diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..bca64ed74e3 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,71 @@ +# Auto detect text files and perform CRLF normalization +* text=auto eol=crlf + +# Standard to msysgit +*.doc diff=astextplain +*.DOC diff=astextplain +*.docx diff=astextplain +*.DOCX diff=astextplain +*.dot diff=astextplain +*.DOT diff=astextplain +*.pdf diff=astextplain +*.PDF diff=astextplain +*.rtf diff=astextplain +*.RTF diff=astextplain + +*.exe -text -diff +*.jpg -text -diff +*.png -text -diff +*.gif -text -diff +*.dll -text -diff +*.pdb -text -diff +*.pptx -text -diff +*.xap -text -diff +*.ico -text -diff + +*.cs text diff=csharp +*.config text diff=csharp +*.xml text diff=csharp +*.vb text +*.c text +*.cpp text +*.cxx text +*.h text +*.hxx text +*.py text +*.rb text +*.java text +*.html text +*.htm text +*.css text +*.scss text +*.sass text +*.less text +*.js text +*.lisp text +*.clj text +*.sql text +*.php text +*.lua text +*.m text +*.asm text +*.erl text +*.fs text +*.fsx text +*.hs text + +*.psm1 text +*.ps1 text +*.txt text eol=crlf +*.bat text eol=crlf + +# Custom for Visual Studio +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union +*.sln text eol=crlf merge=union +*.suo -text -diff +*.snk -text -diff +*.cub -text -diff +*.wixlib -text -diff diff --git a/.gitignore b/.gitignore index 287935058d1..624f15a3653 100644 --- a/.gitignore +++ b/.gitignore @@ -1,27 +1,31 @@ -build -binaries -obj -bin -.nu -_ReSharper.* -_UpgradeReport.* -*.csproj.user -*.resharper.user -*.resharper -*.suo -*.cache -*~ -*.swp -*.user -TestResult.xml -results -CommonAssemblyInfo.cs -lib/sqlite/System.Data.SQLite.dll -*.orig -Samples/DataBus/storage -packages -PrecompiledWeb -core-only -Release -Artifacts -csx +build +build32 +binaries +obj +bin +.nu +_ReSharper.* +_UpgradeReport.* +*.csproj.user +*.resharper.user +*.resharper +*.suo +*.cache +*~ +*.swp +*.user +TestResult.xml +results +CommonAssemblyInfo.cs +lib/sqlite/System.Data.SQLite.dll +*.orig +Samples/DataBus/storage +packages +PrecompiledWeb +core-only +Release +Artifacts +LogFiles +csx +*.ncrunchproject +_NCrunch_NServiceBus/* diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Customization/Conventions.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Customization/Conventions.cs new file mode 100644 index 00000000000..8ff63e4da62 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Customization/Conventions.cs @@ -0,0 +1,22 @@ +namespace NServiceBus.AcceptanceTesting.Customization +{ + using System; + using Support; + + public class Conventions + { + static Conventions() + { + EndpointNamingConvention = (t) => t.Name; + } + + public static Func DefaultRunDescriptor = () => new RunDescriptor {Key = "Default"}; + + public static Func EndpointNamingConvention { get; set; } + + public static string DefaultNameFor() + { + return EndpointNamingConvention(typeof(T)); + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/EndpointConfigurationBuilder.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/EndpointConfigurationBuilder.cs new file mode 100644 index 00000000000..982a5237e77 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/EndpointConfigurationBuilder.cs @@ -0,0 +1,143 @@ +namespace NServiceBus.AcceptanceTesting +{ + using System; + using System.Collections.Generic; + using System.Threading; + using Support; + + public class EndpointConfigurationBuilder : IEndpointConfigurationFactory + { + public EndpointConfigurationBuilder() + { + configuration.EndpointMappings = new Dictionary(); + } + + + public EndpointConfigurationBuilder AuditTo() + { + configuration.AuditEndpoint = typeof(T); + + return this; + } + public EndpointConfigurationBuilder AuditTo(Address addressOfAuditQueue) + { + configuration.AddressOfAuditQueue = addressOfAuditQueue; + + return this; + } + + public EndpointConfigurationBuilder CustomMachineName(string customMachineName) + { + configuration.CustomMachineName = customMachineName; + + return this; + } + + public EndpointConfigurationBuilder CustomEndpointName(string customEndpointName) + { + configuration.CustomEndpointName = customEndpointName; + + return this; + } + + + public EndpointConfigurationBuilder AppConfig(string path) + { + configuration.AppConfigPath = path; + + return this; + } + + + public EndpointConfigurationBuilder AddMapping(Type endpoint) + { + this.configuration.EndpointMappings.Add(typeof(T),endpoint); + + return this; + } + + EndpointConfiguration CreateScenario() + { + configuration.BuilderType = GetType(); + + return this.configuration; + } + + public EndpointConfigurationBuilder EndpointSetup() where T : IEndpointSetupTemplate + { + return EndpointSetup(c => { }); + } + + public EndpointConfigurationBuilder EndpointSetup(Action configCustomization) where T: IEndpointSetupTemplate + { + configuration.GetConfiguration = (settings,routingTable) => + { + var config = ((IEndpointSetupTemplate)Activator.CreateInstance()).GetConfiguration(settings, configuration, new ScenarioConfigSource(configuration, routingTable)); + + configCustomization(config); + + return config; + }; + + return this; + } + + EndpointConfiguration IEndpointConfigurationFactory.Get() + { + return CreateScenario(); + } + + public class SubscriptionsSpy : IAuthorizeSubscriptions + { + private readonly ManualResetEvent manualResetEvent = new ManualResetEvent(false); + private int subscriptionsReceived; + + public int NumberOfSubscriptionsToWaitFor { get; set; } + + public bool AuthorizeSubscribe(string messageType, string clientEndpoint, + IDictionary headers) + { + if (Interlocked.Increment(ref subscriptionsReceived) >= NumberOfSubscriptionsToWaitFor) + { + manualResetEvent.Set(); + } + + return true; + } + + public bool AuthorizeUnsubscribe(string messageType, string clientEndpoint, + IDictionary headers) + { + return true; + } + + public void Wait() + { + if(!manualResetEvent.WaitOne(TimeSpan.FromSeconds(20))) + throw new Exception("No subscription message was received"); + + } + } + + + readonly EndpointConfiguration configuration = new EndpointConfiguration(); + + public EndpointConfigurationBuilder WithConfig(Action action) + { + var config = Activator.CreateInstance(); + + action(config); + + configuration.UserDefinedConfigSections[typeof (T)] = config; + + return this; + } + + public EndpointConfigurationBuilder ExcludeType() + { + configuration.TypesToExclude.Add(typeof(T)); + + return this; + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/NServiceBus.AcceptanceTesting.csproj b/AcceptanceTests/NServiceBus.AcceptanceTesting/NServiceBus.AcceptanceTesting.csproj new file mode 100644 index 00000000000..f4d508a1f39 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/NServiceBus.AcceptanceTesting.csproj @@ -0,0 +1,78 @@ + + + + + Debug + AnyCPU + {758357F6-CD31-4337-80C4-BA377FC257AF} + Library + Properties + NServiceBus.AcceptanceTesting + NServiceBus.AcceptanceTesting + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\binaries\NServiceBus.dll + + + ..\..\binaries\NServiceBus.Core.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Properties/AssemblyInfo.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..ab1fc50959d --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("NServiceBus.IntegrationTests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("NServiceBus.IntegrationTests")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f7248400-c4a5-4c8a-9023-600c359d8b8b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Scenario.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Scenario.cs new file mode 100644 index 00000000000..4722329cc1d --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Scenario.cs @@ -0,0 +1,162 @@ +namespace NServiceBus.AcceptanceTesting +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using System.Linq; + using Customization; + using Support; + + public class Scenario + { + public static IScenarioWithEndpointBehavior Define() + { + return Define(); + } + + public static IScenarioWithEndpointBehavior Define() where T : ScenarioContext + { + return new ScenarioWithContext(Activator.CreateInstance); + } + + public static IScenarioWithEndpointBehavior Define(T context) where T : ScenarioContext + { + return new ScenarioWithContext(()=>context); + } + + public static IScenarioWithEndpointBehavior Define(Func contextFactory) where T : ScenarioContext + { + return new ScenarioWithContext(contextFactory); + } + + } + + public class ScenarioWithContext : IScenarioWithEndpointBehavior, IAdvancedScenarioWithEndpointBehavior where TContext : ScenarioContext + { + public ScenarioWithContext(Func factory) + { + contextFactory = factory; + } + + public IScenarioWithEndpointBehavior WithEndpoint() where T : EndpointConfigurationBuilder + { + return WithEndpoint(b => { }); + } + + public IScenarioWithEndpointBehavior WithEndpoint(Action> defineBehaviour) where T : EndpointConfigurationBuilder + { + + var builder = new EndpointBehaviorBuilder(typeof (T)); + + defineBehaviour(builder); + + behaviours.Add(builder.Build()); + + return this; + } + + public IScenarioWithEndpointBehavior Done(Func func) + { + done = (c) => func((TContext)c); + + return this; + } + + public IEnumerable Run(TimeSpan? testExecutionTimeout = null) + { + var builder = new RunDescriptorsBuilder(); + + runDescriptorsBuilderAction(builder); + + var runDescriptors = builder.Build(); + + if (!runDescriptors.Any()) + { + Console.Out.WriteLine("No active rundescriptors was found for this test, test will not be executed"); + return new List(); + } + + foreach (var runDescriptor in runDescriptors) + { + runDescriptor.ScenarioContext = contextFactory(); + runDescriptor.TestExecutionTimeout = testExecutionTimeout ?? TimeSpan.FromSeconds(90); + } + + var sw = new Stopwatch(); + + sw.Start(); + ScenarioRunner.Run(runDescriptors, this.behaviours, shoulds, this.done, limitTestParallelismTo, reports); + + sw.Stop(); + + Console.Out.WriteLine("Total time for testrun: {0}", sw.Elapsed); + + return runDescriptors.Select(r => (TContext)r.ScenarioContext); + } + + public IAdvancedScenarioWithEndpointBehavior Repeat(Action action) + { + runDescriptorsBuilderAction = action; + + return this; + } + + public IAdvancedScenarioWithEndpointBehavior MaxTestParallelism(int maxParallelism) + { + limitTestParallelismTo = maxParallelism; + + return this; + } + + + TContext IScenarioWithEndpointBehavior.Run(TimeSpan? testExecutionTimeout) + { + return Run(testExecutionTimeout).Single(); + } + + public IAdvancedScenarioWithEndpointBehavior Should(Action should) + { + shoulds.Add(new ScenarioVerification + { + ContextType = typeof(TContext), + Should = should + }); + + return this; + } + + + public IAdvancedScenarioWithEndpointBehavior Report(Action reportActions) + { + reports = reportActions; + return this; + } + + + int limitTestParallelismTo; + readonly IList behaviours = new List(); + Action runDescriptorsBuilderAction = builder => builder.For(Conventions.DefaultRunDescriptor()); + IList shoulds = new List(); + public Func done = context => true; + + Func contextFactory = () => Activator.CreateInstance(); + Action reports; + } + + public class ScenarioVerification : IScenarioVerification where T : ScenarioContext + { + public Action Should { get; set; } + public Type ContextType { get; set; } + + public void Verify(ScenarioContext context) + { + Should(((T)context)); + } + } + + public interface IScenarioVerification + { + Type ContextType { get; set; } + void Verify(ScenarioContext context); + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/ScenarioContext.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/ScenarioContext.cs new file mode 100644 index 00000000000..68a8bdcdad5 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/ScenarioContext.cs @@ -0,0 +1,65 @@ +namespace NServiceBus.AcceptanceTesting +{ + using System; + using System.Runtime.Remoting.Activation; + using System.Runtime.Remoting.Contexts; + using System.Runtime.Remoting.Messaging; + + [Intercept] + [Serializable] + public abstract class ScenarioContext : ContextBoundObject + { + public event EventHandler ContextPropertyChanged; + + [AttributeUsage(AttributeTargets.Class)] + sealed class InterceptAttribute : ContextAttribute, IContributeObjectSink + { + public InterceptAttribute() + : base("InterceptProperty") + { + } + + public override void GetPropertiesForNewContext(IConstructionCallMessage message) + { + message.ContextProperties.Add(this); + } + + public IMessageSink GetObjectSink(MarshalByRefObject obj, IMessageSink nextSink) + { + return new InterceptSink { Target = (ScenarioContext)obj, NextSink = nextSink }; + } + } + + class InterceptSink : IMessageSink + { + public IMessageSink NextSink { get; set; } + + public ScenarioContext Target; + + public IMessageCtrl AsyncProcessMessage(IMessage msg, IMessageSink sink) + { + throw new NotSupportedException("AsyncProcessMessage is not supported."); + } + + public IMessage SyncProcessMessage(IMessage msg) + { + var call = msg as IMethodCallMessage; + if (call != null) + { + var method = call.MethodName; + + + if (Target.ContextPropertyChanged != null && method.StartsWith("set")) + { + Target.ContextPropertyChanged(Target, EventArgs.Empty); + } + } + + return NextSink.SyncProcessMessage(msg); + } + } + + public bool EndpointsStarted { get; set; } + + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ActiveRunner.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ActiveRunner.cs new file mode 100644 index 00000000000..9e24fc72104 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ActiveRunner.cs @@ -0,0 +1,11 @@ +namespace NServiceBus.AcceptanceTesting.Support +{ + using System; + + class ActiveRunner + { + public EndpointRunner Instance { get; set; } + public AppDomain AppDomain { get; set; } + public string EndpointName { get; set; } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/BehaviourFactory.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/BehaviourFactory.cs new file mode 100644 index 00000000000..79866d51bb1 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/BehaviourFactory.cs @@ -0,0 +1,7 @@ +namespace NServiceBus.AcceptanceTesting.Support +{ + public interface IEndpointConfigurationFactory + { + EndpointConfiguration Get(); + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/DefaultScenarioDescriptor.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/DefaultScenarioDescriptor.cs new file mode 100644 index 00000000000..837b4e7a306 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/DefaultScenarioDescriptor.cs @@ -0,0 +1,10 @@ +namespace NServiceBus.AcceptanceTesting.Support +{ + public class DefaultScenarioDescriptor : ScenarioDescriptor + { + public DefaultScenarioDescriptor() + { + this.Add(new RunDescriptor { Key = "Default Scenario" }); + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/EndpointBehaviorBuilder.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/EndpointBehaviorBuilder.cs new file mode 100644 index 00000000000..feca6896922 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/EndpointBehaviorBuilder.cs @@ -0,0 +1,69 @@ +namespace NServiceBus.AcceptanceTesting.Support +{ + using System; + using System.Collections.Generic; + + public class EndpointBehaviorBuilder where TContext:ScenarioContext + { + + public EndpointBehaviorBuilder(Type type) + { + behaviour = new EndpointBehaviour(type) + { + Givens = new List(), + Whens = new List() + }; + } + + + public EndpointBehaviorBuilder Given(Action action) + { + behaviour.Givens.Add(new GivenDefinition(action)); + + return this; + } + + + public EndpointBehaviorBuilder Given(Action action) + { + behaviour.Givens.Add(new GivenDefinition(action)); + + return this; + } + + public EndpointBehaviorBuilder When(Action action) + { + return When(c => true, action); + } + + public EndpointBehaviorBuilder When(Predicate condition, Action action) + { + behaviour.Whens.Add(new WhenDefinition(condition,action)); + + return this; + } + + public EndpointBehaviorBuilder When(Predicate condition, Action action) + { + behaviour.Whens.Add(new WhenDefinition(condition,action)); + + return this; + } + + public EndpointBehaviorBuilder CustomConfig(Action action) + { + behaviour.CustomConfig.Add(action); + + return this; + } + + public EndpointBehaviour Build() + { + return behaviour; + } + + readonly EndpointBehaviour behaviour; + + + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/EndpointBehaviour.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/EndpointBehaviour.cs new file mode 100644 index 00000000000..2a945148eb5 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/EndpointBehaviour.cs @@ -0,0 +1,122 @@ +namespace NServiceBus.AcceptanceTesting.Support +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Diagnostics; + using System.Text; + using System.Threading; + using Customization; + + [Serializable] + public class EndpointBehaviour : MarshalByRefObject + { + public EndpointBehaviour(Type builderType) + { + EndpointBuilderType = builderType; + EndpointName = Conventions.EndpointNamingConvention(builderType); + CustomConfig = new List>(); + } + + public string EndpointName { get; private set; } + + public Type EndpointBuilderType { get; private set; } + + + + public List Givens { get; set; } + public List Whens { get; set; } + + public List> CustomConfig { get; set; } + } + + + [Serializable] + public class GivenDefinition : IGivenDefinition where TContext : ScenarioContext + { + public GivenDefinition(Action action) + { + givenAction2 = action; + } + + public GivenDefinition(Action action) + { + givenAction = action; + } + + public Action GetAction(ScenarioContext context) + { + if (givenAction2 != null) + return bus => givenAction2(bus); + + return bus => givenAction(bus, (TContext)context); + } + + readonly Action givenAction; + readonly Action givenAction2; + + } + + [Serializable] + public class WhenDefinition : IWhenDefinition where TContext : ScenarioContext + { + public WhenDefinition(Predicate condition, Action action) + { + id = Guid.NewGuid(); + this.condition = condition; + busAction = action; + } + + public WhenDefinition(Predicate condition, Action actionWithContext) + { + id = Guid.NewGuid(); + this.condition = condition; + busAndContextAction = actionWithContext; + } + + public Guid Id { get { return id; } } + + public bool ExecuteAction(ScenarioContext context, IBus bus) + { + var c = context as TContext; + + if (!condition(c)) + { + return false; + } + + + if (busAction != null) + { + busAction(bus); + } + else + { + busAndContextAction(bus, c); + + } + + Debug.WriteLine("Condition {0} has fired - Thread: {1} AppDomain: {2}", id, Thread.CurrentThread.ManagedThreadId,AppDomain.CurrentDomain.FriendlyName); + + return true; + } + + readonly Predicate condition; + readonly Action busAction; + readonly Action busAndContextAction; + Guid id; + } + + public interface IGivenDefinition + { + Action GetAction(ScenarioContext context); + } + + + public interface IWhenDefinition + { + bool ExecuteAction(ScenarioContext context, IBus bus); + + Guid Id { get; } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/EndpointConfiguration.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/EndpointConfiguration.cs new file mode 100644 index 00000000000..b5ec9483f30 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/EndpointConfiguration.cs @@ -0,0 +1,47 @@ +namespace NServiceBus.AcceptanceTesting.Support +{ + using System; + using System.Collections.Generic; + + public class EndpointConfiguration + { + public EndpointConfiguration() + { + UserDefinedConfigSections = new Dictionary(); + TypesToExclude = new List(); + } + + public IDictionary EndpointMappings { get; set; } + + public IList TypesToExclude { get; set; } + + public Func, Configure> GetConfiguration { get; set; } + + public string EndpointName + { + get + { + if (!string.IsNullOrEmpty(CustomEndpointName)) + return CustomEndpointName; + return endpointName; + } + set { endpointName = value; } + } + + public Type BuilderType { get; set; } + + public string AppConfigPath { get; set; } + + public Address AddressOfAuditQueue { get; set; } + + public IDictionary UserDefinedConfigSections { get; private set; } + + public string CustomMachineName { get; set; } + + public string CustomEndpointName { get; set; } + + public Type AuditEndpoint { get; set; } + + string endpointName; + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/EndpointRunner.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/EndpointRunner.cs new file mode 100644 index 00000000000..ca935e208d0 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/EndpointRunner.cs @@ -0,0 +1,186 @@ +namespace NServiceBus.AcceptanceTesting.Support +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using System.Runtime.Remoting.Lifetime; + using System.Threading; + using System.Threading.Tasks; + using Installation.Environments; + using Logging; + + [Serializable] + public class EndpointRunner : MarshalByRefObject + { + IStartableBus bus; + Configure config; + + EndpointConfiguration configuration; + ScenarioContext scenarioContext; + EndpointBehaviour behaviour; + Semaphore contextChanged = new Semaphore(0, int.MaxValue); + bool stopped = false; + + public Result Initialize(RunDescriptor run, EndpointBehaviour endpointBehaviour, IDictionary routingTable, string endpointName) + { + try + { + behaviour = endpointBehaviour; + scenarioContext = run.ScenarioContext; + configuration = ((IEndpointConfigurationFactory)Activator.CreateInstance(endpointBehaviour.EndpointBuilderType)).Get(); + configuration.EndpointName = endpointName; + + if (!string.IsNullOrEmpty(configuration.CustomMachineName)) + { + NServiceBus.Support.RuntimeEnvironment.MachineNameAction = () => configuration.CustomMachineName; + } + + //apply custom config settings + endpointBehaviour.CustomConfig.ForEach(customAction => customAction(config)); + config = configuration.GetConfiguration(run, routingTable); + + + + if (scenarioContext != null) + { + config.Configurer.RegisterSingleton(scenarioContext.GetType(), scenarioContext); + scenarioContext.ContextPropertyChanged += scenarioContext_ContextPropertyChanged; + } + + + bus = config.CreateBus(); + + Configure.Instance.ForInstallationOn().Install(); + + Task.Factory.StartNew(() => + { + while (!stopped) + { + contextChanged.WaitOne(TimeSpan.FromSeconds(5)); //we spin around each 5 s since the callback mechanism seems to be shaky + + lock (behaviour) + { + + foreach (var when in behaviour.Whens) + { + if (executedWhens.Contains(when.Id)) + continue; + + if(when.ExecuteAction(scenarioContext, bus)) + executedWhens.Add(when.Id); + } + } + } + }); + + return Result.Success(); + } + catch (Exception ex) + { + Logger.Error("Failed to initalize endpoint " + endpointName, ex); + return Result.Failure(ex); + } + } + IList executedWhens = new List(); + + void scenarioContext_ContextPropertyChanged(object sender, EventArgs e) + { + contextChanged.Release(); + } + + + public Result Start() + { + try + { + foreach (var given in behaviour.Givens) + { + var action = given.GetAction(scenarioContext); + + action(bus); + } + + bus.Start(); + + + return Result.Success(); + } + catch (Exception ex) + { + Logger.Error("Failed to start endpoint " + configuration.EndpointName, ex); + + return Result.Failure(ex); + } + } + + public Result Stop() + { + try + { + stopped = true; + + scenarioContext.ContextPropertyChanged -= scenarioContext_ContextPropertyChanged; + + bus.Dispose(); + + + + return Result.Success(); + } + catch (Exception ex) + { + Logger.Error("Failed to stop endpoint " + configuration.EndpointName, ex); + + return Result.Failure(ex); + } + } + + public override object InitializeLifetimeService() + { + ILease lease = (ILease)base.InitializeLifetimeService(); + if (lease.CurrentState == LeaseState.Initial) + { + lease.InitialLeaseTime = TimeSpan.FromMinutes(2); + lease.SponsorshipTimeout = TimeSpan.FromMinutes(2); + lease.RenewOnCallTime = TimeSpan.FromSeconds(2); + } + return lease; + } + + public string Name() + { + return AppDomain.CurrentDomain.FriendlyName; + } + static readonly ILog Logger = LogManager.GetLogger(typeof(EndpointRunner)); + + [Serializable] + public class Result : MarshalByRefObject + { + public string ExceptionMessage { get; set; } + + public bool Failed + { + get { return ExceptionMessage != null; } + + } + + public static Result Success() + { + return new Result(); + } + + public static Result Failure(Exception ex) + { + return new Result + { + ExceptionMessage = ex.ToString(), + ExceptionType = ex.GetType() + }; + } + + public Type ExceptionType { get; set; } + } + } + + +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/IEndpointSetupTemplate.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/IEndpointSetupTemplate.cs new file mode 100644 index 00000000000..99aabfcfd6f --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/IEndpointSetupTemplate.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.AcceptanceTesting.Support +{ + using NServiceBus.Config.ConfigurationSource; + + public interface IEndpointSetupTemplate + { + Configure GetConfiguration(RunDescriptor runDescriptor, EndpointConfiguration endpointConfiguration, IConfigurationSource configSource); + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/IScenarioWithEndpointBehavior.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/IScenarioWithEndpointBehavior.cs new file mode 100644 index 00000000000..4250417e29c --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/IScenarioWithEndpointBehavior.cs @@ -0,0 +1,31 @@ +namespace NServiceBus.AcceptanceTesting.Support +{ + using System; + using System.Collections.Generic; + + public interface IScenarioWithEndpointBehavior where TContext : ScenarioContext + { + IScenarioWithEndpointBehavior WithEndpoint() where T : EndpointConfigurationBuilder; + + IScenarioWithEndpointBehavior WithEndpoint(Action> behaviour) where T : EndpointConfigurationBuilder; + + IScenarioWithEndpointBehavior Done(Func func); + + TContext Run(TimeSpan? testExecutionTimeout = null); + + IAdvancedScenarioWithEndpointBehavior Repeat(Action runtimeDescriptor); + + } + + public interface IAdvancedScenarioWithEndpointBehavior where TContext : ScenarioContext + { + IAdvancedScenarioWithEndpointBehavior Should(Action should); + + IAdvancedScenarioWithEndpointBehavior Report(Action summaries); + + + IAdvancedScenarioWithEndpointBehavior MaxTestParallelism(int maxParallelism); + + IEnumerable Run(TimeSpan? testExecutionTimeout = null); + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/RunDescriptor.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/RunDescriptor.cs new file mode 100644 index 00000000000..552833bb4e7 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/RunDescriptor.cs @@ -0,0 +1,60 @@ +namespace NServiceBus.AcceptanceTesting.Support +{ + using System; + using System.Collections.Generic; + using System.Linq; + + [Serializable] + public class RunDescriptor : MarshalByRefObject + { + protected bool Equals(RunDescriptor other) + { + return string.Equals(Key, other.Key); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != this.GetType()) return false; + return Equals((RunDescriptor) obj); + } + + public override int GetHashCode() + { + return (Key != null ? Key.GetHashCode() : 0); + } + + public RunDescriptor() + { + Settings = new Dictionary(); + } + + public RunDescriptor(RunDescriptor template) + { + Settings = template.Settings.ToDictionary(entry => entry.Key, + entry => entry.Value); + Key = template.Key; + } + + public string Key { get; set; } + + public IDictionary Settings { get; set; } + + public ScenarioContext ScenarioContext { get; set; } + + public TimeSpan TestExecutionTimeout { get; set; } + + public int Permutation { get; set; } + + public void Merge(RunDescriptor descriptorToAdd) + { + Key += "." + descriptorToAdd.Key; + + foreach (var setting in descriptorToAdd.Settings) + { + Settings[setting.Key] = setting.Value; + } + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/RunDescriptorsBuilder.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/RunDescriptorsBuilder.cs new file mode 100644 index 00000000000..16d77365c09 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/RunDescriptorsBuilder.cs @@ -0,0 +1,99 @@ +namespace NServiceBus.AcceptanceTesting.Support +{ + using System; + using System.Collections.Generic; + using System.Linq; + + public class RunDescriptorsBuilder + { + IList descriptors = new List(); + + readonly List excludes = new List(); + public RunDescriptorsBuilder For(params RunDescriptor[] runDescriptorsToExclude) where T : ScenarioDescriptor + { + excludes.AddRange(runDescriptorsToExclude + .Where(r=>r != null) + .Select(r =>r.Key.ToLowerInvariant()).ToArray()); + + var sd = Activator.CreateInstance() as ScenarioDescriptor; + + return For(sd.ToArray()); + } + + public RunDescriptorsBuilder For(params RunDescriptor[] descriptorsToAdd) + { + var toAdd = descriptorsToAdd.Where(r => r != null).ToList(); + + if (!toAdd.Any()) + { + emptyPermutationFound = true; + } + + if (!descriptors.Any()) + { + descriptors = toAdd; + return this; + } + + + var result = new List(); + + foreach (var existingDescriptor in descriptors) + { + foreach (var descriptorToAdd in toAdd) + { + var nd = new RunDescriptor(existingDescriptor); + nd.Merge(descriptorToAdd); + result.Add(nd); + } + } + + + descriptors = result; + + return this; + } + + public IList Build() + { + //if we have found a empty permutation this means that we shouldn't run any permutations. This happens when a test is specified to run for a given key + // but that key is not avaiable. Eg running tests for sql server but the sql transport isn't available + if (emptyPermutationFound) + { + return new List(); + } + + var environmentExcludes = GetEnvironmentExcludes(); + + var activeDescriptors = descriptors.Where(d => + !excludes.Any(e => d.Key.ToLower().Contains(e)) && + !environmentExcludes.Any(e => d.Key.ToLower().Contains(e)) + ).ToList(); + + int permutation = 1; + foreach (var run in activeDescriptors) + { + run.Permutation = permutation; + + permutation++; + + } + + return activeDescriptors; + } + + static IList GetEnvironmentExcludes() + { + var env = Environment.GetEnvironmentVariable("nservicebus_test_exclude_scenarios"); + if (string.IsNullOrEmpty(env)) + return new List(); + + Console.Out.WriteLine("Scenarios excluded for this environment: " + env); + return env.ToLower().Split(';'); + } + + bool emptyPermutationFound; + + + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ScenarioConfigSource.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ScenarioConfigSource.cs new file mode 100644 index 00000000000..7c91a758628 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ScenarioConfigSource.cs @@ -0,0 +1,85 @@ +namespace NServiceBus.AcceptanceTesting.Support +{ + using System; + using System.Collections.Generic; + using System.Configuration; + using NServiceBus.Config; + using NServiceBus.Config.ConfigurationSource; + + public class ScenarioConfigSource : IConfigurationSource + { + readonly EndpointConfiguration configuration; + readonly IDictionary routingTable; + + public ScenarioConfigSource(EndpointConfiguration configuration, IDictionary routingTable) + { + this.configuration = configuration; + this.routingTable = routingTable; + } + + public T GetConfiguration() where T : class, new() + { + var type = typeof (T); + + if (configuration.UserDefinedConfigSections.ContainsKey(type)) + return configuration.UserDefinedConfigSections[type] as T; + + + if (type == typeof (MessageForwardingInCaseOfFaultConfig)) + return new MessageForwardingInCaseOfFaultConfig + { + ErrorQueue = "error" + } as T; + + if (type == typeof (UnicastBusConfig)) + { + var auditAddress = configuration.AddressOfAuditQueue != null + ? configuration.AddressOfAuditQueue.ToString() + : null; + + if (configuration.AuditEndpoint != null) + { + auditAddress = routingTable[configuration.AuditEndpoint]; + } + + return new UnicastBusConfig + { + ForwardReceivedMessagesTo = auditAddress, + MessageEndpointMappings = GenerateMappings() + } as T; + + } + + + + if (type == typeof(Logging)) + return new Logging() + { + Threshold = "WARN" + } as T; + + + return ConfigurationManager.GetSection(type.Name) as T; + } + + MessageEndpointMappingCollection GenerateMappings() + { + var mappings = new MessageEndpointMappingCollection(); + + foreach (var templateMapping in configuration.EndpointMappings) + { + var messageType = templateMapping.Key; + var endpoint = templateMapping.Value; + + mappings.Add( new MessageEndpointMapping + { + AssemblyName = messageType.Assembly.FullName, + TypeFullName = messageType.FullName, + Endpoint = routingTable[endpoint] + }); + } + + return mappings; + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ScenarioDescriptor.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ScenarioDescriptor.cs new file mode 100644 index 00000000000..5c30af05be4 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ScenarioDescriptor.cs @@ -0,0 +1,8 @@ +namespace NServiceBus.AcceptanceTesting.Support +{ + using System.Collections.Generic; + + public abstract class ScenarioDescriptor : List + { + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ScenarioException.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ScenarioException.cs new file mode 100644 index 00000000000..b9693b08229 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ScenarioException.cs @@ -0,0 +1,27 @@ +namespace NServiceBus.AcceptanceTesting.Support +{ + using System; + using System.Runtime.Serialization; + + public class ScenarioException : Exception + { + public ScenarioException() + { + } + + public ScenarioException(string message) + : base(message) + { + } + + public ScenarioException(string message, Exception innerException) + : base(message, innerException) + { + } + + protected ScenarioException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ScenarioRunner.cs b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ScenarioRunner.cs new file mode 100644 index 00000000000..f13f37c0a56 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTesting/Support/ScenarioRunner.cs @@ -0,0 +1,397 @@ +using System.Runtime.Remoting; +using System.Runtime.Remoting.Lifetime; + +namespace NServiceBus.AcceptanceTesting.Support +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Diagnostics; + using System.Linq; + using System.Reflection; + using System.Text; + using System.Threading; + using System.Threading.Tasks; + using Customization; + + public class ScenarioRunner + { + public static IEnumerable Run(IList runDescriptors, IList behaviorDescriptors, IList shoulds, Func done, int limitTestParallelismTo, Action reports) + { + var totalRuns = runDescriptors.Count(); + + var cts = new CancellationTokenSource(); + + var po = new ParallelOptions + { + CancellationToken = cts.Token + }; + + var maxParallelismSetting = Environment.GetEnvironmentVariable("max_test_parallelism"); + int maxParallelism; + if (int.TryParse(maxParallelismSetting, out maxParallelism)) + { + Console.Out.WriteLine("Parallelism limited to: {0}",maxParallelism); + + po.MaxDegreeOfParallelism = maxParallelism; + } + + if (limitTestParallelismTo > 0) + po.MaxDegreeOfParallelism = limitTestParallelismTo; + + var results = new ConcurrentBag(); + + try + { + Parallel.ForEach(runDescriptors, po, runDescriptor => + { + if (po.CancellationToken.IsCancellationRequested) + { + return; + } + + Console.Out.WriteLine("{0} - Started @ {1}", runDescriptor.Key, DateTime.Now.ToString()); + + var runResult = PerformTestRun(behaviorDescriptors, shoulds, runDescriptor, done); + + Console.Out.WriteLine("{0} - Finished @ {1}", runDescriptor.Key, DateTime.Now.ToString()); + + results.Add(new RunSummary + { + Result = runResult, + RunDescriptor = runDescriptor, + Endpoints = behaviorDescriptors + }); + + + if (runResult.Failed) + { + cts.Cancel(); + } + }); + } + catch (OperationCanceledException) + { + Console.Out.WriteLine("Test run aborted due to test failures"); + } + + var failedRuns = results.Where(s => s.Result.Failed).ToList(); + + foreach (var runSummary in failedRuns) + { + DisplayRunResult(runSummary, totalRuns); + } + + if (failedRuns.Any()) + throw new AggregateException("Test run failed due to one or more exception", failedRuns.Select(f => f.Result.Exception)); + + + foreach (var runSummary in results.Where(s => !s.Result.Failed)) + { + DisplayRunResult(runSummary, totalRuns); + + if (reports != null) + reports(runSummary); + } + + return results; + } + + + static void DisplayRunResult(RunSummary summary, int totalRuns) + { + var runDescriptor = summary.RunDescriptor; + var runResult = summary.Result; + + Console.Out.WriteLine("------------------------------------------------------"); + Console.Out.WriteLine("Test summary for: {0}", runDescriptor.Key); + if (totalRuns > 1) + Console.Out.WriteLine(" - Permutation: {0}({1})", runDescriptor.Permutation, totalRuns); + Console.Out.WriteLine(""); + + + PrintSettings(runDescriptor.Settings); + + Console.WriteLine(""); + Console.WriteLine("Endpoints:"); + + foreach (var endpoint in runResult.ActiveEndpoints) + { + Console.Out.WriteLine(" - {0}", endpoint); + } + + + if (runResult.Failed) + { + Console.Out.WriteLine("Test failed: {0}", runResult.Exception); + + Console.Out.WriteLine("Context:"); + + foreach (var prop in runResult.ScenarioContext.GetType().GetProperties()) + { + Console.Out.WriteLine("{0} = {1}", prop.Name, prop.GetValue(runResult.ScenarioContext,null)); + } + } + else + { + Console.Out.WriteLine("Result: Successful - Duration: {0}", runResult.TotalTime); + Console.Out.WriteLine("------------------------------------------------------"); + + } + } + + static RunResult PerformTestRun(IList behaviorDescriptors, IList shoulds, RunDescriptor runDescriptor, Func done) + { + var runResult = new RunResult + { + ScenarioContext = runDescriptor.ScenarioContext + }; + + var runTimer = new Stopwatch(); + + runTimer.Start(); + + try + { + List runners = InitializeRunners(runDescriptor, behaviorDescriptors); + + try + { + runResult.ActiveEndpoints = runners.Select(r => r.EndpointName).ToList(); + + PerformScenarios(runDescriptor,runners, () => done(runDescriptor.ScenarioContext)); + } + finally + { + UnloadAppDomains(runners); + } + + runTimer.Stop(); + + Parallel.ForEach(runners, runner => shoulds.Where(s => s.ContextType == runDescriptor.ScenarioContext.GetType()).ToList() + .ForEach(v => v.Verify(runDescriptor.ScenarioContext))); + } + catch (Exception ex) + { + runResult.Failed = true; + runResult.Exception = ex; + } + + runResult.TotalTime = runTimer.Elapsed; + + return runResult; + } + + static void UnloadAppDomains(IEnumerable runners) + { + Parallel.ForEach(runners, runner => + { + try + { + AppDomain.Unload(runner.AppDomain); + } + catch (CannotUnloadAppDomainException ex) + { + Console.Out.WriteLine("Failed to unload appdomain {0}, reason: {1}",runner.AppDomain.FriendlyName,ex.ToString()); + } + + }); + } + + static IDictionary CreateRoutingTable(RunDescriptor runDescriptor, IEnumerable behaviorDescriptors) + { + var routingTable = new Dictionary(); + + foreach (var behaviorDescriptor in behaviorDescriptors) + { + routingTable[behaviorDescriptor.EndpointBuilderType] = GetEndpointNameForRun(runDescriptor, behaviorDescriptor); + } + + return routingTable; + } + + private static void PrintSettings(IEnumerable> settings) + { + Console.WriteLine(""); + Console.WriteLine("Using settings:"); + foreach (KeyValuePair pair in settings) + { + Console.Out.WriteLine(" {0}: {1}", pair.Key, pair.Value); + } + Console.WriteLine(); + } + + static void PerformScenarios(RunDescriptor runDescriptor,IEnumerable runners, Func done) + { + var endpoints = runners.Select(r => r.Instance).ToList(); + + StartEndpoints(endpoints); + + runDescriptor.ScenarioContext.EndpointsStarted = true; + + var startTime = DateTime.UtcNow; + var maxTime = runDescriptor.TestExecutionTimeout; + + Task.WaitAll(endpoints.Select(endpoint => Task.Factory.StartNew(() => SpinWait.SpinUntil(done, maxTime))).Cast().ToArray(), maxTime); + + try + { + if ((DateTime.UtcNow - startTime) > maxTime) + { + throw new ScenarioException(GenerateTestTimedOutMessage(endpoints, maxTime)); + } + } + finally + { + StopEndpoints(endpoints); + } + } + + static string GenerateTestTimedOutMessage(List endpoints, TimeSpan maxTime) + { + var sb = new StringBuilder(); + + sb.AppendLine(string.Format("The maximum time limit for this test({0}s) has been reached", + maxTime.TotalSeconds)); + sb.AppendLine("----------------------------------------------------------------------------"); + + return sb.ToString(); + } + + static void StartEndpoints(IEnumerable endpoints) + { + var tasks = endpoints.Select(endpoint => Task.Factory.StartNew(() => + { + var result = endpoint.Start(); + + if (result.Failed) + throw new ScenarioException(string.Format("Endpoint failed to start - {0}", result.ExceptionMessage)); + + })).ToArray(); + + if(!Task.WaitAll(tasks, TimeSpan.FromMinutes(2))) + throw new Exception("Starting endpoints took longer than 2 minutes"); + } + + static void StopEndpoints(IEnumerable endpoints) + { + var tasks = endpoints.Select(endpoint => Task.Factory.StartNew(() => + { + + Console.Out.WriteLine("Stopping endpoint: {0}", endpoint.Name()); + var sw = new Stopwatch(); + sw.Start(); + var result = endpoint.Stop(); + + sw.Stop(); + if (result.Failed) + throw new ScenarioException(string.Format("Endpoint failed to stop - {0}", result.ExceptionMessage)); + + Console.Out.WriteLine("Endpoint: {0} stopped ({1}s)",endpoint.Name(),sw.Elapsed); + + })).ToArray(); + + if(!Task.WaitAll(tasks,TimeSpan.FromMinutes(2))) + throw new Exception("Stopping endpoints took longer than 2 minutes"); + } + + static List InitializeRunners(RunDescriptor runDescriptor, IList behaviorDescriptors) + { + var runners = new List(); + var routingTable = CreateRoutingTable(runDescriptor, behaviorDescriptors); + + foreach (var behaviorDescriptor in behaviorDescriptors) + { + var endpointName = GetEndpointNameForRun(runDescriptor, behaviorDescriptor); + + + + + var runner = PrepareRunner(endpointName, behaviorDescriptor); + var result = runner.Instance.Initialize(runDescriptor, behaviorDescriptor, routingTable, endpointName); + + // Extend the lease to the timeout value specified. + ILease serverLease = (ILease)RemotingServices.GetLifetimeService(runner.Instance); + + // Add the execution time + additional time for the endpoints to be able to stop gracefully + var totalLifeTime = runDescriptor.TestExecutionTimeout.Add(TimeSpan.FromMinutes(2)); + serverLease.Renew(totalLifeTime); + + + if (result.Failed) + throw new ScenarioException(string.Format("Endpoint {0} failed to initialize - {1}", runner.Instance.Name(), result.ExceptionMessage)); + + runners.Add(runner); + } + + return runners; + } + + static string GetEndpointNameForRun(RunDescriptor runDescriptor, EndpointBehaviour endpointBehaviour) + { + var endpointName = Conventions.EndpointNamingConvention(endpointBehaviour.EndpointBuilderType) + "." + + runDescriptor.Key; + return endpointName; + } + + static ActiveRunner PrepareRunner(string endpointName, EndpointBehaviour endpointBehaviour) + { + var domainSetup = new AppDomainSetup + { + ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase, + LoaderOptimization = LoaderOptimization.SingleDomain + }; + + var endpoint = ((IEndpointConfigurationFactory) Activator.CreateInstance(endpointBehaviour.EndpointBuilderType)).Get(); + + if (endpoint.AppConfigPath != null) + domainSetup.ConfigurationFile = endpoint.AppConfigPath; + + var appDomain = AppDomain.CreateDomain(endpointName, AppDomain.CurrentDomain.Evidence, domainSetup); + + + return new ActiveRunner + { + Instance = (EndpointRunner)appDomain.CreateInstanceAndUnwrap(Assembly.GetExecutingAssembly().FullName, typeof(EndpointRunner).FullName), + AppDomain = appDomain, + EndpointName = endpointName + }; + } + } + + public class RunResult + { + public bool Failed { get; set; } + + public Exception Exception { get; set; } + + public TimeSpan TotalTime { get; set; } + + public ScenarioContext ScenarioContext{ get; set; } + + + public IEnumerable ActiveEndpoints + { + get + { + if (activeEndpoints == null) + activeEndpoints = new List(); + + return activeEndpoints; + } + set { activeEndpoints = value.ToList(); } + } + + IList activeEndpoints; + } + + public class RunSummary + { + public RunResult Result { get; set; } + + public RunDescriptor RunDescriptor { get; set; } + + public IEnumerable Endpoints { get; set; } + } + +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Audit/When_a_message_is_audited.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Audit/When_a_message_is_audited.cs new file mode 100644 index 00000000000..a6217c4677c --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Audit/When_a_message_is_audited.cs @@ -0,0 +1,119 @@ +namespace NServiceBus.AcceptanceTests.Audit +{ + using System; + using System.Linq; + using EndpointTemplates; + using AcceptanceTesting; + using MessageMutator; + using NUnit.Framework; + +#pragma warning disable 612, 618 + + public class When_a_message_is_audited : NServiceBusAcceptanceTest + { + [Test] + public void Should_preserve_the_original_body() + { + var context = new Context(); + + Scenario.Define(context) + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new MessageToBeAudited()))) + .WithEndpoint() + .Done(c => c.AuditChecksum != default(byte)) + .Run(); + + Assert.AreEqual(context.OriginalBodyChecksum, context.AuditChecksum, "The body of the message sent to audit should be the same as the original message coming off the queue"); + } + + + public class Context : ScenarioContext + { + public byte OriginalBodyChecksum { get; set; } + + public byte AuditChecksum { get; set; } + } + + public class EndpointWithAuditOn : EndpointConfigurationBuilder + { + public EndpointWithAuditOn() + { + EndpointSetup() + .AuditTo(); + } + + class BodyMutator : IMutateTransportMessages, NServiceBus.INeedInitialization + { + public Context Context { get; set; } + + public void MutateIncoming(TransportMessage transportMessage) + { + + var originalBody = transportMessage.Body; + + Context.OriginalBodyChecksum = Checksum(originalBody); + + var decryptedBody = new byte[originalBody.Length]; + + Buffer.BlockCopy(originalBody,0,decryptedBody,0,originalBody.Length); + + //decrypt + decryptedBody[0]++; + + transportMessage.Body = decryptedBody; + } + + + public void MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + //not the way to do it for real but good enough for this test + transportMessage.Body[0]--; + } + + public void Init() + { + Configure.Component(DependencyLifecycle.InstancePerCall); + } + } + + + class MessageToBeAuditedHandler : IHandleMessages{ public void Handle(MessageToBeAudited message) {}} + } + + class AuditSpyEndpoint : EndpointConfigurationBuilder + { + public AuditSpyEndpoint() + { + EndpointSetup(); + } + + class BodySpy : IMutateIncomingTransportMessages, NServiceBus.INeedInitialization + { + public Context Context { get; set; } + + public void MutateIncoming(TransportMessage transportMessage) + { + Context.AuditChecksum = Checksum(transportMessage.Body); + } + + public void Init() + { + Configure.Component(DependencyLifecycle.InstancePerCall); + } + } + } + + public static byte Checksum(byte[] data) + { + long longSum = data.Sum(x => (long)x); + return unchecked((byte)longSum); + } + + [Serializable] + public class MessageToBeAudited : IMessage + { + } + } + +#pragma warning restore 612, 618 + +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/BasicMessaging/When_registering_a_callback_for_a_local_message.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/BasicMessaging/When_registering_a_callback_for_a_local_message.cs new file mode 100644 index 00000000000..38c932f8d00 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/BasicMessaging/When_registering_a_callback_for_a_local_message.cs @@ -0,0 +1,61 @@ +namespace NServiceBus.AcceptanceTests.BasicMessaging +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using ScenarioDescriptors; + + + [TestFixture] + public class When_registering_a_callback_for_a_local_message : NServiceBusAcceptanceTest + { + [Test] + public void Should_trigger_the_callback_when_the_response_comes_back() + { + Scenario.Define() + .WithEndpoint(b=>b.Given( + (bus,context)=>bus.SendLocal(new MyRequest()).Register(r => context.CallbackFired = DateTime.UtcNow))) + .Done(c => c.HandlerGotTheRequest.HasValue) + .Repeat(r =>r.For(Transports.Default)) + .Should(c => + { + Assert.Greater(c.CallbackFired,c.HandlerGotTheRequest,"The callback should fire when the response comes in"); + }) + .Run(); + } + + public class Context : ScenarioContext + { + public DateTime? HandlerGotTheRequest { get; set; } + + + public DateTime CallbackFired { get; set; } + } + + public class EndpointWithLocalCallback : EndpointConfigurationBuilder + { + public EndpointWithLocalCallback() + { + EndpointSetup(); + } + + public class MyRequestHandler : IHandleMessages + { + public Context Context { get; set; } + + public IBus Bus { get; set; } + + public void Handle(MyRequest request) + { + Context.HandlerGotTheRequest = DateTime.UtcNow; + + Bus.Return(1); + } + } + } + + [Serializable] + public class MyRequest : IMessage{} + } +} diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/BasicMessaging/When_sending_a_message_to_another_endpoint.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/BasicMessaging/When_sending_a_message_to_another_endpoint.cs new file mode 100644 index 00000000000..6e6ff331f87 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/BasicMessaging/When_sending_a_message_to_another_endpoint.cs @@ -0,0 +1,90 @@ +namespace NServiceBus.AcceptanceTests.BasicMessaging +{ + using System; + using System.Collections.Generic; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using ScenarioDescriptors; + + [TestFixture] + public class When_sending_a_message_to_another_endpoint : NServiceBusAcceptanceTest + { + [Test] + public void Should_receive_the_message() + { + Scenario.Define(() => new Context { Id = Guid.NewGuid() }) + .WithEndpoint(b => b.Given((bus, context) => bus.Send(new MyMessage { Id = context.Id }))) + .WithEndpoint() + .Done(c => c.WasCalled) + .Repeat(r => + r.For() + .For() + .For() + ) + .Should(c => + { + Assert.True(c.WasCalled, "The message handler should be called"); + Assert.AreEqual(1, c.TimesCalled, "The message handler should only be invoked once"); + Assert.AreEqual(Environment.MachineName, c.ReceivedHeaders[Headers.OriginatingMachine], "The sender should attach the machine name as a header"); + Assert.True(c.ReceivedHeaders[Headers.OriginatingEndpoint].Contains("Sender"), "The sender should attach its endpoint name as a header"); + Assert.AreEqual(Environment.MachineName, c.ReceivedHeaders[Headers.ProcessingMachine], "The receiver should attach the machine name as a header"); + Assert.True(c.ReceivedHeaders[Headers.ProcessingEndpoint].Contains("Receiver"), "The receiver should attach its endpoint name as a header"); + }) + .Run(); + } + + public class Context : ScenarioContext + { + public bool WasCalled { get; set; } + + public int TimesCalled { get; set; } + + public IDictionary ReceivedHeaders { get; set; } + + public Guid Id { get; set; } + } + + public class Sender : EndpointConfigurationBuilder + { + public Sender() + { + EndpointSetup() + .AddMapping(typeof(Receiver)); + } + } + + public class Receiver : EndpointConfigurationBuilder + { + public Receiver() + { + EndpointSetup(); + } + } + + [Serializable] + public class MyMessage : ICommand + { + public Guid Id { get; set; } + } + + public class MyMessageHandler : IHandleMessages + { + public Context Context { get; set; } + + public IBus Bus { get; set; } + + public void Handle(MyMessage message) + { + if (Context.Id != message.Id) + return; + + Context.TimesCalled++; + + Context.ReceivedHeaders = Bus.CurrentMessageContext.Headers; + + Context.WasCalled = true; + } + } + } +} diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/BasicMessaging/When_using_a_custom_correlation_id.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/BasicMessaging/When_using_a_custom_correlation_id.cs new file mode 100644 index 00000000000..3fefc3c6664 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/BasicMessaging/When_using_a_custom_correlation_id.cs @@ -0,0 +1,79 @@ +namespace NServiceBus.AcceptanceTests.BasicMessaging +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using MessageMutator; + using NUnit.Framework; + using ScenarioDescriptors; + + [TestFixture] + public class When_using_a_custom_correlation_id : NServiceBusAcceptanceTest + { + static string CorrelationId = "my_custom_correlation_id"; + + [Test] + public void Should_use_the_given_id_as_the_transport_level_correlation_id() + { + Scenario.Define() + .WithEndpoint(b => b.Given(bus => bus.Send(Address.Local, CorrelationId, new MyRequest()))) + .Done(c => c.GotRequest) + .Repeat(r => r.For() + ) + .Should(c => + { + Assert.AreEqual(CorrelationId, c.CorrelationIdReceived,"Correlation ids should match"); + }) + .Run(); + } + + public class Context : ScenarioContext + { + + public bool GotRequest { get; set; } + + public string CorrelationIdReceived { get; set; } + } + + public class CorrelationEndpoint : EndpointConfigurationBuilder + { + public CorrelationEndpoint() + { + EndpointSetup(); + } + + class GetValueOfIncomingCorrelationId:IMutateIncomingTransportMessages,INeedInitialization + { + public Context Context { get; set; } + + public void MutateIncoming(TransportMessage transportMessage) + { + Context.CorrelationIdReceived = transportMessage.CorrelationId; + } + + public void Init() + { + Configure.Component(DependencyLifecycle.InstancePerCall); + } + } + + public class MyResponseHandler : IHandleMessages + { + public Context Context { get; set; } + + public IBus Bus { get; set; } + + public void Handle(MyRequest response) + { + Context.GotRequest = true; + } + } + } + + + [Serializable] + public class MyRequest : IMessage + { + } + } +} diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/BasicMessaging/When_using_callbacks_in_a_scaleout_scenario.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/BasicMessaging/When_using_callbacks_in_a_scaleout_scenario.cs new file mode 100644 index 00000000000..6addc0e44ac --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/BasicMessaging/When_using_callbacks_in_a_scaleout_scenario.cs @@ -0,0 +1,126 @@ +namespace NServiceBus.AcceptanceTests.BasicMessaging +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using ScenarioDescriptors; + using Support; + + [TestFixture] + public class When_using_callbacks_in_a_scaleout_scenario : NServiceBusAcceptanceTest + { + [Test] + public void Each_client_should_have_a_unique_input_queue_to_avoid_processing_each_others_callbacks() + { + Scenario.Define(() => new Context{Id = Guid.NewGuid()}) + .WithEndpoint(b => b.CustomConfig(c=>RuntimeEnvironment.MachineNameAction = () => "ClientA") + .Given((bus, context) => bus.Send(new MyRequest { Id = context.Id, Client = RuntimeEnvironment.MachineName }) + .Register(r => context.CallbackAFired = true))) + .WithEndpoint(b => b.CustomConfig(c=>RuntimeEnvironment.MachineNameAction = () => "ClientB") + .Given((bus, context) => bus.Send(new MyRequest { Id = context.Id, Client = RuntimeEnvironment.MachineName }) + .Register(r => context.CallbackBFired = true))) + .WithEndpoint() + .Done(c => c.ClientAGotResponse && c.ClientBGotResponse) + .Repeat(r =>r.For() + ) + .Should(c => + { + Assert.True(c.CallbackAFired, "Callback on ClientA should fire"); + Assert.True(c.CallbackBFired, "Callback on ClientB should fire"); + Assert.False(c.ResponseEndedUpAtTheWrongClient, "One of the responses ended up at the wrong client"); + }) + .Run(); + } + + public class Context : ScenarioContext + { + public Guid Id { get; set; } + + public bool ClientAGotResponse { get; set; } + + public bool ClientBGotResponse { get; set; } + + public bool ResponseEndedUpAtTheWrongClient { get; set; } + + public bool CallbackAFired { get; set; } + + public bool CallbackBFired { get; set; } + } + + public class Client : EndpointConfigurationBuilder + { + public Client() + { + EndpointSetup(c => Configure.ScaleOut(s => s.UseUniqueBrokerQueuePerMachine())) + .AddMapping(typeof(Server)); + } + + public class MyResponseHandler : IHandleMessages + { + public Context Context { get; set; } + + public IBus Bus { get; set; } + + public void Handle(MyResponse response) + { + if (Context.Id != response.Id) + return; + + if (RuntimeEnvironment.MachineName == "ClientA") + Context.ClientAGotResponse = true; + else + { + Context.ClientBGotResponse = true; + } + + if (RuntimeEnvironment.MachineName != response.Client) + Context.ResponseEndedUpAtTheWrongClient = true; + } + } + } + + public class Server : EndpointConfigurationBuilder + { + public Server() + { + EndpointSetup(); + } + + public class MyMessageHandler : IHandleMessages + { + public Context Context { get; set; } + + public IBus Bus { get; set; } + + public void Handle(MyRequest request) + { + if (Context.Id != request.Id) + return; + + + Bus.Reply(new MyResponse { Id = request.Id,Client = request.Client }); + } + } + } + + [Serializable] + public class MyRequest : IMessage + { + public Guid Id { get; set; } + + public string Client { get; set; } + } + + [Serializable] + public class MyResponse : IMessage + { + public Guid Id { get; set; } + + public string Client { get; set; } + } + + + + } +} diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Configuration/When_a_config_override_is_found.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Configuration/When_a_config_override_is_found.cs new file mode 100644 index 00000000000..34aaf31f565 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Configuration/When_a_config_override_is_found.cs @@ -0,0 +1,65 @@ +namespace NServiceBus.AcceptanceTests.Configuration +{ + using Config; + using Config.ConfigurationSource; + using EndpointTemplates; + using AcceptanceTesting; + using Faults.Forwarder; + using NUnit.Framework; + using Unicast; + using Unicast.Transport; + + public class When_a_config_override_is_found : NServiceBusAcceptanceTest + { + + static Address CustomErrorQ = Address.Parse("MyErrorQ"); + [Test] + public void Should_be_used_instead_of_pulling_the_settings_from_appconfig() + { + var context = Scenario.Define() + .WithEndpoint(b => b.When(c => c.EndpointsStarted, (bus, cc) => + { + var unicastBus = (UnicastBus)bus; + var transport = (TransportReceiver)unicastBus.Transport; + var fm = (FaultManager)transport.FailureManager; + + cc.ErrorQueueUsedByTheEndpoint = fm.ErrorQueue; + cc.IsDone = true; + })) + .Done(c => c.IsDone) + .Run(); + + Assert.AreEqual(CustomErrorQ, context.ErrorQueueUsedByTheEndpoint, "The error queue should have been changed"); + + } + + public class Context : ScenarioContext + { + public bool IsDone { get; set; } + + public Address ErrorQueueUsedByTheEndpoint { get; set; } + } + + public class ConfigOverrideEndpoint : EndpointConfigurationBuilder + { + public ConfigOverrideEndpoint() + { + EndpointSetup(c => c.MessageForwardingInCaseOfFault()); + } + + public class ConfigErrorQueue : IProvideConfiguration + { + public MessageForwardingInCaseOfFaultConfig GetConfiguration() + { + + return new MessageForwardingInCaseOfFaultConfig + { + ErrorQueue = CustomErrorQ.ToString() + }; + } + } + } + } + + +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/DataBus/When_sending_databus_properties.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/DataBus/When_sending_databus_properties.cs new file mode 100644 index 00000000000..d125c2fc449 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/DataBus/When_sending_databus_properties.cs @@ -0,0 +1,68 @@ +namespace NServiceBus.AcceptanceTests.DataBus +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using ScenarioDescriptors; + + [TestFixture] + public class When_sending_databus_properties:NServiceBusAcceptanceTest + { + static byte[] PayloadToSend = new byte[1024 * 1024 * 10]; + [Test] + public void Should_receive_the_message_the_largeproperty_correctly() + { + Scenario.Define() + .WithEndpoint(b => b.Given(bus=> bus.Send(new MyMessageWithLargePayload + { + Payload = new DataBusProperty(PayloadToSend) + }))) + .WithEndpoint() + .Done(context => context.ReceivedPayload != null) + .Repeat(r => r.For() + .For()) + .Should(c => Assert.AreEqual(PayloadToSend, c.ReceivedPayload, "The large payload should be marshalled correctly using the databus")) + .Run(); + } + + public class Context : ScenarioContext + { + public byte[] ReceivedPayload { get; set; } + } + + + public class Sender : EndpointConfigurationBuilder + { + public Sender() + { + EndpointSetup(c => c.FileShareDataBus(@".\databus\sender")) + .AddMapping(typeof (Receiver)); + } + } + + public class Receiver : EndpointConfigurationBuilder + { + public Receiver() + { + EndpointSetup(c => c.FileShareDataBus(@".\databus\sender")); + } + + public class MyMessageHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MyMessageWithLargePayload messageWithLargePayload) + { + Context.ReceivedPayload = messageWithLargePayload.Payload.Value; + } + } + } + + [Serializable] + public class MyMessageWithLargePayload : ICommand + { + public DataBusProperty Payload { get; set; } + } + } +} diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Encryption/When_using_encryption.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Encryption/When_using_encryption.cs new file mode 100644 index 00000000000..af8a67fd322 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Encryption/When_using_encryption.cs @@ -0,0 +1,113 @@ +namespace NServiceBus.AcceptanceTests.Encryption +{ + using System; + using System.Collections.Generic; + using Config; + using Config.ConfigurationSource; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using ScenarioDescriptors; + + public class When_using_encryption : NServiceBusAcceptanceTest + { + [Test] + public void Should_receive_decrypted_message() + { + Scenario.Define() + .WithEndpoint(b => b.Given((bus, context) => bus.SendLocal(new MessageWithSecretData + { + Secret = "betcha can't guess my secret", + SubProperty = new MySecretSubProperty {Secret = "My sub secret"}, + CreditCards = new List + { + new CreditCardDetails + { + ValidTo = DateTime.UtcNow.AddYears(1), + Number = "312312312312312" + }, + new CreditCardDetails + { + ValidTo = DateTime.UtcNow.AddYears(2), + Number = "543645546546456" + } + } + }))) + .Done(c => c.Done) + .Repeat(r => r.For()) + .Should(c => + { + Assert.AreEqual("betcha can't guess my secret", c.Secret); + Assert.AreEqual("My sub secret", c.SubPropertySecret); + CollectionAssert.AreEquivalent(new List { "312312312312312", "543645546546456" }, c.CreditCards); + }) + .Run(); + } + + public class Context : ScenarioContext + { + public bool Done { get; set; } + + public string Secret { get; set; } + + public string SubPropertySecret { get; set; } + + public List CreditCards { get; set; } + } + + public class Endpoint : EndpointConfigurationBuilder + { + public Endpoint() + { + EndpointSetup(c => c.RijndaelEncryptionService()); + } + + public class Handler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MessageWithSecretData message) + { + Context.Secret = message.Secret.Value; + + Context.SubPropertySecret = message.SubProperty.Secret.Value; + + Context.CreditCards = new List() { message.CreditCards[0].Number.Value, message.CreditCards[1].Number.Value }; + + Context.Done = true; + } + } + } + + [Serializable] + public class MessageWithSecretData : IMessage + { + public WireEncryptedString Secret { get; set; } + public MySecretSubProperty SubProperty { get; set; } + public List CreditCards { get; set; } + } + + [Serializable] + public class CreditCardDetails + { + public DateTime ValidTo { get; set; } + public WireEncryptedString Number { get; set; } + } + + [Serializable] + public class MySecretSubProperty + { + public WireEncryptedString Secret { get; set; } + } + + public class ConfigureEncryption: IProvideConfiguration + { + readonly RijndaelEncryptionServiceConfig rijndaelEncryptionServiceConfig = new RijndaelEncryptionServiceConfig { Key = "gdDbqRpqdRbTs3mhdZh9qCaDaxJXl+e6" }; + + public RijndaelEncryptionServiceConfig GetConfiguration() + { + return rijndaelEncryptionServiceConfig; + } + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/EndpointTemplates/BusExtensions.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/EndpointTemplates/BusExtensions.cs new file mode 100644 index 00000000000..6c087c00955 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/EndpointTemplates/BusExtensions.cs @@ -0,0 +1,13 @@ +namespace NServiceBus.AcceptanceTests.EndpointTemplates +{ + using AcceptanceTesting; + + public static class BusExtensions + { + public static void EnsureSubscriptionMessagesHaveArrived(this IBus bus) + { + Configure.Instance.Builder.Build() + .Wait(); + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/EndpointTemplates/ConfigureExtensions.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/EndpointTemplates/ConfigureExtensions.cs new file mode 100644 index 00000000000..25f26638bb6 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/EndpointTemplates/ConfigureExtensions.cs @@ -0,0 +1,201 @@ +namespace NServiceBus.AcceptanceTests.EndpointTemplates +{ + using System; + using System.Collections.Generic; + using System.Configuration; + using AcceptanceTesting; + using NServiceBus.ObjectBuilder.Autofac; + using NServiceBus.ObjectBuilder.CastleWindsor; + using NServiceBus.ObjectBuilder.Common.Config; + using NServiceBus.ObjectBuilder.Ninject; + using NServiceBus.ObjectBuilder.Spring; + using NServiceBus.ObjectBuilder.StructureMap; + using NServiceBus.ObjectBuilder.Unity; + using NServiceBus.Serializers.Binary; + using NServiceBus.Serializers.Json; + using NServiceBus.Serializers.XML; + using Persistence.InMemory.SagaPersister; + using Persistence.InMemory.SubscriptionStorage; + using Persistence.Msmq.SubscriptionStorage; + using Persistence.NHibernate; + using Persistence.Raven.SagaPersister; + using Persistence.Raven.SubscriptionStorage; + using SagaPersisters.NHibernate; + using Unicast.Subscriptions.NHibernate; + + public static class ConfigureExtensions + { + static string NHibernateConnectionString = @"Server=localhost\sqlexpress;Database=nservicebus;Trusted_Connection=True;"; + + public static string GetOrNull(this IDictionary dictionary, string key) + { + if (!dictionary.ContainsKey(key)) + { + return null; + } + + return dictionary[key]; + } + + public static Configure DefineHowManySubscriptionMessagesToWaitFor(this Configure config, int numberOfSubscriptionsToWaitFor) + { + config.Configurer.ConfigureProperty( + spy => spy.NumberOfSubscriptionsToWaitFor, numberOfSubscriptionsToWaitFor); + + return config; + } + + public static Configure DefineTransport(this Configure config, IDictionary settings) + { + if (!settings.ContainsKey("Transport")) + settings = ScenarioDescriptors.Transports.Default.Settings; + + var transportType = Type.GetType(settings["Transport"]); + + return config.UseTransport(transportType, () => settings["Transport.ConnectionString"]); + + } + + public static Configure DefineSerializer(this Configure config, string serializer) + { + if (string.IsNullOrEmpty(serializer)) + return config;//xml is the default + + var type = Type.GetType(serializer); + + if (type == typeof (XmlMessageSerializer)) + { + Configure.Serialization.Xml(); + return config; + } + + + if (type == typeof (JsonMessageSerializer)) + { + Configure.Serialization.Json(); + return config; + } + + if (type == typeof(BsonMessageSerializer)) + { + Configure.Serialization.Bson(); + return config; + } + + if (type == typeof (BinaryMessageSerializer)) + { + Configure.Serialization.Binary(); + return config; + } + + throw new InvalidOperationException("Unknown serializer:" + serializer); + } + + + public static Configure DefineSagaPersister(this Configure config, string persister) + { + if (string.IsNullOrEmpty(persister)) + return config.InMemorySagaPersister(); + + var type = Type.GetType(persister); + + if (type == typeof(InMemorySagaPersister)) + return config.InMemorySagaPersister(); + + if (type == typeof(RavenSagaPersister)) + { + config.RavenPersistence(() => "url=http://localhost:8080"); + return config.RavenSagaPersister(); + + } + + if (type == typeof(SagaPersister)) + { + NHibernateSettingRetriever.ConnectionStrings = () => + { + var c = new ConnectionStringSettingsCollection(); + + c.Add(new ConnectionStringSettings("NServiceBus/Persistence", NHibernateConnectionString)); + return c; + + }; + return config.UseNHibernateSagaPersister(); + } + + throw new InvalidOperationException("Unknown persister:" + persister); + } + + + public static Configure DefineSubscriptionStorage(this Configure config, string persister) + { + if (string.IsNullOrEmpty(persister)) + return config.InMemorySubscriptionStorage(); + + var type = Type.GetType(persister); + + if (type == typeof(InMemorySubscriptionStorage)) + return config.InMemorySubscriptionStorage(); + + if (type == typeof(RavenSubscriptionStorage)) + { + config.RavenPersistence(() => "url=http://localhost:8080"); + return config.RavenSubscriptionStorage(); + + } + + if (type == typeof(SubscriptionStorage)) + { + NHibernateSettingRetriever.ConnectionStrings = () => + { + var c = new ConnectionStringSettingsCollection(); + + c.Add(new ConnectionStringSettings("NServiceBus/Persistence", NHibernateConnectionString)); + return c; + + }; + return config.UseNHibernateSubscriptionPersister(); + } + + + if (type == typeof(MsmqSubscriptionStorage)) + { + return config.MsmqSubscriptionStorage(); + } + + throw new InvalidOperationException("Unknown persister:" + persister); + } + + public static Configure DefineBuilder(this Configure config, string builder) + { + if (string.IsNullOrEmpty(builder)) + return config.DefaultBuilder(); + + var type = Type.GetType(builder); + + if (type == typeof(AutofacObjectBuilder)) + { + ConfigureCommon.With(config, new AutofacObjectBuilder(null)); + + return config; + } + + if (type == typeof(WindsorObjectBuilder)) + return config.CastleWindsorBuilder(); + + if (type == typeof(NinjectObjectBuilder)) + return config.NinjectBuilder(); + + if (type == typeof(SpringObjectBuilder)) + return config.SpringFrameworkBuilder(); + + if (type == typeof(StructureMapObjectBuilder)) + return config.StructureMapBuilder(); + + if (type == typeof(UnityObjectBuilder)) + return config.StructureMapBuilder(); + + + throw new InvalidOperationException("Unknown builder:" + builder); + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/EndpointTemplates/DefaultServer.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/EndpointTemplates/DefaultServer.cs new file mode 100644 index 00000000000..77b0aae0ff8 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/EndpointTemplates/DefaultServer.cs @@ -0,0 +1,101 @@ +namespace NServiceBus.AcceptanceTests.EndpointTemplates +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Reflection; + using AcceptanceTesting.Support; + using Config.ConfigurationSource; + using Hosting.Helpers; + using NServiceBus; + using Settings; + + public class DefaultServer : IEndpointSetupTemplate + { + public Configure GetConfiguration(RunDescriptor runDescriptor, EndpointConfiguration endpointConfiguration, IConfigurationSource configSource) + { + var settings = runDescriptor.Settings; + + SetupLogging(endpointConfiguration); + + var types = GetTypesToUse(endpointConfiguration); + + var transportToUse = settings.GetOrNull("Transport"); + + Configure.Features.Enable(); + SettingsHolder.SetDefault("ScaleOut.UseSingleBrokerQueue", true); + + var config = Configure.With(types) + .DefineEndpointName(endpointConfiguration.EndpointName) + .DefineBuilder(settings.GetOrNull("Builder")) + .CustomConfigurationSource(configSource) + .DefineSerializer(settings.GetOrNull("Serializer")) + .DefineTransport(settings) + .DefineSagaPersister(settings.GetOrNull("SagaPersister")); + + if (transportToUse == null || + transportToUse.Contains("Msmq") || + transportToUse.Contains("SqlServer") || + transportToUse.Contains("RabbitMq") || + transportToUse.Contains("AzureServiceBus") || + transportToUse.Contains("AzureStorageQueue")) + config.UseInMemoryTimeoutPersister(); + + if (transportToUse == null || transportToUse.Contains("Msmq") || transportToUse.Contains("SqlServer")) + config.DefineSubscriptionStorage(settings.GetOrNull("SubscriptionStorage")); + + return config.UnicastBus(); + } + + static IEnumerable GetTypesToUse(EndpointConfiguration endpointConfiguration) + { + var assemblies = AssemblyScanner.GetScannableAssemblies(); + + var types = assemblies.Assemblies + //exclude all test types by default + .Where(a => a != Assembly.GetExecutingAssembly()) + .SelectMany(a => a.GetTypes()); + + + types = types.Union(GetNestedTypeRecursive(endpointConfiguration.BuilderType.DeclaringType, endpointConfiguration.BuilderType)); + + return types.Where(t=>!endpointConfiguration.TypesToExclude.Contains(t)).ToList(); + } + + static IEnumerable GetNestedTypeRecursive(Type rootType,Type builderType) + { + yield return rootType; + + if (typeof(IEndpointConfigurationFactory).IsAssignableFrom(rootType) && rootType != builderType) + yield break; + + foreach (var nestedType in rootType.GetNestedTypes(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic).SelectMany(t => GetNestedTypeRecursive(t, builderType))) + { + yield return nestedType; + } + } + + static void SetupLogging(EndpointConfiguration endpointConfiguration) + { + var logDir = ".\\logfiles\\"; + + if (!Directory.Exists(logDir)) + Directory.CreateDirectory(logDir); + + var logFile = Path.Combine(logDir, endpointConfiguration.EndpointName + ".txt"); + + if (File.Exists(logFile)) + File.Delete(logFile); + + var logLevel = "WARN"; + var logLevelOverride = Environment.GetEnvironmentVariable("tests_loglevel"); + + if (!string.IsNullOrEmpty(logLevelOverride)) + logLevel = logLevelOverride; + + SetLoggingLibrary.Log4Net(null, + Logging.Loggers.Log4NetAdapter.Log4NetAppenderFactory.CreateRollingFileAppender(logLevel, logFile)); + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Gateway/When_using_a_custom_correlation_id.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Gateway/When_using_a_custom_correlation_id.cs new file mode 100644 index 00000000000..981c744b7f4 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Gateway/When_using_a_custom_correlation_id.cs @@ -0,0 +1,124 @@ +namespace NServiceBus.AcceptanceTests.Gateway +{ + using System; + using Config; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using ScenarioDescriptors; + + [TestFixture] + public class When_sending_a_message_to_another_site : NServiceBusAcceptanceTest + { + [Test] + public void Should_be_able_to_reply_to_the_message() + { + Scenario.Define() + .WithEndpoint(b => b.Given(bus => bus.SendToSites(new[] { "SiteA" }, new MyRequest()))) + .WithEndpoint() + .Done(c => c.GotResponseBack) + .Repeat(r => r.For(Transports.Default) + ) + .Should(c => + { + //Assert.AreEqual(CorrelationId,c.CorrelationIdReceived,"Correlation ids should match"); + }) + .Run(); + } + + public class Context : ScenarioContext + { + + public bool GotResponseBack { get; set; } + + } + + public class Headquarters : EndpointConfigurationBuilder + { + public Headquarters() + { + EndpointSetup(c => c.RunGateway().UseInMemoryGatewayPersister()) + .WithConfig(c => + { + c.Sites = new SiteCollection + { + new SiteConfig + { + Key = "SiteA", + Address = "http://localhost:25899/SiteA/", + ChannelType = "http" + } + }; + + c.Channels = new ChannelCollection + { + new ChannelConfig + { + Address = "http://localhost:25899/Headquarters/", + ChannelType = "http" + } + }; + + + }); + } + + public class MyResponseHandler : IHandleMessages + { + public Context Context { get; set; } + + public IBus Bus { get; set; } + + public void Handle(MyResponse response) + { + Context.GotResponseBack = true; + } + } + } + + public class SiteA : EndpointConfigurationBuilder + { + public SiteA() + { + EndpointSetup(c => c.RunGateway().UseInMemoryGatewayPersister()) + .WithConfig(c => + { + c.Channels = new ChannelCollection + { + new ChannelConfig + { + Address = "http://localhost:25899/SiteA/", + ChannelType = "http" + } + }; + + + }); + + } + + public class MyRequestHandler : IHandleMessages + { + public Context Context { get; set; } + + public IBus Bus { get; set; } + + public void Handle(MyRequest request) + { + Bus.Reply(new MyResponse()); + } + } + } + + + [Serializable] + public class MyRequest : IMessage + { + } + + [Serializable] + public class MyResponse : IMessage + { + } + } +} diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/NServiceBus.AcceptanceTests.csproj b/AcceptanceTests/NServiceBus.AcceptanceTests/NServiceBus.AcceptanceTests.csproj new file mode 100644 index 00000000000..4953d9c4dbb --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/NServiceBus.AcceptanceTests.csproj @@ -0,0 +1,223 @@ + + + + + Debug + AnyCPU + {6A9E04E7-6229-4A3E-B94A-DA168E962B5A} + Library + Properties + NServiceBus.AcceptanceTests + NServiceBus.AcceptanceTests + v4.0 + 512 + ..\..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\packages\Apache.NMS.1.5.1\lib\net40\Apache.NMS.dll + + + False + ..\..\lib\Apache.NMS-CustomBuild\Apache.NMS.ActiveMQ.dll + + + False + ..\..\packages\Autofac.3.0.0\lib\net40\Autofac.dll + + + False + ..\..\packages\Autofac.3.0.0\lib\net40\Autofac.Configuration.dll + + + False + ..\..\packages\Castle.Core.3.2.0\lib\net40-client\Castle.Core.dll + + + False + ..\..\packages\Castle.Windsor.3.2.0\lib\net40\Castle.Windsor.dll + + + ..\..\packages\Common.Logging.1.2.0\lib\1.0\Common.Logging.dll + + + ..\..\packages\Iesi.Collections.3.3.3.4000\lib\Net35\Iesi.Collections.dll + + + False + ..\..\binaries\log4net.dll + + + ..\..\packages\NHibernate.3.3.3.4000\lib\Net35\NHibernate.dll + + + ..\..\packages\Ninject.3.0.1.10\lib\net40\Ninject.dll + + + ..\..\packages\Ninject.Extensions.ContextPreservation.3.0.0.8\lib\net40\Ninject.Extensions.ContextPreservation.dll + + + ..\..\packages\Ninject.Extensions.NamedScope.3.0.0.5\lib\net40\Ninject.Extensions.NamedScope.dll + + + ..\..\binaries\NServiceBus.dll + + + ..\..\binaries\NServiceBus.Azure.dll + + + ..\..\binaries\NServiceBus.Core.dll + + + ..\..\binaries\NServiceBus.NHibernate.dll + + + ..\..\binaries\containers\autofac\NServiceBus.ObjectBuilder.Autofac.dll + + + ..\..\binaries\containers\castle\NServiceBus.ObjectBuilder.CastleWindsor.dll + + + ..\..\binaries\containers\ninject\NServiceBus.ObjectBuilder.Ninject.dll + + + ..\..\binaries\containers\spring\NServiceBus.ObjectBuilder.Spring.dll + + + ..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll + + + ..\..\binaries\containers\unity\NServiceBus.ObjectBuilder.Unity.dll + + + ..\..\binaries\NServiceBus.Transports.ActiveMQ.dll + + + ..\..\binaries\NServiceBus.Transports.RabbitMQ.dll + + + ..\..\binaries\NServiceBus.Transports.SQLServer.dll + + + ..\..\packages\NUnit.2.6.2\lib\nunit.framework.dll + + + ..\..\packages\RabbitMQ.Client.3.0.0\lib\net30\RabbitMQ.Client.dll + + + ..\..\packages\RavenDB.Client.2.0.2375\lib\net40\Raven.Abstractions.dll + + + ..\..\packages\RavenDB.Client.2.0.2375\lib\net40\Raven.Client.Lightweight.dll + + + ..\..\packages\Spring.Core.1.3.2\lib\net40\Spring.Core.dll + + + ..\..\packages\structuremap.2.6.4.1\lib\net40\StructureMap.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {758357F6-CD31-4337-80C4-BA377FC257AF} + NServiceBus.AcceptanceTesting + + + + + + + \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/NServiceBusAcceptanceTest.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/NServiceBusAcceptanceTest.cs new file mode 100644 index 00000000000..b85d3b76fd4 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/NServiceBusAcceptanceTest.cs @@ -0,0 +1,24 @@ +namespace NServiceBus.AcceptanceTests +{ + using AcceptanceTesting.Customization; + using NUnit.Framework; + + /// + /// Base class for all the NSB test that sets up our conventions + /// + public class NServiceBusAcceptanceTest + { + [SetUp] + public void SetUp() + { + Conventions.EndpointNamingConvention= t => + { + var baseNs = typeof (NServiceBusAcceptanceTest).Namespace; + var testName = GetType().Name; + return t.FullName.Replace(baseNs + ".", "").Replace(testName + "+", ""); + }; + + Conventions.DefaultRunDescriptor = () => ScenarioDescriptors.Transports.Default; + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Performance/NServiceBusPerformanceTest.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Performance/NServiceBusPerformanceTest.cs new file mode 100644 index 00000000000..cc6639e5f04 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Performance/NServiceBusPerformanceTest.cs @@ -0,0 +1,73 @@ +namespace NServiceBus.AcceptanceTests.Performance +{ + using System; + using System.Diagnostics; + using System.IO; + using System.Linq; + using AcceptanceTesting; + using AcceptanceTesting.Support; + + public class NServiceBusPerformanceTest:NServiceBusAcceptanceTest + { + protected static int NumberOfTestMessages + { + get + { + int nr; + + if (!int.TryParse(Environment.GetEnvironmentVariable("NServiceBus.MaxMessagesForPerformanceTests"),out nr)) + return 3000; + + return nr; + } + } + + protected static int MaxConcurrencyLevel + { + get + { + int nr; + + if (!int.TryParse(Environment.GetEnvironmentVariable("NServiceBus.MaxConcurrencyLevel"), out nr)) + return 15; + + return nr; + } + } + + protected static void DisplayTestResults(RunSummary summary) + { + + + var caller =new StackTrace().GetFrames().First(f => typeof(NServiceBusPerformanceTest).IsAssignableFrom(f.GetMethod().DeclaringType.BaseType)); + + var testCategory = caller.GetMethod().DeclaringType.Namespace.Replace(typeof(NServiceBusPerformanceTest).Namespace + ".", ""); + var testCase = caller.GetMethod().Name; + + var c = summary.RunDescriptor.ScenarioContext as PerformanceTestContext; + + var messagesPerSecondsProcessed = c.NumberOfTestMessages / + (c.LastMessageProcessedAt - c.FirstMessageProcessedAt).TotalSeconds; + + Console.Out.WriteLine("Results: {0} messages, {1} msg/s", c.NumberOfTestMessages, messagesPerSecondsProcessed); + + using (var file = new StreamWriter(".\\PerformanceTestResults.txt", true)) + { + file.WriteLine(string.Join(";", summary.RunDescriptor.Key, testCategory,testCase, c.NumberOfTestMessages, messagesPerSecondsProcessed)); + } + + Console.Out.WriteLine("##teamcity[buildStatisticValue key='{0}' value='{1:0}']", summary.RunDescriptor.Key + "." + testCategory + "." + testCase, messagesPerSecondsProcessed); + } + + + } + + public class PerformanceTestContext:ScenarioContext + { + public int NumberOfTestMessages; + + public DateTime FirstMessageProcessedAt { get; set; } + + public DateTime LastMessageProcessedAt { get; set; } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Performance/Receive/Receive_performance.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Performance/Receive/Receive_performance.cs new file mode 100644 index 00000000000..feb0096f984 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Performance/Receive/Receive_performance.cs @@ -0,0 +1,132 @@ +namespace NServiceBus.AcceptanceTests.Performance.Receive +{ + using System; + using System.Threading; + using System.Threading.Tasks; + using AcceptanceTesting; + using AcceptanceTesting.Support; + using Config; + using EndpointTemplates; + using NUnit.Framework; + using ScenarioDescriptors; + + public class Receive_performance : NServiceBusPerformanceTest + { + [Test] + public void With_dtc_enabled() + { + Scenario.Define(() => new Context { NumberOfTestMessages = NumberOfTestMessages }) + .WithEndpoint(SendTestMessages) + .Done(c => c.Complete) + .Repeat(r => r.For(Transports.Default)) + .Report(DisplayTestResults) + .MaxTestParallelism(1) + .Run(); + } + + [Test] + public void With_dtc_suppressed() + { + + Scenario.Define(() => new Context { NumberOfTestMessages = NumberOfTestMessages }) + .WithEndpoint(b => + { + b.CustomConfig(c => Configure.Transactions.Advanced(a => a.DisableDistributedTransactions())); + SendTestMessages(b); + }) + .Done(c => c.Complete) + .Repeat(r => r.For(Transports.Default)) + .Report(DisplayTestResults) + .MaxTestParallelism(1) + .Run(); + } + + [Test] + public void With_no_transactions() + { + + Scenario.Define(() => new Context { NumberOfTestMessages = NumberOfTestMessages }) + .WithEndpoint(b => + { + b.CustomConfig(c => Configure.Transactions.Disable()); + SendTestMessages(b); + }) + .Done(c => c.Complete) + .Repeat(r => r.For(Transports.Default)) + .Report(DisplayTestResults) + .MaxTestParallelism(1) + .Run(); + } + + [Test] + public void With_ambient_tx_suppressed() + { + + Scenario.Define(() => new Context { NumberOfTestMessages = NumberOfTestMessages }) + .WithEndpoint(b => + { + b.CustomConfig(c => Configure.Transactions.Advanced(a => a.DoNotWrapHandlersExecutionInATransactionScope())); + SendTestMessages(b); + }) + .Done(c => c.Complete) + .Repeat(r => r.For(Transports.Default)) + .Report(DisplayTestResults) + .MaxTestParallelism(1) + .Run(); + } + + + public class Context : PerformanceTestContext + { + + + public bool Complete { get; set; } + } + + public class ReceiveEndpoint : EndpointConfigurationBuilder + { + public ReceiveEndpoint() + { + EndpointSetup() + .WithConfig(c => c.MaximumConcurrencyLevel = MaxConcurrencyLevel); + } + + public class MyMessageHandler : IHandleMessages + { + public Context Context { get; set; } + + static int numberOfMessagesProcessed; + + + public void Handle(MyMessage messageThatIsEnlisted) + { + var current = Interlocked.Increment(ref numberOfMessagesProcessed); + + if (current == 1) + { + Context.FirstMessageProcessedAt = DateTime.UtcNow; + } + + if (current == Context.NumberOfTestMessages) + { + Context.LastMessageProcessedAt = DateTime.UtcNow; + Context.Complete = true; + } + + } + } + } + + [Serializable] + public class MyMessage : ICommand + { + } + + + + protected static void SendTestMessages(EndpointBehaviorBuilder b) + { + b.Given((bus, context) => Parallel.For(0, context.NumberOfTestMessages, (s, c) => bus.SendLocal(new MyMessage()))); + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Performance/RequestResponse/Request_response_performance.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Performance/RequestResponse/Request_response_performance.cs new file mode 100644 index 00000000000..d3c94d58639 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Performance/RequestResponse/Request_response_performance.cs @@ -0,0 +1,155 @@ +namespace NServiceBus.AcceptanceTests.Performance.RequestResponse +{ + using System; + using System.Threading; + using System.Threading.Tasks; + using AcceptanceTesting; + using Config; + using EndpointTemplates; + using AcceptanceTesting.Support; + using NUnit.Framework; + using ScenarioDescriptors; + + public class Request_response_performance : NServiceBusPerformanceTest + { + [Test] + public void With_dtc_enabled() + { + Scenario.Define(() => new Context { NumberOfTestMessages = NumberOfTestMessages }) + .WithEndpoint(b => SendMessages(b)) + .WithEndpoint() + .Done(c => c.Complete) + .Repeat(r => r.For(Transports.Default)) + .Report(DisplayTestResults) + .MaxTestParallelism(1) + .Run(); + } + + [Test] + public void With_dtc_supressed() + { + Scenario.Define(() => new Context { NumberOfTestMessages = NumberOfTestMessages }) + .WithEndpoint(b => + { + b.CustomConfig(c => Configure.Transactions.Advanced(a => a.DisableDistributedTransactions())); + SendMessages(b); + }) + .WithEndpoint(b => b.CustomConfig(c => Configure.Transactions.Advanced(a => a.DisableDistributedTransactions()))) + .Done(c => c.Complete) + .Repeat(r => r.For(Transports.Default)) + .Report(DisplayTestResults) + .MaxTestParallelism(1) + .Run(); + } + + [Test] + public void With_no_transactions() + { + Scenario.Define(() => new Context { NumberOfTestMessages = NumberOfTestMessages }) + .WithEndpoint(b => + { + b.CustomConfig(c => Configure.Transactions.Disable()); + SendMessages(b); + }) + .WithEndpoint(b => b.CustomConfig(c => Configure.Transactions.Disable())) + .Done(c => c.Complete) + .Repeat(r => r.For(Transports.Default)) + .Report(DisplayTestResults) + .MaxTestParallelism(1) + .Run(); + } + + [Test] + public void With_ambient_tx_suppressed() + { + Scenario.Define(() => new Context { NumberOfTestMessages = NumberOfTestMessages }) + .WithEndpoint(b => + { + b.CustomConfig(c => Configure.Transactions.Advanced(a => a.DoNotWrapHandlersExecutionInATransactionScope())); + SendMessages(b); + }) + .WithEndpoint(b => b.CustomConfig(c => Configure.Transactions.Advanced(a => a.DoNotWrapHandlersExecutionInATransactionScope()))) + .Done(c => c.Complete) + .Repeat(r => r.For(Transports.Default)) + .Report(DisplayTestResults) + .MaxTestParallelism(1) + .Run(); + } + + private static EndpointBehaviorBuilder SendMessages(EndpointBehaviorBuilder b) + { + return b.Given((bus, context) => Parallel.For(0, context.NumberOfTestMessages, (s, c) => bus.Send(new MyMessage()))); + } + + public class Context : PerformanceTestContext + { + public bool Complete { get; set; } + } + + public class ClientEndpoint : EndpointConfigurationBuilder + { + public ClientEndpoint() + { + EndpointSetup() + .WithConfig(c => c.MaximumConcurrencyLevel = MaxConcurrencyLevel) + .AddMapping(typeof(ServerEndpoint)); + } + + public class MyMessageHandler : IHandleMessages + { + public Context Context { get; set; } + + static int numberOfMessagesProcessed; + + + public void Handle(MyResponse messageThatIsEnlisted) + { + var current = Interlocked.Increment(ref numberOfMessagesProcessed); + + if (current == 1) + { + Context.FirstMessageProcessedAt = DateTime.UtcNow; + } + + if (current == Context.NumberOfTestMessages) + { + Context.LastMessageProcessedAt = DateTime.UtcNow; + Context.Complete = true; + } + + } + } + } + + public class ServerEndpoint : EndpointConfigurationBuilder + { + public ServerEndpoint() + { + EndpointSetup() + .WithConfig(c => c.MaximumConcurrencyLevel = MaxConcurrencyLevel); + } + + public class MyMessageHandler : IHandleMessages + { + public Context Context { get; set; } + + public IBus Bus { get; set; } + + public void Handle(MyMessage message) + { + Bus.Reply(new MyResponse()); + } + } + } + + [Serializable] + public class MyMessage : ICommand + { + } + + [Serializable] + public class MyResponse : IMessage + { + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Performance/Sagas/Saga_performance.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Performance/Sagas/Saga_performance.cs new file mode 100644 index 00000000000..a1c14704a92 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Performance/Sagas/Saga_performance.cs @@ -0,0 +1,127 @@ +namespace NServiceBus.AcceptanceTests.Performance.Sagas +{ + using System; + using System.Threading; + using System.Threading.Tasks; + using AcceptanceTesting; + using AcceptanceTesting.Support; + using Config; + using EndpointTemplates; + using NUnit.Framework; + using Saga; + using ScenarioDescriptors; + + public class Saga_performance : NServiceBusPerformanceTest + { + [Test, Explicit("Fails in build server! Not reliable")] + public void With_dtc_enabled() + { + Scenario.Define(() => new Context { NumberOfTestMessages = NumberOfTestMessages }) + .WithEndpoint(SendTestMessages) + .Done(c => c.Complete) + .Repeat(r => r.For()) + .Report(DisplayTestResults) + .MaxTestParallelism(1) + .Run(); + } + + [Test, Explicit("Fails in build server! Not reliable")] + public void With_dtc_supressed() + { + Scenario.Define(() => new Context { NumberOfTestMessages = NumberOfTestMessages }) + .WithEndpoint(b => + { + b.CustomConfig(c => Configure.Transactions.Advanced(a => a.DisableDistributedTransactions())); + SendTestMessages(b); + }) + .Done(c => c.Complete) + .Repeat(r => r.For()) + .Report(DisplayTestResults) + .MaxTestParallelism(1) + .Run(); + } + + public class Context : PerformanceTestContext + { + + public bool Complete { get; set; } + } + + public class SagaEndpoint : EndpointConfigurationBuilder + { + public SagaEndpoint() + { + EndpointSetup() + .WithConfig(c => c.MaximumConcurrencyLevel = MaxConcurrencyLevel); + } + + public class MySaga : Saga,IAmStartedByMessages + { + public Context Context { get; set; } + + static int numberOfMessagesProcessed; + + + public void Handle(MyMessage message) + { + Data.SomeId = message.SomeId; + + var current = Interlocked.Increment(ref numberOfMessagesProcessed); + + if (current == 1) + { + Context.FirstMessageProcessedAt = DateTime.UtcNow; + } + + if (current == Context.NumberOfTestMessages) + { + Context.LastMessageProcessedAt = DateTime.UtcNow; + Context.Complete = true; + } + + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(m=>m.SomeId) + .ToSaga(s=>s.SomeId); + + } + + + public class MySagaData : IContainSagaData + { + public virtual Guid Id { get; set; } + public virtual string Originator { get; set; } + public virtual string OriginalMessageId { get; set; } + + [Unique] + public virtual Guid SomeId { get; set; } + } + + } + + + } + + [Serializable] + public class MyMessage : ICommand + { + public Guid SomeId { get; set; } + } + + + + protected static void SendTestMessages(EndpointBehaviorBuilder b) + { + b.Given((bus, context) => Parallel.For(0, context.NumberOfTestMessages, (s, c) => bus.SendLocal(new MyMessage + { + SomeId = Guid.NewGuid() + }))); + } + } + + + + +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Properties/AssemblyInfo.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..2915c3a69c1 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("NServiceBus.IntegrationTests.Automated")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("NServiceBus.IntegrationTests.Automated")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("eebba921-499c-46ab-ac43-56aaf1af7947")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/PubSubAcceptanceTest.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/PubSubAcceptanceTest.cs new file mode 100644 index 00000000000..d14b480ecc4 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/PubSubAcceptanceTest.cs @@ -0,0 +1,24 @@ +namespace NServiceBus.AcceptanceTests.PubSub +{ + using System; + using Features; + using Unicast.Subscriptions; + using Unicast.Subscriptions.MessageDrivenSubscriptions; + + [Serializable] + public class Subscriptions + { + public static Action> OnEndpointSubscribed = actionToPerform => + { + if (Feature.IsEnabled()) + { + Configure.Instance.Builder.Build().ClientSubscribed += + (sender, args) => + { + actionToPerform(args); + }; + } + }; + + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/When_publishing_an_event.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/When_publishing_an_event.cs new file mode 100644 index 00000000000..0f701abe069 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/When_publishing_an_event.cs @@ -0,0 +1,115 @@ +namespace NServiceBus.AcceptanceTests.PubSub +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using Features; + using NUnit.Framework; + using ScenarioDescriptors; + + public class When_publishing_an_event : NServiceBusAcceptanceTest + { + [Test] + public void Should_be_delivered_to_allsubscribers() + { + Scenario.Define() + .WithEndpoint(b => + b.Given((bus, context) => Subscriptions.OnEndpointSubscribed(s => + { + if (s.SubscriberReturnAddress.Queue.Contains("Subscriber1")) + context.Subscriber1Subscribed = true; + + if (s.SubscriberReturnAddress.Queue.Contains("Subscriber2")) + context.Subscriber2Subscribed = true; + })) + .When(c => c.Subscriber1Subscribed && c.Subscriber2Subscribed, bus => bus.Publish(new MyEvent())) + ) + .WithEndpoint(b => b.Given((bus, context) => + { + bus.Subscribe(); + + if (!Feature.IsEnabled()) + context.Subscriber1Subscribed = true; + })) + .WithEndpoint(b => b.Given((bus, context) => + { + bus.Subscribe(); + + if (!Feature.IsEnabled()) + context.Subscriber2Subscribed = true; + })) + .Done(c => c.Subscriber1GotTheEvent && c.Subscriber2GotTheEvent) + .Repeat(r => r.For(Transports.Msmq)) + .Should(c => + { + Assert.True(c.Subscriber1GotTheEvent); + Assert.True(c.Subscriber2GotTheEvent); + }) + + .Run(); + } + + public class Context : ScenarioContext + { + public bool Subscriber1GotTheEvent { get; set; } + + public bool Subscriber2GotTheEvent { get; set; } + + + public bool Subscriber1Subscribed { get; set; } + + public bool Subscriber2Subscribed { get; set; } + } + + public class Publisher : EndpointConfigurationBuilder + { + public Publisher() + { + EndpointSetup(); + } + } + + public class Subscriber1 : EndpointConfigurationBuilder + { + public Subscriber1() + { + EndpointSetup(c => Configure.Features.Disable()) + .AddMapping(typeof(Publisher)); + } + + public class MyEventHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MyEvent messageThatIsEnlisted) + { + Context.Subscriber1GotTheEvent = true; + } + } + } + + public class Subscriber2 : EndpointConfigurationBuilder + { + public Subscriber2() + { + EndpointSetup(c => Configure.Features.Disable()) + .AddMapping(typeof(Publisher)); + } + + public class MyEventHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MyEvent messageThatIsEnlisted) + { + Context.Subscriber2GotTheEvent = true; + } + } + } + + [Serializable] + public class MyEvent : IEvent + { + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/When_publishing_an_event_using_a_broker_transport_with_centralized_routing.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/When_publishing_an_event_using_a_broker_transport_with_centralized_routing.cs new file mode 100644 index 00000000000..e60efb917cf --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/When_publishing_an_event_using_a_broker_transport_with_centralized_routing.cs @@ -0,0 +1,88 @@ +namespace NServiceBus.AcceptanceTests.PubSub +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using ScenarioDescriptors; + + public class When_publishing_an_event_using_a_broker_transport_with_centralized_routing : NServiceBusAcceptanceTest + { + [Test, Explicit("Not reliable!")] + public void Should_be_delivered_to_allsubscribers_without_the_need_for_config() + { + Scenario.Define() + .WithEndpoint(b => b.When(c => c.EndpointsStarted, (bus, context) => + { + bus.Publish(new MyEvent()); + })) + .WithEndpoint() + .WithEndpoint() + .Done(c => c.Subscriber1GotTheEvent && c.Subscriber2GotTheEvent) + .Repeat(r => r.For()) + .Should(c => + { + Assert.True(c.Subscriber1GotTheEvent); + Assert.True(c.Subscriber2GotTheEvent); + }) + + .Run(); + } + + public class Context : ScenarioContext + { + public bool Subscriber1GotTheEvent { get; set; } + + public bool Subscriber2GotTheEvent { get; set; } + } + + public class CentralizedPublisher : EndpointConfigurationBuilder + { + public CentralizedPublisher() + { + EndpointSetup(); + } + } + + public class CentralizedSubscriber1 : EndpointConfigurationBuilder + { + public CentralizedSubscriber1() + { + EndpointSetup(); + } + + public class MyEventHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MyEvent messageThatIsEnlisted) + { + Context.Subscriber1GotTheEvent = true; + } + } + } + + public class CentralizedSubscriber2 : EndpointConfigurationBuilder + { + public CentralizedSubscriber2() + { + EndpointSetup(); + } + + public class MyEventHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MyEvent messageThatIsEnlisted) + { + Context.Subscriber2GotTheEvent = true; + } + } + } + + [Serializable] + public class MyEvent : IEvent + { + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/When_publishing_an_event_with_the_subscriber_scaled_out.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/When_publishing_an_event_with_the_subscriber_scaled_out.cs new file mode 100644 index 00000000000..b0ce7e90b94 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/When_publishing_an_event_with_the_subscriber_scaled_out.cs @@ -0,0 +1,122 @@ +namespace NServiceBus.AcceptanceTests.PubSub +{ + using System; + using System.Collections.Generic; + using System.Linq; + using EndpointTemplates; + using AcceptanceTesting; + using Features; + using NUnit.Framework; + using ScenarioDescriptors; + using Unicast.Subscriptions; + using Unicast.Subscriptions.MessageDrivenSubscriptions; + + public class When_publishing_an_event_with_the_subscriber_scaled_out : NServiceBusAcceptanceTest + { + static string Server1 = "Server1"; + static string Server2 = "Server2"; + + [Test]//https://github.com/NServiceBus/NServiceBus/issues/1101 + public void Should_only_publish_one_event() + { + Scenario.Define() + .WithEndpoint(b => + b.Given((bus, context) => Subscriptions.OnEndpointSubscribed(s => + { + if (s.SubscriberReturnAddress.Queue != "MyEndpoint") + return; + + context.NumberOfSubcriptionsReceived++; + })) + .When(c => c.NumberOfSubcriptionsReceived >= 2, (bus, c) => + { + c.SubcribersOfTheEvent = Configure.Instance.Builder.Build() + .GetSubscriberAddressesForMessage(new[] { new MessageType(typeof(MyEvent)) }).Select(a => a.ToString()).ToList(); + }) + ) + .WithEndpoint(b => b.Given((bus, context) => + { + bus.Subscribe(); + + if (!Feature.IsEnabled()) + context.NumberOfSubcriptionsReceived++; + })) + .WithEndpoint(b => b.Given((bus, context) => + { + bus.Subscribe(); + + if (!Feature.IsEnabled()) + context.NumberOfSubcriptionsReceived++; + })) + .Done(c => c.SubcribersOfTheEvent != null) + .Repeat(r => r.For(Transports.SqlServer) + .For(SubscriptionStorages.Msmq)) + .Should(c => + { + Assert.AreEqual(1, c.SubcribersOfTheEvent.Count(), "There should only be one logical subscriber"); + }) + .MaxTestParallelism(1)//we force the endpoint names so we can't run this is parallell + .Run(); + } + + public class Context : ScenarioContext + { + public int NumberOfSubcriptionsReceived { get; set; } + + public IEnumerable SubcribersOfTheEvent { get; set; } + } + + public class Publisher : EndpointConfigurationBuilder + { + public Publisher() + { + EndpointSetup(); + } + } + + public class Subscriber1 : EndpointConfigurationBuilder + { + public Subscriber1() + { + EndpointSetup(c => Configure.Features.Disable()) + .AddMapping(typeof (Publisher)) + .CustomMachineName(Server1) + .CustomEndpointName("MyEndpoint"); + } + + public class MyEventHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MyEvent messageThatIsEnlisted) + { + } + } + } + + public class Subscriber2 : EndpointConfigurationBuilder + { + public Subscriber2() + { + EndpointSetup(c => Configure.Features.Disable()) + .AddMapping(typeof(Publisher)) + .CustomMachineName(Server2) + .CustomEndpointName("MyEndpoint"); + } + + public class MyEventHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MyEvent messageThatIsEnlisted) + { + } + } + } + + [Serializable] + public class MyEvent : IEvent + { + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/When_subscribing_to_a_polymorphic_event.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/When_subscribing_to_a_polymorphic_event.cs new file mode 100644 index 00000000000..100b07332d7 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/PubSub/When_subscribing_to_a_polymorphic_event.cs @@ -0,0 +1,127 @@ +namespace NServiceBus.AcceptanceTests.PubSub +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using Features; + using NUnit.Framework; + using ScenarioDescriptors; + using Unicast.Subscriptions.MessageDrivenSubscriptions; + + public class When_subscribing_to_a_polymorphic_event : NServiceBusAcceptanceTest + { + [Test] + public void Event_should_be_delivered() + { + Scenario.Define() + .WithEndpoint(b => b.Given((bus, context) => EnableNotificationsOnSubscribe(context)) + .When(c => c.Subscriber1Subscribed && c.Subscriber2Subscribed, bus => bus.Publish(new MyEvent()))) + .WithEndpoint(b => b.Given((bus, context) => + { + bus.Subscribe(); + + if (!Feature.IsEnabled()) + context.Subscriber1Subscribed = true; + })) + .WithEndpoint(b => b.Given((bus, context) => + { + bus.Subscribe(); + + if (!Feature.IsEnabled()) + context.Subscriber2Subscribed = true; + })) + .Done(c => c.Subscriber1GotTheEvent && c.Subscriber2GotTheEvent) + .Repeat(r => r.For(Transports.ActiveMQ)) + .Should(c => + { + Assert.True(c.Subscriber1GotTheEvent); + Assert.True(c.Subscriber2GotTheEvent); + }) + + .Run(); + } + + public class Context : ScenarioContext + { + public bool Subscriber1GotTheEvent { get; set; } + + public bool Subscriber2GotTheEvent { get; set; } + + public int NumberOfSubscribers { get; set; } + + public bool Subscriber1Subscribed { get; set; } + + public bool Subscriber2Subscribed { get; set; } + } + + public class Publisher : EndpointConfigurationBuilder + { + public Publisher() + { + EndpointSetup(); + } + } + + public class Subscriber1 : EndpointConfigurationBuilder + { + public Subscriber1() + { + EndpointSetup(c=>Configure.Features.Disable()) + .AddMapping(typeof(Publisher)); + } + + public class MyEventHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(IMyEvent messageThatIsEnlisted) + { + Context.Subscriber1GotTheEvent = true; + } + } + } + + public class Subscriber2 : EndpointConfigurationBuilder + { + public Subscriber2() + { + EndpointSetup(c => Configure.Features.Disable()) + .AddMapping(typeof(Publisher)); + } + + public class MyEventHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MyEvent messageThatIsEnlisted) + { + Context.Subscriber2GotTheEvent = true; + } + } + } + static void EnableNotificationsOnSubscribe(Context context) + { + if (Feature.IsEnabled()) + { + Configure.Instance.Builder.Build().ClientSubscribed += + (sender, args) => + { + if (args.SubscriberReturnAddress.Queue.Contains("Subscriber1")) + context.Subscriber1Subscribed = true; + + if (args.SubscriberReturnAddress.Queue.Contains("Subscriber2")) + context.Subscriber2Subscribed = true; + }; + } + } + + [Serializable] + public class MyEvent : IMyEvent + { + } + + public interface IMyEvent : IEvent + { + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Retries/When_doing_flr_with_default_settings.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Retries/When_doing_flr_with_default_settings.cs new file mode 100644 index 00000000000..eacef625c27 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Retries/When_doing_flr_with_default_settings.cs @@ -0,0 +1,126 @@ +namespace NServiceBus.AcceptanceTests.Retries +{ + using System; + using Config; + using Faults; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using ScenarioDescriptors; + + public class When_doing_flr_with_default_settings : NServiceBusAcceptanceTest + { + [Test] + public void Should_do_5_retries_by_default_with_dtc_on() + { + Scenario.Define() + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new MessageToBeRetried()))) + .Done(c => c.HandedOverToSlr || c.NumberOfTimesInvoked > 5) + .Repeat(r => r.For()) + .Should(c => Assert.AreEqual(5, c.NumberOfTimesInvoked, "The FLR should by default retry 5 times")) + .Run(); + + } + + [Test] + public void Should_do_5_retries_by_default_with_native_transactions() + { + Scenario.Define() + .WithEndpoint(b => + { + b.CustomConfig(c => Configure.Transactions.Advanced(a => a.DisableDistributedTransactions())); + b.Given(bus => bus.SendLocal(new MessageToBeRetried())); + }) + .Done(c => c.HandedOverToSlr || c.NumberOfTimesInvoked > 5) + .Repeat(r => r.For()) + .Should(c => Assert.AreEqual(5, c.NumberOfTimesInvoked, "The FLR should by default retry 5 times")) + .Run(); + + } + + [Test] + public void Should_not_do_any_retries_if_transactions_are_off() + { + Scenario.Define() + .WithEndpoint(b => + { + b.CustomConfig(c => Configure.Transactions.Disable()); + b.Given((bus, context) => + { + bus.SendLocal(new MessageToBeRetried()); + bus.SendLocal(new MessageToBeRetried { SecondMessage = true }); + }); + }) + .Done(c => c.SecondMessageReceived || c.NumberOfTimesInvoked > 1) + .Repeat(r => r.For()) + .Should(c => Assert.AreEqual(1, c.NumberOfTimesInvoked, "No retries should be in use if transactions are off")) + .Run(); + + } + + public class Context : ScenarioContext + { + public int NumberOfTimesInvoked { get; set; } + + public bool HandedOverToSlr { get; set; } + + public bool SecondMessageReceived { get; set; } + } + + public class RetryEndpoint : EndpointConfigurationBuilder + { + public RetryEndpoint() + { + EndpointSetup( + c => c.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance)) + .WithConfig(c => c.MaximumConcurrencyLevel = 1); + } + + class CustomFaultManager : IManageMessageFailures + { + public Context Context { get; set; } + + public void SerializationFailedForMessage(TransportMessage message, Exception e) + { + + } + + public void ProcessingAlwaysFailsForMessage(TransportMessage message, Exception e) + { + Context.HandedOverToSlr = true; + } + + public void Init(Address address) + { + + } + } + + class MessageToBeRetriedHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MessageToBeRetried message) + { + if (message.SecondMessage) + { + Context.SecondMessageReceived = true; + return; + } + + Context.NumberOfTimesInvoked++; + + throw new Exception("Simulated exception"); + } + } + } + + [Serializable] + public class MessageToBeRetried : IMessage + { + public bool SecondMessage { get; set; } + } + } + + +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Retries/When_message_fails_with_retries_set_to_0.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Retries/When_message_fails_with_retries_set_to_0.cs new file mode 100644 index 00000000000..af1a81736eb --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Retries/When_message_fails_with_retries_set_to_0.cs @@ -0,0 +1,87 @@ +namespace NServiceBus.AcceptanceTests.Retries +{ + using System; + using System.Collections.Generic; + using Config; + using Faults; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + + public class When_message_fails_with_retries_set_to_0 : NServiceBusAcceptanceTest + { + [Test] + public void Should_not_retry_the_message() + { + var context = new Context(); + + Scenario.Define(context) + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new MessageToBeRetried()))) + .Done(c => c.HandedOverToSlr) + .Run(); + + Assert.AreEqual(1, context.NumberOfTimesInvoked,"No FLR should be in use if MaxRetries is set to 0"); + Assert.AreEqual(Environment.MachineName, context.HeadersOfTheFailedMessage[Headers.ProcessingMachine], "The receiver should attach the machine name as a header"); + Assert.True(context.HeadersOfTheFailedMessage[Headers.ProcessingEndpoint].Contains("RetryEndpoint"), "The receiver should attach its endpoint name as a header"); + } + + public class Context : ScenarioContext + { + public int NumberOfTimesInvoked { get; set; } + + public bool HandedOverToSlr { get; set; } + + public Dictionary HeadersOfTheFailedMessage { get; set; } + } + + public class RetryEndpoint : EndpointConfigurationBuilder + { + public RetryEndpoint() + { + EndpointSetup(c => c.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance)) + .WithConfig(c => + { + c.MaxRetries = 0; + }); + } + + class CustomFaultManager: IManageMessageFailures + { + public Context Context { get; set; } + + public void SerializationFailedForMessage(TransportMessage message, Exception e) + { + + } + + public void ProcessingAlwaysFailsForMessage(TransportMessage message, Exception e) + { + Context.HandedOverToSlr = true; + Context.HeadersOfTheFailedMessage = message.Headers; + } + + public void Init(Address address) + { + + } + } + + class MessageToBeRetriedHandler:IHandleMessages + { + public Context Context { get; set; } + public void Handle(MessageToBeRetried message) + { + Context.NumberOfTimesInvoked++; + throw new Exception("Simulated exception"); + } + } + } + + [Serializable] + public class MessageToBeRetried : IMessage + { + } + } + + +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Retries/When_messages_fails_flr.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Retries/When_messages_fails_flr.cs new file mode 100644 index 00000000000..ec846117b1a --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Retries/When_messages_fails_flr.cs @@ -0,0 +1,88 @@ +namespace NServiceBus.AcceptanceTests.Retries +{ + using System; + using Config; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using ScenarioDescriptors; + + public class When_messages_fails_flr : NServiceBusAcceptanceTest + { + static TimeSpan SlrDelay = TimeSpan.FromSeconds(5); + + [Test] + public void Should_be_moved_to_slr() + { + Scenario.Define() + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new MessageToBeRetried()))) + .Done(c => c.NumberOfTimesInvoked >= 2) + .Repeat(r=>r.For()) + .Should(context => + { + Assert.GreaterOrEqual(1,context.NumberOfSlrRetriesPerformed, "The SLR should only do one retry"); + Assert.GreaterOrEqual(context.TimeOfSecondAttempt - context.TimeOfFirstAttempt,SlrDelay , "The SLR should delay the retry"); + }) + .Run(); + } + + public class Context : ScenarioContext + { + public int NumberOfTimesInvoked { get; set; } + + public DateTime TimeOfFirstAttempt { get; set; } + public DateTime TimeOfSecondAttempt { get; set; } + + public int NumberOfSlrRetriesPerformed { get; set; } + } + + public class SLREndpoint : EndpointConfigurationBuilder + { + public SLREndpoint() + { + EndpointSetup() + .WithConfig(c => + { + c.MaxRetries = 0; //to skip the FLR + }) + .WithConfig(c => + { + c.NumberOfRetries = 1; + c.TimeIncrease = SlrDelay; + }); + } + + + class MessageToBeRetriedHandler:IHandleMessages + { + public Context Context { get; set; } + + public IBus Bus { get; set; } + + public void Handle(MessageToBeRetried message) + { + Context.NumberOfTimesInvoked++; + + if (Context.NumberOfTimesInvoked == 1) + Context.TimeOfFirstAttempt = DateTime.UtcNow; + + if (Context.NumberOfTimesInvoked == 2) + { + Context.TimeOfSecondAttempt = DateTime.UtcNow; + } + + Context.NumberOfSlrRetriesPerformed = int.Parse(Bus.CurrentMessageContext.Headers[Headers.Retries]); + + throw new Exception("Simulated exception"); + } + } + } + + [Serializable] + public class MessageToBeRetried : IMessage + { + } + } + + +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Retries/When_sending_a_message_off_to_slr.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Retries/When_sending_a_message_off_to_slr.cs new file mode 100644 index 00000000000..a9c54915b21 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Retries/When_sending_a_message_off_to_slr.cs @@ -0,0 +1,145 @@ +namespace NServiceBus.AcceptanceTests.Retries +{ + using System; + using System.Linq; + using Config; + using Faults; + using EndpointTemplates; + using AcceptanceTesting; + using MessageMutator; + using NUnit.Framework; + +#pragma warning disable 612, 618 + + public class When_sending_a_message_off_to_slr : NServiceBusAcceptanceTest + { + [Test] + public void Should_preserve_the_original_body_for_regular_exceptions() + { + var context = new Context(); + + Scenario.Define(context) + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new MessageToBeRetried()))) + .Done(c => c.SlrChecksum != default(byte)) + .Run(); + + Assert.AreEqual(context.OriginalBodyChecksum, context.SlrChecksum, "The body of the message sent to slr should be the same as the original message coming off the queue"); + + } + [Test] + public void Should_preserve_the_original_body_for_serialization_exceptions() + { + var context = new Context + { + SimulateSerializationException = true + }; + + Scenario.Define(context) + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new MessageToBeRetried()))) + .Done(c => c.SlrChecksum != default(byte)) + .Run(); + + Assert.AreEqual(context.OriginalBodyChecksum, context.SlrChecksum, "The body of the message sent to slr should be the same as the original message coming off the queue"); + + } + + public class Context : ScenarioContext + { + public byte OriginalBodyChecksum { get; set; } + + public byte SlrChecksum { get; set; } + + public bool SimulateSerializationException { get; set; } + } + + public class RetryEndpoint : EndpointConfigurationBuilder + { + public RetryEndpoint() + { + EndpointSetup(c => c.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance)) + .WithConfig(c => + { + c.MaxRetries = 0; + }); + } + + class BodyMutator : IMutateTransportMessages, NServiceBus.INeedInitialization + { + public Context Context { get; set; } + + public void MutateIncoming(TransportMessage transportMessage) + { + + var originalBody = transportMessage.Body; + + Context.OriginalBodyChecksum = Checksum(originalBody); + + var decryptedBody = new byte[originalBody.Length]; + + Buffer.BlockCopy(originalBody,0,decryptedBody,0,originalBody.Length); + + //decrypt + decryptedBody[0]++; + + if (Context.SimulateSerializationException) + decryptedBody[1]++; + + transportMessage.Body = decryptedBody; + } + + + public void MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + transportMessage.Body[0]--; + } + + public void Init() + { + Configure.Component(DependencyLifecycle.InstancePerCall); + } + } + + class CustomFaultManager : IManageMessageFailures + { + public Context Context { get; set; } + + public void SerializationFailedForMessage(TransportMessage message, Exception e) + { + Context.SlrChecksum = RetryEndpoint.Checksum(message.Body); + } + + public void ProcessingAlwaysFailsForMessage(TransportMessage message, Exception e) + { + Context.SlrChecksum = RetryEndpoint.Checksum(message.Body); + } + + public void Init(Address address) + { + + } + } + + class MessageToBeRetriedHandler : IHandleMessages + { + public void Handle(MessageToBeRetried message) + { + throw new Exception("Simulated exception"); + } + } + + public static byte Checksum(byte[] data) + { + long longSum = data.Sum(x => (long)x); + return unchecked((byte)longSum); + } + } + + [Serializable] + public class MessageToBeRetried : IMessage + { + } + } + +#pragma warning restore 612, 618 + +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_a_saga_message_goes_through_the_slr.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_a_saga_message_goes_through_the_slr.cs new file mode 100644 index 00000000000..3246e79c5ee --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_a_saga_message_goes_through_the_slr.cs @@ -0,0 +1,96 @@ +namespace NServiceBus.AcceptanceTests.Sagas +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using Saga; + using ScenarioDescriptors; + + //repro for issue: https://github.com/NServiceBus/NServiceBus/issues/1020 + public class When_a_saga_message_goes_through_the_slr : NServiceBusAcceptanceTest + { + [Test] + public void Should_invoke_the_correct_handle_methods_on_the_saga() + { + Scenario.Define() + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new StartSagaMessage { SomeId = Guid.NewGuid() }))) + .Done(c => c.SecondMessageProcessed) + .Repeat(r => r.For(Transports.Default)) + .Run(); + } + + public class Context : ScenarioContext + { + public bool SecondMessageProcessed { get; set; } + + + public int NumberOfTimesInvoked { get; set; } + } + + public class SagaEndpoint : EndpointConfigurationBuilder + { + public SagaEndpoint() + { + EndpointSetup(); + } + + public class TestSaga : Saga, IAmStartedByMessages,IHandleMessages + { + public Context Context { get; set; } + public void Handle(StartSagaMessage message) + { + Data.SomeId = message.SomeId; + + Bus.SendLocal(new SecondSagaMessage + { + SomeId = Data.SomeId + }); + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(m=>m.SomeId) + .ToSaga(s=>s.SomeId); + ConfigureMapping(m => m.SomeId) + .ToSaga(s => s.SomeId); + } + + public void Handle(SecondSagaMessage message) + { + Context.NumberOfTimesInvoked++; + var shouldFail = Context.NumberOfTimesInvoked < 2; //1 FLR and 1 SLR + + if(shouldFail) + throw new Exception("Simulated exception"); + + Context.SecondMessageProcessed = true; + } + } + + public class TestSagaData : IContainSagaData + { + public Guid Id { get; set; } + public string Originator { get; set; } + public string OriginalMessageId { get; set; } + public Guid SomeId { get; set; } + } + } + + [Serializable] + public class StartSagaMessage : ICommand + { + public Guid SomeId { get; set; } + } + public class SecondSagaMessage : ICommand + { + public Guid SomeId { get; set; } + } + + public class SomeTimeout + { + } + } + + +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_an_endpoint_replies_to_a_saga.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_an_endpoint_replies_to_a_saga.cs new file mode 100644 index 00000000000..7a3fef8d580 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_an_endpoint_replies_to_a_saga.cs @@ -0,0 +1,111 @@ +namespace NServiceBus.AcceptanceTests.Sagas +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using Saga; + using ScenarioDescriptors; + + // Repro for issue https://github.com/NServiceBus/NServiceBus/issues/1277 to test the fix + // making sure that the saga correlation still works. + public class When_an_endpoint_replies_to_a_saga : NServiceBusAcceptanceTest + { + [Test] + public void Should_correlate_all_saga_messages_properly() + { + Scenario.Define() + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new StartSaga { DataId = Guid.NewGuid() }))) + .WithEndpoint() + .Done(c => c.DidSagaReplyMessageGetCorrelated) + .Repeat(r => r.For(Transports.Default)) + .Should(c => + { + Assert.True(c.DidSagaReplyMessageGetCorrelated); + }) + .Run(); + } + + public class Context : ScenarioContext + { + public bool DidSagaReplyMessageGetCorrelated { get; set; } + } + + public class EndpointThatHandlesAMessageFromSagaAndReplies : EndpointConfigurationBuilder + { + public EndpointThatHandlesAMessageFromSagaAndReplies() + { + EndpointSetup(); + } + + class DoSomethingHandler : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(DoSomething message) + { + Console.WriteLine("Received DoSomething command for DataId:{0} ... and responding with a reply", message.DataId); + Bus.Reply(new DoSomethingResponse { DataId = message.DataId }); + } + } + } + + public class EndpointThatHostsASaga : EndpointConfigurationBuilder + { + public EndpointThatHostsASaga() + { + EndpointSetup() + .AddMapping(typeof (EndpointThatHandlesAMessageFromSagaAndReplies)); + + } + + public class Saga2 : Saga, IAmStartedByMessages, IHandleMessages + { + public Context Context { get; set; } + + public void Handle(StartSaga message) + { + var dataId = Guid.NewGuid(); + Console.Out.WriteLine("Saga2 sending DoSomething for DataId: {0}", dataId); + Data.DataId = dataId; + Bus.Send(new DoSomething { DataId = dataId }); + } + + public void Handle(DoSomethingResponse message) + { + Context.DidSagaReplyMessageGetCorrelated = message.DataId == Data.DataId; + Console.Out.WriteLine("Saga received DoSomethingResponse for DataId: {0} and MarkAsComplete", message.DataId); + MarkAsComplete(); + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(m => m.DataId).ToSaga(s => s.DataId); + } + + public class MySaga2Data : ContainSagaData + { + [Unique] + public Guid DataId { get; set; } + } + } + } + + + [Serializable] + public class StartSaga : ICommand + { + public Guid DataId { get; set; } + } + + public class DoSomething : ICommand + { + public Guid DataId { get; set; } + } + + public class DoSomethingResponse : IMessage + { + public Guid DataId { get; set; } + } + } +} diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_receiving_a_message_that_is_mapped_to_an_existing_saga_instance.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_receiving_a_message_that_is_mapped_to_an_existing_saga_instance.cs new file mode 100644 index 00000000000..5e2ee84df81 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_receiving_a_message_that_is_mapped_to_an_existing_saga_instance.cs @@ -0,0 +1,97 @@ +namespace NServiceBus.AcceptanceTests.Sagas +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using Saga; + using SagaPersisters.NHibernate.AutoPersistence.Attributes; + using ScenarioDescriptors; + + public class When_receiving_a_message_that_is_mapped_to_an_existing_saga_instance : NServiceBusAcceptanceTest + { + static Guid IdThatSagaIsCorrelatedOn = Guid.NewGuid(); + + [Test] + public void Should_hydrate_and_invoke_the_existing_instance() + { + Scenario.Define() + .WithEndpoint(b => b.Given(bus => + { + bus.SendLocal(new StartSagaMessage { SomeId = IdThatSagaIsCorrelatedOn }); + bus.SendLocal(new StartSagaMessage { SomeId = IdThatSagaIsCorrelatedOn, SecondMessage = true }); + })) + .Done(c => c.SecondMessageReceived) + .Repeat(r => r.For()) + .Should(c => + { + Assert.AreEqual(c.FirstSagaInstance, c.SecondSagaInstance, "The same saga instance should be invoked invoked for both messages"); + }) + + .Run(); + } + + public class Context : ScenarioContext + { + public bool SecondMessageReceived { get; set; } + + public Guid FirstSagaInstance { get; set; } + public Guid SecondSagaInstance { get; set; } + } + + public class SagaEndpoint : EndpointConfigurationBuilder + { + public SagaEndpoint() + { + EndpointSetup(c=>Configure.Transactions.Advanced(a => + { + a.DoNotWrapHandlersExecutionInATransactionScope(); + })); + } + + public class TestSaga : Saga, IAmStartedByMessages + { + public Context Context { get; set; } + public void Handle(StartSagaMessage message) + { + Data.SomeId = message.SomeId; + + if (message.SecondMessage) + { + Context.SecondSagaInstance = Data.Id; + Context.SecondMessageReceived = true; + } + else + { + Context.FirstSagaInstance = Data.Id; + } + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(m=>m.SomeId) + .ToSaga(s=>s.SomeId); + } + } + + [TableName("SagaEndpointTestSagaData")] + public class TestSagaData : IContainSagaData + { + public virtual Guid Id { get; set; } + public virtual string Originator { get; set; } + public virtual string OriginalMessageId { get; set; } + + [Unique] + public virtual Guid SomeId { get; set; } + } + } + + [Serializable] + public class StartSagaMessage : ICommand + { + public Guid SomeId { get; set; } + + public bool SecondMessage { get; set; } + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_receiving_a_message_that_should_complete_saga.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_receiving_a_message_that_should_complete_saga.cs new file mode 100644 index 00000000000..88fa76a1f01 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_receiving_a_message_that_should_complete_saga.cs @@ -0,0 +1,144 @@ +namespace NServiceBus.AcceptanceTests.Sagas +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using Saga; + using ScenarioDescriptors; + + public class When_receiving_a_message_that_completes_the_saga : NServiceBusAcceptanceTest + { + [Test] + public void Should_hydrate_and_complete_the_existing_instance() + { + Scenario.Define(() => new Context { Id = Guid.NewGuid() }) + .WithEndpoint(b => + { + b.Given((bus, context) => bus.SendLocal(new StartSagaMessage {SomeId = context.Id})); + b.When(context => context.StartSagaMessageReceived, (bus, context) => bus.SendLocal(new CompleteSagaMessage { SomeId = context.Id })); + }) + .Done(c => c.SagaCompleted) + .Repeat(r => r.For(Transports.Default)) + .Should(c => + { + Assert.IsNull(c.UnhandledException); + }) + + .Run(); + } + + [Test] + public void Should_ignore_messages_afterwards() + { + Scenario.Define(() => new Context {Id = Guid.NewGuid()}) + .WithEndpoint(b => + { + b.Given((bus, context) => bus.SendLocal(new StartSagaMessage { SomeId = context.Id })); + b.When(context => context.StartSagaMessageReceived, (bus, context) => bus.SendLocal(new CompleteSagaMessage { SomeId = context.Id })); + b.When(context => context.SagaCompleted, (bus, context) => bus.SendLocal(new AnotherMessage { SomeId = context.Id })); + }) + .Done(c => c.AnotherMessageReceived) + .Repeat(r => r.For(Transports.Default)) + .Should(c => + { + Assert.IsNull(c.UnhandledException); + Assert.False(c.SagaReceivedAnotherMessage,"AnotherMessage should not be delivered to the saga after completion"); + }) + .Run(); + } + + public class Context : ScenarioContext + { + public Exception UnhandledException { get; set; } + public Guid Id { get; set; } + + public bool StartSagaMessageReceived { get; set; } + + public bool SagaCompleted { get; set; } + + public bool AnotherMessageReceived { get; set; } + public bool SagaReceivedAnotherMessage { get; set; } + } + + public class SagaEndpoint : EndpointConfigurationBuilder + { + public SagaEndpoint() + { + EndpointSetup( + c => c.RavenSagaPersister().UnicastBus().LoadMessageHandlers>()); + } + + + + public class TestSaga : Saga, IAmStartedByMessages, IHandleMessages, IHandleMessages + { + public Context Context { get; set; } + + public void Handle(StartSagaMessage message) + { + Data.SomeId = message.SomeId; + + Context.StartSagaMessageReceived = true; + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(m=>m.SomeId) + .ToSaga(s=>s.SomeId); + ConfigureMapping(m => m.SomeId) + .ToSaga(s => s.SomeId); + ConfigureMapping(m => m.SomeId) + .ToSaga(s => s.SomeId); + } + + public void Handle(CompleteSagaMessage message) + { + MarkAsComplete(); + Context.SagaCompleted = true; + } + + public void Handle(AnotherMessage message) + { + Context.SagaReceivedAnotherMessage = true; + } + } + + public class TestSagaData : IContainSagaData + { + public Guid Id { get; set; } + public string Originator { get; set; } + public string OriginalMessageId { get; set; } + [Unique] + public Guid SomeId { get; set; } + } + } + + public class CompletionHandler : IHandleMessages + { + public Context Context { get; set; } + public void Handle(AnotherMessage message) + { + Context.AnotherMessageReceived = true; + } + } + + [Serializable] + public class StartSagaMessage : ICommand + { + public Guid SomeId { get; set; } + } + + [Serializable] + public class CompleteSagaMessage : ICommand + { + public Guid SomeId { get; set; } + } + + [Serializable] + public class AnotherMessage : ICommand + { + public Guid SomeId { get; set; } + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_receiving_a_message_that_should_start_a_saga.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_receiving_a_message_that_should_start_a_saga.cs new file mode 100644 index 00000000000..e0e39273713 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_receiving_a_message_that_should_start_a_saga.cs @@ -0,0 +1,102 @@ +namespace NServiceBus.AcceptanceTests.Sagas +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using Saga; + using ScenarioDescriptors; + + [TestFixture] + public class When_receiving_a_message_that_should_start_a_saga : NServiceBusAcceptanceTest + { + [Test] + public void Should_start_the_saga_and_call_all_messagehandlers_for_the_given_message() + { + Scenario.Define() + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new StartSagaMessage()))) + .Done(context => context.InterceptingHandlerCalled && context.SagaStarted) + .Repeat(r => r.For()) + .Should(c => + { + Assert.True(c.InterceptingHandlerCalled, "The message handler should be called"); + Assert.True(c.SagaStarted, "The saga should have been started"); + }) + .Run(); + } + + + [Test] + public void Should_not_start_saga_if_a_interception_handler_has_been_invoked() + { + Scenario.Define(() => new SagaEndpointContext{InterceptSaga = true}) + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new StartSagaMessage()))) + .Done(context => context.InterceptingHandlerCalled) + .Repeat(r => r.For()) + .Should(c => + { + Assert.True(c.InterceptingHandlerCalled, "The intercepting handler should be called"); + Assert.False(c.SagaStarted, "The saga should not have been started since the intercepting handler stops the pipeline"); + }) + .Run(); + } + + + public class SagaEndpointContext : ScenarioContext + { + public bool InterceptingHandlerCalled { get; set; } + + public bool SagaStarted { get; set; } + + public bool InterceptSaga { get; set; } + } + + + public class SagaEndpoint : EndpointConfigurationBuilder + { + public SagaEndpoint() + { + EndpointSetup(c =>c.UnicastBus().LoadMessageHandlers>()); + } + + public class TestSaga : Saga, IAmStartedByMessages + { + public SagaEndpointContext Context { get; set; } + public void Handle(StartSagaMessage message) + { + Context.SagaStarted = true; + } + } + + public class TestSagaData : IContainSagaData + { + public Guid Id { get; set; } + public string Originator { get; set; } + public string OriginalMessageId { get; set; } + } + + public class InterceptingHandler : IHandleMessages + { + public SagaEndpointContext Context { get; set; } + + public IBus Bus { get; set; } + + public void Handle(StartSagaMessage message) + { + Context.InterceptingHandlerCalled = true; + + if(Context.InterceptSaga) + Bus.DoNotContinueDispatchingCurrentMessageToHandlers(); + } + } + } + + [Serializable] + public class StartSagaMessage : ICommand + { + } + + + } + +} diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_two_sagas_subscribe_to_the_same_event.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_two_sagas_subscribe_to_the_same_event.cs new file mode 100644 index 00000000000..2e8b28a70e1 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_two_sagas_subscribe_to_the_same_event.cs @@ -0,0 +1,155 @@ + +namespace NServiceBus.AcceptanceTests.Sagas +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using Saga; + using ScenarioDescriptors; + + // Repro for issue https://github.com/NServiceBus/NServiceBus/issues/1277 + public class When_two_sagas_subscribe_to_the_same_event : NServiceBusAcceptanceTest + { + [Test] + public void Should_invoke_all_handlers_on_all_sagas() + { + Scenario.Define() + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new StartSaga2 { DataId = Guid.NewGuid() }))) + .WithEndpoint() + .Done(c => c.DidSaga1EventHandlerGetInvoked && c.DidSaga2EventHandlerGetInvoked) + .Repeat(r => r.For(Transports.Default)) + .Should(c => + { + Assert.True(c.DidSaga1EventHandlerGetInvoked && c.DidSaga2EventHandlerGetInvoked); + }) + .Run(); + } + + public class Context : ScenarioContext + { + public bool DidSaga1EventHandlerGetInvoked { get; set; } + public bool DidSaga2EventHandlerGetInvoked { get; set; } + } + + public class EndpointThatHandlesAMessageAndPublishesEvent : EndpointConfigurationBuilder + { + public EndpointThatHandlesAMessageAndPublishesEvent() + { + EndpointSetup(); + } + + class OpenGroupCommandHandler : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(OpenGroupCommand message) + { + Console.WriteLine("Received OpenGroupCommand for DataId:{0} ... and publishing GroupPendingEvent", message.DataId); + Bus.Publish(new GroupPendingEvent { DataId = message.DataId }); + } + } + } + + public class EndpointThatHostsTwoSagas : EndpointConfigurationBuilder + { + public EndpointThatHostsTwoSagas() + { + EndpointSetup() + .AddMapping(typeof(EndpointThatHandlesAMessageAndPublishesEvent)) + .AddMapping(typeof(EndpointThatHandlesAMessageAndPublishesEvent)); + } + + public class Saga1 : Saga, IAmStartedByMessages, IHandleMessages + { + public Context Context { get; set; } + + public void Handle(GroupPendingEvent message) + { + Data.DataId = message.DataId; + Console.Out.WriteLine("Saga1 received GroupPendingEvent for DataId: {0}", message.DataId); + Context.DidSaga1EventHandlerGetInvoked = true; + Bus.SendLocal(new CompleteSaga1Start { DataId = message.DataId }); + } + + public void Handle(CompleteSaga1Now message) + { + Console.Out.WriteLine("Saga1 received CompleteSaga1Now for DataId:{0} and MarkAsComplete", message.DataId); + + MarkAsComplete(); + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(m => m.DataId).ToSaga(s => s.DataId); + ConfigureMapping(m => m.DataId).ToSaga(s => s.DataId); + } + + public class MySaga1Data : ContainSagaData + { + [Unique] + public Guid DataId { get; set; } + } + } + + public class Saga2 : Saga, IAmStartedByMessages, IHandleMessages + { + public Context Context { get; set; } + + public void Handle(StartSaga2 message) + { + var dataId = Guid.NewGuid(); + Console.Out.WriteLine("Saga2 sending OpenGroupCommand for DataId: {0}", dataId); + Data.DataId = dataId; + Bus.Send(new OpenGroupCommand { DataId = dataId }); + } + + public void Handle(GroupPendingEvent message) + { + Context.DidSaga2EventHandlerGetInvoked = true; + Console.Out.WriteLine("Saga2 received GroupPendingEvent for DataId: {0} and MarkAsComplete", message.DataId); + MarkAsComplete(); + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(m => m.DataId).ToSaga(s => s.DataId); + ConfigureMapping(m => m.DataId).ToSaga(s => s.DataId); + } + + public class MySaga2Data : ContainSagaData + { + [Unique] + public Guid DataId { get; set; } + } + } + } + + [Serializable] + public class GroupPendingEvent : IEvent + { + public Guid DataId { get; set; } + } + + public class OpenGroupCommand : ICommand + { + public Guid DataId { get; set; } + } + + [Serializable] + public class StartSaga2 : ICommand + { + public Guid DataId { get; set; } + } + + public class CompleteSaga1Start : ICommand + { + public Guid DataId { get; set; } + } + + public class CompleteSaga1Now : ICommand + { + public Guid DataId { get; set; } + } + } +} diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_using_a_received_message_for_timeout.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_using_a_received_message_for_timeout.cs new file mode 100644 index 00000000000..760d092ac26 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_using_a_received_message_for_timeout.cs @@ -0,0 +1,108 @@ +namespace NServiceBus.AcceptanceTests.Sagas +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using Saga; + using ScenarioDescriptors; + + public class When_using_a_received_message_for_timeout : NServiceBusAcceptanceTest + { + [Test, Ignore("Not working!")] + public void Timeout_should_be_received_after_expiration() + { + Scenario.Define(() => new Context {Id = Guid.NewGuid()}) + .WithEndpoint(b => + { + b.Given((bus, context) => bus.SendLocal(new StartSagaMessage {SomeId = context.Id})); + + b.When(context => context.StartSagaMessageReceived, + (bus, context) => + { + bus.EnsureSubscriptionMessagesHaveArrived(); + bus.Publish(new SomeEvent {SomeId = context.Id}); + }); + }) + .Done(c => c.TimeoutReceived) + .Repeat(r => r.For(Transports.Default)) + .Run(); + } + + public class Context : ScenarioContext + { + public Guid Id { get; set; } + + public bool StartSagaMessageReceived { get; set; } + + public bool SomeEventReceived { get; set; } + + public bool TimeoutReceived { get; set; } + } + + public class SagaEndpoint : EndpointConfigurationBuilder + { + public SagaEndpoint() + { + EndpointSetup(c => c.RavenSagaPersister() + .DefineHowManySubscriptionMessagesToWaitFor(1) + .UnicastBus()) + .AddMapping(typeof (SagaEndpoint)); + } + + public class TestSaga : Saga, IAmStartedByMessages, + IHandleMessages, IHandleTimeouts + { + public Context Context { get; set; } + + public void Handle(StartSagaMessage message) + { + Data.SomeId = message.SomeId; + Context.StartSagaMessageReceived = true; + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(m => m.SomeId) + .ToSaga(s => s.SomeId); + ConfigureMapping(m => m.SomeId) + .ToSaga(s => s.SomeId); + } + + public void Handle(SomeEvent message) + { + RequestTimeout(TimeSpan.FromMilliseconds(100), message); + Context.SomeEventReceived = true; + } + + public void Timeout(SomeEvent message) + { + Context.TimeoutReceived = true; + MarkAsComplete(); + } + } + + public class TestSagaData : IContainSagaData + { + public Guid Id { get; set; } + public string Originator { get; set; } + public string OriginalMessageId { get; set; } + + [Unique] + public Guid SomeId { get; set; } + } + } + + [Serializable] + public class StartSagaMessage : ICommand + { + public Guid SomeId { get; set; } + } + + [Serializable] + public class SomeEvent : IEvent + { + public Guid SomeId { get; set; } + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_using_containSagaData.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_using_containSagaData.cs new file mode 100644 index 00000000000..54504ea65c8 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Sagas/When_using_containSagaData.cs @@ -0,0 +1,83 @@ +namespace NServiceBus.AcceptanceTests.Sagas +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using Saga; + using ScenarioDescriptors; + + // Repro for #SB-191 + public class When_using_containsagadata : NServiceBusAcceptanceTest + { + [Test] + public void Should_handle_timeouts_properly_when_using_NHibernate() + { + Scenario.Define() + .WithEndpoint( + b => b.Given(bus => bus.SendLocal(new StartSaga {DataId = Guid.NewGuid()}))) + .Done(c => c.DidAllSagaInstancesReceiveTimeouts) + .Repeat(r => r.For(Transports.SqlServer).For(SagaPersisters.NHibernate)) + .Should(c => + { + Assert.True(c.DidAllSagaInstancesReceiveTimeouts); + }) + .Run(); + } + + public class Context : ScenarioContext + { + public bool DidAllSagaInstancesReceiveTimeouts { get; set; } + } + + public class EndpointThatHostsASaga : EndpointConfigurationBuilder + { + public EndpointThatHostsASaga() + { + EndpointSetup(); + } + + public class SagaThatUsesNHibernatePersistence : Saga, + IAmStartedByMessages, + IHandleTimeouts + { + public Context Context { get; set; } + + public void Handle(StartSaga message) + { + Data.DataId = message.DataId; + + RequestTimeout(TimeSpan.FromSeconds(5), new TimeHasPassed()); + } + + public void Timeout(TimeHasPassed state) + { + MarkAsComplete(); + + Context.DidAllSagaInstancesReceiveTimeouts = true; + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(m => m.DataId).ToSaga(s => s.DataId); + } + + public class MySagaData : ContainSagaData + { + [Unique] + public virtual Guid DataId { get; set; } + } + + public class TimeHasPassed + { + } + } + } + + [Serializable] + public class StartSaga : ICommand + { + public Guid DataId { get; set; } + } + } +} diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllBuilders.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllBuilders.cs new file mode 100644 index 00000000000..c8b0bcca5df --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllBuilders.cs @@ -0,0 +1,18 @@ +namespace NServiceBus.AcceptanceTests.ScenarioDescriptors +{ + using NServiceBus.AcceptanceTesting.Support; + + public class AllBuilders:ScenarioDescriptor + { + public AllBuilders() + { + Add(Builders.Unity); + Add(Builders.Autofac); + Add(Builders.Windsor); + Add(Builders.Spring); + Add(Builders.Ninject); + Add(Builders.StructureMap); + + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllSagaPersisters.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllSagaPersisters.cs new file mode 100644 index 00000000000..ab71a0b9ab8 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllSagaPersisters.cs @@ -0,0 +1,14 @@ +namespace NServiceBus.AcceptanceTests.ScenarioDescriptors +{ + using AcceptanceTesting.Support; + + public class AllSagaPersisters : ScenarioDescriptor + { + public AllSagaPersisters() + { + Add(SagaPersisters.InMemory); + Add(SagaPersisters.Raven); + Add(SagaPersisters.NHibernate); + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllSerializers.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllSerializers.cs new file mode 100644 index 00000000000..ce90fdb1f81 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllSerializers.cs @@ -0,0 +1,15 @@ +namespace NServiceBus.AcceptanceTests.ScenarioDescriptors +{ + using NServiceBus.AcceptanceTesting.Support; + + public class AllSerializers : ScenarioDescriptor + { + public AllSerializers() + { + Add(Serializers.Bson); + Add(Serializers.Json); + Add(Serializers.Xml); + Add(Serializers.Binary); + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllSubscriptionStorages.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllSubscriptionStorages.cs new file mode 100644 index 00000000000..4b1cce819ad --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllSubscriptionStorages.cs @@ -0,0 +1,15 @@ +namespace NServiceBus.AcceptanceTests.ScenarioDescriptors +{ + using AcceptanceTesting.Support; + + public class AllSubscriptionStorages : ScenarioDescriptor + { + public AllSubscriptionStorages() + { + Add(SubscriptionStorages.InMemory); + Add(SubscriptionStorages.Raven); + Add(SubscriptionStorages.NHibernate); + Add(SubscriptionStorages.Msmq); + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllTransports.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllTransports.cs new file mode 100644 index 00000000000..a14b1916f9f --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/AllTransports.cs @@ -0,0 +1,112 @@ +namespace NServiceBus.AcceptanceTests.ScenarioDescriptors +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + using AcceptanceTesting.Support; + using Hosting.Helpers; + + public class AllTransports : ScenarioDescriptor + { + public AllTransports() + { + AddRange(ActiveTransports); + } + + static IEnumerable ActiveTransports + { + get + { + if (activeTransports == null) + { + activeTransports = new List(); + + var specificTransport = Environment.GetEnvironmentVariable("Transport.UseSpecific"); + + var excludedTransports = Environment.GetEnvironmentVariable("Transport.Excluded"); + + foreach (var transport in Transports.AllAvailable) + { + var key = transport.Key; + + if (!string.IsNullOrEmpty(specificTransport) && specificTransport != key) + { + Console.Out.WriteLine("Transport {0} excluded since the test suite is only specified to run for {1}", key, specificTransport); + continue; + } + if (!string.IsNullOrEmpty(excludedTransports) && excludedTransports.Contains(key)) + { + Console.Out.WriteLine("Transport {0} excluded since its included in the list of exclude transports {1}", key, excludedTransports); + continue; + } + + activeTransports.Add(transport); + } + } + + return activeTransports; + } + } + + static ICollection activeTransports; + } + + public class AllDtcTransports : AllTransports + { + public AllDtcTransports() + { + Remove(Transports.RabbitMQ); + } + } + + public class AllBrokerTransports : AllTransports + { + public AllBrokerTransports() + { + Remove(Transports.Msmq); + } + } + + public class AllTransportsWithCentralizedPubSubSupport : AllTransports + { + public AllTransportsWithCentralizedPubSubSupport() + { + Remove(Transports.Msmq); + Remove(Transports.SqlServer); + } + } + + public class AllTransportsWithMessageDrivenPubSub : AllTransports + { + public AllTransportsWithMessageDrivenPubSub() + { + Remove(Transports.ActiveMQ); + Remove(Transports.RabbitMQ); + } + } + + public class TypeScanner + { + + public static IEnumerable GetAllTypesAssignableTo() + { + return AvailableAssemblies.SelectMany(a => a.GetTypes()) + .Where(t => typeof (T).IsAssignableFrom(t) && t != typeof(T)) + .ToList(); + } + + static IEnumerable AvailableAssemblies + { + get + { + if (assemblies == null) + assemblies = AssemblyScanner.GetScannableAssemblies().Assemblies; + + return assemblies; + } + } + + static List assemblies; + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/Builders.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/Builders.cs new file mode 100644 index 00000000000..8ccf6c6b56b --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/Builders.cs @@ -0,0 +1,87 @@ +namespace NServiceBus.AcceptanceTests.ScenarioDescriptors +{ + using System.Collections.Generic; + using NServiceBus.AcceptanceTesting.Support; + using NServiceBus.ObjectBuilder.Autofac; + using NServiceBus.ObjectBuilder.CastleWindsor; + using NServiceBus.ObjectBuilder.Ninject; + using NServiceBus.ObjectBuilder.Spring; + using NServiceBus.ObjectBuilder.StructureMap; + using NServiceBus.ObjectBuilder.Unity; + + public static class Builders + { + public static readonly RunDescriptor Unity = new RunDescriptor + { + Key = "Unity", + Settings = + new Dictionary + { + { + "Builder", typeof (UnityObjectBuilder).AssemblyQualifiedName + } + } + }; + + public static readonly RunDescriptor Autofac = new RunDescriptor + { + Key = "Autofac", + Settings = + new Dictionary + { + { + "Builder", typeof (AutofacObjectBuilder).AssemblyQualifiedName + } + } + }; + + public static readonly RunDescriptor Windsor = new RunDescriptor + { + Key = "Windsor", + Settings = + new Dictionary + { + { + "Builder", typeof (WindsorObjectBuilder).AssemblyQualifiedName + } + } + }; + + public static readonly RunDescriptor Ninject = new RunDescriptor + { + Key = "Ninject", + Settings = + new Dictionary + { + { + "Builder", typeof (NinjectObjectBuilder).AssemblyQualifiedName + } + } + }; + + + public static readonly RunDescriptor Spring = new RunDescriptor + { + Key = "Spring", + Settings = + new Dictionary + { + { + "Builder", typeof (SpringObjectBuilder).AssemblyQualifiedName + } + } + }; + + public static readonly RunDescriptor StructureMap = new RunDescriptor + { + Key = "StructureMap", + Settings = + new Dictionary + { + { + "Builder", typeof (StructureMapObjectBuilder).AssemblyQualifiedName + } + } + }; + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/SagaPersisters.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/SagaPersisters.cs new file mode 100644 index 00000000000..4cc3a301413 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/SagaPersisters.cs @@ -0,0 +1,51 @@ +namespace NServiceBus.AcceptanceTests.ScenarioDescriptors +{ + using System.Collections.Generic; + using AcceptanceTesting.Support; + using NServiceBus.SagaPersisters.NHibernate; + using Persistence.InMemory.SagaPersister; + using Persistence.Raven.SagaPersister; + + public static class SagaPersisters + { + public static readonly RunDescriptor InMemory = new RunDescriptor + { + Key = "InMemorySagaPersister", + Settings = + new Dictionary + { + { + "SagaPersister", + typeof (InMemorySagaPersister).AssemblyQualifiedName + } + } + }; + + + public static readonly RunDescriptor Raven = new RunDescriptor + { + Key = "RavenSagaPersister", + Settings = + new Dictionary + { + { + "SagaPersister", + typeof (RavenSagaPersister).AssemblyQualifiedName + } + } + }; + + public static readonly RunDescriptor NHibernate = new RunDescriptor + { + Key = "NHibernateSagaPersister", + Settings = + new Dictionary + { + { + "SagaPersister", + typeof (SagaPersister).AssemblyQualifiedName + } + } + }; + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/Serializers.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/Serializers.cs new file mode 100644 index 00000000000..c15b82e117d --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/Serializers.cs @@ -0,0 +1,59 @@ +namespace NServiceBus.AcceptanceTests.ScenarioDescriptors +{ + using System.Collections.Generic; + using AcceptanceTesting.Support; + using NServiceBus.Serializers.Binary; + using NServiceBus.Serializers.Json; + using NServiceBus.Serializers.XML; + + public static class Serializers + { + public static readonly RunDescriptor Binary = new RunDescriptor + { + Key = "Binary", + Settings = + new Dictionary + { + { + "Serializer", typeof (BinaryMessageSerializer).AssemblyQualifiedName + } + } + }; + + public static readonly RunDescriptor Bson = new RunDescriptor + { + Key = "Bson", + Settings = + new Dictionary + { + { + "Serializer", typeof (BsonMessageSerializer).AssemblyQualifiedName + } + } + }; + + public static readonly RunDescriptor Xml = new RunDescriptor + { + Key = "Xml", + Settings = + new Dictionary + { + { + "Serializer", typeof (XmlMessageSerializer).AssemblyQualifiedName + } + } + }; + + public static readonly RunDescriptor Json = new RunDescriptor + { + Key = "Json", + Settings = + new Dictionary + { + { + "Serializer", typeof (JsonMessageSerializer).AssemblyQualifiedName + } + } + }; + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/SubscriptionStorages.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/SubscriptionStorages.cs new file mode 100644 index 00000000000..e92295568f2 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/SubscriptionStorages.cs @@ -0,0 +1,65 @@ +namespace NServiceBus.AcceptanceTests.ScenarioDescriptors +{ + using System.Collections.Generic; + using AcceptanceTesting.Support; + using Persistence.InMemory.SubscriptionStorage; + using Persistence.Msmq.SubscriptionStorage; + using Persistence.Raven.SubscriptionStorage; + using Unicast.Subscriptions.NHibernate; + + public static class SubscriptionStorages + { + public static readonly RunDescriptor InMemory = new RunDescriptor + { + Key = "InMemorySubscriptionStorage", + Settings = + new Dictionary + { + { + "SubscriptionStorage", + typeof (InMemorySubscriptionStorage).AssemblyQualifiedName + } + } + }; + + + public static readonly RunDescriptor Raven = new RunDescriptor + { + Key = "RavenSubscriptionStorage", + Settings = + new Dictionary + { + { + "SubscriptionStorage", + typeof (RavenSubscriptionStorage).AssemblyQualifiedName + } + } + }; + + public static readonly RunDescriptor NHibernate = new RunDescriptor + { + Key = "NHibernateSubscriptionStorage", + Settings = + new Dictionary + { + { + "SubscriptionStorage", + typeof (SubscriptionStorage).AssemblyQualifiedName + } + } + }; + + public static readonly RunDescriptor Msmq = new RunDescriptor + { + Key = "MsmqSubscriptionStorage", + Settings = + new Dictionary + { + { + "SubscriptionStorage", + typeof (MsmqSubscriptionStorage).AssemblyQualifiedName + } + } + }; + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/Transports.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/Transports.cs new file mode 100644 index 00000000000..5baf74259f3 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/ScenarioDescriptors/Transports.cs @@ -0,0 +1,113 @@ +namespace NServiceBus.AcceptanceTests.ScenarioDescriptors +{ + using System; + using System.Collections.Generic; + using System.Linq; + using AcceptanceTesting.Support; + using NServiceBus.Transports; + + public static class Transports + { + + public static IEnumerable AllAvailable + { + get + { + if (availableTransports == null) + availableTransports = GetAllAvailable().ToList(); + + return availableTransports; + } + } + + + public static RunDescriptor Default + { + get + { + var specificTransport = Environment.GetEnvironmentVariable("Transport.UseSpecific"); + + if (!string.IsNullOrEmpty(specificTransport)) + return AllAvailable.Single(r => r.Key == specificTransport); + + var transportsOtherThanMsmq = AllAvailable.Where(t => t != Msmq); + + if (transportsOtherThanMsmq.Count() == 1) + return transportsOtherThanMsmq.First(); + + return Msmq; + } + } + + public static RunDescriptor ActiveMQ + { + get { return AllAvailable.SingleOrDefault(r => r.Key == "ActiveMQ"); } + } + + public static RunDescriptor Msmq + { + get { return AllAvailable.SingleOrDefault(r => r.Key == "Msmq"); } + } + + public static RunDescriptor RabbitMQ + { + get { return AllAvailable.SingleOrDefault(r => r.Key == "RabbitMQ"); } + } + + + + public static RunDescriptor SqlServer + { + get { return AllAvailable.SingleOrDefault(r => r.Key == "SqlServer"); } + } + + static IEnumerable GetAllAvailable() + { + var foundTransportDefinitions = TypeScanner.GetAllTypesAssignableTo(); + + + foreach (var transportDefinitionType in foundTransportDefinitions) + { + var key = transportDefinitionType.Name; + + var runDescriptor = new RunDescriptor + { + Key = key, + Settings = + new Dictionary + { + {"Transport", transportDefinitionType.AssemblyQualifiedName} + } + }; + + var connectionString = Environment.GetEnvironmentVariable(key + ".ConnectionString"); + + if (string.IsNullOrEmpty(connectionString) && DefaultConnectionStrings.ContainsKey(key)) + connectionString = DefaultConnectionStrings[key]; + + + if (!string.IsNullOrEmpty(connectionString)) + { + runDescriptor.Settings.Add("Transport.ConnectionString", connectionString); + yield return runDescriptor; + } + else + { + Console.Out.WriteLine("No connection string found for transport: {0}, test will not be executed for this transport", key); + } + } + } + + static IList availableTransports; + + static readonly Dictionary DefaultConnectionStrings = new Dictionary + { + {"RabbitMQ", "host=localhost"}, + {"SqlServer", @"Server=localhost\sqlexpress;Database=nservicebus;Trusted_Connection=True;"}, + {"ActiveMQ", @"ServerUrl=activemq:tcp://localhost:61616"}, + {"Msmq", @"cacheSendConnection=false;journal=false;"} + }; + + + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Scheduling/When_scheduling_a_recurring_task.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Scheduling/When_scheduling_a_recurring_task.cs new file mode 100644 index 00000000000..0d665779c1d --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Scheduling/When_scheduling_a_recurring_task.cs @@ -0,0 +1,56 @@ +namespace NServiceBus.AcceptanceTests.Sagas +{ + using System; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using Saga; + using ScenarioDescriptors; + + public class When_scheduling_a_recurring_task : NServiceBusAcceptanceTest + { + [Test] + public void Should_execute_the_task() + { + Scenario.Define() + .WithEndpoint() + .Done(c => c.ScheduleActionInvoked) + .Repeat(r => r.For()) + .Run(TimeSpan.FromSeconds(60)); + } + + public class Context : ScenarioContext + { + public bool ScheduleActionInvoked { get; set; } + } + + public class SchedulingEndpoint : EndpointConfigurationBuilder + { + public SchedulingEndpoint() + { + EndpointSetup(); + } + + class SetupScheduledAction : IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Schedule.Every(TimeSpan.FromSeconds(5)) + .Action("MyTask", () => + { + Console.Out.WriteLine("Task invoked"); + Configure.Instance.Builder.Build() + .ScheduleActionInvoked = true; + }); + } + + public void Stop() + { + + } + } + } + } + + +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/FakePromotableResourceManager.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/FakePromotableResourceManager.cs new file mode 100644 index 00000000000..8e3adc74323 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/FakePromotableResourceManager.cs @@ -0,0 +1,54 @@ +namespace NServiceBus.AcceptanceTests.Transactions +{ + using System; + using System.Transactions; + + public class FakePromotableResourceManager : IPromotableSinglePhaseNotification, IEnlistmentNotification + { + public static Guid ResourceManagerId = Guid.Parse("6f057e24-a0d8-4c95-b091-b8dc9a916fa4"); + + public void Prepare(PreparingEnlistment preparingEnlistment) + { + preparingEnlistment.Prepared(); + } + + public void Commit(Enlistment enlistment) + { + enlistment.Done(); + } + + public void Rollback(Enlistment enlistment) + { + enlistment.Done(); + } + + public void InDoubt(Enlistment enlistment) + { + enlistment.Done(); + } + + + public void Initialize() + { + } + + public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment) + { + singlePhaseEnlistment.Committed(); + } + + public void Rollback(SinglePhaseEnlistment singlePhaseEnlistment) + { + singlePhaseEnlistment.Done(); + } + + public byte[] Promote() + { + return TransactionInterop.GetTransmitterPropagationToken(new CommittableTransaction()); + + } + + + } + +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_receiving_a_message_with_dtc_disabled.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_receiving_a_message_with_dtc_disabled.cs new file mode 100644 index 00000000000..0952371338c --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_receiving_a_message_with_dtc_disabled.cs @@ -0,0 +1,66 @@ +namespace NServiceBus.AcceptanceTests.Transactions +{ + using System; + using System.Transactions; + using AcceptanceTesting; + using EndpointTemplates; + using NUnit.Framework; + using ScenarioDescriptors; + + public class When_receiving_a_message_with_dtc_disabled : NServiceBusAcceptanceTest + { + [Test] + public void Should_not_escalate_a_single_durable_rm_to_dtc_tx() + { + + Scenario.Define() + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new MyMessage()))) + .Done(c => c.HandlerInvoked) + .Repeat(r => r.For()) + .Should(c => + { + //this check mainly applies to MSMQ who creates a DTC tx right of the bat if DTC is on + Assert.AreEqual(Guid.Empty, c.DistributedIdentifierBefore, "No DTC tx should exist before enlistment"); + Assert.True(c.CanEnlistPromotable, "A promotable RM should be able to enlist"); + }) + .Run(); + } + + public class Context : ScenarioContext + { + public bool HandlerInvoked { get; set; } + + public Guid DistributedIdentifierBefore { get; set; } + + public bool CanEnlistPromotable { get; set; } + } + + public class NonDTCEndpoint : EndpointConfigurationBuilder + { + public NonDTCEndpoint() + { + Configure.Transactions.Advanced(a => a.DisableDistributedTransactions()); + EndpointSetup(); + } + + public class MyMessageHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MyMessage messageThatIsEnlisted) + { + Context.DistributedIdentifierBefore = Transaction.Current.TransactionInformation.DistributedIdentifier; + + Context.CanEnlistPromotable = Transaction.Current.EnlistPromotableSinglePhase(new FakePromotableResourceManager()); + + Context.HandlerInvoked = true; + } + } + } + + [Serializable] + public class MyMessage : ICommand + { + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_receiving_a_message_with_dtc_enabled.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_receiving_a_message_with_dtc_enabled.cs new file mode 100644 index 00000000000..39604a4f656 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_receiving_a_message_with_dtc_enabled.cs @@ -0,0 +1,83 @@ +namespace NServiceBus.AcceptanceTests.Transactions +{ + using System; + using System.Transactions; + using AcceptanceTesting; + using EndpointTemplates; + using NUnit.Framework; + using ScenarioDescriptors; + + public class When_receiving_a_message_with_dtc_enabled : NServiceBusAcceptanceTest + { + [Test] + public void Should_enlist_the_receive_in_the_dtc_tx() + { + Scenario.Define() + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new MyMessage()))) + .Done(c => c.HandlerInvoked) + .Repeat(r => r.For()) + .Should(c => Assert.False(c.CanEnlistPromotable, "There should exists a DTC tx")) + .Run(); + } + + [Test] + public void Basic_assumptions_promotable_should_fail_if_durable_already_exists() + { + using (var tx = new TransactionScope()) + { + Transaction.Current.EnlistDurable(FakePromotableResourceManager.ResourceManagerId, new FakePromotableResourceManager(), EnlistmentOptions.None); + Assert.False(Transaction.Current.EnlistPromotableSinglePhase(new FakePromotableResourceManager())); ; + + tx.Complete(); + } + } + + + [Test] + public void Basic_assumptions_second_promotable_should_fail() + { + using (var tx = new TransactionScope()) + { + Assert.True(Transaction.Current.EnlistPromotableSinglePhase(new FakePromotableResourceManager())); ; + + Assert.False(Transaction.Current.EnlistPromotableSinglePhase(new FakePromotableResourceManager())); + + tx.Complete(); + } + } + + + public class Context : ScenarioContext + { + public bool HandlerInvoked { get; set; } + + public bool CanEnlistPromotable { get; set; } + } + + public class DTCEndpoint : EndpointConfigurationBuilder + { + public DTCEndpoint() + { + EndpointSetup(); + } + + public class MyMessageHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MyMessage messageThatIsEnlisted) + { + Context.CanEnlistPromotable = Transaction.Current.EnlistPromotableSinglePhase(new FakePromotableResourceManager()); + Context.HandlerInvoked = true; + } + } + } + + [Serializable] + public class MyMessage : ICommand + { + } + + + } +} diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_receiving_a_message_with_the_default_settings.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_receiving_a_message_with_the_default_settings.cs new file mode 100644 index 00000000000..65f142d647b --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_receiving_a_message_with_the_default_settings.cs @@ -0,0 +1,53 @@ +namespace NServiceBus.AcceptanceTests.Transactions +{ + using System; + using System.Transactions; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using ScenarioDescriptors; + + public class When_receiving_a_message_with_the_default_settings:NServiceBusAcceptanceTest + { + [Test] + public void Should_wrap_the_handler_pipeline_with_a_transactionscope() + { + Scenario.Define() + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new MyMessage()))) + .Done(c => c.HandlerInvoked) + .Repeat(r => r.For()) + .Should(c => Assert.True(c.AmbientTransactionExists, "There should exist an ambient transaction")) + .Run(); + } + + public class Context : ScenarioContext + { + public bool AmbientTransactionExists { get; set; } + public bool HandlerInvoked { get; set; } + } + + public class TransactionalEndpoint : EndpointConfigurationBuilder + { + public TransactionalEndpoint() + { + EndpointSetup(); + } + + public class MyMessageHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MyMessage messageThatIsEnlisted) + { + Context.AmbientTransactionExists = (Transaction.Current != null); + Context.HandlerInvoked = true; + } + } + } + + [Serializable] + public class MyMessage : ICommand + { + } + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_receiving_a_message_with_transactions_disabled.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_receiving_a_message_with_transactions_disabled.cs new file mode 100644 index 00000000000..409dc5c16fc --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_receiving_a_message_with_transactions_disabled.cs @@ -0,0 +1,82 @@ +namespace NServiceBus.AcceptanceTests.Transactions +{ + using System; + using System.Transactions; + using AcceptanceTesting; + using EndpointTemplates; + using NUnit.Framework; + using ScenarioDescriptors; + + public class When_receiving_a_message_with_transactions_disabled : NServiceBusAcceptanceTest + { + [Test] + public void Should_not_roll_the_message_back_to_the_queue_in_case_of_failure() + { + + Scenario.Define() + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new MyMessage()))) + .Done(c => c.TestComplete) + .Repeat(r => r.For()) + .Should(c => + { + Assert.AreEqual(1, c.TimesCalled, "Should not retry the message"); + }) + .Run(); + } + + public class Context : ScenarioContext + { + public bool TestComplete { get; set; } + + public int TimesCalled { get; set; } + } + + public class NonTransactionalEndpoint : EndpointConfigurationBuilder + { + public NonTransactionalEndpoint() + { + EndpointSetup(c => Configure.Transactions.Disable()); + } + + public class MyMessageHandler : IHandleMessages + { + public Context Context { get; set; } + + public IBus Bus { get; set; } + public void Handle(MyMessage message) + { + Context.TimesCalled++; + + using (new TransactionScope(TransactionScopeOption.Suppress)) + { + Bus.SendLocal(new CompleteTest()); + } + + throw new Exception("Simulated exception"); + } + } + + public class CompleteTestHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(CompleteTest message) + { + Context.TestComplete = true; + } + } + } + + [Serializable] + public class MyMessage : ICommand + { + } + + [Serializable] + public class CompleteTest : ICommand + { + } + + + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_sending_a_message_from_a_non_transactional_endpoint_with_a_ambient_transaction_enabled.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_sending_a_message_from_a_non_transactional_endpoint_with_a_ambient_transaction_enabled.cs new file mode 100644 index 00000000000..8ee50ed9251 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_sending_a_message_from_a_non_transactional_endpoint_with_a_ambient_transaction_enabled.cs @@ -0,0 +1,93 @@ +namespace NServiceBus.AcceptanceTests.Transactions +{ + using System; + using System.Transactions; + using AcceptanceTesting; + using EndpointTemplates; + using NUnit.Framework; + using ScenarioDescriptors; + + public class When_sending_a_message_from_a_non_transactional_endpoint_with_a_ambient_transaction_enabled : NServiceBusAcceptanceTest + { + [Test] + public void Should_not_roll_the_message_back_to_the_queue_in_case_of_failure() + { + + Scenario.Define() + .WithEndpoint(b => b.Given(bus => bus.SendLocal(new MyMessage()))) + .Done(c => c.TestComplete) + .Repeat(r => r.For(Transports.ActiveMQ)) + .Should(c => + { + Assert.False(c.MessageEnlistedInTheAmbientTxReceived, "The enlisted bus.Send should not commit"); + }) + .Run(); + } + + public class Context : ScenarioContext + { + public bool TestComplete { get; set; } + + public bool MessageEnlistedInTheAmbientTxReceived { get; set; } + } + + public class NonTransactionalEndpoint : EndpointConfigurationBuilder + { + public NonTransactionalEndpoint() + { + EndpointSetup(c => + { + Configure.Transactions.Disable(); + Configure.Transactions.Advanced(t => t.WrapHandlersExecutionInATransactionScope()); + }); + } + + public class MyMessageHandler : IHandleMessages + { + public Context Context { get; set; } + + public IBus Bus { get; set; } + public void Handle(MyMessage message) + { + Bus.SendLocal(new CompleteTest + { + EnlistedInTheAmbientTx = true + }); + + using (new TransactionScope(TransactionScopeOption.Suppress)) + { + Bus.SendLocal(new CompleteTest()); + } + + throw new Exception("Simulated exception"); + } + } + + public class CompleteTestHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(CompleteTest message) + { + if (!Context.MessageEnlistedInTheAmbientTxReceived) + Context.MessageEnlistedInTheAmbientTxReceived = message.EnlistedInTheAmbientTx; + + Context.TestComplete = true; + } + } + } + + [Serializable] + public class MyMessage : ICommand + { + } + + [Serializable] + public class CompleteTest : ICommand + { + public bool EnlistedInTheAmbientTx { get; set; } + } + + + } +} \ No newline at end of file diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_sending_messages_within_an_ambient_transaction.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_sending_messages_within_an_ambient_transaction.cs new file mode 100644 index 00000000000..2b911a3f777 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Transactions/When_sending_messages_within_an_ambient_transaction.cs @@ -0,0 +1,129 @@ +namespace NServiceBus.AcceptanceTests.Transactions +{ + using System; + using System.Threading; + using System.Transactions; + using EndpointTemplates; + using AcceptanceTesting; + using NUnit.Framework; + using ScenarioDescriptors; + + [TestFixture] + public class When_sending_messages_within_an_ambient_transaction : NServiceBusAcceptanceTest + { + [Test] + public void Should_not_deliver_them_until_the_commit_phase() + { + Scenario.Define() + .WithEndpoint(b => b.Given((bus, context) => + { + using (var tx = new TransactionScope()) + { + bus.Send(new MessageThatIsEnlisted { SequenceNumber = 1 }); + bus.Send(new MessageThatIsEnlisted { SequenceNumber = 2 }); + + //send another message as well so that we can check the order in the receiver + using (new TransactionScope(TransactionScopeOption.Suppress)) + { + bus.Send(new MessageThatIsNotEnlisted()); + } + + tx.Complete(); + } + })) + .Done(c => c.MessageThatIsNotEnlistedHandlerWasCalled && c.TimesCalled >= 2) + .Repeat(r => r.For(Transports.SqlServer)) //not stable for sqlserver + .Should(c => + { + Assert.AreEqual(1, c.SequenceNumberOfFirstMessage,"The transport should preserve the order in which the transactional messages are delivered to the queuing system"); + Assert.True(c.NonTransactionalHandlerCalledFirst,"The non transactional handler should be called first"); + } + ) + .Run(); + } + + [Test] + public void Should_not_deliver_them_on_rollback() + { + Scenario.Define() + .WithEndpoint(b => b.Given(bus => + { + using (new TransactionScope()) + { + bus.Send(new MessageThatIsEnlisted()); + + //rollback + } + + bus.Send(new MessageThatIsNotEnlisted()); + + })) + .Done(c => c.MessageThatIsNotEnlistedHandlerWasCalled) + .Repeat(r => r.For()) + .Should(c => Assert.False(c.MessageThatIsEnlistedHandlerWasCalled, "The transactional handler should not be called")) + .Run(); + } + + public class Context : ScenarioContext + { + public bool MessageThatIsEnlistedHandlerWasCalled { get; set; } + + public bool MessageThatIsNotEnlistedHandlerWasCalled { get; set; } + public int TimesCalled { get; set; } + + public int SequenceNumberOfFirstMessage { get; set; } + + public bool NonTransactionalHandlerCalledFirst { get; set; } + } + + public class TransactionalEndpoint : EndpointConfigurationBuilder + { + public TransactionalEndpoint() + { + EndpointSetup() + .AddMapping(typeof(TransactionalEndpoint)) + .AddMapping(typeof(TransactionalEndpoint)); + } + + public class MessageThatIsEnlistedHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MessageThatIsEnlisted messageThatIsEnlisted) + { + Context.MessageThatIsEnlistedHandlerWasCalled = true; + Context.TimesCalled++; + + if (Context.SequenceNumberOfFirstMessage == 0) + { + Context.SequenceNumberOfFirstMessage = messageThatIsEnlisted.SequenceNumber; + } + } + } + + public class MessageThatIsNotEnlistedHandler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(MessageThatIsNotEnlisted messageThatIsNotEnlisted) + { + Context.MessageThatIsNotEnlistedHandlerWasCalled = true; + Context.NonTransactionalHandlerCalledFirst = !Context.MessageThatIsEnlistedHandlerWasCalled; + } + } + } + + + [Serializable] + public class MessageThatIsEnlisted : ICommand + { + public int SequenceNumber { get; set; } + } + [Serializable] + public class MessageThatIsNotEnlisted : ICommand + { + } + + + } +} diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/Versioning/When_multiple_versions_of_a_message_is_published.cs b/AcceptanceTests/NServiceBus.AcceptanceTests/Versioning/When_multiple_versions_of_a_message_is_published.cs new file mode 100644 index 00000000000..21e71902837 --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/Versioning/When_multiple_versions_of_a_message_is_published.cs @@ -0,0 +1,125 @@ +namespace NServiceBus.AcceptanceTests.Versioning +{ + using EndpointTemplates; + using AcceptanceTesting; + using Features; + using NUnit.Framework; + using PubSub; + using ScenarioDescriptors; + + [TestFixture] + public class When_multiple_versions_of_a_message_is_published : NServiceBusAcceptanceTest + { + [Test] + public void Should_deliver_is_to_both_v1_and_vX_subscribers() + { + Scenario.Define() + .WithEndpoint(b => + b.Given((bus, context) => Subscriptions.OnEndpointSubscribed(s => + { + if (s.SubscriberReturnAddress.Queue.Contains("V1Subscriber")) + context.V1Subscribed = true; + + if (s.SubscriberReturnAddress.Queue.Contains("V2Subscriber")) + context.V2Subscribed = true; + }) + ) + .When(c => c.V1Subscribed && c.V2Subscribed, (bus, c) => bus.Publish(e => + { + e.SomeData = 1; + e.MoreInfo = "dasd"; + }))) + .WithEndpoint(b => b.Given((bus,c) => + { + bus.Subscribe(); + if (!Feature.IsEnabled()) + c.V1Subscribed = true; + })) + .WithEndpoint(b => b.Given((bus,c) => + { + bus.Subscribe(); + if (!Feature.IsEnabled()) + c.V2Subscribed = true; + })) + .Done(c => c.V1SubscriberGotTheMessage && c.V2SubscriberGotTheMessage) + .Repeat(r =>r.For(Transports.ActiveMQ) //until #1098 is fixed + .For(Serializers.Binary)) //versioning isn't supported for binary serialization + .Should(c => + { + //put asserts in here if needed + }) + .Run(); + } + + public class Context : ScenarioContext + { + public bool V1SubscriberGotTheMessage { get; set; } + + public bool V2SubscriberGotTheMessage { get; set; } + + public bool V1Subscribed { get; set; } + + public bool V2Subscribed { get; set; } + } + + public class V2Publisher : EndpointConfigurationBuilder + { + public V2Publisher() + { + EndpointSetup(); + + } + } + public class V1Subscriber : EndpointConfigurationBuilder + { + public V1Subscriber() + { + EndpointSetup() + .ExcludeType() + .AddMapping(typeof(V2Publisher)); + + } + + + class V1Handler:IHandleMessages + { + public Context Context { get; set; } + public void Handle(V1Event message) + { + Context.V1SubscriberGotTheMessage = true; + } + } + } + + + public class V2Subscriber : EndpointConfigurationBuilder + { + public V2Subscriber() + { + EndpointSetup() + .AddMapping(typeof(V2Publisher)); + } + + class V2Handler : IHandleMessages + { + public Context Context { get; set; } + + public void Handle(V2Event message) + { + Context.V2SubscriberGotTheMessage = true; + } + } + } + + + public interface V1Event : IEvent + { + int SomeData { get; set; } + } + + public interface V2Event : V1Event + { + string MoreInfo { get; set; } + } + } +} diff --git a/AcceptanceTests/NServiceBus.AcceptanceTests/packages.config b/AcceptanceTests/NServiceBus.AcceptanceTests/packages.config new file mode 100644 index 00000000000..116bfd1cd5b --- /dev/null +++ b/AcceptanceTests/NServiceBus.AcceptanceTests/packages.config @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000000..412ef32c17e --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,42 @@ +# How to contribute + +We love getting patches to NServiceBus from our awesome community. Here is a few guidelines that we +need contributors to follow so that we can have a chance of keeping on +top of things. + +## Getting Started + +* Make sure you have a [GitHub account](https://github.com/signup/free) +* [Create a new issue](https://github.com/NServiceBus/NServiceBus/issues/new), assuming one does not already exist. + * Clearly describe the issue including steps to reproduce when it is a bug. + * If it is a bug make sure you tell us what version you have encountered this bug on. +* Fork the repository on GitHub + +## Making Changes + +* Create a feature branch from where you want to base your work. + * This is usually the develop branch since we never do any work off our master branch. The master is always our latest stable release + * Only target release branches if you are certain your fix must be on that + branch. + * To quickly create a feature branch based on develop; `git branch + fix/develop/my_contribution` then checkout the new branch with `git + checkout fix/develop/my_contribution`. Please avoid working directly on the + `develop` branch. +* Make commits of logical units. +* Check for unnecessary whitespace with `git diff --check` before committing. +* Make sure your commit messages are in the proper format. +* Make sure you have added the necessary tests for your changes. +* Run build.bat in the root to assure nothing else was accidentally broken. +* We have a resharper layer that applies our coding standards so make sure that you're "all green in reshaper" + + +## Submitting Changes + +* Sign the [Contributor License Agreement](http://nservicebus.com/contributors/signup). +* Push your changes to a feature branch in your fork of the repository. +* Submit a pull request to the NServiceBus repository + +# Additional Resources + +* [General GitHub documentation](http://help.github.com/) +* [GitHub pull request documentation](http://help.github.com/send-pull-requests/) diff --git a/Samples/DataBus/.nuget/NuGet.Config b/IntegrationTests/ActiveMQ/.nuget/NuGet.Config similarity index 100% rename from Samples/DataBus/.nuget/NuGet.Config rename to IntegrationTests/ActiveMQ/.nuget/NuGet.Config diff --git a/IntegrationTests/ActiveMQ/.nuget/NuGet.exe b/IntegrationTests/ActiveMQ/.nuget/NuGet.exe new file mode 100644 index 00000000000..4645f4b35e8 Binary files /dev/null and b/IntegrationTests/ActiveMQ/.nuget/NuGet.exe differ diff --git a/Samples/DataBus/.nuget/NuGet.targets b/IntegrationTests/ActiveMQ/.nuget/NuGet.targets similarity index 100% rename from Samples/DataBus/.nuget/NuGet.targets rename to IntegrationTests/ActiveMQ/.nuget/NuGet.targets diff --git a/IntegrationTests/ActiveMQ/ActiveMq.sln b/IntegrationTests/ActiveMQ/ActiveMq.sln new file mode 100644 index 00000000000..55c1415c3ce --- /dev/null +++ b/IntegrationTests/ActiveMQ/ActiveMq.sln @@ -0,0 +1,56 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyMessages", "MyMessages\MyMessages.csproj", "{5686FE6C-A5E3-40D1-A6BD-25F94DA612F8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyPublisher", "MyPublisher\MyPublisher.csproj", "{7036A49B-359F-4BC7-AFBA-DE3C7AB41986}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Subscriber1", "Subscriber1\Subscriber1.csproj", "{28DE496A-3885-410E-A0B8-004FAEFF9378}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Subscriber2", "Subscriber2\Subscriber2.csproj", "{6A699A4E-F2FD-4B71-AF73-199B499482BD}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{B27A2AC1-C4DC-424F-89BC-87C69F7A1D01}" + ProjectSection(SolutionItems) = preProject + .nuget\NuGet.exe = .nuget\NuGet.exe + .nuget\NuGet.targets = .nuget\NuGet.targets + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NMSPublisher", "NMSPublisher\NMSPublisher.csproj", "{F34154FC-B995-4B3C-BD8A-0273655C5206}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NMSConsumer", "NMSConsumer\NMSConsumer.csproj", "{8116EF80-857D-4A19-846B-9B9EFF0A5E04}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8}.Release|Any CPU.Build.0 = Release|Any CPU + {7036A49B-359F-4BC7-AFBA-DE3C7AB41986}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7036A49B-359F-4BC7-AFBA-DE3C7AB41986}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7036A49B-359F-4BC7-AFBA-DE3C7AB41986}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7036A49B-359F-4BC7-AFBA-DE3C7AB41986}.Release|Any CPU.Build.0 = Release|Any CPU + {28DE496A-3885-410E-A0B8-004FAEFF9378}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28DE496A-3885-410E-A0B8-004FAEFF9378}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28DE496A-3885-410E-A0B8-004FAEFF9378}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28DE496A-3885-410E-A0B8-004FAEFF9378}.Release|Any CPU.Build.0 = Release|Any CPU + {6A699A4E-F2FD-4B71-AF73-199B499482BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6A699A4E-F2FD-4B71-AF73-199B499482BD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6A699A4E-F2FD-4B71-AF73-199B499482BD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6A699A4E-F2FD-4B71-AF73-199B499482BD}.Release|Any CPU.Build.0 = Release|Any CPU + {F34154FC-B995-4B3C-BD8A-0273655C5206}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F34154FC-B995-4B3C-BD8A-0273655C5206}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F34154FC-B995-4B3C-BD8A-0273655C5206}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F34154FC-B995-4B3C-BD8A-0273655C5206}.Release|Any CPU.Build.0 = Release|Any CPU + {8116EF80-857D-4A19-846B-9B9EFF0A5E04}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8116EF80-857D-4A19-846B-9B9EFF0A5E04}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8116EF80-857D-4A19-846B-9B9EFF0A5E04}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8116EF80-857D-4A19-846B-9B9EFF0A5E04}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/IntegrationTests/ActiveMQ/MyMessages/Messages.cs b/IntegrationTests/ActiveMQ/MyMessages/Messages.cs new file mode 100644 index 00000000000..443121dec6e --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyMessages/Messages.cs @@ -0,0 +1,129 @@ +using System; +using NServiceBus; + +namespace MyMessages +{ + [Serializable] + public class EventMessage : IMyEvent + { + public Guid EventId { get; set; } + public DateTime? Time { get; set; } + public TimeSpan Duration { get; set; } + } + + public interface IMyEvent : IEvent + { + Guid EventId { get; set; } + DateTime? Time { get; set; } + TimeSpan Duration { get; set; } + } + + public interface IMyCommand : ICommand + { + Guid CommandId { get; set; } + DateTime? Time { get; set; } + TimeSpan Duration { get; set; } + bool ThrowExceptionDuringProcessing { get; set; } + } +} + +namespace MyMessages.Other +{ + [Serializable] + public class AnotherEventMessage : IMyEvent + { + public Guid EventId { get; set; } + public DateTime? Time { get; set; } + public TimeSpan Duration { get; set; } + } +} + +namespace MyMessages.Subscriber1 +{ + public class MyRequest1 : IMyCommand + { + public Guid CommandId { get; set; } + public DateTime? Time { get; set; } + public TimeSpan Duration { get; set; } + public bool ThrowExceptionDuringProcessing { get; set; } + } +} + +namespace MyMessages.Subscriber2 +{ + public interface IMyRequest2 : IMyCommand + { + } +} + +namespace MyMessages.SubscriberNMS +{ + public class MyRequestNMS : IMyCommand + { + public Guid CommandId { get; set; } + public DateTime? Time { get; set; } + public TimeSpan Duration { get; set; } + public bool ThrowExceptionDuringProcessing { get; set; } + } +} + +namespace MyMessages.DataBus +{ + [TimeToBeReceived("00:01:00")]//the data bus is allowed to clean up transmitted properties older than the TTBR + public class MessageWithLargePayload : ICommand + { + public string SomeProperty { get; set; } + public DataBusProperty LargeBlob { get; set; } + } +} + +namespace MyMessages.Publisher +{ + public enum ResponseCode + { + Ok, + Failed + }; + + public class ResponseToPublisher : IMessage + { + public Guid ResponseId { get; set; } + public DateTime? Time { get; set; } + public TimeSpan Duration { get; set; } + } + + public class DeferedMessage : IMessage + { + public DeferedMessage() + { + this.Id = Guid.NewGuid(); + } + + public Guid Id { get; private set; } + } + + public class LocalCommand : IMyCommand + { + public Guid CommandId { get; set; } + public DateTime? Time { get; set; } + public TimeSpan Duration { get; set; } + public bool ThrowExceptionDuringProcessing { get; set; } + } + + public class StartSagaMessage : IMessage + { + public Guid OrderId { get; set; } + } + + public class CompleteSagaMessage : IMessage + { + public Guid OrderId { get; set; } + + public bool ThrowDuringCompletion { get; set; } + } + + public class StartedSaga : IMessage + { + public Guid OrderId { get; set; } + } +} diff --git a/IntegrationTests/ActiveMQ/MyMessages/MyMessages.csproj b/IntegrationTests/ActiveMQ/MyMessages/MyMessages.csproj new file mode 100644 index 00000000000..828c9fdd3b8 --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyMessages/MyMessages.csproj @@ -0,0 +1,61 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8} + Library + Properties + MyMessages + MyMessages + + + + + v4.0 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\binaries\NServiceBus.dll + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/MyMessages/Properties/AssemblyInfo.cs b/IntegrationTests/ActiveMQ/MyMessages/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..983a52a727e --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyMessages/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyMessages")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyMessages")] +[assembly: AssemblyCopyright("Copyright © 2007")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5e94a240-87cd-470f-9633-adffc9532a22")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IntegrationTests/ActiveMQ/MyPublisher/App.config b/IntegrationTests/ActiveMQ/MyPublisher/App.config new file mode 100644 index 00000000000..960b83c4bee --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/App.config @@ -0,0 +1,43 @@ + + + +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IntegrationTests/ActiveMQ/MyPublisher/DeferedMessageHandler.cs b/IntegrationTests/ActiveMQ/MyPublisher/DeferedMessageHandler.cs new file mode 100644 index 00000000000..e325fbaea1a --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/DeferedMessageHandler.cs @@ -0,0 +1,19 @@ +namespace MyPublisher +{ + using System; + + using MyMessages.Publisher; + + using NServiceBus; + + public class DeferedMessageHandler : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(DeferedMessage message) + { + Console.WriteLine("{0} - Deferred message with id {1} processed.", DateTime.Now.ToLongTimeString(), message.Id); + Console.WriteLine("=========================================================================="); + } + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/MyPublisher/EndpointConfig.cs b/IntegrationTests/ActiveMQ/MyPublisher/EndpointConfig.cs new file mode 100644 index 00000000000..a10716d9e5d --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/EndpointConfig.cs @@ -0,0 +1,23 @@ +namespace MyPublisher +{ + using NServiceBus; + using NServiceBus.Features; + + class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher,IWantCustomInitialization + { + public static string BasePath = "..\\..\\..\\storage"; + + public void Init() + { + var config = Configure.With() + //this overrides the NServiceBus default convention of IEvent + .DefaultBuilder() + .FileShareDataBus(BasePath) + .UseTransport( + () => + "ServerUrl=failover:(tcp://localhost:61616,tcp://localhost:61616)?transport.randomize=false&transport.timeout=5000"); + + Configure.Features.Disable(); + } + } +} diff --git a/IntegrationTests/ActiveMQ/MyPublisher/LocalCommandMessageHandler.cs b/IntegrationTests/ActiveMQ/MyPublisher/LocalCommandMessageHandler.cs new file mode 100644 index 00000000000..01d0e84249d --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/LocalCommandMessageHandler.cs @@ -0,0 +1,22 @@ +namespace MyPublisher +{ + using System; + + using MyMessages.Publisher; + + using NServiceBus; + + public class LocalCommandMessageHandler : IHandleMessages + { + public void Handle(LocalCommand message) + { + Console.WriteLine("Received local command {0}.", message.CommandId); + + if (message.ThrowExceptionDuringProcessing) + { + Console.WriteLine("Throwing Exception"); + throw new Exception(); + } + } + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/MyPublisher/MyPublisher.csproj b/IntegrationTests/ActiveMQ/MyPublisher/MyPublisher.csproj new file mode 100644 index 00000000000..5559197fbd9 --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/MyPublisher.csproj @@ -0,0 +1,113 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {7036A49B-359F-4BC7-AFBA-DE3C7AB41986} + Library + Properties + MyPublisher + MyPublisher + + + + + v4.0 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Apache.NMS.1.5.1\lib\net40\Apache.NMS.dll + + + False + ..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll + + + False + ..\..\..\binaries\log4net.dll + + + ..\..\..\binaries\NServiceBus.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + ..\..\..\binaries\NServiceBus.Notifications.dll + + + ..\..\..\binaries\NServiceBus.Transports.ActiveMQ.dll + + + ..\packages\Spring.Core.1.3.2\lib\net40\Spring.Core.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + PreserveNewest + + + + + + {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8} + MyMessages + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + NServiceBus.Integration + + + \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/MyPublisher/NServiceBus.Host.exe.config b/IntegrationTests/ActiveMQ/MyPublisher/NServiceBus.Host.exe.config new file mode 100644 index 00000000000..55afed52044 --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/NServiceBus.Host.exe.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/MyPublisher/Properties/AssemblyInfo.cs b/IntegrationTests/ActiveMQ/MyPublisher/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..f8865c60bca --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyPublisher")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyPublisher")] +[assembly: AssemblyCopyright("Copyright © 2007")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("6d0a1864-1cf8-4f8a-90ae-bc3fda6179d9")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IntegrationTests/ActiveMQ/MyPublisher/ResponseToPublisherHandler.cs b/IntegrationTests/ActiveMQ/MyPublisher/ResponseToPublisherHandler.cs new file mode 100644 index 00000000000..347a13e24c6 --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/ResponseToPublisherHandler.cs @@ -0,0 +1,14 @@ +namespace MyPublisher +{ + using System; + using MyMessages.Publisher; + using NServiceBus; + + public class ResponseToPublisherHandler : IHandleMessages + { + public void Handle(ResponseToPublisher message) + { + Console.WriteLine("Received response Message: {0}", message.ResponseId); + } + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/MyPublisher/Saga/MyTimeOutState.cs b/IntegrationTests/ActiveMQ/MyPublisher/Saga/MyTimeOutState.cs new file mode 100644 index 00000000000..ddc891c5cc4 --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/Saga/MyTimeOutState.cs @@ -0,0 +1,7 @@ +namespace MyPublisher.Saga +{ + public class MyTimeOutState + { + public int SomeValue { get; set; } + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/MyPublisher/Saga/SimpleSaga.cs b/IntegrationTests/ActiveMQ/MyPublisher/Saga/SimpleSaga.cs new file mode 100644 index 00000000000..52da8e6bad6 --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/Saga/SimpleSaga.cs @@ -0,0 +1,68 @@ +namespace MyPublisher.Saga +{ + using System; + + using MyMessages.Publisher; + using MyMessages.Subscriber1; + + using NServiceBus; + using NServiceBus.Saga; + + public class SimpleSaga : Saga, + IAmStartedByMessages, + IHandleMessages, + IHandleTimeouts + { + public void Handle(StartSagaMessage message) + { + this.Data.OrderId = message.OrderId; + var someState = new Random().Next(10); + + this.RequestTimeout(TimeSpan.FromSeconds(5), t => t.SomeValue = someState); + this.RequestTimeout(TimeSpan.FromSeconds(8), t => t.SomeValue = someState); + this.RequestTimeout(TimeSpan.FromSeconds(11), t => t.SomeValue = someState); + + // this.ReplyToOriginator(m => m.OrderId = this.Data.OrderId); + } + + public override void ConfigureHowToFindSaga() + { + this.ConfigureMapping(s => s.OrderId).ToSaga(m => m.OrderId); + this.ConfigureMapping(s => s.OrderId).ToSaga(m => m.OrderId); + } + + void LogMessage(string message) + { + Console.WriteLine("{0} - {1} - SagaId:{2}", DateTime.Now.ToLongTimeString(), message, this.Data.Id); + } + + public void Timeout(MyTimeOutState state) + { + this.LogMessage("Timeout fired fo saga {0}, with state: " + state.SomeValue); + + this.LogMessage("Marking the saga as complete, be aware that this will remove the document from the storage (RavenDB)"); + this.MarkAsComplete(); + } + + public void Handle(CompleteSagaMessage message) + { + this.LogMessage("Completing Saga"); + this.LogMessage("Marking the saga as complete, be aware that this will remove the document from the storage (RavenDB)"); + + this.MarkAsComplete(); + this.Bus.Send( + r => + { + r.Time = DateTime.UtcNow; + r.Duration = TimeSpan.FromMinutes(10); + r.CommandId = Guid.NewGuid(); + }); + + if (message.ThrowDuringCompletion) + { + this.LogMessage("Throwing exception"); + throw new Exception(); + } + } + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/MyPublisher/Saga/SimpleSagaData.cs b/IntegrationTests/ActiveMQ/MyPublisher/Saga/SimpleSagaData.cs new file mode 100644 index 00000000000..b0e14881f80 --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/Saga/SimpleSagaData.cs @@ -0,0 +1,16 @@ +namespace MyPublisher.Saga +{ + using System; + + using NServiceBus.Saga; + + public class SimpleSagaData : IContainSagaData + { + public Guid Id { get; set; } + public string Originator { get; set; } + public string OriginalMessageId { get; set; } + + [Unique] + public Guid OrderId { get; set; } + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/MyPublisher/Scheduling/ScheduleATask.cs b/IntegrationTests/ActiveMQ/MyPublisher/Scheduling/ScheduleATask.cs new file mode 100644 index 00000000000..6564da52fb6 --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/Scheduling/ScheduleATask.cs @@ -0,0 +1,8 @@ +namespace MyPublisher.Scheduling +{ + using NServiceBus; + + public class ScheduleATask : IMessage + { + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/MyPublisher/Scheduling/ScheduleATaskHandler.cs b/IntegrationTests/ActiveMQ/MyPublisher/Scheduling/ScheduleATaskHandler.cs new file mode 100644 index 00000000000..3c1a11a8def --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/Scheduling/ScheduleATaskHandler.cs @@ -0,0 +1,22 @@ +namespace MyPublisher.Scheduling +{ + using System; + + using NServiceBus; + + public class ScheduleATaskHandler : IHandleMessages + { + private readonly IBus bus; + + public ScheduleATaskHandler(IBus bus) + { + this.bus = bus; + } + + public void Handle(ScheduleATask message) + { + Console.WriteLine("Scheduling a task to be executed every 1 minute"); + Schedule.Every(TimeSpan.FromSeconds(6)).Action(() => this.bus.SendLocal(new ScheduledTaskExecuted())); + } + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/MyPublisher/Scheduling/ScheduledTaskExecuted.cs b/IntegrationTests/ActiveMQ/MyPublisher/Scheduling/ScheduledTaskExecuted.cs new file mode 100644 index 00000000000..9e8c69ab19f --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/Scheduling/ScheduledTaskExecuted.cs @@ -0,0 +1,8 @@ +namespace MyPublisher.Scheduling +{ + using NServiceBus; + + public class ScheduledTaskExecuted : IMessage + { + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/MyPublisher/Scheduling/ScheduledTaskExecutedHandler.cs b/IntegrationTests/ActiveMQ/MyPublisher/Scheduling/ScheduledTaskExecutedHandler.cs new file mode 100644 index 00000000000..7b420398e66 --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/Scheduling/ScheduledTaskExecutedHandler.cs @@ -0,0 +1,14 @@ +namespace MyPublisher.Scheduling +{ + using System; + + using NServiceBus; + + public class ScheduledTaskExecutedHandler : IHandleMessages + { + public void Handle(ScheduledTaskExecuted message) + { + Console.WriteLine("ScheduledTaskExecuted handler executed"); + } + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/MyPublisher/ServerEndpoint.cs b/IntegrationTests/ActiveMQ/MyPublisher/ServerEndpoint.cs new file mode 100644 index 00000000000..99e28ce1d8f --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/ServerEndpoint.cs @@ -0,0 +1,311 @@ +using System; +using MyMessages; +using MyMessages.DataBus; +using MyMessages.Other; +using NServiceBus; + +namespace MyPublisher +{ + using System.Threading; + using System.Transactions; + + using MyMessages.Publisher; + using MyMessages.Subscriber1; + using MyMessages.Subscriber2; + using MyMessages.SubscriberNMS; + + using MyPublisher.Scheduling; + + public class MyMessage1Handler : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(MyRequest1 message) + { + Console.WriteLine("Message1"); + using (var tx = new TransactionScope(TransactionScopeOption.RequiresNew)) + { + var localCommand = new LocalCommand { CommandId = Guid.NewGuid(), }; + this.Bus.SendLocal(localCommand); + + tx.Complete(); + } + + throw new Exception(); + } + } + + internal class TestSinglePhaseCommit : ISinglePhaseNotification + { + public void Prepare(PreparingEnlistment preparingEnlistment) + { + Console.WriteLine("Tx Prepare"); + preparingEnlistment.Prepared(); + } + public void Commit(Enlistment enlistment) + { + Console.WriteLine("Tx Commit"); + enlistment.Done(); + } + + public void Rollback(Enlistment enlistment) + { + Console.WriteLine("Tx Rollback"); + enlistment.Done(); + } + public void InDoubt(Enlistment enlistment) + { + Console.WriteLine("Tx InDoubt"); + enlistment.Done(); + } + public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment) + { + Console.WriteLine("Tx SinglePhaseCommit"); + singlePhaseEnlistment.Committed(); + //singlePhaseEnlistment.Aborted(); + } + } + + public class ServerEndpoint : IWantToRunWhenBusStartsAndStops + { + private static Random randomizer = new Random(); + + private int nextEventToPublish = 0; + private int nextCommandToPublish = 0; + private bool failSagaCompletion = false; + + public IBus Bus { get; set; } + + public void Start() + { + Console.WriteLine("Press 'e' to publish an IEvent, EventMessage, and AnotherEventMessage alternately."); + Console.WriteLine("Press 'b' to send a command with large payload to Subscriber1"); + Console.WriteLine("Press 'c' to send a command to Subscriber1, Subscriber2, SubscriberNMS alternately"); + Console.WriteLine("Press 's' to start a saga locally"); + Console.WriteLine("Press 'x' to start a saga locally and complete it before timeout. Completion fails every second time"); + Console.WriteLine("Press 'd' to defer a command locally"); + Console.WriteLine("Press 'l' to send a command locally"); + Console.WriteLine("Press 'n' to send a notification."); + Console.WriteLine("Press 't' to schedule a task."); + Console.WriteLine("Press 'q' to exit"); + + while (true) + { + var key = Console.ReadKey(); + switch (key.KeyChar) + { + case 'q': + return; + case 'e': + this.PublishEvent(); + break; + case 'b': + this.SendOverDataBus(); + break; + case 'c': + this.SendCommand(); + break; + case 's': + this.StartSaga(); + break; + case 'x': + this.StartSagaAndCompleteBeforeTimeout(this.failSagaCompletion); + this.failSagaCompletion = !this.failSagaCompletion; + break; + case 'd': + this.DeferCommand(); + break; + case 'l': + this.SendCommandLocal(); + break; + case 'n': + this.SendNotification(); + break; + case 't': + this.ScheduleTask(); + break; + case 'z': + this.Test(); + break; + } + } + } + + private static TestSinglePhaseCommit x = new TestSinglePhaseCommit(); + private static Guid guid = Guid.NewGuid(); + private void Test() + { + { + Console.WriteLine("Send 1"); + + using (var scope = new TransactionScope(TransactionScopeOption.RequiresNew, TimeSpan.FromSeconds(10))) + { + Transaction.Current.EnlistDurable(guid, x, EnlistmentOptions.None); + + var commandMessage = this.Bus.CreateInstance(); + commandMessage.CommandId = Guid.NewGuid(); + commandMessage.Time = DateTime.Now.Second > -1 ? (DateTime?)DateTime.Now : null; + commandMessage.Duration = TimeSpan.FromSeconds(99999D); + + this.Bus.Send(commandMessage); + scope.Complete(); + } + + Console.WriteLine("Done"); + } + }/* + + private void Test() + { + Bus.SendLocal(m => { }); + }*/ + + private void SendOverDataBus() + { + Bus.Send(m => + { + m.SomeProperty = + "This message contains a large blob that will be sent on the data bus"; + m.LargeBlob = + new DataBusProperty(new byte[1024 * 1024 * 5]); + //5MB + }); + } + + private void ScheduleTask() + { + Bus.SendLocal(new ScheduleATask()); + } + + private void SendNotification() + { + this.Bus.SendEmail(new MailMessage("test@nservicebus.com", "udidahan@nservicebus.com")); + } + + private void StartSaga() + { + var startSagaMessage = new StartSagaMessage { OrderId = Guid.NewGuid() }; + + this.Bus.SendLocal(startSagaMessage); + + Console.WriteLine("Starting saga with for order id {0}.", startSagaMessage.OrderId); + Console.WriteLine("=========================================================================="); + } + + private void StartSagaAndCompleteBeforeTimeout(bool fail) + { + var startSagaMessage = new StartSagaMessage { OrderId = Guid.NewGuid() }; + this.Bus.SendLocal(startSagaMessage); + + Console.WriteLine("Starting saga with for order id {0}.", startSagaMessage.OrderId); + Console.WriteLine("=========================================================================="); + + Thread.Sleep(1000); + + var completeSagaMessage = new CompleteSagaMessage + { + OrderId = startSagaMessage.OrderId, + ThrowDuringCompletion = fail + }; + + this.Bus.SendLocal(completeSagaMessage); + + } + + private void SendCommandLocal() + { + var localCommand = new LocalCommand { CommandId = Guid.NewGuid(), }; + + this.Bus.SendLocal(localCommand); + + Console.WriteLine("Sent command with Id {0}.", localCommand.CommandId); + Console.WriteLine("=========================================================================="); + } + + private void DeferCommand() + { + TimeSpan delay = TimeSpan.FromSeconds(randomizer.Next(2, 6)); + + var deferredMessage = new DeferedMessage(); + + this.Bus.Defer(delay, deferredMessage); + + Console.WriteLine("{0} - Sent a message with id {1} to be processed in {2}.", DateTime.Now.ToLongTimeString(), deferredMessage.Id, delay.ToString()); + Console.WriteLine("=========================================================================="); + } + + private void SendCommand() + { + IMyCommand commandMessage; + + switch (nextCommandToPublish) + { + case 0: + commandMessage = this.Bus.CreateInstance(); + nextCommandToPublish = 1; + break; + case 1: + commandMessage = this.Bus.CreateInstance(); + nextCommandToPublish = 2; + break; + case 2: + commandMessage = new MyRequestNMS(); + nextCommandToPublish = 3; + break; + default: + commandMessage = new MyRequest1(); + commandMessage.ThrowExceptionDuringProcessing = true; + nextCommandToPublish = 0; + break; + } + + commandMessage.CommandId = Guid.NewGuid(); + commandMessage.Time = DateTime.Now.Second > -1 ? (DateTime?)DateTime.Now : null; + commandMessage.Duration = TimeSpan.FromSeconds(99999D); + + this.Bus.Send(commandMessage).Register(response => + { + Console.WriteLine("Received Response to request {0}: {1}", commandMessage.CommandId, response); + Console.WriteLine("=========================================================================="); + }); + + Console.WriteLine("Sent command with Id {0}.", commandMessage.CommandId); + Console.WriteLine("=========================================================================="); + } + + private void PublishEvent() + { + IMyEvent eventMessage; + + switch (nextEventToPublish) + { + case 0: + eventMessage = this.Bus.CreateInstance(); + nextEventToPublish = 1; + break; + case 1: + eventMessage = new EventMessage(); + nextEventToPublish = 2; + break; + default: + eventMessage = new AnotherEventMessage(); + nextEventToPublish = 0; + break; + } + + eventMessage.EventId = Guid.NewGuid(); + eventMessage.Time = DateTime.Now.Second > -1 ? (DateTime?)DateTime.Now : null; + eventMessage.Duration = TimeSpan.FromSeconds(99999D); + + this.Bus.Publish(eventMessage); + + Console.WriteLine("Published event with Id {0}.", eventMessage.EventId); + Console.WriteLine("=========================================================================="); + } + + public void Stop() + { + + } + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/MyPublisher/SubscriptionAuthorizer.cs b/IntegrationTests/ActiveMQ/MyPublisher/SubscriptionAuthorizer.cs new file mode 100644 index 00000000000..bd9570bd239 --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/SubscriptionAuthorizer.cs @@ -0,0 +1,18 @@ +using System.Collections.Generic; +using NServiceBus; + +namespace MyPublisher +{ + public class SubscriptionAuthorizer : IAuthorizeSubscriptions + { + public bool AuthorizeSubscribe(string messageType, string clientEndpoint, IDictionary headers) + { + return true; + } + + public bool AuthorizeUnsubscribe(string messageType, string clientEndpoint, IDictionary headers) + { + return true; + } + } +} diff --git a/IntegrationTests/ActiveMQ/MyPublisher/packages.config b/IntegrationTests/ActiveMQ/MyPublisher/packages.config new file mode 100644 index 00000000000..994e4ca51a4 --- /dev/null +++ b/IntegrationTests/ActiveMQ/MyPublisher/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/NMSConsumer/App.config b/IntegrationTests/ActiveMQ/NMSConsumer/App.config new file mode 100644 index 00000000000..8e15646352e --- /dev/null +++ b/IntegrationTests/ActiveMQ/NMSConsumer/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/NMSConsumer/NMSConsumer.csproj b/IntegrationTests/ActiveMQ/NMSConsumer/NMSConsumer.csproj new file mode 100644 index 00000000000..34c4d080eea --- /dev/null +++ b/IntegrationTests/ActiveMQ/NMSConsumer/NMSConsumer.csproj @@ -0,0 +1,78 @@ + + + + + Debug + AnyCPU + {8116EF80-857D-4A19-846B-9B9EFF0A5E04} + Exe + Properties + NMSConsumer + NMSConsumer + v4.5 + 512 + ..\ + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Apache.NMS.1.5.1\lib\net40\Apache.NMS.dll + + + ..\..\..\lib\Apache.NMS-CustomBuild\Apache.NMS.ActiveMQ.dll + + + ..\..\..\binaries\NServiceBus.dll + + + + + + + + + + + + + + + + + + + + + {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8} + MyMessages + + + + + + \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/NMSConsumer/Program.cs b/IntegrationTests/ActiveMQ/NMSConsumer/Program.cs new file mode 100644 index 00000000000..1891b37cbdc --- /dev/null +++ b/IntegrationTests/ActiveMQ/NMSConsumer/Program.cs @@ -0,0 +1,168 @@ +namespace NMSConsumer +{ + using System; + using System.IO; + using System.Transactions; + using System.Xml; + using System.Xml.Serialization; + + using Apache.NMS; + using Apache.NMS.ActiveMQ; + using Apache.NMS.Util; + + using MyMessages; + using MyMessages.Publisher; + using MyMessages.SubscriberNMS; + + class Program + { + private static INetTxConnection currentconnection; + private static int nextResponseType = 0; + + private INetTxSession session; + + static void Main(string[] args) + { + new Program().Run(); + } + + private void Run() + { + var connectionFactory = new NetTxConnectionFactory("failover:(tcp://localhost:61616,tcp://localhost:61616)?randomize=false&timeout=5000") + { + AcknowledgementMode = AcknowledgementMode.Transactional, + PrefetchPolicy = { QueuePrefetch = 1 } + }; + + using (var connection = connectionFactory.CreateNetTxConnection()) + { + currentconnection = connection; + connection.Start(); + using (var session = connection.CreateNetTxSession()) + { + this.session = session; + var eventDestination = SessionUtil.GetDestination(session, "queue://Consumer.NMS.VirtualTopic.EventMessage"); + var commandDestination = SessionUtil.GetDestination(session, "queue://subscribernms"); + using (var eventConsumer = session.CreateConsumer(eventDestination)) + using (var commandConsumer = session.CreateConsumer(commandDestination)) + { + eventConsumer.Listener += OnEventMessage; + commandConsumer.Listener += this.OnCommandMessage; + + Console.WriteLine("Consumer started. Press q to quit"); + while (Console.ReadKey().KeyChar != 'q') + { + } + } + } + connection.Stop(); + } + } + + private static void OnEventMessage(IMessage message) + { + using (new TransactionScope()) + { + var textMessage = (ITextMessage)message; + var messageContent = (EventMessage)Deserialize(typeof(EventMessage), textMessage.Text); + + Console.WriteLine("Received EventMessage with ID: {0}", messageContent.EventId); + } + } + + private void OnCommandMessage(IMessage message) + { + using (var scope = new TransactionScope(TransactionScopeOption.Required)) + { + var textMessage = (ITextMessage)message; + var text = textMessage.Text; + var messageContent = (MyRequestNMS)Deserialize(typeof(MyRequestNMS), text); + + Console.WriteLine("Received MyRequestNMS with ID: {0}", messageContent.CommandId); + + try + { + // using (var session = currentconnection.CreateNetTxSession()) + { + using (var producer = this.session.CreateProducer()) + { + var responseMessage = GetResponseMessage(this.session, textMessage); + var destination = message.NMSReplyTo; + + producer.Send(destination, responseMessage); + Console.WriteLine("Sent response: " + responseMessage.Properties["ErrorCode"]); + } + } + } + catch (Exception) + { + } + + if (messageContent.ThrowExceptionDuringProcessing) + { + Console.WriteLine("Throwing Exception"); + throw new Exception(); + } + + scope.Complete(); + } + } + + public static object Deserialize(Type objType, string text) + { + if (text == null) + { + return null; + } + try + { + XmlSerializer serializer = new XmlSerializer(objType); + return serializer.Deserialize(new NamespaceIgnorantXmlTextReader(new StringReader(text))); + } + catch (Exception ex) + { + Tracer.ErrorFormat("Error deserializing object: {0}", new object[] { ex.Message }); + return null; + } + } + + private static IMessage GetResponseMessage(INetTxSession session, ITextMessage textMessage) + { + IMessage responseMessage; + + if (nextResponseType == 0) + { + var errorCode = new Random().Next(2) == 1 ? ResponseCode.Ok : ResponseCode.Failed; + + responseMessage = session.CreateTextMessage(""); + responseMessage.Properties["ErrorCode"] = (int)errorCode; + nextResponseType = 1; + } + else + { + var messageContent = new ResponseToPublisher + { + ResponseId = Guid.NewGuid(), + Time = DateTime.Now.Second > -1 ? (DateTime?)DateTime.Now : null, + Duration = TimeSpan.FromSeconds(99999D), + }; + + responseMessage = session.CreateXmlMessage(messageContent); + nextResponseType = 0; + } + + responseMessage.NMSCorrelationID = textMessage.NMSMessageId; + return responseMessage; + } + } + + public class NamespaceIgnorantXmlTextReader : XmlTextReader + { + public NamespaceIgnorantXmlTextReader(System.IO.TextReader reader) : base(reader) { } + + public override string NamespaceURI + { + get { return ""; } + } + } +} diff --git a/IntegrationTests/ActiveMQ/NMSConsumer/Properties/AssemblyInfo.cs b/IntegrationTests/ActiveMQ/NMSConsumer/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..cc4ac0e204b --- /dev/null +++ b/IntegrationTests/ActiveMQ/NMSConsumer/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("NMSConsumer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("NMSConsumer")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("6595e911-28a7-4d91-b6ca-c8e3525162ca")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IntegrationTests/ActiveMQ/NMSConsumer/packages.config b/IntegrationTests/ActiveMQ/NMSConsumer/packages.config new file mode 100644 index 00000000000..3a5cc4d87ad --- /dev/null +++ b/IntegrationTests/ActiveMQ/NMSConsumer/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/NMSPublisher/App.config b/IntegrationTests/ActiveMQ/NMSPublisher/App.config new file mode 100644 index 00000000000..8e15646352e --- /dev/null +++ b/IntegrationTests/ActiveMQ/NMSPublisher/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/NMSPublisher/NMSPublisher.csproj b/IntegrationTests/ActiveMQ/NMSPublisher/NMSPublisher.csproj new file mode 100644 index 00000000000..3ca933e4bf6 --- /dev/null +++ b/IntegrationTests/ActiveMQ/NMSPublisher/NMSPublisher.csproj @@ -0,0 +1,77 @@ + + + + + Debug + AnyCPU + {F34154FC-B995-4B3C-BD8A-0273655C5206} + Exe + Properties + NMSPublisher + NMSPublisher + v4.5 + 512 + ..\ + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Apache.NMS.1.5.1\lib\net40\Apache.NMS.dll + + + ..\packages\Apache.NMS.ActiveMQ.1.5.6\lib\net40\Apache.NMS.ActiveMQ.dll + + + ..\..\..\binaries\NServiceBus.dll + + + + + + + + + + + + + + + + + + + + {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8} + MyMessages + + + + + + \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/NMSPublisher/Program.cs b/IntegrationTests/ActiveMQ/NMSPublisher/Program.cs new file mode 100644 index 00000000000..0235c786124 --- /dev/null +++ b/IntegrationTests/ActiveMQ/NMSPublisher/Program.cs @@ -0,0 +1,132 @@ + +namespace NMSPublisher +{ + using System; + using Apache.NMS; + using Apache.NMS.ActiveMQ; + using Apache.NMS.Util; + + using MyMessages; + using MyMessages.Publisher; + using MyMessages.Subscriber1; + using MyMessages.SubscriberNMS; + + class Program + { + private static IQueue responseQueue; + + static void Main(string[] args) + { + var connectionFactory = new NetTxConnectionFactory("failover:(tcp://localhost:61616,tcp://localhost:61616)?randomize=false&timeout=5000") + { + AcknowledgementMode = AcknowledgementMode.Transactional, + PrefetchPolicy = { QueuePrefetch = 1, TopicPrefetch = 1, DurableTopicPrefetch = 1 } + }; + + using (var connection = connectionFactory.CreateNetTxConnection()) + { + connection.Start(); + using (var session = connection.CreateSession()) + using (var consumer = CreateResponseConsumer(session)) + { + RunProducer(connection); + } + + connection.Stop(); + } + } + + private static IMessageConsumer CreateResponseConsumer(ISession session) + { + responseQueue = session.CreateTemporaryQueue(); + + var consumer = session.CreateConsumer(responseQueue); + consumer.Listener += OnMessage; + + return consumer; + } + + private static void OnMessage(IMessage message) + { + Console.WriteLine("Received Response to request {0}: {1}", message.NMSCorrelationID, "blah"); + Console.WriteLine("=========================================================================="); + } + + private static void RunProducer(INetTxConnection connection) + { + Console.WriteLine("Press 'e' to publish an IEvent, EventMessage, and AnotherEventMessage alternately."); + Console.WriteLine("Press 's' to start a saga on MyPublisher."); + Console.WriteLine("Press 'c' to send a command to Subscriber1"); + Console.WriteLine("Press 'n' to send a command to SubscriberNMS"); + Console.WriteLine("Press 'q' to exit"); + + while (true) + { + var key = Console.ReadKey(); + using (var session = connection.CreateNetTxSession()) + { + switch (key.KeyChar) + { + case 'q': + return; + case 'e': + PublishEvent(session); + break; + case 's': + StartSaga(session, "queue://Mypublisher"); + break; + case 'n': + SendCommand(session, "queue://subscribernms", new MyRequestNMS()); + break; + case 'c': + SendCommand(session, "queue://Subscriber1", new MyRequest1()); + break; + } + } + } + } + + private static void SendCommand(ISession session, string queue, IMyCommand request) + { + request.Time = DateTime.Now; + request.Duration = TimeSpan.FromMinutes(5); + request.CommandId = Guid.NewGuid(); + + var destination = SessionUtil.GetDestination(session, queue); + using (var producer = session.CreateProducer()) + { + var message = + session.CreateXmlMessage( + request); + message.NMSReplyTo = responseQueue; + producer.Send(destination, message); + } + } + + private static void StartSaga(ISession session, string queue) + { + var destination = SessionUtil.GetDestination(session, queue); + using (var producer = session.CreateProducer()) + { + var message = + session.CreateXmlMessage( + new StartSagaMessage { OrderId = Guid.NewGuid() }); + message.NMSReplyTo = responseQueue; + producer.Send(destination, message); + } + } + + private static void PublishEvent(ISession session) + { + var destination = SessionUtil.GetDestination(session, "topic://VirtualTopic.EventMessage"); + using (var producer = session.CreateProducer()) + { + var message = + session.CreateXmlMessage( + new EventMessage + { Time = DateTime.Now, Duration = TimeSpan.FromMinutes(5), EventId = Guid.NewGuid() }); + producer.Send(destination, message); + } + } + } +} diff --git a/IntegrationTests/ActiveMQ/NMSPublisher/Properties/AssemblyInfo.cs b/IntegrationTests/ActiveMQ/NMSPublisher/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..a35da8e8321 --- /dev/null +++ b/IntegrationTests/ActiveMQ/NMSPublisher/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("NMSPublisher")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("NMSPublisher")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("bf16ce8e-351e-44b8-bc6f-3bce7f801afa")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IntegrationTests/ActiveMQ/NMSPublisher/packages.config b/IntegrationTests/ActiveMQ/NMSPublisher/packages.config new file mode 100644 index 00000000000..3a5cc4d87ad --- /dev/null +++ b/IntegrationTests/ActiveMQ/NMSPublisher/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/Subscriber1/AnotherEventMessageHandler.cs b/IntegrationTests/ActiveMQ/Subscriber1/AnotherEventMessageHandler.cs new file mode 100644 index 00000000000..4da293df8ef --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber1/AnotherEventMessageHandler.cs @@ -0,0 +1,30 @@ +using System; +using MyMessages; +using MyMessages.Other; +using NServiceBus; +using NServiceBus.Logging; + +namespace Subscriber1 +{ + using System.Transactions; + + public class AnotherEventMessageHandler : IHandleMessages + { + private readonly IBus bus; + + public AnotherEventMessageHandler(IBus bus) + { + this.bus = bus; + } + + public void Handle(AnotherEventMessage message) + { + Logger.Info(string.Format("Subscriber 1 received AnotherEventMessage with Id {0}.", message.EventId)); + Logger.Info(string.Format("Message time: {0}.", message.Time)); + Logger.Info(string.Format("Message duration: {0}.", message.Duration)); + Console.WriteLine("=========================================================================="); + } + + private static readonly ILog Logger = LogManager.GetLogger(typeof (AnotherEventMessageHandler)); + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/Subscriber1/App.config b/IntegrationTests/ActiveMQ/Subscriber1/App.config new file mode 100644 index 00000000000..4b32bd4bbee --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber1/App.config @@ -0,0 +1,22 @@ + + + +
+
+
+ + + + + + + + + + + + + + + + diff --git a/IntegrationTests/ActiveMQ/Subscriber1/CommandMessageHandler.cs b/IntegrationTests/ActiveMQ/Subscriber1/CommandMessageHandler.cs new file mode 100644 index 00000000000..a7b9a119116 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber1/CommandMessageHandler.cs @@ -0,0 +1,77 @@ +namespace Subscriber1 +{ + using System; + using System.Transactions; + + using MyMessages.Publisher; + using MyMessages.Subscriber1; + using MyMessages.SubscriberNMS; + + using NServiceBus; + using NServiceBus.Logging; + + public class CommandMessageHandler : IHandleMessages + { + private readonly IBus bus; + private static TestSinglePhaseCommit x = new TestSinglePhaseCommit(); + private static Guid guid = Guid.NewGuid(); + + public CommandMessageHandler(IBus bus) + { + this.bus = bus; + } + + public void Handle(MyRequest1 message) + { + Transaction.Current.EnlistDurable(guid, x, EnlistmentOptions.None); + Logger.Info(string.Format("Subscriber 1 received MyRequest1 with Id {0}.", message.CommandId)); + Logger.Info(string.Format("Message time: {0}.", message.Time)); + Logger.Info(string.Format("Message duration: {0}.", message.Duration)); + + var result = new Random().Next(2) == 1 ? ResponseCode.Ok : ResponseCode.Failed; + this.bus.Return(result); + Console.WriteLine("Replied with response {0}", result); + + if (message.ThrowExceptionDuringProcessing) + { + Console.WriteLine("Throwing Exception"); + throw new Exception(); + } + + Console.WriteLine("=========================================================================="); + } + + internal class TestSinglePhaseCommit : ISinglePhaseNotification + { + public void Prepare(PreparingEnlistment preparingEnlistment) + { + Console.WriteLine("Tx Prepare"); + preparingEnlistment.Prepared(); + } + public void Commit(Enlistment enlistment) + { + Console.WriteLine("Tx Commit"); + enlistment.Done(); + } + + public void Rollback(Enlistment enlistment) + { + Console.WriteLine("Tx Rollback"); + enlistment.Done(); + } + public void InDoubt(Enlistment enlistment) + { + Console.WriteLine("Tx InDoubt"); + enlistment.Done(); + } + public void SinglePhaseCommit(SinglePhaseEnlistment singlePhaseEnlistment) + { + Console.WriteLine("Tx SinglePhaseCommit"); + singlePhaseEnlistment.Committed(); + //singlePhaseEnlistment.Aborted(); + } + } + + private static readonly ILog Logger = LogManager.GetLogger(typeof(CommandMessageHandler)); + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/Subscriber1/ConfigOverride.cs b/IntegrationTests/ActiveMQ/Subscriber1/ConfigOverride.cs new file mode 100644 index 00000000000..c55d26841d0 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber1/ConfigOverride.cs @@ -0,0 +1,17 @@ +namespace Subscriber1 +{ + using NServiceBus.Config; + using NServiceBus.Config.ConfigurationSource; + + //demonstrate how to override specific configuration sections + class ConfigOverride : IProvideConfiguration + { + public MessageForwardingInCaseOfFaultConfig GetConfiguration() + { + return new MessageForwardingInCaseOfFaultConfig + { + ErrorQueue = "error" + }; + } + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/Subscriber1/EndpointConfig.cs b/IntegrationTests/ActiveMQ/Subscriber1/EndpointConfig.cs new file mode 100644 index 00000000000..f2fc47a2db1 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber1/EndpointConfig.cs @@ -0,0 +1,21 @@ +namespace Subscriber1 +{ + using NServiceBus; + using NServiceBus.Features; + + class EndpointConfig : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization + { + public static string BasePath = "..\\..\\..\\storage"; + + public void Init() + { + var config = Configure.With() + .DefaultBuilder() + .PurgeOnStartup(true) + .FileShareDataBus(BasePath) + .UseTransport(() =>"ServerUrl=failover:(tcp://localhost:61616,tcp://localhost:61616)?randomize=false&timeout=5000"); + + Configure.Features.Disable(); + } + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/Subscriber1/EventMessageHandler.cs b/IntegrationTests/ActiveMQ/Subscriber1/EventMessageHandler.cs new file mode 100644 index 00000000000..b611dfc4ef4 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber1/EventMessageHandler.cs @@ -0,0 +1,20 @@ +using System; +using MyMessages; +using NServiceBus; +using NServiceBus.Logging; + +namespace Subscriber1 +{ + public class EventMessageHandler : IHandleMessages + { + public void Handle(EventMessage message) + { + Logger.Info(string.Format("Subscriber 1 received EventMessage with Id {0}.", message.EventId)); + Logger.Info(string.Format("Message time: {0}.", message.Time)); + Logger.Info(string.Format("Message duration: {0}.", message.Duration)); + Console.WriteLine("=========================================================================="); + } + + private static readonly ILog Logger = LogManager.GetLogger(typeof (EventMessageHandler)); + } +} diff --git a/IntegrationTests/ActiveMQ/Subscriber1/MessageWithLargePayloadHandler.cs b/IntegrationTests/ActiveMQ/Subscriber1/MessageWithLargePayloadHandler.cs new file mode 100644 index 00000000000..a8960b8de5f --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber1/MessageWithLargePayloadHandler.cs @@ -0,0 +1,21 @@ +using MyMessages.DataBus; + +namespace Subscriber1 +{ + using System; + using NServiceBus; + using NServiceBus.Logging; + + public class MessageWithLargePayloadHandler : IHandleMessages + { + public void Handle(MessageWithLargePayload message) + { + Logger.Info(string.Format("Subscriber 1 received MessageWithLargePayload with SomeProperty {0}.", message.SomeProperty)); + + Console.WriteLine("Message received, size of blob property: " + message.LargeBlob.Value.Length + " Bytes"); + } + + private static readonly ILog Logger = LogManager.GetLogger(typeof(MessageWithLargePayloadHandler)); + + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/Subscriber1/Properties/AssemblyInfo.cs b/IntegrationTests/ActiveMQ/Subscriber1/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..ace03f54076 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber1/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Client")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Client")] +[assembly: AssemblyCopyright("Copyright © 2007")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("9354e6a9-a8e5-4017-a67b-fd5075bd3941")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IntegrationTests/ActiveMQ/Subscriber1/Subscriber1.csproj b/IntegrationTests/ActiveMQ/Subscriber1/Subscriber1.csproj new file mode 100644 index 00000000000..5e142402b71 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber1/Subscriber1.csproj @@ -0,0 +1,110 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {28DE496A-3885-410E-A0B8-004FAEFF9378} + Library + Properties + Subscriber1 + Subscriber1 + + + + + v4.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\packages\Apache.NMS.1.5.1\lib\net40\Apache.NMS.dll + + + False + ..\..\..\binaries\log4net.dll + + + ..\..\..\binaries\NServiceBus.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + ..\..\..\binaries\NServiceBus.Transports.ActiveMQ.dll + + + + + + + + + + + + + + + + + + + + + Designer + + + + + + {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8} + MyMessages + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + NServiceBus.Integration + + + \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/Subscriber1/packages.config b/IntegrationTests/ActiveMQ/Subscriber1/packages.config new file mode 100644 index 00000000000..a60e11bb113 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber1/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/Subscriber2/App.config b/IntegrationTests/ActiveMQ/Subscriber2/App.config new file mode 100644 index 00000000000..7d7350f4170 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber2/App.config @@ -0,0 +1,16 @@ + + + +
+
+ + + + + + + + + + + diff --git a/IntegrationTests/ActiveMQ/Subscriber2/CommandMessageHandler.cs b/IntegrationTests/ActiveMQ/Subscriber2/CommandMessageHandler.cs new file mode 100644 index 00000000000..03beebcd030 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber2/CommandMessageHandler.cs @@ -0,0 +1,45 @@ +namespace Subscriber2 +{ + using System; + + using MyMessages.Publisher; + using MyMessages.Subscriber2; + + using NServiceBus; + using NServiceBus.Logging; + + public class CommandMessageHandler : IHandleMessages + { + private readonly IBus bus; + + public CommandMessageHandler(IBus bus) + { + this.bus = bus; + } + + public void Handle(IMyRequest2 message) + { + Logger.Info(string.Format("Subscriber 1 received IMyRequest2 with Id {0}.", message.CommandId)); + Logger.Info(string.Format("Message time: {0}.", message.Time)); + Logger.Info(string.Format("Message duration: {0}.", message.Duration)); + Console.WriteLine("=========================================================================="); + + Guid result = Guid.NewGuid(); + this.bus.Reply(m => + { + m.ResponseId = result; + m.Time = DateTime.Now.Second > -1 ? (DateTime?)DateTime.Now : null; + m.Duration = TimeSpan.FromSeconds(99999D); + }); + Console.WriteLine("Replied with response {0}", result); + + if (message.ThrowExceptionDuringProcessing) + { + Console.WriteLine("Throwing Exception"); + throw new Exception(); + } + } + + private static readonly ILog Logger = LogManager.GetLogger(typeof(CommandMessageHandler)); + } +} \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/Subscriber2/EndpointConfig.cs b/IntegrationTests/ActiveMQ/Subscriber2/EndpointConfig.cs new file mode 100644 index 00000000000..f7a0d98cef7 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber2/EndpointConfig.cs @@ -0,0 +1,25 @@ +namespace Subscriber2 +{ + using NServiceBus; + using NServiceBus.Features; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization + { + public static string BasePath = "..\\..\\..\\storage"; + + public void Init() + { + Configure.Features.Disable(); + Configure.Features.Disable(); + + Configure.With() + //this overrides the NServiceBus default convention of IEvent + .CastleWindsorBuilder() // just to show we can mix and match containers + .FileShareDataBus(BasePath) + .UseTransport( + () =>"ServerUrl=failover:(tcp://localhost:61616,tcp://localhost:61616)?randomize=false&timeout=5000"); + + + } + } +} diff --git a/IntegrationTests/ActiveMQ/Subscriber2/EventMessageHandler.cs b/IntegrationTests/ActiveMQ/Subscriber2/EventMessageHandler.cs new file mode 100644 index 00000000000..979349894f4 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber2/EventMessageHandler.cs @@ -0,0 +1,22 @@ +using System; +using NServiceBus; + +namespace Subscriber2 +{ + using MyMessages; + + using log4net; + + public class EventMessageHandler : IHandleMessages + { + public void Handle(IMyEvent message) + { + Logger.Info(string.Format("Subscriber 2 received IEvent with Id {0}.", message.EventId)); + Logger.Info(string.Format("Message time: {0}.", message.Time)); + Logger.Info(string.Format("Message duration: {0}.", message.Duration)); + Console.WriteLine("=========================================================================="); + } + + private static readonly ILog Logger = LogManager.GetLogger(typeof (EventMessageHandler)); + } +} diff --git a/IntegrationTests/ActiveMQ/Subscriber2/Properties/AssemblyInfo.cs b/IntegrationTests/ActiveMQ/Subscriber2/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..ace03f54076 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber2/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Client")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Client")] +[assembly: AssemblyCopyright("Copyright © 2007")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("9354e6a9-a8e5-4017-a67b-fd5075bd3941")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IntegrationTests/ActiveMQ/Subscriber2/Subscriber2.csproj b/IntegrationTests/ActiveMQ/Subscriber2/Subscriber2.csproj new file mode 100644 index 00000000000..f253b7a97d1 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber2/Subscriber2.csproj @@ -0,0 +1,119 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {6A699A4E-F2FD-4B71-AF73-199B499482BD} + Library + Properties + Subscriber2 + Subscriber2 + + + + + v4.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\packages\Apache.NMS.1.5.1\lib\net40\Apache.NMS.dll + + + False + ..\packages\Castle.Core.3.2.0\lib\net40-client\Castle.Core.dll + + + False + ..\packages\Castle.Windsor.3.2.0\lib\net40\Castle.Windsor.dll + + + False + ..\..\..\binaries\log4net.dll + + + ..\..\..\binaries\NServiceBus.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + ..\..\..\binaries\containers\castle\NServiceBus.ObjectBuilder.CastleWindsor.dll + + + ..\..\..\binaries\NServiceBus.Transports.ActiveMQ.dll + + + + + + + + + + + + + + + + + + + Designer + + + + + + {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8} + MyMessages + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + NServiceBus.Integration NServiceBus.Integration + + + \ No newline at end of file diff --git a/IntegrationTests/ActiveMQ/Subscriber2/Subscriber2Endpoint.cs b/IntegrationTests/ActiveMQ/Subscriber2/Subscriber2Endpoint.cs new file mode 100644 index 00000000000..88ae55039c7 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber2/Subscriber2Endpoint.cs @@ -0,0 +1,24 @@ +using NServiceBus; + +namespace Subscriber2 +{ + using MyMessages; + + /// + /// Showing how to manage subscriptions manually + /// + class Subscriber2Endpoint : IWantToRunWhenBusStartsAndStops + { + public IBus Bus { get; set; } + + public void Start() + { + Bus.Subscribe(); + } + + public void Stop() + { + Bus.Unsubscribe(); + } + } +} diff --git a/IntegrationTests/ActiveMQ/Subscriber2/packages.config b/IntegrationTests/ActiveMQ/Subscriber2/packages.config new file mode 100644 index 00000000000..f26a245b521 --- /dev/null +++ b/IntegrationTests/ActiveMQ/Subscriber2/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3.sln b/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3.sln new file mode 100644 index 00000000000..57a90890120 --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3.sln @@ -0,0 +1,38 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "AsyncPagesMVC3", "AsyncPagesMVC3\AsyncPagesMVC3.ccproj", "{F32F2A21-92D3-47B9-A06A-8C23CEF55BED}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Website", "Website\Website.csproj", "{12AFC759-8E5F-4B5C-B092-F7FF30A1F8C8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Worker", "Worker\Worker.csproj", "{39F7FC6A-4319-4AC5-89AF-36D730FC547D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contract", "Contract\Contract.csproj", "{A2995239-C5E5-49B6-B134-34CD331BC51F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F32F2A21-92D3-47B9-A06A-8C23CEF55BED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F32F2A21-92D3-47B9-A06A-8C23CEF55BED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F32F2A21-92D3-47B9-A06A-8C23CEF55BED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F32F2A21-92D3-47B9-A06A-8C23CEF55BED}.Release|Any CPU.Build.0 = Release|Any CPU + {12AFC759-8E5F-4B5C-B092-F7FF30A1F8C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12AFC759-8E5F-4B5C-B092-F7FF30A1F8C8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12AFC759-8E5F-4B5C-B092-F7FF30A1F8C8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12AFC759-8E5F-4B5C-B092-F7FF30A1F8C8}.Release|Any CPU.Build.0 = Release|Any CPU + {39F7FC6A-4319-4AC5-89AF-36D730FC547D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39F7FC6A-4319-4AC5-89AF-36D730FC547D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39F7FC6A-4319-4AC5-89AF-36D730FC547D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39F7FC6A-4319-4AC5-89AF-36D730FC547D}.Release|Any CPU.Build.0 = Release|Any CPU + {A2995239-C5E5-49B6-B134-34CD331BC51F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A2995239-C5E5-49B6-B134-34CD331BC51F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A2995239-C5E5-49B6-B134-34CD331BC51F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A2995239-C5E5-49B6-B134-34CD331BC51F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.ccproj b/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.ccproj new file mode 100644 index 00000000000..ef5d398abef --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.ccproj @@ -0,0 +1,64 @@ + + + + + Debug + AnyCPU + 2.0 + {f32f2a21-92d3-47b9-a06a-8c23cef55bed} + Library + Properties + AsyncPagesMVC3 + AsyncPagesMVC3 + True + AsyncPagesMVC3 + False + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + Website + {12afc759-8e5f-4b5c-b092-f7ff30a1f8c8} + True + Web + Website + True + + + Worker + {39f7fc6a-4319-4ac5-89af-36d730fc547d} + True + Worker + Worker + True + + + + + 10.0 + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.0\ + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Cloud.cscfg b/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Cloud.cscfg new file mode 100644 index 00000000000..8ca47eb6877 --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Cloud.cscfg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Local.cscfg b/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Local.cscfg new file mode 100644 index 00000000000..28368eafba7 --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Local.cscfg @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.build.csdef b/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.build.csdef new file mode 100644 index 00000000000..739ddb70a4a --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.build.csdef @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.csdef b/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.csdef new file mode 100644 index 00000000000..763b1d70140 --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.csdef @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3.sln b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/AsyncPagesMVC3.sln similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3.sln rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/AsyncPagesMVC3.sln diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/Site.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/Site.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/Site.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/Site.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-icons_222222_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_222222_256x240.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-icons_222222_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_222222_256x240.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-icons_2e83ff_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-icons_2e83ff_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_2e83ff_256x240.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-icons_454545_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_454545_256x240.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-icons_454545_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_454545_256x240.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-icons_888888_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_888888_256x240.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-icons_888888_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_888888_256x240.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-icons_cd0a0a_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_cd0a0a_256x240.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/images/ui-icons_cd0a0a_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_cd0a0a_256x240.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery-ui.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery-ui.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery-ui.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery-ui.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.accordion.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.accordion.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.accordion.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.accordion.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.all.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.all.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.all.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.all.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.autocomplete.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.autocomplete.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.autocomplete.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.autocomplete.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.base.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.base.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.base.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.base.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.button.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.button.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.button.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.button.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.core.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.core.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.core.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.core.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.datepicker.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.datepicker.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.datepicker.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.datepicker.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.dialog.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.dialog.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.dialog.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.dialog.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.progressbar.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.progressbar.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.progressbar.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.progressbar.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.resizable.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.resizable.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.resizable.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.resizable.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.selectable.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.selectable.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.selectable.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.selectable.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.slider.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.slider.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.slider.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.slider.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.tabs.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.tabs.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.tabs.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.tabs.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.theme.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.theme.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.theme.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.theme.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-icons_222222_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_222222_256x240.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-icons_222222_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_222222_256x240.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-icons_454545_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_454545_256x240.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-icons_454545_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_454545_256x240.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-icons_888888_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_888888_256x240.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-icons_888888_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_888888_256x240.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery-ui.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery-ui.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery-ui.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery-ui.min.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.accordion.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.accordion.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.accordion.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.accordion.min.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.all.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.all.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.all.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.all.min.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.autocomplete.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.autocomplete.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.autocomplete.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.autocomplete.min.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.base.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.base.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.base.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.base.min.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.button.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.button.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.button.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.button.min.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.core.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.core.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.core.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.core.min.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.datepicker.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.datepicker.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.datepicker.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.datepicker.min.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.dialog.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.dialog.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.dialog.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.dialog.min.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.progressbar.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.progressbar.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.progressbar.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.progressbar.min.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.resizable.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.resizable.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.resizable.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.resizable.min.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.selectable.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.selectable.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.selectable.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.selectable.min.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.slider.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.slider.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.slider.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.slider.min.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.tabs.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.tabs.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.tabs.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.tabs.min.css diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.theme.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.theme.min.css similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/minified/jquery.ui.theme.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.theme.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Controllers/HomeController.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Controllers/HomeController.cs similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Controllers/HomeController.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Controllers/HomeController.cs diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Controllers/SendAndBlockController.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Controllers/SendAndBlockController.cs similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Controllers/SendAndBlockController.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Controllers/SendAndBlockController.cs diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Controllers/SendAsyncController.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Controllers/SendAsyncController.cs similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Controllers/SendAsyncController.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Controllers/SendAsyncController.cs diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Global.asax b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Global.asax similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Global.asax rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Global.asax diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Global.asax.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Global.asax.cs new file mode 100644 index 00000000000..2c616b25b73 --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Global.asax.cs @@ -0,0 +1,70 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using NServiceBus; +using NServiceBus.Config; +using NServiceBus.Integration.Azure; + +namespace Website +{ + public class MvcApplication : HttpApplication + { + public static IBus Bus; + + private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); + + private static IBus ConfigureNServiceBus() + { + Configure.Serialization.Json(); + + var bus = Configure.With() + .DefaultBuilder() + .ForMvc() + .Log4Net(new AzureAppender()) + .AzureConfigurationSource() + .AzureMessageQueue() + .QueuePerInstance() + .PurgeOnStartup(true) + .UnicastBus() + .LoadMessageHandlers() + .IsTransactional(true) + .CreateBus() + .Start(); + + return bus; + } + + public static void RegisterGlobalFilters(GlobalFilterCollection filters) + { + filters.Add(new HandleErrorAttribute()); + } + + public static void RegisterRoutes(RouteCollection routes) + { + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + + routes.MapRoute( + "Default", // Route name + "{controller}/{action}/{id}", // URL with parameters + new { controller = "Home", action = "SendLinks", id = UrlParameter.Optional } // Parameter defaults + + ); + } + + protected void Application_Start() + { + AreaRegistration.RegisterAllAreas(); + + RegisterGlobalFilters(GlobalFilters.Filters); + RegisterRoutes(RouteTable.Routes); + } + + protected void Application_BeginRequest(object sender, EventArgs e) + { + Bus = StartBus.Value; + } + } +} \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/InjectionConfiguration/ConfigureMvc3.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/InjectionConfiguration/ConfigureMvc3.cs similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/InjectionConfiguration/ConfigureMvc3.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/InjectionConfiguration/ConfigureMvc3.cs diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/InjectionConfiguration/NServiceBusControllerActivator.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/InjectionConfiguration/NServiceBusControllerActivator.cs similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/InjectionConfiguration/NServiceBusControllerActivator.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/InjectionConfiguration/NServiceBusControllerActivator.cs diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/InjectionConfiguration/NServiceBusDependencyResolverAdapter.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/InjectionConfiguration/NServiceBusDependencyResolverAdapter.cs similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/InjectionConfiguration/NServiceBusDependencyResolverAdapter.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/InjectionConfiguration/NServiceBusDependencyResolverAdapter.cs diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Properties/AssemblyInfo.cs diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftAjax.debug.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftAjax.debug.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftAjax.debug.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftAjax.debug.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftAjax.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftAjax.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftAjax.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftAjax.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcAjax.debug.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcAjax.debug.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcAjax.debug.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcAjax.debug.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcAjax.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcAjax.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcAjax.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcAjax.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcValidation.debug.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcValidation.debug.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcValidation.debug.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcValidation.debug.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcValidation.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcValidation.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcValidation.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcValidation.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.1-vsdoc.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.1-vsdoc.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.1-vsdoc.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.1-vsdoc.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.1.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.1.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.1.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.1.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.1.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.1.min.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.1.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.1.min.js diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Scripts/jquery-1.5.2-vsdoc.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.2-vsdoc.js similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Scripts/jquery-1.5.2-vsdoc.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.2-vsdoc.js diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Scripts/jquery-1.5.2.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.2.js similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Scripts/jquery-1.5.2.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.2.js diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Scripts/jquery-1.5.2.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.2.min.js similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Scripts/jquery-1.5.2.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.2.min.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.11.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-ui-1.8.11.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.11.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-ui-1.8.11.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.11.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-ui-1.8.11.min.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.11.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-ui-1.8.11.min.js diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Scripts/jquery-ui-1.8.16.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-ui-1.8.16.js similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Scripts/jquery-ui-1.8.16.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-ui-1.8.16.js diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Scripts/jquery-ui-1.8.16.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-ui-1.8.16.min.js similarity index 100% rename from Samples/AsyncPagesMVC3/AsyncPagesMVC3/Scripts/jquery-ui-1.8.16.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery-ui-1.8.16.min.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.unobtrusive-ajax.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery.unobtrusive-ajax.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.unobtrusive-ajax.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery.unobtrusive-ajax.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.unobtrusive-ajax.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery.unobtrusive-ajax.min.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.unobtrusive-ajax.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery.unobtrusive-ajax.min.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate-vsdoc.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery.validate-vsdoc.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate-vsdoc.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery.validate-vsdoc.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery.validate.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery.validate.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery.validate.min.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery.validate.min.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.unobtrusive.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery.validate.unobtrusive.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.unobtrusive.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery.validate.unobtrusive.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.unobtrusive.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery.validate.unobtrusive.min.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.unobtrusive.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/jquery.validate.unobtrusive.min.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/modernizr-1.7.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/modernizr-1.7.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/modernizr-1.7.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/modernizr-1.7.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/modernizr-1.7.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/modernizr-1.7.min.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/modernizr-1.7.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Scripts/modernizr-1.7.min.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Views/Home/SendLinks.cshtml b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Views/Home/SendLinks.cshtml similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Views/Home/SendLinks.cshtml rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Views/Home/SendLinks.cshtml diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Views/Shared/Index.cshtml b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Views/Shared/Index.cshtml similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Views/Shared/Index.cshtml rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Views/Shared/Index.cshtml diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Views/Web.config b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Views/Web.config similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Views/Web.config rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Views/Web.config diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Web.Debug.config b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Web.Debug.config similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Web.Debug.config rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Web.Debug.config diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Web.Release.config b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Web.Release.config similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Web.Release.config rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Web.Release.config diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Web.config b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Web.config new file mode 100644 index 00000000000..28bba25d636 --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Web.config @@ -0,0 +1,89 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/WebRole.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/WebRole.cs similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/WebRole.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/WebRole.cs diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Website.csproj b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Website.csproj new file mode 100644 index 00000000000..cbeede4e2e7 --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/Website.csproj @@ -0,0 +1,278 @@ + + + + Debug + AnyCPU + + + 2.0 + {12AFC759-8E5F-4B5C-B092-F7FF30A1F8C8} + {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Website + Website + v4.0 + false + false + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll + + + ..\..\..\..\packages\Iesi.Collections.3.3.3.4000\lib\Net35\Iesi.Collections.dll + + + ..\..\..\..\lib\Ionic.Zip.dll + + + ..\..\..\..\lib\log4net.dll + + + True + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll + + + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + True + + + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + False + + + ..\packages\WindowsAzure.Storage.1.7.0.0\lib\net35-full\Microsoft.WindowsAzure.StorageClient.dll + + + ..\..\..\..\packages\NHibernate.3.3.3.4000\lib\Net35\NHibernate.dll + + + ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\..\binaries\NServiceBus.NHibernate.dll + + + + + True + + + True + + + True + + + True + + + + + + + + + + + + + True + + + True + + + + + + + + + + + + + + + + + Global.asax + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Web.config + + + Web.config + + + + + + + + + + + + + + + + + + + + + + {A2995239-C5E5-49B6-B134-34CD331BC51F} + Contract + + + + + + + + + + + + + + + + + False + True + 3488 + / + + + False + False + + + False + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/packages.config b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/packages.config new file mode 100644 index 00000000000..9783a9a7476 --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Backup/Website/packages.config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/Contract/Command.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Contract/Command.cs new file mode 100644 index 00000000000..bd8afc51fa6 --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Contract/Command.cs @@ -0,0 +1,9 @@ +using NServiceBus; + +namespace Contract +{ + public class Command : ICommand + { + public int Id { get; set; } + } +} diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/Contract/Contract.csproj b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Contract/Contract.csproj new file mode 100644 index 00000000000..2fa6a6fe45f --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Contract/Contract.csproj @@ -0,0 +1,97 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {A2995239-C5E5-49B6-B134-34CD331BC51F} + Library + Properties + Contract + Contract + v4.0 + 512 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\..\..\..\binaries\NServiceBus.dll + + + + + + + + + + + + + + + + + False + Microsoft .NET Framework 4 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Contract/ErrorCodes.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Contract/ErrorCodes.cs similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Contract/ErrorCodes.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Contract/ErrorCodes.cs diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Contract/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Contract/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Contract/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Contract/Properties/AssemblyInfo.cs diff --git a/Samples/Azure/AzureHost/Host/Content/Site.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/Site.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/Site.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/Site.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_222222_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_222222_256x240.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_222222_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_222222_256x240.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_2e83ff_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_2e83ff_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_2e83ff_256x240.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_454545_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_454545_256x240.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_454545_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_454545_256x240.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_888888_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_888888_256x240.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_888888_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_888888_256x240.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_cd0a0a_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_cd0a0a_256x240.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_cd0a0a_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_cd0a0a_256x240.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery-ui.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery-ui.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery-ui.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery-ui.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.accordion.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.accordion.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.accordion.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.accordion.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.all.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.all.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.all.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.all.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.autocomplete.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.autocomplete.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.autocomplete.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.autocomplete.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.base.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.base.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.base.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.base.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.button.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.button.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.button.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.button.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.core.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.core.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.core.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.core.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.datepicker.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.datepicker.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.datepicker.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.datepicker.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.dialog.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.dialog.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.dialog.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.dialog.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.progressbar.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.progressbar.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.progressbar.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.progressbar.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.resizable.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.resizable.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.resizable.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.resizable.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.selectable.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.selectable.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.selectable.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.selectable.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.slider.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.slider.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.slider.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.slider.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.tabs.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.tabs.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.tabs.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.tabs.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.theme.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.theme.css similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/jquery.ui.theme.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.theme.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_222222_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_222222_256x240.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_222222_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_222222_256x240.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_454545_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_454545_256x240.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_454545_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_454545_256x240.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_888888_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_888888_256x240.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_888888_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_888888_256x240.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery-ui.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery-ui.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery-ui.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery-ui.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.accordion.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.accordion.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.accordion.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.accordion.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.all.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.all.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.all.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.all.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.autocomplete.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.autocomplete.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.autocomplete.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.autocomplete.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.base.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.base.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.base.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.base.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.button.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.button.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.button.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.button.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.core.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.core.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.core.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.core.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.datepicker.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.datepicker.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.datepicker.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.datepicker.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.dialog.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.dialog.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.dialog.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.dialog.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.progressbar.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.progressbar.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.progressbar.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.progressbar.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.resizable.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.resizable.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.resizable.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.resizable.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.selectable.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.selectable.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.selectable.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.selectable.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.slider.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.slider.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.slider.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.slider.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.tabs.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.tabs.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.tabs.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.tabs.min.css diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.theme.min.css b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.theme.min.css similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.theme.min.css rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.theme.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Controllers/HomeController.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Controllers/HomeController.cs similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Controllers/HomeController.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Controllers/HomeController.cs diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Controllers/SendAndBlockController.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Controllers/SendAndBlockController.cs similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Controllers/SendAndBlockController.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Controllers/SendAndBlockController.cs diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Controllers/SendAsyncController.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Controllers/SendAsyncController.cs similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Controllers/SendAsyncController.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Controllers/SendAsyncController.cs diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Global.asax b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Global.asax similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Global.asax rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Global.asax diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Global.asax.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Global.asax.cs new file mode 100644 index 00000000000..2903a1914fe --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Global.asax.cs @@ -0,0 +1,69 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using NServiceBus; +using NServiceBus.Config; +using NServiceBus.Integration.Azure; + +namespace Website +{ + public class MvcApplication : HttpApplication + { + public static IBus Bus; + + private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); + + private static IBus ConfigureNServiceBus() + { + Configure.Transactions.Enable(); + Configure.Serialization.Json(); + + var bus = Configure.With() + .DefaultBuilder() + .ForMvc() + .AzureDiagnosticsLogger() + .AzureConfigurationSource() + .AzureMessageQueue() + .QueuePerInstance() + .UnicastBus() + .LoadMessageHandlers() + .CreateBus() + .Start(); + + return bus; + } + + public static void RegisterGlobalFilters(GlobalFilterCollection filters) + { + filters.Add(new HandleErrorAttribute()); + } + + public static void RegisterRoutes(RouteCollection routes) + { + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + + routes.MapRoute( + "Default", // Route name + "{controller}/{action}/{id}", // URL with parameters + new { controller = "Home", action = "SendLinks", id = UrlParameter.Optional } // Parameter defaults + + ); + } + + protected void Application_Start() + { + AreaRegistration.RegisterAllAreas(); + + RegisterGlobalFilters(GlobalFilters.Filters); + RegisterRoutes(RouteTable.Routes); + } + + protected void Application_BeginRequest(object sender, EventArgs e) + { + Bus = StartBus.Value; + } + } +} \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/InjectionConfiguration/ConfigureMvc3.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/InjectionConfiguration/ConfigureMvc3.cs similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/InjectionConfiguration/ConfigureMvc3.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/InjectionConfiguration/ConfigureMvc3.cs diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/InjectionConfiguration/NServiceBusControllerActivator.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/InjectionConfiguration/NServiceBusControllerActivator.cs similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/InjectionConfiguration/NServiceBusControllerActivator.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/InjectionConfiguration/NServiceBusControllerActivator.cs diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/InjectionConfiguration/NServiceBusDependencyResolverAdapter.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/InjectionConfiguration/NServiceBusDependencyResolverAdapter.cs similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/InjectionConfiguration/NServiceBusDependencyResolverAdapter.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/InjectionConfiguration/NServiceBusDependencyResolverAdapter.cs diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Properties/AssemblyInfo.cs diff --git a/Samples/Azure/AzureHost/Host/Scripts/MicrosoftAjax.debug.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftAjax.debug.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/MicrosoftAjax.debug.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftAjax.debug.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/MicrosoftAjax.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftAjax.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/MicrosoftAjax.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftAjax.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/MicrosoftMvcAjax.debug.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcAjax.debug.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/MicrosoftMvcAjax.debug.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcAjax.debug.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/MicrosoftMvcAjax.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcAjax.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/MicrosoftMvcAjax.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcAjax.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/MicrosoftMvcValidation.debug.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcValidation.debug.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/MicrosoftMvcValidation.debug.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcValidation.debug.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/MicrosoftMvcValidation.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcValidation.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/MicrosoftMvcValidation.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/MicrosoftMvcValidation.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/jquery-1.5.1-vsdoc.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.1-vsdoc.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/jquery-1.5.1-vsdoc.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.1-vsdoc.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/jquery-1.5.1.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.1.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/jquery-1.5.1.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.1.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/jquery-1.5.1.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.1.min.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/jquery-1.5.1.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.1.min.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.2-vsdoc.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.2-vsdoc.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.2-vsdoc.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.2-vsdoc.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.2.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.2.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.2.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.2.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.2.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.2.min.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.2.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-1.5.2.min.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/jquery-ui-1.8.11.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.11.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/jquery-ui-1.8.11.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.11.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/jquery-ui-1.8.11.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.11.min.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/jquery-ui-1.8.11.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.11.min.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.16.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.16.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.16.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.16.js diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.16.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.16.min.js similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.16.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.16.min.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/jquery.unobtrusive-ajax.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.unobtrusive-ajax.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/jquery.unobtrusive-ajax.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.unobtrusive-ajax.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/jquery.unobtrusive-ajax.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.unobtrusive-ajax.min.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/jquery.unobtrusive-ajax.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.unobtrusive-ajax.min.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/jquery.validate-vsdoc.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate-vsdoc.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/jquery.validate-vsdoc.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate-vsdoc.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/jquery.validate.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/jquery.validate.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/jquery.validate.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.min.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/jquery.validate.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.min.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/jquery.validate.unobtrusive.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.unobtrusive.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/jquery.validate.unobtrusive.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.unobtrusive.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/jquery.validate.unobtrusive.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.unobtrusive.min.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/jquery.validate.unobtrusive.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/jquery.validate.unobtrusive.min.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/modernizr-1.7.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/modernizr-1.7.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/modernizr-1.7.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/modernizr-1.7.js diff --git a/Samples/Azure/AzureHost/Host/Scripts/modernizr-1.7.min.js b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/modernizr-1.7.min.js similarity index 100% rename from Samples/Azure/AzureHost/Host/Scripts/modernizr-1.7.min.js rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Scripts/modernizr-1.7.min.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Views/Home/SendLinks.cshtml b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Views/Home/SendLinks.cshtml similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Views/Home/SendLinks.cshtml rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Views/Home/SendLinks.cshtml diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Views/Shared/Index.cshtml b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Views/Shared/Index.cshtml similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Views/Shared/Index.cshtml rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Views/Shared/Index.cshtml diff --git a/Samples/Azure/AzureHost/Host/Views/Web.config b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Views/Web.config similarity index 100% rename from Samples/Azure/AzureHost/Host/Views/Web.config rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Views/Web.config diff --git a/Samples/Azure/AzureHost/Host/Web.Debug.config b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Web.Debug.config similarity index 100% rename from Samples/Azure/AzureHost/Host/Web.Debug.config rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Web.Debug.config diff --git a/Samples/Azure/AzureHost/Host/Web.Release.config b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Web.Release.config similarity index 100% rename from Samples/Azure/AzureHost/Host/Web.Release.config rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Web.Release.config diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Web.config b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Web.config new file mode 100644 index 00000000000..6520bf6d34b --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Web.config @@ -0,0 +1,93 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/WebRole.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/WebRole.cs similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/WebRole.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/WebRole.cs diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Website.csproj b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Website.csproj new file mode 100644 index 00000000000..0387433ca8e --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/Website.csproj @@ -0,0 +1,290 @@ + + + + + Debug + AnyCPU + + + 2.0 + {12AFC759-8E5F-4B5C-B092-F7FF30A1F8C8} + {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Website + Website + v4.0 + false + false + + + + + 4.0 + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll + + + ..\..\..\..\lib\Ionic.Zip.dll + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + True + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + False + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + + + False + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + True + + + True + + + True + + + True + + + + + + + + + + + + + True + + + True + + + + + + + + + + + + + + + + + Global.asax + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Web.config + + + Web.config + + + + + + + + + + + + + + + + + + + + + + {A2995239-C5E5-49B6-B134-34CD331BC51F} + Contract + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + + + + + False + True + 3488 + / + + + False + False + + + False + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/packages.config b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/packages.config new file mode 100644 index 00000000000..cde69d5fc0b --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Website/packages.config @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Worker/CommandMessageHandler.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/CommandMessageHandler.cs similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Worker/CommandMessageHandler.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/CommandMessageHandler.cs diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/EndpointConfiguration.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/EndpointConfiguration.cs new file mode 100644 index 00000000000..800b451152e --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/EndpointConfiguration.cs @@ -0,0 +1,9 @@ +using NServiceBus; + +namespace Worker +{ + public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Worker, UsingTransport + { + + } +} \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Worker/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Worker/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/Properties/AssemblyInfo.cs diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/Worker.csproj b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/Worker.csproj new file mode 100644 index 00000000000..3fe2509c802 --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/Worker.csproj @@ -0,0 +1,166 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {39F7FC6A-4319-4AC5-89AF-36D730FC547D} + Library + Properties + Worker + Worker + v4.0 + 512 + Worker + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll + + + ..\..\..\..\packages\Iesi.Collections.3.3.3.4000\lib\Net35\Iesi.Collections.dll + + + ..\..\..\..\lib\Ionic.Zip.dll + + + ..\..\..\..\lib\log4net.dll + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + False + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + + + False + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\..\packages\NHibernate.3.3.3.4000\lib\Net35\NHibernate.dll + + + ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.NHibernate.dll + + + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + + + + + + + + + + + + {A2995239-C5E5-49B6-B134-34CD331BC51F} + Contract + + + + + False + Microsoft .NET Framework 4 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Worker/WorkerRole.cs b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/WorkerRole.cs similarity index 100% rename from Samples/Azure/AzureAsyncPagesMVC3/Worker/WorkerRole.cs rename to IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/WorkerRole.cs diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/app.config b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/app.config new file mode 100644 index 00000000000..533e354fb35 --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/app.config @@ -0,0 +1,24 @@ + + + + +
+ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/packages.config b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/packages.config new file mode 100644 index 00000000000..56e5b5e40d2 --- /dev/null +++ b/IntegrationTests/Azure/AzureAsyncPagesMVC3/Worker/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureBlobStorageDataBus/DataBus.sln b/IntegrationTests/Azure/AzureBlobStorageDataBus/DataBus.sln similarity index 100% rename from Samples/Azure/AzureBlobStorageDataBus/DataBus.sln rename to IntegrationTests/Azure/AzureBlobStorageDataBus/DataBus.sln diff --git a/Samples/Azure/AzureBlobStorageDataBus/Receiver.Messages/AnotherMessageWithLargePayload.cs b/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver.Messages/AnotherMessageWithLargePayload.cs similarity index 100% rename from Samples/Azure/AzureBlobStorageDataBus/Receiver.Messages/AnotherMessageWithLargePayload.cs rename to IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver.Messages/AnotherMessageWithLargePayload.cs diff --git a/Samples/Azure/AzureBlobStorageDataBus/Receiver.Messages/MessageWithLargePayload.cs b/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver.Messages/MessageWithLargePayload.cs similarity index 100% rename from Samples/Azure/AzureBlobStorageDataBus/Receiver.Messages/MessageWithLargePayload.cs rename to IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver.Messages/MessageWithLargePayload.cs diff --git a/Samples/Azure/AzureBlobStorageDataBus/Receiver.Messages/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver.Messages/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzureBlobStorageDataBus/Receiver.Messages/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver.Messages/Properties/AssemblyInfo.cs diff --git a/Samples/Azure/AzureBlobStorageDataBus/Receiver.Messages/Receiver.Messages.csproj b/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver.Messages/Receiver.Messages.csproj similarity index 100% rename from Samples/Azure/AzureBlobStorageDataBus/Receiver.Messages/Receiver.Messages.csproj rename to IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver.Messages/Receiver.Messages.csproj diff --git a/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/App.config b/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/App.config new file mode 100644 index 00000000000..718ecdda093 --- /dev/null +++ b/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/App.config @@ -0,0 +1,32 @@ + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureBlobStorageDataBus/Receiver/MessageWithLargePayloadHandler.cs b/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/MessageWithLargePayloadHandler.cs similarity index 100% rename from Samples/Azure/AzureBlobStorageDataBus/Receiver/MessageWithLargePayloadHandler.cs rename to IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/MessageWithLargePayloadHandler.cs diff --git a/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/Program.cs b/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/Program.cs new file mode 100644 index 00000000000..4e1aab49352 --- /dev/null +++ b/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/Program.cs @@ -0,0 +1,31 @@ +using System; +using NServiceBus; + +namespace Receiver +{ + class Program + { + static void Main(string[] args) + { + BootstrapNServiceBus(); + + Console.WriteLine("Press enter to stop receiving"); + Console.ReadLine(); + } + + private static void BootstrapNServiceBus() + { + Configure.Transactions.Enable(); + Configure.Serialization.Binary(); + + Configure.With() + .DefaultBuilder() + .AzureMessageQueue() + .AzureDataBus() + .UnicastBus() + .LoadMessageHandlers() + .CreateBus() + .Start(); + } + } +} diff --git a/Samples/Azure/AzureBlobStorageDataBus/Receiver/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzureBlobStorageDataBus/Receiver/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/Properties/AssemblyInfo.cs diff --git a/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/Receiver.csproj b/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/Receiver.csproj new file mode 100644 index 00000000000..a4c589c5157 --- /dev/null +++ b/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/Receiver.csproj @@ -0,0 +1,92 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {6987F415-B4D5-4380-ADED-EED5AF170608} + Exe + Properties + Receiver + Receiver + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + Receiver.Program + + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + + + + Designer + + + + + + {E4A4B35E-AFD3-456C-A5AC-4A88AAD77156} + Receiver.Messages + + + + + Program + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/packages.config b/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/packages.config new file mode 100644 index 00000000000..56e5b5e40d2 --- /dev/null +++ b/IntegrationTests/Azure/AzureBlobStorageDataBus/Receiver/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureBlobStorageDataBus/Sender/App.config b/IntegrationTests/Azure/AzureBlobStorageDataBus/Sender/App.config new file mode 100644 index 00000000000..815519f8115 --- /dev/null +++ b/IntegrationTests/Azure/AzureBlobStorageDataBus/Sender/App.config @@ -0,0 +1,30 @@ + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureBlobStorageDataBus/Sender/Program.cs b/IntegrationTests/Azure/AzureBlobStorageDataBus/Sender/Program.cs new file mode 100644 index 00000000000..b2d9fdd6c39 --- /dev/null +++ b/IntegrationTests/Azure/AzureBlobStorageDataBus/Sender/Program.cs @@ -0,0 +1,70 @@ +using System; +using NServiceBus; +using Receiver.Messages; + +namespace Sender +{ + class Program + { + private static IBus bus; + + static void Main(string[] args) + { + BootstrapNServiceBus(); + + string key = ""; + + while (key != "q") + { + Console.WriteLine("Press 'q' to quit, Use 'e' to send a message that will exceed the limit and throw, or any other key to send a large message."); + + key = Console.ReadLine(); + + if(key == "q") continue; + if (key == "e") SendMessageThatIsLargerThanQueueStorageCanHandle(); + else SendMessageThroughDataBus(); + + } + } + + private static void SendMessageThroughDataBus() + { + bus.Send(m => + { + m.SomeProperty = "This message contains a large blob that will be sent on the data bus"; + m.LargeBlob = new DataBusProperty(new byte[1024 * 1024 * 5]);//5MB + }); + } + + private static void SendMessageThatIsLargerThanQueueStorageCanHandle() + { + try + { + bus.Send(m => + { + m.LargeBlob = new byte[1024 * 1024 * 5];//5MB + }); + + } + catch (Exception ex) + { + Console.WriteLine(ex); + } + + } + private static void BootstrapNServiceBus() + { + Configure.Transactions.Enable(); + Configure.Serialization.Binary(); + + bus = Configure.With() + .DefaultBuilder() + .AzureMessageQueue() + .AzureDataBus() + .UnicastBus() + .LoadMessageHandlers() + .CreateBus() + .Start(); + } + } +} diff --git a/Samples/Azure/AzureBlobStorageDataBus/Sender/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureBlobStorageDataBus/Sender/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzureBlobStorageDataBus/Sender/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureBlobStorageDataBus/Sender/Properties/AssemblyInfo.cs diff --git a/IntegrationTests/Azure/AzureBlobStorageDataBus/Sender/Sender.csproj b/IntegrationTests/Azure/AzureBlobStorageDataBus/Sender/Sender.csproj new file mode 100644 index 00000000000..b91e35c3ad8 --- /dev/null +++ b/IntegrationTests/Azure/AzureBlobStorageDataBus/Sender/Sender.csproj @@ -0,0 +1,94 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {D04CF1FC-C4C0-4959-A817-2BC68770CA9B} + Exe + Properties + Sender + Sender + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + Sender.Program + + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll + + + + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + + + {E4A4B35E-AFD3-456C-A5AC-4A88AAD77156} + Receiver.Messages + + + + + Designer + + + + + + Program + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureBlobStorageDataBus/Sender/packages.config b/IntegrationTests/Azure/AzureBlobStorageDataBus/Sender/packages.config new file mode 100644 index 00000000000..56e5b5e40d2 --- /dev/null +++ b/IntegrationTests/Azure/AzureBlobStorageDataBus/Sender/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureFullDuplex/AzureFullDuplex.ccproj b/IntegrationTests/Azure/AzureFullDuplex/AzureFullDuplex.ccproj similarity index 90% rename from Samples/Azure/AzureFullDuplex/AzureFullDuplex.ccproj rename to IntegrationTests/Azure/AzureFullDuplex/AzureFullDuplex.ccproj index 8014681f5fe..9e6291e5e8d 100644 --- a/Samples/Azure/AzureFullDuplex/AzureFullDuplex.ccproj +++ b/IntegrationTests/Azure/AzureFullDuplex/AzureFullDuplex.ccproj @@ -4,14 +4,15 @@ Debug AnyCPU - 1.6 + 2.0 {adcfc6b6-8bf7-4d56-b6a4-f6d221111666} Library Properties AzureService AzureService - False + True AzureService + False true @@ -42,6 +43,7 @@ True Worker OrderService + True OrderWebSite @@ -60,7 +62,7 @@ 10.0 - $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\1.6\ + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.0\ + \ No newline at end of file diff --git a/Samples/Azure/AzureFullDuplex/OrderService/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureFullDuplex/OrderService/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzureFullDuplex/OrderService/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureFullDuplex/OrderService/Properties/AssemblyInfo.cs diff --git a/IntegrationTests/Azure/AzureFullDuplex/OrderService/WorkerRole.cs b/IntegrationTests/Azure/AzureFullDuplex/OrderService/WorkerRole.cs new file mode 100644 index 00000000000..60de2612f64 --- /dev/null +++ b/IntegrationTests/Azure/AzureFullDuplex/OrderService/WorkerRole.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Specialized; +using System.Threading; +using Common.Logging; +using log4net.Core; +using Microsoft.WindowsAzure.ServiceRuntime; +using MyMessages; +using NServiceBus; +using NServiceBus.Config; +using NServiceBus.Integration.Azure; + +namespace OrderService +{ + public class WorkerRole : RoleEntryPoint + { + public IBus Bus; + + public OrderList Orders = new OrderList(); + private ILog logger; + + public override void Run() + { + ConfigureLogging(); + + logger.Info("Starting order worker with instance id:" + RoleEnvironment.CurrentRoleInstance.Id); + + ConfigureNServiceBus(); + + while (true) + { + Thread.Sleep(10000); + + logger.Info("Approving orders"); + + foreach (var order in Orders.GetOrdersToApprove()) + { + var updatedOrder = Orders.UpdateStatus(order, OrderStatus.Approved); + + //publish update + var orderUpdatedEvent = Bus.CreateInstance(x => x.UpdatedOrder = updatedOrder); + Bus.Publish(orderUpdatedEvent); + } + } + } + + private void ConfigureNServiceBus() + { + + logger.Info("Initalizing NServiceBus"); + try + { + var config = Configure.With() + .SpringBuilder() + .AzureConfigurationSource() + .UnicastBus() + .LoadMessageHandlers() + .AzureQueuesTransport() + .IsTransactional(true) + .PurgeOnStartup(false) + .InMemorySubscriptionStorage();//we use inmemory storage until we have a sub storage for TableStorage or SQL Services + + Configure.Instance.Configurer.RegisterSingleton(Orders); + + Bus = config.CreateBus() + .Start(); + + } + catch (Exception ex) + { + logger.Error(ex); + throw; + } + + logger.Info("NServiceBus started"); + + } + + + private void ConfigureLogging() + { + LogManager.Adapter = new Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter(new NameValueCollection + { + {"configType","EXTERNAL"} + }); + + var appender = new AzureAppender + { + ConnectionStringKey = "AzureQueueConfig.ConnectionString", + Threshold = Level.Debug + }; + appender.ActivateOptions(); + + log4net.Config.BasicConfigurator.Configure(appender); + + logger = LogManager.GetLogger(typeof(WorkerRole)); + } + } +} diff --git a/IntegrationTests/Azure/AzureFullDuplex/OrderService/packages.config b/IntegrationTests/Azure/AzureFullDuplex/OrderService/packages.config new file mode 100644 index 00000000000..106fa3772ae --- /dev/null +++ b/IntegrationTests/Azure/AzureFullDuplex/OrderService/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureFullDuplex/OrderWebSite/Default.aspx b/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Default.aspx similarity index 100% rename from Samples/Azure/AzureFullDuplex/OrderWebSite/Default.aspx rename to IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Default.aspx diff --git a/Samples/Azure/AzureFullDuplex/OrderWebSite/Default.aspx.cs b/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Default.aspx.cs similarity index 100% rename from Samples/Azure/AzureFullDuplex/OrderWebSite/Default.aspx.cs rename to IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Default.aspx.cs diff --git a/Samples/Azure/AzureFullDuplex/OrderWebSite/Default.aspx.designer.cs b/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Default.aspx.designer.cs similarity index 100% rename from Samples/Azure/AzureFullDuplex/OrderWebSite/Default.aspx.designer.cs rename to IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Default.aspx.designer.cs diff --git a/Samples/Azure/AzureFullDuplex/OrderWebSite/Global.asax b/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Global.asax similarity index 100% rename from Samples/Azure/AzureFullDuplex/OrderWebSite/Global.asax rename to IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Global.asax diff --git a/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Global.asax.cs b/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Global.asax.cs new file mode 100644 index 00000000000..064e2d93bdf --- /dev/null +++ b/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Global.asax.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Web; +using MyMessages; +using NServiceBus.Features; +using log4net; +using NServiceBus; + +namespace OrderWebSite +{ + public class Global : HttpApplication + { + public static IBus Bus; + public static IList Orders; + + private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); + + private static IBus ConfigureNServiceBus() + { + Configure.Transactions.Enable(); + Configure.Serialization.Json(); + + Feature.Disable(); + Feature.Disable(); + Feature.Disable(); + + var bus = Configure.With() + .DefiningMessagesAs(t => typeof (IDefineMessages).IsAssignableFrom(t) && t != typeof(IDefineMessages)) + .DefaultBuilder() + .AzureConfigurationSource() + .AzureDiagnosticsLogger() + .AzureMessageQueue() + .QueuePerInstance() + .PurgeOnStartup(true) + .UnicastBus() + .CreateBus() + .Start(); + + return bus; + } + + protected void Application_Start(object sender, EventArgs e) + { + Orders = new List(); + } + + protected void Application_BeginRequest(object sender, EventArgs e) + { + Bus = StartBus.Value; + } + + protected void Application_AuthenticateRequest(object sender, EventArgs e) + { + + } + + protected void Application_Error(object sender, EventArgs e) + { + + } + + protected void Session_End(object sender, EventArgs e) + { + + } + + protected void Application_End(object sender, EventArgs e) + { + + } + + } +} \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/OrderWebSite.csproj b/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/OrderWebSite.csproj new file mode 100644 index 00000000000..2c8ec73e42c --- /dev/null +++ b/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/OrderWebSite.csproj @@ -0,0 +1,165 @@ + + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + OrderWebSite + OrderWebSite + v4.0 + + + 4.0 + + false + + + v4.0 + 4.0 + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + False + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Configuration.dll + + + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + True + + + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + False + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + + + + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + + + Designer + + + + + ASPXCodeBehind + Default.aspx + + + Default.aspx + + + Global.asax + + + + + + {3871CC9B-235F-4E60-98F7-FEF04DB1201B} + MyMessages + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + + False + True + 51188 + / + + + False + False + + + False + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureFullDuplex/OrderWebSite/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzureFullDuplex/OrderWebSite/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Properties/AssemblyInfo.cs diff --git a/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Web.config b/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Web.config new file mode 100644 index 00000000000..add77517501 --- /dev/null +++ b/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/Web.config @@ -0,0 +1,34 @@ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/packages.config b/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/packages.config new file mode 100644 index 00000000000..106fa3772ae --- /dev/null +++ b/IntegrationTests/Azure/AzureFullDuplex/OrderWebSite/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureFullDuplex/ServiceConfiguration.cscfg b/IntegrationTests/Azure/AzureFullDuplex/ServiceConfiguration.cscfg new file mode 100644 index 00000000000..479a0a8ef8e --- /dev/null +++ b/IntegrationTests/Azure/AzureFullDuplex/ServiceConfiguration.cscfg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureFullDuplex/ServiceDefinition.build.csdef b/IntegrationTests/Azure/AzureFullDuplex/ServiceDefinition.build.csdef new file mode 100644 index 00000000000..b29667099a5 --- /dev/null +++ b/IntegrationTests/Azure/AzureFullDuplex/ServiceDefinition.build.csdef @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureFullDuplex/ServiceDefinition.csdef b/IntegrationTests/Azure/AzureFullDuplex/ServiceDefinition.csdef new file mode 100644 index 00000000000..60f063563ad --- /dev/null +++ b/IntegrationTests/Azure/AzureFullDuplex/ServiceDefinition.csdef @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Encryption/.nuget/NuGet.Config b/IntegrationTests/Azure/AzureHost/.nuget/NuGet.Config similarity index 100% rename from Samples/Encryption/.nuget/NuGet.Config rename to IntegrationTests/Azure/AzureHost/.nuget/NuGet.Config diff --git a/IntegrationTests/Azure/AzureHost/.nuget/NuGet.exe b/IntegrationTests/Azure/AzureHost/.nuget/NuGet.exe new file mode 100644 index 00000000000..cb3ed0367e1 Binary files /dev/null and b/IntegrationTests/Azure/AzureHost/.nuget/NuGet.exe differ diff --git a/IntegrationTests/Azure/AzureHost/.nuget/NuGet.targets b/IntegrationTests/Azure/AzureHost/.nuget/NuGet.targets new file mode 100644 index 00000000000..46a1b6ced78 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/.nuget/NuGet.targets @@ -0,0 +1,133 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + + + + + $(SolutionDir).nuget + packages.config + + + + + $(NuGetToolsPath)\NuGet.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + -NonInteractive + + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " + $(NuGetCommand) pack "$(ProjectPath)" -Properties Configuration=$(Configuration) $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/AzureHost.sln b/IntegrationTests/Azure/AzureHost/AzureHost.sln new file mode 100644 index 00000000000..3d755a6b92a --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/AzureHost.sln @@ -0,0 +1,45 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "AzureHost", "AzureHost\AzureHost.ccproj", "{FDEABEA1-2723-40F4-A871-B618D71A0C7A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Worker", "Worker\Worker.csproj", "{0CF5DB7F-D5B6-45C2-BEA7-4C5EB947A438}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Host", "Host\Host.csproj", "{A60DF3DD-1D45-42B5-9859-1CDB8D90FCFF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Messages", "Messages\Messages.csproj", "{838CE3D7-23D2-4B66-8933-19E283D38363}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{E3958BA3-3D7E-48F8-909A-88736F6CE0D6}" + ProjectSection(SolutionItems) = preProject + .nuget\NuGet.Config = .nuget\NuGet.Config + .nuget\NuGet.exe = .nuget\NuGet.exe + .nuget\NuGet.targets = .nuget\NuGet.targets + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FDEABEA1-2723-40F4-A871-B618D71A0C7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDEABEA1-2723-40F4-A871-B618D71A0C7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDEABEA1-2723-40F4-A871-B618D71A0C7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDEABEA1-2723-40F4-A871-B618D71A0C7A}.Release|Any CPU.Build.0 = Release|Any CPU + {0CF5DB7F-D5B6-45C2-BEA7-4C5EB947A438}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0CF5DB7F-D5B6-45C2-BEA7-4C5EB947A438}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0CF5DB7F-D5B6-45C2-BEA7-4C5EB947A438}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CF5DB7F-D5B6-45C2-BEA7-4C5EB947A438}.Release|Any CPU.Build.0 = Release|Any CPU + {A60DF3DD-1D45-42B5-9859-1CDB8D90FCFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A60DF3DD-1D45-42B5-9859-1CDB8D90FCFF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A60DF3DD-1D45-42B5-9859-1CDB8D90FCFF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A60DF3DD-1D45-42B5-9859-1CDB8D90FCFF}.Release|Any CPU.Build.0 = Release|Any CPU + {838CE3D7-23D2-4B66-8933-19E283D38363}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {838CE3D7-23D2-4B66-8933-19E283D38363}.Debug|Any CPU.Build.0 = Debug|Any CPU + {838CE3D7-23D2-4B66-8933-19E283D38363}.Release|Any CPU.ActiveCfg = Release|Any CPU + {838CE3D7-23D2-4B66-8933-19E283D38363}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Samples/Azure/AzureHost/AzureHost/AzureHost.ccproj b/IntegrationTests/Azure/AzureHost/AzureHost/AzureHost.ccproj similarity index 94% rename from Samples/Azure/AzureHost/AzureHost/AzureHost.ccproj rename to IntegrationTests/Azure/AzureHost/AzureHost/AzureHost.ccproj index c0ab7a7a2fa..6116eadb6ee 100644 --- a/Samples/Azure/AzureHost/AzureHost/AzureHost.ccproj +++ b/IntegrationTests/Azure/AzureHost/AzureHost/AzureHost.ccproj @@ -4,7 +4,7 @@ Debug AnyCPU - 1.6 + 2.0 {fdeabea1-2723-40f4-a871-b618d71a0c7a} Library Properties @@ -12,6 +12,7 @@ AzureHost True AzureHost + False true @@ -55,7 +56,7 @@ 10.0 - $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\1.6\ + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.0\ \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/AzureHost/ServiceConfiguration.Cloud.cscfg b/IntegrationTests/Azure/AzureHost/AzureHost/ServiceConfiguration.Cloud.cscfg new file mode 100644 index 00000000000..45c6096787f --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/AzureHost/ServiceConfiguration.Cloud.cscfg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/AzureHost/ServiceConfiguration.Local.cscfg b/IntegrationTests/Azure/AzureHost/AzureHost/ServiceConfiguration.Local.cscfg new file mode 100644 index 00000000000..c13956d0519 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/AzureHost/ServiceConfiguration.Local.cscfg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/AzureHost/ServiceDefinition.build.csdef b/IntegrationTests/Azure/AzureHost/AzureHost/ServiceDefinition.build.csdef new file mode 100644 index 00000000000..f48b75855a9 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/AzureHost/ServiceDefinition.build.csdef @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/AzureHost/ServiceDefinition.csdef b/IntegrationTests/Azure/AzureHost/AzureHost/ServiceDefinition.csdef new file mode 100644 index 00000000000..d2f73ae2cdb --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/AzureHost/ServiceDefinition.csdef @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureHost/AzureHost.sln b/IntegrationTests/Azure/AzureHost/Backup/AzureHost.sln similarity index 100% rename from Samples/Azure/AzureHost/AzureHost.sln rename to IntegrationTests/Azure/AzureHost/Backup/AzureHost.sln diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/Site.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/Site.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/Site.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/Site.css diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_222222_256x240.png b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-icons_222222_256x240.png similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_222222_256x240.png rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-icons_222222_256x240.png diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_2e83ff_256x240.png b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_2e83ff_256x240.png rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-icons_2e83ff_256x240.png diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_454545_256x240.png b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-icons_454545_256x240.png similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_454545_256x240.png rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-icons_454545_256x240.png diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_888888_256x240.png b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-icons_888888_256x240.png similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_888888_256x240.png rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-icons_888888_256x240.png diff --git a/Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_cd0a0a_256x240.png b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-icons_cd0a0a_256x240.png similarity index 100% rename from Samples/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_cd0a0a_256x240.png rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/images/ui-icons_cd0a0a_256x240.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.accordion.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.accordion.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.accordion.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.accordion.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.all.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.all.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.all.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.all.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.autocomplete.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.autocomplete.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.autocomplete.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.autocomplete.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.base.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.base.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.base.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.base.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.button.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.button.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.button.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.button.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.core.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.core.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.core.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.core.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.datepicker.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.datepicker.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.datepicker.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.datepicker.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.dialog.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.dialog.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.dialog.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.dialog.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.progressbar.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.progressbar.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.progressbar.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.progressbar.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.resizable.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.resizable.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.resizable.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.resizable.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.selectable.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.selectable.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.selectable.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.selectable.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.slider.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.slider.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.slider.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.slider.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.tabs.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.tabs.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.tabs.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.tabs.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.theme.css b/IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.theme.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery.ui.theme.css rename to IntegrationTests/Azure/AzureHost/Backup/Host/Content/themes/base/jquery.ui.theme.css diff --git a/Samples/Azure/AzureHost/Host/Controllers/HomeController.cs b/IntegrationTests/Azure/AzureHost/Backup/Host/Controllers/HomeController.cs similarity index 100% rename from Samples/Azure/AzureHost/Host/Controllers/HomeController.cs rename to IntegrationTests/Azure/AzureHost/Backup/Host/Controllers/HomeController.cs diff --git a/Samples/Azure/AzureHost/Host/Global.asax b/IntegrationTests/Azure/AzureHost/Backup/Host/Global.asax similarity index 100% rename from Samples/Azure/AzureHost/Host/Global.asax rename to IntegrationTests/Azure/AzureHost/Backup/Host/Global.asax diff --git a/IntegrationTests/Azure/AzureHost/Backup/Host/Global.asax.cs b/IntegrationTests/Azure/AzureHost/Backup/Host/Global.asax.cs new file mode 100644 index 00000000000..e6e41fad436 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Backup/Host/Global.asax.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using NServiceBus; +using NServiceBus.Config; +using NServiceBus.Integration.Azure; + +namespace Host +{ + // Note: For instructions on enabling IIS6 or IIS7 classic mode, + // visit http://go.microsoft.com/?LinkId=9394801 + + public class MvcApplication : System.Web.HttpApplication + { + public static IBus Bus; + + private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); + + private static IBus ConfigureNServiceBus() + { + Configure.Serialization.Json(); + var bus = Configure.With() + .DefaultBuilder() + .ForMvc() + .Log4Net(new AzureAppender()) + .AzureConfigurationSource() + .AzureMessageQueue() + .QueuePerInstance() + .UnicastBus() + .LoadMessageHandlers() + .IsTransactional(true) + .CreateBus() + .Start(); + + return bus; + } + + protected void Application_BeginRequest() + { + Bus = StartBus.Value; + } + + public static void RegisterGlobalFilters(GlobalFilterCollection filters) + { + filters.Add(new HandleErrorAttribute()); + } + + public static void RegisterRoutes(RouteCollection routes) + { + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + + routes.MapRoute( + "Hello", // Route name + "Hello", // URL with parameters + new { controller = "Home", action = "Hello" } // Parameter defaults + ); + + routes.MapRoute( + "Text", // Route name + "Text", // URL with parameters + new { controller = "Home", action = "Text" } // Parameter defaults + ); + + routes.MapRoute( + "Default", // Route name + "{controller}/{action}/{id}", // URL with parameters + new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults + ); + + } + + protected void Application_Start() + { + AreaRegistration.RegisterAllAreas(); + + RegisterGlobalFilters(GlobalFilters.Filters); + RegisterRoutes(RouteTable.Routes); + } + } +} \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Backup/Host/Host.csproj b/IntegrationTests/Azure/AzureHost/Backup/Host/Host.csproj new file mode 100644 index 00000000000..c249bb5cb8e --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Backup/Host/Host.csproj @@ -0,0 +1,256 @@ + + + + Debug + AnyCPU + + + 2.0 + {A60DF3DD-1D45-42B5-9859-1CDB8D90FCFF} + {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Host + Host + v4.0 + false + false + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll + + + ..\..\..\..\packages\Iesi.Collections.3.3.3.4000\lib\Net35\Iesi.Collections.dll + + + ..\..\..\..\lib\Ionic.Zip.dll + + + ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll + + + True + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.1.8.0.0\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll + + + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + True + + + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + False + + + ..\packages\WindowsAzure.Storage.1.7.0.0\lib\net35-full\Microsoft.WindowsAzure.StorageClient.dll + + + ..\..\..\..\packages\NHibernate.3.3.3.4000\lib\Net35\NHibernate.dll + + + ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.NHibernate.dll + + + + + True + + + True + + + True + + + True + + + + + + + + + + + + True + + + True + + + + + + + + + + + + + + + Global.asax + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Web.config + + + Web.config + + + + + + + + + + + + + + + + + + + + + + + + + + + + {838CE3D7-23D2-4B66-8933-19E283D38363} + Messages + + + + + + + + Designer + Always + + + + + + + + + + + + + False + True + 52104 + / + + + False + False + + + False + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureHost/Host/MvcIntegration/BasicViewPageActivator.cs b/IntegrationTests/Azure/AzureHost/Backup/Host/MvcIntegration/BasicViewPageActivator.cs similarity index 100% rename from Samples/Azure/AzureHost/Host/MvcIntegration/BasicViewPageActivator.cs rename to IntegrationTests/Azure/AzureHost/Backup/Host/MvcIntegration/BasicViewPageActivator.cs diff --git a/Samples/Azure/AzureHost/Host/MvcIntegration/ConfigureMvc.cs b/IntegrationTests/Azure/AzureHost/Backup/Host/MvcIntegration/ConfigureMvc.cs similarity index 100% rename from Samples/Azure/AzureHost/Host/MvcIntegration/ConfigureMvc.cs rename to IntegrationTests/Azure/AzureHost/Backup/Host/MvcIntegration/ConfigureMvc.cs diff --git a/Samples/Azure/AzureHost/Host/MvcIntegration/NServiceBusControllerActivator.cs b/IntegrationTests/Azure/AzureHost/Backup/Host/MvcIntegration/NServiceBusControllerActivator.cs similarity index 100% rename from Samples/Azure/AzureHost/Host/MvcIntegration/NServiceBusControllerActivator.cs rename to IntegrationTests/Azure/AzureHost/Backup/Host/MvcIntegration/NServiceBusControllerActivator.cs diff --git a/Samples/Azure/AzureHost/Host/MvcIntegration/NServiceBusResolverAdapter.cs b/IntegrationTests/Azure/AzureHost/Backup/Host/MvcIntegration/NServiceBusResolverAdapter.cs similarity index 100% rename from Samples/Azure/AzureHost/Host/MvcIntegration/NServiceBusResolverAdapter.cs rename to IntegrationTests/Azure/AzureHost/Backup/Host/MvcIntegration/NServiceBusResolverAdapter.cs diff --git a/Samples/Azure/AzureHost/Host/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureHost/Backup/Host/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzureHost/Host/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureHost/Backup/Host/Properties/AssemblyInfo.cs diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/MicrosoftAjax.debug.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/MicrosoftAjax.debug.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/MicrosoftAjax.debug.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/MicrosoftAjax.debug.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/MicrosoftAjax.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/MicrosoftAjax.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/MicrosoftAjax.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/MicrosoftAjax.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/MicrosoftMvcAjax.debug.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/MicrosoftMvcAjax.debug.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/MicrosoftMvcAjax.debug.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/MicrosoftMvcAjax.debug.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/MicrosoftMvcAjax.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/MicrosoftMvcAjax.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/MicrosoftMvcAjax.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/MicrosoftMvcAjax.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/MicrosoftMvcValidation.debug.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/MicrosoftMvcValidation.debug.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/MicrosoftMvcValidation.debug.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/MicrosoftMvcValidation.debug.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/MicrosoftMvcValidation.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/MicrosoftMvcValidation.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/MicrosoftMvcValidation.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/MicrosoftMvcValidation.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery-1.5.1-vsdoc.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery-1.5.1-vsdoc.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery-1.5.1-vsdoc.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery-1.5.1-vsdoc.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery-1.5.1.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery-1.5.1.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery-1.5.1.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery-1.5.1.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery-1.5.1.min.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery-1.5.1.min.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery-1.5.1.min.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery-1.5.1.min.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.11.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery-ui-1.8.11.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.11.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery-ui-1.8.11.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.11.min.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery-ui-1.8.11.min.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery-ui-1.8.11.min.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery-ui-1.8.11.min.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery.unobtrusive-ajax.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery.unobtrusive-ajax.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery.unobtrusive-ajax.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery.unobtrusive-ajax.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery.unobtrusive-ajax.min.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery.unobtrusive-ajax.min.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery.unobtrusive-ajax.min.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery.unobtrusive-ajax.min.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery.validate-vsdoc.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery.validate-vsdoc.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery.validate-vsdoc.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery.validate-vsdoc.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery.validate.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery.validate.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery.validate.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery.validate.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery.validate.min.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery.validate.min.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery.validate.min.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery.validate.min.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery.validate.unobtrusive.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery.validate.unobtrusive.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery.validate.unobtrusive.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery.validate.unobtrusive.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery.validate.unobtrusive.min.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery.validate.unobtrusive.min.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/jquery.validate.unobtrusive.min.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/jquery.validate.unobtrusive.min.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/modernizr-1.7.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/modernizr-1.7.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/modernizr-1.7.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/modernizr-1.7.js diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/modernizr-1.7.min.js b/IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/modernizr-1.7.min.js similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Scripts/modernizr-1.7.min.js rename to IntegrationTests/Azure/AzureHost/Backup/Host/Scripts/modernizr-1.7.min.js diff --git a/Samples/Azure/AzureHost/Host/Views/Home/Hello.cshtml b/IntegrationTests/Azure/AzureHost/Backup/Host/Views/Home/Hello.cshtml similarity index 100% rename from Samples/Azure/AzureHost/Host/Views/Home/Hello.cshtml rename to IntegrationTests/Azure/AzureHost/Backup/Host/Views/Home/Hello.cshtml diff --git a/Samples/Azure/AzureHost/Host/Views/Home/Index.cshtml b/IntegrationTests/Azure/AzureHost/Backup/Host/Views/Home/Index.cshtml similarity index 100% rename from Samples/Azure/AzureHost/Host/Views/Home/Index.cshtml rename to IntegrationTests/Azure/AzureHost/Backup/Host/Views/Home/Index.cshtml diff --git a/Samples/Azure/AzureHost/Host/Views/Shared/Error.cshtml b/IntegrationTests/Azure/AzureHost/Backup/Host/Views/Shared/Error.cshtml similarity index 100% rename from Samples/Azure/AzureHost/Host/Views/Shared/Error.cshtml rename to IntegrationTests/Azure/AzureHost/Backup/Host/Views/Shared/Error.cshtml diff --git a/Samples/Azure/AzureHost/Host/Views/Shared/_Layout.cshtml b/IntegrationTests/Azure/AzureHost/Backup/Host/Views/Shared/_Layout.cshtml similarity index 100% rename from Samples/Azure/AzureHost/Host/Views/Shared/_Layout.cshtml rename to IntegrationTests/Azure/AzureHost/Backup/Host/Views/Shared/_Layout.cshtml diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Views/Web.config b/IntegrationTests/Azure/AzureHost/Backup/Host/Views/Web.config similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Views/Web.config rename to IntegrationTests/Azure/AzureHost/Backup/Host/Views/Web.config diff --git a/Samples/Azure/AzureHost/Host/Views/_ViewStart.cshtml b/IntegrationTests/Azure/AzureHost/Backup/Host/Views/_ViewStart.cshtml similarity index 100% rename from Samples/Azure/AzureHost/Host/Views/_ViewStart.cshtml rename to IntegrationTests/Azure/AzureHost/Backup/Host/Views/_ViewStart.cshtml diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Web.Debug.config b/IntegrationTests/Azure/AzureHost/Backup/Host/Web.Debug.config similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Web.Debug.config rename to IntegrationTests/Azure/AzureHost/Backup/Host/Web.Debug.config diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Web.Release.config b/IntegrationTests/Azure/AzureHost/Backup/Host/Web.Release.config similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Web.Release.config rename to IntegrationTests/Azure/AzureHost/Backup/Host/Web.Release.config diff --git a/IntegrationTests/Azure/AzureHost/Backup/Host/Web.config b/IntegrationTests/Azure/AzureHost/Backup/Host/Web.config new file mode 100644 index 00000000000..ead1f0f7c67 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Backup/Host/Web.config @@ -0,0 +1,69 @@ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureHost/Host/WebRole.cs b/IntegrationTests/Azure/AzureHost/Backup/Host/WebRole.cs similarity index 100% rename from Samples/Azure/AzureHost/Host/WebRole.cs rename to IntegrationTests/Azure/AzureHost/Backup/Host/WebRole.cs diff --git a/Samples/Azure/AzureHost/Host/diagnostics.wadcfg b/IntegrationTests/Azure/AzureHost/Backup/Host/diagnostics.wadcfg similarity index 100% rename from Samples/Azure/AzureHost/Host/diagnostics.wadcfg rename to IntegrationTests/Azure/AzureHost/Backup/Host/diagnostics.wadcfg diff --git a/IntegrationTests/Azure/AzureHost/Backup/Host/packages.config b/IntegrationTests/Azure/AzureHost/Backup/Host/packages.config new file mode 100644 index 00000000000..d76ca08e5c4 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Backup/Host/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/Site.css b/IntegrationTests/Azure/AzureHost/Host/Content/Site.css new file mode 100644 index 00000000000..56ff8bd77e8 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/Site.css @@ -0,0 +1,75 @@ +body +{ + font-size: .85em; + font-family: "Trebuchet MS", Verdana, Helvetica, Sans-Serif; + color: #232323; + background-color: #fff; +} + +header, +footer, +nav, +section { + display: block; +} + +/* Styles for basic forms +-----------------------------------------------------------*/ + +fieldset +{ + border:1px solid #ddd; + padding:0 1.4em 1.4em 1.4em; + margin:0 0 1.5em 0; +} + +legend +{ + font-size:1.2em; + font-weight: bold; +} + +textarea +{ + min-height: 75px; +} + +.editor-label +{ + margin: 1em 0 0 0; +} + +.editor-field +{ + margin:0.5em 0 0 0; +} + + +/* Styles for validation helpers +-----------------------------------------------------------*/ +.field-validation-error +{ + color: #ff0000; +} + +.field-validation-valid +{ + display: none; +} + +.input-validation-error +{ + border: 1px solid #ff0000; + background-color: #ffeeee; +} + +.validation-summary-errors +{ + font-weight: bold; + color: #ff0000; +} + +.validation-summary-valid +{ + display: none; +} diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png rename to IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png rename to IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png rename to IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png rename to IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png rename to IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png rename to IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png rename to IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png rename to IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_222222_256x240.png b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_222222_256x240.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_222222_256x240.png rename to IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_222222_256x240.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_2e83ff_256x240.png b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_2e83ff_256x240.png rename to IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_2e83ff_256x240.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_454545_256x240.png b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_454545_256x240.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_454545_256x240.png rename to IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_454545_256x240.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_888888_256x240.png b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_888888_256x240.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_888888_256x240.png rename to IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_888888_256x240.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_cd0a0a_256x240.png b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_cd0a0a_256x240.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/images/ui-icons_cd0a0a_256x240.png rename to IntegrationTests/Azure/AzureHost/Host/Content/themes/base/images/ui-icons_cd0a0a_256x240.png diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.accordion.css b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.accordion.css new file mode 100644 index 00000000000..4a67cbf8e42 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.accordion.css @@ -0,0 +1,24 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Accordion 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Accordion#theming + */ +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; } diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.all.css b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.all.css new file mode 100644 index 00000000000..2b2c103e803 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.all.css @@ -0,0 +1,16 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI CSS Framework 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Theming + */ +@import "jquery.ui.base.css"; +@import "jquery.ui.theme.css"; diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.autocomplete.css b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.autocomplete.css new file mode 100644 index 00000000000..aac4e204d26 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.autocomplete.css @@ -0,0 +1,62 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Autocomplete 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * http://docs.jquery.com/UI/Autocomplete#theming + */ +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Menu 1.8.11 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.base.css b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.base.css new file mode 100644 index 00000000000..f52ee39b959 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.base.css @@ -0,0 +1,11 @@ +@import url("jquery.ui.core.css"); +@import url("jquery.ui.resizable.css"); +@import url("jquery.ui.selectable.css"); +@import url("jquery.ui.accordion.css"); +@import url("jquery.ui.autocomplete.css"); +@import url("jquery.ui.button.css"); +@import url("jquery.ui.dialog.css"); +@import url("jquery.ui.slider.css"); +@import url("jquery.ui.tabs.css"); +@import url("jquery.ui.datepicker.css"); +@import url("jquery.ui.progressbar.css"); \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.button.css b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.button.css new file mode 100644 index 00000000000..af6c985b8dc --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.button.css @@ -0,0 +1,43 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Button 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Button#theming + */ +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.core.css b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.core.css new file mode 100644 index 00000000000..55fb8b0d990 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.core.css @@ -0,0 +1,46 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI CSS Framework 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.datepicker.css b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.datepicker.css new file mode 100644 index 00000000000..7126923cc02 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.datepicker.css @@ -0,0 +1,73 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Datepicker 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Datepicker#theming + */ +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +} \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.dialog.css b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.dialog.css new file mode 100644 index 00000000000..311dd32e5d0 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.dialog.css @@ -0,0 +1,26 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Dialog 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.progressbar.css b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.progressbar.css new file mode 100644 index 00000000000..6e8718e03fa --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.progressbar.css @@ -0,0 +1,16 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Progressbar 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Progressbar#theming + */ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.resizable.css b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.resizable.css new file mode 100644 index 00000000000..bf037be1839 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.resizable.css @@ -0,0 +1,25 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Resizable 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)] + * + * http://docs.jquery.com/UI/Resizable#theming + */ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.selectable.css b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.selectable.css new file mode 100644 index 00000000000..011416b6f70 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.selectable.css @@ -0,0 +1,15 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Selectable 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Selectable#theming + */ +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.slider.css b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.slider.css new file mode 100644 index 00000000000..3bbfb932dbf --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.slider.css @@ -0,0 +1,29 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Slider 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Slider#theming + */ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; } \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.tabs.css b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.tabs.css new file mode 100644 index 00000000000..aa5cd8a546f --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.tabs.css @@ -0,0 +1,23 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Tabs 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Tabs#theming + */ +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.theme.css b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.theme.css new file mode 100644 index 00000000000..0d5b7354655 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Content/themes/base/jquery.ui.theme.css @@ -0,0 +1,257 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI CSS Framework 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/ + */ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; } +.ui-widget-content a { color: #222222/*{fcContent}*/; } +.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; } +.ui-widget-header a { color: #222222/*{fcHeader}*/; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; } +.ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; } +.ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-top { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-right { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-left { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; } +.ui-corner-all { -moz-border-radius: 4px/*{cornerRadius}*/; -webkit-border-radius: 4px/*{cornerRadius}*/; border-radius: 4px/*{cornerRadius}*/; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; } +.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; } \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/Controllers/HomeController.cs b/IntegrationTests/Azure/AzureHost/Host/Controllers/HomeController.cs new file mode 100644 index 00000000000..8332a816c68 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Controllers/HomeController.cs @@ -0,0 +1,43 @@ +using System.Web.Mvc; +using Messages; +using NServiceBus; + +namespace Host.Controllers +{ + public class HomeController : Controller, IHandleMessages + { + private readonly IBus bus; + private static string text = ""; + + public HomeController(IBus bus) + { + this.bus = bus; + } + + public ActionResult Index() + { + return View(); + } + + [HttpPost] + public ActionResult Hello() + { + text = ""; + + bus.Send(new SayHelloTo {Name = Request["name"]}); + + return View(); + } + + [HttpPost] + public string Text() + { + return text; + } + + public void Handle(Hello message) + { + text = message.Text; + } + } +} diff --git a/IntegrationTests/Azure/AzureHost/Host/Global.asax b/IntegrationTests/Azure/AzureHost/Host/Global.asax new file mode 100644 index 00000000000..75853db2356 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Global.asax @@ -0,0 +1 @@ +<%@ Application Codebehind="Global.asax.cs" Inherits="Host.MvcApplication" Language="C#" %> diff --git a/IntegrationTests/Azure/AzureHost/Host/Global.asax.cs b/IntegrationTests/Azure/AzureHost/Host/Global.asax.cs new file mode 100644 index 00000000000..ebed64802bc --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Global.asax.cs @@ -0,0 +1,79 @@ +using System; +using System.Web.Mvc; +using System.Web.Routing; +using NServiceBus; + +namespace Host +{ + // Note: For instructions on enabling IIS6 or IIS7 classic mode, + // visit http://go.microsoft.com/?LinkId=9394801 + + public class MvcApplication : System.Web.HttpApplication + { + public static IBus Bus; + + private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); + + private static IBus ConfigureNServiceBus() + { + Configure.Transactions.Enable(); + Configure.Serialization.Json(); + + var bus = Configure.With() + .DefaultBuilder() + .ForMvc() + .AzureDiagnosticsLogger() + .AzureConfigurationSource() + .AzureMessageQueue() + .QueuePerInstance() + .UnicastBus() + .LoadMessageHandlers() + .CreateBus() + .Start(); + + return bus; + } + + protected void Application_BeginRequest() + { + Bus = StartBus.Value; + } + + public static void RegisterGlobalFilters(GlobalFilterCollection filters) + { + filters.Add(new HandleErrorAttribute()); + } + + public static void RegisterRoutes(RouteCollection routes) + { + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + + routes.MapRoute( + "Hello", // Route name + "Hello", // URL with parameters + new { controller = "Home", action = "Hello" } // Parameter defaults + ); + + routes.MapRoute( + "Text", // Route name + "Text", // URL with parameters + new { controller = "Home", action = "Text" } // Parameter defaults + ); + + routes.MapRoute( + "Default", // Route name + "{controller}/{action}/{id}", // URL with parameters + new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults + ); + + } + + protected void Application_Start() + { + AreaRegistration.RegisterAllAreas(); + + RegisterGlobalFilters(GlobalFilters.Filters); + RegisterRoutes(RouteTable.Routes); + } + } +} \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/Host.csproj b/IntegrationTests/Azure/AzureHost/Host/Host.csproj new file mode 100644 index 00000000000..1ac91ea1cde --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Host.csproj @@ -0,0 +1,271 @@ + + + + + Debug + AnyCPU + + + 2.0 + {A60DF3DD-1D45-42B5-9859-1CDB8D90FCFF} + {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + Host + Host + v4.0 + false + false + + + + + 4.0 + + + + + ..\ + true + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll + + + ..\..\..\..\lib\Ionic.Zip.dll + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + True + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + False + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + + + False + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll + + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + True + + + True + + + True + + + True + + + + + + + + + + + + True + + + True + + + + + + + + + + + + + + + Global.asax + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Web.config + + + Web.config + + + + + + + + + + + + + + + + + + + + + + + + + + + + {838CE3D7-23D2-4B66-8933-19E283D38363} + Messages + + + + + + + + Designer + Always + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + + + + + False + True + 52104 + / + + + False + False + + + False + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/MvcIntegration/BasicViewPageActivator.cs b/IntegrationTests/Azure/AzureHost/Host/MvcIntegration/BasicViewPageActivator.cs new file mode 100644 index 00000000000..b8bbd223e16 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/MvcIntegration/BasicViewPageActivator.cs @@ -0,0 +1,13 @@ +using System; +using System.Web.Mvc; + +namespace Host +{ + public class BasicViewPageActivator : IViewPageActivator + { + public object Create(ControllerContext controllerContext, Type type) + { + return Activator.CreateInstance(type); + } + } +} \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/MvcIntegration/ConfigureMvc.cs b/IntegrationTests/Azure/AzureHost/Host/MvcIntegration/ConfigureMvc.cs new file mode 100644 index 00000000000..ba9ab27987a --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/MvcIntegration/ConfigureMvc.cs @@ -0,0 +1,28 @@ +using System.Linq; +using System.Web.Mvc; +using NServiceBus; +using NServiceBus.ObjectBuilder; + +namespace Host +{ + public static class ConfigureMvc + { + public static Configure ForMvc(this Configure configure) + { + configure.Configurer.RegisterSingleton(typeof (IControllerActivator), new NServiceBusControllerActivator()); + configure.Configurer.RegisterSingleton(typeof (IControllerFactory), new DefaultControllerFactory()); + configure.Configurer.RegisterSingleton(typeof (IViewPageActivator), new BasicViewPageActivator()); + configure.Configurer.RegisterSingleton(typeof(ModelMetadataProvider), ModelMetadataProviders.Current); + + var controllers = Configure.TypesToScan + .Where(t => typeof(IController).IsAssignableFrom(t)); + + foreach (var type in controllers) + configure.Configurer.ConfigureComponent(type, DependencyLifecycle.InstancePerCall); + + DependencyResolver.SetResolver(new NServiceBusResolverAdapter(configure.Builder)); + + return configure; + } + } +} \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/MvcIntegration/NServiceBusControllerActivator.cs b/IntegrationTests/Azure/AzureHost/Host/MvcIntegration/NServiceBusControllerActivator.cs new file mode 100644 index 00000000000..390f8051ecc --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/MvcIntegration/NServiceBusControllerActivator.cs @@ -0,0 +1,15 @@ +using System; +using System.Web.Mvc; +using System.Web.Routing; + +namespace Host +{ + public class NServiceBusControllerActivator : IControllerActivator + { + public IController Create(RequestContext requestContext, Type controllerType) + { + return DependencyResolver.Current + .GetService(controllerType) as IController; + } + } +} \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/MvcIntegration/NServiceBusResolverAdapter.cs b/IntegrationTests/Azure/AzureHost/Host/MvcIntegration/NServiceBusResolverAdapter.cs new file mode 100644 index 00000000000..fcceff12227 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/MvcIntegration/NServiceBusResolverAdapter.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Web.Mvc; +using NServiceBus.ObjectBuilder; + +namespace Host +{ + public class NServiceBusResolverAdapter : IDependencyResolver + { + private readonly IBuilder builder; + + public NServiceBusResolverAdapter(IBuilder builder) + { + this.builder = builder; + } + + public object GetService(Type serviceType) + { + return builder.Build(serviceType); + } + + public IEnumerable GetServices(Type serviceType) + { + return builder.BuildAll(serviceType); + } + } +} \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureHost/Host/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..47d1e5d5799 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Host")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Host")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f4bd0865-61b4-437f-85cf-f9f7901e9d5e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftAjax.debug.js b/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftAjax.debug.js new file mode 100644 index 00000000000..a5f7942ef2b --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftAjax.debug.js @@ -0,0 +1,7117 @@ +// Name: MicrosoftAjax.debug.js +// Assembly: System.Web.Extensions +// Version: 4.0.0.0 +// FileVersion: 4.0.20526.0 +//----------------------------------------------------------------------- +// Copyright (C) Microsoft Corporation. All rights reserved. +//----------------------------------------------------------------------- +// MicrosoftAjax.js +// Microsoft AJAX Framework. + +Function.__typeName = 'Function'; +Function.__class = true; +Function.createCallback = function Function$createCallback(method, context) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "method", type: Function}, + {name: "context", mayBeNull: true} + ]); + if (e) throw e; + return function() { + var l = arguments.length; + if (l > 0) { + var args = []; + for (var i = 0; i < l; i++) { + args[i] = arguments[i]; + } + args[l] = context; + return method.apply(this, args); + } + return method.call(this, context); + } +} +Function.createDelegate = function Function$createDelegate(instance, method) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance", mayBeNull: true}, + {name: "method", type: Function} + ]); + if (e) throw e; + return function() { + return method.apply(instance, arguments); + } +} +Function.emptyFunction = Function.emptyMethod = function Function$emptyMethod() { + /// +} +Function.validateParameters = function Function$validateParameters(parameters, expectedParameters, validateParameterCount) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "parameters"}, + {name: "expectedParameters"}, + {name: "validateParameterCount", type: Boolean, optional: true} + ]); + if (e) throw e; + return Function._validateParams(parameters, expectedParameters, validateParameterCount); +} +Function._validateParams = function Function$_validateParams(params, expectedParams, validateParameterCount) { + var e, expectedLength = expectedParams.length; + validateParameterCount = validateParameterCount || (typeof(validateParameterCount) === "undefined"); + e = Function._validateParameterCount(params, expectedParams, validateParameterCount); + if (e) { + e.popStackFrame(); + return e; + } + for (var i = 0, l = params.length; i < l; i++) { + var expectedParam = expectedParams[Math.min(i, expectedLength - 1)], + paramName = expectedParam.name; + if (expectedParam.parameterArray) { + paramName += "[" + (i - expectedLength + 1) + "]"; + } + else if (!validateParameterCount && (i >= expectedLength)) { + break; + } + e = Function._validateParameter(params[i], expectedParam, paramName); + if (e) { + e.popStackFrame(); + return e; + } + } + return null; +} +Function._validateParameterCount = function Function$_validateParameterCount(params, expectedParams, validateParameterCount) { + var i, error, + expectedLen = expectedParams.length, + actualLen = params.length; + if (actualLen < expectedLen) { + var minParams = expectedLen; + for (i = 0; i < expectedLen; i++) { + var param = expectedParams[i]; + if (param.optional || param.parameterArray) { + minParams--; + } + } + if (actualLen < minParams) { + error = true; + } + } + else if (validateParameterCount && (actualLen > expectedLen)) { + error = true; + for (i = 0; i < expectedLen; i++) { + if (expectedParams[i].parameterArray) { + error = false; + break; + } + } + } + if (error) { + var e = Error.parameterCount(); + e.popStackFrame(); + return e; + } + return null; +} +Function._validateParameter = function Function$_validateParameter(param, expectedParam, paramName) { + var e, + expectedType = expectedParam.type, + expectedInteger = !!expectedParam.integer, + expectedDomElement = !!expectedParam.domElement, + mayBeNull = !!expectedParam.mayBeNull; + e = Function._validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName); + if (e) { + e.popStackFrame(); + return e; + } + var expectedElementType = expectedParam.elementType, + elementMayBeNull = !!expectedParam.elementMayBeNull; + if (expectedType === Array && typeof(param) !== "undefined" && param !== null && + (expectedElementType || !elementMayBeNull)) { + var expectedElementInteger = !!expectedParam.elementInteger, + expectedElementDomElement = !!expectedParam.elementDomElement; + for (var i=0; i < param.length; i++) { + var elem = param[i]; + e = Function._validateParameterType(elem, expectedElementType, + expectedElementInteger, expectedElementDomElement, elementMayBeNull, + paramName + "[" + i + "]"); + if (e) { + e.popStackFrame(); + return e; + } + } + } + return null; +} +Function._validateParameterType = function Function$_validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName) { + var e, i; + if (typeof(param) === "undefined") { + if (mayBeNull) { + return null; + } + else { + e = Error.argumentUndefined(paramName); + e.popStackFrame(); + return e; + } + } + if (param === null) { + if (mayBeNull) { + return null; + } + else { + e = Error.argumentNull(paramName); + e.popStackFrame(); + return e; + } + } + if (expectedType && expectedType.__enum) { + if (typeof(param) !== 'number') { + e = Error.argumentType(paramName, Object.getType(param), expectedType); + e.popStackFrame(); + return e; + } + if ((param % 1) === 0) { + var values = expectedType.prototype; + if (!expectedType.__flags || (param === 0)) { + for (i in values) { + if (values[i] === param) return null; + } + } + else { + var v = param; + for (i in values) { + var vali = values[i]; + if (vali === 0) continue; + if ((vali & param) === vali) { + v -= vali; + } + if (v === 0) return null; + } + } + } + e = Error.argumentOutOfRange(paramName, param, String.format(Sys.Res.enumInvalidValue, param, expectedType.getName())); + e.popStackFrame(); + return e; + } + if (expectedDomElement && (!Sys._isDomElement(param) || (param.nodeType === 3))) { + e = Error.argument(paramName, Sys.Res.argumentDomElement); + e.popStackFrame(); + return e; + } + if (expectedType && !Sys._isInstanceOfType(expectedType, param)) { + e = Error.argumentType(paramName, Object.getType(param), expectedType); + e.popStackFrame(); + return e; + } + if (expectedType === Number && expectedInteger) { + if ((param % 1) !== 0) { + e = Error.argumentOutOfRange(paramName, param, Sys.Res.argumentInteger); + e.popStackFrame(); + return e; + } + } + return null; +} + +Error.__typeName = 'Error'; +Error.__class = true; +Error.create = function Error$create(message, errorInfo) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "message", type: String, mayBeNull: true, optional: true}, + {name: "errorInfo", mayBeNull: true, optional: true} + ]); + if (e) throw e; + var err = new Error(message); + err.message = message; + if (errorInfo) { + for (var v in errorInfo) { + err[v] = errorInfo[v]; + } + } + err.popStackFrame(); + return err; +} +Error.argument = function Error$argument(paramName, message) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "paramName", type: String, mayBeNull: true, optional: true}, + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.ArgumentException: " + (message ? message : Sys.Res.argument); + if (paramName) { + displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); + } + var err = Error.create(displayMessage, { name: "Sys.ArgumentException", paramName: paramName }); + err.popStackFrame(); + return err; +} +Error.argumentNull = function Error$argumentNull(paramName, message) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "paramName", type: String, mayBeNull: true, optional: true}, + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.ArgumentNullException: " + (message ? message : Sys.Res.argumentNull); + if (paramName) { + displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); + } + var err = Error.create(displayMessage, { name: "Sys.ArgumentNullException", paramName: paramName }); + err.popStackFrame(); + return err; +} +Error.argumentOutOfRange = function Error$argumentOutOfRange(paramName, actualValue, message) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "paramName", type: String, mayBeNull: true, optional: true}, + {name: "actualValue", mayBeNull: true, optional: true}, + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.ArgumentOutOfRangeException: " + (message ? message : Sys.Res.argumentOutOfRange); + if (paramName) { + displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); + } + if (typeof(actualValue) !== "undefined" && actualValue !== null) { + displayMessage += "\n" + String.format(Sys.Res.actualValue, actualValue); + } + var err = Error.create(displayMessage, { + name: "Sys.ArgumentOutOfRangeException", + paramName: paramName, + actualValue: actualValue + }); + err.popStackFrame(); + return err; +} +Error.argumentType = function Error$argumentType(paramName, actualType, expectedType, message) { + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "paramName", type: String, mayBeNull: true, optional: true}, + {name: "actualType", type: Type, mayBeNull: true, optional: true}, + {name: "expectedType", type: Type, mayBeNull: true, optional: true}, + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.ArgumentTypeException: "; + if (message) { + displayMessage += message; + } + else if (actualType && expectedType) { + displayMessage += + String.format(Sys.Res.argumentTypeWithTypes, actualType.getName(), expectedType.getName()); + } + else { + displayMessage += Sys.Res.argumentType; + } + if (paramName) { + displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); + } + var err = Error.create(displayMessage, { + name: "Sys.ArgumentTypeException", + paramName: paramName, + actualType: actualType, + expectedType: expectedType + }); + err.popStackFrame(); + return err; +} +Error.argumentUndefined = function Error$argumentUndefined(paramName, message) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "paramName", type: String, mayBeNull: true, optional: true}, + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.ArgumentUndefinedException: " + (message ? message : Sys.Res.argumentUndefined); + if (paramName) { + displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); + } + var err = Error.create(displayMessage, { name: "Sys.ArgumentUndefinedException", paramName: paramName }); + err.popStackFrame(); + return err; +} +Error.format = function Error$format(message) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.FormatException: " + (message ? message : Sys.Res.format); + var err = Error.create(displayMessage, {name: 'Sys.FormatException'}); + err.popStackFrame(); + return err; +} +Error.invalidOperation = function Error$invalidOperation(message) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.InvalidOperationException: " + (message ? message : Sys.Res.invalidOperation); + var err = Error.create(displayMessage, {name: 'Sys.InvalidOperationException'}); + err.popStackFrame(); + return err; +} +Error.notImplemented = function Error$notImplemented(message) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.NotImplementedException: " + (message ? message : Sys.Res.notImplemented); + var err = Error.create(displayMessage, {name: 'Sys.NotImplementedException'}); + err.popStackFrame(); + return err; +} +Error.parameterCount = function Error$parameterCount(message) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.ParameterCountException: " + (message ? message : Sys.Res.parameterCount); + var err = Error.create(displayMessage, {name: 'Sys.ParameterCountException'}); + err.popStackFrame(); + return err; +} +Error.prototype.popStackFrame = function Error$popStackFrame() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (typeof(this.stack) === "undefined" || this.stack === null || + typeof(this.fileName) === "undefined" || this.fileName === null || + typeof(this.lineNumber) === "undefined" || this.lineNumber === null) { + return; + } + var stackFrames = this.stack.split("\n"); + var currentFrame = stackFrames[0]; + var pattern = this.fileName + ":" + this.lineNumber; + while(typeof(currentFrame) !== "undefined" && + currentFrame !== null && + currentFrame.indexOf(pattern) === -1) { + stackFrames.shift(); + currentFrame = stackFrames[0]; + } + var nextFrame = stackFrames[1]; + if (typeof(nextFrame) === "undefined" || nextFrame === null) { + return; + } + var nextFrameParts = nextFrame.match(/@(.*):(\d+)$/); + if (typeof(nextFrameParts) === "undefined" || nextFrameParts === null) { + return; + } + this.fileName = nextFrameParts[1]; + this.lineNumber = parseInt(nextFrameParts[2]); + stackFrames.shift(); + this.stack = stackFrames.join("\n"); +} + +Object.__typeName = 'Object'; +Object.__class = true; +Object.getType = function Object$getType(instance) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance"} + ]); + if (e) throw e; + var ctor = instance.constructor; + if (!ctor || (typeof(ctor) !== "function") || !ctor.__typeName || (ctor.__typeName === 'Object')) { + return Object; + } + return ctor; +} +Object.getTypeName = function Object$getTypeName(instance) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance"} + ]); + if (e) throw e; + return Object.getType(instance).getName(); +} + +String.__typeName = 'String'; +String.__class = true; +String.prototype.endsWith = function String$endsWith(suffix) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "suffix", type: String} + ]); + if (e) throw e; + return (this.substr(this.length - suffix.length) === suffix); +} +String.prototype.startsWith = function String$startsWith(prefix) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "prefix", type: String} + ]); + if (e) throw e; + return (this.substr(0, prefix.length) === prefix); +} +String.prototype.trim = function String$trim() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this.replace(/^\s+|\s+$/g, ''); +} +String.prototype.trimEnd = function String$trimEnd() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this.replace(/\s+$/, ''); +} +String.prototype.trimStart = function String$trimStart() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this.replace(/^\s+/, ''); +} +String.format = function String$format(format, args) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "format", type: String}, + {name: "args", mayBeNull: true, parameterArray: true} + ]); + if (e) throw e; + return String._toFormattedString(false, arguments); +} +String._toFormattedString = function String$_toFormattedString(useLocale, args) { + var result = ''; + var format = args[0]; + for (var i=0;;) { + var open = format.indexOf('{', i); + var close = format.indexOf('}', i); + if ((open < 0) && (close < 0)) { + result += format.slice(i); + break; + } + if ((close > 0) && ((close < open) || (open < 0))) { + if (format.charAt(close + 1) !== '}') { + throw Error.argument('format', Sys.Res.stringFormatBraceMismatch); + } + result += format.slice(i, close + 1); + i = close + 2; + continue; + } + result += format.slice(i, open); + i = open + 1; + if (format.charAt(i) === '{') { + result += '{'; + i++; + continue; + } + if (close < 0) throw Error.argument('format', Sys.Res.stringFormatBraceMismatch); + var brace = format.substring(i, close); + var colonIndex = brace.indexOf(':'); + var argNumber = parseInt((colonIndex < 0)? brace : brace.substring(0, colonIndex), 10) + 1; + if (isNaN(argNumber)) throw Error.argument('format', Sys.Res.stringFormatInvalid); + var argFormat = (colonIndex < 0)? '' : brace.substring(colonIndex + 1); + var arg = args[argNumber]; + if (typeof(arg) === "undefined" || arg === null) { + arg = ''; + } + if (arg.toFormattedString) { + result += arg.toFormattedString(argFormat); + } + else if (useLocale && arg.localeFormat) { + result += arg.localeFormat(argFormat); + } + else if (arg.format) { + result += arg.format(argFormat); + } + else + result += arg.toString(); + i = close + 1; + } + return result; +} + +Boolean.__typeName = 'Boolean'; +Boolean.__class = true; +Boolean.parse = function Boolean$parse(value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String} + ], false); + if (e) throw e; + var v = value.trim().toLowerCase(); + if (v === 'false') return false; + if (v === 'true') return true; + throw Error.argumentOutOfRange('value', value, Sys.Res.boolTrueOrFalse); +} + +Date.__typeName = 'Date'; +Date.__class = true; + +Number.__typeName = 'Number'; +Number.__class = true; + +RegExp.__typeName = 'RegExp'; +RegExp.__class = true; + +if (!window) this.window = this; +window.Type = Function; +Type.__fullyQualifiedIdentifierRegExp = new RegExp("^[^.0-9 \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]([^ \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]*[^. \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\])?$", "i"); +Type.__identifierRegExp = new RegExp("^[^.0-9 \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\][^. \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]*$", "i"); +Type.prototype.callBaseMethod = function Type$callBaseMethod(instance, name, baseArguments) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance"}, + {name: "name", type: String}, + {name: "baseArguments", type: Array, mayBeNull: true, optional: true, elementMayBeNull: true} + ]); + if (e) throw e; + var baseMethod = Sys._getBaseMethod(this, instance, name); + if (!baseMethod) throw Error.invalidOperation(String.format(Sys.Res.methodNotFound, name)); + if (!baseArguments) { + return baseMethod.apply(instance); + } + else { + return baseMethod.apply(instance, baseArguments); + } +} +Type.prototype.getBaseMethod = function Type$getBaseMethod(instance, name) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance"}, + {name: "name", type: String} + ]); + if (e) throw e; + return Sys._getBaseMethod(this, instance, name); +} +Type.prototype.getBaseType = function Type$getBaseType() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return (typeof(this.__baseType) === "undefined") ? null : this.__baseType; +} +Type.prototype.getInterfaces = function Type$getInterfaces() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + var result = []; + var type = this; + while(type) { + var interfaces = type.__interfaces; + if (interfaces) { + for (var i = 0, l = interfaces.length; i < l; i++) { + var interfaceType = interfaces[i]; + if (!Array.contains(result, interfaceType)) { + result[result.length] = interfaceType; + } + } + } + type = type.__baseType; + } + return result; +} +Type.prototype.getName = function Type$getName() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return (typeof(this.__typeName) === "undefined") ? "" : this.__typeName; +} +Type.prototype.implementsInterface = function Type$implementsInterface(interfaceType) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "interfaceType", type: Type} + ]); + if (e) throw e; + this.resolveInheritance(); + var interfaceName = interfaceType.getName(); + var cache = this.__interfaceCache; + if (cache) { + var cacheEntry = cache[interfaceName]; + if (typeof(cacheEntry) !== 'undefined') return cacheEntry; + } + else { + cache = this.__interfaceCache = {}; + } + var baseType = this; + while (baseType) { + var interfaces = baseType.__interfaces; + if (interfaces) { + if (Array.indexOf(interfaces, interfaceType) !== -1) { + return cache[interfaceName] = true; + } + } + baseType = baseType.__baseType; + } + return cache[interfaceName] = false; +} +Type.prototype.inheritsFrom = function Type$inheritsFrom(parentType) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "parentType", type: Type} + ]); + if (e) throw e; + this.resolveInheritance(); + var baseType = this.__baseType; + while (baseType) { + if (baseType === parentType) { + return true; + } + baseType = baseType.__baseType; + } + return false; +} +Type.prototype.initializeBase = function Type$initializeBase(instance, baseArguments) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance"}, + {name: "baseArguments", type: Array, mayBeNull: true, optional: true, elementMayBeNull: true} + ]); + if (e) throw e; + if (!Sys._isInstanceOfType(this, instance)) throw Error.argumentType('instance', Object.getType(instance), this); + this.resolveInheritance(); + if (this.__baseType) { + if (!baseArguments) { + this.__baseType.apply(instance); + } + else { + this.__baseType.apply(instance, baseArguments); + } + } + return instance; +} +Type.prototype.isImplementedBy = function Type$isImplementedBy(instance) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance", mayBeNull: true} + ]); + if (e) throw e; + if (typeof(instance) === "undefined" || instance === null) return false; + var instanceType = Object.getType(instance); + return !!(instanceType.implementsInterface && instanceType.implementsInterface(this)); +} +Type.prototype.isInstanceOfType = function Type$isInstanceOfType(instance) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance", mayBeNull: true} + ]); + if (e) throw e; + return Sys._isInstanceOfType(this, instance); +} +Type.prototype.registerClass = function Type$registerClass(typeName, baseType, interfaceTypes) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "typeName", type: String}, + {name: "baseType", type: Type, mayBeNull: true, optional: true}, + {name: "interfaceTypes", type: Type, parameterArray: true} + ]); + if (e) throw e; + if (!Type.__fullyQualifiedIdentifierRegExp.test(typeName)) throw Error.argument('typeName', Sys.Res.notATypeName); + var parsedName; + try { + parsedName = eval(typeName); + } + catch(e) { + throw Error.argument('typeName', Sys.Res.argumentTypeName); + } + if (parsedName !== this) throw Error.argument('typeName', Sys.Res.badTypeName); + if (Sys.__registeredTypes[typeName]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, typeName)); + if ((arguments.length > 1) && (typeof(baseType) === 'undefined')) throw Error.argumentUndefined('baseType'); + if (baseType && !baseType.__class) throw Error.argument('baseType', Sys.Res.baseNotAClass); + this.prototype.constructor = this; + this.__typeName = typeName; + this.__class = true; + if (baseType) { + this.__baseType = baseType; + this.__basePrototypePending = true; + } + Sys.__upperCaseTypes[typeName.toUpperCase()] = this; + if (interfaceTypes) { + this.__interfaces = []; + this.resolveInheritance(); + for (var i = 2, l = arguments.length; i < l; i++) { + var interfaceType = arguments[i]; + if (!interfaceType.__interface) throw Error.argument('interfaceTypes[' + (i - 2) + ']', Sys.Res.notAnInterface); + for (var methodName in interfaceType.prototype) { + var method = interfaceType.prototype[methodName]; + if (!this.prototype[methodName]) { + this.prototype[methodName] = method; + } + } + this.__interfaces.push(interfaceType); + } + } + Sys.__registeredTypes[typeName] = true; + return this; +} +Type.prototype.registerInterface = function Type$registerInterface(typeName) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "typeName", type: String} + ]); + if (e) throw e; + if (!Type.__fullyQualifiedIdentifierRegExp.test(typeName)) throw Error.argument('typeName', Sys.Res.notATypeName); + var parsedName; + try { + parsedName = eval(typeName); + } + catch(e) { + throw Error.argument('typeName', Sys.Res.argumentTypeName); + } + if (parsedName !== this) throw Error.argument('typeName', Sys.Res.badTypeName); + if (Sys.__registeredTypes[typeName]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, typeName)); + Sys.__upperCaseTypes[typeName.toUpperCase()] = this; + this.prototype.constructor = this; + this.__typeName = typeName; + this.__interface = true; + Sys.__registeredTypes[typeName] = true; + return this; +} +Type.prototype.resolveInheritance = function Type$resolveInheritance() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this.__basePrototypePending) { + var baseType = this.__baseType; + baseType.resolveInheritance(); + for (var memberName in baseType.prototype) { + var memberValue = baseType.prototype[memberName]; + if (!this.prototype[memberName]) { + this.prototype[memberName] = memberValue; + } + } + delete this.__basePrototypePending; + } +} +Type.getRootNamespaces = function Type$getRootNamespaces() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return Array.clone(Sys.__rootNamespaces); +} +Type.isClass = function Type$isClass(type) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "type", mayBeNull: true} + ]); + if (e) throw e; + if ((typeof(type) === 'undefined') || (type === null)) return false; + return !!type.__class; +} +Type.isInterface = function Type$isInterface(type) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "type", mayBeNull: true} + ]); + if (e) throw e; + if ((typeof(type) === 'undefined') || (type === null)) return false; + return !!type.__interface; +} +Type.isNamespace = function Type$isNamespace(object) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "object", mayBeNull: true} + ]); + if (e) throw e; + if ((typeof(object) === 'undefined') || (object === null)) return false; + return !!object.__namespace; +} +Type.parse = function Type$parse(typeName, ns) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "typeName", type: String, mayBeNull: true}, + {name: "ns", mayBeNull: true, optional: true} + ]); + if (e) throw e; + var fn; + if (ns) { + fn = Sys.__upperCaseTypes[ns.getName().toUpperCase() + '.' + typeName.toUpperCase()]; + return fn || null; + } + if (!typeName) return null; + if (!Type.__htClasses) { + Type.__htClasses = {}; + } + fn = Type.__htClasses[typeName]; + if (!fn) { + fn = eval(typeName); + if (typeof(fn) !== 'function') throw Error.argument('typeName', Sys.Res.notATypeName); + Type.__htClasses[typeName] = fn; + } + return fn; +} +Type.registerNamespace = function Type$registerNamespace(namespacePath) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "namespacePath", type: String} + ]); + if (e) throw e; + Type._registerNamespace(namespacePath); +} +Type._registerNamespace = function Type$_registerNamespace(namespacePath) { + if (!Type.__fullyQualifiedIdentifierRegExp.test(namespacePath)) throw Error.argument('namespacePath', Sys.Res.invalidNameSpace); + var rootObject = window; + var namespaceParts = namespacePath.split('.'); + for (var i = 0; i < namespaceParts.length; i++) { + var currentPart = namespaceParts[i]; + var ns = rootObject[currentPart]; + var nsType = typeof(ns); + if ((nsType !== "undefined") && (ns !== null)) { + if (nsType === "function") { + throw Error.invalidOperation(String.format(Sys.Res.namespaceContainsClass, namespaceParts.splice(0, i + 1).join('.'))); + } + if ((typeof(ns) !== "object") || (ns instanceof Array)) { + throw Error.invalidOperation(String.format(Sys.Res.namespaceContainsNonObject, namespaceParts.splice(0, i + 1).join('.'))); + } + } + if (!ns) { + ns = rootObject[currentPart] = {}; + } + if (!ns.__namespace) { + if ((i === 0) && (namespacePath !== "Sys")) { + Sys.__rootNamespaces[Sys.__rootNamespaces.length] = ns; + } + ns.__namespace = true; + ns.__typeName = namespaceParts.slice(0, i + 1).join('.'); + var parsedName; + try { + parsedName = eval(ns.__typeName); + } + catch(e) { + parsedName = null; + } + if (parsedName !== ns) { + delete rootObject[currentPart]; + throw Error.argument('namespacePath', Sys.Res.invalidNameSpace); + } + ns.getName = function ns$getName() {return this.__typeName;} + } + rootObject = ns; + } +} +Type._checkDependency = function Type$_checkDependency(dependency, featureName) { + var scripts = Type._registerScript._scripts, isDependent = (scripts ? (!!scripts[dependency]) : false); + if ((typeof(featureName) !== 'undefined') && !isDependent) { + throw Error.invalidOperation(String.format(Sys.Res.requiredScriptReferenceNotIncluded, + featureName, dependency)); + } + return isDependent; +} +Type._registerScript = function Type$_registerScript(scriptName, dependencies) { + var scripts = Type._registerScript._scripts; + if (!scripts) { + Type._registerScript._scripts = scripts = {}; + } + if (scripts[scriptName]) { + throw Error.invalidOperation(String.format(Sys.Res.scriptAlreadyLoaded, scriptName)); + } + scripts[scriptName] = true; + if (dependencies) { + for (var i = 0, l = dependencies.length; i < l; i++) { + var dependency = dependencies[i]; + if (!Type._checkDependency(dependency)) { + throw Error.invalidOperation(String.format(Sys.Res.scriptDependencyNotFound, scriptName, dependency)); + } + } + } +} +Type._registerNamespace("Sys"); +Sys.__upperCaseTypes = {}; +Sys.__rootNamespaces = [Sys]; +Sys.__registeredTypes = {}; +Sys._isInstanceOfType = function Sys$_isInstanceOfType(type, instance) { + if (typeof(instance) === "undefined" || instance === null) return false; + if (instance instanceof type) return true; + var instanceType = Object.getType(instance); + return !!(instanceType === type) || + (instanceType.inheritsFrom && instanceType.inheritsFrom(type)) || + (instanceType.implementsInterface && instanceType.implementsInterface(type)); +} +Sys._getBaseMethod = function Sys$_getBaseMethod(type, instance, name) { + if (!Sys._isInstanceOfType(type, instance)) throw Error.argumentType('instance', Object.getType(instance), type); + var baseType = type.getBaseType(); + if (baseType) { + var baseMethod = baseType.prototype[name]; + return (baseMethod instanceof Function) ? baseMethod : null; + } + return null; +} +Sys._isDomElement = function Sys$_isDomElement(obj) { + var val = false; + if (typeof (obj.nodeType) !== 'number') { + var doc = obj.ownerDocument || obj.document || obj; + if (doc != obj) { + var w = doc.defaultView || doc.parentWindow; + val = (w != obj); + } + else { + val = (typeof (doc.body) === 'undefined'); + } + } + return !val; +} + +Array.__typeName = 'Array'; +Array.__class = true; +Array.add = Array.enqueue = function Array$enqueue(array, item) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "item", mayBeNull: true} + ]); + if (e) throw e; + array[array.length] = item; +} +Array.addRange = function Array$addRange(array, items) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "items", type: Array, elementMayBeNull: true} + ]); + if (e) throw e; + array.push.apply(array, items); +} +Array.clear = function Array$clear(array) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true} + ]); + if (e) throw e; + array.length = 0; +} +Array.clone = function Array$clone(array) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true} + ]); + if (e) throw e; + if (array.length === 1) { + return [array[0]]; + } + else { + return Array.apply(null, array); + } +} +Array.contains = function Array$contains(array, item) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "item", mayBeNull: true} + ]); + if (e) throw e; + return (Sys._indexOf(array, item) >= 0); +} +Array.dequeue = function Array$dequeue(array) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true} + ]); + if (e) throw e; + return array.shift(); +} +Array.forEach = function Array$forEach(array, method, instance) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "method", type: Function}, + {name: "instance", mayBeNull: true, optional: true} + ]); + if (e) throw e; + for (var i = 0, l = array.length; i < l; i++) { + var elt = array[i]; + if (typeof(elt) !== 'undefined') method.call(instance, elt, i, array); + } +} +Array.indexOf = function Array$indexOf(array, item, start) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "item", mayBeNull: true, optional: true}, + {name: "start", mayBeNull: true, optional: true} + ]); + if (e) throw e; + return Sys._indexOf(array, item, start); +} +Array.insert = function Array$insert(array, index, item) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "index", mayBeNull: true}, + {name: "item", mayBeNull: true} + ]); + if (e) throw e; + array.splice(index, 0, item); +} +Array.parse = function Array$parse(value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String, mayBeNull: true} + ]); + if (e) throw e; + if (!value) return []; + var v = eval(value); + if (!Array.isInstanceOfType(v)) throw Error.argument('value', Sys.Res.arrayParseBadFormat); + return v; +} +Array.remove = function Array$remove(array, item) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "item", mayBeNull: true} + ]); + if (e) throw e; + var index = Sys._indexOf(array, item); + if (index >= 0) { + array.splice(index, 1); + } + return (index >= 0); +} +Array.removeAt = function Array$removeAt(array, index) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "index", mayBeNull: true} + ]); + if (e) throw e; + array.splice(index, 1); +} +Sys._indexOf = function Sys$_indexOf(array, item, start) { + if (typeof(item) === "undefined") return -1; + var length = array.length; + if (length !== 0) { + start = start - 0; + if (isNaN(start)) { + start = 0; + } + else { + if (isFinite(start)) { + start = start - (start % 1); + } + if (start < 0) { + start = Math.max(0, length + start); + } + } + for (var i = start; i < length; i++) { + if ((typeof(array[i]) !== "undefined") && (array[i] === item)) { + return i; + } + } + } + return -1; +} +Type._registerScript._scripts = { + "MicrosoftAjaxCore.js": true, + "MicrosoftAjaxGlobalization.js": true, + "MicrosoftAjaxSerialization.js": true, + "MicrosoftAjaxComponentModel.js": true, + "MicrosoftAjaxHistory.js": true, + "MicrosoftAjaxNetwork.js" : true, + "MicrosoftAjaxWebServices.js": true }; + +Sys.IDisposable = function Sys$IDisposable() { + throw Error.notImplemented(); +} + function Sys$IDisposable$dispose() { + throw Error.notImplemented(); + } +Sys.IDisposable.prototype = { + dispose: Sys$IDisposable$dispose +} +Sys.IDisposable.registerInterface('Sys.IDisposable'); + +Sys.StringBuilder = function Sys$StringBuilder(initialText) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "initialText", mayBeNull: true, optional: true} + ]); + if (e) throw e; + this._parts = (typeof(initialText) !== 'undefined' && initialText !== null && initialText !== '') ? + [initialText.toString()] : []; + this._value = {}; + this._len = 0; +} + function Sys$StringBuilder$append(text) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "text", mayBeNull: true} + ]); + if (e) throw e; + this._parts[this._parts.length] = text; + } + function Sys$StringBuilder$appendLine(text) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "text", mayBeNull: true, optional: true} + ]); + if (e) throw e; + this._parts[this._parts.length] = + ((typeof(text) === 'undefined') || (text === null) || (text === '')) ? + '\r\n' : text + '\r\n'; + } + function Sys$StringBuilder$clear() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._parts = []; + this._value = {}; + this._len = 0; + } + function Sys$StringBuilder$isEmpty() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this._parts.length === 0) return true; + return this.toString() === ''; + } + function Sys$StringBuilder$toString(separator) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "separator", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + separator = separator || ''; + var parts = this._parts; + if (this._len !== parts.length) { + this._value = {}; + this._len = parts.length; + } + var val = this._value; + if (typeof(val[separator]) === 'undefined') { + if (separator !== '') { + for (var i = 0; i < parts.length;) { + if ((typeof(parts[i]) === 'undefined') || (parts[i] === '') || (parts[i] === null)) { + parts.splice(i, 1); + } + else { + i++; + } + } + } + val[separator] = this._parts.join(separator); + } + return val[separator]; + } +Sys.StringBuilder.prototype = { + append: Sys$StringBuilder$append, + appendLine: Sys$StringBuilder$appendLine, + clear: Sys$StringBuilder$clear, + isEmpty: Sys$StringBuilder$isEmpty, + toString: Sys$StringBuilder$toString +} +Sys.StringBuilder.registerClass('Sys.StringBuilder'); + +Sys.Browser = {}; +Sys.Browser.InternetExplorer = {}; +Sys.Browser.Firefox = {}; +Sys.Browser.Safari = {}; +Sys.Browser.Opera = {}; +Sys.Browser.agent = null; +Sys.Browser.hasDebuggerStatement = false; +Sys.Browser.name = navigator.appName; +Sys.Browser.version = parseFloat(navigator.appVersion); +Sys.Browser.documentMode = 0; +if (navigator.userAgent.indexOf(' MSIE ') > -1) { + Sys.Browser.agent = Sys.Browser.InternetExplorer; + Sys.Browser.version = parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]); + if (Sys.Browser.version >= 8) { + if (document.documentMode >= 7) { + Sys.Browser.documentMode = document.documentMode; + } + } + Sys.Browser.hasDebuggerStatement = true; +} +else if (navigator.userAgent.indexOf(' Firefox/') > -1) { + Sys.Browser.agent = Sys.Browser.Firefox; + Sys.Browser.version = parseFloat(navigator.userAgent.match(/ Firefox\/(\d+\.\d+)/)[1]); + Sys.Browser.name = 'Firefox'; + Sys.Browser.hasDebuggerStatement = true; +} +else if (navigator.userAgent.indexOf(' AppleWebKit/') > -1) { + Sys.Browser.agent = Sys.Browser.Safari; + Sys.Browser.version = parseFloat(navigator.userAgent.match(/ AppleWebKit\/(\d+(\.\d+)?)/)[1]); + Sys.Browser.name = 'Safari'; +} +else if (navigator.userAgent.indexOf('Opera/') > -1) { + Sys.Browser.agent = Sys.Browser.Opera; +} + +Sys.EventArgs = function Sys$EventArgs() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); +} +Sys.EventArgs.registerClass('Sys.EventArgs'); +Sys.EventArgs.Empty = new Sys.EventArgs(); + +Sys.CancelEventArgs = function Sys$CancelEventArgs() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + Sys.CancelEventArgs.initializeBase(this); + this._cancel = false; +} + function Sys$CancelEventArgs$get_cancel() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._cancel; + } + function Sys$CancelEventArgs$set_cancel(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]); + if (e) throw e; + this._cancel = value; + } +Sys.CancelEventArgs.prototype = { + get_cancel: Sys$CancelEventArgs$get_cancel, + set_cancel: Sys$CancelEventArgs$set_cancel +} +Sys.CancelEventArgs.registerClass('Sys.CancelEventArgs', Sys.EventArgs); +Type.registerNamespace('Sys.UI'); + +Sys._Debug = function Sys$_Debug() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); +} + function Sys$_Debug$_appendConsole(text) { + if ((typeof(Debug) !== 'undefined') && Debug.writeln) { + Debug.writeln(text); + } + if (window.console && window.console.log) { + window.console.log(text); + } + if (window.opera) { + window.opera.postError(text); + } + if (window.debugService) { + window.debugService.trace(text); + } + } + function Sys$_Debug$_appendTrace(text) { + var traceElement = document.getElementById('TraceConsole'); + if (traceElement && (traceElement.tagName.toUpperCase() === 'TEXTAREA')) { + traceElement.value += text + '\n'; + } + } + function Sys$_Debug$assert(condition, message, displayCaller) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "condition", type: Boolean}, + {name: "message", type: String, mayBeNull: true, optional: true}, + {name: "displayCaller", type: Boolean, optional: true} + ]); + if (e) throw e; + if (!condition) { + message = (displayCaller && this.assert.caller) ? + String.format(Sys.Res.assertFailedCaller, message, this.assert.caller) : + String.format(Sys.Res.assertFailed, message); + if (confirm(String.format(Sys.Res.breakIntoDebugger, message))) { + this.fail(message); + } + } + } + function Sys$_Debug$clearTrace() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + var traceElement = document.getElementById('TraceConsole'); + if (traceElement && (traceElement.tagName.toUpperCase() === 'TEXTAREA')) { + traceElement.value = ''; + } + } + function Sys$_Debug$fail(message) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "message", type: String, mayBeNull: true} + ]); + if (e) throw e; + this._appendConsole(message); + if (Sys.Browser.hasDebuggerStatement) { + eval('debugger'); + } + } + function Sys$_Debug$trace(text) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "text"} + ]); + if (e) throw e; + this._appendConsole(text); + this._appendTrace(text); + } + function Sys$_Debug$traceDump(object, name) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "object", mayBeNull: true}, + {name: "name", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var text = this._traceDump(object, name, true); + } + function Sys$_Debug$_traceDump(object, name, recursive, indentationPadding, loopArray) { + name = name? name : 'traceDump'; + indentationPadding = indentationPadding? indentationPadding : ''; + if (object === null) { + this.trace(indentationPadding + name + ': null'); + return; + } + switch(typeof(object)) { + case 'undefined': + this.trace(indentationPadding + name + ': Undefined'); + break; + case 'number': case 'string': case 'boolean': + this.trace(indentationPadding + name + ': ' + object); + break; + default: + if (Date.isInstanceOfType(object) || RegExp.isInstanceOfType(object)) { + this.trace(indentationPadding + name + ': ' + object.toString()); + break; + } + if (!loopArray) { + loopArray = []; + } + else if (Array.contains(loopArray, object)) { + this.trace(indentationPadding + name + ': ...'); + return; + } + Array.add(loopArray, object); + if ((object == window) || (object === document) || + (window.HTMLElement && (object instanceof HTMLElement)) || + (typeof(object.nodeName) === 'string')) { + var tag = object.tagName? object.tagName : 'DomElement'; + if (object.id) { + tag += ' - ' + object.id; + } + this.trace(indentationPadding + name + ' {' + tag + '}'); + } + else { + var typeName = Object.getTypeName(object); + this.trace(indentationPadding + name + (typeof(typeName) === 'string' ? ' {' + typeName + '}' : '')); + if ((indentationPadding === '') || recursive) { + indentationPadding += " "; + var i, length, properties, p, v; + if (Array.isInstanceOfType(object)) { + length = object.length; + for (i = 0; i < length; i++) { + this._traceDump(object[i], '[' + i + ']', recursive, indentationPadding, loopArray); + } + } + else { + for (p in object) { + v = object[p]; + if (!Function.isInstanceOfType(v)) { + this._traceDump(v, p, recursive, indentationPadding, loopArray); + } + } + } + } + } + Array.remove(loopArray, object); + } + } +Sys._Debug.prototype = { + _appendConsole: Sys$_Debug$_appendConsole, + _appendTrace: Sys$_Debug$_appendTrace, + assert: Sys$_Debug$assert, + clearTrace: Sys$_Debug$clearTrace, + fail: Sys$_Debug$fail, + trace: Sys$_Debug$trace, + traceDump: Sys$_Debug$traceDump, + _traceDump: Sys$_Debug$_traceDump +} +Sys._Debug.registerClass('Sys._Debug'); +Sys.Debug = new Sys._Debug(); + Sys.Debug.isDebug = true; + +function Sys$Enum$parse(value, ignoreCase) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String}, + {name: "ignoreCase", type: Boolean, optional: true} + ]); + if (e) throw e; + var values, parsed, val; + if (ignoreCase) { + values = this.__lowerCaseValues; + if (!values) { + this.__lowerCaseValues = values = {}; + var prototype = this.prototype; + for (var name in prototype) { + values[name.toLowerCase()] = prototype[name]; + } + } + } + else { + values = this.prototype; + } + if (!this.__flags) { + val = (ignoreCase ? value.toLowerCase() : value); + parsed = values[val.trim()]; + if (typeof(parsed) !== 'number') throw Error.argument('value', String.format(Sys.Res.enumInvalidValue, value, this.__typeName)); + return parsed; + } + else { + var parts = (ignoreCase ? value.toLowerCase() : value).split(','); + var v = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var part = parts[i].trim(); + parsed = values[part]; + if (typeof(parsed) !== 'number') throw Error.argument('value', String.format(Sys.Res.enumInvalidValue, value.split(',')[i].trim(), this.__typeName)); + v |= parsed; + } + return v; + } +} +function Sys$Enum$toString(value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", mayBeNull: true, optional: true} + ]); + if (e) throw e; + if ((typeof(value) === 'undefined') || (value === null)) return this.__string; + if ((typeof(value) != 'number') || ((value % 1) !== 0)) throw Error.argumentType('value', Object.getType(value), this); + var values = this.prototype; + var i; + if (!this.__flags || (value === 0)) { + for (i in values) { + if (values[i] === value) { + return i; + } + } + } + else { + var sorted = this.__sortedValues; + if (!sorted) { + sorted = []; + for (i in values) { + sorted[sorted.length] = {key: i, value: values[i]}; + } + sorted.sort(function(a, b) { + return a.value - b.value; + }); + this.__sortedValues = sorted; + } + var parts = []; + var v = value; + for (i = sorted.length - 1; i >= 0; i--) { + var kvp = sorted[i]; + var vali = kvp.value; + if (vali === 0) continue; + if ((vali & value) === vali) { + parts[parts.length] = kvp.key; + v -= vali; + if (v === 0) break; + } + } + if (parts.length && v === 0) return parts.reverse().join(', '); + } + throw Error.argumentOutOfRange('value', value, String.format(Sys.Res.enumInvalidValue, value, this.__typeName)); +} +Type.prototype.registerEnum = function Type$registerEnum(name, flags) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "name", type: String}, + {name: "flags", type: Boolean, optional: true} + ]); + if (e) throw e; + if (!Type.__fullyQualifiedIdentifierRegExp.test(name)) throw Error.argument('name', Sys.Res.notATypeName); + var parsedName; + try { + parsedName = eval(name); + } + catch(e) { + throw Error.argument('name', Sys.Res.argumentTypeName); + } + if (parsedName !== this) throw Error.argument('name', Sys.Res.badTypeName); + if (Sys.__registeredTypes[name]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, name)); + for (var j in this.prototype) { + var val = this.prototype[j]; + if (!Type.__identifierRegExp.test(j)) throw Error.invalidOperation(String.format(Sys.Res.enumInvalidValueName, j)); + if (typeof(val) !== 'number' || (val % 1) !== 0) throw Error.invalidOperation(Sys.Res.enumValueNotInteger); + if (typeof(this[j]) !== 'undefined') throw Error.invalidOperation(String.format(Sys.Res.enumReservedName, j)); + } + Sys.__upperCaseTypes[name.toUpperCase()] = this; + for (var i in this.prototype) { + this[i] = this.prototype[i]; + } + this.__typeName = name; + this.parse = Sys$Enum$parse; + this.__string = this.toString(); + this.toString = Sys$Enum$toString; + this.__flags = flags; + this.__enum = true; + Sys.__registeredTypes[name] = true; +} +Type.isEnum = function Type$isEnum(type) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "type", mayBeNull: true} + ]); + if (e) throw e; + if ((typeof(type) === 'undefined') || (type === null)) return false; + return !!type.__enum; +} +Type.isFlags = function Type$isFlags(type) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "type", mayBeNull: true} + ]); + if (e) throw e; + if ((typeof(type) === 'undefined') || (type === null)) return false; + return !!type.__flags; +} +Sys.CollectionChange = function Sys$CollectionChange(action, newItems, newStartingIndex, oldItems, oldStartingIndex) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "action", type: Sys.NotifyCollectionChangedAction}, + {name: "newItems", mayBeNull: true, optional: true}, + {name: "newStartingIndex", type: Number, mayBeNull: true, integer: true, optional: true}, + {name: "oldItems", mayBeNull: true, optional: true}, + {name: "oldStartingIndex", type: Number, mayBeNull: true, integer: true, optional: true} + ]); + if (e) throw e; + this.action = action; + if (newItems) { + if (!(newItems instanceof Array)) { + newItems = [newItems]; + } + } + this.newItems = newItems || null; + if (typeof newStartingIndex !== "number") { + newStartingIndex = -1; + } + this.newStartingIndex = newStartingIndex; + if (oldItems) { + if (!(oldItems instanceof Array)) { + oldItems = [oldItems]; + } + } + this.oldItems = oldItems || null; + if (typeof oldStartingIndex !== "number") { + oldStartingIndex = -1; + } + this.oldStartingIndex = oldStartingIndex; +} +Sys.CollectionChange.registerClass("Sys.CollectionChange"); +Sys.NotifyCollectionChangedAction = function Sys$NotifyCollectionChangedAction() { + /// + /// + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); +} +Sys.NotifyCollectionChangedAction.prototype = { + add: 0, + remove: 1, + reset: 2 +} +Sys.NotifyCollectionChangedAction.registerEnum('Sys.NotifyCollectionChangedAction'); +Sys.NotifyCollectionChangedEventArgs = function Sys$NotifyCollectionChangedEventArgs(changes) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "changes", type: Array, elementType: Sys.CollectionChange} + ]); + if (e) throw e; + this._changes = changes; + Sys.NotifyCollectionChangedEventArgs.initializeBase(this); +} + function Sys$NotifyCollectionChangedEventArgs$get_changes() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._changes || []; + } +Sys.NotifyCollectionChangedEventArgs.prototype = { + get_changes: Sys$NotifyCollectionChangedEventArgs$get_changes +} +Sys.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs", Sys.EventArgs); +Sys.Observer = function Sys$Observer() { + throw Error.invalidOperation(); +} +Sys.Observer.registerClass("Sys.Observer"); +Sys.Observer.makeObservable = function Sys$Observer$makeObservable(target) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"} + ]); + if (e) throw e; + var isArray = target instanceof Array, + o = Sys.Observer; + Sys.Observer._ensureObservable(target); + if (target.setValue === o._observeMethods.setValue) return target; + o._addMethods(target, o._observeMethods); + if (isArray) { + o._addMethods(target, o._arrayMethods); + } + return target; +} +Sys.Observer._ensureObservable = function Sys$Observer$_ensureObservable(target) { + var type = typeof target; + if ((type === "string") || (type === "number") || (type === "boolean") || (type === "date")) { + throw Error.invalidOperation(String.format(Sys.Res.notObservable, type)); + } +} +Sys.Observer._addMethods = function Sys$Observer$_addMethods(target, methods) { + for (var m in methods) { + if (target[m] && (target[m] !== methods[m])) { + throw Error.invalidOperation(String.format(Sys.Res.observableConflict, m)); + } + target[m] = methods[m]; + } +} +Sys.Observer._addEventHandler = function Sys$Observer$_addEventHandler(target, eventName, handler) { + Sys.Observer._getContext(target, true).events._addHandler(eventName, handler); +} +Sys.Observer.addEventHandler = function Sys$Observer$addEventHandler(target, eventName, handler) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"}, + {name: "eventName", type: String}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + Sys.Observer._addEventHandler(target, eventName, handler); +} +Sys.Observer._removeEventHandler = function Sys$Observer$_removeEventHandler(target, eventName, handler) { + Sys.Observer._getContext(target, true).events._removeHandler(eventName, handler); +} +Sys.Observer.removeEventHandler = function Sys$Observer$removeEventHandler(target, eventName, handler) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"}, + {name: "eventName", type: String}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + Sys.Observer._removeEventHandler(target, eventName, handler); +} +Sys.Observer.raiseEvent = function Sys$Observer$raiseEvent(target, eventName, eventArgs) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"}, + {name: "eventName", type: String}, + {name: "eventArgs", type: Sys.EventArgs} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + var ctx = Sys.Observer._getContext(target); + if (!ctx) return; + var handler = ctx.events.getHandler(eventName); + if (handler) { + handler(target, eventArgs); + } +} +Sys.Observer.addPropertyChanged = function Sys$Observer$addPropertyChanged(target, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + Sys.Observer._addEventHandler(target, "propertyChanged", handler); +} +Sys.Observer.removePropertyChanged = function Sys$Observer$removePropertyChanged(target, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + Sys.Observer._removeEventHandler(target, "propertyChanged", handler); +} +Sys.Observer.beginUpdate = function Sys$Observer$beginUpdate(target) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + Sys.Observer._getContext(target, true).updating = true; +} +Sys.Observer.endUpdate = function Sys$Observer$endUpdate(target) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + var ctx = Sys.Observer._getContext(target); + if (!ctx || !ctx.updating) return; + ctx.updating = false; + var dirty = ctx.dirty; + ctx.dirty = false; + if (dirty) { + if (target instanceof Array) { + var changes = ctx.changes; + ctx.changes = null; + Sys.Observer.raiseCollectionChanged(target, changes); + } + Sys.Observer.raisePropertyChanged(target, ""); + } +} +Sys.Observer.isUpdating = function Sys$Observer$isUpdating(target) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + var ctx = Sys.Observer._getContext(target); + return ctx ? ctx.updating : false; +} +Sys.Observer._setValue = function Sys$Observer$_setValue(target, propertyName, value) { + var getter, setter, mainTarget = target, path = propertyName.split('.'); + for (var i = 0, l = (path.length - 1); i < l ; i++) { + var name = path[i]; + getter = target["get_" + name]; + if (typeof (getter) === "function") { + target = getter.call(target); + } + else { + target = target[name]; + } + var type = typeof (target); + if ((target === null) || (type === "undefined")) { + throw Error.invalidOperation(String.format(Sys.Res.nullReferenceInPath, propertyName)); + } + } + var currentValue, lastPath = path[l]; + getter = target["get_" + lastPath]; + setter = target["set_" + lastPath]; + if (typeof(getter) === 'function') { + currentValue = getter.call(target); + } + else { + currentValue = target[lastPath]; + } + if (typeof(setter) === 'function') { + setter.call(target, value); + } + else { + target[lastPath] = value; + } + if (currentValue !== value) { + var ctx = Sys.Observer._getContext(mainTarget); + if (ctx && ctx.updating) { + ctx.dirty = true; + return; + }; + Sys.Observer.raisePropertyChanged(mainTarget, path[0]); + } +} +Sys.Observer.setValue = function Sys$Observer$setValue(target, propertyName, value) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"}, + {name: "propertyName", type: String}, + {name: "value", mayBeNull: true} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + Sys.Observer._setValue(target, propertyName, value); +} +Sys.Observer.raisePropertyChanged = function Sys$Observer$raisePropertyChanged(target, propertyName) { + /// + /// + /// + Sys.Observer.raiseEvent(target, "propertyChanged", new Sys.PropertyChangedEventArgs(propertyName)); +} +Sys.Observer.addCollectionChanged = function Sys$Observer$addCollectionChanged(target, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._addEventHandler(target, "collectionChanged", handler); +} +Sys.Observer.removeCollectionChanged = function Sys$Observer$removeCollectionChanged(target, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._removeEventHandler(target, "collectionChanged", handler); +} +Sys.Observer._collectionChange = function Sys$Observer$_collectionChange(target, change) { + var ctx = Sys.Observer._getContext(target); + if (ctx && ctx.updating) { + ctx.dirty = true; + var changes = ctx.changes; + if (!changes) { + ctx.changes = changes = [change]; + } + else { + changes.push(change); + } + } + else { + Sys.Observer.raiseCollectionChanged(target, [change]); + Sys.Observer.raisePropertyChanged(target, 'length'); + } +} +Sys.Observer.add = function Sys$Observer$add(target, item) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true}, + {name: "item", mayBeNull: true} + ]); + if (e) throw e; + var change = new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, [item], target.length); + Array.add(target, item); + Sys.Observer._collectionChange(target, change); +} +Sys.Observer.addRange = function Sys$Observer$addRange(target, items) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true}, + {name: "items", type: Array, elementMayBeNull: true} + ]); + if (e) throw e; + var change = new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, items, target.length); + Array.addRange(target, items); + Sys.Observer._collectionChange(target, change); +} +Sys.Observer.clear = function Sys$Observer$clear(target) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true} + ]); + if (e) throw e; + var oldItems = Array.clone(target); + Array.clear(target); + Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.reset, null, -1, oldItems, 0)); +} +Sys.Observer.insert = function Sys$Observer$insert(target, index, item) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true}, + {name: "index", type: Number, integer: true}, + {name: "item", mayBeNull: true} + ]); + if (e) throw e; + Array.insert(target, index, item); + Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, [item], index)); +} +Sys.Observer.remove = function Sys$Observer$remove(target, item) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true}, + {name: "item", mayBeNull: true} + ]); + if (e) throw e; + var index = Array.indexOf(target, item); + if (index !== -1) { + Array.remove(target, item); + Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove, null, -1, [item], index)); + return true; + } + return false; +} +Sys.Observer.removeAt = function Sys$Observer$removeAt(target, index) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true}, + {name: "index", type: Number, integer: true} + ]); + if (e) throw e; + if ((index > -1) && (index < target.length)) { + var item = target[index]; + Array.removeAt(target, index); + Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove, null, -1, [item], index)); + } +} +Sys.Observer.raiseCollectionChanged = function Sys$Observer$raiseCollectionChanged(target, changes) { + /// + /// + /// + Sys.Observer.raiseEvent(target, "collectionChanged", new Sys.NotifyCollectionChangedEventArgs(changes)); +} +Sys.Observer._observeMethods = { + add_propertyChanged: function(handler) { + Sys.Observer._addEventHandler(this, "propertyChanged", handler); + }, + remove_propertyChanged: function(handler) { + Sys.Observer._removeEventHandler(this, "propertyChanged", handler); + }, + addEventHandler: function(eventName, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "eventName", type: String}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._addEventHandler(this, eventName, handler); + }, + removeEventHandler: function(eventName, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "eventName", type: String}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._removeEventHandler(this, eventName, handler); + }, + get_isUpdating: function() { + /// + /// + return Sys.Observer.isUpdating(this); + }, + beginUpdate: function() { + /// + Sys.Observer.beginUpdate(this); + }, + endUpdate: function() { + /// + Sys.Observer.endUpdate(this); + }, + setValue: function(name, value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "name", type: String}, + {name: "value", mayBeNull: true} + ]); + if (e) throw e; + Sys.Observer._setValue(this, name, value); + }, + raiseEvent: function(eventName, eventArgs) { + /// + /// + /// + Sys.Observer.raiseEvent(this, eventName, eventArgs); + }, + raisePropertyChanged: function(name) { + /// + /// + Sys.Observer.raiseEvent(this, "propertyChanged", new Sys.PropertyChangedEventArgs(name)); + } +} +Sys.Observer._arrayMethods = { + add_collectionChanged: function(handler) { + Sys.Observer._addEventHandler(this, "collectionChanged", handler); + }, + remove_collectionChanged: function(handler) { + Sys.Observer._removeEventHandler(this, "collectionChanged", handler); + }, + add: function(item) { + /// + /// + Sys.Observer.add(this, item); + }, + addRange: function(items) { + /// + /// + Sys.Observer.addRange(this, items); + }, + clear: function() { + /// + Sys.Observer.clear(this); + }, + insert: function(index, item) { + /// + /// + /// + Sys.Observer.insert(this, index, item); + }, + remove: function(item) { + /// + /// + /// + return Sys.Observer.remove(this, item); + }, + removeAt: function(index) { + /// + /// + Sys.Observer.removeAt(this, index); + }, + raiseCollectionChanged: function(changes) { + /// + /// + Sys.Observer.raiseEvent(this, "collectionChanged", new Sys.NotifyCollectionChangedEventArgs(changes)); + } +} +Sys.Observer._getContext = function Sys$Observer$_getContext(obj, create) { + var ctx = obj._observerContext; + if (ctx) return ctx(); + if (create) { + return (obj._observerContext = Sys.Observer._createContext())(); + } + return null; +} +Sys.Observer._createContext = function Sys$Observer$_createContext() { + var ctx = { + events: new Sys.EventHandlerList() + }; + return function() { + return ctx; + } +} +Date._appendPreOrPostMatch = function Date$_appendPreOrPostMatch(preMatch, strBuilder) { + var quoteCount = 0; + var escaped = false; + for (var i = 0, il = preMatch.length; i < il; i++) { + var c = preMatch.charAt(i); + switch (c) { + case '\'': + if (escaped) strBuilder.append("'"); + else quoteCount++; + escaped = false; + break; + case '\\': + if (escaped) strBuilder.append("\\"); + escaped = !escaped; + break; + default: + strBuilder.append(c); + escaped = false; + break; + } + } + return quoteCount; +} +Date._expandFormat = function Date$_expandFormat(dtf, format) { + if (!format) { + format = "F"; + } + var len = format.length; + if (len === 1) { + switch (format) { + case "d": + return dtf.ShortDatePattern; + case "D": + return dtf.LongDatePattern; + case "t": + return dtf.ShortTimePattern; + case "T": + return dtf.LongTimePattern; + case "f": + return dtf.LongDatePattern + " " + dtf.ShortTimePattern; + case "F": + return dtf.FullDateTimePattern; + case "M": case "m": + return dtf.MonthDayPattern; + case "s": + return dtf.SortableDateTimePattern; + case "Y": case "y": + return dtf.YearMonthPattern; + default: + throw Error.format(Sys.Res.formatInvalidString); + } + } + else if ((len === 2) && (format.charAt(0) === "%")) { + format = format.charAt(1); + } + return format; +} +Date._expandYear = function Date$_expandYear(dtf, year) { + var now = new Date(), + era = Date._getEra(now); + if (year < 100) { + var curr = Date._getEraYear(now, dtf, era); + year += curr - (curr % 100); + if (year > dtf.Calendar.TwoDigitYearMax) { + year -= 100; + } + } + return year; +} +Date._getEra = function Date$_getEra(date, eras) { + if (!eras) return 0; + var start, ticks = date.getTime(); + for (var i = 0, l = eras.length; i < l; i += 4) { + start = eras[i+2]; + if ((start === null) || (ticks >= start)) { + return i; + } + } + return 0; +} +Date._getEraYear = function Date$_getEraYear(date, dtf, era, sortable) { + var year = date.getFullYear(); + if (!sortable && dtf.eras) { + year -= dtf.eras[era + 3]; + } + return year; +} +Date._getParseRegExp = function Date$_getParseRegExp(dtf, format) { + if (!dtf._parseRegExp) { + dtf._parseRegExp = {}; + } + else if (dtf._parseRegExp[format]) { + return dtf._parseRegExp[format]; + } + var expFormat = Date._expandFormat(dtf, format); + expFormat = expFormat.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, "\\\\$1"); + var regexp = new Sys.StringBuilder("^"); + var groups = []; + var index = 0; + var quoteCount = 0; + var tokenRegExp = Date._getTokenRegExp(); + var match; + while ((match = tokenRegExp.exec(expFormat)) !== null) { + var preMatch = expFormat.slice(index, match.index); + index = tokenRegExp.lastIndex; + quoteCount += Date._appendPreOrPostMatch(preMatch, regexp); + if ((quoteCount%2) === 1) { + regexp.append(match[0]); + continue; + } + switch (match[0]) { + case 'dddd': case 'ddd': + case 'MMMM': case 'MMM': + case 'gg': case 'g': + regexp.append("(\\D+)"); + break; + case 'tt': case 't': + regexp.append("(\\D*)"); + break; + case 'yyyy': + regexp.append("(\\d{4})"); + break; + case 'fff': + regexp.append("(\\d{3})"); + break; + case 'ff': + regexp.append("(\\d{2})"); + break; + case 'f': + regexp.append("(\\d)"); + break; + case 'dd': case 'd': + case 'MM': case 'M': + case 'yy': case 'y': + case 'HH': case 'H': + case 'hh': case 'h': + case 'mm': case 'm': + case 'ss': case 's': + regexp.append("(\\d\\d?)"); + break; + case 'zzz': + regexp.append("([+-]?\\d\\d?:\\d{2})"); + break; + case 'zz': case 'z': + regexp.append("([+-]?\\d\\d?)"); + break; + case '/': + regexp.append("(\\" + dtf.DateSeparator + ")"); + break; + default: + Sys.Debug.fail("Invalid date format pattern"); + } + Array.add(groups, match[0]); + } + Date._appendPreOrPostMatch(expFormat.slice(index), regexp); + regexp.append("$"); + var regexpStr = regexp.toString().replace(/\s+/g, "\\s+"); + var parseRegExp = {'regExp': regexpStr, 'groups': groups}; + dtf._parseRegExp[format] = parseRegExp; + return parseRegExp; +} +Date._getTokenRegExp = function Date$_getTokenRegExp() { + return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g; +} +Date.parseLocale = function Date$parseLocale(value, formats) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String}, + {name: "formats", mayBeNull: true, optional: true, parameterArray: true} + ]); + if (e) throw e; + return Date._parse(value, Sys.CultureInfo.CurrentCulture, arguments); +} +Date.parseInvariant = function Date$parseInvariant(value, formats) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String}, + {name: "formats", mayBeNull: true, optional: true, parameterArray: true} + ]); + if (e) throw e; + return Date._parse(value, Sys.CultureInfo.InvariantCulture, arguments); +} +Date._parse = function Date$_parse(value, cultureInfo, args) { + var i, l, date, format, formats, custom = false; + for (i = 1, l = args.length; i < l; i++) { + format = args[i]; + if (format) { + custom = true; + date = Date._parseExact(value, format, cultureInfo); + if (date) return date; + } + } + if (! custom) { + formats = cultureInfo._getDateTimeFormats(); + for (i = 0, l = formats.length; i < l; i++) { + date = Date._parseExact(value, formats[i], cultureInfo); + if (date) return date; + } + } + return null; +} +Date._parseExact = function Date$_parseExact(value, format, cultureInfo) { + value = value.trim(); + var dtf = cultureInfo.dateTimeFormat, + parseInfo = Date._getParseRegExp(dtf, format), + match = new RegExp(parseInfo.regExp).exec(value); + if (match === null) return null; + + var groups = parseInfo.groups, + era = null, year = null, month = null, date = null, weekDay = null, + hour = 0, hourOffset, min = 0, sec = 0, msec = 0, tzMinOffset = null, + pmHour = false; + for (var j = 0, jl = groups.length; j < jl; j++) { + var matchGroup = match[j+1]; + if (matchGroup) { + switch (groups[j]) { + case 'dd': case 'd': + date = parseInt(matchGroup, 10); + if ((date < 1) || (date > 31)) return null; + break; + case 'MMMM': + month = cultureInfo._getMonthIndex(matchGroup); + if ((month < 0) || (month > 11)) return null; + break; + case 'MMM': + month = cultureInfo._getAbbrMonthIndex(matchGroup); + if ((month < 0) || (month > 11)) return null; + break; + case 'M': case 'MM': + month = parseInt(matchGroup, 10) - 1; + if ((month < 0) || (month > 11)) return null; + break; + case 'y': case 'yy': + year = Date._expandYear(dtf,parseInt(matchGroup, 10)); + if ((year < 0) || (year > 9999)) return null; + break; + case 'yyyy': + year = parseInt(matchGroup, 10); + if ((year < 0) || (year > 9999)) return null; + break; + case 'h': case 'hh': + hour = parseInt(matchGroup, 10); + if (hour === 12) hour = 0; + if ((hour < 0) || (hour > 11)) return null; + break; + case 'H': case 'HH': + hour = parseInt(matchGroup, 10); + if ((hour < 0) || (hour > 23)) return null; + break; + case 'm': case 'mm': + min = parseInt(matchGroup, 10); + if ((min < 0) || (min > 59)) return null; + break; + case 's': case 'ss': + sec = parseInt(matchGroup, 10); + if ((sec < 0) || (sec > 59)) return null; + break; + case 'tt': case 't': + var upperToken = matchGroup.toUpperCase(); + pmHour = (upperToken === dtf.PMDesignator.toUpperCase()); + if (!pmHour && (upperToken !== dtf.AMDesignator.toUpperCase())) return null; + break; + case 'f': + msec = parseInt(matchGroup, 10) * 100; + if ((msec < 0) || (msec > 999)) return null; + break; + case 'ff': + msec = parseInt(matchGroup, 10) * 10; + if ((msec < 0) || (msec > 999)) return null; + break; + case 'fff': + msec = parseInt(matchGroup, 10); + if ((msec < 0) || (msec > 999)) return null; + break; + case 'dddd': + weekDay = cultureInfo._getDayIndex(matchGroup); + if ((weekDay < 0) || (weekDay > 6)) return null; + break; + case 'ddd': + weekDay = cultureInfo._getAbbrDayIndex(matchGroup); + if ((weekDay < 0) || (weekDay > 6)) return null; + break; + case 'zzz': + var offsets = matchGroup.split(/:/); + if (offsets.length !== 2) return null; + hourOffset = parseInt(offsets[0], 10); + if ((hourOffset < -12) || (hourOffset > 13)) return null; + var minOffset = parseInt(offsets[1], 10); + if ((minOffset < 0) || (minOffset > 59)) return null; + tzMinOffset = (hourOffset * 60) + (matchGroup.startsWith('-')? -minOffset : minOffset); + break; + case 'z': case 'zz': + hourOffset = parseInt(matchGroup, 10); + if ((hourOffset < -12) || (hourOffset > 13)) return null; + tzMinOffset = hourOffset * 60; + break; + case 'g': case 'gg': + var eraName = matchGroup; + if (!eraName || !dtf.eras) return null; + eraName = eraName.toLowerCase().trim(); + for (var i = 0, l = dtf.eras.length; i < l; i += 4) { + if (eraName === dtf.eras[i + 1].toLowerCase()) { + era = i; + break; + } + } + if (era === null) return null; + break; + } + } + } + var result = new Date(), defaults, convert = dtf.Calendar.convert; + if (convert) { + defaults = convert.fromGregorian(result); + } + if (!convert) { + defaults = [result.getFullYear(), result.getMonth(), result.getDate()]; + } + if (year === null) { + year = defaults[0]; + } + else if (dtf.eras) { + year += dtf.eras[(era || 0) + 3]; + } + if (month === null) { + month = defaults[1]; + } + if (date === null) { + date = defaults[2]; + } + if (convert) { + result = convert.toGregorian(year, month, date); + if (result === null) return null; + } + else { + result.setFullYear(year, month, date); + if (result.getDate() !== date) return null; + if ((weekDay !== null) && (result.getDay() !== weekDay)) { + return null; + } + } + if (pmHour && (hour < 12)) { + hour += 12; + } + result.setHours(hour, min, sec, msec); + if (tzMinOffset !== null) { + var adjustedMin = result.getMinutes() - (tzMinOffset + result.getTimezoneOffset()); + result.setHours(result.getHours() + parseInt(adjustedMin/60, 10), adjustedMin%60); + } + return result; +} +Date.prototype.format = function Date$format(format) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "format", type: String} + ]); + if (e) throw e; + return this._toFormattedString(format, Sys.CultureInfo.InvariantCulture); +} +Date.prototype.localeFormat = function Date$localeFormat(format) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "format", type: String} + ]); + if (e) throw e; + return this._toFormattedString(format, Sys.CultureInfo.CurrentCulture); +} +Date.prototype._toFormattedString = function Date$_toFormattedString(format, cultureInfo) { + var dtf = cultureInfo.dateTimeFormat, + convert = dtf.Calendar.convert; + if (!format || !format.length || (format === 'i')) { + if (cultureInfo && cultureInfo.name.length) { + if (convert) { + return this._toFormattedString(dtf.FullDateTimePattern, cultureInfo); + } + else { + var eraDate = new Date(this.getTime()); + var era = Date._getEra(this, dtf.eras); + eraDate.setFullYear(Date._getEraYear(this, dtf, era)); + return eraDate.toLocaleString(); + } + } + else { + return this.toString(); + } + } + var eras = dtf.eras, + sortable = (format === "s"); + format = Date._expandFormat(dtf, format); + var ret = new Sys.StringBuilder(); + var hour; + function addLeadingZero(num) { + if (num < 10) { + return '0' + num; + } + return num.toString(); + } + function addLeadingZeros(num) { + if (num < 10) { + return '00' + num; + } + if (num < 100) { + return '0' + num; + } + return num.toString(); + } + function padYear(year) { + if (year < 10) { + return '000' + year; + } + else if (year < 100) { + return '00' + year; + } + else if (year < 1000) { + return '0' + year; + } + return year.toString(); + } + + var foundDay, checkedDay, dayPartRegExp = /([^d]|^)(d|dd)([^d]|$)/g; + function hasDay() { + if (foundDay || checkedDay) { + return foundDay; + } + foundDay = dayPartRegExp.test(format); + checkedDay = true; + return foundDay; + } + + var quoteCount = 0, + tokenRegExp = Date._getTokenRegExp(), + converted; + if (!sortable && convert) { + converted = convert.fromGregorian(this); + } + for (;;) { + var index = tokenRegExp.lastIndex; + var ar = tokenRegExp.exec(format); + var preMatch = format.slice(index, ar ? ar.index : format.length); + quoteCount += Date._appendPreOrPostMatch(preMatch, ret); + if (!ar) break; + if ((quoteCount%2) === 1) { + ret.append(ar[0]); + continue; + } + + function getPart(date, part) { + if (converted) { + return converted[part]; + } + switch (part) { + case 0: return date.getFullYear(); + case 1: return date.getMonth(); + case 2: return date.getDate(); + } + } + switch (ar[0]) { + case "dddd": + ret.append(dtf.DayNames[this.getDay()]); + break; + case "ddd": + ret.append(dtf.AbbreviatedDayNames[this.getDay()]); + break; + case "dd": + foundDay = true; + ret.append(addLeadingZero(getPart(this, 2))); + break; + case "d": + foundDay = true; + ret.append(getPart(this, 2)); + break; + case "MMMM": + ret.append((dtf.MonthGenitiveNames && hasDay()) + ? dtf.MonthGenitiveNames[getPart(this, 1)] + : dtf.MonthNames[getPart(this, 1)]); + break; + case "MMM": + ret.append((dtf.AbbreviatedMonthGenitiveNames && hasDay()) + ? dtf.AbbreviatedMonthGenitiveNames[getPart(this, 1)] + : dtf.AbbreviatedMonthNames[getPart(this, 1)]); + break; + case "MM": + ret.append(addLeadingZero(getPart(this, 1) + 1)); + break; + case "M": + ret.append(getPart(this, 1) + 1); + break; + case "yyyy": + ret.append(padYear(converted ? converted[0] : Date._getEraYear(this, dtf, Date._getEra(this, eras), sortable))); + break; + case "yy": + ret.append(addLeadingZero((converted ? converted[0] : Date._getEraYear(this, dtf, Date._getEra(this, eras), sortable)) % 100)); + break; + case "y": + ret.append((converted ? converted[0] : Date._getEraYear(this, dtf, Date._getEra(this, eras), sortable)) % 100); + break; + case "hh": + hour = this.getHours() % 12; + if (hour === 0) hour = 12; + ret.append(addLeadingZero(hour)); + break; + case "h": + hour = this.getHours() % 12; + if (hour === 0) hour = 12; + ret.append(hour); + break; + case "HH": + ret.append(addLeadingZero(this.getHours())); + break; + case "H": + ret.append(this.getHours()); + break; + case "mm": + ret.append(addLeadingZero(this.getMinutes())); + break; + case "m": + ret.append(this.getMinutes()); + break; + case "ss": + ret.append(addLeadingZero(this.getSeconds())); + break; + case "s": + ret.append(this.getSeconds()); + break; + case "tt": + ret.append((this.getHours() < 12) ? dtf.AMDesignator : dtf.PMDesignator); + break; + case "t": + ret.append(((this.getHours() < 12) ? dtf.AMDesignator : dtf.PMDesignator).charAt(0)); + break; + case "f": + ret.append(addLeadingZeros(this.getMilliseconds()).charAt(0)); + break; + case "ff": + ret.append(addLeadingZeros(this.getMilliseconds()).substr(0, 2)); + break; + case "fff": + ret.append(addLeadingZeros(this.getMilliseconds())); + break; + case "z": + hour = this.getTimezoneOffset() / 60; + ret.append(((hour <= 0) ? '+' : '-') + Math.floor(Math.abs(hour))); + break; + case "zz": + hour = this.getTimezoneOffset() / 60; + ret.append(((hour <= 0) ? '+' : '-') + addLeadingZero(Math.floor(Math.abs(hour)))); + break; + case "zzz": + hour = this.getTimezoneOffset() / 60; + ret.append(((hour <= 0) ? '+' : '-') + addLeadingZero(Math.floor(Math.abs(hour))) + + ":" + addLeadingZero(Math.abs(this.getTimezoneOffset() % 60))); + break; + case "g": + case "gg": + if (dtf.eras) { + ret.append(dtf.eras[Date._getEra(this, eras) + 1]); + } + break; + case "/": + ret.append(dtf.DateSeparator); + break; + default: + Sys.Debug.fail("Invalid date format pattern"); + } + } + return ret.toString(); +} +String.localeFormat = function String$localeFormat(format, args) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "format", type: String}, + {name: "args", mayBeNull: true, parameterArray: true} + ]); + if (e) throw e; + return String._toFormattedString(true, arguments); +} +Number.parseLocale = function Number$parseLocale(value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String} + ], false); + if (e) throw e; + return Number._parse(value, Sys.CultureInfo.CurrentCulture); +} +Number.parseInvariant = function Number$parseInvariant(value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String} + ], false); + if (e) throw e; + return Number._parse(value, Sys.CultureInfo.InvariantCulture); +} +Number._parse = function Number$_parse(value, cultureInfo) { + value = value.trim(); + + if (value.match(/^[+-]?infinity$/i)) { + return parseFloat(value); + } + if (value.match(/^0x[a-f0-9]+$/i)) { + return parseInt(value); + } + var numFormat = cultureInfo.numberFormat; + var signInfo = Number._parseNumberNegativePattern(value, numFormat, numFormat.NumberNegativePattern); + var sign = signInfo[0]; + var num = signInfo[1]; + + if ((sign === '') && (numFormat.NumberNegativePattern !== 1)) { + signInfo = Number._parseNumberNegativePattern(value, numFormat, 1); + sign = signInfo[0]; + num = signInfo[1]; + } + if (sign === '') sign = '+'; + + var exponent; + var intAndFraction; + var exponentPos = num.indexOf('e'); + if (exponentPos < 0) exponentPos = num.indexOf('E'); + if (exponentPos < 0) { + intAndFraction = num; + exponent = null; + } + else { + intAndFraction = num.substr(0, exponentPos); + exponent = num.substr(exponentPos + 1); + } + + var integer; + var fraction; + var decimalPos = intAndFraction.indexOf(numFormat.NumberDecimalSeparator); + if (decimalPos < 0) { + integer = intAndFraction; + fraction = null; + } + else { + integer = intAndFraction.substr(0, decimalPos); + fraction = intAndFraction.substr(decimalPos + numFormat.NumberDecimalSeparator.length); + } + + integer = integer.split(numFormat.NumberGroupSeparator).join(''); + var altNumGroupSeparator = numFormat.NumberGroupSeparator.replace(/\u00A0/g, " "); + if (numFormat.NumberGroupSeparator !== altNumGroupSeparator) { + integer = integer.split(altNumGroupSeparator).join(''); + } + + var p = sign + integer; + if (fraction !== null) { + p += '.' + fraction; + } + if (exponent !== null) { + var expSignInfo = Number._parseNumberNegativePattern(exponent, numFormat, 1); + if (expSignInfo[0] === '') { + expSignInfo[0] = '+'; + } + p += 'e' + expSignInfo[0] + expSignInfo[1]; + } + if (p.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/)) { + return parseFloat(p); + } + return Number.NaN; +} +Number._parseNumberNegativePattern = function Number$_parseNumberNegativePattern(value, numFormat, numberNegativePattern) { + var neg = numFormat.NegativeSign; + var pos = numFormat.PositiveSign; + switch (numberNegativePattern) { + case 4: + neg = ' ' + neg; + pos = ' ' + pos; + case 3: + if (value.endsWith(neg)) { + return ['-', value.substr(0, value.length - neg.length)]; + } + else if (value.endsWith(pos)) { + return ['+', value.substr(0, value.length - pos.length)]; + } + break; + case 2: + neg += ' '; + pos += ' '; + case 1: + if (value.startsWith(neg)) { + return ['-', value.substr(neg.length)]; + } + else if (value.startsWith(pos)) { + return ['+', value.substr(pos.length)]; + } + break; + case 0: + if (value.startsWith('(') && value.endsWith(')')) { + return ['-', value.substr(1, value.length - 2)]; + } + break; + default: + Sys.Debug.fail(""); + } + return ['', value]; +} +Number.prototype.format = function Number$format(format) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "format", type: String} + ]); + if (e) throw e; + return this._toFormattedString(format, Sys.CultureInfo.InvariantCulture); +} +Number.prototype.localeFormat = function Number$localeFormat(format) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "format", type: String} + ]); + if (e) throw e; + return this._toFormattedString(format, Sys.CultureInfo.CurrentCulture); +} +Number.prototype._toFormattedString = function Number$_toFormattedString(format, cultureInfo) { + if (!format || (format.length === 0) || (format === 'i')) { + if (cultureInfo && (cultureInfo.name.length > 0)) { + return this.toLocaleString(); + } + else { + return this.toString(); + } + } + + var _percentPositivePattern = ["n %", "n%", "%n" ]; + var _percentNegativePattern = ["-n %", "-n%", "-%n"]; + var _numberNegativePattern = ["(n)","-n","- n","n-","n -"]; + var _currencyPositivePattern = ["$n","n$","$ n","n $"]; + var _currencyNegativePattern = ["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"]; + function zeroPad(str, count, left) { + for (var l=str.length; l < count; l++) { + str = (left ? ('0' + str) : (str + '0')); + } + return str; + } + + function expandNumber(number, precision, groupSizes, sep, decimalChar) { + Sys.Debug.assert(groupSizes.length > 0, "groupSizes must be an array of at least 1"); + var curSize = groupSizes[0]; + var curGroupIndex = 1; + var factor = Math.pow(10, precision); + var rounded = (Math.round(number * factor) / factor); + if (!isFinite(rounded)) { + rounded = number; + } + number = rounded; + + var numberString = number.toString(); + var right = ""; + var exponent; + + + var split = numberString.split(/e/i); + numberString = split[0]; + exponent = (split.length > 1 ? parseInt(split[1]) : 0); + split = numberString.split('.'); + numberString = split[0]; + right = split.length > 1 ? split[1] : ""; + + var l; + if (exponent > 0) { + right = zeroPad(right, exponent, false); + numberString += right.slice(0, exponent); + right = right.substr(exponent); + } + else if (exponent < 0) { + exponent = -exponent; + numberString = zeroPad(numberString, exponent+1, true); + right = numberString.slice(-exponent, numberString.length) + right; + numberString = numberString.slice(0, -exponent); + } + if (precision > 0) { + if (right.length > precision) { + right = right.slice(0, precision); + } + else { + right = zeroPad(right, precision, false); + } + right = decimalChar + right; + } + else { + right = ""; + } + var stringIndex = numberString.length-1; + var ret = ""; + while (stringIndex >= 0) { + if (curSize === 0 || curSize > stringIndex) { + if (ret.length > 0) + return numberString.slice(0, stringIndex + 1) + sep + ret + right; + else + return numberString.slice(0, stringIndex + 1) + right; + } + if (ret.length > 0) + ret = numberString.slice(stringIndex - curSize + 1, stringIndex+1) + sep + ret; + else + ret = numberString.slice(stringIndex - curSize + 1, stringIndex+1); + stringIndex -= curSize; + if (curGroupIndex < groupSizes.length) { + curSize = groupSizes[curGroupIndex]; + curGroupIndex++; + } + } + return numberString.slice(0, stringIndex + 1) + sep + ret + right; + } + var nf = cultureInfo.numberFormat; + var number = Math.abs(this); + if (!format) + format = "D"; + var precision = -1; + if (format.length > 1) precision = parseInt(format.slice(1), 10); + var pattern; + switch (format.charAt(0)) { + case "d": + case "D": + pattern = 'n'; + if (precision !== -1) { + number = zeroPad(""+number, precision, true); + } + if (this < 0) number = -number; + break; + case "c": + case "C": + if (this < 0) pattern = _currencyNegativePattern[nf.CurrencyNegativePattern]; + else pattern = _currencyPositivePattern[nf.CurrencyPositivePattern]; + if (precision === -1) precision = nf.CurrencyDecimalDigits; + number = expandNumber(Math.abs(this), precision, nf.CurrencyGroupSizes, nf.CurrencyGroupSeparator, nf.CurrencyDecimalSeparator); + break; + case "n": + case "N": + if (this < 0) pattern = _numberNegativePattern[nf.NumberNegativePattern]; + else pattern = 'n'; + if (precision === -1) precision = nf.NumberDecimalDigits; + number = expandNumber(Math.abs(this), precision, nf.NumberGroupSizes, nf.NumberGroupSeparator, nf.NumberDecimalSeparator); + break; + case "p": + case "P": + if (this < 0) pattern = _percentNegativePattern[nf.PercentNegativePattern]; + else pattern = _percentPositivePattern[nf.PercentPositivePattern]; + if (precision === -1) precision = nf.PercentDecimalDigits; + number = expandNumber(Math.abs(this) * 100, precision, nf.PercentGroupSizes, nf.PercentGroupSeparator, nf.PercentDecimalSeparator); + break; + default: + throw Error.format(Sys.Res.formatBadFormatSpecifier); + } + var regex = /n|\$|-|%/g; + var ret = ""; + for (;;) { + var index = regex.lastIndex; + var ar = regex.exec(pattern); + ret += pattern.slice(index, ar ? ar.index : pattern.length); + if (!ar) + break; + switch (ar[0]) { + case "n": + ret += number; + break; + case "$": + ret += nf.CurrencySymbol; + break; + case "-": + if (/[1-9]/.test(number)) { + ret += nf.NegativeSign; + } + break; + case "%": + ret += nf.PercentSymbol; + break; + default: + Sys.Debug.fail("Invalid number format pattern"); + } + } + return ret; +} + +Sys.CultureInfo = function Sys$CultureInfo(name, numberFormat, dateTimeFormat) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "name", type: String}, + {name: "numberFormat", type: Object}, + {name: "dateTimeFormat", type: Object} + ]); + if (e) throw e; + this.name = name; + this.numberFormat = numberFormat; + this.dateTimeFormat = dateTimeFormat; +} + function Sys$CultureInfo$_getDateTimeFormats() { + if (! this._dateTimeFormats) { + var dtf = this.dateTimeFormat; + this._dateTimeFormats = + [ dtf.MonthDayPattern, + dtf.YearMonthPattern, + dtf.ShortDatePattern, + dtf.ShortTimePattern, + dtf.LongDatePattern, + dtf.LongTimePattern, + dtf.FullDateTimePattern, + dtf.RFC1123Pattern, + dtf.SortableDateTimePattern, + dtf.UniversalSortableDateTimePattern ]; + } + return this._dateTimeFormats; + } + function Sys$CultureInfo$_getIndex(value, a1, a2) { + var upper = this._toUpper(value), + i = Array.indexOf(a1, upper); + if (i === -1) { + i = Array.indexOf(a2, upper); + } + return i; + } + function Sys$CultureInfo$_getMonthIndex(value) { + if (!this._upperMonths) { + this._upperMonths = this._toUpperArray(this.dateTimeFormat.MonthNames); + this._upperMonthsGenitive = this._toUpperArray(this.dateTimeFormat.MonthGenitiveNames); + } + return this._getIndex(value, this._upperMonths, this._upperMonthsGenitive); + } + function Sys$CultureInfo$_getAbbrMonthIndex(value) { + if (!this._upperAbbrMonths) { + this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames); + this._upperAbbrMonthsGenitive = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthGenitiveNames); + } + return this._getIndex(value, this._upperAbbrMonths, this._upperAbbrMonthsGenitive); + } + function Sys$CultureInfo$_getDayIndex(value) { + if (!this._upperDays) { + this._upperDays = this._toUpperArray(this.dateTimeFormat.DayNames); + } + return Array.indexOf(this._upperDays, this._toUpper(value)); + } + function Sys$CultureInfo$_getAbbrDayIndex(value) { + if (!this._upperAbbrDays) { + this._upperAbbrDays = this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames); + } + return Array.indexOf(this._upperAbbrDays, this._toUpper(value)); + } + function Sys$CultureInfo$_toUpperArray(arr) { + var result = []; + for (var i = 0, il = arr.length; i < il; i++) { + result[i] = this._toUpper(arr[i]); + } + return result; + } + function Sys$CultureInfo$_toUpper(value) { + return value.split("\u00A0").join(' ').toUpperCase(); + } +Sys.CultureInfo.prototype = { + _getDateTimeFormats: Sys$CultureInfo$_getDateTimeFormats, + _getIndex: Sys$CultureInfo$_getIndex, + _getMonthIndex: Sys$CultureInfo$_getMonthIndex, + _getAbbrMonthIndex: Sys$CultureInfo$_getAbbrMonthIndex, + _getDayIndex: Sys$CultureInfo$_getDayIndex, + _getAbbrDayIndex: Sys$CultureInfo$_getAbbrDayIndex, + _toUpperArray: Sys$CultureInfo$_toUpperArray, + _toUpper: Sys$CultureInfo$_toUpper +} +Sys.CultureInfo.registerClass('Sys.CultureInfo'); +Sys.CultureInfo._parse = function Sys$CultureInfo$_parse(value) { + var dtf = value.dateTimeFormat; + if (dtf && !dtf.eras) { + dtf.eras = value.eras; + } + return new Sys.CultureInfo(value.name, value.numberFormat, dtf); +} +Sys.CultureInfo.InvariantCulture = Sys.CultureInfo._parse({"name":"","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":true,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"\u00A4","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":true},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, dd MMMM yyyy HH:mm:ss","LongDatePattern":"dddd, dd MMMM yyyy","LongTimePattern":"HH:mm:ss","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"MM/dd/yyyy","ShortTimePattern":"HH:mm","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"yyyy MMMM","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":true,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]},"eras":[1,"A.D.",null,0]}); +if (typeof(__cultureInfo) === "object") { + Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse(__cultureInfo); + delete __cultureInfo; +} +else { + Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse({"name":"en-US","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":false,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"$","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":false},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, MMMM dd, yyyy h:mm:ss tt","LongDatePattern":"dddd, MMMM dd, yyyy","LongTimePattern":"h:mm:ss tt","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"M/d/yyyy","ShortTimePattern":"h:mm tt","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"MMMM, yyyy","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":false,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]},"eras":[1,"A.D.",null,0]}); +} +Type.registerNamespace('Sys.Serialization'); +Sys.Serialization.JavaScriptSerializer = function Sys$Serialization$JavaScriptSerializer() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); +} +Sys.Serialization.JavaScriptSerializer.registerClass('Sys.Serialization.JavaScriptSerializer'); +Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs = []; +Sys.Serialization.JavaScriptSerializer._charsToEscape = []; +Sys.Serialization.JavaScriptSerializer._dateRegEx = new RegExp('(^|[^\\\\])\\"\\\\/Date\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\\"', 'g'); +Sys.Serialization.JavaScriptSerializer._escapeChars = {}; +Sys.Serialization.JavaScriptSerializer._escapeRegEx = new RegExp('["\\\\\\x00-\\x1F]', 'i'); +Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal = new RegExp('["\\\\\\x00-\\x1F]', 'g'); +Sys.Serialization.JavaScriptSerializer._jsonRegEx = new RegExp('[^,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]', 'g'); +Sys.Serialization.JavaScriptSerializer._jsonStringRegEx = new RegExp('"(\\\\.|[^"\\\\])*"', 'g'); +Sys.Serialization.JavaScriptSerializer._serverTypeFieldName = '__type'; +Sys.Serialization.JavaScriptSerializer._init = function Sys$Serialization$JavaScriptSerializer$_init() { + var replaceChars = ['\\u0000','\\u0001','\\u0002','\\u0003','\\u0004','\\u0005','\\u0006','\\u0007', + '\\b','\\t','\\n','\\u000b','\\f','\\r','\\u000e','\\u000f','\\u0010','\\u0011', + '\\u0012','\\u0013','\\u0014','\\u0015','\\u0016','\\u0017','\\u0018','\\u0019', + '\\u001a','\\u001b','\\u001c','\\u001d','\\u001e','\\u001f']; + Sys.Serialization.JavaScriptSerializer._charsToEscape[0] = '\\'; + Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['\\'] = new RegExp('\\\\', 'g'); + Sys.Serialization.JavaScriptSerializer._escapeChars['\\'] = '\\\\'; + Sys.Serialization.JavaScriptSerializer._charsToEscape[1] = '"'; + Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['"'] = new RegExp('"', 'g'); + Sys.Serialization.JavaScriptSerializer._escapeChars['"'] = '\\"'; + for (var i = 0; i < 32; i++) { + var c = String.fromCharCode(i); + Sys.Serialization.JavaScriptSerializer._charsToEscape[i+2] = c; + Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[c] = new RegExp(c, 'g'); + Sys.Serialization.JavaScriptSerializer._escapeChars[c] = replaceChars[i]; + } +} +Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeBooleanWithBuilder(object, stringBuilder) { + stringBuilder.append(object.toString()); +} +Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeNumberWithBuilder(object, stringBuilder) { + if (isFinite(object)) { + stringBuilder.append(String(object)); + } + else { + throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers); + } +} +Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeStringWithBuilder(string, stringBuilder) { + stringBuilder.append('"'); + if (Sys.Serialization.JavaScriptSerializer._escapeRegEx.test(string)) { + if (Sys.Serialization.JavaScriptSerializer._charsToEscape.length === 0) { + Sys.Serialization.JavaScriptSerializer._init(); + } + if (string.length < 128) { + string = string.replace(Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal, + function(x) { return Sys.Serialization.JavaScriptSerializer._escapeChars[x]; }); + } + else { + for (var i = 0; i < 34; i++) { + var c = Sys.Serialization.JavaScriptSerializer._charsToEscape[i]; + if (string.indexOf(c) !== -1) { + if (Sys.Browser.agent === Sys.Browser.Opera || Sys.Browser.agent === Sys.Browser.FireFox) { + string = string.split(c).join(Sys.Serialization.JavaScriptSerializer._escapeChars[c]); + } + else { + string = string.replace(Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[c], + Sys.Serialization.JavaScriptSerializer._escapeChars[c]); + } + } + } + } + } + stringBuilder.append(string); + stringBuilder.append('"'); +} +Sys.Serialization.JavaScriptSerializer._serializeWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeWithBuilder(object, stringBuilder, sort, prevObjects) { + var i; + switch (typeof object) { + case 'object': + if (object) { + if (prevObjects){ + for( var j = 0; j < prevObjects.length; j++) { + if (prevObjects[j] === object) { + throw Error.invalidOperation(Sys.Res.cannotSerializeObjectWithCycle); + } + } + } + else { + prevObjects = new Array(); + } + try { + Array.add(prevObjects, object); + + if (Number.isInstanceOfType(object)){ + Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(object, stringBuilder); + } + else if (Boolean.isInstanceOfType(object)){ + Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(object, stringBuilder); + } + else if (String.isInstanceOfType(object)){ + Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(object, stringBuilder); + } + + else if (Array.isInstanceOfType(object)) { + stringBuilder.append('['); + + for (i = 0; i < object.length; ++i) { + if (i > 0) { + stringBuilder.append(','); + } + Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(object[i], stringBuilder,false,prevObjects); + } + stringBuilder.append(']'); + } + else { + if (Date.isInstanceOfType(object)) { + stringBuilder.append('"\\/Date('); + stringBuilder.append(object.getTime()); + stringBuilder.append(')\\/"'); + break; + } + var properties = []; + var propertyCount = 0; + for (var name in object) { + if (name.startsWith('$')) { + continue; + } + if (name === Sys.Serialization.JavaScriptSerializer._serverTypeFieldName && propertyCount !== 0){ + properties[propertyCount++] = properties[0]; + properties[0] = name; + } + else{ + properties[propertyCount++] = name; + } + } + if (sort) properties.sort(); + stringBuilder.append('{'); + var needComma = false; + + for (i=0; i + /// + /// + var e = Function._validateParams(arguments, [ + {name: "object", mayBeNull: true} + ]); + if (e) throw e; + var stringBuilder = new Sys.StringBuilder(); + Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(object, stringBuilder, false); + return stringBuilder.toString(); +} +Sys.Serialization.JavaScriptSerializer.deserialize = function Sys$Serialization$JavaScriptSerializer$deserialize(data, secure) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "data", type: String}, + {name: "secure", type: Boolean, optional: true} + ]); + if (e) throw e; + + if (data.length === 0) throw Error.argument('data', Sys.Res.cannotDeserializeEmptyString); + try { + var exp = data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx, "$1new Date($2)"); + + if (secure && Sys.Serialization.JavaScriptSerializer._jsonRegEx.test( + exp.replace(Sys.Serialization.JavaScriptSerializer._jsonStringRegEx, ''))) throw null; + return eval('(' + exp + ')'); + } + catch (e) { + throw Error.argument('data', Sys.Res.cannotDeserializeInvalidJson); + } +} +Type.registerNamespace('Sys.UI'); + +Sys.EventHandlerList = function Sys$EventHandlerList() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._list = {}; +} + function Sys$EventHandlerList$_addHandler(id, handler) { + Array.add(this._getEvent(id, true), handler); + } + function Sys$EventHandlerList$addHandler(id, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "id", type: String}, + {name: "handler", type: Function} + ]); + if (e) throw e; + this._addHandler(id, handler); + } + function Sys$EventHandlerList$_removeHandler(id, handler) { + var evt = this._getEvent(id); + if (!evt) return; + Array.remove(evt, handler); + } + function Sys$EventHandlerList$removeHandler(id, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "id", type: String}, + {name: "handler", type: Function} + ]); + if (e) throw e; + this._removeHandler(id, handler); + } + function Sys$EventHandlerList$getHandler(id) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "id", type: String} + ]); + if (e) throw e; + var evt = this._getEvent(id); + if (!evt || (evt.length === 0)) return null; + evt = Array.clone(evt); + return function(source, args) { + for (var i = 0, l = evt.length; i < l; i++) { + evt[i](source, args); + } + }; + } + function Sys$EventHandlerList$_getEvent(id, create) { + if (!this._list[id]) { + if (!create) return null; + this._list[id] = []; + } + return this._list[id]; + } +Sys.EventHandlerList.prototype = { + _addHandler: Sys$EventHandlerList$_addHandler, + addHandler: Sys$EventHandlerList$addHandler, + _removeHandler: Sys$EventHandlerList$_removeHandler, + removeHandler: Sys$EventHandlerList$removeHandler, + getHandler: Sys$EventHandlerList$getHandler, + _getEvent: Sys$EventHandlerList$_getEvent +} +Sys.EventHandlerList.registerClass('Sys.EventHandlerList'); +Sys.CommandEventArgs = function Sys$CommandEventArgs(commandName, commandArgument, commandSource) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "commandName", type: String}, + {name: "commandArgument", mayBeNull: true}, + {name: "commandSource", mayBeNull: true} + ]); + if (e) throw e; + Sys.CommandEventArgs.initializeBase(this); + this._commandName = commandName; + this._commandArgument = commandArgument; + this._commandSource = commandSource; +} + function Sys$CommandEventArgs$get_commandName() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._commandName; + } + function Sys$CommandEventArgs$get_commandArgument() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._commandArgument; + } + function Sys$CommandEventArgs$get_commandSource() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._commandSource; + } +Sys.CommandEventArgs.prototype = { + _commandName: null, + _commandArgument: null, + _commandSource: null, + get_commandName: Sys$CommandEventArgs$get_commandName, + get_commandArgument: Sys$CommandEventArgs$get_commandArgument, + get_commandSource: Sys$CommandEventArgs$get_commandSource +} +Sys.CommandEventArgs.registerClass("Sys.CommandEventArgs", Sys.CancelEventArgs); + +Sys.INotifyPropertyChange = function Sys$INotifyPropertyChange() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); +} + function Sys$INotifyPropertyChange$add_propertyChanged(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + throw Error.notImplemented(); + } + function Sys$INotifyPropertyChange$remove_propertyChanged(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + throw Error.notImplemented(); + } +Sys.INotifyPropertyChange.prototype = { + add_propertyChanged: Sys$INotifyPropertyChange$add_propertyChanged, + remove_propertyChanged: Sys$INotifyPropertyChange$remove_propertyChanged +} +Sys.INotifyPropertyChange.registerInterface('Sys.INotifyPropertyChange'); + +Sys.PropertyChangedEventArgs = function Sys$PropertyChangedEventArgs(propertyName) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "propertyName", type: String} + ]); + if (e) throw e; + Sys.PropertyChangedEventArgs.initializeBase(this); + this._propertyName = propertyName; +} + + function Sys$PropertyChangedEventArgs$get_propertyName() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._propertyName; + } +Sys.PropertyChangedEventArgs.prototype = { + get_propertyName: Sys$PropertyChangedEventArgs$get_propertyName +} +Sys.PropertyChangedEventArgs.registerClass('Sys.PropertyChangedEventArgs', Sys.EventArgs); + +Sys.INotifyDisposing = function Sys$INotifyDisposing() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); +} + function Sys$INotifyDisposing$add_disposing(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + throw Error.notImplemented(); + } + function Sys$INotifyDisposing$remove_disposing(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + throw Error.notImplemented(); + } +Sys.INotifyDisposing.prototype = { + add_disposing: Sys$INotifyDisposing$add_disposing, + remove_disposing: Sys$INotifyDisposing$remove_disposing +} +Sys.INotifyDisposing.registerInterface("Sys.INotifyDisposing"); + +Sys.Component = function Sys$Component() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (Sys.Application) Sys.Application.registerDisposableObject(this); +} + function Sys$Component$get_events() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._events) { + this._events = new Sys.EventHandlerList(); + } + return this._events; + } + function Sys$Component$get_id() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._id; + } + function Sys$Component$set_id(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + if (this._idSet) throw Error.invalidOperation(Sys.Res.componentCantSetIdTwice); + this._idSet = true; + var oldId = this.get_id(); + if (oldId && Sys.Application.findComponent(oldId)) throw Error.invalidOperation(Sys.Res.componentCantSetIdAfterAddedToApp); + this._id = value; + } + function Sys$Component$get_isInitialized() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._initialized; + } + function Sys$Component$get_isUpdating() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._updating; + } + function Sys$Component$add_disposing(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().addHandler("disposing", handler); + } + function Sys$Component$remove_disposing(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().removeHandler("disposing", handler); + } + function Sys$Component$add_propertyChanged(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().addHandler("propertyChanged", handler); + } + function Sys$Component$remove_propertyChanged(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().removeHandler("propertyChanged", handler); + } + function Sys$Component$beginUpdate() { + this._updating = true; + } + function Sys$Component$dispose() { + if (this._events) { + var handler = this._events.getHandler("disposing"); + if (handler) { + handler(this, Sys.EventArgs.Empty); + } + } + delete this._events; + Sys.Application.unregisterDisposableObject(this); + Sys.Application.removeComponent(this); + } + function Sys$Component$endUpdate() { + this._updating = false; + if (!this._initialized) this.initialize(); + this.updated(); + } + function Sys$Component$initialize() { + this._initialized = true; + } + function Sys$Component$raisePropertyChanged(propertyName) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "propertyName", type: String} + ]); + if (e) throw e; + if (!this._events) return; + var handler = this._events.getHandler("propertyChanged"); + if (handler) { + handler(this, new Sys.PropertyChangedEventArgs(propertyName)); + } + } + function Sys$Component$updated() { + } +Sys.Component.prototype = { + _id: null, + _idSet: false, + _initialized: false, + _updating: false, + get_events: Sys$Component$get_events, + get_id: Sys$Component$get_id, + set_id: Sys$Component$set_id, + get_isInitialized: Sys$Component$get_isInitialized, + get_isUpdating: Sys$Component$get_isUpdating, + add_disposing: Sys$Component$add_disposing, + remove_disposing: Sys$Component$remove_disposing, + add_propertyChanged: Sys$Component$add_propertyChanged, + remove_propertyChanged: Sys$Component$remove_propertyChanged, + beginUpdate: Sys$Component$beginUpdate, + dispose: Sys$Component$dispose, + endUpdate: Sys$Component$endUpdate, + initialize: Sys$Component$initialize, + raisePropertyChanged: Sys$Component$raisePropertyChanged, + updated: Sys$Component$updated +} +Sys.Component.registerClass('Sys.Component', null, Sys.IDisposable, Sys.INotifyPropertyChange, Sys.INotifyDisposing); +function Sys$Component$_setProperties(target, properties) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"}, + {name: "properties"} + ]); + if (e) throw e; + var current; + var targetType = Object.getType(target); + var isObject = (targetType === Object) || (targetType === Sys.UI.DomElement); + var isComponent = Sys.Component.isInstanceOfType(target) && !target.get_isUpdating(); + if (isComponent) target.beginUpdate(); + for (var name in properties) { + var val = properties[name]; + var getter = isObject ? null : target["get_" + name]; + if (isObject || typeof(getter) !== 'function') { + var targetVal = target[name]; + if (!isObject && typeof(targetVal) === 'undefined') throw Error.invalidOperation(String.format(Sys.Res.propertyUndefined, name)); + if (!val || (typeof(val) !== 'object') || (isObject && !targetVal)) { + target[name] = val; + } + else { + Sys$Component$_setProperties(targetVal, val); + } + } + else { + var setter = target["set_" + name]; + if (typeof(setter) === 'function') { + setter.apply(target, [val]); + } + else if (val instanceof Array) { + current = getter.apply(target); + if (!(current instanceof Array)) throw new Error.invalidOperation(String.format(Sys.Res.propertyNotAnArray, name)); + for (var i = 0, j = current.length, l= val.length; i < l; i++, j++) { + current[j] = val[i]; + } + } + else if ((typeof(val) === 'object') && (Object.getType(val) === Object)) { + current = getter.apply(target); + if ((typeof(current) === 'undefined') || (current === null)) throw new Error.invalidOperation(String.format(Sys.Res.propertyNullOrUndefined, name)); + Sys$Component$_setProperties(current, val); + } + else { + throw new Error.invalidOperation(String.format(Sys.Res.propertyNotWritable, name)); + } + } + } + if (isComponent) target.endUpdate(); +} +function Sys$Component$_setReferences(component, references) { + for (var name in references) { + var setter = component["set_" + name]; + var reference = $find(references[name]); + if (typeof(setter) !== 'function') throw new Error.invalidOperation(String.format(Sys.Res.propertyNotWritable, name)); + if (!reference) throw Error.invalidOperation(String.format(Sys.Res.referenceNotFound, references[name])); + setter.apply(component, [reference]); + } +} +var $create = Sys.Component.create = function Sys$Component$create(type, properties, events, references, element) { + /// + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "type", type: Type}, + {name: "properties", mayBeNull: true, optional: true}, + {name: "events", mayBeNull: true, optional: true}, + {name: "references", mayBeNull: true, optional: true}, + {name: "element", mayBeNull: true, domElement: true, optional: true} + ]); + if (e) throw e; + if (!type.inheritsFrom(Sys.Component)) { + throw Error.argument('type', String.format(Sys.Res.createNotComponent, type.getName())); + } + if (type.inheritsFrom(Sys.UI.Behavior) || type.inheritsFrom(Sys.UI.Control)) { + if (!element) throw Error.argument('element', Sys.Res.createNoDom); + } + else if (element) throw Error.argument('element', Sys.Res.createComponentOnDom); + var component = (element ? new type(element): new type()); + var app = Sys.Application; + var creatingComponents = app.get_isCreatingComponents(); + component.beginUpdate(); + if (properties) { + Sys$Component$_setProperties(component, properties); + } + if (events) { + for (var name in events) { + if (!(component["add_" + name] instanceof Function)) throw new Error.invalidOperation(String.format(Sys.Res.undefinedEvent, name)); + if (!(events[name] instanceof Function)) throw new Error.invalidOperation(Sys.Res.eventHandlerNotFunction); + component["add_" + name](events[name]); + } + } + if (component.get_id()) { + app.addComponent(component); + } + if (creatingComponents) { + app._createdComponents[app._createdComponents.length] = component; + if (references) { + app._addComponentToSecondPass(component, references); + } + else { + component.endUpdate(); + } + } + else { + if (references) { + Sys$Component$_setReferences(component, references); + } + component.endUpdate(); + } + return component; +} + +Sys.UI.MouseButton = function Sys$UI$MouseButton() { + /// + /// + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); +} +Sys.UI.MouseButton.prototype = { + leftButton: 0, + middleButton: 1, + rightButton: 2 +} +Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton"); + +Sys.UI.Key = function Sys$UI$Key() { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); +} +Sys.UI.Key.prototype = { + backspace: 8, + tab: 9, + enter: 13, + esc: 27, + space: 32, + pageUp: 33, + pageDown: 34, + end: 35, + home: 36, + left: 37, + up: 38, + right: 39, + down: 40, + del: 127 +} +Sys.UI.Key.registerEnum("Sys.UI.Key"); + +Sys.UI.Point = function Sys$UI$Point(x, y) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "x", type: Number, integer: true}, + {name: "y", type: Number, integer: true} + ]); + if (e) throw e; + this.x = x; + this.y = y; +} +Sys.UI.Point.registerClass('Sys.UI.Point'); + +Sys.UI.Bounds = function Sys$UI$Bounds(x, y, width, height) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "x", type: Number, integer: true}, + {name: "y", type: Number, integer: true}, + {name: "width", type: Number, integer: true}, + {name: "height", type: Number, integer: true} + ]); + if (e) throw e; + this.x = x; + this.y = y; + this.height = height; + this.width = width; +} +Sys.UI.Bounds.registerClass('Sys.UI.Bounds'); + +Sys.UI.DomEvent = function Sys$UI$DomEvent(eventObject) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "eventObject"} + ]); + if (e) throw e; + var ev = eventObject; + var etype = this.type = ev.type.toLowerCase(); + this.rawEvent = ev; + this.altKey = ev.altKey; + if (typeof(ev.button) !== 'undefined') { + this.button = (typeof(ev.which) !== 'undefined') ? ev.button : + (ev.button === 4) ? Sys.UI.MouseButton.middleButton : + (ev.button === 2) ? Sys.UI.MouseButton.rightButton : + Sys.UI.MouseButton.leftButton; + } + if (etype === 'keypress') { + this.charCode = ev.charCode || ev.keyCode; + } + else if (ev.keyCode && (ev.keyCode === 46)) { + this.keyCode = 127; + } + else { + this.keyCode = ev.keyCode; + } + this.clientX = ev.clientX; + this.clientY = ev.clientY; + this.ctrlKey = ev.ctrlKey; + this.target = ev.target ? ev.target : ev.srcElement; + if (!etype.startsWith('key')) { + if ((typeof(ev.offsetX) !== 'undefined') && (typeof(ev.offsetY) !== 'undefined')) { + this.offsetX = ev.offsetX; + this.offsetY = ev.offsetY; + } + else if (this.target && (this.target.nodeType !== 3) && (typeof(ev.clientX) === 'number')) { + var loc = Sys.UI.DomElement.getLocation(this.target); + var w = Sys.UI.DomElement._getWindow(this.target); + this.offsetX = (w.pageXOffset || 0) + ev.clientX - loc.x; + this.offsetY = (w.pageYOffset || 0) + ev.clientY - loc.y; + } + } + this.screenX = ev.screenX; + this.screenY = ev.screenY; + this.shiftKey = ev.shiftKey; +} + function Sys$UI$DomEvent$preventDefault() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this.rawEvent.preventDefault) { + this.rawEvent.preventDefault(); + } + else if (window.event) { + this.rawEvent.returnValue = false; + } + } + function Sys$UI$DomEvent$stopPropagation() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this.rawEvent.stopPropagation) { + this.rawEvent.stopPropagation(); + } + else if (window.event) { + this.rawEvent.cancelBubble = true; + } + } +Sys.UI.DomEvent.prototype = { + preventDefault: Sys$UI$DomEvent$preventDefault, + stopPropagation: Sys$UI$DomEvent$stopPropagation +} +Sys.UI.DomEvent.registerClass('Sys.UI.DomEvent'); +var $addHandler = Sys.UI.DomEvent.addHandler = function Sys$UI$DomEvent$addHandler(element, eventName, handler, autoRemove) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element"}, + {name: "eventName", type: String}, + {name: "handler", type: Function}, + {name: "autoRemove", type: Boolean, optional: true} + ]); + if (e) throw e; + Sys.UI.DomEvent._ensureDomNode(element); + if (eventName === "error") throw Error.invalidOperation(Sys.Res.addHandlerCantBeUsedForError); + if (!element._events) { + element._events = {}; + } + var eventCache = element._events[eventName]; + if (!eventCache) { + element._events[eventName] = eventCache = []; + } + var browserHandler; + if (element.addEventListener) { + browserHandler = function(e) { + return handler.call(element, new Sys.UI.DomEvent(e)); + } + element.addEventListener(eventName, browserHandler, false); + } + else if (element.attachEvent) { + browserHandler = function() { + var e = {}; + try {e = Sys.UI.DomElement._getWindow(element).event} catch(ex) {} + return handler.call(element, new Sys.UI.DomEvent(e)); + } + element.attachEvent('on' + eventName, browserHandler); + } + eventCache[eventCache.length] = {handler: handler, browserHandler: browserHandler, autoRemove: autoRemove }; + if (autoRemove) { + var d = element.dispose; + if (d !== Sys.UI.DomEvent._disposeHandlers) { + element.dispose = Sys.UI.DomEvent._disposeHandlers; + if (typeof(d) !== "undefined") { + element._chainDispose = d; + } + } + } +} +var $addHandlers = Sys.UI.DomEvent.addHandlers = function Sys$UI$DomEvent$addHandlers(element, events, handlerOwner, autoRemove) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element"}, + {name: "events", type: Object}, + {name: "handlerOwner", optional: true}, + {name: "autoRemove", type: Boolean, optional: true} + ]); + if (e) throw e; + Sys.UI.DomEvent._ensureDomNode(element); + for (var name in events) { + var handler = events[name]; + if (typeof(handler) !== 'function') throw Error.invalidOperation(Sys.Res.cantAddNonFunctionhandler); + if (handlerOwner) { + handler = Function.createDelegate(handlerOwner, handler); + } + $addHandler(element, name, handler, autoRemove || false); + } +} +var $clearHandlers = Sys.UI.DomEvent.clearHandlers = function Sys$UI$DomEvent$clearHandlers(element) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element"} + ]); + if (e) throw e; + Sys.UI.DomEvent._ensureDomNode(element); + Sys.UI.DomEvent._clearHandlers(element, false); +} +Sys.UI.DomEvent._clearHandlers = function Sys$UI$DomEvent$_clearHandlers(element, autoRemoving) { + if (element._events) { + var cache = element._events; + for (var name in cache) { + var handlers = cache[name]; + for (var i = handlers.length - 1; i >= 0; i--) { + var entry = handlers[i]; + if (!autoRemoving || entry.autoRemove) { + $removeHandler(element, name, entry.handler); + } + } + } + element._events = null; + } +} +Sys.UI.DomEvent._disposeHandlers = function Sys$UI$DomEvent$_disposeHandlers() { + Sys.UI.DomEvent._clearHandlers(this, true); + var d = this._chainDispose, type = typeof(d); + if (type !== "undefined") { + this.dispose = d; + this._chainDispose = null; + if (type === "function") { + this.dispose(); + } + } +} +var $removeHandler = Sys.UI.DomEvent.removeHandler = function Sys$UI$DomEvent$removeHandler(element, eventName, handler) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element"}, + {name: "eventName", type: String}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.UI.DomEvent._removeHandler(element, eventName, handler); +} +Sys.UI.DomEvent._removeHandler = function Sys$UI$DomEvent$_removeHandler(element, eventName, handler) { + Sys.UI.DomEvent._ensureDomNode(element); + var browserHandler = null; + if ((typeof(element._events) !== 'object') || !element._events) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid); + var cache = element._events[eventName]; + if (!(cache instanceof Array)) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid); + for (var i = 0, l = cache.length; i < l; i++) { + if (cache[i].handler === handler) { + browserHandler = cache[i].browserHandler; + break; + } + } + if (typeof(browserHandler) !== 'function') throw Error.invalidOperation(Sys.Res.eventHandlerInvalid); + if (element.removeEventListener) { + element.removeEventListener(eventName, browserHandler, false); + } + else if (element.detachEvent) { + element.detachEvent('on' + eventName, browserHandler); + } + cache.splice(i, 1); +} +Sys.UI.DomEvent._ensureDomNode = function Sys$UI$DomEvent$_ensureDomNode(element) { + if (element.tagName && (element.tagName.toUpperCase() === "SCRIPT")) return; + + var doc = element.ownerDocument || element.document || element; + if ((typeof(element.document) !== 'object') && (element != doc) && (typeof(element.nodeType) !== 'number')) { + throw Error.argument("element", Sys.Res.argumentDomNode); + } +} + +Sys.UI.DomElement = function Sys$UI$DomElement() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); +} +Sys.UI.DomElement.registerClass('Sys.UI.DomElement'); +Sys.UI.DomElement.addCssClass = function Sys$UI$DomElement$addCssClass(element, className) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "className", type: String} + ]); + if (e) throw e; + if (!Sys.UI.DomElement.containsCssClass(element, className)) { + if (element.className === '') { + element.className = className; + } + else { + element.className += ' ' + className; + } + } +} +Sys.UI.DomElement.containsCssClass = function Sys$UI$DomElement$containsCssClass(element, className) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "className", type: String} + ]); + if (e) throw e; + return Array.contains(element.className.split(' '), className); +} +Sys.UI.DomElement.getBounds = function Sys$UI$DomElement$getBounds(element) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + var offset = Sys.UI.DomElement.getLocation(element); + return new Sys.UI.Bounds(offset.x, offset.y, element.offsetWidth || 0, element.offsetHeight || 0); +} +var $get = Sys.UI.DomElement.getElementById = function Sys$UI$DomElement$getElementById(id, element) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "id", type: String}, + {name: "element", mayBeNull: true, domElement: true, optional: true} + ]); + if (e) throw e; + if (!element) return document.getElementById(id); + if (element.getElementById) return element.getElementById(id); + var nodeQueue = []; + var childNodes = element.childNodes; + for (var i = 0; i < childNodes.length; i++) { + var node = childNodes[i]; + if (node.nodeType == 1) { + nodeQueue[nodeQueue.length] = node; + } + } + while (nodeQueue.length) { + node = nodeQueue.shift(); + if (node.id == id) { + return node; + } + childNodes = node.childNodes; + for (i = 0; i < childNodes.length; i++) { + node = childNodes[i]; + if (node.nodeType == 1) { + nodeQueue[nodeQueue.length] = node; + } + } + } + return null; +} +if (document.documentElement.getBoundingClientRect) { + Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + if (element.self || element.nodeType === 9) return new Sys.UI.Point(0,0); + var clientRect = element.getBoundingClientRect(); + if (!clientRect) { + return new Sys.UI.Point(0,0); + } + var documentElement = element.ownerDocument.documentElement, + offsetX = Math.floor(clientRect.left + 0.5) + documentElement.scrollLeft, + offsetY = Math.floor(clientRect.top + 0.5) + documentElement.scrollTop; + if (Sys.Browser.agent === Sys.Browser.InternetExplorer) { + try { + var f = element.ownerDocument.parentWindow.frameElement || null; + if (f) { + var offset = (f.frameBorder === "0" || f.frameBorder === "no") ? 2 : 0; + offsetX += offset; + offsetY += offset; + } + } + catch(ex) { + } + if (Sys.Browser.version <= 7) { + + var multiplier, before, rect, d = document.createElement("div"); + d.style.cssText = "position:absolute !important;left:0px !important;right:0px !important;height:0px !important;width:1px !important;display:hidden !important"; + try { + before = document.body.childNodes[0]; + document.body.insertBefore(d, before); + rect = d.getBoundingClientRect(); + document.body.removeChild(d); + multiplier = (rect.right - rect.left); + } + catch (e) { + } + if (multiplier && (multiplier !== 1)) { + offsetX = Math.floor(offsetX / multiplier); + offsetY = Math.floor(offsetY / multiplier); + } + } + if ((document.documentMode || 0) < 8) { + offsetX -= 2; + offsetY -= 2; + } + } + return new Sys.UI.Point(offsetX, offsetY); + } +} +else if (Sys.Browser.agent === Sys.Browser.Safari) { + Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + if ((element.window && (element.window === element)) || element.nodeType === 9) return new Sys.UI.Point(0,0); + var offsetX = 0, offsetY = 0, + parent, + previous = null, + previousStyle = null, + currentStyle; + for (parent = element; parent; previous = parent, previousStyle = currentStyle, parent = parent.offsetParent) { + currentStyle = Sys.UI.DomElement._getCurrentStyle(parent); + var tagName = parent.tagName ? parent.tagName.toUpperCase() : null; + if ((parent.offsetLeft || parent.offsetTop) && + ((tagName !== "BODY") || (!previousStyle || previousStyle.position !== "absolute"))) { + offsetX += parent.offsetLeft; + offsetY += parent.offsetTop; + } + if (previous && Sys.Browser.version >= 3) { + offsetX += parseInt(currentStyle.borderLeftWidth); + offsetY += parseInt(currentStyle.borderTopWidth); + } + } + currentStyle = Sys.UI.DomElement._getCurrentStyle(element); + var elementPosition = currentStyle ? currentStyle.position : null; + if (!elementPosition || (elementPosition !== "absolute")) { + for (parent = element.parentNode; parent; parent = parent.parentNode) { + tagName = parent.tagName ? parent.tagName.toUpperCase() : null; + if ((tagName !== "BODY") && (tagName !== "HTML") && (parent.scrollLeft || parent.scrollTop)) { + offsetX -= (parent.scrollLeft || 0); + offsetY -= (parent.scrollTop || 0); + } + currentStyle = Sys.UI.DomElement._getCurrentStyle(parent); + var parentPosition = currentStyle ? currentStyle.position : null; + if (parentPosition && (parentPosition === "absolute")) break; + } + } + return new Sys.UI.Point(offsetX, offsetY); + } +} +else { + Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + if ((element.window && (element.window === element)) || element.nodeType === 9) return new Sys.UI.Point(0,0); + var offsetX = 0, offsetY = 0, + parent, + previous = null, + previousStyle = null, + currentStyle = null; + for (parent = element; parent; previous = parent, previousStyle = currentStyle, parent = parent.offsetParent) { + var tagName = parent.tagName ? parent.tagName.toUpperCase() : null; + currentStyle = Sys.UI.DomElement._getCurrentStyle(parent); + if ((parent.offsetLeft || parent.offsetTop) && + !((tagName === "BODY") && + (!previousStyle || previousStyle.position !== "absolute"))) { + offsetX += parent.offsetLeft; + offsetY += parent.offsetTop; + } + if (previous !== null && currentStyle) { + if ((tagName !== "TABLE") && (tagName !== "TD") && (tagName !== "HTML")) { + offsetX += parseInt(currentStyle.borderLeftWidth) || 0; + offsetY += parseInt(currentStyle.borderTopWidth) || 0; + } + if (tagName === "TABLE" && + (currentStyle.position === "relative" || currentStyle.position === "absolute")) { + offsetX += parseInt(currentStyle.marginLeft) || 0; + offsetY += parseInt(currentStyle.marginTop) || 0; + } + } + } + currentStyle = Sys.UI.DomElement._getCurrentStyle(element); + var elementPosition = currentStyle ? currentStyle.position : null; + if (!elementPosition || (elementPosition !== "absolute")) { + for (parent = element.parentNode; parent; parent = parent.parentNode) { + tagName = parent.tagName ? parent.tagName.toUpperCase() : null; + if ((tagName !== "BODY") && (tagName !== "HTML") && (parent.scrollLeft || parent.scrollTop)) { + offsetX -= (parent.scrollLeft || 0); + offsetY -= (parent.scrollTop || 0); + currentStyle = Sys.UI.DomElement._getCurrentStyle(parent); + if (currentStyle) { + offsetX += parseInt(currentStyle.borderLeftWidth) || 0; + offsetY += parseInt(currentStyle.borderTopWidth) || 0; + } + } + } + } + return new Sys.UI.Point(offsetX, offsetY); + } +} +Sys.UI.DomElement.isDomElement = function Sys$UI$DomElement$isDomElement(obj) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "obj"} + ]); + if (e) throw e; + return Sys._isDomElement(obj); +} +Sys.UI.DomElement.removeCssClass = function Sys$UI$DomElement$removeCssClass(element, className) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "className", type: String} + ]); + if (e) throw e; + var currentClassName = ' ' + element.className + ' '; + var index = currentClassName.indexOf(' ' + className + ' '); + if (index >= 0) { + element.className = (currentClassName.substr(0, index) + ' ' + + currentClassName.substring(index + className.length + 1, currentClassName.length)).trim(); + } +} +Sys.UI.DomElement.resolveElement = function Sys$UI$DomElement$resolveElement(elementOrElementId, containerElement) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "elementOrElementId", mayBeNull: true}, + {name: "containerElement", mayBeNull: true, domElement: true, optional: true} + ]); + if (e) throw e; + var el = elementOrElementId; + if (!el) return null; + if (typeof(el) === "string") { + el = Sys.UI.DomElement.getElementById(el, containerElement); + if (!el) { + throw Error.argument("elementOrElementId", String.format(Sys.Res.elementNotFound, elementOrElementId)); + } + } + else if(!Sys.UI.DomElement.isDomElement(el)) { + throw Error.argument("elementOrElementId", Sys.Res.expectedElementOrId); + } + return el; +} +Sys.UI.DomElement.raiseBubbleEvent = function Sys$UI$DomElement$raiseBubbleEvent(source, args) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "source", domElement: true}, + {name: "args", type: Sys.EventArgs} + ]); + if (e) throw e; + var target = source; + while (target) { + var control = target.control; + if (control && control.onBubbleEvent && control.raiseBubbleEvent) { + Sys.UI.DomElement._raiseBubbleEventFromControl(control, source, args); + return; + } + target = target.parentNode; + } +} +Sys.UI.DomElement._raiseBubbleEventFromControl = function Sys$UI$DomElement$_raiseBubbleEventFromControl(control, source, args) { + if (!control.onBubbleEvent(source, args)) { + control._raiseBubbleEvent(source, args); + } +} +Sys.UI.DomElement.setLocation = function Sys$UI$DomElement$setLocation(element, x, y) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "x", type: Number, integer: true}, + {name: "y", type: Number, integer: true} + ]); + if (e) throw e; + var style = element.style; + style.position = 'absolute'; + style.left = x + "px"; + style.top = y + "px"; +} +Sys.UI.DomElement.toggleCssClass = function Sys$UI$DomElement$toggleCssClass(element, className) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "className", type: String} + ]); + if (e) throw e; + if (Sys.UI.DomElement.containsCssClass(element, className)) { + Sys.UI.DomElement.removeCssClass(element, className); + } + else { + Sys.UI.DomElement.addCssClass(element, className); + } +} +Sys.UI.DomElement.getVisibilityMode = function Sys$UI$DomElement$getVisibilityMode(element) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + return (element._visibilityMode === Sys.UI.VisibilityMode.hide) ? + Sys.UI.VisibilityMode.hide : + Sys.UI.VisibilityMode.collapse; +} +Sys.UI.DomElement.setVisibilityMode = function Sys$UI$DomElement$setVisibilityMode(element, value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "value", type: Sys.UI.VisibilityMode} + ]); + if (e) throw e; + Sys.UI.DomElement._ensureOldDisplayMode(element); + if (element._visibilityMode !== value) { + element._visibilityMode = value; + if (Sys.UI.DomElement.getVisible(element) === false) { + if (element._visibilityMode === Sys.UI.VisibilityMode.hide) { + element.style.display = element._oldDisplayMode; + } + else { + element.style.display = 'none'; + } + } + element._visibilityMode = value; + } +} +Sys.UI.DomElement.getVisible = function Sys$UI$DomElement$getVisible(element) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + var style = element.currentStyle || Sys.UI.DomElement._getCurrentStyle(element); + if (!style) return true; + return (style.visibility !== 'hidden') && (style.display !== 'none'); +} +Sys.UI.DomElement.setVisible = function Sys$UI$DomElement$setVisible(element, value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "value", type: Boolean} + ]); + if (e) throw e; + if (value !== Sys.UI.DomElement.getVisible(element)) { + Sys.UI.DomElement._ensureOldDisplayMode(element); + element.style.visibility = value ? 'visible' : 'hidden'; + if (value || (element._visibilityMode === Sys.UI.VisibilityMode.hide)) { + element.style.display = element._oldDisplayMode; + } + else { + element.style.display = 'none'; + } + } +} +Sys.UI.DomElement._ensureOldDisplayMode = function Sys$UI$DomElement$_ensureOldDisplayMode(element) { + if (!element._oldDisplayMode) { + var style = element.currentStyle || Sys.UI.DomElement._getCurrentStyle(element); + element._oldDisplayMode = style ? style.display : null; + if (!element._oldDisplayMode || element._oldDisplayMode === 'none') { + switch(element.tagName.toUpperCase()) { + case 'DIV': case 'P': case 'ADDRESS': case 'BLOCKQUOTE': case 'BODY': case 'COL': + case 'COLGROUP': case 'DD': case 'DL': case 'DT': case 'FIELDSET': case 'FORM': + case 'H1': case 'H2': case 'H3': case 'H4': case 'H5': case 'H6': case 'HR': + case 'IFRAME': case 'LEGEND': case 'OL': case 'PRE': case 'TABLE': case 'TD': + case 'TH': case 'TR': case 'UL': + element._oldDisplayMode = 'block'; + break; + case 'LI': + element._oldDisplayMode = 'list-item'; + break; + default: + element._oldDisplayMode = 'inline'; + } + } + } +} +Sys.UI.DomElement._getWindow = function Sys$UI$DomElement$_getWindow(element) { + var doc = element.ownerDocument || element.document || element; + return doc.defaultView || doc.parentWindow; +} +Sys.UI.DomElement._getCurrentStyle = function Sys$UI$DomElement$_getCurrentStyle(element) { + if (element.nodeType === 3) return null; + var w = Sys.UI.DomElement._getWindow(element); + if (element.documentElement) element = element.documentElement; + var computedStyle = (w && (element !== w) && w.getComputedStyle) ? + w.getComputedStyle(element, null) : + element.currentStyle || element.style; + if (!computedStyle && (Sys.Browser.agent === Sys.Browser.Safari) && element.style) { + var oldDisplay = element.style.display; + var oldPosition = element.style.position; + element.style.position = 'absolute'; + element.style.display = 'block'; + var style = w.getComputedStyle(element, null); + element.style.display = oldDisplay; + element.style.position = oldPosition; + computedStyle = {}; + for (var n in style) { + computedStyle[n] = style[n]; + } + computedStyle.display = 'none'; + } + return computedStyle; +} + +Sys.IContainer = function Sys$IContainer() { + throw Error.notImplemented(); +} + function Sys$IContainer$addComponent(component) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "component", type: Sys.Component} + ]); + if (e) throw e; + throw Error.notImplemented(); + } + function Sys$IContainer$removeComponent(component) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "component", type: Sys.Component} + ]); + if (e) throw e; + throw Error.notImplemented(); + } + function Sys$IContainer$findComponent(id) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "id", type: String} + ]); + if (e) throw e; + throw Error.notImplemented(); + } + function Sys$IContainer$getComponents() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } +Sys.IContainer.prototype = { + addComponent: Sys$IContainer$addComponent, + removeComponent: Sys$IContainer$removeComponent, + findComponent: Sys$IContainer$findComponent, + getComponents: Sys$IContainer$getComponents +} +Sys.IContainer.registerInterface("Sys.IContainer"); + +Sys.ApplicationLoadEventArgs = function Sys$ApplicationLoadEventArgs(components, isPartialLoad) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "components", type: Array, elementType: Sys.Component}, + {name: "isPartialLoad", type: Boolean} + ]); + if (e) throw e; + Sys.ApplicationLoadEventArgs.initializeBase(this); + this._components = components; + this._isPartialLoad = isPartialLoad; +} + + function Sys$ApplicationLoadEventArgs$get_components() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._components; + } + function Sys$ApplicationLoadEventArgs$get_isPartialLoad() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._isPartialLoad; + } +Sys.ApplicationLoadEventArgs.prototype = { + get_components: Sys$ApplicationLoadEventArgs$get_components, + get_isPartialLoad: Sys$ApplicationLoadEventArgs$get_isPartialLoad +} +Sys.ApplicationLoadEventArgs.registerClass('Sys.ApplicationLoadEventArgs', Sys.EventArgs); + +Sys._Application = function Sys$_Application() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + Sys._Application.initializeBase(this); + this._disposableObjects = []; + this._components = {}; + this._createdComponents = []; + this._secondPassComponents = []; + this._unloadHandlerDelegate = Function.createDelegate(this, this._unloadHandler); + Sys.UI.DomEvent.addHandler(window, "unload", this._unloadHandlerDelegate); + this._domReady(); +} + function Sys$_Application$get_isCreatingComponents() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._creatingComponents; + } + function Sys$_Application$get_isDisposing() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._disposing; + } + function Sys$_Application$add_init(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + if (this._initialized) { + handler(this, Sys.EventArgs.Empty); + } + else { + this.get_events().addHandler("init", handler); + } + } + function Sys$_Application$remove_init(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().removeHandler("init", handler); + } + function Sys$_Application$add_load(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().addHandler("load", handler); + } + function Sys$_Application$remove_load(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().removeHandler("load", handler); + } + function Sys$_Application$add_unload(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().addHandler("unload", handler); + } + function Sys$_Application$remove_unload(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().removeHandler("unload", handler); + } + function Sys$_Application$addComponent(component) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "component", type: Sys.Component} + ]); + if (e) throw e; + var id = component.get_id(); + if (!id) throw Error.invalidOperation(Sys.Res.cantAddWithoutId); + if (typeof(this._components[id]) !== 'undefined') throw Error.invalidOperation(String.format(Sys.Res.appDuplicateComponent, id)); + this._components[id] = component; + } + function Sys$_Application$beginCreateComponents() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._creatingComponents = true; + } + function Sys$_Application$dispose() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._disposing) { + this._disposing = true; + if (this._timerCookie) { + window.clearTimeout(this._timerCookie); + delete this._timerCookie; + } + if (this._endRequestHandler) { + Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler); + delete this._endRequestHandler; + } + if (this._beginRequestHandler) { + Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler); + delete this._beginRequestHandler; + } + if (window.pageUnload) { + window.pageUnload(this, Sys.EventArgs.Empty); + } + var unloadHandler = this.get_events().getHandler("unload"); + if (unloadHandler) { + unloadHandler(this, Sys.EventArgs.Empty); + } + var disposableObjects = Array.clone(this._disposableObjects); + for (var i = 0, l = disposableObjects.length; i < l; i++) { + var object = disposableObjects[i]; + if (typeof(object) !== "undefined") { + object.dispose(); + } + } + Array.clear(this._disposableObjects); + Sys.UI.DomEvent.removeHandler(window, "unload", this._unloadHandlerDelegate); + if (Sys._ScriptLoader) { + var sl = Sys._ScriptLoader.getInstance(); + if(sl) { + sl.dispose(); + } + } + Sys._Application.callBaseMethod(this, 'dispose'); + } + } + function Sys$_Application$disposeElement(element, childNodesOnly) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element"}, + {name: "childNodesOnly", type: Boolean} + ]); + if (e) throw e; + if (element.nodeType === 1) { + var children = element.getElementsByTagName("*"); + for (var i = children.length - 1; i >= 0; i--) { + this._disposeElementInternal(children[i]); + } + if (!childNodesOnly) { + this._disposeElementInternal(element); + } + } + } + function Sys$_Application$endCreateComponents() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + var components = this._secondPassComponents; + for (var i = 0, l = components.length; i < l; i++) { + var component = components[i].component; + Sys$Component$_setReferences(component, components[i].references); + component.endUpdate(); + } + this._secondPassComponents = []; + this._creatingComponents = false; + } + function Sys$_Application$findComponent(id, parent) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "id", type: String}, + {name: "parent", mayBeNull: true, optional: true} + ]); + if (e) throw e; + return (parent ? + ((Sys.IContainer.isInstanceOfType(parent)) ? + parent.findComponent(id) : + parent[id] || null) : + Sys.Application._components[id] || null); + } + function Sys$_Application$getComponents() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + var res = []; + var components = this._components; + for (var name in components) { + res[res.length] = components[name]; + } + return res; + } + function Sys$_Application$initialize() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if(!this.get_isInitialized() && !this._disposing) { + Sys._Application.callBaseMethod(this, 'initialize'); + this._raiseInit(); + if (this.get_stateString) { + if (Sys.WebForms && Sys.WebForms.PageRequestManager) { + this._beginRequestHandler = Function.createDelegate(this, this._onPageRequestManagerBeginRequest); + Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler); + this._endRequestHandler = Function.createDelegate(this, this._onPageRequestManagerEndRequest); + Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler); + } + var loadedEntry = this.get_stateString(); + if (loadedEntry !== this._currentEntry) { + this._navigate(loadedEntry); + } + else { + this._ensureHistory(); + } + } + this.raiseLoad(); + } + } + function Sys$_Application$notifyScriptLoaded() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + } + function Sys$_Application$registerDisposableObject(object) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "object", type: Sys.IDisposable} + ]); + if (e) throw e; + if (!this._disposing) { + var objects = this._disposableObjects, + i = objects.length; + objects[i] = object; + object.__msdisposeindex = i; + } + } + function Sys$_Application$raiseLoad() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + var h = this.get_events().getHandler("load"); + var args = new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents), !!this._loaded); + this._loaded = true; + if (h) { + h(this, args); + } + if (window.pageLoad) { + window.pageLoad(this, args); + } + this._createdComponents = []; + } + function Sys$_Application$removeComponent(component) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "component", type: Sys.Component} + ]); + if (e) throw e; + var id = component.get_id(); + if (id) delete this._components[id]; + } + function Sys$_Application$unregisterDisposableObject(object) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "object", type: Sys.IDisposable} + ]); + if (e) throw e; + if (!this._disposing) { + var i = object.__msdisposeindex; + if (typeof(i) === "number") { + var disposableObjects = this._disposableObjects; + delete disposableObjects[i]; + delete object.__msdisposeindex; + if (++this._deleteCount > 1000) { + var newArray = []; + for (var j = 0, l = disposableObjects.length; j < l; j++) { + object = disposableObjects[j]; + if (typeof(object) !== "undefined") { + object.__msdisposeindex = newArray.length; + newArray.push(object); + } + } + this._disposableObjects = newArray; + this._deleteCount = 0; + } + } + } + } + function Sys$_Application$_addComponentToSecondPass(component, references) { + this._secondPassComponents[this._secondPassComponents.length] = {component: component, references: references}; + } + function Sys$_Application$_disposeComponents(list) { + if (list) { + for (var i = list.length - 1; i >= 0; i--) { + var item = list[i]; + if (typeof(item.dispose) === "function") { + item.dispose(); + } + } + } + } + function Sys$_Application$_disposeElementInternal(element) { + var d = element.dispose; + if (d && typeof(d) === "function") { + element.dispose(); + } + else { + var c = element.control; + if (c && typeof(c.dispose) === "function") { + c.dispose(); + } + } + var list = element._behaviors; + if (list) { + this._disposeComponents(list); + } + list = element._components; + if (list) { + this._disposeComponents(list); + element._components = null; + } + } + function Sys$_Application$_domReady() { + var check, er, app = this; + function init() { app.initialize(); } + var onload = function() { + Sys.UI.DomEvent.removeHandler(window, "load", onload); + init(); + } + Sys.UI.DomEvent.addHandler(window, "load", onload); + + if (document.addEventListener) { + try { + document.addEventListener("DOMContentLoaded", check = function() { + document.removeEventListener("DOMContentLoaded", check, false); + init(); + }, false); + } + catch (er) { } + } + else if (document.attachEvent) { + if ((window == window.top) && document.documentElement.doScroll) { + var timeout, el = document.createElement("div"); + check = function() { + try { + el.doScroll("left"); + } + catch (er) { + timeout = window.setTimeout(check, 0); + return; + } + el = null; + init(); + } + check(); + } + else { + document.attachEvent("onreadystatechange", check = function() { + if (document.readyState === "complete") { + document.detachEvent("onreadystatechange", check); + init(); + } + }); + } + } + } + function Sys$_Application$_raiseInit() { + var handler = this.get_events().getHandler("init"); + if (handler) { + this.beginCreateComponents(); + handler(this, Sys.EventArgs.Empty); + this.endCreateComponents(); + } + } + function Sys$_Application$_unloadHandler(event) { + this.dispose(); + } +Sys._Application.prototype = { + _creatingComponents: false, + _disposing: false, + _deleteCount: 0, + get_isCreatingComponents: Sys$_Application$get_isCreatingComponents, + get_isDisposing: Sys$_Application$get_isDisposing, + add_init: Sys$_Application$add_init, + remove_init: Sys$_Application$remove_init, + add_load: Sys$_Application$add_load, + remove_load: Sys$_Application$remove_load, + add_unload: Sys$_Application$add_unload, + remove_unload: Sys$_Application$remove_unload, + addComponent: Sys$_Application$addComponent, + beginCreateComponents: Sys$_Application$beginCreateComponents, + dispose: Sys$_Application$dispose, + disposeElement: Sys$_Application$disposeElement, + endCreateComponents: Sys$_Application$endCreateComponents, + findComponent: Sys$_Application$findComponent, + getComponents: Sys$_Application$getComponents, + initialize: Sys$_Application$initialize, + notifyScriptLoaded: Sys$_Application$notifyScriptLoaded, + registerDisposableObject: Sys$_Application$registerDisposableObject, + raiseLoad: Sys$_Application$raiseLoad, + removeComponent: Sys$_Application$removeComponent, + unregisterDisposableObject: Sys$_Application$unregisterDisposableObject, + _addComponentToSecondPass: Sys$_Application$_addComponentToSecondPass, + _disposeComponents: Sys$_Application$_disposeComponents, + _disposeElementInternal: Sys$_Application$_disposeElementInternal, + _domReady: Sys$_Application$_domReady, + _raiseInit: Sys$_Application$_raiseInit, + _unloadHandler: Sys$_Application$_unloadHandler +} +Sys._Application.registerClass('Sys._Application', Sys.Component, Sys.IContainer); +Sys.Application = new Sys._Application(); +var $find = Sys.Application.findComponent; + +Sys.UI.Behavior = function Sys$UI$Behavior(element) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + Sys.UI.Behavior.initializeBase(this); + this._element = element; + var behaviors = element._behaviors; + if (!behaviors) { + element._behaviors = [this]; + } + else { + behaviors[behaviors.length] = this; + } +} + function Sys$UI$Behavior$get_element() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._element; + } + function Sys$UI$Behavior$get_id() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + var baseId = Sys.UI.Behavior.callBaseMethod(this, 'get_id'); + if (baseId) return baseId; + if (!this._element || !this._element.id) return ''; + return this._element.id + '$' + this.get_name(); + } + function Sys$UI$Behavior$get_name() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this._name) return this._name; + var name = Object.getTypeName(this); + var i = name.lastIndexOf('.'); + if (i !== -1) name = name.substr(i + 1); + if (!this.get_isInitialized()) this._name = name; + return name; + } + function Sys$UI$Behavior$set_name(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + if ((value === '') || (value.charAt(0) === ' ') || (value.charAt(value.length - 1) === ' ')) + throw Error.argument('value', Sys.Res.invalidId); + if (typeof(this._element[value]) !== 'undefined') + throw Error.invalidOperation(String.format(Sys.Res.behaviorDuplicateName, value)); + if (this.get_isInitialized()) throw Error.invalidOperation(Sys.Res.cantSetNameAfterInit); + this._name = value; + } + function Sys$UI$Behavior$initialize() { + Sys.UI.Behavior.callBaseMethod(this, 'initialize'); + var name = this.get_name(); + if (name) this._element[name] = this; + } + function Sys$UI$Behavior$dispose() { + Sys.UI.Behavior.callBaseMethod(this, 'dispose'); + var e = this._element; + if (e) { + var name = this.get_name(); + if (name) { + e[name] = null; + } + var behaviors = e._behaviors; + Array.remove(behaviors, this); + if (behaviors.length === 0) { + e._behaviors = null; + } + delete this._element; + } + } +Sys.UI.Behavior.prototype = { + _name: null, + get_element: Sys$UI$Behavior$get_element, + get_id: Sys$UI$Behavior$get_id, + get_name: Sys$UI$Behavior$get_name, + set_name: Sys$UI$Behavior$set_name, + initialize: Sys$UI$Behavior$initialize, + dispose: Sys$UI$Behavior$dispose +} +Sys.UI.Behavior.registerClass('Sys.UI.Behavior', Sys.Component); +Sys.UI.Behavior.getBehaviorByName = function Sys$UI$Behavior$getBehaviorByName(element, name) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "name", type: String} + ]); + if (e) throw e; + var b = element[name]; + return (b && Sys.UI.Behavior.isInstanceOfType(b)) ? b : null; +} +Sys.UI.Behavior.getBehaviors = function Sys$UI$Behavior$getBehaviors(element) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + if (!element._behaviors) return []; + return Array.clone(element._behaviors); +} +Sys.UI.Behavior.getBehaviorsByType = function Sys$UI$Behavior$getBehaviorsByType(element, type) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "type", type: Type} + ]); + if (e) throw e; + var behaviors = element._behaviors; + var results = []; + if (behaviors) { + for (var i = 0, l = behaviors.length; i < l; i++) { + if (type.isInstanceOfType(behaviors[i])) { + results[results.length] = behaviors[i]; + } + } + } + return results; +} + +Sys.UI.VisibilityMode = function Sys$UI$VisibilityMode() { + /// + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); +} +Sys.UI.VisibilityMode.prototype = { + hide: 0, + collapse: 1 +} +Sys.UI.VisibilityMode.registerEnum("Sys.UI.VisibilityMode"); + +Sys.UI.Control = function Sys$UI$Control(element) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + if (typeof(element.control) !== 'undefined') throw Error.invalidOperation(Sys.Res.controlAlreadyDefined); + Sys.UI.Control.initializeBase(this); + this._element = element; + element.control = this; + var role = this.get_role(); + if (role) { + element.setAttribute("role", role); + } +} + function Sys$UI$Control$get_element() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._element; + } + function Sys$UI$Control$get_id() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._element) return ''; + return this._element.id; + } + function Sys$UI$Control$set_id(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + throw Error.invalidOperation(Sys.Res.cantSetId); + } + function Sys$UI$Control$get_parent() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this._parent) return this._parent; + if (!this._element) return null; + + var parentElement = this._element.parentNode; + while (parentElement) { + if (parentElement.control) { + return parentElement.control; + } + parentElement = parentElement.parentNode; + } + return null; + } + function Sys$UI$Control$set_parent(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Sys.UI.Control}]); + if (e) throw e; + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + var parents = [this]; + var current = value; + while (current) { + if (Array.contains(parents, current)) throw Error.invalidOperation(Sys.Res.circularParentChain); + parents[parents.length] = current; + current = current.get_parent(); + } + this._parent = value; + } + function Sys$UI$Control$get_role() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return null; + } + function Sys$UI$Control$get_visibilityMode() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + return Sys.UI.DomElement.getVisibilityMode(this._element); + } + function Sys$UI$Control$set_visibilityMode(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Sys.UI.VisibilityMode}]); + if (e) throw e; + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + Sys.UI.DomElement.setVisibilityMode(this._element, value); + } + function Sys$UI$Control$get_visible() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + return Sys.UI.DomElement.getVisible(this._element); + } + function Sys$UI$Control$set_visible(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]); + if (e) throw e; + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + Sys.UI.DomElement.setVisible(this._element, value) + } + function Sys$UI$Control$addCssClass(className) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "className", type: String} + ]); + if (e) throw e; + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + Sys.UI.DomElement.addCssClass(this._element, className); + } + function Sys$UI$Control$dispose() { + Sys.UI.Control.callBaseMethod(this, 'dispose'); + if (this._element) { + this._element.control = null; + delete this._element; + } + if (this._parent) delete this._parent; + } + function Sys$UI$Control$onBubbleEvent(source, args) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "source"}, + {name: "args", type: Sys.EventArgs} + ]); + if (e) throw e; + return false; + } + function Sys$UI$Control$raiseBubbleEvent(source, args) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "source"}, + {name: "args", type: Sys.EventArgs} + ]); + if (e) throw e; + this._raiseBubbleEvent(source, args); + } + function Sys$UI$Control$_raiseBubbleEvent(source, args) { + var currentTarget = this.get_parent(); + while (currentTarget) { + if (currentTarget.onBubbleEvent(source, args)) { + return; + } + currentTarget = currentTarget.get_parent(); + } + } + function Sys$UI$Control$removeCssClass(className) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "className", type: String} + ]); + if (e) throw e; + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + Sys.UI.DomElement.removeCssClass(this._element, className); + } + function Sys$UI$Control$toggleCssClass(className) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "className", type: String} + ]); + if (e) throw e; + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + Sys.UI.DomElement.toggleCssClass(this._element, className); + } +Sys.UI.Control.prototype = { + _parent: null, + _visibilityMode: Sys.UI.VisibilityMode.hide, + get_element: Sys$UI$Control$get_element, + get_id: Sys$UI$Control$get_id, + set_id: Sys$UI$Control$set_id, + get_parent: Sys$UI$Control$get_parent, + set_parent: Sys$UI$Control$set_parent, + get_role: Sys$UI$Control$get_role, + get_visibilityMode: Sys$UI$Control$get_visibilityMode, + set_visibilityMode: Sys$UI$Control$set_visibilityMode, + get_visible: Sys$UI$Control$get_visible, + set_visible: Sys$UI$Control$set_visible, + addCssClass: Sys$UI$Control$addCssClass, + dispose: Sys$UI$Control$dispose, + onBubbleEvent: Sys$UI$Control$onBubbleEvent, + raiseBubbleEvent: Sys$UI$Control$raiseBubbleEvent, + _raiseBubbleEvent: Sys$UI$Control$_raiseBubbleEvent, + removeCssClass: Sys$UI$Control$removeCssClass, + toggleCssClass: Sys$UI$Control$toggleCssClass +} +Sys.UI.Control.registerClass('Sys.UI.Control', Sys.Component); +Sys.HistoryEventArgs = function Sys$HistoryEventArgs(state) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "state", type: Object} + ]); + if (e) throw e; + Sys.HistoryEventArgs.initializeBase(this); + this._state = state; +} + function Sys$HistoryEventArgs$get_state() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._state; + } +Sys.HistoryEventArgs.prototype = { + get_state: Sys$HistoryEventArgs$get_state +} +Sys.HistoryEventArgs.registerClass('Sys.HistoryEventArgs', Sys.EventArgs); +Sys.Application._appLoadHandler = null; +Sys.Application._beginRequestHandler = null; +Sys.Application._clientId = null; +Sys.Application._currentEntry = ''; +Sys.Application._endRequestHandler = null; +Sys.Application._history = null; +Sys.Application._enableHistory = false; +Sys.Application._historyEnabledInScriptManager = false; +Sys.Application._historyFrame = null; +Sys.Application._historyInitialized = false; +Sys.Application._historyPointIsNew = false; +Sys.Application._ignoreTimer = false; +Sys.Application._initialState = null; +Sys.Application._state = {}; +Sys.Application._timerCookie = 0; +Sys.Application._timerHandler = null; +Sys.Application._uniqueId = null; +Sys._Application.prototype.get_stateString = function Sys$_Application$get_stateString() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + var hash = null; + + if (Sys.Browser.agent === Sys.Browser.Firefox) { + var href = window.location.href; + var hashIndex = href.indexOf('#'); + if (hashIndex !== -1) { + hash = href.substring(hashIndex + 1); + } + else { + hash = ""; + } + return hash; + } + else { + hash = window.location.hash; + } + + if ((hash.length > 0) && (hash.charAt(0) === '#')) { + hash = hash.substring(1); + } + return hash; +}; +Sys._Application.prototype.get_enableHistory = function Sys$_Application$get_enableHistory() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._enableHistory; +}; +Sys._Application.prototype.set_enableHistory = function Sys$_Application$set_enableHistory(value) { + if (this._initialized && !this._initializing) { + throw Error.invalidOperation(Sys.Res.historyCannotEnableHistory); + } + else if (this._historyEnabledInScriptManager && !value) { + throw Error.invalidOperation(Sys.Res.invalidHistorySettingCombination); + } + this._enableHistory = value; +}; +Sys._Application.prototype.add_navigate = function Sys$_Application$add_navigate(handler) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "handler", type: Function} + ]); + if (e) throw e; + this.get_events().addHandler("navigate", handler); +}; +Sys._Application.prototype.remove_navigate = function Sys$_Application$remove_navigate(handler) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "handler", type: Function} + ]); + if (e) throw e; + this.get_events().removeHandler("navigate", handler); +}; +Sys._Application.prototype.addHistoryPoint = function Sys$_Application$addHistoryPoint(state, title) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "state", type: Object}, + {name: "title", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + if (!this._enableHistory) throw Error.invalidOperation(Sys.Res.historyCannotAddHistoryPointWithHistoryDisabled); + for (var n in state) { + var v = state[n]; + var t = typeof(v); + if ((v !== null) && ((t === 'object') || (t === 'function') || (t === 'undefined'))) { + throw Error.argument('state', Sys.Res.stateMustBeStringDictionary); + } + } + this._ensureHistory(); + var initialState = this._state; + for (var key in state) { + var value = state[key]; + if (value === null) { + if (typeof(initialState[key]) !== 'undefined') { + delete initialState[key]; + } + } + else { + initialState[key] = value; + } + } + var entry = this._serializeState(initialState); + this._historyPointIsNew = true; + this._setState(entry, title); + this._raiseNavigate(); +}; +Sys._Application.prototype.setServerId = function Sys$_Application$setServerId(clientId, uniqueId) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "clientId", type: String}, + {name: "uniqueId", type: String} + ]); + if (e) throw e; + this._clientId = clientId; + this._uniqueId = uniqueId; +}; +Sys._Application.prototype.setServerState = function Sys$_Application$setServerState(value) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String} + ]); + if (e) throw e; + this._ensureHistory(); + this._state.__s = value; + this._updateHiddenField(value); +}; +Sys._Application.prototype._deserializeState = function Sys$_Application$_deserializeState(entry) { + var result = {}; + entry = entry || ''; + var serverSeparator = entry.indexOf('&&'); + if ((serverSeparator !== -1) && (serverSeparator + 2 < entry.length)) { + result.__s = entry.substr(serverSeparator + 2); + entry = entry.substr(0, serverSeparator); + } + var tokens = entry.split('&'); + for (var i = 0, l = tokens.length; i < l; i++) { + var token = tokens[i]; + var equal = token.indexOf('='); + if ((equal !== -1) && (equal + 1 < token.length)) { + var name = token.substr(0, equal); + var value = token.substr(equal + 1); + result[name] = decodeURIComponent(value); + } + } + return result; +}; +Sys._Application.prototype._enableHistoryInScriptManager = function Sys$_Application$_enableHistoryInScriptManager() { + this._enableHistory = true; + this._historyEnabledInScriptManager = true; +}; +Sys._Application.prototype._ensureHistory = function Sys$_Application$_ensureHistory() { + if (!this._historyInitialized && this._enableHistory) { + if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.documentMode < 8)) { + this._historyFrame = document.getElementById('__historyFrame'); + if (!this._historyFrame) throw Error.invalidOperation(Sys.Res.historyMissingFrame); + this._ignoreIFrame = true; + } + this._timerHandler = Function.createDelegate(this, this._onIdle); + this._timerCookie = window.setTimeout(this._timerHandler, 100); + + try { + this._initialState = this._deserializeState(this.get_stateString()); + } catch(e) {} + + this._historyInitialized = true; + } +}; +Sys._Application.prototype._navigate = function Sys$_Application$_navigate(entry) { + this._ensureHistory(); + var state = this._deserializeState(entry); + + if (this._uniqueId) { + var oldServerEntry = this._state.__s || ''; + var newServerEntry = state.__s || ''; + if (newServerEntry !== oldServerEntry) { + this._updateHiddenField(newServerEntry); + __doPostBack(this._uniqueId, newServerEntry); + this._state = state; + return; + } + } + this._setState(entry); + this._state = state; + this._raiseNavigate(); +}; +Sys._Application.prototype._onIdle = function Sys$_Application$_onIdle() { + delete this._timerCookie; + + var entry = this.get_stateString(); + if (entry !== this._currentEntry) { + if (!this._ignoreTimer) { + this._historyPointIsNew = false; + this._navigate(entry); + } + } + else { + this._ignoreTimer = false; + } + this._timerCookie = window.setTimeout(this._timerHandler, 100); +}; +Sys._Application.prototype._onIFrameLoad = function Sys$_Application$_onIFrameLoad(entry) { + this._ensureHistory(); + if (!this._ignoreIFrame) { + this._historyPointIsNew = false; + this._navigate(entry); + } + this._ignoreIFrame = false; +}; +Sys._Application.prototype._onPageRequestManagerBeginRequest = function Sys$_Application$_onPageRequestManagerBeginRequest(sender, args) { + this._ignoreTimer = true; +}; +Sys._Application.prototype._onPageRequestManagerEndRequest = function Sys$_Application$_onPageRequestManagerEndRequest(sender, args) { + var dataItem = args.get_dataItems()[this._clientId]; + var eventTarget = document.getElementById("__EVENTTARGET"); + if (eventTarget && eventTarget.value === this._uniqueId) { + eventTarget.value = ''; + } + if (typeof(dataItem) !== 'undefined') { + this.setServerState(dataItem); + this._historyPointIsNew = true; + } + else { + this._ignoreTimer = false; + } + var entry = this._serializeState(this._state); + if (entry !== this._currentEntry) { + this._ignoreTimer = true; + this._setState(entry); + this._raiseNavigate(); + } +}; +Sys._Application.prototype._raiseNavigate = function Sys$_Application$_raiseNavigate() { + var h = this.get_events().getHandler("navigate"); + var stateClone = {}; + for (var key in this._state) { + if (key !== '__s') { + stateClone[key] = this._state[key]; + } + } + var args = new Sys.HistoryEventArgs(stateClone); + if (h) { + h(this, args); + } + var err; + try { + if ((Sys.Browser.agent === Sys.Browser.Firefox) && window.location.hash && + (!window.frameElement || window.top.location.hash)) { + window.history.go(0); + } + } + catch(err) { + } +}; +Sys._Application.prototype._serializeState = function Sys$_Application$_serializeState(state) { + var serialized = []; + for (var key in state) { + var value = state[key]; + if (key === '__s') { + var serverState = value; + } + else { + if (key.indexOf('=') !== -1) throw Error.argument('state', Sys.Res.stateFieldNameInvalid); + serialized[serialized.length] = key + '=' + encodeURIComponent(value); + } + } + return serialized.join('&') + (serverState ? '&&' + serverState : ''); +}; +Sys._Application.prototype._setState = function Sys$_Application$_setState(entry, title) { + if (this._enableHistory) { + entry = entry || ''; + if (entry !== this._currentEntry) { + if (window.theForm) { + var action = window.theForm.action; + var hashIndex = action.indexOf('#'); + window.theForm.action = ((hashIndex !== -1) ? action.substring(0, hashIndex) : action) + '#' + entry; + } + + if (this._historyFrame && this._historyPointIsNew) { + this._ignoreIFrame = true; + var frameDoc = this._historyFrame.contentWindow.document; + frameDoc.open("javascript:''"); + frameDoc.write("" + (title || document.title) + + "parent.Sys.Application._onIFrameLoad(" + + Sys.Serialization.JavaScriptSerializer.serialize(entry) + + ");"); + frameDoc.close(); + } + this._ignoreTimer = false; + this._currentEntry = entry; + if (this._historyFrame || this._historyPointIsNew) { + var currentHash = this.get_stateString(); + if (entry !== currentHash) { + var loc = document.location; + if (loc.href.length - loc.hash.length + entry.length > 1024) { + throw Error.invalidOperation(Sys.Res.urlMustBeLessThan1024chars); + } + window.location.hash = entry; + this._currentEntry = this.get_stateString(); + if ((typeof(title) !== 'undefined') && (title !== null)) { + document.title = title; + } + } + } + this._historyPointIsNew = false; + } + } +}; +Sys._Application.prototype._updateHiddenField = function Sys$_Application$_updateHiddenField(value) { + if (this._clientId) { + var serverStateField = document.getElementById(this._clientId); + if (serverStateField) { + serverStateField.value = value; + } + } +}; + +if (!window.XMLHttpRequest) { + window.XMLHttpRequest = function window$XMLHttpRequest() { + var progIDs = [ 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP' ]; + for (var i = 0, l = progIDs.length; i < l; i++) { + try { + return new ActiveXObject(progIDs[i]); + } + catch (ex) { + } + } + return null; + } +} +Type.registerNamespace('Sys.Net'); + +Sys.Net.WebRequestExecutor = function Sys$Net$WebRequestExecutor() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._webRequest = null; + this._resultObject = null; +} + function Sys$Net$WebRequestExecutor$get_webRequest() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._webRequest; + } + function Sys$Net$WebRequestExecutor$_set_webRequest(value) { + if (this.get_started()) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOnceStarted, 'set_webRequest')); + } + this._webRequest = value; + } + function Sys$Net$WebRequestExecutor$get_started() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_responseAvailable() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_timedOut() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_aborted() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_responseData() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_statusCode() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_statusText() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_xml() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_object() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._resultObject) { + this._resultObject = Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData()); + } + return this._resultObject; + } + function Sys$Net$WebRequestExecutor$executeRequest() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$abort() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$getResponseHeader(header) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "header", type: String} + ]); + if (e) throw e; + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$getAllResponseHeaders() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } +Sys.Net.WebRequestExecutor.prototype = { + get_webRequest: Sys$Net$WebRequestExecutor$get_webRequest, + _set_webRequest: Sys$Net$WebRequestExecutor$_set_webRequest, + get_started: Sys$Net$WebRequestExecutor$get_started, + get_responseAvailable: Sys$Net$WebRequestExecutor$get_responseAvailable, + get_timedOut: Sys$Net$WebRequestExecutor$get_timedOut, + get_aborted: Sys$Net$WebRequestExecutor$get_aborted, + get_responseData: Sys$Net$WebRequestExecutor$get_responseData, + get_statusCode: Sys$Net$WebRequestExecutor$get_statusCode, + get_statusText: Sys$Net$WebRequestExecutor$get_statusText, + get_xml: Sys$Net$WebRequestExecutor$get_xml, + get_object: Sys$Net$WebRequestExecutor$get_object, + executeRequest: Sys$Net$WebRequestExecutor$executeRequest, + abort: Sys$Net$WebRequestExecutor$abort, + getResponseHeader: Sys$Net$WebRequestExecutor$getResponseHeader, + getAllResponseHeaders: Sys$Net$WebRequestExecutor$getAllResponseHeaders +} +Sys.Net.WebRequestExecutor.registerClass('Sys.Net.WebRequestExecutor'); + +Sys.Net.XMLDOM = function Sys$Net$XMLDOM(markup) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "markup", type: String} + ]); + if (e) throw e; + if (!window.DOMParser) { + var progIDs = [ 'Msxml2.DOMDocument.3.0', 'Msxml2.DOMDocument' ]; + for (var i = 0, l = progIDs.length; i < l; i++) { + try { + var xmlDOM = new ActiveXObject(progIDs[i]); + xmlDOM.async = false; + xmlDOM.loadXML(markup); + xmlDOM.setProperty('SelectionLanguage', 'XPath'); + return xmlDOM; + } + catch (ex) { + } + } + } + else { + try { + var domParser = new window.DOMParser(); + return domParser.parseFromString(markup, 'text/xml'); + } + catch (ex) { + } + } + return null; +} +Sys.Net.XMLHttpExecutor = function Sys$Net$XMLHttpExecutor() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + Sys.Net.XMLHttpExecutor.initializeBase(this); + var _this = this; + this._xmlHttpRequest = null; + this._webRequest = null; + this._responseAvailable = false; + this._timedOut = false; + this._timer = null; + this._aborted = false; + this._started = false; + this._onReadyStateChange = (function () { + + if (_this._xmlHttpRequest.readyState === 4 ) { + try { + if (typeof(_this._xmlHttpRequest.status) === "undefined") { + return; + } + } + catch(ex) { + return; + } + + _this._clearTimer(); + _this._responseAvailable = true; + _this._webRequest.completed(Sys.EventArgs.Empty); + if (_this._xmlHttpRequest != null) { + _this._xmlHttpRequest.onreadystatechange = Function.emptyMethod; + _this._xmlHttpRequest = null; + } + } + }); + this._clearTimer = (function() { + if (_this._timer != null) { + window.clearTimeout(_this._timer); + _this._timer = null; + } + }); + this._onTimeout = (function() { + if (!_this._responseAvailable) { + _this._clearTimer(); + _this._timedOut = true; + _this._xmlHttpRequest.onreadystatechange = Function.emptyMethod; + _this._xmlHttpRequest.abort(); + _this._webRequest.completed(Sys.EventArgs.Empty); + _this._xmlHttpRequest = null; + } + }); +} + function Sys$Net$XMLHttpExecutor$get_timedOut() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._timedOut; + } + function Sys$Net$XMLHttpExecutor$get_started() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._started; + } + function Sys$Net$XMLHttpExecutor$get_responseAvailable() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._responseAvailable; + } + function Sys$Net$XMLHttpExecutor$get_aborted() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._aborted; + } + function Sys$Net$XMLHttpExecutor$executeRequest() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._webRequest = this.get_webRequest(); + if (this._started) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOnceStarted, 'executeRequest')); + } + if (this._webRequest === null) { + throw Error.invalidOperation(Sys.Res.nullWebRequest); + } + var body = this._webRequest.get_body(); + var headers = this._webRequest.get_headers(); + this._xmlHttpRequest = new XMLHttpRequest(); + this._xmlHttpRequest.onreadystatechange = this._onReadyStateChange; + var verb = this._webRequest.get_httpVerb(); + this._xmlHttpRequest.open(verb, this._webRequest.getResolvedUrl(), true ); + this._xmlHttpRequest.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + if (headers) { + for (var header in headers) { + var val = headers[header]; + if (typeof(val) !== "function") + this._xmlHttpRequest.setRequestHeader(header, val); + } + } + if (verb.toLowerCase() === "post") { + if ((headers === null) || !headers['Content-Type']) { + this._xmlHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8'); + } + if (!body) { + body = ""; + } + } + var timeout = this._webRequest.get_timeout(); + if (timeout > 0) { + this._timer = window.setTimeout(Function.createDelegate(this, this._onTimeout), timeout); + } + this._xmlHttpRequest.send(body); + this._started = true; + } + function Sys$Net$XMLHttpExecutor$getResponseHeader(header) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "header", type: String} + ]); + if (e) throw e; + if (!this._responseAvailable) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'getResponseHeader')); + } + if (!this._xmlHttpRequest) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'getResponseHeader')); + } + var result; + try { + result = this._xmlHttpRequest.getResponseHeader(header); + } catch (e) { + } + if (!result) result = ""; + return result; + } + function Sys$Net$XMLHttpExecutor$getAllResponseHeaders() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._responseAvailable) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'getAllResponseHeaders')); + } + if (!this._xmlHttpRequest) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'getAllResponseHeaders')); + } + return this._xmlHttpRequest.getAllResponseHeaders(); + } + function Sys$Net$XMLHttpExecutor$get_responseData() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._responseAvailable) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_responseData')); + } + if (!this._xmlHttpRequest) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_responseData')); + } + return this._xmlHttpRequest.responseText; + } + function Sys$Net$XMLHttpExecutor$get_statusCode() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._responseAvailable) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_statusCode')); + } + if (!this._xmlHttpRequest) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_statusCode')); + } + var result = 0; + try { + result = this._xmlHttpRequest.status; + } + catch(ex) { + } + return result; + } + function Sys$Net$XMLHttpExecutor$get_statusText() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._responseAvailable) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_statusText')); + } + if (!this._xmlHttpRequest) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_statusText')); + } + return this._xmlHttpRequest.statusText; + } + function Sys$Net$XMLHttpExecutor$get_xml() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._responseAvailable) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_xml')); + } + if (!this._xmlHttpRequest) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_xml')); + } + var xml = this._xmlHttpRequest.responseXML; + if (!xml || !xml.documentElement) { + xml = Sys.Net.XMLDOM(this._xmlHttpRequest.responseText); + if (!xml || !xml.documentElement) + return null; + } + else if (navigator.userAgent.indexOf('MSIE') !== -1) { + xml.setProperty('SelectionLanguage', 'XPath'); + } + if (xml.documentElement.namespaceURI === "http://www.mozilla.org/newlayout/xml/parsererror.xml" && + xml.documentElement.tagName === "parsererror") { + return null; + } + + if (xml.documentElement.firstChild && xml.documentElement.firstChild.tagName === "parsererror") { + return null; + } + + return xml; + } + function Sys$Net$XMLHttpExecutor$abort() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._started) { + throw Error.invalidOperation(Sys.Res.cannotAbortBeforeStart); + } + if (this._aborted || this._responseAvailable || this._timedOut) + return; + this._aborted = true; + this._clearTimer(); + if (this._xmlHttpRequest && !this._responseAvailable) { + this._xmlHttpRequest.onreadystatechange = Function.emptyMethod; + this._xmlHttpRequest.abort(); + + this._xmlHttpRequest = null; + this._webRequest.completed(Sys.EventArgs.Empty); + } + } +Sys.Net.XMLHttpExecutor.prototype = { + get_timedOut: Sys$Net$XMLHttpExecutor$get_timedOut, + get_started: Sys$Net$XMLHttpExecutor$get_started, + get_responseAvailable: Sys$Net$XMLHttpExecutor$get_responseAvailable, + get_aborted: Sys$Net$XMLHttpExecutor$get_aborted, + executeRequest: Sys$Net$XMLHttpExecutor$executeRequest, + getResponseHeader: Sys$Net$XMLHttpExecutor$getResponseHeader, + getAllResponseHeaders: Sys$Net$XMLHttpExecutor$getAllResponseHeaders, + get_responseData: Sys$Net$XMLHttpExecutor$get_responseData, + get_statusCode: Sys$Net$XMLHttpExecutor$get_statusCode, + get_statusText: Sys$Net$XMLHttpExecutor$get_statusText, + get_xml: Sys$Net$XMLHttpExecutor$get_xml, + abort: Sys$Net$XMLHttpExecutor$abort +} +Sys.Net.XMLHttpExecutor.registerClass('Sys.Net.XMLHttpExecutor', Sys.Net.WebRequestExecutor); + +Sys.Net._WebRequestManager = function Sys$Net$_WebRequestManager() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._defaultTimeout = 0; + this._defaultExecutorType = "Sys.Net.XMLHttpExecutor"; +} + function Sys$Net$_WebRequestManager$add_invokingRequest(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this._get_eventHandlerList().addHandler("invokingRequest", handler); + } + function Sys$Net$_WebRequestManager$remove_invokingRequest(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this._get_eventHandlerList().removeHandler("invokingRequest", handler); + } + function Sys$Net$_WebRequestManager$add_completedRequest(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this._get_eventHandlerList().addHandler("completedRequest", handler); + } + function Sys$Net$_WebRequestManager$remove_completedRequest(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this._get_eventHandlerList().removeHandler("completedRequest", handler); + } + function Sys$Net$_WebRequestManager$_get_eventHandlerList() { + if (!this._events) { + this._events = new Sys.EventHandlerList(); + } + return this._events; + } + function Sys$Net$_WebRequestManager$get_defaultTimeout() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._defaultTimeout; + } + function Sys$Net$_WebRequestManager$set_defaultTimeout(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Number}]); + if (e) throw e; + if (value < 0) { + throw Error.argumentOutOfRange("value", value, Sys.Res.invalidTimeout); + } + this._defaultTimeout = value; + } + function Sys$Net$_WebRequestManager$get_defaultExecutorType() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._defaultExecutorType; + } + function Sys$Net$_WebRequestManager$set_defaultExecutorType(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + this._defaultExecutorType = value; + } + function Sys$Net$_WebRequestManager$executeRequest(webRequest) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "webRequest", type: Sys.Net.WebRequest} + ]); + if (e) throw e; + var executor = webRequest.get_executor(); + if (!executor) { + var failed = false; + try { + var executorType = eval(this._defaultExecutorType); + executor = new executorType(); + } catch (e) { + failed = true; + } + if (failed || !Sys.Net.WebRequestExecutor.isInstanceOfType(executor) || !executor) { + throw Error.argument("defaultExecutorType", String.format(Sys.Res.invalidExecutorType, this._defaultExecutorType)); + } + webRequest.set_executor(executor); + } + if (executor.get_aborted()) { + return; + } + var evArgs = new Sys.Net.NetworkRequestEventArgs(webRequest); + var handler = this._get_eventHandlerList().getHandler("invokingRequest"); + if (handler) { + handler(this, evArgs); + } + if (!evArgs.get_cancel()) { + executor.executeRequest(); + } + } +Sys.Net._WebRequestManager.prototype = { + add_invokingRequest: Sys$Net$_WebRequestManager$add_invokingRequest, + remove_invokingRequest: Sys$Net$_WebRequestManager$remove_invokingRequest, + add_completedRequest: Sys$Net$_WebRequestManager$add_completedRequest, + remove_completedRequest: Sys$Net$_WebRequestManager$remove_completedRequest, + _get_eventHandlerList: Sys$Net$_WebRequestManager$_get_eventHandlerList, + get_defaultTimeout: Sys$Net$_WebRequestManager$get_defaultTimeout, + set_defaultTimeout: Sys$Net$_WebRequestManager$set_defaultTimeout, + get_defaultExecutorType: Sys$Net$_WebRequestManager$get_defaultExecutorType, + set_defaultExecutorType: Sys$Net$_WebRequestManager$set_defaultExecutorType, + executeRequest: Sys$Net$_WebRequestManager$executeRequest +} +Sys.Net._WebRequestManager.registerClass('Sys.Net._WebRequestManager'); +Sys.Net.WebRequestManager = new Sys.Net._WebRequestManager(); + +Sys.Net.NetworkRequestEventArgs = function Sys$Net$NetworkRequestEventArgs(webRequest) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "webRequest", type: Sys.Net.WebRequest} + ]); + if (e) throw e; + Sys.Net.NetworkRequestEventArgs.initializeBase(this); + this._webRequest = webRequest; +} + function Sys$Net$NetworkRequestEventArgs$get_webRequest() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._webRequest; + } +Sys.Net.NetworkRequestEventArgs.prototype = { + get_webRequest: Sys$Net$NetworkRequestEventArgs$get_webRequest +} +Sys.Net.NetworkRequestEventArgs.registerClass('Sys.Net.NetworkRequestEventArgs', Sys.CancelEventArgs); + +Sys.Net.WebRequest = function Sys$Net$WebRequest() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._url = ""; + this._headers = { }; + this._body = null; + this._userContext = null; + this._httpVerb = null; + this._executor = null; + this._invokeCalled = false; + this._timeout = 0; +} + function Sys$Net$WebRequest$add_completed(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this._get_eventHandlerList().addHandler("completed", handler); + } + function Sys$Net$WebRequest$remove_completed(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this._get_eventHandlerList().removeHandler("completed", handler); + } + function Sys$Net$WebRequest$completed(eventArgs) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "eventArgs", type: Sys.EventArgs} + ]); + if (e) throw e; + var handler = Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest"); + if (handler) { + handler(this._executor, eventArgs); + } + handler = this._get_eventHandlerList().getHandler("completed"); + if (handler) { + handler(this._executor, eventArgs); + } + } + function Sys$Net$WebRequest$_get_eventHandlerList() { + if (!this._events) { + this._events = new Sys.EventHandlerList(); + } + return this._events; + } + function Sys$Net$WebRequest$get_url() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._url; + } + function Sys$Net$WebRequest$set_url(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + this._url = value; + } + function Sys$Net$WebRequest$get_headers() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._headers; + } + function Sys$Net$WebRequest$get_httpVerb() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this._httpVerb === null) { + if (this._body === null) { + return "GET"; + } + return "POST"; + } + return this._httpVerb; + } + function Sys$Net$WebRequest$set_httpVerb(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + if (value.length === 0) { + throw Error.argument('value', Sys.Res.invalidHttpVerb); + } + this._httpVerb = value; + } + function Sys$Net$WebRequest$get_body() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._body; + } + function Sys$Net$WebRequest$set_body(value) { + var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]); + if (e) throw e; + this._body = value; + } + function Sys$Net$WebRequest$get_userContext() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._userContext; + } + function Sys$Net$WebRequest$set_userContext(value) { + var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]); + if (e) throw e; + this._userContext = value; + } + function Sys$Net$WebRequest$get_executor() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._executor; + } + function Sys$Net$WebRequest$set_executor(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Sys.Net.WebRequestExecutor}]); + if (e) throw e; + if (this._executor !== null && this._executor.get_started()) { + throw Error.invalidOperation(Sys.Res.setExecutorAfterActive); + } + this._executor = value; + this._executor._set_webRequest(this); + } + function Sys$Net$WebRequest$get_timeout() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this._timeout === 0) { + return Sys.Net.WebRequestManager.get_defaultTimeout(); + } + return this._timeout; + } + function Sys$Net$WebRequest$set_timeout(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Number}]); + if (e) throw e; + if (value < 0) { + throw Error.argumentOutOfRange("value", value, Sys.Res.invalidTimeout); + } + this._timeout = value; + } + function Sys$Net$WebRequest$getResolvedUrl() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return Sys.Net.WebRequest._resolveUrl(this._url); + } + function Sys$Net$WebRequest$invoke() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this._invokeCalled) { + throw Error.invalidOperation(Sys.Res.invokeCalledTwice); + } + Sys.Net.WebRequestManager.executeRequest(this); + this._invokeCalled = true; + } +Sys.Net.WebRequest.prototype = { + add_completed: Sys$Net$WebRequest$add_completed, + remove_completed: Sys$Net$WebRequest$remove_completed, + completed: Sys$Net$WebRequest$completed, + _get_eventHandlerList: Sys$Net$WebRequest$_get_eventHandlerList, + get_url: Sys$Net$WebRequest$get_url, + set_url: Sys$Net$WebRequest$set_url, + get_headers: Sys$Net$WebRequest$get_headers, + get_httpVerb: Sys$Net$WebRequest$get_httpVerb, + set_httpVerb: Sys$Net$WebRequest$set_httpVerb, + get_body: Sys$Net$WebRequest$get_body, + set_body: Sys$Net$WebRequest$set_body, + get_userContext: Sys$Net$WebRequest$get_userContext, + set_userContext: Sys$Net$WebRequest$set_userContext, + get_executor: Sys$Net$WebRequest$get_executor, + set_executor: Sys$Net$WebRequest$set_executor, + get_timeout: Sys$Net$WebRequest$get_timeout, + set_timeout: Sys$Net$WebRequest$set_timeout, + getResolvedUrl: Sys$Net$WebRequest$getResolvedUrl, + invoke: Sys$Net$WebRequest$invoke +} +Sys.Net.WebRequest._resolveUrl = function Sys$Net$WebRequest$_resolveUrl(url, baseUrl) { + if (url && url.indexOf('://') !== -1) { + return url; + } + if (!baseUrl || baseUrl.length === 0) { + var baseElement = document.getElementsByTagName('base')[0]; + if (baseElement && baseElement.href && baseElement.href.length > 0) { + baseUrl = baseElement.href; + } + else { + baseUrl = document.URL; + } + } + var qsStart = baseUrl.indexOf('?'); + if (qsStart !== -1) { + baseUrl = baseUrl.substr(0, qsStart); + } + qsStart = baseUrl.indexOf('#'); + if (qsStart !== -1) { + baseUrl = baseUrl.substr(0, qsStart); + } + baseUrl = baseUrl.substr(0, baseUrl.lastIndexOf('/') + 1); + if (!url || url.length === 0) { + return baseUrl; + } + if (url.charAt(0) === '/') { + var slashslash = baseUrl.indexOf('://'); + if (slashslash === -1) { + throw Error.argument("baseUrl", Sys.Res.badBaseUrl1); + } + var nextSlash = baseUrl.indexOf('/', slashslash + 3); + if (nextSlash === -1) { + throw Error.argument("baseUrl", Sys.Res.badBaseUrl2); + } + return baseUrl.substr(0, nextSlash) + url; + } + else { + var lastSlash = baseUrl.lastIndexOf('/'); + if (lastSlash === -1) { + throw Error.argument("baseUrl", Sys.Res.badBaseUrl3); + } + return baseUrl.substr(0, lastSlash+1) + url; + } +} +Sys.Net.WebRequest._createQueryString = function Sys$Net$WebRequest$_createQueryString(queryString, encodeMethod, addParams) { + encodeMethod = encodeMethod || encodeURIComponent; + var i = 0, obj, val, arg, sb = new Sys.StringBuilder(); + if (queryString) { + for (arg in queryString) { + obj = queryString[arg]; + if (typeof(obj) === "function") continue; + val = Sys.Serialization.JavaScriptSerializer.serialize(obj); + if (i++) { + sb.append('&'); + } + sb.append(arg); + sb.append('='); + sb.append(encodeMethod(val)); + } + } + if (addParams) { + if (i) { + sb.append('&'); + } + sb.append(addParams); + } + return sb.toString(); +} +Sys.Net.WebRequest._createUrl = function Sys$Net$WebRequest$_createUrl(url, queryString, addParams) { + if (!queryString && !addParams) { + return url; + } + var qs = Sys.Net.WebRequest._createQueryString(queryString, null, addParams); + return qs.length + ? url + ((url && url.indexOf('?') >= 0) ? "&" : "?") + qs + : url; +} +Sys.Net.WebRequest.registerClass('Sys.Net.WebRequest'); + +Sys._ScriptLoaderTask = function Sys$_ScriptLoaderTask(scriptElement, completedCallback) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "scriptElement", domElement: true}, + {name: "completedCallback", type: Function} + ]); + if (e) throw e; + this._scriptElement = scriptElement; + this._completedCallback = completedCallback; +} + function Sys$_ScriptLoaderTask$get_scriptElement() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._scriptElement; + } + function Sys$_ScriptLoaderTask$dispose() { + if(this._disposed) { + return; + } + this._disposed = true; + this._removeScriptElementHandlers(); + Sys._ScriptLoaderTask._clearScript(this._scriptElement); + this._scriptElement = null; + } + function Sys$_ScriptLoaderTask$execute() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._addScriptElementHandlers(); + var headElements = document.getElementsByTagName('head'); + if (headElements.length === 0) { + throw new Error.invalidOperation(Sys.Res.scriptLoadFailedNoHead); + } + else { + headElements[0].appendChild(this._scriptElement); + } + } + function Sys$_ScriptLoaderTask$_addScriptElementHandlers() { + this._scriptLoadDelegate = Function.createDelegate(this, this._scriptLoadHandler); + + if (Sys.Browser.agent !== Sys.Browser.InternetExplorer) { + this._scriptElement.readyState = 'loaded'; + $addHandler(this._scriptElement, 'load', this._scriptLoadDelegate); + } + else { + $addHandler(this._scriptElement, 'readystatechange', this._scriptLoadDelegate); + } + if (this._scriptElement.addEventListener) { + this._scriptErrorDelegate = Function.createDelegate(this, this._scriptErrorHandler); + this._scriptElement.addEventListener('error', this._scriptErrorDelegate, false); + } + } + function Sys$_ScriptLoaderTask$_removeScriptElementHandlers() { + if(this._scriptLoadDelegate) { + var scriptElement = this.get_scriptElement(); + if (Sys.Browser.agent !== Sys.Browser.InternetExplorer) { + $removeHandler(scriptElement, 'load', this._scriptLoadDelegate); + } + else { + $removeHandler(scriptElement, 'readystatechange', this._scriptLoadDelegate); + } + if (this._scriptErrorDelegate) { + this._scriptElement.removeEventListener('error', this._scriptErrorDelegate, false); + this._scriptErrorDelegate = null; + } + this._scriptLoadDelegate = null; + } + } + function Sys$_ScriptLoaderTask$_scriptErrorHandler() { + if(this._disposed) { + return; + } + + this._completedCallback(this.get_scriptElement(), false); + } + function Sys$_ScriptLoaderTask$_scriptLoadHandler() { + if(this._disposed) { + return; + } + var scriptElement = this.get_scriptElement(); + if ((scriptElement.readyState !== 'loaded') && + (scriptElement.readyState !== 'complete')) { + return; + } + + this._completedCallback(scriptElement, true); + } +Sys._ScriptLoaderTask.prototype = { + get_scriptElement: Sys$_ScriptLoaderTask$get_scriptElement, + dispose: Sys$_ScriptLoaderTask$dispose, + execute: Sys$_ScriptLoaderTask$execute, + _addScriptElementHandlers: Sys$_ScriptLoaderTask$_addScriptElementHandlers, + _removeScriptElementHandlers: Sys$_ScriptLoaderTask$_removeScriptElementHandlers, + _scriptErrorHandler: Sys$_ScriptLoaderTask$_scriptErrorHandler, + _scriptLoadHandler: Sys$_ScriptLoaderTask$_scriptLoadHandler +} +Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask", null, Sys.IDisposable); +Sys._ScriptLoaderTask._clearScript = function Sys$_ScriptLoaderTask$_clearScript(scriptElement) { + if (!Sys.Debug.isDebug) { + scriptElement.parentNode.removeChild(scriptElement); + } +} +Type.registerNamespace('Sys.Net'); + +Sys.Net.WebServiceProxy = function Sys$Net$WebServiceProxy() { +} + function Sys$Net$WebServiceProxy$get_timeout() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._timeout || 0; + } + function Sys$Net$WebServiceProxy$set_timeout(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Number}]); + if (e) throw e; + if (value < 0) { throw Error.argumentOutOfRange('value', value, Sys.Res.invalidTimeout); } + this._timeout = value; + } + function Sys$Net$WebServiceProxy$get_defaultUserContext() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return (typeof(this._userContext) === "undefined") ? null : this._userContext; + } + function Sys$Net$WebServiceProxy$set_defaultUserContext(value) { + var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]); + if (e) throw e; + this._userContext = value; + } + function Sys$Net$WebServiceProxy$get_defaultSucceededCallback() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._succeeded || null; + } + function Sys$Net$WebServiceProxy$set_defaultSucceededCallback(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]); + if (e) throw e; + this._succeeded = value; + } + function Sys$Net$WebServiceProxy$get_defaultFailedCallback() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._failed || null; + } + function Sys$Net$WebServiceProxy$set_defaultFailedCallback(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]); + if (e) throw e; + this._failed = value; + } + function Sys$Net$WebServiceProxy$get_enableJsonp() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return !!this._jsonp; + } + function Sys$Net$WebServiceProxy$set_enableJsonp(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]); + if (e) throw e; + this._jsonp = value; + } + function Sys$Net$WebServiceProxy$get_path() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._path || null; + } + function Sys$Net$WebServiceProxy$set_path(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + this._path = value; + } + function Sys$Net$WebServiceProxy$get_jsonpCallbackParameter() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._callbackParameter || "callback"; + } + function Sys$Net$WebServiceProxy$set_jsonpCallbackParameter(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + this._callbackParameter = value; + } + function Sys$Net$WebServiceProxy$_invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "servicePath", type: String}, + {name: "methodName", type: String}, + {name: "useGet", type: Boolean}, + {name: "params"}, + {name: "onSuccess", type: Function, mayBeNull: true, optional: true}, + {name: "onFailure", type: Function, mayBeNull: true, optional: true}, + {name: "userContext", mayBeNull: true, optional: true} + ]); + if (e) throw e; + onSuccess = onSuccess || this.get_defaultSucceededCallback(); + onFailure = onFailure || this.get_defaultFailedCallback(); + if (userContext === null || typeof userContext === 'undefined') userContext = this.get_defaultUserContext(); + return Sys.Net.WebServiceProxy.invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext, this.get_timeout(), this.get_enableJsonp(), this.get_jsonpCallbackParameter()); + } +Sys.Net.WebServiceProxy.prototype = { + get_timeout: Sys$Net$WebServiceProxy$get_timeout, + set_timeout: Sys$Net$WebServiceProxy$set_timeout, + get_defaultUserContext: Sys$Net$WebServiceProxy$get_defaultUserContext, + set_defaultUserContext: Sys$Net$WebServiceProxy$set_defaultUserContext, + get_defaultSucceededCallback: Sys$Net$WebServiceProxy$get_defaultSucceededCallback, + set_defaultSucceededCallback: Sys$Net$WebServiceProxy$set_defaultSucceededCallback, + get_defaultFailedCallback: Sys$Net$WebServiceProxy$get_defaultFailedCallback, + set_defaultFailedCallback: Sys$Net$WebServiceProxy$set_defaultFailedCallback, + get_enableJsonp: Sys$Net$WebServiceProxy$get_enableJsonp, + set_enableJsonp: Sys$Net$WebServiceProxy$set_enableJsonp, + get_path: Sys$Net$WebServiceProxy$get_path, + set_path: Sys$Net$WebServiceProxy$set_path, + get_jsonpCallbackParameter: Sys$Net$WebServiceProxy$get_jsonpCallbackParameter, + set_jsonpCallbackParameter: Sys$Net$WebServiceProxy$set_jsonpCallbackParameter, + _invoke: Sys$Net$WebServiceProxy$_invoke +} +Sys.Net.WebServiceProxy.registerClass('Sys.Net.WebServiceProxy'); +Sys.Net.WebServiceProxy.invoke = function Sys$Net$WebServiceProxy$invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext, timeout, enableJsonp, jsonpCallbackParameter) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "servicePath", type: String}, + {name: "methodName", type: String, mayBeNull: true, optional: true}, + {name: "useGet", type: Boolean, optional: true}, + {name: "params", mayBeNull: true, optional: true}, + {name: "onSuccess", type: Function, mayBeNull: true, optional: true}, + {name: "onFailure", type: Function, mayBeNull: true, optional: true}, + {name: "userContext", mayBeNull: true, optional: true}, + {name: "timeout", type: Number, optional: true}, + {name: "enableJsonp", type: Boolean, mayBeNull: true, optional: true}, + {name: "jsonpCallbackParameter", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var schemeHost = (enableJsonp !== false) ? Sys.Net.WebServiceProxy._xdomain.exec(servicePath) : null, + tempCallback, jsonp = schemeHost && (schemeHost.length === 3) && + ((schemeHost[1] !== location.protocol) || (schemeHost[2] !== location.host)); + useGet = jsonp || useGet; + if (jsonp) { + jsonpCallbackParameter = jsonpCallbackParameter || "callback"; + tempCallback = "_jsonp" + Sys._jsonp++; + } + if (!params) params = {}; + var urlParams = params; + if (!useGet || !urlParams) urlParams = {}; + var script, error, timeoutcookie = null, loader, body = null, + url = Sys.Net.WebRequest._createUrl(methodName + ? (servicePath+"/"+encodeURIComponent(methodName)) + : servicePath, urlParams, jsonp ? (jsonpCallbackParameter + "=Sys." + tempCallback) : null); + if (jsonp) { + script = document.createElement("script"); + script.src = url; + loader = new Sys._ScriptLoaderTask(script, function(script, loaded) { + if (!loaded || tempCallback) { + jsonpComplete({ Message: String.format(Sys.Res.webServiceFailedNoMsg, methodName) }, -1); + } + }); + function jsonpComplete(data, statusCode) { + if (timeoutcookie !== null) { + window.clearTimeout(timeoutcookie); + timeoutcookie = null; + } + loader.dispose(); + delete Sys[tempCallback]; + tempCallback = null; + if ((typeof(statusCode) !== "undefined") && (statusCode !== 200)) { + if (onFailure) { + error = new Sys.Net.WebServiceError(false, + data.Message || String.format(Sys.Res.webServiceFailedNoMsg, methodName), + data.StackTrace || null, + data.ExceptionType || null, + data); + error._statusCode = statusCode; + onFailure(error, userContext, methodName); + } + else { + if (data.StackTrace && data.Message) { + error = data.StackTrace + "-- " + data.Message; + } + else { + error = data.StackTrace || data.Message; + } + error = String.format(error ? Sys.Res.webServiceFailed : Sys.Res.webServiceFailedNoMsg, methodName, error); + throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceFailed, methodName, error)); + } + } + else if (onSuccess) { + onSuccess(data, userContext, methodName); + } + } + Sys[tempCallback] = jsonpComplete; + loader.execute(); + return null; + } + var request = new Sys.Net.WebRequest(); + request.set_url(url); + request.get_headers()['Content-Type'] = 'application/json; charset=utf-8'; + if (!useGet) { + body = Sys.Serialization.JavaScriptSerializer.serialize(params); + if (body === "{}") body = ""; + } + request.set_body(body); + request.add_completed(onComplete); + if (timeout && timeout > 0) request.set_timeout(timeout); + request.invoke(); + + function onComplete(response, eventArgs) { + if (response.get_responseAvailable()) { + var statusCode = response.get_statusCode(); + var result = null; + + try { + var contentType = response.getResponseHeader("Content-Type"); + if (contentType.startsWith("application/json")) { + result = response.get_object(); + } + else if (contentType.startsWith("text/xml")) { + result = response.get_xml(); + } + else { + result = response.get_responseData(); + } + } catch (ex) { + } + var error = response.getResponseHeader("jsonerror"); + var errorObj = (error === "true"); + if (errorObj) { + if (result) { + result = new Sys.Net.WebServiceError(false, result.Message, result.StackTrace, result.ExceptionType, result); + } + } + else if (contentType.startsWith("application/json")) { + result = (!result || (typeof(result.d) === "undefined")) ? result : result.d; + } + if (((statusCode < 200) || (statusCode >= 300)) || errorObj) { + if (onFailure) { + if (!result || !errorObj) { + result = new Sys.Net.WebServiceError(false , String.format(Sys.Res.webServiceFailedNoMsg, methodName)); + } + result._statusCode = statusCode; + onFailure(result, userContext, methodName); + } + else { + if (result && errorObj) { + error = result.get_exceptionType() + "-- " + result.get_message(); + } + else { + error = response.get_responseData(); + } + throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceFailed, methodName, error)); + } + } + else if (onSuccess) { + onSuccess(result, userContext, methodName); + } + } + else { + var msg; + if (response.get_timedOut()) { + msg = String.format(Sys.Res.webServiceTimedOut, methodName); + } + else { + msg = String.format(Sys.Res.webServiceFailedNoMsg, methodName) + } + if (onFailure) { + onFailure(new Sys.Net.WebServiceError(response.get_timedOut(), msg, "", ""), userContext, methodName); + } + else { + throw Sys.Net.WebServiceProxy._createFailedError(methodName, msg); + } + } + } + return request; +} +Sys.Net.WebServiceProxy._createFailedError = function Sys$Net$WebServiceProxy$_createFailedError(methodName, errorMessage) { + var displayMessage = "Sys.Net.WebServiceFailedException: " + errorMessage; + var e = Error.create(displayMessage, { 'name': 'Sys.Net.WebServiceFailedException', 'methodName': methodName }); + e.popStackFrame(); + return e; +} +Sys.Net.WebServiceProxy._defaultFailedCallback = function Sys$Net$WebServiceProxy$_defaultFailedCallback(err, methodName) { + var error = err.get_exceptionType() + "-- " + err.get_message(); + throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceFailed, methodName, error)); +} +Sys.Net.WebServiceProxy._generateTypedConstructor = function Sys$Net$WebServiceProxy$_generateTypedConstructor(type) { + return function(properties) { + if (properties) { + for (var name in properties) { + this[name] = properties[name]; + } + } + this.__type = type; + } +} +Sys._jsonp = 0; +Sys.Net.WebServiceProxy._xdomain = /^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/; + +Sys.Net.WebServiceError = function Sys$Net$WebServiceError(timedOut, message, stackTrace, exceptionType, errorObject) { + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "timedOut", type: Boolean}, + {name: "message", type: String, mayBeNull: true}, + {name: "stackTrace", type: String, mayBeNull: true, optional: true}, + {name: "exceptionType", type: String, mayBeNull: true, optional: true}, + {name: "errorObject", type: Object, mayBeNull: true, optional: true} + ]); + if (e) throw e; + this._timedOut = timedOut; + this._message = message; + this._stackTrace = stackTrace; + this._exceptionType = exceptionType; + this._errorObject = errorObject; + this._statusCode = -1; +} + function Sys$Net$WebServiceError$get_timedOut() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._timedOut; + } + function Sys$Net$WebServiceError$get_statusCode() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._statusCode; + } + function Sys$Net$WebServiceError$get_message() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._message; + } + function Sys$Net$WebServiceError$get_stackTrace() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._stackTrace || ""; + } + function Sys$Net$WebServiceError$get_exceptionType() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._exceptionType || ""; + } + function Sys$Net$WebServiceError$get_errorObject() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._errorObject || null; + } +Sys.Net.WebServiceError.prototype = { + get_timedOut: Sys$Net$WebServiceError$get_timedOut, + get_statusCode: Sys$Net$WebServiceError$get_statusCode, + get_message: Sys$Net$WebServiceError$get_message, + get_stackTrace: Sys$Net$WebServiceError$get_stackTrace, + get_exceptionType: Sys$Net$WebServiceError$get_exceptionType, + get_errorObject: Sys$Net$WebServiceError$get_errorObject +} +Sys.Net.WebServiceError.registerClass('Sys.Net.WebServiceError'); + + +Type.registerNamespace('Sys'); + +Sys.Res={ +'urlMustBeLessThan1024chars':'The history state must be small enough to not make the url larger than 1024 characters.', +'argumentTypeName':'Value is not the name of an existing type.', +'cantBeCalledAfterDispose':'Can\'t be called after dispose.', +'componentCantSetIdAfterAddedToApp':'The id property of a component can\'t be set after it\'s been added to the Application object.', +'behaviorDuplicateName':'A behavior with name \'{0}\' already exists or it is the name of an existing property on the target element.', +'notATypeName':'Value is not a valid type name.', +'elementNotFound':'An element with id \'{0}\' could not be found.', +'stateMustBeStringDictionary':'The state object can only have null and string fields.', +'boolTrueOrFalse':'Value must be \'true\' or \'false\'.', +'scriptLoadFailedNoHead':'ScriptLoader requires pages to contain a element.', +'stringFormatInvalid':'The format string is invalid.', +'referenceNotFound':'Component \'{0}\' was not found.', +'enumReservedName':'\'{0}\' is a reserved name that can\'t be used as an enum value name.', +'circularParentChain':'The chain of control parents can\'t have circular references.', +'namespaceContainsNonObject':'Object {0} already exists and is not an object.', +'undefinedEvent':'\'{0}\' is not an event.', +'propertyUndefined':'\'{0}\' is not a property or an existing field.', +'observableConflict':'Object already contains a member with the name \'{0}\'.', +'historyCannotEnableHistory':'Cannot set enableHistory after initialization.', +'eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.', +'scriptLoadFailedDebug':'The script \'{0}\' failed to load. Check for:\r\n Inaccessible path.\r\n Script errors. (IE) Enable \'Display a notification about every script error\' under advanced settings.', +'propertyNotWritable':'\'{0}\' is not a writable property.', +'enumInvalidValueName':'\'{0}\' is not a valid name for an enum value.', +'controlAlreadyDefined':'A control is already associated with the element.', +'addHandlerCantBeUsedForError':'Can\'t add a handler for the error event using this method. Please set the window.onerror property instead.', +'cantAddNonFunctionhandler':'Can\'t add a handler that is not a function.', +'invalidNameSpace':'Value is not a valid namespace identifier.', +'notAnInterface':'Value is not a valid interface.', +'eventHandlerNotFunction':'Handler must be a function.', +'propertyNotAnArray':'\'{0}\' is not an Array property.', +'namespaceContainsClass':'Object {0} already exists as a class, enum, or interface.', +'typeRegisteredTwice':'Type {0} has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.', +'cantSetNameAfterInit':'The name property can\'t be set on this object after initialization.', +'historyMissingFrame':'For the history feature to work in IE, the page must have an iFrame element with id \'__historyFrame\' pointed to a page that gets its title from the \'title\' query string parameter and calls Sys.Application._onIFrameLoad() on the parent window. This can be done by setting EnableHistory to true on ScriptManager.', +'appDuplicateComponent':'Two components with the same id \'{0}\' can\'t be added to the application.', +'historyCannotAddHistoryPointWithHistoryDisabled':'A history point can only be added if enableHistory is set to true.', +'baseNotAClass':'Value is not a class.', +'expectedElementOrId':'Value must be a DOM element or DOM element Id.', +'methodNotFound':'No method found with name \'{0}\'.', +'arrayParseBadFormat':'Value must be a valid string representation for an array. It must start with a \'[\' and end with a \']\'.', +'stateFieldNameInvalid':'State field names must not contain any \'=\' characters.', +'cantSetId':'The id property can\'t be set on this object.', +'stringFormatBraceMismatch':'The format string contains an unmatched opening or closing brace.', +'enumValueNotInteger':'An enumeration definition can only contain integer values.', +'propertyNullOrUndefined':'Cannot set the properties of \'{0}\' because it returned a null value.', +'argumentDomNode':'Value must be a DOM element or a text node.', +'componentCantSetIdTwice':'The id property of a component can\'t be set more than once.', +'createComponentOnDom':'Value must be null for Components that are not Controls or Behaviors.', +'createNotComponent':'{0} does not derive from Sys.Component.', +'createNoDom':'Value must not be null for Controls and Behaviors.', +'cantAddWithoutId':'Can\'t add a component that doesn\'t have an id.', +'notObservable':'Instances of type \'{0}\' cannot be observed.', +'badTypeName':'Value is not the name of the type being registered or the name is a reserved word.', +'argumentInteger':'Value must be an integer.', +'invokeCalledTwice':'Cannot call invoke more than once.', +'webServiceFailed':'The server method \'{0}\' failed with the following error: {1}', +'argumentType':'Object cannot be converted to the required type.', +'argumentNull':'Value cannot be null.', +'scriptAlreadyLoaded':'The script \'{0}\' has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.', +'scriptDependencyNotFound':'The script \'{0}\' failed to load because it is dependent on script \'{1}\'.', +'formatBadFormatSpecifier':'Format specifier was invalid.', +'requiredScriptReferenceNotIncluded':'\'{0}\' requires that you have included a script reference to \'{1}\'.', +'webServiceFailedNoMsg':'The server method \'{0}\' failed.', +'argumentDomElement':'Value must be a DOM element.', +'invalidExecutorType':'Could not create a valid Sys.Net.WebRequestExecutor from: {0}.', +'cannotCallBeforeResponse':'Cannot call {0} when responseAvailable is false.', +'actualValue':'Actual value was {0}.', +'enumInvalidValue':'\'{0}\' is not a valid value for enum {1}.', +'scriptLoadFailed':'The script \'{0}\' could not be loaded.', +'parameterCount':'Parameter count mismatch.', +'cannotDeserializeEmptyString':'Cannot deserialize empty string.', +'formatInvalidString':'Input string was not in a correct format.', +'invalidTimeout':'Value must be greater than or equal to zero.', +'cannotAbortBeforeStart':'Cannot abort when executor has not started.', +'argument':'Value does not fall within the expected range.', +'cannotDeserializeInvalidJson':'Cannot deserialize. The data does not correspond to valid JSON.', +'invalidHttpVerb':'httpVerb cannot be set to an empty or null string.', +'nullWebRequest':'Cannot call executeRequest with a null webRequest.', +'eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.', +'cannotSerializeNonFiniteNumbers':'Cannot serialize non finite numbers.', +'argumentUndefined':'Value cannot be undefined.', +'webServiceInvalidReturnType':'The server method \'{0}\' returned an invalid type. Expected type: {1}', +'servicePathNotSet':'The path to the web service has not been set.', +'argumentTypeWithTypes':'Object of type \'{0}\' cannot be converted to type \'{1}\'.', +'cannotCallOnceStarted':'Cannot call {0} once started.', +'badBaseUrl1':'Base URL does not contain ://.', +'badBaseUrl2':'Base URL does not contain another /.', +'badBaseUrl3':'Cannot find last / in base URL.', +'setExecutorAfterActive':'Cannot set executor after it has become active.', +'paramName':'Parameter name: {0}', +'nullReferenceInPath':'Null reference while evaluating data path: \'{0}\'.', +'cannotCallOutsideHandler':'Cannot call {0} outside of a completed event handler.', +'cannotSerializeObjectWithCycle':'Cannot serialize object with cyclic reference within child properties.', +'format':'One of the identified items was in an invalid format.', +'assertFailedCaller':'Assertion Failed: {0}\r\nat {1}', +'argumentOutOfRange':'Specified argument was out of the range of valid values.', +'webServiceTimedOut':'The server method \'{0}\' timed out.', +'notImplemented':'The method or operation is not implemented.', +'assertFailed':'Assertion Failed: {0}', +'invalidOperation':'Operation is not valid due to the current state of the object.', +'breakIntoDebugger':'{0}\r\n\r\nBreak into debugger?' +}; diff --git a/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftAjax.js b/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftAjax.js new file mode 100644 index 00000000000..52e6626a072 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftAjax.js @@ -0,0 +1,6 @@ +//---------------------------------------------------------- +// Copyright (C) Microsoft Corporation. All rights reserved. +//---------------------------------------------------------- +// MicrosoftAjax.js +Function.__typeName="Function";Function.__class=true;Function.createCallback=function(b,a){return function(){var e=arguments.length;if(e>0){var d=[];for(var c=0;c=d)break;a=Function._validateParameter(g[b],f,h);if(a){a.popStackFrame();return a}}return null};Function._validateParameterCount=function(j,d,i){var a,c,b=d.length,e=j.length;if(eb){c=true;for(a=0;a0&&(d=0};Array.dequeue=function(a){return a.shift()};Array.forEach=function(b,e,d){for(var a=0,f=b.length;a=0)b.splice(a,1);return a>=0};Array.removeAt=function(a,b){a.splice(b,1)};Sys._indexOf=function(d,e,a){if(typeof e==="undefined")return -1;var c=d.length;if(c!==0){a=a-0;if(isNaN(a))a=0;else{if(isFinite(a))a=a-a%1;if(a<0)a=Math.max(0,c+a)}for(var b=a;b-1){Sys.Browser.agent=Sys.Browser.InternetExplorer;Sys.Browser.version=parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);if(Sys.Browser.version>=8)if(document.documentMode>=7)Sys.Browser.documentMode=document.documentMode;Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" Firefox/")>-1){Sys.Browser.agent=Sys.Browser.Firefox;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);Sys.Browser.name="Firefox";Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" AppleWebKit/")>-1){Sys.Browser.agent=Sys.Browser.Safari;Sys.Browser.version=parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+(\.\d+)?)/)[1]);Sys.Browser.name="Safari"}else if(navigator.userAgent.indexOf("Opera/")>-1)Sys.Browser.agent=Sys.Browser.Opera;Sys.EventArgs=function(){};Sys.EventArgs.registerClass("Sys.EventArgs");Sys.EventArgs.Empty=new Sys.EventArgs;Sys.CancelEventArgs=function(){Sys.CancelEventArgs.initializeBase(this);this._cancel=false};Sys.CancelEventArgs.prototype={get_cancel:function(){return this._cancel},set_cancel:function(a){this._cancel=a}};Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs",Sys.EventArgs);Type.registerNamespace("Sys.UI");Sys._Debug=function(){};Sys._Debug.prototype={_appendConsole:function(a){if(typeof Debug!=="undefined"&&Debug.writeln)Debug.writeln(a);if(window.console&&window.console.log)window.console.log(a);if(window.opera)window.opera.postError(a);if(window.debugService)window.debugService.trace(a)},_appendTrace:function(b){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value+=b+"\n"},assert:function(c,a,b){if(!c){a=b&&this.assert.caller?String.format(Sys.Res.assertFailedCaller,a,this.assert.caller):String.format(Sys.Res.assertFailed,a);if(confirm(String.format(Sys.Res.breakIntoDebugger,a)))this.fail(a)}},clearTrace:function(){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value=""},fail:function(message){this._appendConsole(message);if(Sys.Browser.hasDebuggerStatement)eval("debugger")},trace:function(a){this._appendConsole(a);this._appendTrace(a)},traceDump:function(a,b){var c=this._traceDump(a,b,true)},_traceDump:function(a,c,f,b,d){c=c?c:"traceDump";b=b?b:"";if(a===null){this.trace(b+c+": null");return}switch(typeof a){case "undefined":this.trace(b+c+": Undefined");break;case "number":case "string":case "boolean":this.trace(b+c+": "+a);break;default:if(Date.isInstanceOfType(a)||RegExp.isInstanceOfType(a)){this.trace(b+c+": "+a.toString());break}if(!d)d=[];else if(Array.contains(d,a)){this.trace(b+c+": ...");return}Array.add(d,a);if(a==window||a===document||window.HTMLElement&&a instanceof HTMLElement||typeof a.nodeName==="string"){var k=a.tagName?a.tagName:"DomElement";if(a.id)k+=" - "+a.id;this.trace(b+c+" {"+k+"}")}else{var i=Object.getTypeName(a);this.trace(b+c+(typeof i==="string"?" {"+i+"}":""));if(b===""||f){b+=" ";var e,j,l,g,h;if(Array.isInstanceOfType(a)){j=a.length;for(e=0;e=0;d--){var k=h[d].trim();b=a[k];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c.split(",")[d].trim(),this.__typeName));j|=b}return j}}function Sys$Enum$toString(c){if(typeof c==="undefined"||c===null)return this.__string;var d=this.prototype,a;if(!this.__flags||c===0){for(a in d)if(d[a]===c)return a}else{var b=this.__sortedValues;if(!b){b=[];for(a in d)b[b.length]={key:a,value:d[a]};b.sort(function(a,b){return a.value-b.value});this.__sortedValues=b}var e=[],g=c;for(a=b.length-1;a>=0;a--){var h=b[a],f=h.value;if(f===0)continue;if((f&c)===f){e[e.length]=h.key;g-=f;if(g===0)break}}if(e.length&&g===0)return e.reverse().join(", ")}return ""}Type.prototype.registerEnum=function(b,c){Sys.__upperCaseTypes[b.toUpperCase()]=this;for(var a in this.prototype)this[a]=this.prototype[a];this.__typeName=b;this.parse=Sys$Enum$parse;this.__string=this.toString();this.toString=Sys$Enum$toString;this.__flags=c;this.__enum=true};Type.isEnum=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__enum};Type.isFlags=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__flags};Sys.CollectionChange=function(e,a,c,b,d){this.action=e;if(a)if(!(a instanceof Array))a=[a];this.newItems=a||null;if(typeof c!=="number")c=-1;this.newStartingIndex=c;if(b)if(!(b instanceof Array))b=[b];this.oldItems=b||null;if(typeof d!=="number")d=-1;this.oldStartingIndex=d};Sys.CollectionChange.registerClass("Sys.CollectionChange");Sys.NotifyCollectionChangedAction=function(){throw Error.notImplemented()};Sys.NotifyCollectionChangedAction.prototype={add:0,remove:1,reset:2};Sys.NotifyCollectionChangedAction.registerEnum("Sys.NotifyCollectionChangedAction");Sys.NotifyCollectionChangedEventArgs=function(a){this._changes=a;Sys.NotifyCollectionChangedEventArgs.initializeBase(this)};Sys.NotifyCollectionChangedEventArgs.prototype={get_changes:function(){return this._changes||[]}};Sys.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs",Sys.EventArgs);Sys.Observer=function(){};Sys.Observer.registerClass("Sys.Observer");Sys.Observer.makeObservable=function(a){var c=a instanceof Array,b=Sys.Observer;if(a.setValue===b._observeMethods.setValue)return a;b._addMethods(a,b._observeMethods);if(c)b._addMethods(a,b._arrayMethods);return a};Sys.Observer._addMethods=function(c,b){for(var a in b)c[a]=b[a]};Sys.Observer._addEventHandler=function(c,a,b){Sys.Observer._getContext(c,true).events._addHandler(a,b)};Sys.Observer.addEventHandler=function(c,a,b){Sys.Observer._addEventHandler(c,a,b)};Sys.Observer._removeEventHandler=function(c,a,b){Sys.Observer._getContext(c,true).events._removeHandler(a,b)};Sys.Observer.removeEventHandler=function(c,a,b){Sys.Observer._removeEventHandler(c,a,b)};Sys.Observer.raiseEvent=function(b,e,d){var c=Sys.Observer._getContext(b);if(!c)return;var a=c.events.getHandler(e);if(a)a(b,d)};Sys.Observer.addPropertyChanged=function(b,a){Sys.Observer._addEventHandler(b,"propertyChanged",a)};Sys.Observer.removePropertyChanged=function(b,a){Sys.Observer._removeEventHandler(b,"propertyChanged",a)};Sys.Observer.beginUpdate=function(a){Sys.Observer._getContext(a,true).updating=true};Sys.Observer.endUpdate=function(b){var a=Sys.Observer._getContext(b);if(!a||!a.updating)return;a.updating=false;var d=a.dirty;a.dirty=false;if(d){if(b instanceof Array){var c=a.changes;a.changes=null;Sys.Observer.raiseCollectionChanged(b,c)}Sys.Observer.raisePropertyChanged(b,"")}};Sys.Observer.isUpdating=function(b){var a=Sys.Observer._getContext(b);return a?a.updating:false};Sys.Observer._setValue=function(a,j,g){var b,f,k=a,d=j.split(".");for(var i=0,m=d.length-1;i-1&&ac.Calendar.TwoDigitYearMax)a-=100}return a};Date._getEra=function(e,c){if(!c)return 0;var b,d=e.getTime();for(var a=0,f=c.length;a=b)return a}return 0};Date._getEraYear=function(d,b,e,c){var a=d.getFullYear();if(!c&&b.eras)a-=b.eras[e+3];return a};Date._getParseRegExp=function(b,e){if(!b._parseRegExp)b._parseRegExp={};else if(b._parseRegExp[e])return b._parseRegExp[e];var c=Date._expandFormat(b,e);c=c.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");var a=new Sys.StringBuilder("^"),j=[],f=0,i=0,h=Date._getTokenRegExp(),d;while((d=h.exec(c))!==null){var l=c.slice(f,d.index);f=h.lastIndex;i+=Date._appendPreOrPostMatch(l,a);if(i%2===1){a.append(d[0]);continue}switch(d[0]){case "dddd":case "ddd":case "MMMM":case "MMM":case "gg":case "g":a.append("(\\D+)");break;case "tt":case "t":a.append("(\\D*)");break;case "yyyy":a.append("(\\d{4})");break;case "fff":a.append("(\\d{3})");break;case "ff":a.append("(\\d{2})");break;case "f":a.append("(\\d)");break;case "dd":case "d":case "MM":case "M":case "yy":case "y":case "HH":case "H":case "hh":case "h":case "mm":case "m":case "ss":case "s":a.append("(\\d\\d?)");break;case "zzz":a.append("([+-]?\\d\\d?:\\d{2})");break;case "zz":case "z":a.append("([+-]?\\d\\d?)");break;case "/":a.append("(\\"+b.DateSeparator+")")}Array.add(j,d[0])}Date._appendPreOrPostMatch(c.slice(f),a);a.append("$");var k=a.toString().replace(/\s+/g,"\\s+"),g={"regExp":k,"groups":j};b._parseRegExp[e]=g;return g};Date._getTokenRegExp=function(){return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g};Date.parseLocale=function(a){return Date._parse(a,Sys.CultureInfo.CurrentCulture,arguments)};Date.parseInvariant=function(a){return Date._parse(a,Sys.CultureInfo.InvariantCulture,arguments)};Date._parse=function(h,d,i){var a,c,b,f,e,g=false;for(a=1,c=i.length;a31)return null;break;case "MMMM":c=k._getMonthIndex(a);if(c<0||c>11)return null;break;case "MMM":c=k._getAbbrMonthIndex(a);if(c<0||c>11)return null;break;case "M":case "MM":c=parseInt(a,10)-1;if(c<0||c>11)return null;break;case "y":case "yy":e=Date._expandYear(g,parseInt(a,10));if(e<0||e>9999)return null;break;case "yyyy":e=parseInt(a,10);if(e<0||e>9999)return null;break;case "h":case "hh":d=parseInt(a,10);if(d===12)d=0;if(d<0||d>11)return null;break;case "H":case "HH":d=parseInt(a,10);if(d<0||d>23)return null;break;case "m":case "mm":q=parseInt(a,10);if(q<0||q>59)return null;break;case "s":case "ss":r=parseInt(a,10);if(r<0||r>59)return null;break;case "tt":case "t":var z=a.toUpperCase();v=z===g.PMDesignator.toUpperCase();if(!v&&z!==g.AMDesignator.toUpperCase())return null;break;case "f":f=parseInt(a,10)*100;if(f<0||f>999)return null;break;case "ff":f=parseInt(a,10)*10;if(f<0||f>999)return null;break;case "fff":f=parseInt(a,10);if(f<0||f>999)return null;break;case "dddd":i=k._getDayIndex(a);if(i<0||i>6)return null;break;case "ddd":i=k._getAbbrDayIndex(a);if(i<0||i>6)return null;break;case "zzz":var u=a.split(/:/);if(u.length!==2)return null;h=parseInt(u[0],10);if(h<-12||h>13)return null;var o=parseInt(u[1],10);if(o<0||o>59)return null;n=h*60+(a.startsWith("-")?-o:o);break;case "z":case "zz":h=parseInt(a,10);if(h<-12||h>13)return null;n=h*60;break;case "g":case "gg":var p=a;if(!p||!g.eras)return null;p=p.toLowerCase().trim();for(var s=0,F=g.eras.length;s0)return this.toLocaleString();else return this.toString();var o=["n %","n%","%n"],n=["-n %","-n%","-%n"],p=["(n)","-n","- n","n-","n -"],m=["$n","n$","$ n","n $"],l=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"];function g(a,c,d){for(var b=a.length;b1?parseInt(e[1]):0;e=b.split(".");b=e[0];a=e.length>1?e[1]:"";var q;if(c>0){a=g(a,c,false);b+=a.slice(0,c);a=a.substr(c)}else if(c<0){c=-c;b=g(b,c+1,true);a=b.slice(-c,b.length)+a;b=b.slice(0,-c)}if(i>0){if(a.length>i)a=a.slice(0,i);else a=g(a,i,false);a=p+a}else a="";var d=b.length-1,f="";while(d>=0){if(h===0||h>d)if(f.length>0)return b.slice(0,d+1)+n+f+a;else return b.slice(0,d+1)+a;if(f.length>0)f=b.slice(d-h+1,d+1)+n+f;else f=b.slice(d-h+1,d+1);d-=h;if(k1)b=parseInt(e.slice(1),10);var c;switch(e.charAt(0)){case "d":case "D":c="n";if(b!==-1)d=g(""+d,b,true);if(this<0)d=-d;break;case "c":case "C":if(this<0)c=l[a.CurrencyNegativePattern];else c=m[a.CurrencyPositivePattern];if(b===-1)b=a.CurrencyDecimalDigits;d=i(Math.abs(this),b,a.CurrencyGroupSizes,a.CurrencyGroupSeparator,a.CurrencyDecimalSeparator);break;case "n":case "N":if(this<0)c=p[a.NumberNegativePattern];else c="n";if(b===-1)b=a.NumberDecimalDigits;d=i(Math.abs(this),b,a.NumberGroupSizes,a.NumberGroupSeparator,a.NumberDecimalSeparator);break;case "p":case "P":if(this<0)c=n[a.PercentNegativePattern];else c=o[a.PercentPositivePattern];if(b===-1)b=a.PercentDecimalDigits;d=i(Math.abs(this)*100,b,a.PercentGroupSizes,a.PercentGroupSeparator,a.PercentDecimalSeparator);break;default:throw Error.format(Sys.Res.formatBadFormatSpecifier)}var k=/n|\$|-|%/g,f="";for(;true;){var q=k.lastIndex,h=k.exec(c);f+=c.slice(q,h?h.index:c.length);if(!h)break;switch(h[0]){case "n":f+=d;break;case "$":f+=a.CurrencySymbol;break;case "-":if(/[1-9]/.test(d))f+=a.NegativeSign;break;case "%":f+=a.PercentSymbol}}return f};Sys.CultureInfo=function(c,b,a){this.name=c;this.numberFormat=b;this.dateTimeFormat=a};Sys.CultureInfo.prototype={_getDateTimeFormats:function(){if(!this._dateTimeFormats){var a=this.dateTimeFormat;this._dateTimeFormats=[a.MonthDayPattern,a.YearMonthPattern,a.ShortDatePattern,a.ShortTimePattern,a.LongDatePattern,a.LongTimePattern,a.FullDateTimePattern,a.RFC1123Pattern,a.SortableDateTimePattern,a.UniversalSortableDateTimePattern]}return this._dateTimeFormats},_getIndex:function(c,d,e){var b=this._toUpper(c),a=Array.indexOf(d,b);if(a===-1)a=Array.indexOf(e,b);return a},_getMonthIndex:function(a){if(!this._upperMonths){this._upperMonths=this._toUpperArray(this.dateTimeFormat.MonthNames);this._upperMonthsGenitive=this._toUpperArray(this.dateTimeFormat.MonthGenitiveNames)}return this._getIndex(a,this._upperMonths,this._upperMonthsGenitive)},_getAbbrMonthIndex:function(a){if(!this._upperAbbrMonths){this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);this._upperAbbrMonthsGenitive=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthGenitiveNames)}return this._getIndex(a,this._upperAbbrMonths,this._upperAbbrMonthsGenitive)},_getDayIndex:function(a){if(!this._upperDays)this._upperDays=this._toUpperArray(this.dateTimeFormat.DayNames);return Array.indexOf(this._upperDays,this._toUpper(a))},_getAbbrDayIndex:function(a){if(!this._upperAbbrDays)this._upperAbbrDays=this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);return Array.indexOf(this._upperAbbrDays,this._toUpper(a))},_toUpperArray:function(c){var b=[];for(var a=0,d=c.length;a0)a.append(",");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b[c],a,false,g)}a.append("]")}else{if(Date.isInstanceOfType(b)){a.append('"\\/Date(');a.append(b.getTime());a.append(')\\/"');break}var d=[],f=0;for(var e in b){if(e.startsWith("$"))continue;if(e===Sys.Serialization.JavaScriptSerializer._serverTypeFieldName&&f!==0){d[f++]=d[0];d[0]=e}else d[f++]=e}if(i)d.sort();a.append("{");var j=false;for(c=0;c=0;c--){var f=d[c];if(!g||f.autoRemove)$removeHandler(a,b,f.handler)}}a._events=null}};Sys.UI.DomEvent._disposeHandlers=function(){Sys.UI.DomEvent._clearHandlers(this,true);var b=this._chainDispose,a=typeof b;if(a!=="undefined"){this.dispose=b;this._chainDispose=null;if(a==="function")this.dispose()}};var $removeHandler=Sys.UI.DomEvent.removeHandler=function(b,a,c){Sys.UI.DomEvent._removeHandler(b,a,c)};Sys.UI.DomEvent._removeHandler=function(a,e,f){var d=null,c=a._events[e];for(var b=0,g=c.length;b=3){d+=parseInt(b.borderLeftWidth);e+=parseInt(b.borderTopWidth)}}b=Sys.UI.DomElement._getCurrentStyle(c);var h=b?b.position:null;if(!h||h!=="absolute")for(a=c.parentNode;a;a=a.parentNode){f=a.tagName?a.tagName.toUpperCase():null;if(f!=="BODY"&&f!=="HTML"&&(a.scrollLeft||a.scrollTop)){d-=a.scrollLeft||0;e-=a.scrollTop||0}b=Sys.UI.DomElement._getCurrentStyle(a);var i=b?b.position:null;if(i&&i==="absolute")break}return new Sys.UI.Point(d,e)};else Sys.UI.DomElement.getLocation=function(d){if(d.window&&d.window===d||d.nodeType===9)return new Sys.UI.Point(0,0);var e=0,f=0,a,i=null,g=null,b=null;for(a=d;a;i=a,(g=b,a=a.offsetParent)){var c=a.tagName?a.tagName.toUpperCase():null;b=Sys.UI.DomElement._getCurrentStyle(a);if((a.offsetLeft||a.offsetTop)&&!(c==="BODY"&&(!g||g.position!=="absolute"))){e+=a.offsetLeft;f+=a.offsetTop}if(i!==null&&b){if(c!=="TABLE"&&c!=="TD"&&c!=="HTML"){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}if(c==="TABLE"&&(b.position==="relative"||b.position==="absolute")){e+=parseInt(b.marginLeft)||0;f+=parseInt(b.marginTop)||0}}}b=Sys.UI.DomElement._getCurrentStyle(d);var h=b?b.position:null;if(!h||h!=="absolute")for(a=d.parentNode;a;a=a.parentNode){c=a.tagName?a.tagName.toUpperCase():null;if(c!=="BODY"&&c!=="HTML"&&(a.scrollLeft||a.scrollTop)){e-=a.scrollLeft||0;f-=a.scrollTop||0;b=Sys.UI.DomElement._getCurrentStyle(a);if(b){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}}}return new Sys.UI.Point(e,f)};Sys.UI.DomElement.isDomElement=function(a){return Sys._isDomElement(a)};Sys.UI.DomElement.removeCssClass=function(d,c){var a=" "+d.className+" ",b=a.indexOf(" "+c+" ");if(b>=0)d.className=(a.substr(0,b)+" "+a.substring(b+c.length+1,a.length)).trim()};Sys.UI.DomElement.resolveElement=function(b,c){var a=b;if(!a)return null;if(typeof a==="string")a=Sys.UI.DomElement.getElementById(a,c);return a};Sys.UI.DomElement.raiseBubbleEvent=function(c,d){var b=c;while(b){var a=b.control;if(a&&a.onBubbleEvent&&a.raiseBubbleEvent){Sys.UI.DomElement._raiseBubbleEventFromControl(a,c,d);return}b=b.parentNode}};Sys.UI.DomElement._raiseBubbleEventFromControl=function(a,b,c){if(!a.onBubbleEvent(b,c))a._raiseBubbleEvent(b,c)};Sys.UI.DomElement.setLocation=function(b,c,d){var a=b.style;a.position="absolute";a.left=c+"px";a.top=d+"px"};Sys.UI.DomElement.toggleCssClass=function(b,a){if(Sys.UI.DomElement.containsCssClass(b,a))Sys.UI.DomElement.removeCssClass(b,a);else Sys.UI.DomElement.addCssClass(b,a)};Sys.UI.DomElement.getVisibilityMode=function(a){return a._visibilityMode===Sys.UI.VisibilityMode.hide?Sys.UI.VisibilityMode.hide:Sys.UI.VisibilityMode.collapse};Sys.UI.DomElement.setVisibilityMode=function(a,b){Sys.UI.DomElement._ensureOldDisplayMode(a);if(a._visibilityMode!==b){a._visibilityMode=b;if(Sys.UI.DomElement.getVisible(a)===false)if(a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none";a._visibilityMode=b}};Sys.UI.DomElement.getVisible=function(b){var a=b.currentStyle||Sys.UI.DomElement._getCurrentStyle(b);if(!a)return true;return a.visibility!=="hidden"&&a.display!=="none"};Sys.UI.DomElement.setVisible=function(a,b){if(b!==Sys.UI.DomElement.getVisible(a)){Sys.UI.DomElement._ensureOldDisplayMode(a);a.style.visibility=b?"visible":"hidden";if(b||a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none"}};Sys.UI.DomElement._ensureOldDisplayMode=function(a){if(!a._oldDisplayMode){var b=a.currentStyle||Sys.UI.DomElement._getCurrentStyle(a);a._oldDisplayMode=b?b.display:null;if(!a._oldDisplayMode||a._oldDisplayMode==="none")switch(a.tagName.toUpperCase()){case "DIV":case "P":case "ADDRESS":case "BLOCKQUOTE":case "BODY":case "COL":case "COLGROUP":case "DD":case "DL":case "DT":case "FIELDSET":case "FORM":case "H1":case "H2":case "H3":case "H4":case "H5":case "H6":case "HR":case "IFRAME":case "LEGEND":case "OL":case "PRE":case "TABLE":case "TD":case "TH":case "TR":case "UL":a._oldDisplayMode="block";break;case "LI":a._oldDisplayMode="list-item";break;default:a._oldDisplayMode="inline"}}};Sys.UI.DomElement._getWindow=function(a){var b=a.ownerDocument||a.document||a;return b.defaultView||b.parentWindow};Sys.UI.DomElement._getCurrentStyle=function(a){if(a.nodeType===3)return null;var c=Sys.UI.DomElement._getWindow(a);if(a.documentElement)a=a.documentElement;var b=c&&a!==c&&c.getComputedStyle?c.getComputedStyle(a,null):a.currentStyle||a.style;if(!b&&Sys.Browser.agent===Sys.Browser.Safari&&a.style){var g=a.style.display,f=a.style.position;a.style.position="absolute";a.style.display="block";var e=c.getComputedStyle(a,null);a.style.display=g;a.style.position=f;b={};for(var d in e)b[d]=e[d];b.display="none"}return b};Sys.IContainer=function(){};Sys.IContainer.prototype={};Sys.IContainer.registerInterface("Sys.IContainer");Sys.ApplicationLoadEventArgs=function(b,a){Sys.ApplicationLoadEventArgs.initializeBase(this);this._components=b;this._isPartialLoad=a};Sys.ApplicationLoadEventArgs.prototype={get_components:function(){return this._components},get_isPartialLoad:function(){return this._isPartialLoad}};Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs",Sys.EventArgs);Sys._Application=function(){Sys._Application.initializeBase(this);this._disposableObjects=[];this._components={};this._createdComponents=[];this._secondPassComponents=[];this._unloadHandlerDelegate=Function.createDelegate(this,this._unloadHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._unloadHandlerDelegate);this._domReady()};Sys._Application.prototype={_creatingComponents:false,_disposing:false,_deleteCount:0,get_isCreatingComponents:function(){return this._creatingComponents},get_isDisposing:function(){return this._disposing},add_init:function(a){if(this._initialized)a(this,Sys.EventArgs.Empty);else this.get_events().addHandler("init",a)},remove_init:function(a){this.get_events().removeHandler("init",a)},add_load:function(a){this.get_events().addHandler("load",a)},remove_load:function(a){this.get_events().removeHandler("load",a)},add_unload:function(a){this.get_events().addHandler("unload",a)},remove_unload:function(a){this.get_events().removeHandler("unload",a)},addComponent:function(a){this._components[a.get_id()]=a},beginCreateComponents:function(){this._creatingComponents=true},dispose:function(){if(!this._disposing){this._disposing=true;if(this._timerCookie){window.clearTimeout(this._timerCookie);delete this._timerCookie}if(this._endRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);delete this._endRequestHandler}if(this._beginRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);delete this._beginRequestHandler}if(window.pageUnload)window.pageUnload(this,Sys.EventArgs.Empty);var c=this.get_events().getHandler("unload");if(c)c(this,Sys.EventArgs.Empty);var b=Array.clone(this._disposableObjects);for(var a=0,f=b.length;a=0;b--)this._disposeElementInternal(c[b]);if(!d)this._disposeElementInternal(a)}},endCreateComponents:function(){var b=this._secondPassComponents;for(var a=0,d=b.length;a1000){var c=[];for(var d=0,f=b.length;d=0;b--){var c=a[b];if(typeof c.dispose==="function")c.dispose()}},_disposeElementInternal:function(a){var d=a.dispose;if(d&&typeof d==="function")a.dispose();else{var c=a.control;if(c&&typeof c.dispose==="function")c.dispose()}var b=a._behaviors;if(b)this._disposeComponents(b);b=a._components;if(b){this._disposeComponents(b);a._components=null}},_domReady:function(){var a,g,f=this;function b(){f.initialize()}var c=function(){Sys.UI.DomEvent.removeHandler(window,"load",c);b()};Sys.UI.DomEvent.addHandler(window,"load",c);if(document.addEventListener)try{document.addEventListener("DOMContentLoaded",a=function(){document.removeEventListener("DOMContentLoaded",a,false);b()},false)}catch(h){}else if(document.attachEvent)if(window==window.top&&document.documentElement.doScroll){var e,d=document.createElement("div");a=function(){try{d.doScroll("left")}catch(c){e=window.setTimeout(a,0);return}d=null;b()};a()}else document.attachEvent("onreadystatechange",a=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",a);b()}})},_raiseInit:function(){var a=this.get_events().getHandler("init");if(a){this.beginCreateComponents();a(this,Sys.EventArgs.Empty);this.endCreateComponents()}},_unloadHandler:function(){this.dispose()}};Sys._Application.registerClass("Sys._Application",Sys.Component,Sys.IContainer);Sys.Application=new Sys._Application;var $find=Sys.Application.findComponent;Sys.UI.Behavior=function(b){Sys.UI.Behavior.initializeBase(this);this._element=b;var a=b._behaviors;if(!a)b._behaviors=[this];else a[a.length]=this};Sys.UI.Behavior.prototype={_name:null,get_element:function(){return this._element},get_id:function(){var a=Sys.UI.Behavior.callBaseMethod(this,"get_id");if(a)return a;if(!this._element||!this._element.id)return "";return this._element.id+"$"+this.get_name()},get_name:function(){if(this._name)return this._name;var a=Object.getTypeName(this),b=a.lastIndexOf(".");if(b!==-1)a=a.substr(b+1);if(!this.get_isInitialized())this._name=a;return a},set_name:function(a){this._name=a},initialize:function(){Sys.UI.Behavior.callBaseMethod(this,"initialize");var a=this.get_name();if(a)this._element[a]=this},dispose:function(){Sys.UI.Behavior.callBaseMethod(this,"dispose");var a=this._element;if(a){var c=this.get_name();if(c)a[c]=null;var b=a._behaviors;Array.remove(b,this);if(b.length===0)a._behaviors=null;delete this._element}}};Sys.UI.Behavior.registerClass("Sys.UI.Behavior",Sys.Component);Sys.UI.Behavior.getBehaviorByName=function(b,c){var a=b[c];return a&&Sys.UI.Behavior.isInstanceOfType(a)?a:null};Sys.UI.Behavior.getBehaviors=function(a){if(!a._behaviors)return [];return Array.clone(a._behaviors)};Sys.UI.Behavior.getBehaviorsByType=function(d,e){var a=d._behaviors,c=[];if(a)for(var b=0,f=a.length;b0&&a.charAt(0)==="#")a=a.substring(1);return a};Sys._Application.prototype.get_enableHistory=function(){return this._enableHistory};Sys._Application.prototype.set_enableHistory=function(a){this._enableHistory=a};Sys._Application.prototype.add_navigate=function(a){this.get_events().addHandler("navigate",a)};Sys._Application.prototype.remove_navigate=function(a){this.get_events().removeHandler("navigate",a)};Sys._Application.prototype.addHistoryPoint=function(c,f){this._ensureHistory();var b=this._state;for(var a in c){var d=c[a];if(d===null){if(typeof b[a]!=="undefined")delete b[a]}else b[a]=d}var e=this._serializeState(b);this._historyPointIsNew=true;this._setState(e,f);this._raiseNavigate()};Sys._Application.prototype.setServerId=function(a,b){this._clientId=a;this._uniqueId=b};Sys._Application.prototype.setServerState=function(a){this._ensureHistory();this._state.__s=a;this._updateHiddenField(a)};Sys._Application.prototype._deserializeState=function(a){var e={};a=a||"";var b=a.indexOf("&&");if(b!==-1&&b+2'");c.write(""+(b||document.title)+"parent.Sys.Application._onIFrameLoad('+Sys.Serialization.JavaScriptSerializer.serialize(a)+");");c.close()}this._ignoreTimer=false;this._currentEntry=a;if(this._historyFrame||this._historyPointIsNew){var f=this.get_stateString();if(a!==f){window.location.hash=a;this._currentEntry=this.get_stateString();if(typeof b!=="undefined"&&b!==null)document.title=b}}this._historyPointIsNew=false}}};Sys._Application.prototype._updateHiddenField=function(b){if(this._clientId){var a=document.getElementById(this._clientId);if(a)a.value=b}};if(!window.XMLHttpRequest)window.XMLHttpRequest=function(){var b=["Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"];for(var a=0,c=b.length;a0)this._timer=window.setTimeout(Function.createDelegate(this,this._onTimeout),d);this._xmlHttpRequest.send(c);this._started=true},getResponseHeader:function(b){var a;try{a=this._xmlHttpRequest.getResponseHeader(b)}catch(c){}if(!a)a="";return a},getAllResponseHeaders:function(){return this._xmlHttpRequest.getAllResponseHeaders()},get_responseData:function(){return this._xmlHttpRequest.responseText},get_statusCode:function(){var a=0;try{a=this._xmlHttpRequest.status}catch(b){}return a},get_statusText:function(){return this._xmlHttpRequest.statusText},get_xml:function(){var a=this._xmlHttpRequest.responseXML;if(!a||!a.documentElement){a=Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);if(!a||!a.documentElement)return null}else if(navigator.userAgent.indexOf("MSIE")!==-1)a.setProperty("SelectionLanguage","XPath");if(a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml"&&a.documentElement.tagName==="parsererror")return null;if(a.documentElement.firstChild&&a.documentElement.firstChild.tagName==="parsererror")return null;return a},abort:function(){if(this._aborted||this._responseAvailable||this._timedOut)return;this._aborted=true;this._clearTimer();if(this._xmlHttpRequest&&!this._responseAvailable){this._xmlHttpRequest.onreadystatechange=Function.emptyMethod;this._xmlHttpRequest.abort();this._xmlHttpRequest=null;this._webRequest.completed(Sys.EventArgs.Empty)}}};Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor",Sys.Net.WebRequestExecutor);Sys.Net._WebRequestManager=function(){this._defaultTimeout=0;this._defaultExecutorType="Sys.Net.XMLHttpExecutor"};Sys.Net._WebRequestManager.prototype={add_invokingRequest:function(a){this._get_eventHandlerList().addHandler("invokingRequest",a)},remove_invokingRequest:function(a){this._get_eventHandlerList().removeHandler("invokingRequest",a)},add_completedRequest:function(a){this._get_eventHandlerList().addHandler("completedRequest",a)},remove_completedRequest:function(a){this._get_eventHandlerList().removeHandler("completedRequest",a)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_defaultTimeout:function(){return this._defaultTimeout},set_defaultTimeout:function(a){this._defaultTimeout=a},get_defaultExecutorType:function(){return this._defaultExecutorType},set_defaultExecutorType:function(a){this._defaultExecutorType=a},executeRequest:function(webRequest){var executor=webRequest.get_executor();if(!executor){var failed=false;try{var executorType=eval(this._defaultExecutorType);executor=new executorType}catch(a){failed=true}webRequest.set_executor(executor)}if(executor.get_aborted())return;var evArgs=new Sys.Net.NetworkRequestEventArgs(webRequest),handler=this._get_eventHandlerList().getHandler("invokingRequest");if(handler)handler(this,evArgs);if(!evArgs.get_cancel())executor.executeRequest()}};Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");Sys.Net.WebRequestManager=new Sys.Net._WebRequestManager;Sys.Net.NetworkRequestEventArgs=function(a){Sys.Net.NetworkRequestEventArgs.initializeBase(this);this._webRequest=a};Sys.Net.NetworkRequestEventArgs.prototype={get_webRequest:function(){return this._webRequest}};Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs",Sys.CancelEventArgs);Sys.Net.WebRequest=function(){this._url="";this._headers={};this._body=null;this._userContext=null;this._httpVerb=null;this._executor=null;this._invokeCalled=false;this._timeout=0};Sys.Net.WebRequest.prototype={add_completed:function(a){this._get_eventHandlerList().addHandler("completed",a)},remove_completed:function(a){this._get_eventHandlerList().removeHandler("completed",a)},completed:function(b){var a=Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");if(a)a(this._executor,b);a=this._get_eventHandlerList().getHandler("completed");if(a)a(this._executor,b)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_url:function(){return this._url},set_url:function(a){this._url=a},get_headers:function(){return this._headers},get_httpVerb:function(){if(this._httpVerb===null){if(this._body===null)return "GET";return "POST"}return this._httpVerb},set_httpVerb:function(a){this._httpVerb=a},get_body:function(){return this._body},set_body:function(a){this._body=a},get_userContext:function(){return this._userContext},set_userContext:function(a){this._userContext=a},get_executor:function(){return this._executor},set_executor:function(a){this._executor=a;this._executor._set_webRequest(this)},get_timeout:function(){if(this._timeout===0)return Sys.Net.WebRequestManager.get_defaultTimeout();return this._timeout},set_timeout:function(a){this._timeout=a},getResolvedUrl:function(){return Sys.Net.WebRequest._resolveUrl(this._url)},invoke:function(){Sys.Net.WebRequestManager.executeRequest(this);this._invokeCalled=true}};Sys.Net.WebRequest._resolveUrl=function(b,a){if(b&&b.indexOf("://")!==-1)return b;if(!a||a.length===0){var d=document.getElementsByTagName("base")[0];if(d&&d.href&&d.href.length>0)a=d.href;else a=document.URL}var c=a.indexOf("?");if(c!==-1)a=a.substr(0,c);c=a.indexOf("#");if(c!==-1)a=a.substr(0,c);a=a.substr(0,a.lastIndexOf("/")+1);if(!b||b.length===0)return a;if(b.charAt(0)==="/"){var e=a.indexOf("://"),g=a.indexOf("/",e+3);return a.substr(0,g)+b}else{var f=a.lastIndexOf("/");return a.substr(0,f+1)+b}};Sys.Net.WebRequest._createQueryString=function(c,b,f){b=b||encodeURIComponent;var h=0,e,g,d,a=new Sys.StringBuilder;if(c)for(d in c){e=c[d];if(typeof e==="function")continue;g=Sys.Serialization.JavaScriptSerializer.serialize(e);if(h++)a.append("&");a.append(d);a.append("=");a.append(b(g))}if(f){if(h)a.append("&");a.append(f)}return a.toString()};Sys.Net.WebRequest._createUrl=function(a,b,c){if(!b&&!c)return a;var d=Sys.Net.WebRequest._createQueryString(b,null,c);return d.length?a+(a&&a.indexOf("?")>=0?"&":"?")+d:a};Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");Sys._ScriptLoaderTask=function(b,a){this._scriptElement=b;this._completedCallback=a};Sys._ScriptLoaderTask.prototype={get_scriptElement:function(){return this._scriptElement},dispose:function(){if(this._disposed)return;this._disposed=true;this._removeScriptElementHandlers();Sys._ScriptLoaderTask._clearScript(this._scriptElement);this._scriptElement=null},execute:function(){this._addScriptElementHandlers();document.getElementsByTagName("head")[0].appendChild(this._scriptElement)},_addScriptElementHandlers:function(){this._scriptLoadDelegate=Function.createDelegate(this,this._scriptLoadHandler);if(Sys.Browser.agent!==Sys.Browser.InternetExplorer){this._scriptElement.readyState="loaded";$addHandler(this._scriptElement,"load",this._scriptLoadDelegate)}else $addHandler(this._scriptElement,"readystatechange",this._scriptLoadDelegate);if(this._scriptElement.addEventListener){this._scriptErrorDelegate=Function.createDelegate(this,this._scriptErrorHandler);this._scriptElement.addEventListener("error",this._scriptErrorDelegate,false)}},_removeScriptElementHandlers:function(){if(this._scriptLoadDelegate){var a=this.get_scriptElement();if(Sys.Browser.agent!==Sys.Browser.InternetExplorer)$removeHandler(a,"load",this._scriptLoadDelegate);else $removeHandler(a,"readystatechange",this._scriptLoadDelegate);if(this._scriptErrorDelegate){this._scriptElement.removeEventListener("error",this._scriptErrorDelegate,false);this._scriptErrorDelegate=null}this._scriptLoadDelegate=null}},_scriptErrorHandler:function(){if(this._disposed)return;this._completedCallback(this.get_scriptElement(),false)},_scriptLoadHandler:function(){if(this._disposed)return;var a=this.get_scriptElement();if(a.readyState!=="loaded"&&a.readyState!=="complete")return;this._completedCallback(a,true)}};Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask",null,Sys.IDisposable);Sys._ScriptLoaderTask._clearScript=function(a){if(!Sys.Debug.isDebug)a.parentNode.removeChild(a)};Type.registerNamespace("Sys.Net");Sys.Net.WebServiceProxy=function(){};Sys.Net.WebServiceProxy.prototype={get_timeout:function(){return this._timeout||0},set_timeout:function(a){if(a<0)throw Error.argumentOutOfRange("value",a,Sys.Res.invalidTimeout);this._timeout=a},get_defaultUserContext:function(){return typeof this._userContext==="undefined"?null:this._userContext},set_defaultUserContext:function(a){this._userContext=a},get_defaultSucceededCallback:function(){return this._succeeded||null},set_defaultSucceededCallback:function(a){this._succeeded=a},get_defaultFailedCallback:function(){return this._failed||null},set_defaultFailedCallback:function(a){this._failed=a},get_enableJsonp:function(){return !!this._jsonp},set_enableJsonp:function(a){this._jsonp=a},get_path:function(){return this._path||null},set_path:function(a){this._path=a},get_jsonpCallbackParameter:function(){return this._callbackParameter||"callback"},set_jsonpCallbackParameter:function(a){this._callbackParameter=a},_invoke:function(d,e,g,f,c,b,a){c=c||this.get_defaultSucceededCallback();b=b||this.get_defaultFailedCallback();if(a===null||typeof a==="undefined")a=this.get_defaultUserContext();return Sys.Net.WebServiceProxy.invoke(d,e,g,f,c,b,a,this.get_timeout(),this.get_enableJsonp(),this.get_jsonpCallbackParameter())}};Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");Sys.Net.WebServiceProxy.invoke=function(q,a,m,l,j,b,g,e,w,p){var i=w!==false?Sys.Net.WebServiceProxy._xdomain.exec(q):null,c,n=i&&i.length===3&&(i[1]!==location.protocol||i[2]!==location.host);m=n||m;if(n){p=p||"callback";c="_jsonp"+Sys._jsonp++}if(!l)l={};var r=l;if(!m||!r)r={};var s,h,f=null,k,o=null,u=Sys.Net.WebRequest._createUrl(a?q+"/"+encodeURIComponent(a):q,r,n?p+"=Sys."+c:null);if(n){s=document.createElement("script");s.src=u;k=new Sys._ScriptLoaderTask(s,function(d,b){if(!b||c)t({Message:String.format(Sys.Res.webServiceFailedNoMsg,a)},-1)});function v(){if(f===null)return;f=null;h=new Sys.Net.WebServiceError(true,String.format(Sys.Res.webServiceTimedOut,a));k.dispose();delete Sys[c];if(b)b(h,g,a)}function t(d,e){if(f!==null){window.clearTimeout(f);f=null}k.dispose();delete Sys[c];c=null;if(typeof e!=="undefined"&&e!==200){if(b){h=new Sys.Net.WebServiceError(false,d.Message||String.format(Sys.Res.webServiceFailedNoMsg,a),d.StackTrace||null,d.ExceptionType||null,d);h._statusCode=e;b(h,g,a)}}else if(j)j(d,g,a)}Sys[c]=t;e=e||Sys.Net.WebRequestManager.get_defaultTimeout();if(e>0)f=window.setTimeout(v,e);k.execute();return null}var d=new Sys.Net.WebRequest;d.set_url(u);d.get_headers()["Content-Type"]="application/json; charset=utf-8";if(!m){o=Sys.Serialization.JavaScriptSerializer.serialize(l);if(o==="{}")o=""}d.set_body(o);d.add_completed(x);if(e&&e>0)d.set_timeout(e);d.invoke();function x(d){if(d.get_responseAvailable()){var f=d.get_statusCode(),c=null;try{var e=d.getResponseHeader("Content-Type");if(e.startsWith("application/json"))c=d.get_object();else if(e.startsWith("text/xml"))c=d.get_xml();else c=d.get_responseData()}catch(m){}var k=d.getResponseHeader("jsonerror"),h=k==="true";if(h){if(c)c=new Sys.Net.WebServiceError(false,c.Message,c.StackTrace,c.ExceptionType,c)}else if(e.startsWith("application/json"))c=!c||typeof c.d==="undefined"?c:c.d;if(f<200||f>=300||h){if(b){if(!c||!h)c=new Sys.Net.WebServiceError(false,String.format(Sys.Res.webServiceFailedNoMsg,a));c._statusCode=f;b(c,g,a)}}else if(j)j(c,g,a)}else{var i;if(d.get_timedOut())i=String.format(Sys.Res.webServiceTimedOut,a);else i=String.format(Sys.Res.webServiceFailedNoMsg,a);if(b)b(new Sys.Net.WebServiceError(d.get_timedOut(),i,"",""),g,a)}}return d};Sys.Net.WebServiceProxy._generateTypedConstructor=function(a){return function(b){if(b)for(var c in b)this[c]=b[c];this.__type=a}};Sys._jsonp=0;Sys.Net.WebServiceProxy._xdomain=/^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;Sys.Net.WebServiceError=function(d,e,c,a,b){this._timedOut=d;this._message=e;this._stackTrace=c;this._exceptionType=a;this._errorObject=b;this._statusCode=-1};Sys.Net.WebServiceError.prototype={get_timedOut:function(){return this._timedOut},get_statusCode:function(){return this._statusCode},get_message:function(){return this._message},get_stackTrace:function(){return this._stackTrace||""},get_exceptionType:function(){return this._exceptionType||""},get_errorObject:function(){return this._errorObject||null}};Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError"); +Type.registerNamespace('Sys');Sys.Res={'argumentInteger':'Value must be an integer.','invokeCalledTwice':'Cannot call invoke more than once.','webServiceFailed':'The server method \'{0}\' failed with the following error: {1}','argumentType':'Object cannot be converted to the required type.','argumentNull':'Value cannot be null.','scriptAlreadyLoaded':'The script \'{0}\' has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.','scriptDependencyNotFound':'The script \'{0}\' failed to load because it is dependent on script \'{1}\'.','formatBadFormatSpecifier':'Format specifier was invalid.','requiredScriptReferenceNotIncluded':'\'{0}\' requires that you have included a script reference to \'{1}\'.','webServiceFailedNoMsg':'The server method \'{0}\' failed.','argumentDomElement':'Value must be a DOM element.','invalidExecutorType':'Could not create a valid Sys.Net.WebRequestExecutor from: {0}.','cannotCallBeforeResponse':'Cannot call {0} when responseAvailable is false.','actualValue':'Actual value was {0}.','enumInvalidValue':'\'{0}\' is not a valid value for enum {1}.','scriptLoadFailed':'The script \'{0}\' could not be loaded.','parameterCount':'Parameter count mismatch.','cannotDeserializeEmptyString':'Cannot deserialize empty string.','formatInvalidString':'Input string was not in a correct format.','invalidTimeout':'Value must be greater than or equal to zero.','cannotAbortBeforeStart':'Cannot abort when executor has not started.','argument':'Value does not fall within the expected range.','cannotDeserializeInvalidJson':'Cannot deserialize. The data does not correspond to valid JSON.','invalidHttpVerb':'httpVerb cannot be set to an empty or null string.','nullWebRequest':'Cannot call executeRequest with a null webRequest.','eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.','cannotSerializeNonFiniteNumbers':'Cannot serialize non finite numbers.','argumentUndefined':'Value cannot be undefined.','webServiceInvalidReturnType':'The server method \'{0}\' returned an invalid type. Expected type: {1}','servicePathNotSet':'The path to the web service has not been set.','argumentTypeWithTypes':'Object of type \'{0}\' cannot be converted to type \'{1}\'.','cannotCallOnceStarted':'Cannot call {0} once started.','badBaseUrl1':'Base URL does not contain ://.','badBaseUrl2':'Base URL does not contain another /.','badBaseUrl3':'Cannot find last / in base URL.','setExecutorAfterActive':'Cannot set executor after it has become active.','paramName':'Parameter name: {0}','nullReferenceInPath':'Null reference while evaluating data path: \'{0}\'.','cannotCallOutsideHandler':'Cannot call {0} outside of a completed event handler.','cannotSerializeObjectWithCycle':'Cannot serialize object with cyclic reference within child properties.','format':'One of the identified items was in an invalid format.','assertFailedCaller':'Assertion Failed: {0}\r\nat {1}','argumentOutOfRange':'Specified argument was out of the range of valid values.','webServiceTimedOut':'The server method \'{0}\' timed out.','notImplemented':'The method or operation is not implemented.','assertFailed':'Assertion Failed: {0}','invalidOperation':'Operation is not valid due to the current state of the object.','breakIntoDebugger':'{0}\r\n\r\nBreak into debugger?'}; diff --git a/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftMvcAjax.debug.js b/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftMvcAjax.debug.js new file mode 100644 index 00000000000..eb68ba7e7e2 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftMvcAjax.debug.js @@ -0,0 +1,408 @@ +//!---------------------------------------------------------- +//! Copyright (C) Microsoft Corporation. All rights reserved. +//!---------------------------------------------------------- +//! MicrosoftMvcAjax.js + +Type.registerNamespace('Sys.Mvc'); + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.AjaxOptions + +Sys.Mvc.$create_AjaxOptions = function Sys_Mvc_AjaxOptions() { return {}; } + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.InsertionMode + +Sys.Mvc.InsertionMode = function() { + /// + /// + /// + /// + /// + /// +}; +Sys.Mvc.InsertionMode.prototype = { + replace: 0, + insertBefore: 1, + insertAfter: 2 +} +Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode', false); + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.AjaxContext + +Sys.Mvc.AjaxContext = function Sys_Mvc_AjaxContext(request, updateTarget, loadingElement, insertionMode) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + this._request = request; + this._updateTarget = updateTarget; + this._loadingElement = loadingElement; + this._insertionMode = insertionMode; +} +Sys.Mvc.AjaxContext.prototype = { + _insertionMode: 0, + _loadingElement: null, + _response: null, + _request: null, + _updateTarget: null, + + get_data: function Sys_Mvc_AjaxContext$get_data() { + /// + if (this._response) { + return this._response.get_responseData(); + } + else { + return null; + } + }, + + get_insertionMode: function Sys_Mvc_AjaxContext$get_insertionMode() { + /// + return this._insertionMode; + }, + + get_loadingElement: function Sys_Mvc_AjaxContext$get_loadingElement() { + /// + return this._loadingElement; + }, + + get_object: function Sys_Mvc_AjaxContext$get_object() { + /// + var executor = this.get_response(); + return (executor) ? executor.get_object() : null; + }, + + get_response: function Sys_Mvc_AjaxContext$get_response() { + /// + return this._response; + }, + set_response: function Sys_Mvc_AjaxContext$set_response(value) { + /// + this._response = value; + return value; + }, + + get_request: function Sys_Mvc_AjaxContext$get_request() { + /// + return this._request; + }, + + get_updateTarget: function Sys_Mvc_AjaxContext$get_updateTarget() { + /// + return this._updateTarget; + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.AsyncHyperlink + +Sys.Mvc.AsyncHyperlink = function Sys_Mvc_AsyncHyperlink() { +} +Sys.Mvc.AsyncHyperlink.handleClick = function Sys_Mvc_AsyncHyperlink$handleClick(anchor, evt, ajaxOptions) { + /// + /// + /// + /// + /// + /// + evt.preventDefault(); + Sys.Mvc.MvcHelpers._asyncRequest(anchor.href, 'post', '', anchor, ajaxOptions); +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.MvcHelpers + +Sys.Mvc.MvcHelpers = function Sys_Mvc_MvcHelpers() { +} +Sys.Mvc.MvcHelpers._serializeSubmitButton = function Sys_Mvc_MvcHelpers$_serializeSubmitButton(element, offsetX, offsetY) { + /// + /// + /// + /// + /// + /// + /// + if (element.disabled) { + return null; + } + var name = element.name; + if (name) { + var tagName = element.tagName.toUpperCase(); + var encodedName = encodeURIComponent(name); + var inputElement = element; + if (tagName === 'INPUT') { + var type = inputElement.type; + if (type === 'submit') { + return encodedName + '=' + encodeURIComponent(inputElement.value); + } + else if (type === 'image') { + return encodedName + '.x=' + offsetX + '&' + encodedName + '.y=' + offsetY; + } + } + else if ((tagName === 'BUTTON') && (name.length) && (inputElement.type === 'submit')) { + return encodedName + '=' + encodeURIComponent(inputElement.value); + } + } + return null; +} +Sys.Mvc.MvcHelpers._serializeForm = function Sys_Mvc_MvcHelpers$_serializeForm(form) { + /// + /// + /// + var formElements = form.elements; + var formBody = new Sys.StringBuilder(); + var count = formElements.length; + for (var i = 0; i < count; i++) { + var element = formElements[i]; + var name = element.name; + if (!name || !name.length) { + continue; + } + var tagName = element.tagName.toUpperCase(); + if (tagName === 'INPUT') { + var inputElement = element; + var type = inputElement.type; + if ((type === 'text') || (type === 'password') || (type === 'hidden') || (((type === 'checkbox') || (type === 'radio')) && element.checked)) { + formBody.append(encodeURIComponent(name)); + formBody.append('='); + formBody.append(encodeURIComponent(inputElement.value)); + formBody.append('&'); + } + } + else if (tagName === 'SELECT') { + var selectElement = element; + var optionCount = selectElement.options.length; + for (var j = 0; j < optionCount; j++) { + var optionElement = selectElement.options[j]; + if (optionElement.selected) { + formBody.append(encodeURIComponent(name)); + formBody.append('='); + formBody.append(encodeURIComponent(optionElement.value)); + formBody.append('&'); + } + } + } + else if (tagName === 'TEXTAREA') { + formBody.append(encodeURIComponent(name)); + formBody.append('='); + formBody.append(encodeURIComponent((element.value))); + formBody.append('&'); + } + } + var additionalInput = form._additionalInput; + if (additionalInput) { + formBody.append(additionalInput); + formBody.append('&'); + } + return formBody.toString(); +} +Sys.Mvc.MvcHelpers._asyncRequest = function Sys_Mvc_MvcHelpers$_asyncRequest(url, verb, body, triggerElement, ajaxOptions) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + if (ajaxOptions.confirm) { + if (!confirm(ajaxOptions.confirm)) { + return; + } + } + if (ajaxOptions.url) { + url = ajaxOptions.url; + } + if (ajaxOptions.httpMethod) { + verb = ajaxOptions.httpMethod; + } + if (body.length > 0 && !body.endsWith('&')) { + body += '&'; + } + body += 'X-Requested-With=XMLHttpRequest'; + var upperCaseVerb = verb.toUpperCase(); + var isGetOrPost = (upperCaseVerb === 'GET' || upperCaseVerb === 'POST'); + if (!isGetOrPost) { + body += '&'; + body += 'X-HTTP-Method-Override=' + upperCaseVerb; + } + var requestBody = ''; + if (upperCaseVerb === 'GET' || upperCaseVerb === 'DELETE') { + if (url.indexOf('?') > -1) { + if (!url.endsWith('&')) { + url += '&'; + } + url += body; + } + else { + url += '?'; + url += body; + } + } + else { + requestBody = body; + } + var request = new Sys.Net.WebRequest(); + request.set_url(url); + if (isGetOrPost) { + request.set_httpVerb(verb); + } + else { + request.set_httpVerb('POST'); + request.get_headers()['X-HTTP-Method-Override'] = upperCaseVerb; + } + request.set_body(requestBody); + if (verb.toUpperCase() === 'PUT') { + request.get_headers()['Content-Type'] = 'application/x-www-form-urlencoded;'; + } + request.get_headers()['X-Requested-With'] = 'XMLHttpRequest'; + var updateElement = null; + if (ajaxOptions.updateTargetId) { + updateElement = $get(ajaxOptions.updateTargetId); + } + var loadingElement = null; + if (ajaxOptions.loadingElementId) { + loadingElement = $get(ajaxOptions.loadingElementId); + } + var ajaxContext = new Sys.Mvc.AjaxContext(request, updateElement, loadingElement, ajaxOptions.insertionMode); + var continueRequest = true; + if (ajaxOptions.onBegin) { + continueRequest = ajaxOptions.onBegin(ajaxContext) !== false; + } + if (loadingElement) { + Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), true); + } + if (continueRequest) { + request.add_completed(Function.createDelegate(null, function(executor) { + Sys.Mvc.MvcHelpers._onComplete(request, ajaxOptions, ajaxContext); + })); + request.invoke(); + } +} +Sys.Mvc.MvcHelpers._onComplete = function Sys_Mvc_MvcHelpers$_onComplete(request, ajaxOptions, ajaxContext) { + /// + /// + /// + /// + /// + /// + ajaxContext.set_response(request.get_executor()); + if (ajaxOptions.onComplete && ajaxOptions.onComplete(ajaxContext) === false) { + return; + } + var statusCode = ajaxContext.get_response().get_statusCode(); + if ((statusCode >= 200 && statusCode < 300) || statusCode === 304 || statusCode === 1223) { + if (statusCode !== 204 && statusCode !== 304 && statusCode !== 1223) { + var contentType = ajaxContext.get_response().getResponseHeader('Content-Type'); + if ((contentType) && (contentType.indexOf('application/x-javascript') !== -1)) { + eval(ajaxContext.get_data()); + } + else { + Sys.Mvc.MvcHelpers.updateDomElement(ajaxContext.get_updateTarget(), ajaxContext.get_insertionMode(), ajaxContext.get_data()); + } + } + if (ajaxOptions.onSuccess) { + ajaxOptions.onSuccess(ajaxContext); + } + } + else { + if (ajaxOptions.onFailure) { + ajaxOptions.onFailure(ajaxContext); + } + } + if (ajaxContext.get_loadingElement()) { + Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), false); + } +} +Sys.Mvc.MvcHelpers.updateDomElement = function Sys_Mvc_MvcHelpers$updateDomElement(target, insertionMode, content) { + /// + /// + /// + /// + /// + /// + if (target) { + switch (insertionMode) { + case Sys.Mvc.InsertionMode.replace: + target.innerHTML = content; + break; + case Sys.Mvc.InsertionMode.insertBefore: + if (content && content.length > 0) { + target.innerHTML = content + target.innerHTML.trimStart(); + } + break; + case Sys.Mvc.InsertionMode.insertAfter: + if (content && content.length > 0) { + target.innerHTML = target.innerHTML.trimEnd() + content; + } + break; + } + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.AsyncForm + +Sys.Mvc.AsyncForm = function Sys_Mvc_AsyncForm() { +} +Sys.Mvc.AsyncForm.handleClick = function Sys_Mvc_AsyncForm$handleClick(form, evt) { + /// + /// + /// + /// + var additionalInput = Sys.Mvc.MvcHelpers._serializeSubmitButton(evt.target, evt.offsetX, evt.offsetY); + form._additionalInput = additionalInput; +} +Sys.Mvc.AsyncForm.handleSubmit = function Sys_Mvc_AsyncForm$handleSubmit(form, evt, ajaxOptions) { + /// + /// + /// + /// + /// + /// + evt.preventDefault(); + var validationCallbacks = form.validationCallbacks; + if (validationCallbacks) { + for (var i = 0; i < validationCallbacks.length; i++) { + var callback = validationCallbacks[i]; + if (!callback()) { + return; + } + } + } + var body = Sys.Mvc.MvcHelpers._serializeForm(form); + Sys.Mvc.MvcHelpers._asyncRequest(form.action, form.method || 'post', body, form, ajaxOptions); +} + + +Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext'); +Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink'); +Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers'); +Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm'); + +// ---- Do not remove this footer ---- +// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) +// ----------------------------------- diff --git a/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftMvcAjax.js b/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftMvcAjax.js new file mode 100644 index 00000000000..c5a6165e7b6 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftMvcAjax.js @@ -0,0 +1,25 @@ +//---------------------------------------------------------- +// Copyright (C) Microsoft Corporation. All rights reserved. +//---------------------------------------------------------- +// MicrosoftMvcAjax.js + +Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_AjaxOptions=function(){return {};} +Sys.Mvc.InsertionMode=function(){};Sys.Mvc.InsertionMode.prototype = {replace:0,insertBefore:1,insertAfter:2} +Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode',false);Sys.Mvc.AjaxContext=function(request,updateTarget,loadingElement,insertionMode){this.$3=request;this.$4=updateTarget;this.$1=loadingElement;this.$0=insertionMode;} +Sys.Mvc.AjaxContext.prototype={$0:0,$1:null,$2:null,$3:null,$4:null,get_data:function(){if(this.$2){return this.$2.get_responseData();}else{return null;}},get_insertionMode:function(){return this.$0;},get_loadingElement:function(){return this.$1;},get_object:function(){var $0=this.get_response();return ($0)?$0.get_object():null;},get_response:function(){return this.$2;},set_response:function(value){this.$2=value;return value;},get_request:function(){return this.$3;},get_updateTarget:function(){return this.$4;}} +Sys.Mvc.AsyncHyperlink=function(){} +Sys.Mvc.AsyncHyperlink.handleClick=function(anchor,evt,ajaxOptions){evt.preventDefault();Sys.Mvc.MvcHelpers.$2(anchor.href,'post','',anchor,ajaxOptions);} +Sys.Mvc.MvcHelpers=function(){} +Sys.Mvc.MvcHelpers.$0=function($p0,$p1,$p2){if($p0.disabled){return null;}var $0=$p0.name;if($0){var $1=$p0.tagName.toUpperCase();var $2=encodeURIComponent($0);var $3=$p0;if($1==='INPUT'){var $4=$3.type;if($4==='submit'){return $2+'='+encodeURIComponent($3.value);}else if($4==='image'){return $2+'.x='+$p1+'&'+$2+'.y='+$p2;}}else if(($1==='BUTTON')&&($0.length)&&($3.type==='submit')){return $2+'='+encodeURIComponent($3.value);}}return null;} +Sys.Mvc.MvcHelpers.$1=function($p0){var $0=$p0.elements;var $1=new Sys.StringBuilder();var $2=$0.length;for(var $4=0;$4<$2;$4++){var $5=$0[$4];var $6=$5.name;if(!$6||!$6.length){continue;}var $7=$5.tagName.toUpperCase();if($7==='INPUT'){var $8=$5;var $9=$8.type;if(($9==='text')||($9==='password')||($9==='hidden')||((($9==='checkbox')||($9==='radio'))&&$5.checked)){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent($8.value));$1.append('&');}}else if($7==='SELECT'){var $A=$5;var $B=$A.options.length;for(var $C=0;$C<$B;$C++){var $D=$A.options[$C];if($D.selected){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent($D.value));$1.append('&');}}}else if($7==='TEXTAREA'){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent(($5.value)));$1.append('&');}}var $3=$p0._additionalInput;if($3){$1.append($3);$1.append('&');}return $1.toString();} +Sys.Mvc.MvcHelpers.$2=function($p0,$p1,$p2,$p3,$p4){if($p4.confirm){if(!confirm($p4.confirm)){return;}}if($p4.url){$p0=$p4.url;}if($p4.httpMethod){$p1=$p4.httpMethod;}if($p2.length>0&&!$p2.endsWith('&')){$p2+='&';}$p2+='X-Requested-With=XMLHttpRequest';var $0=$p1.toUpperCase();var $1=($0==='GET'||$0==='POST');if(!$1){$p2+='&';$p2+='X-HTTP-Method-Override='+$0;}var $2='';if($0==='GET'||$0==='DELETE'){if($p0.indexOf('?')>-1){if(!$p0.endsWith('&')){$p0+='&';}$p0+=$p2;}else{$p0+='?';$p0+=$p2;}}else{$2=$p2;}var $3=new Sys.Net.WebRequest();$3.set_url($p0);if($1){$3.set_httpVerb($p1);}else{$3.set_httpVerb('POST');$3.get_headers()['X-HTTP-Method-Override']=$0;}$3.set_body($2);if($p1.toUpperCase()==='PUT'){$3.get_headers()['Content-Type']='application/x-www-form-urlencoded;';}$3.get_headers()['X-Requested-With']='XMLHttpRequest';var $4=null;if($p4.updateTargetId){$4=$get($p4.updateTargetId);}var $5=null;if($p4.loadingElementId){$5=$get($p4.loadingElementId);}var $6=new Sys.Mvc.AjaxContext($3,$4,$5,$p4.insertionMode);var $7=true;if($p4.onBegin){$7=$p4.onBegin($6)!==false;}if($5){Sys.UI.DomElement.setVisible($6.get_loadingElement(),true);}if($7){$3.add_completed(Function.createDelegate(null,function($p1_0){ +Sys.Mvc.MvcHelpers.$3($3,$p4,$6);}));$3.invoke();}} +Sys.Mvc.MvcHelpers.$3=function($p0,$p1,$p2){$p2.set_response($p0.get_executor());if($p1.onComplete&&$p1.onComplete($p2)===false){return;}var $0=$p2.get_response().get_statusCode();if(($0>=200&&$0<300)||$0===304||$0===1223){if($0!==204&&$0!==304&&$0!==1223){var $1=$p2.get_response().getResponseHeader('Content-Type');if(($1)&&($1.indexOf('application/x-javascript')!==-1)){eval($p2.get_data());}else{Sys.Mvc.MvcHelpers.updateDomElement($p2.get_updateTarget(),$p2.get_insertionMode(),$p2.get_data());}}if($p1.onSuccess){$p1.onSuccess($p2);}}else{if($p1.onFailure){$p1.onFailure($p2);}}if($p2.get_loadingElement()){Sys.UI.DomElement.setVisible($p2.get_loadingElement(),false);}} +Sys.Mvc.MvcHelpers.updateDomElement=function(target,insertionMode,content){if(target){switch(insertionMode){case 0:target.innerHTML=content;break;case 1:if(content&&content.length>0){target.innerHTML=content+target.innerHTML.trimStart();}break;case 2:if(content&&content.length>0){target.innerHTML=target.innerHTML.trimEnd()+content;}break;}}} +Sys.Mvc.AsyncForm=function(){} +Sys.Mvc.AsyncForm.handleClick=function(form,evt){var $0=Sys.Mvc.MvcHelpers.$0(evt.target,evt.offsetX,evt.offsetY);form._additionalInput = $0;} +Sys.Mvc.AsyncForm.handleSubmit=function(form,evt,ajaxOptions){evt.preventDefault();var $0=form.validationCallbacks;if($0){for(var $2=0;$2<$0.length;$2++){var $3=$0[$2];if(!$3()){return;}}}var $1=Sys.Mvc.MvcHelpers.$1(form);Sys.Mvc.MvcHelpers.$2(form.action,form.method||'post',$1,form,ajaxOptions);} +Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext');Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink');Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers');Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm'); +// ---- Do not remove this footer ---- +// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) +// ----------------------------------- diff --git a/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftMvcValidation.debug.js b/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftMvcValidation.debug.js new file mode 100644 index 00000000000..346ba4818db --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftMvcValidation.debug.js @@ -0,0 +1,883 @@ +//!---------------------------------------------------------- +//! Copyright (C) Microsoft Corporation. All rights reserved. +//!---------------------------------------------------------- +//! MicrosoftMvcValidation.js + + +Type.registerNamespace('Sys.Mvc'); + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.Validation + +Sys.Mvc.$create_Validation = function Sys_Mvc_Validation() { return {}; } + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.JsonValidationField + +Sys.Mvc.$create_JsonValidationField = function Sys_Mvc_JsonValidationField() { return {}; } + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.JsonValidationOptions + +Sys.Mvc.$create_JsonValidationOptions = function Sys_Mvc_JsonValidationOptions() { return {}; } + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.JsonValidationRule + +Sys.Mvc.$create_JsonValidationRule = function Sys_Mvc_JsonValidationRule() { return {}; } + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.ValidationContext + +Sys.Mvc.$create_ValidationContext = function Sys_Mvc_ValidationContext() { return {}; } + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.NumberValidator + +Sys.Mvc.NumberValidator = function Sys_Mvc_NumberValidator() { +} +Sys.Mvc.NumberValidator.create = function Sys_Mvc_NumberValidator$create(rule) { + /// + /// + /// + return Function.createDelegate(new Sys.Mvc.NumberValidator(), new Sys.Mvc.NumberValidator().validate); +} +Sys.Mvc.NumberValidator.prototype = { + + validate: function Sys_Mvc_NumberValidator$validate(value, context) { + /// + /// + /// + /// + /// + if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) { + return true; + } + var n = Number.parseLocale(value); + return (!isNaN(n)); + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.FormContext + +Sys.Mvc.FormContext = function Sys_Mvc_FormContext(formElement, validationSummaryElement) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + this._errors = []; + this.fields = new Array(0); + this._formElement = formElement; + this._validationSummaryElement = validationSummaryElement; + formElement[Sys.Mvc.FormContext._formValidationTag] = this; + if (validationSummaryElement) { + var ulElements = validationSummaryElement.getElementsByTagName('ul'); + if (ulElements.length > 0) { + this._validationSummaryULElement = ulElements[0]; + } + } + this._onClickHandler = Function.createDelegate(this, this._form_OnClick); + this._onSubmitHandler = Function.createDelegate(this, this._form_OnSubmit); +} +Sys.Mvc.FormContext._Application_Load = function Sys_Mvc_FormContext$_Application_Load() { + var allFormOptions = window.mvcClientValidationMetadata; + if (allFormOptions) { + while (allFormOptions.length > 0) { + var thisFormOptions = allFormOptions.pop(); + Sys.Mvc.FormContext._parseJsonOptions(thisFormOptions); + } + } +} +Sys.Mvc.FormContext._getFormElementsWithName = function Sys_Mvc_FormContext$_getFormElementsWithName(formElement, name) { + /// + /// + /// + /// + /// + var allElementsWithNameInForm = []; + var allElementsWithName = document.getElementsByName(name); + for (var i = 0; i < allElementsWithName.length; i++) { + var thisElement = allElementsWithName[i]; + if (Sys.Mvc.FormContext._isElementInHierarchy(formElement, thisElement)) { + Array.add(allElementsWithNameInForm, thisElement); + } + } + return allElementsWithNameInForm; +} +Sys.Mvc.FormContext.getValidationForForm = function Sys_Mvc_FormContext$getValidationForForm(formElement) { + /// + /// + /// + return formElement[Sys.Mvc.FormContext._formValidationTag]; +} +Sys.Mvc.FormContext._isElementInHierarchy = function Sys_Mvc_FormContext$_isElementInHierarchy(parent, child) { + /// + /// + /// + /// + /// + while (child) { + if (parent === child) { + return true; + } + child = child.parentNode; + } + return false; +} +Sys.Mvc.FormContext._parseJsonOptions = function Sys_Mvc_FormContext$_parseJsonOptions(options) { + /// + /// + /// + var formElement = $get(options.FormId); + var validationSummaryElement = (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(options.ValidationSummaryId)) ? $get(options.ValidationSummaryId) : null; + var formContext = new Sys.Mvc.FormContext(formElement, validationSummaryElement); + formContext.enableDynamicValidation(); + formContext.replaceValidationSummary = options.ReplaceValidationSummary; + for (var i = 0; i < options.Fields.length; i++) { + var field = options.Fields[i]; + var fieldElements = Sys.Mvc.FormContext._getFormElementsWithName(formElement, field.FieldName); + var validationMessageElement = (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(field.ValidationMessageId)) ? $get(field.ValidationMessageId) : null; + var fieldContext = new Sys.Mvc.FieldContext(formContext); + Array.addRange(fieldContext.elements, fieldElements); + fieldContext.validationMessageElement = validationMessageElement; + fieldContext.replaceValidationMessageContents = field.ReplaceValidationMessageContents; + for (var j = 0; j < field.ValidationRules.length; j++) { + var rule = field.ValidationRules[j]; + var validator = Sys.Mvc.ValidatorRegistry.getValidator(rule); + if (validator) { + var validation = Sys.Mvc.$create_Validation(); + validation.fieldErrorMessage = rule.ErrorMessage; + validation.validator = validator; + Array.add(fieldContext.validations, validation); + } + } + fieldContext.enableDynamicValidation(); + Array.add(formContext.fields, fieldContext); + } + var registeredValidatorCallbacks = formElement.validationCallbacks; + if (!registeredValidatorCallbacks) { + registeredValidatorCallbacks = []; + formElement.validationCallbacks = registeredValidatorCallbacks; + } + registeredValidatorCallbacks.push(Function.createDelegate(null, function() { + return Sys.Mvc._validationUtil.arrayIsNullOrEmpty(formContext.validate('submit')); + })); + return formContext; +} +Sys.Mvc.FormContext.prototype = { + _onClickHandler: null, + _onSubmitHandler: null, + _submitButtonClicked: null, + _validationSummaryElement: null, + _validationSummaryULElement: null, + _formElement: null, + replaceValidationSummary: false, + + addError: function Sys_Mvc_FormContext$addError(message) { + /// + /// + this.addErrors([ message ]); + }, + + addErrors: function Sys_Mvc_FormContext$addErrors(messages) { + /// + /// + if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(messages)) { + Array.addRange(this._errors, messages); + this._onErrorCountChanged(); + } + }, + + clearErrors: function Sys_Mvc_FormContext$clearErrors() { + Array.clear(this._errors); + this._onErrorCountChanged(); + }, + + _displayError: function Sys_Mvc_FormContext$_displayError() { + if (this._validationSummaryElement) { + if (this._validationSummaryULElement) { + Sys.Mvc._validationUtil.removeAllChildren(this._validationSummaryULElement); + for (var i = 0; i < this._errors.length; i++) { + var liElement = document.createElement('li'); + Sys.Mvc._validationUtil.setInnerText(liElement, this._errors[i]); + this._validationSummaryULElement.appendChild(liElement); + } + } + Sys.UI.DomElement.removeCssClass(this._validationSummaryElement, Sys.Mvc.FormContext._validationSummaryValidCss); + Sys.UI.DomElement.addCssClass(this._validationSummaryElement, Sys.Mvc.FormContext._validationSummaryErrorCss); + } + }, + + _displaySuccess: function Sys_Mvc_FormContext$_displaySuccess() { + var validationSummaryElement = this._validationSummaryElement; + if (validationSummaryElement) { + var validationSummaryULElement = this._validationSummaryULElement; + if (validationSummaryULElement) { + validationSummaryULElement.innerHTML = ''; + } + Sys.UI.DomElement.removeCssClass(validationSummaryElement, Sys.Mvc.FormContext._validationSummaryErrorCss); + Sys.UI.DomElement.addCssClass(validationSummaryElement, Sys.Mvc.FormContext._validationSummaryValidCss); + } + }, + + enableDynamicValidation: function Sys_Mvc_FormContext$enableDynamicValidation() { + Sys.UI.DomEvent.addHandler(this._formElement, 'click', this._onClickHandler); + Sys.UI.DomEvent.addHandler(this._formElement, 'submit', this._onSubmitHandler); + }, + + _findSubmitButton: function Sys_Mvc_FormContext$_findSubmitButton(element) { + /// + /// + /// + if (element.disabled) { + return null; + } + var tagName = element.tagName.toUpperCase(); + var inputElement = element; + if (tagName === 'INPUT') { + var type = inputElement.type; + if (type === 'submit' || type === 'image') { + return inputElement; + } + } + else if ((tagName === 'BUTTON') && (inputElement.type === 'submit')) { + return inputElement; + } + return null; + }, + + _form_OnClick: function Sys_Mvc_FormContext$_form_OnClick(e) { + /// + /// + this._submitButtonClicked = this._findSubmitButton(e.target); + }, + + _form_OnSubmit: function Sys_Mvc_FormContext$_form_OnSubmit(e) { + /// + /// + var form = e.target; + var submitButton = this._submitButtonClicked; + if (submitButton && submitButton.disableValidation) { + return; + } + var errorMessages = this.validate('submit'); + if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(errorMessages)) { + e.preventDefault(); + } + }, + + _onErrorCountChanged: function Sys_Mvc_FormContext$_onErrorCountChanged() { + if (!this._errors.length) { + this._displaySuccess(); + } + else { + this._displayError(); + } + }, + + validate: function Sys_Mvc_FormContext$validate(eventName) { + /// + /// + /// + var fields = this.fields; + var errors = []; + for (var i = 0; i < fields.length; i++) { + var field = fields[i]; + if (!field.elements[0].disabled) { + var thisErrors = field.validate(eventName); + if (thisErrors) { + Array.addRange(errors, thisErrors); + } + } + } + if (this.replaceValidationSummary) { + this.clearErrors(); + this.addErrors(errors); + } + return errors; + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.FieldContext + +Sys.Mvc.FieldContext = function Sys_Mvc_FieldContext(formContext) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + this._errors = []; + this.elements = new Array(0); + this.validations = new Array(0); + this.formContext = formContext; + this._onBlurHandler = Function.createDelegate(this, this._element_OnBlur); + this._onChangeHandler = Function.createDelegate(this, this._element_OnChange); + this._onInputHandler = Function.createDelegate(this, this._element_OnInput); + this._onPropertyChangeHandler = Function.createDelegate(this, this._element_OnPropertyChange); +} +Sys.Mvc.FieldContext.prototype = { + _onBlurHandler: null, + _onChangeHandler: null, + _onInputHandler: null, + _onPropertyChangeHandler: null, + defaultErrorMessage: null, + formContext: null, + replaceValidationMessageContents: false, + validationMessageElement: null, + + addError: function Sys_Mvc_FieldContext$addError(message) { + /// + /// + this.addErrors([ message ]); + }, + + addErrors: function Sys_Mvc_FieldContext$addErrors(messages) { + /// + /// + if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(messages)) { + Array.addRange(this._errors, messages); + this._onErrorCountChanged(); + } + }, + + clearErrors: function Sys_Mvc_FieldContext$clearErrors() { + Array.clear(this._errors); + this._onErrorCountChanged(); + }, + + _displayError: function Sys_Mvc_FieldContext$_displayError() { + var validationMessageElement = this.validationMessageElement; + if (validationMessageElement) { + if (this.replaceValidationMessageContents) { + Sys.Mvc._validationUtil.setInnerText(validationMessageElement, this._errors[0]); + } + Sys.UI.DomElement.removeCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageValidCss); + Sys.UI.DomElement.addCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageErrorCss); + } + var elements = this.elements; + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + Sys.UI.DomElement.removeCssClass(element, Sys.Mvc.FieldContext._inputElementValidCss); + Sys.UI.DomElement.addCssClass(element, Sys.Mvc.FieldContext._inputElementErrorCss); + } + }, + + _displaySuccess: function Sys_Mvc_FieldContext$_displaySuccess() { + var validationMessageElement = this.validationMessageElement; + if (validationMessageElement) { + if (this.replaceValidationMessageContents) { + Sys.Mvc._validationUtil.setInnerText(validationMessageElement, ''); + } + Sys.UI.DomElement.removeCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageErrorCss); + Sys.UI.DomElement.addCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageValidCss); + } + var elements = this.elements; + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + Sys.UI.DomElement.removeCssClass(element, Sys.Mvc.FieldContext._inputElementErrorCss); + Sys.UI.DomElement.addCssClass(element, Sys.Mvc.FieldContext._inputElementValidCss); + } + }, + + _element_OnBlur: function Sys_Mvc_FieldContext$_element_OnBlur(e) { + /// + /// + if (e.target[Sys.Mvc.FieldContext._hasTextChangedTag] || e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) { + this.validate('blur'); + } + }, + + _element_OnChange: function Sys_Mvc_FieldContext$_element_OnChange(e) { + /// + /// + e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true; + }, + + _element_OnInput: function Sys_Mvc_FieldContext$_element_OnInput(e) { + /// + /// + e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true; + if (e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) { + this.validate('input'); + } + }, + + _element_OnPropertyChange: function Sys_Mvc_FieldContext$_element_OnPropertyChange(e) { + /// + /// + if (e.rawEvent.propertyName === 'value') { + e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true; + if (e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) { + this.validate('input'); + } + } + }, + + enableDynamicValidation: function Sys_Mvc_FieldContext$enableDynamicValidation() { + var elements = this.elements; + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + if (Sys.Mvc._validationUtil.elementSupportsEvent(element, 'onpropertychange')) { + var compatMode = document.documentMode; + if (compatMode && compatMode >= 8) { + Sys.UI.DomEvent.addHandler(element, 'propertychange', this._onPropertyChangeHandler); + } + } + else { + Sys.UI.DomEvent.addHandler(element, 'input', this._onInputHandler); + } + Sys.UI.DomEvent.addHandler(element, 'change', this._onChangeHandler); + Sys.UI.DomEvent.addHandler(element, 'blur', this._onBlurHandler); + } + }, + + _getErrorString: function Sys_Mvc_FieldContext$_getErrorString(validatorReturnValue, fieldErrorMessage) { + /// + /// + /// + /// + /// + var fallbackErrorMessage = fieldErrorMessage || this.defaultErrorMessage; + if (Boolean.isInstanceOfType(validatorReturnValue)) { + return (validatorReturnValue) ? null : fallbackErrorMessage; + } + if (String.isInstanceOfType(validatorReturnValue)) { + return ((validatorReturnValue).length) ? validatorReturnValue : fallbackErrorMessage; + } + return null; + }, + + _getStringValue: function Sys_Mvc_FieldContext$_getStringValue() { + /// + var elements = this.elements; + return (elements.length > 0) ? elements[0].value : null; + }, + + _markValidationFired: function Sys_Mvc_FieldContext$_markValidationFired() { + var elements = this.elements; + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + element[Sys.Mvc.FieldContext._hasValidationFiredTag] = true; + } + }, + + _onErrorCountChanged: function Sys_Mvc_FieldContext$_onErrorCountChanged() { + if (!this._errors.length) { + this._displaySuccess(); + } + else { + this._displayError(); + } + }, + + validate: function Sys_Mvc_FieldContext$validate(eventName) { + /// + /// + /// + var validations = this.validations; + var errors = []; + var value = this._getStringValue(); + for (var i = 0; i < validations.length; i++) { + var validation = validations[i]; + var context = Sys.Mvc.$create_ValidationContext(); + context.eventName = eventName; + context.fieldContext = this; + context.validation = validation; + var retVal = validation.validator(value, context); + var errorMessage = this._getErrorString(retVal, validation.fieldErrorMessage); + if (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(errorMessage)) { + Array.add(errors, errorMessage); + } + } + this._markValidationFired(); + this.clearErrors(); + this.addErrors(errors); + return errors; + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.RangeValidator + +Sys.Mvc.RangeValidator = function Sys_Mvc_RangeValidator(minimum, maximum) { + /// + /// + /// + /// + /// + /// + /// + /// + this._minimum = minimum; + this._maximum = maximum; +} +Sys.Mvc.RangeValidator.create = function Sys_Mvc_RangeValidator$create(rule) { + /// + /// + /// + var min = rule.ValidationParameters['min']; + var max = rule.ValidationParameters['max']; + return Function.createDelegate(new Sys.Mvc.RangeValidator(min, max), new Sys.Mvc.RangeValidator(min, max).validate); +} +Sys.Mvc.RangeValidator.prototype = { + _minimum: null, + _maximum: null, + + validate: function Sys_Mvc_RangeValidator$validate(value, context) { + /// + /// + /// + /// + /// + if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) { + return true; + } + var n = Number.parseLocale(value); + return (!isNaN(n) && this._minimum <= n && n <= this._maximum); + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.RegularExpressionValidator + +Sys.Mvc.RegularExpressionValidator = function Sys_Mvc_RegularExpressionValidator(pattern) { + /// + /// + /// + /// + this._pattern = pattern; +} +Sys.Mvc.RegularExpressionValidator.create = function Sys_Mvc_RegularExpressionValidator$create(rule) { + /// + /// + /// + var pattern = rule.ValidationParameters['pattern']; + return Function.createDelegate(new Sys.Mvc.RegularExpressionValidator(pattern), new Sys.Mvc.RegularExpressionValidator(pattern).validate); +} +Sys.Mvc.RegularExpressionValidator.prototype = { + _pattern: null, + + validate: function Sys_Mvc_RegularExpressionValidator$validate(value, context) { + /// + /// + /// + /// + /// + if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) { + return true; + } + var regExp = new RegExp(this._pattern); + var matches = regExp.exec(value); + return (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(matches) && matches[0].length === value.length); + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.RequiredValidator + +Sys.Mvc.RequiredValidator = function Sys_Mvc_RequiredValidator() { +} +Sys.Mvc.RequiredValidator.create = function Sys_Mvc_RequiredValidator$create(rule) { + /// + /// + /// + return Function.createDelegate(new Sys.Mvc.RequiredValidator(), new Sys.Mvc.RequiredValidator().validate); +} +Sys.Mvc.RequiredValidator._isRadioInputElement = function Sys_Mvc_RequiredValidator$_isRadioInputElement(element) { + /// + /// + /// + if (element.tagName.toUpperCase() === 'INPUT') { + var inputType = (element.type).toUpperCase(); + if (inputType === 'RADIO') { + return true; + } + } + return false; +} +Sys.Mvc.RequiredValidator._isSelectInputElement = function Sys_Mvc_RequiredValidator$_isSelectInputElement(element) { + /// + /// + /// + if (element.tagName.toUpperCase() === 'SELECT') { + return true; + } + return false; +} +Sys.Mvc.RequiredValidator._isTextualInputElement = function Sys_Mvc_RequiredValidator$_isTextualInputElement(element) { + /// + /// + /// + if (element.tagName.toUpperCase() === 'INPUT') { + var inputType = (element.type).toUpperCase(); + switch (inputType) { + case 'TEXT': + case 'PASSWORD': + case 'FILE': + return true; + } + } + if (element.tagName.toUpperCase() === 'TEXTAREA') { + return true; + } + return false; +} +Sys.Mvc.RequiredValidator._validateRadioInput = function Sys_Mvc_RequiredValidator$_validateRadioInput(elements) { + /// + /// + /// + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + if (element.checked) { + return true; + } + } + return false; +} +Sys.Mvc.RequiredValidator._validateSelectInput = function Sys_Mvc_RequiredValidator$_validateSelectInput(optionElements) { + /// + /// + /// + for (var i = 0; i < optionElements.length; i++) { + var element = optionElements[i]; + if (element.selected) { + if (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(element.value)) { + return true; + } + } + } + return false; +} +Sys.Mvc.RequiredValidator._validateTextualInput = function Sys_Mvc_RequiredValidator$_validateTextualInput(element) { + /// + /// + /// + return (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(element.value)); +} +Sys.Mvc.RequiredValidator.prototype = { + + validate: function Sys_Mvc_RequiredValidator$validate(value, context) { + /// + /// + /// + /// + /// + var elements = context.fieldContext.elements; + if (!elements.length) { + return true; + } + var sampleElement = elements[0]; + if (Sys.Mvc.RequiredValidator._isTextualInputElement(sampleElement)) { + return Sys.Mvc.RequiredValidator._validateTextualInput(sampleElement); + } + if (Sys.Mvc.RequiredValidator._isRadioInputElement(sampleElement)) { + return Sys.Mvc.RequiredValidator._validateRadioInput(elements); + } + if (Sys.Mvc.RequiredValidator._isSelectInputElement(sampleElement)) { + return Sys.Mvc.RequiredValidator._validateSelectInput((sampleElement).options); + } + return true; + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.StringLengthValidator + +Sys.Mvc.StringLengthValidator = function Sys_Mvc_StringLengthValidator(minLength, maxLength) { + /// + /// + /// + /// + /// + /// + /// + /// + this._minLength = minLength; + this._maxLength = maxLength; +} +Sys.Mvc.StringLengthValidator.create = function Sys_Mvc_StringLengthValidator$create(rule) { + /// + /// + /// + var minLength = (rule.ValidationParameters['min'] || 0); + var maxLength = (rule.ValidationParameters['max'] || Number.MAX_VALUE); + return Function.createDelegate(new Sys.Mvc.StringLengthValidator(minLength, maxLength), new Sys.Mvc.StringLengthValidator(minLength, maxLength).validate); +} +Sys.Mvc.StringLengthValidator.prototype = { + _maxLength: 0, + _minLength: 0, + + validate: function Sys_Mvc_StringLengthValidator$validate(value, context) { + /// + /// + /// + /// + /// + if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) { + return true; + } + return (this._minLength <= value.length && value.length <= this._maxLength); + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc._validationUtil + +Sys.Mvc._validationUtil = function Sys_Mvc__validationUtil() { +} +Sys.Mvc._validationUtil.arrayIsNullOrEmpty = function Sys_Mvc__validationUtil$arrayIsNullOrEmpty(array) { + /// + /// + /// + return (!array || !array.length); +} +Sys.Mvc._validationUtil.stringIsNullOrEmpty = function Sys_Mvc__validationUtil$stringIsNullOrEmpty(value) { + /// + /// + /// + return (!value || !value.length); +} +Sys.Mvc._validationUtil.elementSupportsEvent = function Sys_Mvc__validationUtil$elementSupportsEvent(element, eventAttributeName) { + /// + /// + /// + /// + /// + return (eventAttributeName in element); +} +Sys.Mvc._validationUtil.removeAllChildren = function Sys_Mvc__validationUtil$removeAllChildren(element) { + /// + /// + while (element.firstChild) { + element.removeChild(element.firstChild); + } +} +Sys.Mvc._validationUtil.setInnerText = function Sys_Mvc__validationUtil$setInnerText(element, innerText) { + /// + /// + /// + /// + var textNode = document.createTextNode(innerText); + Sys.Mvc._validationUtil.removeAllChildren(element); + element.appendChild(textNode); +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.ValidatorRegistry + +Sys.Mvc.ValidatorRegistry = function Sys_Mvc_ValidatorRegistry() { + /// + /// +} +Sys.Mvc.ValidatorRegistry.getValidator = function Sys_Mvc_ValidatorRegistry$getValidator(rule) { + /// + /// + /// + var creator = Sys.Mvc.ValidatorRegistry.validators[rule.ValidationType]; + return (creator) ? creator(rule) : null; +} +Sys.Mvc.ValidatorRegistry._getDefaultValidators = function Sys_Mvc_ValidatorRegistry$_getDefaultValidators() { + /// + return { required: Function.createDelegate(null, Sys.Mvc.RequiredValidator.create), length: Function.createDelegate(null, Sys.Mvc.StringLengthValidator.create), regex: Function.createDelegate(null, Sys.Mvc.RegularExpressionValidator.create), range: Function.createDelegate(null, Sys.Mvc.RangeValidator.create), number: Function.createDelegate(null, Sys.Mvc.NumberValidator.create) }; +} + + +Sys.Mvc.NumberValidator.registerClass('Sys.Mvc.NumberValidator'); +Sys.Mvc.FormContext.registerClass('Sys.Mvc.FormContext'); +Sys.Mvc.FieldContext.registerClass('Sys.Mvc.FieldContext'); +Sys.Mvc.RangeValidator.registerClass('Sys.Mvc.RangeValidator'); +Sys.Mvc.RegularExpressionValidator.registerClass('Sys.Mvc.RegularExpressionValidator'); +Sys.Mvc.RequiredValidator.registerClass('Sys.Mvc.RequiredValidator'); +Sys.Mvc.StringLengthValidator.registerClass('Sys.Mvc.StringLengthValidator'); +Sys.Mvc._validationUtil.registerClass('Sys.Mvc._validationUtil'); +Sys.Mvc.ValidatorRegistry.registerClass('Sys.Mvc.ValidatorRegistry'); +Sys.Mvc.FormContext._validationSummaryErrorCss = 'validation-summary-errors'; +Sys.Mvc.FormContext._validationSummaryValidCss = 'validation-summary-valid'; +Sys.Mvc.FormContext._formValidationTag = '__MVC_FormValidation'; +Sys.Mvc.FieldContext._hasTextChangedTag = '__MVC_HasTextChanged'; +Sys.Mvc.FieldContext._hasValidationFiredTag = '__MVC_HasValidationFired'; +Sys.Mvc.FieldContext._inputElementErrorCss = 'input-validation-error'; +Sys.Mvc.FieldContext._inputElementValidCss = 'input-validation-valid'; +Sys.Mvc.FieldContext._validationMessageErrorCss = 'field-validation-error'; +Sys.Mvc.FieldContext._validationMessageValidCss = 'field-validation-valid'; +Sys.Mvc.ValidatorRegistry.validators = Sys.Mvc.ValidatorRegistry._getDefaultValidators(); + +// ---- Do not remove this footer ---- +// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) +// ----------------------------------- + +// register validation +Sys.Application.add_load(function() { + Sys.Application.remove_load(arguments.callee); + Sys.Mvc.FormContext._Application_Load(); +}); diff --git a/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftMvcValidation.js b/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftMvcValidation.js new file mode 100644 index 00000000000..9483492f119 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Scripts/MicrosoftMvcValidation.js @@ -0,0 +1,55 @@ +//---------------------------------------------------------- +// Copyright (C) Microsoft Corporation. All rights reserved. +//---------------------------------------------------------- +// MicrosoftMvcValidation.js + +Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_Validation=function(){return {};} +Sys.Mvc.$create_JsonValidationField=function(){return {};} +Sys.Mvc.$create_JsonValidationOptions=function(){return {};} +Sys.Mvc.$create_JsonValidationRule=function(){return {};} +Sys.Mvc.$create_ValidationContext=function(){return {};} +Sys.Mvc.NumberValidator=function(){} +Sys.Mvc.NumberValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.NumberValidator(),new Sys.Mvc.NumberValidator().validate);} +Sys.Mvc.NumberValidator.prototype={validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=Number.parseLocale(value);return (!isNaN($0));}} +Sys.Mvc.FormContext=function(formElement,validationSummaryElement){this.$5=[];this.fields=new Array(0);this.$9=formElement;this.$7=validationSummaryElement;formElement['__MVC_FormValidation'] = this;if(validationSummaryElement){var $0=validationSummaryElement.getElementsByTagName('ul');if($0.length>0){this.$8=$0[0];}}this.$3=Function.createDelegate(this,this.$D);this.$4=Function.createDelegate(this,this.$E);} +Sys.Mvc.FormContext._Application_Load=function(){var $0=window.mvcClientValidationMetadata;if($0){while($0.length>0){var $1=$0.pop();Sys.Mvc.FormContext.$12($1);}}} +Sys.Mvc.FormContext.$F=function($p0,$p1){var $0=[];var $1=document.getElementsByName($p1);for(var $2=0;$2<$1.length;$2++){var $3=$1[$2];if(Sys.Mvc.FormContext.$10($p0,$3)){Array.add($0,$3);}}return $0;} +Sys.Mvc.FormContext.getValidationForForm=function(formElement){return formElement['__MVC_FormValidation'];} +Sys.Mvc.FormContext.$10=function($p0,$p1){while($p1){if($p0===$p1){return true;}$p1=$p1.parentNode;}return false;} +Sys.Mvc.FormContext.$12=function($p0){var $0=$get($p0.FormId);var $1=(!Sys.Mvc._ValidationUtil.$1($p0.ValidationSummaryId))?$get($p0.ValidationSummaryId):null;var $2=new Sys.Mvc.FormContext($0,$1);$2.enableDynamicValidation();$2.replaceValidationSummary=$p0.ReplaceValidationSummary;for(var $4=0;$4<$p0.Fields.length;$4++){var $5=$p0.Fields[$4];var $6=Sys.Mvc.FormContext.$F($0,$5.FieldName);var $7=(!Sys.Mvc._ValidationUtil.$1($5.ValidationMessageId))?$get($5.ValidationMessageId):null;var $8=new Sys.Mvc.FieldContext($2);Array.addRange($8.elements,$6);$8.validationMessageElement=$7;$8.replaceValidationMessageContents=$5.ReplaceValidationMessageContents;for(var $9=0;$9<$5.ValidationRules.length;$9++){var $A=$5.ValidationRules[$9];var $B=Sys.Mvc.ValidatorRegistry.getValidator($A);if($B){var $C=Sys.Mvc.$create_Validation();$C.fieldErrorMessage=$A.ErrorMessage;$C.validator=$B;Array.add($8.validations,$C);}}$8.enableDynamicValidation();Array.add($2.fields,$8);}var $3=$0.validationCallbacks;if(!$3){$3=[];$0.validationCallbacks = $3;}$3.push(Function.createDelegate(null,function(){ +return Sys.Mvc._ValidationUtil.$0($2.validate('submit'));}));return $2;} +Sys.Mvc.FormContext.prototype={$3:null,$4:null,$6:null,$7:null,$8:null,$9:null,replaceValidationSummary:false,addError:function(message){this.addErrors([message]);},addErrors:function(messages){if(!Sys.Mvc._ValidationUtil.$0(messages)){Array.addRange(this.$5,messages);this.$11();}},clearErrors:function(){Array.clear(this.$5);this.$11();},$A:function(){if(this.$7){if(this.$8){Sys.Mvc._ValidationUtil.$3(this.$8);for(var $0=0;$0=8){Sys.UI.DomEvent.addHandler($2,'propertychange',this.$9);}}else{Sys.UI.DomEvent.addHandler($2,'input',this.$8);}Sys.UI.DomEvent.addHandler($2,'change',this.$7);Sys.UI.DomEvent.addHandler($2,'blur',this.$6);}},$11:function($p0,$p1){var $0=$p1||this.defaultErrorMessage;if(Boolean.isInstanceOfType($p0)){return ($p0)?null:$0;}if(String.isInstanceOfType($p0)){return (($p0).length)?$p0:$0;}return null;},$12:function(){var $0=this.elements;return ($0.length>0)?$0[0].value:null;},$13:function(){var $0=this.elements;for(var $1=0;$1<$0.length;$1++){var $2=$0[$1];$2['__MVC_HasValidationFired'] = true;}},$14:function(){if(!this.$A.length){this.$C();}else{this.$B();}},validate:function(eventName){var $0=this.validations;var $1=[];var $2=this.$12();for(var $3=0;$3<$0.length;$3++){var $4=$0[$3];var $5=Sys.Mvc.$create_ValidationContext();$5.eventName=eventName;$5.fieldContext=this;$5.validation=$4;var $6=$4.validator($2,$5);var $7=this.$11($6,$4.fieldErrorMessage);if(!Sys.Mvc._ValidationUtil.$1($7)){Array.add($1,$7);}}this.$13();this.clearErrors();this.addErrors($1);return $1;}} +Sys.Mvc.RangeValidator=function(minimum,maximum){this.$0=minimum;this.$1=maximum;} +Sys.Mvc.RangeValidator.create=function(rule){var $0=rule.ValidationParameters['min'];var $1=rule.ValidationParameters['max'];return Function.createDelegate(new Sys.Mvc.RangeValidator($0,$1),new Sys.Mvc.RangeValidator($0,$1).validate);} +Sys.Mvc.RangeValidator.prototype={$0:null,$1:null,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=Number.parseLocale(value);return (!isNaN($0)&&this.$0<=$0&&$0<=this.$1);}} +Sys.Mvc.RegularExpressionValidator=function(pattern){this.$0=pattern;} +Sys.Mvc.RegularExpressionValidator.create=function(rule){var $0=rule.ValidationParameters['pattern'];return Function.createDelegate(new Sys.Mvc.RegularExpressionValidator($0),new Sys.Mvc.RegularExpressionValidator($0).validate);} +Sys.Mvc.RegularExpressionValidator.prototype={$0:null,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=new RegExp(this.$0);var $1=$0.exec(value);return (!Sys.Mvc._ValidationUtil.$0($1)&&$1[0].length===value.length);}} +Sys.Mvc.RequiredValidator=function(){} +Sys.Mvc.RequiredValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.RequiredValidator(),new Sys.Mvc.RequiredValidator().validate);} +Sys.Mvc.RequiredValidator.$0=function($p0){if($p0.tagName.toUpperCase()==='INPUT'){var $0=($p0.type).toUpperCase();if($0==='RADIO'){return true;}}return false;} +Sys.Mvc.RequiredValidator.$1=function($p0){if($p0.tagName.toUpperCase()==='SELECT'){return true;}return false;} +Sys.Mvc.RequiredValidator.$2=function($p0){if($p0.tagName.toUpperCase()==='INPUT'){var $0=($p0.type).toUpperCase();switch($0){case 'TEXT':case 'PASSWORD':case 'FILE':return true;}}if($p0.tagName.toUpperCase()==='TEXTAREA'){return true;}return false;} +Sys.Mvc.RequiredValidator.$3=function($p0){for(var $0=0;$0<$p0.length;$0++){var $1=$p0[$0];if($1.checked){return true;}}return false;} +Sys.Mvc.RequiredValidator.$4=function($p0){for(var $0=0;$0<$p0.length;$0++){var $1=$p0[$0];if($1.selected){if(!Sys.Mvc._ValidationUtil.$1($1.value)){return true;}}}return false;} +Sys.Mvc.RequiredValidator.$5=function($p0){return (!Sys.Mvc._ValidationUtil.$1($p0.value));} +Sys.Mvc.RequiredValidator.prototype={validate:function(value,context){var $0=context.fieldContext.elements;if(!$0.length){return true;}var $1=$0[0];if(Sys.Mvc.RequiredValidator.$2($1)){return Sys.Mvc.RequiredValidator.$5($1);}if(Sys.Mvc.RequiredValidator.$0($1)){return Sys.Mvc.RequiredValidator.$3($0);}if(Sys.Mvc.RequiredValidator.$1($1)){return Sys.Mvc.RequiredValidator.$4(($1).options);}return true;}} +Sys.Mvc.StringLengthValidator=function(minLength,maxLength){this.$1=minLength;this.$0=maxLength;} +Sys.Mvc.StringLengthValidator.create=function(rule){var $0=(rule.ValidationParameters['min']||0);var $1=(rule.ValidationParameters['max']||Number.MAX_VALUE);return Function.createDelegate(new Sys.Mvc.StringLengthValidator($0,$1),new Sys.Mvc.StringLengthValidator($0,$1).validate);} +Sys.Mvc.StringLengthValidator.prototype={$0:0,$1:0,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}return (this.$1<=value.length&&value.length<=this.$0);}} +Sys.Mvc._ValidationUtil=function(){} +Sys.Mvc._ValidationUtil.$0=function($p0){return (!$p0||!$p0.length);} +Sys.Mvc._ValidationUtil.$1=function($p0){return (!$p0||!$p0.length);} +Sys.Mvc._ValidationUtil.$2=function($p0,$p1){return ($p1 in $p0);} +Sys.Mvc._ValidationUtil.$3=function($p0){while($p0.firstChild){$p0.removeChild($p0.firstChild);}} +Sys.Mvc._ValidationUtil.$4=function($p0,$p1){var $0=document.createTextNode($p1);Sys.Mvc._ValidationUtil.$3($p0);$p0.appendChild($0);} +Sys.Mvc.ValidatorRegistry=function(){} +Sys.Mvc.ValidatorRegistry.getValidator=function(rule){var $0=Sys.Mvc.ValidatorRegistry.validators[rule.ValidationType];return ($0)?$0(rule):null;} +Sys.Mvc.ValidatorRegistry.$0=function(){return {required:Function.createDelegate(null,Sys.Mvc.RequiredValidator.create),length:Function.createDelegate(null,Sys.Mvc.StringLengthValidator.create),regex:Function.createDelegate(null,Sys.Mvc.RegularExpressionValidator.create),range:Function.createDelegate(null,Sys.Mvc.RangeValidator.create),number:Function.createDelegate(null,Sys.Mvc.NumberValidator.create)};} +Sys.Mvc.NumberValidator.registerClass('Sys.Mvc.NumberValidator');Sys.Mvc.FormContext.registerClass('Sys.Mvc.FormContext');Sys.Mvc.FieldContext.registerClass('Sys.Mvc.FieldContext');Sys.Mvc.RangeValidator.registerClass('Sys.Mvc.RangeValidator');Sys.Mvc.RegularExpressionValidator.registerClass('Sys.Mvc.RegularExpressionValidator');Sys.Mvc.RequiredValidator.registerClass('Sys.Mvc.RequiredValidator');Sys.Mvc.StringLengthValidator.registerClass('Sys.Mvc.StringLengthValidator');Sys.Mvc._ValidationUtil.registerClass('Sys.Mvc._ValidationUtil');Sys.Mvc.ValidatorRegistry.registerClass('Sys.Mvc.ValidatorRegistry');Sys.Mvc.ValidatorRegistry.validators=Sys.Mvc.ValidatorRegistry.$0(); +// ---- Do not remove this footer ---- +// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) +// ----------------------------------- +Sys.Application.add_load(function(){Sys.Application.remove_load(arguments.callee);Sys.Mvc.FormContext._Application_Load();}); \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/Scripts/jquery-1.5.1-vsdoc.js b/IntegrationTests/Azure/AzureHost/Host/Scripts/jquery-1.5.1-vsdoc.js new file mode 100644 index 00000000000..8f56f29ea15 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Scripts/jquery-1.5.1-vsdoc.js @@ -0,0 +1,9110 @@ +/* + * This file has been commented to support Visual Studio Intellisense. + * You should not use this file at runtime inside the browser--it is only + * intended to be used only for design-time IntelliSense. Please use the + * standard jQuery library for all production use. + * + * Comment version: 1.5.1 + */ + +/*! + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery JavaScript Library v1.5.1 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * + */ +(function( window, undefined ) { + +// Use the correct document accordingly with window argument (sandbox) +var document = window.document; +var jQuery = (function() { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + /// + /// 1: $(expression, context) - This function accepts a string containing a CSS selector which is then used to match a set of elements. + /// 2: $(html) - Create DOM elements on-the-fly from the provided String of raw HTML. + /// 3: $(elements) - Wrap jQuery functionality around a single or multiple DOM Element(s). + /// 4: $(callback) - A shorthand for $(document).ready(). + /// 5: $() - As of jQuery 1.4, if you pass no arguments in to the jQuery() method, an empty jQuery set will be returned. + /// + /// + /// 1: expression - An expression to search with. + /// 2: html - A string of HTML to create on the fly. + /// 3: elements - DOM element(s) to be encapsulated by a jQuery object. + /// 4: callback - The function to execute when the DOM is ready. + /// + /// + /// 1: context - A DOM Element, Document or jQuery to use as context. + /// + /// + + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/, + + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + rwhite = /\s/, + + // Used for trimming whitespace + trimLeft = /^\s+/, + trimRight = /\s+$/, + + // Check for non-word characters + rnonword = /\W/, + + // Check for digits + rdigit = /\d/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + + // Useragent RegExp + rwebkit = /(webkit)[ \/]([\w.]+)/, + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, + rmsie = /(msie) ([\w.]+)/, + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // Has the ready events already been bound? + readyBound = false, + + // The functions to execute on DOM ready + readyList = [], + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context && document.body ) { + this.context = document; + this[0] = document.body; + this.selector = "body"; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + doc = (context ? context.ownerDocument || context : document); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); + selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $("TAG") + } else if ( !context && !rnonword.test( selector ) ) { + this.selector = selector; + this.context = document; + selector = document.getElementsByTagName( selector ); + return jQuery.merge( this, selector ); + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return (context || rootjQuery).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return jQuery( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if (selector.selector !== undefined) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.4.4", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + /// + /// The number of elements currently matched. + /// Part of Core + /// + /// + + return this.length; + }, + + toArray: function() { + /// + /// Retrieve all the DOM elements contained in the jQuery set, as an array. + /// + /// + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + /// + /// Access a single matched element. num is used to access the + /// Nth element matched. + /// Part of Core + /// + /// + /// + /// Access the element in the Nth position. + /// + + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + /// + /// Set the jQuery object to an array of elements, while maintaining + /// the stack. + /// Part of Core + /// + /// + /// + /// An array of elements + /// + + // Build a new jQuery matched element set + var ret = jQuery(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + (this.selector ? " " : "") + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + /// + /// Execute a function within the context of every matched element. + /// This means that every time the passed-in function is executed + /// (which is once for every element matched) the 'this' keyword + /// points to the specific element. + /// Additionally, the function, when executed, is passed a single + /// argument representing the position of the element in the matched + /// set. + /// Part of Core + /// + /// + /// + /// A function to execute + /// + + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + /// + /// Binds a function to be executed whenever the DOM is ready to be traversed and manipulated. + /// + /// The function to be executed when the DOM is ready. + + // Attach the listeners + jQuery.bindReady(); + + // If the DOM is already ready + if ( jQuery.isReady ) { + // Execute the function immediately + fn.call( document, jQuery ); + + // Otherwise, remember the function for later + } else if ( readyList ) { + // Add the function to the wait list + readyList.push( fn ); + } + + return this; + }, + + eq: function( i ) { + /// + /// Reduce the set of matched elements to a single element. + /// The position of the element in the set of matched elements + /// starts at 0 and goes to length - 1. + /// Part of Core + /// + /// + /// + /// pos The index of the element that you wish to limit to. + /// + + return i === -1 ? + this.slice( i ) : + this.slice( i, +i + 1 ); + }, + + first: function() { + /// + /// Reduce the set of matched elements to the first in the set. + /// + /// + + return this.eq( 0 ); + }, + + last: function() { + /// + /// Reduce the set of matched elements to the final one in the set. + /// + /// + + return this.eq( -1 ); + }, + + slice: function() { + /// + /// Selects a subset of the matched elements. Behaves exactly like the built-in Array slice method. + /// + /// Where to start the subset (0-based). + /// Where to end the subset (not including the end element itself). + /// If omitted, ends at the end of the selection + /// The sliced elements + + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + /// + /// This member is internal. + /// + /// + /// + + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + /// + /// End the most recent 'destructive' operation, reverting the list of matched elements + /// back to its previous state. After an end operation, the list of matched elements will + /// revert to the last state of matched elements. + /// If there was no destructive operation before, an empty set is returned. + /// Part of DOM/Traversing + /// + /// + + return this.prevObject || jQuery(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + /// + /// Extend one object with one or more others, returning the original, + /// modified, object. This is a great utility for simple inheritance. + /// jQuery.extend(settings, options); + /// var settings = jQuery.extend({}, defaults, options); + /// Part of JavaScript + /// + /// + /// The object to extend + /// + /// + /// The object that will be merged into the first. + /// + /// + /// (optional) More objects to merge into the first + /// + /// + + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + /// + /// Run this function to give control of the $ variable back + /// to whichever library first implemented it. This helps to make + /// sure that jQuery doesn't conflict with the $ object + /// of other libraries. + /// By using this function, you will only be able to access jQuery + /// using the 'jQuery' variable. For example, where you used to do + /// $("div p"), you now must do jQuery("div p"). + /// Part of Core + /// + /// + + window.$ = _$; + + if ( deep ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + /// + /// This method is internal. + /// + /// + + // A third-party is pushing the ready event forwards + if ( wait === true ) { + jQuery.readyWait--; + } + + // Make sure that the DOM is not already loaded + if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + if ( readyList ) { + // Execute all of them + var fn, + i = 0, + ready = readyList; + + // Reset the list of functions + readyList = null; + + while ( (fn = ready[ i++ ]) ) { + fn.call( document, jQuery ); + } + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger( "ready" ).unbind( "ready" ); + } + } + } + }, + + bindReady: function() { + if ( readyBound ) { + return; + } + + readyBound = true; + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + return setTimeout( jQuery.ready, 1 ); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent("onreadystatechange", DOMContentLoaded); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + /// + /// Determines if the parameter passed is a function. + /// + /// The object to check + /// True if the parameter is a function; otherwise false. + + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + /// + /// Determine if the parameter passed is an array. + /// + /// Object to test whether or not it is an array. + /// True if the parameter is a function; otherwise false. + + return jQuery.type(obj) === "array"; + }, + + // A crude way of determining if an object is a window + isWindow: function( obj ) { + return obj && typeof obj === "object" && "setInterval" in obj; + }, + + isNaN: function( obj ) { + return obj == null || !rdigit.test( obj ) || isNaN( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + /// + /// Check to see if an object is a plain object (created using "{}" or "new Object"). + /// + /// + /// The object that will be checked to see if it's a plain object. + /// + /// + + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + /// + /// Check to see if an object is empty (contains no properties). + /// + /// + /// The object that will be checked to see if it's empty. + /// + /// + + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw msg; + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test(data.replace(rvalidescape, "@") + .replace(rvalidtokens, "]") + .replace(rvalidbraces, "")) ) { + + // Try to use the native JSON parser first + return window.JSON && window.JSON.parse ? + window.JSON.parse( data ) : + (new Function("return " + data))(); + + } else { + jQuery.error( "Invalid JSON: " + data ); + } + }, + + noop: function() { + /// + /// An empty function. + /// + /// + }, + + // Evalulates a script in a global context + globalEval: function( data ) { + /// + /// Internally evaluates a script in a global context. + /// + /// + + if ( data && rnotwhite.test(data) ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + + if ( jQuery.support.scriptEval ) { + script.appendChild( document.createTextNode( data ) ); + } else { + script.text = data; + } + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + /// + /// Checks whether the specified element has the specified DOM node name. + /// + /// The element to examine + /// The node name to check + /// True if the specified node name matches the node's DOM node name; otherwise false + + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + /// + /// A generic iterator function, which can be used to seemlessly + /// iterate over both objects and arrays. This function is not the same + /// as $().each() - which is used to iterate, exclusively, over a jQuery + /// object. This function can be used to iterate over anything. + /// The callback has two arguments:the key (objects) or index (arrays) as first + /// the first, and the value as the second. + /// Part of JavaScript + /// + /// + /// The object, or array, to iterate over. + /// + /// + /// The function that will be executed on every object. + /// + /// + + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction(object); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} + } + } + + return object; + }, + + // Use native String.trim function wherever possible + trim: trim ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + /// + /// Turns anything into a true array. This is an internal method. + /// + /// Anything to turn into an actual Array + /// + /// + + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // The extra typeof function check is to prevent crashes + // in Safari 2 (See: #3039) + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + var type = jQuery.type(array); + + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; + }, + + merge: function( first, second ) { + /// + /// Merge two arrays together, removing all duplicates. + /// The new array is: All the results from the first array, followed + /// by the unique results from the second array. + /// Part of JavaScript + /// + /// + /// + /// The first array to merge. + /// + /// + /// The second array to merge. + /// + + var i = first.length, + j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + /// + /// Filter items out of an array, by using a filter function. + /// The specified function will be passed two arguments: The + /// current array item and the index of the item in the array. The + /// function must return 'true' to keep the item in the array, + /// false to remove it. + /// }); + /// Part of JavaScript + /// + /// + /// + /// array The Array to find items in. + /// + /// + /// The function to process each item against. + /// + /// + /// Invert the selection - select the opposite of the function. + /// + + var ret = [], retVal; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + /// + /// Translate all items in an array to another array of items. + /// The translation function that is provided to this method is + /// called for each item in the array and is passed one argument: + /// The item to be translated. + /// The function can then return the translated value, 'null' + /// (to remove the item), or an array of values - which will + /// be flattened into the full array. + /// Part of JavaScript + /// + /// + /// + /// array The Array to translate. + /// + /// + /// The function to process each item against. + /// + + var ret = [], value; + + // Go through the array, translating each of the items to their + // new value (or values). + for ( var i = 0, length = elems.length; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + proxy: function( fn, proxy, thisObject ) { + /// + /// Takes a function and returns a new one that will always have a particular scope. + /// + /// + /// The function whose scope will be changed. + /// + /// + /// The object to which the scope of the function should be set. + /// + /// + + if ( arguments.length === 2 ) { + if ( typeof proxy === "string" ) { + thisObject = fn; + fn = thisObject[ proxy ]; + proxy = undefined; + + } else if ( proxy && !jQuery.isFunction( proxy ) ) { + thisObject = proxy; + proxy = undefined; + } + } + + if ( !proxy && fn ) { + proxy = function() { + return fn.apply( thisObject || this, arguments ); + }; + } + + // Set the guid of unique handler to the same of original handler, so it can be removed + if ( fn ) { + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + } + + // So proxy can be declared as an argument + return proxy; + }, + + // Mutifunctional method to get and set values to a collection + // The value/s can be optionally by executed if its a function + access: function( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + jQuery.access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; + }, + + now: function() { + return (new Date()).getTime(); + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + browser: {} +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +if ( indexOf ) { + jQuery.inArray = function( elem, array ) { + /// + /// Determines the index of the first parameter in the array. + /// + /// The value to see if it exists in the array. + /// The array to look through for the value + /// The 0-based index of the item if it was found, otherwise -1. + + return indexOf.call( array, elem ); + }; +} + +// Verify that \s matches non-breaking spaces +// (IE fails on this test) +if ( !rwhite.test( "\xA0" ) ) { + trimLeft = /^[\s\xA0]+/; + trimRight = /[\s\xA0]+$/; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch(e) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +// Expose jQuery to the global object +return (window.jQuery = window.$ = jQuery); + +})(); + + + +// [vsdoc] The following function has been modified for IntelliSense. +// [vsdoc] Stubbing support properties to "false" for IntelliSense compat. +(function() { + + jQuery.support = {}; + + // var root = document.documentElement, + // script = document.createElement("script"), + // div = document.createElement("div"), + // id = "script" + jQuery.now(); + + // div.style.display = "none"; + // div.innerHTML = "
a"; + + // var all = div.getElementsByTagName("*"), + // a = div.getElementsByTagName("a")[0], + // select = document.createElement("select"), + // opt = select.appendChild( document.createElement("option") ); + + // // Can't get basic test support + // if ( !all || !all.length || !a ) { + // return; + // } + + jQuery.support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: false, + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: false, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: false, + + // Get the style information from getAttribute + // (IE uses .cssText insted) + style: false, + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: false, + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: false, + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: false, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: false, + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: false, + + // Will be defined later + deleteExpando: false, + optDisabled: false, + checkClone: false, + scriptEval: false, + noCloneEvent: false, + boxModel: false, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableHiddenOffsets: true + }; + + // // Make sure that the options inside disabled selects aren't marked as disabled + // // (WebKit marks them as diabled) + // select.disabled = true; + // jQuery.support.optDisabled = !opt.disabled; + + // script.type = "text/javascript"; + // try { + // script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); + // } catch(e) {} + + // root.insertBefore( script, root.firstChild ); + + // // Make sure that the execution of code works by injecting a script + // // tag with appendChild/createTextNode + // // (IE doesn't support this, fails, and uses .text instead) + // if ( window[ id ] ) { + // jQuery.support.scriptEval = true; + // delete window[ id ]; + // } + + // // Test to see if it's possible to delete an expando from an element + // // Fails in Internet Explorer + // try { + // delete script.test; + + // } catch(e) { + // jQuery.support.deleteExpando = false; + // } + + // root.removeChild( script ); + + // if ( div.attachEvent && div.fireEvent ) { + // div.attachEvent("onclick", function click() { + // // Cloning a node shouldn't copy over any + // // bound event handlers (IE does this) + // jQuery.support.noCloneEvent = false; + // div.detachEvent("onclick", click); + // }); + // div.cloneNode(true).fireEvent("onclick"); + // } + + // div = document.createElement("div"); + // div.innerHTML = ""; + + // var fragment = document.createDocumentFragment(); + // fragment.appendChild( div.firstChild ); + + // // WebKit doesn't clone checked state correctly in fragments + // jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; + + // // Figure out if the W3C box model works as expected + // // document.body must exist before we can do this + // jQuery(function() { + // var div = document.createElement("div"); + // div.style.width = div.style.paddingLeft = "1px"; + + // document.body.appendChild( div ); + // jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; + + // if ( "zoom" in div.style ) { + // // Check if natively block-level elements act like inline-block + // // elements when setting their display to 'inline' and giving + // // them layout + // // (IE < 8 does this) + // div.style.display = "inline"; + // div.style.zoom = 1; + // jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2; + + // // Check if elements with layout shrink-wrap their children + // // (IE 6 does this) + // div.style.display = ""; + // div.innerHTML = "
"; + // jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; + // } + + // div.innerHTML = "
t
"; + // var tds = div.getElementsByTagName("td"); + + // // Check if table cells still have offsetWidth/Height when they are set + // // to display:none and there are still other visible table cells in a + // // table row; if so, offsetWidth/Height are not reliable for use when + // // determining if an element has been hidden directly using + // // display:none (it is still safe to use offsets if a parent element is + // // hidden; don safety goggles and see bug #4512 for more information). + // // (only IE 8 fails this test) + // jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0; + + // tds[0].style.display = ""; + // tds[1].style.display = "none"; + + // // Check if empty table cells still have offsetWidth/Height + // // (IE < 8 fail this test) + // jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0; + // div.innerHTML = ""; + + // document.body.removeChild( div ).style.display = "none"; + // div = tds = null; + // }); + + // // Technique from Juriy Zaytsev + // // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ + // var eventSupported = function( eventName ) { + // var el = document.createElement("div"); + // eventName = "on" + eventName; + + // var isSupported = (eventName in el); + // if ( !isSupported ) { + // el.setAttribute(eventName, "return;"); + // isSupported = typeof el[eventName] === "function"; + // } + // el = null; + + // return isSupported; + // }; + + jQuery.support.submitBubbles = false; + jQuery.support.changeBubbles = false; + + // // release memory in IE + // root = script = div = all = a = null; +})(); + + + +var windowData = {}, + rbrace = /^(?:\{.*\}|\[.*\])$/; + +jQuery.extend({ + cache: {}, + + // Please use with caution + uuid: 0, + + // Unique for each copy of jQuery on the page + expando: "jQuery" + jQuery.now(), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + data: function( elem, name, data ) { + /// + /// Store arbitrary data associated with the specified element. + /// + /// + /// The DOM element to associate with the data. + /// + /// + /// A string naming the piece of data to set. + /// + /// + /// The new data value. + /// + /// + + if ( !jQuery.acceptData( elem ) ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var isNode = elem.nodeType, + id = isNode ? elem[ jQuery.expando ] : null, + cache = jQuery.cache, thisCache; + + if ( isNode && !id && typeof name === "string" && data === undefined ) { + return; + } + + // Get the data from the object directly + if ( !isNode ) { + cache = elem; + + // Compute a unique ID for the element + } else if ( !id ) { + elem[ jQuery.expando ] = id = ++jQuery.uuid; + } + + // Avoid generating a new cache unless none exists and we + // want to manipulate it. + if ( typeof name === "object" ) { + if ( isNode ) { + cache[ id ] = jQuery.extend(cache[ id ], name); + + } else { + jQuery.extend( cache, name ); + } + + } else if ( isNode && !cache[ id ] ) { + cache[ id ] = {}; + } + + thisCache = isNode ? cache[ id ] : cache; + + // Prevent overriding the named cache with undefined values + if ( data !== undefined ) { + thisCache[ name ] = data; + } + + return typeof name === "string" ? thisCache[ name ] : thisCache; + }, + + removeData: function( elem, name ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var isNode = elem.nodeType, + id = isNode ? elem[ jQuery.expando ] : elem, + cache = jQuery.cache, + thisCache = isNode ? cache[ id ] : id; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( thisCache ) { + // Remove the section of cache data + delete thisCache[ name ]; + + // If we've removed all the data, remove the element's cache + if ( isNode && jQuery.isEmptyObject(thisCache) ) { + jQuery.removeData( elem ); + } + } + + // Otherwise, we want to remove all of the element's data + } else { + if ( isNode && jQuery.support.deleteExpando ) { + delete elem[ jQuery.expando ]; + + } else if ( elem.removeAttribute ) { + elem.removeAttribute( jQuery.expando ); + + // Completely remove the data cache + } else if ( isNode ) { + delete cache[ id ]; + + // Remove all fields from the object + } else { + for ( var n in elem ) { + delete elem[ n ]; + } + } + } + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + if ( elem.nodeName ) { + var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; + + if ( match ) { + return !(match === true || elem.getAttribute("classid") !== match); + } + } + + return true; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + /// + /// Store arbitrary data associated with the matched elements. + /// + /// + /// A string naming the piece of data to set. + /// + /// + /// The new data value. + /// + /// + + var data = null; + + if ( typeof key === "undefined" ) { + if ( this.length ) { + var attr = this[0].attributes, name; + data = jQuery.data( this[0] ); + + for ( var i = 0, l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( name.indexOf( "data-" ) === 0 ) { + name = name.substr( 5 ); + dataAttr( this[0], name, data[ name ] ); + } + } + } + + return data; + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + // Try to fetch any internally stored data first + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + data = dataAttr( this[0], key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + + } else { + return this.each(function() { + var $this = jQuery( this ), + args = [ parts[0], value ]; + + $this.triggerHandler( "setData" + parts[1] + "!", args ); + jQuery.data( this, key, value ); + $this.triggerHandler( "changeData" + parts[1] + "!", args ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + data = elem.getAttribute( "data-" + key ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + !jQuery.isNaN( data ) ? parseFloat( data ) : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + + + + +jQuery.extend({ + queue: function( elem, type, data ) { + if ( !elem ) { + return; + } + + type = (type || "fx") + "queue"; + var q = jQuery.data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( !data ) { + return q || []; + } + + if ( !q || jQuery.isArray(data) ) { + q = jQuery.data( elem, type, jQuery.makeArray(data) ); + + } else { + q.push( data ); + } + + return q; + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + fn = queue.shift(); + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift("inprogress"); + } + + fn.call(elem, function() { + jQuery.dequeue(elem, type); + }); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + /// + /// 1: queue() - Returns a reference to the first element's queue (which is an array of functions). + /// 2: queue(callback) - Adds a new function, to be executed, onto the end of the queue of all matched elements. + /// 3: queue(queue) - Replaces the queue of all matched element with this new queue (the array of functions). + /// + /// The function to add to the queue. + /// + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function( i ) { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + /// + /// Removes a queued function from the front of the queue and executes it. + /// + /// The type of queue to access. + /// + + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + /// + /// Set a timer to delay execution of subsequent items in the queue. + /// + /// + /// An integer indicating the number of milliseconds to delay execution of the next item in the queue. + /// + /// + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// + /// + + time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; + type = type || "fx"; + + return this.queue( type, function() { + var elem = this; + setTimeout(function() { + jQuery.dequeue( elem, type ); + }, time ); + }); + }, + + clearQueue: function( type ) { + /// + /// Remove from the queue all items that have not yet been run. + /// + /// + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// + /// + + return this.queue( type || "fx", [] ); + } +}); + + + + +var rclass = /[\n\t]/g, + rspaces = /\s+/, + rreturn = /\r/g, + rspecialurl = /^(?:href|src|style)$/, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea)?$/i, + rradiocheck = /^(?:radio|checkbox)$/i; + +jQuery.props = { + "for": "htmlFor", + "class": "className", + readonly: "readOnly", + maxlength: "maxLength", + cellspacing: "cellSpacing", + rowspan: "rowSpan", + colspan: "colSpan", + tabindex: "tabIndex", + usemap: "useMap", + frameborder: "frameBorder" +}; + +jQuery.fn.extend({ + attr: function( name, value ) { + /// + /// Set a single property to a computed value, on all matched elements. + /// Instead of a value, a function is provided, that computes the value. + /// Part of DOM/Attributes + /// + /// + /// + /// The name of the property to set. + /// + /// + /// A function returning the value to set. + /// + + return jQuery.access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name, fn ) { + /// + /// Remove an attribute from each of the matched elements. + /// Part of DOM/Attributes + /// + /// + /// An attribute to remove. + /// + /// + + return this.each(function(){ + jQuery.attr( this, name, "" ); + if ( this.nodeType === 1 ) { + this.removeAttribute( name ); + } + }); + }, + + addClass: function( value ) { + /// + /// Adds the specified class(es) to each of the set of matched elements. + /// Part of DOM/Attributes + /// + /// + /// One or more class names to be added to the class attribute of each matched element. + /// + /// + + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.addClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( value && typeof value === "string" ) { + var classNames = (value || "").split( rspaces ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className ) { + elem.className = value; + + } else { + var className = " " + elem.className + " ", + setClass = elem.className; + + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { + setClass += " " + classNames[c]; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + /// + /// Removes all or the specified class(es) from the set of matched elements. + /// Part of DOM/Attributes + /// + /// + /// (Optional) A class name to be removed from the class attribute of each matched element. + /// + /// + + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.removeClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + var classNames = (value || "").split( rspaces ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + var className = (" " + elem.className + " ").replace(rclass, " "); + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[c] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + /// + /// Add or remove a class from each element in the set of matched elements, depending + /// on either the class's presence or the value of the switch argument. + /// + /// + /// A class name to be toggled for each element in the matched set. + /// + /// + /// A boolean value to determine whether the class should be added or removed. + /// + /// + + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this); + self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( rspaces ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery.data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + /// + /// Checks the current selection against a class and returns whether at least one selection has a given class. + /// + /// The class to check against + /// True if at least one element in the selection has the class, otherwise false. + + var className = " " + selector + " "; + for ( var i = 0, l = this.length; i < l; i++ ) { + if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + /// + /// Set the value of every matched element. + /// Part of DOM/Attributes + /// + /// + /// + /// A string of text or an array of strings to set as the value property of each + /// matched element. + /// + + if ( !arguments.length ) { + var elem = this[0]; + + if ( elem ) { + if ( jQuery.nodeName( elem, "option" ) ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery(option).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + } + + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { + return elem.getAttribute("value") === null ? "on" : elem.value; + } + + + // Everything else, we just grab the value + return (elem.value || "").replace(rreturn, ""); + + } + + return undefined; + } + + var isFunction = jQuery.isFunction(value); + + return this.each(function(i) { + var self = jQuery(this), val = value; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call(this, i, self.val()); + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray(val) ) { + val = jQuery.map(val, function (value) { + return value == null ? "" : value + ""; + }); + } + + if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { + this.checked = jQuery.inArray( self.val(), val ) >= 0; + + } else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(val); + + jQuery( "option", this ).each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + this.selectedIndex = -1; + } + + } else { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attr: function( elem, name, value, pass ) { + /// + /// This method is internal. + /// + /// + + // don't set attributes on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery(elem)[name](value); + } + + var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), + // Whether we are setting (or getting) + set = value !== undefined; + + // Try to normalize/fix the name + name = notxml && jQuery.props[ name ] || name; + + // These attributes require special treatment + var special = rspecialurl.test( name ); + + // Safari mis-reports the default selected property of an option + // Accessing the parent's selectedIndex property fixes it + if ( name === "selected" && !jQuery.support.optSelected ) { + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + + // If applicable, access the attribute via the DOM 0 way + // 'in' checks fail in Blackberry 4.7 #6931 + if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) { + if ( set ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } + + if ( value === null ) { + if ( elem.nodeType === 1 ) { + elem.removeAttribute( name ); + } + + } else { + elem[ name ] = value; + } + } + + // browsers index elements by id/name on forms, give priority to attributes. + if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { + return elem.getAttributeNode( name ).nodeValue; + } + + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + if ( name === "tabIndex" ) { + var attributeNode = elem.getAttributeNode( "tabIndex" ); + + return attributeNode && attributeNode.specified ? + attributeNode.value : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + + return elem[ name ]; + } + + if ( !jQuery.support.style && notxml && name === "style" ) { + if ( set ) { + elem.style.cssText = "" + value; + } + + return elem.style.cssText; + } + + if ( set ) { + // convert the value to a string (all browsers do this but IE) see #1070 + elem.setAttribute( name, "" + value ); + } + + // Ensure that missing attributes return undefined + // Blackberry 4.7 returns "" from getAttribute #6938 + if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) { + return undefined; + } + + var attr = !jQuery.support.hrefNormalized && notxml && special ? + // Some attributes require a special call on IE + elem.getAttribute( name, 2 ) : + elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return attr === null ? undefined : attr; + } +}); + + + + +var rnamespaces = /\.(.*)$/, + rformElems = /^(?:textarea|input|select)$/i, + rperiod = /\./g, + rspace = / /g, + rescape = /[^\w\s.|`]/g, + fcleanup = function( nm ) { + return nm.replace(rescape, "\\$&"); + }, + focusCounts = { focusin: 0, focusout: 0 }; + +/* + * A number of helper functions used for managing events. + * Many of the ideas behind this code originated from + * Dean Edwards' addEvent library. + */ +jQuery.event = { + + // Bind an event to an element + // Original by Dean Edwards + add: function( elem, types, handler, data ) { + /// + /// This method is internal. + /// + /// + + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // For whatever reason, IE has trouble passing the window object + // around, causing it to be cloned in the process + if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) { + elem = window; + } + + if ( handler === false ) { + handler = returnFalse; + } else if ( !handler ) { + // Fixes bug #7229. Fix recommended by jdalton + return; + } + + var handleObjIn, handleObj; + + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the function being executed has a unique ID + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure + var elemData = jQuery.data( elem ); + + // If no elemData is found then we must be trying to bind to one of the + // banned noData elements + if ( !elemData ) { + return; + } + + // Use a key less likely to result in collisions for plain JS objects. + // Fixes bug #7150. + var eventKey = elem.nodeType ? "events" : "__events__", + events = elemData[ eventKey ], + eventHandle = elemData.handle; + + if ( typeof events === "function" ) { + // On plain objects events is a fn that holds the the data + // which prevents this data from being JSON serialized + // the function does not need to be called, it just contains the data + eventHandle = events.handle; + events = events.events; + + } else if ( !events ) { + if ( !elem.nodeType ) { + // On plain objects, create a fn that acts as the holder + // of the values to avoid JSON serialization of event data + elemData[ eventKey ] = elemData = function(){}; + } + + elemData.events = events = {}; + } + + if ( !eventHandle ) { + elemData.handle = eventHandle = function() { + // Handle the second event of a trigger and when + // an event is called after a page has unloaded + return typeof jQuery !== "undefined" && !jQuery.event.triggered ? + jQuery.event.handle.apply( eventHandle.elem, arguments ) : + undefined; + }; + } + + // Add elem as a property of the handle function + // This is to prevent a memory leak with non-native events in IE. + eventHandle.elem = elem; + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = types.split(" "); + + var type, i = 0, namespaces; + + while ( (type = types[ i++ ]) ) { + handleObj = handleObjIn ? + jQuery.extend({}, handleObjIn) : + { handler: handler, data: data }; + + // Namespaced event handlers + if ( type.indexOf(".") > -1 ) { + namespaces = type.split("."); + type = namespaces.shift(); + handleObj.namespace = namespaces.slice(0).sort().join("."); + + } else { + namespaces = []; + handleObj.namespace = ""; + } + + handleObj.type = type; + if ( !handleObj.guid ) { + handleObj.guid = handler.guid; + } + + // Get the current list of functions bound to this event + var handlers = events[ type ], + special = jQuery.event.special[ type ] || {}; + + // Init the event handler queue + if ( !handlers ) { + handlers = events[ type ] = []; + + // Check for a special event handler + // Only use addEventListener/attachEvent if the special + // events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add the function to the element's handler list + handlers.push( handleObj ); + + // Keep track of which events have been used, for global triggering + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler ) { + /// + /// This method is internal. + /// + /// + + // don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + if ( handler === false ) { + handler = returnFalse; + } + + var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, + eventKey = elem.nodeType ? "events" : "__events__", + elemData = jQuery.data( elem ), + events = elemData && elemData[ eventKey ]; + + if ( !elemData || !events ) { + return; + } + + if ( typeof events === "function" ) { + elemData = events; + events = events.events; + } + + // types is actually an event object here + if ( types && types.type ) { + handler = types.handler; + types = types.type; + } + + // Unbind all events for the element + if ( !types || typeof types === "string" && types.charAt(0) === "." ) { + types = types || ""; + + for ( type in events ) { + jQuery.event.remove( elem, type + types ); + } + + return; + } + + // Handle multiple events separated by a space + // jQuery(...).unbind("mouseover mouseout", fn); + types = types.split(" "); + + while ( (type = types[ i++ ]) ) { + origType = type; + handleObj = null; + all = type.indexOf(".") < 0; + namespaces = []; + + if ( !all ) { + // Namespaced event handlers + namespaces = type.split("."); + type = namespaces.shift(); + + namespace = new RegExp("(^|\\.)" + + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + eventType = events[ type ]; + + if ( !eventType ) { + continue; + } + + if ( !handler ) { + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( all || namespace.test( handleObj.namespace ) ) { + jQuery.event.remove( elem, origType, handleObj.handler, j ); + eventType.splice( j--, 1 ); + } + } + + continue; + } + + special = jQuery.event.special[ type ] || {}; + + for ( j = pos || 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( handler.guid === handleObj.guid ) { + // remove the given handler for the given type + if ( all || namespace.test( handleObj.namespace ) ) { + if ( pos == null ) { + eventType.splice( j--, 1 ); + } + + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + + if ( pos != null ) { + break; + } + } + } + + // remove generic event handler if no more handlers exist + if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + ret = null; + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + var handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + delete elemData.events; + delete elemData.handle; + + if ( typeof elemData === "function" ) { + jQuery.removeData( elem, eventKey ); + + } else if ( jQuery.isEmptyObject( elemData ) ) { + jQuery.removeData( elem ); + } + } + }, + + // bubbling is internal + trigger: function( event, data, elem /*, bubbling */ ) { + /// + /// This method is internal. + /// + /// + + // Event object or event type + var type = event.type || event, + bubbling = arguments[3]; + + if ( !bubbling ) { + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + jQuery.extend( jQuery.Event(type), event ) : + // Just the event type (string) + jQuery.Event(type); + + if ( type.indexOf("!") >= 0 ) { + event.type = type = type.slice(0, -1); + event.exclusive = true; + } + + // Handle a global trigger + if ( !elem ) { + // Don't bubble custom events when global (to avoid too much overhead) + event.stopPropagation(); + + // Only trigger if we've ever bound an event for it + if ( jQuery.event.global[ type ] ) { + jQuery.each( jQuery.cache, function() { + if ( this.events && this.events[type] ) { + jQuery.event.trigger( event, data, this.handle.elem ); + } + }); + } + } + + // Handle triggering a single element + + // don't do events on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + // Clean up in case it is reused + event.result = undefined; + event.target = elem; + + // Clone the incoming data, if any + data = jQuery.makeArray( data ); + data.unshift( event ); + } + + event.currentTarget = elem; + + // Trigger the event, it is assumed that "handle" is a function + var handle = elem.nodeType ? + jQuery.data( elem, "handle" ) : + (jQuery.data( elem, "__events__" ) || {}).handle; + + if ( handle ) { + handle.apply( elem, data ); + } + + var parent = elem.parentNode || elem.ownerDocument; + + // Trigger an inline bound script + try { + if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { + if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { + event.result = false; + event.preventDefault(); + } + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (inlineError) {} + + if ( !event.isPropagationStopped() && parent ) { + jQuery.event.trigger( event, data, parent, true ); + + } else if ( !event.isDefaultPrevented() ) { + var old, + target = event.target, + targetType = type.replace( rnamespaces, "" ), + isClick = jQuery.nodeName( target, "a" ) && targetType === "click", + special = jQuery.event.special[ targetType ] || {}; + + if ( (!special._default || special._default.call( elem, event ) === false) && + !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { + + try { + if ( target[ targetType ] ) { + // Make sure that we don't accidentally re-trigger the onFOO events + old = target[ "on" + targetType ]; + + if ( old ) { + target[ "on" + targetType ] = null; + } + + jQuery.event.triggered = true; + target[ targetType ](); + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (triggerError) {} + + if ( old ) { + target[ "on" + targetType ] = old; + } + + jQuery.event.triggered = false; + } + } + }, + + handle: function( event ) { + /// + /// This method is internal. + /// + /// + + var all, handlers, namespaces, namespace_re, events, + namespace_sort = [], + args = jQuery.makeArray( arguments ); + + event = args[0] = jQuery.event.fix( event || window.event ); + event.currentTarget = this; + + // Namespaced event handlers + all = event.type.indexOf(".") < 0 && !event.exclusive; + + if ( !all ) { + namespaces = event.type.split("."); + event.type = namespaces.shift(); + namespace_sort = namespaces.slice(0).sort(); + namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.namespace = event.namespace || namespace_sort.join("."); + + events = jQuery.data(this, this.nodeType ? "events" : "__events__"); + + if ( typeof events === "function" ) { + events = events.events; + } + + handlers = (events || {})[ event.type ]; + + if ( events && handlers ) { + // Clone the handlers to prevent manipulation + handlers = handlers.slice(0); + + for ( var j = 0, l = handlers.length; j < l; j++ ) { + var handleObj = handlers[ j ]; + + // Filter the functions by class + if ( all || namespace_re.test( handleObj.namespace ) ) { + // Pass in a reference to the handler function itself + // So that we can later remove it + event.handler = handleObj.handler; + event.data = handleObj.data; + event.handleObj = handleObj; + + var ret = handleObj.handler.apply( this, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + } + + return event.result; + }, + + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), + + fix: function( event ) { + /// + /// This method is internal. + /// + /// + + if ( event[ jQuery.expando ] ) { + return event; + } + + // store a copy of the original event object + // and "clone" to set read-only properties + var originalEvent = event; + event = jQuery.Event( originalEvent ); + + for ( var i = this.props.length, prop; i; ) { + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary + if ( !event.target ) { + // Fixes #1925 where srcElement might not be defined either + event.target = event.srcElement || document; + } + + // check if target is a textnode (safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && event.fromElement ) { + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + } + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && event.clientX != null ) { + var doc = document.documentElement, + body = document.body; + + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Add which for key events + if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { + event.which = event.charCode != null ? event.charCode : event.keyCode; + } + + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) + if ( !event.metaKey && event.ctrlKey ) { + event.metaKey = event.ctrlKey; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && event.button !== undefined ) { + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); + } + + return event; + }, + + // Deprecated, use jQuery.guid instead + guid: 1E8, + + // Deprecated, use jQuery.proxy instead + proxy: jQuery.proxy, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady, + teardown: jQuery.noop + }, + + live: { + add: function( handleObj ) { + jQuery.event.add( this, + liveConvert( handleObj.origType, handleObj.selector ), + jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); + }, + + remove: function( handleObj ) { + jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); + } + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + if ( elem.detachEvent ) { + elem.detachEvent( "on" + type, handle ); + } + }; + +jQuery.Event = function( src ) { + // Allow instantiation without the 'new' keyword + if ( !this.preventDefault ) { + return new jQuery.Event( src ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + // Event type + } else { + this.type = src; + } + + // timeStamp is buggy for some events on Firefox(#3843) + // So we won't rely on the native value + this.timeStamp = jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Checks if an event happened on an element within another element +// Used in jQuery.event.special.mouseenter and mouseleave handlers +var withinElement = function( event ) { + // Check if mouse(over|out) are still within the same parent element + var parent = event.relatedTarget; + + // Firefox sometimes assigns relatedTarget a XUL element + // which we cannot access the parentNode property of + try { + // Traverse up the tree + while ( parent && parent !== this ) { + parent = parent.parentNode; + } + + if ( parent !== this ) { + // set the correct event type + event.type = event.data; + + // handle event if we actually just moused on to a non sub-element + jQuery.event.handle.apply( this, arguments ); + } + + // assuming we've left the element since we most likely mousedover a xul element + } catch(e) { } +}, + +// In case of event delegation, we only need to rename the event.type, +// liveHandler will take care of the rest. +delegate = function( event ) { + event.type = event.data; + jQuery.event.handle.apply( this, arguments ); +}; + +// Create mouseenter and mouseleave events +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + setup: function( data ) { + jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); + }, + teardown: function( data ) { + jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); + } + }; +}); + +// submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function( data, namespaces ) { + if ( this.nodeName.toLowerCase() !== "form" ) { + jQuery.event.add(this, "click.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { + e.liveFired = undefined; + return trigger( "submit", this, arguments ); + } + }); + + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { + e.liveFired = undefined; + return trigger( "submit", this, arguments ); + } + }); + + } else { + return false; + } + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialSubmit" ); + } + }; + +} + +// change delegation, happens here so we have bind. +if ( !jQuery.support.changeBubbles ) { + + var changeFilters, + + getVal = function( elem ) { + var type = elem.type, val = elem.value; + + if ( type === "radio" || type === "checkbox" ) { + val = elem.checked; + + } else if ( type === "select-multiple" ) { + val = elem.selectedIndex > -1 ? + jQuery.map( elem.options, function( elem ) { + return elem.selected; + }).join("-") : + ""; + + } else if ( elem.nodeName.toLowerCase() === "select" ) { + val = elem.selectedIndex; + } + + return val; + }, + + testChange = function testChange( e ) { + var elem = e.target, data, val; + + if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { + return; + } + + data = jQuery.data( elem, "_change_data" ); + val = getVal(elem); + + // the current data will be also retrieved by beforeactivate + if ( e.type !== "focusout" || elem.type !== "radio" ) { + jQuery.data( elem, "_change_data", val ); + } + + if ( data === undefined || val === data ) { + return; + } + + if ( data != null || val ) { + e.type = "change"; + e.liveFired = undefined; + return jQuery.event.trigger( e, arguments[1], elem ); + } + }; + + jQuery.event.special.change = { + filters: { + focusout: testChange, + + beforedeactivate: testChange, + + click: function( e ) { + var elem = e.target, type = elem.type; + + if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { + return testChange.call( this, e ); + } + }, + + // Change has to be called before submit + // Keydown will be called before keypress, which is used in submit-event delegation + keydown: function( e ) { + var elem = e.target, type = elem.type; + + if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || + (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || + type === "select-multiple" ) { + return testChange.call( this, e ); + } + }, + + // Beforeactivate happens also before the previous element is blurred + // with this event you can't trigger a change event, but you can store + // information + beforeactivate: function( e ) { + var elem = e.target; + jQuery.data( elem, "_change_data", getVal(elem) ); + } + }, + + setup: function( data, namespaces ) { + if ( this.type === "file" ) { + return false; + } + + for ( var type in changeFilters ) { + jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); + } + + return rformElems.test( this.nodeName ); + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialChange" ); + + return rformElems.test( this.nodeName ); + } + }; + + changeFilters = jQuery.event.special.change.filters; + + // Handle when the input is .focus()'d + changeFilters.focus = changeFilters.beforeactivate; +} + +function trigger( type, elem, args ) { + args[0].type = type; + return jQuery.event.handle.apply( elem, args ); +} + +// Create "bubbling" focus and blur events +if ( document.addEventListener ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + jQuery.event.special[ fix ] = { + setup: function() { + /// + /// This method is internal. + /// + /// + + if ( focusCounts[fix]++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + /// + /// This method is internal. + /// + /// + + if ( --focusCounts[fix] === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + + function handler( e ) { + e = jQuery.event.fix( e ); + e.type = fix; + return jQuery.event.trigger( e, null, e.target ); + } + }); +} + +// jQuery.each(["bind", "one"], function( i, name ) { +// jQuery.fn[ name ] = function( type, data, fn ) { +// // Handle object literals +// if ( typeof type === "object" ) { +// for ( var key in type ) { +// this[ name ](key, data, type[key], fn); +// } +// return this; +// } + +// if ( jQuery.isFunction( data ) || data === false ) { +// fn = data; +// data = undefined; +// } + +// var handler = name === "one" ? jQuery.proxy( fn, function( event ) { +// jQuery( this ).unbind( event, handler ); +// return fn.apply( this, arguments ); +// }) : fn; + +// if ( type === "unload" && name !== "one" ) { +// this.one( type, data, fn ); + +// } else { +// for ( var i = 0, l = this.length; i < l; i++ ) { +// jQuery.event.add( this[i], type, handler, data ); +// } +// } + +// return this; +// }; +// }); + +jQuery.fn[ "bind" ] = function( type, data, fn ) { + /// + /// Binds a handler to one or more events for each matched element. Can also bind custom events. + /// + /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . + /// Additional data passed to the event handler as event.data + /// A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element. + + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ "bind" ](key, data, type[key], fn); + } + return this; + } + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + var handler = "bind" === "one" ? jQuery.proxy( fn, function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }) : fn; + + return type === "unload" && "bind" !== "one" ? + this.one( type, data, fn ) : + this.each(function() { + jQuery.event.add( this, type, handler, data ); + }); +}; + +jQuery.fn[ "one" ] = function( type, data, fn ) { + /// + /// Binds a handler to one or more events to be executed exactly once for each matched element. + /// + /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . + /// Additional data passed to the event handler as event.data + /// A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element. + + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ "one" ](key, data, type[key], fn); + } + return this; + } + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + var handler = "one" === "one" ? jQuery.proxy( fn, function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }) : fn; + + return type === "unload" && "one" !== "one" ? + this.one( type, data, fn ) : + this.each(function() { + jQuery.event.add( this, type, handler, data ); + }); +}; + +jQuery.fn.extend({ + unbind: function( type, fn ) { + /// + /// Unbinds a handler from one or more events for each matched element. + /// + /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . + /// A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element. + + // Handle object literals + if ( typeof type === "object" && !type.preventDefault ) { + for ( var key in type ) { + this.unbind(key, type[key]); + } + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.remove( this[i], type, fn ); + } + } + + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.live( types, data, fn, selector ); + }, + + undelegate: function( selector, types, fn ) { + if ( arguments.length === 0 ) { + return this.unbind( "live" ); + + } else { + return this.die( types, null, fn, selector ); + } + }, + + trigger: function( type, data ) { + /// + /// Triggers a type of event on every matched element. + /// + /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . + /// Additional data passed to the event handler as additional arguments. + /// This parameter is undocumented. + + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + + triggerHandler: function( type, data ) { + /// + /// Triggers all bound event handlers on an element for a specific event type without executing the browser's default actions. + /// + /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . + /// Additional data passed to the event handler as additional arguments. + /// This parameter is undocumented. + + if ( this[0] ) { + var event = jQuery.Event( type ); + event.preventDefault(); + event.stopPropagation(); + jQuery.event.trigger( event, data, this[0] ); + return event.result; + } + }, + + toggle: function( fn ) { + /// + /// Toggles among two or more function calls every other click. + /// + /// The functions among which to toggle execution + + // Save reference to arguments for access in closure + var args = arguments, + i = 1; + + // link all the functions, so any of them can unbind this click handler + while ( i < args.length ) { + jQuery.proxy( fn, args[ i++ ] ); + } + + return this.click( jQuery.proxy( fn, function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + })); + }, + + hover: function( fnOver, fnOut ) { + /// + /// Simulates hovering (moving the mouse on or off of an object). + /// + /// The function to fire when the mouse is moved over a matched element. + /// The function to fire when the mouse is moved off of a matched element. + + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +var liveMap = { + focus: "focusin", + blur: "focusout", + mouseenter: "mouseover", + mouseleave: "mouseout" +}; + +// jQuery.each(["live", "die"], function( i, name ) { +// jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { +// var type, i = 0, match, namespaces, preType, +// selector = origSelector || this.selector, +// context = origSelector ? this : jQuery( this.context ); + +// if ( typeof types === "object" && !types.preventDefault ) { +// for ( var key in types ) { +// context[ name ]( key, data, types[key], selector ); +// } + +// return this; +// } + +// if ( jQuery.isFunction( data ) ) { +// fn = data; +// data = undefined; +// } + +// types = (types || "").split(" "); + +// while ( (type = types[ i++ ]) != null ) { +// match = rnamespaces.exec( type ); +// namespaces = ""; + +// if ( match ) { +// namespaces = match[0]; +// type = type.replace( rnamespaces, "" ); +// } + +// if ( type === "hover" ) { +// types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); +// continue; +// } + +// preType = type; + +// if ( type === "focus" || type === "blur" ) { +// types.push( liveMap[ type ] + namespaces ); +// type = type + namespaces; + +// } else { +// type = (liveMap[ type ] || type) + namespaces; +// } + +// if ( name === "live" ) { +// // bind live handler +// for ( var j = 0, l = context.length; j < l; j++ ) { +// jQuery.event.add( context[j], "live." + liveConvert( type, selector ), +// { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); +// } + +// } else { +// // unbind live handler +// context.unbind( "live." + liveConvert( type, selector ), fn ); +// } +// } + +// return this; +// }; +// }); + +jQuery.fn[ "live" ] = function( types, data, fn ) { + /// + /// Attach a handler to the event for all elements which match the current selector, now or + /// in the future. + /// + /// + /// A string containing a JavaScript event type, such as "click" or "keydown". + /// + /// + /// A map of data that will be passed to the event handler. + /// + /// + /// A function to execute at the time the event is triggered. + /// + /// + + var type, i = 0; + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + types = (types || "").split( /\s+/ ); + + while ( (type = types[ i++ ]) != null ) { + type = type === "focus" ? "focusin" : // focus --> focusin + type === "blur" ? "focusout" : // blur --> focusout + type === "hover" ? types.push("mouseleave") && "mouseenter" : // hover support + type; + + if ( "live" === "live" ) { + // bind live handler + jQuery( this.context ).bind( liveConvert( type, this.selector ), { + data: data, selector: this.selector, live: type + }, fn ); + + } else { + // unbind live handler + jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null ); + } + } + + return this; +} + +jQuery.fn[ "die" ] = function( types, data, fn ) { + /// + /// Remove all event handlers previously attached using .live() from the elements. + /// + /// + /// A string containing a JavaScript event type, such as click or keydown. + /// + /// + /// The function that is to be no longer executed. + /// + /// + + var type, i = 0; + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + types = (types || "").split( /\s+/ ); + + while ( (type = types[ i++ ]) != null ) { + type = type === "focus" ? "focusin" : // focus --> focusin + type === "blur" ? "focusout" : // blur --> focusout + type === "hover" ? types.push("mouseleave") && "mouseenter" : // hover support + type; + + if ( "die" === "live" ) { + // bind live handler + jQuery( this.context ).bind( liveConvert( type, this.selector ), { + data: data, selector: this.selector, live: type + }, fn ); + + } else { + // unbind live handler + jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null ); + } + } + + return this; +} + +function liveHandler( event ) { + var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, + elems = [], + selectors = [], + events = jQuery.data( this, this.nodeType ? "events" : "__events__" ); + + if ( typeof events === "function" ) { + events = events.events; + } + + // Make sure we avoid non-left-click bubbling in Firefox (#3861) + if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) { + return; + } + + if ( event.namespace ) { + namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.liveFired = this; + + var live = events.live.slice(0); + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { + selectors.push( handleObj.selector ); + + } else { + live.splice( j--, 1 ); + } + } + + match = jQuery( event.target ).closest( selectors, event.currentTarget ); + + for ( i = 0, l = match.length; i < l; i++ ) { + close = match[i]; + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) { + elem = close.elem; + related = null; + + // Those two events require additional checking + if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { + event.type = handleObj.preType; + related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; + } + + if ( !related || related !== elem ) { + elems.push({ elem: elem, handleObj: handleObj, level: close.level }); + } + } + } + } + + for ( i = 0, l = elems.length; i < l; i++ ) { + match = elems[i]; + + if ( maxLevel && match.level > maxLevel ) { + break; + } + + event.currentTarget = match.elem; + event.data = match.handleObj.data; + event.handleObj = match.handleObj; + + ret = match.handleObj.origHandler.apply( match.elem, arguments ); + + if ( ret === false || event.isPropagationStopped() ) { + maxLevel = match.level; + + if ( ret === false ) { + stop = false; + } + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + + return stop; +} + +function liveConvert( type, selector ) { + return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&"); +} + +// jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + +// "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + +// "change select submit keydown keypress keyup error").split(" "), function( i, name ) { + +// // Handle event binding +// jQuery.fn[ name ] = function( data, fn ) { +// if ( fn == null ) { +// fn = data; +// data = null; +// } + +// return arguments.length > 0 ? +// this.bind( name, data, fn ) : +// this.trigger( name ); +// }; + +// if ( jQuery.attrFn ) { +// jQuery.attrFn[ name ] = true; +// } +// }); + +jQuery.fn[ "blur" ] = function( fn ) { + /// + /// 1: blur() - Triggers the blur event of each matched element. + /// 2: blur(fn) - Binds a function to the blur event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "blur", fn ) : this.trigger( "blur" ); +}; + +jQuery.fn[ "focus" ] = function( fn ) { + /// + /// 1: focus() - Triggers the focus event of each matched element. + /// 2: focus(fn) - Binds a function to the focus event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "focus", fn ) : this.trigger( "focus" ); +}; + +jQuery.fn[ "focusin" ] = function( fn ) { + /// + /// Bind an event handler to the "focusin" JavaScript event. + /// + /// + /// A function to execute each time the event is triggered. + /// + /// + + return fn ? this.bind( "focusin", fn ) : this.trigger( "focusin" ); +}; + +jQuery.fn[ "focusout" ] = function( fn ) { + /// + /// Bind an event handler to the "focusout" JavaScript event. + /// + /// + /// A function to execute each time the event is triggered. + /// + /// + + return fn ? this.bind( "focusout", fn ) : this.trigger( "focusout" ); +}; + +jQuery.fn[ "load" ] = function( fn ) { + /// + /// 1: load() - Triggers the load event of each matched element. + /// 2: load(fn) - Binds a function to the load event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "load", fn ) : this.trigger( "load" ); +}; + +jQuery.fn[ "resize" ] = function( fn ) { + /// + /// 1: resize() - Triggers the resize event of each matched element. + /// 2: resize(fn) - Binds a function to the resize event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "resize", fn ) : this.trigger( "resize" ); +}; + +jQuery.fn[ "scroll" ] = function( fn ) { + /// + /// 1: scroll() - Triggers the scroll event of each matched element. + /// 2: scroll(fn) - Binds a function to the scroll event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "scroll", fn ) : this.trigger( "scroll" ); +}; + +jQuery.fn[ "unload" ] = function( fn ) { + /// + /// 1: unload() - Triggers the unload event of each matched element. + /// 2: unload(fn) - Binds a function to the unload event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "unload", fn ) : this.trigger( "unload" ); +}; + +jQuery.fn[ "click" ] = function( fn ) { + /// + /// 1: click() - Triggers the click event of each matched element. + /// 2: click(fn) - Binds a function to the click event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "click", fn ) : this.trigger( "click" ); +}; + +jQuery.fn[ "dblclick" ] = function( fn ) { + /// + /// 1: dblclick() - Triggers the dblclick event of each matched element. + /// 2: dblclick(fn) - Binds a function to the dblclick event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "dblclick", fn ) : this.trigger( "dblclick" ); +}; + +jQuery.fn[ "mousedown" ] = function( fn ) { + /// + /// Binds a function to the mousedown event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "mousedown", fn ) : this.trigger( "mousedown" ); +}; + +jQuery.fn[ "mouseup" ] = function( fn ) { + /// + /// Bind a function to the mouseup event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "mouseup", fn ) : this.trigger( "mouseup" ); +}; + +jQuery.fn[ "mousemove" ] = function( fn ) { + /// + /// Bind a function to the mousemove event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "mousemove", fn ) : this.trigger( "mousemove" ); +}; + +jQuery.fn[ "mouseover" ] = function( fn ) { + /// + /// Bind a function to the mouseover event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "mouseover", fn ) : this.trigger( "mouseover" ); +}; + +jQuery.fn[ "mouseout" ] = function( fn ) { + /// + /// Bind a function to the mouseout event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "mouseout", fn ) : this.trigger( "mouseout" ); +}; + +jQuery.fn[ "mouseenter" ] = function( fn ) { + /// + /// Bind a function to the mouseenter event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "mouseenter", fn ) : this.trigger( "mouseenter" ); +}; + +jQuery.fn[ "mouseleave" ] = function( fn ) { + /// + /// Bind a function to the mouseleave event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "mouseleave", fn ) : this.trigger( "mouseleave" ); +}; + +jQuery.fn[ "change" ] = function( fn ) { + /// + /// 1: change() - Triggers the change event of each matched element. + /// 2: change(fn) - Binds a function to the change event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "change", fn ) : this.trigger( "change" ); +}; + +jQuery.fn[ "select" ] = function( fn ) { + /// + /// 1: select() - Triggers the select event of each matched element. + /// 2: select(fn) - Binds a function to the select event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "select", fn ) : this.trigger( "select" ); +}; + +jQuery.fn[ "submit" ] = function( fn ) { + /// + /// 1: submit() - Triggers the submit event of each matched element. + /// 2: submit(fn) - Binds a function to the submit event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "submit", fn ) : this.trigger( "submit" ); +}; + +jQuery.fn[ "keydown" ] = function( fn ) { + /// + /// 1: keydown() - Triggers the keydown event of each matched element. + /// 2: keydown(fn) - Binds a function to the keydown event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "keydown", fn ) : this.trigger( "keydown" ); +}; + +jQuery.fn[ "keypress" ] = function( fn ) { + /// + /// 1: keypress() - Triggers the keypress event of each matched element. + /// 2: keypress(fn) - Binds a function to the keypress event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "keypress", fn ) : this.trigger( "keypress" ); +}; + +jQuery.fn[ "keyup" ] = function( fn ) { + /// + /// 1: keyup() - Triggers the keyup event of each matched element. + /// 2: keyup(fn) - Binds a function to the keyup event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "keyup", fn ) : this.trigger( "keyup" ); +}; + +jQuery.fn[ "error" ] = function( fn ) { + /// + /// 1: error() - Triggers the error event of each matched element. + /// 2: error(fn) - Binds a function to the error event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "error", fn ) : this.trigger( "error" ); +}; + +// Prevent memory leaks in IE +// Window isn't included so as not to unbind existing unload events +// More info: +// - http://isaacschlueter.com/2006/10/msie-memory-leaks/ +if ( window.attachEvent && !window.addEventListener ) { + jQuery(window).bind("unload", function() { + for ( var id in jQuery.cache ) { + if ( jQuery.cache[ id ].handle ) { + // Try/Catch is to handle iframes being unloaded, see #4280 + try { + jQuery.event.remove( jQuery.cache[ id ].handle.elem ); + } catch(e) {} + } + } + }); +} + + +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function() { + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function( selector, context, results, seed ) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var m, set, checkSet, extra, ret, cur, pop, i, + prune = true, + contextXML = Sizzle.isXML( context ), + parts = [], + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec( "" ); + m = chunker.exec( soFar ); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? + Sizzle.filter( ret.expr, ret.set )[0] : + ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + + set = ret.expr ? + Sizzle.filter( ret.expr, ret.set ) : + ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray( set ); + + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function( results ) { + /// + /// Removes all duplicate elements from an array of elements. + /// + /// The array to translate + /// The array after translation. + + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + } + + return results; +}; + +Sizzle.matches = function( expr, set ) { + return Sizzle( expr, null, null, set ); +}; + +Sizzle.matchesSelector = function( node, expr ) { + return Sizzle( expr, null, null, [node] ).length > 0; +}; + +Sizzle.find = function( expr, context, isXML ) { + var set; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var match, + type = Expr.order[i]; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice( 1, 1 ); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace(/\\/g, ""); + set = Expr.find[ type ]( match, context, isXML ); + + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = context.getElementsByTagName( "*" ); + } + + return { set: set, expr: expr }; +}; + +Sizzle.filter = function( expr, set, inplace, not ) { + var match, anyFound, + old = expr, + result = [], + curLoop = set, + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var found, item, + filter = Expr.filter[ type ], + left = match[1]; + + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + + } else { + curLoop[i] = false; + } + + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + + leftMatch: {}, + + attrMap: { + "class": "className", + "for": "htmlFor" + }, + + attrHandle: { + href: function( elem ) { + return elem.getAttribute( "href" ); + } + }, + + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !/\W/.test( part ), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + + ">": function( checkSet, part ) { + var elem, + isPartStr = typeof part === "string", + i = 0, + l = checkSet.length; + + if ( isPartStr && !/\W/.test( part ) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + + "": function(checkSet, part, isXML){ + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); + }, + + "~": function( checkSet, part, isXML ) { + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); + } + }, + + find: { + ID: function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }, + + NAME: function( match, context ) { + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], + results = context.getElementsByName( match[1] ); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + + TAG: function( match, context ) { + return context.getElementsByTagName( match[1] ); + } + }, + preFilter: { + CLASS: function( match, curLoop, inplace, result, not, isXML ) { + match = " " + match[1].replace(/\\/g, "") + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + + ID: function( match ) { + return match[1].replace(/\\/g, ""); + }, + + TAG: function( match, curLoop ) { + return match[1].toLowerCase(); + }, + + CHILD: function( match ) { + if ( match[1] === "nth" ) { + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + + ATTR: function( match, curLoop, inplace, result, not, isXML ) { + var name = match[1].replace(/\\/g, ""); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + + PSEUDO: function( match, curLoop, inplace, result, not ) { + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + + if ( !inplace ) { + result.push.apply( result, ret ); + } + + return false; + } + + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + + POS: function( match ) { + match.unshift( true ); + + return match; + } + }, + + filters: { + enabled: function( elem ) { + return elem.disabled === false && elem.type !== "hidden"; + }, + + disabled: function( elem ) { + return elem.disabled === true; + }, + + checked: function( elem ) { + return elem.checked === true; + }, + + selected: function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + elem.parentNode.selectedIndex; + + return elem.selected === true; + }, + + parent: function( elem ) { + return !!elem.firstChild; + }, + + empty: function( elem ) { + return !elem.firstChild; + }, + + has: function( elem, i, match ) { + /// + /// Internal use only; use hasClass('class') + /// + /// + + return !!Sizzle( match[3], elem ).length; + }, + + header: function( elem ) { + return (/h\d/i).test( elem.nodeName ); + }, + + text: function( elem ) { + return "text" === elem.type; + }, + radio: function( elem ) { + return "radio" === elem.type; + }, + + checkbox: function( elem ) { + return "checkbox" === elem.type; + }, + + file: function( elem ) { + return "file" === elem.type; + }, + password: function( elem ) { + return "password" === elem.type; + }, + + submit: function( elem ) { + return "submit" === elem.type; + }, + + image: function( elem ) { + return "image" === elem.type; + }, + + reset: function( elem ) { + return "reset" === elem.type; + }, + + button: function( elem ) { + return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; + }, + + input: function( elem ) { + return (/input|select|textarea|button/i).test( elem.nodeName ); + } + }, + setFilters: { + first: function( elem, i ) { + return i === 0; + }, + + last: function( elem, i, match, array ) { + return i === array.length - 1; + }, + + even: function( elem, i ) { + return i % 2 === 0; + }, + + odd: function( elem, i ) { + return i % 2 === 1; + }, + + lt: function( elem, i, match ) { + return i < match[3] - 0; + }, + + gt: function( elem, i, match ) { + return i > match[3] - 0; + }, + + nth: function( elem, i, match ) { + return match[3] - 0 === i; + }, + + eq: function( elem, i, match ) { + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function( elem, match, i, array ) { + var name = match[1], + filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; + + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + + } else { + Sizzle.error( "Syntax error, unrecognized expression: " + name ); + } + }, + + CHILD: function( elem, match ) { + var type = match[1], + node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + + case "nth": + var first = match[2], + last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + + if ( first === 0 ) { + return diff === 0; + + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + + ID: function( elem, match ) { + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + + TAG: function( elem, match ) { + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + + CLASS: function( elem, match ) { + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + + ATTR: function( elem, match ) { + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + + POS: function( elem, match, i, array ) { + var name = match[2], + filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} + +var makeArray = function( array, results ) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch( e ) { + makeArray = function( array, results ) { + var i = 0, + ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder, siblingCheck; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + return a.compareDocumentPosition ? -1 : 1; + } + + return a.compareDocumentPosition(b) & 4 ? -1 : 1; + }; + +} else { + sortOrder = function( a, b ) { + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // If the nodes are siblings (or identical) we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + + siblingCheck = function( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +Sizzle.getText = function( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += Sizzle.getText( elem.childNodes ); + } + } + + return ret; +}; + +// [vsdoc] The following function has been modified for IntelliSense. +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + // var form = document.createElement("div"), + // id = "script" + (new Date()).getTime(), + // root = document.documentElement; + + // form.innerHTML = ""; + + // // Inject it into the root element, check its status, and remove it quickly + // root.insertBefore( form, root.firstChild ); + + // // The workaround has to do additional checks after a getElementById + // // Which slows things down for other browsers (hence the branching) + // if ( document.getElementById( id ) ) { + Expr.find.ID = function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + + return m ? + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? + [m] : + undefined : + []; + } + }; + + Expr.filter.ID = function( elem, match ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + // } + + // root.removeChild( form ); + + // release memory in IE + root = form = null; +})(); + +// [vsdoc] The following function has been modified for IntelliSense. +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + // var div = document.createElement("div"); + // div.appendChild( document.createComment("") ); + + // Make sure no comments are found + // if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function( match, context ) { + var results = context.getElementsByTagName( match[1] ); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + // } + + // Check to see if an attribute returns normalized href attributes + // div.innerHTML = ""; + + // if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + // div.firstChild.getAttribute("href") !== "#" ) { + + // Expr.attrHandle.href = function( elem ) { + // return elem.getAttribute( "href", 2 ); + // }; + // } + + // release memory in IE + div = null; +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, + div = document.createElement("div"), + id = "__sizzle__"; + + div.innerHTML = "

"; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function( query, context, extra, seed ) { + context = context || document; + + // Make sure that attribute selectors are quoted + query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && !Sizzle.isXML(context) ) { + if ( context.nodeType === 9 ) { + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(qsaError) {} + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + var old = context.getAttribute( "id" ), + nid = old || id; + + if ( !old ) { + context.setAttribute( "id", nid ); + } + + try { + return makeArray( context.querySelectorAll( "#" + nid + " " + query ), extra ); + + } catch(pseudoError) { + } finally { + if ( !old ) { + context.removeAttribute( "id" ); + } + } + } + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + // release memory in IE + div = null; + })(); +} + +(function(){ + var html = document.documentElement, + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector, + pseudoWorks = false; + + try { + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( document.documentElement, "[test!='']:sizzle" ); + + } catch( pseudoError ) { + pseudoWorks = true; + } + + if ( matches ) { + Sizzle.matchesSelector = function( node, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + if ( !Sizzle.isXML( node ) ) { + try { + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { + return matches.call( node, expr ); + } + } catch(e) {} + } + + return Sizzle(expr, null, null, [node]).length > 0; + }; + } +})(); + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
"; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function( match, context, isXML ) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + // release memory in IE + div = null; +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +if ( document.documentElement.contains ) { + Sizzle.contains = function( a, b ) { + /// + /// Check to see if a DOM node is within another DOM node. + /// + /// + /// The DOM element that may contain the other element. + /// + /// + /// The DOM node that may be contained by the other element. + /// + /// + + return a !== b && (a.contains ? a.contains(b) : true); + }; + +} else if ( document.documentElement.compareDocumentPosition ) { + Sizzle.contains = function( a, b ) { + /// + /// Check to see if a DOM node is within another DOM node. + /// + /// + /// The DOM element that may contain the other element. + /// + /// + /// The DOM node that may be contained by the other element. + /// + /// + + return !!(a.compareDocumentPosition(b) & 16); + }; + +} else { + Sizzle.contains = function() { + return false; + }; +} + +Sizzle.isXML = function( elem ) { + /// + /// Determines if the parameter passed is an XML document. + /// + /// The object to test + /// True if the parameter is an XML document; otherwise false. + + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function( selector, context ) { + var match, + tmpSet = [], + later = "", + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})(); + + +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + isSimple = /^.[^:#\[\.,]*$/, + slice = Array.prototype.slice, + POS = jQuery.expr.match.POS; + +jQuery.fn.extend({ + find: function( selector ) { + /// + /// Searches for all elements that match the specified expression. + /// This method is a good way to find additional descendant + /// elements with which to process. + /// All searching is done using a jQuery expression. The expression can be + /// written using CSS 1-3 Selector syntax, or basic XPath. + /// Part of DOM/Traversing + /// + /// + /// + /// An expression to search with. + /// + /// + + var ret = this.pushStack( "", "find", selector ), + length = 0; + + for ( var i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( var n = length; n < ret.length; n++ ) { + for ( var r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + /// + /// Reduce the set of matched elements to those that have a descendant that matches the + /// selector or DOM element. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + /// + /// Removes any elements inside the array of elements from the set + /// of matched elements. This method is used to remove one or more + /// elements from a jQuery object. + /// Part of DOM/Traversing + /// + /// + /// A set of elements to remove from the jQuery set of matched elements. + /// + /// + + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + /// + /// Removes all elements from the set of matched elements that do not + /// pass the specified filter. This method is used to narrow down + /// the results of a search. + /// }) + /// Part of DOM/Traversing + /// + /// + /// + /// A function to use for filtering + /// + /// + + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + /// + /// Checks the current selection against an expression and returns true, + /// if at least one element of the selection fits the given expression. + /// Does return false, if no element fits or the expression is not valid. + /// filter(String) is used internally, therefore all rules that apply there + /// apply here, too. + /// Part of DOM/Traversing + /// + /// + /// + /// The expression with which to filter + /// + + return !!selector && jQuery.filter( selector, this ).length > 0; + }, + + closest: function( selectors, context ) { + /// + /// Get a set of elements containing the closest parent element that matches the specified selector, the starting element included. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + /// A DOM element within which a matching element may be found. If no context is passed + /// in then the context of the jQuery set will be used instead. + /// + /// + + var ret = [], i, l, cur = this[0]; + + if ( jQuery.isArray( selectors ) ) { + var match, selector, + matches = {}, + level = 1; + + if ( cur && selectors.length ) { + for ( i = 0, l = selectors.length; i < l; i++ ) { + selector = selectors[i]; + + if ( !matches[selector] ) { + matches[selector] = jQuery.expr.match.POS.test( selector ) ? + jQuery( selector, context || this.context ) : + selector; + } + } + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( selector in matches ) { + match = matches[selector]; + + if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { + ret.push({ selector: selector, elem: cur, level: level }); + } + } + + cur = cur.parentNode; + level++; + } + } + + return ret; + } + + var pos = POS.test( selectors ) ? + jQuery( selectors, context || this.context ) : null; + + for ( i = 0, l = this.length; i < l; i++ ) { + cur = this[i]; + + while ( cur ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + + } else { + cur = cur.parentNode; + if ( !cur || !cur.ownerDocument || cur === context ) { + break; + } + } + } + } + + ret = ret.length > 1 ? jQuery.unique(ret) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + /// + /// Searches every matched element for the object and returns + /// the index of the element, if found, starting with zero. + /// Returns -1 if the object wasn't found. + /// Part of Core + /// + /// + /// + /// Object to search for + /// + + if ( !elem || typeof elem === "string" ) { + return jQuery.inArray( this[0], + // If it receives a string, the selector is used + // If it receives nothing, the siblings are used + elem ? jQuery( elem ) : this.parent().children() ); + } + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + /// + /// Adds one or more Elements to the set of matched elements. + /// Part of DOM/Traversing + /// + /// + /// A string containing a selector expression to match additional elements against. + /// + /// + /// Add some elements rooted against the specified context. + /// + /// + + var set = typeof selector === "string" ? + jQuery( selector, context || this.context ) : + jQuery.makeArray( selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + /// + /// Adds the previous selection to the current selection. + /// + /// + + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.fn.parents = function (until, selector) { + /// + /// Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + return jQuery.dir(elem, "parentNode"); +}; + +jQuery.fn.parentsUntil = function (until, selector) { + /// + /// Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching ancestor elements. + /// + /// + return jQuery.dir(elem, "parentNode", until); +}; + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + /// + /// Get all following siblings of each element up to but not including the element matched + /// by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching following + /// sibling elements. + /// + /// + + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + /// + /// Get all preceding siblings of each element up to but not including the element matched + /// by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching preceding + /// sibling elements. + /// + /// + + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( elem.parentNode.firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, slice.call(arguments).join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + /// + /// This member is internal only. + /// + /// + + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + /// + /// This member is internal only. + /// + /// + + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + /// + /// This member is internal only. + /// + /// + + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return (elem === qualifier) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return (jQuery.inArray( elem, qualifier ) >= 0) === keep; + }); +} + + + + +var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rtagName = /<([\w:]+)/, + rtbody = /\s]+\/)>/g, + wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
", "
" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + col: [ 2, "", "
" ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }; + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and diff --git a/IntegrationTests/Azure/AzureHost/Host/Views/Home/Index.cshtml b/IntegrationTests/Azure/AzureHost/Host/Views/Home/Index.cshtml new file mode 100644 index 00000000000..a4d237985cb --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Views/Home/Index.cshtml @@ -0,0 +1,9 @@ +@{ + ViewBag.Title = "Hello"; +} + +

Say hello

+ +
+ +
diff --git a/IntegrationTests/Azure/AzureHost/Host/Views/Shared/Error.cshtml b/IntegrationTests/Azure/AzureHost/Host/Views/Shared/Error.cshtml new file mode 100644 index 00000000000..7618dc415f8 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Views/Shared/Error.cshtml @@ -0,0 +1,15 @@ +@{ + Layout = null; +} + + + + + Error + + +

+ Sorry, an error occurred while processing your request. +

+ + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/Views/Shared/_Layout.cshtml b/IntegrationTests/Azure/AzureHost/Host/Views/Shared/_Layout.cshtml new file mode 100644 index 00000000000..21ad8dd8f31 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Views/Shared/_Layout.cshtml @@ -0,0 +1,14 @@ + + + + + @ViewBag.Title + + + + + + + @RenderBody() + + diff --git a/IntegrationTests/Azure/AzureHost/Host/Views/Web.config b/IntegrationTests/Azure/AzureHost/Host/Views/Web.config new file mode 100644 index 00000000000..a4def2a3db5 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Views/Web.config @@ -0,0 +1,58 @@ + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/IntegrationTests/Azure/AzureHost/Host/Views/_ViewStart.cshtml b/IntegrationTests/Azure/AzureHost/Host/Views/_ViewStart.cshtml new file mode 100644 index 00000000000..efda124b1fc --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/Web.Debug.config b/IntegrationTests/Azure/AzureHost/Host/Web.Debug.config new file mode 100644 index 00000000000..2c6dd51a705 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/Web.Release.config b/IntegrationTests/Azure/AzureHost/Host/Web.Release.config new file mode 100644 index 00000000000..4122d79bfe2 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/Web.config b/IntegrationTests/Azure/AzureHost/Host/Web.config new file mode 100644 index 00000000000..d4f3e97bb9e --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/Web.config @@ -0,0 +1,71 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Host/WebRole.cs b/IntegrationTests/Azure/AzureHost/Host/WebRole.cs new file mode 100644 index 00000000000..ebda2618840 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/WebRole.cs @@ -0,0 +1,14 @@ +using NServiceBus; +using NServiceBus.Hosting.Azure; + +namespace Host +{ + public class WebRole : RoleEntryPoint + { + + } + + public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Host + { + } +} diff --git a/Samples/Azure/AzureHost/Worker/diagnostics.wadcfg b/IntegrationTests/Azure/AzureHost/Host/diagnostics.wadcfg similarity index 100% rename from Samples/Azure/AzureHost/Worker/diagnostics.wadcfg rename to IntegrationTests/Azure/AzureHost/Host/diagnostics.wadcfg diff --git a/IntegrationTests/Azure/AzureHost/Host/packages.config b/IntegrationTests/Azure/AzureHost/Host/packages.config new file mode 100644 index 00000000000..56e5b5e40d2 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Host/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureHost/Messages/Hello.cs b/IntegrationTests/Azure/AzureHost/Messages/Hello.cs similarity index 100% rename from Samples/Azure/AzureHost/Messages/Hello.cs rename to IntegrationTests/Azure/AzureHost/Messages/Hello.cs diff --git a/Samples/Azure/AzureHost/Messages/Messages.csproj b/IntegrationTests/Azure/AzureHost/Messages/Messages.csproj similarity index 100% rename from Samples/Azure/AzureHost/Messages/Messages.csproj rename to IntegrationTests/Azure/AzureHost/Messages/Messages.csproj diff --git a/Samples/Azure/AzureHost/Messages/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureHost/Messages/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzureHost/Messages/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureHost/Messages/Properties/AssemblyInfo.cs diff --git a/Samples/Azure/AzureHost/Messages/SayHelloTo.cs b/IntegrationTests/Azure/AzureHost/Messages/SayHelloTo.cs similarity index 100% rename from Samples/Azure/AzureHost/Messages/SayHelloTo.cs rename to IntegrationTests/Azure/AzureHost/Messages/SayHelloTo.cs diff --git a/IntegrationTests/Azure/AzureHost/Worker/App.config b/IntegrationTests/Azure/AzureHost/Worker/App.config new file mode 100644 index 00000000000..6cefee916e1 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Worker/App.config @@ -0,0 +1,38 @@ + + + + +
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureHost/Worker/MessageHandlers/SayHello.cs b/IntegrationTests/Azure/AzureHost/Worker/MessageHandlers/SayHello.cs similarity index 100% rename from Samples/Azure/AzureHost/Worker/MessageHandlers/SayHello.cs rename to IntegrationTests/Azure/AzureHost/Worker/MessageHandlers/SayHello.cs diff --git a/Samples/Azure/AzureHost/Worker/NServiceBus.Hosting.Azure.HostProcess.exe.config b/IntegrationTests/Azure/AzureHost/Worker/NServiceBus.Hosting.Azure.HostProcess.exe.config similarity index 100% rename from Samples/Azure/AzureHost/Worker/NServiceBus.Hosting.Azure.HostProcess.exe.config rename to IntegrationTests/Azure/AzureHost/Worker/NServiceBus.Hosting.Azure.HostProcess.exe.config diff --git a/Samples/Azure/AzureHost/Worker/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureHost/Worker/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzureHost/Worker/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureHost/Worker/Properties/AssemblyInfo.cs diff --git a/Samples/Azure/AzureHost/Worker/README.txt b/IntegrationTests/Azure/AzureHost/Worker/README.txt similarity index 100% rename from Samples/Azure/AzureHost/Worker/README.txt rename to IntegrationTests/Azure/AzureHost/Worker/README.txt diff --git a/IntegrationTests/Azure/AzureHost/Worker/Worker.csproj b/IntegrationTests/Azure/AzureHost/Worker/Worker.csproj new file mode 100644 index 00000000000..870c3216acc --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Worker/Worker.csproj @@ -0,0 +1,174 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {0CF5DB7F-D5B6-45C2-BEA7-4C5EB947A438} + Library + Properties + Worker + Worker + v4.0 + 512 + Worker + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll + + + ..\..\..\..\lib\Ionic.Zip.dll + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\..\..\..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + False + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + + + False + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Hosting.Azure.HostProcess.exe + + + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + ..\..\..\..\lib\Topshelf\Topshelf.dll + + + + + + + + + + Always + Designer + + + + + + Designer + + + Designer + Always + + + + + + {838CE3D7-23D2-4B66-8933-19E283D38363} + Messages + + + + + False + Microsoft .NET Framework 4 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureHost/Worker/WorkerRole.cs b/IntegrationTests/Azure/AzureHost/Worker/WorkerRole.cs new file mode 100644 index 00000000000..dda72796b21 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Worker/WorkerRole.cs @@ -0,0 +1,15 @@ +using NServiceBus; +using NServiceBus.Hosting.Azure; + +namespace Worker +{ + public class WorkerRole : RoleEntryPoint + { + + } + + public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Worker, UsingTransport + { + + } +} diff --git a/IntegrationTests/Azure/AzureHost/Worker/diagnostics.wadcfg b/IntegrationTests/Azure/AzureHost/Worker/diagnostics.wadcfg new file mode 100644 index 00000000000..2c82d3c936e --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Worker/diagnostics.wadcfg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + diff --git a/IntegrationTests/Azure/AzureHost/Worker/packages.config b/IntegrationTests/Azure/AzureHost/Worker/packages.config new file mode 100644 index 00000000000..56e5b5e40d2 --- /dev/null +++ b/IntegrationTests/Azure/AzureHost/Worker/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Samples/SendOnlyEndpoint/.nuget/NuGet.Config b/IntegrationTests/Azure/AzurePubSub/.nuget/NuGet.Config similarity index 100% rename from Samples/SendOnlyEndpoint/.nuget/NuGet.Config rename to IntegrationTests/Azure/AzurePubSub/.nuget/NuGet.Config diff --git a/IntegrationTests/Azure/AzurePubSub/.nuget/NuGet.exe b/IntegrationTests/Azure/AzurePubSub/.nuget/NuGet.exe new file mode 100644 index 00000000000..cb3ed0367e1 Binary files /dev/null and b/IntegrationTests/Azure/AzurePubSub/.nuget/NuGet.exe differ diff --git a/IntegrationTests/Azure/AzurePubSub/.nuget/NuGet.targets b/IntegrationTests/Azure/AzurePubSub/.nuget/NuGet.targets new file mode 100644 index 00000000000..46a1b6ced78 --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/.nuget/NuGet.targets @@ -0,0 +1,133 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + + + + + $(SolutionDir).nuget + packages.config + + + + + $(NuGetToolsPath)\NuGet.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + -NonInteractive + + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " + $(NuGetCommand) pack "$(ProjectPath)" -Properties Configuration=$(Configuration) $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzurePubSub/AzurePubSub.ccproj b/IntegrationTests/Azure/AzurePubSub/AzurePubSub.ccproj new file mode 100644 index 00000000000..11f1bb22949 --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/AzurePubSub.ccproj @@ -0,0 +1,71 @@ + + + + + Debug + AnyCPU + 2.0 + {adcfc6b6-8bf7-4d56-b6a4-f6d221111666} + Library + Properties + AzureService + AzureService + True + AzureService + False + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + OrderService + {84aca710-e5b3-4a46-b87a-7c12fb2527a8} + True + Worker + OrderService + + + OrderWebSite + {f3798c2c-41dc-407c-9ebe-3f10c1ca9a76} + True + Web + OrderWebSite + + + + + 10.0 + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.0\ + + + + \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/AzurePubSub.ncrunchsolution b/IntegrationTests/Azure/AzurePubSub/AzurePubSub.ncrunchsolution similarity index 100% rename from Samples/Azure/AzurePubSub/AzurePubSub.ncrunchsolution rename to IntegrationTests/Azure/AzurePubSub/AzurePubSub.ncrunchsolution diff --git a/IntegrationTests/Azure/AzurePubSub/AzurePubSub.sln b/IntegrationTests/Azure/AzurePubSub/AzurePubSub.sln new file mode 100644 index 00000000000..12dbdd74a7d --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/AzurePubSub.sln @@ -0,0 +1,45 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "AzurePubSub", "AzurePubSub.ccproj", "{ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderWebSite", "OrderWebSite\OrderWebSite.csproj", "{F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderService", "OrderService\OrderService.csproj", "{84ACA710-E5B3-4A46-B87A-7C12FB2527A8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyMessages", "MyMessages\MyMessages.csproj", "{3871CC9B-235F-4E60-98F7-FEF04DB1201B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{BAE2B223-739D-48C5-A306-0BF8539B61D1}" + ProjectSection(SolutionItems) = preProject + .nuget\NuGet.Config = .nuget\NuGet.Config + .nuget\NuGet.exe = .nuget\NuGet.exe + .nuget\NuGet.targets = .nuget\NuGet.targets + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Release|Any CPU.Build.0 = Release|Any CPU + {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Release|Any CPU.Build.0 = Release|Any CPU + {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Release|Any CPU.Build.0 = Release|Any CPU + {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/IntegrationTests/Azure/AzurePubSub/MyMessages/LoadOrdersMessage.cs b/IntegrationTests/Azure/AzurePubSub/MyMessages/LoadOrdersMessage.cs new file mode 100644 index 00000000000..46051f0d257 --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/MyMessages/LoadOrdersMessage.cs @@ -0,0 +1,11 @@ +using System; +using NServiceBus; + +namespace MyMessages +{ + [Serializable] + public class LoadOrdersMessage: ICommand + { + + } +} \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/MyMessages/LoadOrdersResponseMessage.cs b/IntegrationTests/Azure/AzurePubSub/MyMessages/LoadOrdersResponseMessage.cs similarity index 100% rename from Samples/Azure/AzurePubSub/MyMessages/LoadOrdersResponseMessage.cs rename to IntegrationTests/Azure/AzurePubSub/MyMessages/LoadOrdersResponseMessage.cs diff --git a/Samples/Azure/AzurePubSub/MyMessages/MyMessages.csproj b/IntegrationTests/Azure/AzurePubSub/MyMessages/MyMessages.csproj similarity index 100% rename from Samples/Azure/AzurePubSub/MyMessages/MyMessages.csproj rename to IntegrationTests/Azure/AzurePubSub/MyMessages/MyMessages.csproj diff --git a/Samples/Azure/AzurePubSub/MyMessages/Order.cs b/IntegrationTests/Azure/AzurePubSub/MyMessages/Order.cs similarity index 100% rename from Samples/Azure/AzurePubSub/MyMessages/Order.cs rename to IntegrationTests/Azure/AzurePubSub/MyMessages/Order.cs diff --git a/IntegrationTests/Azure/AzurePubSub/MyMessages/OrderMessage.cs b/IntegrationTests/Azure/AzurePubSub/MyMessages/OrderMessage.cs new file mode 100644 index 00000000000..b8fd0a4b45f --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/MyMessages/OrderMessage.cs @@ -0,0 +1,12 @@ +using System; +using NServiceBus; + +namespace MyMessages +{ + [Serializable] + public class OrderMessage : ICommand + { + public Guid Id { get; set; } + public int Quantity { get; set; } + } +} diff --git a/Samples/Azure/AzurePubSub/MyMessages/OrderStatus.cs b/IntegrationTests/Azure/AzurePubSub/MyMessages/OrderStatus.cs similarity index 100% rename from Samples/Azure/AzurePubSub/MyMessages/OrderStatus.cs rename to IntegrationTests/Azure/AzurePubSub/MyMessages/OrderStatus.cs diff --git a/IntegrationTests/Azure/AzurePubSub/MyMessages/OrderUpdatedEvent.cs b/IntegrationTests/Azure/AzurePubSub/MyMessages/OrderUpdatedEvent.cs new file mode 100644 index 00000000000..09f41a60cc8 --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/MyMessages/OrderUpdatedEvent.cs @@ -0,0 +1,11 @@ +using System; +using NServiceBus; + +namespace MyMessages +{ + [Serializable] + public class OrderUpdatedEvent: IEvent + { + public Order UpdatedOrder{ get; set; } + } +} \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/MyMessages/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzurePubSub/MyMessages/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzurePubSub/MyMessages/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzurePubSub/MyMessages/Properties/AssemblyInfo.cs diff --git a/IntegrationTests/Azure/AzurePubSub/OrderService/App.config b/IntegrationTests/Azure/AzurePubSub/OrderService/App.config new file mode 100644 index 00000000000..11a627c7810 --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/OrderService/App.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff --git a/IntegrationTests/Azure/AzurePubSub/OrderService/DefineRouting.cs b/IntegrationTests/Azure/AzurePubSub/OrderService/DefineRouting.cs new file mode 100644 index 00000000000..f909e4fb6fa --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/OrderService/DefineRouting.cs @@ -0,0 +1,19 @@ +using NServiceBus.Config; +using NServiceBus.Config.ConfigurationSource; + +namespace OrderService +{ + class DefineRouting : IProvideConfiguration + { + public UnicastBusConfig GetConfiguration() + { + return new UnicastBusConfig + { + MessageEndpointMappings = new MessageEndpointMappingCollection + { + new MessageEndpointMapping { Messages="MyMessages", Endpoint="orderserviceinputqueue" } + } + }; + } + } +} \ No newline at end of file diff --git a/IntegrationTests/Azure/AzurePubSub/OrderService/EndpointConfiguration.cs b/IntegrationTests/Azure/AzurePubSub/OrderService/EndpointConfiguration.cs new file mode 100644 index 00000000000..3615700cd88 --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/OrderService/EndpointConfiguration.cs @@ -0,0 +1,16 @@ +using NServiceBus; + +namespace OrderService +{ + using NServiceBus.Features; + + public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Worker, UsingTransport + { + public EndpointConfiguration() + { + Feature.Disable(); + Feature.Disable(); + Feature.Disable(); + } + } +} \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderService/Host.cs b/IntegrationTests/Azure/AzurePubSub/OrderService/Host.cs similarity index 100% rename from Samples/Azure/AzurePubSub/OrderService/Host.cs rename to IntegrationTests/Azure/AzurePubSub/OrderService/Host.cs diff --git a/IntegrationTests/Azure/AzurePubSub/OrderService/InitializeOrders.cs b/IntegrationTests/Azure/AzurePubSub/OrderService/InitializeOrders.cs new file mode 100644 index 00000000000..b40246fc893 --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/OrderService/InitializeOrders.cs @@ -0,0 +1,12 @@ +using NServiceBus; + +namespace OrderService +{ + public class InitializeOrders : INeedInitialization + { + public void Init() + { + Configure.Instance.Configurer.RegisterSingleton(new OrderList()); + } + } +} diff --git a/Samples/Azure/AzurePubSub/OrderService/MessageHandlers/LoadOrdersMessageHandlers.cs b/IntegrationTests/Azure/AzurePubSub/OrderService/MessageHandlers/LoadOrdersMessageHandlers.cs similarity index 100% rename from Samples/Azure/AzurePubSub/OrderService/MessageHandlers/LoadOrdersMessageHandlers.cs rename to IntegrationTests/Azure/AzurePubSub/OrderService/MessageHandlers/LoadOrdersMessageHandlers.cs diff --git a/IntegrationTests/Azure/AzurePubSub/OrderService/MessageHandlers/OrderMessageHandler.cs b/IntegrationTests/Azure/AzurePubSub/OrderService/MessageHandlers/OrderMessageHandler.cs new file mode 100644 index 00000000000..cfadd7a3bf8 --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/OrderService/MessageHandlers/OrderMessageHandler.cs @@ -0,0 +1,35 @@ +using System; +using System.Threading; +using MyMessages; +using NServiceBus; +using Order = MyMessages.Order; + +namespace OrderService.MessageHandlers +{ + public class OrderMessageHandler : IHandleMessages + { + public IBus Bus { get; set; } + + public OrderList Orders { get; set; } + + public void Handle(OrderMessage message) + { + //simulate processing + Thread.Sleep(4000); + + //simulate business logic + var order = new Order + { + Id = message.Id, + Quantity = message.Quantity, + Status = message.Quantity < 100 ? OrderStatus.Approved : OrderStatus.AwaitingApproval + }; + + //store the order in "the database" + Orders.AddOrder(order); + + //publish update + Bus.Publish(x => x.UpdatedOrder = order); + } + } +} \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderService/OrderList.cs b/IntegrationTests/Azure/AzurePubSub/OrderService/OrderList.cs similarity index 100% rename from Samples/Azure/AzurePubSub/OrderService/OrderList.cs rename to IntegrationTests/Azure/AzurePubSub/OrderService/OrderList.cs diff --git a/IntegrationTests/Azure/AzurePubSub/OrderService/OrderService.csproj b/IntegrationTests/Azure/AzurePubSub/OrderService/OrderService.csproj new file mode 100644 index 00000000000..24bdfd77b1c --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/OrderService/OrderService.csproj @@ -0,0 +1,164 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {84ACA710-E5B3-4A46-B87A-7C12FB2527A8} + Library + Properties + OrderService + OrderService + v4.0 + 512 + Worker + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + True + + + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + False + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll + + + True + + + True + + + True + + + True + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + + + + + + + + + {3871CC9B-235F-4E60-98F7-FEF04DB1201B} + MyMessages + + + + + Designer + + + + + + False + Microsoft .NET Framework 4 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderService/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzurePubSub/OrderService/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzurePubSub/OrderService/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzurePubSub/OrderService/Properties/AssemblyInfo.cs diff --git a/IntegrationTests/Azure/AzurePubSub/OrderService/WorkerRole.cs b/IntegrationTests/Azure/AzurePubSub/OrderService/WorkerRole.cs new file mode 100644 index 00000000000..60de2612f64 --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/OrderService/WorkerRole.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Specialized; +using System.Threading; +using Common.Logging; +using log4net.Core; +using Microsoft.WindowsAzure.ServiceRuntime; +using MyMessages; +using NServiceBus; +using NServiceBus.Config; +using NServiceBus.Integration.Azure; + +namespace OrderService +{ + public class WorkerRole : RoleEntryPoint + { + public IBus Bus; + + public OrderList Orders = new OrderList(); + private ILog logger; + + public override void Run() + { + ConfigureLogging(); + + logger.Info("Starting order worker with instance id:" + RoleEnvironment.CurrentRoleInstance.Id); + + ConfigureNServiceBus(); + + while (true) + { + Thread.Sleep(10000); + + logger.Info("Approving orders"); + + foreach (var order in Orders.GetOrdersToApprove()) + { + var updatedOrder = Orders.UpdateStatus(order, OrderStatus.Approved); + + //publish update + var orderUpdatedEvent = Bus.CreateInstance(x => x.UpdatedOrder = updatedOrder); + Bus.Publish(orderUpdatedEvent); + } + } + } + + private void ConfigureNServiceBus() + { + + logger.Info("Initalizing NServiceBus"); + try + { + var config = Configure.With() + .SpringBuilder() + .AzureConfigurationSource() + .UnicastBus() + .LoadMessageHandlers() + .AzureQueuesTransport() + .IsTransactional(true) + .PurgeOnStartup(false) + .InMemorySubscriptionStorage();//we use inmemory storage until we have a sub storage for TableStorage or SQL Services + + Configure.Instance.Configurer.RegisterSingleton(Orders); + + Bus = config.CreateBus() + .Start(); + + } + catch (Exception ex) + { + logger.Error(ex); + throw; + } + + logger.Info("NServiceBus started"); + + } + + + private void ConfigureLogging() + { + LogManager.Adapter = new Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter(new NameValueCollection + { + {"configType","EXTERNAL"} + }); + + var appender = new AzureAppender + { + ConnectionStringKey = "AzureQueueConfig.ConnectionString", + Threshold = Level.Debug + }; + appender.ActivateOptions(); + + log4net.Config.BasicConfigurator.Configure(appender); + + logger = LogManager.GetLogger(typeof(WorkerRole)); + } + } +} diff --git a/IntegrationTests/Azure/AzurePubSub/OrderService/packages.config b/IntegrationTests/Azure/AzurePubSub/OrderService/packages.config new file mode 100644 index 00000000000..56e5b5e40d2 --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/OrderService/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzurePubSub/OrderWebSite/Default.aspx b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/Default.aspx new file mode 100644 index 00000000000..bb0f74b4836 --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/Default.aspx @@ -0,0 +1,58 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="OrderWebSite._Default" %> +<%@ Import Namespace="System.Data" %> + + + + + + +
+
+ Enter quantity: + + +
+
+ Entering a value above 100 will require manager approval
+ Refresh the page after submitting orders (would of course use Ajax for this in production :) ) +
+ Click here to refresh orderlist +
+
+
+ + + + + + + + + + + + + + + + + +
+ Id + + Quantity + + Status +
+ <%# DataBinder.Eval(Container.DataItem, "Id") %> + + <%# DataBinder.Eval(Container.DataItem, "Quantity") %> + + <%# DataBinder.Eval(Container.DataItem, "Status") %> +
+ +
+
+
+ + diff --git a/Samples/Azure/AzurePubSub/OrderWebSite/Default.aspx.cs b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/Default.aspx.cs similarity index 100% rename from Samples/Azure/AzurePubSub/OrderWebSite/Default.aspx.cs rename to IntegrationTests/Azure/AzurePubSub/OrderWebSite/Default.aspx.cs diff --git a/Samples/Azure/AzurePubSub/OrderWebSite/Default.aspx.designer.cs b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/Default.aspx.designer.cs similarity index 100% rename from Samples/Azure/AzurePubSub/OrderWebSite/Default.aspx.designer.cs rename to IntegrationTests/Azure/AzurePubSub/OrderWebSite/Default.aspx.designer.cs diff --git a/IntegrationTests/Azure/AzurePubSub/OrderWebSite/DefineRouting.cs b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/DefineRouting.cs new file mode 100644 index 00000000000..534f5002cbc --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/DefineRouting.cs @@ -0,0 +1,18 @@ +using NServiceBus.Config; +using NServiceBus.Config.ConfigurationSource; + +namespace OrderWebSite +{ + class DefineRouting : IProvideConfiguration + { + public UnicastBusConfig GetConfiguration() + { + return new UnicastBusConfig { + MessageEndpointMappings = new MessageEndpointMappingCollection + { + new MessageEndpointMapping { Messages="MyMessages", Endpoint="orderserviceinputqueue" } + } + }; + } + } +} \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderWebSite/Global.asax b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/Global.asax similarity index 100% rename from Samples/Azure/AzurePubSub/OrderWebSite/Global.asax rename to IntegrationTests/Azure/AzurePubSub/OrderWebSite/Global.asax diff --git a/IntegrationTests/Azure/AzurePubSub/OrderWebSite/Global.asax.cs b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/Global.asax.cs new file mode 100644 index 00000000000..0d9961e6605 --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/Global.asax.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Web; +using MyMessages; +using NServiceBus; +using NServiceBus.Features; + +namespace OrderWebSite +{ + using System.Configuration; + using NServiceBus.Unicast.Queuing; + + public class Global : HttpApplication + { + public static IBus Bus; + public static IList Orders; + + private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); + + private static IBus ConfigureNServiceBus() + { + Feature.Disable(); + Feature.Disable(); + Feature.Disable(); + + var bus = Configure.With() + .DefaultBuilder() + .AzureConfigurationSource() + .AzureMessageQueue() + .QueuePerInstance() + .UnicastBus() + .CreateBus() + .Start(); + + try + { + bus.Send(new LoadOrdersMessage()); + } + catch (ConfigurationErrorsException ex) + { + //swallow a q not found since there is a race condition when starting the sample on a clean box + if (!(ex.InnerException is QueueNotFoundException)) + throw; + } + + + return bus; + } + + protected void Application_Start(object sender, EventArgs e) + { + Orders = new List(); + } + + protected void Application_BeginRequest(object sender, EventArgs e) + { + Bus = StartBus.Value; + } + + protected void Application_AuthenticateRequest(object sender, EventArgs e) + { + + } + + protected void Application_Error(object sender, EventArgs e) + { + + } + + protected void Session_End(object sender, EventArgs e) + { + + } + + protected void Application_End(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderWebSite/MessageHandlers/LoadOrdersResponseMessageHandler.cs b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/MessageHandlers/LoadOrdersResponseMessageHandler.cs similarity index 100% rename from Samples/Azure/AzurePubSub/OrderWebSite/MessageHandlers/LoadOrdersResponseMessageHandler.cs rename to IntegrationTests/Azure/AzurePubSub/OrderWebSite/MessageHandlers/LoadOrdersResponseMessageHandler.cs diff --git a/Samples/Azure/AzurePubSub/OrderWebSite/MessageHandlers/OrderUpdatedEventHandler.cs b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/MessageHandlers/OrderUpdatedEventHandler.cs similarity index 100% rename from Samples/Azure/AzurePubSub/OrderWebSite/MessageHandlers/OrderUpdatedEventHandler.cs rename to IntegrationTests/Azure/AzurePubSub/OrderWebSite/MessageHandlers/OrderUpdatedEventHandler.cs diff --git a/IntegrationTests/Azure/AzurePubSub/OrderWebSite/OrderWebSite.csproj b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/OrderWebSite.csproj new file mode 100644 index 00000000000..b08aa6aa5f4 --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/OrderWebSite.csproj @@ -0,0 +1,180 @@ + + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + OrderWebSite + OrderWebSite + v4.0 + + + 4.0 + + + false + + + + + ..\ + true + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + True + + + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + False + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + True + + + True + + + True + + + + True + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + True + + + True + + + True + + + + + + + + Designer + + + + + + ASPXCodeBehind + Default.aspx + + + Default.aspx + + + Global.asax + + + + + + + + {3871CC9B-235F-4E60-98F7-FEF04DB1201B} + MyMessages + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + + False + False + 8089 + / + + + False + False + + + False + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderWebSite/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzurePubSub/OrderWebSite/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzurePubSub/OrderWebSite/Properties/AssemblyInfo.cs diff --git a/IntegrationTests/Azure/AzurePubSub/OrderWebSite/Web.config b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/Web.config new file mode 100644 index 00000000000..fc551eec90a --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/Web.config @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzurePubSub/OrderWebSite/packages.config b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/packages.config new file mode 100644 index 00000000000..56e5b5e40d2 --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/OrderWebSite/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzurePubSub/ServiceConfiguration.cscfg b/IntegrationTests/Azure/AzurePubSub/ServiceConfiguration.cscfg new file mode 100644 index 00000000000..db4f6d86ecc --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/ServiceConfiguration.cscfg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/ServiceDefinition.build.csdef b/IntegrationTests/Azure/AzurePubSub/ServiceDefinition.build.csdef similarity index 100% rename from Samples/Azure/AzurePubSub/ServiceDefinition.build.csdef rename to IntegrationTests/Azure/AzurePubSub/ServiceDefinition.build.csdef diff --git a/IntegrationTests/Azure/AzurePubSub/ServiceDefinition.csdef b/IntegrationTests/Azure/AzurePubSub/ServiceDefinition.csdef new file mode 100644 index 00000000000..4310d3a807d --- /dev/null +++ b/IntegrationTests/Azure/AzurePubSub/ServiceDefinition.csdef @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureSagas/.nuget/NuGet.Config b/IntegrationTests/Azure/AzureSagas/.nuget/NuGet.Config new file mode 100644 index 00000000000..67f8ea046ef --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/.nuget/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureSagas/.nuget/NuGet.exe b/IntegrationTests/Azure/AzureSagas/.nuget/NuGet.exe new file mode 100644 index 00000000000..4645f4b35e8 Binary files /dev/null and b/IntegrationTests/Azure/AzureSagas/.nuget/NuGet.exe differ diff --git a/IntegrationTests/Azure/AzureSagas/.nuget/NuGet.targets b/IntegrationTests/Azure/AzureSagas/.nuget/NuGet.targets new file mode 100644 index 00000000000..bda5bea32c2 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/.nuget/NuGet.targets @@ -0,0 +1,143 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + $([System.IO.Path]::Combine($(SolutionDir), "packages")) + + + + + $(SolutionDir).nuget + packages.config + $(SolutionDir)packages + + + + + $(NuGetToolsPath)\nuget.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -o "$(PackagesDir)" + $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureSagas/Barista/App.config b/IntegrationTests/Azure/AzureSagas/Barista/App.config new file mode 100644 index 00000000000..e13d2d36026 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Barista/App.config @@ -0,0 +1,35 @@ + + + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureSagas/Barista/Barista.csproj b/IntegrationTests/Azure/AzureSagas/Barista/Barista.csproj new file mode 100644 index 00000000000..97057275e24 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Barista/Barista.csproj @@ -0,0 +1,140 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065} + WinExe + Properties + Barista + Barista + v4.0 + 512 + + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\packages\log4net.1.2.10\lib\2.0\log4net.dll + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + False + ..\..\..\..\binaries\NServiceBus.dll + + + False + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + False + ..\..\..\..\binaries\NServiceBus.Core.dll + + + False + ..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll + + + ..\packages\structuremap.2.6.4.1\lib\net40\StructureMap.dll + + + + + + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + + + + + + Form + + + StarbucksBarista.cs + + + + + StarbucksBarista.cs + + + Designer + + + + + + + Designer + + + + + {3963D354-2888-4005-8763-6E54A4D6BFCC} + CashierContracts + + + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} + CustomerContracts + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureSagas/Barista/BaristaMessageHandler.cs b/IntegrationTests/Azure/AzureSagas/Barista/BaristaMessageHandler.cs new file mode 100644 index 00000000000..efb8b36d4c5 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Barista/BaristaMessageHandler.cs @@ -0,0 +1,93 @@ +using System; +using System.Threading; +using Barista.ViewData; +using CashierContracts; +using CustomerContracts; +using NServiceBus; +using NServiceBus.Saga; + +namespace Barista +{ + public class BaristaMessageHandler : Saga, + IAmStartedByMessages, + IHandleMessages, + IHandleTimeouts + { + private readonly IStarbucksBaristaView _view; + + public BaristaMessageHandler() + {} + + public BaristaMessageHandler(IStarbucksBaristaView view) + { + _view = view; + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(s => s.OrderId).ToSaga(m => m.OrderId); + ConfigureMapping(s => s.OrderId).ToSaga(m => m.OrderId); + } + + public void Handle(PrepareOrderMessage message) + { + var viewData = new PrepareOrderView(message.CustomerName, message.Drink, message.DrinkSize); + _view.PrepareOrder(viewData); + + Data.CustomerName = message.CustomerName; + Data.Drink = message.Drink; + Data.OrderId = message.OrderId; + Data.Size = (int) message.DrinkSize; + + RequestTimeout(TimeSpan.FromMinutes(1)); + + for(var i=0; i<10; i++) + { + Thread.Sleep(1000); + } + + var additionalViewData = new OrderIsDoneView(message.CustomerName); + _view.OrderIsDone(additionalViewData); + + Data.OrderIsReady = true; + DeliverOrder(); + } + + public void Handle(PaymentCompleteMessage message) + { + Data.OrderIsPaid = true; + DeliverOrder(); + } + + private void DeliverOrder() + { + if (!Data.OrderIsReady || !Data.OrderIsPaid) + return; + + var viewData = new DeliverOrderView(Data.Drink, (DrinkSize)Data.Size); + _view.DeliverOrder(viewData); + + Bus.Send(new OrderReadyMessage{ Drink = Data.Drink, CustomerName = Data.CustomerName}); + + MarkAsComplete(); + } + + public void Timeout(CleanUpOrders state) + { + if (!Data.OrderIsReady || !Data.OrderIsPaid) + { + var viewData = new OrderIsTrashedView(Data.Drink, Data.CustomerName, (DrinkSize) Data.Size); + _view.TrashOrder(viewData); + MarkAsComplete(); + } + else + { + DeliverOrder(); + } + } + } + + public class CleanUpOrders + { + } +} diff --git a/Samples/Azure/AzureSagas/Barista/BaristaRegistry.cs b/IntegrationTests/Azure/AzureSagas/Barista/BaristaRegistry.cs similarity index 100% rename from Samples/Azure/AzureSagas/Barista/BaristaRegistry.cs rename to IntegrationTests/Azure/AzureSagas/Barista/BaristaRegistry.cs diff --git a/IntegrationTests/Azure/AzureSagas/Barista/BaristaSagaData.cs b/IntegrationTests/Azure/AzureSagas/Barista/BaristaSagaData.cs new file mode 100644 index 00000000000..406b893e416 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Barista/BaristaSagaData.cs @@ -0,0 +1,20 @@ +using System; +using CashierContracts; +using NServiceBus.Saga; + +namespace Barista +{ + public class BaristaSagaData : IContainSagaData + { + public virtual Guid Id { get; set; } + public virtual String Originator { get; set; } + public virtual String OriginalMessageId { get; set; } + + public virtual String CustomerName { get; set; } + public virtual String Drink { get; set; } + public virtual Guid OrderId { get; set; } + public virtual int Size { get; set; } + public virtual Boolean OrderIsReady { get; set; } + public virtual Boolean OrderIsPaid { get; set; } + } +} diff --git a/IntegrationTests/Azure/AzureSagas/Barista/Bootstrapper.cs b/IntegrationTests/Azure/AzureSagas/Barista/Bootstrapper.cs new file mode 100644 index 00000000000..471910786c1 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Barista/Bootstrapper.cs @@ -0,0 +1,45 @@ +using NServiceBus; +using NServiceBus.Config; +using StructureMap; + +namespace Barista +{ + using NServiceBus.Features; + + public class Bootstrapper + { + private Bootstrapper() + { + } + + public static void Bootstrap() + { + BootstrapStructureMap(); + BootstrapNServiceBus(); + } + + private static void BootstrapStructureMap() + { + ObjectFactory.Initialize(x => x.AddRegistry(new BaristaRegistry())); + } + + private static void BootstrapNServiceBus() + { + Configure.Transactions.Enable(); + Configure.Features.Enable(); + Configure.Serialization.Json(); + + Configure.With() + .Log4Net() + .StructureMapBuilder(ObjectFactory.Container) + .AzureMessageQueue() + .AzureSubscriptionStorage() + .AzureSagaPersister() + .UseAzureTimeoutPersister() + .UnicastBus() + .LoadMessageHandlers() + .CreateBus() + .Start(); + } + } +} diff --git a/Samples/Azure/AzureSagas/Barista/Disposable.cs b/IntegrationTests/Azure/AzureSagas/Barista/Disposable.cs similarity index 100% rename from Samples/Azure/AzureSagas/Barista/Disposable.cs rename to IntegrationTests/Azure/AzureSagas/Barista/Disposable.cs diff --git a/IntegrationTests/Azure/AzureSagas/Barista/MessageSubscriptions.cs b/IntegrationTests/Azure/AzureSagas/Barista/MessageSubscriptions.cs new file mode 100644 index 00000000000..e7ff709b59d --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Barista/MessageSubscriptions.cs @@ -0,0 +1,47 @@ +using System; +using CashierContracts; +using NServiceBus; + +namespace Barista +{ + public interface IMessageSubscriptions : IDisposable + { + IDisposable Subscribe(); + void Unsubscribe(); + } + + public class MessageSubscriptions : Disposable, + IMessageSubscriptions + { + private readonly IBus _bus; + + private static readonly Type[] MessageTypes = new Type[] + { + typeof(PaymentCompleteMessage) + }; + + public MessageSubscriptions(IBus bus) + { + _bus = bus; + } + + public IDisposable Subscribe() + { + foreach(var messageType in MessageTypes) + _bus.Subscribe(messageType); + + return this; + } + + public void Unsubscribe() + { + foreach(var messageType in MessageTypes) + _bus.Unsubscribe(messageType); + } + + protected override void DisposeManagedResources() + { + Unsubscribe(); + } + } +} diff --git a/Samples/Azure/AzureSagas/Barista/Program.cs b/IntegrationTests/Azure/AzureSagas/Barista/Program.cs similarity index 100% rename from Samples/Azure/AzureSagas/Barista/Program.cs rename to IntegrationTests/Azure/AzureSagas/Barista/Program.cs diff --git a/IntegrationTests/Azure/AzureSagas/Barista/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureSagas/Barista/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..1ccde7d18b2 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Barista/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Barista")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Barista")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5ce23dcd-97df-43c7-a33a-b4abc6c7754d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/AzureSagas/Barista/StarbucksBarista.Designer.cs b/IntegrationTests/Azure/AzureSagas/Barista/StarbucksBarista.Designer.cs similarity index 100% rename from Samples/Azure/AzureSagas/Barista/StarbucksBarista.Designer.cs rename to IntegrationTests/Azure/AzureSagas/Barista/StarbucksBarista.Designer.cs diff --git a/Samples/Azure/AzureSagas/Barista/StarbucksBarista.cs b/IntegrationTests/Azure/AzureSagas/Barista/StarbucksBarista.cs similarity index 100% rename from Samples/Azure/AzureSagas/Barista/StarbucksBarista.cs rename to IntegrationTests/Azure/AzureSagas/Barista/StarbucksBarista.cs diff --git a/Samples/Azure/AzureSagas/Barista/StarbucksBarista.resx b/IntegrationTests/Azure/AzureSagas/Barista/StarbucksBarista.resx similarity index 100% rename from Samples/Azure/AzureSagas/Barista/StarbucksBarista.resx rename to IntegrationTests/Azure/AzureSagas/Barista/StarbucksBarista.resx diff --git a/Samples/Azure/AzureSagas/Barista/ViewData/DeliverOrderView.cs b/IntegrationTests/Azure/AzureSagas/Barista/ViewData/DeliverOrderView.cs similarity index 100% rename from Samples/Azure/AzureSagas/Barista/ViewData/DeliverOrderView.cs rename to IntegrationTests/Azure/AzureSagas/Barista/ViewData/DeliverOrderView.cs diff --git a/Samples/Azure/AzureSagas/Barista/ViewData/OrderIsDoneView.cs b/IntegrationTests/Azure/AzureSagas/Barista/ViewData/OrderIsDoneView.cs similarity index 100% rename from Samples/Azure/AzureSagas/Barista/ViewData/OrderIsDoneView.cs rename to IntegrationTests/Azure/AzureSagas/Barista/ViewData/OrderIsDoneView.cs diff --git a/Samples/Azure/AzureSagas/Barista/ViewData/OrderIsTrashedView.cs b/IntegrationTests/Azure/AzureSagas/Barista/ViewData/OrderIsTrashedView.cs similarity index 100% rename from Samples/Azure/AzureSagas/Barista/ViewData/OrderIsTrashedView.cs rename to IntegrationTests/Azure/AzureSagas/Barista/ViewData/OrderIsTrashedView.cs diff --git a/Samples/Azure/AzureSagas/Barista/ViewData/PrepareOrderView.cs b/IntegrationTests/Azure/AzureSagas/Barista/ViewData/PrepareOrderView.cs similarity index 100% rename from Samples/Azure/AzureSagas/Barista/ViewData/PrepareOrderView.cs rename to IntegrationTests/Azure/AzureSagas/Barista/ViewData/PrepareOrderView.cs diff --git a/IntegrationTests/Azure/AzureSagas/Barista/packages.config b/IntegrationTests/Azure/AzureSagas/Barista/packages.config new file mode 100644 index 00000000000..fca07d4932c --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Barista/packages.config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureSagas/Cashier/App.config b/IntegrationTests/Azure/AzureSagas/Cashier/App.config new file mode 100644 index 00000000000..23dcbf78726 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Cashier/App.config @@ -0,0 +1,34 @@ + + + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureSagas/Cashier/Bootstrapper.cs b/IntegrationTests/Azure/AzureSagas/Cashier/Bootstrapper.cs new file mode 100644 index 00000000000..dbd39c5cc53 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Cashier/Bootstrapper.cs @@ -0,0 +1,43 @@ +using NServiceBus; +using StructureMap; + +namespace Cashier +{ + using NServiceBus.Features; + + public class Bootstrapper + { + private Bootstrapper() + {} + + public static void Bootstrap() + { + BootstrapStructureMap(); + BootstrapNServiceBus(); + } + + private static void BootstrapStructureMap() + { + ObjectFactory.Initialize(x => x.AddRegistry(new CashierRegistry())); + } + + private static void BootstrapNServiceBus() + { + Configure.Transactions.Enable(); + Configure.Features.Enable(); + Configure.Serialization.Json(); + + Configure.With() + .Log4Net() + .StructureMapBuilder(ObjectFactory.Container) + .AzureMessageQueue() + .AzureSubscriptionStorage() + .AzureSagaPersister() + .UseAzureTimeoutPersister() + .UnicastBus() + .LoadMessageHandlers() + .CreateBus() + .Start(); + } + } +} diff --git a/IntegrationTests/Azure/AzureSagas/Cashier/Cashier.csproj b/IntegrationTests/Azure/AzureSagas/Cashier/Cashier.csproj new file mode 100644 index 00000000000..951f9d714df --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Cashier/Cashier.csproj @@ -0,0 +1,132 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {DCCBF183-A703-4999-BB10-046E6C2800B9} + WinExe + Properties + Cashier + Cashier + v4.0 + 512 + + + + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\log4net.1.2.10\lib\2.0\log4net.dll + True + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll + + + ..\..\..\..\binaries\NServiceBus.Timeout.Hosting.Azure.dll + + + ..\packages\structuremap.2.6.4.1\lib\net40\StructureMap.dll + + + + + + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + + + + + + + + StarbucksCashier.cs + + + Designer + + + Form + + + StarbucksCashier.cs + + + + + + + {3963D354-2888-4005-8763-6E54A4D6BFCC} + CashierContracts + + + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} + CustomerContracts + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureSagas/Cashier/CashierMessageHandler.cs b/IntegrationTests/Azure/AzureSagas/Cashier/CashierMessageHandler.cs new file mode 100644 index 00000000000..de8bd317c43 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Cashier/CashierMessageHandler.cs @@ -0,0 +1,77 @@ +using System; +using Cashier.ViewData; +using CashierContracts; +using CustomerContracts; +using NServiceBus; +using NServiceBus.Saga; + +namespace Cashier +{ + public class CashierSaga : Saga, + IAmStartedByMessages, + IHandleMessages + { + private readonly IStarbucksCashierView _view; + + public CashierSaga() + {} + + public CashierSaga(IStarbucksCashierView view) + { + _view = view; + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(s => s.OrderId).ToSaga(m => m.OrderId); + ConfigureMapping(s => s.OrderId).ToSaga(m => m.OrderId); + } + + public void Handle(NewOrderMessage message) + { + _view.NewOrder(new NewOrderView(message)); + + Data.Drink = message.Drink; + Data.DrinkSize = (int) message.DrinkSize; + Data.OrderId = message.OrderId; + Data.CustomerName = message.CustomerName; + Data.Amount = CalculateAmountAccordingTo(message.DrinkSize); + + Bus.Send(new PrepareOrderMessage { CustomerName = Data.CustomerName, Drink = Data.Drink, DrinkSize = (DrinkSize)Data.DrinkSize, OrderId = Data.OrderId }); + Bus.Reply(new PaymentRequestMessage { OrderId = Data.OrderId, CustomerName = Data.CustomerName, Amount = Data.Amount }); + } + + public void Handle(PaymentMessage message) + { + if(message.Amount == 0) + { + var viewData = new CustomerRefusesToPayView(Data.CustomerName, Data.Amount, Data.Drink, (DrinkSize) Data.DrinkSize); + _view.CustomerRefusesToPay(viewData); + } + else + { + var viewData = new ReceivedFullPaymentView(Data.CustomerName, Data.Drink, (DrinkSize) Data.DrinkSize); + _view.ReceivedFullPayment(viewData); + + Bus.Publish(new PaymentCompleteMessage{ OrderId = Data.OrderId}); + } + + MarkAsComplete(); + } + + private static Double CalculateAmountAccordingTo(DrinkSize size) + { + switch(size) + { + case DrinkSize.Tall: + return 3.25; + case DrinkSize.Grande: + return 4.00; + case DrinkSize.Venti: + return 4.75; + default: + throw new InvalidOperationException(String.Format("Size '{0}' does not compute!", size)); + } + } + } +} diff --git a/Samples/Azure/AzureSagas/Cashier/CashierRegistry.cs b/IntegrationTests/Azure/AzureSagas/Cashier/CashierRegistry.cs similarity index 100% rename from Samples/Azure/AzureSagas/Cashier/CashierRegistry.cs rename to IntegrationTests/Azure/AzureSagas/Cashier/CashierRegistry.cs diff --git a/IntegrationTests/Azure/AzureSagas/Cashier/CashierSagaData.cs b/IntegrationTests/Azure/AzureSagas/Cashier/CashierSagaData.cs new file mode 100644 index 00000000000..d8ba7b2f460 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Cashier/CashierSagaData.cs @@ -0,0 +1,19 @@ +using System; +using CashierContracts; +using NServiceBus.Saga; + +namespace Cashier +{ + public class CashierSagaData : IContainSagaData + { + public virtual Guid Id { get; set; } + public virtual String Originator { get; set; } + public virtual String OriginalMessageId { get; set; } + + public virtual Double Amount { get; set; } + public virtual String CustomerName { get; set; } + public virtual String Drink { get; set; } + public virtual int DrinkSize { get; set; } + public virtual Guid OrderId { get; set; } + } +} diff --git a/Samples/Azure/AzureSagas/Cashier/Program.cs b/IntegrationTests/Azure/AzureSagas/Cashier/Program.cs similarity index 100% rename from Samples/Azure/AzureSagas/Cashier/Program.cs rename to IntegrationTests/Azure/AzureSagas/Cashier/Program.cs diff --git a/IntegrationTests/Azure/AzureSagas/Cashier/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureSagas/Cashier/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..d7dcaa723c2 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Cashier/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Cashier")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Cashier")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a23d05c3-f8de-4c46-91bc-99c11db88551")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/AzureSagas/Cashier/StarbucksCashier.Designer.cs b/IntegrationTests/Azure/AzureSagas/Cashier/StarbucksCashier.Designer.cs similarity index 100% rename from Samples/Azure/AzureSagas/Cashier/StarbucksCashier.Designer.cs rename to IntegrationTests/Azure/AzureSagas/Cashier/StarbucksCashier.Designer.cs diff --git a/Samples/Azure/AzureSagas/Cashier/StarbucksCashier.cs b/IntegrationTests/Azure/AzureSagas/Cashier/StarbucksCashier.cs similarity index 100% rename from Samples/Azure/AzureSagas/Cashier/StarbucksCashier.cs rename to IntegrationTests/Azure/AzureSagas/Cashier/StarbucksCashier.cs diff --git a/Samples/Azure/AzureSagas/Cashier/StarbucksCashier.resx b/IntegrationTests/Azure/AzureSagas/Cashier/StarbucksCashier.resx similarity index 100% rename from Samples/Azure/AzureSagas/Cashier/StarbucksCashier.resx rename to IntegrationTests/Azure/AzureSagas/Cashier/StarbucksCashier.resx diff --git a/Samples/Azure/AzureSagas/Cashier/ViewData/CustomerRefusesToPayView.cs b/IntegrationTests/Azure/AzureSagas/Cashier/ViewData/CustomerRefusesToPayView.cs similarity index 100% rename from Samples/Azure/AzureSagas/Cashier/ViewData/CustomerRefusesToPayView.cs rename to IntegrationTests/Azure/AzureSagas/Cashier/ViewData/CustomerRefusesToPayView.cs diff --git a/Samples/Azure/AzureSagas/Cashier/ViewData/NewOrderView.cs b/IntegrationTests/Azure/AzureSagas/Cashier/ViewData/NewOrderView.cs similarity index 100% rename from Samples/Azure/AzureSagas/Cashier/ViewData/NewOrderView.cs rename to IntegrationTests/Azure/AzureSagas/Cashier/ViewData/NewOrderView.cs diff --git a/Samples/Azure/AzureSagas/Cashier/ViewData/ReceivedFullPaymentView.cs b/IntegrationTests/Azure/AzureSagas/Cashier/ViewData/ReceivedFullPaymentView.cs similarity index 100% rename from Samples/Azure/AzureSagas/Cashier/ViewData/ReceivedFullPaymentView.cs rename to IntegrationTests/Azure/AzureSagas/Cashier/ViewData/ReceivedFullPaymentView.cs diff --git a/IntegrationTests/Azure/AzureSagas/Cashier/packages.config b/IntegrationTests/Azure/AzureSagas/Cashier/packages.config new file mode 100644 index 00000000000..fca07d4932c --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Cashier/packages.config @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureSagas/CashierContracts/CashierContracts.csproj b/IntegrationTests/Azure/AzureSagas/CashierContracts/CashierContracts.csproj similarity index 100% rename from Samples/Azure/AzureSagas/CashierContracts/CashierContracts.csproj rename to IntegrationTests/Azure/AzureSagas/CashierContracts/CashierContracts.csproj diff --git a/Samples/Azure/AzureSagas/CashierContracts/DrinkSize.cs b/IntegrationTests/Azure/AzureSagas/CashierContracts/DrinkSize.cs similarity index 100% rename from Samples/Azure/AzureSagas/CashierContracts/DrinkSize.cs rename to IntegrationTests/Azure/AzureSagas/CashierContracts/DrinkSize.cs diff --git a/IntegrationTests/Azure/AzureSagas/CashierContracts/NewOrderMessage.cs b/IntegrationTests/Azure/AzureSagas/CashierContracts/NewOrderMessage.cs new file mode 100644 index 00000000000..f00390045a7 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/CashierContracts/NewOrderMessage.cs @@ -0,0 +1,26 @@ +using System; +using NServiceBus; + +namespace CashierContracts +{ + public class NewOrderMessage : ICommand + { + public String CustomerName { get; set; } + public String Drink { get; set; } + public DrinkSize DrinkSize { get; set; } + public Guid OrderId { get; set; } + + public NewOrderMessage() + { + OrderId = Guid.NewGuid(); + } + + public NewOrderMessage(String customerName, String drink, DrinkSize drinkSize) + { + CustomerName = customerName; + Drink = drink; + DrinkSize = drinkSize; + OrderId = Guid.NewGuid(); + } + } +} diff --git a/IntegrationTests/Azure/AzureSagas/CashierContracts/PaymentCompleteMessage.cs b/IntegrationTests/Azure/AzureSagas/CashierContracts/PaymentCompleteMessage.cs new file mode 100644 index 00000000000..a65f791802d --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/CashierContracts/PaymentCompleteMessage.cs @@ -0,0 +1,19 @@ +using System; +using NServiceBus; + +namespace CashierContracts +{ + public class PaymentCompleteMessage : IEvent + { + public Guid OrderId { get; set; } + + public PaymentCompleteMessage() + { + } + + public PaymentCompleteMessage(Guid orderId) + { + OrderId = orderId; + } + } +} diff --git a/Samples/Azure/AzureSagas/CashierContracts/PaymentMessage.cs b/IntegrationTests/Azure/AzureSagas/CashierContracts/PaymentMessage.cs similarity index 100% rename from Samples/Azure/AzureSagas/CashierContracts/PaymentMessage.cs rename to IntegrationTests/Azure/AzureSagas/CashierContracts/PaymentMessage.cs diff --git a/IntegrationTests/Azure/AzureSagas/CashierContracts/PrepareOrderMessage.cs b/IntegrationTests/Azure/AzureSagas/CashierContracts/PrepareOrderMessage.cs new file mode 100644 index 00000000000..91782d905bb --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/CashierContracts/PrepareOrderMessage.cs @@ -0,0 +1,25 @@ +using System; +using NServiceBus; + +namespace CashierContracts +{ + public class PrepareOrderMessage : ICommand + { + public String CustomerName { get; set; } + public String Drink { get; set; } + public DrinkSize DrinkSize { get; set; } + public Guid OrderId { get; set; } + + public PrepareOrderMessage() + { + } + + public PrepareOrderMessage(String customerName, String drink, DrinkSize size, Guid orderId) + { + CustomerName = customerName; + Drink = drink; + DrinkSize = size; + OrderId = orderId; + } + } +} diff --git a/IntegrationTests/Azure/AzureSagas/CashierContracts/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureSagas/CashierContracts/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..bdf41a8e7e6 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/CashierContracts/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CashierContracts")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CashierContracts")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("15e01ae1-e78d-4467-95a1-b5ce66f67de0")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IntegrationTests/Azure/AzureSagas/Customer/App.config b/IntegrationTests/Azure/AzureSagas/Customer/App.config new file mode 100644 index 00000000000..94b0cac1f04 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Customer/App.config @@ -0,0 +1,33 @@ + + + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureSagas/Customer/Bootstrapper.cs b/IntegrationTests/Azure/AzureSagas/Customer/Bootstrapper.cs new file mode 100644 index 00000000000..ece5d666513 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Customer/Bootstrapper.cs @@ -0,0 +1,44 @@ +using Cashier; +using NServiceBus; +using NServiceBus.Features; +using StructureMap; + +namespace Customer +{ + public class Bootstrapper + { + private Bootstrapper() + { + } + + public static void Bootstrap() + { + BootstrapStructureMap(); + BootstrapNServiceBus(); + } + + private static void BootstrapStructureMap() + { + ObjectFactory.Initialize(x => x.AddRegistry(new CustomerRegistry())); + } + + private static void BootstrapNServiceBus() + { + Configure.Transactions.Enable(); + Configure.Features.Disable(); + Configure.Features.Enable(); + Configure.Serialization.Json(); + + Configure.With() + .Log4Net() + .StructureMapBuilder(ObjectFactory.Container) + .AzureMessageQueue() + .AzureSagaPersister() + .UseAzureTimeoutPersister() + .UnicastBus() + .LoadMessageHandlers() + .CreateBus() + .Start(); + } + } +} diff --git a/IntegrationTests/Azure/AzureSagas/Customer/Customer.csproj b/IntegrationTests/Azure/AzureSagas/Customer/Customer.csproj new file mode 100644 index 00000000000..fecdef3777f --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Customer/Customer.csproj @@ -0,0 +1,132 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79} + WinExe + Properties + Customer + Customer + v4.0 + 512 + + + + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\packages\log4net.1.2.10\lib\2.0\log4net.dll + True + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll + + + ..\packages\structuremap.2.6.4.1\lib\net40\StructureMap.dll + + + + + + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + + Form + + + CustomerOrder.cs + + + + + + + CustomerOrder.cs + + + + + Designer + + + Designer + + + + + {3963D354-2888-4005-8763-6E54A4D6BFCC} + CashierContracts + + + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} + CustomerContracts + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureSagas/Customer/CustomerOrder.Designer.cs b/IntegrationTests/Azure/AzureSagas/Customer/CustomerOrder.Designer.cs similarity index 100% rename from Samples/Azure/AzureSagas/Customer/CustomerOrder.Designer.cs rename to IntegrationTests/Azure/AzureSagas/Customer/CustomerOrder.Designer.cs diff --git a/Samples/Azure/AzureSagas/Customer/CustomerOrder.cs b/IntegrationTests/Azure/AzureSagas/Customer/CustomerOrder.cs similarity index 100% rename from Samples/Azure/AzureSagas/Customer/CustomerOrder.cs rename to IntegrationTests/Azure/AzureSagas/Customer/CustomerOrder.cs diff --git a/Samples/Azure/AzureSagas/Customer/CustomerOrder.resx b/IntegrationTests/Azure/AzureSagas/Customer/CustomerOrder.resx similarity index 100% rename from Samples/Azure/AzureSagas/Customer/CustomerOrder.resx rename to IntegrationTests/Azure/AzureSagas/Customer/CustomerOrder.resx diff --git a/Samples/Azure/AzureSagas/Customer/CustomerRegistry.cs b/IntegrationTests/Azure/AzureSagas/Customer/CustomerRegistry.cs similarity index 100% rename from Samples/Azure/AzureSagas/Customer/CustomerRegistry.cs rename to IntegrationTests/Azure/AzureSagas/Customer/CustomerRegistry.cs diff --git a/Samples/Azure/AzureSagas/Customer/Program.cs b/IntegrationTests/Azure/AzureSagas/Customer/Program.cs similarity index 100% rename from Samples/Azure/AzureSagas/Customer/Program.cs rename to IntegrationTests/Azure/AzureSagas/Customer/Program.cs diff --git a/IntegrationTests/Azure/AzureSagas/Customer/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureSagas/Customer/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..c757f613d04 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Customer/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Starbucks")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Starbucks")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("95d68a80-2651-4438-99f3-dcc3b6ff8fa2")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IntegrationTests/Azure/AzureSagas/Customer/packages.config b/IntegrationTests/Azure/AzureSagas/Customer/packages.config new file mode 100644 index 00000000000..f5f41242736 --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Customer/packages.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureSagas/CustomerContracts/CustomerContracts.csproj b/IntegrationTests/Azure/AzureSagas/CustomerContracts/CustomerContracts.csproj similarity index 100% rename from Samples/Azure/AzureSagas/CustomerContracts/CustomerContracts.csproj rename to IntegrationTests/Azure/AzureSagas/CustomerContracts/CustomerContracts.csproj diff --git a/Samples/Azure/AzureSagas/CustomerContracts/OrderReadyMessage.cs b/IntegrationTests/Azure/AzureSagas/CustomerContracts/OrderReadyMessage.cs similarity index 100% rename from Samples/Azure/AzureSagas/CustomerContracts/OrderReadyMessage.cs rename to IntegrationTests/Azure/AzureSagas/CustomerContracts/OrderReadyMessage.cs diff --git a/Samples/Azure/AzureSagas/CustomerContracts/PaymentRequestMessage.cs b/IntegrationTests/Azure/AzureSagas/CustomerContracts/PaymentRequestMessage.cs similarity index 100% rename from Samples/Azure/AzureSagas/CustomerContracts/PaymentRequestMessage.cs rename to IntegrationTests/Azure/AzureSagas/CustomerContracts/PaymentRequestMessage.cs diff --git a/IntegrationTests/Azure/AzureSagas/CustomerContracts/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureSagas/CustomerContracts/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..bbc99f61e1f --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/CustomerContracts/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CustomerContracts")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CustomerContracts")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b661ecb2-d7f2-4346-94a8-198ec4b10b3b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IntegrationTests/Azure/AzureSagas/Starbucks.sln b/IntegrationTests/Azure/AzureSagas/Starbucks.sln new file mode 100644 index 00000000000..40c3876b61d --- /dev/null +++ b/IntegrationTests/Azure/AzureSagas/Starbucks.sln @@ -0,0 +1,84 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cashier", "Cashier\Cashier.csproj", "{DCCBF183-A703-4999-BB10-046E6C2800B9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Customer", "Customer\Customer.csproj", "{88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CashierContracts", "CashierContracts\CashierContracts.csproj", "{3963D354-2888-4005-8763-6E54A4D6BFCC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomerContracts", "CustomerContracts\CustomerContracts.csproj", "{05882666-3DBD-4B8D-ADAE-439CABDD7DFB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Barista", "Barista\Barista.csproj", "{F5C48D42-06F2-4CCA-88B5-6C49F2A09065}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{BA241B77-F8F3-4D9B-8BD8-ADD856A66C3D}" + ProjectSection(SolutionItems) = preProject + .nuget\NuGet.Config = .nuget\NuGet.Config + .nuget\NuGet.exe = .nuget\NuGet.exe + .nuget\NuGet.targets = .nuget\NuGet.targets + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|x86.ActiveCfg = Debug|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Any CPU.Build.0 = Release|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|x86.ActiveCfg = Release|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Any CPU.Build.0 = Debug|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|x86.ActiveCfg = Debug|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Any CPU.ActiveCfg = Release|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Any CPU.Build.0 = Release|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|x86.ActiveCfg = Release|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|x86.ActiveCfg = Debug|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Any CPU.Build.0 = Release|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|x86.ActiveCfg = Release|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|x86.ActiveCfg = Debug|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Any CPU.Build.0 = Release|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|x86.ActiveCfg = Release|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|x86.ActiveCfg = Debug|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Any CPU.Build.0 = Release|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|x86.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/.nuget/NuGet.Config b/IntegrationTests/Azure/AzureServiceBusPubSub/.nuget/NuGet.Config new file mode 100644 index 00000000000..67f8ea046ef --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/.nuget/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/.nuget/NuGet.exe b/IntegrationTests/Azure/AzureServiceBusPubSub/.nuget/NuGet.exe new file mode 100644 index 00000000000..cb3ed0367e1 Binary files /dev/null and b/IntegrationTests/Azure/AzureServiceBusPubSub/.nuget/NuGet.exe differ diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/.nuget/NuGet.targets b/IntegrationTests/Azure/AzureServiceBusPubSub/.nuget/NuGet.targets new file mode 100644 index 00000000000..46a1b6ced78 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/.nuget/NuGet.targets @@ -0,0 +1,133 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + + + + + $(SolutionDir).nuget + packages.config + + + + + $(NuGetToolsPath)\NuGet.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + -NonInteractive + + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " + $(NuGetCommand) pack "$(ProjectPath)" -Properties Configuration=$(Configuration) $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/AzurePubSub.ccproj b/IntegrationTests/Azure/AzureServiceBusPubSub/AzurePubSub.ccproj new file mode 100644 index 00000000000..11f1bb22949 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/AzurePubSub.ccproj @@ -0,0 +1,71 @@ + + + + + Debug + AnyCPU + 2.0 + {adcfc6b6-8bf7-4d56-b6a4-f6d221111666} + Library + Properties + AzureService + AzureService + True + AzureService + False + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + OrderService + {84aca710-e5b3-4a46-b87a-7c12fb2527a8} + True + Worker + OrderService + + + OrderWebSite + {f3798c2c-41dc-407c-9ebe-3f10c1ca9a76} + True + Web + OrderWebSite + + + + + 10.0 + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.0\ + + + + \ No newline at end of file diff --git a/src/azure/SubscriptionStorage/NServiceBus.Unicast.Subscriptions.Azure.TableStorage.ncrunchsolution b/IntegrationTests/Azure/AzureServiceBusPubSub/AzurePubSub.ncrunchsolution similarity index 100% rename from src/azure/SubscriptionStorage/NServiceBus.Unicast.Subscriptions.Azure.TableStorage.ncrunchsolution rename to IntegrationTests/Azure/AzureServiceBusPubSub/AzurePubSub.ncrunchsolution diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/AzurePubSub.sln b/IntegrationTests/Azure/AzureServiceBusPubSub/AzurePubSub.sln new file mode 100644 index 00000000000..12dbdd74a7d --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/AzurePubSub.sln @@ -0,0 +1,45 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "AzurePubSub", "AzurePubSub.ccproj", "{ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderWebSite", "OrderWebSite\OrderWebSite.csproj", "{F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderService", "OrderService\OrderService.csproj", "{84ACA710-E5B3-4A46-B87A-7C12FB2527A8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyMessages", "MyMessages\MyMessages.csproj", "{3871CC9B-235F-4E60-98F7-FEF04DB1201B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{BAE2B223-739D-48C5-A306-0BF8539B61D1}" + ProjectSection(SolutionItems) = preProject + .nuget\NuGet.Config = .nuget\NuGet.Config + .nuget\NuGet.exe = .nuget\NuGet.exe + .nuget\NuGet.targets = .nuget\NuGet.targets + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Release|Any CPU.Build.0 = Release|Any CPU + {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Release|Any CPU.Build.0 = Release|Any CPU + {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Release|Any CPU.Build.0 = Release|Any CPU + {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/LoadOrdersMessage.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/LoadOrdersMessage.cs new file mode 100644 index 00000000000..46051f0d257 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/LoadOrdersMessage.cs @@ -0,0 +1,11 @@ +using System; +using NServiceBus; + +namespace MyMessages +{ + [Serializable] + public class LoadOrdersMessage: ICommand + { + + } +} \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/MyMessages/LoadOrdersResponseMessage.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/LoadOrdersResponseMessage.cs similarity index 100% rename from Samples/Azure/ServiceBusPubSub/MyMessages/LoadOrdersResponseMessage.cs rename to IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/LoadOrdersResponseMessage.cs diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/MyMessages.csproj b/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/MyMessages.csproj new file mode 100644 index 00000000000..0335aaa31b5 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/MyMessages.csproj @@ -0,0 +1,97 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {3871CC9B-235F-4E60-98F7-FEF04DB1201B} + Library + Properties + MyMessages + MyMessages + v4.0 + 512 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\..\..\..\binaries\NServiceBus.dll + + + + + + + + + + + + + + + + + False + Microsoft .NET Framework 4 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/MyMessages/Order.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/Order.cs similarity index 100% rename from Samples/Azure/ServiceBusPubSub/MyMessages/Order.cs rename to IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/Order.cs diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/OrderMessage.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/OrderMessage.cs new file mode 100644 index 00000000000..b8fd0a4b45f --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/OrderMessage.cs @@ -0,0 +1,12 @@ +using System; +using NServiceBus; + +namespace MyMessages +{ + [Serializable] + public class OrderMessage : ICommand + { + public Guid Id { get; set; } + public int Quantity { get; set; } + } +} diff --git a/Samples/Azure/ServiceBusFullDuplex/MyMessages/OrderStatus.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/OrderStatus.cs similarity index 100% rename from Samples/Azure/ServiceBusFullDuplex/MyMessages/OrderStatus.cs rename to IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/OrderStatus.cs diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/OrderUpdatedEvent.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/OrderUpdatedEvent.cs new file mode 100644 index 00000000000..09f41a60cc8 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/OrderUpdatedEvent.cs @@ -0,0 +1,11 @@ +using System; +using NServiceBus; + +namespace MyMessages +{ + [Serializable] + public class OrderUpdatedEvent: IEvent + { + public Order UpdatedOrder{ get; set; } + } +} \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/MyMessages/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzureThumbnailCreator/MyMessages/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureServiceBusPubSub/MyMessages/Properties/AssemblyInfo.cs diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/App.config b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/App.config new file mode 100644 index 00000000000..11a627c7810 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/App.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + + diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/DefineRouting.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/DefineRouting.cs new file mode 100644 index 00000000000..f909e4fb6fa --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/DefineRouting.cs @@ -0,0 +1,19 @@ +using NServiceBus.Config; +using NServiceBus.Config.ConfigurationSource; + +namespace OrderService +{ + class DefineRouting : IProvideConfiguration + { + public UnicastBusConfig GetConfiguration() + { + return new UnicastBusConfig + { + MessageEndpointMappings = new MessageEndpointMappingCollection + { + new MessageEndpointMapping { Messages="MyMessages", Endpoint="orderserviceinputqueue" } + } + }; + } + } +} \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/EndpointConfiguration.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/EndpointConfiguration.cs new file mode 100644 index 00000000000..70c18372a85 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/EndpointConfiguration.cs @@ -0,0 +1,15 @@ +using NServiceBus; + +namespace OrderService +{ + using NServiceBus.Features; + + public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Worker, UsingTransport + { + public EndpointConfiguration() + { + Feature.Disable(); + Feature.Disable(); + } + } +} \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/Service/Host.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/Host.cs similarity index 100% rename from Samples/Azure/AzureThumbnailCreator/Service/Host.cs rename to IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/Host.cs diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/InitializeOrders.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/InitializeOrders.cs new file mode 100644 index 00000000000..b40246fc893 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/InitializeOrders.cs @@ -0,0 +1,12 @@ +using NServiceBus; + +namespace OrderService +{ + public class InitializeOrders : INeedInitialization + { + public void Init() + { + Configure.Instance.Configurer.RegisterSingleton(new OrderList()); + } + } +} diff --git a/Samples/Azure/ServiceBusPubSub/OrderService/MessageHandlers/LoadOrdersMessageHandlers.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/MessageHandlers/LoadOrdersMessageHandlers.cs similarity index 100% rename from Samples/Azure/ServiceBusPubSub/OrderService/MessageHandlers/LoadOrdersMessageHandlers.cs rename to IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/MessageHandlers/LoadOrdersMessageHandlers.cs diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/MessageHandlers/OrderMessageHandler.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/MessageHandlers/OrderMessageHandler.cs new file mode 100644 index 00000000000..cfadd7a3bf8 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/MessageHandlers/OrderMessageHandler.cs @@ -0,0 +1,35 @@ +using System; +using System.Threading; +using MyMessages; +using NServiceBus; +using Order = MyMessages.Order; + +namespace OrderService.MessageHandlers +{ + public class OrderMessageHandler : IHandleMessages + { + public IBus Bus { get; set; } + + public OrderList Orders { get; set; } + + public void Handle(OrderMessage message) + { + //simulate processing + Thread.Sleep(4000); + + //simulate business logic + var order = new Order + { + Id = message.Id, + Quantity = message.Quantity, + Status = message.Quantity < 100 ? OrderStatus.Approved : OrderStatus.AwaitingApproval + }; + + //store the order in "the database" + Orders.AddOrder(order); + + //publish update + Bus.Publish(x => x.UpdatedOrder = order); + } + } +} \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/OrderService/OrderList.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/OrderList.cs similarity index 100% rename from Samples/Azure/ServiceBusPubSub/OrderService/OrderList.cs rename to IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/OrderList.cs diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/OrderService.csproj b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/OrderService.csproj new file mode 100644 index 00000000000..24bdfd77b1c --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/OrderService.csproj @@ -0,0 +1,164 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {84ACA710-E5B3-4A46-B87A-7C12FB2527A8} + Library + Properties + OrderService + OrderService + v4.0 + 512 + Worker + false + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + true + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + True + + + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + False + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll + + + True + + + True + + + True + + + True + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + + + + + + + + + {3871CC9B-235F-4E60-98F7-FEF04DB1201B} + MyMessages + + + + + Designer + + + + + + False + Microsoft .NET Framework 4 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + False + Windows Installer 3.1 + true + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/Service/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzureThumbnailCreator/Service/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/Properties/AssemblyInfo.cs diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/WorkerRole.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/WorkerRole.cs new file mode 100644 index 00000000000..60de2612f64 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/WorkerRole.cs @@ -0,0 +1,98 @@ +using System; +using System.Collections.Specialized; +using System.Threading; +using Common.Logging; +using log4net.Core; +using Microsoft.WindowsAzure.ServiceRuntime; +using MyMessages; +using NServiceBus; +using NServiceBus.Config; +using NServiceBus.Integration.Azure; + +namespace OrderService +{ + public class WorkerRole : RoleEntryPoint + { + public IBus Bus; + + public OrderList Orders = new OrderList(); + private ILog logger; + + public override void Run() + { + ConfigureLogging(); + + logger.Info("Starting order worker with instance id:" + RoleEnvironment.CurrentRoleInstance.Id); + + ConfigureNServiceBus(); + + while (true) + { + Thread.Sleep(10000); + + logger.Info("Approving orders"); + + foreach (var order in Orders.GetOrdersToApprove()) + { + var updatedOrder = Orders.UpdateStatus(order, OrderStatus.Approved); + + //publish update + var orderUpdatedEvent = Bus.CreateInstance(x => x.UpdatedOrder = updatedOrder); + Bus.Publish(orderUpdatedEvent); + } + } + } + + private void ConfigureNServiceBus() + { + + logger.Info("Initalizing NServiceBus"); + try + { + var config = Configure.With() + .SpringBuilder() + .AzureConfigurationSource() + .UnicastBus() + .LoadMessageHandlers() + .AzureQueuesTransport() + .IsTransactional(true) + .PurgeOnStartup(false) + .InMemorySubscriptionStorage();//we use inmemory storage until we have a sub storage for TableStorage or SQL Services + + Configure.Instance.Configurer.RegisterSingleton(Orders); + + Bus = config.CreateBus() + .Start(); + + } + catch (Exception ex) + { + logger.Error(ex); + throw; + } + + logger.Info("NServiceBus started"); + + } + + + private void ConfigureLogging() + { + LogManager.Adapter = new Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter(new NameValueCollection + { + {"configType","EXTERNAL"} + }); + + var appender = new AzureAppender + { + ConnectionStringKey = "AzureQueueConfig.ConnectionString", + Threshold = Level.Debug + }; + appender.ActivateOptions(); + + log4net.Config.BasicConfigurator.Configure(appender); + + logger = LogManager.GetLogger(typeof(WorkerRole)); + } + } +} diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/packages.config b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/packages.config new file mode 100644 index 00000000000..56e5b5e40d2 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderService/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Default.aspx b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Default.aspx new file mode 100644 index 00000000000..bb0f74b4836 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Default.aspx @@ -0,0 +1,58 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="OrderWebSite._Default" %> +<%@ Import Namespace="System.Data" %> + + + + + + +
+
+ Enter quantity: + + +
+
+ Entering a value above 100 will require manager approval
+ Refresh the page after submitting orders (would of course use Ajax for this in production :) ) +
+ Click here to refresh orderlist +
+
+
+ + + + + + + + + + + + + + + + + +
+ Id + + Quantity + + Status +
+ <%# DataBinder.Eval(Container.DataItem, "Id") %> + + <%# DataBinder.Eval(Container.DataItem, "Quantity") %> + + <%# DataBinder.Eval(Container.DataItem, "Status") %> +
+ +
+
+
+ + diff --git a/Samples/Azure/ServiceBusPubSub/OrderWebSite/Default.aspx.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Default.aspx.cs similarity index 100% rename from Samples/Azure/ServiceBusPubSub/OrderWebSite/Default.aspx.cs rename to IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Default.aspx.cs diff --git a/Samples/Azure/ServiceBusFullDuplex/OrderWebSite/Default.aspx.designer.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Default.aspx.designer.cs similarity index 100% rename from Samples/Azure/ServiceBusFullDuplex/OrderWebSite/Default.aspx.designer.cs rename to IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Default.aspx.designer.cs diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/DefineRouting.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/DefineRouting.cs new file mode 100644 index 00000000000..d479f6d0d65 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/DefineRouting.cs @@ -0,0 +1,18 @@ +using NServiceBus.Config; +using NServiceBus.Config.ConfigurationSource; + +namespace OrderWebSite +{ + class DefineRouting : IProvideConfiguration + { + public UnicastBusConfig GetConfiguration() + { + return new UnicastBusConfig { + MessageEndpointMappings = new MessageEndpointMappingCollection + { + new MessageEndpointMapping { Messages="MyMessages", Endpoint="orderserviceXXX" } + } + }; + } + } +} \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/WebSite/Global.asax b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Global.asax similarity index 100% rename from Samples/Azure/AzureThumbnailCreator/WebSite/Global.asax rename to IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Global.asax diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Global.asax.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Global.asax.cs new file mode 100644 index 00000000000..6d9a3405027 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Global.asax.cs @@ -0,0 +1,78 @@ +using System; +using System.Collections.Generic; +using System.Web; +using MyMessages; +using NServiceBus; +using NServiceBus.Features; + +namespace OrderWebSite +{ + using System.Configuration; + using NServiceBus.Unicast.Queuing; + + public class Global : HttpApplication + { + public static IBus Bus; + public static IList Orders; + + private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); + + private static IBus ConfigureNServiceBus() + { + Feature.Disable(); + Feature.Disable(); + + var bus = Configure.With() + .DefaultBuilder() + .AzureConfigurationSource() + .UseTransport() + .UnicastBus() + .CreateBus() + .Start(); + + try + { + bus.Send(new LoadOrdersMessage()); + } + catch (ConfigurationErrorsException ex) + { + //swallow a q not found since there is a race condition when starting the sample on a clean box + if (!(ex.InnerException is QueueNotFoundException)) + throw; + } + + + return bus; + } + + protected void Application_Start(object sender, EventArgs e) + { + Orders = new List(); + } + + protected void Application_BeginRequest(object sender, EventArgs e) + { + Bus = StartBus.Value; + } + + protected void Application_AuthenticateRequest(object sender, EventArgs e) + { + + } + + protected void Application_Error(object sender, EventArgs e) + { + + } + + protected void Session_End(object sender, EventArgs e) + { + + } + + protected void Application_End(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/OrderWebSite/MessageHandlers/LoadOrdersResponseMessageHandler.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/MessageHandlers/LoadOrdersResponseMessageHandler.cs similarity index 100% rename from Samples/Azure/ServiceBusPubSub/OrderWebSite/MessageHandlers/LoadOrdersResponseMessageHandler.cs rename to IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/MessageHandlers/LoadOrdersResponseMessageHandler.cs diff --git a/Samples/Azure/ServiceBusPubSub/OrderWebSite/MessageHandlers/OrderUpdatedEventHandler.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/MessageHandlers/OrderUpdatedEventHandler.cs similarity index 100% rename from Samples/Azure/ServiceBusPubSub/OrderWebSite/MessageHandlers/OrderUpdatedEventHandler.cs rename to IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/MessageHandlers/OrderUpdatedEventHandler.cs diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/OrderWebSite.csproj b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/OrderWebSite.csproj new file mode 100644 index 00000000000..b08aa6aa5f4 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/OrderWebSite.csproj @@ -0,0 +1,180 @@ + + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + OrderWebSite + OrderWebSite + v4.0 + + + 4.0 + + + false + + + + + ..\ + true + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + AllRules.ruleset + + + pdbonly + true + bin\ + TRACE + prompt + 4 + AllRules.ruleset + + + + ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + True + + + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + False + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + True + + + True + + + True + + + + True + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + True + + + True + + + True + + + + + + + + Designer + + + + + + ASPXCodeBehind + Default.aspx + + + Default.aspx + + + Global.asax + + + + + + + + {3871CC9B-235F-4E60-98F7-FEF04DB1201B} + MyMessages + + + + + + + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + + False + False + 8089 + / + + + False + False + + + False + + + + + + \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/WebSite/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Properties/AssemblyInfo.cs similarity index 100% rename from Samples/Azure/AzureThumbnailCreator/WebSite/Properties/AssemblyInfo.cs rename to IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Properties/AssemblyInfo.cs diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Web.config b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Web.config new file mode 100644 index 00000000000..fc551eec90a --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/Web.config @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/packages.config b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/packages.config new file mode 100644 index 00000000000..56e5b5e40d2 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/OrderWebSite/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/ServiceConfiguration.cscfg b/IntegrationTests/Azure/AzureServiceBusPubSub/ServiceConfiguration.cscfg new file mode 100644 index 00000000000..436f3080f11 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/ServiceConfiguration.cscfg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/ServiceDefinition.build.csdef b/IntegrationTests/Azure/AzureServiceBusPubSub/ServiceDefinition.build.csdef new file mode 100644 index 00000000000..e07c63cf2f3 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/ServiceDefinition.build.csdef @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/AzureServiceBusPubSub/ServiceDefinition.csdef b/IntegrationTests/Azure/AzureServiceBusPubSub/ServiceDefinition.csdef new file mode 100644 index 00000000000..a436e27e6e0 --- /dev/null +++ b/IntegrationTests/Azure/AzureServiceBusPubSub/ServiceDefinition.csdef @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/SQLAzure/.nuget/NuGet.Config b/IntegrationTests/Azure/SQLAzure/.nuget/NuGet.Config new file mode 100644 index 00000000000..67f8ea046ef --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/.nuget/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/SQLAzure/.nuget/NuGet.exe b/IntegrationTests/Azure/SQLAzure/.nuget/NuGet.exe new file mode 100644 index 00000000000..be85ec2c4ca Binary files /dev/null and b/IntegrationTests/Azure/SQLAzure/.nuget/NuGet.exe differ diff --git a/IntegrationTests/Azure/SQLAzure/.nuget/NuGet.targets b/IntegrationTests/Azure/SQLAzure/.nuget/NuGet.targets new file mode 100644 index 00000000000..c15311e6931 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/.nuget/NuGet.targets @@ -0,0 +1,139 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + false + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + $([System.IO.Path]::Combine($(SolutionDir), "packages")) + + + + + $(SolutionDir).nuget + packages.config + $(SolutionDir)packages + + + + + $(NuGetToolsPath)\nuget.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" -o "$(PackagesDir)" + $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/SQLAzure/Barista/App.config b/IntegrationTests/Azure/SQLAzure/Barista/App.config new file mode 100644 index 00000000000..a2678f68127 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Barista/App.config @@ -0,0 +1,60 @@ + + + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/SQLAzure/Barista/Barista.csproj b/IntegrationTests/Azure/SQLAzure/Barista/Barista.csproj new file mode 100644 index 00000000000..0cfc1742de8 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Barista/Barista.csproj @@ -0,0 +1,140 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065} + WinExe + Properties + Barista + Barista + v4.0 + 512 + + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\packages\Iesi.Collections.3.3.3.4000\lib\Net35\Iesi.Collections.dll + + + ..\packages\log4net.1.2.10\lib\2.0\log4net.dll + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\packages\NHibernate.3.3.3.4000\lib\Net35\NHibernate.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\..\binaries\NServiceBus.NHibernate.dll + + + ..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll + + + ..\packages\structuremap.2.6.4.1\lib\net40\StructureMap.dll + + + + + + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + + + + + + Form + + + StarbucksBarista.cs + + + + + StarbucksBarista.cs + + + Designer + + + + + + + + + + {3963D354-2888-4005-8763-6E54A4D6BFCC} + CashierContracts + + + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} + CustomerContracts + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/SQLAzure/Barista/BaristaMessageHandler.cs b/IntegrationTests/Azure/SQLAzure/Barista/BaristaMessageHandler.cs new file mode 100644 index 00000000000..cc1a1920004 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Barista/BaristaMessageHandler.cs @@ -0,0 +1,93 @@ +using System; +using System.Threading; +using Barista.ViewData; +using CashierContracts; +using CustomerContracts; +using NServiceBus; +using NServiceBus.Saga; + +namespace Barista +{ + public class BaristaMessageHandler : Saga, + IAmStartedByMessages, + IHandleMessages, + IHandleTimeouts + { + private readonly IStarbucksBaristaView _view; + + public BaristaMessageHandler() + {} + + public BaristaMessageHandler(IStarbucksBaristaView view) + { + _view = view; + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(s => s.OrderId).ToSaga(m => m.OrderId); + ConfigureMapping(s => s.OrderId).ToSaga(m => m.OrderId); + } + + public void Handle(PrepareOrderMessage message) + { + var viewData = new PrepareOrderView(message.CustomerName, message.Drink, message.DrinkSize); + _view.PrepareOrder(viewData); + + Data.CustomerName = message.CustomerName; + Data.Drink = message.Drink; + Data.OrderId = message.OrderId; + Data.Size = message.DrinkSize; + + RequestTimeout(TimeSpan.FromMinutes(1)); + + for(var i=0; i<10; i++) + { + Thread.Sleep(1000); + } + + var additionalViewData = new OrderIsDoneView(message.CustomerName); + _view.OrderIsDone(additionalViewData); + + Data.OrderIsReady = true; + DeliverOrder(); + } + + public void Handle(PaymentCompleteMessage message) + { + Data.OrderIsPaid = true; + DeliverOrder(); + } + + private void DeliverOrder() + { + if (!Data.OrderIsReady || !Data.OrderIsPaid) + return; + + var viewData = new DeliverOrderView(Data.Drink, Data.Size); + _view.DeliverOrder(viewData); + + Bus.Publish(new OrderReadyMessage(Data.Drink,Data.CustomerName)); + + MarkAsComplete(); + } + + public void Timeout(CleanUpOrders state) + { + if (!Data.OrderIsReady || !Data.OrderIsPaid) + { + var viewData = new OrderIsTrashedView(Data.Drink, Data.CustomerName, Data.Size); + _view.TrashOrder(viewData); + MarkAsComplete(); + } + else + { + DeliverOrder(); + } + } + } + + public class CleanUpOrders + { + } +} diff --git a/Samples/Azure/SQLAzure/Barista/BaristaRegistry.cs b/IntegrationTests/Azure/SQLAzure/Barista/BaristaRegistry.cs similarity index 100% rename from Samples/Azure/SQLAzure/Barista/BaristaRegistry.cs rename to IntegrationTests/Azure/SQLAzure/Barista/BaristaRegistry.cs diff --git a/Samples/Azure/AzureSagas/Barista/BaristaSagaData.cs b/IntegrationTests/Azure/SQLAzure/Barista/BaristaSagaData.cs similarity index 100% rename from Samples/Azure/AzureSagas/Barista/BaristaSagaData.cs rename to IntegrationTests/Azure/SQLAzure/Barista/BaristaSagaData.cs diff --git a/IntegrationTests/Azure/SQLAzure/Barista/Bootstrapper.cs b/IntegrationTests/Azure/SQLAzure/Barista/Bootstrapper.cs new file mode 100644 index 00000000000..7474a56fee3 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Barista/Bootstrapper.cs @@ -0,0 +1,43 @@ +using NServiceBus; +using StructureMap; + +namespace Barista +{ + using NServiceBus.Features; + + public class Bootstrapper + { + private Bootstrapper() + { } + + public static void Bootstrap() + { + BootstrapStructureMap(); + BootstrapNServiceBus(); + } + + private static void BootstrapStructureMap() + { + ObjectFactory.Initialize(x => x.AddRegistry(new BaristaRegistry())); + } + + private static void BootstrapNServiceBus() + { + Configure.Transactions.Enable(); + Configure.Features.Enable(); + Configure.Serialization.Json(); + + Configure.With() + .Log4Net() + .StructureMapBuilder(ObjectFactory.Container) + .AzureMessageQueue() + .UseNHibernateSubscriptionPersister() + .UseNHibernateSagaPersister() + .UseNHibernateTimeoutPersister() + .UnicastBus() + .LoadMessageHandlers() + .CreateBus() + .Start(); + } + } +} diff --git a/Samples/Azure/SQLAzure/Barista/Disposable.cs b/IntegrationTests/Azure/SQLAzure/Barista/Disposable.cs similarity index 100% rename from Samples/Azure/SQLAzure/Barista/Disposable.cs rename to IntegrationTests/Azure/SQLAzure/Barista/Disposable.cs diff --git a/IntegrationTests/Azure/SQLAzure/Barista/MessageSubscriptions.cs b/IntegrationTests/Azure/SQLAzure/Barista/MessageSubscriptions.cs new file mode 100644 index 00000000000..e7ff709b59d --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Barista/MessageSubscriptions.cs @@ -0,0 +1,47 @@ +using System; +using CashierContracts; +using NServiceBus; + +namespace Barista +{ + public interface IMessageSubscriptions : IDisposable + { + IDisposable Subscribe(); + void Unsubscribe(); + } + + public class MessageSubscriptions : Disposable, + IMessageSubscriptions + { + private readonly IBus _bus; + + private static readonly Type[] MessageTypes = new Type[] + { + typeof(PaymentCompleteMessage) + }; + + public MessageSubscriptions(IBus bus) + { + _bus = bus; + } + + public IDisposable Subscribe() + { + foreach(var messageType in MessageTypes) + _bus.Subscribe(messageType); + + return this; + } + + public void Unsubscribe() + { + foreach(var messageType in MessageTypes) + _bus.Unsubscribe(messageType); + } + + protected override void DisposeManagedResources() + { + Unsubscribe(); + } + } +} diff --git a/Samples/Azure/SQLAzure/Barista/Program.cs b/IntegrationTests/Azure/SQLAzure/Barista/Program.cs similarity index 100% rename from Samples/Azure/SQLAzure/Barista/Program.cs rename to IntegrationTests/Azure/SQLAzure/Barista/Program.cs diff --git a/IntegrationTests/Azure/SQLAzure/Barista/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/SQLAzure/Barista/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..1ccde7d18b2 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Barista/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Barista")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Barista")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("5ce23dcd-97df-43c7-a33a-b4abc6c7754d")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/SQLAzure/Barista/StarbucksBarista.Designer.cs b/IntegrationTests/Azure/SQLAzure/Barista/StarbucksBarista.Designer.cs similarity index 100% rename from Samples/Azure/SQLAzure/Barista/StarbucksBarista.Designer.cs rename to IntegrationTests/Azure/SQLAzure/Barista/StarbucksBarista.Designer.cs diff --git a/IntegrationTests/Azure/SQLAzure/Barista/StarbucksBarista.cs b/IntegrationTests/Azure/SQLAzure/Barista/StarbucksBarista.cs new file mode 100644 index 00000000000..6b8873704e6 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Barista/StarbucksBarista.cs @@ -0,0 +1,61 @@ +using System; +using System.Windows.Forms; +using Barista.ViewData; + +namespace Barista +{ + public interface IStarbucksBaristaView + { + void DeliverOrder(DeliverOrderView view); + void OrderIsDone(OrderIsDoneView view); + void PrepareOrder(PrepareOrderView view); + void TrashOrder(OrderIsTrashedView viewData); + void Start(); + } + + public partial class StarbucksBarista : Form, IStarbucksBaristaView + { + public StarbucksBarista() + { + InitializeComponent(); + } + + public void DeliverOrder(DeliverOrderView view) + { + var logItem = String.Format("Delivering {0} - {1}.", view.Drink, view.DrinkSize); + Invoke(new Action(Log), logItem); + } + + public void OrderIsDone(OrderIsDoneView view) + { + var logItem = String.Format("Done preparing order for customer {0}.", view.CustomerName); + Invoke(new Action(Log), logItem); + } + + public void PrepareOrder(PrepareOrderView view) + { + var logItem = String.Format("Preparing {0} - {1} for customer {2}.", + view.Drink, view.DrinkSize, view.CustomerName); + + Invoke(new Action(Log), logItem); + } + + public void TrashOrder(OrderIsTrashedView viewData) + { + var logItem = String.Format("Trashing {0} - {1} for customer {2} as it got cold.", + viewData.Drink, viewData.Size, viewData.CustomerName); + + Invoke(new Action(Log), logItem); + } + + public void Start() + { + Application.Run(this); + } + + private void Log(String logItem) + { + OrdersListBox.Items.Add(logItem); + } + } +} diff --git a/Samples/Azure/SQLAzure/Barista/StarbucksBarista.resx b/IntegrationTests/Azure/SQLAzure/Barista/StarbucksBarista.resx similarity index 100% rename from Samples/Azure/SQLAzure/Barista/StarbucksBarista.resx rename to IntegrationTests/Azure/SQLAzure/Barista/StarbucksBarista.resx diff --git a/Samples/Azure/SQLAzure/Barista/ViewData/DeliverOrderView.cs b/IntegrationTests/Azure/SQLAzure/Barista/ViewData/DeliverOrderView.cs similarity index 100% rename from Samples/Azure/SQLAzure/Barista/ViewData/DeliverOrderView.cs rename to IntegrationTests/Azure/SQLAzure/Barista/ViewData/DeliverOrderView.cs diff --git a/Samples/Azure/SQLAzure/Barista/ViewData/OrderIsDoneView.cs b/IntegrationTests/Azure/SQLAzure/Barista/ViewData/OrderIsDoneView.cs similarity index 100% rename from Samples/Azure/SQLAzure/Barista/ViewData/OrderIsDoneView.cs rename to IntegrationTests/Azure/SQLAzure/Barista/ViewData/OrderIsDoneView.cs diff --git a/IntegrationTests/Azure/SQLAzure/Barista/ViewData/OrderIsTrashedView.cs b/IntegrationTests/Azure/SQLAzure/Barista/ViewData/OrderIsTrashedView.cs new file mode 100644 index 00000000000..a973aa83347 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Barista/ViewData/OrderIsTrashedView.cs @@ -0,0 +1,33 @@ +using CashierContracts; + +namespace Barista.ViewData +{ + public class OrderIsTrashedView + { + private readonly string drink; + private readonly string customerName; + private readonly DrinkSize size; + + public OrderIsTrashedView(string drink, string customerName, DrinkSize size) + { + this.drink = drink; + this.customerName = customerName; + this.size = size; + } + + public DrinkSize Size + { + get { return size; } + } + + public string CustomerName + { + get { return customerName; } + } + + public string Drink + { + get { return drink; } + } + } +} \ No newline at end of file diff --git a/Samples/Azure/SQLAzure/Barista/ViewData/PrepareOrderView.cs b/IntegrationTests/Azure/SQLAzure/Barista/ViewData/PrepareOrderView.cs similarity index 100% rename from Samples/Azure/SQLAzure/Barista/ViewData/PrepareOrderView.cs rename to IntegrationTests/Azure/SQLAzure/Barista/ViewData/PrepareOrderView.cs diff --git a/IntegrationTests/Azure/SQLAzure/Barista/packages.config b/IntegrationTests/Azure/SQLAzure/Barista/packages.config new file mode 100644 index 00000000000..f5f41242736 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Barista/packages.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/SQLAzure/Cashier/App.config b/IntegrationTests/Azure/SQLAzure/Cashier/App.config new file mode 100644 index 00000000000..575648fb7da --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Cashier/App.config @@ -0,0 +1,59 @@ + + + +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/SQLAzure/Cashier/Bootstrapper.cs b/IntegrationTests/Azure/SQLAzure/Cashier/Bootstrapper.cs new file mode 100644 index 00000000000..eb4eec402ae --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Cashier/Bootstrapper.cs @@ -0,0 +1,43 @@ +using NServiceBus; +using StructureMap; + +namespace Cashier +{ + using NServiceBus.Features; + + public class Bootstrapper + { + private Bootstrapper() + {} + + public static void Bootstrap() + { + BootstrapStructureMap(); + BootstrapNServiceBus(); + } + + private static void BootstrapStructureMap() + { + ObjectFactory.Initialize(x => x.AddRegistry(new CashierRegistry())); + } + + private static void BootstrapNServiceBus() + { + Configure.Transactions.Enable(); + Configure.Features.Enable(); + Configure.Serialization.Json(); + + Configure.With() + .Log4Net() + .StructureMapBuilder(ObjectFactory.Container) + .AzureMessageQueue() + .UseNHibernateSubscriptionPersister() + .UseNHibernateSagaPersister() + .UseNHibernateTimeoutPersister() + .UnicastBus() + .LoadMessageHandlers() + .CreateBus() + .Start(); + } + } +} diff --git a/IntegrationTests/Azure/SQLAzure/Cashier/Cashier.csproj b/IntegrationTests/Azure/SQLAzure/Cashier/Cashier.csproj new file mode 100644 index 00000000000..e8627b51f58 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Cashier/Cashier.csproj @@ -0,0 +1,137 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {DCCBF183-A703-4999-BB10-046E6C2800B9} + WinExe + Properties + Cashier + Cashier + v4.0 + 512 + + + + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Iesi.Collections.3.3.3.4000\lib\Net35\Iesi.Collections.dll + + + ..\packages\log4net.1.2.10\lib\2.0\log4net.dll + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\packages\NHibernate.3.3.3.4000\lib\Net35\NHibernate.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\..\binaries\NServiceBus.NHibernate.dll + + + ..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll + + + ..\packages\structuremap.2.6.4.1\lib\net40\StructureMap.dll + + + + + + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + + + + + + + + StarbucksCashier.cs + + + Designer + + + Form + + + StarbucksCashier.cs + + + + + + + {3963D354-2888-4005-8763-6E54A4D6BFCC} + CashierContracts + + + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} + CustomerContracts + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/SQLAzure/Cashier/CashierMessageHandler.cs b/IntegrationTests/Azure/SQLAzure/Cashier/CashierMessageHandler.cs new file mode 100644 index 00000000000..27fac617f11 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Cashier/CashierMessageHandler.cs @@ -0,0 +1,77 @@ +using System; +using Cashier.ViewData; +using CashierContracts; +using CustomerContracts; +using NServiceBus; +using NServiceBus.Saga; + +namespace Cashier +{ + public class CashierSaga : Saga, + IAmStartedByMessages, + IHandleMessages + { + private readonly IStarbucksCashierView _view; + + public CashierSaga() + {} + + public CashierSaga(IStarbucksCashierView view) + { + _view = view; + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(s => s.OrderId).ToSaga(m => m.OrderId); + ConfigureMapping(s => s.OrderId).ToSaga(m => m.OrderId); + } + + public void Handle(NewOrderMessage message) + { + _view.NewOrder(new NewOrderView(message)); + + Data.Drink = message.Drink; + Data.DrinkSize = message.DrinkSize; + Data.OrderId = message.OrderId; + Data.CustomerName = message.CustomerName; + Data.Amount = CalculateAmountAccordingTo(message.DrinkSize); + + Bus.Send(new PrepareOrderMessage(Data.CustomerName, Data.Drink, Data.DrinkSize, Data.OrderId)); + Bus.Reply(new PaymentRequestMessage(Data.Amount, message.CustomerName, message.OrderId)); + } + + public void Handle(PaymentMessage message) + { + if(message.Amount >= Data.Amount) + { + var viewData = new ReceivedFullPaymentView(Data.CustomerName, Data.Drink, Data.DrinkSize); + _view.ReceivedFullPayment(viewData); + + Bus.Publish(new PaymentCompleteMessage(Data.OrderId)); + } + else if(message.Amount == 0) + { + var viewData = new CustomerRefusesToPayView(Data.CustomerName, Data.Amount, Data.Drink, Data.DrinkSize); + _view.CustomerRefusesToPay(viewData); + } + + MarkAsComplete(); + } + + private static Double CalculateAmountAccordingTo(DrinkSize size) + { + switch(size) + { + case DrinkSize.Tall: + return 3.25; + case DrinkSize.Grande: + return 4.00; + case DrinkSize.Venti: + return 4.75; + default: + throw new InvalidOperationException(String.Format("Size '{0}' does not compute!", size)); + } + } + } +} diff --git a/Samples/Azure/SQLAzure/Cashier/CashierRegistry.cs b/IntegrationTests/Azure/SQLAzure/Cashier/CashierRegistry.cs similarity index 100% rename from Samples/Azure/SQLAzure/Cashier/CashierRegistry.cs rename to IntegrationTests/Azure/SQLAzure/Cashier/CashierRegistry.cs diff --git a/Samples/Azure/AzureSagas/Cashier/CashierSagaData.cs b/IntegrationTests/Azure/SQLAzure/Cashier/CashierSagaData.cs similarity index 100% rename from Samples/Azure/AzureSagas/Cashier/CashierSagaData.cs rename to IntegrationTests/Azure/SQLAzure/Cashier/CashierSagaData.cs diff --git a/Samples/Azure/SQLAzure/Cashier/Program.cs b/IntegrationTests/Azure/SQLAzure/Cashier/Program.cs similarity index 100% rename from Samples/Azure/SQLAzure/Cashier/Program.cs rename to IntegrationTests/Azure/SQLAzure/Cashier/Program.cs diff --git a/IntegrationTests/Azure/SQLAzure/Cashier/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/SQLAzure/Cashier/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..d7dcaa723c2 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Cashier/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Cashier")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Cashier")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("a23d05c3-f8de-4c46-91bc-99c11db88551")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/SQLAzure/Cashier/StarbucksCashier.Designer.cs b/IntegrationTests/Azure/SQLAzure/Cashier/StarbucksCashier.Designer.cs similarity index 100% rename from Samples/Azure/SQLAzure/Cashier/StarbucksCashier.Designer.cs rename to IntegrationTests/Azure/SQLAzure/Cashier/StarbucksCashier.Designer.cs diff --git a/Samples/Azure/SQLAzure/Cashier/StarbucksCashier.cs b/IntegrationTests/Azure/SQLAzure/Cashier/StarbucksCashier.cs similarity index 100% rename from Samples/Azure/SQLAzure/Cashier/StarbucksCashier.cs rename to IntegrationTests/Azure/SQLAzure/Cashier/StarbucksCashier.cs diff --git a/Samples/Azure/SQLAzure/Cashier/StarbucksCashier.resx b/IntegrationTests/Azure/SQLAzure/Cashier/StarbucksCashier.resx similarity index 100% rename from Samples/Azure/SQLAzure/Cashier/StarbucksCashier.resx rename to IntegrationTests/Azure/SQLAzure/Cashier/StarbucksCashier.resx diff --git a/Samples/Azure/SQLAzure/Cashier/ViewData/CustomerRefusesToPayView.cs b/IntegrationTests/Azure/SQLAzure/Cashier/ViewData/CustomerRefusesToPayView.cs similarity index 100% rename from Samples/Azure/SQLAzure/Cashier/ViewData/CustomerRefusesToPayView.cs rename to IntegrationTests/Azure/SQLAzure/Cashier/ViewData/CustomerRefusesToPayView.cs diff --git a/Samples/Azure/SQLAzure/Cashier/ViewData/NewOrderView.cs b/IntegrationTests/Azure/SQLAzure/Cashier/ViewData/NewOrderView.cs similarity index 100% rename from Samples/Azure/SQLAzure/Cashier/ViewData/NewOrderView.cs rename to IntegrationTests/Azure/SQLAzure/Cashier/ViewData/NewOrderView.cs diff --git a/Samples/Azure/SQLAzure/Cashier/ViewData/ReceivedFullPaymentView.cs b/IntegrationTests/Azure/SQLAzure/Cashier/ViewData/ReceivedFullPaymentView.cs similarity index 100% rename from Samples/Azure/SQLAzure/Cashier/ViewData/ReceivedFullPaymentView.cs rename to IntegrationTests/Azure/SQLAzure/Cashier/ViewData/ReceivedFullPaymentView.cs diff --git a/IntegrationTests/Azure/SQLAzure/Cashier/packages.config b/IntegrationTests/Azure/SQLAzure/Cashier/packages.config new file mode 100644 index 00000000000..f5f41242736 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Cashier/packages.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/SQLAzure/CashierContracts/CashierContracts.csproj b/IntegrationTests/Azure/SQLAzure/CashierContracts/CashierContracts.csproj new file mode 100644 index 00000000000..6a1281150b9 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/CashierContracts/CashierContracts.csproj @@ -0,0 +1,61 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {3963D354-2888-4005-8763-6E54A4D6BFCC} + Library + Properties + CashierContracts + CashierContracts + v4.0 + 512 + + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\..\binaries\NServiceBus.dll + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/SQLAzure/CashierContracts/DrinkSize.cs b/IntegrationTests/Azure/SQLAzure/CashierContracts/DrinkSize.cs similarity index 100% rename from Samples/Azure/SQLAzure/CashierContracts/DrinkSize.cs rename to IntegrationTests/Azure/SQLAzure/CashierContracts/DrinkSize.cs diff --git a/IntegrationTests/Azure/SQLAzure/CashierContracts/NewOrderMessage.cs b/IntegrationTests/Azure/SQLAzure/CashierContracts/NewOrderMessage.cs new file mode 100644 index 00000000000..f4504afc832 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/CashierContracts/NewOrderMessage.cs @@ -0,0 +1,21 @@ +using System; +using NServiceBus; + +namespace CashierContracts +{ + public class NewOrderMessage : ICommand + { + public String CustomerName { get; set; } + public String Drink { get; set; } + public DrinkSize DrinkSize { get; set; } + public Guid OrderId { get; set; } + + public NewOrderMessage(String customerName, String drink, DrinkSize drinkSize) + { + CustomerName = customerName; + Drink = drink; + DrinkSize = drinkSize; + OrderId = Guid.NewGuid(); + } + } +} diff --git a/IntegrationTests/Azure/SQLAzure/CashierContracts/PaymentCompleteMessage.cs b/IntegrationTests/Azure/SQLAzure/CashierContracts/PaymentCompleteMessage.cs new file mode 100644 index 00000000000..c6b126a065a --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/CashierContracts/PaymentCompleteMessage.cs @@ -0,0 +1,15 @@ +using System; +using NServiceBus; + +namespace CashierContracts +{ + public class PaymentCompleteMessage : IEvent + { + public Guid OrderId { get; set; } + + public PaymentCompleteMessage(Guid orderId) + { + OrderId = orderId; + } + } +} diff --git a/Samples/Azure/SQLAzure/CashierContracts/PaymentMessage.cs b/IntegrationTests/Azure/SQLAzure/CashierContracts/PaymentMessage.cs similarity index 100% rename from Samples/Azure/SQLAzure/CashierContracts/PaymentMessage.cs rename to IntegrationTests/Azure/SQLAzure/CashierContracts/PaymentMessage.cs diff --git a/IntegrationTests/Azure/SQLAzure/CashierContracts/PrepareOrderMessage.cs b/IntegrationTests/Azure/SQLAzure/CashierContracts/PrepareOrderMessage.cs new file mode 100644 index 00000000000..eb154da31fe --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/CashierContracts/PrepareOrderMessage.cs @@ -0,0 +1,21 @@ +using System; +using NServiceBus; + +namespace CashierContracts +{ + public class PrepareOrderMessage : ICommand + { + public String CustomerName { get; set; } + public String Drink { get; set; } + public DrinkSize DrinkSize { get; set; } + public Guid OrderId { get; set; } + + public PrepareOrderMessage(String customerName, String drink, DrinkSize size, Guid orderId) + { + CustomerName = customerName; + Drink = drink; + DrinkSize = size; + OrderId = orderId; + } + } +} diff --git a/IntegrationTests/Azure/SQLAzure/CashierContracts/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/SQLAzure/CashierContracts/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..bdf41a8e7e6 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/CashierContracts/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CashierContracts")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CashierContracts")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("15e01ae1-e78d-4467-95a1-b5ce66f67de0")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IntegrationTests/Azure/SQLAzure/Customer/App.config b/IntegrationTests/Azure/SQLAzure/Customer/App.config new file mode 100644 index 00000000000..43cc49c79a7 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Customer/App.config @@ -0,0 +1,50 @@ + + + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/SQLAzure/Customer/Bootstrapper.cs b/IntegrationTests/Azure/SQLAzure/Customer/Bootstrapper.cs new file mode 100644 index 00000000000..b7794dff1b6 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Customer/Bootstrapper.cs @@ -0,0 +1,40 @@ +using Cashier; +using NServiceBus; +using StructureMap; + +namespace Customer +{ + public class Bootstrapper + { + private Bootstrapper() + {} + + public static void Bootstrap() + { + BootstrapStructureMap(); + BootstrapNServiceBus(); + } + + private static void BootstrapStructureMap() + { + ObjectFactory.Initialize(x => x.AddRegistry(new CustomerRegistry())); + } + + private static void BootstrapNServiceBus() + { + Configure.Transactions.Enable(); + Configure.Serialization.Json(); + + Configure.With() + .Log4Net() + .StructureMapBuilder(ObjectFactory.Container) + .AzureMessageQueue() + .UseNHibernateSubscriptionPersister() + .UseNHibernateTimeoutPersister() + .UnicastBus() + .LoadMessageHandlers() + .CreateBus() + .Start(); + } + } +} diff --git a/IntegrationTests/Azure/SQLAzure/Customer/Customer.csproj b/IntegrationTests/Azure/SQLAzure/Customer/Customer.csproj new file mode 100644 index 00000000000..f6eb1c3ebe7 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Customer/Customer.csproj @@ -0,0 +1,140 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79} + WinExe + Properties + Customer + Customer + v4.0 + 512 + + + + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\packages\Iesi.Collections.3.3.3.4000\lib\Net35\Iesi.Collections.dll + + + ..\packages\log4net.1.2.10\lib\2.0\log4net.dll + + + False + ..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.0.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + ..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\packages\NHibernate.3.3.3.4000\lib\Net35\NHibernate.dll + + + ..\..\..\..\binaries\NServiceBus.dll + + + ..\..\..\..\binaries\NServiceBus.Azure.dll + + + ..\..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\..\binaries\NServiceBus.NHibernate.dll + + + ..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll + + + ..\packages\structuremap.2.6.4.1\lib\net40\StructureMap.dll + + + + + + + + + False + ..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + + Form + + + CustomerOrder.cs + + + + + + + CustomerOrder.cs + + + + + Designer + + + Designer + + + + + {3963D354-2888-4005-8763-6E54A4D6BFCC} + CashierContracts + + + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} + CustomerContracts + + + + + + \ No newline at end of file diff --git a/Samples/Azure/SQLAzure/Customer/CustomerOrder.Designer.cs b/IntegrationTests/Azure/SQLAzure/Customer/CustomerOrder.Designer.cs similarity index 100% rename from Samples/Azure/SQLAzure/Customer/CustomerOrder.Designer.cs rename to IntegrationTests/Azure/SQLAzure/Customer/CustomerOrder.Designer.cs diff --git a/Samples/Azure/SQLAzure/Customer/CustomerOrder.cs b/IntegrationTests/Azure/SQLAzure/Customer/CustomerOrder.cs similarity index 100% rename from Samples/Azure/SQLAzure/Customer/CustomerOrder.cs rename to IntegrationTests/Azure/SQLAzure/Customer/CustomerOrder.cs diff --git a/Samples/Azure/SQLAzure/Customer/CustomerOrder.resx b/IntegrationTests/Azure/SQLAzure/Customer/CustomerOrder.resx similarity index 100% rename from Samples/Azure/SQLAzure/Customer/CustomerOrder.resx rename to IntegrationTests/Azure/SQLAzure/Customer/CustomerOrder.resx diff --git a/Samples/Azure/SQLAzure/Customer/CustomerRegistry.cs b/IntegrationTests/Azure/SQLAzure/Customer/CustomerRegistry.cs similarity index 100% rename from Samples/Azure/SQLAzure/Customer/CustomerRegistry.cs rename to IntegrationTests/Azure/SQLAzure/Customer/CustomerRegistry.cs diff --git a/Samples/Azure/SQLAzure/Customer/Program.cs b/IntegrationTests/Azure/SQLAzure/Customer/Program.cs similarity index 100% rename from Samples/Azure/SQLAzure/Customer/Program.cs rename to IntegrationTests/Azure/SQLAzure/Customer/Program.cs diff --git a/IntegrationTests/Azure/SQLAzure/Customer/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/SQLAzure/Customer/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..c757f613d04 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Customer/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Starbucks")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Starbucks")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("95d68a80-2651-4438-99f3-dcc3b6ff8fa2")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IntegrationTests/Azure/SQLAzure/Customer/packages.config b/IntegrationTests/Azure/SQLAzure/Customer/packages.config new file mode 100644 index 00000000000..f5f41242736 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Customer/packages.config @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/SQLAzure/CustomerContracts/CustomerContracts.csproj b/IntegrationTests/Azure/SQLAzure/CustomerContracts/CustomerContracts.csproj new file mode 100644 index 00000000000..e4acc7dafdc --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/CustomerContracts/CustomerContracts.csproj @@ -0,0 +1,60 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} + Library + Properties + CustomerContracts + CustomerContracts + v4.0 + 512 + + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\..\binaries\NServiceBus.dll + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/SQLAzure/CustomerContracts/OrderReadyMessage.cs b/IntegrationTests/Azure/SQLAzure/CustomerContracts/OrderReadyMessage.cs new file mode 100644 index 00000000000..142567dda48 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/CustomerContracts/OrderReadyMessage.cs @@ -0,0 +1,17 @@ +using System; +using NServiceBus; + +namespace CustomerContracts +{ + public class OrderReadyMessage : IEvent + { + public String CustomerName { get; set; } + public String Drink { get; set; } + + public OrderReadyMessage(String customerName, String drink) + { + CustomerName = customerName; + Drink = drink; + } + } +} diff --git a/Samples/Azure/SQLAzure/CustomerContracts/PaymentRequestMessage.cs b/IntegrationTests/Azure/SQLAzure/CustomerContracts/PaymentRequestMessage.cs similarity index 100% rename from Samples/Azure/SQLAzure/CustomerContracts/PaymentRequestMessage.cs rename to IntegrationTests/Azure/SQLAzure/CustomerContracts/PaymentRequestMessage.cs diff --git a/IntegrationTests/Azure/SQLAzure/CustomerContracts/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/SQLAzure/CustomerContracts/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..bbc99f61e1f --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/CustomerContracts/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("CustomerContracts")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("CustomerContracts")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("b661ecb2-d7f2-4346-94a8-198ec4b10b3b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IntegrationTests/Azure/SQLAzure/Starbucks.sln b/IntegrationTests/Azure/SQLAzure/Starbucks.sln new file mode 100644 index 00000000000..e06efe01482 --- /dev/null +++ b/IntegrationTests/Azure/SQLAzure/Starbucks.sln @@ -0,0 +1,84 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cashier", "Cashier\Cashier.csproj", "{DCCBF183-A703-4999-BB10-046E6C2800B9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Customer", "Customer\Customer.csproj", "{88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CashierContracts", "CashierContracts\CashierContracts.csproj", "{3963D354-2888-4005-8763-6E54A4D6BFCC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomerContracts", "CustomerContracts\CustomerContracts.csproj", "{05882666-3DBD-4B8D-ADAE-439CABDD7DFB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Barista", "Barista\Barista.csproj", "{F5C48D42-06F2-4CCA-88B5-6C49F2A09065}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{EDD8AE2F-B346-44C0-99A2-0C8B7695FE95}" + ProjectSection(SolutionItems) = preProject + .nuget\NuGet.Config = .nuget\NuGet.Config + .nuget\NuGet.exe = .nuget\NuGet.exe + .nuget\NuGet.targets = .nuget\NuGet.targets + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|x86.ActiveCfg = Debug|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Any CPU.Build.0 = Release|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|x86.ActiveCfg = Release|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Any CPU.Build.0 = Debug|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|x86.ActiveCfg = Debug|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Any CPU.ActiveCfg = Release|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Any CPU.Build.0 = Release|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|x86.ActiveCfg = Release|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|x86.ActiveCfg = Debug|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Any CPU.Build.0 = Release|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|x86.ActiveCfg = Release|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|x86.ActiveCfg = Debug|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Any CPU.Build.0 = Release|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|x86.ActiveCfg = Release|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|x86.ActiveCfg = Debug|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Any CPU.Build.0 = Release|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|x86.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3.ncrunchsolution b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3.ncrunchsolution new file mode 100644 index 00000000000..c1a8525e9e3 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3.ncrunchsolution @@ -0,0 +1,12 @@ + + 0 + Default + false + UseDynamicAnalysis + UseStaticAnalysis + UseStaticAnalysis + UseStaticAnalysis + Run all tests automatically:BFRydWU=;Run all tests manually:BUZhbHNl;Run impacted tests automatically, others manually (experimental!):CklzSW1wYWN0ZWQ=;Run pinned tests automatically, others manually:CElzUGlubmVk + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3.sln b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3.sln new file mode 100644 index 00000000000..57a90890120 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3.sln @@ -0,0 +1,38 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "AsyncPagesMVC3", "AsyncPagesMVC3\AsyncPagesMVC3.ccproj", "{F32F2A21-92D3-47B9-A06A-8C23CEF55BED}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Website", "Website\Website.csproj", "{12AFC759-8E5F-4B5C-B092-F7FF30A1F8C8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Worker", "Worker\Worker.csproj", "{39F7FC6A-4319-4AC5-89AF-36D730FC547D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Contract", "Contract\Contract.csproj", "{A2995239-C5E5-49B6-B134-34CD331BC51F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {F32F2A21-92D3-47B9-A06A-8C23CEF55BED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F32F2A21-92D3-47B9-A06A-8C23CEF55BED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F32F2A21-92D3-47B9-A06A-8C23CEF55BED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F32F2A21-92D3-47B9-A06A-8C23CEF55BED}.Release|Any CPU.Build.0 = Release|Any CPU + {12AFC759-8E5F-4B5C-B092-F7FF30A1F8C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12AFC759-8E5F-4B5C-B092-F7FF30A1F8C8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12AFC759-8E5F-4B5C-B092-F7FF30A1F8C8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12AFC759-8E5F-4B5C-B092-F7FF30A1F8C8}.Release|Any CPU.Build.0 = Release|Any CPU + {39F7FC6A-4319-4AC5-89AF-36D730FC547D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39F7FC6A-4319-4AC5-89AF-36D730FC547D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39F7FC6A-4319-4AC5-89AF-36D730FC547D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39F7FC6A-4319-4AC5-89AF-36D730FC547D}.Release|Any CPU.Build.0 = Release|Any CPU + {A2995239-C5E5-49B6-B134-34CD331BC51F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A2995239-C5E5-49B6-B134-34CD331BC51F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A2995239-C5E5-49B6-B134-34CD331BC51F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A2995239-C5E5-49B6-B134-34CD331BC51F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.ccproj b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.ccproj new file mode 100644 index 00000000000..ef5d398abef --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.ccproj @@ -0,0 +1,64 @@ + + + + + Debug + AnyCPU + 2.0 + {f32f2a21-92d3-47b9-a06a-8c23cef55bed} + Library + Properties + AsyncPagesMVC3 + AsyncPagesMVC3 + True + AsyncPagesMVC3 + False + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + Website + {12afc759-8e5f-4b5c-b092-f7ff30a1f8c8} + True + Web + Website + True + + + Worker + {39f7fc6a-4319-4ac5-89af-36d730fc547d} + True + Worker + Worker + True + + + + + 10.0 + $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\2.0\ + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Cloud.cscfg b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Cloud.cscfg new file mode 100644 index 00000000000..8fc3cb813bd --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Cloud.cscfg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Local.cscfg b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Local.cscfg new file mode 100644 index 00000000000..ebad5d8d0d4 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Local.cscfg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.build.csdef b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.build.csdef new file mode 100644 index 00000000000..0bd2145731e --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.build.csdef @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.csdef b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.csdef new file mode 100644 index 00000000000..c629fccb5a7 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.csdef @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3.sln b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/AsyncPagesMVC3.sln similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3.sln rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/AsyncPagesMVC3.sln diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/Site.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/Site.css new file mode 100644 index 00000000000..56ff8bd77e8 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/Site.css @@ -0,0 +1,75 @@ +body +{ + font-size: .85em; + font-family: "Trebuchet MS", Verdana, Helvetica, Sans-Serif; + color: #232323; + background-color: #fff; +} + +header, +footer, +nav, +section { + display: block; +} + +/* Styles for basic forms +-----------------------------------------------------------*/ + +fieldset +{ + border:1px solid #ddd; + padding:0 1.4em 1.4em 1.4em; + margin:0 0 1.5em 0; +} + +legend +{ + font-size:1.2em; + font-weight: bold; +} + +textarea +{ + min-height: 75px; +} + +.editor-label +{ + margin: 1em 0 0 0; +} + +.editor-field +{ + margin:0.5em 0 0 0; +} + + +/* Styles for validation helpers +-----------------------------------------------------------*/ +.field-validation-error +{ + color: #ff0000; +} + +.field-validation-valid +{ + display: none; +} + +.input-validation-error +{ + border: 1px solid #ff0000; + background-color: #ffeeee; +} + +.validation-summary-errors +{ + font-weight: bold; + color: #ff0000; +} + +.validation-summary-valid +{ + display: none; +} diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_flat_0_aaaaaa_40x100.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_flat_75_ffffff_40x100.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_55_fbf9ee_1x400.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_65_ffffff_1x400.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_75_dadada_1x400.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_75_e6e6e6_1x400.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_glass_95_fef1ec_1x400.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-bg_highlight-soft_75_cccccc_1x100.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_222222_256x240.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_222222_256x240.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_222222_256x240.png rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_222222_256x240.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_2e83ff_256x240.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_454545_256x240.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_454545_256x240.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_454545_256x240.png rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_454545_256x240.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_888888_256x240.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_888888_256x240.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_888888_256x240.png rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_888888_256x240.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_cd0a0a_256x240.png similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/images/ui-icons_cd0a0a_256x240.png diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery-ui.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery-ui.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/jquery-ui.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery-ui.css diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.accordion.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.accordion.css new file mode 100644 index 00000000000..4a67cbf8e42 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.accordion.css @@ -0,0 +1,24 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Accordion 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Accordion#theming + */ +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; } diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.all.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.all.css new file mode 100644 index 00000000000..2b2c103e803 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.all.css @@ -0,0 +1,16 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI CSS Framework 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Theming + */ +@import "jquery.ui.base.css"; +@import "jquery.ui.theme.css"; diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.autocomplete.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.autocomplete.css new file mode 100644 index 00000000000..aac4e204d26 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.autocomplete.css @@ -0,0 +1,62 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Autocomplete 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * http://docs.jquery.com/UI/Autocomplete#theming + */ +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Menu 1.8.11 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.base.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.base.css new file mode 100644 index 00000000000..f52ee39b959 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.base.css @@ -0,0 +1,11 @@ +@import url("jquery.ui.core.css"); +@import url("jquery.ui.resizable.css"); +@import url("jquery.ui.selectable.css"); +@import url("jquery.ui.accordion.css"); +@import url("jquery.ui.autocomplete.css"); +@import url("jquery.ui.button.css"); +@import url("jquery.ui.dialog.css"); +@import url("jquery.ui.slider.css"); +@import url("jquery.ui.tabs.css"); +@import url("jquery.ui.datepicker.css"); +@import url("jquery.ui.progressbar.css"); \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.button.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.button.css new file mode 100644 index 00000000000..af6c985b8dc --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.button.css @@ -0,0 +1,43 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Button 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Button#theming + */ +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.core.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.core.css new file mode 100644 index 00000000000..55fb8b0d990 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.core.css @@ -0,0 +1,46 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI CSS Framework 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.datepicker.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.datepicker.css new file mode 100644 index 00000000000..7126923cc02 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.datepicker.css @@ -0,0 +1,73 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Datepicker 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Datepicker#theming + */ +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +} \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.dialog.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.dialog.css new file mode 100644 index 00000000000..311dd32e5d0 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.dialog.css @@ -0,0 +1,26 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Dialog 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.progressbar.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.progressbar.css new file mode 100644 index 00000000000..6e8718e03fa --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.progressbar.css @@ -0,0 +1,16 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Progressbar 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Progressbar#theming + */ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.resizable.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.resizable.css new file mode 100644 index 00000000000..bf037be1839 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.resizable.css @@ -0,0 +1,25 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Resizable 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)] + * + * http://docs.jquery.com/UI/Resizable#theming + */ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;} +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.selectable.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.selectable.css new file mode 100644 index 00000000000..011416b6f70 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.selectable.css @@ -0,0 +1,15 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Selectable 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Selectable#theming + */ +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.slider.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.slider.css new file mode 100644 index 00000000000..3bbfb932dbf --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.slider.css @@ -0,0 +1,29 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Slider 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Slider#theming + */ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; } \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.tabs.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.tabs.css new file mode 100644 index 00000000000..aa5cd8a546f --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.tabs.css @@ -0,0 +1,23 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI Tabs 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Tabs#theming + */ +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.theme.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.theme.css new file mode 100644 index 00000000000..0d5b7354655 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/jquery.ui.theme.css @@ -0,0 +1,257 @@ +/* + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery UI CSS Framework 1.8.11 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/ + */ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; } +.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; } +.ui-widget-content a { color: #222222/*{fcContent}*/; } +.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; } +.ui-widget-header a { color: #222222/*{fcHeader}*/; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; } +.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; } +.ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; } +.ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-top { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-bottom { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-right { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } +.ui-corner-left { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; } +.ui-corner-all { -moz-border-radius: 4px/*{cornerRadius}*/; -webkit-border-radius: 4px/*{cornerRadius}*/; border-radius: 4px/*{cornerRadius}*/; } + +/* Overlays */ +.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; } +.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; } \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100644 index 00000000000..5b5dab2ab7b Binary files /dev/null and b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png new file mode 100644 index 00000000000..ac8b229af95 Binary files /dev/null and b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100644 index 00000000000..ad3d6346e00 Binary files /dev/null and b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 00000000000..42ccba269b6 Binary files /dev/null and b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png new file mode 100644 index 00000000000..5a46b47cb16 Binary files /dev/null and b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png new file mode 100644 index 00000000000..86c2baa655e Binary files /dev/null and b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png new file mode 100644 index 00000000000..4443fdc1a15 Binary files /dev/null and b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100644 index 00000000000..7c9fa6c6edc Binary files /dev/null and b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_222222_256x240.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_222222_256x240.png new file mode 100644 index 00000000000..ee039dc096a Binary files /dev/null and b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_222222_256x240.png differ diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png new file mode 100644 index 00000000000..45e8928e528 Binary files /dev/null and b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_2e83ff_256x240.png differ diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_454545_256x240.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_454545_256x240.png new file mode 100644 index 00000000000..7ec70d11bfb Binary files /dev/null and b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_454545_256x240.png differ diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_888888_256x240.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_888888_256x240.png new file mode 100644 index 00000000000..5ba708c3917 Binary files /dev/null and b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_888888_256x240.png differ diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png new file mode 100644 index 00000000000..7930a558099 Binary files /dev/null and b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/images/ui-icons_cd0a0a_256x240.png differ diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery-ui.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery-ui.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery-ui.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery-ui.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.accordion.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.accordion.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.accordion.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.accordion.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.all.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.all.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.all.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.all.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.autocomplete.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.autocomplete.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.autocomplete.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.autocomplete.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.base.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.base.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.base.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.base.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.button.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.button.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.button.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.button.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.core.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.core.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.core.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.core.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.datepicker.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.datepicker.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.datepicker.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.datepicker.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.dialog.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.dialog.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.dialog.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.dialog.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.progressbar.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.progressbar.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.progressbar.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.progressbar.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.resizable.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.resizable.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.resizable.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.resizable.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.selectable.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.selectable.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.selectable.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.selectable.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.slider.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.slider.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.slider.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.slider.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.tabs.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.tabs.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.tabs.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.tabs.min.css diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.theme.min.css b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.theme.min.css similarity index 100% rename from Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Content/themes/base/minified/jquery.ui.theme.min.css rename to IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Content/themes/base/minified/jquery.ui.theme.min.css diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Controllers/HomeController.cs b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Controllers/HomeController.cs new file mode 100644 index 00000000000..c9e73a3f266 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Controllers/HomeController.cs @@ -0,0 +1,16 @@ +using System.Web.Mvc; + +namespace Website +{ + public class HomeController : Controller + { + // + // GET: /Home/ + + public ActionResult SendLinks() + { + return View(); + } + + } +} diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Controllers/SendAndBlockController.cs b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Controllers/SendAndBlockController.cs new file mode 100644 index 00000000000..5da19a88a38 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Controllers/SendAndBlockController.cs @@ -0,0 +1,47 @@ +using System; +using System.Threading; +using System.Web.Mvc; +using Contract; +using NServiceBus; + +namespace Website +{ + public class SendAndBlockController : Controller + { + // Bus property to be injected + public IBus Bus { get; set; } + + [HttpGet] + public ActionResult Index() + { + ViewBag.Title = "SendAndBlock"; + return View(); + } + + [HttpPost] + public ActionResult Index(string textField) + { + ViewBag.Title = "SendAndBlock"; + + int number; + if (!int.TryParse(textField, out number)) + return View(); + + var command = new Command { Id = number }; + + IAsyncResult res = Bus.Send(command).Register(SimpleCommandCallback, this); + WaitHandle asyncWaitHandle = res.AsyncWaitHandle; + asyncWaitHandle.WaitOne(50000); + + return View(); + } + + private void SimpleCommandCallback(IAsyncResult asyncResult) + { + var result = asyncResult.AsyncState as CompletionResult; + var controller = result.State as SendAndBlockController; + controller.ViewBag.ResponseText = Enum.GetName(typeof (ErrorCodes), result.ErrorCode); + } + + } +} diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Controllers/SendAsyncController.cs b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Controllers/SendAsyncController.cs new file mode 100644 index 00000000000..d040a7b70bd --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Controllers/SendAsyncController.cs @@ -0,0 +1,47 @@ +using System; +using System.Web.Mvc; +using Contract; +using NServiceBus; + +namespace Website +{ + public class SendAsyncController : AsyncController + { + // Bus property to be injected + public IBus Bus { get; set; } + + [HttpGet] + public ActionResult Index() + { + ViewBag.Title = "SendAsync"; + return View("Index"); + } + + [HttpPost] + [AsyncTimeout(50000)] + public void IndexAsync(string textField) + { + int number; + if (!int.TryParse(textField, out number)) + return; + + AsyncManager.OutstandingOperations.Increment(); + var command = new Command { Id = number }; + Bus.Send(command).Register(SimpleCommandCallback, this); + } + + public ActionResult IndexCompleted(string errorCode) + { + ViewBag.Title = "SendAsync"; + ViewBag.ResponseText = errorCode; + return View("Index"); + } + + private void SimpleCommandCallback(IAsyncResult asyncResult) + { + var result = asyncResult.AsyncState as CompletionResult; + AsyncManager.Parameters["errorCode"] = Enum.GetName(typeof(ErrorCodes), result.ErrorCode); + AsyncManager.OutstandingOperations.Decrement(); + } + } +} diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Global.asax b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Global.asax new file mode 100644 index 00000000000..332f04ea290 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Global.asax @@ -0,0 +1 @@ +<%@ Application Codebehind="Global.asax.cs" Inherits="Website.MvcApplication" Language="C#" %> diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Global.asax.cs b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Global.asax.cs new file mode 100644 index 00000000000..485e2da4b6b --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Global.asax.cs @@ -0,0 +1,69 @@ +using System; +using System.Web; +using System.Web.Mvc; +using System.Web.Routing; +using NServiceBus; +using NServiceBus.Config; +using NServiceBus.Integration.Azure; + +namespace Website +{ + public class MvcApplication : HttpApplication + { + public static IBus Bus; + + private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); + + private static IBus ConfigureNServiceBus() + { + Configure.Serialization.Json(); + + var bus = Configure.With() + .DefaultBuilder() + .ForMvc() + .Log4Net(new AzureAppender()) + .AzureConfigurationSource() + .AzureServiceBusMessageQueue() + .QueuePerInstance() + .PurgeOnStartup(true) + .UseInMemoryTimeoutPersister() + .UnicastBus() + .LoadMessageHandlers() + .IsTransactional(true) + .CreateBus() + .Start(); + + return bus; + } + + public static void RegisterGlobalFilters(GlobalFilterCollection filters) + { + filters.Add(new HandleErrorAttribute()); + } + + public static void RegisterRoutes(RouteCollection routes) + { + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + + routes.MapRoute( + "Default", // Route name + "{controller}/{action}/{id}", // URL with parameters + new { controller = "Home", action = "SendLinks", id = UrlParameter.Optional } // Parameter defaults + + ); + } + + protected void Application_Start() + { + AreaRegistration.RegisterAllAreas(); + + RegisterGlobalFilters(GlobalFilters.Filters); + RegisterRoutes(RouteTable.Routes); + } + + protected void Application_BeginRequest(object sender, EventArgs e) + { + Bus = StartBus.Value; + } + } +} \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/InjectionConfiguration/ConfigureMvc3.cs b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/InjectionConfiguration/ConfigureMvc3.cs new file mode 100644 index 00000000000..6d5797701e9 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/InjectionConfiguration/ConfigureMvc3.cs @@ -0,0 +1,31 @@ +using System; +using System.Linq; +using System.Web.Mvc; +using NServiceBus; + +namespace Website +{ + public static class ConfigureMvc3 + { + public static Configure ForMvc(this Configure configure) + { + // Register our controller activator with NSB + configure.Configurer.RegisterSingleton(typeof(IControllerActivator), + new NServiceBusControllerActivator()); + + // Find every controller class so that we can register it + var controllers = Configure.TypesToScan + .Where(t => typeof(IController).IsAssignableFrom(t)); + + // Register each controller class with the NServiceBus container + foreach (Type type in controllers) + configure.Configurer.ConfigureComponent(type, DependencyLifecycle.InstancePerCall); + + // Set the MVC dependency resolver to use our resolver + DependencyResolver.SetResolver(new NServiceBusDependencyResolverAdapter(configure.Builder)); + + // Required by the fluent configuration semantics + return configure; + } + } +} \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/InjectionConfiguration/NServiceBusControllerActivator.cs b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/InjectionConfiguration/NServiceBusControllerActivator.cs new file mode 100644 index 00000000000..5d05a090f29 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/InjectionConfiguration/NServiceBusControllerActivator.cs @@ -0,0 +1,14 @@ +using System; +using System.Web.Mvc; +using System.Web.Routing; + +namespace Website +{ + public class NServiceBusControllerActivator : IControllerActivator + { + public IController Create(RequestContext requestContext, Type controllerType) + { + return DependencyResolver.Current.GetService(controllerType) as IController; + } + } +} \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/InjectionConfiguration/NServiceBusDependencyResolverAdapter.cs b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/InjectionConfiguration/NServiceBusDependencyResolverAdapter.cs new file mode 100644 index 00000000000..0c93c8e4018 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/InjectionConfiguration/NServiceBusDependencyResolverAdapter.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Web.Mvc; +using NServiceBus.ObjectBuilder; + +namespace Website +{ + public class NServiceBusDependencyResolverAdapter : IDependencyResolver + { + private IBuilder builder; + + public NServiceBusDependencyResolverAdapter(IBuilder builder) + { + this.builder = builder; + } + + public object GetService(Type serviceType) + { + if (NServiceBus.Configure.Instance.Configurer.HasComponent(serviceType)) + return builder.Build(serviceType); + else + return null; + } + + public IEnumerable GetServices(Type serviceType) + { + return builder.BuildAll(serviceType); + } + } +} \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Properties/AssemblyInfo.cs b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..951828628dc --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Website")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Capgemini")] +[assembly: AssemblyProduct("Website")] +[assembly: AssemblyCopyright("Copyright © Capgemini 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("378e2ff0-f929-429a-89cb-63b9a258599e")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftAjax.debug.js b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftAjax.debug.js new file mode 100644 index 00000000000..a5f7942ef2b --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftAjax.debug.js @@ -0,0 +1,7117 @@ +// Name: MicrosoftAjax.debug.js +// Assembly: System.Web.Extensions +// Version: 4.0.0.0 +// FileVersion: 4.0.20526.0 +//----------------------------------------------------------------------- +// Copyright (C) Microsoft Corporation. All rights reserved. +//----------------------------------------------------------------------- +// MicrosoftAjax.js +// Microsoft AJAX Framework. + +Function.__typeName = 'Function'; +Function.__class = true; +Function.createCallback = function Function$createCallback(method, context) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "method", type: Function}, + {name: "context", mayBeNull: true} + ]); + if (e) throw e; + return function() { + var l = arguments.length; + if (l > 0) { + var args = []; + for (var i = 0; i < l; i++) { + args[i] = arguments[i]; + } + args[l] = context; + return method.apply(this, args); + } + return method.call(this, context); + } +} +Function.createDelegate = function Function$createDelegate(instance, method) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance", mayBeNull: true}, + {name: "method", type: Function} + ]); + if (e) throw e; + return function() { + return method.apply(instance, arguments); + } +} +Function.emptyFunction = Function.emptyMethod = function Function$emptyMethod() { + /// +} +Function.validateParameters = function Function$validateParameters(parameters, expectedParameters, validateParameterCount) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "parameters"}, + {name: "expectedParameters"}, + {name: "validateParameterCount", type: Boolean, optional: true} + ]); + if (e) throw e; + return Function._validateParams(parameters, expectedParameters, validateParameterCount); +} +Function._validateParams = function Function$_validateParams(params, expectedParams, validateParameterCount) { + var e, expectedLength = expectedParams.length; + validateParameterCount = validateParameterCount || (typeof(validateParameterCount) === "undefined"); + e = Function._validateParameterCount(params, expectedParams, validateParameterCount); + if (e) { + e.popStackFrame(); + return e; + } + for (var i = 0, l = params.length; i < l; i++) { + var expectedParam = expectedParams[Math.min(i, expectedLength - 1)], + paramName = expectedParam.name; + if (expectedParam.parameterArray) { + paramName += "[" + (i - expectedLength + 1) + "]"; + } + else if (!validateParameterCount && (i >= expectedLength)) { + break; + } + e = Function._validateParameter(params[i], expectedParam, paramName); + if (e) { + e.popStackFrame(); + return e; + } + } + return null; +} +Function._validateParameterCount = function Function$_validateParameterCount(params, expectedParams, validateParameterCount) { + var i, error, + expectedLen = expectedParams.length, + actualLen = params.length; + if (actualLen < expectedLen) { + var minParams = expectedLen; + for (i = 0; i < expectedLen; i++) { + var param = expectedParams[i]; + if (param.optional || param.parameterArray) { + minParams--; + } + } + if (actualLen < minParams) { + error = true; + } + } + else if (validateParameterCount && (actualLen > expectedLen)) { + error = true; + for (i = 0; i < expectedLen; i++) { + if (expectedParams[i].parameterArray) { + error = false; + break; + } + } + } + if (error) { + var e = Error.parameterCount(); + e.popStackFrame(); + return e; + } + return null; +} +Function._validateParameter = function Function$_validateParameter(param, expectedParam, paramName) { + var e, + expectedType = expectedParam.type, + expectedInteger = !!expectedParam.integer, + expectedDomElement = !!expectedParam.domElement, + mayBeNull = !!expectedParam.mayBeNull; + e = Function._validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName); + if (e) { + e.popStackFrame(); + return e; + } + var expectedElementType = expectedParam.elementType, + elementMayBeNull = !!expectedParam.elementMayBeNull; + if (expectedType === Array && typeof(param) !== "undefined" && param !== null && + (expectedElementType || !elementMayBeNull)) { + var expectedElementInteger = !!expectedParam.elementInteger, + expectedElementDomElement = !!expectedParam.elementDomElement; + for (var i=0; i < param.length; i++) { + var elem = param[i]; + e = Function._validateParameterType(elem, expectedElementType, + expectedElementInteger, expectedElementDomElement, elementMayBeNull, + paramName + "[" + i + "]"); + if (e) { + e.popStackFrame(); + return e; + } + } + } + return null; +} +Function._validateParameterType = function Function$_validateParameterType(param, expectedType, expectedInteger, expectedDomElement, mayBeNull, paramName) { + var e, i; + if (typeof(param) === "undefined") { + if (mayBeNull) { + return null; + } + else { + e = Error.argumentUndefined(paramName); + e.popStackFrame(); + return e; + } + } + if (param === null) { + if (mayBeNull) { + return null; + } + else { + e = Error.argumentNull(paramName); + e.popStackFrame(); + return e; + } + } + if (expectedType && expectedType.__enum) { + if (typeof(param) !== 'number') { + e = Error.argumentType(paramName, Object.getType(param), expectedType); + e.popStackFrame(); + return e; + } + if ((param % 1) === 0) { + var values = expectedType.prototype; + if (!expectedType.__flags || (param === 0)) { + for (i in values) { + if (values[i] === param) return null; + } + } + else { + var v = param; + for (i in values) { + var vali = values[i]; + if (vali === 0) continue; + if ((vali & param) === vali) { + v -= vali; + } + if (v === 0) return null; + } + } + } + e = Error.argumentOutOfRange(paramName, param, String.format(Sys.Res.enumInvalidValue, param, expectedType.getName())); + e.popStackFrame(); + return e; + } + if (expectedDomElement && (!Sys._isDomElement(param) || (param.nodeType === 3))) { + e = Error.argument(paramName, Sys.Res.argumentDomElement); + e.popStackFrame(); + return e; + } + if (expectedType && !Sys._isInstanceOfType(expectedType, param)) { + e = Error.argumentType(paramName, Object.getType(param), expectedType); + e.popStackFrame(); + return e; + } + if (expectedType === Number && expectedInteger) { + if ((param % 1) !== 0) { + e = Error.argumentOutOfRange(paramName, param, Sys.Res.argumentInteger); + e.popStackFrame(); + return e; + } + } + return null; +} + +Error.__typeName = 'Error'; +Error.__class = true; +Error.create = function Error$create(message, errorInfo) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "message", type: String, mayBeNull: true, optional: true}, + {name: "errorInfo", mayBeNull: true, optional: true} + ]); + if (e) throw e; + var err = new Error(message); + err.message = message; + if (errorInfo) { + for (var v in errorInfo) { + err[v] = errorInfo[v]; + } + } + err.popStackFrame(); + return err; +} +Error.argument = function Error$argument(paramName, message) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "paramName", type: String, mayBeNull: true, optional: true}, + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.ArgumentException: " + (message ? message : Sys.Res.argument); + if (paramName) { + displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); + } + var err = Error.create(displayMessage, { name: "Sys.ArgumentException", paramName: paramName }); + err.popStackFrame(); + return err; +} +Error.argumentNull = function Error$argumentNull(paramName, message) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "paramName", type: String, mayBeNull: true, optional: true}, + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.ArgumentNullException: " + (message ? message : Sys.Res.argumentNull); + if (paramName) { + displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); + } + var err = Error.create(displayMessage, { name: "Sys.ArgumentNullException", paramName: paramName }); + err.popStackFrame(); + return err; +} +Error.argumentOutOfRange = function Error$argumentOutOfRange(paramName, actualValue, message) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "paramName", type: String, mayBeNull: true, optional: true}, + {name: "actualValue", mayBeNull: true, optional: true}, + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.ArgumentOutOfRangeException: " + (message ? message : Sys.Res.argumentOutOfRange); + if (paramName) { + displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); + } + if (typeof(actualValue) !== "undefined" && actualValue !== null) { + displayMessage += "\n" + String.format(Sys.Res.actualValue, actualValue); + } + var err = Error.create(displayMessage, { + name: "Sys.ArgumentOutOfRangeException", + paramName: paramName, + actualValue: actualValue + }); + err.popStackFrame(); + return err; +} +Error.argumentType = function Error$argumentType(paramName, actualType, expectedType, message) { + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "paramName", type: String, mayBeNull: true, optional: true}, + {name: "actualType", type: Type, mayBeNull: true, optional: true}, + {name: "expectedType", type: Type, mayBeNull: true, optional: true}, + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.ArgumentTypeException: "; + if (message) { + displayMessage += message; + } + else if (actualType && expectedType) { + displayMessage += + String.format(Sys.Res.argumentTypeWithTypes, actualType.getName(), expectedType.getName()); + } + else { + displayMessage += Sys.Res.argumentType; + } + if (paramName) { + displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); + } + var err = Error.create(displayMessage, { + name: "Sys.ArgumentTypeException", + paramName: paramName, + actualType: actualType, + expectedType: expectedType + }); + err.popStackFrame(); + return err; +} +Error.argumentUndefined = function Error$argumentUndefined(paramName, message) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "paramName", type: String, mayBeNull: true, optional: true}, + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.ArgumentUndefinedException: " + (message ? message : Sys.Res.argumentUndefined); + if (paramName) { + displayMessage += "\n" + String.format(Sys.Res.paramName, paramName); + } + var err = Error.create(displayMessage, { name: "Sys.ArgumentUndefinedException", paramName: paramName }); + err.popStackFrame(); + return err; +} +Error.format = function Error$format(message) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.FormatException: " + (message ? message : Sys.Res.format); + var err = Error.create(displayMessage, {name: 'Sys.FormatException'}); + err.popStackFrame(); + return err; +} +Error.invalidOperation = function Error$invalidOperation(message) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.InvalidOperationException: " + (message ? message : Sys.Res.invalidOperation); + var err = Error.create(displayMessage, {name: 'Sys.InvalidOperationException'}); + err.popStackFrame(); + return err; +} +Error.notImplemented = function Error$notImplemented(message) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.NotImplementedException: " + (message ? message : Sys.Res.notImplemented); + var err = Error.create(displayMessage, {name: 'Sys.NotImplementedException'}); + err.popStackFrame(); + return err; +} +Error.parameterCount = function Error$parameterCount(message) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "message", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var displayMessage = "Sys.ParameterCountException: " + (message ? message : Sys.Res.parameterCount); + var err = Error.create(displayMessage, {name: 'Sys.ParameterCountException'}); + err.popStackFrame(); + return err; +} +Error.prototype.popStackFrame = function Error$popStackFrame() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (typeof(this.stack) === "undefined" || this.stack === null || + typeof(this.fileName) === "undefined" || this.fileName === null || + typeof(this.lineNumber) === "undefined" || this.lineNumber === null) { + return; + } + var stackFrames = this.stack.split("\n"); + var currentFrame = stackFrames[0]; + var pattern = this.fileName + ":" + this.lineNumber; + while(typeof(currentFrame) !== "undefined" && + currentFrame !== null && + currentFrame.indexOf(pattern) === -1) { + stackFrames.shift(); + currentFrame = stackFrames[0]; + } + var nextFrame = stackFrames[1]; + if (typeof(nextFrame) === "undefined" || nextFrame === null) { + return; + } + var nextFrameParts = nextFrame.match(/@(.*):(\d+)$/); + if (typeof(nextFrameParts) === "undefined" || nextFrameParts === null) { + return; + } + this.fileName = nextFrameParts[1]; + this.lineNumber = parseInt(nextFrameParts[2]); + stackFrames.shift(); + this.stack = stackFrames.join("\n"); +} + +Object.__typeName = 'Object'; +Object.__class = true; +Object.getType = function Object$getType(instance) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance"} + ]); + if (e) throw e; + var ctor = instance.constructor; + if (!ctor || (typeof(ctor) !== "function") || !ctor.__typeName || (ctor.__typeName === 'Object')) { + return Object; + } + return ctor; +} +Object.getTypeName = function Object$getTypeName(instance) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance"} + ]); + if (e) throw e; + return Object.getType(instance).getName(); +} + +String.__typeName = 'String'; +String.__class = true; +String.prototype.endsWith = function String$endsWith(suffix) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "suffix", type: String} + ]); + if (e) throw e; + return (this.substr(this.length - suffix.length) === suffix); +} +String.prototype.startsWith = function String$startsWith(prefix) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "prefix", type: String} + ]); + if (e) throw e; + return (this.substr(0, prefix.length) === prefix); +} +String.prototype.trim = function String$trim() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this.replace(/^\s+|\s+$/g, ''); +} +String.prototype.trimEnd = function String$trimEnd() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this.replace(/\s+$/, ''); +} +String.prototype.trimStart = function String$trimStart() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this.replace(/^\s+/, ''); +} +String.format = function String$format(format, args) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "format", type: String}, + {name: "args", mayBeNull: true, parameterArray: true} + ]); + if (e) throw e; + return String._toFormattedString(false, arguments); +} +String._toFormattedString = function String$_toFormattedString(useLocale, args) { + var result = ''; + var format = args[0]; + for (var i=0;;) { + var open = format.indexOf('{', i); + var close = format.indexOf('}', i); + if ((open < 0) && (close < 0)) { + result += format.slice(i); + break; + } + if ((close > 0) && ((close < open) || (open < 0))) { + if (format.charAt(close + 1) !== '}') { + throw Error.argument('format', Sys.Res.stringFormatBraceMismatch); + } + result += format.slice(i, close + 1); + i = close + 2; + continue; + } + result += format.slice(i, open); + i = open + 1; + if (format.charAt(i) === '{') { + result += '{'; + i++; + continue; + } + if (close < 0) throw Error.argument('format', Sys.Res.stringFormatBraceMismatch); + var brace = format.substring(i, close); + var colonIndex = brace.indexOf(':'); + var argNumber = parseInt((colonIndex < 0)? brace : brace.substring(0, colonIndex), 10) + 1; + if (isNaN(argNumber)) throw Error.argument('format', Sys.Res.stringFormatInvalid); + var argFormat = (colonIndex < 0)? '' : brace.substring(colonIndex + 1); + var arg = args[argNumber]; + if (typeof(arg) === "undefined" || arg === null) { + arg = ''; + } + if (arg.toFormattedString) { + result += arg.toFormattedString(argFormat); + } + else if (useLocale && arg.localeFormat) { + result += arg.localeFormat(argFormat); + } + else if (arg.format) { + result += arg.format(argFormat); + } + else + result += arg.toString(); + i = close + 1; + } + return result; +} + +Boolean.__typeName = 'Boolean'; +Boolean.__class = true; +Boolean.parse = function Boolean$parse(value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String} + ], false); + if (e) throw e; + var v = value.trim().toLowerCase(); + if (v === 'false') return false; + if (v === 'true') return true; + throw Error.argumentOutOfRange('value', value, Sys.Res.boolTrueOrFalse); +} + +Date.__typeName = 'Date'; +Date.__class = true; + +Number.__typeName = 'Number'; +Number.__class = true; + +RegExp.__typeName = 'RegExp'; +RegExp.__class = true; + +if (!window) this.window = this; +window.Type = Function; +Type.__fullyQualifiedIdentifierRegExp = new RegExp("^[^.0-9 \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]([^ \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]*[^. \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\])?$", "i"); +Type.__identifierRegExp = new RegExp("^[^.0-9 \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\][^. \\s|,;:&*=+\\-()\\[\\]{}^%#@!~\\n\\r\\t\\f\\\\]*$", "i"); +Type.prototype.callBaseMethod = function Type$callBaseMethod(instance, name, baseArguments) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance"}, + {name: "name", type: String}, + {name: "baseArguments", type: Array, mayBeNull: true, optional: true, elementMayBeNull: true} + ]); + if (e) throw e; + var baseMethod = Sys._getBaseMethod(this, instance, name); + if (!baseMethod) throw Error.invalidOperation(String.format(Sys.Res.methodNotFound, name)); + if (!baseArguments) { + return baseMethod.apply(instance); + } + else { + return baseMethod.apply(instance, baseArguments); + } +} +Type.prototype.getBaseMethod = function Type$getBaseMethod(instance, name) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance"}, + {name: "name", type: String} + ]); + if (e) throw e; + return Sys._getBaseMethod(this, instance, name); +} +Type.prototype.getBaseType = function Type$getBaseType() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return (typeof(this.__baseType) === "undefined") ? null : this.__baseType; +} +Type.prototype.getInterfaces = function Type$getInterfaces() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + var result = []; + var type = this; + while(type) { + var interfaces = type.__interfaces; + if (interfaces) { + for (var i = 0, l = interfaces.length; i < l; i++) { + var interfaceType = interfaces[i]; + if (!Array.contains(result, interfaceType)) { + result[result.length] = interfaceType; + } + } + } + type = type.__baseType; + } + return result; +} +Type.prototype.getName = function Type$getName() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return (typeof(this.__typeName) === "undefined") ? "" : this.__typeName; +} +Type.prototype.implementsInterface = function Type$implementsInterface(interfaceType) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "interfaceType", type: Type} + ]); + if (e) throw e; + this.resolveInheritance(); + var interfaceName = interfaceType.getName(); + var cache = this.__interfaceCache; + if (cache) { + var cacheEntry = cache[interfaceName]; + if (typeof(cacheEntry) !== 'undefined') return cacheEntry; + } + else { + cache = this.__interfaceCache = {}; + } + var baseType = this; + while (baseType) { + var interfaces = baseType.__interfaces; + if (interfaces) { + if (Array.indexOf(interfaces, interfaceType) !== -1) { + return cache[interfaceName] = true; + } + } + baseType = baseType.__baseType; + } + return cache[interfaceName] = false; +} +Type.prototype.inheritsFrom = function Type$inheritsFrom(parentType) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "parentType", type: Type} + ]); + if (e) throw e; + this.resolveInheritance(); + var baseType = this.__baseType; + while (baseType) { + if (baseType === parentType) { + return true; + } + baseType = baseType.__baseType; + } + return false; +} +Type.prototype.initializeBase = function Type$initializeBase(instance, baseArguments) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance"}, + {name: "baseArguments", type: Array, mayBeNull: true, optional: true, elementMayBeNull: true} + ]); + if (e) throw e; + if (!Sys._isInstanceOfType(this, instance)) throw Error.argumentType('instance', Object.getType(instance), this); + this.resolveInheritance(); + if (this.__baseType) { + if (!baseArguments) { + this.__baseType.apply(instance); + } + else { + this.__baseType.apply(instance, baseArguments); + } + } + return instance; +} +Type.prototype.isImplementedBy = function Type$isImplementedBy(instance) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance", mayBeNull: true} + ]); + if (e) throw e; + if (typeof(instance) === "undefined" || instance === null) return false; + var instanceType = Object.getType(instance); + return !!(instanceType.implementsInterface && instanceType.implementsInterface(this)); +} +Type.prototype.isInstanceOfType = function Type$isInstanceOfType(instance) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "instance", mayBeNull: true} + ]); + if (e) throw e; + return Sys._isInstanceOfType(this, instance); +} +Type.prototype.registerClass = function Type$registerClass(typeName, baseType, interfaceTypes) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "typeName", type: String}, + {name: "baseType", type: Type, mayBeNull: true, optional: true}, + {name: "interfaceTypes", type: Type, parameterArray: true} + ]); + if (e) throw e; + if (!Type.__fullyQualifiedIdentifierRegExp.test(typeName)) throw Error.argument('typeName', Sys.Res.notATypeName); + var parsedName; + try { + parsedName = eval(typeName); + } + catch(e) { + throw Error.argument('typeName', Sys.Res.argumentTypeName); + } + if (parsedName !== this) throw Error.argument('typeName', Sys.Res.badTypeName); + if (Sys.__registeredTypes[typeName]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, typeName)); + if ((arguments.length > 1) && (typeof(baseType) === 'undefined')) throw Error.argumentUndefined('baseType'); + if (baseType && !baseType.__class) throw Error.argument('baseType', Sys.Res.baseNotAClass); + this.prototype.constructor = this; + this.__typeName = typeName; + this.__class = true; + if (baseType) { + this.__baseType = baseType; + this.__basePrototypePending = true; + } + Sys.__upperCaseTypes[typeName.toUpperCase()] = this; + if (interfaceTypes) { + this.__interfaces = []; + this.resolveInheritance(); + for (var i = 2, l = arguments.length; i < l; i++) { + var interfaceType = arguments[i]; + if (!interfaceType.__interface) throw Error.argument('interfaceTypes[' + (i - 2) + ']', Sys.Res.notAnInterface); + for (var methodName in interfaceType.prototype) { + var method = interfaceType.prototype[methodName]; + if (!this.prototype[methodName]) { + this.prototype[methodName] = method; + } + } + this.__interfaces.push(interfaceType); + } + } + Sys.__registeredTypes[typeName] = true; + return this; +} +Type.prototype.registerInterface = function Type$registerInterface(typeName) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "typeName", type: String} + ]); + if (e) throw e; + if (!Type.__fullyQualifiedIdentifierRegExp.test(typeName)) throw Error.argument('typeName', Sys.Res.notATypeName); + var parsedName; + try { + parsedName = eval(typeName); + } + catch(e) { + throw Error.argument('typeName', Sys.Res.argumentTypeName); + } + if (parsedName !== this) throw Error.argument('typeName', Sys.Res.badTypeName); + if (Sys.__registeredTypes[typeName]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, typeName)); + Sys.__upperCaseTypes[typeName.toUpperCase()] = this; + this.prototype.constructor = this; + this.__typeName = typeName; + this.__interface = true; + Sys.__registeredTypes[typeName] = true; + return this; +} +Type.prototype.resolveInheritance = function Type$resolveInheritance() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this.__basePrototypePending) { + var baseType = this.__baseType; + baseType.resolveInheritance(); + for (var memberName in baseType.prototype) { + var memberValue = baseType.prototype[memberName]; + if (!this.prototype[memberName]) { + this.prototype[memberName] = memberValue; + } + } + delete this.__basePrototypePending; + } +} +Type.getRootNamespaces = function Type$getRootNamespaces() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return Array.clone(Sys.__rootNamespaces); +} +Type.isClass = function Type$isClass(type) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "type", mayBeNull: true} + ]); + if (e) throw e; + if ((typeof(type) === 'undefined') || (type === null)) return false; + return !!type.__class; +} +Type.isInterface = function Type$isInterface(type) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "type", mayBeNull: true} + ]); + if (e) throw e; + if ((typeof(type) === 'undefined') || (type === null)) return false; + return !!type.__interface; +} +Type.isNamespace = function Type$isNamespace(object) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "object", mayBeNull: true} + ]); + if (e) throw e; + if ((typeof(object) === 'undefined') || (object === null)) return false; + return !!object.__namespace; +} +Type.parse = function Type$parse(typeName, ns) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "typeName", type: String, mayBeNull: true}, + {name: "ns", mayBeNull: true, optional: true} + ]); + if (e) throw e; + var fn; + if (ns) { + fn = Sys.__upperCaseTypes[ns.getName().toUpperCase() + '.' + typeName.toUpperCase()]; + return fn || null; + } + if (!typeName) return null; + if (!Type.__htClasses) { + Type.__htClasses = {}; + } + fn = Type.__htClasses[typeName]; + if (!fn) { + fn = eval(typeName); + if (typeof(fn) !== 'function') throw Error.argument('typeName', Sys.Res.notATypeName); + Type.__htClasses[typeName] = fn; + } + return fn; +} +Type.registerNamespace = function Type$registerNamespace(namespacePath) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "namespacePath", type: String} + ]); + if (e) throw e; + Type._registerNamespace(namespacePath); +} +Type._registerNamespace = function Type$_registerNamespace(namespacePath) { + if (!Type.__fullyQualifiedIdentifierRegExp.test(namespacePath)) throw Error.argument('namespacePath', Sys.Res.invalidNameSpace); + var rootObject = window; + var namespaceParts = namespacePath.split('.'); + for (var i = 0; i < namespaceParts.length; i++) { + var currentPart = namespaceParts[i]; + var ns = rootObject[currentPart]; + var nsType = typeof(ns); + if ((nsType !== "undefined") && (ns !== null)) { + if (nsType === "function") { + throw Error.invalidOperation(String.format(Sys.Res.namespaceContainsClass, namespaceParts.splice(0, i + 1).join('.'))); + } + if ((typeof(ns) !== "object") || (ns instanceof Array)) { + throw Error.invalidOperation(String.format(Sys.Res.namespaceContainsNonObject, namespaceParts.splice(0, i + 1).join('.'))); + } + } + if (!ns) { + ns = rootObject[currentPart] = {}; + } + if (!ns.__namespace) { + if ((i === 0) && (namespacePath !== "Sys")) { + Sys.__rootNamespaces[Sys.__rootNamespaces.length] = ns; + } + ns.__namespace = true; + ns.__typeName = namespaceParts.slice(0, i + 1).join('.'); + var parsedName; + try { + parsedName = eval(ns.__typeName); + } + catch(e) { + parsedName = null; + } + if (parsedName !== ns) { + delete rootObject[currentPart]; + throw Error.argument('namespacePath', Sys.Res.invalidNameSpace); + } + ns.getName = function ns$getName() {return this.__typeName;} + } + rootObject = ns; + } +} +Type._checkDependency = function Type$_checkDependency(dependency, featureName) { + var scripts = Type._registerScript._scripts, isDependent = (scripts ? (!!scripts[dependency]) : false); + if ((typeof(featureName) !== 'undefined') && !isDependent) { + throw Error.invalidOperation(String.format(Sys.Res.requiredScriptReferenceNotIncluded, + featureName, dependency)); + } + return isDependent; +} +Type._registerScript = function Type$_registerScript(scriptName, dependencies) { + var scripts = Type._registerScript._scripts; + if (!scripts) { + Type._registerScript._scripts = scripts = {}; + } + if (scripts[scriptName]) { + throw Error.invalidOperation(String.format(Sys.Res.scriptAlreadyLoaded, scriptName)); + } + scripts[scriptName] = true; + if (dependencies) { + for (var i = 0, l = dependencies.length; i < l; i++) { + var dependency = dependencies[i]; + if (!Type._checkDependency(dependency)) { + throw Error.invalidOperation(String.format(Sys.Res.scriptDependencyNotFound, scriptName, dependency)); + } + } + } +} +Type._registerNamespace("Sys"); +Sys.__upperCaseTypes = {}; +Sys.__rootNamespaces = [Sys]; +Sys.__registeredTypes = {}; +Sys._isInstanceOfType = function Sys$_isInstanceOfType(type, instance) { + if (typeof(instance) === "undefined" || instance === null) return false; + if (instance instanceof type) return true; + var instanceType = Object.getType(instance); + return !!(instanceType === type) || + (instanceType.inheritsFrom && instanceType.inheritsFrom(type)) || + (instanceType.implementsInterface && instanceType.implementsInterface(type)); +} +Sys._getBaseMethod = function Sys$_getBaseMethod(type, instance, name) { + if (!Sys._isInstanceOfType(type, instance)) throw Error.argumentType('instance', Object.getType(instance), type); + var baseType = type.getBaseType(); + if (baseType) { + var baseMethod = baseType.prototype[name]; + return (baseMethod instanceof Function) ? baseMethod : null; + } + return null; +} +Sys._isDomElement = function Sys$_isDomElement(obj) { + var val = false; + if (typeof (obj.nodeType) !== 'number') { + var doc = obj.ownerDocument || obj.document || obj; + if (doc != obj) { + var w = doc.defaultView || doc.parentWindow; + val = (w != obj); + } + else { + val = (typeof (doc.body) === 'undefined'); + } + } + return !val; +} + +Array.__typeName = 'Array'; +Array.__class = true; +Array.add = Array.enqueue = function Array$enqueue(array, item) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "item", mayBeNull: true} + ]); + if (e) throw e; + array[array.length] = item; +} +Array.addRange = function Array$addRange(array, items) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "items", type: Array, elementMayBeNull: true} + ]); + if (e) throw e; + array.push.apply(array, items); +} +Array.clear = function Array$clear(array) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true} + ]); + if (e) throw e; + array.length = 0; +} +Array.clone = function Array$clone(array) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true} + ]); + if (e) throw e; + if (array.length === 1) { + return [array[0]]; + } + else { + return Array.apply(null, array); + } +} +Array.contains = function Array$contains(array, item) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "item", mayBeNull: true} + ]); + if (e) throw e; + return (Sys._indexOf(array, item) >= 0); +} +Array.dequeue = function Array$dequeue(array) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true} + ]); + if (e) throw e; + return array.shift(); +} +Array.forEach = function Array$forEach(array, method, instance) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "method", type: Function}, + {name: "instance", mayBeNull: true, optional: true} + ]); + if (e) throw e; + for (var i = 0, l = array.length; i < l; i++) { + var elt = array[i]; + if (typeof(elt) !== 'undefined') method.call(instance, elt, i, array); + } +} +Array.indexOf = function Array$indexOf(array, item, start) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "item", mayBeNull: true, optional: true}, + {name: "start", mayBeNull: true, optional: true} + ]); + if (e) throw e; + return Sys._indexOf(array, item, start); +} +Array.insert = function Array$insert(array, index, item) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "index", mayBeNull: true}, + {name: "item", mayBeNull: true} + ]); + if (e) throw e; + array.splice(index, 0, item); +} +Array.parse = function Array$parse(value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String, mayBeNull: true} + ]); + if (e) throw e; + if (!value) return []; + var v = eval(value); + if (!Array.isInstanceOfType(v)) throw Error.argument('value', Sys.Res.arrayParseBadFormat); + return v; +} +Array.remove = function Array$remove(array, item) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "item", mayBeNull: true} + ]); + if (e) throw e; + var index = Sys._indexOf(array, item); + if (index >= 0) { + array.splice(index, 1); + } + return (index >= 0); +} +Array.removeAt = function Array$removeAt(array, index) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "array", type: Array, elementMayBeNull: true}, + {name: "index", mayBeNull: true} + ]); + if (e) throw e; + array.splice(index, 1); +} +Sys._indexOf = function Sys$_indexOf(array, item, start) { + if (typeof(item) === "undefined") return -1; + var length = array.length; + if (length !== 0) { + start = start - 0; + if (isNaN(start)) { + start = 0; + } + else { + if (isFinite(start)) { + start = start - (start % 1); + } + if (start < 0) { + start = Math.max(0, length + start); + } + } + for (var i = start; i < length; i++) { + if ((typeof(array[i]) !== "undefined") && (array[i] === item)) { + return i; + } + } + } + return -1; +} +Type._registerScript._scripts = { + "MicrosoftAjaxCore.js": true, + "MicrosoftAjaxGlobalization.js": true, + "MicrosoftAjaxSerialization.js": true, + "MicrosoftAjaxComponentModel.js": true, + "MicrosoftAjaxHistory.js": true, + "MicrosoftAjaxNetwork.js" : true, + "MicrosoftAjaxWebServices.js": true }; + +Sys.IDisposable = function Sys$IDisposable() { + throw Error.notImplemented(); +} + function Sys$IDisposable$dispose() { + throw Error.notImplemented(); + } +Sys.IDisposable.prototype = { + dispose: Sys$IDisposable$dispose +} +Sys.IDisposable.registerInterface('Sys.IDisposable'); + +Sys.StringBuilder = function Sys$StringBuilder(initialText) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "initialText", mayBeNull: true, optional: true} + ]); + if (e) throw e; + this._parts = (typeof(initialText) !== 'undefined' && initialText !== null && initialText !== '') ? + [initialText.toString()] : []; + this._value = {}; + this._len = 0; +} + function Sys$StringBuilder$append(text) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "text", mayBeNull: true} + ]); + if (e) throw e; + this._parts[this._parts.length] = text; + } + function Sys$StringBuilder$appendLine(text) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "text", mayBeNull: true, optional: true} + ]); + if (e) throw e; + this._parts[this._parts.length] = + ((typeof(text) === 'undefined') || (text === null) || (text === '')) ? + '\r\n' : text + '\r\n'; + } + function Sys$StringBuilder$clear() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._parts = []; + this._value = {}; + this._len = 0; + } + function Sys$StringBuilder$isEmpty() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this._parts.length === 0) return true; + return this.toString() === ''; + } + function Sys$StringBuilder$toString(separator) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "separator", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + separator = separator || ''; + var parts = this._parts; + if (this._len !== parts.length) { + this._value = {}; + this._len = parts.length; + } + var val = this._value; + if (typeof(val[separator]) === 'undefined') { + if (separator !== '') { + for (var i = 0; i < parts.length;) { + if ((typeof(parts[i]) === 'undefined') || (parts[i] === '') || (parts[i] === null)) { + parts.splice(i, 1); + } + else { + i++; + } + } + } + val[separator] = this._parts.join(separator); + } + return val[separator]; + } +Sys.StringBuilder.prototype = { + append: Sys$StringBuilder$append, + appendLine: Sys$StringBuilder$appendLine, + clear: Sys$StringBuilder$clear, + isEmpty: Sys$StringBuilder$isEmpty, + toString: Sys$StringBuilder$toString +} +Sys.StringBuilder.registerClass('Sys.StringBuilder'); + +Sys.Browser = {}; +Sys.Browser.InternetExplorer = {}; +Sys.Browser.Firefox = {}; +Sys.Browser.Safari = {}; +Sys.Browser.Opera = {}; +Sys.Browser.agent = null; +Sys.Browser.hasDebuggerStatement = false; +Sys.Browser.name = navigator.appName; +Sys.Browser.version = parseFloat(navigator.appVersion); +Sys.Browser.documentMode = 0; +if (navigator.userAgent.indexOf(' MSIE ') > -1) { + Sys.Browser.agent = Sys.Browser.InternetExplorer; + Sys.Browser.version = parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]); + if (Sys.Browser.version >= 8) { + if (document.documentMode >= 7) { + Sys.Browser.documentMode = document.documentMode; + } + } + Sys.Browser.hasDebuggerStatement = true; +} +else if (navigator.userAgent.indexOf(' Firefox/') > -1) { + Sys.Browser.agent = Sys.Browser.Firefox; + Sys.Browser.version = parseFloat(navigator.userAgent.match(/ Firefox\/(\d+\.\d+)/)[1]); + Sys.Browser.name = 'Firefox'; + Sys.Browser.hasDebuggerStatement = true; +} +else if (navigator.userAgent.indexOf(' AppleWebKit/') > -1) { + Sys.Browser.agent = Sys.Browser.Safari; + Sys.Browser.version = parseFloat(navigator.userAgent.match(/ AppleWebKit\/(\d+(\.\d+)?)/)[1]); + Sys.Browser.name = 'Safari'; +} +else if (navigator.userAgent.indexOf('Opera/') > -1) { + Sys.Browser.agent = Sys.Browser.Opera; +} + +Sys.EventArgs = function Sys$EventArgs() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); +} +Sys.EventArgs.registerClass('Sys.EventArgs'); +Sys.EventArgs.Empty = new Sys.EventArgs(); + +Sys.CancelEventArgs = function Sys$CancelEventArgs() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + Sys.CancelEventArgs.initializeBase(this); + this._cancel = false; +} + function Sys$CancelEventArgs$get_cancel() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._cancel; + } + function Sys$CancelEventArgs$set_cancel(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]); + if (e) throw e; + this._cancel = value; + } +Sys.CancelEventArgs.prototype = { + get_cancel: Sys$CancelEventArgs$get_cancel, + set_cancel: Sys$CancelEventArgs$set_cancel +} +Sys.CancelEventArgs.registerClass('Sys.CancelEventArgs', Sys.EventArgs); +Type.registerNamespace('Sys.UI'); + +Sys._Debug = function Sys$_Debug() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); +} + function Sys$_Debug$_appendConsole(text) { + if ((typeof(Debug) !== 'undefined') && Debug.writeln) { + Debug.writeln(text); + } + if (window.console && window.console.log) { + window.console.log(text); + } + if (window.opera) { + window.opera.postError(text); + } + if (window.debugService) { + window.debugService.trace(text); + } + } + function Sys$_Debug$_appendTrace(text) { + var traceElement = document.getElementById('TraceConsole'); + if (traceElement && (traceElement.tagName.toUpperCase() === 'TEXTAREA')) { + traceElement.value += text + '\n'; + } + } + function Sys$_Debug$assert(condition, message, displayCaller) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "condition", type: Boolean}, + {name: "message", type: String, mayBeNull: true, optional: true}, + {name: "displayCaller", type: Boolean, optional: true} + ]); + if (e) throw e; + if (!condition) { + message = (displayCaller && this.assert.caller) ? + String.format(Sys.Res.assertFailedCaller, message, this.assert.caller) : + String.format(Sys.Res.assertFailed, message); + if (confirm(String.format(Sys.Res.breakIntoDebugger, message))) { + this.fail(message); + } + } + } + function Sys$_Debug$clearTrace() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + var traceElement = document.getElementById('TraceConsole'); + if (traceElement && (traceElement.tagName.toUpperCase() === 'TEXTAREA')) { + traceElement.value = ''; + } + } + function Sys$_Debug$fail(message) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "message", type: String, mayBeNull: true} + ]); + if (e) throw e; + this._appendConsole(message); + if (Sys.Browser.hasDebuggerStatement) { + eval('debugger'); + } + } + function Sys$_Debug$trace(text) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "text"} + ]); + if (e) throw e; + this._appendConsole(text); + this._appendTrace(text); + } + function Sys$_Debug$traceDump(object, name) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "object", mayBeNull: true}, + {name: "name", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var text = this._traceDump(object, name, true); + } + function Sys$_Debug$_traceDump(object, name, recursive, indentationPadding, loopArray) { + name = name? name : 'traceDump'; + indentationPadding = indentationPadding? indentationPadding : ''; + if (object === null) { + this.trace(indentationPadding + name + ': null'); + return; + } + switch(typeof(object)) { + case 'undefined': + this.trace(indentationPadding + name + ': Undefined'); + break; + case 'number': case 'string': case 'boolean': + this.trace(indentationPadding + name + ': ' + object); + break; + default: + if (Date.isInstanceOfType(object) || RegExp.isInstanceOfType(object)) { + this.trace(indentationPadding + name + ': ' + object.toString()); + break; + } + if (!loopArray) { + loopArray = []; + } + else if (Array.contains(loopArray, object)) { + this.trace(indentationPadding + name + ': ...'); + return; + } + Array.add(loopArray, object); + if ((object == window) || (object === document) || + (window.HTMLElement && (object instanceof HTMLElement)) || + (typeof(object.nodeName) === 'string')) { + var tag = object.tagName? object.tagName : 'DomElement'; + if (object.id) { + tag += ' - ' + object.id; + } + this.trace(indentationPadding + name + ' {' + tag + '}'); + } + else { + var typeName = Object.getTypeName(object); + this.trace(indentationPadding + name + (typeof(typeName) === 'string' ? ' {' + typeName + '}' : '')); + if ((indentationPadding === '') || recursive) { + indentationPadding += " "; + var i, length, properties, p, v; + if (Array.isInstanceOfType(object)) { + length = object.length; + for (i = 0; i < length; i++) { + this._traceDump(object[i], '[' + i + ']', recursive, indentationPadding, loopArray); + } + } + else { + for (p in object) { + v = object[p]; + if (!Function.isInstanceOfType(v)) { + this._traceDump(v, p, recursive, indentationPadding, loopArray); + } + } + } + } + } + Array.remove(loopArray, object); + } + } +Sys._Debug.prototype = { + _appendConsole: Sys$_Debug$_appendConsole, + _appendTrace: Sys$_Debug$_appendTrace, + assert: Sys$_Debug$assert, + clearTrace: Sys$_Debug$clearTrace, + fail: Sys$_Debug$fail, + trace: Sys$_Debug$trace, + traceDump: Sys$_Debug$traceDump, + _traceDump: Sys$_Debug$_traceDump +} +Sys._Debug.registerClass('Sys._Debug'); +Sys.Debug = new Sys._Debug(); + Sys.Debug.isDebug = true; + +function Sys$Enum$parse(value, ignoreCase) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String}, + {name: "ignoreCase", type: Boolean, optional: true} + ]); + if (e) throw e; + var values, parsed, val; + if (ignoreCase) { + values = this.__lowerCaseValues; + if (!values) { + this.__lowerCaseValues = values = {}; + var prototype = this.prototype; + for (var name in prototype) { + values[name.toLowerCase()] = prototype[name]; + } + } + } + else { + values = this.prototype; + } + if (!this.__flags) { + val = (ignoreCase ? value.toLowerCase() : value); + parsed = values[val.trim()]; + if (typeof(parsed) !== 'number') throw Error.argument('value', String.format(Sys.Res.enumInvalidValue, value, this.__typeName)); + return parsed; + } + else { + var parts = (ignoreCase ? value.toLowerCase() : value).split(','); + var v = 0; + for (var i = parts.length - 1; i >= 0; i--) { + var part = parts[i].trim(); + parsed = values[part]; + if (typeof(parsed) !== 'number') throw Error.argument('value', String.format(Sys.Res.enumInvalidValue, value.split(',')[i].trim(), this.__typeName)); + v |= parsed; + } + return v; + } +} +function Sys$Enum$toString(value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", mayBeNull: true, optional: true} + ]); + if (e) throw e; + if ((typeof(value) === 'undefined') || (value === null)) return this.__string; + if ((typeof(value) != 'number') || ((value % 1) !== 0)) throw Error.argumentType('value', Object.getType(value), this); + var values = this.prototype; + var i; + if (!this.__flags || (value === 0)) { + for (i in values) { + if (values[i] === value) { + return i; + } + } + } + else { + var sorted = this.__sortedValues; + if (!sorted) { + sorted = []; + for (i in values) { + sorted[sorted.length] = {key: i, value: values[i]}; + } + sorted.sort(function(a, b) { + return a.value - b.value; + }); + this.__sortedValues = sorted; + } + var parts = []; + var v = value; + for (i = sorted.length - 1; i >= 0; i--) { + var kvp = sorted[i]; + var vali = kvp.value; + if (vali === 0) continue; + if ((vali & value) === vali) { + parts[parts.length] = kvp.key; + v -= vali; + if (v === 0) break; + } + } + if (parts.length && v === 0) return parts.reverse().join(', '); + } + throw Error.argumentOutOfRange('value', value, String.format(Sys.Res.enumInvalidValue, value, this.__typeName)); +} +Type.prototype.registerEnum = function Type$registerEnum(name, flags) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "name", type: String}, + {name: "flags", type: Boolean, optional: true} + ]); + if (e) throw e; + if (!Type.__fullyQualifiedIdentifierRegExp.test(name)) throw Error.argument('name', Sys.Res.notATypeName); + var parsedName; + try { + parsedName = eval(name); + } + catch(e) { + throw Error.argument('name', Sys.Res.argumentTypeName); + } + if (parsedName !== this) throw Error.argument('name', Sys.Res.badTypeName); + if (Sys.__registeredTypes[name]) throw Error.invalidOperation(String.format(Sys.Res.typeRegisteredTwice, name)); + for (var j in this.prototype) { + var val = this.prototype[j]; + if (!Type.__identifierRegExp.test(j)) throw Error.invalidOperation(String.format(Sys.Res.enumInvalidValueName, j)); + if (typeof(val) !== 'number' || (val % 1) !== 0) throw Error.invalidOperation(Sys.Res.enumValueNotInteger); + if (typeof(this[j]) !== 'undefined') throw Error.invalidOperation(String.format(Sys.Res.enumReservedName, j)); + } + Sys.__upperCaseTypes[name.toUpperCase()] = this; + for (var i in this.prototype) { + this[i] = this.prototype[i]; + } + this.__typeName = name; + this.parse = Sys$Enum$parse; + this.__string = this.toString(); + this.toString = Sys$Enum$toString; + this.__flags = flags; + this.__enum = true; + Sys.__registeredTypes[name] = true; +} +Type.isEnum = function Type$isEnum(type) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "type", mayBeNull: true} + ]); + if (e) throw e; + if ((typeof(type) === 'undefined') || (type === null)) return false; + return !!type.__enum; +} +Type.isFlags = function Type$isFlags(type) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "type", mayBeNull: true} + ]); + if (e) throw e; + if ((typeof(type) === 'undefined') || (type === null)) return false; + return !!type.__flags; +} +Sys.CollectionChange = function Sys$CollectionChange(action, newItems, newStartingIndex, oldItems, oldStartingIndex) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "action", type: Sys.NotifyCollectionChangedAction}, + {name: "newItems", mayBeNull: true, optional: true}, + {name: "newStartingIndex", type: Number, mayBeNull: true, integer: true, optional: true}, + {name: "oldItems", mayBeNull: true, optional: true}, + {name: "oldStartingIndex", type: Number, mayBeNull: true, integer: true, optional: true} + ]); + if (e) throw e; + this.action = action; + if (newItems) { + if (!(newItems instanceof Array)) { + newItems = [newItems]; + } + } + this.newItems = newItems || null; + if (typeof newStartingIndex !== "number") { + newStartingIndex = -1; + } + this.newStartingIndex = newStartingIndex; + if (oldItems) { + if (!(oldItems instanceof Array)) { + oldItems = [oldItems]; + } + } + this.oldItems = oldItems || null; + if (typeof oldStartingIndex !== "number") { + oldStartingIndex = -1; + } + this.oldStartingIndex = oldStartingIndex; +} +Sys.CollectionChange.registerClass("Sys.CollectionChange"); +Sys.NotifyCollectionChangedAction = function Sys$NotifyCollectionChangedAction() { + /// + /// + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); +} +Sys.NotifyCollectionChangedAction.prototype = { + add: 0, + remove: 1, + reset: 2 +} +Sys.NotifyCollectionChangedAction.registerEnum('Sys.NotifyCollectionChangedAction'); +Sys.NotifyCollectionChangedEventArgs = function Sys$NotifyCollectionChangedEventArgs(changes) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "changes", type: Array, elementType: Sys.CollectionChange} + ]); + if (e) throw e; + this._changes = changes; + Sys.NotifyCollectionChangedEventArgs.initializeBase(this); +} + function Sys$NotifyCollectionChangedEventArgs$get_changes() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._changes || []; + } +Sys.NotifyCollectionChangedEventArgs.prototype = { + get_changes: Sys$NotifyCollectionChangedEventArgs$get_changes +} +Sys.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs", Sys.EventArgs); +Sys.Observer = function Sys$Observer() { + throw Error.invalidOperation(); +} +Sys.Observer.registerClass("Sys.Observer"); +Sys.Observer.makeObservable = function Sys$Observer$makeObservable(target) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"} + ]); + if (e) throw e; + var isArray = target instanceof Array, + o = Sys.Observer; + Sys.Observer._ensureObservable(target); + if (target.setValue === o._observeMethods.setValue) return target; + o._addMethods(target, o._observeMethods); + if (isArray) { + o._addMethods(target, o._arrayMethods); + } + return target; +} +Sys.Observer._ensureObservable = function Sys$Observer$_ensureObservable(target) { + var type = typeof target; + if ((type === "string") || (type === "number") || (type === "boolean") || (type === "date")) { + throw Error.invalidOperation(String.format(Sys.Res.notObservable, type)); + } +} +Sys.Observer._addMethods = function Sys$Observer$_addMethods(target, methods) { + for (var m in methods) { + if (target[m] && (target[m] !== methods[m])) { + throw Error.invalidOperation(String.format(Sys.Res.observableConflict, m)); + } + target[m] = methods[m]; + } +} +Sys.Observer._addEventHandler = function Sys$Observer$_addEventHandler(target, eventName, handler) { + Sys.Observer._getContext(target, true).events._addHandler(eventName, handler); +} +Sys.Observer.addEventHandler = function Sys$Observer$addEventHandler(target, eventName, handler) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"}, + {name: "eventName", type: String}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + Sys.Observer._addEventHandler(target, eventName, handler); +} +Sys.Observer._removeEventHandler = function Sys$Observer$_removeEventHandler(target, eventName, handler) { + Sys.Observer._getContext(target, true).events._removeHandler(eventName, handler); +} +Sys.Observer.removeEventHandler = function Sys$Observer$removeEventHandler(target, eventName, handler) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"}, + {name: "eventName", type: String}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + Sys.Observer._removeEventHandler(target, eventName, handler); +} +Sys.Observer.raiseEvent = function Sys$Observer$raiseEvent(target, eventName, eventArgs) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"}, + {name: "eventName", type: String}, + {name: "eventArgs", type: Sys.EventArgs} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + var ctx = Sys.Observer._getContext(target); + if (!ctx) return; + var handler = ctx.events.getHandler(eventName); + if (handler) { + handler(target, eventArgs); + } +} +Sys.Observer.addPropertyChanged = function Sys$Observer$addPropertyChanged(target, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + Sys.Observer._addEventHandler(target, "propertyChanged", handler); +} +Sys.Observer.removePropertyChanged = function Sys$Observer$removePropertyChanged(target, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + Sys.Observer._removeEventHandler(target, "propertyChanged", handler); +} +Sys.Observer.beginUpdate = function Sys$Observer$beginUpdate(target) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + Sys.Observer._getContext(target, true).updating = true; +} +Sys.Observer.endUpdate = function Sys$Observer$endUpdate(target) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + var ctx = Sys.Observer._getContext(target); + if (!ctx || !ctx.updating) return; + ctx.updating = false; + var dirty = ctx.dirty; + ctx.dirty = false; + if (dirty) { + if (target instanceof Array) { + var changes = ctx.changes; + ctx.changes = null; + Sys.Observer.raiseCollectionChanged(target, changes); + } + Sys.Observer.raisePropertyChanged(target, ""); + } +} +Sys.Observer.isUpdating = function Sys$Observer$isUpdating(target) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + var ctx = Sys.Observer._getContext(target); + return ctx ? ctx.updating : false; +} +Sys.Observer._setValue = function Sys$Observer$_setValue(target, propertyName, value) { + var getter, setter, mainTarget = target, path = propertyName.split('.'); + for (var i = 0, l = (path.length - 1); i < l ; i++) { + var name = path[i]; + getter = target["get_" + name]; + if (typeof (getter) === "function") { + target = getter.call(target); + } + else { + target = target[name]; + } + var type = typeof (target); + if ((target === null) || (type === "undefined")) { + throw Error.invalidOperation(String.format(Sys.Res.nullReferenceInPath, propertyName)); + } + } + var currentValue, lastPath = path[l]; + getter = target["get_" + lastPath]; + setter = target["set_" + lastPath]; + if (typeof(getter) === 'function') { + currentValue = getter.call(target); + } + else { + currentValue = target[lastPath]; + } + if (typeof(setter) === 'function') { + setter.call(target, value); + } + else { + target[lastPath] = value; + } + if (currentValue !== value) { + var ctx = Sys.Observer._getContext(mainTarget); + if (ctx && ctx.updating) { + ctx.dirty = true; + return; + }; + Sys.Observer.raisePropertyChanged(mainTarget, path[0]); + } +} +Sys.Observer.setValue = function Sys$Observer$setValue(target, propertyName, value) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"}, + {name: "propertyName", type: String}, + {name: "value", mayBeNull: true} + ]); + if (e) throw e; + Sys.Observer._ensureObservable(target); + Sys.Observer._setValue(target, propertyName, value); +} +Sys.Observer.raisePropertyChanged = function Sys$Observer$raisePropertyChanged(target, propertyName) { + /// + /// + /// + Sys.Observer.raiseEvent(target, "propertyChanged", new Sys.PropertyChangedEventArgs(propertyName)); +} +Sys.Observer.addCollectionChanged = function Sys$Observer$addCollectionChanged(target, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._addEventHandler(target, "collectionChanged", handler); +} +Sys.Observer.removeCollectionChanged = function Sys$Observer$removeCollectionChanged(target, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._removeEventHandler(target, "collectionChanged", handler); +} +Sys.Observer._collectionChange = function Sys$Observer$_collectionChange(target, change) { + var ctx = Sys.Observer._getContext(target); + if (ctx && ctx.updating) { + ctx.dirty = true; + var changes = ctx.changes; + if (!changes) { + ctx.changes = changes = [change]; + } + else { + changes.push(change); + } + } + else { + Sys.Observer.raiseCollectionChanged(target, [change]); + Sys.Observer.raisePropertyChanged(target, 'length'); + } +} +Sys.Observer.add = function Sys$Observer$add(target, item) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true}, + {name: "item", mayBeNull: true} + ]); + if (e) throw e; + var change = new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, [item], target.length); + Array.add(target, item); + Sys.Observer._collectionChange(target, change); +} +Sys.Observer.addRange = function Sys$Observer$addRange(target, items) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true}, + {name: "items", type: Array, elementMayBeNull: true} + ]); + if (e) throw e; + var change = new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, items, target.length); + Array.addRange(target, items); + Sys.Observer._collectionChange(target, change); +} +Sys.Observer.clear = function Sys$Observer$clear(target) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true} + ]); + if (e) throw e; + var oldItems = Array.clone(target); + Array.clear(target); + Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.reset, null, -1, oldItems, 0)); +} +Sys.Observer.insert = function Sys$Observer$insert(target, index, item) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true}, + {name: "index", type: Number, integer: true}, + {name: "item", mayBeNull: true} + ]); + if (e) throw e; + Array.insert(target, index, item); + Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.add, [item], index)); +} +Sys.Observer.remove = function Sys$Observer$remove(target, item) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true}, + {name: "item", mayBeNull: true} + ]); + if (e) throw e; + var index = Array.indexOf(target, item); + if (index !== -1) { + Array.remove(target, item); + Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove, null, -1, [item], index)); + return true; + } + return false; +} +Sys.Observer.removeAt = function Sys$Observer$removeAt(target, index) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target", type: Array, elementMayBeNull: true}, + {name: "index", type: Number, integer: true} + ]); + if (e) throw e; + if ((index > -1) && (index < target.length)) { + var item = target[index]; + Array.removeAt(target, index); + Sys.Observer._collectionChange(target, new Sys.CollectionChange(Sys.NotifyCollectionChangedAction.remove, null, -1, [item], index)); + } +} +Sys.Observer.raiseCollectionChanged = function Sys$Observer$raiseCollectionChanged(target, changes) { + /// + /// + /// + Sys.Observer.raiseEvent(target, "collectionChanged", new Sys.NotifyCollectionChangedEventArgs(changes)); +} +Sys.Observer._observeMethods = { + add_propertyChanged: function(handler) { + Sys.Observer._addEventHandler(this, "propertyChanged", handler); + }, + remove_propertyChanged: function(handler) { + Sys.Observer._removeEventHandler(this, "propertyChanged", handler); + }, + addEventHandler: function(eventName, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "eventName", type: String}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._addEventHandler(this, eventName, handler); + }, + removeEventHandler: function(eventName, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "eventName", type: String}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.Observer._removeEventHandler(this, eventName, handler); + }, + get_isUpdating: function() { + /// + /// + return Sys.Observer.isUpdating(this); + }, + beginUpdate: function() { + /// + Sys.Observer.beginUpdate(this); + }, + endUpdate: function() { + /// + Sys.Observer.endUpdate(this); + }, + setValue: function(name, value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "name", type: String}, + {name: "value", mayBeNull: true} + ]); + if (e) throw e; + Sys.Observer._setValue(this, name, value); + }, + raiseEvent: function(eventName, eventArgs) { + /// + /// + /// + Sys.Observer.raiseEvent(this, eventName, eventArgs); + }, + raisePropertyChanged: function(name) { + /// + /// + Sys.Observer.raiseEvent(this, "propertyChanged", new Sys.PropertyChangedEventArgs(name)); + } +} +Sys.Observer._arrayMethods = { + add_collectionChanged: function(handler) { + Sys.Observer._addEventHandler(this, "collectionChanged", handler); + }, + remove_collectionChanged: function(handler) { + Sys.Observer._removeEventHandler(this, "collectionChanged", handler); + }, + add: function(item) { + /// + /// + Sys.Observer.add(this, item); + }, + addRange: function(items) { + /// + /// + Sys.Observer.addRange(this, items); + }, + clear: function() { + /// + Sys.Observer.clear(this); + }, + insert: function(index, item) { + /// + /// + /// + Sys.Observer.insert(this, index, item); + }, + remove: function(item) { + /// + /// + /// + return Sys.Observer.remove(this, item); + }, + removeAt: function(index) { + /// + /// + Sys.Observer.removeAt(this, index); + }, + raiseCollectionChanged: function(changes) { + /// + /// + Sys.Observer.raiseEvent(this, "collectionChanged", new Sys.NotifyCollectionChangedEventArgs(changes)); + } +} +Sys.Observer._getContext = function Sys$Observer$_getContext(obj, create) { + var ctx = obj._observerContext; + if (ctx) return ctx(); + if (create) { + return (obj._observerContext = Sys.Observer._createContext())(); + } + return null; +} +Sys.Observer._createContext = function Sys$Observer$_createContext() { + var ctx = { + events: new Sys.EventHandlerList() + }; + return function() { + return ctx; + } +} +Date._appendPreOrPostMatch = function Date$_appendPreOrPostMatch(preMatch, strBuilder) { + var quoteCount = 0; + var escaped = false; + for (var i = 0, il = preMatch.length; i < il; i++) { + var c = preMatch.charAt(i); + switch (c) { + case '\'': + if (escaped) strBuilder.append("'"); + else quoteCount++; + escaped = false; + break; + case '\\': + if (escaped) strBuilder.append("\\"); + escaped = !escaped; + break; + default: + strBuilder.append(c); + escaped = false; + break; + } + } + return quoteCount; +} +Date._expandFormat = function Date$_expandFormat(dtf, format) { + if (!format) { + format = "F"; + } + var len = format.length; + if (len === 1) { + switch (format) { + case "d": + return dtf.ShortDatePattern; + case "D": + return dtf.LongDatePattern; + case "t": + return dtf.ShortTimePattern; + case "T": + return dtf.LongTimePattern; + case "f": + return dtf.LongDatePattern + " " + dtf.ShortTimePattern; + case "F": + return dtf.FullDateTimePattern; + case "M": case "m": + return dtf.MonthDayPattern; + case "s": + return dtf.SortableDateTimePattern; + case "Y": case "y": + return dtf.YearMonthPattern; + default: + throw Error.format(Sys.Res.formatInvalidString); + } + } + else if ((len === 2) && (format.charAt(0) === "%")) { + format = format.charAt(1); + } + return format; +} +Date._expandYear = function Date$_expandYear(dtf, year) { + var now = new Date(), + era = Date._getEra(now); + if (year < 100) { + var curr = Date._getEraYear(now, dtf, era); + year += curr - (curr % 100); + if (year > dtf.Calendar.TwoDigitYearMax) { + year -= 100; + } + } + return year; +} +Date._getEra = function Date$_getEra(date, eras) { + if (!eras) return 0; + var start, ticks = date.getTime(); + for (var i = 0, l = eras.length; i < l; i += 4) { + start = eras[i+2]; + if ((start === null) || (ticks >= start)) { + return i; + } + } + return 0; +} +Date._getEraYear = function Date$_getEraYear(date, dtf, era, sortable) { + var year = date.getFullYear(); + if (!sortable && dtf.eras) { + year -= dtf.eras[era + 3]; + } + return year; +} +Date._getParseRegExp = function Date$_getParseRegExp(dtf, format) { + if (!dtf._parseRegExp) { + dtf._parseRegExp = {}; + } + else if (dtf._parseRegExp[format]) { + return dtf._parseRegExp[format]; + } + var expFormat = Date._expandFormat(dtf, format); + expFormat = expFormat.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g, "\\\\$1"); + var regexp = new Sys.StringBuilder("^"); + var groups = []; + var index = 0; + var quoteCount = 0; + var tokenRegExp = Date._getTokenRegExp(); + var match; + while ((match = tokenRegExp.exec(expFormat)) !== null) { + var preMatch = expFormat.slice(index, match.index); + index = tokenRegExp.lastIndex; + quoteCount += Date._appendPreOrPostMatch(preMatch, regexp); + if ((quoteCount%2) === 1) { + regexp.append(match[0]); + continue; + } + switch (match[0]) { + case 'dddd': case 'ddd': + case 'MMMM': case 'MMM': + case 'gg': case 'g': + regexp.append("(\\D+)"); + break; + case 'tt': case 't': + regexp.append("(\\D*)"); + break; + case 'yyyy': + regexp.append("(\\d{4})"); + break; + case 'fff': + regexp.append("(\\d{3})"); + break; + case 'ff': + regexp.append("(\\d{2})"); + break; + case 'f': + regexp.append("(\\d)"); + break; + case 'dd': case 'd': + case 'MM': case 'M': + case 'yy': case 'y': + case 'HH': case 'H': + case 'hh': case 'h': + case 'mm': case 'm': + case 'ss': case 's': + regexp.append("(\\d\\d?)"); + break; + case 'zzz': + regexp.append("([+-]?\\d\\d?:\\d{2})"); + break; + case 'zz': case 'z': + regexp.append("([+-]?\\d\\d?)"); + break; + case '/': + regexp.append("(\\" + dtf.DateSeparator + ")"); + break; + default: + Sys.Debug.fail("Invalid date format pattern"); + } + Array.add(groups, match[0]); + } + Date._appendPreOrPostMatch(expFormat.slice(index), regexp); + regexp.append("$"); + var regexpStr = regexp.toString().replace(/\s+/g, "\\s+"); + var parseRegExp = {'regExp': regexpStr, 'groups': groups}; + dtf._parseRegExp[format] = parseRegExp; + return parseRegExp; +} +Date._getTokenRegExp = function Date$_getTokenRegExp() { + return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g; +} +Date.parseLocale = function Date$parseLocale(value, formats) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String}, + {name: "formats", mayBeNull: true, optional: true, parameterArray: true} + ]); + if (e) throw e; + return Date._parse(value, Sys.CultureInfo.CurrentCulture, arguments); +} +Date.parseInvariant = function Date$parseInvariant(value, formats) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String}, + {name: "formats", mayBeNull: true, optional: true, parameterArray: true} + ]); + if (e) throw e; + return Date._parse(value, Sys.CultureInfo.InvariantCulture, arguments); +} +Date._parse = function Date$_parse(value, cultureInfo, args) { + var i, l, date, format, formats, custom = false; + for (i = 1, l = args.length; i < l; i++) { + format = args[i]; + if (format) { + custom = true; + date = Date._parseExact(value, format, cultureInfo); + if (date) return date; + } + } + if (! custom) { + formats = cultureInfo._getDateTimeFormats(); + for (i = 0, l = formats.length; i < l; i++) { + date = Date._parseExact(value, formats[i], cultureInfo); + if (date) return date; + } + } + return null; +} +Date._parseExact = function Date$_parseExact(value, format, cultureInfo) { + value = value.trim(); + var dtf = cultureInfo.dateTimeFormat, + parseInfo = Date._getParseRegExp(dtf, format), + match = new RegExp(parseInfo.regExp).exec(value); + if (match === null) return null; + + var groups = parseInfo.groups, + era = null, year = null, month = null, date = null, weekDay = null, + hour = 0, hourOffset, min = 0, sec = 0, msec = 0, tzMinOffset = null, + pmHour = false; + for (var j = 0, jl = groups.length; j < jl; j++) { + var matchGroup = match[j+1]; + if (matchGroup) { + switch (groups[j]) { + case 'dd': case 'd': + date = parseInt(matchGroup, 10); + if ((date < 1) || (date > 31)) return null; + break; + case 'MMMM': + month = cultureInfo._getMonthIndex(matchGroup); + if ((month < 0) || (month > 11)) return null; + break; + case 'MMM': + month = cultureInfo._getAbbrMonthIndex(matchGroup); + if ((month < 0) || (month > 11)) return null; + break; + case 'M': case 'MM': + month = parseInt(matchGroup, 10) - 1; + if ((month < 0) || (month > 11)) return null; + break; + case 'y': case 'yy': + year = Date._expandYear(dtf,parseInt(matchGroup, 10)); + if ((year < 0) || (year > 9999)) return null; + break; + case 'yyyy': + year = parseInt(matchGroup, 10); + if ((year < 0) || (year > 9999)) return null; + break; + case 'h': case 'hh': + hour = parseInt(matchGroup, 10); + if (hour === 12) hour = 0; + if ((hour < 0) || (hour > 11)) return null; + break; + case 'H': case 'HH': + hour = parseInt(matchGroup, 10); + if ((hour < 0) || (hour > 23)) return null; + break; + case 'm': case 'mm': + min = parseInt(matchGroup, 10); + if ((min < 0) || (min > 59)) return null; + break; + case 's': case 'ss': + sec = parseInt(matchGroup, 10); + if ((sec < 0) || (sec > 59)) return null; + break; + case 'tt': case 't': + var upperToken = matchGroup.toUpperCase(); + pmHour = (upperToken === dtf.PMDesignator.toUpperCase()); + if (!pmHour && (upperToken !== dtf.AMDesignator.toUpperCase())) return null; + break; + case 'f': + msec = parseInt(matchGroup, 10) * 100; + if ((msec < 0) || (msec > 999)) return null; + break; + case 'ff': + msec = parseInt(matchGroup, 10) * 10; + if ((msec < 0) || (msec > 999)) return null; + break; + case 'fff': + msec = parseInt(matchGroup, 10); + if ((msec < 0) || (msec > 999)) return null; + break; + case 'dddd': + weekDay = cultureInfo._getDayIndex(matchGroup); + if ((weekDay < 0) || (weekDay > 6)) return null; + break; + case 'ddd': + weekDay = cultureInfo._getAbbrDayIndex(matchGroup); + if ((weekDay < 0) || (weekDay > 6)) return null; + break; + case 'zzz': + var offsets = matchGroup.split(/:/); + if (offsets.length !== 2) return null; + hourOffset = parseInt(offsets[0], 10); + if ((hourOffset < -12) || (hourOffset > 13)) return null; + var minOffset = parseInt(offsets[1], 10); + if ((minOffset < 0) || (minOffset > 59)) return null; + tzMinOffset = (hourOffset * 60) + (matchGroup.startsWith('-')? -minOffset : minOffset); + break; + case 'z': case 'zz': + hourOffset = parseInt(matchGroup, 10); + if ((hourOffset < -12) || (hourOffset > 13)) return null; + tzMinOffset = hourOffset * 60; + break; + case 'g': case 'gg': + var eraName = matchGroup; + if (!eraName || !dtf.eras) return null; + eraName = eraName.toLowerCase().trim(); + for (var i = 0, l = dtf.eras.length; i < l; i += 4) { + if (eraName === dtf.eras[i + 1].toLowerCase()) { + era = i; + break; + } + } + if (era === null) return null; + break; + } + } + } + var result = new Date(), defaults, convert = dtf.Calendar.convert; + if (convert) { + defaults = convert.fromGregorian(result); + } + if (!convert) { + defaults = [result.getFullYear(), result.getMonth(), result.getDate()]; + } + if (year === null) { + year = defaults[0]; + } + else if (dtf.eras) { + year += dtf.eras[(era || 0) + 3]; + } + if (month === null) { + month = defaults[1]; + } + if (date === null) { + date = defaults[2]; + } + if (convert) { + result = convert.toGregorian(year, month, date); + if (result === null) return null; + } + else { + result.setFullYear(year, month, date); + if (result.getDate() !== date) return null; + if ((weekDay !== null) && (result.getDay() !== weekDay)) { + return null; + } + } + if (pmHour && (hour < 12)) { + hour += 12; + } + result.setHours(hour, min, sec, msec); + if (tzMinOffset !== null) { + var adjustedMin = result.getMinutes() - (tzMinOffset + result.getTimezoneOffset()); + result.setHours(result.getHours() + parseInt(adjustedMin/60, 10), adjustedMin%60); + } + return result; +} +Date.prototype.format = function Date$format(format) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "format", type: String} + ]); + if (e) throw e; + return this._toFormattedString(format, Sys.CultureInfo.InvariantCulture); +} +Date.prototype.localeFormat = function Date$localeFormat(format) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "format", type: String} + ]); + if (e) throw e; + return this._toFormattedString(format, Sys.CultureInfo.CurrentCulture); +} +Date.prototype._toFormattedString = function Date$_toFormattedString(format, cultureInfo) { + var dtf = cultureInfo.dateTimeFormat, + convert = dtf.Calendar.convert; + if (!format || !format.length || (format === 'i')) { + if (cultureInfo && cultureInfo.name.length) { + if (convert) { + return this._toFormattedString(dtf.FullDateTimePattern, cultureInfo); + } + else { + var eraDate = new Date(this.getTime()); + var era = Date._getEra(this, dtf.eras); + eraDate.setFullYear(Date._getEraYear(this, dtf, era)); + return eraDate.toLocaleString(); + } + } + else { + return this.toString(); + } + } + var eras = dtf.eras, + sortable = (format === "s"); + format = Date._expandFormat(dtf, format); + var ret = new Sys.StringBuilder(); + var hour; + function addLeadingZero(num) { + if (num < 10) { + return '0' + num; + } + return num.toString(); + } + function addLeadingZeros(num) { + if (num < 10) { + return '00' + num; + } + if (num < 100) { + return '0' + num; + } + return num.toString(); + } + function padYear(year) { + if (year < 10) { + return '000' + year; + } + else if (year < 100) { + return '00' + year; + } + else if (year < 1000) { + return '0' + year; + } + return year.toString(); + } + + var foundDay, checkedDay, dayPartRegExp = /([^d]|^)(d|dd)([^d]|$)/g; + function hasDay() { + if (foundDay || checkedDay) { + return foundDay; + } + foundDay = dayPartRegExp.test(format); + checkedDay = true; + return foundDay; + } + + var quoteCount = 0, + tokenRegExp = Date._getTokenRegExp(), + converted; + if (!sortable && convert) { + converted = convert.fromGregorian(this); + } + for (;;) { + var index = tokenRegExp.lastIndex; + var ar = tokenRegExp.exec(format); + var preMatch = format.slice(index, ar ? ar.index : format.length); + quoteCount += Date._appendPreOrPostMatch(preMatch, ret); + if (!ar) break; + if ((quoteCount%2) === 1) { + ret.append(ar[0]); + continue; + } + + function getPart(date, part) { + if (converted) { + return converted[part]; + } + switch (part) { + case 0: return date.getFullYear(); + case 1: return date.getMonth(); + case 2: return date.getDate(); + } + } + switch (ar[0]) { + case "dddd": + ret.append(dtf.DayNames[this.getDay()]); + break; + case "ddd": + ret.append(dtf.AbbreviatedDayNames[this.getDay()]); + break; + case "dd": + foundDay = true; + ret.append(addLeadingZero(getPart(this, 2))); + break; + case "d": + foundDay = true; + ret.append(getPart(this, 2)); + break; + case "MMMM": + ret.append((dtf.MonthGenitiveNames && hasDay()) + ? dtf.MonthGenitiveNames[getPart(this, 1)] + : dtf.MonthNames[getPart(this, 1)]); + break; + case "MMM": + ret.append((dtf.AbbreviatedMonthGenitiveNames && hasDay()) + ? dtf.AbbreviatedMonthGenitiveNames[getPart(this, 1)] + : dtf.AbbreviatedMonthNames[getPart(this, 1)]); + break; + case "MM": + ret.append(addLeadingZero(getPart(this, 1) + 1)); + break; + case "M": + ret.append(getPart(this, 1) + 1); + break; + case "yyyy": + ret.append(padYear(converted ? converted[0] : Date._getEraYear(this, dtf, Date._getEra(this, eras), sortable))); + break; + case "yy": + ret.append(addLeadingZero((converted ? converted[0] : Date._getEraYear(this, dtf, Date._getEra(this, eras), sortable)) % 100)); + break; + case "y": + ret.append((converted ? converted[0] : Date._getEraYear(this, dtf, Date._getEra(this, eras), sortable)) % 100); + break; + case "hh": + hour = this.getHours() % 12; + if (hour === 0) hour = 12; + ret.append(addLeadingZero(hour)); + break; + case "h": + hour = this.getHours() % 12; + if (hour === 0) hour = 12; + ret.append(hour); + break; + case "HH": + ret.append(addLeadingZero(this.getHours())); + break; + case "H": + ret.append(this.getHours()); + break; + case "mm": + ret.append(addLeadingZero(this.getMinutes())); + break; + case "m": + ret.append(this.getMinutes()); + break; + case "ss": + ret.append(addLeadingZero(this.getSeconds())); + break; + case "s": + ret.append(this.getSeconds()); + break; + case "tt": + ret.append((this.getHours() < 12) ? dtf.AMDesignator : dtf.PMDesignator); + break; + case "t": + ret.append(((this.getHours() < 12) ? dtf.AMDesignator : dtf.PMDesignator).charAt(0)); + break; + case "f": + ret.append(addLeadingZeros(this.getMilliseconds()).charAt(0)); + break; + case "ff": + ret.append(addLeadingZeros(this.getMilliseconds()).substr(0, 2)); + break; + case "fff": + ret.append(addLeadingZeros(this.getMilliseconds())); + break; + case "z": + hour = this.getTimezoneOffset() / 60; + ret.append(((hour <= 0) ? '+' : '-') + Math.floor(Math.abs(hour))); + break; + case "zz": + hour = this.getTimezoneOffset() / 60; + ret.append(((hour <= 0) ? '+' : '-') + addLeadingZero(Math.floor(Math.abs(hour)))); + break; + case "zzz": + hour = this.getTimezoneOffset() / 60; + ret.append(((hour <= 0) ? '+' : '-') + addLeadingZero(Math.floor(Math.abs(hour))) + + ":" + addLeadingZero(Math.abs(this.getTimezoneOffset() % 60))); + break; + case "g": + case "gg": + if (dtf.eras) { + ret.append(dtf.eras[Date._getEra(this, eras) + 1]); + } + break; + case "/": + ret.append(dtf.DateSeparator); + break; + default: + Sys.Debug.fail("Invalid date format pattern"); + } + } + return ret.toString(); +} +String.localeFormat = function String$localeFormat(format, args) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "format", type: String}, + {name: "args", mayBeNull: true, parameterArray: true} + ]); + if (e) throw e; + return String._toFormattedString(true, arguments); +} +Number.parseLocale = function Number$parseLocale(value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String} + ], false); + if (e) throw e; + return Number._parse(value, Sys.CultureInfo.CurrentCulture); +} +Number.parseInvariant = function Number$parseInvariant(value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String} + ], false); + if (e) throw e; + return Number._parse(value, Sys.CultureInfo.InvariantCulture); +} +Number._parse = function Number$_parse(value, cultureInfo) { + value = value.trim(); + + if (value.match(/^[+-]?infinity$/i)) { + return parseFloat(value); + } + if (value.match(/^0x[a-f0-9]+$/i)) { + return parseInt(value); + } + var numFormat = cultureInfo.numberFormat; + var signInfo = Number._parseNumberNegativePattern(value, numFormat, numFormat.NumberNegativePattern); + var sign = signInfo[0]; + var num = signInfo[1]; + + if ((sign === '') && (numFormat.NumberNegativePattern !== 1)) { + signInfo = Number._parseNumberNegativePattern(value, numFormat, 1); + sign = signInfo[0]; + num = signInfo[1]; + } + if (sign === '') sign = '+'; + + var exponent; + var intAndFraction; + var exponentPos = num.indexOf('e'); + if (exponentPos < 0) exponentPos = num.indexOf('E'); + if (exponentPos < 0) { + intAndFraction = num; + exponent = null; + } + else { + intAndFraction = num.substr(0, exponentPos); + exponent = num.substr(exponentPos + 1); + } + + var integer; + var fraction; + var decimalPos = intAndFraction.indexOf(numFormat.NumberDecimalSeparator); + if (decimalPos < 0) { + integer = intAndFraction; + fraction = null; + } + else { + integer = intAndFraction.substr(0, decimalPos); + fraction = intAndFraction.substr(decimalPos + numFormat.NumberDecimalSeparator.length); + } + + integer = integer.split(numFormat.NumberGroupSeparator).join(''); + var altNumGroupSeparator = numFormat.NumberGroupSeparator.replace(/\u00A0/g, " "); + if (numFormat.NumberGroupSeparator !== altNumGroupSeparator) { + integer = integer.split(altNumGroupSeparator).join(''); + } + + var p = sign + integer; + if (fraction !== null) { + p += '.' + fraction; + } + if (exponent !== null) { + var expSignInfo = Number._parseNumberNegativePattern(exponent, numFormat, 1); + if (expSignInfo[0] === '') { + expSignInfo[0] = '+'; + } + p += 'e' + expSignInfo[0] + expSignInfo[1]; + } + if (p.match(/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/)) { + return parseFloat(p); + } + return Number.NaN; +} +Number._parseNumberNegativePattern = function Number$_parseNumberNegativePattern(value, numFormat, numberNegativePattern) { + var neg = numFormat.NegativeSign; + var pos = numFormat.PositiveSign; + switch (numberNegativePattern) { + case 4: + neg = ' ' + neg; + pos = ' ' + pos; + case 3: + if (value.endsWith(neg)) { + return ['-', value.substr(0, value.length - neg.length)]; + } + else if (value.endsWith(pos)) { + return ['+', value.substr(0, value.length - pos.length)]; + } + break; + case 2: + neg += ' '; + pos += ' '; + case 1: + if (value.startsWith(neg)) { + return ['-', value.substr(neg.length)]; + } + else if (value.startsWith(pos)) { + return ['+', value.substr(pos.length)]; + } + break; + case 0: + if (value.startsWith('(') && value.endsWith(')')) { + return ['-', value.substr(1, value.length - 2)]; + } + break; + default: + Sys.Debug.fail(""); + } + return ['', value]; +} +Number.prototype.format = function Number$format(format) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "format", type: String} + ]); + if (e) throw e; + return this._toFormattedString(format, Sys.CultureInfo.InvariantCulture); +} +Number.prototype.localeFormat = function Number$localeFormat(format) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "format", type: String} + ]); + if (e) throw e; + return this._toFormattedString(format, Sys.CultureInfo.CurrentCulture); +} +Number.prototype._toFormattedString = function Number$_toFormattedString(format, cultureInfo) { + if (!format || (format.length === 0) || (format === 'i')) { + if (cultureInfo && (cultureInfo.name.length > 0)) { + return this.toLocaleString(); + } + else { + return this.toString(); + } + } + + var _percentPositivePattern = ["n %", "n%", "%n" ]; + var _percentNegativePattern = ["-n %", "-n%", "-%n"]; + var _numberNegativePattern = ["(n)","-n","- n","n-","n -"]; + var _currencyPositivePattern = ["$n","n$","$ n","n $"]; + var _currencyNegativePattern = ["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"]; + function zeroPad(str, count, left) { + for (var l=str.length; l < count; l++) { + str = (left ? ('0' + str) : (str + '0')); + } + return str; + } + + function expandNumber(number, precision, groupSizes, sep, decimalChar) { + Sys.Debug.assert(groupSizes.length > 0, "groupSizes must be an array of at least 1"); + var curSize = groupSizes[0]; + var curGroupIndex = 1; + var factor = Math.pow(10, precision); + var rounded = (Math.round(number * factor) / factor); + if (!isFinite(rounded)) { + rounded = number; + } + number = rounded; + + var numberString = number.toString(); + var right = ""; + var exponent; + + + var split = numberString.split(/e/i); + numberString = split[0]; + exponent = (split.length > 1 ? parseInt(split[1]) : 0); + split = numberString.split('.'); + numberString = split[0]; + right = split.length > 1 ? split[1] : ""; + + var l; + if (exponent > 0) { + right = zeroPad(right, exponent, false); + numberString += right.slice(0, exponent); + right = right.substr(exponent); + } + else if (exponent < 0) { + exponent = -exponent; + numberString = zeroPad(numberString, exponent+1, true); + right = numberString.slice(-exponent, numberString.length) + right; + numberString = numberString.slice(0, -exponent); + } + if (precision > 0) { + if (right.length > precision) { + right = right.slice(0, precision); + } + else { + right = zeroPad(right, precision, false); + } + right = decimalChar + right; + } + else { + right = ""; + } + var stringIndex = numberString.length-1; + var ret = ""; + while (stringIndex >= 0) { + if (curSize === 0 || curSize > stringIndex) { + if (ret.length > 0) + return numberString.slice(0, stringIndex + 1) + sep + ret + right; + else + return numberString.slice(0, stringIndex + 1) + right; + } + if (ret.length > 0) + ret = numberString.slice(stringIndex - curSize + 1, stringIndex+1) + sep + ret; + else + ret = numberString.slice(stringIndex - curSize + 1, stringIndex+1); + stringIndex -= curSize; + if (curGroupIndex < groupSizes.length) { + curSize = groupSizes[curGroupIndex]; + curGroupIndex++; + } + } + return numberString.slice(0, stringIndex + 1) + sep + ret + right; + } + var nf = cultureInfo.numberFormat; + var number = Math.abs(this); + if (!format) + format = "D"; + var precision = -1; + if (format.length > 1) precision = parseInt(format.slice(1), 10); + var pattern; + switch (format.charAt(0)) { + case "d": + case "D": + pattern = 'n'; + if (precision !== -1) { + number = zeroPad(""+number, precision, true); + } + if (this < 0) number = -number; + break; + case "c": + case "C": + if (this < 0) pattern = _currencyNegativePattern[nf.CurrencyNegativePattern]; + else pattern = _currencyPositivePattern[nf.CurrencyPositivePattern]; + if (precision === -1) precision = nf.CurrencyDecimalDigits; + number = expandNumber(Math.abs(this), precision, nf.CurrencyGroupSizes, nf.CurrencyGroupSeparator, nf.CurrencyDecimalSeparator); + break; + case "n": + case "N": + if (this < 0) pattern = _numberNegativePattern[nf.NumberNegativePattern]; + else pattern = 'n'; + if (precision === -1) precision = nf.NumberDecimalDigits; + number = expandNumber(Math.abs(this), precision, nf.NumberGroupSizes, nf.NumberGroupSeparator, nf.NumberDecimalSeparator); + break; + case "p": + case "P": + if (this < 0) pattern = _percentNegativePattern[nf.PercentNegativePattern]; + else pattern = _percentPositivePattern[nf.PercentPositivePattern]; + if (precision === -1) precision = nf.PercentDecimalDigits; + number = expandNumber(Math.abs(this) * 100, precision, nf.PercentGroupSizes, nf.PercentGroupSeparator, nf.PercentDecimalSeparator); + break; + default: + throw Error.format(Sys.Res.formatBadFormatSpecifier); + } + var regex = /n|\$|-|%/g; + var ret = ""; + for (;;) { + var index = regex.lastIndex; + var ar = regex.exec(pattern); + ret += pattern.slice(index, ar ? ar.index : pattern.length); + if (!ar) + break; + switch (ar[0]) { + case "n": + ret += number; + break; + case "$": + ret += nf.CurrencySymbol; + break; + case "-": + if (/[1-9]/.test(number)) { + ret += nf.NegativeSign; + } + break; + case "%": + ret += nf.PercentSymbol; + break; + default: + Sys.Debug.fail("Invalid number format pattern"); + } + } + return ret; +} + +Sys.CultureInfo = function Sys$CultureInfo(name, numberFormat, dateTimeFormat) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "name", type: String}, + {name: "numberFormat", type: Object}, + {name: "dateTimeFormat", type: Object} + ]); + if (e) throw e; + this.name = name; + this.numberFormat = numberFormat; + this.dateTimeFormat = dateTimeFormat; +} + function Sys$CultureInfo$_getDateTimeFormats() { + if (! this._dateTimeFormats) { + var dtf = this.dateTimeFormat; + this._dateTimeFormats = + [ dtf.MonthDayPattern, + dtf.YearMonthPattern, + dtf.ShortDatePattern, + dtf.ShortTimePattern, + dtf.LongDatePattern, + dtf.LongTimePattern, + dtf.FullDateTimePattern, + dtf.RFC1123Pattern, + dtf.SortableDateTimePattern, + dtf.UniversalSortableDateTimePattern ]; + } + return this._dateTimeFormats; + } + function Sys$CultureInfo$_getIndex(value, a1, a2) { + var upper = this._toUpper(value), + i = Array.indexOf(a1, upper); + if (i === -1) { + i = Array.indexOf(a2, upper); + } + return i; + } + function Sys$CultureInfo$_getMonthIndex(value) { + if (!this._upperMonths) { + this._upperMonths = this._toUpperArray(this.dateTimeFormat.MonthNames); + this._upperMonthsGenitive = this._toUpperArray(this.dateTimeFormat.MonthGenitiveNames); + } + return this._getIndex(value, this._upperMonths, this._upperMonthsGenitive); + } + function Sys$CultureInfo$_getAbbrMonthIndex(value) { + if (!this._upperAbbrMonths) { + this._upperAbbrMonths = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames); + this._upperAbbrMonthsGenitive = this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthGenitiveNames); + } + return this._getIndex(value, this._upperAbbrMonths, this._upperAbbrMonthsGenitive); + } + function Sys$CultureInfo$_getDayIndex(value) { + if (!this._upperDays) { + this._upperDays = this._toUpperArray(this.dateTimeFormat.DayNames); + } + return Array.indexOf(this._upperDays, this._toUpper(value)); + } + function Sys$CultureInfo$_getAbbrDayIndex(value) { + if (!this._upperAbbrDays) { + this._upperAbbrDays = this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames); + } + return Array.indexOf(this._upperAbbrDays, this._toUpper(value)); + } + function Sys$CultureInfo$_toUpperArray(arr) { + var result = []; + for (var i = 0, il = arr.length; i < il; i++) { + result[i] = this._toUpper(arr[i]); + } + return result; + } + function Sys$CultureInfo$_toUpper(value) { + return value.split("\u00A0").join(' ').toUpperCase(); + } +Sys.CultureInfo.prototype = { + _getDateTimeFormats: Sys$CultureInfo$_getDateTimeFormats, + _getIndex: Sys$CultureInfo$_getIndex, + _getMonthIndex: Sys$CultureInfo$_getMonthIndex, + _getAbbrMonthIndex: Sys$CultureInfo$_getAbbrMonthIndex, + _getDayIndex: Sys$CultureInfo$_getDayIndex, + _getAbbrDayIndex: Sys$CultureInfo$_getAbbrDayIndex, + _toUpperArray: Sys$CultureInfo$_toUpperArray, + _toUpper: Sys$CultureInfo$_toUpper +} +Sys.CultureInfo.registerClass('Sys.CultureInfo'); +Sys.CultureInfo._parse = function Sys$CultureInfo$_parse(value) { + var dtf = value.dateTimeFormat; + if (dtf && !dtf.eras) { + dtf.eras = value.eras; + } + return new Sys.CultureInfo(value.name, value.numberFormat, dtf); +} +Sys.CultureInfo.InvariantCulture = Sys.CultureInfo._parse({"name":"","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":true,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"\u00A4","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":true},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, dd MMMM yyyy HH:mm:ss","LongDatePattern":"dddd, dd MMMM yyyy","LongTimePattern":"HH:mm:ss","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"MM/dd/yyyy","ShortTimePattern":"HH:mm","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"yyyy MMMM","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":true,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]},"eras":[1,"A.D.",null,0]}); +if (typeof(__cultureInfo) === "object") { + Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse(__cultureInfo); + delete __cultureInfo; +} +else { + Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse({"name":"en-US","numberFormat":{"CurrencyDecimalDigits":2,"CurrencyDecimalSeparator":".","IsReadOnly":false,"CurrencyGroupSizes":[3],"NumberGroupSizes":[3],"PercentGroupSizes":[3],"CurrencyGroupSeparator":",","CurrencySymbol":"$","NaNSymbol":"NaN","CurrencyNegativePattern":0,"NumberNegativePattern":1,"PercentPositivePattern":0,"PercentNegativePattern":0,"NegativeInfinitySymbol":"-Infinity","NegativeSign":"-","NumberDecimalDigits":2,"NumberDecimalSeparator":".","NumberGroupSeparator":",","CurrencyPositivePattern":0,"PositiveInfinitySymbol":"Infinity","PositiveSign":"+","PercentDecimalDigits":2,"PercentDecimalSeparator":".","PercentGroupSeparator":",","PercentSymbol":"%","PerMilleSymbol":"\u2030","NativeDigits":["0","1","2","3","4","5","6","7","8","9"],"DigitSubstitution":1},"dateTimeFormat":{"AMDesignator":"AM","Calendar":{"MinSupportedDateTime":"@-62135568000000@","MaxSupportedDateTime":"@253402300799999@","AlgorithmType":1,"CalendarType":1,"Eras":[1],"TwoDigitYearMax":2029,"IsReadOnly":false},"DateSeparator":"/","FirstDayOfWeek":0,"CalendarWeekRule":0,"FullDateTimePattern":"dddd, MMMM dd, yyyy h:mm:ss tt","LongDatePattern":"dddd, MMMM dd, yyyy","LongTimePattern":"h:mm:ss tt","MonthDayPattern":"MMMM dd","PMDesignator":"PM","RFC1123Pattern":"ddd, dd MMM yyyy HH\':\'mm\':\'ss \'GMT\'","ShortDatePattern":"M/d/yyyy","ShortTimePattern":"h:mm tt","SortableDateTimePattern":"yyyy\'-\'MM\'-\'dd\'T\'HH\':\'mm\':\'ss","TimeSeparator":":","UniversalSortableDateTimePattern":"yyyy\'-\'MM\'-\'dd HH\':\'mm\':\'ss\'Z\'","YearMonthPattern":"MMMM, yyyy","AbbreviatedDayNames":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"ShortestDayNames":["Su","Mo","Tu","We","Th","Fr","Sa"],"DayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"AbbreviatedMonthNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"IsReadOnly":false,"NativeCalendarName":"Gregorian Calendar","AbbreviatedMonthGenitiveNames":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"MonthGenitiveNames":["January","February","March","April","May","June","July","August","September","October","November","December",""]},"eras":[1,"A.D.",null,0]}); +} +Type.registerNamespace('Sys.Serialization'); +Sys.Serialization.JavaScriptSerializer = function Sys$Serialization$JavaScriptSerializer() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); +} +Sys.Serialization.JavaScriptSerializer.registerClass('Sys.Serialization.JavaScriptSerializer'); +Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs = []; +Sys.Serialization.JavaScriptSerializer._charsToEscape = []; +Sys.Serialization.JavaScriptSerializer._dateRegEx = new RegExp('(^|[^\\\\])\\"\\\\/Date\\((-?[0-9]+)(?:[a-zA-Z]|(?:\\+|-)[0-9]{4})?\\)\\\\/\\"', 'g'); +Sys.Serialization.JavaScriptSerializer._escapeChars = {}; +Sys.Serialization.JavaScriptSerializer._escapeRegEx = new RegExp('["\\\\\\x00-\\x1F]', 'i'); +Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal = new RegExp('["\\\\\\x00-\\x1F]', 'g'); +Sys.Serialization.JavaScriptSerializer._jsonRegEx = new RegExp('[^,:{}\\[\\]0-9.\\-+Eaeflnr-u \\n\\r\\t]', 'g'); +Sys.Serialization.JavaScriptSerializer._jsonStringRegEx = new RegExp('"(\\\\.|[^"\\\\])*"', 'g'); +Sys.Serialization.JavaScriptSerializer._serverTypeFieldName = '__type'; +Sys.Serialization.JavaScriptSerializer._init = function Sys$Serialization$JavaScriptSerializer$_init() { + var replaceChars = ['\\u0000','\\u0001','\\u0002','\\u0003','\\u0004','\\u0005','\\u0006','\\u0007', + '\\b','\\t','\\n','\\u000b','\\f','\\r','\\u000e','\\u000f','\\u0010','\\u0011', + '\\u0012','\\u0013','\\u0014','\\u0015','\\u0016','\\u0017','\\u0018','\\u0019', + '\\u001a','\\u001b','\\u001c','\\u001d','\\u001e','\\u001f']; + Sys.Serialization.JavaScriptSerializer._charsToEscape[0] = '\\'; + Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['\\'] = new RegExp('\\\\', 'g'); + Sys.Serialization.JavaScriptSerializer._escapeChars['\\'] = '\\\\'; + Sys.Serialization.JavaScriptSerializer._charsToEscape[1] = '"'; + Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs['"'] = new RegExp('"', 'g'); + Sys.Serialization.JavaScriptSerializer._escapeChars['"'] = '\\"'; + for (var i = 0; i < 32; i++) { + var c = String.fromCharCode(i); + Sys.Serialization.JavaScriptSerializer._charsToEscape[i+2] = c; + Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[c] = new RegExp(c, 'g'); + Sys.Serialization.JavaScriptSerializer._escapeChars[c] = replaceChars[i]; + } +} +Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeBooleanWithBuilder(object, stringBuilder) { + stringBuilder.append(object.toString()); +} +Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeNumberWithBuilder(object, stringBuilder) { + if (isFinite(object)) { + stringBuilder.append(String(object)); + } + else { + throw Error.invalidOperation(Sys.Res.cannotSerializeNonFiniteNumbers); + } +} +Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeStringWithBuilder(string, stringBuilder) { + stringBuilder.append('"'); + if (Sys.Serialization.JavaScriptSerializer._escapeRegEx.test(string)) { + if (Sys.Serialization.JavaScriptSerializer._charsToEscape.length === 0) { + Sys.Serialization.JavaScriptSerializer._init(); + } + if (string.length < 128) { + string = string.replace(Sys.Serialization.JavaScriptSerializer._escapeRegExGlobal, + function(x) { return Sys.Serialization.JavaScriptSerializer._escapeChars[x]; }); + } + else { + for (var i = 0; i < 34; i++) { + var c = Sys.Serialization.JavaScriptSerializer._charsToEscape[i]; + if (string.indexOf(c) !== -1) { + if (Sys.Browser.agent === Sys.Browser.Opera || Sys.Browser.agent === Sys.Browser.FireFox) { + string = string.split(c).join(Sys.Serialization.JavaScriptSerializer._escapeChars[c]); + } + else { + string = string.replace(Sys.Serialization.JavaScriptSerializer._charsToEscapeRegExs[c], + Sys.Serialization.JavaScriptSerializer._escapeChars[c]); + } + } + } + } + } + stringBuilder.append(string); + stringBuilder.append('"'); +} +Sys.Serialization.JavaScriptSerializer._serializeWithBuilder = function Sys$Serialization$JavaScriptSerializer$_serializeWithBuilder(object, stringBuilder, sort, prevObjects) { + var i; + switch (typeof object) { + case 'object': + if (object) { + if (prevObjects){ + for( var j = 0; j < prevObjects.length; j++) { + if (prevObjects[j] === object) { + throw Error.invalidOperation(Sys.Res.cannotSerializeObjectWithCycle); + } + } + } + else { + prevObjects = new Array(); + } + try { + Array.add(prevObjects, object); + + if (Number.isInstanceOfType(object)){ + Sys.Serialization.JavaScriptSerializer._serializeNumberWithBuilder(object, stringBuilder); + } + else if (Boolean.isInstanceOfType(object)){ + Sys.Serialization.JavaScriptSerializer._serializeBooleanWithBuilder(object, stringBuilder); + } + else if (String.isInstanceOfType(object)){ + Sys.Serialization.JavaScriptSerializer._serializeStringWithBuilder(object, stringBuilder); + } + + else if (Array.isInstanceOfType(object)) { + stringBuilder.append('['); + + for (i = 0; i < object.length; ++i) { + if (i > 0) { + stringBuilder.append(','); + } + Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(object[i], stringBuilder,false,prevObjects); + } + stringBuilder.append(']'); + } + else { + if (Date.isInstanceOfType(object)) { + stringBuilder.append('"\\/Date('); + stringBuilder.append(object.getTime()); + stringBuilder.append(')\\/"'); + break; + } + var properties = []; + var propertyCount = 0; + for (var name in object) { + if (name.startsWith('$')) { + continue; + } + if (name === Sys.Serialization.JavaScriptSerializer._serverTypeFieldName && propertyCount !== 0){ + properties[propertyCount++] = properties[0]; + properties[0] = name; + } + else{ + properties[propertyCount++] = name; + } + } + if (sort) properties.sort(); + stringBuilder.append('{'); + var needComma = false; + + for (i=0; i + /// + /// + var e = Function._validateParams(arguments, [ + {name: "object", mayBeNull: true} + ]); + if (e) throw e; + var stringBuilder = new Sys.StringBuilder(); + Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(object, stringBuilder, false); + return stringBuilder.toString(); +} +Sys.Serialization.JavaScriptSerializer.deserialize = function Sys$Serialization$JavaScriptSerializer$deserialize(data, secure) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "data", type: String}, + {name: "secure", type: Boolean, optional: true} + ]); + if (e) throw e; + + if (data.length === 0) throw Error.argument('data', Sys.Res.cannotDeserializeEmptyString); + try { + var exp = data.replace(Sys.Serialization.JavaScriptSerializer._dateRegEx, "$1new Date($2)"); + + if (secure && Sys.Serialization.JavaScriptSerializer._jsonRegEx.test( + exp.replace(Sys.Serialization.JavaScriptSerializer._jsonStringRegEx, ''))) throw null; + return eval('(' + exp + ')'); + } + catch (e) { + throw Error.argument('data', Sys.Res.cannotDeserializeInvalidJson); + } +} +Type.registerNamespace('Sys.UI'); + +Sys.EventHandlerList = function Sys$EventHandlerList() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._list = {}; +} + function Sys$EventHandlerList$_addHandler(id, handler) { + Array.add(this._getEvent(id, true), handler); + } + function Sys$EventHandlerList$addHandler(id, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "id", type: String}, + {name: "handler", type: Function} + ]); + if (e) throw e; + this._addHandler(id, handler); + } + function Sys$EventHandlerList$_removeHandler(id, handler) { + var evt = this._getEvent(id); + if (!evt) return; + Array.remove(evt, handler); + } + function Sys$EventHandlerList$removeHandler(id, handler) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "id", type: String}, + {name: "handler", type: Function} + ]); + if (e) throw e; + this._removeHandler(id, handler); + } + function Sys$EventHandlerList$getHandler(id) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "id", type: String} + ]); + if (e) throw e; + var evt = this._getEvent(id); + if (!evt || (evt.length === 0)) return null; + evt = Array.clone(evt); + return function(source, args) { + for (var i = 0, l = evt.length; i < l; i++) { + evt[i](source, args); + } + }; + } + function Sys$EventHandlerList$_getEvent(id, create) { + if (!this._list[id]) { + if (!create) return null; + this._list[id] = []; + } + return this._list[id]; + } +Sys.EventHandlerList.prototype = { + _addHandler: Sys$EventHandlerList$_addHandler, + addHandler: Sys$EventHandlerList$addHandler, + _removeHandler: Sys$EventHandlerList$_removeHandler, + removeHandler: Sys$EventHandlerList$removeHandler, + getHandler: Sys$EventHandlerList$getHandler, + _getEvent: Sys$EventHandlerList$_getEvent +} +Sys.EventHandlerList.registerClass('Sys.EventHandlerList'); +Sys.CommandEventArgs = function Sys$CommandEventArgs(commandName, commandArgument, commandSource) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "commandName", type: String}, + {name: "commandArgument", mayBeNull: true}, + {name: "commandSource", mayBeNull: true} + ]); + if (e) throw e; + Sys.CommandEventArgs.initializeBase(this); + this._commandName = commandName; + this._commandArgument = commandArgument; + this._commandSource = commandSource; +} + function Sys$CommandEventArgs$get_commandName() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._commandName; + } + function Sys$CommandEventArgs$get_commandArgument() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._commandArgument; + } + function Sys$CommandEventArgs$get_commandSource() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._commandSource; + } +Sys.CommandEventArgs.prototype = { + _commandName: null, + _commandArgument: null, + _commandSource: null, + get_commandName: Sys$CommandEventArgs$get_commandName, + get_commandArgument: Sys$CommandEventArgs$get_commandArgument, + get_commandSource: Sys$CommandEventArgs$get_commandSource +} +Sys.CommandEventArgs.registerClass("Sys.CommandEventArgs", Sys.CancelEventArgs); + +Sys.INotifyPropertyChange = function Sys$INotifyPropertyChange() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); +} + function Sys$INotifyPropertyChange$add_propertyChanged(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + throw Error.notImplemented(); + } + function Sys$INotifyPropertyChange$remove_propertyChanged(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + throw Error.notImplemented(); + } +Sys.INotifyPropertyChange.prototype = { + add_propertyChanged: Sys$INotifyPropertyChange$add_propertyChanged, + remove_propertyChanged: Sys$INotifyPropertyChange$remove_propertyChanged +} +Sys.INotifyPropertyChange.registerInterface('Sys.INotifyPropertyChange'); + +Sys.PropertyChangedEventArgs = function Sys$PropertyChangedEventArgs(propertyName) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "propertyName", type: String} + ]); + if (e) throw e; + Sys.PropertyChangedEventArgs.initializeBase(this); + this._propertyName = propertyName; +} + + function Sys$PropertyChangedEventArgs$get_propertyName() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._propertyName; + } +Sys.PropertyChangedEventArgs.prototype = { + get_propertyName: Sys$PropertyChangedEventArgs$get_propertyName +} +Sys.PropertyChangedEventArgs.registerClass('Sys.PropertyChangedEventArgs', Sys.EventArgs); + +Sys.INotifyDisposing = function Sys$INotifyDisposing() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); +} + function Sys$INotifyDisposing$add_disposing(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + throw Error.notImplemented(); + } + function Sys$INotifyDisposing$remove_disposing(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + throw Error.notImplemented(); + } +Sys.INotifyDisposing.prototype = { + add_disposing: Sys$INotifyDisposing$add_disposing, + remove_disposing: Sys$INotifyDisposing$remove_disposing +} +Sys.INotifyDisposing.registerInterface("Sys.INotifyDisposing"); + +Sys.Component = function Sys$Component() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (Sys.Application) Sys.Application.registerDisposableObject(this); +} + function Sys$Component$get_events() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._events) { + this._events = new Sys.EventHandlerList(); + } + return this._events; + } + function Sys$Component$get_id() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._id; + } + function Sys$Component$set_id(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + if (this._idSet) throw Error.invalidOperation(Sys.Res.componentCantSetIdTwice); + this._idSet = true; + var oldId = this.get_id(); + if (oldId && Sys.Application.findComponent(oldId)) throw Error.invalidOperation(Sys.Res.componentCantSetIdAfterAddedToApp); + this._id = value; + } + function Sys$Component$get_isInitialized() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._initialized; + } + function Sys$Component$get_isUpdating() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._updating; + } + function Sys$Component$add_disposing(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().addHandler("disposing", handler); + } + function Sys$Component$remove_disposing(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().removeHandler("disposing", handler); + } + function Sys$Component$add_propertyChanged(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().addHandler("propertyChanged", handler); + } + function Sys$Component$remove_propertyChanged(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().removeHandler("propertyChanged", handler); + } + function Sys$Component$beginUpdate() { + this._updating = true; + } + function Sys$Component$dispose() { + if (this._events) { + var handler = this._events.getHandler("disposing"); + if (handler) { + handler(this, Sys.EventArgs.Empty); + } + } + delete this._events; + Sys.Application.unregisterDisposableObject(this); + Sys.Application.removeComponent(this); + } + function Sys$Component$endUpdate() { + this._updating = false; + if (!this._initialized) this.initialize(); + this.updated(); + } + function Sys$Component$initialize() { + this._initialized = true; + } + function Sys$Component$raisePropertyChanged(propertyName) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "propertyName", type: String} + ]); + if (e) throw e; + if (!this._events) return; + var handler = this._events.getHandler("propertyChanged"); + if (handler) { + handler(this, new Sys.PropertyChangedEventArgs(propertyName)); + } + } + function Sys$Component$updated() { + } +Sys.Component.prototype = { + _id: null, + _idSet: false, + _initialized: false, + _updating: false, + get_events: Sys$Component$get_events, + get_id: Sys$Component$get_id, + set_id: Sys$Component$set_id, + get_isInitialized: Sys$Component$get_isInitialized, + get_isUpdating: Sys$Component$get_isUpdating, + add_disposing: Sys$Component$add_disposing, + remove_disposing: Sys$Component$remove_disposing, + add_propertyChanged: Sys$Component$add_propertyChanged, + remove_propertyChanged: Sys$Component$remove_propertyChanged, + beginUpdate: Sys$Component$beginUpdate, + dispose: Sys$Component$dispose, + endUpdate: Sys$Component$endUpdate, + initialize: Sys$Component$initialize, + raisePropertyChanged: Sys$Component$raisePropertyChanged, + updated: Sys$Component$updated +} +Sys.Component.registerClass('Sys.Component', null, Sys.IDisposable, Sys.INotifyPropertyChange, Sys.INotifyDisposing); +function Sys$Component$_setProperties(target, properties) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "target"}, + {name: "properties"} + ]); + if (e) throw e; + var current; + var targetType = Object.getType(target); + var isObject = (targetType === Object) || (targetType === Sys.UI.DomElement); + var isComponent = Sys.Component.isInstanceOfType(target) && !target.get_isUpdating(); + if (isComponent) target.beginUpdate(); + for (var name in properties) { + var val = properties[name]; + var getter = isObject ? null : target["get_" + name]; + if (isObject || typeof(getter) !== 'function') { + var targetVal = target[name]; + if (!isObject && typeof(targetVal) === 'undefined') throw Error.invalidOperation(String.format(Sys.Res.propertyUndefined, name)); + if (!val || (typeof(val) !== 'object') || (isObject && !targetVal)) { + target[name] = val; + } + else { + Sys$Component$_setProperties(targetVal, val); + } + } + else { + var setter = target["set_" + name]; + if (typeof(setter) === 'function') { + setter.apply(target, [val]); + } + else if (val instanceof Array) { + current = getter.apply(target); + if (!(current instanceof Array)) throw new Error.invalidOperation(String.format(Sys.Res.propertyNotAnArray, name)); + for (var i = 0, j = current.length, l= val.length; i < l; i++, j++) { + current[j] = val[i]; + } + } + else if ((typeof(val) === 'object') && (Object.getType(val) === Object)) { + current = getter.apply(target); + if ((typeof(current) === 'undefined') || (current === null)) throw new Error.invalidOperation(String.format(Sys.Res.propertyNullOrUndefined, name)); + Sys$Component$_setProperties(current, val); + } + else { + throw new Error.invalidOperation(String.format(Sys.Res.propertyNotWritable, name)); + } + } + } + if (isComponent) target.endUpdate(); +} +function Sys$Component$_setReferences(component, references) { + for (var name in references) { + var setter = component["set_" + name]; + var reference = $find(references[name]); + if (typeof(setter) !== 'function') throw new Error.invalidOperation(String.format(Sys.Res.propertyNotWritable, name)); + if (!reference) throw Error.invalidOperation(String.format(Sys.Res.referenceNotFound, references[name])); + setter.apply(component, [reference]); + } +} +var $create = Sys.Component.create = function Sys$Component$create(type, properties, events, references, element) { + /// + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "type", type: Type}, + {name: "properties", mayBeNull: true, optional: true}, + {name: "events", mayBeNull: true, optional: true}, + {name: "references", mayBeNull: true, optional: true}, + {name: "element", mayBeNull: true, domElement: true, optional: true} + ]); + if (e) throw e; + if (!type.inheritsFrom(Sys.Component)) { + throw Error.argument('type', String.format(Sys.Res.createNotComponent, type.getName())); + } + if (type.inheritsFrom(Sys.UI.Behavior) || type.inheritsFrom(Sys.UI.Control)) { + if (!element) throw Error.argument('element', Sys.Res.createNoDom); + } + else if (element) throw Error.argument('element', Sys.Res.createComponentOnDom); + var component = (element ? new type(element): new type()); + var app = Sys.Application; + var creatingComponents = app.get_isCreatingComponents(); + component.beginUpdate(); + if (properties) { + Sys$Component$_setProperties(component, properties); + } + if (events) { + for (var name in events) { + if (!(component["add_" + name] instanceof Function)) throw new Error.invalidOperation(String.format(Sys.Res.undefinedEvent, name)); + if (!(events[name] instanceof Function)) throw new Error.invalidOperation(Sys.Res.eventHandlerNotFunction); + component["add_" + name](events[name]); + } + } + if (component.get_id()) { + app.addComponent(component); + } + if (creatingComponents) { + app._createdComponents[app._createdComponents.length] = component; + if (references) { + app._addComponentToSecondPass(component, references); + } + else { + component.endUpdate(); + } + } + else { + if (references) { + Sys$Component$_setReferences(component, references); + } + component.endUpdate(); + } + return component; +} + +Sys.UI.MouseButton = function Sys$UI$MouseButton() { + /// + /// + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); +} +Sys.UI.MouseButton.prototype = { + leftButton: 0, + middleButton: 1, + rightButton: 2 +} +Sys.UI.MouseButton.registerEnum("Sys.UI.MouseButton"); + +Sys.UI.Key = function Sys$UI$Key() { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); +} +Sys.UI.Key.prototype = { + backspace: 8, + tab: 9, + enter: 13, + esc: 27, + space: 32, + pageUp: 33, + pageDown: 34, + end: 35, + home: 36, + left: 37, + up: 38, + right: 39, + down: 40, + del: 127 +} +Sys.UI.Key.registerEnum("Sys.UI.Key"); + +Sys.UI.Point = function Sys$UI$Point(x, y) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "x", type: Number, integer: true}, + {name: "y", type: Number, integer: true} + ]); + if (e) throw e; + this.x = x; + this.y = y; +} +Sys.UI.Point.registerClass('Sys.UI.Point'); + +Sys.UI.Bounds = function Sys$UI$Bounds(x, y, width, height) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "x", type: Number, integer: true}, + {name: "y", type: Number, integer: true}, + {name: "width", type: Number, integer: true}, + {name: "height", type: Number, integer: true} + ]); + if (e) throw e; + this.x = x; + this.y = y; + this.height = height; + this.width = width; +} +Sys.UI.Bounds.registerClass('Sys.UI.Bounds'); + +Sys.UI.DomEvent = function Sys$UI$DomEvent(eventObject) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "eventObject"} + ]); + if (e) throw e; + var ev = eventObject; + var etype = this.type = ev.type.toLowerCase(); + this.rawEvent = ev; + this.altKey = ev.altKey; + if (typeof(ev.button) !== 'undefined') { + this.button = (typeof(ev.which) !== 'undefined') ? ev.button : + (ev.button === 4) ? Sys.UI.MouseButton.middleButton : + (ev.button === 2) ? Sys.UI.MouseButton.rightButton : + Sys.UI.MouseButton.leftButton; + } + if (etype === 'keypress') { + this.charCode = ev.charCode || ev.keyCode; + } + else if (ev.keyCode && (ev.keyCode === 46)) { + this.keyCode = 127; + } + else { + this.keyCode = ev.keyCode; + } + this.clientX = ev.clientX; + this.clientY = ev.clientY; + this.ctrlKey = ev.ctrlKey; + this.target = ev.target ? ev.target : ev.srcElement; + if (!etype.startsWith('key')) { + if ((typeof(ev.offsetX) !== 'undefined') && (typeof(ev.offsetY) !== 'undefined')) { + this.offsetX = ev.offsetX; + this.offsetY = ev.offsetY; + } + else if (this.target && (this.target.nodeType !== 3) && (typeof(ev.clientX) === 'number')) { + var loc = Sys.UI.DomElement.getLocation(this.target); + var w = Sys.UI.DomElement._getWindow(this.target); + this.offsetX = (w.pageXOffset || 0) + ev.clientX - loc.x; + this.offsetY = (w.pageYOffset || 0) + ev.clientY - loc.y; + } + } + this.screenX = ev.screenX; + this.screenY = ev.screenY; + this.shiftKey = ev.shiftKey; +} + function Sys$UI$DomEvent$preventDefault() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this.rawEvent.preventDefault) { + this.rawEvent.preventDefault(); + } + else if (window.event) { + this.rawEvent.returnValue = false; + } + } + function Sys$UI$DomEvent$stopPropagation() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this.rawEvent.stopPropagation) { + this.rawEvent.stopPropagation(); + } + else if (window.event) { + this.rawEvent.cancelBubble = true; + } + } +Sys.UI.DomEvent.prototype = { + preventDefault: Sys$UI$DomEvent$preventDefault, + stopPropagation: Sys$UI$DomEvent$stopPropagation +} +Sys.UI.DomEvent.registerClass('Sys.UI.DomEvent'); +var $addHandler = Sys.UI.DomEvent.addHandler = function Sys$UI$DomEvent$addHandler(element, eventName, handler, autoRemove) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element"}, + {name: "eventName", type: String}, + {name: "handler", type: Function}, + {name: "autoRemove", type: Boolean, optional: true} + ]); + if (e) throw e; + Sys.UI.DomEvent._ensureDomNode(element); + if (eventName === "error") throw Error.invalidOperation(Sys.Res.addHandlerCantBeUsedForError); + if (!element._events) { + element._events = {}; + } + var eventCache = element._events[eventName]; + if (!eventCache) { + element._events[eventName] = eventCache = []; + } + var browserHandler; + if (element.addEventListener) { + browserHandler = function(e) { + return handler.call(element, new Sys.UI.DomEvent(e)); + } + element.addEventListener(eventName, browserHandler, false); + } + else if (element.attachEvent) { + browserHandler = function() { + var e = {}; + try {e = Sys.UI.DomElement._getWindow(element).event} catch(ex) {} + return handler.call(element, new Sys.UI.DomEvent(e)); + } + element.attachEvent('on' + eventName, browserHandler); + } + eventCache[eventCache.length] = {handler: handler, browserHandler: browserHandler, autoRemove: autoRemove }; + if (autoRemove) { + var d = element.dispose; + if (d !== Sys.UI.DomEvent._disposeHandlers) { + element.dispose = Sys.UI.DomEvent._disposeHandlers; + if (typeof(d) !== "undefined") { + element._chainDispose = d; + } + } + } +} +var $addHandlers = Sys.UI.DomEvent.addHandlers = function Sys$UI$DomEvent$addHandlers(element, events, handlerOwner, autoRemove) { + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element"}, + {name: "events", type: Object}, + {name: "handlerOwner", optional: true}, + {name: "autoRemove", type: Boolean, optional: true} + ]); + if (e) throw e; + Sys.UI.DomEvent._ensureDomNode(element); + for (var name in events) { + var handler = events[name]; + if (typeof(handler) !== 'function') throw Error.invalidOperation(Sys.Res.cantAddNonFunctionhandler); + if (handlerOwner) { + handler = Function.createDelegate(handlerOwner, handler); + } + $addHandler(element, name, handler, autoRemove || false); + } +} +var $clearHandlers = Sys.UI.DomEvent.clearHandlers = function Sys$UI$DomEvent$clearHandlers(element) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element"} + ]); + if (e) throw e; + Sys.UI.DomEvent._ensureDomNode(element); + Sys.UI.DomEvent._clearHandlers(element, false); +} +Sys.UI.DomEvent._clearHandlers = function Sys$UI$DomEvent$_clearHandlers(element, autoRemoving) { + if (element._events) { + var cache = element._events; + for (var name in cache) { + var handlers = cache[name]; + for (var i = handlers.length - 1; i >= 0; i--) { + var entry = handlers[i]; + if (!autoRemoving || entry.autoRemove) { + $removeHandler(element, name, entry.handler); + } + } + } + element._events = null; + } +} +Sys.UI.DomEvent._disposeHandlers = function Sys$UI$DomEvent$_disposeHandlers() { + Sys.UI.DomEvent._clearHandlers(this, true); + var d = this._chainDispose, type = typeof(d); + if (type !== "undefined") { + this.dispose = d; + this._chainDispose = null; + if (type === "function") { + this.dispose(); + } + } +} +var $removeHandler = Sys.UI.DomEvent.removeHandler = function Sys$UI$DomEvent$removeHandler(element, eventName, handler) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element"}, + {name: "eventName", type: String}, + {name: "handler", type: Function} + ]); + if (e) throw e; + Sys.UI.DomEvent._removeHandler(element, eventName, handler); +} +Sys.UI.DomEvent._removeHandler = function Sys$UI$DomEvent$_removeHandler(element, eventName, handler) { + Sys.UI.DomEvent._ensureDomNode(element); + var browserHandler = null; + if ((typeof(element._events) !== 'object') || !element._events) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid); + var cache = element._events[eventName]; + if (!(cache instanceof Array)) throw Error.invalidOperation(Sys.Res.eventHandlerInvalid); + for (var i = 0, l = cache.length; i < l; i++) { + if (cache[i].handler === handler) { + browserHandler = cache[i].browserHandler; + break; + } + } + if (typeof(browserHandler) !== 'function') throw Error.invalidOperation(Sys.Res.eventHandlerInvalid); + if (element.removeEventListener) { + element.removeEventListener(eventName, browserHandler, false); + } + else if (element.detachEvent) { + element.detachEvent('on' + eventName, browserHandler); + } + cache.splice(i, 1); +} +Sys.UI.DomEvent._ensureDomNode = function Sys$UI$DomEvent$_ensureDomNode(element) { + if (element.tagName && (element.tagName.toUpperCase() === "SCRIPT")) return; + + var doc = element.ownerDocument || element.document || element; + if ((typeof(element.document) !== 'object') && (element != doc) && (typeof(element.nodeType) !== 'number')) { + throw Error.argument("element", Sys.Res.argumentDomNode); + } +} + +Sys.UI.DomElement = function Sys$UI$DomElement() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); +} +Sys.UI.DomElement.registerClass('Sys.UI.DomElement'); +Sys.UI.DomElement.addCssClass = function Sys$UI$DomElement$addCssClass(element, className) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "className", type: String} + ]); + if (e) throw e; + if (!Sys.UI.DomElement.containsCssClass(element, className)) { + if (element.className === '') { + element.className = className; + } + else { + element.className += ' ' + className; + } + } +} +Sys.UI.DomElement.containsCssClass = function Sys$UI$DomElement$containsCssClass(element, className) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "className", type: String} + ]); + if (e) throw e; + return Array.contains(element.className.split(' '), className); +} +Sys.UI.DomElement.getBounds = function Sys$UI$DomElement$getBounds(element) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + var offset = Sys.UI.DomElement.getLocation(element); + return new Sys.UI.Bounds(offset.x, offset.y, element.offsetWidth || 0, element.offsetHeight || 0); +} +var $get = Sys.UI.DomElement.getElementById = function Sys$UI$DomElement$getElementById(id, element) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "id", type: String}, + {name: "element", mayBeNull: true, domElement: true, optional: true} + ]); + if (e) throw e; + if (!element) return document.getElementById(id); + if (element.getElementById) return element.getElementById(id); + var nodeQueue = []; + var childNodes = element.childNodes; + for (var i = 0; i < childNodes.length; i++) { + var node = childNodes[i]; + if (node.nodeType == 1) { + nodeQueue[nodeQueue.length] = node; + } + } + while (nodeQueue.length) { + node = nodeQueue.shift(); + if (node.id == id) { + return node; + } + childNodes = node.childNodes; + for (i = 0; i < childNodes.length; i++) { + node = childNodes[i]; + if (node.nodeType == 1) { + nodeQueue[nodeQueue.length] = node; + } + } + } + return null; +} +if (document.documentElement.getBoundingClientRect) { + Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + if (element.self || element.nodeType === 9) return new Sys.UI.Point(0,0); + var clientRect = element.getBoundingClientRect(); + if (!clientRect) { + return new Sys.UI.Point(0,0); + } + var documentElement = element.ownerDocument.documentElement, + offsetX = Math.floor(clientRect.left + 0.5) + documentElement.scrollLeft, + offsetY = Math.floor(clientRect.top + 0.5) + documentElement.scrollTop; + if (Sys.Browser.agent === Sys.Browser.InternetExplorer) { + try { + var f = element.ownerDocument.parentWindow.frameElement || null; + if (f) { + var offset = (f.frameBorder === "0" || f.frameBorder === "no") ? 2 : 0; + offsetX += offset; + offsetY += offset; + } + } + catch(ex) { + } + if (Sys.Browser.version <= 7) { + + var multiplier, before, rect, d = document.createElement("div"); + d.style.cssText = "position:absolute !important;left:0px !important;right:0px !important;height:0px !important;width:1px !important;display:hidden !important"; + try { + before = document.body.childNodes[0]; + document.body.insertBefore(d, before); + rect = d.getBoundingClientRect(); + document.body.removeChild(d); + multiplier = (rect.right - rect.left); + } + catch (e) { + } + if (multiplier && (multiplier !== 1)) { + offsetX = Math.floor(offsetX / multiplier); + offsetY = Math.floor(offsetY / multiplier); + } + } + if ((document.documentMode || 0) < 8) { + offsetX -= 2; + offsetY -= 2; + } + } + return new Sys.UI.Point(offsetX, offsetY); + } +} +else if (Sys.Browser.agent === Sys.Browser.Safari) { + Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + if ((element.window && (element.window === element)) || element.nodeType === 9) return new Sys.UI.Point(0,0); + var offsetX = 0, offsetY = 0, + parent, + previous = null, + previousStyle = null, + currentStyle; + for (parent = element; parent; previous = parent, previousStyle = currentStyle, parent = parent.offsetParent) { + currentStyle = Sys.UI.DomElement._getCurrentStyle(parent); + var tagName = parent.tagName ? parent.tagName.toUpperCase() : null; + if ((parent.offsetLeft || parent.offsetTop) && + ((tagName !== "BODY") || (!previousStyle || previousStyle.position !== "absolute"))) { + offsetX += parent.offsetLeft; + offsetY += parent.offsetTop; + } + if (previous && Sys.Browser.version >= 3) { + offsetX += parseInt(currentStyle.borderLeftWidth); + offsetY += parseInt(currentStyle.borderTopWidth); + } + } + currentStyle = Sys.UI.DomElement._getCurrentStyle(element); + var elementPosition = currentStyle ? currentStyle.position : null; + if (!elementPosition || (elementPosition !== "absolute")) { + for (parent = element.parentNode; parent; parent = parent.parentNode) { + tagName = parent.tagName ? parent.tagName.toUpperCase() : null; + if ((tagName !== "BODY") && (tagName !== "HTML") && (parent.scrollLeft || parent.scrollTop)) { + offsetX -= (parent.scrollLeft || 0); + offsetY -= (parent.scrollTop || 0); + } + currentStyle = Sys.UI.DomElement._getCurrentStyle(parent); + var parentPosition = currentStyle ? currentStyle.position : null; + if (parentPosition && (parentPosition === "absolute")) break; + } + } + return new Sys.UI.Point(offsetX, offsetY); + } +} +else { + Sys.UI.DomElement.getLocation = function Sys$UI$DomElement$getLocation(element) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + if ((element.window && (element.window === element)) || element.nodeType === 9) return new Sys.UI.Point(0,0); + var offsetX = 0, offsetY = 0, + parent, + previous = null, + previousStyle = null, + currentStyle = null; + for (parent = element; parent; previous = parent, previousStyle = currentStyle, parent = parent.offsetParent) { + var tagName = parent.tagName ? parent.tagName.toUpperCase() : null; + currentStyle = Sys.UI.DomElement._getCurrentStyle(parent); + if ((parent.offsetLeft || parent.offsetTop) && + !((tagName === "BODY") && + (!previousStyle || previousStyle.position !== "absolute"))) { + offsetX += parent.offsetLeft; + offsetY += parent.offsetTop; + } + if (previous !== null && currentStyle) { + if ((tagName !== "TABLE") && (tagName !== "TD") && (tagName !== "HTML")) { + offsetX += parseInt(currentStyle.borderLeftWidth) || 0; + offsetY += parseInt(currentStyle.borderTopWidth) || 0; + } + if (tagName === "TABLE" && + (currentStyle.position === "relative" || currentStyle.position === "absolute")) { + offsetX += parseInt(currentStyle.marginLeft) || 0; + offsetY += parseInt(currentStyle.marginTop) || 0; + } + } + } + currentStyle = Sys.UI.DomElement._getCurrentStyle(element); + var elementPosition = currentStyle ? currentStyle.position : null; + if (!elementPosition || (elementPosition !== "absolute")) { + for (parent = element.parentNode; parent; parent = parent.parentNode) { + tagName = parent.tagName ? parent.tagName.toUpperCase() : null; + if ((tagName !== "BODY") && (tagName !== "HTML") && (parent.scrollLeft || parent.scrollTop)) { + offsetX -= (parent.scrollLeft || 0); + offsetY -= (parent.scrollTop || 0); + currentStyle = Sys.UI.DomElement._getCurrentStyle(parent); + if (currentStyle) { + offsetX += parseInt(currentStyle.borderLeftWidth) || 0; + offsetY += parseInt(currentStyle.borderTopWidth) || 0; + } + } + } + } + return new Sys.UI.Point(offsetX, offsetY); + } +} +Sys.UI.DomElement.isDomElement = function Sys$UI$DomElement$isDomElement(obj) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "obj"} + ]); + if (e) throw e; + return Sys._isDomElement(obj); +} +Sys.UI.DomElement.removeCssClass = function Sys$UI$DomElement$removeCssClass(element, className) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "className", type: String} + ]); + if (e) throw e; + var currentClassName = ' ' + element.className + ' '; + var index = currentClassName.indexOf(' ' + className + ' '); + if (index >= 0) { + element.className = (currentClassName.substr(0, index) + ' ' + + currentClassName.substring(index + className.length + 1, currentClassName.length)).trim(); + } +} +Sys.UI.DomElement.resolveElement = function Sys$UI$DomElement$resolveElement(elementOrElementId, containerElement) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "elementOrElementId", mayBeNull: true}, + {name: "containerElement", mayBeNull: true, domElement: true, optional: true} + ]); + if (e) throw e; + var el = elementOrElementId; + if (!el) return null; + if (typeof(el) === "string") { + el = Sys.UI.DomElement.getElementById(el, containerElement); + if (!el) { + throw Error.argument("elementOrElementId", String.format(Sys.Res.elementNotFound, elementOrElementId)); + } + } + else if(!Sys.UI.DomElement.isDomElement(el)) { + throw Error.argument("elementOrElementId", Sys.Res.expectedElementOrId); + } + return el; +} +Sys.UI.DomElement.raiseBubbleEvent = function Sys$UI$DomElement$raiseBubbleEvent(source, args) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "source", domElement: true}, + {name: "args", type: Sys.EventArgs} + ]); + if (e) throw e; + var target = source; + while (target) { + var control = target.control; + if (control && control.onBubbleEvent && control.raiseBubbleEvent) { + Sys.UI.DomElement._raiseBubbleEventFromControl(control, source, args); + return; + } + target = target.parentNode; + } +} +Sys.UI.DomElement._raiseBubbleEventFromControl = function Sys$UI$DomElement$_raiseBubbleEventFromControl(control, source, args) { + if (!control.onBubbleEvent(source, args)) { + control._raiseBubbleEvent(source, args); + } +} +Sys.UI.DomElement.setLocation = function Sys$UI$DomElement$setLocation(element, x, y) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "x", type: Number, integer: true}, + {name: "y", type: Number, integer: true} + ]); + if (e) throw e; + var style = element.style; + style.position = 'absolute'; + style.left = x + "px"; + style.top = y + "px"; +} +Sys.UI.DomElement.toggleCssClass = function Sys$UI$DomElement$toggleCssClass(element, className) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "className", type: String} + ]); + if (e) throw e; + if (Sys.UI.DomElement.containsCssClass(element, className)) { + Sys.UI.DomElement.removeCssClass(element, className); + } + else { + Sys.UI.DomElement.addCssClass(element, className); + } +} +Sys.UI.DomElement.getVisibilityMode = function Sys$UI$DomElement$getVisibilityMode(element) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + return (element._visibilityMode === Sys.UI.VisibilityMode.hide) ? + Sys.UI.VisibilityMode.hide : + Sys.UI.VisibilityMode.collapse; +} +Sys.UI.DomElement.setVisibilityMode = function Sys$UI$DomElement$setVisibilityMode(element, value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "value", type: Sys.UI.VisibilityMode} + ]); + if (e) throw e; + Sys.UI.DomElement._ensureOldDisplayMode(element); + if (element._visibilityMode !== value) { + element._visibilityMode = value; + if (Sys.UI.DomElement.getVisible(element) === false) { + if (element._visibilityMode === Sys.UI.VisibilityMode.hide) { + element.style.display = element._oldDisplayMode; + } + else { + element.style.display = 'none'; + } + } + element._visibilityMode = value; + } +} +Sys.UI.DomElement.getVisible = function Sys$UI$DomElement$getVisible(element) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + var style = element.currentStyle || Sys.UI.DomElement._getCurrentStyle(element); + if (!style) return true; + return (style.visibility !== 'hidden') && (style.display !== 'none'); +} +Sys.UI.DomElement.setVisible = function Sys$UI$DomElement$setVisible(element, value) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "value", type: Boolean} + ]); + if (e) throw e; + if (value !== Sys.UI.DomElement.getVisible(element)) { + Sys.UI.DomElement._ensureOldDisplayMode(element); + element.style.visibility = value ? 'visible' : 'hidden'; + if (value || (element._visibilityMode === Sys.UI.VisibilityMode.hide)) { + element.style.display = element._oldDisplayMode; + } + else { + element.style.display = 'none'; + } + } +} +Sys.UI.DomElement._ensureOldDisplayMode = function Sys$UI$DomElement$_ensureOldDisplayMode(element) { + if (!element._oldDisplayMode) { + var style = element.currentStyle || Sys.UI.DomElement._getCurrentStyle(element); + element._oldDisplayMode = style ? style.display : null; + if (!element._oldDisplayMode || element._oldDisplayMode === 'none') { + switch(element.tagName.toUpperCase()) { + case 'DIV': case 'P': case 'ADDRESS': case 'BLOCKQUOTE': case 'BODY': case 'COL': + case 'COLGROUP': case 'DD': case 'DL': case 'DT': case 'FIELDSET': case 'FORM': + case 'H1': case 'H2': case 'H3': case 'H4': case 'H5': case 'H6': case 'HR': + case 'IFRAME': case 'LEGEND': case 'OL': case 'PRE': case 'TABLE': case 'TD': + case 'TH': case 'TR': case 'UL': + element._oldDisplayMode = 'block'; + break; + case 'LI': + element._oldDisplayMode = 'list-item'; + break; + default: + element._oldDisplayMode = 'inline'; + } + } + } +} +Sys.UI.DomElement._getWindow = function Sys$UI$DomElement$_getWindow(element) { + var doc = element.ownerDocument || element.document || element; + return doc.defaultView || doc.parentWindow; +} +Sys.UI.DomElement._getCurrentStyle = function Sys$UI$DomElement$_getCurrentStyle(element) { + if (element.nodeType === 3) return null; + var w = Sys.UI.DomElement._getWindow(element); + if (element.documentElement) element = element.documentElement; + var computedStyle = (w && (element !== w) && w.getComputedStyle) ? + w.getComputedStyle(element, null) : + element.currentStyle || element.style; + if (!computedStyle && (Sys.Browser.agent === Sys.Browser.Safari) && element.style) { + var oldDisplay = element.style.display; + var oldPosition = element.style.position; + element.style.position = 'absolute'; + element.style.display = 'block'; + var style = w.getComputedStyle(element, null); + element.style.display = oldDisplay; + element.style.position = oldPosition; + computedStyle = {}; + for (var n in style) { + computedStyle[n] = style[n]; + } + computedStyle.display = 'none'; + } + return computedStyle; +} + +Sys.IContainer = function Sys$IContainer() { + throw Error.notImplemented(); +} + function Sys$IContainer$addComponent(component) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "component", type: Sys.Component} + ]); + if (e) throw e; + throw Error.notImplemented(); + } + function Sys$IContainer$removeComponent(component) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "component", type: Sys.Component} + ]); + if (e) throw e; + throw Error.notImplemented(); + } + function Sys$IContainer$findComponent(id) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "id", type: String} + ]); + if (e) throw e; + throw Error.notImplemented(); + } + function Sys$IContainer$getComponents() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } +Sys.IContainer.prototype = { + addComponent: Sys$IContainer$addComponent, + removeComponent: Sys$IContainer$removeComponent, + findComponent: Sys$IContainer$findComponent, + getComponents: Sys$IContainer$getComponents +} +Sys.IContainer.registerInterface("Sys.IContainer"); + +Sys.ApplicationLoadEventArgs = function Sys$ApplicationLoadEventArgs(components, isPartialLoad) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "components", type: Array, elementType: Sys.Component}, + {name: "isPartialLoad", type: Boolean} + ]); + if (e) throw e; + Sys.ApplicationLoadEventArgs.initializeBase(this); + this._components = components; + this._isPartialLoad = isPartialLoad; +} + + function Sys$ApplicationLoadEventArgs$get_components() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._components; + } + function Sys$ApplicationLoadEventArgs$get_isPartialLoad() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._isPartialLoad; + } +Sys.ApplicationLoadEventArgs.prototype = { + get_components: Sys$ApplicationLoadEventArgs$get_components, + get_isPartialLoad: Sys$ApplicationLoadEventArgs$get_isPartialLoad +} +Sys.ApplicationLoadEventArgs.registerClass('Sys.ApplicationLoadEventArgs', Sys.EventArgs); + +Sys._Application = function Sys$_Application() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + Sys._Application.initializeBase(this); + this._disposableObjects = []; + this._components = {}; + this._createdComponents = []; + this._secondPassComponents = []; + this._unloadHandlerDelegate = Function.createDelegate(this, this._unloadHandler); + Sys.UI.DomEvent.addHandler(window, "unload", this._unloadHandlerDelegate); + this._domReady(); +} + function Sys$_Application$get_isCreatingComponents() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._creatingComponents; + } + function Sys$_Application$get_isDisposing() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._disposing; + } + function Sys$_Application$add_init(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + if (this._initialized) { + handler(this, Sys.EventArgs.Empty); + } + else { + this.get_events().addHandler("init", handler); + } + } + function Sys$_Application$remove_init(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().removeHandler("init", handler); + } + function Sys$_Application$add_load(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().addHandler("load", handler); + } + function Sys$_Application$remove_load(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().removeHandler("load", handler); + } + function Sys$_Application$add_unload(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().addHandler("unload", handler); + } + function Sys$_Application$remove_unload(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this.get_events().removeHandler("unload", handler); + } + function Sys$_Application$addComponent(component) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "component", type: Sys.Component} + ]); + if (e) throw e; + var id = component.get_id(); + if (!id) throw Error.invalidOperation(Sys.Res.cantAddWithoutId); + if (typeof(this._components[id]) !== 'undefined') throw Error.invalidOperation(String.format(Sys.Res.appDuplicateComponent, id)); + this._components[id] = component; + } + function Sys$_Application$beginCreateComponents() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._creatingComponents = true; + } + function Sys$_Application$dispose() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._disposing) { + this._disposing = true; + if (this._timerCookie) { + window.clearTimeout(this._timerCookie); + delete this._timerCookie; + } + if (this._endRequestHandler) { + Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler); + delete this._endRequestHandler; + } + if (this._beginRequestHandler) { + Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler); + delete this._beginRequestHandler; + } + if (window.pageUnload) { + window.pageUnload(this, Sys.EventArgs.Empty); + } + var unloadHandler = this.get_events().getHandler("unload"); + if (unloadHandler) { + unloadHandler(this, Sys.EventArgs.Empty); + } + var disposableObjects = Array.clone(this._disposableObjects); + for (var i = 0, l = disposableObjects.length; i < l; i++) { + var object = disposableObjects[i]; + if (typeof(object) !== "undefined") { + object.dispose(); + } + } + Array.clear(this._disposableObjects); + Sys.UI.DomEvent.removeHandler(window, "unload", this._unloadHandlerDelegate); + if (Sys._ScriptLoader) { + var sl = Sys._ScriptLoader.getInstance(); + if(sl) { + sl.dispose(); + } + } + Sys._Application.callBaseMethod(this, 'dispose'); + } + } + function Sys$_Application$disposeElement(element, childNodesOnly) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element"}, + {name: "childNodesOnly", type: Boolean} + ]); + if (e) throw e; + if (element.nodeType === 1) { + var children = element.getElementsByTagName("*"); + for (var i = children.length - 1; i >= 0; i--) { + this._disposeElementInternal(children[i]); + } + if (!childNodesOnly) { + this._disposeElementInternal(element); + } + } + } + function Sys$_Application$endCreateComponents() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + var components = this._secondPassComponents; + for (var i = 0, l = components.length; i < l; i++) { + var component = components[i].component; + Sys$Component$_setReferences(component, components[i].references); + component.endUpdate(); + } + this._secondPassComponents = []; + this._creatingComponents = false; + } + function Sys$_Application$findComponent(id, parent) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "id", type: String}, + {name: "parent", mayBeNull: true, optional: true} + ]); + if (e) throw e; + return (parent ? + ((Sys.IContainer.isInstanceOfType(parent)) ? + parent.findComponent(id) : + parent[id] || null) : + Sys.Application._components[id] || null); + } + function Sys$_Application$getComponents() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + var res = []; + var components = this._components; + for (var name in components) { + res[res.length] = components[name]; + } + return res; + } + function Sys$_Application$initialize() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if(!this.get_isInitialized() && !this._disposing) { + Sys._Application.callBaseMethod(this, 'initialize'); + this._raiseInit(); + if (this.get_stateString) { + if (Sys.WebForms && Sys.WebForms.PageRequestManager) { + this._beginRequestHandler = Function.createDelegate(this, this._onPageRequestManagerBeginRequest); + Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(this._beginRequestHandler); + this._endRequestHandler = Function.createDelegate(this, this._onPageRequestManagerEndRequest); + Sys.WebForms.PageRequestManager.getInstance().add_endRequest(this._endRequestHandler); + } + var loadedEntry = this.get_stateString(); + if (loadedEntry !== this._currentEntry) { + this._navigate(loadedEntry); + } + else { + this._ensureHistory(); + } + } + this.raiseLoad(); + } + } + function Sys$_Application$notifyScriptLoaded() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + } + function Sys$_Application$registerDisposableObject(object) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "object", type: Sys.IDisposable} + ]); + if (e) throw e; + if (!this._disposing) { + var objects = this._disposableObjects, + i = objects.length; + objects[i] = object; + object.__msdisposeindex = i; + } + } + function Sys$_Application$raiseLoad() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + var h = this.get_events().getHandler("load"); + var args = new Sys.ApplicationLoadEventArgs(Array.clone(this._createdComponents), !!this._loaded); + this._loaded = true; + if (h) { + h(this, args); + } + if (window.pageLoad) { + window.pageLoad(this, args); + } + this._createdComponents = []; + } + function Sys$_Application$removeComponent(component) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "component", type: Sys.Component} + ]); + if (e) throw e; + var id = component.get_id(); + if (id) delete this._components[id]; + } + function Sys$_Application$unregisterDisposableObject(object) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "object", type: Sys.IDisposable} + ]); + if (e) throw e; + if (!this._disposing) { + var i = object.__msdisposeindex; + if (typeof(i) === "number") { + var disposableObjects = this._disposableObjects; + delete disposableObjects[i]; + delete object.__msdisposeindex; + if (++this._deleteCount > 1000) { + var newArray = []; + for (var j = 0, l = disposableObjects.length; j < l; j++) { + object = disposableObjects[j]; + if (typeof(object) !== "undefined") { + object.__msdisposeindex = newArray.length; + newArray.push(object); + } + } + this._disposableObjects = newArray; + this._deleteCount = 0; + } + } + } + } + function Sys$_Application$_addComponentToSecondPass(component, references) { + this._secondPassComponents[this._secondPassComponents.length] = {component: component, references: references}; + } + function Sys$_Application$_disposeComponents(list) { + if (list) { + for (var i = list.length - 1; i >= 0; i--) { + var item = list[i]; + if (typeof(item.dispose) === "function") { + item.dispose(); + } + } + } + } + function Sys$_Application$_disposeElementInternal(element) { + var d = element.dispose; + if (d && typeof(d) === "function") { + element.dispose(); + } + else { + var c = element.control; + if (c && typeof(c.dispose) === "function") { + c.dispose(); + } + } + var list = element._behaviors; + if (list) { + this._disposeComponents(list); + } + list = element._components; + if (list) { + this._disposeComponents(list); + element._components = null; + } + } + function Sys$_Application$_domReady() { + var check, er, app = this; + function init() { app.initialize(); } + var onload = function() { + Sys.UI.DomEvent.removeHandler(window, "load", onload); + init(); + } + Sys.UI.DomEvent.addHandler(window, "load", onload); + + if (document.addEventListener) { + try { + document.addEventListener("DOMContentLoaded", check = function() { + document.removeEventListener("DOMContentLoaded", check, false); + init(); + }, false); + } + catch (er) { } + } + else if (document.attachEvent) { + if ((window == window.top) && document.documentElement.doScroll) { + var timeout, el = document.createElement("div"); + check = function() { + try { + el.doScroll("left"); + } + catch (er) { + timeout = window.setTimeout(check, 0); + return; + } + el = null; + init(); + } + check(); + } + else { + document.attachEvent("onreadystatechange", check = function() { + if (document.readyState === "complete") { + document.detachEvent("onreadystatechange", check); + init(); + } + }); + } + } + } + function Sys$_Application$_raiseInit() { + var handler = this.get_events().getHandler("init"); + if (handler) { + this.beginCreateComponents(); + handler(this, Sys.EventArgs.Empty); + this.endCreateComponents(); + } + } + function Sys$_Application$_unloadHandler(event) { + this.dispose(); + } +Sys._Application.prototype = { + _creatingComponents: false, + _disposing: false, + _deleteCount: 0, + get_isCreatingComponents: Sys$_Application$get_isCreatingComponents, + get_isDisposing: Sys$_Application$get_isDisposing, + add_init: Sys$_Application$add_init, + remove_init: Sys$_Application$remove_init, + add_load: Sys$_Application$add_load, + remove_load: Sys$_Application$remove_load, + add_unload: Sys$_Application$add_unload, + remove_unload: Sys$_Application$remove_unload, + addComponent: Sys$_Application$addComponent, + beginCreateComponents: Sys$_Application$beginCreateComponents, + dispose: Sys$_Application$dispose, + disposeElement: Sys$_Application$disposeElement, + endCreateComponents: Sys$_Application$endCreateComponents, + findComponent: Sys$_Application$findComponent, + getComponents: Sys$_Application$getComponents, + initialize: Sys$_Application$initialize, + notifyScriptLoaded: Sys$_Application$notifyScriptLoaded, + registerDisposableObject: Sys$_Application$registerDisposableObject, + raiseLoad: Sys$_Application$raiseLoad, + removeComponent: Sys$_Application$removeComponent, + unregisterDisposableObject: Sys$_Application$unregisterDisposableObject, + _addComponentToSecondPass: Sys$_Application$_addComponentToSecondPass, + _disposeComponents: Sys$_Application$_disposeComponents, + _disposeElementInternal: Sys$_Application$_disposeElementInternal, + _domReady: Sys$_Application$_domReady, + _raiseInit: Sys$_Application$_raiseInit, + _unloadHandler: Sys$_Application$_unloadHandler +} +Sys._Application.registerClass('Sys._Application', Sys.Component, Sys.IContainer); +Sys.Application = new Sys._Application(); +var $find = Sys.Application.findComponent; + +Sys.UI.Behavior = function Sys$UI$Behavior(element) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + Sys.UI.Behavior.initializeBase(this); + this._element = element; + var behaviors = element._behaviors; + if (!behaviors) { + element._behaviors = [this]; + } + else { + behaviors[behaviors.length] = this; + } +} + function Sys$UI$Behavior$get_element() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._element; + } + function Sys$UI$Behavior$get_id() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + var baseId = Sys.UI.Behavior.callBaseMethod(this, 'get_id'); + if (baseId) return baseId; + if (!this._element || !this._element.id) return ''; + return this._element.id + '$' + this.get_name(); + } + function Sys$UI$Behavior$get_name() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this._name) return this._name; + var name = Object.getTypeName(this); + var i = name.lastIndexOf('.'); + if (i !== -1) name = name.substr(i + 1); + if (!this.get_isInitialized()) this._name = name; + return name; + } + function Sys$UI$Behavior$set_name(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + if ((value === '') || (value.charAt(0) === ' ') || (value.charAt(value.length - 1) === ' ')) + throw Error.argument('value', Sys.Res.invalidId); + if (typeof(this._element[value]) !== 'undefined') + throw Error.invalidOperation(String.format(Sys.Res.behaviorDuplicateName, value)); + if (this.get_isInitialized()) throw Error.invalidOperation(Sys.Res.cantSetNameAfterInit); + this._name = value; + } + function Sys$UI$Behavior$initialize() { + Sys.UI.Behavior.callBaseMethod(this, 'initialize'); + var name = this.get_name(); + if (name) this._element[name] = this; + } + function Sys$UI$Behavior$dispose() { + Sys.UI.Behavior.callBaseMethod(this, 'dispose'); + var e = this._element; + if (e) { + var name = this.get_name(); + if (name) { + e[name] = null; + } + var behaviors = e._behaviors; + Array.remove(behaviors, this); + if (behaviors.length === 0) { + e._behaviors = null; + } + delete this._element; + } + } +Sys.UI.Behavior.prototype = { + _name: null, + get_element: Sys$UI$Behavior$get_element, + get_id: Sys$UI$Behavior$get_id, + get_name: Sys$UI$Behavior$get_name, + set_name: Sys$UI$Behavior$set_name, + initialize: Sys$UI$Behavior$initialize, + dispose: Sys$UI$Behavior$dispose +} +Sys.UI.Behavior.registerClass('Sys.UI.Behavior', Sys.Component); +Sys.UI.Behavior.getBehaviorByName = function Sys$UI$Behavior$getBehaviorByName(element, name) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "name", type: String} + ]); + if (e) throw e; + var b = element[name]; + return (b && Sys.UI.Behavior.isInstanceOfType(b)) ? b : null; +} +Sys.UI.Behavior.getBehaviors = function Sys$UI$Behavior$getBehaviors(element) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + if (!element._behaviors) return []; + return Array.clone(element._behaviors); +} +Sys.UI.Behavior.getBehaviorsByType = function Sys$UI$Behavior$getBehaviorsByType(element, type) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true}, + {name: "type", type: Type} + ]); + if (e) throw e; + var behaviors = element._behaviors; + var results = []; + if (behaviors) { + for (var i = 0, l = behaviors.length; i < l; i++) { + if (type.isInstanceOfType(behaviors[i])) { + results[results.length] = behaviors[i]; + } + } + } + return results; +} + +Sys.UI.VisibilityMode = function Sys$UI$VisibilityMode() { + /// + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); +} +Sys.UI.VisibilityMode.prototype = { + hide: 0, + collapse: 1 +} +Sys.UI.VisibilityMode.registerEnum("Sys.UI.VisibilityMode"); + +Sys.UI.Control = function Sys$UI$Control(element) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "element", domElement: true} + ]); + if (e) throw e; + if (typeof(element.control) !== 'undefined') throw Error.invalidOperation(Sys.Res.controlAlreadyDefined); + Sys.UI.Control.initializeBase(this); + this._element = element; + element.control = this; + var role = this.get_role(); + if (role) { + element.setAttribute("role", role); + } +} + function Sys$UI$Control$get_element() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._element; + } + function Sys$UI$Control$get_id() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._element) return ''; + return this._element.id; + } + function Sys$UI$Control$set_id(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + throw Error.invalidOperation(Sys.Res.cantSetId); + } + function Sys$UI$Control$get_parent() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this._parent) return this._parent; + if (!this._element) return null; + + var parentElement = this._element.parentNode; + while (parentElement) { + if (parentElement.control) { + return parentElement.control; + } + parentElement = parentElement.parentNode; + } + return null; + } + function Sys$UI$Control$set_parent(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Sys.UI.Control}]); + if (e) throw e; + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + var parents = [this]; + var current = value; + while (current) { + if (Array.contains(parents, current)) throw Error.invalidOperation(Sys.Res.circularParentChain); + parents[parents.length] = current; + current = current.get_parent(); + } + this._parent = value; + } + function Sys$UI$Control$get_role() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return null; + } + function Sys$UI$Control$get_visibilityMode() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + return Sys.UI.DomElement.getVisibilityMode(this._element); + } + function Sys$UI$Control$set_visibilityMode(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Sys.UI.VisibilityMode}]); + if (e) throw e; + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + Sys.UI.DomElement.setVisibilityMode(this._element, value); + } + function Sys$UI$Control$get_visible() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + return Sys.UI.DomElement.getVisible(this._element); + } + function Sys$UI$Control$set_visible(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]); + if (e) throw e; + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + Sys.UI.DomElement.setVisible(this._element, value) + } + function Sys$UI$Control$addCssClass(className) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "className", type: String} + ]); + if (e) throw e; + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + Sys.UI.DomElement.addCssClass(this._element, className); + } + function Sys$UI$Control$dispose() { + Sys.UI.Control.callBaseMethod(this, 'dispose'); + if (this._element) { + this._element.control = null; + delete this._element; + } + if (this._parent) delete this._parent; + } + function Sys$UI$Control$onBubbleEvent(source, args) { + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "source"}, + {name: "args", type: Sys.EventArgs} + ]); + if (e) throw e; + return false; + } + function Sys$UI$Control$raiseBubbleEvent(source, args) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "source"}, + {name: "args", type: Sys.EventArgs} + ]); + if (e) throw e; + this._raiseBubbleEvent(source, args); + } + function Sys$UI$Control$_raiseBubbleEvent(source, args) { + var currentTarget = this.get_parent(); + while (currentTarget) { + if (currentTarget.onBubbleEvent(source, args)) { + return; + } + currentTarget = currentTarget.get_parent(); + } + } + function Sys$UI$Control$removeCssClass(className) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "className", type: String} + ]); + if (e) throw e; + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + Sys.UI.DomElement.removeCssClass(this._element, className); + } + function Sys$UI$Control$toggleCssClass(className) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "className", type: String} + ]); + if (e) throw e; + if (!this._element) throw Error.invalidOperation(Sys.Res.cantBeCalledAfterDispose); + Sys.UI.DomElement.toggleCssClass(this._element, className); + } +Sys.UI.Control.prototype = { + _parent: null, + _visibilityMode: Sys.UI.VisibilityMode.hide, + get_element: Sys$UI$Control$get_element, + get_id: Sys$UI$Control$get_id, + set_id: Sys$UI$Control$set_id, + get_parent: Sys$UI$Control$get_parent, + set_parent: Sys$UI$Control$set_parent, + get_role: Sys$UI$Control$get_role, + get_visibilityMode: Sys$UI$Control$get_visibilityMode, + set_visibilityMode: Sys$UI$Control$set_visibilityMode, + get_visible: Sys$UI$Control$get_visible, + set_visible: Sys$UI$Control$set_visible, + addCssClass: Sys$UI$Control$addCssClass, + dispose: Sys$UI$Control$dispose, + onBubbleEvent: Sys$UI$Control$onBubbleEvent, + raiseBubbleEvent: Sys$UI$Control$raiseBubbleEvent, + _raiseBubbleEvent: Sys$UI$Control$_raiseBubbleEvent, + removeCssClass: Sys$UI$Control$removeCssClass, + toggleCssClass: Sys$UI$Control$toggleCssClass +} +Sys.UI.Control.registerClass('Sys.UI.Control', Sys.Component); +Sys.HistoryEventArgs = function Sys$HistoryEventArgs(state) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "state", type: Object} + ]); + if (e) throw e; + Sys.HistoryEventArgs.initializeBase(this); + this._state = state; +} + function Sys$HistoryEventArgs$get_state() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._state; + } +Sys.HistoryEventArgs.prototype = { + get_state: Sys$HistoryEventArgs$get_state +} +Sys.HistoryEventArgs.registerClass('Sys.HistoryEventArgs', Sys.EventArgs); +Sys.Application._appLoadHandler = null; +Sys.Application._beginRequestHandler = null; +Sys.Application._clientId = null; +Sys.Application._currentEntry = ''; +Sys.Application._endRequestHandler = null; +Sys.Application._history = null; +Sys.Application._enableHistory = false; +Sys.Application._historyEnabledInScriptManager = false; +Sys.Application._historyFrame = null; +Sys.Application._historyInitialized = false; +Sys.Application._historyPointIsNew = false; +Sys.Application._ignoreTimer = false; +Sys.Application._initialState = null; +Sys.Application._state = {}; +Sys.Application._timerCookie = 0; +Sys.Application._timerHandler = null; +Sys.Application._uniqueId = null; +Sys._Application.prototype.get_stateString = function Sys$_Application$get_stateString() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + var hash = null; + + if (Sys.Browser.agent === Sys.Browser.Firefox) { + var href = window.location.href; + var hashIndex = href.indexOf('#'); + if (hashIndex !== -1) { + hash = href.substring(hashIndex + 1); + } + else { + hash = ""; + } + return hash; + } + else { + hash = window.location.hash; + } + + if ((hash.length > 0) && (hash.charAt(0) === '#')) { + hash = hash.substring(1); + } + return hash; +}; +Sys._Application.prototype.get_enableHistory = function Sys$_Application$get_enableHistory() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._enableHistory; +}; +Sys._Application.prototype.set_enableHistory = function Sys$_Application$set_enableHistory(value) { + if (this._initialized && !this._initializing) { + throw Error.invalidOperation(Sys.Res.historyCannotEnableHistory); + } + else if (this._historyEnabledInScriptManager && !value) { + throw Error.invalidOperation(Sys.Res.invalidHistorySettingCombination); + } + this._enableHistory = value; +}; +Sys._Application.prototype.add_navigate = function Sys$_Application$add_navigate(handler) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "handler", type: Function} + ]); + if (e) throw e; + this.get_events().addHandler("navigate", handler); +}; +Sys._Application.prototype.remove_navigate = function Sys$_Application$remove_navigate(handler) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "handler", type: Function} + ]); + if (e) throw e; + this.get_events().removeHandler("navigate", handler); +}; +Sys._Application.prototype.addHistoryPoint = function Sys$_Application$addHistoryPoint(state, title) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "state", type: Object}, + {name: "title", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + if (!this._enableHistory) throw Error.invalidOperation(Sys.Res.historyCannotAddHistoryPointWithHistoryDisabled); + for (var n in state) { + var v = state[n]; + var t = typeof(v); + if ((v !== null) && ((t === 'object') || (t === 'function') || (t === 'undefined'))) { + throw Error.argument('state', Sys.Res.stateMustBeStringDictionary); + } + } + this._ensureHistory(); + var initialState = this._state; + for (var key in state) { + var value = state[key]; + if (value === null) { + if (typeof(initialState[key]) !== 'undefined') { + delete initialState[key]; + } + } + else { + initialState[key] = value; + } + } + var entry = this._serializeState(initialState); + this._historyPointIsNew = true; + this._setState(entry, title); + this._raiseNavigate(); +}; +Sys._Application.prototype.setServerId = function Sys$_Application$setServerId(clientId, uniqueId) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "clientId", type: String}, + {name: "uniqueId", type: String} + ]); + if (e) throw e; + this._clientId = clientId; + this._uniqueId = uniqueId; +}; +Sys._Application.prototype.setServerState = function Sys$_Application$setServerState(value) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "value", type: String} + ]); + if (e) throw e; + this._ensureHistory(); + this._state.__s = value; + this._updateHiddenField(value); +}; +Sys._Application.prototype._deserializeState = function Sys$_Application$_deserializeState(entry) { + var result = {}; + entry = entry || ''; + var serverSeparator = entry.indexOf('&&'); + if ((serverSeparator !== -1) && (serverSeparator + 2 < entry.length)) { + result.__s = entry.substr(serverSeparator + 2); + entry = entry.substr(0, serverSeparator); + } + var tokens = entry.split('&'); + for (var i = 0, l = tokens.length; i < l; i++) { + var token = tokens[i]; + var equal = token.indexOf('='); + if ((equal !== -1) && (equal + 1 < token.length)) { + var name = token.substr(0, equal); + var value = token.substr(equal + 1); + result[name] = decodeURIComponent(value); + } + } + return result; +}; +Sys._Application.prototype._enableHistoryInScriptManager = function Sys$_Application$_enableHistoryInScriptManager() { + this._enableHistory = true; + this._historyEnabledInScriptManager = true; +}; +Sys._Application.prototype._ensureHistory = function Sys$_Application$_ensureHistory() { + if (!this._historyInitialized && this._enableHistory) { + if ((Sys.Browser.agent === Sys.Browser.InternetExplorer) && (Sys.Browser.documentMode < 8)) { + this._historyFrame = document.getElementById('__historyFrame'); + if (!this._historyFrame) throw Error.invalidOperation(Sys.Res.historyMissingFrame); + this._ignoreIFrame = true; + } + this._timerHandler = Function.createDelegate(this, this._onIdle); + this._timerCookie = window.setTimeout(this._timerHandler, 100); + + try { + this._initialState = this._deserializeState(this.get_stateString()); + } catch(e) {} + + this._historyInitialized = true; + } +}; +Sys._Application.prototype._navigate = function Sys$_Application$_navigate(entry) { + this._ensureHistory(); + var state = this._deserializeState(entry); + + if (this._uniqueId) { + var oldServerEntry = this._state.__s || ''; + var newServerEntry = state.__s || ''; + if (newServerEntry !== oldServerEntry) { + this._updateHiddenField(newServerEntry); + __doPostBack(this._uniqueId, newServerEntry); + this._state = state; + return; + } + } + this._setState(entry); + this._state = state; + this._raiseNavigate(); +}; +Sys._Application.prototype._onIdle = function Sys$_Application$_onIdle() { + delete this._timerCookie; + + var entry = this.get_stateString(); + if (entry !== this._currentEntry) { + if (!this._ignoreTimer) { + this._historyPointIsNew = false; + this._navigate(entry); + } + } + else { + this._ignoreTimer = false; + } + this._timerCookie = window.setTimeout(this._timerHandler, 100); +}; +Sys._Application.prototype._onIFrameLoad = function Sys$_Application$_onIFrameLoad(entry) { + this._ensureHistory(); + if (!this._ignoreIFrame) { + this._historyPointIsNew = false; + this._navigate(entry); + } + this._ignoreIFrame = false; +}; +Sys._Application.prototype._onPageRequestManagerBeginRequest = function Sys$_Application$_onPageRequestManagerBeginRequest(sender, args) { + this._ignoreTimer = true; +}; +Sys._Application.prototype._onPageRequestManagerEndRequest = function Sys$_Application$_onPageRequestManagerEndRequest(sender, args) { + var dataItem = args.get_dataItems()[this._clientId]; + var eventTarget = document.getElementById("__EVENTTARGET"); + if (eventTarget && eventTarget.value === this._uniqueId) { + eventTarget.value = ''; + } + if (typeof(dataItem) !== 'undefined') { + this.setServerState(dataItem); + this._historyPointIsNew = true; + } + else { + this._ignoreTimer = false; + } + var entry = this._serializeState(this._state); + if (entry !== this._currentEntry) { + this._ignoreTimer = true; + this._setState(entry); + this._raiseNavigate(); + } +}; +Sys._Application.prototype._raiseNavigate = function Sys$_Application$_raiseNavigate() { + var h = this.get_events().getHandler("navigate"); + var stateClone = {}; + for (var key in this._state) { + if (key !== '__s') { + stateClone[key] = this._state[key]; + } + } + var args = new Sys.HistoryEventArgs(stateClone); + if (h) { + h(this, args); + } + var err; + try { + if ((Sys.Browser.agent === Sys.Browser.Firefox) && window.location.hash && + (!window.frameElement || window.top.location.hash)) { + window.history.go(0); + } + } + catch(err) { + } +}; +Sys._Application.prototype._serializeState = function Sys$_Application$_serializeState(state) { + var serialized = []; + for (var key in state) { + var value = state[key]; + if (key === '__s') { + var serverState = value; + } + else { + if (key.indexOf('=') !== -1) throw Error.argument('state', Sys.Res.stateFieldNameInvalid); + serialized[serialized.length] = key + '=' + encodeURIComponent(value); + } + } + return serialized.join('&') + (serverState ? '&&' + serverState : ''); +}; +Sys._Application.prototype._setState = function Sys$_Application$_setState(entry, title) { + if (this._enableHistory) { + entry = entry || ''; + if (entry !== this._currentEntry) { + if (window.theForm) { + var action = window.theForm.action; + var hashIndex = action.indexOf('#'); + window.theForm.action = ((hashIndex !== -1) ? action.substring(0, hashIndex) : action) + '#' + entry; + } + + if (this._historyFrame && this._historyPointIsNew) { + this._ignoreIFrame = true; + var frameDoc = this._historyFrame.contentWindow.document; + frameDoc.open("javascript:''"); + frameDoc.write("" + (title || document.title) + + "parent.Sys.Application._onIFrameLoad(" + + Sys.Serialization.JavaScriptSerializer.serialize(entry) + + ");"); + frameDoc.close(); + } + this._ignoreTimer = false; + this._currentEntry = entry; + if (this._historyFrame || this._historyPointIsNew) { + var currentHash = this.get_stateString(); + if (entry !== currentHash) { + var loc = document.location; + if (loc.href.length - loc.hash.length + entry.length > 1024) { + throw Error.invalidOperation(Sys.Res.urlMustBeLessThan1024chars); + } + window.location.hash = entry; + this._currentEntry = this.get_stateString(); + if ((typeof(title) !== 'undefined') && (title !== null)) { + document.title = title; + } + } + } + this._historyPointIsNew = false; + } + } +}; +Sys._Application.prototype._updateHiddenField = function Sys$_Application$_updateHiddenField(value) { + if (this._clientId) { + var serverStateField = document.getElementById(this._clientId); + if (serverStateField) { + serverStateField.value = value; + } + } +}; + +if (!window.XMLHttpRequest) { + window.XMLHttpRequest = function window$XMLHttpRequest() { + var progIDs = [ 'Msxml2.XMLHTTP.3.0', 'Msxml2.XMLHTTP' ]; + for (var i = 0, l = progIDs.length; i < l; i++) { + try { + return new ActiveXObject(progIDs[i]); + } + catch (ex) { + } + } + return null; + } +} +Type.registerNamespace('Sys.Net'); + +Sys.Net.WebRequestExecutor = function Sys$Net$WebRequestExecutor() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._webRequest = null; + this._resultObject = null; +} + function Sys$Net$WebRequestExecutor$get_webRequest() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._webRequest; + } + function Sys$Net$WebRequestExecutor$_set_webRequest(value) { + if (this.get_started()) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOnceStarted, 'set_webRequest')); + } + this._webRequest = value; + } + function Sys$Net$WebRequestExecutor$get_started() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_responseAvailable() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_timedOut() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_aborted() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_responseData() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_statusCode() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_statusText() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_xml() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$get_object() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._resultObject) { + this._resultObject = Sys.Serialization.JavaScriptSerializer.deserialize(this.get_responseData()); + } + return this._resultObject; + } + function Sys$Net$WebRequestExecutor$executeRequest() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$abort() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$getResponseHeader(header) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "header", type: String} + ]); + if (e) throw e; + throw Error.notImplemented(); + } + function Sys$Net$WebRequestExecutor$getAllResponseHeaders() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + throw Error.notImplemented(); + } +Sys.Net.WebRequestExecutor.prototype = { + get_webRequest: Sys$Net$WebRequestExecutor$get_webRequest, + _set_webRequest: Sys$Net$WebRequestExecutor$_set_webRequest, + get_started: Sys$Net$WebRequestExecutor$get_started, + get_responseAvailable: Sys$Net$WebRequestExecutor$get_responseAvailable, + get_timedOut: Sys$Net$WebRequestExecutor$get_timedOut, + get_aborted: Sys$Net$WebRequestExecutor$get_aborted, + get_responseData: Sys$Net$WebRequestExecutor$get_responseData, + get_statusCode: Sys$Net$WebRequestExecutor$get_statusCode, + get_statusText: Sys$Net$WebRequestExecutor$get_statusText, + get_xml: Sys$Net$WebRequestExecutor$get_xml, + get_object: Sys$Net$WebRequestExecutor$get_object, + executeRequest: Sys$Net$WebRequestExecutor$executeRequest, + abort: Sys$Net$WebRequestExecutor$abort, + getResponseHeader: Sys$Net$WebRequestExecutor$getResponseHeader, + getAllResponseHeaders: Sys$Net$WebRequestExecutor$getAllResponseHeaders +} +Sys.Net.WebRequestExecutor.registerClass('Sys.Net.WebRequestExecutor'); + +Sys.Net.XMLDOM = function Sys$Net$XMLDOM(markup) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "markup", type: String} + ]); + if (e) throw e; + if (!window.DOMParser) { + var progIDs = [ 'Msxml2.DOMDocument.3.0', 'Msxml2.DOMDocument' ]; + for (var i = 0, l = progIDs.length; i < l; i++) { + try { + var xmlDOM = new ActiveXObject(progIDs[i]); + xmlDOM.async = false; + xmlDOM.loadXML(markup); + xmlDOM.setProperty('SelectionLanguage', 'XPath'); + return xmlDOM; + } + catch (ex) { + } + } + } + else { + try { + var domParser = new window.DOMParser(); + return domParser.parseFromString(markup, 'text/xml'); + } + catch (ex) { + } + } + return null; +} +Sys.Net.XMLHttpExecutor = function Sys$Net$XMLHttpExecutor() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + Sys.Net.XMLHttpExecutor.initializeBase(this); + var _this = this; + this._xmlHttpRequest = null; + this._webRequest = null; + this._responseAvailable = false; + this._timedOut = false; + this._timer = null; + this._aborted = false; + this._started = false; + this._onReadyStateChange = (function () { + + if (_this._xmlHttpRequest.readyState === 4 ) { + try { + if (typeof(_this._xmlHttpRequest.status) === "undefined") { + return; + } + } + catch(ex) { + return; + } + + _this._clearTimer(); + _this._responseAvailable = true; + _this._webRequest.completed(Sys.EventArgs.Empty); + if (_this._xmlHttpRequest != null) { + _this._xmlHttpRequest.onreadystatechange = Function.emptyMethod; + _this._xmlHttpRequest = null; + } + } + }); + this._clearTimer = (function() { + if (_this._timer != null) { + window.clearTimeout(_this._timer); + _this._timer = null; + } + }); + this._onTimeout = (function() { + if (!_this._responseAvailable) { + _this._clearTimer(); + _this._timedOut = true; + _this._xmlHttpRequest.onreadystatechange = Function.emptyMethod; + _this._xmlHttpRequest.abort(); + _this._webRequest.completed(Sys.EventArgs.Empty); + _this._xmlHttpRequest = null; + } + }); +} + function Sys$Net$XMLHttpExecutor$get_timedOut() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._timedOut; + } + function Sys$Net$XMLHttpExecutor$get_started() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._started; + } + function Sys$Net$XMLHttpExecutor$get_responseAvailable() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._responseAvailable; + } + function Sys$Net$XMLHttpExecutor$get_aborted() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._aborted; + } + function Sys$Net$XMLHttpExecutor$executeRequest() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._webRequest = this.get_webRequest(); + if (this._started) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOnceStarted, 'executeRequest')); + } + if (this._webRequest === null) { + throw Error.invalidOperation(Sys.Res.nullWebRequest); + } + var body = this._webRequest.get_body(); + var headers = this._webRequest.get_headers(); + this._xmlHttpRequest = new XMLHttpRequest(); + this._xmlHttpRequest.onreadystatechange = this._onReadyStateChange; + var verb = this._webRequest.get_httpVerb(); + this._xmlHttpRequest.open(verb, this._webRequest.getResolvedUrl(), true ); + this._xmlHttpRequest.setRequestHeader("X-Requested-With", "XMLHttpRequest"); + if (headers) { + for (var header in headers) { + var val = headers[header]; + if (typeof(val) !== "function") + this._xmlHttpRequest.setRequestHeader(header, val); + } + } + if (verb.toLowerCase() === "post") { + if ((headers === null) || !headers['Content-Type']) { + this._xmlHttpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=utf-8'); + } + if (!body) { + body = ""; + } + } + var timeout = this._webRequest.get_timeout(); + if (timeout > 0) { + this._timer = window.setTimeout(Function.createDelegate(this, this._onTimeout), timeout); + } + this._xmlHttpRequest.send(body); + this._started = true; + } + function Sys$Net$XMLHttpExecutor$getResponseHeader(header) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "header", type: String} + ]); + if (e) throw e; + if (!this._responseAvailable) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'getResponseHeader')); + } + if (!this._xmlHttpRequest) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'getResponseHeader')); + } + var result; + try { + result = this._xmlHttpRequest.getResponseHeader(header); + } catch (e) { + } + if (!result) result = ""; + return result; + } + function Sys$Net$XMLHttpExecutor$getAllResponseHeaders() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._responseAvailable) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'getAllResponseHeaders')); + } + if (!this._xmlHttpRequest) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'getAllResponseHeaders')); + } + return this._xmlHttpRequest.getAllResponseHeaders(); + } + function Sys$Net$XMLHttpExecutor$get_responseData() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._responseAvailable) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_responseData')); + } + if (!this._xmlHttpRequest) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_responseData')); + } + return this._xmlHttpRequest.responseText; + } + function Sys$Net$XMLHttpExecutor$get_statusCode() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._responseAvailable) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_statusCode')); + } + if (!this._xmlHttpRequest) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_statusCode')); + } + var result = 0; + try { + result = this._xmlHttpRequest.status; + } + catch(ex) { + } + return result; + } + function Sys$Net$XMLHttpExecutor$get_statusText() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._responseAvailable) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_statusText')); + } + if (!this._xmlHttpRequest) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_statusText')); + } + return this._xmlHttpRequest.statusText; + } + function Sys$Net$XMLHttpExecutor$get_xml() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._responseAvailable) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, 'get_xml')); + } + if (!this._xmlHttpRequest) { + throw Error.invalidOperation(String.format(Sys.Res.cannotCallOutsideHandler, 'get_xml')); + } + var xml = this._xmlHttpRequest.responseXML; + if (!xml || !xml.documentElement) { + xml = Sys.Net.XMLDOM(this._xmlHttpRequest.responseText); + if (!xml || !xml.documentElement) + return null; + } + else if (navigator.userAgent.indexOf('MSIE') !== -1) { + xml.setProperty('SelectionLanguage', 'XPath'); + } + if (xml.documentElement.namespaceURI === "http://www.mozilla.org/newlayout/xml/parsererror.xml" && + xml.documentElement.tagName === "parsererror") { + return null; + } + + if (xml.documentElement.firstChild && xml.documentElement.firstChild.tagName === "parsererror") { + return null; + } + + return xml; + } + function Sys$Net$XMLHttpExecutor$abort() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (!this._started) { + throw Error.invalidOperation(Sys.Res.cannotAbortBeforeStart); + } + if (this._aborted || this._responseAvailable || this._timedOut) + return; + this._aborted = true; + this._clearTimer(); + if (this._xmlHttpRequest && !this._responseAvailable) { + this._xmlHttpRequest.onreadystatechange = Function.emptyMethod; + this._xmlHttpRequest.abort(); + + this._xmlHttpRequest = null; + this._webRequest.completed(Sys.EventArgs.Empty); + } + } +Sys.Net.XMLHttpExecutor.prototype = { + get_timedOut: Sys$Net$XMLHttpExecutor$get_timedOut, + get_started: Sys$Net$XMLHttpExecutor$get_started, + get_responseAvailable: Sys$Net$XMLHttpExecutor$get_responseAvailable, + get_aborted: Sys$Net$XMLHttpExecutor$get_aborted, + executeRequest: Sys$Net$XMLHttpExecutor$executeRequest, + getResponseHeader: Sys$Net$XMLHttpExecutor$getResponseHeader, + getAllResponseHeaders: Sys$Net$XMLHttpExecutor$getAllResponseHeaders, + get_responseData: Sys$Net$XMLHttpExecutor$get_responseData, + get_statusCode: Sys$Net$XMLHttpExecutor$get_statusCode, + get_statusText: Sys$Net$XMLHttpExecutor$get_statusText, + get_xml: Sys$Net$XMLHttpExecutor$get_xml, + abort: Sys$Net$XMLHttpExecutor$abort +} +Sys.Net.XMLHttpExecutor.registerClass('Sys.Net.XMLHttpExecutor', Sys.Net.WebRequestExecutor); + +Sys.Net._WebRequestManager = function Sys$Net$_WebRequestManager() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._defaultTimeout = 0; + this._defaultExecutorType = "Sys.Net.XMLHttpExecutor"; +} + function Sys$Net$_WebRequestManager$add_invokingRequest(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this._get_eventHandlerList().addHandler("invokingRequest", handler); + } + function Sys$Net$_WebRequestManager$remove_invokingRequest(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this._get_eventHandlerList().removeHandler("invokingRequest", handler); + } + function Sys$Net$_WebRequestManager$add_completedRequest(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this._get_eventHandlerList().addHandler("completedRequest", handler); + } + function Sys$Net$_WebRequestManager$remove_completedRequest(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this._get_eventHandlerList().removeHandler("completedRequest", handler); + } + function Sys$Net$_WebRequestManager$_get_eventHandlerList() { + if (!this._events) { + this._events = new Sys.EventHandlerList(); + } + return this._events; + } + function Sys$Net$_WebRequestManager$get_defaultTimeout() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._defaultTimeout; + } + function Sys$Net$_WebRequestManager$set_defaultTimeout(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Number}]); + if (e) throw e; + if (value < 0) { + throw Error.argumentOutOfRange("value", value, Sys.Res.invalidTimeout); + } + this._defaultTimeout = value; + } + function Sys$Net$_WebRequestManager$get_defaultExecutorType() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._defaultExecutorType; + } + function Sys$Net$_WebRequestManager$set_defaultExecutorType(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + this._defaultExecutorType = value; + } + function Sys$Net$_WebRequestManager$executeRequest(webRequest) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "webRequest", type: Sys.Net.WebRequest} + ]); + if (e) throw e; + var executor = webRequest.get_executor(); + if (!executor) { + var failed = false; + try { + var executorType = eval(this._defaultExecutorType); + executor = new executorType(); + } catch (e) { + failed = true; + } + if (failed || !Sys.Net.WebRequestExecutor.isInstanceOfType(executor) || !executor) { + throw Error.argument("defaultExecutorType", String.format(Sys.Res.invalidExecutorType, this._defaultExecutorType)); + } + webRequest.set_executor(executor); + } + if (executor.get_aborted()) { + return; + } + var evArgs = new Sys.Net.NetworkRequestEventArgs(webRequest); + var handler = this._get_eventHandlerList().getHandler("invokingRequest"); + if (handler) { + handler(this, evArgs); + } + if (!evArgs.get_cancel()) { + executor.executeRequest(); + } + } +Sys.Net._WebRequestManager.prototype = { + add_invokingRequest: Sys$Net$_WebRequestManager$add_invokingRequest, + remove_invokingRequest: Sys$Net$_WebRequestManager$remove_invokingRequest, + add_completedRequest: Sys$Net$_WebRequestManager$add_completedRequest, + remove_completedRequest: Sys$Net$_WebRequestManager$remove_completedRequest, + _get_eventHandlerList: Sys$Net$_WebRequestManager$_get_eventHandlerList, + get_defaultTimeout: Sys$Net$_WebRequestManager$get_defaultTimeout, + set_defaultTimeout: Sys$Net$_WebRequestManager$set_defaultTimeout, + get_defaultExecutorType: Sys$Net$_WebRequestManager$get_defaultExecutorType, + set_defaultExecutorType: Sys$Net$_WebRequestManager$set_defaultExecutorType, + executeRequest: Sys$Net$_WebRequestManager$executeRequest +} +Sys.Net._WebRequestManager.registerClass('Sys.Net._WebRequestManager'); +Sys.Net.WebRequestManager = new Sys.Net._WebRequestManager(); + +Sys.Net.NetworkRequestEventArgs = function Sys$Net$NetworkRequestEventArgs(webRequest) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "webRequest", type: Sys.Net.WebRequest} + ]); + if (e) throw e; + Sys.Net.NetworkRequestEventArgs.initializeBase(this); + this._webRequest = webRequest; +} + function Sys$Net$NetworkRequestEventArgs$get_webRequest() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._webRequest; + } +Sys.Net.NetworkRequestEventArgs.prototype = { + get_webRequest: Sys$Net$NetworkRequestEventArgs$get_webRequest +} +Sys.Net.NetworkRequestEventArgs.registerClass('Sys.Net.NetworkRequestEventArgs', Sys.CancelEventArgs); + +Sys.Net.WebRequest = function Sys$Net$WebRequest() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._url = ""; + this._headers = { }; + this._body = null; + this._userContext = null; + this._httpVerb = null; + this._executor = null; + this._invokeCalled = false; + this._timeout = 0; +} + function Sys$Net$WebRequest$add_completed(handler) { + /// + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this._get_eventHandlerList().addHandler("completed", handler); + } + function Sys$Net$WebRequest$remove_completed(handler) { + var e = Function._validateParams(arguments, [{name: "handler", type: Function}]); + if (e) throw e; + this._get_eventHandlerList().removeHandler("completed", handler); + } + function Sys$Net$WebRequest$completed(eventArgs) { + /// + /// + var e = Function._validateParams(arguments, [ + {name: "eventArgs", type: Sys.EventArgs} + ]); + if (e) throw e; + var handler = Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest"); + if (handler) { + handler(this._executor, eventArgs); + } + handler = this._get_eventHandlerList().getHandler("completed"); + if (handler) { + handler(this._executor, eventArgs); + } + } + function Sys$Net$WebRequest$_get_eventHandlerList() { + if (!this._events) { + this._events = new Sys.EventHandlerList(); + } + return this._events; + } + function Sys$Net$WebRequest$get_url() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._url; + } + function Sys$Net$WebRequest$set_url(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + this._url = value; + } + function Sys$Net$WebRequest$get_headers() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._headers; + } + function Sys$Net$WebRequest$get_httpVerb() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this._httpVerb === null) { + if (this._body === null) { + return "GET"; + } + return "POST"; + } + return this._httpVerb; + } + function Sys$Net$WebRequest$set_httpVerb(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + if (value.length === 0) { + throw Error.argument('value', Sys.Res.invalidHttpVerb); + } + this._httpVerb = value; + } + function Sys$Net$WebRequest$get_body() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._body; + } + function Sys$Net$WebRequest$set_body(value) { + var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]); + if (e) throw e; + this._body = value; + } + function Sys$Net$WebRequest$get_userContext() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._userContext; + } + function Sys$Net$WebRequest$set_userContext(value) { + var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]); + if (e) throw e; + this._userContext = value; + } + function Sys$Net$WebRequest$get_executor() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._executor; + } + function Sys$Net$WebRequest$set_executor(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Sys.Net.WebRequestExecutor}]); + if (e) throw e; + if (this._executor !== null && this._executor.get_started()) { + throw Error.invalidOperation(Sys.Res.setExecutorAfterActive); + } + this._executor = value; + this._executor._set_webRequest(this); + } + function Sys$Net$WebRequest$get_timeout() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this._timeout === 0) { + return Sys.Net.WebRequestManager.get_defaultTimeout(); + } + return this._timeout; + } + function Sys$Net$WebRequest$set_timeout(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Number}]); + if (e) throw e; + if (value < 0) { + throw Error.argumentOutOfRange("value", value, Sys.Res.invalidTimeout); + } + this._timeout = value; + } + function Sys$Net$WebRequest$getResolvedUrl() { + /// + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return Sys.Net.WebRequest._resolveUrl(this._url); + } + function Sys$Net$WebRequest$invoke() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + if (this._invokeCalled) { + throw Error.invalidOperation(Sys.Res.invokeCalledTwice); + } + Sys.Net.WebRequestManager.executeRequest(this); + this._invokeCalled = true; + } +Sys.Net.WebRequest.prototype = { + add_completed: Sys$Net$WebRequest$add_completed, + remove_completed: Sys$Net$WebRequest$remove_completed, + completed: Sys$Net$WebRequest$completed, + _get_eventHandlerList: Sys$Net$WebRequest$_get_eventHandlerList, + get_url: Sys$Net$WebRequest$get_url, + set_url: Sys$Net$WebRequest$set_url, + get_headers: Sys$Net$WebRequest$get_headers, + get_httpVerb: Sys$Net$WebRequest$get_httpVerb, + set_httpVerb: Sys$Net$WebRequest$set_httpVerb, + get_body: Sys$Net$WebRequest$get_body, + set_body: Sys$Net$WebRequest$set_body, + get_userContext: Sys$Net$WebRequest$get_userContext, + set_userContext: Sys$Net$WebRequest$set_userContext, + get_executor: Sys$Net$WebRequest$get_executor, + set_executor: Sys$Net$WebRequest$set_executor, + get_timeout: Sys$Net$WebRequest$get_timeout, + set_timeout: Sys$Net$WebRequest$set_timeout, + getResolvedUrl: Sys$Net$WebRequest$getResolvedUrl, + invoke: Sys$Net$WebRequest$invoke +} +Sys.Net.WebRequest._resolveUrl = function Sys$Net$WebRequest$_resolveUrl(url, baseUrl) { + if (url && url.indexOf('://') !== -1) { + return url; + } + if (!baseUrl || baseUrl.length === 0) { + var baseElement = document.getElementsByTagName('base')[0]; + if (baseElement && baseElement.href && baseElement.href.length > 0) { + baseUrl = baseElement.href; + } + else { + baseUrl = document.URL; + } + } + var qsStart = baseUrl.indexOf('?'); + if (qsStart !== -1) { + baseUrl = baseUrl.substr(0, qsStart); + } + qsStart = baseUrl.indexOf('#'); + if (qsStart !== -1) { + baseUrl = baseUrl.substr(0, qsStart); + } + baseUrl = baseUrl.substr(0, baseUrl.lastIndexOf('/') + 1); + if (!url || url.length === 0) { + return baseUrl; + } + if (url.charAt(0) === '/') { + var slashslash = baseUrl.indexOf('://'); + if (slashslash === -1) { + throw Error.argument("baseUrl", Sys.Res.badBaseUrl1); + } + var nextSlash = baseUrl.indexOf('/', slashslash + 3); + if (nextSlash === -1) { + throw Error.argument("baseUrl", Sys.Res.badBaseUrl2); + } + return baseUrl.substr(0, nextSlash) + url; + } + else { + var lastSlash = baseUrl.lastIndexOf('/'); + if (lastSlash === -1) { + throw Error.argument("baseUrl", Sys.Res.badBaseUrl3); + } + return baseUrl.substr(0, lastSlash+1) + url; + } +} +Sys.Net.WebRequest._createQueryString = function Sys$Net$WebRequest$_createQueryString(queryString, encodeMethod, addParams) { + encodeMethod = encodeMethod || encodeURIComponent; + var i = 0, obj, val, arg, sb = new Sys.StringBuilder(); + if (queryString) { + for (arg in queryString) { + obj = queryString[arg]; + if (typeof(obj) === "function") continue; + val = Sys.Serialization.JavaScriptSerializer.serialize(obj); + if (i++) { + sb.append('&'); + } + sb.append(arg); + sb.append('='); + sb.append(encodeMethod(val)); + } + } + if (addParams) { + if (i) { + sb.append('&'); + } + sb.append(addParams); + } + return sb.toString(); +} +Sys.Net.WebRequest._createUrl = function Sys$Net$WebRequest$_createUrl(url, queryString, addParams) { + if (!queryString && !addParams) { + return url; + } + var qs = Sys.Net.WebRequest._createQueryString(queryString, null, addParams); + return qs.length + ? url + ((url && url.indexOf('?') >= 0) ? "&" : "?") + qs + : url; +} +Sys.Net.WebRequest.registerClass('Sys.Net.WebRequest'); + +Sys._ScriptLoaderTask = function Sys$_ScriptLoaderTask(scriptElement, completedCallback) { + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "scriptElement", domElement: true}, + {name: "completedCallback", type: Function} + ]); + if (e) throw e; + this._scriptElement = scriptElement; + this._completedCallback = completedCallback; +} + function Sys$_ScriptLoaderTask$get_scriptElement() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._scriptElement; + } + function Sys$_ScriptLoaderTask$dispose() { + if(this._disposed) { + return; + } + this._disposed = true; + this._removeScriptElementHandlers(); + Sys._ScriptLoaderTask._clearScript(this._scriptElement); + this._scriptElement = null; + } + function Sys$_ScriptLoaderTask$execute() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + this._addScriptElementHandlers(); + var headElements = document.getElementsByTagName('head'); + if (headElements.length === 0) { + throw new Error.invalidOperation(Sys.Res.scriptLoadFailedNoHead); + } + else { + headElements[0].appendChild(this._scriptElement); + } + } + function Sys$_ScriptLoaderTask$_addScriptElementHandlers() { + this._scriptLoadDelegate = Function.createDelegate(this, this._scriptLoadHandler); + + if (Sys.Browser.agent !== Sys.Browser.InternetExplorer) { + this._scriptElement.readyState = 'loaded'; + $addHandler(this._scriptElement, 'load', this._scriptLoadDelegate); + } + else { + $addHandler(this._scriptElement, 'readystatechange', this._scriptLoadDelegate); + } + if (this._scriptElement.addEventListener) { + this._scriptErrorDelegate = Function.createDelegate(this, this._scriptErrorHandler); + this._scriptElement.addEventListener('error', this._scriptErrorDelegate, false); + } + } + function Sys$_ScriptLoaderTask$_removeScriptElementHandlers() { + if(this._scriptLoadDelegate) { + var scriptElement = this.get_scriptElement(); + if (Sys.Browser.agent !== Sys.Browser.InternetExplorer) { + $removeHandler(scriptElement, 'load', this._scriptLoadDelegate); + } + else { + $removeHandler(scriptElement, 'readystatechange', this._scriptLoadDelegate); + } + if (this._scriptErrorDelegate) { + this._scriptElement.removeEventListener('error', this._scriptErrorDelegate, false); + this._scriptErrorDelegate = null; + } + this._scriptLoadDelegate = null; + } + } + function Sys$_ScriptLoaderTask$_scriptErrorHandler() { + if(this._disposed) { + return; + } + + this._completedCallback(this.get_scriptElement(), false); + } + function Sys$_ScriptLoaderTask$_scriptLoadHandler() { + if(this._disposed) { + return; + } + var scriptElement = this.get_scriptElement(); + if ((scriptElement.readyState !== 'loaded') && + (scriptElement.readyState !== 'complete')) { + return; + } + + this._completedCallback(scriptElement, true); + } +Sys._ScriptLoaderTask.prototype = { + get_scriptElement: Sys$_ScriptLoaderTask$get_scriptElement, + dispose: Sys$_ScriptLoaderTask$dispose, + execute: Sys$_ScriptLoaderTask$execute, + _addScriptElementHandlers: Sys$_ScriptLoaderTask$_addScriptElementHandlers, + _removeScriptElementHandlers: Sys$_ScriptLoaderTask$_removeScriptElementHandlers, + _scriptErrorHandler: Sys$_ScriptLoaderTask$_scriptErrorHandler, + _scriptLoadHandler: Sys$_ScriptLoaderTask$_scriptLoadHandler +} +Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask", null, Sys.IDisposable); +Sys._ScriptLoaderTask._clearScript = function Sys$_ScriptLoaderTask$_clearScript(scriptElement) { + if (!Sys.Debug.isDebug) { + scriptElement.parentNode.removeChild(scriptElement); + } +} +Type.registerNamespace('Sys.Net'); + +Sys.Net.WebServiceProxy = function Sys$Net$WebServiceProxy() { +} + function Sys$Net$WebServiceProxy$get_timeout() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._timeout || 0; + } + function Sys$Net$WebServiceProxy$set_timeout(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Number}]); + if (e) throw e; + if (value < 0) { throw Error.argumentOutOfRange('value', value, Sys.Res.invalidTimeout); } + this._timeout = value; + } + function Sys$Net$WebServiceProxy$get_defaultUserContext() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return (typeof(this._userContext) === "undefined") ? null : this._userContext; + } + function Sys$Net$WebServiceProxy$set_defaultUserContext(value) { + var e = Function._validateParams(arguments, [{name: "value", mayBeNull: true}]); + if (e) throw e; + this._userContext = value; + } + function Sys$Net$WebServiceProxy$get_defaultSucceededCallback() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._succeeded || null; + } + function Sys$Net$WebServiceProxy$set_defaultSucceededCallback(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]); + if (e) throw e; + this._succeeded = value; + } + function Sys$Net$WebServiceProxy$get_defaultFailedCallback() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._failed || null; + } + function Sys$Net$WebServiceProxy$set_defaultFailedCallback(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Function, mayBeNull: true}]); + if (e) throw e; + this._failed = value; + } + function Sys$Net$WebServiceProxy$get_enableJsonp() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return !!this._jsonp; + } + function Sys$Net$WebServiceProxy$set_enableJsonp(value) { + var e = Function._validateParams(arguments, [{name: "value", type: Boolean}]); + if (e) throw e; + this._jsonp = value; + } + function Sys$Net$WebServiceProxy$get_path() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._path || null; + } + function Sys$Net$WebServiceProxy$set_path(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + this._path = value; + } + function Sys$Net$WebServiceProxy$get_jsonpCallbackParameter() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._callbackParameter || "callback"; + } + function Sys$Net$WebServiceProxy$set_jsonpCallbackParameter(value) { + var e = Function._validateParams(arguments, [{name: "value", type: String}]); + if (e) throw e; + this._callbackParameter = value; + } + function Sys$Net$WebServiceProxy$_invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "servicePath", type: String}, + {name: "methodName", type: String}, + {name: "useGet", type: Boolean}, + {name: "params"}, + {name: "onSuccess", type: Function, mayBeNull: true, optional: true}, + {name: "onFailure", type: Function, mayBeNull: true, optional: true}, + {name: "userContext", mayBeNull: true, optional: true} + ]); + if (e) throw e; + onSuccess = onSuccess || this.get_defaultSucceededCallback(); + onFailure = onFailure || this.get_defaultFailedCallback(); + if (userContext === null || typeof userContext === 'undefined') userContext = this.get_defaultUserContext(); + return Sys.Net.WebServiceProxy.invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext, this.get_timeout(), this.get_enableJsonp(), this.get_jsonpCallbackParameter()); + } +Sys.Net.WebServiceProxy.prototype = { + get_timeout: Sys$Net$WebServiceProxy$get_timeout, + set_timeout: Sys$Net$WebServiceProxy$set_timeout, + get_defaultUserContext: Sys$Net$WebServiceProxy$get_defaultUserContext, + set_defaultUserContext: Sys$Net$WebServiceProxy$set_defaultUserContext, + get_defaultSucceededCallback: Sys$Net$WebServiceProxy$get_defaultSucceededCallback, + set_defaultSucceededCallback: Sys$Net$WebServiceProxy$set_defaultSucceededCallback, + get_defaultFailedCallback: Sys$Net$WebServiceProxy$get_defaultFailedCallback, + set_defaultFailedCallback: Sys$Net$WebServiceProxy$set_defaultFailedCallback, + get_enableJsonp: Sys$Net$WebServiceProxy$get_enableJsonp, + set_enableJsonp: Sys$Net$WebServiceProxy$set_enableJsonp, + get_path: Sys$Net$WebServiceProxy$get_path, + set_path: Sys$Net$WebServiceProxy$set_path, + get_jsonpCallbackParameter: Sys$Net$WebServiceProxy$get_jsonpCallbackParameter, + set_jsonpCallbackParameter: Sys$Net$WebServiceProxy$set_jsonpCallbackParameter, + _invoke: Sys$Net$WebServiceProxy$_invoke +} +Sys.Net.WebServiceProxy.registerClass('Sys.Net.WebServiceProxy'); +Sys.Net.WebServiceProxy.invoke = function Sys$Net$WebServiceProxy$invoke(servicePath, methodName, useGet, params, onSuccess, onFailure, userContext, timeout, enableJsonp, jsonpCallbackParameter) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "servicePath", type: String}, + {name: "methodName", type: String, mayBeNull: true, optional: true}, + {name: "useGet", type: Boolean, optional: true}, + {name: "params", mayBeNull: true, optional: true}, + {name: "onSuccess", type: Function, mayBeNull: true, optional: true}, + {name: "onFailure", type: Function, mayBeNull: true, optional: true}, + {name: "userContext", mayBeNull: true, optional: true}, + {name: "timeout", type: Number, optional: true}, + {name: "enableJsonp", type: Boolean, mayBeNull: true, optional: true}, + {name: "jsonpCallbackParameter", type: String, mayBeNull: true, optional: true} + ]); + if (e) throw e; + var schemeHost = (enableJsonp !== false) ? Sys.Net.WebServiceProxy._xdomain.exec(servicePath) : null, + tempCallback, jsonp = schemeHost && (schemeHost.length === 3) && + ((schemeHost[1] !== location.protocol) || (schemeHost[2] !== location.host)); + useGet = jsonp || useGet; + if (jsonp) { + jsonpCallbackParameter = jsonpCallbackParameter || "callback"; + tempCallback = "_jsonp" + Sys._jsonp++; + } + if (!params) params = {}; + var urlParams = params; + if (!useGet || !urlParams) urlParams = {}; + var script, error, timeoutcookie = null, loader, body = null, + url = Sys.Net.WebRequest._createUrl(methodName + ? (servicePath+"/"+encodeURIComponent(methodName)) + : servicePath, urlParams, jsonp ? (jsonpCallbackParameter + "=Sys." + tempCallback) : null); + if (jsonp) { + script = document.createElement("script"); + script.src = url; + loader = new Sys._ScriptLoaderTask(script, function(script, loaded) { + if (!loaded || tempCallback) { + jsonpComplete({ Message: String.format(Sys.Res.webServiceFailedNoMsg, methodName) }, -1); + } + }); + function jsonpComplete(data, statusCode) { + if (timeoutcookie !== null) { + window.clearTimeout(timeoutcookie); + timeoutcookie = null; + } + loader.dispose(); + delete Sys[tempCallback]; + tempCallback = null; + if ((typeof(statusCode) !== "undefined") && (statusCode !== 200)) { + if (onFailure) { + error = new Sys.Net.WebServiceError(false, + data.Message || String.format(Sys.Res.webServiceFailedNoMsg, methodName), + data.StackTrace || null, + data.ExceptionType || null, + data); + error._statusCode = statusCode; + onFailure(error, userContext, methodName); + } + else { + if (data.StackTrace && data.Message) { + error = data.StackTrace + "-- " + data.Message; + } + else { + error = data.StackTrace || data.Message; + } + error = String.format(error ? Sys.Res.webServiceFailed : Sys.Res.webServiceFailedNoMsg, methodName, error); + throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceFailed, methodName, error)); + } + } + else if (onSuccess) { + onSuccess(data, userContext, methodName); + } + } + Sys[tempCallback] = jsonpComplete; + loader.execute(); + return null; + } + var request = new Sys.Net.WebRequest(); + request.set_url(url); + request.get_headers()['Content-Type'] = 'application/json; charset=utf-8'; + if (!useGet) { + body = Sys.Serialization.JavaScriptSerializer.serialize(params); + if (body === "{}") body = ""; + } + request.set_body(body); + request.add_completed(onComplete); + if (timeout && timeout > 0) request.set_timeout(timeout); + request.invoke(); + + function onComplete(response, eventArgs) { + if (response.get_responseAvailable()) { + var statusCode = response.get_statusCode(); + var result = null; + + try { + var contentType = response.getResponseHeader("Content-Type"); + if (contentType.startsWith("application/json")) { + result = response.get_object(); + } + else if (contentType.startsWith("text/xml")) { + result = response.get_xml(); + } + else { + result = response.get_responseData(); + } + } catch (ex) { + } + var error = response.getResponseHeader("jsonerror"); + var errorObj = (error === "true"); + if (errorObj) { + if (result) { + result = new Sys.Net.WebServiceError(false, result.Message, result.StackTrace, result.ExceptionType, result); + } + } + else if (contentType.startsWith("application/json")) { + result = (!result || (typeof(result.d) === "undefined")) ? result : result.d; + } + if (((statusCode < 200) || (statusCode >= 300)) || errorObj) { + if (onFailure) { + if (!result || !errorObj) { + result = new Sys.Net.WebServiceError(false , String.format(Sys.Res.webServiceFailedNoMsg, methodName)); + } + result._statusCode = statusCode; + onFailure(result, userContext, methodName); + } + else { + if (result && errorObj) { + error = result.get_exceptionType() + "-- " + result.get_message(); + } + else { + error = response.get_responseData(); + } + throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceFailed, methodName, error)); + } + } + else if (onSuccess) { + onSuccess(result, userContext, methodName); + } + } + else { + var msg; + if (response.get_timedOut()) { + msg = String.format(Sys.Res.webServiceTimedOut, methodName); + } + else { + msg = String.format(Sys.Res.webServiceFailedNoMsg, methodName) + } + if (onFailure) { + onFailure(new Sys.Net.WebServiceError(response.get_timedOut(), msg, "", ""), userContext, methodName); + } + else { + throw Sys.Net.WebServiceProxy._createFailedError(methodName, msg); + } + } + } + return request; +} +Sys.Net.WebServiceProxy._createFailedError = function Sys$Net$WebServiceProxy$_createFailedError(methodName, errorMessage) { + var displayMessage = "Sys.Net.WebServiceFailedException: " + errorMessage; + var e = Error.create(displayMessage, { 'name': 'Sys.Net.WebServiceFailedException', 'methodName': methodName }); + e.popStackFrame(); + return e; +} +Sys.Net.WebServiceProxy._defaultFailedCallback = function Sys$Net$WebServiceProxy$_defaultFailedCallback(err, methodName) { + var error = err.get_exceptionType() + "-- " + err.get_message(); + throw Sys.Net.WebServiceProxy._createFailedError(methodName, String.format(Sys.Res.webServiceFailed, methodName, error)); +} +Sys.Net.WebServiceProxy._generateTypedConstructor = function Sys$Net$WebServiceProxy$_generateTypedConstructor(type) { + return function(properties) { + if (properties) { + for (var name in properties) { + this[name] = properties[name]; + } + } + this.__type = type; + } +} +Sys._jsonp = 0; +Sys.Net.WebServiceProxy._xdomain = /^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/; + +Sys.Net.WebServiceError = function Sys$Net$WebServiceError(timedOut, message, stackTrace, exceptionType, errorObject) { + /// + /// + /// + /// + /// + /// + var e = Function._validateParams(arguments, [ + {name: "timedOut", type: Boolean}, + {name: "message", type: String, mayBeNull: true}, + {name: "stackTrace", type: String, mayBeNull: true, optional: true}, + {name: "exceptionType", type: String, mayBeNull: true, optional: true}, + {name: "errorObject", type: Object, mayBeNull: true, optional: true} + ]); + if (e) throw e; + this._timedOut = timedOut; + this._message = message; + this._stackTrace = stackTrace; + this._exceptionType = exceptionType; + this._errorObject = errorObject; + this._statusCode = -1; +} + function Sys$Net$WebServiceError$get_timedOut() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._timedOut; + } + function Sys$Net$WebServiceError$get_statusCode() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._statusCode; + } + function Sys$Net$WebServiceError$get_message() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._message; + } + function Sys$Net$WebServiceError$get_stackTrace() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._stackTrace || ""; + } + function Sys$Net$WebServiceError$get_exceptionType() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._exceptionType || ""; + } + function Sys$Net$WebServiceError$get_errorObject() { + /// + if (arguments.length !== 0) throw Error.parameterCount(); + return this._errorObject || null; + } +Sys.Net.WebServiceError.prototype = { + get_timedOut: Sys$Net$WebServiceError$get_timedOut, + get_statusCode: Sys$Net$WebServiceError$get_statusCode, + get_message: Sys$Net$WebServiceError$get_message, + get_stackTrace: Sys$Net$WebServiceError$get_stackTrace, + get_exceptionType: Sys$Net$WebServiceError$get_exceptionType, + get_errorObject: Sys$Net$WebServiceError$get_errorObject +} +Sys.Net.WebServiceError.registerClass('Sys.Net.WebServiceError'); + + +Type.registerNamespace('Sys'); + +Sys.Res={ +'urlMustBeLessThan1024chars':'The history state must be small enough to not make the url larger than 1024 characters.', +'argumentTypeName':'Value is not the name of an existing type.', +'cantBeCalledAfterDispose':'Can\'t be called after dispose.', +'componentCantSetIdAfterAddedToApp':'The id property of a component can\'t be set after it\'s been added to the Application object.', +'behaviorDuplicateName':'A behavior with name \'{0}\' already exists or it is the name of an existing property on the target element.', +'notATypeName':'Value is not a valid type name.', +'elementNotFound':'An element with id \'{0}\' could not be found.', +'stateMustBeStringDictionary':'The state object can only have null and string fields.', +'boolTrueOrFalse':'Value must be \'true\' or \'false\'.', +'scriptLoadFailedNoHead':'ScriptLoader requires pages to contain a element.', +'stringFormatInvalid':'The format string is invalid.', +'referenceNotFound':'Component \'{0}\' was not found.', +'enumReservedName':'\'{0}\' is a reserved name that can\'t be used as an enum value name.', +'circularParentChain':'The chain of control parents can\'t have circular references.', +'namespaceContainsNonObject':'Object {0} already exists and is not an object.', +'undefinedEvent':'\'{0}\' is not an event.', +'propertyUndefined':'\'{0}\' is not a property or an existing field.', +'observableConflict':'Object already contains a member with the name \'{0}\'.', +'historyCannotEnableHistory':'Cannot set enableHistory after initialization.', +'eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.', +'scriptLoadFailedDebug':'The script \'{0}\' failed to load. Check for:\r\n Inaccessible path.\r\n Script errors. (IE) Enable \'Display a notification about every script error\' under advanced settings.', +'propertyNotWritable':'\'{0}\' is not a writable property.', +'enumInvalidValueName':'\'{0}\' is not a valid name for an enum value.', +'controlAlreadyDefined':'A control is already associated with the element.', +'addHandlerCantBeUsedForError':'Can\'t add a handler for the error event using this method. Please set the window.onerror property instead.', +'cantAddNonFunctionhandler':'Can\'t add a handler that is not a function.', +'invalidNameSpace':'Value is not a valid namespace identifier.', +'notAnInterface':'Value is not a valid interface.', +'eventHandlerNotFunction':'Handler must be a function.', +'propertyNotAnArray':'\'{0}\' is not an Array property.', +'namespaceContainsClass':'Object {0} already exists as a class, enum, or interface.', +'typeRegisteredTwice':'Type {0} has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.', +'cantSetNameAfterInit':'The name property can\'t be set on this object after initialization.', +'historyMissingFrame':'For the history feature to work in IE, the page must have an iFrame element with id \'__historyFrame\' pointed to a page that gets its title from the \'title\' query string parameter and calls Sys.Application._onIFrameLoad() on the parent window. This can be done by setting EnableHistory to true on ScriptManager.', +'appDuplicateComponent':'Two components with the same id \'{0}\' can\'t be added to the application.', +'historyCannotAddHistoryPointWithHistoryDisabled':'A history point can only be added if enableHistory is set to true.', +'baseNotAClass':'Value is not a class.', +'expectedElementOrId':'Value must be a DOM element or DOM element Id.', +'methodNotFound':'No method found with name \'{0}\'.', +'arrayParseBadFormat':'Value must be a valid string representation for an array. It must start with a \'[\' and end with a \']\'.', +'stateFieldNameInvalid':'State field names must not contain any \'=\' characters.', +'cantSetId':'The id property can\'t be set on this object.', +'stringFormatBraceMismatch':'The format string contains an unmatched opening or closing brace.', +'enumValueNotInteger':'An enumeration definition can only contain integer values.', +'propertyNullOrUndefined':'Cannot set the properties of \'{0}\' because it returned a null value.', +'argumentDomNode':'Value must be a DOM element or a text node.', +'componentCantSetIdTwice':'The id property of a component can\'t be set more than once.', +'createComponentOnDom':'Value must be null for Components that are not Controls or Behaviors.', +'createNotComponent':'{0} does not derive from Sys.Component.', +'createNoDom':'Value must not be null for Controls and Behaviors.', +'cantAddWithoutId':'Can\'t add a component that doesn\'t have an id.', +'notObservable':'Instances of type \'{0}\' cannot be observed.', +'badTypeName':'Value is not the name of the type being registered or the name is a reserved word.', +'argumentInteger':'Value must be an integer.', +'invokeCalledTwice':'Cannot call invoke more than once.', +'webServiceFailed':'The server method \'{0}\' failed with the following error: {1}', +'argumentType':'Object cannot be converted to the required type.', +'argumentNull':'Value cannot be null.', +'scriptAlreadyLoaded':'The script \'{0}\' has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.', +'scriptDependencyNotFound':'The script \'{0}\' failed to load because it is dependent on script \'{1}\'.', +'formatBadFormatSpecifier':'Format specifier was invalid.', +'requiredScriptReferenceNotIncluded':'\'{0}\' requires that you have included a script reference to \'{1}\'.', +'webServiceFailedNoMsg':'The server method \'{0}\' failed.', +'argumentDomElement':'Value must be a DOM element.', +'invalidExecutorType':'Could not create a valid Sys.Net.WebRequestExecutor from: {0}.', +'cannotCallBeforeResponse':'Cannot call {0} when responseAvailable is false.', +'actualValue':'Actual value was {0}.', +'enumInvalidValue':'\'{0}\' is not a valid value for enum {1}.', +'scriptLoadFailed':'The script \'{0}\' could not be loaded.', +'parameterCount':'Parameter count mismatch.', +'cannotDeserializeEmptyString':'Cannot deserialize empty string.', +'formatInvalidString':'Input string was not in a correct format.', +'invalidTimeout':'Value must be greater than or equal to zero.', +'cannotAbortBeforeStart':'Cannot abort when executor has not started.', +'argument':'Value does not fall within the expected range.', +'cannotDeserializeInvalidJson':'Cannot deserialize. The data does not correspond to valid JSON.', +'invalidHttpVerb':'httpVerb cannot be set to an empty or null string.', +'nullWebRequest':'Cannot call executeRequest with a null webRequest.', +'eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.', +'cannotSerializeNonFiniteNumbers':'Cannot serialize non finite numbers.', +'argumentUndefined':'Value cannot be undefined.', +'webServiceInvalidReturnType':'The server method \'{0}\' returned an invalid type. Expected type: {1}', +'servicePathNotSet':'The path to the web service has not been set.', +'argumentTypeWithTypes':'Object of type \'{0}\' cannot be converted to type \'{1}\'.', +'cannotCallOnceStarted':'Cannot call {0} once started.', +'badBaseUrl1':'Base URL does not contain ://.', +'badBaseUrl2':'Base URL does not contain another /.', +'badBaseUrl3':'Cannot find last / in base URL.', +'setExecutorAfterActive':'Cannot set executor after it has become active.', +'paramName':'Parameter name: {0}', +'nullReferenceInPath':'Null reference while evaluating data path: \'{0}\'.', +'cannotCallOutsideHandler':'Cannot call {0} outside of a completed event handler.', +'cannotSerializeObjectWithCycle':'Cannot serialize object with cyclic reference within child properties.', +'format':'One of the identified items was in an invalid format.', +'assertFailedCaller':'Assertion Failed: {0}\r\nat {1}', +'argumentOutOfRange':'Specified argument was out of the range of valid values.', +'webServiceTimedOut':'The server method \'{0}\' timed out.', +'notImplemented':'The method or operation is not implemented.', +'assertFailed':'Assertion Failed: {0}', +'invalidOperation':'Operation is not valid due to the current state of the object.', +'breakIntoDebugger':'{0}\r\n\r\nBreak into debugger?' +}; diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftAjax.js b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftAjax.js new file mode 100644 index 00000000000..52e6626a072 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftAjax.js @@ -0,0 +1,6 @@ +//---------------------------------------------------------- +// Copyright (C) Microsoft Corporation. All rights reserved. +//---------------------------------------------------------- +// MicrosoftAjax.js +Function.__typeName="Function";Function.__class=true;Function.createCallback=function(b,a){return function(){var e=arguments.length;if(e>0){var d=[];for(var c=0;c=d)break;a=Function._validateParameter(g[b],f,h);if(a){a.popStackFrame();return a}}return null};Function._validateParameterCount=function(j,d,i){var a,c,b=d.length,e=j.length;if(eb){c=true;for(a=0;a0&&(d=0};Array.dequeue=function(a){return a.shift()};Array.forEach=function(b,e,d){for(var a=0,f=b.length;a=0)b.splice(a,1);return a>=0};Array.removeAt=function(a,b){a.splice(b,1)};Sys._indexOf=function(d,e,a){if(typeof e==="undefined")return -1;var c=d.length;if(c!==0){a=a-0;if(isNaN(a))a=0;else{if(isFinite(a))a=a-a%1;if(a<0)a=Math.max(0,c+a)}for(var b=a;b-1){Sys.Browser.agent=Sys.Browser.InternetExplorer;Sys.Browser.version=parseFloat(navigator.userAgent.match(/MSIE (\d+\.\d+)/)[1]);if(Sys.Browser.version>=8)if(document.documentMode>=7)Sys.Browser.documentMode=document.documentMode;Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" Firefox/")>-1){Sys.Browser.agent=Sys.Browser.Firefox;Sys.Browser.version=parseFloat(navigator.userAgent.match(/Firefox\/(\d+\.\d+)/)[1]);Sys.Browser.name="Firefox";Sys.Browser.hasDebuggerStatement=true}else if(navigator.userAgent.indexOf(" AppleWebKit/")>-1){Sys.Browser.agent=Sys.Browser.Safari;Sys.Browser.version=parseFloat(navigator.userAgent.match(/AppleWebKit\/(\d+(\.\d+)?)/)[1]);Sys.Browser.name="Safari"}else if(navigator.userAgent.indexOf("Opera/")>-1)Sys.Browser.agent=Sys.Browser.Opera;Sys.EventArgs=function(){};Sys.EventArgs.registerClass("Sys.EventArgs");Sys.EventArgs.Empty=new Sys.EventArgs;Sys.CancelEventArgs=function(){Sys.CancelEventArgs.initializeBase(this);this._cancel=false};Sys.CancelEventArgs.prototype={get_cancel:function(){return this._cancel},set_cancel:function(a){this._cancel=a}};Sys.CancelEventArgs.registerClass("Sys.CancelEventArgs",Sys.EventArgs);Type.registerNamespace("Sys.UI");Sys._Debug=function(){};Sys._Debug.prototype={_appendConsole:function(a){if(typeof Debug!=="undefined"&&Debug.writeln)Debug.writeln(a);if(window.console&&window.console.log)window.console.log(a);if(window.opera)window.opera.postError(a);if(window.debugService)window.debugService.trace(a)},_appendTrace:function(b){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value+=b+"\n"},assert:function(c,a,b){if(!c){a=b&&this.assert.caller?String.format(Sys.Res.assertFailedCaller,a,this.assert.caller):String.format(Sys.Res.assertFailed,a);if(confirm(String.format(Sys.Res.breakIntoDebugger,a)))this.fail(a)}},clearTrace:function(){var a=document.getElementById("TraceConsole");if(a&&a.tagName.toUpperCase()==="TEXTAREA")a.value=""},fail:function(message){this._appendConsole(message);if(Sys.Browser.hasDebuggerStatement)eval("debugger")},trace:function(a){this._appendConsole(a);this._appendTrace(a)},traceDump:function(a,b){var c=this._traceDump(a,b,true)},_traceDump:function(a,c,f,b,d){c=c?c:"traceDump";b=b?b:"";if(a===null){this.trace(b+c+": null");return}switch(typeof a){case "undefined":this.trace(b+c+": Undefined");break;case "number":case "string":case "boolean":this.trace(b+c+": "+a);break;default:if(Date.isInstanceOfType(a)||RegExp.isInstanceOfType(a)){this.trace(b+c+": "+a.toString());break}if(!d)d=[];else if(Array.contains(d,a)){this.trace(b+c+": ...");return}Array.add(d,a);if(a==window||a===document||window.HTMLElement&&a instanceof HTMLElement||typeof a.nodeName==="string"){var k=a.tagName?a.tagName:"DomElement";if(a.id)k+=" - "+a.id;this.trace(b+c+" {"+k+"}")}else{var i=Object.getTypeName(a);this.trace(b+c+(typeof i==="string"?" {"+i+"}":""));if(b===""||f){b+=" ";var e,j,l,g,h;if(Array.isInstanceOfType(a)){j=a.length;for(e=0;e=0;d--){var k=h[d].trim();b=a[k];if(typeof b!=="number")throw Error.argument("value",String.format(Sys.Res.enumInvalidValue,c.split(",")[d].trim(),this.__typeName));j|=b}return j}}function Sys$Enum$toString(c){if(typeof c==="undefined"||c===null)return this.__string;var d=this.prototype,a;if(!this.__flags||c===0){for(a in d)if(d[a]===c)return a}else{var b=this.__sortedValues;if(!b){b=[];for(a in d)b[b.length]={key:a,value:d[a]};b.sort(function(a,b){return a.value-b.value});this.__sortedValues=b}var e=[],g=c;for(a=b.length-1;a>=0;a--){var h=b[a],f=h.value;if(f===0)continue;if((f&c)===f){e[e.length]=h.key;g-=f;if(g===0)break}}if(e.length&&g===0)return e.reverse().join(", ")}return ""}Type.prototype.registerEnum=function(b,c){Sys.__upperCaseTypes[b.toUpperCase()]=this;for(var a in this.prototype)this[a]=this.prototype[a];this.__typeName=b;this.parse=Sys$Enum$parse;this.__string=this.toString();this.toString=Sys$Enum$toString;this.__flags=c;this.__enum=true};Type.isEnum=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__enum};Type.isFlags=function(a){if(typeof a==="undefined"||a===null)return false;return !!a.__flags};Sys.CollectionChange=function(e,a,c,b,d){this.action=e;if(a)if(!(a instanceof Array))a=[a];this.newItems=a||null;if(typeof c!=="number")c=-1;this.newStartingIndex=c;if(b)if(!(b instanceof Array))b=[b];this.oldItems=b||null;if(typeof d!=="number")d=-1;this.oldStartingIndex=d};Sys.CollectionChange.registerClass("Sys.CollectionChange");Sys.NotifyCollectionChangedAction=function(){throw Error.notImplemented()};Sys.NotifyCollectionChangedAction.prototype={add:0,remove:1,reset:2};Sys.NotifyCollectionChangedAction.registerEnum("Sys.NotifyCollectionChangedAction");Sys.NotifyCollectionChangedEventArgs=function(a){this._changes=a;Sys.NotifyCollectionChangedEventArgs.initializeBase(this)};Sys.NotifyCollectionChangedEventArgs.prototype={get_changes:function(){return this._changes||[]}};Sys.NotifyCollectionChangedEventArgs.registerClass("Sys.NotifyCollectionChangedEventArgs",Sys.EventArgs);Sys.Observer=function(){};Sys.Observer.registerClass("Sys.Observer");Sys.Observer.makeObservable=function(a){var c=a instanceof Array,b=Sys.Observer;if(a.setValue===b._observeMethods.setValue)return a;b._addMethods(a,b._observeMethods);if(c)b._addMethods(a,b._arrayMethods);return a};Sys.Observer._addMethods=function(c,b){for(var a in b)c[a]=b[a]};Sys.Observer._addEventHandler=function(c,a,b){Sys.Observer._getContext(c,true).events._addHandler(a,b)};Sys.Observer.addEventHandler=function(c,a,b){Sys.Observer._addEventHandler(c,a,b)};Sys.Observer._removeEventHandler=function(c,a,b){Sys.Observer._getContext(c,true).events._removeHandler(a,b)};Sys.Observer.removeEventHandler=function(c,a,b){Sys.Observer._removeEventHandler(c,a,b)};Sys.Observer.raiseEvent=function(b,e,d){var c=Sys.Observer._getContext(b);if(!c)return;var a=c.events.getHandler(e);if(a)a(b,d)};Sys.Observer.addPropertyChanged=function(b,a){Sys.Observer._addEventHandler(b,"propertyChanged",a)};Sys.Observer.removePropertyChanged=function(b,a){Sys.Observer._removeEventHandler(b,"propertyChanged",a)};Sys.Observer.beginUpdate=function(a){Sys.Observer._getContext(a,true).updating=true};Sys.Observer.endUpdate=function(b){var a=Sys.Observer._getContext(b);if(!a||!a.updating)return;a.updating=false;var d=a.dirty;a.dirty=false;if(d){if(b instanceof Array){var c=a.changes;a.changes=null;Sys.Observer.raiseCollectionChanged(b,c)}Sys.Observer.raisePropertyChanged(b,"")}};Sys.Observer.isUpdating=function(b){var a=Sys.Observer._getContext(b);return a?a.updating:false};Sys.Observer._setValue=function(a,j,g){var b,f,k=a,d=j.split(".");for(var i=0,m=d.length-1;i-1&&ac.Calendar.TwoDigitYearMax)a-=100}return a};Date._getEra=function(e,c){if(!c)return 0;var b,d=e.getTime();for(var a=0,f=c.length;a=b)return a}return 0};Date._getEraYear=function(d,b,e,c){var a=d.getFullYear();if(!c&&b.eras)a-=b.eras[e+3];return a};Date._getParseRegExp=function(b,e){if(!b._parseRegExp)b._parseRegExp={};else if(b._parseRegExp[e])return b._parseRegExp[e];var c=Date._expandFormat(b,e);c=c.replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1");var a=new Sys.StringBuilder("^"),j=[],f=0,i=0,h=Date._getTokenRegExp(),d;while((d=h.exec(c))!==null){var l=c.slice(f,d.index);f=h.lastIndex;i+=Date._appendPreOrPostMatch(l,a);if(i%2===1){a.append(d[0]);continue}switch(d[0]){case "dddd":case "ddd":case "MMMM":case "MMM":case "gg":case "g":a.append("(\\D+)");break;case "tt":case "t":a.append("(\\D*)");break;case "yyyy":a.append("(\\d{4})");break;case "fff":a.append("(\\d{3})");break;case "ff":a.append("(\\d{2})");break;case "f":a.append("(\\d)");break;case "dd":case "d":case "MM":case "M":case "yy":case "y":case "HH":case "H":case "hh":case "h":case "mm":case "m":case "ss":case "s":a.append("(\\d\\d?)");break;case "zzz":a.append("([+-]?\\d\\d?:\\d{2})");break;case "zz":case "z":a.append("([+-]?\\d\\d?)");break;case "/":a.append("(\\"+b.DateSeparator+")")}Array.add(j,d[0])}Date._appendPreOrPostMatch(c.slice(f),a);a.append("$");var k=a.toString().replace(/\s+/g,"\\s+"),g={"regExp":k,"groups":j};b._parseRegExp[e]=g;return g};Date._getTokenRegExp=function(){return /\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g};Date.parseLocale=function(a){return Date._parse(a,Sys.CultureInfo.CurrentCulture,arguments)};Date.parseInvariant=function(a){return Date._parse(a,Sys.CultureInfo.InvariantCulture,arguments)};Date._parse=function(h,d,i){var a,c,b,f,e,g=false;for(a=1,c=i.length;a31)return null;break;case "MMMM":c=k._getMonthIndex(a);if(c<0||c>11)return null;break;case "MMM":c=k._getAbbrMonthIndex(a);if(c<0||c>11)return null;break;case "M":case "MM":c=parseInt(a,10)-1;if(c<0||c>11)return null;break;case "y":case "yy":e=Date._expandYear(g,parseInt(a,10));if(e<0||e>9999)return null;break;case "yyyy":e=parseInt(a,10);if(e<0||e>9999)return null;break;case "h":case "hh":d=parseInt(a,10);if(d===12)d=0;if(d<0||d>11)return null;break;case "H":case "HH":d=parseInt(a,10);if(d<0||d>23)return null;break;case "m":case "mm":q=parseInt(a,10);if(q<0||q>59)return null;break;case "s":case "ss":r=parseInt(a,10);if(r<0||r>59)return null;break;case "tt":case "t":var z=a.toUpperCase();v=z===g.PMDesignator.toUpperCase();if(!v&&z!==g.AMDesignator.toUpperCase())return null;break;case "f":f=parseInt(a,10)*100;if(f<0||f>999)return null;break;case "ff":f=parseInt(a,10)*10;if(f<0||f>999)return null;break;case "fff":f=parseInt(a,10);if(f<0||f>999)return null;break;case "dddd":i=k._getDayIndex(a);if(i<0||i>6)return null;break;case "ddd":i=k._getAbbrDayIndex(a);if(i<0||i>6)return null;break;case "zzz":var u=a.split(/:/);if(u.length!==2)return null;h=parseInt(u[0],10);if(h<-12||h>13)return null;var o=parseInt(u[1],10);if(o<0||o>59)return null;n=h*60+(a.startsWith("-")?-o:o);break;case "z":case "zz":h=parseInt(a,10);if(h<-12||h>13)return null;n=h*60;break;case "g":case "gg":var p=a;if(!p||!g.eras)return null;p=p.toLowerCase().trim();for(var s=0,F=g.eras.length;s0)return this.toLocaleString();else return this.toString();var o=["n %","n%","%n"],n=["-n %","-n%","-%n"],p=["(n)","-n","- n","n-","n -"],m=["$n","n$","$ n","n $"],l=["($n)","-$n","$-n","$n-","(n$)","-n$","n-$","n$-","-n $","-$ n","n $-","$ n-","$ -n","n- $","($ n)","(n $)"];function g(a,c,d){for(var b=a.length;b1?parseInt(e[1]):0;e=b.split(".");b=e[0];a=e.length>1?e[1]:"";var q;if(c>0){a=g(a,c,false);b+=a.slice(0,c);a=a.substr(c)}else if(c<0){c=-c;b=g(b,c+1,true);a=b.slice(-c,b.length)+a;b=b.slice(0,-c)}if(i>0){if(a.length>i)a=a.slice(0,i);else a=g(a,i,false);a=p+a}else a="";var d=b.length-1,f="";while(d>=0){if(h===0||h>d)if(f.length>0)return b.slice(0,d+1)+n+f+a;else return b.slice(0,d+1)+a;if(f.length>0)f=b.slice(d-h+1,d+1)+n+f;else f=b.slice(d-h+1,d+1);d-=h;if(k1)b=parseInt(e.slice(1),10);var c;switch(e.charAt(0)){case "d":case "D":c="n";if(b!==-1)d=g(""+d,b,true);if(this<0)d=-d;break;case "c":case "C":if(this<0)c=l[a.CurrencyNegativePattern];else c=m[a.CurrencyPositivePattern];if(b===-1)b=a.CurrencyDecimalDigits;d=i(Math.abs(this),b,a.CurrencyGroupSizes,a.CurrencyGroupSeparator,a.CurrencyDecimalSeparator);break;case "n":case "N":if(this<0)c=p[a.NumberNegativePattern];else c="n";if(b===-1)b=a.NumberDecimalDigits;d=i(Math.abs(this),b,a.NumberGroupSizes,a.NumberGroupSeparator,a.NumberDecimalSeparator);break;case "p":case "P":if(this<0)c=n[a.PercentNegativePattern];else c=o[a.PercentPositivePattern];if(b===-1)b=a.PercentDecimalDigits;d=i(Math.abs(this)*100,b,a.PercentGroupSizes,a.PercentGroupSeparator,a.PercentDecimalSeparator);break;default:throw Error.format(Sys.Res.formatBadFormatSpecifier)}var k=/n|\$|-|%/g,f="";for(;true;){var q=k.lastIndex,h=k.exec(c);f+=c.slice(q,h?h.index:c.length);if(!h)break;switch(h[0]){case "n":f+=d;break;case "$":f+=a.CurrencySymbol;break;case "-":if(/[1-9]/.test(d))f+=a.NegativeSign;break;case "%":f+=a.PercentSymbol}}return f};Sys.CultureInfo=function(c,b,a){this.name=c;this.numberFormat=b;this.dateTimeFormat=a};Sys.CultureInfo.prototype={_getDateTimeFormats:function(){if(!this._dateTimeFormats){var a=this.dateTimeFormat;this._dateTimeFormats=[a.MonthDayPattern,a.YearMonthPattern,a.ShortDatePattern,a.ShortTimePattern,a.LongDatePattern,a.LongTimePattern,a.FullDateTimePattern,a.RFC1123Pattern,a.SortableDateTimePattern,a.UniversalSortableDateTimePattern]}return this._dateTimeFormats},_getIndex:function(c,d,e){var b=this._toUpper(c),a=Array.indexOf(d,b);if(a===-1)a=Array.indexOf(e,b);return a},_getMonthIndex:function(a){if(!this._upperMonths){this._upperMonths=this._toUpperArray(this.dateTimeFormat.MonthNames);this._upperMonthsGenitive=this._toUpperArray(this.dateTimeFormat.MonthGenitiveNames)}return this._getIndex(a,this._upperMonths,this._upperMonthsGenitive)},_getAbbrMonthIndex:function(a){if(!this._upperAbbrMonths){this._upperAbbrMonths=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthNames);this._upperAbbrMonthsGenitive=this._toUpperArray(this.dateTimeFormat.AbbreviatedMonthGenitiveNames)}return this._getIndex(a,this._upperAbbrMonths,this._upperAbbrMonthsGenitive)},_getDayIndex:function(a){if(!this._upperDays)this._upperDays=this._toUpperArray(this.dateTimeFormat.DayNames);return Array.indexOf(this._upperDays,this._toUpper(a))},_getAbbrDayIndex:function(a){if(!this._upperAbbrDays)this._upperAbbrDays=this._toUpperArray(this.dateTimeFormat.AbbreviatedDayNames);return Array.indexOf(this._upperAbbrDays,this._toUpper(a))},_toUpperArray:function(c){var b=[];for(var a=0,d=c.length;a0)a.append(",");Sys.Serialization.JavaScriptSerializer._serializeWithBuilder(b[c],a,false,g)}a.append("]")}else{if(Date.isInstanceOfType(b)){a.append('"\\/Date(');a.append(b.getTime());a.append(')\\/"');break}var d=[],f=0;for(var e in b){if(e.startsWith("$"))continue;if(e===Sys.Serialization.JavaScriptSerializer._serverTypeFieldName&&f!==0){d[f++]=d[0];d[0]=e}else d[f++]=e}if(i)d.sort();a.append("{");var j=false;for(c=0;c=0;c--){var f=d[c];if(!g||f.autoRemove)$removeHandler(a,b,f.handler)}}a._events=null}};Sys.UI.DomEvent._disposeHandlers=function(){Sys.UI.DomEvent._clearHandlers(this,true);var b=this._chainDispose,a=typeof b;if(a!=="undefined"){this.dispose=b;this._chainDispose=null;if(a==="function")this.dispose()}};var $removeHandler=Sys.UI.DomEvent.removeHandler=function(b,a,c){Sys.UI.DomEvent._removeHandler(b,a,c)};Sys.UI.DomEvent._removeHandler=function(a,e,f){var d=null,c=a._events[e];for(var b=0,g=c.length;b=3){d+=parseInt(b.borderLeftWidth);e+=parseInt(b.borderTopWidth)}}b=Sys.UI.DomElement._getCurrentStyle(c);var h=b?b.position:null;if(!h||h!=="absolute")for(a=c.parentNode;a;a=a.parentNode){f=a.tagName?a.tagName.toUpperCase():null;if(f!=="BODY"&&f!=="HTML"&&(a.scrollLeft||a.scrollTop)){d-=a.scrollLeft||0;e-=a.scrollTop||0}b=Sys.UI.DomElement._getCurrentStyle(a);var i=b?b.position:null;if(i&&i==="absolute")break}return new Sys.UI.Point(d,e)};else Sys.UI.DomElement.getLocation=function(d){if(d.window&&d.window===d||d.nodeType===9)return new Sys.UI.Point(0,0);var e=0,f=0,a,i=null,g=null,b=null;for(a=d;a;i=a,(g=b,a=a.offsetParent)){var c=a.tagName?a.tagName.toUpperCase():null;b=Sys.UI.DomElement._getCurrentStyle(a);if((a.offsetLeft||a.offsetTop)&&!(c==="BODY"&&(!g||g.position!=="absolute"))){e+=a.offsetLeft;f+=a.offsetTop}if(i!==null&&b){if(c!=="TABLE"&&c!=="TD"&&c!=="HTML"){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}if(c==="TABLE"&&(b.position==="relative"||b.position==="absolute")){e+=parseInt(b.marginLeft)||0;f+=parseInt(b.marginTop)||0}}}b=Sys.UI.DomElement._getCurrentStyle(d);var h=b?b.position:null;if(!h||h!=="absolute")for(a=d.parentNode;a;a=a.parentNode){c=a.tagName?a.tagName.toUpperCase():null;if(c!=="BODY"&&c!=="HTML"&&(a.scrollLeft||a.scrollTop)){e-=a.scrollLeft||0;f-=a.scrollTop||0;b=Sys.UI.DomElement._getCurrentStyle(a);if(b){e+=parseInt(b.borderLeftWidth)||0;f+=parseInt(b.borderTopWidth)||0}}}return new Sys.UI.Point(e,f)};Sys.UI.DomElement.isDomElement=function(a){return Sys._isDomElement(a)};Sys.UI.DomElement.removeCssClass=function(d,c){var a=" "+d.className+" ",b=a.indexOf(" "+c+" ");if(b>=0)d.className=(a.substr(0,b)+" "+a.substring(b+c.length+1,a.length)).trim()};Sys.UI.DomElement.resolveElement=function(b,c){var a=b;if(!a)return null;if(typeof a==="string")a=Sys.UI.DomElement.getElementById(a,c);return a};Sys.UI.DomElement.raiseBubbleEvent=function(c,d){var b=c;while(b){var a=b.control;if(a&&a.onBubbleEvent&&a.raiseBubbleEvent){Sys.UI.DomElement._raiseBubbleEventFromControl(a,c,d);return}b=b.parentNode}};Sys.UI.DomElement._raiseBubbleEventFromControl=function(a,b,c){if(!a.onBubbleEvent(b,c))a._raiseBubbleEvent(b,c)};Sys.UI.DomElement.setLocation=function(b,c,d){var a=b.style;a.position="absolute";a.left=c+"px";a.top=d+"px"};Sys.UI.DomElement.toggleCssClass=function(b,a){if(Sys.UI.DomElement.containsCssClass(b,a))Sys.UI.DomElement.removeCssClass(b,a);else Sys.UI.DomElement.addCssClass(b,a)};Sys.UI.DomElement.getVisibilityMode=function(a){return a._visibilityMode===Sys.UI.VisibilityMode.hide?Sys.UI.VisibilityMode.hide:Sys.UI.VisibilityMode.collapse};Sys.UI.DomElement.setVisibilityMode=function(a,b){Sys.UI.DomElement._ensureOldDisplayMode(a);if(a._visibilityMode!==b){a._visibilityMode=b;if(Sys.UI.DomElement.getVisible(a)===false)if(a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none";a._visibilityMode=b}};Sys.UI.DomElement.getVisible=function(b){var a=b.currentStyle||Sys.UI.DomElement._getCurrentStyle(b);if(!a)return true;return a.visibility!=="hidden"&&a.display!=="none"};Sys.UI.DomElement.setVisible=function(a,b){if(b!==Sys.UI.DomElement.getVisible(a)){Sys.UI.DomElement._ensureOldDisplayMode(a);a.style.visibility=b?"visible":"hidden";if(b||a._visibilityMode===Sys.UI.VisibilityMode.hide)a.style.display=a._oldDisplayMode;else a.style.display="none"}};Sys.UI.DomElement._ensureOldDisplayMode=function(a){if(!a._oldDisplayMode){var b=a.currentStyle||Sys.UI.DomElement._getCurrentStyle(a);a._oldDisplayMode=b?b.display:null;if(!a._oldDisplayMode||a._oldDisplayMode==="none")switch(a.tagName.toUpperCase()){case "DIV":case "P":case "ADDRESS":case "BLOCKQUOTE":case "BODY":case "COL":case "COLGROUP":case "DD":case "DL":case "DT":case "FIELDSET":case "FORM":case "H1":case "H2":case "H3":case "H4":case "H5":case "H6":case "HR":case "IFRAME":case "LEGEND":case "OL":case "PRE":case "TABLE":case "TD":case "TH":case "TR":case "UL":a._oldDisplayMode="block";break;case "LI":a._oldDisplayMode="list-item";break;default:a._oldDisplayMode="inline"}}};Sys.UI.DomElement._getWindow=function(a){var b=a.ownerDocument||a.document||a;return b.defaultView||b.parentWindow};Sys.UI.DomElement._getCurrentStyle=function(a){if(a.nodeType===3)return null;var c=Sys.UI.DomElement._getWindow(a);if(a.documentElement)a=a.documentElement;var b=c&&a!==c&&c.getComputedStyle?c.getComputedStyle(a,null):a.currentStyle||a.style;if(!b&&Sys.Browser.agent===Sys.Browser.Safari&&a.style){var g=a.style.display,f=a.style.position;a.style.position="absolute";a.style.display="block";var e=c.getComputedStyle(a,null);a.style.display=g;a.style.position=f;b={};for(var d in e)b[d]=e[d];b.display="none"}return b};Sys.IContainer=function(){};Sys.IContainer.prototype={};Sys.IContainer.registerInterface("Sys.IContainer");Sys.ApplicationLoadEventArgs=function(b,a){Sys.ApplicationLoadEventArgs.initializeBase(this);this._components=b;this._isPartialLoad=a};Sys.ApplicationLoadEventArgs.prototype={get_components:function(){return this._components},get_isPartialLoad:function(){return this._isPartialLoad}};Sys.ApplicationLoadEventArgs.registerClass("Sys.ApplicationLoadEventArgs",Sys.EventArgs);Sys._Application=function(){Sys._Application.initializeBase(this);this._disposableObjects=[];this._components={};this._createdComponents=[];this._secondPassComponents=[];this._unloadHandlerDelegate=Function.createDelegate(this,this._unloadHandler);Sys.UI.DomEvent.addHandler(window,"unload",this._unloadHandlerDelegate);this._domReady()};Sys._Application.prototype={_creatingComponents:false,_disposing:false,_deleteCount:0,get_isCreatingComponents:function(){return this._creatingComponents},get_isDisposing:function(){return this._disposing},add_init:function(a){if(this._initialized)a(this,Sys.EventArgs.Empty);else this.get_events().addHandler("init",a)},remove_init:function(a){this.get_events().removeHandler("init",a)},add_load:function(a){this.get_events().addHandler("load",a)},remove_load:function(a){this.get_events().removeHandler("load",a)},add_unload:function(a){this.get_events().addHandler("unload",a)},remove_unload:function(a){this.get_events().removeHandler("unload",a)},addComponent:function(a){this._components[a.get_id()]=a},beginCreateComponents:function(){this._creatingComponents=true},dispose:function(){if(!this._disposing){this._disposing=true;if(this._timerCookie){window.clearTimeout(this._timerCookie);delete this._timerCookie}if(this._endRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_endRequest(this._endRequestHandler);delete this._endRequestHandler}if(this._beginRequestHandler){Sys.WebForms.PageRequestManager.getInstance().remove_beginRequest(this._beginRequestHandler);delete this._beginRequestHandler}if(window.pageUnload)window.pageUnload(this,Sys.EventArgs.Empty);var c=this.get_events().getHandler("unload");if(c)c(this,Sys.EventArgs.Empty);var b=Array.clone(this._disposableObjects);for(var a=0,f=b.length;a=0;b--)this._disposeElementInternal(c[b]);if(!d)this._disposeElementInternal(a)}},endCreateComponents:function(){var b=this._secondPassComponents;for(var a=0,d=b.length;a1000){var c=[];for(var d=0,f=b.length;d=0;b--){var c=a[b];if(typeof c.dispose==="function")c.dispose()}},_disposeElementInternal:function(a){var d=a.dispose;if(d&&typeof d==="function")a.dispose();else{var c=a.control;if(c&&typeof c.dispose==="function")c.dispose()}var b=a._behaviors;if(b)this._disposeComponents(b);b=a._components;if(b){this._disposeComponents(b);a._components=null}},_domReady:function(){var a,g,f=this;function b(){f.initialize()}var c=function(){Sys.UI.DomEvent.removeHandler(window,"load",c);b()};Sys.UI.DomEvent.addHandler(window,"load",c);if(document.addEventListener)try{document.addEventListener("DOMContentLoaded",a=function(){document.removeEventListener("DOMContentLoaded",a,false);b()},false)}catch(h){}else if(document.attachEvent)if(window==window.top&&document.documentElement.doScroll){var e,d=document.createElement("div");a=function(){try{d.doScroll("left")}catch(c){e=window.setTimeout(a,0);return}d=null;b()};a()}else document.attachEvent("onreadystatechange",a=function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",a);b()}})},_raiseInit:function(){var a=this.get_events().getHandler("init");if(a){this.beginCreateComponents();a(this,Sys.EventArgs.Empty);this.endCreateComponents()}},_unloadHandler:function(){this.dispose()}};Sys._Application.registerClass("Sys._Application",Sys.Component,Sys.IContainer);Sys.Application=new Sys._Application;var $find=Sys.Application.findComponent;Sys.UI.Behavior=function(b){Sys.UI.Behavior.initializeBase(this);this._element=b;var a=b._behaviors;if(!a)b._behaviors=[this];else a[a.length]=this};Sys.UI.Behavior.prototype={_name:null,get_element:function(){return this._element},get_id:function(){var a=Sys.UI.Behavior.callBaseMethod(this,"get_id");if(a)return a;if(!this._element||!this._element.id)return "";return this._element.id+"$"+this.get_name()},get_name:function(){if(this._name)return this._name;var a=Object.getTypeName(this),b=a.lastIndexOf(".");if(b!==-1)a=a.substr(b+1);if(!this.get_isInitialized())this._name=a;return a},set_name:function(a){this._name=a},initialize:function(){Sys.UI.Behavior.callBaseMethod(this,"initialize");var a=this.get_name();if(a)this._element[a]=this},dispose:function(){Sys.UI.Behavior.callBaseMethod(this,"dispose");var a=this._element;if(a){var c=this.get_name();if(c)a[c]=null;var b=a._behaviors;Array.remove(b,this);if(b.length===0)a._behaviors=null;delete this._element}}};Sys.UI.Behavior.registerClass("Sys.UI.Behavior",Sys.Component);Sys.UI.Behavior.getBehaviorByName=function(b,c){var a=b[c];return a&&Sys.UI.Behavior.isInstanceOfType(a)?a:null};Sys.UI.Behavior.getBehaviors=function(a){if(!a._behaviors)return [];return Array.clone(a._behaviors)};Sys.UI.Behavior.getBehaviorsByType=function(d,e){var a=d._behaviors,c=[];if(a)for(var b=0,f=a.length;b0&&a.charAt(0)==="#")a=a.substring(1);return a};Sys._Application.prototype.get_enableHistory=function(){return this._enableHistory};Sys._Application.prototype.set_enableHistory=function(a){this._enableHistory=a};Sys._Application.prototype.add_navigate=function(a){this.get_events().addHandler("navigate",a)};Sys._Application.prototype.remove_navigate=function(a){this.get_events().removeHandler("navigate",a)};Sys._Application.prototype.addHistoryPoint=function(c,f){this._ensureHistory();var b=this._state;for(var a in c){var d=c[a];if(d===null){if(typeof b[a]!=="undefined")delete b[a]}else b[a]=d}var e=this._serializeState(b);this._historyPointIsNew=true;this._setState(e,f);this._raiseNavigate()};Sys._Application.prototype.setServerId=function(a,b){this._clientId=a;this._uniqueId=b};Sys._Application.prototype.setServerState=function(a){this._ensureHistory();this._state.__s=a;this._updateHiddenField(a)};Sys._Application.prototype._deserializeState=function(a){var e={};a=a||"";var b=a.indexOf("&&");if(b!==-1&&b+2'");c.write(""+(b||document.title)+"parent.Sys.Application._onIFrameLoad('+Sys.Serialization.JavaScriptSerializer.serialize(a)+");");c.close()}this._ignoreTimer=false;this._currentEntry=a;if(this._historyFrame||this._historyPointIsNew){var f=this.get_stateString();if(a!==f){window.location.hash=a;this._currentEntry=this.get_stateString();if(typeof b!=="undefined"&&b!==null)document.title=b}}this._historyPointIsNew=false}}};Sys._Application.prototype._updateHiddenField=function(b){if(this._clientId){var a=document.getElementById(this._clientId);if(a)a.value=b}};if(!window.XMLHttpRequest)window.XMLHttpRequest=function(){var b=["Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP"];for(var a=0,c=b.length;a0)this._timer=window.setTimeout(Function.createDelegate(this,this._onTimeout),d);this._xmlHttpRequest.send(c);this._started=true},getResponseHeader:function(b){var a;try{a=this._xmlHttpRequest.getResponseHeader(b)}catch(c){}if(!a)a="";return a},getAllResponseHeaders:function(){return this._xmlHttpRequest.getAllResponseHeaders()},get_responseData:function(){return this._xmlHttpRequest.responseText},get_statusCode:function(){var a=0;try{a=this._xmlHttpRequest.status}catch(b){}return a},get_statusText:function(){return this._xmlHttpRequest.statusText},get_xml:function(){var a=this._xmlHttpRequest.responseXML;if(!a||!a.documentElement){a=Sys.Net.XMLDOM(this._xmlHttpRequest.responseText);if(!a||!a.documentElement)return null}else if(navigator.userAgent.indexOf("MSIE")!==-1)a.setProperty("SelectionLanguage","XPath");if(a.documentElement.namespaceURI==="http://www.mozilla.org/newlayout/xml/parsererror.xml"&&a.documentElement.tagName==="parsererror")return null;if(a.documentElement.firstChild&&a.documentElement.firstChild.tagName==="parsererror")return null;return a},abort:function(){if(this._aborted||this._responseAvailable||this._timedOut)return;this._aborted=true;this._clearTimer();if(this._xmlHttpRequest&&!this._responseAvailable){this._xmlHttpRequest.onreadystatechange=Function.emptyMethod;this._xmlHttpRequest.abort();this._xmlHttpRequest=null;this._webRequest.completed(Sys.EventArgs.Empty)}}};Sys.Net.XMLHttpExecutor.registerClass("Sys.Net.XMLHttpExecutor",Sys.Net.WebRequestExecutor);Sys.Net._WebRequestManager=function(){this._defaultTimeout=0;this._defaultExecutorType="Sys.Net.XMLHttpExecutor"};Sys.Net._WebRequestManager.prototype={add_invokingRequest:function(a){this._get_eventHandlerList().addHandler("invokingRequest",a)},remove_invokingRequest:function(a){this._get_eventHandlerList().removeHandler("invokingRequest",a)},add_completedRequest:function(a){this._get_eventHandlerList().addHandler("completedRequest",a)},remove_completedRequest:function(a){this._get_eventHandlerList().removeHandler("completedRequest",a)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_defaultTimeout:function(){return this._defaultTimeout},set_defaultTimeout:function(a){this._defaultTimeout=a},get_defaultExecutorType:function(){return this._defaultExecutorType},set_defaultExecutorType:function(a){this._defaultExecutorType=a},executeRequest:function(webRequest){var executor=webRequest.get_executor();if(!executor){var failed=false;try{var executorType=eval(this._defaultExecutorType);executor=new executorType}catch(a){failed=true}webRequest.set_executor(executor)}if(executor.get_aborted())return;var evArgs=new Sys.Net.NetworkRequestEventArgs(webRequest),handler=this._get_eventHandlerList().getHandler("invokingRequest");if(handler)handler(this,evArgs);if(!evArgs.get_cancel())executor.executeRequest()}};Sys.Net._WebRequestManager.registerClass("Sys.Net._WebRequestManager");Sys.Net.WebRequestManager=new Sys.Net._WebRequestManager;Sys.Net.NetworkRequestEventArgs=function(a){Sys.Net.NetworkRequestEventArgs.initializeBase(this);this._webRequest=a};Sys.Net.NetworkRequestEventArgs.prototype={get_webRequest:function(){return this._webRequest}};Sys.Net.NetworkRequestEventArgs.registerClass("Sys.Net.NetworkRequestEventArgs",Sys.CancelEventArgs);Sys.Net.WebRequest=function(){this._url="";this._headers={};this._body=null;this._userContext=null;this._httpVerb=null;this._executor=null;this._invokeCalled=false;this._timeout=0};Sys.Net.WebRequest.prototype={add_completed:function(a){this._get_eventHandlerList().addHandler("completed",a)},remove_completed:function(a){this._get_eventHandlerList().removeHandler("completed",a)},completed:function(b){var a=Sys.Net.WebRequestManager._get_eventHandlerList().getHandler("completedRequest");if(a)a(this._executor,b);a=this._get_eventHandlerList().getHandler("completed");if(a)a(this._executor,b)},_get_eventHandlerList:function(){if(!this._events)this._events=new Sys.EventHandlerList;return this._events},get_url:function(){return this._url},set_url:function(a){this._url=a},get_headers:function(){return this._headers},get_httpVerb:function(){if(this._httpVerb===null){if(this._body===null)return "GET";return "POST"}return this._httpVerb},set_httpVerb:function(a){this._httpVerb=a},get_body:function(){return this._body},set_body:function(a){this._body=a},get_userContext:function(){return this._userContext},set_userContext:function(a){this._userContext=a},get_executor:function(){return this._executor},set_executor:function(a){this._executor=a;this._executor._set_webRequest(this)},get_timeout:function(){if(this._timeout===0)return Sys.Net.WebRequestManager.get_defaultTimeout();return this._timeout},set_timeout:function(a){this._timeout=a},getResolvedUrl:function(){return Sys.Net.WebRequest._resolveUrl(this._url)},invoke:function(){Sys.Net.WebRequestManager.executeRequest(this);this._invokeCalled=true}};Sys.Net.WebRequest._resolveUrl=function(b,a){if(b&&b.indexOf("://")!==-1)return b;if(!a||a.length===0){var d=document.getElementsByTagName("base")[0];if(d&&d.href&&d.href.length>0)a=d.href;else a=document.URL}var c=a.indexOf("?");if(c!==-1)a=a.substr(0,c);c=a.indexOf("#");if(c!==-1)a=a.substr(0,c);a=a.substr(0,a.lastIndexOf("/")+1);if(!b||b.length===0)return a;if(b.charAt(0)==="/"){var e=a.indexOf("://"),g=a.indexOf("/",e+3);return a.substr(0,g)+b}else{var f=a.lastIndexOf("/");return a.substr(0,f+1)+b}};Sys.Net.WebRequest._createQueryString=function(c,b,f){b=b||encodeURIComponent;var h=0,e,g,d,a=new Sys.StringBuilder;if(c)for(d in c){e=c[d];if(typeof e==="function")continue;g=Sys.Serialization.JavaScriptSerializer.serialize(e);if(h++)a.append("&");a.append(d);a.append("=");a.append(b(g))}if(f){if(h)a.append("&");a.append(f)}return a.toString()};Sys.Net.WebRequest._createUrl=function(a,b,c){if(!b&&!c)return a;var d=Sys.Net.WebRequest._createQueryString(b,null,c);return d.length?a+(a&&a.indexOf("?")>=0?"&":"?")+d:a};Sys.Net.WebRequest.registerClass("Sys.Net.WebRequest");Sys._ScriptLoaderTask=function(b,a){this._scriptElement=b;this._completedCallback=a};Sys._ScriptLoaderTask.prototype={get_scriptElement:function(){return this._scriptElement},dispose:function(){if(this._disposed)return;this._disposed=true;this._removeScriptElementHandlers();Sys._ScriptLoaderTask._clearScript(this._scriptElement);this._scriptElement=null},execute:function(){this._addScriptElementHandlers();document.getElementsByTagName("head")[0].appendChild(this._scriptElement)},_addScriptElementHandlers:function(){this._scriptLoadDelegate=Function.createDelegate(this,this._scriptLoadHandler);if(Sys.Browser.agent!==Sys.Browser.InternetExplorer){this._scriptElement.readyState="loaded";$addHandler(this._scriptElement,"load",this._scriptLoadDelegate)}else $addHandler(this._scriptElement,"readystatechange",this._scriptLoadDelegate);if(this._scriptElement.addEventListener){this._scriptErrorDelegate=Function.createDelegate(this,this._scriptErrorHandler);this._scriptElement.addEventListener("error",this._scriptErrorDelegate,false)}},_removeScriptElementHandlers:function(){if(this._scriptLoadDelegate){var a=this.get_scriptElement();if(Sys.Browser.agent!==Sys.Browser.InternetExplorer)$removeHandler(a,"load",this._scriptLoadDelegate);else $removeHandler(a,"readystatechange",this._scriptLoadDelegate);if(this._scriptErrorDelegate){this._scriptElement.removeEventListener("error",this._scriptErrorDelegate,false);this._scriptErrorDelegate=null}this._scriptLoadDelegate=null}},_scriptErrorHandler:function(){if(this._disposed)return;this._completedCallback(this.get_scriptElement(),false)},_scriptLoadHandler:function(){if(this._disposed)return;var a=this.get_scriptElement();if(a.readyState!=="loaded"&&a.readyState!=="complete")return;this._completedCallback(a,true)}};Sys._ScriptLoaderTask.registerClass("Sys._ScriptLoaderTask",null,Sys.IDisposable);Sys._ScriptLoaderTask._clearScript=function(a){if(!Sys.Debug.isDebug)a.parentNode.removeChild(a)};Type.registerNamespace("Sys.Net");Sys.Net.WebServiceProxy=function(){};Sys.Net.WebServiceProxy.prototype={get_timeout:function(){return this._timeout||0},set_timeout:function(a){if(a<0)throw Error.argumentOutOfRange("value",a,Sys.Res.invalidTimeout);this._timeout=a},get_defaultUserContext:function(){return typeof this._userContext==="undefined"?null:this._userContext},set_defaultUserContext:function(a){this._userContext=a},get_defaultSucceededCallback:function(){return this._succeeded||null},set_defaultSucceededCallback:function(a){this._succeeded=a},get_defaultFailedCallback:function(){return this._failed||null},set_defaultFailedCallback:function(a){this._failed=a},get_enableJsonp:function(){return !!this._jsonp},set_enableJsonp:function(a){this._jsonp=a},get_path:function(){return this._path||null},set_path:function(a){this._path=a},get_jsonpCallbackParameter:function(){return this._callbackParameter||"callback"},set_jsonpCallbackParameter:function(a){this._callbackParameter=a},_invoke:function(d,e,g,f,c,b,a){c=c||this.get_defaultSucceededCallback();b=b||this.get_defaultFailedCallback();if(a===null||typeof a==="undefined")a=this.get_defaultUserContext();return Sys.Net.WebServiceProxy.invoke(d,e,g,f,c,b,a,this.get_timeout(),this.get_enableJsonp(),this.get_jsonpCallbackParameter())}};Sys.Net.WebServiceProxy.registerClass("Sys.Net.WebServiceProxy");Sys.Net.WebServiceProxy.invoke=function(q,a,m,l,j,b,g,e,w,p){var i=w!==false?Sys.Net.WebServiceProxy._xdomain.exec(q):null,c,n=i&&i.length===3&&(i[1]!==location.protocol||i[2]!==location.host);m=n||m;if(n){p=p||"callback";c="_jsonp"+Sys._jsonp++}if(!l)l={};var r=l;if(!m||!r)r={};var s,h,f=null,k,o=null,u=Sys.Net.WebRequest._createUrl(a?q+"/"+encodeURIComponent(a):q,r,n?p+"=Sys."+c:null);if(n){s=document.createElement("script");s.src=u;k=new Sys._ScriptLoaderTask(s,function(d,b){if(!b||c)t({Message:String.format(Sys.Res.webServiceFailedNoMsg,a)},-1)});function v(){if(f===null)return;f=null;h=new Sys.Net.WebServiceError(true,String.format(Sys.Res.webServiceTimedOut,a));k.dispose();delete Sys[c];if(b)b(h,g,a)}function t(d,e){if(f!==null){window.clearTimeout(f);f=null}k.dispose();delete Sys[c];c=null;if(typeof e!=="undefined"&&e!==200){if(b){h=new Sys.Net.WebServiceError(false,d.Message||String.format(Sys.Res.webServiceFailedNoMsg,a),d.StackTrace||null,d.ExceptionType||null,d);h._statusCode=e;b(h,g,a)}}else if(j)j(d,g,a)}Sys[c]=t;e=e||Sys.Net.WebRequestManager.get_defaultTimeout();if(e>0)f=window.setTimeout(v,e);k.execute();return null}var d=new Sys.Net.WebRequest;d.set_url(u);d.get_headers()["Content-Type"]="application/json; charset=utf-8";if(!m){o=Sys.Serialization.JavaScriptSerializer.serialize(l);if(o==="{}")o=""}d.set_body(o);d.add_completed(x);if(e&&e>0)d.set_timeout(e);d.invoke();function x(d){if(d.get_responseAvailable()){var f=d.get_statusCode(),c=null;try{var e=d.getResponseHeader("Content-Type");if(e.startsWith("application/json"))c=d.get_object();else if(e.startsWith("text/xml"))c=d.get_xml();else c=d.get_responseData()}catch(m){}var k=d.getResponseHeader("jsonerror"),h=k==="true";if(h){if(c)c=new Sys.Net.WebServiceError(false,c.Message,c.StackTrace,c.ExceptionType,c)}else if(e.startsWith("application/json"))c=!c||typeof c.d==="undefined"?c:c.d;if(f<200||f>=300||h){if(b){if(!c||!h)c=new Sys.Net.WebServiceError(false,String.format(Sys.Res.webServiceFailedNoMsg,a));c._statusCode=f;b(c,g,a)}}else if(j)j(c,g,a)}else{var i;if(d.get_timedOut())i=String.format(Sys.Res.webServiceTimedOut,a);else i=String.format(Sys.Res.webServiceFailedNoMsg,a);if(b)b(new Sys.Net.WebServiceError(d.get_timedOut(),i,"",""),g,a)}}return d};Sys.Net.WebServiceProxy._generateTypedConstructor=function(a){return function(b){if(b)for(var c in b)this[c]=b[c];this.__type=a}};Sys._jsonp=0;Sys.Net.WebServiceProxy._xdomain=/^\s*([a-zA-Z0-9\+\-\.]+\:)\/\/([^?#\/]+)/;Sys.Net.WebServiceError=function(d,e,c,a,b){this._timedOut=d;this._message=e;this._stackTrace=c;this._exceptionType=a;this._errorObject=b;this._statusCode=-1};Sys.Net.WebServiceError.prototype={get_timedOut:function(){return this._timedOut},get_statusCode:function(){return this._statusCode},get_message:function(){return this._message},get_stackTrace:function(){return this._stackTrace||""},get_exceptionType:function(){return this._exceptionType||""},get_errorObject:function(){return this._errorObject||null}};Sys.Net.WebServiceError.registerClass("Sys.Net.WebServiceError"); +Type.registerNamespace('Sys');Sys.Res={'argumentInteger':'Value must be an integer.','invokeCalledTwice':'Cannot call invoke more than once.','webServiceFailed':'The server method \'{0}\' failed with the following error: {1}','argumentType':'Object cannot be converted to the required type.','argumentNull':'Value cannot be null.','scriptAlreadyLoaded':'The script \'{0}\' has been referenced multiple times. If referencing Microsoft AJAX scripts explicitly, set the MicrosoftAjaxMode property of the ScriptManager to Explicit.','scriptDependencyNotFound':'The script \'{0}\' failed to load because it is dependent on script \'{1}\'.','formatBadFormatSpecifier':'Format specifier was invalid.','requiredScriptReferenceNotIncluded':'\'{0}\' requires that you have included a script reference to \'{1}\'.','webServiceFailedNoMsg':'The server method \'{0}\' failed.','argumentDomElement':'Value must be a DOM element.','invalidExecutorType':'Could not create a valid Sys.Net.WebRequestExecutor from: {0}.','cannotCallBeforeResponse':'Cannot call {0} when responseAvailable is false.','actualValue':'Actual value was {0}.','enumInvalidValue':'\'{0}\' is not a valid value for enum {1}.','scriptLoadFailed':'The script \'{0}\' could not be loaded.','parameterCount':'Parameter count mismatch.','cannotDeserializeEmptyString':'Cannot deserialize empty string.','formatInvalidString':'Input string was not in a correct format.','invalidTimeout':'Value must be greater than or equal to zero.','cannotAbortBeforeStart':'Cannot abort when executor has not started.','argument':'Value does not fall within the expected range.','cannotDeserializeInvalidJson':'Cannot deserialize. The data does not correspond to valid JSON.','invalidHttpVerb':'httpVerb cannot be set to an empty or null string.','nullWebRequest':'Cannot call executeRequest with a null webRequest.','eventHandlerInvalid':'Handler was not added through the Sys.UI.DomEvent.addHandler method.','cannotSerializeNonFiniteNumbers':'Cannot serialize non finite numbers.','argumentUndefined':'Value cannot be undefined.','webServiceInvalidReturnType':'The server method \'{0}\' returned an invalid type. Expected type: {1}','servicePathNotSet':'The path to the web service has not been set.','argumentTypeWithTypes':'Object of type \'{0}\' cannot be converted to type \'{1}\'.','cannotCallOnceStarted':'Cannot call {0} once started.','badBaseUrl1':'Base URL does not contain ://.','badBaseUrl2':'Base URL does not contain another /.','badBaseUrl3':'Cannot find last / in base URL.','setExecutorAfterActive':'Cannot set executor after it has become active.','paramName':'Parameter name: {0}','nullReferenceInPath':'Null reference while evaluating data path: \'{0}\'.','cannotCallOutsideHandler':'Cannot call {0} outside of a completed event handler.','cannotSerializeObjectWithCycle':'Cannot serialize object with cyclic reference within child properties.','format':'One of the identified items was in an invalid format.','assertFailedCaller':'Assertion Failed: {0}\r\nat {1}','argumentOutOfRange':'Specified argument was out of the range of valid values.','webServiceTimedOut':'The server method \'{0}\' timed out.','notImplemented':'The method or operation is not implemented.','assertFailed':'Assertion Failed: {0}','invalidOperation':'Operation is not valid due to the current state of the object.','breakIntoDebugger':'{0}\r\n\r\nBreak into debugger?'}; diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcAjax.debug.js b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcAjax.debug.js new file mode 100644 index 00000000000..eb68ba7e7e2 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcAjax.debug.js @@ -0,0 +1,408 @@ +//!---------------------------------------------------------- +//! Copyright (C) Microsoft Corporation. All rights reserved. +//!---------------------------------------------------------- +//! MicrosoftMvcAjax.js + +Type.registerNamespace('Sys.Mvc'); + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.AjaxOptions + +Sys.Mvc.$create_AjaxOptions = function Sys_Mvc_AjaxOptions() { return {}; } + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.InsertionMode + +Sys.Mvc.InsertionMode = function() { + /// + /// + /// + /// + /// + /// +}; +Sys.Mvc.InsertionMode.prototype = { + replace: 0, + insertBefore: 1, + insertAfter: 2 +} +Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode', false); + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.AjaxContext + +Sys.Mvc.AjaxContext = function Sys_Mvc_AjaxContext(request, updateTarget, loadingElement, insertionMode) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + this._request = request; + this._updateTarget = updateTarget; + this._loadingElement = loadingElement; + this._insertionMode = insertionMode; +} +Sys.Mvc.AjaxContext.prototype = { + _insertionMode: 0, + _loadingElement: null, + _response: null, + _request: null, + _updateTarget: null, + + get_data: function Sys_Mvc_AjaxContext$get_data() { + /// + if (this._response) { + return this._response.get_responseData(); + } + else { + return null; + } + }, + + get_insertionMode: function Sys_Mvc_AjaxContext$get_insertionMode() { + /// + return this._insertionMode; + }, + + get_loadingElement: function Sys_Mvc_AjaxContext$get_loadingElement() { + /// + return this._loadingElement; + }, + + get_object: function Sys_Mvc_AjaxContext$get_object() { + /// + var executor = this.get_response(); + return (executor) ? executor.get_object() : null; + }, + + get_response: function Sys_Mvc_AjaxContext$get_response() { + /// + return this._response; + }, + set_response: function Sys_Mvc_AjaxContext$set_response(value) { + /// + this._response = value; + return value; + }, + + get_request: function Sys_Mvc_AjaxContext$get_request() { + /// + return this._request; + }, + + get_updateTarget: function Sys_Mvc_AjaxContext$get_updateTarget() { + /// + return this._updateTarget; + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.AsyncHyperlink + +Sys.Mvc.AsyncHyperlink = function Sys_Mvc_AsyncHyperlink() { +} +Sys.Mvc.AsyncHyperlink.handleClick = function Sys_Mvc_AsyncHyperlink$handleClick(anchor, evt, ajaxOptions) { + /// + /// + /// + /// + /// + /// + evt.preventDefault(); + Sys.Mvc.MvcHelpers._asyncRequest(anchor.href, 'post', '', anchor, ajaxOptions); +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.MvcHelpers + +Sys.Mvc.MvcHelpers = function Sys_Mvc_MvcHelpers() { +} +Sys.Mvc.MvcHelpers._serializeSubmitButton = function Sys_Mvc_MvcHelpers$_serializeSubmitButton(element, offsetX, offsetY) { + /// + /// + /// + /// + /// + /// + /// + if (element.disabled) { + return null; + } + var name = element.name; + if (name) { + var tagName = element.tagName.toUpperCase(); + var encodedName = encodeURIComponent(name); + var inputElement = element; + if (tagName === 'INPUT') { + var type = inputElement.type; + if (type === 'submit') { + return encodedName + '=' + encodeURIComponent(inputElement.value); + } + else if (type === 'image') { + return encodedName + '.x=' + offsetX + '&' + encodedName + '.y=' + offsetY; + } + } + else if ((tagName === 'BUTTON') && (name.length) && (inputElement.type === 'submit')) { + return encodedName + '=' + encodeURIComponent(inputElement.value); + } + } + return null; +} +Sys.Mvc.MvcHelpers._serializeForm = function Sys_Mvc_MvcHelpers$_serializeForm(form) { + /// + /// + /// + var formElements = form.elements; + var formBody = new Sys.StringBuilder(); + var count = formElements.length; + for (var i = 0; i < count; i++) { + var element = formElements[i]; + var name = element.name; + if (!name || !name.length) { + continue; + } + var tagName = element.tagName.toUpperCase(); + if (tagName === 'INPUT') { + var inputElement = element; + var type = inputElement.type; + if ((type === 'text') || (type === 'password') || (type === 'hidden') || (((type === 'checkbox') || (type === 'radio')) && element.checked)) { + formBody.append(encodeURIComponent(name)); + formBody.append('='); + formBody.append(encodeURIComponent(inputElement.value)); + formBody.append('&'); + } + } + else if (tagName === 'SELECT') { + var selectElement = element; + var optionCount = selectElement.options.length; + for (var j = 0; j < optionCount; j++) { + var optionElement = selectElement.options[j]; + if (optionElement.selected) { + formBody.append(encodeURIComponent(name)); + formBody.append('='); + formBody.append(encodeURIComponent(optionElement.value)); + formBody.append('&'); + } + } + } + else if (tagName === 'TEXTAREA') { + formBody.append(encodeURIComponent(name)); + formBody.append('='); + formBody.append(encodeURIComponent((element.value))); + formBody.append('&'); + } + } + var additionalInput = form._additionalInput; + if (additionalInput) { + formBody.append(additionalInput); + formBody.append('&'); + } + return formBody.toString(); +} +Sys.Mvc.MvcHelpers._asyncRequest = function Sys_Mvc_MvcHelpers$_asyncRequest(url, verb, body, triggerElement, ajaxOptions) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + if (ajaxOptions.confirm) { + if (!confirm(ajaxOptions.confirm)) { + return; + } + } + if (ajaxOptions.url) { + url = ajaxOptions.url; + } + if (ajaxOptions.httpMethod) { + verb = ajaxOptions.httpMethod; + } + if (body.length > 0 && !body.endsWith('&')) { + body += '&'; + } + body += 'X-Requested-With=XMLHttpRequest'; + var upperCaseVerb = verb.toUpperCase(); + var isGetOrPost = (upperCaseVerb === 'GET' || upperCaseVerb === 'POST'); + if (!isGetOrPost) { + body += '&'; + body += 'X-HTTP-Method-Override=' + upperCaseVerb; + } + var requestBody = ''; + if (upperCaseVerb === 'GET' || upperCaseVerb === 'DELETE') { + if (url.indexOf('?') > -1) { + if (!url.endsWith('&')) { + url += '&'; + } + url += body; + } + else { + url += '?'; + url += body; + } + } + else { + requestBody = body; + } + var request = new Sys.Net.WebRequest(); + request.set_url(url); + if (isGetOrPost) { + request.set_httpVerb(verb); + } + else { + request.set_httpVerb('POST'); + request.get_headers()['X-HTTP-Method-Override'] = upperCaseVerb; + } + request.set_body(requestBody); + if (verb.toUpperCase() === 'PUT') { + request.get_headers()['Content-Type'] = 'application/x-www-form-urlencoded;'; + } + request.get_headers()['X-Requested-With'] = 'XMLHttpRequest'; + var updateElement = null; + if (ajaxOptions.updateTargetId) { + updateElement = $get(ajaxOptions.updateTargetId); + } + var loadingElement = null; + if (ajaxOptions.loadingElementId) { + loadingElement = $get(ajaxOptions.loadingElementId); + } + var ajaxContext = new Sys.Mvc.AjaxContext(request, updateElement, loadingElement, ajaxOptions.insertionMode); + var continueRequest = true; + if (ajaxOptions.onBegin) { + continueRequest = ajaxOptions.onBegin(ajaxContext) !== false; + } + if (loadingElement) { + Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), true); + } + if (continueRequest) { + request.add_completed(Function.createDelegate(null, function(executor) { + Sys.Mvc.MvcHelpers._onComplete(request, ajaxOptions, ajaxContext); + })); + request.invoke(); + } +} +Sys.Mvc.MvcHelpers._onComplete = function Sys_Mvc_MvcHelpers$_onComplete(request, ajaxOptions, ajaxContext) { + /// + /// + /// + /// + /// + /// + ajaxContext.set_response(request.get_executor()); + if (ajaxOptions.onComplete && ajaxOptions.onComplete(ajaxContext) === false) { + return; + } + var statusCode = ajaxContext.get_response().get_statusCode(); + if ((statusCode >= 200 && statusCode < 300) || statusCode === 304 || statusCode === 1223) { + if (statusCode !== 204 && statusCode !== 304 && statusCode !== 1223) { + var contentType = ajaxContext.get_response().getResponseHeader('Content-Type'); + if ((contentType) && (contentType.indexOf('application/x-javascript') !== -1)) { + eval(ajaxContext.get_data()); + } + else { + Sys.Mvc.MvcHelpers.updateDomElement(ajaxContext.get_updateTarget(), ajaxContext.get_insertionMode(), ajaxContext.get_data()); + } + } + if (ajaxOptions.onSuccess) { + ajaxOptions.onSuccess(ajaxContext); + } + } + else { + if (ajaxOptions.onFailure) { + ajaxOptions.onFailure(ajaxContext); + } + } + if (ajaxContext.get_loadingElement()) { + Sys.UI.DomElement.setVisible(ajaxContext.get_loadingElement(), false); + } +} +Sys.Mvc.MvcHelpers.updateDomElement = function Sys_Mvc_MvcHelpers$updateDomElement(target, insertionMode, content) { + /// + /// + /// + /// + /// + /// + if (target) { + switch (insertionMode) { + case Sys.Mvc.InsertionMode.replace: + target.innerHTML = content; + break; + case Sys.Mvc.InsertionMode.insertBefore: + if (content && content.length > 0) { + target.innerHTML = content + target.innerHTML.trimStart(); + } + break; + case Sys.Mvc.InsertionMode.insertAfter: + if (content && content.length > 0) { + target.innerHTML = target.innerHTML.trimEnd() + content; + } + break; + } + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.AsyncForm + +Sys.Mvc.AsyncForm = function Sys_Mvc_AsyncForm() { +} +Sys.Mvc.AsyncForm.handleClick = function Sys_Mvc_AsyncForm$handleClick(form, evt) { + /// + /// + /// + /// + var additionalInput = Sys.Mvc.MvcHelpers._serializeSubmitButton(evt.target, evt.offsetX, evt.offsetY); + form._additionalInput = additionalInput; +} +Sys.Mvc.AsyncForm.handleSubmit = function Sys_Mvc_AsyncForm$handleSubmit(form, evt, ajaxOptions) { + /// + /// + /// + /// + /// + /// + evt.preventDefault(); + var validationCallbacks = form.validationCallbacks; + if (validationCallbacks) { + for (var i = 0; i < validationCallbacks.length; i++) { + var callback = validationCallbacks[i]; + if (!callback()) { + return; + } + } + } + var body = Sys.Mvc.MvcHelpers._serializeForm(form); + Sys.Mvc.MvcHelpers._asyncRequest(form.action, form.method || 'post', body, form, ajaxOptions); +} + + +Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext'); +Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink'); +Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers'); +Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm'); + +// ---- Do not remove this footer ---- +// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) +// ----------------------------------- diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcAjax.js b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcAjax.js new file mode 100644 index 00000000000..c5a6165e7b6 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcAjax.js @@ -0,0 +1,25 @@ +//---------------------------------------------------------- +// Copyright (C) Microsoft Corporation. All rights reserved. +//---------------------------------------------------------- +// MicrosoftMvcAjax.js + +Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_AjaxOptions=function(){return {};} +Sys.Mvc.InsertionMode=function(){};Sys.Mvc.InsertionMode.prototype = {replace:0,insertBefore:1,insertAfter:2} +Sys.Mvc.InsertionMode.registerEnum('Sys.Mvc.InsertionMode',false);Sys.Mvc.AjaxContext=function(request,updateTarget,loadingElement,insertionMode){this.$3=request;this.$4=updateTarget;this.$1=loadingElement;this.$0=insertionMode;} +Sys.Mvc.AjaxContext.prototype={$0:0,$1:null,$2:null,$3:null,$4:null,get_data:function(){if(this.$2){return this.$2.get_responseData();}else{return null;}},get_insertionMode:function(){return this.$0;},get_loadingElement:function(){return this.$1;},get_object:function(){var $0=this.get_response();return ($0)?$0.get_object():null;},get_response:function(){return this.$2;},set_response:function(value){this.$2=value;return value;},get_request:function(){return this.$3;},get_updateTarget:function(){return this.$4;}} +Sys.Mvc.AsyncHyperlink=function(){} +Sys.Mvc.AsyncHyperlink.handleClick=function(anchor,evt,ajaxOptions){evt.preventDefault();Sys.Mvc.MvcHelpers.$2(anchor.href,'post','',anchor,ajaxOptions);} +Sys.Mvc.MvcHelpers=function(){} +Sys.Mvc.MvcHelpers.$0=function($p0,$p1,$p2){if($p0.disabled){return null;}var $0=$p0.name;if($0){var $1=$p0.tagName.toUpperCase();var $2=encodeURIComponent($0);var $3=$p0;if($1==='INPUT'){var $4=$3.type;if($4==='submit'){return $2+'='+encodeURIComponent($3.value);}else if($4==='image'){return $2+'.x='+$p1+'&'+$2+'.y='+$p2;}}else if(($1==='BUTTON')&&($0.length)&&($3.type==='submit')){return $2+'='+encodeURIComponent($3.value);}}return null;} +Sys.Mvc.MvcHelpers.$1=function($p0){var $0=$p0.elements;var $1=new Sys.StringBuilder();var $2=$0.length;for(var $4=0;$4<$2;$4++){var $5=$0[$4];var $6=$5.name;if(!$6||!$6.length){continue;}var $7=$5.tagName.toUpperCase();if($7==='INPUT'){var $8=$5;var $9=$8.type;if(($9==='text')||($9==='password')||($9==='hidden')||((($9==='checkbox')||($9==='radio'))&&$5.checked)){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent($8.value));$1.append('&');}}else if($7==='SELECT'){var $A=$5;var $B=$A.options.length;for(var $C=0;$C<$B;$C++){var $D=$A.options[$C];if($D.selected){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent($D.value));$1.append('&');}}}else if($7==='TEXTAREA'){$1.append(encodeURIComponent($6));$1.append('=');$1.append(encodeURIComponent(($5.value)));$1.append('&');}}var $3=$p0._additionalInput;if($3){$1.append($3);$1.append('&');}return $1.toString();} +Sys.Mvc.MvcHelpers.$2=function($p0,$p1,$p2,$p3,$p4){if($p4.confirm){if(!confirm($p4.confirm)){return;}}if($p4.url){$p0=$p4.url;}if($p4.httpMethod){$p1=$p4.httpMethod;}if($p2.length>0&&!$p2.endsWith('&')){$p2+='&';}$p2+='X-Requested-With=XMLHttpRequest';var $0=$p1.toUpperCase();var $1=($0==='GET'||$0==='POST');if(!$1){$p2+='&';$p2+='X-HTTP-Method-Override='+$0;}var $2='';if($0==='GET'||$0==='DELETE'){if($p0.indexOf('?')>-1){if(!$p0.endsWith('&')){$p0+='&';}$p0+=$p2;}else{$p0+='?';$p0+=$p2;}}else{$2=$p2;}var $3=new Sys.Net.WebRequest();$3.set_url($p0);if($1){$3.set_httpVerb($p1);}else{$3.set_httpVerb('POST');$3.get_headers()['X-HTTP-Method-Override']=$0;}$3.set_body($2);if($p1.toUpperCase()==='PUT'){$3.get_headers()['Content-Type']='application/x-www-form-urlencoded;';}$3.get_headers()['X-Requested-With']='XMLHttpRequest';var $4=null;if($p4.updateTargetId){$4=$get($p4.updateTargetId);}var $5=null;if($p4.loadingElementId){$5=$get($p4.loadingElementId);}var $6=new Sys.Mvc.AjaxContext($3,$4,$5,$p4.insertionMode);var $7=true;if($p4.onBegin){$7=$p4.onBegin($6)!==false;}if($5){Sys.UI.DomElement.setVisible($6.get_loadingElement(),true);}if($7){$3.add_completed(Function.createDelegate(null,function($p1_0){ +Sys.Mvc.MvcHelpers.$3($3,$p4,$6);}));$3.invoke();}} +Sys.Mvc.MvcHelpers.$3=function($p0,$p1,$p2){$p2.set_response($p0.get_executor());if($p1.onComplete&&$p1.onComplete($p2)===false){return;}var $0=$p2.get_response().get_statusCode();if(($0>=200&&$0<300)||$0===304||$0===1223){if($0!==204&&$0!==304&&$0!==1223){var $1=$p2.get_response().getResponseHeader('Content-Type');if(($1)&&($1.indexOf('application/x-javascript')!==-1)){eval($p2.get_data());}else{Sys.Mvc.MvcHelpers.updateDomElement($p2.get_updateTarget(),$p2.get_insertionMode(),$p2.get_data());}}if($p1.onSuccess){$p1.onSuccess($p2);}}else{if($p1.onFailure){$p1.onFailure($p2);}}if($p2.get_loadingElement()){Sys.UI.DomElement.setVisible($p2.get_loadingElement(),false);}} +Sys.Mvc.MvcHelpers.updateDomElement=function(target,insertionMode,content){if(target){switch(insertionMode){case 0:target.innerHTML=content;break;case 1:if(content&&content.length>0){target.innerHTML=content+target.innerHTML.trimStart();}break;case 2:if(content&&content.length>0){target.innerHTML=target.innerHTML.trimEnd()+content;}break;}}} +Sys.Mvc.AsyncForm=function(){} +Sys.Mvc.AsyncForm.handleClick=function(form,evt){var $0=Sys.Mvc.MvcHelpers.$0(evt.target,evt.offsetX,evt.offsetY);form._additionalInput = $0;} +Sys.Mvc.AsyncForm.handleSubmit=function(form,evt,ajaxOptions){evt.preventDefault();var $0=form.validationCallbacks;if($0){for(var $2=0;$2<$0.length;$2++){var $3=$0[$2];if(!$3()){return;}}}var $1=Sys.Mvc.MvcHelpers.$1(form);Sys.Mvc.MvcHelpers.$2(form.action,form.method||'post',$1,form,ajaxOptions);} +Sys.Mvc.AjaxContext.registerClass('Sys.Mvc.AjaxContext');Sys.Mvc.AsyncHyperlink.registerClass('Sys.Mvc.AsyncHyperlink');Sys.Mvc.MvcHelpers.registerClass('Sys.Mvc.MvcHelpers');Sys.Mvc.AsyncForm.registerClass('Sys.Mvc.AsyncForm'); +// ---- Do not remove this footer ---- +// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) +// ----------------------------------- diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcValidation.debug.js b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcValidation.debug.js new file mode 100644 index 00000000000..346ba4818db --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcValidation.debug.js @@ -0,0 +1,883 @@ +//!---------------------------------------------------------- +//! Copyright (C) Microsoft Corporation. All rights reserved. +//!---------------------------------------------------------- +//! MicrosoftMvcValidation.js + + +Type.registerNamespace('Sys.Mvc'); + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.Validation + +Sys.Mvc.$create_Validation = function Sys_Mvc_Validation() { return {}; } + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.JsonValidationField + +Sys.Mvc.$create_JsonValidationField = function Sys_Mvc_JsonValidationField() { return {}; } + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.JsonValidationOptions + +Sys.Mvc.$create_JsonValidationOptions = function Sys_Mvc_JsonValidationOptions() { return {}; } + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.JsonValidationRule + +Sys.Mvc.$create_JsonValidationRule = function Sys_Mvc_JsonValidationRule() { return {}; } + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.ValidationContext + +Sys.Mvc.$create_ValidationContext = function Sys_Mvc_ValidationContext() { return {}; } + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.NumberValidator + +Sys.Mvc.NumberValidator = function Sys_Mvc_NumberValidator() { +} +Sys.Mvc.NumberValidator.create = function Sys_Mvc_NumberValidator$create(rule) { + /// + /// + /// + return Function.createDelegate(new Sys.Mvc.NumberValidator(), new Sys.Mvc.NumberValidator().validate); +} +Sys.Mvc.NumberValidator.prototype = { + + validate: function Sys_Mvc_NumberValidator$validate(value, context) { + /// + /// + /// + /// + /// + if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) { + return true; + } + var n = Number.parseLocale(value); + return (!isNaN(n)); + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.FormContext + +Sys.Mvc.FormContext = function Sys_Mvc_FormContext(formElement, validationSummaryElement) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + this._errors = []; + this.fields = new Array(0); + this._formElement = formElement; + this._validationSummaryElement = validationSummaryElement; + formElement[Sys.Mvc.FormContext._formValidationTag] = this; + if (validationSummaryElement) { + var ulElements = validationSummaryElement.getElementsByTagName('ul'); + if (ulElements.length > 0) { + this._validationSummaryULElement = ulElements[0]; + } + } + this._onClickHandler = Function.createDelegate(this, this._form_OnClick); + this._onSubmitHandler = Function.createDelegate(this, this._form_OnSubmit); +} +Sys.Mvc.FormContext._Application_Load = function Sys_Mvc_FormContext$_Application_Load() { + var allFormOptions = window.mvcClientValidationMetadata; + if (allFormOptions) { + while (allFormOptions.length > 0) { + var thisFormOptions = allFormOptions.pop(); + Sys.Mvc.FormContext._parseJsonOptions(thisFormOptions); + } + } +} +Sys.Mvc.FormContext._getFormElementsWithName = function Sys_Mvc_FormContext$_getFormElementsWithName(formElement, name) { + /// + /// + /// + /// + /// + var allElementsWithNameInForm = []; + var allElementsWithName = document.getElementsByName(name); + for (var i = 0; i < allElementsWithName.length; i++) { + var thisElement = allElementsWithName[i]; + if (Sys.Mvc.FormContext._isElementInHierarchy(formElement, thisElement)) { + Array.add(allElementsWithNameInForm, thisElement); + } + } + return allElementsWithNameInForm; +} +Sys.Mvc.FormContext.getValidationForForm = function Sys_Mvc_FormContext$getValidationForForm(formElement) { + /// + /// + /// + return formElement[Sys.Mvc.FormContext._formValidationTag]; +} +Sys.Mvc.FormContext._isElementInHierarchy = function Sys_Mvc_FormContext$_isElementInHierarchy(parent, child) { + /// + /// + /// + /// + /// + while (child) { + if (parent === child) { + return true; + } + child = child.parentNode; + } + return false; +} +Sys.Mvc.FormContext._parseJsonOptions = function Sys_Mvc_FormContext$_parseJsonOptions(options) { + /// + /// + /// + var formElement = $get(options.FormId); + var validationSummaryElement = (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(options.ValidationSummaryId)) ? $get(options.ValidationSummaryId) : null; + var formContext = new Sys.Mvc.FormContext(formElement, validationSummaryElement); + formContext.enableDynamicValidation(); + formContext.replaceValidationSummary = options.ReplaceValidationSummary; + for (var i = 0; i < options.Fields.length; i++) { + var field = options.Fields[i]; + var fieldElements = Sys.Mvc.FormContext._getFormElementsWithName(formElement, field.FieldName); + var validationMessageElement = (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(field.ValidationMessageId)) ? $get(field.ValidationMessageId) : null; + var fieldContext = new Sys.Mvc.FieldContext(formContext); + Array.addRange(fieldContext.elements, fieldElements); + fieldContext.validationMessageElement = validationMessageElement; + fieldContext.replaceValidationMessageContents = field.ReplaceValidationMessageContents; + for (var j = 0; j < field.ValidationRules.length; j++) { + var rule = field.ValidationRules[j]; + var validator = Sys.Mvc.ValidatorRegistry.getValidator(rule); + if (validator) { + var validation = Sys.Mvc.$create_Validation(); + validation.fieldErrorMessage = rule.ErrorMessage; + validation.validator = validator; + Array.add(fieldContext.validations, validation); + } + } + fieldContext.enableDynamicValidation(); + Array.add(formContext.fields, fieldContext); + } + var registeredValidatorCallbacks = formElement.validationCallbacks; + if (!registeredValidatorCallbacks) { + registeredValidatorCallbacks = []; + formElement.validationCallbacks = registeredValidatorCallbacks; + } + registeredValidatorCallbacks.push(Function.createDelegate(null, function() { + return Sys.Mvc._validationUtil.arrayIsNullOrEmpty(formContext.validate('submit')); + })); + return formContext; +} +Sys.Mvc.FormContext.prototype = { + _onClickHandler: null, + _onSubmitHandler: null, + _submitButtonClicked: null, + _validationSummaryElement: null, + _validationSummaryULElement: null, + _formElement: null, + replaceValidationSummary: false, + + addError: function Sys_Mvc_FormContext$addError(message) { + /// + /// + this.addErrors([ message ]); + }, + + addErrors: function Sys_Mvc_FormContext$addErrors(messages) { + /// + /// + if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(messages)) { + Array.addRange(this._errors, messages); + this._onErrorCountChanged(); + } + }, + + clearErrors: function Sys_Mvc_FormContext$clearErrors() { + Array.clear(this._errors); + this._onErrorCountChanged(); + }, + + _displayError: function Sys_Mvc_FormContext$_displayError() { + if (this._validationSummaryElement) { + if (this._validationSummaryULElement) { + Sys.Mvc._validationUtil.removeAllChildren(this._validationSummaryULElement); + for (var i = 0; i < this._errors.length; i++) { + var liElement = document.createElement('li'); + Sys.Mvc._validationUtil.setInnerText(liElement, this._errors[i]); + this._validationSummaryULElement.appendChild(liElement); + } + } + Sys.UI.DomElement.removeCssClass(this._validationSummaryElement, Sys.Mvc.FormContext._validationSummaryValidCss); + Sys.UI.DomElement.addCssClass(this._validationSummaryElement, Sys.Mvc.FormContext._validationSummaryErrorCss); + } + }, + + _displaySuccess: function Sys_Mvc_FormContext$_displaySuccess() { + var validationSummaryElement = this._validationSummaryElement; + if (validationSummaryElement) { + var validationSummaryULElement = this._validationSummaryULElement; + if (validationSummaryULElement) { + validationSummaryULElement.innerHTML = ''; + } + Sys.UI.DomElement.removeCssClass(validationSummaryElement, Sys.Mvc.FormContext._validationSummaryErrorCss); + Sys.UI.DomElement.addCssClass(validationSummaryElement, Sys.Mvc.FormContext._validationSummaryValidCss); + } + }, + + enableDynamicValidation: function Sys_Mvc_FormContext$enableDynamicValidation() { + Sys.UI.DomEvent.addHandler(this._formElement, 'click', this._onClickHandler); + Sys.UI.DomEvent.addHandler(this._formElement, 'submit', this._onSubmitHandler); + }, + + _findSubmitButton: function Sys_Mvc_FormContext$_findSubmitButton(element) { + /// + /// + /// + if (element.disabled) { + return null; + } + var tagName = element.tagName.toUpperCase(); + var inputElement = element; + if (tagName === 'INPUT') { + var type = inputElement.type; + if (type === 'submit' || type === 'image') { + return inputElement; + } + } + else if ((tagName === 'BUTTON') && (inputElement.type === 'submit')) { + return inputElement; + } + return null; + }, + + _form_OnClick: function Sys_Mvc_FormContext$_form_OnClick(e) { + /// + /// + this._submitButtonClicked = this._findSubmitButton(e.target); + }, + + _form_OnSubmit: function Sys_Mvc_FormContext$_form_OnSubmit(e) { + /// + /// + var form = e.target; + var submitButton = this._submitButtonClicked; + if (submitButton && submitButton.disableValidation) { + return; + } + var errorMessages = this.validate('submit'); + if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(errorMessages)) { + e.preventDefault(); + } + }, + + _onErrorCountChanged: function Sys_Mvc_FormContext$_onErrorCountChanged() { + if (!this._errors.length) { + this._displaySuccess(); + } + else { + this._displayError(); + } + }, + + validate: function Sys_Mvc_FormContext$validate(eventName) { + /// + /// + /// + var fields = this.fields; + var errors = []; + for (var i = 0; i < fields.length; i++) { + var field = fields[i]; + if (!field.elements[0].disabled) { + var thisErrors = field.validate(eventName); + if (thisErrors) { + Array.addRange(errors, thisErrors); + } + } + } + if (this.replaceValidationSummary) { + this.clearErrors(); + this.addErrors(errors); + } + return errors; + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.FieldContext + +Sys.Mvc.FieldContext = function Sys_Mvc_FieldContext(formContext) { + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + this._errors = []; + this.elements = new Array(0); + this.validations = new Array(0); + this.formContext = formContext; + this._onBlurHandler = Function.createDelegate(this, this._element_OnBlur); + this._onChangeHandler = Function.createDelegate(this, this._element_OnChange); + this._onInputHandler = Function.createDelegate(this, this._element_OnInput); + this._onPropertyChangeHandler = Function.createDelegate(this, this._element_OnPropertyChange); +} +Sys.Mvc.FieldContext.prototype = { + _onBlurHandler: null, + _onChangeHandler: null, + _onInputHandler: null, + _onPropertyChangeHandler: null, + defaultErrorMessage: null, + formContext: null, + replaceValidationMessageContents: false, + validationMessageElement: null, + + addError: function Sys_Mvc_FieldContext$addError(message) { + /// + /// + this.addErrors([ message ]); + }, + + addErrors: function Sys_Mvc_FieldContext$addErrors(messages) { + /// + /// + if (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(messages)) { + Array.addRange(this._errors, messages); + this._onErrorCountChanged(); + } + }, + + clearErrors: function Sys_Mvc_FieldContext$clearErrors() { + Array.clear(this._errors); + this._onErrorCountChanged(); + }, + + _displayError: function Sys_Mvc_FieldContext$_displayError() { + var validationMessageElement = this.validationMessageElement; + if (validationMessageElement) { + if (this.replaceValidationMessageContents) { + Sys.Mvc._validationUtil.setInnerText(validationMessageElement, this._errors[0]); + } + Sys.UI.DomElement.removeCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageValidCss); + Sys.UI.DomElement.addCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageErrorCss); + } + var elements = this.elements; + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + Sys.UI.DomElement.removeCssClass(element, Sys.Mvc.FieldContext._inputElementValidCss); + Sys.UI.DomElement.addCssClass(element, Sys.Mvc.FieldContext._inputElementErrorCss); + } + }, + + _displaySuccess: function Sys_Mvc_FieldContext$_displaySuccess() { + var validationMessageElement = this.validationMessageElement; + if (validationMessageElement) { + if (this.replaceValidationMessageContents) { + Sys.Mvc._validationUtil.setInnerText(validationMessageElement, ''); + } + Sys.UI.DomElement.removeCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageErrorCss); + Sys.UI.DomElement.addCssClass(validationMessageElement, Sys.Mvc.FieldContext._validationMessageValidCss); + } + var elements = this.elements; + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + Sys.UI.DomElement.removeCssClass(element, Sys.Mvc.FieldContext._inputElementErrorCss); + Sys.UI.DomElement.addCssClass(element, Sys.Mvc.FieldContext._inputElementValidCss); + } + }, + + _element_OnBlur: function Sys_Mvc_FieldContext$_element_OnBlur(e) { + /// + /// + if (e.target[Sys.Mvc.FieldContext._hasTextChangedTag] || e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) { + this.validate('blur'); + } + }, + + _element_OnChange: function Sys_Mvc_FieldContext$_element_OnChange(e) { + /// + /// + e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true; + }, + + _element_OnInput: function Sys_Mvc_FieldContext$_element_OnInput(e) { + /// + /// + e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true; + if (e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) { + this.validate('input'); + } + }, + + _element_OnPropertyChange: function Sys_Mvc_FieldContext$_element_OnPropertyChange(e) { + /// + /// + if (e.rawEvent.propertyName === 'value') { + e.target[Sys.Mvc.FieldContext._hasTextChangedTag] = true; + if (e.target[Sys.Mvc.FieldContext._hasValidationFiredTag]) { + this.validate('input'); + } + } + }, + + enableDynamicValidation: function Sys_Mvc_FieldContext$enableDynamicValidation() { + var elements = this.elements; + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + if (Sys.Mvc._validationUtil.elementSupportsEvent(element, 'onpropertychange')) { + var compatMode = document.documentMode; + if (compatMode && compatMode >= 8) { + Sys.UI.DomEvent.addHandler(element, 'propertychange', this._onPropertyChangeHandler); + } + } + else { + Sys.UI.DomEvent.addHandler(element, 'input', this._onInputHandler); + } + Sys.UI.DomEvent.addHandler(element, 'change', this._onChangeHandler); + Sys.UI.DomEvent.addHandler(element, 'blur', this._onBlurHandler); + } + }, + + _getErrorString: function Sys_Mvc_FieldContext$_getErrorString(validatorReturnValue, fieldErrorMessage) { + /// + /// + /// + /// + /// + var fallbackErrorMessage = fieldErrorMessage || this.defaultErrorMessage; + if (Boolean.isInstanceOfType(validatorReturnValue)) { + return (validatorReturnValue) ? null : fallbackErrorMessage; + } + if (String.isInstanceOfType(validatorReturnValue)) { + return ((validatorReturnValue).length) ? validatorReturnValue : fallbackErrorMessage; + } + return null; + }, + + _getStringValue: function Sys_Mvc_FieldContext$_getStringValue() { + /// + var elements = this.elements; + return (elements.length > 0) ? elements[0].value : null; + }, + + _markValidationFired: function Sys_Mvc_FieldContext$_markValidationFired() { + var elements = this.elements; + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + element[Sys.Mvc.FieldContext._hasValidationFiredTag] = true; + } + }, + + _onErrorCountChanged: function Sys_Mvc_FieldContext$_onErrorCountChanged() { + if (!this._errors.length) { + this._displaySuccess(); + } + else { + this._displayError(); + } + }, + + validate: function Sys_Mvc_FieldContext$validate(eventName) { + /// + /// + /// + var validations = this.validations; + var errors = []; + var value = this._getStringValue(); + for (var i = 0; i < validations.length; i++) { + var validation = validations[i]; + var context = Sys.Mvc.$create_ValidationContext(); + context.eventName = eventName; + context.fieldContext = this; + context.validation = validation; + var retVal = validation.validator(value, context); + var errorMessage = this._getErrorString(retVal, validation.fieldErrorMessage); + if (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(errorMessage)) { + Array.add(errors, errorMessage); + } + } + this._markValidationFired(); + this.clearErrors(); + this.addErrors(errors); + return errors; + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.RangeValidator + +Sys.Mvc.RangeValidator = function Sys_Mvc_RangeValidator(minimum, maximum) { + /// + /// + /// + /// + /// + /// + /// + /// + this._minimum = minimum; + this._maximum = maximum; +} +Sys.Mvc.RangeValidator.create = function Sys_Mvc_RangeValidator$create(rule) { + /// + /// + /// + var min = rule.ValidationParameters['min']; + var max = rule.ValidationParameters['max']; + return Function.createDelegate(new Sys.Mvc.RangeValidator(min, max), new Sys.Mvc.RangeValidator(min, max).validate); +} +Sys.Mvc.RangeValidator.prototype = { + _minimum: null, + _maximum: null, + + validate: function Sys_Mvc_RangeValidator$validate(value, context) { + /// + /// + /// + /// + /// + if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) { + return true; + } + var n = Number.parseLocale(value); + return (!isNaN(n) && this._minimum <= n && n <= this._maximum); + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.RegularExpressionValidator + +Sys.Mvc.RegularExpressionValidator = function Sys_Mvc_RegularExpressionValidator(pattern) { + /// + /// + /// + /// + this._pattern = pattern; +} +Sys.Mvc.RegularExpressionValidator.create = function Sys_Mvc_RegularExpressionValidator$create(rule) { + /// + /// + /// + var pattern = rule.ValidationParameters['pattern']; + return Function.createDelegate(new Sys.Mvc.RegularExpressionValidator(pattern), new Sys.Mvc.RegularExpressionValidator(pattern).validate); +} +Sys.Mvc.RegularExpressionValidator.prototype = { + _pattern: null, + + validate: function Sys_Mvc_RegularExpressionValidator$validate(value, context) { + /// + /// + /// + /// + /// + if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) { + return true; + } + var regExp = new RegExp(this._pattern); + var matches = regExp.exec(value); + return (!Sys.Mvc._validationUtil.arrayIsNullOrEmpty(matches) && matches[0].length === value.length); + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.RequiredValidator + +Sys.Mvc.RequiredValidator = function Sys_Mvc_RequiredValidator() { +} +Sys.Mvc.RequiredValidator.create = function Sys_Mvc_RequiredValidator$create(rule) { + /// + /// + /// + return Function.createDelegate(new Sys.Mvc.RequiredValidator(), new Sys.Mvc.RequiredValidator().validate); +} +Sys.Mvc.RequiredValidator._isRadioInputElement = function Sys_Mvc_RequiredValidator$_isRadioInputElement(element) { + /// + /// + /// + if (element.tagName.toUpperCase() === 'INPUT') { + var inputType = (element.type).toUpperCase(); + if (inputType === 'RADIO') { + return true; + } + } + return false; +} +Sys.Mvc.RequiredValidator._isSelectInputElement = function Sys_Mvc_RequiredValidator$_isSelectInputElement(element) { + /// + /// + /// + if (element.tagName.toUpperCase() === 'SELECT') { + return true; + } + return false; +} +Sys.Mvc.RequiredValidator._isTextualInputElement = function Sys_Mvc_RequiredValidator$_isTextualInputElement(element) { + /// + /// + /// + if (element.tagName.toUpperCase() === 'INPUT') { + var inputType = (element.type).toUpperCase(); + switch (inputType) { + case 'TEXT': + case 'PASSWORD': + case 'FILE': + return true; + } + } + if (element.tagName.toUpperCase() === 'TEXTAREA') { + return true; + } + return false; +} +Sys.Mvc.RequiredValidator._validateRadioInput = function Sys_Mvc_RequiredValidator$_validateRadioInput(elements) { + /// + /// + /// + for (var i = 0; i < elements.length; i++) { + var element = elements[i]; + if (element.checked) { + return true; + } + } + return false; +} +Sys.Mvc.RequiredValidator._validateSelectInput = function Sys_Mvc_RequiredValidator$_validateSelectInput(optionElements) { + /// + /// + /// + for (var i = 0; i < optionElements.length; i++) { + var element = optionElements[i]; + if (element.selected) { + if (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(element.value)) { + return true; + } + } + } + return false; +} +Sys.Mvc.RequiredValidator._validateTextualInput = function Sys_Mvc_RequiredValidator$_validateTextualInput(element) { + /// + /// + /// + return (!Sys.Mvc._validationUtil.stringIsNullOrEmpty(element.value)); +} +Sys.Mvc.RequiredValidator.prototype = { + + validate: function Sys_Mvc_RequiredValidator$validate(value, context) { + /// + /// + /// + /// + /// + var elements = context.fieldContext.elements; + if (!elements.length) { + return true; + } + var sampleElement = elements[0]; + if (Sys.Mvc.RequiredValidator._isTextualInputElement(sampleElement)) { + return Sys.Mvc.RequiredValidator._validateTextualInput(sampleElement); + } + if (Sys.Mvc.RequiredValidator._isRadioInputElement(sampleElement)) { + return Sys.Mvc.RequiredValidator._validateRadioInput(elements); + } + if (Sys.Mvc.RequiredValidator._isSelectInputElement(sampleElement)) { + return Sys.Mvc.RequiredValidator._validateSelectInput((sampleElement).options); + } + return true; + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.StringLengthValidator + +Sys.Mvc.StringLengthValidator = function Sys_Mvc_StringLengthValidator(minLength, maxLength) { + /// + /// + /// + /// + /// + /// + /// + /// + this._minLength = minLength; + this._maxLength = maxLength; +} +Sys.Mvc.StringLengthValidator.create = function Sys_Mvc_StringLengthValidator$create(rule) { + /// + /// + /// + var minLength = (rule.ValidationParameters['min'] || 0); + var maxLength = (rule.ValidationParameters['max'] || Number.MAX_VALUE); + return Function.createDelegate(new Sys.Mvc.StringLengthValidator(minLength, maxLength), new Sys.Mvc.StringLengthValidator(minLength, maxLength).validate); +} +Sys.Mvc.StringLengthValidator.prototype = { + _maxLength: 0, + _minLength: 0, + + validate: function Sys_Mvc_StringLengthValidator$validate(value, context) { + /// + /// + /// + /// + /// + if (Sys.Mvc._validationUtil.stringIsNullOrEmpty(value)) { + return true; + } + return (this._minLength <= value.length && value.length <= this._maxLength); + } +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc._validationUtil + +Sys.Mvc._validationUtil = function Sys_Mvc__validationUtil() { +} +Sys.Mvc._validationUtil.arrayIsNullOrEmpty = function Sys_Mvc__validationUtil$arrayIsNullOrEmpty(array) { + /// + /// + /// + return (!array || !array.length); +} +Sys.Mvc._validationUtil.stringIsNullOrEmpty = function Sys_Mvc__validationUtil$stringIsNullOrEmpty(value) { + /// + /// + /// + return (!value || !value.length); +} +Sys.Mvc._validationUtil.elementSupportsEvent = function Sys_Mvc__validationUtil$elementSupportsEvent(element, eventAttributeName) { + /// + /// + /// + /// + /// + return (eventAttributeName in element); +} +Sys.Mvc._validationUtil.removeAllChildren = function Sys_Mvc__validationUtil$removeAllChildren(element) { + /// + /// + while (element.firstChild) { + element.removeChild(element.firstChild); + } +} +Sys.Mvc._validationUtil.setInnerText = function Sys_Mvc__validationUtil$setInnerText(element, innerText) { + /// + /// + /// + /// + var textNode = document.createTextNode(innerText); + Sys.Mvc._validationUtil.removeAllChildren(element); + element.appendChild(textNode); +} + + +//////////////////////////////////////////////////////////////////////////////// +// Sys.Mvc.ValidatorRegistry + +Sys.Mvc.ValidatorRegistry = function Sys_Mvc_ValidatorRegistry() { + /// + /// +} +Sys.Mvc.ValidatorRegistry.getValidator = function Sys_Mvc_ValidatorRegistry$getValidator(rule) { + /// + /// + /// + var creator = Sys.Mvc.ValidatorRegistry.validators[rule.ValidationType]; + return (creator) ? creator(rule) : null; +} +Sys.Mvc.ValidatorRegistry._getDefaultValidators = function Sys_Mvc_ValidatorRegistry$_getDefaultValidators() { + /// + return { required: Function.createDelegate(null, Sys.Mvc.RequiredValidator.create), length: Function.createDelegate(null, Sys.Mvc.StringLengthValidator.create), regex: Function.createDelegate(null, Sys.Mvc.RegularExpressionValidator.create), range: Function.createDelegate(null, Sys.Mvc.RangeValidator.create), number: Function.createDelegate(null, Sys.Mvc.NumberValidator.create) }; +} + + +Sys.Mvc.NumberValidator.registerClass('Sys.Mvc.NumberValidator'); +Sys.Mvc.FormContext.registerClass('Sys.Mvc.FormContext'); +Sys.Mvc.FieldContext.registerClass('Sys.Mvc.FieldContext'); +Sys.Mvc.RangeValidator.registerClass('Sys.Mvc.RangeValidator'); +Sys.Mvc.RegularExpressionValidator.registerClass('Sys.Mvc.RegularExpressionValidator'); +Sys.Mvc.RequiredValidator.registerClass('Sys.Mvc.RequiredValidator'); +Sys.Mvc.StringLengthValidator.registerClass('Sys.Mvc.StringLengthValidator'); +Sys.Mvc._validationUtil.registerClass('Sys.Mvc._validationUtil'); +Sys.Mvc.ValidatorRegistry.registerClass('Sys.Mvc.ValidatorRegistry'); +Sys.Mvc.FormContext._validationSummaryErrorCss = 'validation-summary-errors'; +Sys.Mvc.FormContext._validationSummaryValidCss = 'validation-summary-valid'; +Sys.Mvc.FormContext._formValidationTag = '__MVC_FormValidation'; +Sys.Mvc.FieldContext._hasTextChangedTag = '__MVC_HasTextChanged'; +Sys.Mvc.FieldContext._hasValidationFiredTag = '__MVC_HasValidationFired'; +Sys.Mvc.FieldContext._inputElementErrorCss = 'input-validation-error'; +Sys.Mvc.FieldContext._inputElementValidCss = 'input-validation-valid'; +Sys.Mvc.FieldContext._validationMessageErrorCss = 'field-validation-error'; +Sys.Mvc.FieldContext._validationMessageValidCss = 'field-validation-valid'; +Sys.Mvc.ValidatorRegistry.validators = Sys.Mvc.ValidatorRegistry._getDefaultValidators(); + +// ---- Do not remove this footer ---- +// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) +// ----------------------------------- + +// register validation +Sys.Application.add_load(function() { + Sys.Application.remove_load(arguments.callee); + Sys.Mvc.FormContext._Application_Load(); +}); diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcValidation.js b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcValidation.js new file mode 100644 index 00000000000..9483492f119 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/MicrosoftMvcValidation.js @@ -0,0 +1,55 @@ +//---------------------------------------------------------- +// Copyright (C) Microsoft Corporation. All rights reserved. +//---------------------------------------------------------- +// MicrosoftMvcValidation.js + +Type.registerNamespace('Sys.Mvc');Sys.Mvc.$create_Validation=function(){return {};} +Sys.Mvc.$create_JsonValidationField=function(){return {};} +Sys.Mvc.$create_JsonValidationOptions=function(){return {};} +Sys.Mvc.$create_JsonValidationRule=function(){return {};} +Sys.Mvc.$create_ValidationContext=function(){return {};} +Sys.Mvc.NumberValidator=function(){} +Sys.Mvc.NumberValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.NumberValidator(),new Sys.Mvc.NumberValidator().validate);} +Sys.Mvc.NumberValidator.prototype={validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=Number.parseLocale(value);return (!isNaN($0));}} +Sys.Mvc.FormContext=function(formElement,validationSummaryElement){this.$5=[];this.fields=new Array(0);this.$9=formElement;this.$7=validationSummaryElement;formElement['__MVC_FormValidation'] = this;if(validationSummaryElement){var $0=validationSummaryElement.getElementsByTagName('ul');if($0.length>0){this.$8=$0[0];}}this.$3=Function.createDelegate(this,this.$D);this.$4=Function.createDelegate(this,this.$E);} +Sys.Mvc.FormContext._Application_Load=function(){var $0=window.mvcClientValidationMetadata;if($0){while($0.length>0){var $1=$0.pop();Sys.Mvc.FormContext.$12($1);}}} +Sys.Mvc.FormContext.$F=function($p0,$p1){var $0=[];var $1=document.getElementsByName($p1);for(var $2=0;$2<$1.length;$2++){var $3=$1[$2];if(Sys.Mvc.FormContext.$10($p0,$3)){Array.add($0,$3);}}return $0;} +Sys.Mvc.FormContext.getValidationForForm=function(formElement){return formElement['__MVC_FormValidation'];} +Sys.Mvc.FormContext.$10=function($p0,$p1){while($p1){if($p0===$p1){return true;}$p1=$p1.parentNode;}return false;} +Sys.Mvc.FormContext.$12=function($p0){var $0=$get($p0.FormId);var $1=(!Sys.Mvc._ValidationUtil.$1($p0.ValidationSummaryId))?$get($p0.ValidationSummaryId):null;var $2=new Sys.Mvc.FormContext($0,$1);$2.enableDynamicValidation();$2.replaceValidationSummary=$p0.ReplaceValidationSummary;for(var $4=0;$4<$p0.Fields.length;$4++){var $5=$p0.Fields[$4];var $6=Sys.Mvc.FormContext.$F($0,$5.FieldName);var $7=(!Sys.Mvc._ValidationUtil.$1($5.ValidationMessageId))?$get($5.ValidationMessageId):null;var $8=new Sys.Mvc.FieldContext($2);Array.addRange($8.elements,$6);$8.validationMessageElement=$7;$8.replaceValidationMessageContents=$5.ReplaceValidationMessageContents;for(var $9=0;$9<$5.ValidationRules.length;$9++){var $A=$5.ValidationRules[$9];var $B=Sys.Mvc.ValidatorRegistry.getValidator($A);if($B){var $C=Sys.Mvc.$create_Validation();$C.fieldErrorMessage=$A.ErrorMessage;$C.validator=$B;Array.add($8.validations,$C);}}$8.enableDynamicValidation();Array.add($2.fields,$8);}var $3=$0.validationCallbacks;if(!$3){$3=[];$0.validationCallbacks = $3;}$3.push(Function.createDelegate(null,function(){ +return Sys.Mvc._ValidationUtil.$0($2.validate('submit'));}));return $2;} +Sys.Mvc.FormContext.prototype={$3:null,$4:null,$6:null,$7:null,$8:null,$9:null,replaceValidationSummary:false,addError:function(message){this.addErrors([message]);},addErrors:function(messages){if(!Sys.Mvc._ValidationUtil.$0(messages)){Array.addRange(this.$5,messages);this.$11();}},clearErrors:function(){Array.clear(this.$5);this.$11();},$A:function(){if(this.$7){if(this.$8){Sys.Mvc._ValidationUtil.$3(this.$8);for(var $0=0;$0=8){Sys.UI.DomEvent.addHandler($2,'propertychange',this.$9);}}else{Sys.UI.DomEvent.addHandler($2,'input',this.$8);}Sys.UI.DomEvent.addHandler($2,'change',this.$7);Sys.UI.DomEvent.addHandler($2,'blur',this.$6);}},$11:function($p0,$p1){var $0=$p1||this.defaultErrorMessage;if(Boolean.isInstanceOfType($p0)){return ($p0)?null:$0;}if(String.isInstanceOfType($p0)){return (($p0).length)?$p0:$0;}return null;},$12:function(){var $0=this.elements;return ($0.length>0)?$0[0].value:null;},$13:function(){var $0=this.elements;for(var $1=0;$1<$0.length;$1++){var $2=$0[$1];$2['__MVC_HasValidationFired'] = true;}},$14:function(){if(!this.$A.length){this.$C();}else{this.$B();}},validate:function(eventName){var $0=this.validations;var $1=[];var $2=this.$12();for(var $3=0;$3<$0.length;$3++){var $4=$0[$3];var $5=Sys.Mvc.$create_ValidationContext();$5.eventName=eventName;$5.fieldContext=this;$5.validation=$4;var $6=$4.validator($2,$5);var $7=this.$11($6,$4.fieldErrorMessage);if(!Sys.Mvc._ValidationUtil.$1($7)){Array.add($1,$7);}}this.$13();this.clearErrors();this.addErrors($1);return $1;}} +Sys.Mvc.RangeValidator=function(minimum,maximum){this.$0=minimum;this.$1=maximum;} +Sys.Mvc.RangeValidator.create=function(rule){var $0=rule.ValidationParameters['min'];var $1=rule.ValidationParameters['max'];return Function.createDelegate(new Sys.Mvc.RangeValidator($0,$1),new Sys.Mvc.RangeValidator($0,$1).validate);} +Sys.Mvc.RangeValidator.prototype={$0:null,$1:null,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=Number.parseLocale(value);return (!isNaN($0)&&this.$0<=$0&&$0<=this.$1);}} +Sys.Mvc.RegularExpressionValidator=function(pattern){this.$0=pattern;} +Sys.Mvc.RegularExpressionValidator.create=function(rule){var $0=rule.ValidationParameters['pattern'];return Function.createDelegate(new Sys.Mvc.RegularExpressionValidator($0),new Sys.Mvc.RegularExpressionValidator($0).validate);} +Sys.Mvc.RegularExpressionValidator.prototype={$0:null,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}var $0=new RegExp(this.$0);var $1=$0.exec(value);return (!Sys.Mvc._ValidationUtil.$0($1)&&$1[0].length===value.length);}} +Sys.Mvc.RequiredValidator=function(){} +Sys.Mvc.RequiredValidator.create=function(rule){return Function.createDelegate(new Sys.Mvc.RequiredValidator(),new Sys.Mvc.RequiredValidator().validate);} +Sys.Mvc.RequiredValidator.$0=function($p0){if($p0.tagName.toUpperCase()==='INPUT'){var $0=($p0.type).toUpperCase();if($0==='RADIO'){return true;}}return false;} +Sys.Mvc.RequiredValidator.$1=function($p0){if($p0.tagName.toUpperCase()==='SELECT'){return true;}return false;} +Sys.Mvc.RequiredValidator.$2=function($p0){if($p0.tagName.toUpperCase()==='INPUT'){var $0=($p0.type).toUpperCase();switch($0){case 'TEXT':case 'PASSWORD':case 'FILE':return true;}}if($p0.tagName.toUpperCase()==='TEXTAREA'){return true;}return false;} +Sys.Mvc.RequiredValidator.$3=function($p0){for(var $0=0;$0<$p0.length;$0++){var $1=$p0[$0];if($1.checked){return true;}}return false;} +Sys.Mvc.RequiredValidator.$4=function($p0){for(var $0=0;$0<$p0.length;$0++){var $1=$p0[$0];if($1.selected){if(!Sys.Mvc._ValidationUtil.$1($1.value)){return true;}}}return false;} +Sys.Mvc.RequiredValidator.$5=function($p0){return (!Sys.Mvc._ValidationUtil.$1($p0.value));} +Sys.Mvc.RequiredValidator.prototype={validate:function(value,context){var $0=context.fieldContext.elements;if(!$0.length){return true;}var $1=$0[0];if(Sys.Mvc.RequiredValidator.$2($1)){return Sys.Mvc.RequiredValidator.$5($1);}if(Sys.Mvc.RequiredValidator.$0($1)){return Sys.Mvc.RequiredValidator.$3($0);}if(Sys.Mvc.RequiredValidator.$1($1)){return Sys.Mvc.RequiredValidator.$4(($1).options);}return true;}} +Sys.Mvc.StringLengthValidator=function(minLength,maxLength){this.$1=minLength;this.$0=maxLength;} +Sys.Mvc.StringLengthValidator.create=function(rule){var $0=(rule.ValidationParameters['min']||0);var $1=(rule.ValidationParameters['max']||Number.MAX_VALUE);return Function.createDelegate(new Sys.Mvc.StringLengthValidator($0,$1),new Sys.Mvc.StringLengthValidator($0,$1).validate);} +Sys.Mvc.StringLengthValidator.prototype={$0:0,$1:0,validate:function(value,context){if(Sys.Mvc._ValidationUtil.$1(value)){return true;}return (this.$1<=value.length&&value.length<=this.$0);}} +Sys.Mvc._ValidationUtil=function(){} +Sys.Mvc._ValidationUtil.$0=function($p0){return (!$p0||!$p0.length);} +Sys.Mvc._ValidationUtil.$1=function($p0){return (!$p0||!$p0.length);} +Sys.Mvc._ValidationUtil.$2=function($p0,$p1){return ($p1 in $p0);} +Sys.Mvc._ValidationUtil.$3=function($p0){while($p0.firstChild){$p0.removeChild($p0.firstChild);}} +Sys.Mvc._ValidationUtil.$4=function($p0,$p1){var $0=document.createTextNode($p1);Sys.Mvc._ValidationUtil.$3($p0);$p0.appendChild($0);} +Sys.Mvc.ValidatorRegistry=function(){} +Sys.Mvc.ValidatorRegistry.getValidator=function(rule){var $0=Sys.Mvc.ValidatorRegistry.validators[rule.ValidationType];return ($0)?$0(rule):null;} +Sys.Mvc.ValidatorRegistry.$0=function(){return {required:Function.createDelegate(null,Sys.Mvc.RequiredValidator.create),length:Function.createDelegate(null,Sys.Mvc.StringLengthValidator.create),regex:Function.createDelegate(null,Sys.Mvc.RegularExpressionValidator.create),range:Function.createDelegate(null,Sys.Mvc.RangeValidator.create),number:Function.createDelegate(null,Sys.Mvc.NumberValidator.create)};} +Sys.Mvc.NumberValidator.registerClass('Sys.Mvc.NumberValidator');Sys.Mvc.FormContext.registerClass('Sys.Mvc.FormContext');Sys.Mvc.FieldContext.registerClass('Sys.Mvc.FieldContext');Sys.Mvc.RangeValidator.registerClass('Sys.Mvc.RangeValidator');Sys.Mvc.RegularExpressionValidator.registerClass('Sys.Mvc.RegularExpressionValidator');Sys.Mvc.RequiredValidator.registerClass('Sys.Mvc.RequiredValidator');Sys.Mvc.StringLengthValidator.registerClass('Sys.Mvc.StringLengthValidator');Sys.Mvc._ValidationUtil.registerClass('Sys.Mvc._ValidationUtil');Sys.Mvc.ValidatorRegistry.registerClass('Sys.Mvc.ValidatorRegistry');Sys.Mvc.ValidatorRegistry.validators=Sys.Mvc.ValidatorRegistry.$0(); +// ---- Do not remove this footer ---- +// Generated using Script# v0.5.0.0 (http://projects.nikhilk.net) +// ----------------------------------- +Sys.Application.add_load(function(){Sys.Application.remove_load(arguments.callee);Sys.Mvc.FormContext._Application_Load();}); \ No newline at end of file diff --git a/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.1-vsdoc.js b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.1-vsdoc.js new file mode 100644 index 00000000000..8f56f29ea15 --- /dev/null +++ b/IntegrationTests/Azure/ServiceBusAsyncPagesMVC3/Backup/Website/Scripts/jquery-1.5.1-vsdoc.js @@ -0,0 +1,9110 @@ +/* + * This file has been commented to support Visual Studio Intellisense. + * You should not use this file at runtime inside the browser--it is only + * intended to be used only for design-time IntelliSense. Please use the + * standard jQuery library for all production use. + * + * Comment version: 1.5.1 + */ + +/*! + * Note: While Microsoft is not the author of this file, Microsoft is + * offering you a license subject to the terms of the Microsoft Software + * License Terms for Microsoft ASP.NET Model View Controller 3. + * Microsoft reserves all other rights. The notices below are provided + * for informational purposes only and are not the license terms under + * which Microsoft distributed this file. + * + * jQuery JavaScript Library v1.5.1 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * + */ +(function( window, undefined ) { + +// Use the correct document accordingly with window argument (sandbox) +var document = window.document; +var jQuery = (function() { + +// Define a local copy of jQuery +var jQuery = function( selector, context ) { + /// + /// 1: $(expression, context) - This function accepts a string containing a CSS selector which is then used to match a set of elements. + /// 2: $(html) - Create DOM elements on-the-fly from the provided String of raw HTML. + /// 3: $(elements) - Wrap jQuery functionality around a single or multiple DOM Element(s). + /// 4: $(callback) - A shorthand for $(document).ready(). + /// 5: $() - As of jQuery 1.4, if you pass no arguments in to the jQuery() method, an empty jQuery set will be returned. + /// + /// + /// 1: expression - An expression to search with. + /// 2: html - A string of HTML to create on the fly. + /// 3: elements - DOM element(s) to be encapsulated by a jQuery object. + /// 4: callback - The function to execute when the DOM is ready. + /// + /// + /// 1: context - A DOM Element, Document or jQuery to use as context. + /// + /// + + // The jQuery object is actually just the init constructor 'enhanced' + return new jQuery.fn.init( selector, context ); + }, + + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$, + + // A central reference to the root jQuery(document) + rootjQuery, + + // A simple way to check for HTML strings or ID strings + // (both of which we optimize for) + quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/, + + // Is it a simple selector + isSimple = /^.[^:#\[\.,]*$/, + + // Check if a string has a non-whitespace character in it + rnotwhite = /\S/, + rwhite = /\s/, + + // Used for trimming whitespace + trimLeft = /^\s+/, + trimRight = /\s+$/, + + // Check for non-word characters + rnonword = /\W/, + + // Check for digits + rdigit = /\d/, + + // Match a standalone tag + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, + + // JSON RegExp + rvalidchars = /^[\],:{}\s]*$/, + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, + + // Useragent RegExp + rwebkit = /(webkit)[ \/]([\w.]+)/, + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, + rmsie = /(msie) ([\w.]+)/, + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, + + // Keep a UserAgent string for use with jQuery.browser + userAgent = navigator.userAgent, + + // For matching the engine and version of the browser + browserMatch, + + // Has the ready events already been bound? + readyBound = false, + + // The functions to execute on DOM ready + readyList = [], + + // The ready event handler + DOMContentLoaded, + + // Save a reference to some core methods + toString = Object.prototype.toString, + hasOwn = Object.prototype.hasOwnProperty, + push = Array.prototype.push, + slice = Array.prototype.slice, + trim = String.prototype.trim, + indexOf = Array.prototype.indexOf, + + // [[Class]] -> type pairs + class2type = {}; + +jQuery.fn = jQuery.prototype = { + init: function( selector, context ) { + var match, elem, ret, doc; + + // Handle $(""), $(null), or $(undefined) + if ( !selector ) { + return this; + } + + // Handle $(DOMElement) + if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + } + + // The body element only exists once, optimize finding it + if ( selector === "body" && !context && document.body ) { + this.context = document; + this[0] = document.body; + this.selector = "body"; + this.length = 1; + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + // Are we dealing with HTML string or an ID? + match = quickExpr.exec( selector ); + + // Verify a match, and that no context was specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + doc = (context ? context.ownerDocument || context : document); + + // If a single string is passed in and it's a single tag + // just do a createElement and skip the rest + ret = rsingleTag.exec( selector ); + + if ( ret ) { + if ( jQuery.isPlainObject( context ) ) { + selector = [ document.createElement( ret[1] ) ]; + jQuery.fn.attr.call( selector, context, true ); + + } else { + selector = [ doc.createElement( ret[1] ) ]; + } + + } else { + ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); + selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes; + } + + return jQuery.merge( this, selector ); + + // HANDLE: $("#id") + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $("TAG") + } else if ( !context && !rnonword.test( selector ) ) { + this.selector = selector; + this.context = document; + selector = document.getElementsByTagName( selector ); + return jQuery.merge( this, selector ); + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return (context || rootjQuery).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return jQuery( context ).find( selector ); + } + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return rootjQuery.ready( selector ); + } + + if (selector.selector !== undefined) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }, + + // Start with an empty selector + selector: "", + + // The current version of jQuery being used + jquery: "1.4.4", + + // The default length of a jQuery object is 0 + length: 0, + + // The number of elements contained in the matched element set + size: function() { + /// + /// The number of elements currently matched. + /// Part of Core + /// + /// + + return this.length; + }, + + toArray: function() { + /// + /// Retrieve all the DOM elements contained in the jQuery set, as an array. + /// + /// + return slice.call( this, 0 ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + /// + /// Access a single matched element. num is used to access the + /// Nth element matched. + /// Part of Core + /// + /// + /// + /// Access the element in the Nth position. + /// + + return num == null ? + + // Return a 'clean' array + this.toArray() : + + // Return just the object + ( num < 0 ? this.slice(num)[ 0 ] : this[ num ] ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems, name, selector ) { + /// + /// Set the jQuery object to an array of elements, while maintaining + /// the stack. + /// Part of Core + /// + /// + /// + /// An array of elements + /// + + // Build a new jQuery matched element set + var ret = jQuery(); + + if ( jQuery.isArray( elems ) ) { + push.apply( ret, elems ); + + } else { + jQuery.merge( ret, elems ); + } + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + ret.context = this.context; + + if ( name === "find" ) { + ret.selector = this.selector + (this.selector ? " " : "") + selector; + } else if ( name ) { + ret.selector = this.selector + "." + name + "(" + selector + ")"; + } + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + /// + /// Execute a function within the context of every matched element. + /// This means that every time the passed-in function is executed + /// (which is once for every element matched) the 'this' keyword + /// points to the specific element. + /// Additionally, the function, when executed, is passed a single + /// argument representing the position of the element in the matched + /// set. + /// Part of Core + /// + /// + /// + /// A function to execute + /// + + return jQuery.each( this, callback, args ); + }, + + ready: function( fn ) { + /// + /// Binds a function to be executed whenever the DOM is ready to be traversed and manipulated. + /// + /// The function to be executed when the DOM is ready. + + // Attach the listeners + jQuery.bindReady(); + + // If the DOM is already ready + if ( jQuery.isReady ) { + // Execute the function immediately + fn.call( document, jQuery ); + + // Otherwise, remember the function for later + } else if ( readyList ) { + // Add the function to the wait list + readyList.push( fn ); + } + + return this; + }, + + eq: function( i ) { + /// + /// Reduce the set of matched elements to a single element. + /// The position of the element in the set of matched elements + /// starts at 0 and goes to length - 1. + /// Part of Core + /// + /// + /// + /// pos The index of the element that you wish to limit to. + /// + + return i === -1 ? + this.slice( i ) : + this.slice( i, +i + 1 ); + }, + + first: function() { + /// + /// Reduce the set of matched elements to the first in the set. + /// + /// + + return this.eq( 0 ); + }, + + last: function() { + /// + /// Reduce the set of matched elements to the final one in the set. + /// + /// + + return this.eq( -1 ); + }, + + slice: function() { + /// + /// Selects a subset of the matched elements. Behaves exactly like the built-in Array slice method. + /// + /// Where to start the subset (0-based). + /// Where to end the subset (not including the end element itself). + /// If omitted, ends at the end of the selection + /// The sliced elements + + return this.pushStack( slice.apply( this, arguments ), + "slice", slice.call(arguments).join(",") ); + }, + + map: function( callback ) { + /// + /// This member is internal. + /// + /// + /// + + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + end: function() { + /// + /// End the most recent 'destructive' operation, reverting the list of matched elements + /// back to its previous state. After an end operation, the list of matched elements will + /// revert to the last state of matched elements. + /// If there was no destructive operation before, an empty set is returned. + /// Part of DOM/Traversing + /// + /// + + return this.prevObject || jQuery(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: [].sort, + splice: [].splice +}; + +// Give the init function the jQuery prototype for later instantiation +jQuery.fn.init.prototype = jQuery.fn; + +jQuery.extend = jQuery.fn.extend = function() { + /// + /// Extend one object with one or more others, returning the original, + /// modified, object. This is a great utility for simple inheritance. + /// jQuery.extend(settings, options); + /// var settings = jQuery.extend({}, defaults, options); + /// Part of JavaScript + /// + /// + /// The object to extend + /// + /// + /// The object that will be merged into the first. + /// + /// + /// (optional) More objects to merge into the first + /// + /// + + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + target = arguments[1] || {}; + // skip the boolean and the target + i = 2; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( length === i ) { + target = this; + --i; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + noConflict: function( deep ) { + /// + /// Run this function to give control of the $ variable back + /// to whichever library first implemented it. This helps to make + /// sure that jQuery doesn't conflict with the $ object + /// of other libraries. + /// By using this function, you will only be able to access jQuery + /// using the 'jQuery' variable. For example, where you used to do + /// $("div p"), you now must do jQuery("div p"). + /// Part of Core + /// + /// + + window.$ = _$; + + if ( deep ) { + window.jQuery = _jQuery; + } + + return jQuery; + }, + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + /// + /// This method is internal. + /// + /// + + // A third-party is pushing the ready event forwards + if ( wait === true ) { + jQuery.readyWait--; + } + + // Make sure that the DOM is not already loaded + if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready, 1 ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + if ( readyList ) { + // Execute all of them + var fn, + i = 0, + ready = readyList; + + // Reset the list of functions + readyList = null; + + while ( (fn = ready[ i++ ]) ) { + fn.call( document, jQuery ); + } + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger( "ready" ).unbind( "ready" ); + } + } + } + }, + + bindReady: function() { + if ( readyBound ) { + return; + } + + readyBound = true; + + // Catch cases where $(document).ready() is called after the + // browser event has already occurred. + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + return setTimeout( jQuery.ready, 1 ); + } + + // Mozilla, Opera and webkit nightlies currently support this event + if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", jQuery.ready, false ); + + // If IE event model is used + } else if ( document.attachEvent ) { + // ensure firing before onload, + // maybe late but safe also for iframes + document.attachEvent("onreadystatechange", DOMContentLoaded); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", jQuery.ready ); + + // If IE and not a frame + // continually check to see if the document is ready + var toplevel = false; + + try { + toplevel = window.frameElement == null; + } catch(e) {} + + if ( document.documentElement.doScroll && toplevel ) { + doScrollCheck(); + } + } + }, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + /// + /// Determines if the parameter passed is a function. + /// + /// The object to check + /// True if the parameter is a function; otherwise false. + + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + /// + /// Determine if the parameter passed is an array. + /// + /// Object to test whether or not it is an array. + /// True if the parameter is a function; otherwise false. + + return jQuery.type(obj) === "array"; + }, + + // A crude way of determining if an object is a window + isWindow: function( obj ) { + return obj && typeof obj === "object" && "setInterval" in obj; + }, + + isNaN: function( obj ) { + return obj == null || !rdigit.test( obj ) || isNaN( obj ); + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + class2type[ toString.call(obj) ] || "object"; + }, + + isPlainObject: function( obj ) { + /// + /// Check to see if an object is a plain object (created using "{}" or "new Object"). + /// + /// + /// The object that will be checked to see if it's a plain object. + /// + /// + + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + + var key; + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + isEmptyObject: function( obj ) { + /// + /// Check to see if an object is empty (contains no properties). + /// + /// + /// The object that will be checked to see if it's empty. + /// + /// + + for ( var name in obj ) { + return false; + } + return true; + }, + + error: function( msg ) { + throw msg; + }, + + parseJSON: function( data ) { + if ( typeof data !== "string" || !data ) { + return null; + } + + // Make sure leading/trailing whitespace is removed (IE can't handle it) + data = jQuery.trim( data ); + + // Make sure the incoming data is actual JSON + // Logic borrowed from http://json.org/json2.js + if ( rvalidchars.test(data.replace(rvalidescape, "@") + .replace(rvalidtokens, "]") + .replace(rvalidbraces, "")) ) { + + // Try to use the native JSON parser first + return window.JSON && window.JSON.parse ? + window.JSON.parse( data ) : + (new Function("return " + data))(); + + } else { + jQuery.error( "Invalid JSON: " + data ); + } + }, + + noop: function() { + /// + /// An empty function. + /// + /// + }, + + // Evalulates a script in a global context + globalEval: function( data ) { + /// + /// Internally evaluates a script in a global context. + /// + /// + + if ( data && rnotwhite.test(data) ) { + // Inspired by code by Andrea Giammarchi + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html + var head = document.getElementsByTagName("head")[0] || document.documentElement, + script = document.createElement("script"); + + script.type = "text/javascript"; + + if ( jQuery.support.scriptEval ) { + script.appendChild( document.createTextNode( data ) ); + } else { + script.text = data; + } + + // Use insertBefore instead of appendChild to circumvent an IE6 bug. + // This arises when a base node is used (#2709). + head.insertBefore( script, head.firstChild ); + head.removeChild( script ); + } + }, + + nodeName: function( elem, name ) { + /// + /// Checks whether the specified element has the specified DOM node name. + /// + /// The element to examine + /// The node name to check + /// True if the specified node name matches the node's DOM node name; otherwise false + + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); + }, + + // args is for internal usage only + each: function( object, callback, args ) { + /// + /// A generic iterator function, which can be used to seemlessly + /// iterate over both objects and arrays. This function is not the same + /// as $().each() - which is used to iterate, exclusively, over a jQuery + /// object. This function can be used to iterate over anything. + /// The callback has two arguments:the key (objects) or index (arrays) as first + /// the first, and the value as the second. + /// Part of JavaScript + /// + /// + /// The object, or array, to iterate over. + /// + /// + /// The function that will be executed on every object. + /// + /// + + var name, i = 0, + length = object.length, + isObj = length === undefined || jQuery.isFunction(object); + + if ( args ) { + if ( isObj ) { + for ( name in object ) { + if ( callback.apply( object[ name ], args ) === false ) { + break; + } + } + } else { + for ( ; i < length; ) { + if ( callback.apply( object[ i++ ], args ) === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isObj ) { + for ( name in object ) { + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { + break; + } + } + } else { + for ( var value = object[0]; + i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} + } + } + + return object; + }, + + // Use native String.trim function wherever possible + trim: trim ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); + }, + + // results is for internal usage only + makeArray: function( array, results ) { + /// + /// Turns anything into a true array. This is an internal method. + /// + /// Anything to turn into an actual Array + /// + /// + + var ret = results || []; + + if ( array != null ) { + // The window, strings (and functions) also have 'length' + // The extra typeof function check is to prevent crashes + // in Safari 2 (See: #3039) + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 + var type = jQuery.type(array); + + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { + push.call( ret, array ); + } else { + jQuery.merge( ret, array ); + } + } + + return ret; + }, + + inArray: function( elem, array ) { + if ( array.indexOf ) { + return array.indexOf( elem ); + } + + for ( var i = 0, length = array.length; i < length; i++ ) { + if ( array[ i ] === elem ) { + return i; + } + } + + return -1; + }, + + merge: function( first, second ) { + /// + /// Merge two arrays together, removing all duplicates. + /// The new array is: All the results from the first array, followed + /// by the unique results from the second array. + /// Part of JavaScript + /// + /// + /// + /// The first array to merge. + /// + /// + /// The second array to merge. + /// + + var i = first.length, + j = 0; + + if ( typeof second.length === "number" ) { + for ( var l = second.length; j < l; j++ ) { + first[ i++ ] = second[ j ]; + } + + } else { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, inv ) { + /// + /// Filter items out of an array, by using a filter function. + /// The specified function will be passed two arguments: The + /// current array item and the index of the item in the array. The + /// function must return 'true' to keep the item in the array, + /// false to remove it. + /// }); + /// Part of JavaScript + /// + /// + /// + /// array The Array to find items in. + /// + /// + /// The function to process each item against. + /// + /// + /// Invert the selection - select the opposite of the function. + /// + + var ret = [], retVal; + inv = !!inv; + + // Go through the array, only saving the items + // that pass the validator function + for ( var i = 0, length = elems.length; i < length; i++ ) { + retVal = !!callback( elems[ i ], i ); + if ( inv !== retVal ) { + ret.push( elems[ i ] ); + } + } + + return ret; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + /// + /// Translate all items in an array to another array of items. + /// The translation function that is provided to this method is + /// called for each item in the array and is passed one argument: + /// The item to be translated. + /// The function can then return the translated value, 'null' + /// (to remove the item), or an array of values - which will + /// be flattened into the full array. + /// Part of JavaScript + /// + /// + /// + /// array The Array to translate. + /// + /// + /// The function to process each item against. + /// + + var ret = [], value; + + // Go through the array, translating each of the items to their + // new value (or values). + for ( var i = 0, length = elems.length; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret[ ret.length ] = value; + } + } + + return ret.concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + proxy: function( fn, proxy, thisObject ) { + /// + /// Takes a function and returns a new one that will always have a particular scope. + /// + /// + /// The function whose scope will be changed. + /// + /// + /// The object to which the scope of the function should be set. + /// + /// + + if ( arguments.length === 2 ) { + if ( typeof proxy === "string" ) { + thisObject = fn; + fn = thisObject[ proxy ]; + proxy = undefined; + + } else if ( proxy && !jQuery.isFunction( proxy ) ) { + thisObject = proxy; + proxy = undefined; + } + } + + if ( !proxy && fn ) { + proxy = function() { + return fn.apply( thisObject || this, arguments ); + }; + } + + // Set the guid of unique handler to the same of original handler, so it can be removed + if ( fn ) { + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; + } + + // So proxy can be declared as an argument + return proxy; + }, + + // Mutifunctional method to get and set values to a collection + // The value/s can be optionally by executed if its a function + access: function( elems, key, value, exec, fn, pass ) { + var length = elems.length; + + // Setting many attributes + if ( typeof key === "object" ) { + for ( var k in key ) { + jQuery.access( elems, k, key[k], exec, fn, value ); + } + return elems; + } + + // Setting one attribute + if ( value !== undefined ) { + // Optionally, function values get executed if exec is true + exec = !pass && exec && jQuery.isFunction(value); + + for ( var i = 0; i < length; i++ ) { + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); + } + + return elems; + } + + // Getting an attribute + return length ? fn( elems[0], key ) : undefined; + }, + + now: function() { + return (new Date()).getTime(); + }, + + // Use of jQuery.browser is frowned upon. + // More details: http://docs.jquery.com/Utilities/jQuery.browser + uaMatch: function( ua ) { + ua = ua.toLowerCase(); + + var match = rwebkit.exec( ua ) || + ropera.exec( ua ) || + rmsie.exec( ua ) || + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || + []; + + return { browser: match[1] || "", version: match[2] || "0" }; + }, + + browser: {} +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +browserMatch = jQuery.uaMatch( userAgent ); +if ( browserMatch.browser ) { + jQuery.browser[ browserMatch.browser ] = true; + jQuery.browser.version = browserMatch.version; +} + +// Deprecated, use jQuery.browser.webkit instead +if ( jQuery.browser.webkit ) { + jQuery.browser.safari = true; +} + +if ( indexOf ) { + jQuery.inArray = function( elem, array ) { + /// + /// Determines the index of the first parameter in the array. + /// + /// The value to see if it exists in the array. + /// The array to look through for the value + /// The 0-based index of the item if it was found, otherwise -1. + + return indexOf.call( array, elem ); + }; +} + +// Verify that \s matches non-breaking spaces +// (IE fails on this test) +if ( !rwhite.test( "\xA0" ) ) { + trimLeft = /^[\s\xA0]+/; + trimRight = /[\s\xA0]+$/; +} + +// All jQuery objects should point back to these +rootjQuery = jQuery(document); + +// Cleanup functions for the document ready method +if ( document.addEventListener ) { + DOMContentLoaded = function() { + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); + jQuery.ready(); + }; + +} else if ( document.attachEvent ) { + DOMContentLoaded = function() { + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( document.readyState === "complete" ) { + document.detachEvent( "onreadystatechange", DOMContentLoaded ); + jQuery.ready(); + } + }; +} + +// The DOM ready check for Internet Explorer +function doScrollCheck() { + if ( jQuery.isReady ) { + return; + } + + try { + // If IE is used, use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + document.documentElement.doScroll("left"); + } catch(e) { + setTimeout( doScrollCheck, 1 ); + return; + } + + // and execute any waiting functions + jQuery.ready(); +} + +// Expose jQuery to the global object +return (window.jQuery = window.$ = jQuery); + +})(); + + + +// [vsdoc] The following function has been modified for IntelliSense. +// [vsdoc] Stubbing support properties to "false" for IntelliSense compat. +(function() { + + jQuery.support = {}; + + // var root = document.documentElement, + // script = document.createElement("script"), + // div = document.createElement("div"), + // id = "script" + jQuery.now(); + + // div.style.display = "none"; + // div.innerHTML = "
a"; + + // var all = div.getElementsByTagName("*"), + // a = div.getElementsByTagName("a")[0], + // select = document.createElement("select"), + // opt = select.appendChild( document.createElement("option") ); + + // // Can't get basic test support + // if ( !all || !all.length || !a ) { + // return; + // } + + jQuery.support = { + // IE strips leading whitespace when .innerHTML is used + leadingWhitespace: false, + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + tbody: false, + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + htmlSerialize: false, + + // Get the style information from getAttribute + // (IE uses .cssText insted) + style: false, + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + hrefNormalized: false, + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + opacity: false, + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + cssFloat: false, + + // Make sure that if no value is specified for a checkbox + // that it defaults to "on". + // (WebKit defaults to "" instead) + checkOn: false, + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + optSelected: false, + + // Will be defined later + deleteExpando: false, + optDisabled: false, + checkClone: false, + scriptEval: false, + noCloneEvent: false, + boxModel: false, + inlineBlockNeedsLayout: false, + shrinkWrapBlocks: false, + reliableHiddenOffsets: true + }; + + // // Make sure that the options inside disabled selects aren't marked as disabled + // // (WebKit marks them as diabled) + // select.disabled = true; + // jQuery.support.optDisabled = !opt.disabled; + + // script.type = "text/javascript"; + // try { + // script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); + // } catch(e) {} + + // root.insertBefore( script, root.firstChild ); + + // // Make sure that the execution of code works by injecting a script + // // tag with appendChild/createTextNode + // // (IE doesn't support this, fails, and uses .text instead) + // if ( window[ id ] ) { + // jQuery.support.scriptEval = true; + // delete window[ id ]; + // } + + // // Test to see if it's possible to delete an expando from an element + // // Fails in Internet Explorer + // try { + // delete script.test; + + // } catch(e) { + // jQuery.support.deleteExpando = false; + // } + + // root.removeChild( script ); + + // if ( div.attachEvent && div.fireEvent ) { + // div.attachEvent("onclick", function click() { + // // Cloning a node shouldn't copy over any + // // bound event handlers (IE does this) + // jQuery.support.noCloneEvent = false; + // div.detachEvent("onclick", click); + // }); + // div.cloneNode(true).fireEvent("onclick"); + // } + + // div = document.createElement("div"); + // div.innerHTML = ""; + + // var fragment = document.createDocumentFragment(); + // fragment.appendChild( div.firstChild ); + + // // WebKit doesn't clone checked state correctly in fragments + // jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; + + // // Figure out if the W3C box model works as expected + // // document.body must exist before we can do this + // jQuery(function() { + // var div = document.createElement("div"); + // div.style.width = div.style.paddingLeft = "1px"; + + // document.body.appendChild( div ); + // jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; + + // if ( "zoom" in div.style ) { + // // Check if natively block-level elements act like inline-block + // // elements when setting their display to 'inline' and giving + // // them layout + // // (IE < 8 does this) + // div.style.display = "inline"; + // div.style.zoom = 1; + // jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2; + + // // Check if elements with layout shrink-wrap their children + // // (IE 6 does this) + // div.style.display = ""; + // div.innerHTML = "
"; + // jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; + // } + + // div.innerHTML = "
t
"; + // var tds = div.getElementsByTagName("td"); + + // // Check if table cells still have offsetWidth/Height when they are set + // // to display:none and there are still other visible table cells in a + // // table row; if so, offsetWidth/Height are not reliable for use when + // // determining if an element has been hidden directly using + // // display:none (it is still safe to use offsets if a parent element is + // // hidden; don safety goggles and see bug #4512 for more information). + // // (only IE 8 fails this test) + // jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0; + + // tds[0].style.display = ""; + // tds[1].style.display = "none"; + + // // Check if empty table cells still have offsetWidth/Height + // // (IE < 8 fail this test) + // jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0; + // div.innerHTML = ""; + + // document.body.removeChild( div ).style.display = "none"; + // div = tds = null; + // }); + + // // Technique from Juriy Zaytsev + // // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ + // var eventSupported = function( eventName ) { + // var el = document.createElement("div"); + // eventName = "on" + eventName; + + // var isSupported = (eventName in el); + // if ( !isSupported ) { + // el.setAttribute(eventName, "return;"); + // isSupported = typeof el[eventName] === "function"; + // } + // el = null; + + // return isSupported; + // }; + + jQuery.support.submitBubbles = false; + jQuery.support.changeBubbles = false; + + // // release memory in IE + // root = script = div = all = a = null; +})(); + + + +var windowData = {}, + rbrace = /^(?:\{.*\}|\[.*\])$/; + +jQuery.extend({ + cache: {}, + + // Please use with caution + uuid: 0, + + // Unique for each copy of jQuery on the page + expando: "jQuery" + jQuery.now(), + + // The following elements throw uncatchable exceptions if you + // attempt to add expando properties to them. + noData: { + "embed": true, + // Ban all objects except for Flash (which handle expandos) + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", + "applet": true + }, + + data: function( elem, name, data ) { + /// + /// Store arbitrary data associated with the specified element. + /// + /// + /// The DOM element to associate with the data. + /// + /// + /// A string naming the piece of data to set. + /// + /// + /// The new data value. + /// + /// + + if ( !jQuery.acceptData( elem ) ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var isNode = elem.nodeType, + id = isNode ? elem[ jQuery.expando ] : null, + cache = jQuery.cache, thisCache; + + if ( isNode && !id && typeof name === "string" && data === undefined ) { + return; + } + + // Get the data from the object directly + if ( !isNode ) { + cache = elem; + + // Compute a unique ID for the element + } else if ( !id ) { + elem[ jQuery.expando ] = id = ++jQuery.uuid; + } + + // Avoid generating a new cache unless none exists and we + // want to manipulate it. + if ( typeof name === "object" ) { + if ( isNode ) { + cache[ id ] = jQuery.extend(cache[ id ], name); + + } else { + jQuery.extend( cache, name ); + } + + } else if ( isNode && !cache[ id ] ) { + cache[ id ] = {}; + } + + thisCache = isNode ? cache[ id ] : cache; + + // Prevent overriding the named cache with undefined values + if ( data !== undefined ) { + thisCache[ name ] = data; + } + + return typeof name === "string" ? thisCache[ name ] : thisCache; + }, + + removeData: function( elem, name ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + elem = elem == window ? + windowData : + elem; + + var isNode = elem.nodeType, + id = isNode ? elem[ jQuery.expando ] : elem, + cache = jQuery.cache, + thisCache = isNode ? cache[ id ] : id; + + // If we want to remove a specific section of the element's data + if ( name ) { + if ( thisCache ) { + // Remove the section of cache data + delete thisCache[ name ]; + + // If we've removed all the data, remove the element's cache + if ( isNode && jQuery.isEmptyObject(thisCache) ) { + jQuery.removeData( elem ); + } + } + + // Otherwise, we want to remove all of the element's data + } else { + if ( isNode && jQuery.support.deleteExpando ) { + delete elem[ jQuery.expando ]; + + } else if ( elem.removeAttribute ) { + elem.removeAttribute( jQuery.expando ); + + // Completely remove the data cache + } else if ( isNode ) { + delete cache[ id ]; + + // Remove all fields from the object + } else { + for ( var n in elem ) { + delete elem[ n ]; + } + } + } + }, + + // A method for determining if a DOM node can handle the data expando + acceptData: function( elem ) { + if ( elem.nodeName ) { + var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; + + if ( match ) { + return !(match === true || elem.getAttribute("classid") !== match); + } + } + + return true; + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + /// + /// Store arbitrary data associated with the matched elements. + /// + /// + /// A string naming the piece of data to set. + /// + /// + /// The new data value. + /// + /// + + var data = null; + + if ( typeof key === "undefined" ) { + if ( this.length ) { + var attr = this[0].attributes, name; + data = jQuery.data( this[0] ); + + for ( var i = 0, l = attr.length; i < l; i++ ) { + name = attr[i].name; + + if ( name.indexOf( "data-" ) === 0 ) { + name = name.substr( 5 ); + dataAttr( this[0], name, data[ name ] ); + } + } + } + + return data; + + } else if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + var parts = key.split("."); + parts[1] = parts[1] ? "." + parts[1] : ""; + + if ( value === undefined ) { + data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); + + // Try to fetch any internally stored data first + if ( data === undefined && this.length ) { + data = jQuery.data( this[0], key ); + data = dataAttr( this[0], key, data ); + } + + return data === undefined && parts[1] ? + this.data( parts[0] ) : + data; + + } else { + return this.each(function() { + var $this = jQuery( this ), + args = [ parts[0], value ]; + + $this.triggerHandler( "setData" + parts[1] + "!", args ); + jQuery.data( this, key, value ); + $this.triggerHandler( "changeData" + parts[1] + "!", args ); + }); + } + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + data = elem.getAttribute( "data-" + key ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + !jQuery.isNaN( data ) ? parseFloat( data ) : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + + + + +jQuery.extend({ + queue: function( elem, type, data ) { + if ( !elem ) { + return; + } + + type = (type || "fx") + "queue"; + var q = jQuery.data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( !data ) { + return q || []; + } + + if ( !q || jQuery.isArray(data) ) { + q = jQuery.data( elem, type, jQuery.makeArray(data) ); + + } else { + q.push( data ); + } + + return q; + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + fn = queue.shift(); + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + } + + if ( fn ) { + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift("inprogress"); + } + + fn.call(elem, function() { + jQuery.dequeue(elem, type); + }); + } + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + /// + /// 1: queue() - Returns a reference to the first element's queue (which is an array of functions). + /// 2: queue(callback) - Adds a new function, to be executed, onto the end of the queue of all matched elements. + /// 3: queue(queue) - Replaces the queue of all matched element with this new queue (the array of functions). + /// + /// The function to add to the queue. + /// + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + } + + if ( data === undefined ) { + return jQuery.queue( this[0], type ); + } + return this.each(function( i ) { + var queue = jQuery.queue( this, type, data ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + /// + /// Removes a queued function from the front of the queue and executes it. + /// + /// The type of queue to access. + /// + + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + + // Based off of the plugin by Clint Helfers, with permission. + // http://blindsignals.com/index.php/2009/07/jquery-delay/ + delay: function( time, type ) { + /// + /// Set a timer to delay execution of subsequent items in the queue. + /// + /// + /// An integer indicating the number of milliseconds to delay execution of the next item in the queue. + /// + /// + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// + /// + + time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; + type = type || "fx"; + + return this.queue( type, function() { + var elem = this; + setTimeout(function() { + jQuery.dequeue( elem, type ); + }, time ); + }); + }, + + clearQueue: function( type ) { + /// + /// Remove from the queue all items that have not yet been run. + /// + /// + /// A string containing the name of the queue. Defaults to fx, the standard effects queue. + /// + /// + + return this.queue( type || "fx", [] ); + } +}); + + + + +var rclass = /[\n\t]/g, + rspaces = /\s+/, + rreturn = /\r/g, + rspecialurl = /^(?:href|src|style)$/, + rtype = /^(?:button|input)$/i, + rfocusable = /^(?:button|input|object|select|textarea)$/i, + rclickable = /^a(?:rea)?$/i, + rradiocheck = /^(?:radio|checkbox)$/i; + +jQuery.props = { + "for": "htmlFor", + "class": "className", + readonly: "readOnly", + maxlength: "maxLength", + cellspacing: "cellSpacing", + rowspan: "rowSpan", + colspan: "colSpan", + tabindex: "tabIndex", + usemap: "useMap", + frameborder: "frameBorder" +}; + +jQuery.fn.extend({ + attr: function( name, value ) { + /// + /// Set a single property to a computed value, on all matched elements. + /// Instead of a value, a function is provided, that computes the value. + /// Part of DOM/Attributes + /// + /// + /// + /// The name of the property to set. + /// + /// + /// A function returning the value to set. + /// + + return jQuery.access( this, name, value, true, jQuery.attr ); + }, + + removeAttr: function( name, fn ) { + /// + /// Remove an attribute from each of the matched elements. + /// Part of DOM/Attributes + /// + /// + /// An attribute to remove. + /// + /// + + return this.each(function(){ + jQuery.attr( this, name, "" ); + if ( this.nodeType === 1 ) { + this.removeAttribute( name ); + } + }); + }, + + addClass: function( value ) { + /// + /// Adds the specified class(es) to each of the set of matched elements. + /// Part of DOM/Attributes + /// + /// + /// One or more class names to be added to the class attribute of each matched element. + /// + /// + + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.addClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( value && typeof value === "string" ) { + var classNames = (value || "").split( rspaces ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 ) { + if ( !elem.className ) { + elem.className = value; + + } else { + var className = " " + elem.className + " ", + setClass = elem.className; + + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { + setClass += " " + classNames[c]; + } + } + elem.className = jQuery.trim( setClass ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + /// + /// Removes all or the specified class(es) from the set of matched elements. + /// Part of DOM/Attributes + /// + /// + /// (Optional) A class name to be removed from the class attribute of each matched element. + /// + /// + + if ( jQuery.isFunction(value) ) { + return this.each(function(i) { + var self = jQuery(this); + self.removeClass( value.call(this, i, self.attr("class")) ); + }); + } + + if ( (value && typeof value === "string") || value === undefined ) { + var classNames = (value || "").split( rspaces ); + + for ( var i = 0, l = this.length; i < l; i++ ) { + var elem = this[i]; + + if ( elem.nodeType === 1 && elem.className ) { + if ( value ) { + var className = (" " + elem.className + " ").replace(rclass, " "); + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { + className = className.replace(" " + classNames[c] + " ", " "); + } + elem.className = jQuery.trim( className ); + + } else { + elem.className = ""; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + /// + /// Add or remove a class from each element in the set of matched elements, depending + /// on either the class's presence or the value of the switch argument. + /// + /// + /// A class name to be toggled for each element in the matched set. + /// + /// + /// A boolean value to determine whether the class should be added or removed. + /// + /// + + var type = typeof value, + isBool = typeof stateVal === "boolean"; + + if ( jQuery.isFunction( value ) ) { + return this.each(function(i) { + var self = jQuery(this); + self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + state = stateVal, + classNames = value.split( rspaces ); + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space seperated list + state = isBool ? state : !self.hasClass( className ); + self[ state ? "addClass" : "removeClass" ]( className ); + } + + } else if ( type === "undefined" || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery.data( this, "__className__", this.className ); + } + + // toggle whole className + this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + /// + /// Checks the current selection against a class and returns whether at least one selection has a given class. + /// + /// The class to check against + /// True if at least one element in the selection has the class, otherwise false. + + var className = " " + selector + " "; + for ( var i = 0, l = this.length; i < l; i++ ) { + if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { + return true; + } + } + + return false; + }, + + val: function( value ) { + /// + /// Set the value of every matched element. + /// Part of DOM/Attributes + /// + /// + /// + /// A string of text or an array of strings to set as the value property of each + /// matched element. + /// + + if ( !arguments.length ) { + var elem = this[0]; + + if ( elem ) { + if ( jQuery.nodeName( elem, "option" ) ) { + // attributes.value is undefined in Blackberry 4.7 but + // uses .value. See #6932 + var val = elem.attributes.value; + return !val || val.specified ? elem.value : elem.text; + } + + // We need to handle select boxes special + if ( jQuery.nodeName( elem, "select" ) ) { + var index = elem.selectedIndex, + values = [], + options = elem.options, + one = elem.type === "select-one"; + + // Nothing was selected + if ( index < 0 ) { + return null; + } + + // Loop through all the selected options + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { + var option = options[ i ]; + + // Don't return options that are disabled or in a disabled optgroup + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { + + // Get the specific value for the option + value = jQuery(option).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + } + + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified + if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { + return elem.getAttribute("value") === null ? "on" : elem.value; + } + + + // Everything else, we just grab the value + return (elem.value || "").replace(rreturn, ""); + + } + + return undefined; + } + + var isFunction = jQuery.isFunction(value); + + return this.each(function(i) { + var self = jQuery(this), val = value; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call(this, i, self.val()); + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray(val) ) { + val = jQuery.map(val, function (value) { + return value == null ? "" : value + ""; + }); + } + + if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { + this.checked = jQuery.inArray( self.val(), val ) >= 0; + + } else if ( jQuery.nodeName( this, "select" ) ) { + var values = jQuery.makeArray(val); + + jQuery( "option", this ).each(function() { + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; + }); + + if ( !values.length ) { + this.selectedIndex = -1; + } + + } else { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + attrFn: { + val: true, + css: true, + html: true, + text: true, + data: true, + width: true, + height: true, + offset: true + }, + + attr: function( elem, name, value, pass ) { + /// + /// This method is internal. + /// + /// + + // don't set attributes on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + if ( pass && name in jQuery.attrFn ) { + return jQuery(elem)[name](value); + } + + var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), + // Whether we are setting (or getting) + set = value !== undefined; + + // Try to normalize/fix the name + name = notxml && jQuery.props[ name ] || name; + + // These attributes require special treatment + var special = rspecialurl.test( name ); + + // Safari mis-reports the default selected property of an option + // Accessing the parent's selectedIndex property fixes it + if ( name === "selected" && !jQuery.support.optSelected ) { + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + + // If applicable, access the attribute via the DOM 0 way + // 'in' checks fail in Blackberry 4.7 #6931 + if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) { + if ( set ) { + // We can't allow the type property to be changed (since it causes problems in IE) + if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { + jQuery.error( "type property can't be changed" ); + } + + if ( value === null ) { + if ( elem.nodeType === 1 ) { + elem.removeAttribute( name ); + } + + } else { + elem[ name ] = value; + } + } + + // browsers index elements by id/name on forms, give priority to attributes. + if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { + return elem.getAttributeNode( name ).nodeValue; + } + + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + if ( name === "tabIndex" ) { + var attributeNode = elem.getAttributeNode( "tabIndex" ); + + return attributeNode && attributeNode.specified ? + attributeNode.value : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + undefined; + } + + return elem[ name ]; + } + + if ( !jQuery.support.style && notxml && name === "style" ) { + if ( set ) { + elem.style.cssText = "" + value; + } + + return elem.style.cssText; + } + + if ( set ) { + // convert the value to a string (all browsers do this but IE) see #1070 + elem.setAttribute( name, "" + value ); + } + + // Ensure that missing attributes return undefined + // Blackberry 4.7 returns "" from getAttribute #6938 + if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) { + return undefined; + } + + var attr = !jQuery.support.hrefNormalized && notxml && special ? + // Some attributes require a special call on IE + elem.getAttribute( name, 2 ) : + elem.getAttribute( name ); + + // Non-existent attributes return null, we normalize to undefined + return attr === null ? undefined : attr; + } +}); + + + + +var rnamespaces = /\.(.*)$/, + rformElems = /^(?:textarea|input|select)$/i, + rperiod = /\./g, + rspace = / /g, + rescape = /[^\w\s.|`]/g, + fcleanup = function( nm ) { + return nm.replace(rescape, "\\$&"); + }, + focusCounts = { focusin: 0, focusout: 0 }; + +/* + * A number of helper functions used for managing events. + * Many of the ideas behind this code originated from + * Dean Edwards' addEvent library. + */ +jQuery.event = { + + // Bind an event to an element + // Original by Dean Edwards + add: function( elem, types, handler, data ) { + /// + /// This method is internal. + /// + /// + + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // For whatever reason, IE has trouble passing the window object + // around, causing it to be cloned in the process + if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) { + elem = window; + } + + if ( handler === false ) { + handler = returnFalse; + } else if ( !handler ) { + // Fixes bug #7229. Fix recommended by jdalton + return; + } + + var handleObjIn, handleObj; + + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + } + + // Make sure that the function being executed has a unique ID + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure + var elemData = jQuery.data( elem ); + + // If no elemData is found then we must be trying to bind to one of the + // banned noData elements + if ( !elemData ) { + return; + } + + // Use a key less likely to result in collisions for plain JS objects. + // Fixes bug #7150. + var eventKey = elem.nodeType ? "events" : "__events__", + events = elemData[ eventKey ], + eventHandle = elemData.handle; + + if ( typeof events === "function" ) { + // On plain objects events is a fn that holds the the data + // which prevents this data from being JSON serialized + // the function does not need to be called, it just contains the data + eventHandle = events.handle; + events = events.events; + + } else if ( !events ) { + if ( !elem.nodeType ) { + // On plain objects, create a fn that acts as the holder + // of the values to avoid JSON serialization of event data + elemData[ eventKey ] = elemData = function(){}; + } + + elemData.events = events = {}; + } + + if ( !eventHandle ) { + elemData.handle = eventHandle = function() { + // Handle the second event of a trigger and when + // an event is called after a page has unloaded + return typeof jQuery !== "undefined" && !jQuery.event.triggered ? + jQuery.event.handle.apply( eventHandle.elem, arguments ) : + undefined; + }; + } + + // Add elem as a property of the handle function + // This is to prevent a memory leak with non-native events in IE. + eventHandle.elem = elem; + + // Handle multiple events separated by a space + // jQuery(...).bind("mouseover mouseout", fn); + types = types.split(" "); + + var type, i = 0, namespaces; + + while ( (type = types[ i++ ]) ) { + handleObj = handleObjIn ? + jQuery.extend({}, handleObjIn) : + { handler: handler, data: data }; + + // Namespaced event handlers + if ( type.indexOf(".") > -1 ) { + namespaces = type.split("."); + type = namespaces.shift(); + handleObj.namespace = namespaces.slice(0).sort().join("."); + + } else { + namespaces = []; + handleObj.namespace = ""; + } + + handleObj.type = type; + if ( !handleObj.guid ) { + handleObj.guid = handler.guid; + } + + // Get the current list of functions bound to this event + var handlers = events[ type ], + special = jQuery.event.special[ type ] || {}; + + // Init the event handler queue + if ( !handlers ) { + handlers = events[ type ] = []; + + // Check for a special event handler + // Only use addEventListener/attachEvent if the special + // events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add the function to the element's handler list + handlers.push( handleObj ); + + // Keep track of which events have been used, for global triggering + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + global: {}, + + // Detach an event or set of events from an element + remove: function( elem, types, handler ) { + /// + /// This method is internal. + /// + /// + + // don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + if ( handler === false ) { + handler = returnFalse; + } + + var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, + eventKey = elem.nodeType ? "events" : "__events__", + elemData = jQuery.data( elem ), + events = elemData && elemData[ eventKey ]; + + if ( !elemData || !events ) { + return; + } + + if ( typeof events === "function" ) { + elemData = events; + events = events.events; + } + + // types is actually an event object here + if ( types && types.type ) { + handler = types.handler; + types = types.type; + } + + // Unbind all events for the element + if ( !types || typeof types === "string" && types.charAt(0) === "." ) { + types = types || ""; + + for ( type in events ) { + jQuery.event.remove( elem, type + types ); + } + + return; + } + + // Handle multiple events separated by a space + // jQuery(...).unbind("mouseover mouseout", fn); + types = types.split(" "); + + while ( (type = types[ i++ ]) ) { + origType = type; + handleObj = null; + all = type.indexOf(".") < 0; + namespaces = []; + + if ( !all ) { + // Namespaced event handlers + namespaces = type.split("."); + type = namespaces.shift(); + + namespace = new RegExp("(^|\\.)" + + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + eventType = events[ type ]; + + if ( !eventType ) { + continue; + } + + if ( !handler ) { + for ( j = 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( all || namespace.test( handleObj.namespace ) ) { + jQuery.event.remove( elem, origType, handleObj.handler, j ); + eventType.splice( j--, 1 ); + } + } + + continue; + } + + special = jQuery.event.special[ type ] || {}; + + for ( j = pos || 0; j < eventType.length; j++ ) { + handleObj = eventType[ j ]; + + if ( handler.guid === handleObj.guid ) { + // remove the given handler for the given type + if ( all || namespace.test( handleObj.namespace ) ) { + if ( pos == null ) { + eventType.splice( j--, 1 ); + } + + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + + if ( pos != null ) { + break; + } + } + } + + // remove generic event handler if no more handlers exist + if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + ret = null; + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + var handle = elemData.handle; + if ( handle ) { + handle.elem = null; + } + + delete elemData.events; + delete elemData.handle; + + if ( typeof elemData === "function" ) { + jQuery.removeData( elem, eventKey ); + + } else if ( jQuery.isEmptyObject( elemData ) ) { + jQuery.removeData( elem ); + } + } + }, + + // bubbling is internal + trigger: function( event, data, elem /*, bubbling */ ) { + /// + /// This method is internal. + /// + /// + + // Event object or event type + var type = event.type || event, + bubbling = arguments[3]; + + if ( !bubbling ) { + event = typeof event === "object" ? + // jQuery.Event object + event[ jQuery.expando ] ? event : + // Object literal + jQuery.extend( jQuery.Event(type), event ) : + // Just the event type (string) + jQuery.Event(type); + + if ( type.indexOf("!") >= 0 ) { + event.type = type = type.slice(0, -1); + event.exclusive = true; + } + + // Handle a global trigger + if ( !elem ) { + // Don't bubble custom events when global (to avoid too much overhead) + event.stopPropagation(); + + // Only trigger if we've ever bound an event for it + if ( jQuery.event.global[ type ] ) { + jQuery.each( jQuery.cache, function() { + if ( this.events && this.events[type] ) { + jQuery.event.trigger( event, data, this.handle.elem ); + } + }); + } + } + + // Handle triggering a single element + + // don't do events on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { + return undefined; + } + + // Clean up in case it is reused + event.result = undefined; + event.target = elem; + + // Clone the incoming data, if any + data = jQuery.makeArray( data ); + data.unshift( event ); + } + + event.currentTarget = elem; + + // Trigger the event, it is assumed that "handle" is a function + var handle = elem.nodeType ? + jQuery.data( elem, "handle" ) : + (jQuery.data( elem, "__events__" ) || {}).handle; + + if ( handle ) { + handle.apply( elem, data ); + } + + var parent = elem.parentNode || elem.ownerDocument; + + // Trigger an inline bound script + try { + if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { + if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { + event.result = false; + event.preventDefault(); + } + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (inlineError) {} + + if ( !event.isPropagationStopped() && parent ) { + jQuery.event.trigger( event, data, parent, true ); + + } else if ( !event.isDefaultPrevented() ) { + var old, + target = event.target, + targetType = type.replace( rnamespaces, "" ), + isClick = jQuery.nodeName( target, "a" ) && targetType === "click", + special = jQuery.event.special[ targetType ] || {}; + + if ( (!special._default || special._default.call( elem, event ) === false) && + !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { + + try { + if ( target[ targetType ] ) { + // Make sure that we don't accidentally re-trigger the onFOO events + old = target[ "on" + targetType ]; + + if ( old ) { + target[ "on" + targetType ] = null; + } + + jQuery.event.triggered = true; + target[ targetType ](); + } + + // prevent IE from throwing an error for some elements with some event types, see #3533 + } catch (triggerError) {} + + if ( old ) { + target[ "on" + targetType ] = old; + } + + jQuery.event.triggered = false; + } + } + }, + + handle: function( event ) { + /// + /// This method is internal. + /// + /// + + var all, handlers, namespaces, namespace_re, events, + namespace_sort = [], + args = jQuery.makeArray( arguments ); + + event = args[0] = jQuery.event.fix( event || window.event ); + event.currentTarget = this; + + // Namespaced event handlers + all = event.type.indexOf(".") < 0 && !event.exclusive; + + if ( !all ) { + namespaces = event.type.split("."); + event.type = namespaces.shift(); + namespace_sort = namespaces.slice(0).sort(); + namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.namespace = event.namespace || namespace_sort.join("."); + + events = jQuery.data(this, this.nodeType ? "events" : "__events__"); + + if ( typeof events === "function" ) { + events = events.events; + } + + handlers = (events || {})[ event.type ]; + + if ( events && handlers ) { + // Clone the handlers to prevent manipulation + handlers = handlers.slice(0); + + for ( var j = 0, l = handlers.length; j < l; j++ ) { + var handleObj = handlers[ j ]; + + // Filter the functions by class + if ( all || namespace_re.test( handleObj.namespace ) ) { + // Pass in a reference to the handler function itself + // So that we can later remove it + event.handler = handleObj.handler; + event.data = handleObj.data; + event.handleObj = handleObj; + + var ret = handleObj.handler.apply( this, args ); + + if ( ret !== undefined ) { + event.result = ret; + if ( ret === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + } + + return event.result; + }, + + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), + + fix: function( event ) { + /// + /// This method is internal. + /// + /// + + if ( event[ jQuery.expando ] ) { + return event; + } + + // store a copy of the original event object + // and "clone" to set read-only properties + var originalEvent = event; + event = jQuery.Event( originalEvent ); + + for ( var i = this.props.length, prop; i; ) { + prop = this.props[ --i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Fix target property, if necessary + if ( !event.target ) { + // Fixes #1925 where srcElement might not be defined either + event.target = event.srcElement || document; + } + + // check if target is a textnode (safari) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && event.fromElement ) { + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; + } + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && event.clientX != null ) { + var doc = document.documentElement, + body = document.body; + + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + + // Add which for key events + if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { + event.which = event.charCode != null ? event.charCode : event.keyCode; + } + + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) + if ( !event.metaKey && event.ctrlKey ) { + event.metaKey = event.ctrlKey; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && event.button !== undefined ) { + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); + } + + return event; + }, + + // Deprecated, use jQuery.guid instead + guid: 1E8, + + // Deprecated, use jQuery.proxy instead + proxy: jQuery.proxy, + + special: { + ready: { + // Make sure the ready event is setup + setup: jQuery.bindReady, + teardown: jQuery.noop + }, + + live: { + add: function( handleObj ) { + jQuery.event.add( this, + liveConvert( handleObj.origType, handleObj.selector ), + jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); + }, + + remove: function( handleObj ) { + jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); + } + }, + + beforeunload: { + setup: function( data, namespaces, eventHandle ) { + // We only want to do this special case on windows + if ( jQuery.isWindow( this ) ) { + this.onbeforeunload = eventHandle; + } + }, + + teardown: function( namespaces, eventHandle ) { + if ( this.onbeforeunload === eventHandle ) { + this.onbeforeunload = null; + } + } + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + if ( elem.detachEvent ) { + elem.detachEvent( "on" + type, handle ); + } + }; + +jQuery.Event = function( src ) { + // Allow instantiation without the 'new' keyword + if ( !this.preventDefault ) { + return new jQuery.Event( src ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + // Event type + } else { + this.type = src; + } + + // timeStamp is buggy for some events on Firefox(#3843) + // So we won't rely on the native value + this.timeStamp = jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +function returnFalse() { + return false; +} +function returnTrue() { + return true; +} + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + preventDefault: function() { + this.isDefaultPrevented = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + + // if preventDefault exists run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // otherwise set the returnValue property of the original event to false (IE) + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + this.isPropagationStopped = returnTrue; + + var e = this.originalEvent; + if ( !e ) { + return; + } + // if stopPropagation exists run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + // otherwise set the cancelBubble property of the original event to true (IE) + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + }, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse +}; + +// Checks if an event happened on an element within another element +// Used in jQuery.event.special.mouseenter and mouseleave handlers +var withinElement = function( event ) { + // Check if mouse(over|out) are still within the same parent element + var parent = event.relatedTarget; + + // Firefox sometimes assigns relatedTarget a XUL element + // which we cannot access the parentNode property of + try { + // Traverse up the tree + while ( parent && parent !== this ) { + parent = parent.parentNode; + } + + if ( parent !== this ) { + // set the correct event type + event.type = event.data; + + // handle event if we actually just moused on to a non sub-element + jQuery.event.handle.apply( this, arguments ); + } + + // assuming we've left the element since we most likely mousedover a xul element + } catch(e) { } +}, + +// In case of event delegation, we only need to rename the event.type, +// liveHandler will take care of the rest. +delegate = function( event ) { + event.type = event.data; + jQuery.event.handle.apply( this, arguments ); +}; + +// Create mouseenter and mouseleave events +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + setup: function( data ) { + jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); + }, + teardown: function( data ) { + jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); + } + }; +}); + +// submit delegation +if ( !jQuery.support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function( data, namespaces ) { + if ( this.nodeName.toLowerCase() !== "form" ) { + jQuery.event.add(this, "click.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { + e.liveFired = undefined; + return trigger( "submit", this, arguments ); + } + }); + + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { + var elem = e.target, + type = elem.type; + + if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { + e.liveFired = undefined; + return trigger( "submit", this, arguments ); + } + }); + + } else { + return false; + } + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialSubmit" ); + } + }; + +} + +// change delegation, happens here so we have bind. +if ( !jQuery.support.changeBubbles ) { + + var changeFilters, + + getVal = function( elem ) { + var type = elem.type, val = elem.value; + + if ( type === "radio" || type === "checkbox" ) { + val = elem.checked; + + } else if ( type === "select-multiple" ) { + val = elem.selectedIndex > -1 ? + jQuery.map( elem.options, function( elem ) { + return elem.selected; + }).join("-") : + ""; + + } else if ( elem.nodeName.toLowerCase() === "select" ) { + val = elem.selectedIndex; + } + + return val; + }, + + testChange = function testChange( e ) { + var elem = e.target, data, val; + + if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { + return; + } + + data = jQuery.data( elem, "_change_data" ); + val = getVal(elem); + + // the current data will be also retrieved by beforeactivate + if ( e.type !== "focusout" || elem.type !== "radio" ) { + jQuery.data( elem, "_change_data", val ); + } + + if ( data === undefined || val === data ) { + return; + } + + if ( data != null || val ) { + e.type = "change"; + e.liveFired = undefined; + return jQuery.event.trigger( e, arguments[1], elem ); + } + }; + + jQuery.event.special.change = { + filters: { + focusout: testChange, + + beforedeactivate: testChange, + + click: function( e ) { + var elem = e.target, type = elem.type; + + if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { + return testChange.call( this, e ); + } + }, + + // Change has to be called before submit + // Keydown will be called before keypress, which is used in submit-event delegation + keydown: function( e ) { + var elem = e.target, type = elem.type; + + if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || + (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || + type === "select-multiple" ) { + return testChange.call( this, e ); + } + }, + + // Beforeactivate happens also before the previous element is blurred + // with this event you can't trigger a change event, but you can store + // information + beforeactivate: function( e ) { + var elem = e.target; + jQuery.data( elem, "_change_data", getVal(elem) ); + } + }, + + setup: function( data, namespaces ) { + if ( this.type === "file" ) { + return false; + } + + for ( var type in changeFilters ) { + jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); + } + + return rformElems.test( this.nodeName ); + }, + + teardown: function( namespaces ) { + jQuery.event.remove( this, ".specialChange" ); + + return rformElems.test( this.nodeName ); + } + }; + + changeFilters = jQuery.event.special.change.filters; + + // Handle when the input is .focus()'d + changeFilters.focus = changeFilters.beforeactivate; +} + +function trigger( type, elem, args ) { + args[0].type = type; + return jQuery.event.handle.apply( elem, args ); +} + +// Create "bubbling" focus and blur events +if ( document.addEventListener ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + jQuery.event.special[ fix ] = { + setup: function() { + /// + /// This method is internal. + /// + /// + + if ( focusCounts[fix]++ === 0 ) { + document.addEventListener( orig, handler, true ); + } + }, + teardown: function() { + /// + /// This method is internal. + /// + /// + + if ( --focusCounts[fix] === 0 ) { + document.removeEventListener( orig, handler, true ); + } + } + }; + + function handler( e ) { + e = jQuery.event.fix( e ); + e.type = fix; + return jQuery.event.trigger( e, null, e.target ); + } + }); +} + +// jQuery.each(["bind", "one"], function( i, name ) { +// jQuery.fn[ name ] = function( type, data, fn ) { +// // Handle object literals +// if ( typeof type === "object" ) { +// for ( var key in type ) { +// this[ name ](key, data, type[key], fn); +// } +// return this; +// } + +// if ( jQuery.isFunction( data ) || data === false ) { +// fn = data; +// data = undefined; +// } + +// var handler = name === "one" ? jQuery.proxy( fn, function( event ) { +// jQuery( this ).unbind( event, handler ); +// return fn.apply( this, arguments ); +// }) : fn; + +// if ( type === "unload" && name !== "one" ) { +// this.one( type, data, fn ); + +// } else { +// for ( var i = 0, l = this.length; i < l; i++ ) { +// jQuery.event.add( this[i], type, handler, data ); +// } +// } + +// return this; +// }; +// }); + +jQuery.fn[ "bind" ] = function( type, data, fn ) { + /// + /// Binds a handler to one or more events for each matched element. Can also bind custom events. + /// + /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . + /// Additional data passed to the event handler as event.data + /// A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element. + + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ "bind" ](key, data, type[key], fn); + } + return this; + } + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + var handler = "bind" === "one" ? jQuery.proxy( fn, function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }) : fn; + + return type === "unload" && "bind" !== "one" ? + this.one( type, data, fn ) : + this.each(function() { + jQuery.event.add( this, type, handler, data ); + }); +}; + +jQuery.fn[ "one" ] = function( type, data, fn ) { + /// + /// Binds a handler to one or more events to be executed exactly once for each matched element. + /// + /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . + /// Additional data passed to the event handler as event.data + /// A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element. + + // Handle object literals + if ( typeof type === "object" ) { + for ( var key in type ) { + this[ "one" ](key, data, type[key], fn); + } + return this; + } + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + var handler = "one" === "one" ? jQuery.proxy( fn, function( event ) { + jQuery( this ).unbind( event, handler ); + return fn.apply( this, arguments ); + }) : fn; + + return type === "unload" && "one" !== "one" ? + this.one( type, data, fn ) : + this.each(function() { + jQuery.event.add( this, type, handler, data ); + }); +}; + +jQuery.fn.extend({ + unbind: function( type, fn ) { + /// + /// Unbinds a handler from one or more events for each matched element. + /// + /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . + /// A function to bind to the event on each of the set of matched elements. function callback(eventObject) such that this corresponds to the dom element. + + // Handle object literals + if ( typeof type === "object" && !type.preventDefault ) { + for ( var key in type ) { + this.unbind(key, type[key]); + } + + } else { + for ( var i = 0, l = this.length; i < l; i++ ) { + jQuery.event.remove( this[i], type, fn ); + } + } + + return this; + }, + + delegate: function( selector, types, data, fn ) { + return this.live( types, data, fn, selector ); + }, + + undelegate: function( selector, types, fn ) { + if ( arguments.length === 0 ) { + return this.unbind( "live" ); + + } else { + return this.die( types, null, fn, selector ); + } + }, + + trigger: function( type, data ) { + /// + /// Triggers a type of event on every matched element. + /// + /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . + /// Additional data passed to the event handler as additional arguments. + /// This parameter is undocumented. + + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + + triggerHandler: function( type, data ) { + /// + /// Triggers all bound event handlers on an element for a specific event type without executing the browser's default actions. + /// + /// One or more event types separated by a space. Built-in event type values are: blur, focus, load, resize, scroll, unload, click, dblclick, mousedown, mouseup, mousemove, mouseover, mouseout, mouseenter, mouseleave, change, select, submit, keydown, keypress, keyup, error . + /// Additional data passed to the event handler as additional arguments. + /// This parameter is undocumented. + + if ( this[0] ) { + var event = jQuery.Event( type ); + event.preventDefault(); + event.stopPropagation(); + jQuery.event.trigger( event, data, this[0] ); + return event.result; + } + }, + + toggle: function( fn ) { + /// + /// Toggles among two or more function calls every other click. + /// + /// The functions among which to toggle execution + + // Save reference to arguments for access in closure + var args = arguments, + i = 1; + + // link all the functions, so any of them can unbind this click handler + while ( i < args.length ) { + jQuery.proxy( fn, args[ i++ ] ); + } + + return this.click( jQuery.proxy( fn, function( event ) { + // Figure out which function to execute + var lastToggle = ( jQuery.data( this, "lastToggle" + fn.guid ) || 0 ) % i; + jQuery.data( this, "lastToggle" + fn.guid, lastToggle + 1 ); + + // Make sure that clicks stop + event.preventDefault(); + + // and execute the function + return args[ lastToggle ].apply( this, arguments ) || false; + })); + }, + + hover: function( fnOver, fnOut ) { + /// + /// Simulates hovering (moving the mouse on or off of an object). + /// + /// The function to fire when the mouse is moved over a matched element. + /// The function to fire when the mouse is moved off of a matched element. + + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + } +}); + +var liveMap = { + focus: "focusin", + blur: "focusout", + mouseenter: "mouseover", + mouseleave: "mouseout" +}; + +// jQuery.each(["live", "die"], function( i, name ) { +// jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { +// var type, i = 0, match, namespaces, preType, +// selector = origSelector || this.selector, +// context = origSelector ? this : jQuery( this.context ); + +// if ( typeof types === "object" && !types.preventDefault ) { +// for ( var key in types ) { +// context[ name ]( key, data, types[key], selector ); +// } + +// return this; +// } + +// if ( jQuery.isFunction( data ) ) { +// fn = data; +// data = undefined; +// } + +// types = (types || "").split(" "); + +// while ( (type = types[ i++ ]) != null ) { +// match = rnamespaces.exec( type ); +// namespaces = ""; + +// if ( match ) { +// namespaces = match[0]; +// type = type.replace( rnamespaces, "" ); +// } + +// if ( type === "hover" ) { +// types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); +// continue; +// } + +// preType = type; + +// if ( type === "focus" || type === "blur" ) { +// types.push( liveMap[ type ] + namespaces ); +// type = type + namespaces; + +// } else { +// type = (liveMap[ type ] || type) + namespaces; +// } + +// if ( name === "live" ) { +// // bind live handler +// for ( var j = 0, l = context.length; j < l; j++ ) { +// jQuery.event.add( context[j], "live." + liveConvert( type, selector ), +// { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); +// } + +// } else { +// // unbind live handler +// context.unbind( "live." + liveConvert( type, selector ), fn ); +// } +// } + +// return this; +// }; +// }); + +jQuery.fn[ "live" ] = function( types, data, fn ) { + /// + /// Attach a handler to the event for all elements which match the current selector, now or + /// in the future. + /// + /// + /// A string containing a JavaScript event type, such as "click" or "keydown". + /// + /// + /// A map of data that will be passed to the event handler. + /// + /// + /// A function to execute at the time the event is triggered. + /// + /// + + var type, i = 0; + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + types = (types || "").split( /\s+/ ); + + while ( (type = types[ i++ ]) != null ) { + type = type === "focus" ? "focusin" : // focus --> focusin + type === "blur" ? "focusout" : // blur --> focusout + type === "hover" ? types.push("mouseleave") && "mouseenter" : // hover support + type; + + if ( "live" === "live" ) { + // bind live handler + jQuery( this.context ).bind( liveConvert( type, this.selector ), { + data: data, selector: this.selector, live: type + }, fn ); + + } else { + // unbind live handler + jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null ); + } + } + + return this; +} + +jQuery.fn[ "die" ] = function( types, data, fn ) { + /// + /// Remove all event handlers previously attached using .live() from the elements. + /// + /// + /// A string containing a JavaScript event type, such as click or keydown. + /// + /// + /// The function that is to be no longer executed. + /// + /// + + var type, i = 0; + + if ( jQuery.isFunction( data ) ) { + fn = data; + data = undefined; + } + + types = (types || "").split( /\s+/ ); + + while ( (type = types[ i++ ]) != null ) { + type = type === "focus" ? "focusin" : // focus --> focusin + type === "blur" ? "focusout" : // blur --> focusout + type === "hover" ? types.push("mouseleave") && "mouseenter" : // hover support + type; + + if ( "die" === "live" ) { + // bind live handler + jQuery( this.context ).bind( liveConvert( type, this.selector ), { + data: data, selector: this.selector, live: type + }, fn ); + + } else { + // unbind live handler + jQuery( this.context ).unbind( liveConvert( type, this.selector ), fn ? { guid: fn.guid + this.selector + type } : null ); + } + } + + return this; +} + +function liveHandler( event ) { + var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, + elems = [], + selectors = [], + events = jQuery.data( this, this.nodeType ? "events" : "__events__" ); + + if ( typeof events === "function" ) { + events = events.events; + } + + // Make sure we avoid non-left-click bubbling in Firefox (#3861) + if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) { + return; + } + + if ( event.namespace ) { + namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); + } + + event.liveFired = this; + + var live = events.live.slice(0); + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { + selectors.push( handleObj.selector ); + + } else { + live.splice( j--, 1 ); + } + } + + match = jQuery( event.target ).closest( selectors, event.currentTarget ); + + for ( i = 0, l = match.length; i < l; i++ ) { + close = match[i]; + + for ( j = 0; j < live.length; j++ ) { + handleObj = live[j]; + + if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) { + elem = close.elem; + related = null; + + // Those two events require additional checking + if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { + event.type = handleObj.preType; + related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; + } + + if ( !related || related !== elem ) { + elems.push({ elem: elem, handleObj: handleObj, level: close.level }); + } + } + } + } + + for ( i = 0, l = elems.length; i < l; i++ ) { + match = elems[i]; + + if ( maxLevel && match.level > maxLevel ) { + break; + } + + event.currentTarget = match.elem; + event.data = match.handleObj.data; + event.handleObj = match.handleObj; + + ret = match.handleObj.origHandler.apply( match.elem, arguments ); + + if ( ret === false || event.isPropagationStopped() ) { + maxLevel = match.level; + + if ( ret === false ) { + stop = false; + } + if ( event.isImmediatePropagationStopped() ) { + break; + } + } + } + + return stop; +} + +function liveConvert( type, selector ) { + return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&"); +} + +// jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + +// "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + +// "change select submit keydown keypress keyup error").split(" "), function( i, name ) { + +// // Handle event binding +// jQuery.fn[ name ] = function( data, fn ) { +// if ( fn == null ) { +// fn = data; +// data = null; +// } + +// return arguments.length > 0 ? +// this.bind( name, data, fn ) : +// this.trigger( name ); +// }; + +// if ( jQuery.attrFn ) { +// jQuery.attrFn[ name ] = true; +// } +// }); + +jQuery.fn[ "blur" ] = function( fn ) { + /// + /// 1: blur() - Triggers the blur event of each matched element. + /// 2: blur(fn) - Binds a function to the blur event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "blur", fn ) : this.trigger( "blur" ); +}; + +jQuery.fn[ "focus" ] = function( fn ) { + /// + /// 1: focus() - Triggers the focus event of each matched element. + /// 2: focus(fn) - Binds a function to the focus event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "focus", fn ) : this.trigger( "focus" ); +}; + +jQuery.fn[ "focusin" ] = function( fn ) { + /// + /// Bind an event handler to the "focusin" JavaScript event. + /// + /// + /// A function to execute each time the event is triggered. + /// + /// + + return fn ? this.bind( "focusin", fn ) : this.trigger( "focusin" ); +}; + +jQuery.fn[ "focusout" ] = function( fn ) { + /// + /// Bind an event handler to the "focusout" JavaScript event. + /// + /// + /// A function to execute each time the event is triggered. + /// + /// + + return fn ? this.bind( "focusout", fn ) : this.trigger( "focusout" ); +}; + +jQuery.fn[ "load" ] = function( fn ) { + /// + /// 1: load() - Triggers the load event of each matched element. + /// 2: load(fn) - Binds a function to the load event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "load", fn ) : this.trigger( "load" ); +}; + +jQuery.fn[ "resize" ] = function( fn ) { + /// + /// 1: resize() - Triggers the resize event of each matched element. + /// 2: resize(fn) - Binds a function to the resize event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "resize", fn ) : this.trigger( "resize" ); +}; + +jQuery.fn[ "scroll" ] = function( fn ) { + /// + /// 1: scroll() - Triggers the scroll event of each matched element. + /// 2: scroll(fn) - Binds a function to the scroll event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "scroll", fn ) : this.trigger( "scroll" ); +}; + +jQuery.fn[ "unload" ] = function( fn ) { + /// + /// 1: unload() - Triggers the unload event of each matched element. + /// 2: unload(fn) - Binds a function to the unload event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "unload", fn ) : this.trigger( "unload" ); +}; + +jQuery.fn[ "click" ] = function( fn ) { + /// + /// 1: click() - Triggers the click event of each matched element. + /// 2: click(fn) - Binds a function to the click event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "click", fn ) : this.trigger( "click" ); +}; + +jQuery.fn[ "dblclick" ] = function( fn ) { + /// + /// 1: dblclick() - Triggers the dblclick event of each matched element. + /// 2: dblclick(fn) - Binds a function to the dblclick event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "dblclick", fn ) : this.trigger( "dblclick" ); +}; + +jQuery.fn[ "mousedown" ] = function( fn ) { + /// + /// Binds a function to the mousedown event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "mousedown", fn ) : this.trigger( "mousedown" ); +}; + +jQuery.fn[ "mouseup" ] = function( fn ) { + /// + /// Bind a function to the mouseup event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "mouseup", fn ) : this.trigger( "mouseup" ); +}; + +jQuery.fn[ "mousemove" ] = function( fn ) { + /// + /// Bind a function to the mousemove event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "mousemove", fn ) : this.trigger( "mousemove" ); +}; + +jQuery.fn[ "mouseover" ] = function( fn ) { + /// + /// Bind a function to the mouseover event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "mouseover", fn ) : this.trigger( "mouseover" ); +}; + +jQuery.fn[ "mouseout" ] = function( fn ) { + /// + /// Bind a function to the mouseout event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "mouseout", fn ) : this.trigger( "mouseout" ); +}; + +jQuery.fn[ "mouseenter" ] = function( fn ) { + /// + /// Bind a function to the mouseenter event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "mouseenter", fn ) : this.trigger( "mouseenter" ); +}; + +jQuery.fn[ "mouseleave" ] = function( fn ) { + /// + /// Bind a function to the mouseleave event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "mouseleave", fn ) : this.trigger( "mouseleave" ); +}; + +jQuery.fn[ "change" ] = function( fn ) { + /// + /// 1: change() - Triggers the change event of each matched element. + /// 2: change(fn) - Binds a function to the change event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "change", fn ) : this.trigger( "change" ); +}; + +jQuery.fn[ "select" ] = function( fn ) { + /// + /// 1: select() - Triggers the select event of each matched element. + /// 2: select(fn) - Binds a function to the select event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "select", fn ) : this.trigger( "select" ); +}; + +jQuery.fn[ "submit" ] = function( fn ) { + /// + /// 1: submit() - Triggers the submit event of each matched element. + /// 2: submit(fn) - Binds a function to the submit event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "submit", fn ) : this.trigger( "submit" ); +}; + +jQuery.fn[ "keydown" ] = function( fn ) { + /// + /// 1: keydown() - Triggers the keydown event of each matched element. + /// 2: keydown(fn) - Binds a function to the keydown event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "keydown", fn ) : this.trigger( "keydown" ); +}; + +jQuery.fn[ "keypress" ] = function( fn ) { + /// + /// 1: keypress() - Triggers the keypress event of each matched element. + /// 2: keypress(fn) - Binds a function to the keypress event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "keypress", fn ) : this.trigger( "keypress" ); +}; + +jQuery.fn[ "keyup" ] = function( fn ) { + /// + /// 1: keyup() - Triggers the keyup event of each matched element. + /// 2: keyup(fn) - Binds a function to the keyup event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "keyup", fn ) : this.trigger( "keyup" ); +}; + +jQuery.fn[ "error" ] = function( fn ) { + /// + /// 1: error() - Triggers the error event of each matched element. + /// 2: error(fn) - Binds a function to the error event of each matched element. + /// + /// The function to execute. + /// + + return fn ? this.bind( "error", fn ) : this.trigger( "error" ); +}; + +// Prevent memory leaks in IE +// Window isn't included so as not to unbind existing unload events +// More info: +// - http://isaacschlueter.com/2006/10/msie-memory-leaks/ +if ( window.attachEvent && !window.addEventListener ) { + jQuery(window).bind("unload", function() { + for ( var id in jQuery.cache ) { + if ( jQuery.cache[ id ].handle ) { + // Try/Catch is to handle iframes being unloaded, see #4280 + try { + jQuery.event.remove( jQuery.cache[ id ].handle.elem ); + } catch(e) {} + } + } + }); +} + + +(function(){ + +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, + done = 0, + toString = Object.prototype.toString, + hasDuplicate = false, + baseHasDuplicate = true; + +// Here we check if the JavaScript engine is using some sort of +// optimization where it does not always call our comparision +// function. If that is the case, discard the hasDuplicate value. +// Thus far that includes Google Chrome. +[0, 0].sort(function() { + baseHasDuplicate = false; + return 0; +}); + +var Sizzle = function( selector, context, results, seed ) { + results = results || []; + context = context || document; + + var origContext = context; + + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { + return []; + } + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + var m, set, checkSet, extra, ret, cur, pop, i, + prune = true, + contextXML = Sizzle.isXML( context ), + parts = [], + soFar = selector; + + // Reset the position of the chunker regexp (start from head) + do { + chunker.exec( "" ); + m = chunker.exec( soFar ); + + if ( m ) { + soFar = m[3]; + + parts.push( m[1] ); + + if ( m[2] ) { + extra = m[3]; + break; + } + } + } while ( m ); + + if ( parts.length > 1 && origPOS.exec( selector ) ) { + + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { + set = posProcess( parts[0] + parts[1], context ); + + } else { + set = Expr.relative[ parts[0] ] ? + [ context ] : + Sizzle( parts.shift(), context ); + + while ( parts.length ) { + selector = parts.shift(); + + if ( Expr.relative[ selector ] ) { + selector += parts.shift(); + } + + set = posProcess( selector, set ); + } + } + + } else { + // Take a shortcut and set the context if the root selector is an ID + // (but not if it'll be faster if the inner selector is an ID) + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { + + ret = Sizzle.find( parts.shift(), context, contextXML ); + context = ret.expr ? + Sizzle.filter( ret.expr, ret.set )[0] : + ret.set[0]; + } + + if ( context ) { + ret = seed ? + { expr: parts.pop(), set: makeArray(seed) } : + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); + + set = ret.expr ? + Sizzle.filter( ret.expr, ret.set ) : + ret.set; + + if ( parts.length > 0 ) { + checkSet = makeArray( set ); + + } else { + prune = false; + } + + while ( parts.length ) { + cur = parts.pop(); + pop = cur; + + if ( !Expr.relative[ cur ] ) { + cur = ""; + } else { + pop = parts.pop(); + } + + if ( pop == null ) { + pop = context; + } + + Expr.relative[ cur ]( checkSet, pop, contextXML ); + } + + } else { + checkSet = parts = []; + } + } + + if ( !checkSet ) { + checkSet = set; + } + + if ( !checkSet ) { + Sizzle.error( cur || selector ); + } + + if ( toString.call(checkSet) === "[object Array]" ) { + if ( !prune ) { + results.push.apply( results, checkSet ); + + } else if ( context && context.nodeType === 1 ) { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { + results.push( set[i] ); + } + } + + } else { + for ( i = 0; checkSet[i] != null; i++ ) { + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { + results.push( set[i] ); + } + } + } + + } else { + makeArray( checkSet, results ); + } + + if ( extra ) { + Sizzle( extra, origContext, results, seed ); + Sizzle.uniqueSort( results ); + } + + return results; +}; + +Sizzle.uniqueSort = function( results ) { + /// + /// Removes all duplicate elements from an array of elements. + /// + /// The array to translate + /// The array after translation. + + if ( sortOrder ) { + hasDuplicate = baseHasDuplicate; + results.sort( sortOrder ); + + if ( hasDuplicate ) { + for ( var i = 1; i < results.length; i++ ) { + if ( results[i] === results[ i - 1 ] ) { + results.splice( i--, 1 ); + } + } + } + } + + return results; +}; + +Sizzle.matches = function( expr, set ) { + return Sizzle( expr, null, null, set ); +}; + +Sizzle.matchesSelector = function( node, expr ) { + return Sizzle( expr, null, null, [node] ).length > 0; +}; + +Sizzle.find = function( expr, context, isXML ) { + var set; + + if ( !expr ) { + return []; + } + + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { + var match, + type = Expr.order[i]; + + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { + var left = match[1]; + match.splice( 1, 1 ); + + if ( left.substr( left.length - 1 ) !== "\\" ) { + match[1] = (match[1] || "").replace(/\\/g, ""); + set = Expr.find[ type ]( match, context, isXML ); + + if ( set != null ) { + expr = expr.replace( Expr.match[ type ], "" ); + break; + } + } + } + } + + if ( !set ) { + set = context.getElementsByTagName( "*" ); + } + + return { set: set, expr: expr }; +}; + +Sizzle.filter = function( expr, set, inplace, not ) { + var match, anyFound, + old = expr, + result = [], + curLoop = set, + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); + + while ( expr && set.length ) { + for ( var type in Expr.filter ) { + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { + var found, item, + filter = Expr.filter[ type ], + left = match[1]; + + anyFound = false; + + match.splice(1,1); + + if ( left.substr( left.length - 1 ) === "\\" ) { + continue; + } + + if ( curLoop === result ) { + result = []; + } + + if ( Expr.preFilter[ type ] ) { + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); + + if ( !match ) { + anyFound = found = true; + + } else if ( match === true ) { + continue; + } + } + + if ( match ) { + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { + if ( item ) { + found = filter( item, match, i, curLoop ); + var pass = not ^ !!found; + + if ( inplace && found != null ) { + if ( pass ) { + anyFound = true; + + } else { + curLoop[i] = false; + } + + } else if ( pass ) { + result.push( item ); + anyFound = true; + } + } + } + } + + if ( found !== undefined ) { + if ( !inplace ) { + curLoop = result; + } + + expr = expr.replace( Expr.match[ type ], "" ); + + if ( !anyFound ) { + return []; + } + + break; + } + } + } + + // Improper expression + if ( expr === old ) { + if ( anyFound == null ) { + Sizzle.error( expr ); + + } else { + break; + } + } + + old = expr; + } + + return curLoop; +}; + +Sizzle.error = function( msg ) { + throw "Syntax error, unrecognized expression: " + msg; +}; + +var Expr = Sizzle.selectors = { + order: [ "ID", "NAME", "TAG" ], + + match: { + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/, + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, + CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+\-]*)\))?/, + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ + }, + + leftMatch: {}, + + attrMap: { + "class": "className", + "for": "htmlFor" + }, + + attrHandle: { + href: function( elem ) { + return elem.getAttribute( "href" ); + } + }, + + relative: { + "+": function(checkSet, part){ + var isPartStr = typeof part === "string", + isTag = isPartStr && !/\W/.test( part ), + isPartStrNotTag = isPartStr && !isTag; + + if ( isTag ) { + part = part.toLowerCase(); + } + + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { + if ( (elem = checkSet[i]) ) { + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} + + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? + elem || false : + elem === part; + } + } + + if ( isPartStrNotTag ) { + Sizzle.filter( part, checkSet, true ); + } + }, + + ">": function( checkSet, part ) { + var elem, + isPartStr = typeof part === "string", + i = 0, + l = checkSet.length; + + if ( isPartStr && !/\W/.test( part ) ) { + part = part.toLowerCase(); + + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + var parent = elem.parentNode; + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; + } + } + + } else { + for ( ; i < l; i++ ) { + elem = checkSet[i]; + + if ( elem ) { + checkSet[i] = isPartStr ? + elem.parentNode : + elem.parentNode === part; + } + } + + if ( isPartStr ) { + Sizzle.filter( part, checkSet, true ); + } + } + }, + + "": function(checkSet, part, isXML){ + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test(part) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); + }, + + "~": function( checkSet, part, isXML ) { + var nodeCheck, + doneName = done++, + checkFn = dirCheck; + + if ( typeof part === "string" && !/\W/.test( part ) ) { + part = part.toLowerCase(); + nodeCheck = part; + checkFn = dirNodeCheck; + } + + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); + } + }, + + find: { + ID: function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }, + + NAME: function( match, context ) { + if ( typeof context.getElementsByName !== "undefined" ) { + var ret = [], + results = context.getElementsByName( match[1] ); + + for ( var i = 0, l = results.length; i < l; i++ ) { + if ( results[i].getAttribute("name") === match[1] ) { + ret.push( results[i] ); + } + } + + return ret.length === 0 ? null : ret; + } + }, + + TAG: function( match, context ) { + return context.getElementsByTagName( match[1] ); + } + }, + preFilter: { + CLASS: function( match, curLoop, inplace, result, not, isXML ) { + match = " " + match[1].replace(/\\/g, "") + " "; + + if ( isXML ) { + return match; + } + + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { + if ( elem ) { + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) { + if ( !inplace ) { + result.push( elem ); + } + + } else if ( inplace ) { + curLoop[i] = false; + } + } + } + + return false; + }, + + ID: function( match ) { + return match[1].replace(/\\/g, ""); + }, + + TAG: function( match, curLoop ) { + return match[1].toLowerCase(); + }, + + CHILD: function( match ) { + if ( match[1] === "nth" ) { + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' + var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec( + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); + + // calculate the numbers (first)n+(last) including if they are negative + match[2] = (test[1] + (test[2] || 1)) - 0; + match[3] = test[3] - 0; + } + + // TODO: Move to normal caching system + match[0] = done++; + + return match; + }, + + ATTR: function( match, curLoop, inplace, result, not, isXML ) { + var name = match[1].replace(/\\/g, ""); + + if ( !isXML && Expr.attrMap[name] ) { + match[1] = Expr.attrMap[name]; + } + + if ( match[2] === "~=" ) { + match[4] = " " + match[4] + " "; + } + + return match; + }, + + PSEUDO: function( match, curLoop, inplace, result, not ) { + if ( match[1] === "not" ) { + // If we're dealing with a complex expression, or a simple one + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { + match[3] = Sizzle(match[3], null, null, curLoop); + + } else { + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); + + if ( !inplace ) { + result.push.apply( result, ret ); + } + + return false; + } + + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { + return true; + } + + return match; + }, + + POS: function( match ) { + match.unshift( true ); + + return match; + } + }, + + filters: { + enabled: function( elem ) { + return elem.disabled === false && elem.type !== "hidden"; + }, + + disabled: function( elem ) { + return elem.disabled === true; + }, + + checked: function( elem ) { + return elem.checked === true; + }, + + selected: function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + elem.parentNode.selectedIndex; + + return elem.selected === true; + }, + + parent: function( elem ) { + return !!elem.firstChild; + }, + + empty: function( elem ) { + return !elem.firstChild; + }, + + has: function( elem, i, match ) { + /// + /// Internal use only; use hasClass('class') + /// + /// + + return !!Sizzle( match[3], elem ).length; + }, + + header: function( elem ) { + return (/h\d/i).test( elem.nodeName ); + }, + + text: function( elem ) { + return "text" === elem.type; + }, + radio: function( elem ) { + return "radio" === elem.type; + }, + + checkbox: function( elem ) { + return "checkbox" === elem.type; + }, + + file: function( elem ) { + return "file" === elem.type; + }, + password: function( elem ) { + return "password" === elem.type; + }, + + submit: function( elem ) { + return "submit" === elem.type; + }, + + image: function( elem ) { + return "image" === elem.type; + }, + + reset: function( elem ) { + return "reset" === elem.type; + }, + + button: function( elem ) { + return "button" === elem.type || elem.nodeName.toLowerCase() === "button"; + }, + + input: function( elem ) { + return (/input|select|textarea|button/i).test( elem.nodeName ); + } + }, + setFilters: { + first: function( elem, i ) { + return i === 0; + }, + + last: function( elem, i, match, array ) { + return i === array.length - 1; + }, + + even: function( elem, i ) { + return i % 2 === 0; + }, + + odd: function( elem, i ) { + return i % 2 === 1; + }, + + lt: function( elem, i, match ) { + return i < match[3] - 0; + }, + + gt: function( elem, i, match ) { + return i > match[3] - 0; + }, + + nth: function( elem, i, match ) { + return match[3] - 0 === i; + }, + + eq: function( elem, i, match ) { + return match[3] - 0 === i; + } + }, + filter: { + PSEUDO: function( elem, match, i, array ) { + var name = match[1], + filter = Expr.filters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + + } else if ( name === "contains" ) { + return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0; + + } else if ( name === "not" ) { + var not = match[3]; + + for ( var j = 0, l = not.length; j < l; j++ ) { + if ( not[j] === elem ) { + return false; + } + } + + return true; + + } else { + Sizzle.error( "Syntax error, unrecognized expression: " + name ); + } + }, + + CHILD: function( elem, match ) { + var type = match[1], + node = elem; + + switch ( type ) { + case "only": + case "first": + while ( (node = node.previousSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + if ( type === "first" ) { + return true; + } + + node = elem; + + case "last": + while ( (node = node.nextSibling) ) { + if ( node.nodeType === 1 ) { + return false; + } + } + + return true; + + case "nth": + var first = match[2], + last = match[3]; + + if ( first === 1 && last === 0 ) { + return true; + } + + var doneName = match[0], + parent = elem.parentNode; + + if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) { + var count = 0; + + for ( node = parent.firstChild; node; node = node.nextSibling ) { + if ( node.nodeType === 1 ) { + node.nodeIndex = ++count; + } + } + + parent.sizcache = doneName; + } + + var diff = elem.nodeIndex - last; + + if ( first === 0 ) { + return diff === 0; + + } else { + return ( diff % first === 0 && diff / first >= 0 ); + } + } + }, + + ID: function( elem, match ) { + return elem.nodeType === 1 && elem.getAttribute("id") === match; + }, + + TAG: function( elem, match ) { + return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match; + }, + + CLASS: function( elem, match ) { + return (" " + (elem.className || elem.getAttribute("class")) + " ") + .indexOf( match ) > -1; + }, + + ATTR: function( elem, match ) { + var name = match[1], + result = Expr.attrHandle[ name ] ? + Expr.attrHandle[ name ]( elem ) : + elem[ name ] != null ? + elem[ name ] : + elem.getAttribute( name ), + value = result + "", + type = match[2], + check = match[4]; + + return result == null ? + type === "!=" : + type === "=" ? + value === check : + type === "*=" ? + value.indexOf(check) >= 0 : + type === "~=" ? + (" " + value + " ").indexOf(check) >= 0 : + !check ? + value && result !== false : + type === "!=" ? + value !== check : + type === "^=" ? + value.indexOf(check) === 0 : + type === "$=" ? + value.substr(value.length - check.length) === check : + type === "|=" ? + value === check || value.substr(0, check.length + 1) === check + "-" : + false; + }, + + POS: function( elem, match, i, array ) { + var name = match[2], + filter = Expr.setFilters[ name ]; + + if ( filter ) { + return filter( elem, i, match, array ); + } + } + } +}; + +var origPOS = Expr.match.POS, + fescape = function(all, num){ + return "\\" + (num - 0 + 1); + }; + +for ( var type in Expr.match ) { + Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) ); + Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) ); +} + +var makeArray = function( array, results ) { + array = Array.prototype.slice.call( array, 0 ); + + if ( results ) { + results.push.apply( results, array ); + return results; + } + + return array; +}; + +// Perform a simple check to determine if the browser is capable of +// converting a NodeList to an array using builtin methods. +// Also verifies that the returned array holds DOM nodes +// (which is not the case in the Blackberry browser) +try { + Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType; + +// Provide a fallback method if it does not work +} catch( e ) { + makeArray = function( array, results ) { + var i = 0, + ret = results || []; + + if ( toString.call(array) === "[object Array]" ) { + Array.prototype.push.apply( ret, array ); + + } else { + if ( typeof array.length === "number" ) { + for ( var l = array.length; i < l; i++ ) { + ret.push( array[i] ); + } + + } else { + for ( ; array[i]; i++ ) { + ret.push( array[i] ); + } + } + } + + return ret; + }; +} + +var sortOrder, siblingCheck; + +if ( document.documentElement.compareDocumentPosition ) { + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) { + return a.compareDocumentPosition ? -1 : 1; + } + + return a.compareDocumentPosition(b) & 4 ? -1 : 1; + }; + +} else { + sortOrder = function( a, b ) { + var al, bl, + ap = [], + bp = [], + aup = a.parentNode, + bup = b.parentNode, + cur = aup; + + // The nodes are identical, we can exit early + if ( a === b ) { + hasDuplicate = true; + return 0; + + // If the nodes are siblings (or identical) we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + + // If no parents were found then the nodes are disconnected + } else if ( !aup ) { + return -1; + + } else if ( !bup ) { + return 1; + } + + // Otherwise they're somewhere else in the tree so we need + // to build up a full list of the parentNodes for comparison + while ( cur ) { + ap.unshift( cur ); + cur = cur.parentNode; + } + + cur = bup; + + while ( cur ) { + bp.unshift( cur ); + cur = cur.parentNode; + } + + al = ap.length; + bl = bp.length; + + // Start walking down the tree looking for a discrepancy + for ( var i = 0; i < al && i < bl; i++ ) { + if ( ap[i] !== bp[i] ) { + return siblingCheck( ap[i], bp[i] ); + } + } + + // We ended someplace up the tree so do a sibling check + return i === al ? + siblingCheck( a, bp[i], -1 ) : + siblingCheck( ap[i], b, 1 ); + }; + + siblingCheck = function( a, b, ret ) { + if ( a === b ) { + return ret; + } + + var cur = a.nextSibling; + + while ( cur ) { + if ( cur === b ) { + return -1; + } + + cur = cur.nextSibling; + } + + return 1; + }; +} + +// Utility function for retreiving the text value of an array of DOM nodes +Sizzle.getText = function( elems ) { + var ret = "", elem; + + for ( var i = 0; elems[i]; i++ ) { + elem = elems[i]; + + // Get the text from text nodes and CDATA nodes + if ( elem.nodeType === 3 || elem.nodeType === 4 ) { + ret += elem.nodeValue; + + // Traverse everything else, except comment nodes + } else if ( elem.nodeType !== 8 ) { + ret += Sizzle.getText( elem.childNodes ); + } + } + + return ret; +}; + +// [vsdoc] The following function has been modified for IntelliSense. +// Check to see if the browser returns elements by name when +// querying by getElementById (and provide a workaround) +(function(){ + // We're going to inject a fake input element with a specified name + // var form = document.createElement("div"), + // id = "script" + (new Date()).getTime(), + // root = document.documentElement; + + // form.innerHTML = ""; + + // // Inject it into the root element, check its status, and remove it quickly + // root.insertBefore( form, root.firstChild ); + + // // The workaround has to do additional checks after a getElementById + // // Which slows things down for other browsers (hence the branching) + // if ( document.getElementById( id ) ) { + Expr.find.ID = function( match, context, isXML ) { + if ( typeof context.getElementById !== "undefined" && !isXML ) { + var m = context.getElementById(match[1]); + + return m ? + m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? + [m] : + undefined : + []; + } + }; + + Expr.filter.ID = function( elem, match ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + + return elem.nodeType === 1 && node && node.nodeValue === match; + }; + // } + + // root.removeChild( form ); + + // release memory in IE + root = form = null; +})(); + +// [vsdoc] The following function has been modified for IntelliSense. +(function(){ + // Check to see if the browser returns only elements + // when doing getElementsByTagName("*") + + // Create a fake element + // var div = document.createElement("div"); + // div.appendChild( document.createComment("") ); + + // Make sure no comments are found + // if ( div.getElementsByTagName("*").length > 0 ) { + Expr.find.TAG = function( match, context ) { + var results = context.getElementsByTagName( match[1] ); + + // Filter out possible comments + if ( match[1] === "*" ) { + var tmp = []; + + for ( var i = 0; results[i]; i++ ) { + if ( results[i].nodeType === 1 ) { + tmp.push( results[i] ); + } + } + + results = tmp; + } + + return results; + }; + // } + + // Check to see if an attribute returns normalized href attributes + // div.innerHTML = ""; + + // if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" && + // div.firstChild.getAttribute("href") !== "#" ) { + + // Expr.attrHandle.href = function( elem ) { + // return elem.getAttribute( "href", 2 ); + // }; + // } + + // release memory in IE + div = null; +})(); + +if ( document.querySelectorAll ) { + (function(){ + var oldSizzle = Sizzle, + div = document.createElement("div"), + id = "__sizzle__"; + + div.innerHTML = "

"; + + // Safari can't handle uppercase or unicode characters when + // in quirks mode. + if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) { + return; + } + + Sizzle = function( query, context, extra, seed ) { + context = context || document; + + // Make sure that attribute selectors are quoted + query = query.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + // Only use querySelectorAll on non-XML documents + // (ID selectors don't work in non-HTML documents) + if ( !seed && !Sizzle.isXML(context) ) { + if ( context.nodeType === 9 ) { + try { + return makeArray( context.querySelectorAll(query), extra ); + } catch(qsaError) {} + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + } else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + var old = context.getAttribute( "id" ), + nid = old || id; + + if ( !old ) { + context.setAttribute( "id", nid ); + } + + try { + return makeArray( context.querySelectorAll( "#" + nid + " " + query ), extra ); + + } catch(pseudoError) { + } finally { + if ( !old ) { + context.removeAttribute( "id" ); + } + } + } + } + + return oldSizzle(query, context, extra, seed); + }; + + for ( var prop in oldSizzle ) { + Sizzle[ prop ] = oldSizzle[ prop ]; + } + + // release memory in IE + div = null; + })(); +} + +(function(){ + var html = document.documentElement, + matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector, + pseudoWorks = false; + + try { + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( document.documentElement, "[test!='']:sizzle" ); + + } catch( pseudoError ) { + pseudoWorks = true; + } + + if ( matches ) { + Sizzle.matchesSelector = function( node, expr ) { + // Make sure that attribute selectors are quoted + expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"); + + if ( !Sizzle.isXML( node ) ) { + try { + if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) { + return matches.call( node, expr ); + } + } catch(e) {} + } + + return Sizzle(expr, null, null, [node]).length > 0; + }; + } +})(); + +(function(){ + var div = document.createElement("div"); + + div.innerHTML = "
"; + + // Opera can't find a second classname (in 9.6) + // Also, make sure that getElementsByClassName actually exists + if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) { + return; + } + + // Safari caches class attributes, doesn't catch changes (in 3.2) + div.lastChild.className = "e"; + + if ( div.getElementsByClassName("e").length === 1 ) { + return; + } + + Expr.order.splice(1, 0, "CLASS"); + Expr.find.CLASS = function( match, context, isXML ) { + if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) { + return context.getElementsByClassName(match[1]); + } + }; + + // release memory in IE + div = null; +})(); + +function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 && !isXML ){ + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( elem.nodeName.toLowerCase() === cur ) { + match = elem; + break; + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) { + for ( var i = 0, l = checkSet.length; i < l; i++ ) { + var elem = checkSet[i]; + + if ( elem ) { + var match = false; + + elem = elem[dir]; + + while ( elem ) { + if ( elem.sizcache === doneName ) { + match = checkSet[elem.sizset]; + break; + } + + if ( elem.nodeType === 1 ) { + if ( !isXML ) { + elem.sizcache = doneName; + elem.sizset = i; + } + + if ( typeof cur !== "string" ) { + if ( elem === cur ) { + match = true; + break; + } + + } else if ( Sizzle.filter( cur, [elem] ).length > 0 ) { + match = elem; + break; + } + } + + elem = elem[dir]; + } + + checkSet[i] = match; + } + } +} + +if ( document.documentElement.contains ) { + Sizzle.contains = function( a, b ) { + /// + /// Check to see if a DOM node is within another DOM node. + /// + /// + /// The DOM element that may contain the other element. + /// + /// + /// The DOM node that may be contained by the other element. + /// + /// + + return a !== b && (a.contains ? a.contains(b) : true); + }; + +} else if ( document.documentElement.compareDocumentPosition ) { + Sizzle.contains = function( a, b ) { + /// + /// Check to see if a DOM node is within another DOM node. + /// + /// + /// The DOM element that may contain the other element. + /// + /// + /// The DOM node that may be contained by the other element. + /// + /// + + return !!(a.compareDocumentPosition(b) & 16); + }; + +} else { + Sizzle.contains = function() { + return false; + }; +} + +Sizzle.isXML = function( elem ) { + /// + /// Determines if the parameter passed is an XML document. + /// + /// The object to test + /// True if the parameter is an XML document; otherwise false. + + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; + + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +var posProcess = function( selector, context ) { + var match, + tmpSet = [], + later = "", + root = context.nodeType ? [context] : context; + + // Position selectors must be done after the filter + // And so must :not(positional) so we move all PSEUDOs to the end + while ( (match = Expr.match.PSEUDO.exec( selector )) ) { + later += match[0]; + selector = selector.replace( Expr.match.PSEUDO, "" ); + } + + selector = Expr.relative[selector] ? selector + "*" : selector; + + for ( var i = 0, l = root.length; i < l; i++ ) { + Sizzle( selector, root[i], tmpSet ); + } + + return Sizzle.filter( later, tmpSet ); +}; + +// EXPOSE +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.filters; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + +})(); + + +var runtil = /Until$/, + rparentsprev = /^(?:parents|prevUntil|prevAll)/, + // Note: This RegExp should be improved, or likely pulled from Sizzle + rmultiselector = /,/, + isSimple = /^.[^:#\[\.,]*$/, + slice = Array.prototype.slice, + POS = jQuery.expr.match.POS; + +jQuery.fn.extend({ + find: function( selector ) { + /// + /// Searches for all elements that match the specified expression. + /// This method is a good way to find additional descendant + /// elements with which to process. + /// All searching is done using a jQuery expression. The expression can be + /// written using CSS 1-3 Selector syntax, or basic XPath. + /// Part of DOM/Traversing + /// + /// + /// + /// An expression to search with. + /// + /// + + var ret = this.pushStack( "", "find", selector ), + length = 0; + + for ( var i = 0, l = this.length; i < l; i++ ) { + length = ret.length; + jQuery.find( selector, this[i], ret ); + + if ( i > 0 ) { + // Make sure that the results are unique + for ( var n = length; n < ret.length; n++ ) { + for ( var r = 0; r < length; r++ ) { + if ( ret[r] === ret[n] ) { + ret.splice(n--, 1); + break; + } + } + } + } + } + + return ret; + }, + + has: function( target ) { + /// + /// Reduce the set of matched elements to those that have a descendant that matches the + /// selector or DOM element. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + + var targets = jQuery( target ); + return this.filter(function() { + for ( var i = 0, l = targets.length; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + not: function( selector ) { + /// + /// Removes any elements inside the array of elements from the set + /// of matched elements. This method is used to remove one or more + /// elements from a jQuery object. + /// Part of DOM/Traversing + /// + /// + /// A set of elements to remove from the jQuery set of matched elements. + /// + /// + + return this.pushStack( winnow(this, selector, false), "not", selector); + }, + + filter: function( selector ) { + /// + /// Removes all elements from the set of matched elements that do not + /// pass the specified filter. This method is used to narrow down + /// the results of a search. + /// }) + /// Part of DOM/Traversing + /// + /// + /// + /// A function to use for filtering + /// + /// + + return this.pushStack( winnow(this, selector, true), "filter", selector ); + }, + + is: function( selector ) { + /// + /// Checks the current selection against an expression and returns true, + /// if at least one element of the selection fits the given expression. + /// Does return false, if no element fits or the expression is not valid. + /// filter(String) is used internally, therefore all rules that apply there + /// apply here, too. + /// Part of DOM/Traversing + /// + /// + /// + /// The expression with which to filter + /// + + return !!selector && jQuery.filter( selector, this ).length > 0; + }, + + closest: function( selectors, context ) { + /// + /// Get a set of elements containing the closest parent element that matches the specified selector, the starting element included. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + /// A DOM element within which a matching element may be found. If no context is passed + /// in then the context of the jQuery set will be used instead. + /// + /// + + var ret = [], i, l, cur = this[0]; + + if ( jQuery.isArray( selectors ) ) { + var match, selector, + matches = {}, + level = 1; + + if ( cur && selectors.length ) { + for ( i = 0, l = selectors.length; i < l; i++ ) { + selector = selectors[i]; + + if ( !matches[selector] ) { + matches[selector] = jQuery.expr.match.POS.test( selector ) ? + jQuery( selector, context || this.context ) : + selector; + } + } + + while ( cur && cur.ownerDocument && cur !== context ) { + for ( selector in matches ) { + match = matches[selector]; + + if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) { + ret.push({ selector: selector, elem: cur, level: level }); + } + } + + cur = cur.parentNode; + level++; + } + } + + return ret; + } + + var pos = POS.test( selectors ) ? + jQuery( selectors, context || this.context ) : null; + + for ( i = 0, l = this.length; i < l; i++ ) { + cur = this[i]; + + while ( cur ) { + if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) { + ret.push( cur ); + break; + + } else { + cur = cur.parentNode; + if ( !cur || !cur.ownerDocument || cur === context ) { + break; + } + } + } + } + + ret = ret.length > 1 ? jQuery.unique(ret) : ret; + + return this.pushStack( ret, "closest", selectors ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + /// + /// Searches every matched element for the object and returns + /// the index of the element, if found, starting with zero. + /// Returns -1 if the object wasn't found. + /// Part of Core + /// + /// + /// + /// Object to search for + /// + + if ( !elem || typeof elem === "string" ) { + return jQuery.inArray( this[0], + // If it receives a string, the selector is used + // If it receives nothing, the siblings are used + elem ? jQuery( elem ) : this.parent().children() ); + } + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + /// + /// Adds one or more Elements to the set of matched elements. + /// Part of DOM/Traversing + /// + /// + /// A string containing a selector expression to match additional elements against. + /// + /// + /// Add some elements rooted against the specified context. + /// + /// + + var set = typeof selector === "string" ? + jQuery( selector, context || this.context ) : + jQuery.makeArray( selector ), + all = jQuery.merge( this.get(), set ); + + return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ? + all : + jQuery.unique( all ) ); + }, + + andSelf: function() { + /// + /// Adds the previous selection to the current selection. + /// + /// + + return this.add( this.prevObject ); + } +}); + +// A painfully simple check to see if an element is disconnected +// from a document (should be improved, where feasible). +function isDisconnected( node ) { + return !node || !node.parentNode || node.parentNode.nodeType === 11; +} + +jQuery.fn.parents = function (until, selector) { + /// + /// Get the ancestors of each element in the current set of matched elements, optionally filtered by a selector. + /// + /// + /// A string containing a selector expression to match elements against. + /// + /// + return jQuery.dir(elem, "parentNode"); +}; + +jQuery.fn.parentsUntil = function (until, selector) { + /// + /// Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching ancestor elements. + /// + /// + return jQuery.dir(elem, "parentNode", until); +}; + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + next: function( elem ) { + return jQuery.nth( elem, 2, "nextSibling" ); + }, + prev: function( elem ) { + return jQuery.nth( elem, 2, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + /// + /// Get all following siblings of each element up to but not including the element matched + /// by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching following + /// sibling elements. + /// + /// + + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + /// + /// Get all preceding siblings of each element up to but not including the element matched + /// by the selector. + /// + /// + /// A string containing a selector expression to indicate where to stop matching preceding + /// sibling elements. + /// + /// + + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( elem.parentNode.firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.makeArray( elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( !runtil.test( name ) ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + ret = this.length > 1 ? jQuery.unique( ret ) : ret; + + if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + + return this.pushStack( ret, name, slice.call(arguments).join(",") ); + }; +}); + +jQuery.extend({ + filter: function( expr, elems, not ) { + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 ? + jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] : + jQuery.find.matches(expr, elems); + }, + + dir: function( elem, dir, until ) { + /// + /// This member is internal only. + /// + /// + + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + nth: function( cur, result, dir, elem ) { + /// + /// This member is internal only. + /// + /// + + result = result || 1; + var num = 0; + + for ( ; cur; cur = cur[dir] ) { + if ( cur.nodeType === 1 && ++num === result ) { + break; + } + } + + return cur; + }, + + sibling: function( n, elem ) { + /// + /// This member is internal only. + /// + /// + + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, keep ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep(elements, function( elem, i ) { + var retVal = !!qualifier.call( elem, i, elem ); + return retVal === keep; + }); + + } else if ( qualifier.nodeType ) { + return jQuery.grep(elements, function( elem, i ) { + return (elem === qualifier) === keep; + }); + + } else if ( typeof qualifier === "string" ) { + var filtered = jQuery.grep(elements, function( elem ) { + return elem.nodeType === 1; + }); + + if ( isSimple.test( qualifier ) ) { + return jQuery.filter(qualifier, filtered, !keep); + } else { + qualifier = jQuery.filter( qualifier, filtered ); + } + } + + return jQuery.grep(elements, function( elem, i ) { + return (jQuery.inArray( elem, qualifier ) >= 0) === keep; + }); +} + + + + +var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g, + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig, + rtagName = /<([\w:]+)/, + rtbody = /\s]+\/)>/g, + wrapMap = { + option: [ 1, "" ], + legend: [ 1, "
", "
" ], + thead: [ 1, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + col: [ 2, "", "
" ], + area: [ 1, "", "" ], + _default: [ 0, "", "" ] + }; + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// IE can't serialize and + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
+
+
+
+ + +
+
+
+
+ |   + Community   |   + Contact Us +
+
+
+
+ Solutions    |    + Downloads    |    + License    |    + Documentation    |    + Training    |    + Support    |    + Customers    |    + About Us +
+
+
+
+ +
+
+ + +

NServiceBus v4.0 Beta Release Notes

+

License and Usage

+
+
+
+
+
+ NServiceBus V4 beta release is provided with an unlimited license for 14 days. + Additional extended usage can be provided upon request.

+ Please use + NServiceBus v4 beta release only for your personal learning, evaluation, and non-production use.

+ A detailed list of all the changes.

+
+
+
+
+
+ +

Compatibility and Upgrades

+
+ Prerequisite: NServiceBus v4.0 requires RavenDB 2.0.0.2261 or later +
+ In order to run + NServiceBus v4.0 in beta (non-production environment), RavenDB v2.0 must be installed on the machine + on which NServiceBus v4.0 is tested.

NServiceBus installer + will automaticly install a RavenDB v2.0 if there is no existing and + active installation of RavenDB v2.0 on the machine.
it is + possible to manualy validate the current RavenDB installed version + by connecting to the RavenDB instance ( + http://localhost:8080 ) and + locating the bottom status bar where server and client build numbers + are noted, build numbers prior to 2000 indecates a RavenDB earlier than + v2.0.

If the NServiceBus v4.0 installer finds a RavenDB + version prior to v2.0 on the target machine a new instance of RavenDB + v2.0 will be installed and no intact will be made to the existing + instance.
+
+
+ NServiceBus v4.0 is not compatible with NServiceBus v2.6 (or earlier) +
+ As you can see, + a large number of features were added to NServiceBus. As a result, NServiceBus v4.0 is not compatible with NServiceBus v2.6. Furthermore, only messages marked as events (IEvent or DefiningEventsAs()) will be auto-subscribed. +
+
+ +
+ PowerShell cmdlets - breaking changes: +
+ NServiceBus.Host no longer supports /installinfrastructure. Use Powershell cmdlets instead.
+ Powershell cmdlets have been renamed so that they do not clash with any existing cmdlets. See details below. +
+
+ +
+ Autosubscriptions +
+ Only messages marked as events (IEvent or DefiningEventsAs()) will be auto-subscribed. +
+
+ +
+ Default transaction isolation level +
+ Default transaction isolation level is now ReadCommitted.
+ To revert to Serializable use:
+
+
+   Configure
+      .Transactions
+      .Advanced(settings => settings.IsolationLevel(IsolationLevel.Serializable));
+   
+
+
+ +
+

New Transports Support and Configuration

+
+ Four transports are now out of the box (SqlServer, MSMQ, ActiveMQ and RabbitMQ) + with more to come.

+ Four new transport samples were added to the NServiceBus samples, illustrating how to configure the new transports:
+
    +
  • Messaging.ActiveMQ
  • +
  • Messaging.RabbitMQ
  • +
  • Messaging.SqlServer
  • +
  • Messaging.MSMQ
  • +
+ These samples are online and included in the MSI installation samples sub-directory. +
+ +
+ New configuration APIs were added to simplify the transports configuration and make it consistent across all transports. In your config file, specify a connection string, e.g.: +
 
+ <connectionStrings>
+
+   <!-- MSMQ -->
+   <add name="NServiceBus/Transport" 
+        connectionString="deadLetter=true;journal=true;useTransactionalQueues=true;cacheSendConnection=true"/>
+			
+   <!-- ActiveMQ --> 
+   <add name="NServiceBus/Transport" 
+        connectionString="ServerUrl=activemq:tcp://localhost:61616"/>
+			
+   <!-- RabbitMQ--> 
+   <add name="NServiceBus/Transport" 
+        connectionString="host=localhost"/>
+		
+   <!-- SqlServer -->
+   <add name="NServiceBus/Transport" 
+        connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=nservicebus;Integrated Security=True"/>
+
+ </connectionStrings>
+		
+
+ You then have + two options to specify the transport:
+
    +
  • You can specify it as part of the IConfigureThisEndpoint class declaration, e.g.:
  • + +
+
		
+    public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, UsingTransport<RabbitMQ>
+
+
+
  • Or you can specify it in the IWantCustomInitialization Init method, e.g.:
  • +
    		
    +    public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization
    +    {
    +       public void Init()
    +       {
    +          Configure.With()
    +             .DefaultBuilder()
    +             .UseTransport<RabbitMQ>() 
    +       }
    +    }
    +
    +
    +
    + +
    + Three new nuget packages for the new transports are also available:
    + +
    + Example of how to install the NServiceBus.ActiveMQ package:
    + (Note that the Nuget packages are defined as pre-release. They will not be listed unless you tell Nuget to show  pre-release packages using the –Prerelease  or -Pre alias flags.)
    +
    +

    + PM> Install-Package NServiceBus.ActiveMQ -Pre
    +

    +
    +
    +
    +
    + New Transports DLLs
    + Add a reference to the new transport DLL’s (in the Binaries directory):
    +
      +
    • NServiceBus.Transports.RabbitMQ.dll
    • +
    • NServiceBus.Transports.SQlServer.dll
    • +
    • NServiceBus.Transports.ActiveMQ.dll
    • +
    + (MSMQ is currently in NServiceBus.Core.dll and does not require any additional reference. Nuget adds the reference automatically.) +
    +
    + +
    +

    Configuration Changes

    +
    + XmlMessageSerializer now supports not wrapping messages in a <messages> element for single messages. This makes interoperability with other systems easier.
    + To turn on this feature use:
    +
    +    .XmlSerializer( dontWrapSingleMessages:true )
    +
    +
    +
    +
    + MsmqTransportConfig section has been deprecated in favour of TransportConfig section, e.g.:
    +
    +    <section name="TransportConfig" type="NServiceBus.Config.TransportConfig, NServiceBus.Core" />
    +
    +    <TransportConfig MaximumConcurrencyLevel="10" MaxRetries="3" MaximumMessageThroughputPerSecond="10" />
    +
    +
    +
    +
    + INeedToInstallSomething is now resolved via the container +
    + +
    + NHibernate Configuration
    + NHibernate settings have been simplified use as follows:
    +
    	
    +  <appSettings>
    +    <!-- dialect is the only required NHibernate property -->
    +    <add key="NServiceBus/Persistence/NHibernate/dialect" value="NHibernate.Dialect.MsSql2008Dialect"/>
    +    <!-- other optional settings examples -->
    +    <add key="NServiceBus/Persistence/NHibernate/connection.provider" value="NHibernate.Connection.DriverConnectionProvider"/>
    +    <add key="NServiceBus/Persistence/NHibernate/connection.driver_class" value="NHibernate.Driver.Sql2008ClientDriver"/>
    +    <!-- For more setting see http://www.nhforge.org/doc/nh/en/#configuration-hibernatejdbc and
    +         http://www.nhforge.org/doc/nh/en/#configuration-optional -->
    +  </appSettings> 
    +  <connectionStrings>
    +    <!-- Default connection string for all Nhibernate/Sql persisters -->
    +    <add name="NServiceBus/Persistence" 
    +         connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=nservicebus;Integrated Security=True" />
    +       
    +    <!-- Optional overrides per persister -->
    +    <add name="NServiceBus/Persistence/NHibernate/Timeout" 
    +         connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=timeout;Integrated Security=True" />
    +       
    +    <add name="NServiceBus/Persistence/NHibernate/Saga" 
    +         connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=sagas;Integrated Security=True" />
    +       
    +    <add name="NServiceBus/Persistence/NHibernate/Subscription" 
    +         connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=subscription;Integrated Security=True" />
    +       
    +    <add name="NServiceBus/Persistence/NHibernate/Gateway" 
    +         connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=gateway;Integrated Security=True" />
    +       
    +    <add name="NServiceBus/Persistence/NHibernate/Distributor" 
    +         connectionString="Data Source=.\SQLEXPRESS;Initial Catalog=distributor;Integrated Security=True" />
    +       
    +  </connectionStrings>
    +
    +
    +
    +
    + Performance Counters
    + New throughput performance counters and updated performance counters are now available:

    + +
    +
    + NServiceBus license installed per machine
    + Licenses can now be installed in HKLM, allowing you to install one license per server instead of installing a license per endpoint or per windows account.

    + Sample usage:
    +
    +
    + LicenseInstaller.exe -m C:\License.xml +
    + +
    + Powershell cmdlets Updates
    + NServiceBus + Powershell cmdlets have been moved to NServiceBus.PowerShell.dll, so to import it run: +
    +

    PM> Import-Module .\NServiceBus.PowerShell.dll

    +
    + NServiceBus Powershell cmdlets have been renamed so that they do not clash with any existing cmdlets:
    + +
      +
    • Installs a NServiceBus license file. +
      + Install-NServiceBusLicense
    • +
    • Displays all messages in a queue. +
      + Get-NServiceBusMSMQMessage
    • +
    • Displays the NServiceBus installed version. +
      + Get-NServiceBusVersion
    • +
    • Installs DTC on the machine. +
      + Install-NServiceBusDTC
    • +
    • Installs RavenDB on the machine. +
      + Install-NServiceBusRavenDB
    • +
    • Installs NServiceBus performance counters on the machine. +
      + Install-NServiceBusPerformanceCounters
    • +
    • Installs MSMQ on the machine. +
      + Install-NServiceBusMSMQ
    • +
    • Validates if DTC is installed and running on the machine. +
      + Test-NServiceBusDTCInstallation
    • +
    • Ensures RavenDB is on the machine. +
      + Test-NServiceBusRavenDBInstallation
    • +
    • Validates that NServiceBus performance counters are correctly installed on the machine. +
      + Test-NServiceBusPerformanceCountersInstallation
    • +
    • Validates MSMQ is correctly installed on the machine. +
      + Test-NServiceBusMSMQInstallation
    • +
    • Adds the required configuration section to the config file. +
      + Add-NServiceBusMessageForwardingInCaseOfFaultConfig
    • +
    • Shows the default error and + audit queues. +
      + Get-NServiceBusLocalMachineSettings
    • +
    • Allows specifying the default + error and audit queues. +
      + Set-NServiceBusLocalMachineSettings
    • +
    • NServiceBus.Host no longer supports /installinfrastructure - Use Powershell cmdlets instead
    • +
    +
    +
    + New Endpoint Configuration API:
    + Sample usage:
    +
    	
    +    Configure.Endpoint.AsSendOnly()
    +       .Advanced(settings => settings.DisableDurableMessages());
    +
    +    Configure.Transactions.Enable() 
    +       .Advanced(settings => settings.IsolationLevel(IsolationLevel.Serializable)
    +       .DefaultTimeout(TimeSpan.FromSeconds(40)) 
    +       .DisableDistributedTransactions()); 
    +    
    +
    +
    + Embedded RavenDB
    + RavenDB is not ilmerged anymore. (It is embedded instead, using https://github.com/Fody/Costura#readme).
    + The embedding enables client updates (but may require binding redirects). It also allows passing your own DocumentStore, + thereby providing full configuration flexibility. +
    +
    + +
    + Audit and Error Queue Defaults
    + Server defaults for audit and error queues can now be specified in the registry + (see new Powershell cmdlet Get/Set-NServiceBusLocalMachineSettings above).
    +
    + +
    +

    Known issues:

    +
    + + ActiveMQ requires enabling the Scheduler.
    +     + You can do this by setting schedulerSupport="true" attribute to the configuration in activemq.xml: +
    + <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}" schedulerSupport="true" >
    +
    +
    + ActiveMQ Client connection fails when hostname includes a hyphen +
        + (see https://issues.apache.org/jira/browse/AMQNET-399). +

    + NMS Client for ActiveMQ
    + The release contains a custom build of Apache.NMS.ActiveMQ.1.5.6 client.
    + This custom build fixes the following issues:
    + + The custom build will be removed as soon as the official NMS client will be updated with the above fixes. +

    + Installing RavenDB v2 on a machine that already has RavenDB v1.x
    + When installing NServiceBus v4.x on a machine where an instance of RavenDB v1.x exists (default listening on port 8080), the installer will identify the existing RavenDB instance and try to capture the next available port (e.g. 8081, 8082 etc.) instead of the default 8080 port. Once an available port is found, the installer installs RavenDB V2 instance as a new Windows service, side-by-side with the existing RavenDB v1.x installation. +

    + By the end of the installation there will be two RavenDB services running + side by side on the machine:
    +
      +
    • RavenDB
    • +
    • RavenDB-v2
    • +
    + In case where there is a need to uninstall RavenDB v2 follow the following steps: +
      +
    • Open a command line and navigate to the following directory:
      %Program Files%\NServiceBus.Persistence.v4
    • +
    • Execute the following command:
      Raven.Server.exe –uninstall –service-name=RavenDB-v2
    • +
    +
    + Transport samples do not work under Visual Studio 2010
    + All the new transports introduced with NServiceBus 4.0 Beta do work with Visual Studio 2010, the supplied samples currently work only under Visual Studio 2012. + +
    +
    + + +
    +
    + +
    +
    +
    + +
    + About NServiceBus    |    + Contact Us    |    + Privacy    |    + Follow us on:    +
    +
    Copyright 2010-2013 NServiceBus. All rights reserved
    +
    +
    +
    +
    + + + +
    \ No newline at end of file diff --git a/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/NSBSearchIcon.png b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/NSBSearchIcon.png new file mode 100644 index 00000000000..e192e5b5b79 Binary files /dev/null and b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/NSBSearchIcon.png differ diff --git a/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/NSBStyle.css b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/NSBStyle.css new file mode 100644 index 00000000000..7dfe4b3f190 --- /dev/null +++ b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/NSBStyle.css @@ -0,0 +1,426 @@ + +/* unvisited link */ +a:link { text-decoration:none; } + +/* visited link */ +a:visited { text-decoration:none; } + +/* mouse over link */ +a:hover { text-decoration:underline;} + +/* selected link */ +/* +a:active { text-decoration:none; } +*/ +.NSBVerticalMenuImage img{ + border: 1px solid #ccc; +} + +.NSBVerticalMenuImage:hover img{ + border: 1px solid navy; +} + + +.NSBPage { + background: #F0F0F0; +} + +.NSBMainContainer { + background: inherit; + /* background:black; */ +} + +.NSBAlignMiddle{ + width: 1000px; + margin-left:auto; + margin-right:auto; +} + +/* ---- header ---- */ + +.NSBHeaderBlock{ + background:black; + height:80px; +} + +.NSBHeaderContainer{ + clear:both; + height:80px; +} + +.NSBHeaderTopContent{ + position:relative; + float:right; + height:40px; + width:720px; +} + +.NSBHeaderBottomContent{ + position:relative; + float:right; + height:40px; + width:720px; +} + +.NSBLogoContainer{ + float:left; + width:264px; + height:64px; + background-repeat:no-repeat; + margin-bottom:0px; + margin-left:0px; + margin-top:10px; +} + +.NSBSmallMenu{ + margin-top:12px; + margin-left:100px; + margin-right:50px; + float:right; + color:#D8D8D8; + font-size:12px; +} + +#NSBSmallMenu a{ + color: #D8D8D8; +} + +.NSBSearchBlock{ + position:relative; + float:right; + width:200px; + height:40px; +} + +.NSBSearchForm { + position:relative; + width:200px; + height:26px; + float:right; + background-image:url('http://images.nservicebus.com/NSBSearchBox.png'); + background-repeat:no-repeat; + margin-top:7px; + margin-bottom:7px; +} + +.NSBSearchLine { + position:relative; + margin-top:3px; + margin-bottom:3px; + height:16px; + width:200px; +} + +.NSBCheckmark { + vertical-align: top; + margin-right: 10px; + width: 16px; + height: 16px; +} + +.NSBRedX { + vertical-align: top; + margin-right: 10px; + width: 16px; + height: 16px; +} + +.NSBSearchQuery{ + position:relative; + float:left; + border:0; + width:148px; + height:16px; + font-size:10px; + margin-right:12px; + margin-left:8px; + margin-top:0px; + margin-bottom:0px; +} + +.NSBSearchExecute { + float:right; + position:relative; + margin-top:2px; + margin-right: 10px; + text-indent:-9999px; +} + +.NSBMainMenu{ + margin-top:10px; + margin-right:10px; + margin-bottom:0px; + float:right; + color:white; + font-size:14px; +} + +#NSBMainMenu a{ + color:white; +} + +/* ---- content ---- */ +.NSBContent { + /* clear:both; */ +/* position:relative; + + margin-bottom:0px; */ + margin-top:0px; + min-height:350px; +/* background:#F0F4F4; */ +} + +.NSBContentContainer{ + margin-top:0px; +/* margin-bottom:0px; */ + min-height:350px; + text-align:left; +} +/* ---- footer ---- */ +.NSBFooter{ + clear:both; + position:relative; + padding-top:5px; +} + +.NSBFooterBlock{ + margin-top:40px; + background:#B9B9B9; + height:50px; +} + +.NSBFooterContainer{ + height:40px; + padding-top:14px; +} + +.NSBFooterMenu{ + margin-bottom:0px; + float:right; + color:black; + font-size:14px; +} + +#NSBFooterMenu a{ + color:black; +} + +.NSBCopyrightNotice{ + float:left; +} + +#mainContent { + width:1000px; + height:350px; + overflow:hidden; + position:relative; + display:none; + +} + +.NSBTeamMemeberBlock{} + +.NSBTeamMemeberEven{ + float:left; +} + +.NSBTeamMemeberOdd{ + float:right; +} + +.NSBTeamMemeberContainer{ + + background: #808080; /*#FFF;*/ + padding-top:5px; + padding-bottom:5px; + padding-left:10px; + padding-right:10px; + width:400px; + height:350px; +} + +.NSBVerticalRow{ + clear:both; + /* padding-top:0px; */ +} + +.NSBTeamMemberName { + margin-top:20px; + font-size:24px; + font-weight:bold; + color:orange; +} + +.NSBTeamMemberTitle { + font-size:20px; + font-weight:bold; + color:orange; +} + +.NSBTeamMemberHeader{ + height:90px; +} + +.NSBTeamMemberImage{ + position:relative; + width:90px; + height:90px; + float:right; + margin-top:0px; + margin-right:0px; +} + +.NSBContactUsBlock { + clear:both; + margin: 10px 40px 10px 40px; +} + +.NSBVerticalMenuItem{ + float:left; + width:230px; +} + +.NSBVerticalMenuTitle{ + font-weight:bold; + color:navy; +} + +/* Contact Us */ + +.NSBContactUsMailingAddress{ + clear:both; +} + + +/* About Us */ + +.NSBAboutUsRow { + padding-top:10px; +} + +/* Developer Friendly SOA */ + +.NSBDevFriendlySOABottomContent{ + clear:both; + padding-top:30px; +} + +#integration-content{ + display: none; +} + +#cloud-content{ + display: none; +} + +#scalability-content{ + display: none; +} + +#productivity-content{ + display: none; +} + +/* Customer */ + +.NSBCustomerContent{ + position:relative; + margin: 30px 60px 30px 60px; +} + +.NSBCustomerContentRow{ + background-color:white; + padding-top:10px; + padding-bottom:10px; +} + +.NSBVerticalMenuItemCustomers{ + width:150px; + margin:5px 5px 5px 5px; +} + +.NSBCustomersBlock{ + position:relative; + margin-top:-10px; + margin-left:10px; + margin-right:10px; + padding: 10px 10px 10px 10px; +} + +.NSBCustomersRow{ + background-color:#E2E2E2; + height:165px; +} +/* tabs */ + +#tabs_wrapper { + width: 1000px; +} + +#tabs_container { + border-bottom: 1px solid #ccc; +} + +#tabs { + list-style: none; + padding: 0px 24px 4px 0px; + margin: 0px 0px 0px 0px; + font: 1.2em arial; +} + +#tabs li { + display: inline; +} + +#tabs li a { + border: 1px solid #ccc; + padding: 4px 24px; + text-decoration: none; + background-color: #eeeeee; + border-bottom: none; + outline: none; +} + +#tabs li a:hover { + background-color: #dddddd; + padding: 4px 24px; +} + +#tabs li.active a { + border-bottom: 1px solid #fff; + background-color: #fff; + padding: 4px 24px 5px 24px; + border-bottom: none; +} + +#tabs li.active a:hover { + background-color: #eeeeee; + padding: 4px 24px 5px 24px; + border-bottom: none; +} + +#tabs li a.icon_accept { + background-image: url(accept.png); + background-position: 5px; + background-repeat: no-repeat; + padding-left: 24px; + padding-right: 24px; +} + +#tabs li a.icon_accept:hover { + padding-left: 24px; + padding-right: 24px; +} + +#tabs_content_container { + border: 1px solid #ccc; + border-top: none; + padding: 10px; + width: 1000px; +} + +.tab_content { + display: none; +} + + diff --git a/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/NServiceBusLogo_black.png b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/NServiceBusLogo_black.png new file mode 100644 index 00000000000..961fbaf5c3f Binary files /dev/null and b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/NServiceBusLogo_black.png differ diff --git a/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/ga.js b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/ga.js new file mode 100644 index 00000000000..db1e7d93a0b --- /dev/null +++ b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/ga.js @@ -0,0 +1,64 @@ +(function(){var g=void 0,h=!0,Ge=null,l=!1,aa=encodeURIComponent,ba=Infinity,ca=setTimeout,da=isNaN,m=Math,ea=decodeURIComponent;function He(a,b){return a.onload=b}function Ie(a,b){return a.onerror=b}function ha(a,b){return a.name=b} +var n="push",ia="test",ja="slice",p="replace",ka="load",la="floor",ma="charAt",na="value",q="indexOf",oa="match",pa="port",qa="createElement",ra="path",r="name",kf="getTime",u="host",v="toString",w="length",x="prototype",sa="clientWidth",y="split",ta="stopPropagation",ua="scope",z="location",va="search",Je="random",A="protocol",wa="clientHeight",xa="href",B="substring",ya="apply",za="navigator",C="join",D="toLowerCase",E;function Aa(a,b){switch(b){case 0:return""+a;case 1:return 1*a;case 2:return!!a;case 3:return 1E3*a}return a}function Ba(a){return"function"==typeof a}function Ca(a){return a!=g&&-1<(a.constructor+"")[q]("String")}function F(a,b){return g==a||"-"==a&&!b||""==a}function Da(a){if(!a||""==a)return"";for(;a&&-1<" \n\r\t"[q](a[ma](0));)a=a[B](1);for(;a&&-1<" \n\r\t"[q](a[ma](a[w]-1));)a=a[B](0,a[w]-1);return a}function Ea(){return m.round(2147483647*m[Je]())}function Fa(){} +function G(a,b){if(aa instanceof Function)return b?encodeURI(a):aa(a);H(68);return escape(a)}function I(a){a=a[y]("+")[C](" ");if(ea instanceof Function)try{return ea(a)}catch(b){H(17)}else H(68);return unescape(a)}var Ga=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,!!d):a.attachEvent&&a.attachEvent("on"+b,c)},Ha=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,!!d):a.detachEvent&&a.detachEvent("on"+b,c)}; +function Ia(a,b){if(a){var c=J[qa]("script");c.type="text/javascript";c.async=h;c.src=a;c.id=b;var d=J.getElementsByTagName("script")[0];d.parentNode.insertBefore(c,d);return c}}function K(a){return a&&0a[y]("/")[0][q](":")&&(a=k+f[2][B](0,f[2].lastIndexOf("/"))+"/"+a);d.href=a;e=c(d);return{protocol:(d[A]||"")[D](),host:e[0], +port:e[1],path:e[2],Oa:d[va]||"",url:a||""}}function Na(a,b){function c(b,c){a.contains(b)||a.set(b,[]);a.get(b)[n](c)}for(var d=Da(b)[y]("&"),e=0;ef?c(d[e],"1"):c(d[e][B](0,f),d[e][B](f+1))}}function Pa(a,b){if(F(a)||"["==a[ma](0)&&"]"==a[ma](a[w]-1))return"-";var c=J.domain;return a[q](c+(b&&"/"!=b?b:""))==(0==a[q]("http://")?7:0==a[q]("https://")?8:0)?"0":a};var Qa=0;function Ra(a,b,c){!(1<=Qa)&&!(1<=100*m[Je]())&&(a=["utmt=error","utmerr="+a,"utmwv=5.4.1","utmn="+Ea(),"utmsp=1"],b&&a[n]("api="+b),c&&a[n]("msg="+G(c[B](0,100))),M.w&&a[n]("aip=1"),Sa(a[C]("&")),Qa++)};var Ta=0,Ua={};function N(a){return Va("x"+Ta++,a)}function Va(a,b){Ua[a]=!!b;return a} +var Wa=N(),Xa=Va("anonymizeIp"),Ya=N(),$a=N(),ab=N(),bb=N(),O=N(),P=N(),cb=N(),db=N(),eb=N(),fb=N(),gb=N(),hb=N(),ib=N(),jb=N(),kb=N(),lb=N(),nb=N(),ob=N(),pb=N(),qb=N(),rb=N(),sb=N(),tb=N(),ub=N(),vb=N(),wb=N(),xb=N(),yb=N(),zb=N(),Ab=N(),Bb=N(),Cb=N(),Db=N(),Eb=N(),Fb=N(h),Gb=Va("currencyCode"),Hb=Va("page"),Ib=Va("title"),Jb=N(),Kb=N(),Lb=N(),Mb=N(),Nb=N(),Ob=N(),Pb=N(),Qb=N(),Rb=N(),Q=N(h),Sb=N(h),Tb=N(h),Ub=N(h),Vb=N(h),Wb=N(h),Zb=N(h),$b=N(h),ac=N(h),bc=N(h),cc=N(h),R=N(h),dc=N(h),ec=N(h),fc= +N(h),gc=N(h),hc=N(h),ic=N(h),jc=N(h),S=N(h),kc=N(h),lc=N(h),mc=N(h),nc=N(h),oc=N(h),pc=N(h),qc=N(h),rc=Va("campaignParams"),sc=N(),tc=Va("hitCallback"),uc=N();N();var vc=N(),wc=N(),xc=N(),yc=N(),zc=N(),Ac=N(),Bc=N(),Cc=N(),Dc=N(),Ec=N(),Fc=N(),Gc=N(),Hc=N(),Ic=N();N();var Mc=N(),Nc=N(),Oc=N(),Oe=Va("uaName"),Pe=Va("uaDomain"),Qe=Va("uaPath");var Re=function(){function a(a,c,d){T($[x],a,c,d)}a("_createTracker",$[x].r,55);a("_getTracker",$[x].oa,0);a("_getTrackerByName",$[x].u,51);a("_getTrackers",$[x].pa,130);a("_anonymizeIp",$[x].aa,16);a("_forceSSL",$[x].la,125);a("_getPlugin",Pc,120)},Se=function(){function a(a,c,d){T(U[x],a,c,d)}Qc("_getName",$a,58);Qc("_getAccount",Wa,64);Qc("_visitCode",Q,54);Qc("_getClientInfo",ib,53,1);Qc("_getDetectTitle",lb,56,1);Qc("_getDetectFlash",jb,65,1);Qc("_getLocalGifPath",wb,57);Qc("_getServiceMode", +xb,59);V("_setClientInfo",ib,66,2);V("_setAccount",Wa,3);V("_setNamespace",Ya,48);V("_setAllowLinker",fb,11,2);V("_setDetectFlash",jb,61,2);V("_setDetectTitle",lb,62,2);V("_setLocalGifPath",wb,46,0);V("_setLocalServerMode",xb,92,g,0);V("_setRemoteServerMode",xb,63,g,1);V("_setLocalRemoteServerMode",xb,47,g,2);V("_setSampleRate",vb,45,1);V("_setCampaignTrack",kb,36,2);V("_setAllowAnchor",gb,7,2);V("_setCampNameKey",ob,41);V("_setCampContentKey",tb,38);V("_setCampIdKey",nb,39);V("_setCampMediumKey", +rb,40);V("_setCampNOKey",ub,42);V("_setCampSourceKey",qb,43);V("_setCampTermKey",sb,44);V("_setCampCIdKey",pb,37);V("_setCookiePath",P,9,0);V("_setMaxCustomVariables",yb,0,1);V("_setVisitorCookieTimeout",cb,28,1);V("_setSessionCookieTimeout",db,26,1);V("_setCampaignCookieTimeout",eb,29,1);V("_setReferrerOverride",Jb,49);V("_setSiteSpeedSampleRate",Dc,132);a("_trackPageview",U[x].Fa,1);a("_trackEvent",U[x].F,4);a("_trackPageLoadTime",U[x].Ea,100);a("_trackSocial",U[x].Ga,104);a("_trackTrans",U[x].Ia, +18);a("_sendXEvent",U[x].t,78);a("_createEventTracker",U[x].ia,74);a("_getVersion",U[x].qa,60);a("_setDomainName",U[x].B,6);a("_setAllowHash",U[x].va,8);a("_getLinkerUrl",U[x].na,52);a("_link",U[x].link,101);a("_linkByPost",U[x].ua,102);a("_setTrans",U[x].za,20);a("_addTrans",U[x].$,21);a("_addItem",U[x].Y,19);a("_clearTrans",U[x].ea,105);a("_setTransactionDelim",U[x].Aa,82);a("_setCustomVar",U[x].wa,10);a("_deleteCustomVar",U[x].ka,35);a("_getVisitorCustomVar",U[x].ra,50);a("_setXKey",U[x].Ca,83); +a("_setXValue",U[x].Da,84);a("_getXKey",U[x].sa,76);a("_getXValue",U[x].ta,77);a("_clearXKey",U[x].fa,72);a("_clearXValue",U[x].ga,73);a("_createXObj",U[x].ja,75);a("_addIgnoredOrganic",U[x].W,15);a("_clearIgnoredOrganic",U[x].ba,97);a("_addIgnoredRef",U[x].X,31);a("_clearIgnoredRef",U[x].ca,32);a("_addOrganic",U[x].Z,14);a("_clearOrganic",U[x].da,70);a("_cookiePathCopy",U[x].ha,30);a("_get",U[x].ma,106);a("_set",U[x].xa,107);a("_addEventListener",U[x].addEventListener,108);a("_removeEventListener", +U[x].removeEventListener,109);a("_addDevId",U[x].V);a("_getPlugin",Pc,122);a("_setPageGroup",U[x].ya,126);a("_trackTiming",U[x].Ha,124);a("_initData",U[x].v,2);a("_setVar",U[x].Ba,22);V("_setSessionTimeout",db,27,3);V("_setCookieTimeout",eb,25,3);V("_setCookiePersistence",cb,24,1);a("_setAutoTrackOutbound",Fa,79);a("_setTrackOutboundSubdomains",Fa,81);a("_setHrefExamineLimit",Fa,80)};function Pc(a){var b=this.plugins_;if(b)return b.get(a)} +var T=function(a,b,c,d){a[b]=function(){try{return d!=g&&H(d),c[ya](this,arguments)}catch(a){throw Ra("exc",b,a&&a[r]),a;}}},Qc=function(a,b,c,d){U[x][a]=function(){try{return H(c),Aa(this.a.get(b),d)}catch(e){throw Ra("exc",a,e&&e[r]),e;}}},V=function(a,b,c,d,e){U[x][a]=function(f){try{H(c),e==g?this.a.set(b,Aa(f,d)):this.a.set(b,e)}catch(Be){throw Ra("exc",a,Be&&Be[r]),Be;}}},Te=function(a,b){return{type:b,target:a,stopPropagation:function(){throw"aborted";}}};var Rc=RegExp(/(^|\.)doubleclick\.net$/i),Sc=function(a,b){return Rc[ia](J[z].hostname)?h:"/"!==b?l:(0==a[q]("www.google.")||0==a[q](".google.")||0==a[q]("google."))&&!(-1b[w]||ad(b[0],c))return l;b=b[ja](1)[C](".")[y]("|");0=b[w])return h;b=b[1][y](-1== +b[1][q](",")?"^":",");for(c=0;cb[w]||ad(b[0],c))return a.set(ec,g),a.set(fc,g),a.set(gc,g),a.set(ic,g),a.set(jc,g),a.set(nc,g),a.set(oc,g),a.set(pc,g),a.set(qc,g),a.set(S,g),a.set(kc,g),a.set(lc,g),a.set(mc,g),l;a.set(ec,1*b[1]);a.set(fc,1*b[2]);a.set(gc,1*b[3]);Ve(a,b[ja](4)[C]("."));return h},Ve=function(a,b){function c(a){return(a=b[oa](a+"=(.*?)(?:\\|utm|$)"))&&2==a[w]?a[1]:g}function d(b,c){c?(c=e?I(c):c[y]("%20")[C](" "), +a.set(b,c)):a.set(b,g)}-1==b[q]("=")&&(b=I(b));var e="2"==c("utmcvr");d(ic,c("utmcid"));d(jc,c("utmccn"));d(nc,c("utmcsr"));d(oc,c("utmcmd"));d(pc,c("utmctr"));d(qc,c("utmcct"));d(S,c("utmgclid"));d(kc,c("utmgclsrc"));d(lc,c("utmdclid"));d(mc,c("utmdsid"))},ad=function(a,b){return b?a!=b:!/^\d+$/[ia](a)};var Uc=function(){this.filters=[]};Uc[x].add=function(a,b){this.filters[n]({name:a,s:b})};Uc[x].execute=function(a){try{for(var b=0;b=100*a.get(vb)&&a[ta]()}function kd(a){ld(a.get(Wa))&&a[ta]()}function md(a){"file:"==J[z][A]&&a[ta]()}function nd(a){a.get(Ib)||a.set(Ib,J.title,h);a.get(Hb)||a.set(Hb,J[z].pathname+J[z][va],h)};var od=new function(){var a=[];this.set=function(b){a[b]=h};this.Xa=function(){for(var b=[],c=0;c=b[0]||0>=b[1]?"":b[C]("x");a.Wa=d}catch(k){H(135)}qd=a}},td=function(){sd(); +for(var a=qd,b=W[za],a=b.appName+b.version+a.language+b.platform+b.userAgent+a.javaEnabled+a.Q+a.P+(J.cookie?J.cookie:"")+(J.referrer?J.referrer:""),b=a[w],c=W.history[w];0d?(this.i=b[B](0,d),this.l=b[B](d+1,c),this.h=b[B](c+1)):(this.i=b[B](0,d),this.h=b[B](d+1));this.k=a[ja](1);this.Ma=!this.l&&"_require"==this.h;this.J=!this.i&&!this.l&&"_provide"==this.h}},Y=function(){T(Y[x],"push",Y[x][n],5);T(Y[x],"_getPlugin",Pc,121);T(Y[x], +"_createAsyncTracker",Y[x].Sa,33);T(Y[x],"_getAsyncTracker",Y[x].Ta,34);this.I=new Ja;this.p=[]};E=Y[x];E.Na=function(a,b,c){var d=this.I.get(a);if(!Ba(d))return l;b.plugins_=b.plugins_||new Ja;b.plugins_.set(a,new d(b,c||{}));return h};E.push=function(a){var b=Z.Va[ya](this,arguments),b=Z.p.concat(b);for(Z.p=[];0e?b+"#"+d:b+"&"+d;c="";f=b[q]("?");0f?b+"?"+d+c:b+"&"+d+c},$d=function(a,b,c,d){for(var e=0;3>e;e++){for(var f=0;3>f;f++){if(d==Yc(a+b+c))return H(127),[b,c];var Be=b[p](/ /g, +"%20"),k=c[p](/ /g,"%20");if(d==Yc(a+Be+k))return H(128),[Be,k];Be=Be[p](/\+/g,"%20");k=k[p](/\+/g,"%20");if(d==Yc(a+Be+k))return H(129),[Be,k];try{var s=b[oa]("utmctr=(.*?)(?:\\|utm|$)");if(s&&2==s[w]&&(Be=b[p](s[1],G(I(s[1]))),d==Yc(a+Be+c)))return H(139),[Be,c]}catch(t){}b=I(b)}c=I(c)}};var de="|",fe=function(a,b,c,d,e,f,Be,k,s){var t=ee(a,b);t||(t={},a.get(Cb)[n](t));t.id_=b;t.affiliation_=c;t.total_=d;t.tax_=e;t.shipping_=f;t.city_=Be;t.state_=k;t.country_=s;t.items_=t.items_||[];return t},ge=function(a,b,c,d,e,f,Be){a=ee(a,b)||fe(a,b,"",0,0,0,"","","");var k;a:{if(a&&a.items_){k=a.items_;for(var s=0;sb[w])&&/^\d+$/[ia](b[0])&&(b[0]=""+c,Fd(a,"__utmx",b[C]("."),g))},be=function(a,b){var c=$c(a.get(O),pd("__utmx"));"-"==c&&(c="");return b?G(c):c},Ye=function(a){try{var b=La(J[z][xa],l),c=ea(L(b.d.get("utm_referrer")))||"";c&&a.set(Jb,c);var d=W.gaData&&W.gaData.expId;d||(d=ea(K(b.d.get("utm_expid")))||"");d&&a.set(Oc,""+d)}catch(e){H(146)}};var ke=function(a,b){var c=m.min(a.b(Dc,0),100);if(a.b(Q,0)%100>=c)return l;c=Ze()||$e();if(c==g)return l;var d=c[0];if(d==g||d==ba||da(d))return l;0a[b])return l;return h},le=function(a){return da(a)||0>a? +0:5E3>a?10*m[la](a/10):5E4>a?100*m[la](a/100):41E5>a?1E3*m[la](a/1E3):41E5},je=function(a){for(var b=new yd,c=0;cc[w])){for(var d=[],e=0;e=f)return l;c=1*(""+c);if(""==a||(!wd(a)||""==b||!wd(b)||!xd(c)||da(c)||0>c||0>f||100=a||a>e.get(yb))a=l;else if(!b||!c||128=a&&Ca(b)&&""!=b){var c=this.get(Fc)||[];c[a]=b;this.set(Fc,c)}};E.V=function(a){a=""+a;if(a[oa](/^[A-Za-z0-9]{1,5}$/)){var b=this.get(Ic)||[];b[n](a);this.set(Ic,b)}};E.v=function(){this.a[ka]()};E.Ba=function(a){a&&""!=a&&(this.set(Tb,a),this.a.j("var"))};var ef=l; +function df(){function a(a,d){var e="p="+a+"&id="+b,s=new Image(1,1);s.src=(Ne()||M.G?"https://ssl.google-analytics.com":"http://www.google-analytics.com")+"/u/"+c[d]+".gif?"+e;He(s,function(){He(s,Ge);Ie(s,Ge)});Ie(s,function(){He(s,Ge);Ie(s,Ge)})}if(!ef){ef=h;var b=[Ea(),Ea(),Ea()][C]("."),c=["a","b","c"],d=[[0,1],[1,0],[0,2],[2,0]],e=m[la](m[Je]()*d[w]);a(e,d[e][0]);a(e,d[e][1])}};var ne=function(a){"trans"!==a.get(sc)&&500<=a.b(cc,0)&&a[ta]();if("event"===a.get(sc)){var b=(new Date)[kf](),c=a.b(dc,0),d=a.b(Zb,0),c=m[la](1*((b-(c!=d?c:1E3*c))/1E3));0=a.b(R,0)&&a[ta]()}},pe=function(a){"event"===a.get(sc)&&a.set(R,m.max(0,a.b(R,10)-1))};var qe=function(){var a=[];this.add=function(b,c,d){d&&(c=G(""+c));a[n](b+"="+c)};this.toString=function(){return a[C]("&")}},re=function(a,b){(b||2!=a.get(xb))&&a.Za(cc)},se=function(a,b){b.add("utmwv","5.4.1");b.add("utms",a.get(cc));b.add("utmn",Ea());var c=J[z].hostname;F(c)||b.add("utmhn",c,h);c=a.get(vb);100!=c&&b.add("utmsp",c,h)},te=function(a,b){b.add("utmht",(new Date)[kf]());b.add("utmac",Da(a.get(Wa)));a.get(Oc)&&b.add("utmxkey",a.get(Oc),h);a.get(vc)&&b.add("utmni",1);var c=a.get(Ic); +c&&0=a[w])gf(a,b,c);else if(8192>=a[w]){if(0<=W[za].userAgent[q]("Firefox")&&![].reduce)throw new De(a[w]);hf(a,b)||Ee(a,b)}else throw new Ce(a[w]);},gf=function(a,b,c){c=c||(Ne()||M.G?"https://ssl.google-analytics.com":"http://www.google-analytics.com")+"/__utm.gif?";var d=new Image(1,1);d.src=c+a;He(d,function(){He(d,Ge);Ie(d,Ge);b()});Ie(d,function(){He(d, +Ge);Ie(d,Ge);b()})},hf=function(a,b){var c,d=(Ne()||M.G?"https://ssl.google-analytics.com":"http://www.google-analytics.com")+"/p/__utm.gif",e=W.XDomainRequest;if(e)c=new e,c.open("POST",d);else if(e=W.XMLHttpRequest)e=new e,"withCredentials"in e&&(c=e,c.open("POST",d,h),c.setRequestHeader("Content-Type","text/plain"));if(c)return c.onreadystatechange=function(){4==c.readyState&&(b(),c=Ge)},c.send(a),h},Ee=function(a,b){if(J.body){a=aa(a);try{var c=J[qa]('')}catch(d){c= +J[qa]("iframe"),ha(c,a)}c.height="0";c.width="0";c.style.display="none";c.style.visibility="hidden";var e=J[z],e=(Ne()||M.G?"https://ssl.google-analytics.com":"http://www.google-analytics.com")+"/u/post_iframe.html#"+aa(e[A]+"//"+e[u]+"/favicon.ico"),f=function(){c.src="";c.parentNode&&c.parentNode.removeChild(c)};Ga(W,"beforeunload",f);var Be=l,k=0,s=function(){if(!Be){try{if(9>21:b}return b};})(); diff --git a/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/global.css b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/global.css new file mode 100644 index 00000000000..f21192fd69b --- /dev/null +++ b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/global.css @@ -0,0 +1,225 @@ + +#container { + width:1000px; + height:350px; + margin-top:30px; + /*margin:0 auto;*/ + position:relative; + /* z-index:0;*/ +} + +#frame { + position:absolute; + z-index:0; + width:1000px; + height:350px; + top:-3px; + left:-80px; +} + +#slides { + position:relative; + top:0px; + left:0px; + z-index:100; +} + +/* + Slides container + Important: + Set the width of your slides container + If height not specified height will be set by the slide content + Set to display none, prevents content flash +*/ + +.slides_container { + width:1000px; + height:350px; + overflow:hidden; + position:relative; + display:none; +} + +.slides_container div { + width:1000px; + height:350px; + display:block; +} + +/* + Each slide + Important: + Set the width of your slides + Offeset for the 20px of padding + If height not specified height will be set by the slide content + Set to display block +*/ + +#slides .slide { + padding:0px; + width:1000px; + height:350px; + display:block; +} + +/* + Next/prev buttons +*/ +/* +#slides .next,#slides .prev { + position:absolute; + top:150px; + left:-24px; + width:24px; + height:43px; + display:block; + z-index:101; +} +*/ + +/* +#slides .next { + left:1000px; +} +*/ + +/* + Pagination +*/ + +.pagination { + position:relative; + top:-35px; + z-index:101; + margin:10px 0 0 900px; + width:100px; +} + +.pagination li { + float:left; + margin:0 1px; + list-style:none; +} + +.pagination li a { + display:block; + width:12px; + height:0; + padding-top:12px; + background-image:url(../img/pagination.png); + background-position:0 0; + float:left; + overflow:hidden; +} + +.pagination li.current a { + background-position:0 -12px; +} + +/* + Slide and Slide Button Styles +*/ + +.slide_one, .slide_two, .slide_three, .slide_four { + background-position: top left; + background-repeat: repeat-x; /* no-repeat; */ + background-attachment:scroll; +} + +.slide_one { background-image: url(http://images.nservicebus.com/dev_friendly.jpg); } +.slide_two { background-image: url(http://images.nservicebus.com/adv_tooling.jpg); } +.slide_three { background-image: url(http://images.nservicebus.com/24x7_support.jpg); } +.slide_four { background-image: url(http://images.nservicebus.com/startups_to_fortune.jpg); } + +.nsb40banner_image { display: block; width: 1000px; height: 151px; position: relative; background-position: 0 0; background-repeat: no-repeat; } +.nsb40banner_image .nsb40banner_link { display: block; position: absolute; text-indent: -999em; overflow: hidden; } +.nsb40banner_image #nsb40banner_link_0 { width: 315px; height: 39px; top: 83px; left: 73px; } +.nsb40banner_image #nsb40banner_link_1 { width: 317px; height: 41px; top: 82px; left: 618.9900512695312px; } + +.nsb40banner { + padding:0px; + width:1000px; + height:151px; + display:block; + background-image: url('../img/beta40Banner.png'); + background-position: top left; + background-repeat: repeat-x; /* no-repeat; */ + background-attachment:scroll; +} + + + +a.slide_button, a.slide_button:hover, a.slide_button:active { + background-color: #34a200; + z-index: 50px; + position: relative; + padding: 7px 40px; + border: 1px solid #b3cbcc; + font-family: "Helvetica Neue", Arial, Helvetica, Geneva, sans-serif; + font-size: 22px; + font-weight: normal; + text-shadow: #000 0px -1px 1px; + color: #EEE; + text-decoration: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + -webkit-box-shadow: 0px 1px 2px 0px #000000; + box-shadow: 0px 1px 2px 0px #000000; + background: #42a513; /* Old browsers */ + background: #46a917; /* Old browsers */ + /* IE9 SVG, needs conditional override of 'filter' to 'none' */ + /* background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzQ2YTkxNyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9Ijk3JSIgc3RvcC1jb2xvcj0iIzMzOTYwNCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9Ijk4JSIgc3RvcC1jb2xvcj0iIzJlODYwNCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMyMzY5MDIiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); */ + background: -moz-linear-gradient(top, #46a917 0%, #339604 97%, #2e8604 98%, #236902 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#46a917), color-stop(97%,#339604), color-stop(98%,#2e8604), color-stop(100%,#236902)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #46a917 0%,#339604 97%,#2e8604 98%,#236902 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #46a917 0%,#339604 97%,#2e8604 98%,#236902 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #46a917 0%,#339604 97%,#2e8604 98%,#236902 100%); /* IE10+ */ + background: linear-gradient(to bottom, #46a917 0%,#339604 97%,#2e8604 98%,#236902 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#46a917', endColorstr='#236902',GradientType=0 ); /* IE6-8 */ + +} + +a.slide_button:hover { + background: #4ed70f; /* Old browsers */ + /* IE9 SVG, needs conditional override of 'filter' to 'none' */ + /* background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzRlZDcwZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9Ijk3JSIgc3RvcC1jb2xvcj0iIzQzYjcwZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9Ijk4JSIgc3RvcC1jb2xvcj0iIzNlYWEwYyIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiMzNDkwMGEiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); */ + background: -moz-linear-gradient(top, #4ed70f 0%, #43b70d 97%, #3eaa0c 98%, #34900a 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#4ed70f), color-stop(97%,#43b70d), color-stop(98%,#3eaa0c), color-stop(100%,#34900a)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #4ed70f 0%,#43b70d 97%,#3eaa0c 98%,#34900a 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #4ed70f 0%,#43b70d 97%,#3eaa0c 98%,#34900a 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #4ed70f 0%,#43b70d 97%,#3eaa0c 98%,#34900a 100%); /* IE10+ */ + background: linear-gradient(to bottom, #4ed70f 0%,#43b70d 97%,#3eaa0c 98%,#34900a 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#4ed70f', endColorstr='#34900a',GradientType=0 ); /* IE6-8 */ + + color: #FFF; +} + +a.slide_button:active { + background: #236902; /* Old browsers */ + /* IE9 SVG, needs conditional override of 'filter' to 'none' */ + /* background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iIzIzNjkwMiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjIlIiBzdG9wLWNvbG9yPSIjMmU4NjA0IiBzdG9wLW9wYWNpdHk9IjEiLz4KICAgIDxzdG9wIG9mZnNldD0iMyUiIHN0b3AtY29sb3I9IiMzMzk2MDQiIHN0b3Atb3BhY2l0eT0iMSIvPgogICAgPHN0b3Agb2Zmc2V0PSIxMDAlIiBzdG9wLWNvbG9yPSIjNDZhOTE3IiBzdG9wLW9wYWNpdHk9IjEiLz4KICA8L2xpbmVhckdyYWRpZW50PgogIDxyZWN0IHg9IjAiIHk9IjAiIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9InVybCgjZ3JhZC11Y2dnLWdlbmVyYXRlZCkiIC8+Cjwvc3ZnPg==); */ + background: -moz-linear-gradient(top, #236902 0%, #2e8604 2%, #339604 3%, #46a917 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#236902), color-stop(2%,#2e8604), color-stop(3%,#339604), color-stop(100%,#46a917)); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, #236902 0%,#2e8604 2%,#339604 3%,#46a917 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, #236902 0%,#2e8604 2%,#339604 3%,#46a917 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, #236902 0%,#2e8604 2%,#339604 3%,#46a917 100%); /* IE10+ */ + background: linear-gradient(to bottom, #236902 0%,#2e8604 2%,#339604 3%,#46a917 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#236902', endColorstr='#46a917',GradientType=0 ); /* IE6-8 */ + + color: #DDD; + + border-color: #000; + + -webkit-box-shadow: 0px -1px 1px 0px #777; + box-shadow: 0px -1px 1px 0px #777; +} + +.slide_one a.slide_button {top: 254px; left: 780px} + +.slide_two a.button_a {top: 280px; left: 210px; padding: 5px 65px;} +.slide_two a.button_b {top: 280px; left: 223px; padding: 5px 65px;} +.slide_two a.button_c {top: 280px; left: 235px; padding: 5px 65px;} + +.slide_three a.slide_button {top: 267px; left: 779px} +.slide_four a.slide_button {top: 267px; left: 779px} \ No newline at end of file diff --git a/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/jquery-1.8.2.min.js b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/jquery-1.8.2.min.js new file mode 100644 index 00000000000..bc3fbc81b26 --- /dev/null +++ b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/jquery-1.8.2.min.js @@ -0,0 +1,2 @@ +/*! jQuery v1.8.2 jquery.com | jquery.org/license */ +(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bS[a]=c,c}function ci(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||ce.test(a)?d(a,e):ci(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ci(a+"["+e+"]",b[e],c,d);else d(a,b)}function cz(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.2",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,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(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return a!=null?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b
    a",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="
    t
    ",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
    ",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||p.guid++:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.length,e=c.shift(),f=p._queueHooks(a,b),g=function(){p.dequeue(a,b)};e==="inprogress"&&(e=c.shift(),d--),e&&(b==="fx"&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c=0)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c=0)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,d+""),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;j=0:p.find(m,this,null,[f]).length),h[m]&&j.push(l);j.length&&u.push({elem:f,matches:j})}o.length>q&&u.push({elem:this,matches:o.slice(q)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bc(a,b,c,d){c=c||[],b=b||r;var e,f,i,j,k=b.nodeType;if(!a||typeof a!="string")return c;if(k!==1&&k!==9)return[];i=g(b);if(!i&&!d)if(e=P.exec(a))if(j=e[1]){if(k===9){f=b.getElementById(j);if(!f||!f.parentNode)return c;if(f.id===j)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(j))&&h(b,f)&&f.id===j)return c.push(f),c}else{if(e[2])return w.apply(c,x.call(b.getElementsByTagName(a),0)),c;if((j=e[3])&&_&&b.getElementsByClassName)return w.apply(c,x.call(b.getElementsByClassName(j),0)),c}return bp(a.replace(L,"$1"),b,c,d,i)}function bd(a){return function(b){var c=b.nodeName.toLowerCase();return c==="input"&&b.type===a}}function be(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}}function bf(a){return z(function(b){return b=+b,z(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function bg(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}function bh(a,b){var c,d,f,g,h,i,j,k=C[o][a];if(k)return b?0:k.slice(0);h=a,i=[],j=e.preFilter;while(h){if(!c||(d=M.exec(h)))d&&(h=h.slice(d[0].length)),i.push(f=[]);c=!1;if(d=N.exec(h))f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=d[0].replace(L," ");for(g in e.filter)(d=W[g].exec(h))&&(!j[g]||(d=j[g](d,r,!0)))&&(f.push(c=new q(d.shift())),h=h.slice(c.length),c.type=g,c.matches=d);if(!c)break}return b?h.length:h?bc.error(a):C(a,i).slice(0)}function bi(a,b,d){var e=b.dir,f=d&&b.dir==="parentNode",g=u++;return b.first?function(b,c,d){while(b=b[e])if(f||b.nodeType===1)return a(b,c,d)}:function(b,d,h){if(!h){var i,j=t+" "+g+" ",k=j+c;while(b=b[e])if(f||b.nodeType===1){if((i=b[o])===k)return b.sizset;if(typeof i=="string"&&i.indexOf(j)===0){if(b.sizset)return b}else{b[o]=k;if(a(b,d,h))return b.sizset=!0,b;b.sizset=!1}}}else while(b=b[e])if(f||b.nodeType===1)if(a(b,d,h))return b}}function bj(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function bk(a,b,c,d,e){var f,g=[],h=0,i=a.length,j=b!=null;for(;h-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==l)||((b=c).nodeType?j(a,c,d):k(a,c,d))}];for(;i1&&bj(m),i>1&&a.slice(0,i-1).join("").replace(L,"$1"),c,i0,f=a.length>0,g=function(h,i,j,k,m){var n,o,p,q=[],s=0,u="0",x=h&&[],y=m!=null,z=l,A=h||f&&e.find.TAG("*",m&&i.parentNode||i),B=t+=z==null?1:Math.E;y&&(l=i!==r&&i,c=g.el);for(;(n=A[u])!=null;u++){if(f&&n){for(o=0;p=a[o];o++)if(p(n,i,j)){k.push(n);break}y&&(t=B,c=++g.el)}d&&((n=!p&&n)&&s--,h&&x.push(n))}s+=u;if(d&&u!==s){for(o=0;p=b[o];o++)p(x,q,i,j);if(h){if(s>0)while(u--)!x[u]&&!q[u]&&(q[u]=v.call(k));q=bk(q)}w.apply(k,q),y&&!h&&q.length>0&&s+b.length>1&&bc.uniqueSort(k)}return y&&(t=B,l=z),x};return g.el=0,d?z(g):g}function bo(a,b,c,d){var e=0,f=b.length;for(;e2&&(j=h[0]).type==="ID"&&b.nodeType===9&&!f&&e.relative[h[1].type]){b=e.find.ID(j.matches[0].replace(V,""),b,f)[0];if(!b)return c;a=a.slice(h.shift().length)}for(g=W.POS.test(a)?-1:h.length-1;g>=0;g--){j=h[g];if(e.relative[k=j.type])break;if(l=e.find[k])if(d=l(j.matches[0].replace(V,""),R.test(h[0].type)&&b.parentNode||b,f)){h.splice(g,1),a=d.length&&h.join("");if(!a)return w.apply(c,x.call(d,0)),c;break}}}return i(a,m)(d,b,f,c,R.test(a)),c}function bq(){}var c,d,e,f,g,h,i,j,k,l,m=!0,n="undefined",o=("sizcache"+Math.random()).replace(".",""),q=String,r=a.document,s=r.documentElement,t=0,u=0,v=[].pop,w=[].push,x=[].slice,y=[].indexOf||function(a){var b=0,c=this.length;for(;be.cacheLength&&delete a[b.shift()],a[c]=d},a)},B=A(),C=A(),D=A(),E="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",G=F.replace("w","w#"),H="([*^$|!~]?=)",I="\\["+E+"*("+F+")"+E+"*(?:"+H+E+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+G+")|)|)"+E+"*\\]",J=":("+F+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+I+")|[^:]|\\\\.)*|.*))\\)|)",K=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+E+"*((?:-\\d)?\\d*)"+E+"*\\)|)(?=[^-]|$)",L=new RegExp("^"+E+"+|((?:^|[^\\\\])(?:\\\\.)*)"+E+"+$","g"),M=new RegExp("^"+E+"*,"+E+"*"),N=new RegExp("^"+E+"*([\\x20\\t\\r\\n\\f>+~])"+E+"*"),O=new RegExp(J),P=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,Q=/^:not/,R=/[\x20\t\r\n\f]*[+~]/,S=/:not\($/,T=/h\d/i,U=/input|select|textarea|button/i,V=/\\(?!\\)/g,W={ID:new RegExp("^#("+F+")"),CLASS:new RegExp("^\\.("+F+")"),NAME:new RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:new RegExp("^("+F.replace("w","w*")+")"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+J),POS:new RegExp(K,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+E+"*(even|odd|(([+-]|)(\\d*)n|)"+E+"*(?:([+-]|)"+E+"*(\\d+)|))"+E+"*\\)|)","i"),needsContext:new RegExp("^"+E+"*[>+~]|"+K,"i")},X=function(a){var b=r.createElement("div");try{return a(b)}catch(c){return!1}finally{b=null}},Y=X(function(a){return a.appendChild(r.createComment("")),!a.getElementsByTagName("*").length}),Z=X(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==n&&a.firstChild.getAttribute("href")==="#"}),$=X(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),_=X(function(a){return a.innerHTML="",!a.getElementsByClassName||!a.getElementsByClassName("e").length?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length===2)}),ba=X(function(a){a.id=o+0,a.innerHTML="
    ",s.insertBefore(a,s.firstChild);var b=r.getElementsByName&&r.getElementsByName(o).length===2+r.getElementsByName(o+0).length;return d=!r.getElementById(o),s.removeChild(a),b});try{x.call(s.childNodes,0)[0].nodeType}catch(bb){x=function(a){var b,c=[];for(;b=this[a];a++)c.push(b);return c}}bc.matches=function(a,b){return bc(a,null,null,b)},bc.matchesSelector=function(a,b){return bc(b,null,null,[a]).length>0},f=bc.getText=function(a){var b,c="",d=0,e=a.nodeType;if(e){if(e===1||e===9||e===11){if(typeof a.textContent=="string")return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=f(a)}else if(e===3||e===4)return a.nodeValue}else for(;b=a[d];d++)c+=f(b);return c},g=bc.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?b.nodeName!=="HTML":!1},h=bc.contains=s.contains?function(a,b){var c=a.nodeType===9?a.documentElement:a,d=b&&b.parentNode;return a===d||!!(d&&d.nodeType===1&&c.contains&&c.contains(d))}:s.compareDocumentPosition?function(a,b){return b&&!!(a.compareDocumentPosition(b)&16)}:function(a,b){while(b=b.parentNode)if(b===a)return!0;return!1},bc.attr=function(a,b){var c,d=g(a);return d||(b=b.toLowerCase()),(c=e.attrHandle[b])?c(a):d||$?a.getAttribute(b):(c=a.getAttributeNode(b),c?typeof a[b]=="boolean"?a[b]?b:null:c.specified?c.value:null:null)},e=bc.selectors={cacheLength:50,createPseudo:z,match:W,attrHandle:Z?{}:{href:function(a){return a.getAttribute("href",2)},type:function(a){return a.getAttribute("type")}},find:{ID:d?function(a,b,c){if(typeof b.getElementById!==n&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==n&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==n&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:Y?function(a,b){if(typeof b.getElementsByTagName!==n)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c},NAME:ba&&function(a,b){if(typeof b.getElementsByName!==n)return b.getElementsByName(name)},CLASS:_&&function(a,b,c){if(typeof b.getElementsByClassName!==n&&!c)return b.getElementsByClassName(a)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(V,""),a[3]=(a[4]||a[5]||"").replace(V,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||bc.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&bc.error(a[0]),a},PSEUDO:function(a){var b,c;if(W.CHILD.test(a[0]))return null;if(a[3])a[2]=a[3];else if(b=a[4])O.test(b)&&(c=bh(b,!0))&&(c=b.indexOf(")",b.length-c)-b.length)&&(b=b.slice(0,c),a[0]=a[0].slice(0,c)),a[2]=b;return a.slice(0,3)}},filter:{ID:d?function(a){return a=a.replace(V,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(V,""),function(b){var c=typeof b.getAttributeNode!==n&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(V,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=B[o][a];return b||(b=B(a,new RegExp("(^|"+E+")"+a+"("+E+"|$)"))),function(a){return b.test(a.className||typeof a.getAttribute!==n&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return function(d,e){var f=bc.attr(d,a);return f==null?b==="!=":b?(f+="",b==="="?f===c:b==="!="?f!==c:b==="^="?c&&f.indexOf(c)===0:b==="*="?c&&f.indexOf(c)>-1:b==="$="?c&&f.substr(f.length-c.length)===c:b==="~="?(" "+f+" ").indexOf(c)>-1:b==="|="?f===c||f.substr(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d){return a==="nth"?function(a){var b,e,f=a.parentNode;if(c===1&&d===0)return!0;if(f){e=0;for(b=f.firstChild;b;b=b.nextSibling)if(b.nodeType===1){e++;if(a===b)break}}return e-=d,e===c||e%c===0&&e/c>=0}:function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b){var c,d=e.pseudos[a]||e.setFilters[a.toLowerCase()]||bc.error("unsupported pseudo: "+a);return d[o]?d(b):d.length>1?(c=[a,a,"",b],e.setFilters.hasOwnProperty(a.toLowerCase())?z(function(a,c){var e,f=d(a,b),g=f.length;while(g--)e=y.call(a,f[g]),a[e]=!(c[e]=f[g])}):function(a){return d(a,0,c)}):d}},pseudos:{not:z(function(a){var b=[],c=[],d=i(a.replace(L,"$1"));return d[o]?z(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)if(f=g[h])a[h]=!(b[h]=f)}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:z(function(a){return function(b){return bc(a,b).length>0}}),contains:z(function(a){return function(b){return(b.textContent||b.innerText||f(b)).indexOf(a)>-1}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!e.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},header:function(a){return T.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:bd("radio"),checkbox:bd("checkbox"),file:bd("file"),password:bd("password"),image:bd("image"),submit:be("submit"),reset:be("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return U.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement},first:bf(function(a,b,c){return[0]}),last:bf(function(a,b,c){return[b-1]}),eq:bf(function(a,b,c){return[c<0?c+b:c]}),even:bf(function(a,b,c){for(var d=0;d=0;)a.push(d);return a}),gt:bf(function(a,b,c){for(var d=c<0?c+b:c;++d",a.querySelectorAll("[selected]").length||e.push("\\["+E+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),X(function(a){a.innerHTML="

    ",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+E+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=new RegExp(e.join("|")),bp=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a))){var i,j,k=!0,l=o,m=d,n=d.nodeType===9&&a;if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){i=bh(a),(k=d.getAttribute("id"))?l=k.replace(c,"\\$&"):d.setAttribute("id",l),l="[id='"+l+"'] ",j=i.length;while(j--)i[j]=l+i[j].join("");m=R.test(a)&&d.parentNode||d,n=i.join(",")}if(n)try{return w.apply(f,x.call(m.querySelectorAll(n),0)),f}catch(p){}finally{k||d.removeAttribute("id")}}return b(a,d,f,g,h)},h&&(X(function(b){a=h.call(b,"div");try{h.call(b,"[test!='']:sizzle"),f.push("!=",J)}catch(c){}}),f=new RegExp(f.join("|")),bc.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!g(b)&&!f.test(c)&&(!e||!e.test(c)))try{var i=h.call(b,c);if(i||a||b.document&&b.document.nodeType!==11)return i}catch(j){}return bc(c,null,null,[b]).length>0})}(),e.pseudos.nth=e.pseudos.eq,e.filters=bq.prototype=e.pseudos,e.setFilters=new bq,bc.attr=p.attr,p.find=bc,p.expr=bc.selectors,p.expr[":"]=p.expr.pseudos,p.unique=bc.uniqueSort,p.text=bc.getText,p.isXMLDoc=bc.isXML,p.contains=bc.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X
    ","
    "]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=b===e&&bA,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(f=0;(h=a[f])!=null;f++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{s=s||bk(b),l=b.createElement("div"),s.appendChild(l),h=h.replace(bo,"<$1>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(g=n.length-1;g>=0;--g)p.nodeName(n[g],"tbody")&&!n[g].childNodes.length&&n[g].parentNode.removeChild(n[g])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l.parentNode.removeChild(l)}h.nodeType?t.push(h):p.merge(t,h)}l&&(h=l=s=null);if(!p.support.appendChecked)for(f=0;(h=t[f])!=null;f++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(f=0;(h=t[f])!=null;f++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[f+1,0].concat(r)),f+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.chrome?b.webkit=!0:b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^(none|table(?!-c[ea]).+)/,bO=/^margin/,bP=new RegExp("^("+q+")(.*)$","i"),bQ=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bR=new RegExp("^([-+])=("+q+")","i"),bS={},bT={position:"absolute",visibility:"hidden",display:"block"},bU={letterSpacing:0,fontWeight:400},bV=["Top","Right","Bottom","Left"],bW=["Webkit","O","Moz","ms"],bX=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return b$(this,!0)},hide:function(){return b$(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bX.apply(this,arguments):this.each(function(){(c?a:bZ(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bY(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bR.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bY(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bU&&(f=bU[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(b,c){var d,e,f,g,h=a.getComputedStyle(b,null),i=b.style;return h&&(d=h[c],d===""&&!p.contains(b.ownerDocument,b)&&(d=p.style(b,c)),bQ.test(d)&&bO.test(c)&&(e=i.width,f=i.minWidth,g=i.maxWidth,i.minWidth=i.maxWidth=i.width=d,d=h.width,i.width=e,i.minWidth=f,i.maxWidth=g)),d}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bQ.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth===0&&bN.test(bH(a,"display"))?p.swap(a,bT,function(){return cb(a,b,d)}):cb(a,b,d)},set:function(a,c,d){return b_(a,c,d?ca(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bQ.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bV[d]+b]=e[d]||e[d-2]||e[0];return f}},bO.test(a)||(p.cssHooks[a+b].set=b_)});var cd=/%20/g,ce=/\[\]$/,cf=/\r?\n/g,cg=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,ch=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ch.test(this.nodeName)||cg.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(cf,"\r\n")}}):{name:b.name,value:c.replace(cf,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ci(d,a[d],c,f);return e.join("&").replace(cd,"+")};var cj,ck,cl=/#.*$/,cm=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,co=/^(?:GET|HEAD)$/,cp=/^\/\//,cq=/\?/,cr=/)<[^<]*)*<\/script>/gi,cs=/([?&])_=[^&]*/,ct=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,cu=p.fn.load,cv={},cw={},cx=["*/"]+["*"];try{ck=f.href}catch(cy){ck=e.createElement("a"),ck.href="",ck=ck.href}cj=ct.exec(ck.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&cu)return cu.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):c&&typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("
    ").append(a.replace(cr,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cB(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cB(a,b),a},ajaxSettings:{url:ck,isLocal:cn.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cx},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cz(cv),ajaxTransport:cz(cw),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cC(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cD(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=(c||y)+"",k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cm.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(cl,"").replace(cp,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=ct.exec(l.url.toLowerCase())||!1,l.crossDomain=i&&i.join(":")+(i[3]?"":i[1]==="http:"?80:443)!==cj.join(":")+(cj[3]?"":cj[1]==="http:"?80:443)),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cA(cv,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!co.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cq.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cs,"$1_="+z);l.url=A+(A===l.url?(cq.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cx+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cA(cw,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cE=[],cF=/\?/,cG=/(=)\?(?=&|$)|\?\?/,cH=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cE.pop()||p.expando+"_"+cH++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cG.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cG.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cG,"$1"+f):m?c.data=i.replace(cG,"$1"+f):k&&(c.url+=(cF.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cE.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cI,cJ=a.ActiveXObject?function(){for(var a in cI)cI[a](0,1)}:!1,cK=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cL()||cM()}:cL,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cJ&&delete cI[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cK,cJ&&(cI||(cI={},p(a).unload(cJ)),cI[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cN,cO,cP=/^(?:toggle|show|hide)$/,cQ=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cR=/queueHooks$/,cS=[cY],cT={"*":[function(a,b){var c,d,e=this.createTween(a,b),f=cQ.exec(b),g=e.cur(),h=+g||0,i=1,j=20;if(f){c=+f[2],d=f[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&h){h=p.css(e.elem,a,!0)||c||1;do i=i||".5",h=h/i,p.style(e.elem,a,h+d);while(i!==(i=e.cur()/g)&&i!==1&&--j)}e.unit=d,e.start=h,e.end=f[1]?h+(f[1]+1)*c:c}return e}]};p.Animation=p.extend(cW,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c_.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c_.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=da(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g,null)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); \ No newline at end of file diff --git a/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/jquery.fancybox-1.3.1.css b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/jquery.fancybox-1.3.1.css new file mode 100644 index 00000000000..f8508856308 --- /dev/null +++ b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/jquery.fancybox-1.3.1.css @@ -0,0 +1,363 @@ +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * + * Version: 1.3.1 (05/03/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +#fancybox-loading { + position: fixed; + top: 50%; + left: 50%; + height: 40px; + width: 40px; + margin-top: -20px; + margin-left: -20px; + cursor: pointer; + overflow: hidden; + z-index: 1104; + display: none; +} + +* html #fancybox-loading { /* IE6 */ + position: absolute; + margin-top: 0; +} + +#fancybox-loading div { + position: absolute; + top: 0; + left: 0; + width: 40px; + height: 480px; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox.png'); +} + +#fancybox-overlay { + position: fixed; + top: 0; + left: 0; + bottom: 0; + right: 0; + background: #000; + z-index: 1100; + display: none; +} + +* html #fancybox-overlay { /* IE6 */ + position: absolute; + width: 100%; +} + +#fancybox-tmp { + padding: 0; + margin: 0; + border: 0; + overflow: auto; + display: none; +} + +#fancybox-wrap { + position: absolute; + top: 0; + left: 0; + margin: 0; + padding: 20px; + z-index: 1101; + display: none; +} + +#fancybox-outer { + position: relative; + width: 100%; + height: 100%; + background: #FFF; +} + +#fancybox-inner { + position: absolute; + top: 0; + left: 0; + width: 1px; + height: 1px; + padding: 0; + margin: 0; + outline: none; + overflow: hidden; +} + +#fancybox-hide-sel-frame { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: transparent; +} + +#fancybox-close { + position: absolute; + top: -15px; + right: -15px; + width: 30px; + height: 30px; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox.png'); + background-position: -40px 0px; + cursor: pointer; + z-index: 1103; + display: none; +} + +#fancybox_error { + color: #444; + font: normal 12px/20px Arial; + padding: 7px; + margin: 0; +} + +#fancybox-content { + height: auto; + width: auto; + padding: 0; + margin: 0; +} + +#fancybox-img { + width: 100%; + height: 100%; + padding: 0; + margin: 0; + border: none; + outline: none; + line-height: 0; + vertical-align: top; + -ms-interpolation-mode: bicubic; +} + +#fancybox-frame { + position: relative; + width: 100%; + height: 100%; + border: none; + display: block; +} + +#fancybox-title { + position: absolute; + bottom: 0; + left: 0; + font-family: Arial; + font-size: 12px; + z-index: 1102; +} + +.fancybox-title-inside { + padding: 10px 0; + text-align: center; + color: #333; +} + +.fancybox-title-outside { + padding-top: 5px; + color: #FFF; + text-align: center; + font-weight: bold; +} + +.fancybox-title-over { + color: #FFF; + text-align: left; +} + +#fancybox-title-over { + padding: 10px; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancy_title_over.png'); + display: block; +} + +#fancybox-title-wrap { + display: inline-block; +} + +#fancybox-title-wrap span { + height: 32px; + float: left; +} + +#fancybox-title-left { + padding-left: 15px; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox.png'); + background-position: -40px -90px; + background-repeat: no-repeat; +} + +#fancybox-title-main { + font-weight: bold; + line-height: 29px; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox-x.png'); + background-position: 0px -40px; + color: #FFF; +} + +#fancybox-title-right { + padding-left: 15px; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox.png'); + background-position: -55px -90px; + background-repeat: no-repeat; +} + +#fancybox-left, #fancybox-right { + position: absolute; + bottom: 0px; + height: 100%; + width: 35%; + cursor: pointer; + outline: none; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/blank.gif'); + z-index: 1102; + display: none; +} + +#fancybox-left { + left: 0px; +} + +#fancybox-right { + right: 0px; +} + +#fancybox-left-ico, #fancybox-right-ico { + position: absolute; + top: 50%; + left: -9999px; + width: 30px; + height: 30px; + margin-top: -15px; + cursor: pointer; + z-index: 1102; + display: block; +} + +#fancybox-left-ico { + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox.png'); + background-position: -40px -30px; +} + +#fancybox-right-ico { + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox.png'); + background-position: -40px -60px; +} + +#fancybox-left:hover, #fancybox-right:hover { + visibility: visible; /* IE6 */ +} + +#fancybox-left:hover span { + left: 20px; +} + +#fancybox-right:hover span { + left: auto; + right: 20px; +} + +.fancy-bg { + position: absolute; + padding: 0; + margin: 0; + border: 0; + width: 20px; + height: 20px; + z-index: 1001; +} + +#fancy-bg-n { + top: -20px; + left: 0; + width: 100%; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox-x.png'); +} + +#fancy-bg-ne { + top: -20px; + right: -20px; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox.png'); + background-position: -40px -162px; +} + +#fancy-bg-e { + top: 0; + right: -20px; + height: 100%; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox-y.png'); + background-position: -20px 0px; +} + +#fancy-bg-se { + bottom: -20px; + right: -20px; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox.png'); + background-position: -40px -182px; +} + +#fancy-bg-s { + bottom: -20px; + left: 0; + width: 100%; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox-x.png'); + background-position: 0px -20px; +} + +#fancy-bg-sw { + bottom: -20px; + left: -20px; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox.png'); + background-position: -40px -142px; +} + +#fancy-bg-w { + top: 0; + left: -20px; + height: 100%; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox-y.png'); +} + +#fancy-bg-nw { + top: -20px; + left: -20px; + background-image: url('http://cdn.nservicebus.com/scripts/fancybox/fancybox.png'); + background-position: -40px -122px; +} + +/* IE */ + +#fancybox-loading.fancybox-ie div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_loading.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_close.png', sizingMethod='scale'); } + +.fancybox-ie #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; } +.fancybox-ie #fancybox-title-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_title_left.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-title-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_title_main.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-title-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_title_right.png', sizingMethod='scale'); } + +.fancybox-ie #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_nav_left.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_nav_right.png', sizingMethod='scale'); } + +.fancybox-ie .fancy-bg { background: transparent !important; } + +.fancybox-ie #fancy-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_shadow_n.png', sizingMethod='scale'); } +.fancybox-ie #fancy-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_shadow_ne.png', sizingMethod='scale'); } +.fancybox-ie #fancy-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_shadow_e.png', sizingMethod='scale'); } +.fancybox-ie #fancy-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_shadow_se.png', sizingMethod='scale'); } +.fancybox-ie #fancy-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_shadow_s.png', sizingMethod='scale'); } +.fancybox-ie #fancy-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_shadow_sw.png', sizingMethod='scale'); } +.fancybox-ie #fancy-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_shadow_w.png', sizingMethod='scale'); } +.fancybox-ie #fancy-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='http://cdn.nservicebus.com/scripts/fancybox/fancy_shadow_nw.png', sizingMethod='scale'); } diff --git a/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/jquery.fancybox-1.3.1.pack.js b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/jquery.fancybox-1.3.1.pack.js new file mode 100644 index 00000000000..8421d53a6d1 --- /dev/null +++ b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/jquery.fancybox-1.3.1.pack.js @@ -0,0 +1,44 @@ +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * + * Version: 1.3.1 (05/03/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +(function(b){var m,u,x,g,D,i,z,A,B,p=0,e={},q=[],n=0,c={},j=[],E=null,s=new Image,G=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,S=/[^\.]\.(swf)\s*$/i,H,I=1,k,l,h=false,y=b.extend(b("
    ")[0],{prop:0}),v=0,O=!b.support.opacity&&!window.XMLHttpRequest,J=function(){u.hide();s.onerror=s.onload=null;E&&E.abort();m.empty()},P=function(){b.fancybox('

    The requested content cannot be loaded.
    Please try again later.

    ',{scrolling:"no",padding:20,transitionIn:"none",transitionOut:"none"})}, +K=function(){return[b(window).width(),b(window).height(),b(document).scrollLeft(),b(document).scrollTop()]},T=function(){var a=K(),d={},f=c.margin,o=c.autoScale,t=(20+f)*2,w=(20+f)*2,r=c.padding*2;if(c.width.toString().indexOf("%")>-1){d.width=a[0]*parseFloat(c.width)/100-40;o=false}else d.width=c.width+r;if(c.height.toString().indexOf("%")>-1){d.height=a[1]*parseFloat(c.height)/100-40;o=false}else d.height=c.height+r;if(o&&(d.width>a[0]-t||d.height>a[1]-w))if(e.type=="image"||e.type=="swf"){t+=r; +w+=r;o=Math.min(Math.min(a[0]-t,c.width)/c.width,Math.min(a[1]-w,c.height)/c.height);d.width=Math.round(o*(d.width-r))+r;d.height=Math.round(o*(d.height-r))+r}else{d.width=Math.min(d.width,a[0]-t);d.height=Math.min(d.height,a[1]-w)}d.top=a[3]+(a[1]-(d.height+40))*0.5;d.left=a[2]+(a[0]-(d.width+40))*0.5;if(c.autoScale===false){d.top=Math.max(a[3]+f,d.top);d.left=Math.max(a[2]+f,d.left)}return d},U=function(a){if(a&&a.length)switch(c.titlePosition){case "inside":return a;case "over":return''+ +a+"";default:return''+a+''}return false},V=function(){var a=c.title,d=l.width-c.padding*2,f="fancybox-title-"+c.titlePosition;b("#fancybox-title").remove();v=0;if(c.titleShow!==false){a=b.isFunction(c.titleFormat)?c.titleFormat(a,j,n,c):U(a);if(!(!a||a==="")){b('
    ').css({width:d,paddingLeft:c.padding, +paddingRight:c.padding}).html(a).appendTo("body");switch(c.titlePosition){case "inside":v=b("#fancybox-title").outerHeight(true)-c.padding;l.height+=v;break;case "over":b("#fancybox-title").css("bottom",c.padding);break;default:b("#fancybox-title").css("bottom",b("#fancybox-title").outerHeight(true)*-1);break}b("#fancybox-title").appendTo(D).hide()}}},W=function(){b(document).unbind("keydown.fb").bind("keydown.fb",function(a){if(a.keyCode==27&&c.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if(a.keyCode== +37){a.preventDefault();b.fancybox.prev()}else if(a.keyCode==39){a.preventDefault();b.fancybox.next()}});if(b.fn.mousewheel){g.unbind("mousewheel.fb");j.length>1&&g.bind("mousewheel.fb",function(a,d){a.preventDefault();h||d===0||(d>0?b.fancybox.prev():b.fancybox.next())})}if(c.showNavArrows){if(c.cyclic&&j.length>1||n!==0)A.show();if(c.cyclic&&j.length>1||n!=j.length-1)B.show()}},X=function(){var a,d;if(j.length-1>n){a=j[n+1].href;if(typeof a!=="undefined"&&a.match(G)){d=new Image;d.src=a}}if(n>0){a= +j[n-1].href;if(typeof a!=="undefined"&&a.match(G)){d=new Image;d.src=a}}},L=function(){i.css("overflow",c.scrolling=="auto"?c.type=="image"||c.type=="iframe"||c.type=="swf"?"hidden":"auto":c.scrolling=="yes"?"auto":"visible");if(!b.support.opacity){i.get(0).style.removeAttribute("filter");g.get(0).style.removeAttribute("filter")}b("#fancybox-title").show();c.hideOnContentClick&&i.one("click",b.fancybox.close);c.hideOnOverlayClick&&x.one("click",b.fancybox.close);c.showCloseButton&&z.show();W();b(window).bind("resize.fb", +b.fancybox.center);c.centerOnScroll?b(window).bind("scroll.fb",b.fancybox.center):b(window).unbind("scroll.fb");b.isFunction(c.onComplete)&&c.onComplete(j,n,c);h=false;X()},M=function(a){var d=Math.round(k.width+(l.width-k.width)*a),f=Math.round(k.height+(l.height-k.height)*a),o=Math.round(k.top+(l.top-k.top)*a),t=Math.round(k.left+(l.left-k.left)*a);g.css({width:d+"px",height:f+"px",top:o+"px",left:t+"px"});d=Math.max(d-c.padding*2,0);f=Math.max(f-(c.padding*2+v*a),0);i.css({width:d+"px",height:f+ +"px"});if(typeof l.opacity!=="undefined")g.css("opacity",a<0.5?0.5:a)},Y=function(a){var d=a.offset();d.top+=parseFloat(a.css("paddingTop"))||0;d.left+=parseFloat(a.css("paddingLeft"))||0;d.top+=parseFloat(a.css("border-top-width"))||0;d.left+=parseFloat(a.css("border-left-width"))||0;d.width=a.width();d.height=a.height();return d},Q=function(){var a=e.orig?b(e.orig):false,d={};if(a&&a.length){a=Y(a);d={width:a.width+c.padding*2,height:a.height+c.padding*2,top:a.top-c.padding-20,left:a.left-c.padding- +20}}else{a=K();d={width:1,height:1,top:a[3]+a[1]*0.5,left:a[2]+a[0]*0.5}}return d},N=function(){u.hide();if(g.is(":visible")&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){b.event.trigger("fancybox-cancel");h=false;return}j=q;n=p;c=e;i.get(0).scrollTop=0;i.get(0).scrollLeft=0;if(c.overlayShow){O&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"}); +x.css({"background-color":c.overlayColor,opacity:c.overlayOpacity}).unbind().show()}l=T();V();if(g.is(":visible")){b(z.add(A).add(B)).hide();var a=g.position(),d;k={top:a.top,left:a.left,width:g.width(),height:g.height()};d=k.width==l.width&&k.height==l.height;i.fadeOut(c.changeFade,function(){var f=function(){i.html(m.contents()).fadeIn(c.changeFade,L)};b.event.trigger("fancybox-change");i.empty().css("overflow","hidden");if(d){i.css({top:c.padding,left:c.padding,width:Math.max(l.width-c.padding* +2,1),height:Math.max(l.height-c.padding*2-v,1)});f()}else{i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)});y.prop=0;b(y).animate({prop:1},{duration:c.changeSpeed,easing:c.easingChange,step:M,complete:f})}})}else{g.css("opacity",1);if(c.transitionIn=="elastic"){k=Q();i.css({top:c.padding,left:c.padding,width:Math.max(k.width-c.padding*2,1),height:Math.max(k.height-c.padding*2,1)}).html(m.contents());g.css(k).show();if(c.opacity)l.opacity= +0;y.prop=0;b(y).animate({prop:1},{duration:c.speedIn,easing:c.easingIn,step:M,complete:L})}else{i.css({top:c.padding,left:c.padding,width:Math.max(l.width-c.padding*2,1),height:Math.max(l.height-c.padding*2-v,1)}).html(m.contents());g.css(l).fadeIn(c.transitionIn=="none"?0:c.speedIn,L)}}},F=function(){m.width(e.width);m.height(e.height);if(e.width=="auto")e.width=m.width();if(e.height=="auto")e.height=m.height();N()},Z=function(){h=true;e.width=s.width;e.height=s.height;b("").attr({id:"fancybox-img", +src:s.src,alt:e.title}).appendTo(m);N()},C=function(){J();var a=q[p],d,f,o,t,w;e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));o=a.title||b(a).title||e.title||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(o===""&&e.orig)o=e.orig.attr("alt");d=a.nodeName&&/^(?:javascript|#)/i.test(a.href)?e.href||null:e.href||a.href||null;if(e.type){f=e.type;if(!d)d=e.content}else if(e.content)f="html";else if(d)if(d.match(G))f= +"image";else if(d.match(S))f="swf";else if(b(a).hasClass("iframe"))f="iframe";else if(d.match(/#/)){a=d.substr(d.indexOf("#"));f=b(a).length>0?"inline":"ajax"}else f="ajax";else f="inline";e.type=f;e.href=d;e.title=o;if(e.autoDimensions&&e.type!=="iframe"&&e.type!=="swf"){e.width="auto";e.height="auto"}if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick=false;e.enableEscapeButton=false;e.showCloseButton=false}if(b.isFunction(e.onStart))if(e.onStart(q,p,e)===false){h=false; +return}m.css("padding",20+e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(i.children())});switch(f){case "html":m.html(e.content);F();break;case "inline":b('
    ').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(i.children())}).bind("fancybox-cancel",function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity(); +s=new Image;s.onerror=function(){P()};s.onload=function(){s.onerror=null;s.onload=null;Z()};s.src=d;break;case "swf":t='';w="";b.each(e.swf,function(r,R){t+='';w+=" "+r+'="'+R+'"'});t+='";m.html(t); +F();break;case "ajax":a=d.split("#",2);f=e.ajax.data||{};if(a.length>1){d=a[0];if(typeof f=="string")f+="&selector="+a[1];else f.selector=a[1]}h=false;b.fancybox.showActivity();E=b.ajax(b.extend(e.ajax,{url:d,data:f,error:P,success:function(r){if(E.status==200){m.html(r);F()}}}));break;case "iframe":b('').appendTo(m);N();break}},$=function(){if(u.is(":visible")){b("div", +u).css("top",I*-40+"px");I=(I+1)%12}else clearInterval(H)},aa=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('
    '),u=b('
    '),x=b('
    '),g=b('
    '));if(!b.support.opacity){g.addClass("fancybox-ie");u.addClass("fancybox-ie")}D=b('
    ').append('
    ').appendTo(g); +D.append(i=b('
    '),z=b(''),A=b(''),B=b(''));z.click(b.fancybox.close);u.click(b.fancybox.cancel);A.click(function(a){a.preventDefault();b.fancybox.prev()});B.click(function(a){a.preventDefault();b.fancybox.next()});if(O){x.get(0).style.setExpression("height", +"document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'");u.get(0).style.setExpression("top","(-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'");D.prepend('')}}}; +b.fn.fancybox=function(a){b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(d){d.preventDefault();if(!h){h=true;b(this).blur();q=[];p=0;d=b(this).attr("rel")||"";if(!d||d==""||d==="nofollow")q.push(this);else{q=b("a[rel="+d+"], area[rel="+d+"]");p=q.index(this)}C();return false}});return this};b.fancybox=function(a,d){if(!h){h=true;d=typeof d!=="undefined"?d:{};q=[];p=d.index||0;if(b.isArray(a)){for(var f=0,o=a.length;fq.length||p<0)p=0;C()}};b.fancybox.showActivity=function(){clearInterval(H);u.show();H=setInterval($,66)};b.fancybox.hideActivity=function(){u.hide()};b.fancybox.next=function(){return b.fancybox.pos(n+1)};b.fancybox.prev=function(){return b.fancybox.pos(n- +1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a,10);if(a>-1&&j.length>a){p=a;C()}if(c.cyclic&&j.length>1&&a<0){p=j.length-1;C()}if(c.cyclic&&j.length>1&&a>=j.length){p=0;C()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");J();e&&b.isFunction(e.onCancel)&&e.onCancel(q,p,e);h=false}};b.fancybox.close=function(){function a(){x.fadeOut("fast");g.hide();b.event.trigger("fancybox-cleanup");i.empty();b.isFunction(c.onClosed)&&c.onClosed(j,n,c);j=e=[];n=p=0;c=e={};h=false} +if(!(h||g.is(":hidden"))){h=true;if(c&&b.isFunction(c.onCleanup))if(c.onCleanup(j,n,c)===false){h=false;return}J();b(z.add(A).add(B)).hide();b("#fancybox-title").remove();g.add(i).add(x).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");i.css("overflow","hidden");if(c.transitionOut=="elastic"){k=Q();var d=g.position();l={top:d.top,left:d.left,width:g.width(),height:g.height()};if(c.opacity)l.opacity=1;y.prop=1;b(y).animate({prop:0},{duration:c.speedOut,easing:c.easingOut, +step:M,complete:a})}else g.fadeOut(c.transitionOut=="none"?0:c.speedOut,a)}};b.fancybox.resize=function(){var a,d;if(!(h||g.is(":hidden"))){h=true;a=i.wrapInner("
    ").children();d=a.height();g.css({height:d+c.padding*2+v});i.css({height:d});a.replaceWith(a.children());b.fancybox.center()}};b.fancybox.center=function(){h=true;var a=K(),d=c.margin,f={};f.top=a[3]+(a[1]-(g.height()-v+40))*0.5;f.left=a[2]+(a[0]-(g.width()+40))*0.5;f.top=Math.max(a[3]+d,f.top);f.left=Math.max(a[2]+ +d,f.left);g.css(f);h=false};b.fn.fancybox.defaults={padding:10,margin:20,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.3,overlayColor:"#666",titleShow:true,titlePosition:"outside",titleFormat:null,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast", +easingIn:"swing",easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,onStart:null,onCancel:null,onComplete:null,onCleanup:null,onClosed:null};b(document).ready(function(){aa()})})(jQuery); \ No newline at end of file diff --git a/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/nsb40perfcounter.png b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/nsb40perfcounter.png new file mode 100644 index 00000000000..67ad0e40d0d Binary files /dev/null and b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/nsb40perfcounter.png differ diff --git a/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/social_media1.gif b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/social_media1.gif new file mode 100644 index 00000000000..2f24f504cd9 Binary files /dev/null and b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/social_media1.gif differ diff --git a/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/style.css b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/style.css new file mode 100644 index 00000000000..26f1c64d99a --- /dev/null +++ b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/style.css @@ -0,0 +1,236 @@ +body +{ + margin: 0px; + padding: 0px; + background: #EEE; + text-align: center; + font-family: Calibri; +} + +table.menu a { + width:111px; + height:32px; + border-right:1px solid #606080; + display: block; + text-align:center; +} + +div.menu +{ + margin-top:4px; +} + +div.menu a { + color: #333333; + background: #ffffff url(http://images.nservicebus.com/menu_bg.png); + text-decoration:none; + font-size:14px; + line-height:32px; + font-family: Calibri, sans-serif; + padding: 2px 5px; +} + +div.menu a:link { +color: #333333; +background: #ffffff url(http://images.nservicebus.com/menu_bg.png); +} + +div.menu a:active { +color: #333333; +background: #ffffff url(http://images.nservicebus.com/menu_bg.png); +} + +div.menu a:visited { +color: #333333; +background: #ffffff url(http://images.nservicebus.com/menu_bg.png); +} + +div.menu a:hover { +color: #005796; +background: #ffffff url(http://images.nservicebus.com/menu_bg.png); +border-right:1px solid #606080; +} + +li.title +{ + font-size:16px; + font-weight:bold; +} + +.h1 +{ + font-size:24px; + font-weight:bold; +} + +.h2 +{ + font-size:20px; + font-weight:bold; +} + +.h3 +{ + font-size:18px; + font-weight:bold; +} + +.logo { + position:relative; + top:-8px; + left:22px; + float:left; +} + +#ad { + float:right; + position:relative; + right: 22px; + top:-8px; +} + +.navigation { + position:relative; + left: 25px; + font-family: Calibri, sans; + font-size: 12px; + color: #000000; + text-decoration: none; + width:150px; +} +.navigation a, .navigation a:active, .navigation a:visited { + font-family: Calibri, sans; + font-size: 12px; + color: #7E7E7E; + text-decoration: none; +} +.navigation a:hover { + font-family: Calibri, sans; + font-size: 12px; + color: #000000; + text-decoration: none; +} + + +h4.navbar { + position:relative; + left: 0px; + font-family: Calibri, sans; + font-size: 12px; + color: #5F5F5F; + text-decoration: none; + margin-bottom: 2px; +} + +table { + font-family: Calibri, sans; + font-size: 14px; +} + +.csharpcode, .csharpcode pre +{ + font-size: small; + color: black; + font-family: Consolas, "Courier New", Courier, Monospace; + background-color: #ffffff; + /*white-space: pre;*/ +} + +.csharpcode pre { margin: 0em; } + +.csharpcode .rem { color: #008000; } + +.csharpcode .kwrd { color: #0000ff; } + +.csharpcode .str { color: #006080; } + +.csharpcode .op { color: #0000c0; } + +.csharpcode .preproc { color: #cc6633; } + +.csharpcode .asp { background-color: #ffff00; } + +.csharpcode .html { color: #800000; } + +.csharpcode .attr { color: #ff0000; } + +.csharpcode .alt +{ + background-color: #f4f4f4; + width: 100%; + margin: 0em; +} + +.csharpcode .lnum { color: #606060; } + +.registration .label { + display: block; + float: left; + margin: 5px 10px 0; + padding: 0; + text-align: right; + width: 100px; +} + +.registration .validator +{ + color:black; +} + +.registration input, textarea, select { + color: #666666; + margin-bottom: 15px; + padding: 5px; + vertical-align: top; +} +/* NuGet Badge */ +.nuget-badge code { + background-color: #202020; + border: 4px solid #c0c0c0; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + box-shadow: 2px 2px 3px #6e6e6e; + color: #e2e2e2; + display:block; + font: 1.2em 'andale mono', 'lucida console', monospace; + line-height: 1.2em; + overflow:auto; + padding: 1px; +} +/* Command line code */ +.commandline code { + background-color: #202020; + border: 4px solid #c0c0c0; + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + box-shadow: 2px 2px 3px #6e6e6e; + color: #e2e2e2; + display:block; + font: 1em 'andale mono', 'lucida console', monospace; + line-height: 1.5em; + overflow:auto; + padding: 1px; +} +IMG.displayed { + display: block; + margin-left: auto; + margin-right: auto } +table.simpleTable { + width: 80%; + border-width: thin; + border-spacing: 0px; + border-style: solid; + border-color: gray; + border-collapse: collapse; + background-color: white; +} +table.simpleTable td { + width: 50%; + border-width: thin; + padding: 4px; + border-style: solid; + border-color: gray; + background-color: white; +} \ No newline at end of file diff --git a/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/tooltipster.css b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/tooltipster.css new file mode 100644 index 00000000000..43cbc1b3c6f --- /dev/null +++ b/NServiceBus Setup/Files/OfflineHtml/NServiceBus 4.0 Beta Release Notes_files/tooltipster.css @@ -0,0 +1,310 @@ +html { + -webkit-font-smoothing: antialiased; +} + + +/* This is the default Tooltipster theme (feel free to modify or duplicate and create multiple themes!): */ +.tooltipster-default { + border-radius: 5px; + border: 2px solid #000; + background: #4c4c4c; + color: #fff; +} + +/* Use this next selector to style things like font-size and line-height: */ +.tooltipster-default .tooltipster-content { + font-family: Arial, sans-serif; + font-size: 14px; + line-height: 16px; + padding: 8px 10px; + overflow: hidden; +} + +/* This next selector defines the color of the border on the outside of the arrow. This will automatically match the color and size of the border set on the main tooltip styles. Set display: none; if you would like a border around the tooltip but no border around the arrow */ +.tooltipster-default .tooltipster-arrow .tooltipster-arrow-border { + /* border-color: ... !important; */ +} + + +/* If you're using the icon option, use this next selector to style them */ +.tooltipster-icon { + cursor: help; + margin-left: 4px; +} + +/* This is the base styling required to make all Tooltipsters work */ +.tooltipster-base { + padding: 0; + font-size: 0; + line-height: 0; + position: absolute; + z-index: 9999999; + pointer-events: none; + width: auto; + overflow: visible; +} +.tooltipster-base .tooltipster-content { + overflow: hidden; +} + + +/* These next classes handle the styles for the little arrow attached to the tooltip. By default, the arrow will inherit the same colors and border as what is set on the main tooltip itself. */ +.tooltipster-arrow { + display: block; + text-align: center; + width: 100%; + height: 100%; + position: absolute; + top: 0; + left: 0; + z-index: -1; +} +.tooltipster-arrow span, .tooltipster-arrow-border { + display: block; + width: 0; + height: 0; + position: absolute; +} +.tooltipster-arrow-top span, .tooltipster-arrow-top-right span, .tooltipster-arrow-top-left span { + border-left: 8px solid transparent !important; + border-right: 8px solid transparent !important; + border-top: 8px solid; + bottom: -8px; +} +.tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-top-left .tooltipster-arrow-border { + border-left: 9px solid transparent !important; + border-right: 9px solid transparent !important; + border-top: 9px solid; + bottom: -8px; +} + +.tooltipster-arrow-bottom span, .tooltipster-arrow-bottom-right span, .tooltipster-arrow-bottom-left span { + border-left: 8px solid transparent !important; + border-right: 8px solid transparent !important; + border-bottom: 8px solid; + top: -8px; +} +.tooltipster-arrow-bottom .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border { + border-left: 9px solid transparent !important; + border-right: 9px solid transparent !important; + border-bottom: 9px solid; + top: -8px; +} +.tooltipster-arrow-top span, .tooltipster-arrow-top .tooltipster-arrow-border, .tooltipster-arrow-bottom span, .tooltipster-arrow-bottom .tooltipster-arrow-border { + left: 0; + right: 0; + margin: 0 auto; +} +.tooltipster-arrow-top-left span, .tooltipster-arrow-bottom-left span { + left: 6px; +} +.tooltipster-arrow-top-left .tooltipster-arrow-border, .tooltipster-arrow-bottom-left .tooltipster-arrow-border { + left: 5px; +} +.tooltipster-arrow-top-right span, .tooltipster-arrow-bottom-right span { + right: 6px; +} +.tooltipster-arrow-top-right .tooltipster-arrow-border, .tooltipster-arrow-bottom-right .tooltipster-arrow-border { + right: 5px; +} +.tooltipster-arrow-left span, .tooltipster-arrow-left .tooltipster-arrow-border { + border-top: 8px solid transparent !important; + border-bottom: 8px solid transparent !important; + border-left: 8px solid; + top: 50%; + margin-top: -7px; + right: -8px; +} +.tooltipster-arrow-left .tooltipster-arrow-border { + border-top: 9px solid transparent !important; + border-bottom: 9px solid transparent !important; + border-left: 9px solid; + margin-top: -8px; +} +.tooltipster-arrow-right span, .tooltipster-arrow-right .tooltipster-arrow-border { + border-top: 8px solid transparent !important; + border-bottom: 8px solid transparent !important; + border-right: 8px solid; + top: 50%; + margin-top: -7px; + left: -8px; +} +.tooltipster-arrow-right .tooltipster-arrow-border { + border-top: 9px solid transparent !important; + border-bottom: 9px solid transparent !important; + border-right: 9px solid; + margin-top: -8px; +} + + +/* Some CSS magic for the awesome animations - feel free to make your own custom animations and reference it in your Tooltipster settings! */ + +.tooltipster-fade { + opacity: 0; + -webkit-transition-property: opacity; + -moz-transition-property: opacity; + -o-transition-property: opacity; + -ms-transition-property: opacity; + transition-property: opacity; +} +.tooltipster-fade-show { + opacity: 1; +} + +.tooltipster-grow { + -webkit-transform: scale(0,0); + -moz-transform: scale(0,0); + -o-transform: scale(0,0); + -ms-transform: scale(0,0); + transform: scale(0,0); + -webkit-transition-property: -webkit-transform; + -moz-transition-property: -moz-transform; + -o-transition-property: -o-transform; + -ms-transition-property: -ms-transform; + transition-property: transform; + -webkit-backface-visibility: hidden; +} +.tooltipster-grow-show { + -webkit-transform: scale(1,1); + -moz-transform: scale(1,1); + -o-transform: scale(1,1); + -ms-transform: scale(1,1); + transform: scale(1,1); + -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); + -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); + -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); + -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); + transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); +} + +.tooltipster-swing { + opacity: 0; + -webkit-transform: rotateZ(4deg); + -moz-transform: rotateZ(4deg); + -o-transform: rotateZ(4deg); + -ms-transform: rotateZ(4deg); + transform: rotateZ(4deg); + -webkit-transition-property: -webkit-transform, opacity; + -moz-transition-property: -moz-transform; + -o-transition-property: -o-transform; + -ms-transition-property: -ms-transform; + transition-property: transform; +} +.tooltipster-swing-show { + opacity: 1; + -webkit-transform: rotateZ(0deg); + -moz-transform: rotateZ(0deg); + -o-transform: rotateZ(0deg); + -ms-transform: rotateZ(0deg); + transform: rotateZ(0deg); + -webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 1); + -webkit-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); + -moz-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); + -ms-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); + -o-transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); + transition-timing-function: cubic-bezier(0.230, 0.635, 0.495, 2.4); +} + +.tooltipster-fall { + top: 0; + -webkit-transition-property: top; + -moz-transition-property: top; + -o-transition-property: top; + -ms-transition-property: top; + transition-property: top; + -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); + -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); + -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); + -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); + transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); +} +.tooltipster-fall-show { +} +.tooltipster-fall.tooltipster-dying { + -webkit-transition-property: all; + -moz-transition-property: all; + -o-transition-property: all; + -ms-transition-property: all; + transition-property: all; + top: 0px !important; + opacity: 0; +} + +.tooltipster-slide { + left: -40px; + -webkit-transition-property: left; + -moz-transition-property: left; + -o-transition-property: left; + -ms-transition-property: left; + transition-property: left; + -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + -webkit-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); + -moz-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); + -ms-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); + -o-transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); + transition-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1.15); +} +.tooltipster-slide.tooltipster-slide-show { +} +.tooltipster-slide.tooltipster-dying { + -webkit-transition-property: all; + -moz-transition-property: all; + -o-transition-property: all; + -ms-transition-property: all; + transition-property: all; + left: 0px !important; + opacity: 0; +} + +.champsTooltipContainer { + clear:both; + position:relative; + float:left; + text-align:left; +} + +.champsTooltipImage { + width:50px; + height:50px; + padding-right:15px; + float:left; +} + +.champsTooltipName { + font-weight:bold; + width:340px; +} + +.champsTooltipTitle {} + +.champsTooltipCompany {} + +.champsTooltipCompanyLink { + color:white; +} + +.champsTooltipBlog {} + +.champsTooltipBlogLink { + color:yellow; +} + +.champsTooltipTwitter {} + +.champsTooltipTwitterLink { + color:yellow; +} + +.champsTooltipWeb {} + +.champsTooltipWebLink { + color:yellow; +} + +.champsTooltipBio {} + +.champImage { + +} \ No newline at end of file diff --git a/NServiceBus Setup/License.rtf b/NServiceBus Setup/License.rtf new file mode 100644 index 00000000000..1faca8009ff --- /dev/null +++ b/NServiceBus Setup/License.rtf @@ -0,0 +1,87 @@ +{\rtf1\ansi\ansicpg1252\deff0{\fonttbl{\f0\fnil\fcharset0 Calibri;}} +{\colortbl ;\red0\green0\blue255;} +{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\lang3081\b\f0\fs40 NServiceBus Basic End User License Agreement\b0\fs22\par +\par +READ THIS AGREEMENT CAREFULLY. BY INSTALLING OR USING ALL OR ANY PORTION OF THE SOFTWARE, YOU ARE ACCEPTING ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU AGREE THAT THIS AGREEMENT IS ENFORCEABLE LIKE ANY WRITTEN NEGOTIATED AGREEMENT SIGNED BY YOU. IF YOU DO NOT AGREE TO ALL OF THESE TERMS AND CONDITIONS, DO NOT CLICK "I Agree". YOU WILL NOT BE GIVEN ACCESS TO THE SOFTWARE UNLESS YOU ACCEPT THE TERMS OF THIS AGREEMENT. IF YOU HAVE PAID A LICENSE FEE FOR USE OF THE SOFTWARE AND DO NOT AGREE TO THESE TERMS, YOU MAY RETURN THE SOFTWARE FOR A FULL REFUND PROVIDED YOU (A) DO NOT USE THE SOFTWARE AND (B) RETURN THE SOFTWARE WITHIN THIRTY (30) DAYS OF YOUR INITIAL PURCHASE. IF YOU WISH TO USE THE SOFTWARE AS AN EMPLOYEE, CONTRACTOR, OR AGENT OF A CORPORATION, PARTNERSHIP OR SIMILAR ENTITY, THEN YOU MUST BE AUTHORIZED TO SIGN FOR AND BIND THE ENTITY IN ORDER TO ACCEPT THE TERMS OF THIS AGREEMENT. THE LICENSES GRANTED UNDER THIS AGREEMENT ARE EXPRESSLY CONDITIONED UPON ACCEPTANCE BY SUCH AUTHORIZED PERSONNEL. IF YOU HAVE ENTERED INTO A SEPARATE WRITTEN LICENSE AGREEMENT WITH NServiceBus Ltd. FOR USE OF THE SOFTWARE, THE TERMS AND CONDITIONS OF SUCH OTHER AGREEMENT SHALL PREVAIL OVER ANY CONFLICTING TERMS OR CONDITIONS IN THIS AGREEMENT.\par +\par +This Software License Agreement ("Agreement") is between NServiceBus Ltd., located at Alef Tsadik Greenberg 20, Haifa 34757, Israel ("NSBLTD") and the customer (individual or entity) that has procured the licensed Software (as defined below) for use as an end user ("you").\par +\par +\b\fs28 1. Definitions.\b0\fs22\par +\par +License: means the terms and conditions for use, reproduction, and distribution as defined by this document.\par +\par +Legal Entity: means the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.\par +\par +You (or Your): means an individual or Legal Entity exercising permissions granted by this License.\par +\par +Source form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.\par +\par +Object form: means any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.\par +\par +Work: means the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or associated with the work.\par +\par +Software: means the Work provided by NSBLTD in connection with this Agreement. Unless otherwise noted, the Software and Documentation are referred to collectively herein as "Software".\par +\par +Documentation: means any supporting content provided with the Software, including content available online, whether on the public website of NSBLTD or any third party website that makes the Software available.\par +\par +Derivative Works: means any work, whether in Source or Object form, that is based on (or derived from) the Software and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Software and Derivative Works thereof.\par +\par +Contribution shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to NSBLTD for inclusion in the Software by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."\par +\par +Contributor shall mean NSBLTD, including any employees and agents of NSBLTD, and any individual or Legal Entity on behalf of whom a Contribution has been received by NSBLTD and subsequently incorporated within the Software.\par +\par +Production Use: means distribution of the Software or its Derivative Works in such a way as to make it accessible to a third party or any end user. Use of the software by programmers, testers, or any person involved in the creation of software by the customer does not constitute Production Use.\par +\par +\b\fs28 2. License.\b0\fs22\par +\par +2.1 Grant of License.\par +\par +Grant of License. Subject to all of the terms and conditions of this Agreement, NSBLTD grants you a non-exclusive, non-transferable, non-sublicensable License to use the Software, prepare Derivative Works of the Software, publicly display, publicly perform, and distribute the Software and its Derivative Works in Source or Object form for commercial and non-commercial purposes limited to the restrictions in this Agreement.\par +\par +2.2 License Restrictions.\par +\par +You shall not:\par +\par +(a) use any portion of the Software or its Derivative Works to create a competitive service, product or technology;\par +(b) remove any product identification, proprietary, copyright or other notices contained in the Software or its Derivative Works; \par +2.3 Derivative Works.\par +\par +All Derivative Works of the Software You may create, or have created on Your behalf by any third party will be under the terms and conditions of this License.\par +\par +2.4 Submission of Contributions.\par +\par +Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Software by You to NSBLTD shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with NSBLTD regarding such Contributions.\par +\par +\b\fs28 3. Ownership.\b0\fs22\par +\par +Notwithstanding anything to the contrary contained herein, except for the explicit license rights expressly provided herein, NSBLTD and its suppliers have and will retain all rights, title and interest (including, without limitation, all patent, copyright, trademark, trade secret and other intellectual property rights) in and to the Software and all copies, and modifications thereof. The customer retains all rights, title and interest (including, without limitation, all patent, copyright, trademark, trade secrets and other intellectual property rights) in any products, services, or code, whether in source or in binary form developed independently by the customer that makes use of the Software.\par +\par +3.1 Third-Party Code.\par +\par +If designated in the Documentation, the Software may contain or be provided with certain third-party code (including code which may be made available to You in source code form). Ownership, use, warranty and modification rights with respect to any such designated code shall be as expressly set forth in the Documentation.\par +As of version 3.0, the Software will be provided with RavenDB (the technology available from {\field{\*\fldinst{HYPERLINK "http://www.ravendb.net"}}{\fldrslt{\ul\cf1 http://www.ravendb.net}}}\f0\fs22 ).\par +Hibernating Rhinos, the licensor of RavenDB, provides users of NServiceBus a non-exclusive, non-transferable, non-sublicensable License to use RavenDB subject to the conditions expressly set forth at the internet address {\field{\*\fldinst{HYPERLINK "http://ravendb.net/nservicebus-and-ravendb"}}{\fldrslt{\ul\cf1 http://ravendb.net/nservicebus-and-ravendb}}}\f0\fs22 . These conditions are copied here for convenience, yet in the case of any discrepancy between the two, the conditions at the aforementioned internet address will prevail.\par +\par +3.1.1 You may not store any data in RavenDB that is not managed by NServiceBus.\par +\par +3.1.2 Any data that You place within an NServiceBus Saga class whose persistence is managed by NServiceBus may be stored in RavenDB\par +\par +\b\fs28 4. Payment.\b0\fs22\par +\par +No payment from you shall be due for any Software licensed hereunder.\par +\par +\b\fs28 5. No Warranty.\b0\fs22\par +\par +THE SOFTWARE AND ALL SERVICES ARE PROVIDED "AS IS," WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED, STATUTORY, OR OTHERWISE, INCLUDING, BUT NOT LIMITED TO WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. YOU MAY HAVE OTHER STATUTORY RIGHTS; HOWEVER, TO THE FULL EXTENT PERMITTED BY LAW, THE DURATION OF STATUTORILY REQUIRED WARRANTIES, IF ANY, SHALL BE LIMITED TO THE MAXIMUM EXTENT PERMITTED BY LAW.\par +\par +\b\fs28 6. No Support & Maintenance.\b0\fs22\par +\par +NSBLTD shall have no support or maintenance obligations with respect to the Software hereunder.\par +\par +\b\fs28 7. Limitation of Remedies and Damages.\b0\fs22\par +\par +IN NO EVENT SHALL NSBLTD BE LIABLE FOR ANY LOSS OF USE, LOST DATA, FAILURE OF SECURITY MECHANISMS, INTERRUPTION OF BUSINESS, OR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY KIND (INCLUDING LOST PROFITS), REGARDLESS OF THE FORM OF ACTION, WHETHER IN CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF INFORMED OF THE POSSIBILITY OF SUCH DAMAGES IN ADVANCE.\par +\par +BY CLICKING ON THE "I Agree" BUTTON OR INSTALLING OR USING ALL OR ANY PORTION OF THE SOFTWARE, YOU ARE ACCEPTING ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. YOU AGREE THAT THIS AGREEMENT IS ENFORCEABLE LIKE ANY WRITTEN NEGOTIATED AGREEMENT SIGNED BY YOU. IF YOU DO NOT AGREE TO ALL OF THESE TERMS AND CONDITIONS, DO NOT CLICK "I Agree". YOU WILL NOT BE GIVEN ACCESS TO THE SOFTWARE UNLESS YOU ACCEPT THE TERMS OF THIS AGREEMENT. IF YOU HAVE PAID A LICENSE FEE FOR USE OF THE SOFTWARE AND DO NOT AGREE TO THESE TERMS, YOU MAY RETURN THE SOFTWARE FOR A FULL REFUND PROVIDED YOU (A) DO NOT USE THE SOFTWARE AND (B) RETURN THE SOFTWARE WITHIN THIRTY (30) DAYS OF YOUR INITIAL PURCHASE. IF YOU WISH TO USE THE SOFTWARE AS AN EMPLOYEE, CONTRACTOR, OR AGENT OF A CORPORATION, PARTNERSHIP OR SIMILAR ENTITY, THEN YOU MUST BE AUTHORIZED TO SIGN FOR AND BIND THE ENTITY IN ORDER TO ACCEPT THE TERMS OF THIS AGREEMENT. THE LICENSES GRANTED UNDER THIS AGREEMENT ARE EXPRESSLY CONDITIONED UPON ACCEPTANCE BY SUCH AUTHORIZED PERSONNEL. IF YOU HAVE ENTERED INTO A SEPARATE WRITTEN LICENSE AGREEMENT WITH VENDOR FOR USE OF THE SOFTWARE, THE TERMS AND CONDITIONS OF SUCH OTHER AGREEMENT SHALL PREVAIL OVER ANY CONFLICTING TERMS OR CONDITIONS IN THIS AGREEMENT.\par +} + \ No newline at end of file diff --git a/NServiceBus Setup/NServiceBus.aip b/NServiceBus Setup/NServiceBus.aip new file mode 100644 index 00000000000..bd34c84fc41 --- /dev/null +++ b/NServiceBus Setup/NServiceBus.aip @@ -0,0 +1,619 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/NServiceBus Setup/res-binary/aicustact.dll b/NServiceBus Setup/res-binary/aicustact.dll new file mode 100644 index 00000000000..0a668bf9e2b Binary files /dev/null and b/NServiceBus Setup/res-binary/aicustact.dll differ diff --git a/NServiceBus Setup/res/NServiceBus.ico b/NServiceBus Setup/res/NServiceBus.ico new file mode 100644 index 00000000000..4acaecf7edf Binary files /dev/null and b/NServiceBus Setup/res/NServiceBus.ico differ diff --git a/NServiceBus Setup/res/NServiceBus_Logo-++white.png b/NServiceBus Setup/res/NServiceBus_Logo-++white.png new file mode 100644 index 00000000000..51dc53f68d4 Binary files /dev/null and b/NServiceBus Setup/res/NServiceBus_Logo-++white.png differ diff --git a/NServiceBus Setup/res/checkbox.png b/NServiceBus Setup/res/checkbox.png new file mode 100644 index 00000000000..43c14f8034f Binary files /dev/null and b/NServiceBus Setup/res/checkbox.png differ diff --git a/NServiceBus.AcceptanceTests.DotSettings b/NServiceBus.AcceptanceTests.DotSettings new file mode 100644 index 00000000000..0cc227954e5 --- /dev/null +++ b/NServiceBus.AcceptanceTests.DotSettings @@ -0,0 +1,93 @@ + + + + True + True + True + False + DO_NOT_SHOW + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + Default: Reformat Code + False + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + True + True + True + False + True + False + False + False + True + Automatic property + True + False + False + DB + DTC + ID + NSB + SLA + $object$_On$event$ + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + $object$_On$event$ + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> \ No newline at end of file diff --git a/NServiceBus.AcceptanceTests.sln b/NServiceBus.AcceptanceTests.sln new file mode 100644 index 00000000000..dc5f301c53e --- /dev/null +++ b/NServiceBus.AcceptanceTests.sln @@ -0,0 +1,26 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.AcceptanceTesting", "AcceptanceTests\NServiceBus.AcceptanceTesting\NServiceBus.AcceptanceTesting.csproj", "{758357F6-CD31-4337-80C4-BA377FC257AF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.AcceptanceTests", "AcceptanceTests\NServiceBus.AcceptanceTests\NServiceBus.AcceptanceTests.csproj", "{6A9E04E7-6229-4A3E-B94A-DA168E962B5A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {758357F6-CD31-4337-80C4-BA377FC257AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {758357F6-CD31-4337-80C4-BA377FC257AF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {758357F6-CD31-4337-80C4-BA377FC257AF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {758357F6-CD31-4337-80C4-BA377FC257AF}.Release|Any CPU.Build.0 = Release|Any CPU + {6A9E04E7-6229-4A3E-B94A-DA168E962B5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6A9E04E7-6229-4A3E-B94A-DA168E962B5A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6A9E04E7-6229-4A3E-B94A-DA168E962B5A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6A9E04E7-6229-4A3E-B94A-DA168E962B5A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/NServiceBus.sln b/NServiceBus.sln new file mode 100644 index 00000000000..993ae125ccc --- /dev/null +++ b/NServiceBus.sln @@ -0,0 +1,581 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus", "src\NServiceBus\NServiceBus.csproj", "{73867D40-8CBB-48E9-BFFA-12BBDD48A341}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.MessageInterfaces.Tests", "src\impl\messageInterfaces\NServiceBus.MessageInterfaces.Tests\NServiceBus.MessageInterfaces.Tests.csproj", "{9FF48F58-4555-4DB9-86EA-561F7E375B88}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObjectBuilder.CastleWindsor", "src\impl\ObjectBuilder\ObjectBuilder.CastleWindsor\ObjectBuilder.CastleWindsor.csproj", "{9A9A0BD5-AC37-4B90-B90F-FD1C1395FEBD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObjectBuilder.StructureMap", "src\impl\ObjectBuilder\ObjectBuilder.StructureMap\ObjectBuilder.StructureMap.csproj", "{C05E5B87-EB74-4A3F-B4FC-AFDD28570850}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObjectBuilder.Autofac", "src\impl\ObjectBuilder\ObjectBuilder.Autofac\ObjectBuilder.Autofac.csproj", "{73EC4EBE-826D-4A0A-8837-51D3458FC2A8}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObjectBuilder.Unity", "src\impl\ObjectBuilder\ObjectBuilder.Unity\ObjectBuilder.Unity.csproj", "{343B2E7A-E228-4B31-ABB5-F5437B2E7A4C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObjectBuilder.Tests", "src\impl\ObjectBuilder\ObjectBuilder.Tests\ObjectBuilder.Tests.csproj", "{0A282BF4-0957-4074-8D5E-C2FB8634A3AA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObjectBuilder.Spring", "src\impl\ObjectBuilder\ObjectBuilder.Spring\ObjectBuilder.Spring.csproj", "{734D30CF-4376-488A-A6B4-1033FED93660}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObjectBuilder.Ninject", "src\impl\ObjectBuilder\ObjectBuilder.Ninject\ObjectBuilder.Ninject.csproj", "{C35AE1C7-C785-4629-A73D-977E0325D8B0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.SagaPersisters.InMemory.Tests", "src\impl\SagaPersisters\InMemory\NServiceBus.SagaPersisters.InMemory.Tests\NServiceBus.SagaPersisters.InMemory.Tests.csproj", "{BEC0A9DD-B275-4B62-BF61-22E25B593DB1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Serializers.XML.XsdGenerator", "src\impl\Serializers\NServiceBus.Serializers.XML.XsdGenerator\NServiceBus.Serializers.XML.XsdGenerator.csproj", "{85118B5C-6CAA-44B4-87EA-419DC6F4F2FB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Logging.Tests", "src\logging\NServiceBus.Logging.Tests\NServiceBus.Logging.Tests.csproj", "{CED929E4-5D17-4A5F-B74C-648331FF7E7A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.PowerShell", "src\PowerShell\NServiceBus.PowerShell\NServiceBus.PowerShell.csproj", "{5E51EFBF-329F-4D3A-B86E-CC111697746F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LicenseInstaller", "src\tools\licenseinstaller\LicenseInstaller.csproj", "{857C5E77-1946-4C83-BC8D-EFF8E1611A0D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReturnToSourceQueue", "src\tools\management\Errors\ReturnToSourceQueue\ReturnToSourceQueue\ReturnToSourceQueue.csproj", "{C4693C58-BB66-4630-984E-313E1BCC2474}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NServiceBus", "NServiceBus", "{258A3F0E-FAFA-4C13-9D5A-9E46661B22D2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ObjectBuilders", "ObjectBuilders", "{A650DE92-3B6D-4228-A1A2-FB06E74C1BD2}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{2904B75F-8F07-4C07-BABC-BC42533B3E75}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Setup", "Setup", "{7C9F4F7D-7D96-4F9B-A673-428D78B7DB14}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{EF5E77D7-74B1-422D-B34E-AED35E19249E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Core", "src\NServiceBus.Core\NServiceBus.Core.csproj", "{DD48B2D0-E996-412D-9157-821ED8B17A9D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Azure", "Azure", "{D252B6C1-2A57-43E7-8A7C-A9B33722E7A7}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Integration.Azure.Tests", "src\azure\Integration\NServiceBus.Integration.Azure.Tests\NServiceBus.Integration.Azure.Tests.csproj", "{CA59C36D-FA35-42B4-99B5-5725C6AF1B01}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{1E44314D-F9DE-4933-9FF7-DB9673992ABC}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NHibernate", "NHibernate", "{A1EA417E-24A7-4088-9028-F0076F5B4978}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.GatewayPersister.NHibernate.Tests", "src\nhibernate\GatewayPersister\NServiceBus.GatewayPersister.NHibernate.Tests\NServiceBus.GatewayPersister.NHibernate.Tests.csproj", "{1DA3FF96-0263-46E7-91DD-A0EBF254FD2E}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{477F7829-A274-44E5-8D4A-5CAA7407029F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Persistence.NHibernate.Tests", "src\nhibernate\NServiceBus.Persistence.NHibernate.Tests\NServiceBus.Persistence.NHibernate.Tests.csproj", "{C6C0A51E-5553-4A04-9CE4-4C43734B27CF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.NHibernate", "src\nhibernate\NServiceBus.NHibernate\NServiceBus.NHibernate.csproj", "{281646E3-32E0-4F4D-BCF6-1DC5EFC6C268}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.SagaPersisters.NHibernate.Tests", "src\nhibernate\SagaPersister\NServiceBus.SagaPersisters.NHibernate.Tests\NServiceBus.SagaPersisters.NHibernate.Tests.csproj", "{7F1A7421-0335-43D4-8C50-4ED444D19336}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Subscriptions.NHibernate.Tests", "src\nhibernate\Subscriptions\NServiceBus.Unicast.Subscriptions.NHibernate.Tests\NServiceBus.Unicast.Subscriptions.NHibernate.Tests.csproj", "{06AE9368-B357-4682-8B79-1FB186BF38B5}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.TimeoutPersisters.NHibernate.Tests", "src\nhibernate\TimeoutPersister\NServiceBus.TimeoutPersisters.NHibernate.Tests\NServiceBus.TimeoutPersisters.NHibernate.Tests.csproj", "{4F6B59C8-917C-4C72-A212-F740E585660F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Hosting", "Hosting", "{5F77E8FE-0DCB-4E91-8F91-D3C9E767F5EF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Hosting.Tests", "src\hosting\NServiceBus.Hosting.Tests\NServiceBus.Hosting.Tests.csproj", "{93B2CD66-7860-47A3-A039-B7D778E9A8F4}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Hosting.Windows", "src\hosting\NServiceBus.Hosting.Windows\NServiceBus.Hosting.Windows.csproj", "{85E813C0-4A94-4946-8B1F-DE1E39AA7D11}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Host", "Host", "{827106CD-3DB5-4CF7-B664-FD894E175E65}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Hosting.Azure", "src\azure\Hosting\NServiceBus.Hosting.Azure\NServiceBus.Hosting.Azure.csproj", "{6591ED91-F9A1-4CC3-813E-A33E07439D49}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Hosting.Azure.HostProcess", "src\azure\Hosting\NServiceBus.Hosting.Azure.HostProcess\NServiceBus.Hosting.Azure.HostProcess.csproj", "{11B81F23-64C6-4341-94AC-38B3C4C6B1E7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Timeout", "Timeout", "{B32EECEC-326A-45CC-9FDF-9D346204DC43}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Timeout.Hosting.Azure", "src\azure\Timeout\NServiceBus.Timeout.Hosting.Azure\NServiceBus.Timeout.Hosting.Azure.csproj", "{046FC5EF-EAE3-4306-BA3D-973197F32EB6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Azure", "src\azure\NServiceBus.Azure\NServiceBus.Azure.csproj", "{12F1D9F1-0A2C-4442-8D18-67DD096C6300}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing.Azure.Tests", "src\azure\Queueing\NServiceBus.Unicast.Queuing.Azure.Tests\NServiceBus.Unicast.Queuing.Azure.Tests.csproj", "{D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Testing", "src\testing\NServiceBus.Testing.csproj", "{8B815173-9AFA-4D95-BAB4-686C298F17DA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ActiveMQ", "ActiveMQ", "{2827E591-D510-4966-8EEE-1562737B9C53}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Transports.ActiveMQ", "src\ActiveMQ\NServiceBus.ActiveMQ\NServiceBus.Transports.ActiveMQ.csproj", "{6FC67824-B465-4796-828E-76E5BF4F0D54}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Transports.ActiveMQ.Tests", "src\ActiveMQ\NServiceBus.ActiveMQ.Tests\NServiceBus.Transports.ActiveMQ.Tests.csproj", "{88485CCA-BE4A-46D7-864A-2ABEF45074BF}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Testing", "Testing", "{0284B5E1-7537-462C-983C-B9074C9FAA48}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Core.Tests", "src\NServiceBus.Core.Tests\NServiceBus.Core.Tests.csproj", "{2C8F181B-9BAF-4858-968B-1C16F5DDCFA7}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RabbitMQ", "RabbitMQ", "{CD0A68A9-F6ED-458A-92A5-AE85E5CC5ADC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Transports.RabbitMQ", "src\RabbitMQ\NServiceBus.RabbitMQ\NServiceBus.Transports.RabbitMQ.csproj", "{BA731749-22C7-4025-8A4D-465AE8E02E61}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Transports.RabbitMQ.Tests", "src\RabbitMQ\NServiceBus.RabbitMQ.Tests\NServiceBus.Transports.RabbitMQ.Tests.csproj", "{8B773CFD-E0F8-402F-AABC-04580289C76A}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SqlServer", "SqlServer", "{DED4B2D5-CE9E-4C2C-A263-A46D25D1ACAC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Transports.SQLServer", "src\SqlServer\NServiceBus.SqlServer\NServiceBus.Transports.SQLServer.csproj", "{FA1193BF-325C-4201-BB78-484032E09809}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Testing.Tests", "src\testing\NServiceBus.Testing.Tests\NServiceBus.Testing.Tests.csproj", "{7619C202-AE52-45DC-98AF-901DD670F117}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Notifications", "src\NServiceBus.Notifications\NServiceBus.Notifications.csproj", "{C97A8937-E7AF-4791-A4A2-0927422DDC2C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.PowerShell.Tests", "src\PowerShell\NServiceBus.PowerShell.Tests\NServiceBus.PowerShell.Tests.csproj", "{04121C4B-EB4F-4508-8760-5818185F4403}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Debug|Any CPU.Build.0 = Debug|Any CPU + {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Debug|x86.ActiveCfg = Debug|Any CPU + {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Debug|x86.Build.0 = Debug|Any CPU + {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Release|Any CPU.ActiveCfg = Release|Any CPU + {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Release|Any CPU.Build.0 = Release|Any CPU + {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Release|x86.ActiveCfg = Release|Any CPU + {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Release|x86.Build.0 = Release|Any CPU + {9FF48F58-4555-4DB9-86EA-561F7E375B88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9FF48F58-4555-4DB9-86EA-561F7E375B88}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9FF48F58-4555-4DB9-86EA-561F7E375B88}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {9FF48F58-4555-4DB9-86EA-561F7E375B88}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {9FF48F58-4555-4DB9-86EA-561F7E375B88}.Debug|x86.ActiveCfg = Debug|Any CPU + {9FF48F58-4555-4DB9-86EA-561F7E375B88}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9FF48F58-4555-4DB9-86EA-561F7E375B88}.Release|Any CPU.Build.0 = Release|Any CPU + {9FF48F58-4555-4DB9-86EA-561F7E375B88}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {9FF48F58-4555-4DB9-86EA-561F7E375B88}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {9FF48F58-4555-4DB9-86EA-561F7E375B88}.Release|x86.ActiveCfg = Release|Any CPU + {9A9A0BD5-AC37-4B90-B90F-FD1C1395FEBD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9A9A0BD5-AC37-4B90-B90F-FD1C1395FEBD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9A9A0BD5-AC37-4B90-B90F-FD1C1395FEBD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {9A9A0BD5-AC37-4B90-B90F-FD1C1395FEBD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {9A9A0BD5-AC37-4B90-B90F-FD1C1395FEBD}.Debug|x86.ActiveCfg = Debug|Any CPU + {9A9A0BD5-AC37-4B90-B90F-FD1C1395FEBD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9A9A0BD5-AC37-4B90-B90F-FD1C1395FEBD}.Release|Any CPU.Build.0 = Release|Any CPU + {9A9A0BD5-AC37-4B90-B90F-FD1C1395FEBD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {9A9A0BD5-AC37-4B90-B90F-FD1C1395FEBD}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {9A9A0BD5-AC37-4B90-B90F-FD1C1395FEBD}.Release|x86.ActiveCfg = Release|Any CPU + {C05E5B87-EB74-4A3F-B4FC-AFDD28570850}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C05E5B87-EB74-4A3F-B4FC-AFDD28570850}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C05E5B87-EB74-4A3F-B4FC-AFDD28570850}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C05E5B87-EB74-4A3F-B4FC-AFDD28570850}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C05E5B87-EB74-4A3F-B4FC-AFDD28570850}.Debug|x86.ActiveCfg = Debug|Any CPU + {C05E5B87-EB74-4A3F-B4FC-AFDD28570850}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C05E5B87-EB74-4A3F-B4FC-AFDD28570850}.Release|Any CPU.Build.0 = Release|Any CPU + {C05E5B87-EB74-4A3F-B4FC-AFDD28570850}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C05E5B87-EB74-4A3F-B4FC-AFDD28570850}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C05E5B87-EB74-4A3F-B4FC-AFDD28570850}.Release|x86.ActiveCfg = Release|Any CPU + {73EC4EBE-826D-4A0A-8837-51D3458FC2A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {73EC4EBE-826D-4A0A-8837-51D3458FC2A8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {73EC4EBE-826D-4A0A-8837-51D3458FC2A8}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {73EC4EBE-826D-4A0A-8837-51D3458FC2A8}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {73EC4EBE-826D-4A0A-8837-51D3458FC2A8}.Debug|x86.ActiveCfg = Debug|Any CPU + {73EC4EBE-826D-4A0A-8837-51D3458FC2A8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {73EC4EBE-826D-4A0A-8837-51D3458FC2A8}.Release|Any CPU.Build.0 = Release|Any CPU + {73EC4EBE-826D-4A0A-8837-51D3458FC2A8}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {73EC4EBE-826D-4A0A-8837-51D3458FC2A8}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {73EC4EBE-826D-4A0A-8837-51D3458FC2A8}.Release|x86.ActiveCfg = Release|Any CPU + {343B2E7A-E228-4B31-ABB5-F5437B2E7A4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {343B2E7A-E228-4B31-ABB5-F5437B2E7A4C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {343B2E7A-E228-4B31-ABB5-F5437B2E7A4C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {343B2E7A-E228-4B31-ABB5-F5437B2E7A4C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {343B2E7A-E228-4B31-ABB5-F5437B2E7A4C}.Debug|x86.ActiveCfg = Debug|Any CPU + {343B2E7A-E228-4B31-ABB5-F5437B2E7A4C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {343B2E7A-E228-4B31-ABB5-F5437B2E7A4C}.Release|Any CPU.Build.0 = Release|Any CPU + {343B2E7A-E228-4B31-ABB5-F5437B2E7A4C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {343B2E7A-E228-4B31-ABB5-F5437B2E7A4C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {343B2E7A-E228-4B31-ABB5-F5437B2E7A4C}.Release|x86.ActiveCfg = Release|Any CPU + {0A282BF4-0957-4074-8D5E-C2FB8634A3AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0A282BF4-0957-4074-8D5E-C2FB8634A3AA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0A282BF4-0957-4074-8D5E-C2FB8634A3AA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {0A282BF4-0957-4074-8D5E-C2FB8634A3AA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {0A282BF4-0957-4074-8D5E-C2FB8634A3AA}.Debug|x86.ActiveCfg = Debug|Any CPU + {0A282BF4-0957-4074-8D5E-C2FB8634A3AA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0A282BF4-0957-4074-8D5E-C2FB8634A3AA}.Release|Any CPU.Build.0 = Release|Any CPU + {0A282BF4-0957-4074-8D5E-C2FB8634A3AA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {0A282BF4-0957-4074-8D5E-C2FB8634A3AA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {0A282BF4-0957-4074-8D5E-C2FB8634A3AA}.Release|x86.ActiveCfg = Release|Any CPU + {734D30CF-4376-488A-A6B4-1033FED93660}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {734D30CF-4376-488A-A6B4-1033FED93660}.Debug|Any CPU.Build.0 = Debug|Any CPU + {734D30CF-4376-488A-A6B4-1033FED93660}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {734D30CF-4376-488A-A6B4-1033FED93660}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {734D30CF-4376-488A-A6B4-1033FED93660}.Debug|x86.ActiveCfg = Debug|Any CPU + {734D30CF-4376-488A-A6B4-1033FED93660}.Release|Any CPU.ActiveCfg = Release|Any CPU + {734D30CF-4376-488A-A6B4-1033FED93660}.Release|Any CPU.Build.0 = Release|Any CPU + {734D30CF-4376-488A-A6B4-1033FED93660}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {734D30CF-4376-488A-A6B4-1033FED93660}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {734D30CF-4376-488A-A6B4-1033FED93660}.Release|x86.ActiveCfg = Release|Any CPU + {C35AE1C7-C785-4629-A73D-977E0325D8B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C35AE1C7-C785-4629-A73D-977E0325D8B0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C35AE1C7-C785-4629-A73D-977E0325D8B0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C35AE1C7-C785-4629-A73D-977E0325D8B0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C35AE1C7-C785-4629-A73D-977E0325D8B0}.Debug|x86.ActiveCfg = Debug|Any CPU + {C35AE1C7-C785-4629-A73D-977E0325D8B0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C35AE1C7-C785-4629-A73D-977E0325D8B0}.Release|Any CPU.Build.0 = Release|Any CPU + {C35AE1C7-C785-4629-A73D-977E0325D8B0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C35AE1C7-C785-4629-A73D-977E0325D8B0}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C35AE1C7-C785-4629-A73D-977E0325D8B0}.Release|x86.ActiveCfg = Release|Any CPU + {BEC0A9DD-B275-4B62-BF61-22E25B593DB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BEC0A9DD-B275-4B62-BF61-22E25B593DB1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BEC0A9DD-B275-4B62-BF61-22E25B593DB1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BEC0A9DD-B275-4B62-BF61-22E25B593DB1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BEC0A9DD-B275-4B62-BF61-22E25B593DB1}.Debug|x86.ActiveCfg = Debug|Any CPU + {BEC0A9DD-B275-4B62-BF61-22E25B593DB1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BEC0A9DD-B275-4B62-BF61-22E25B593DB1}.Release|Any CPU.Build.0 = Release|Any CPU + {BEC0A9DD-B275-4B62-BF61-22E25B593DB1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BEC0A9DD-B275-4B62-BF61-22E25B593DB1}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BEC0A9DD-B275-4B62-BF61-22E25B593DB1}.Release|x86.ActiveCfg = Release|Any CPU + {85118B5C-6CAA-44B4-87EA-419DC6F4F2FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85118B5C-6CAA-44B4-87EA-419DC6F4F2FB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85118B5C-6CAA-44B4-87EA-419DC6F4F2FB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {85118B5C-6CAA-44B4-87EA-419DC6F4F2FB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {85118B5C-6CAA-44B4-87EA-419DC6F4F2FB}.Debug|x86.ActiveCfg = Debug|Any CPU + {85118B5C-6CAA-44B4-87EA-419DC6F4F2FB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85118B5C-6CAA-44B4-87EA-419DC6F4F2FB}.Release|Any CPU.Build.0 = Release|Any CPU + {85118B5C-6CAA-44B4-87EA-419DC6F4F2FB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {85118B5C-6CAA-44B4-87EA-419DC6F4F2FB}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {85118B5C-6CAA-44B4-87EA-419DC6F4F2FB}.Release|x86.ActiveCfg = Release|Any CPU + {CED929E4-5D17-4A5F-B74C-648331FF7E7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CED929E4-5D17-4A5F-B74C-648331FF7E7A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CED929E4-5D17-4A5F-B74C-648331FF7E7A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {CED929E4-5D17-4A5F-B74C-648331FF7E7A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {CED929E4-5D17-4A5F-B74C-648331FF7E7A}.Debug|x86.ActiveCfg = Debug|Any CPU + {CED929E4-5D17-4A5F-B74C-648331FF7E7A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CED929E4-5D17-4A5F-B74C-648331FF7E7A}.Release|Any CPU.Build.0 = Release|Any CPU + {CED929E4-5D17-4A5F-B74C-648331FF7E7A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {CED929E4-5D17-4A5F-B74C-648331FF7E7A}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {CED929E4-5D17-4A5F-B74C-648331FF7E7A}.Release|x86.ActiveCfg = Release|Any CPU + {5E51EFBF-329F-4D3A-B86E-CC111697746F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5E51EFBF-329F-4D3A-B86E-CC111697746F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5E51EFBF-329F-4D3A-B86E-CC111697746F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {5E51EFBF-329F-4D3A-B86E-CC111697746F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {5E51EFBF-329F-4D3A-B86E-CC111697746F}.Debug|x86.ActiveCfg = Debug|Any CPU + {5E51EFBF-329F-4D3A-B86E-CC111697746F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5E51EFBF-329F-4D3A-B86E-CC111697746F}.Release|Any CPU.Build.0 = Release|Any CPU + {5E51EFBF-329F-4D3A-B86E-CC111697746F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {5E51EFBF-329F-4D3A-B86E-CC111697746F}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {5E51EFBF-329F-4D3A-B86E-CC111697746F}.Release|x86.ActiveCfg = Release|Any CPU + {857C5E77-1946-4C83-BC8D-EFF8E1611A0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {857C5E77-1946-4C83-BC8D-EFF8E1611A0D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {857C5E77-1946-4C83-BC8D-EFF8E1611A0D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {857C5E77-1946-4C83-BC8D-EFF8E1611A0D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {857C5E77-1946-4C83-BC8D-EFF8E1611A0D}.Debug|x86.ActiveCfg = Debug|Any CPU + {857C5E77-1946-4C83-BC8D-EFF8E1611A0D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {857C5E77-1946-4C83-BC8D-EFF8E1611A0D}.Release|Any CPU.Build.0 = Release|Any CPU + {857C5E77-1946-4C83-BC8D-EFF8E1611A0D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {857C5E77-1946-4C83-BC8D-EFF8E1611A0D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {857C5E77-1946-4C83-BC8D-EFF8E1611A0D}.Release|x86.ActiveCfg = Release|Any CPU + {C4693C58-BB66-4630-984E-313E1BCC2474}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C4693C58-BB66-4630-984E-313E1BCC2474}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C4693C58-BB66-4630-984E-313E1BCC2474}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C4693C58-BB66-4630-984E-313E1BCC2474}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C4693C58-BB66-4630-984E-313E1BCC2474}.Debug|x86.ActiveCfg = Debug|Any CPU + {C4693C58-BB66-4630-984E-313E1BCC2474}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C4693C58-BB66-4630-984E-313E1BCC2474}.Release|Any CPU.Build.0 = Release|Any CPU + {C4693C58-BB66-4630-984E-313E1BCC2474}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C4693C58-BB66-4630-984E-313E1BCC2474}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C4693C58-BB66-4630-984E-313E1BCC2474}.Release|x86.ActiveCfg = Release|Any CPU + {DD48B2D0-E996-412D-9157-821ED8B17A9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DD48B2D0-E996-412D-9157-821ED8B17A9D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DD48B2D0-E996-412D-9157-821ED8B17A9D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {DD48B2D0-E996-412D-9157-821ED8B17A9D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {DD48B2D0-E996-412D-9157-821ED8B17A9D}.Debug|x86.ActiveCfg = Debug|Any CPU + {DD48B2D0-E996-412D-9157-821ED8B17A9D}.Debug|x86.Build.0 = Debug|Any CPU + {DD48B2D0-E996-412D-9157-821ED8B17A9D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DD48B2D0-E996-412D-9157-821ED8B17A9D}.Release|Any CPU.Build.0 = Release|Any CPU + {DD48B2D0-E996-412D-9157-821ED8B17A9D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {DD48B2D0-E996-412D-9157-821ED8B17A9D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {DD48B2D0-E996-412D-9157-821ED8B17A9D}.Release|x86.ActiveCfg = Release|Any CPU + {DD48B2D0-E996-412D-9157-821ED8B17A9D}.Release|x86.Build.0 = Release|Any CPU + {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Debug|x86.ActiveCfg = Debug|Any CPU + {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Release|Any CPU.Build.0 = Release|Any CPU + {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Release|x86.ActiveCfg = Release|Any CPU + {1DA3FF96-0263-46E7-91DD-A0EBF254FD2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1DA3FF96-0263-46E7-91DD-A0EBF254FD2E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1DA3FF96-0263-46E7-91DD-A0EBF254FD2E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {1DA3FF96-0263-46E7-91DD-A0EBF254FD2E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {1DA3FF96-0263-46E7-91DD-A0EBF254FD2E}.Debug|x86.ActiveCfg = Debug|Any CPU + {1DA3FF96-0263-46E7-91DD-A0EBF254FD2E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1DA3FF96-0263-46E7-91DD-A0EBF254FD2E}.Release|Any CPU.Build.0 = Release|Any CPU + {1DA3FF96-0263-46E7-91DD-A0EBF254FD2E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {1DA3FF96-0263-46E7-91DD-A0EBF254FD2E}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {1DA3FF96-0263-46E7-91DD-A0EBF254FD2E}.Release|x86.ActiveCfg = Release|Any CPU + {C6C0A51E-5553-4A04-9CE4-4C43734B27CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C6C0A51E-5553-4A04-9CE4-4C43734B27CF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C6C0A51E-5553-4A04-9CE4-4C43734B27CF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C6C0A51E-5553-4A04-9CE4-4C43734B27CF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C6C0A51E-5553-4A04-9CE4-4C43734B27CF}.Debug|x86.ActiveCfg = Debug|Any CPU + {C6C0A51E-5553-4A04-9CE4-4C43734B27CF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C6C0A51E-5553-4A04-9CE4-4C43734B27CF}.Release|Any CPU.Build.0 = Release|Any CPU + {C6C0A51E-5553-4A04-9CE4-4C43734B27CF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C6C0A51E-5553-4A04-9CE4-4C43734B27CF}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C6C0A51E-5553-4A04-9CE4-4C43734B27CF}.Release|x86.ActiveCfg = Release|Any CPU + {281646E3-32E0-4F4D-BCF6-1DC5EFC6C268}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {281646E3-32E0-4F4D-BCF6-1DC5EFC6C268}.Debug|Any CPU.Build.0 = Debug|Any CPU + {281646E3-32E0-4F4D-BCF6-1DC5EFC6C268}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {281646E3-32E0-4F4D-BCF6-1DC5EFC6C268}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {281646E3-32E0-4F4D-BCF6-1DC5EFC6C268}.Debug|x86.ActiveCfg = Debug|Any CPU + {281646E3-32E0-4F4D-BCF6-1DC5EFC6C268}.Release|Any CPU.ActiveCfg = Release|Any CPU + {281646E3-32E0-4F4D-BCF6-1DC5EFC6C268}.Release|Any CPU.Build.0 = Release|Any CPU + {281646E3-32E0-4F4D-BCF6-1DC5EFC6C268}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {281646E3-32E0-4F4D-BCF6-1DC5EFC6C268}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {281646E3-32E0-4F4D-BCF6-1DC5EFC6C268}.Release|x86.ActiveCfg = Release|Any CPU + {7F1A7421-0335-43D4-8C50-4ED444D19336}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7F1A7421-0335-43D4-8C50-4ED444D19336}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7F1A7421-0335-43D4-8C50-4ED444D19336}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {7F1A7421-0335-43D4-8C50-4ED444D19336}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {7F1A7421-0335-43D4-8C50-4ED444D19336}.Debug|x86.ActiveCfg = Debug|Any CPU + {7F1A7421-0335-43D4-8C50-4ED444D19336}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7F1A7421-0335-43D4-8C50-4ED444D19336}.Release|Any CPU.Build.0 = Release|Any CPU + {7F1A7421-0335-43D4-8C50-4ED444D19336}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {7F1A7421-0335-43D4-8C50-4ED444D19336}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {7F1A7421-0335-43D4-8C50-4ED444D19336}.Release|x86.ActiveCfg = Release|Any CPU + {06AE9368-B357-4682-8B79-1FB186BF38B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {06AE9368-B357-4682-8B79-1FB186BF38B5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {06AE9368-B357-4682-8B79-1FB186BF38B5}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {06AE9368-B357-4682-8B79-1FB186BF38B5}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {06AE9368-B357-4682-8B79-1FB186BF38B5}.Debug|x86.ActiveCfg = Debug|Any CPU + {06AE9368-B357-4682-8B79-1FB186BF38B5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {06AE9368-B357-4682-8B79-1FB186BF38B5}.Release|Any CPU.Build.0 = Release|Any CPU + {06AE9368-B357-4682-8B79-1FB186BF38B5}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {06AE9368-B357-4682-8B79-1FB186BF38B5}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {06AE9368-B357-4682-8B79-1FB186BF38B5}.Release|x86.ActiveCfg = Release|Any CPU + {4F6B59C8-917C-4C72-A212-F740E585660F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4F6B59C8-917C-4C72-A212-F740E585660F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4F6B59C8-917C-4C72-A212-F740E585660F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {4F6B59C8-917C-4C72-A212-F740E585660F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {4F6B59C8-917C-4C72-A212-F740E585660F}.Debug|x86.ActiveCfg = Debug|Any CPU + {4F6B59C8-917C-4C72-A212-F740E585660F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4F6B59C8-917C-4C72-A212-F740E585660F}.Release|Any CPU.Build.0 = Release|Any CPU + {4F6B59C8-917C-4C72-A212-F740E585660F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {4F6B59C8-917C-4C72-A212-F740E585660F}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {4F6B59C8-917C-4C72-A212-F740E585660F}.Release|x86.ActiveCfg = Release|Any CPU + {93B2CD66-7860-47A3-A039-B7D778E9A8F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {93B2CD66-7860-47A3-A039-B7D778E9A8F4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {93B2CD66-7860-47A3-A039-B7D778E9A8F4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {93B2CD66-7860-47A3-A039-B7D778E9A8F4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {93B2CD66-7860-47A3-A039-B7D778E9A8F4}.Debug|x86.ActiveCfg = Debug|Any CPU + {93B2CD66-7860-47A3-A039-B7D778E9A8F4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {93B2CD66-7860-47A3-A039-B7D778E9A8F4}.Release|Any CPU.Build.0 = Release|Any CPU + {93B2CD66-7860-47A3-A039-B7D778E9A8F4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {93B2CD66-7860-47A3-A039-B7D778E9A8F4}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {93B2CD66-7860-47A3-A039-B7D778E9A8F4}.Release|x86.ActiveCfg = Release|Any CPU + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11}.Debug|x86.ActiveCfg = Debug|x86 + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11}.Debug|x86.Build.0 = Debug|x86 + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11}.Release|Any CPU.Build.0 = Release|Any CPU + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11}.Release|x86.ActiveCfg = Release|x86 + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11}.Release|x86.Build.0 = Release|x86 + {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Debug|x86.ActiveCfg = Debug|Any CPU + {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Release|Any CPU.Build.0 = Release|Any CPU + {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Release|x86.ActiveCfg = Release|Any CPU + {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Debug|x86.ActiveCfg = Debug|Any CPU + {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Release|Any CPU.Build.0 = Release|Any CPU + {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Release|x86.ActiveCfg = Release|Any CPU + {046FC5EF-EAE3-4306-BA3D-973197F32EB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {046FC5EF-EAE3-4306-BA3D-973197F32EB6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {046FC5EF-EAE3-4306-BA3D-973197F32EB6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {046FC5EF-EAE3-4306-BA3D-973197F32EB6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {046FC5EF-EAE3-4306-BA3D-973197F32EB6}.Debug|x86.ActiveCfg = Debug|Any CPU + {046FC5EF-EAE3-4306-BA3D-973197F32EB6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {046FC5EF-EAE3-4306-BA3D-973197F32EB6}.Release|Any CPU.Build.0 = Release|Any CPU + {046FC5EF-EAE3-4306-BA3D-973197F32EB6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {046FC5EF-EAE3-4306-BA3D-973197F32EB6}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {046FC5EF-EAE3-4306-BA3D-973197F32EB6}.Release|x86.ActiveCfg = Release|Any CPU + {12F1D9F1-0A2C-4442-8D18-67DD096C6300}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12F1D9F1-0A2C-4442-8D18-67DD096C6300}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12F1D9F1-0A2C-4442-8D18-67DD096C6300}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {12F1D9F1-0A2C-4442-8D18-67DD096C6300}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {12F1D9F1-0A2C-4442-8D18-67DD096C6300}.Debug|x86.ActiveCfg = Debug|Any CPU + {12F1D9F1-0A2C-4442-8D18-67DD096C6300}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12F1D9F1-0A2C-4442-8D18-67DD096C6300}.Release|Any CPU.Build.0 = Release|Any CPU + {12F1D9F1-0A2C-4442-8D18-67DD096C6300}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {12F1D9F1-0A2C-4442-8D18-67DD096C6300}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {12F1D9F1-0A2C-4442-8D18-67DD096C6300}.Release|x86.ActiveCfg = Release|Any CPU + {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Debug|x86.ActiveCfg = Debug|Any CPU + {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Release|Any CPU.Build.0 = Release|Any CPU + {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Release|x86.ActiveCfg = Release|Any CPU + {8B815173-9AFA-4D95-BAB4-686C298F17DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8B815173-9AFA-4D95-BAB4-686C298F17DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8B815173-9AFA-4D95-BAB4-686C298F17DA}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {8B815173-9AFA-4D95-BAB4-686C298F17DA}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {8B815173-9AFA-4D95-BAB4-686C298F17DA}.Debug|x86.ActiveCfg = Debug|Any CPU + {8B815173-9AFA-4D95-BAB4-686C298F17DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8B815173-9AFA-4D95-BAB4-686C298F17DA}.Release|Any CPU.Build.0 = Release|Any CPU + {8B815173-9AFA-4D95-BAB4-686C298F17DA}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {8B815173-9AFA-4D95-BAB4-686C298F17DA}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {8B815173-9AFA-4D95-BAB4-686C298F17DA}.Release|x86.ActiveCfg = Release|Any CPU + {6FC67824-B465-4796-828E-76E5BF4F0D54}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6FC67824-B465-4796-828E-76E5BF4F0D54}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6FC67824-B465-4796-828E-76E5BF4F0D54}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {6FC67824-B465-4796-828E-76E5BF4F0D54}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {6FC67824-B465-4796-828E-76E5BF4F0D54}.Debug|x86.ActiveCfg = Debug|Any CPU + {6FC67824-B465-4796-828E-76E5BF4F0D54}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6FC67824-B465-4796-828E-76E5BF4F0D54}.Release|Any CPU.Build.0 = Release|Any CPU + {6FC67824-B465-4796-828E-76E5BF4F0D54}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {6FC67824-B465-4796-828E-76E5BF4F0D54}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {6FC67824-B465-4796-828E-76E5BF4F0D54}.Release|x86.ActiveCfg = Release|Any CPU + {88485CCA-BE4A-46D7-864A-2ABEF45074BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {88485CCA-BE4A-46D7-864A-2ABEF45074BF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {88485CCA-BE4A-46D7-864A-2ABEF45074BF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {88485CCA-BE4A-46D7-864A-2ABEF45074BF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {88485CCA-BE4A-46D7-864A-2ABEF45074BF}.Debug|x86.ActiveCfg = Debug|Any CPU + {88485CCA-BE4A-46D7-864A-2ABEF45074BF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {88485CCA-BE4A-46D7-864A-2ABEF45074BF}.Release|Any CPU.Build.0 = Release|Any CPU + {88485CCA-BE4A-46D7-864A-2ABEF45074BF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {88485CCA-BE4A-46D7-864A-2ABEF45074BF}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {88485CCA-BE4A-46D7-864A-2ABEF45074BF}.Release|x86.ActiveCfg = Release|Any CPU + {2C8F181B-9BAF-4858-968B-1C16F5DDCFA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2C8F181B-9BAF-4858-968B-1C16F5DDCFA7}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2C8F181B-9BAF-4858-968B-1C16F5DDCFA7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {2C8F181B-9BAF-4858-968B-1C16F5DDCFA7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {2C8F181B-9BAF-4858-968B-1C16F5DDCFA7}.Debug|x86.ActiveCfg = Debug|Any CPU + {2C8F181B-9BAF-4858-968B-1C16F5DDCFA7}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2C8F181B-9BAF-4858-968B-1C16F5DDCFA7}.Release|Any CPU.Build.0 = Release|Any CPU + {2C8F181B-9BAF-4858-968B-1C16F5DDCFA7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {2C8F181B-9BAF-4858-968B-1C16F5DDCFA7}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {2C8F181B-9BAF-4858-968B-1C16F5DDCFA7}.Release|x86.ActiveCfg = Release|Any CPU + {BA731749-22C7-4025-8A4D-465AE8E02E61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BA731749-22C7-4025-8A4D-465AE8E02E61}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BA731749-22C7-4025-8A4D-465AE8E02E61}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {BA731749-22C7-4025-8A4D-465AE8E02E61}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {BA731749-22C7-4025-8A4D-465AE8E02E61}.Debug|x86.ActiveCfg = Debug|Any CPU + {BA731749-22C7-4025-8A4D-465AE8E02E61}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BA731749-22C7-4025-8A4D-465AE8E02E61}.Release|Any CPU.Build.0 = Release|Any CPU + {BA731749-22C7-4025-8A4D-465AE8E02E61}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {BA731749-22C7-4025-8A4D-465AE8E02E61}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {BA731749-22C7-4025-8A4D-465AE8E02E61}.Release|x86.ActiveCfg = Release|Any CPU + {8B773CFD-E0F8-402F-AABC-04580289C76A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8B773CFD-E0F8-402F-AABC-04580289C76A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8B773CFD-E0F8-402F-AABC-04580289C76A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {8B773CFD-E0F8-402F-AABC-04580289C76A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {8B773CFD-E0F8-402F-AABC-04580289C76A}.Debug|x86.ActiveCfg = Debug|Any CPU + {8B773CFD-E0F8-402F-AABC-04580289C76A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8B773CFD-E0F8-402F-AABC-04580289C76A}.Release|Any CPU.Build.0 = Release|Any CPU + {8B773CFD-E0F8-402F-AABC-04580289C76A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {8B773CFD-E0F8-402F-AABC-04580289C76A}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {8B773CFD-E0F8-402F-AABC-04580289C76A}.Release|x86.ActiveCfg = Release|Any CPU + {FA1193BF-325C-4201-BB78-484032E09809}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA1193BF-325C-4201-BB78-484032E09809}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA1193BF-325C-4201-BB78-484032E09809}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {FA1193BF-325C-4201-BB78-484032E09809}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {FA1193BF-325C-4201-BB78-484032E09809}.Debug|x86.ActiveCfg = Debug|Any CPU + {FA1193BF-325C-4201-BB78-484032E09809}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA1193BF-325C-4201-BB78-484032E09809}.Release|Any CPU.Build.0 = Release|Any CPU + {FA1193BF-325C-4201-BB78-484032E09809}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {FA1193BF-325C-4201-BB78-484032E09809}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {FA1193BF-325C-4201-BB78-484032E09809}.Release|x86.ActiveCfg = Release|Any CPU + {7619C202-AE52-45DC-98AF-901DD670F117}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7619C202-AE52-45DC-98AF-901DD670F117}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7619C202-AE52-45DC-98AF-901DD670F117}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {7619C202-AE52-45DC-98AF-901DD670F117}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {7619C202-AE52-45DC-98AF-901DD670F117}.Debug|x86.ActiveCfg = Debug|Any CPU + {7619C202-AE52-45DC-98AF-901DD670F117}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7619C202-AE52-45DC-98AF-901DD670F117}.Release|Any CPU.Build.0 = Release|Any CPU + {7619C202-AE52-45DC-98AF-901DD670F117}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {7619C202-AE52-45DC-98AF-901DD670F117}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {7619C202-AE52-45DC-98AF-901DD670F117}.Release|x86.ActiveCfg = Release|Any CPU + {C97A8937-E7AF-4791-A4A2-0927422DDC2C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C97A8937-E7AF-4791-A4A2-0927422DDC2C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C97A8937-E7AF-4791-A4A2-0927422DDC2C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {C97A8937-E7AF-4791-A4A2-0927422DDC2C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {C97A8937-E7AF-4791-A4A2-0927422DDC2C}.Debug|x86.ActiveCfg = Debug|Any CPU + {C97A8937-E7AF-4791-A4A2-0927422DDC2C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C97A8937-E7AF-4791-A4A2-0927422DDC2C}.Release|Any CPU.Build.0 = Release|Any CPU + {C97A8937-E7AF-4791-A4A2-0927422DDC2C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {C97A8937-E7AF-4791-A4A2-0927422DDC2C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {C97A8937-E7AF-4791-A4A2-0927422DDC2C}.Release|x86.ActiveCfg = Release|Any CPU + {04121C4B-EB4F-4508-8760-5818185F4403}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {04121C4B-EB4F-4508-8760-5818185F4403}.Debug|Any CPU.Build.0 = Debug|Any CPU + {04121C4B-EB4F-4508-8760-5818185F4403}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {04121C4B-EB4F-4508-8760-5818185F4403}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {04121C4B-EB4F-4508-8760-5818185F4403}.Debug|x86.ActiveCfg = Debug|Any CPU + {04121C4B-EB4F-4508-8760-5818185F4403}.Release|Any CPU.ActiveCfg = Release|Any CPU + {04121C4B-EB4F-4508-8760-5818185F4403}.Release|Any CPU.Build.0 = Release|Any CPU + {04121C4B-EB4F-4508-8760-5818185F4403}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {04121C4B-EB4F-4508-8760-5818185F4403}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {04121C4B-EB4F-4508-8760-5818185F4403}.Release|x86.ActiveCfg = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {73867D40-8CBB-48E9-BFFA-12BBDD48A341} = {258A3F0E-FAFA-4C13-9D5A-9E46661B22D2} + {DD48B2D0-E996-412D-9157-821ED8B17A9D} = {258A3F0E-FAFA-4C13-9D5A-9E46661B22D2} + {2C8F181B-9BAF-4858-968B-1C16F5DDCFA7} = {258A3F0E-FAFA-4C13-9D5A-9E46661B22D2} + {C97A8937-E7AF-4791-A4A2-0927422DDC2C} = {258A3F0E-FAFA-4C13-9D5A-9E46661B22D2} + {BEC0A9DD-B275-4B62-BF61-22E25B593DB1} = {2904B75F-8F07-4C07-BABC-BC42533B3E75} + {CED929E4-5D17-4A5F-B74C-648331FF7E7A} = {2904B75F-8F07-4C07-BABC-BC42533B3E75} + {9FF48F58-4555-4DB9-86EA-561F7E375B88} = {2904B75F-8F07-4C07-BABC-BC42533B3E75} + {C05E5B87-EB74-4A3F-B4FC-AFDD28570850} = {A650DE92-3B6D-4228-A1A2-FB06E74C1BD2} + {73EC4EBE-826D-4A0A-8837-51D3458FC2A8} = {A650DE92-3B6D-4228-A1A2-FB06E74C1BD2} + {343B2E7A-E228-4B31-ABB5-F5437B2E7A4C} = {A650DE92-3B6D-4228-A1A2-FB06E74C1BD2} + {0A282BF4-0957-4074-8D5E-C2FB8634A3AA} = {A650DE92-3B6D-4228-A1A2-FB06E74C1BD2} + {734D30CF-4376-488A-A6B4-1033FED93660} = {A650DE92-3B6D-4228-A1A2-FB06E74C1BD2} + {C35AE1C7-C785-4629-A73D-977E0325D8B0} = {A650DE92-3B6D-4228-A1A2-FB06E74C1BD2} + {9A9A0BD5-AC37-4B90-B90F-FD1C1395FEBD} = {A650DE92-3B6D-4228-A1A2-FB06E74C1BD2} + {857C5E77-1946-4C83-BC8D-EFF8E1611A0D} = {EF5E77D7-74B1-422D-B34E-AED35E19249E} + {C4693C58-BB66-4630-984E-313E1BCC2474} = {EF5E77D7-74B1-422D-B34E-AED35E19249E} + {85118B5C-6CAA-44B4-87EA-419DC6F4F2FB} = {EF5E77D7-74B1-422D-B34E-AED35E19249E} + {5E51EFBF-329F-4D3A-B86E-CC111697746F} = {7C9F4F7D-7D96-4F9B-A673-428D78B7DB14} + {04121C4B-EB4F-4508-8760-5818185F4403} = {7C9F4F7D-7D96-4F9B-A673-428D78B7DB14} + {1E44314D-F9DE-4933-9FF7-DB9673992ABC} = {D252B6C1-2A57-43E7-8A7C-A9B33722E7A7} + {827106CD-3DB5-4CF7-B664-FD894E175E65} = {D252B6C1-2A57-43E7-8A7C-A9B33722E7A7} + {B32EECEC-326A-45CC-9FDF-9D346204DC43} = {D252B6C1-2A57-43E7-8A7C-A9B33722E7A7} + {12F1D9F1-0A2C-4442-8D18-67DD096C6300} = {D252B6C1-2A57-43E7-8A7C-A9B33722E7A7} + {CA59C36D-FA35-42B4-99B5-5725C6AF1B01} = {1E44314D-F9DE-4933-9FF7-DB9673992ABC} + {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD} = {1E44314D-F9DE-4933-9FF7-DB9673992ABC} + {477F7829-A274-44E5-8D4A-5CAA7407029F} = {A1EA417E-24A7-4088-9028-F0076F5B4978} + {281646E3-32E0-4F4D-BCF6-1DC5EFC6C268} = {A1EA417E-24A7-4088-9028-F0076F5B4978} + {1DA3FF96-0263-46E7-91DD-A0EBF254FD2E} = {477F7829-A274-44E5-8D4A-5CAA7407029F} + {C6C0A51E-5553-4A04-9CE4-4C43734B27CF} = {477F7829-A274-44E5-8D4A-5CAA7407029F} + {7F1A7421-0335-43D4-8C50-4ED444D19336} = {477F7829-A274-44E5-8D4A-5CAA7407029F} + {06AE9368-B357-4682-8B79-1FB186BF38B5} = {477F7829-A274-44E5-8D4A-5CAA7407029F} + {4F6B59C8-917C-4C72-A212-F740E585660F} = {477F7829-A274-44E5-8D4A-5CAA7407029F} + {93B2CD66-7860-47A3-A039-B7D778E9A8F4} = {5F77E8FE-0DCB-4E91-8F91-D3C9E767F5EF} + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11} = {5F77E8FE-0DCB-4E91-8F91-D3C9E767F5EF} + {6591ED91-F9A1-4CC3-813E-A33E07439D49} = {827106CD-3DB5-4CF7-B664-FD894E175E65} + {11B81F23-64C6-4341-94AC-38B3C4C6B1E7} = {827106CD-3DB5-4CF7-B664-FD894E175E65} + {046FC5EF-EAE3-4306-BA3D-973197F32EB6} = {B32EECEC-326A-45CC-9FDF-9D346204DC43} + {8B815173-9AFA-4D95-BAB4-686C298F17DA} = {0284B5E1-7537-462C-983C-B9074C9FAA48} + {7619C202-AE52-45DC-98AF-901DD670F117} = {0284B5E1-7537-462C-983C-B9074C9FAA48} + {6FC67824-B465-4796-828E-76E5BF4F0D54} = {2827E591-D510-4966-8EEE-1562737B9C53} + {88485CCA-BE4A-46D7-864A-2ABEF45074BF} = {2827E591-D510-4966-8EEE-1562737B9C53} + {BA731749-22C7-4025-8A4D-465AE8E02E61} = {CD0A68A9-F6ED-458A-92A5-AE85E5CC5ADC} + {8B773CFD-E0F8-402F-AABC-04580289C76A} = {CD0A68A9-F6ED-458A-92A5-AE85E5CC5ADC} + {FA1193BF-325C-4201-BB78-484032E09809} = {DED4B2D5-CE9E-4C2C-A263-A46D25D1ACAC} + EndGlobalSection +EndGlobal diff --git a/NServiceBus.sln.DotSettings b/NServiceBus.sln.DotSettings new file mode 100644 index 00000000000..10c832f5360 --- /dev/null +++ b/NServiceBus.sln.DotSettings @@ -0,0 +1,304 @@ + + + + True + True + True + False + DO_NOT_SHOW + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + DoHide + Default: Reformat Code + False + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + ALWAYS_ADD + True + <?xml version="1.0" encoding="utf-8" ?> + +<!-- +I. Overall + +I.1 Each pattern can have <Match>....</Match> element. For the given type declaration, the pattern with the match, evaluated to 'true' with the largest weight, will be used +I.2 Each pattern consists of the sequence of <Entry>...</Entry> elements. Type member declarations are distributed between entries +I.3 If pattern has RemoveAllRegions="true" attribute, then all regions will be cleared prior to reordering. Otherwise, only auto-generated regions will be cleared +I.4 The contents of each entry is sorted by given keys (First key is primary, next key is secondary, etc). Then the declarations are grouped and en-regioned by given property + +II. Available match operands + +Each operand may have Weight="..." attribute. This weight will be added to the match weight if the operand is evaluated to 'true'. +The default weight is 1 + +II.1 Boolean functions: +II.1.1 <And>....</And> +II.1.2 <Or>....</Or> +II.1.3 <Not>....</Not> + +II.2 Operands +II.2.1 <Kind Is="..."/>. Kinds are: class, struct, interface, enum, delegate, type, constructor, destructor, property, indexer, method, operator, field, constant, event, member +II.2.2 <Name Is="..." [IgnoreCase="true/false"] />. The 'Is' attribute contains regular expression +II.2.3 <HasAttribute CLRName="..." [Inherit="true/false"] />. The 'CLRName' attribute contains regular expression +II.2.4 <Access Is="..."/>. The 'Is' values are: public, protected, internal, protected internal, private +II.2.5 <Static/> +II.2.6 <Abstract/> +II.2.7 <Virtual/> +II.2.8 <Override/> +II.2.9 <Sealed/> +II.2.10 <Readonly/> +II.2.11 <ImplementsInterface CLRName="..."/>. The 'CLRName' attribute contains regular expression +II.2.12 <HandlesEvent /> +--> + +<Patterns xmlns="urn:shemas-jetbrains-com:member-reordering-patterns"> + + <!--Do not reorder COM interfaces and structs marked by StructLayout attribute--> + <Pattern> + <Match> + <Or Weight="100"> + <And> + <Kind Is="interface"/> + <Or> + <HasAttribute CLRName="System.Runtime.InteropServices.InterfaceTypeAttribute"/> + <HasAttribute CLRName="System.Runtime.InteropServices.ComImport"/> + </Or> + </And> + <HasAttribute CLRName="System.Runtime.InteropServices.StructLayoutAttribute"/> + </Or> + </Match> + </Pattern> + + <!--Special formatting of NUnit test fixture--> + <Pattern RemoveAllRegions="true"> + <Match> + <And Weight="100"> + <Kind Is="class"/> + <HasAttribute CLRName="NUnit.Framework.TestFixtureAttribute" Inherit="true"/> + </And> + </Match> + + <!--Setup/Teardow--> + <Entry> + <Match> + <And> + <Kind Is="method"/> + <Or> + <HasAttribute CLRName="NUnit.Framework.SetUpAttribute" Inherit="true"/> + <HasAttribute CLRName="NUnit.Framework.TearDownAttribute" Inherit="true"/> + <HasAttribute CLRName="NUnit.Framework.FixtureSetUpAttribute" Inherit="true"/> + <HasAttribute CLRName="NUnit.Framework.FixtureTearDownAttribute" Inherit="true"/> + </Or> + </And> + </Match> + </Entry> + + <!--All other members--> + <Entry/> + + <!--Test methods--> + <Entry> + <Match> + <And Weight="100"> + <Kind Is="method"/> + <HasAttribute CLRName="NUnit.Framework.TestAttribute" Inherit="false"/> + </And> + </Match> + <Sort> + <Name/> + </Sort> + </Entry> + </Pattern> + + <!--Default pattern--> + <Pattern> + + <!--public delegate--> + <Entry> + <Match> + <And Weight="100"> + <Access Is="public"/> + <Kind Is="delegate"/> + </And> + </Match> + <Sort> + <Name/> + </Sort> + </Entry> + + <!--public enum--> + <Entry> + <Match> + <And Weight="100"> + <Access Is="public"/> + <Kind Is="enum"/> + </And> + </Match> + <Sort> + <Name/> + </Sort> + </Entry> + + <!--Constructors. Place static one first--> + <Entry> + <Match> + <Kind Is="constructor"/> + </Match> + <Sort> + <Static/> + </Sort> + </Entry> + + <!--properties, indexers--> + <Entry> + <Match> + <Or> + <Kind Is="property"/> + <Kind Is="indexer"/> + </Or> + </Match> + </Entry> + + <!--interface implementations--> + <Entry> + <Match> + <And Weight="100"> + <Kind Is="member"/> + <ImplementsInterface/> + </And> + </Match> + <Sort> + <ImplementsInterface Immediate="true"/> + </Sort> + </Entry> + + <!--all other members--> + <Entry/> + +<!--static fields and constants--> + <Entry> + <Match> + <Or> + <Kind Is="constant"/> + <And> + <Kind Is="field"/> + <Static/> + </And> + </Or> + </Match> + <Sort> + <Kind Order="constant field"/> + </Sort> + </Entry> + + <!--instance fields--> + <Entry> + <Match> + <And> + <Kind Is="field"/> + <Not> + <Static/> + </Not> + </And> + </Match> + <Sort> + <Readonly/> + <Name/> + </Sort> + </Entry> + + <!--nested types--> + <Entry> + <Match> + <Kind Is="type"/> + </Match> + <Sort> + <Name/> + </Sort> + </Entry> + </Pattern> + +</Patterns> + + CustomLayout + True + True + False + True + False + False + False + True + Automatic property + True + False + False + DB + DTC + ID + NSB + SLA + $object$_On$event$ + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + $object$_On$event$ + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="I" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="aaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /> + <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> + True + C:\Projects\NServiceBus\NServiceBus.sln.DotSettings + True + 1 + <data /> + <data><IncludeFilters /><ExcludeFilters /></data> \ No newline at end of file diff --git a/NuGet/NServiceBus.ActiveMQ/NServiceBus.ActiveMQ.nuspec b/NuGet/NServiceBus.ActiveMQ/NServiceBus.ActiveMQ.nuspec new file mode 100644 index 00000000000..23c0a175773 --- /dev/null +++ b/NuGet/NServiceBus.ActiveMQ/NServiceBus.ActiveMQ.nuspec @@ -0,0 +1,25 @@ + + + NServiceBus.ActiveMQ + NServiceBus ActiveMQ + 4.0.0-alpha0 + NServiceBus Ltd + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement + http://particular.net/ + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png + true + ActiveMQ support for NServicebus + + + Copyright 2010-2013 NServiceBus. All rights reserved + nservicebus servicebus msmq cqrs publish subscribe + + + + + + + + + \ No newline at end of file diff --git a/NuGet/NServiceBus.ActiveMQ/tools/install.ps1 b/NuGet/NServiceBus.ActiveMQ/tools/install.ps1 new file mode 100644 index 00000000000..d6f9aaac85b --- /dev/null +++ b/NuGet/NServiceBus.ActiveMQ/tools/install.ps1 @@ -0,0 +1,3 @@ +param($installPath, $toolsPath, $package, $project) + +Add-BindingRedirect \ No newline at end of file diff --git a/NuGet/NServiceBus.Autofac/NServiceBus.Autofac.nuspec b/NuGet/NServiceBus.Autofac/NServiceBus.Autofac.nuspec index 7cd0e771b2c..73230debaef 100644 --- a/NuGet/NServiceBus.Autofac/NServiceBus.Autofac.nuspec +++ b/NuGet/NServiceBus.Autofac/NServiceBus.Autofac.nuspec @@ -4,18 +4,18 @@ NServiceBus Autofac 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The Autofac Container for the nservicebus - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe - + diff --git a/NuGet/NServiceBus.Azure/NServiceBus.Azure.nuspec b/NuGet/NServiceBus.Azure/NServiceBus.Azure.nuspec index a83304c1f0a..fb43079fe1a 100644 --- a/NuGet/NServiceBus.Azure/NServiceBus.Azure.nuspec +++ b/NuGet/NServiceBus.Azure/NServiceBus.Azure.nuspec @@ -4,20 +4,21 @@ NServiceBus Azure 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true Azure support for NServicebus - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe - - - + + + + @@ -25,6 +26,5 @@ - \ No newline at end of file diff --git a/NuGet/NServiceBus.CastleWindsor/NServiceBus.CastleWindsor.nuspec b/NuGet/NServiceBus.CastleWindsor/NServiceBus.CastleWindsor.nuspec index d3b8f8109c3..a5b9cafc108 100644 --- a/NuGet/NServiceBus.CastleWindsor/NServiceBus.CastleWindsor.nuspec +++ b/NuGet/NServiceBus.CastleWindsor/NServiceBus.CastleWindsor.nuspec @@ -4,18 +4,18 @@ NServiceBus CastleWindsor 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The CastleWindsor Container for the nservicebus - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe - + diff --git a/NuGet/NServiceBus.Host/NServiceBus.Host.nuspec b/NuGet/NServiceBus.Host/NServiceBus.Host.nuspec index 3958a5c4997..271af65768f 100644 --- a/NuGet/NServiceBus.Host/NServiceBus.Host.nuspec +++ b/NuGet/NServiceBus.Host/NServiceBus.Host.nuspec @@ -4,21 +4,23 @@ NServiceBus Host 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The hosting template for the nservicebus, The most popular open-source service bus for .net - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe + + \ No newline at end of file diff --git a/NuGet/NServiceBus.Host/content/EndpointConfig.cs.pp b/NuGet/NServiceBus.Host/content/EndpointConfig.cs.pp deleted file mode 100644 index 087216d9f76..00000000000 --- a/NuGet/NServiceBus.Host/content/EndpointConfig.cs.pp +++ /dev/null @@ -1,12 +0,0 @@ -namespace $rootnamespace$ -{ - using NServiceBus; - - /* - This class configures this endpoint as a Server. More information about how to configure the NServiceBus host - can be found here: http://particular.net/articles/profiles-for-nservicebus-host - */ - public class EndpointConfig : IConfigureThisEndpoint, AsA_Server - { - } -} \ No newline at end of file diff --git a/NuGet/NServiceBus.Host/content/app.config.transform b/NuGet/NServiceBus.Host/content/app.config.transform deleted file mode 100644 index 71320780d80..00000000000 --- a/NuGet/NServiceBus.Host/content/app.config.transform +++ /dev/null @@ -1,8 +0,0 @@ - - - -
    - - - - diff --git a/NuGet/NServiceBus.Host/tools/install.ps1 b/NuGet/NServiceBus.Host/tools/install.ps1 index c1bc87cc838..73a9ccff4b2 100644 --- a/NuGet/NServiceBus.Host/tools/install.ps1 +++ b/NuGet/NServiceBus.Host/tools/install.ps1 @@ -1,27 +1,66 @@ param($installPath, $toolsPath, $package, $project) - Add-BindingRedirect - - $project.Save() +if(!$toolsPath){ + $project = Get-Project +} +function Get-ConfigureThisEndpointClass($elem) { + + if ($elem.IsCodeType -and ($elem.Kind -eq [EnvDTE.vsCMElement]::vsCMElementClass)) + { + foreach ($e in $elem.ImplementedInterfaces) { + if($e.FullName -eq "NServiceBus.IConfigureThisEndpoint") { + return $elem + } + + return Get-ConfigureThisEndpointClass($e) + + } + } + elseif ($elem.Kind -eq [EnvDTE.vsCMElement]::vsCMElementNamespace) { + foreach ($e in $elem.Members) { + $temp = Get-ConfigureThisEndpointClass($e) + if($temp -ne $null) { + + return $temp + } + } + } - + $null +} + +function Test-HasConfigureThisEndpoint($project) { + + foreach ($item in $project.ProjectItems) { + foreach ($codeElem in $item.FileCodeModel.CodeElements) { + $elem = Get-ConfigureThisEndpointClass($codeElem) + if($elem -ne $null) { + return $true + } + } + } + + $false +} + +function Add-StartProgramIfNeeded { [xml] $prjXml = Get-Content $project.FullName foreach($PropertyGroup in $prjXml.project.ChildNodes) { - if($PropertyGroup.StartAction -ne $null) - { - Break - } + if($PropertyGroup.StartAction -ne $null) + { + return + } } $propertyGroupElement = $prjXml.CreateElement("PropertyGroup", $prjXml.Project.GetAttribute("xmlns")); $startActionElement = $prjXml.CreateElement("StartAction", $prjXml.Project.GetAttribute("xmlns")); - $propertyGroupElement.AppendChild($startActionElement) + $propertyGroupElement.AppendChild($startActionElement) | Out-Null $propertyGroupElement.StartAction = "Program" $startProgramElement = $prjXml.CreateElement("StartProgram", $prjXml.Project.GetAttribute("xmlns")); - $propertyGroupElement.AppendChild($startProgramElement) + $propertyGroupElement.AppendChild($startProgramElement) | Out-Null $propertyGroupElement.StartProgram = "`$(ProjectDir)`$(OutputPath)NServiceBus.Host.exe" - $prjXml.project.AppendChild($propertyGroupElement); + $prjXml.project.AppendChild($propertyGroupElement) | Out-Null $writerSettings = new-object System.Xml.XmlWriterSettings $writerSettings.OmitXmlDeclaration = $false $writerSettings.NewLineOnAttributes = $false @@ -31,4 +70,27 @@ param($installPath, $toolsPath, $package, $project) $prjXml.WriteTo($writer) $writer.Flush() $writer.Close() +} + +function Add-ConfigSettingIfRequired { + Add-NServiceBusMessageForwardingInCaseOfFaultConfig $project.Name + Add-NServiceBusUnicastBusConfig $project.Name +} + +function Add-EndpointConfigIfRequired { + $foundConfigureThisEndpoint = Test-HasConfigureThisEndpoint($project) + + if($foundConfigureThisEndpoint -eq $false) { + if (Get-Module T4Scaffolding) { + Scaffold EndpointConfig -Project $project.Name + } + } +} + +Add-EndpointConfigIfRequired + +Add-ConfigSettingIfRequired + +$project.Save() +Add-StartProgramIfNeeded diff --git a/NuGet/NServiceBus.Host32/NServiceBus.Host32.nuspec b/NuGet/NServiceBus.Host32/NServiceBus.Host32.nuspec index a88555014d7..77235e7e1fc 100644 --- a/NuGet/NServiceBus.Host32/NServiceBus.Host32.nuspec +++ b/NuGet/NServiceBus.Host32/NServiceBus.Host32.nuspec @@ -4,21 +4,23 @@ NServiceBus Host32 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The hosting template for the nservicebus, The most popular open-source service bus for .net - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe + + \ No newline at end of file diff --git a/NuGet/NServiceBus.Host32/content/EndpointConfig.cs.pp b/NuGet/NServiceBus.Host32/content/EndpointConfig.cs.pp deleted file mode 100644 index 087216d9f76..00000000000 --- a/NuGet/NServiceBus.Host32/content/EndpointConfig.cs.pp +++ /dev/null @@ -1,12 +0,0 @@ -namespace $rootnamespace$ -{ - using NServiceBus; - - /* - This class configures this endpoint as a Server. More information about how to configure the NServiceBus host - can be found here: http://particular.net/articles/profiles-for-nservicebus-host - */ - public class EndpointConfig : IConfigureThisEndpoint, AsA_Server - { - } -} \ No newline at end of file diff --git a/NuGet/NServiceBus.Host32/content/app.config.transform b/NuGet/NServiceBus.Host32/content/app.config.transform deleted file mode 100644 index 71320780d80..00000000000 --- a/NuGet/NServiceBus.Host32/content/app.config.transform +++ /dev/null @@ -1,8 +0,0 @@ - - - -
    - - - - diff --git a/NuGet/NServiceBus.Host32/tools/install.ps1 b/NuGet/NServiceBus.Host32/tools/install.ps1 index 36deb8d1227..134a56f6ff4 100644 --- a/NuGet/NServiceBus.Host32/tools/install.ps1 +++ b/NuGet/NServiceBus.Host32/tools/install.ps1 @@ -1,27 +1,66 @@ param($installPath, $toolsPath, $package, $project) - - Add-BindingRedirect - - $project.Save() + +if(!$toolsPath){ + $project = Get-Project +} +function Get-ConfigureThisEndpointClass($elem) { + + if ($elem.IsCodeType -and ($elem.Kind -eq [EnvDTE.vsCMElement]::vsCMElementClass)) + { + foreach ($e in $elem.ImplementedInterfaces) { + if($e.FullName -eq "NServiceBus.IConfigureThisEndpoint") { + return $elem + } + + return Get-ConfigureThisEndpointClass($e) + + } + } + elseif ($elem.Kind -eq [EnvDTE.vsCMElement]::vsCMElementNamespace) { + foreach ($e in $elem.Members) { + $temp = Get-ConfigureThisEndpointClass($e) + if($temp -ne $null) { + + return $temp + } + } + } - + $null +} + +function Test-HasConfigureThisEndpoint($project) { + + foreach ($item in $project.ProjectItems) { + foreach ($codeElem in $item.FileCodeModel.CodeElements) { + $elem = Get-ConfigureThisEndpointClass($codeElem) + if($elem -ne $null) { + return $true + } + } + } + + $false +} + +function Add-StartProgramIfNeeded { [xml] $prjXml = Get-Content $project.FullName foreach($PropertyGroup in $prjXml.project.ChildNodes) { - if($PropertyGroup.StartAction -ne $null) - { - Break - } + if($PropertyGroup.StartAction -ne $null) + { + return + } } $propertyGroupElement = $prjXml.CreateElement("PropertyGroup", $prjXml.Project.GetAttribute("xmlns")); $startActionElement = $prjXml.CreateElement("StartAction", $prjXml.Project.GetAttribute("xmlns")); - $propertyGroupElement.AppendChild($startActionElement) + $propertyGroupElement.AppendChild($startActionElement) | Out-Null $propertyGroupElement.StartAction = "Program" $startProgramElement = $prjXml.CreateElement("StartProgram", $prjXml.Project.GetAttribute("xmlns")); - $propertyGroupElement.AppendChild($startProgramElement) - $propertyGroupElement.StartProgram = "`$(ProjectDir)`$(OutputPath)NServiceBus.Host.exe" - $prjXml.project.AppendChild($propertyGroupElement); + $propertyGroupElement.AppendChild($startProgramElement) | Out-Null + $propertyGroupElement.StartProgram = "`$(ProjectDir)`$(OutputPath)NServiceBus.Host32.exe" + $prjXml.project.AppendChild($propertyGroupElement) | Out-Null $writerSettings = new-object System.Xml.XmlWriterSettings $writerSettings.OmitXmlDeclaration = $false $writerSettings.NewLineOnAttributes = $false @@ -31,4 +70,27 @@ param($installPath, $toolsPath, $package, $project) $prjXml.WriteTo($writer) $writer.Flush() $writer.Close() +} + +function Add-ConfigSettingIfRequired { + Add-NServiceBusMessageForwardingInCaseOfFaultConfig $project.Name + Add-NServiceBusUnicastBusConfig $project.Name +} + +function Add-EndpointConfigIfRequired { + $foundConfigureThisEndpoint = Test-HasConfigureThisEndpoint($project) + + if($foundConfigureThisEndpoint -eq $false) { + if (Get-Module T4Scaffolding) { + Scaffold EndpointConfig -Project $project.Name + } + } +} + +Add-EndpointConfigIfRequired + +Add-ConfigSettingIfRequired + +$project.Save() +Add-StartProgramIfNeeded diff --git a/NuGet/NServiceBus.Hosting.Azure.HostProcess/NServiceBus.Hosting.Azure.HostProcess.nuspec b/NuGet/NServiceBus.Hosting.Azure.HostProcess/NServiceBus.Hosting.Azure.HostProcess.nuspec index f2cb0dc8d78..292915cdafa 100644 --- a/NuGet/NServiceBus.Hosting.Azure.HostProcess/NServiceBus.Hosting.Azure.HostProcess.nuspec +++ b/NuGet/NServiceBus.Hosting.Azure.HostProcess/NServiceBus.Hosting.Azure.HostProcess.nuspec @@ -4,15 +4,15 @@ NServiceBus Hosting Azure HostProcess 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The process used when sharing an azure instance between multiple NServicebus endpoints - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe diff --git a/NuGet/NServiceBus.Hosting.Azure/NServiceBus.Hosting.Azure.nuspec b/NuGet/NServiceBus.Hosting.Azure/NServiceBus.Hosting.Azure.nuspec index 6ff2495e294..c4edefd88ba 100644 --- a/NuGet/NServiceBus.Hosting.Azure/NServiceBus.Hosting.Azure.nuspec +++ b/NuGet/NServiceBus.Hosting.Azure/NServiceBus.Hosting.Azure.nuspec @@ -4,15 +4,15 @@ NServiceBus Hosting Azure 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The Azure Host for NServicebus - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe diff --git a/NuGet/NServiceBus.Integration.WebServices/NServiceBus.Integration.WebServices.nuspec b/NuGet/NServiceBus.Integration.WebServices/NServiceBus.Integration.WebServices.nuspec deleted file mode 100644 index 035ed6282ad..00000000000 --- a/NuGet/NServiceBus.Integration.WebServices/NServiceBus.Integration.WebServices.nuspec +++ /dev/null @@ -1,24 +0,0 @@ - - - NServiceBus.Integration.WebServices - NServiceBus Integration WebServices - 4.0.0-alpha0 - NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing - http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png - true - The WebServices Integration for the nservicebus, The most popular open-source service bus for .net - - - Copyright (C) NServiceBus 2010-2012 - nservicebus servicebus msmq cqrs publish subscribe - - - - - - - - \ No newline at end of file diff --git a/NuGet/NServiceBus.Interfaces/NServiceBus.Interfaces.nuspec b/NuGet/NServiceBus.Interfaces/NServiceBus.Interfaces.nuspec index db1c29f336f..df315e9488f 100644 --- a/NuGet/NServiceBus.Interfaces/NServiceBus.Interfaces.nuspec +++ b/NuGet/NServiceBus.Interfaces/NServiceBus.Interfaces.nuspec @@ -4,15 +4,15 @@ NServiceBus Interfaces 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The Interfaces for NServiceBus Implementation - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe diff --git a/NuGet/NServiceBus.NHibernate/NServiceBus.NHibernate.nuspec b/NuGet/NServiceBus.NHibernate/NServiceBus.NHibernate.nuspec index f667bcf0e96..44072e6704c 100644 --- a/NuGet/NServiceBus.NHibernate/NServiceBus.NHibernate.nuspec +++ b/NuGet/NServiceBus.NHibernate/NServiceBus.NHibernate.nuspec @@ -4,18 +4,18 @@ NServiceBus NHibernate 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The NHibernate for the NServicebus - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe - + diff --git a/NuGet/NServiceBus.Ninject/NServiceBus.Ninject.nuspec b/NuGet/NServiceBus.Ninject/NServiceBus.Ninject.nuspec index 684d65777eb..f3a44a54bef 100644 --- a/NuGet/NServiceBus.Ninject/NServiceBus.Ninject.nuspec +++ b/NuGet/NServiceBus.Ninject/NServiceBus.Ninject.nuspec @@ -4,20 +4,20 @@ NServiceBus Ninject 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The Ninject Container for the nservicebus - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe - + diff --git a/NuGet/NServiceBus.Notifications/NServiceBus.Notifications.nuspec b/NuGet/NServiceBus.Notifications/NServiceBus.Notifications.nuspec new file mode 100644 index 00000000000..3653f6e35ff --- /dev/null +++ b/NuGet/NServiceBus.Notifications/NServiceBus.Notifications.nuspec @@ -0,0 +1,24 @@ + + + NServiceBus.Notifications + NServiceBus Notifications + 4.0.0-alpha0 + NServiceBus Ltd + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement + http://particular.net/ + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png + true + The Notifications component for the NServicebus + + + Copyright 2010-2013 NServiceBus. All rights reserved + nservicebus servicebus msmq cqrs publish subscribe + + + + + + + + \ No newline at end of file diff --git a/NuGet/NServiceBus.RabbitMQ/NServiceBus.RabbitMQ.nuspec b/NuGet/NServiceBus.RabbitMQ/NServiceBus.RabbitMQ.nuspec new file mode 100644 index 00000000000..56237427f24 --- /dev/null +++ b/NuGet/NServiceBus.RabbitMQ/NServiceBus.RabbitMQ.nuspec @@ -0,0 +1,25 @@ + + + NServiceBus.RabbitMQ + NServiceBus RabbitMQ + 4.0.0-alpha0 + NServiceBus Ltd + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement + http://particular.net/ + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png + true + RabbitMQ support for NServicebus + + + Copyright 2010-2013 NServiceBus. All rights reserved + nservicebus servicebus msmq cqrs publish subscribe + + + + + + + + + \ No newline at end of file diff --git a/NuGet/NServiceBus.RabbitMQ/tools/install.ps1 b/NuGet/NServiceBus.RabbitMQ/tools/install.ps1 new file mode 100644 index 00000000000..d6f9aaac85b --- /dev/null +++ b/NuGet/NServiceBus.RabbitMQ/tools/install.ps1 @@ -0,0 +1,3 @@ +param($installPath, $toolsPath, $package, $project) + +Add-BindingRedirect \ No newline at end of file diff --git a/NuGet/NServiceBus.Spring/NServiceBus.Spring.nuspec b/NuGet/NServiceBus.Spring/NServiceBus.Spring.nuspec index 02b4f156e62..0f0ed3739ed 100644 --- a/NuGet/NServiceBus.Spring/NServiceBus.Spring.nuspec +++ b/NuGet/NServiceBus.Spring/NServiceBus.Spring.nuspec @@ -4,18 +4,18 @@ NServiceBus Spring 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The Spring Container for the nservicebus - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe - + diff --git a/NuGet/NServiceBus.SqlServer/NServiceBus.SqlServer.nuspec b/NuGet/NServiceBus.SqlServer/NServiceBus.SqlServer.nuspec new file mode 100644 index 00000000000..61f220f109a --- /dev/null +++ b/NuGet/NServiceBus.SqlServer/NServiceBus.SqlServer.nuspec @@ -0,0 +1,24 @@ + + + NServiceBus.SqlServer + NServiceBus SqlServer + 4.0.0-alpha0 + NServiceBus Ltd + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement + http://particular.net/ + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png + true + SQL transport support for NServicebus + + + Copyright 2010-2013 NServiceBus. All rights reserved + nservicebus servicebus msmq cqrs publish subscribe + + + + + + + + \ No newline at end of file diff --git a/NuGet/NServiceBus.SqlServer/tools/install.ps1 b/NuGet/NServiceBus.SqlServer/tools/install.ps1 new file mode 100644 index 00000000000..d6f9aaac85b --- /dev/null +++ b/NuGet/NServiceBus.SqlServer/tools/install.ps1 @@ -0,0 +1,3 @@ +param($installPath, $toolsPath, $package, $project) + +Add-BindingRedirect \ No newline at end of file diff --git a/NuGet/NServiceBus.StructureMap/NServiceBus.StructureMap.nuspec b/NuGet/NServiceBus.StructureMap/NServiceBus.StructureMap.nuspec index f473f5352ea..d67442fd8e7 100644 --- a/NuGet/NServiceBus.StructureMap/NServiceBus.StructureMap.nuspec +++ b/NuGet/NServiceBus.StructureMap/NServiceBus.StructureMap.nuspec @@ -4,18 +4,18 @@ NServiceBus StructureMap 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The StructureMap Container for the nservicebus - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe - + diff --git a/NuGet/NServiceBus.Testing/NServiceBus.Testing.nuspec b/NuGet/NServiceBus.Testing/NServiceBus.Testing.nuspec index 1280aa98c08..50cd90b0d13 100644 --- a/NuGet/NServiceBus.Testing/NServiceBus.Testing.nuspec +++ b/NuGet/NServiceBus.Testing/NServiceBus.Testing.nuspec @@ -4,15 +4,15 @@ NServiceBus Testing 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The testing for the nservicebus, The most popular open-source service bus for .net - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe diff --git a/NuGet/NServiceBus.Timeout.Hosting.Azure/NServiceBus.Timeout.Hosting.Azure.nuspec b/NuGet/NServiceBus.Timeout.Hosting.Azure/NServiceBus.Timeout.Hosting.Azure.nuspec index 3e19f3a05ba..2c2df01ef82 100644 --- a/NuGet/NServiceBus.Timeout.Hosting.Azure/NServiceBus.Timeout.Hosting.Azure.nuspec +++ b/NuGet/NServiceBus.Timeout.Hosting.Azure/NServiceBus.Timeout.Hosting.Azure.nuspec @@ -4,15 +4,15 @@ NServiceBus Timeout Hosting Azure 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The Azure Host for the timeout manager on NServicebus - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe diff --git a/NuGet/NServiceBus.Unity/NServiceBus.Unity.nuspec b/NuGet/NServiceBus.Unity/NServiceBus.Unity.nuspec index 91e8f70bbef..7efbf1ac8b6 100644 --- a/NuGet/NServiceBus.Unity/NServiceBus.Unity.nuspec +++ b/NuGet/NServiceBus.Unity/NServiceBus.Unity.nuspec @@ -4,19 +4,19 @@ NServiceBus Unity 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The Unity Container for the nservicebus - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe - - + + diff --git a/NuGet/NServiceBus/NServiceBus.nuspec b/NuGet/NServiceBus/NServiceBus.nuspec index ba2ed73a0e2..b743823217a 100644 --- a/NuGet/NServiceBus/NServiceBus.nuspec +++ b/NuGet/NServiceBus/NServiceBus.nuspec @@ -4,15 +4,15 @@ NServiceBus 4.0.0-alpha0 NServiceBus Ltd - Udi Dahan, Andreas Ohlund, John Simons, Jonathan Matheus et al - http://particular.net/licensing + Udi Dahan, Andreas Ohlund, Jonathan Matheus, John Simons + http://particular.net/LicenseAgreement http://particular.net/ - http://particular.blob.core.windows.net/media/Default/images/ProductLogos/icons/NServiceBus_32.png + http://s3.amazonaws.com/nuget.images/NServiceBus_32.png true The most popular open-source service bus for .net - Copyright (C) NServiceBus 2010-2012 + Copyright 2010-2013 NServiceBus. All rights reserved nservicebus servicebus msmq cqrs publish subscribe @@ -20,13 +20,11 @@ - - - - + + - \ No newline at end of file + diff --git a/NuGet/NServiceBus/tools/about_NServiceBus.help.txt b/NuGet/NServiceBus/tools/about_NServiceBus.help.txt deleted file mode 100644 index 9b60391771c..00000000000 --- a/NuGet/NServiceBus/tools/about_NServiceBus.help.txt +++ /dev/null @@ -1,56 +0,0 @@ -TOPIC - about_NServiceBus - -SHORT DESCRIPTION - Provides information about NServiceBus commands. - -LONG DESCRIPTION - This topic describes the NServiceBus commands. NServiceBus is developer friendly - .NET ESB framework. - - The following NServiceBus cmdlets are included. - - Cmdlet Description - ----------------- ----------------------------------------------- - Install-License Install a NServiceBus license file into - HKCU\SOFTWARE\NServiceBus\[VERSION]. - - Get-Message Displays all messages in a queue. - - Get-NServiceBusVersion Displays the NServiceBus installed version. - - Install-Dtc Install DTC on the machine. - - Install-RavenDB Install RavenDB on the machine. - - Install-PerformanceCounters Install NServiceBus performance counters - on the machine. - - Install-Msmq Install MSMQ on the machine. - -Sample Commands - - To checks the status of the NServiceBus performance counters on this box: - - C:\PS> $countersAreInstalled = Install-PerformanceCounters -WhatIf - C:\PS> "PerformanceCounters is good: " + $countersAreInstalled - - To install RavenDB onto a specific path and listening on a different port: - - C:\PS> Install-RavenDB -Port 8888 -Installpath "C:\MyPath\Nservicebus.Persistence" - - A slight more complex NServiceBus retrieve message commands might resemble - the following command: - - C:\PS> Get-Message -QueueName result | select -ExpandProperty Headers | Where-Object{$_.Key -eq "NServiceBus.RelatedToTimeoutId" } - - The above command lists all messages that have a header with key "NServiceBus.RelatedToTimeoutId" - -SEE ALSO - Install-License - Get-Message - Get-NServiceBusVersion - Install-Dtc - Install-RavenDB - Install-PerformanceCounters - Install-Msmq \ No newline at end of file diff --git a/NuGet/NServiceBus/tools/init.ps1 b/NuGet/NServiceBus/tools/init.ps1 index d60dcca88c7..c839e912a6e 100644 --- a/NuGet/NServiceBus/tools/init.ps1 +++ b/NuGet/NServiceBus/tools/init.ps1 @@ -2,13 +2,18 @@ param($installPath, $toolsPath, $package, $project) #default to build dir when debugging if(!$toolsPath){ - $toolsPath = "..\..\NServiceBus.PowerShell\bin\Debug" + $toolsPath = "" } -Import-Module (Join-Path $toolsPath nservicebus.powershell.dll) +if (Get-Module NServiceBus.Powershell) { + Remove-Module NServiceBus.Powershell +} + +Import-Module (Join-Path $toolsPath NServiceBus.Powershell.dll) -Write-Host +Write-Host "" Write-Host "Type 'get-help about_NServiceBus' to see all available NServiceBus commands." +Write-Host "" $nserviceBusKeyPath = "HKCU:SOFTWARE\NServiceBus" $machinePreparedKey = "MachinePrepared" @@ -17,7 +22,7 @@ $nservicebusVersion = Get-NServiceBusVersion $nserviceBusVersionPath = $nserviceBusKeyPath + "\" + $nservicebusVersion.Major + "." + $nservicebusVersion.Minor #Figure out if this machine is properly setup -$a = get-itemproperty -path $nserviceBusVersionPath -ErrorAction silentlycontinue +$a = Get-ItemProperty -path $nserviceBusVersionPath -ErrorAction silentlycontinue $preparedInVersion = $a.psobject.properties | ?{ $_.Name -eq $machinePreparedKey } $dontCheckMachineSetup = $a.psobject.properties | ?{ $_.Name -eq "DontCheckMachineSetup" } @@ -30,30 +35,47 @@ if($machinePrepared -or $dontCheckMachineSetup.value) exit } -$perfCountersInstalled = Install-PerformanceCounters -WhatIf -$msmqInstalled = Install-Msmq -WhatIf -$dtcInstalled = Install-Dtc -WhatIf -$ravenDBInstalled = Install-RavenDB -WhatIf +$perfCountersInstalled = $false +$msmqInstalled = $false +$dtcInstalled = $false +$ravenDBInstalled = $false +try { + $perfCountersInstalled = Test-NServiceBusPerformanceCountersInstallation +} Catch [System.Security.SecurityException] { } +try { + $msmqInstalled = Test-NServiceBusMSMQInstallation +} Catch [System.Security.SecurityException] { } +try { + $dtcInstalled = Test-NServiceBusDTCInstallation +} Catch [System.Security.SecurityException] { } +try { + $ravenDBInstalled = Test-NServiceBusRavenDBInstallation + if(!$ravenDBInstalled) { + $ravenDBInstalled = Test-NServiceBusRavenDBInstallation -Port 8081 + } +} Catch [System.Security.SecurityException] { } if(!$perfCountersInstalled){ - Write-Verbose "Performance counters are not installed." + Write-Warning "Performance counters are not installed." } if(!$msmqInstalled){ - Write-Verbose "Msmq is not installed or correctly setup." + Write-Warning "Msmq is not installed or correctly setup." } if(!$dtcInstalled){ - Write-Verbose "DTC is not installed or started." + Write-Warning "DTC is not installed or started." } if(!$ravenDBInstalled){ - Write-Verbose "RavenDB is not installed." + Write-Warning "RavenDB is not installed. We checked port 8080 and 8081." } if($perfCountersInstalled -and $msmqInstalled -and $dtcInstalled -and $ravenDBInstalled){ - Write-Verbose "Required infrastructure is all setup correctly." - - New-Item -Path $nserviceBusVersionPath -Force | Out-Null - New-ItemProperty -Path $nserviceBusVersionPath -Name $machinePreparedKey -PropertyType String -Value "true" -Force | Out-Null - exit + Write-Host "Required infrastructure is all setup correctly." } -$dte.ExecuteCommand("View.URL", "http://particular.net/articles/preparing-your-machine-to-run-nservicebus?dtc=" + $dtcInstalled + "&msmq=" + $msmqInstalled + "&raven=" + $ravenDBInstalled + "&perfcounter=" + $perfCountersInstalled) \ No newline at end of file +New-Item -Path $nserviceBusVersionPath -ErrorAction silentlycontinue | Out-Null +New-ItemProperty -Path $nserviceBusVersionPath -Name $machinePreparedKey -PropertyType String -Value "true" | Out-Null + +$url = "http://particular.net/articles/preparing-your-machine-to-run-nservicebus?dtc=" + $dtcInstalled + "&msmq=" + $msmqInstalled + "&raven=" + $ravenDBInstalled + "&perfcounter=" + $perfCountersInstalled +$url = $url.ToLowerInvariant(); + +$dte.ExecuteCommand("View.URL", $url) \ No newline at end of file diff --git a/Nuget.ps1 b/Nuget.ps1 index df2f47e7584..235604fd7e9 100644 --- a/Nuget.ps1 +++ b/Nuget.ps1 @@ -1,7 +1,7 @@ properties { $ProductVersion = "4.0" $PatchVersion = "0" - $BuildNumber = if($env:BUILD_NUMBER -ne $null) { $env:BUILD_NUMBER } else { "0" } + $BuildNumber = "0" $PreRelease = "alpha" $NugetKey = "" $UploadPackage = $false @@ -25,23 +25,41 @@ task Clean { } task Pack { + + $v1Projects = @("NServiceBus.ActiveMQ.nuspec", "NServiceBus.RabbitMQ.nuspec", "NServiceBus.SqlServer.nuspec", "NServiceBus.Notifications.nuspec") + + $nsbVersion = $ProductVersion + "." + $PatchVersion + + if($PreRelease -ne '') { + $nsbVersion = "{0}.{1}-{2}{3}" -f $ProductVersion, $PatchVersion, $PreRelease, ($BuildNumber).PadLeft(4, '0') + } + (dir -Path $nugetTempPath -Recurse -Filter '*.nuspec') | foreach { Write-Host Creating NuGet spec file for $_.Name [xml] $nuspec = Get-Content $_.FullName - $nugetVersion = $ProductVersion + "." + $PatchVersion + if([System.Array]::IndexOf($v1Projects, $_.Name) -eq -1){ + $nugetVersion = $ProductVersion + "." + $PatchVersion + + if($PreRelease -ne '') { + $nuspec.package.metadata.title += ' (' + $PreRelease + ')' + $nugetVersion = "{0}.{1}-{2}{3}" -f $ProductVersion, $PatchVersion, $PreRelease, ($BuildNumber).PadLeft(4, '0') + } + } else { + $nugetVersion = "1.0.0" - if($PreRelease -ne '') { - $nuspec.package.metadata.title += ' (' + $PreRelease + ')' - $nugetVersion = $ProductVersion + "." + $PatchVersion + "-" + $PreRelease + $BuildNumber + if($PreRelease -ne '') { + $nuspec.package.metadata.title += ' (' + $PreRelease + ')' + $nugetVersion = "1.0.0-{0}{1}" -f $PreRelease, ($BuildNumber).PadLeft(4, '0') + } } $nuspec.package.metadata.version = $nugetVersion $nuspec | Select-Xml '//dependency[starts-with(@id, "NServiceBus")]' |% { - $_.Node.version = "[$nugetVersion]" + $_.Node.version = "[$nsbVersion]" } $nuspec | Select-Xml '//file[starts-with(@src, "\")]' |% { $_.Node.src = $baseDir + $_.Node.src diff --git a/README.md b/README.md new file mode 100644 index 00000000000..472ed7b6e96 --- /dev/null +++ b/README.md @@ -0,0 +1,176 @@ +## Building + +To build NServiceBus from source files you can either: +* Build using VS2012, open `NServiceBus.sln` +* Or build using Powershell by executing `build.bat` + +You'll find the built assemblies in /binaries. + +If you see the build failing, check that you haven't put the source of NServiceBus in a deep subdirectory since long path names (greater than 248 characters) aren't supported by MSBuild. + +## Running + +To run NServiceBus, please download and install the setup file from http://www.nservicebus.com/Downloads.aspx + +## Licenses + +NHibernate is licensed under the LGPL v2.1 license as described here: + +http://www.hibernate.org/license.html + +NHibernate binaries are merged into NServiceBus allowed under the LGPL license terms found here: + +http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt + +****************************** + + +LinFu is licensed under the LGPL v3 license as described here: + +http://code.google.com/p/linfu/ + +LinFu binaries are merged into NServiceBus allowed under the LGPL license terms found here: + +http://www.gnu.org/licenses/lgpl-3.0.txt + +****************************** + + +Iesi.Collections binaries are merged into NServiceBus allowed under the license terms found here: + +Copyright ? 2002-2004 by Aidant Systems, Inc., and by Jason Smith. + +Copied from http://www.codeproject.com/csharp/sets.asp#xx703510xx that was posted by JasonSmith 12:13 2 Jan '04 + +Feel free to use this code any way you want to. As a favor to me, you can leave the copyright in there. You never know when someone might recognize your name! + +If you do use the code in a commercial product, I would appreciate hearing about it. This message serves as legal notice that I won't be suing you for royalties! The code is in the public domain. + +On the other hand, I don't provide support. The code is actually simple enough that it shouldn't need it. + +****************************** + + +Fluent NHibernate is licensed under the BSD license as described here: + +http://github.com/jagregory/fluent-nhibernate/raw/master/LICENSE.txt + +Fluent NHibernate binaries are merged into NServiceBus allowed under the terms of the license. + +****************************** + + +Autofac is licensed under the MIT license as described here: + +http://code.google.com/p/autofac/ + +Autofac binaries are linked into the NServiceBus distribution allowed under the license terms found here: + +http://www.opensource.org/licenses/mit-license.php + +****************************** + +Spring.NET is licensed under the Apache license version 2.0 as described here: + +http://www.springframework.net/license.html + +Spring.NET binaries are merged into NServiceBus allowed under the license terms found here: + +http://www.apache.org/licenses/LICENSE-2.0.txt + +****************************** + + +Antlr is licensed under the BSD license as described here: + +http://antlr.org/license.html + +Antlr binaries are merged into NServiceBus allowed under the license terms described above. + +****************************** + + +Common.Logging is licensed under the Apache License, Version 2.0 as described here: + +http://netcommon.sourceforge.net/license.html + +Common.Logging binaries are merged into NServiceBus allowed under the LGPL license terms found here: + +http://www.apache.org/licenses/LICENSE-2.0.txt + +****************************** + + +StructureMap is licensed under the Apache License, Version 2.0 as described here: + +http://structuremap.github.com/structuremap/index.html + +StructureMap baries are linked into the NServiceBus distribution allowed under the license terms found here: + +http://www.apache.org/licenses/LICENSE-2.0.txt + +****************************** + + +Castle is licensed under the Apache License, Version 2.0 as described here: + +http://www.castleproject.org/ + +Castle binaries are linked into the NServiceBus distribution allowed under the license terms found here: + +http://www.apache.org/licenses/LICENSE-2.0.txt + +****************************** + + +Unity is licensed under the MSPL license as described here: + +http://unity.codeplex.com/license + +Unity binaries are linked into the NServiceBus distribution allowed under the license terms described above. + +****************************** + + +Log4Net is licensed under the Apache License, Version 2.0 as described here: + +http://logging.apache.org/log4net/license.html + +Log4Net binaries are linked into the NServiceBus distribution allowed under the license terms described above. + +****************************** + + +TopShelf is licensed under the Apache License, Version 2.0 as described here: + +http://code.google.com/p/topshelf/ + +TopShelf binaries are merged into NServiceBus as allowed under the license terms described here: + +http://www.apache.org/licenses/LICENSE-2.0.txt + +****************************** + + +Rhino Mocks is licensed under the BSD License as described here: + +http://www.ayende.com/projects/rhino-mocks.aspx + +Rhino Mocks binaries are merged into NServiceBus allowed under the license terms described here: + +http://www.opensource.org/licenses/bsd-license.php + +****************************** + +RavenDB is under both a OSS and a commercial license described here + +http://ravendb.net/licensing + +The commercial version can be used free of charge for NServiceBus specific storage needs like: + +Subscriptions, Sagas, Timeouts, etc + +Application specific use requires a paid RavenDB license + +RavenDB binaries are linked into the NServiceBus distribution allowed under the license terms described above. + diff --git a/RunMeFirst.bat b/RunMeFirst.bat deleted file mode 100644 index 1206576df9c..00000000000 --- a/RunMeFirst.bat +++ /dev/null @@ -1,36 +0,0 @@ -echo off -md .\binaries\temp -copy .\binaries\log4net.dll .\binaries\temp\log4net.dll -copy .\binaries\NServiceBus.Core.dll .\binaries\temp\NServiceBus.Core.dll -copy .\binaries\NServiceBus.dll .\binaries\temp\NServiceBus.dll -copy .\binaries\NServiceBus.Host.exe .\binaries\temp\NServiceBus.Host.exe -.\binaries\temp\NServiceBus.Host.exe /installInfrastructure -rd /s /q .\binaries\temp - - -if "%ProgramFiles(x86)%XXX"=="XXX" ( -set ProgRoot="%ProgramFiles%" -) else ( -set ProgRoot="%ProgramFiles(x86)%" -) -for /f "delims=" %%a in (%ProgRoot%) do set ProgRoot=%%~a - -set nugetfound=false -set CommonExtensionPath=%ProgRoot%\Microsoft Visual Studio 10.0\Common7\IDE\Extensions -set LocalExtensionPath=%localappdata%\Microsoft\VisualStudio\10.0\Extensions - - -IF EXIST "%CommonExtensionPath%\Microsoft Corporation\NuGet Package Manager" set nugetfound=true -IF EXIST "%LocalExtensionPath%\Microsoft\NuGet Package Manager" set nugetfound=true - -IF %nugetfound%==false ECHO NuGet extension for visual studio is a prerequisite for the NServiceBus modeling tools. Please install the nuget extension manually - http://visualstudiogallery.msdn.microsoft.com/27077b70-9dad-4c64-adcf-c7cf6bc9970c?SRC=Home - - -set nsbstudioinstalled=false -IF EXIST "%CommonExtensionPath%\NServiceBus\NServiceBus Studio" set nsbstudioinstalled=true -IF EXIST "%LocalExtensionPath%\NServiceBus\NServiceBus Studio" set nsbstudioinstalled=true - -IF %nsbstudioinstalled%==false .\tools\NServiceBusStudio.vsix -IF %nsbstudioinstalled%==true ECHO NServiceBus studio already installed - Please visit the visual studio gallery to make sure that you have the latest version - - diff --git a/Samples/AsyncPages/AsyncPages.sln b/Samples/AsyncPages/AsyncPages.sln deleted file mode 100644 index 1833e370d14..00000000000 --- a/Samples/AsyncPages/AsyncPages.sln +++ /dev/null @@ -1,36 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApplication1", "WebApplication1\WebApplication1.csproj", "{562F1C2D-8279-482D-8474-30CDE9EE3269}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Messages", "Messages\Messages.csproj", "{0F1A46A2-D1CE-4DB1-9E75-45D41CCA7EA7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{C9491F30-6CCA-41D5-A9E6-1DC8758C4BE1}" -EndProject -Global - GlobalSection(SubversionScc) = preSolution - Svn-Managed = True - Manager = AnkhSVN - Subversion Support for Visual Studio - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {562F1C2D-8279-482D-8474-30CDE9EE3269}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {562F1C2D-8279-482D-8474-30CDE9EE3269}.Debug|Any CPU.Build.0 = Debug|Any CPU - {562F1C2D-8279-482D-8474-30CDE9EE3269}.Release|Any CPU.ActiveCfg = Release|Any CPU - {562F1C2D-8279-482D-8474-30CDE9EE3269}.Release|Any CPU.Build.0 = Release|Any CPU - {0F1A46A2-D1CE-4DB1-9E75-45D41CCA7EA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0F1A46A2-D1CE-4DB1-9E75-45D41CCA7EA7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0F1A46A2-D1CE-4DB1-9E75-45D41CCA7EA7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0F1A46A2-D1CE-4DB1-9E75-45D41CCA7EA7}.Release|Any CPU.Build.0 = Release|Any CPU - {C9491F30-6CCA-41D5-A9E6-1DC8758C4BE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C9491F30-6CCA-41D5-A9E6-1DC8758C4BE1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C9491F30-6CCA-41D5-A9E6-1DC8758C4BE1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C9491F30-6CCA-41D5-A9E6-1DC8758C4BE1}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Samples/AsyncPages/AsyncPages.suo b/Samples/AsyncPages/AsyncPages.suo deleted file mode 100644 index 504b556c76e..00000000000 Binary files a/Samples/AsyncPages/AsyncPages.suo and /dev/null differ diff --git a/Samples/AsyncPages/Messages/Command.cs b/Samples/AsyncPages/Messages/Command.cs deleted file mode 100644 index be564d830cb..00000000000 --- a/Samples/AsyncPages/Messages/Command.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using NServiceBus; - -namespace Messages -{ - [Serializable] - public class Command : IMessage - { - public int Id { get; set; } - } -} \ No newline at end of file diff --git a/Samples/AsyncPages/Messages/Messages.csproj b/Samples/AsyncPages/Messages/Messages.csproj deleted file mode 100644 index 34d47a89301..00000000000 --- a/Samples/AsyncPages/Messages/Messages.csproj +++ /dev/null @@ -1,95 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {0F1A46A2-D1CE-4DB1-9E75-45D41CCA7EA7} - Library - Properties - Messages - Messages - - - - - - v4.0 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - - 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/Samples/AsyncPages/Messages/Properties/AssemblyInfo.cs b/Samples/AsyncPages/Messages/Properties/AssemblyInfo.cs deleted file mode 100644 index eaafe2c314d..00000000000 --- a/Samples/AsyncPages/Messages/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Messages")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Messages")] -[assembly: AssemblyCopyright("Copyright © 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("58f0c0ae-d27c-4548-886b-077b7cab2376")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/AsyncPages/Server/App.config b/Samples/AsyncPages/Server/App.config deleted file mode 100644 index 4e265ff88b4..00000000000 --- a/Samples/AsyncPages/Server/App.config +++ /dev/null @@ -1,13 +0,0 @@ - - - -
    - - - - - - diff --git a/Samples/AsyncPages/Server/CommandMessageHandler.cs b/Samples/AsyncPages/Server/CommandMessageHandler.cs deleted file mode 100644 index 8b153ca7a77..00000000000 --- a/Samples/AsyncPages/Server/CommandMessageHandler.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Messages; -using NServiceBus; -using System.Threading; -using System; - -namespace Server -{ - public class CommandMessageHandler : IHandleMessages - { - - /// - /// The handler is using the new IHandleMessages<T> extension method of the Bus(). - /// Hence, there is no need to declare on a IBus interface property to be injected. - /// - /// - public void Handle(Command message) - { - Console.WriteLine("======================================================================"); - - Thread.Sleep(TimeSpan.FromSeconds(1)); - - if (message.Id % 2 == 0) - this.Bus().Return(ErrorCodes.Fail); - else - this.Bus().Return(ErrorCodes.None); - } - } -} diff --git a/Samples/AsyncPages/Server/MessageEndpoint.cs b/Samples/AsyncPages/Server/MessageEndpoint.cs deleted file mode 100644 index f225d68dac0..00000000000 --- a/Samples/AsyncPages/Server/MessageEndpoint.cs +++ /dev/null @@ -1,9 +0,0 @@ -using NServiceBus; - -namespace Server -{ - public class MessageEndpoint : IConfigureThisEndpoint, AsA_Server - { - } - -} \ No newline at end of file diff --git a/Samples/AsyncPages/Server/Properties/AssemblyInfo.cs b/Samples/AsyncPages/Server/Properties/AssemblyInfo.cs deleted file mode 100644 index e1c67ec7577..00000000000 --- a/Samples/AsyncPages/Server/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Server")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Server")] -[assembly: AssemblyCopyright("Copyright © 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6d0a1864-1cf8-4f8a-90ae-bc3fda6179d9")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/AsyncPages/Server/Server.csproj b/Samples/AsyncPages/Server/Server.csproj deleted file mode 100644 index 6651e5d1e14..00000000000 --- a/Samples/AsyncPages/Server/Server.csproj +++ /dev/null @@ -1,116 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C9491F30-6CCA-41D5-A9E6-1DC8758C4BE1} - Library - Properties - Server - Server - - - - - v4.0 - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - - Designer - - - - - {0F1A46A2-D1CE-4DB1-9E75-45D41CCA7EA7} - Messages %28Samples\AsyncPages\Messages%29 - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - AllRules.ruleset - - \ No newline at end of file diff --git a/Samples/AsyncPages/WebApplication1/Default.aspx b/Samples/AsyncPages/WebApplication1/Default.aspx deleted file mode 100644 index 4b4fd5798fa..00000000000 --- a/Samples/AsyncPages/WebApplication1/Default.aspx +++ /dev/null @@ -1,21 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" Async="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %> - - - - - - Untitled Page - - -
    -
    - Enter a number below and click "Go".
    - If the number is even, the result will be "Fail", otherwise it will be "None". -

    - - - -
    - - - diff --git a/Samples/AsyncPages/WebApplication1/Default.aspx.cs b/Samples/AsyncPages/WebApplication1/Default.aspx.cs deleted file mode 100644 index 547a2808b23..00000000000 --- a/Samples/AsyncPages/WebApplication1/Default.aspx.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Web.UI; -using Messages; -using NServiceBus; - -namespace WebApplication1 -{ - public partial class _Default : Page - { - protected void Button1_Click(object sender, EventArgs e) - { - int number = int.Parse(TextBox1.Text); - var command = new Command { Id = number }; - - Global.Bus.Send(command).Register( - code => Label1.Text = Enum.GetName(typeof (ErrorCodes), code) - ); - } - - } -} diff --git a/Samples/AsyncPages/WebApplication1/Default.aspx.designer.cs b/Samples/AsyncPages/WebApplication1/Default.aspx.designer.cs deleted file mode 100644 index 9099f0c9c80..00000000000 --- a/Samples/AsyncPages/WebApplication1/Default.aspx.designer.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace WebApplication1 { - - - public partial class _Default { - - /// - /// form1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// - /// TextBox1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox TextBox1; - - /// - /// Button1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button Button1; - - /// - /// Label1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label Label1; - } -} diff --git a/Samples/AsyncPages/WebApplication1/Global.asax b/Samples/AsyncPages/WebApplication1/Global.asax deleted file mode 100644 index 7ac710aba21..00000000000 --- a/Samples/AsyncPages/WebApplication1/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="WebApplication1.Global" Language="C#" %> diff --git a/Samples/AsyncPages/WebApplication1/Global.asax.cs b/Samples/AsyncPages/WebApplication1/Global.asax.cs deleted file mode 100644 index 42fdbc063e3..00000000000 --- a/Samples/AsyncPages/WebApplication1/Global.asax.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Web; -using NServiceBus; - -namespace WebApplication1 -{ - public class Global : HttpApplication - { - public static IBus Bus { get; private set; } - - protected void Application_Start(object sender, EventArgs e) - { - Bus = Configure.With() - .Log4Net() - .DefaultBuilder() - .XmlSerializer() - .MsmqTransport() - .IsTransactional(false) - .PurgeOnStartup(false) - .UnicastBus() - .ImpersonateSender(false) - .CreateBus() - .Start(() => Configure.Instance.ForInstallationOn().Install()); - } - - protected void Application_End(object sender, EventArgs e) - { - - } - } -} \ No newline at end of file diff --git a/Samples/AsyncPages/WebApplication1/Properties/AssemblyInfo.cs b/Samples/AsyncPages/WebApplication1/Properties/AssemblyInfo.cs deleted file mode 100644 index d5224c73902..00000000000 --- a/Samples/AsyncPages/WebApplication1/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("WebApplication1")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("WebApplication1")] -[assembly: AssemblyCopyright("Copyright © 2007")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3d5900ae-111a-45be-96b3-d9e4606ca793")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/AsyncPages/WebApplication1/Properties/Settings.Designer.cs b/Samples/AsyncPages/WebApplication1/Properties/Settings.Designer.cs deleted file mode 100644 index 08aac96f53b..00000000000 --- a/Samples/AsyncPages/WebApplication1/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.1 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace WebApplication1.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/Samples/AsyncPages/WebApplication1/Properties/Settings.settings b/Samples/AsyncPages/WebApplication1/Properties/Settings.settings deleted file mode 100644 index 8e615f25fdc..00000000000 --- a/Samples/AsyncPages/WebApplication1/Properties/Settings.settings +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Samples/AsyncPages/WebApplication1/WebApplication1.csproj b/Samples/AsyncPages/WebApplication1/WebApplication1.csproj deleted file mode 100644 index 5cbcbd53f17..00000000000 --- a/Samples/AsyncPages/WebApplication1/WebApplication1.csproj +++ /dev/null @@ -1,128 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {562F1C2D-8279-482D-8474-30CDE9EE3269} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - WebApplication1 - WebApplication1 - - - - - - v4.0 - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - - - - - - - - - - - - - - - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - - - - - ASPXCodeBehind - Default.aspx - - - Default.aspx - - - Global.asax - - - - True - True - Settings.settings - - - - - {0F1A46A2-D1CE-4DB1-9E75-45D41CCA7EA7} - Messages %28Samples\AsyncPages\Messages%29 - - - - - - - - - - False - True - 21943 - / - - - False - False - - - False - - - - - \ No newline at end of file diff --git a/Samples/AsyncPages/WebApplication1/WebApplication1.csproj.user b/Samples/AsyncPages/WebApplication1/WebApplication1.csproj.user deleted file mode 100644 index d80ba5b31b4..00000000000 --- a/Samples/AsyncPages/WebApplication1/WebApplication1.csproj.user +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - CurrentPage - True - False - False - False - - - - - - - - - False - True - - - - - \ No newline at end of file diff --git a/Samples/AsyncPages/WebApplication1/web.config b/Samples/AsyncPages/WebApplication1/web.config deleted file mode 100644 index a37396186c7..00000000000 --- a/Samples/AsyncPages/WebApplication1/web.config +++ /dev/null @@ -1,96 +0,0 @@ - - - -
    -
    - - -
    - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3.sln b/Samples/AsyncPagesMVC3/AsyncPagesMVC3.sln deleted file mode 100644 index 02bf4c4fd25..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3.sln +++ /dev/null @@ -1,32 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AsyncPagesMVC3", "AsyncPagesMVC3\AsyncPagesMVC3.csproj", "{2584A71C-FA6F-41A1-B486-F56E4C18905B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Messages", "Messages\Messages.csproj", "{B363FF88-1C00-4FB6-A22E-44E2FB754944}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{A3BB0A47-13FE-4021-B4E2-5453CB73753A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2584A71C-FA6F-41A1-B486-F56E4C18905B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2584A71C-FA6F-41A1-B486-F56E4C18905B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2584A71C-FA6F-41A1-B486-F56E4C18905B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2584A71C-FA6F-41A1-B486-F56E4C18905B}.Release|Any CPU.Build.0 = Release|Any CPU - {B363FF88-1C00-4FB6-A22E-44E2FB754944}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B363FF88-1C00-4FB6-A22E-44E2FB754944}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B363FF88-1C00-4FB6-A22E-44E2FB754944}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B363FF88-1C00-4FB6-A22E-44E2FB754944}.Release|Any CPU.Build.0 = Release|Any CPU - {A3BB0A47-13FE-4021-B4E2-5453CB73753A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A3BB0A47-13FE-4021-B4E2-5453CB73753A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A3BB0A47-13FE-4021-B4E2-5453CB73753A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A3BB0A47-13FE-4021-B4E2-5453CB73753A}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3.suo b/Samples/AsyncPagesMVC3/AsyncPagesMVC3.suo deleted file mode 100644 index 91661dae3be..00000000000 Binary files a/Samples/AsyncPagesMVC3/AsyncPagesMVC3.suo and /dev/null differ diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.csproj b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.csproj deleted file mode 100644 index e8e6be7d356..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.csproj +++ /dev/null @@ -1,127 +0,0 @@ - - - - Debug - AnyCPU - - - 2.0 - {2584A71C-FA6F-41A1-B486-F56E4C18905B} - {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - AsyncPagesMVC3 - AsyncPagesMVC3 - v4.0 - false - false - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - ..\..\..\packages\EntityFramework.4.1.10715.0\lib\EntityFramework.dll - - - - ..\..\..\binaries\NServiceBus.dll - - - ..\..\..\binaries\NServiceBus.Core.dll - - - - - - - ..\..\..\lib\Mvc3\System.Web.Mvc.dll - - - - - - - - - Global.asax - - - - - - - - - - Designer - - - Web.config - - - Web.config - - - - - - - - - - - - - {B363FF88-1C00-4FB6-A22E-44E2FB754944} - Messages - - - - - - - - - - - - - - - - False - True - 49214 - / - - - False - False - - - False - - - - - \ No newline at end of file diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.accordion.css b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.accordion.css deleted file mode 100644 index 327beb50e80..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.accordion.css +++ /dev/null @@ -1,19 +0,0 @@ -/* - * jQuery UI Accordion 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Accordion#theming - */ -/* IE/Win - Fix animation bug - #4615 */ -.ui-accordion { width: 100%; } -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } -.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } -.ui-accordion .ui-accordion-content-active { display: block; } diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.all.css b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.all.css deleted file mode 100644 index bf68bc41e0a..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.all.css +++ /dev/null @@ -1,11 +0,0 @@ -/* - * jQuery UI CSS Framework 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming - */ -@import "jquery.ui.base.css"; -@import "jquery.ui.theme.css"; diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.autocomplete.css b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.autocomplete.css deleted file mode 100644 index 6de68673673..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.autocomplete.css +++ /dev/null @@ -1,53 +0,0 @@ -/* - * jQuery UI Autocomplete 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Autocomplete#theming - */ -.ui-autocomplete { position: absolute; cursor: default; } - -/* workarounds */ -* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ - -/* - * jQuery UI Menu 1.8.16 - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Menu#theming - */ -.ui-menu { - list-style:none; - padding: 2px; - margin: 0; - display:block; - float: left; -} -.ui-menu .ui-menu { - margin-top: -3px; -} -.ui-menu .ui-menu-item { - margin:0; - padding: 0; - zoom: 1; - float: left; - clear: left; - width: 100%; -} -.ui-menu .ui-menu-item a { - text-decoration:none; - display:block; - padding:.2em .4em; - line-height:1.5; - zoom:1; -} -.ui-menu .ui-menu-item a.ui-state-hover, -.ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: -1px; -} diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.base.css b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.base.css deleted file mode 100644 index 209c24f30f4..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.base.css +++ /dev/null @@ -1,21 +0,0 @@ -/* - * jQuery UI CSS Framework 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming - */ -@import url("jquery.ui.core.css"); - -@import url("jquery.ui.accordion.css"); -@import url("jquery.ui.autocomplete.css"); -@import url("jquery.ui.button.css"); -@import url("jquery.ui.datepicker.css"); -@import url("jquery.ui.dialog.css"); -@import url("jquery.ui.progressbar.css"); -@import url("jquery.ui.resizable.css"); -@import url("jquery.ui.selectable.css"); -@import url("jquery.ui.slider.css"); -@import url("jquery.ui.tabs.css"); diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.button.css b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.button.css deleted file mode 100644 index 31c79f9c4e2..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.button.css +++ /dev/null @@ -1,38 +0,0 @@ -/* - * jQuery UI Button 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Button#theming - */ -.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ -.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ -button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ -.ui-button-icons-only { width: 3.4em; } -button.ui-button-icons-only { width: 3.7em; } - -/*button text element */ -.ui-button .ui-button-text { display: block; line-height: 1.4; } -.ui-button-text-only .ui-button-text { padding: .4em 1em; } -.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } -.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } -.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } -.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } -/* no icon support for input elements, provide padding by default */ -input.ui-button { padding: .4em 1em; } - -/*button icon element(s) */ -.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } -.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } -.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } -.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } -.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } - -/*button sets*/ -.ui-buttonset { margin-right: 7px; } -.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } - -/* workarounds */ -button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.core.css b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.core.css deleted file mode 100644 index 375d4ad92dd..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.core.css +++ /dev/null @@ -1,41 +0,0 @@ -/* - * jQuery UI CSS Framework 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - */ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } -.ui-helper-clearfix { display: inline-block; } -/* required comment for clearfix to work in Opera \*/ -* html .ui-helper-clearfix { height:1%; } -.ui-helper-clearfix { display:block; } -/* end clearfix */ -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.datepicker.css b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.datepicker.css deleted file mode 100644 index 28efc946927..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.datepicker.css +++ /dev/null @@ -1,68 +0,0 @@ -/* - * jQuery UI Datepicker 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Datepicker#theming - */ -.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -} \ No newline at end of file diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.dialog.css b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.dialog.css deleted file mode 100644 index 1b95d7f4dc4..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.dialog.css +++ /dev/null @@ -1,21 +0,0 @@ -/* - * jQuery UI Dialog 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Dialog#theming - */ -.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } -.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } -.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.progressbar.css b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.progressbar.css deleted file mode 100644 index e885ced6c87..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.progressbar.css +++ /dev/null @@ -1,11 +0,0 @@ -/* - * jQuery UI Progressbar 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Progressbar#theming - */ -.ui-progressbar { height:2em; text-align: left; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.resizable.css b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.resizable.css deleted file mode 100644 index dc706797ffa..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.resizable.css +++ /dev/null @@ -1,20 +0,0 @@ -/* - * jQuery UI Resizable 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Resizable#theming - */ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; } -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;} \ No newline at end of file diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.selectable.css b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.selectable.css deleted file mode 100644 index 2d505fbfe5d..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.selectable.css +++ /dev/null @@ -1,10 +0,0 @@ -/* - * jQuery UI Selectable 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Selectable#theming - */ -.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.slider.css b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.slider.css deleted file mode 100644 index 982f42c589c..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.slider.css +++ /dev/null @@ -1,24 +0,0 @@ -/* - * jQuery UI Slider 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Slider#theming - */ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; } \ No newline at end of file diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.tabs.css b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.tabs.css deleted file mode 100644 index 84d27b82c85..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.tabs.css +++ /dev/null @@ -1,18 +0,0 @@ -/* - * jQuery UI Tabs 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Tabs#theming - */ -.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ -.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } -.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.theme.css b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.theme.css deleted file mode 100644 index 1f6c8f2df6a..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Content/themes/base/jquery.ui.theme.css +++ /dev/null @@ -1,247 +0,0 @@ -/* - * jQuery UI CSS Framework 1.8.16 - * - * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - * - * To view and modify this theme, visit http://jqueryui.com/themeroller/ - */ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1.1em/*{fsDefault}*/; } -.ui-widget .ui-widget { font-size: 1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif/*{ffDefault}*/; font-size: 1em; } -.ui-widget-content { border: 1px solid #aaaaaa/*{borderColorContent}*/; background: #ffffff/*{bgColorContent}*/ url(images/ui-bg_flat_75_ffffff_40x100.png)/*{bgImgUrlContent}*/ 50%/*{bgContentXPos}*/ 50%/*{bgContentYPos}*/ repeat-x/*{bgContentRepeat}*/; color: #222222/*{fcContent}*/; } -.ui-widget-content a { color: #222222/*{fcContent}*/; } -.ui-widget-header { border: 1px solid #aaaaaa/*{borderColorHeader}*/; background: #cccccc/*{bgColorHeader}*/ url(images/ui-bg_highlight-soft_75_cccccc_1x100.png)/*{bgImgUrlHeader}*/ 50%/*{bgHeaderXPos}*/ 50%/*{bgHeaderYPos}*/ repeat-x/*{bgHeaderRepeat}*/; color: #222222/*{fcHeader}*/; font-weight: bold; } -.ui-widget-header a { color: #222222/*{fcHeader}*/; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; } -.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; } -.ui-widget :active { outline: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1/*{borderColorHighlight}*/; background: #fbf9ee/*{bgColorHighlight}*/ url(images/ui-bg_glass_55_fbf9ee_1x400.png)/*{bgImgUrlHighlight}*/ 50%/*{bgHighlightXPos}*/ 50%/*{bgHighlightYPos}*/ repeat-x/*{bgHighlightRepeat}*/; color: #363636/*{fcHighlight}*/; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636/*{fcHighlight}*/; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a/*{borderColorError}*/; background: #fef1ec/*{bgColorError}*/ url(images/ui-bg_glass_95_fef1ec_1x400.png)/*{bgImgUrlError}*/ 50%/*{bgErrorXPos}*/ 50%/*{bgErrorYPos}*/ repeat-x/*{bgErrorRepeat}*/; color: #cd0a0a/*{fcError}*/; } -.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a/*{fcError}*/; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a/*{fcError}*/; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } -.ui-widget-content .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsContent}*/; } -.ui-widget-header .ui-icon {background-image: url(images/ui-icons_222222_256x240.png)/*{iconsHeader}*/; } -.ui-state-default .ui-icon { background-image: url(images/ui-icons_888888_256x240.png)/*{iconsDefault}*/; } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsHover}*/; } -.ui-state-active .ui-icon {background-image: url(images/ui-icons_454545_256x240.png)/*{iconsActive}*/; } -.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png)/*{iconsHighlight}*/; } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png)/*{iconsError}*/; } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-start { background-position: -80px -160px; } -/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px/*{cornerRadius}*/; -webkit-border-top-left-radius: 4px/*{cornerRadius}*/; -khtml-border-top-left-radius: 4px/*{cornerRadius}*/; border-top-left-radius: 4px/*{cornerRadius}*/; } -.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px/*{cornerRadius}*/; -webkit-border-top-right-radius: 4px/*{cornerRadius}*/; -khtml-border-top-right-radius: 4px/*{cornerRadius}*/; border-top-right-radius: 4px/*{cornerRadius}*/; } -.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px/*{cornerRadius}*/; -webkit-border-bottom-left-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-left-radius: 4px/*{cornerRadius}*/; border-bottom-left-radius: 4px/*{cornerRadius}*/; } -.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px/*{cornerRadius}*/; -webkit-border-bottom-right-radius: 4px/*{cornerRadius}*/; -khtml-border-bottom-right-radius: 4px/*{cornerRadius}*/; border-bottom-right-radius: 4px/*{cornerRadius}*/; } - -/* Overlays */ -.ui-widget-overlay { background: #aaaaaa/*{bgColorOverlay}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlOverlay}*/ 50%/*{bgOverlayXPos}*/ 50%/*{bgOverlayYPos}*/ repeat-x/*{bgOverlayRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityOverlay}*/; } -.ui-widget-shadow { margin: -8px/*{offsetTopShadow}*/ 0 0 -8px/*{offsetLeftShadow}*/; padding: 8px/*{thicknessShadow}*/; background: #aaaaaa/*{bgColorShadow}*/ url(images/ui-bg_flat_0_aaaaaa_40x100.png)/*{bgImgUrlShadow}*/ 50%/*{bgShadowXPos}*/ 50%/*{bgShadowYPos}*/ repeat-x/*{bgShadowRepeat}*/; opacity: .3;filter:Alpha(Opacity=30)/*{opacityShadow}*/; -moz-border-radius: 8px/*{cornerRadiusShadow}*/; -khtml-border-radius: 8px/*{cornerRadiusShadow}*/; -webkit-border-radius: 8px/*{cornerRadiusShadow}*/; border-radius: 8px/*{cornerRadiusShadow}*/; } \ No newline at end of file diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Controllers/HomeController.cs b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Controllers/HomeController.cs deleted file mode 100644 index 46bd22d0201..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Controllers/HomeController.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Web.Mvc; - -namespace AsyncPagesMVC3.Controllers -{ - public class HomeController : Controller - { - // - // GET: /Home/ - - public ActionResult SendLinks() - { - return View(); - } - - } -} diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Controllers/SendAndBlockController.cs b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Controllers/SendAndBlockController.cs deleted file mode 100644 index a73c55f3d28..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Controllers/SendAndBlockController.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Threading; -using System.Web.Mvc; -using Messages; -using NServiceBus; - -namespace AsyncPagesMVC3.Controllers -{ - public class SendAndBlockController : Controller - { - // Bus property to be injected - public IBus Bus { get; set; } - - [HttpGet] - public ActionResult Index() - { - ViewBag.Title = "SendAndBlock"; - return View(); - } - - [HttpPost] - public ActionResult Index(string textField) - { - ViewBag.Title = "SendAndBlock"; - - int number; - if (!int.TryParse(textField, out number)) - return View(); - - var command = new Command { Id = number }; - - IAsyncResult res = Bus.Send(command).Register(SimpleCommandCallback, this); - WaitHandle asyncWaitHandle = res.AsyncWaitHandle; - asyncWaitHandle.WaitOne(50000); - - return View(); - } - - private void SimpleCommandCallback(IAsyncResult asyncResult) - { - var result = asyncResult.AsyncState as CompletionResult; - var controller = result.State as SendAndBlockController; - controller.ViewBag.ResponseText = Enum.GetName(typeof (ErrorCodes), result.ErrorCode); - } - - } -} diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Controllers/SendAsyncController.cs b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Controllers/SendAsyncController.cs deleted file mode 100644 index 5b902a7e1a1..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Controllers/SendAsyncController.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Web.Mvc; -using Messages; -using NServiceBus; - -namespace AsyncPagesMVC3.Controllers -{ - public class SendAsyncController : AsyncController - { - // Bus property to be injected - public IBus Bus { get; set; } - - [HttpGet] - public ActionResult Index() - { - ViewBag.Title = "SendAsync"; - return View("Index"); - } - - [HttpPost] - [AsyncTimeout(50000)] - public void IndexAsync(string textField) - { - int number; - if (!int.TryParse(textField, out number)) - return; - - var command = new Command { Id = number }; - Bus.Send(command).Register(status=> - { - AsyncManager.Parameters["errorCode"] = Enum.GetName(typeof(ErrorCodes), status); - }); - } - - public ActionResult IndexCompleted(string errorCode) - { - ViewBag.Title = "SendAsync"; - ViewBag.ResponseText = errorCode; - return View("Index"); - } - } -} diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Global.asax b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Global.asax deleted file mode 100644 index 8212ace606f..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Global.asax +++ /dev/null @@ -1 +0,0 @@ -<%@ Application Codebehind="Global.asax.cs" Inherits="AsyncPagesMVC3.MvcApplication" Language="C#" %> diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Global.asax.cs b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Global.asax.cs deleted file mode 100644 index 29012808ef5..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Global.asax.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Web.Mvc; -using System.Web.Routing; -using NServiceBus; - -namespace AsyncPagesMVC3 -{ - using Injection; - - public class MvcApplication : System.Web.HttpApplication - { - public static void RegisterGlobalFilters(GlobalFilterCollection filters) - { - filters.Add(new HandleErrorAttribute()); - } - - public static void RegisterRoutes(RouteCollection routes) - { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - - routes.MapRoute( - "Default", // Route name - "{controller}/{action}/{id}", // URL with parameters - new { controller = "Home", action = "SendLinks", id = UrlParameter.Optional } // Parameter defaults - - ); - } - - protected void Application_Start() - { - AreaRegistration.RegisterAllAreas(); - - RegisterGlobalFilters(GlobalFilters.Filters); - RegisterRoutes(RouteTable.Routes); - - // NServiceBus configuration - Configure.WithWeb() - .DefaultBuilder() - .ForMvc() - .JsonSerializer() - .Log4Net() - .MsmqTransport() - .IsTransactional(false) - .PurgeOnStartup(true) - .UnicastBus() - .ImpersonateSender(false) - .CreateBus() - .Start(() => Configure.Instance.ForInstallationOn().Install()); - } - } -} \ No newline at end of file diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Injection/ConfigureMvcDependecyInjection.cs b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Injection/ConfigureMvcDependecyInjection.cs deleted file mode 100644 index 80f23730e84..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Injection/ConfigureMvcDependecyInjection.cs +++ /dev/null @@ -1,30 +0,0 @@ -namespace AsyncPagesMVC3.Injection -{ - using System; - using System.Linq; - using System.Web.Mvc; - using NServiceBus; - - public static class ConfigureMvcDependecyInjection - { - public static Configure ForMvc(this Configure configure) - { - // Register our controller activator with NSB - configure.Configurer.RegisterSingleton(typeof(IControllerActivator), - new NServiceBusControllerActivator()); - - // Find every controller class so that we can register it - var controllers = Configure.TypesToScan - .Where(t => typeof(IController).IsAssignableFrom(t)); - - // Register each controller class with the NServiceBus container - foreach (Type type in controllers) - configure.Configurer.ConfigureComponent(type, DependencyLifecycle.InstancePerCall); - - // Set the MVC dependency resolver to use our resolver - DependencyResolver.SetResolver(new NServiceBusDependencyResolverAdapter(configure.Builder)); - - return configure; - } - } -} diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Injection/NServiceBusControllerActivator.cs b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Injection/NServiceBusControllerActivator.cs deleted file mode 100644 index c84e72f1a43..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Injection/NServiceBusControllerActivator.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace AsyncPagesMVC3.Injection -{ - using System; - using System.Web.Mvc; - using System.Web.Routing; - - public class NServiceBusControllerActivator : IControllerActivator - { - public IController Create(RequestContext requestContext, Type controllerType) - { - return DependencyResolver.Current.GetService(controllerType) as IController; - } - } -} \ No newline at end of file diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Injection/NServiceBusDependencyResolverAdapter.cs b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Injection/NServiceBusDependencyResolverAdapter.cs deleted file mode 100644 index 68344ba5998..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Injection/NServiceBusDependencyResolverAdapter.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace AsyncPagesMVC3.Injection -{ - using System; - using System.Collections.Generic; - using System.Web.Mvc; - using NServiceBus; - using NServiceBus.ObjectBuilder; - - public class NServiceBusDependencyResolverAdapter : IDependencyResolver - { - readonly IBuilder builder; - - public NServiceBusDependencyResolverAdapter(IBuilder builder) - { - this.builder = builder; - } - - public object GetService(Type serviceType) - { - if (Configure.Instance.Configurer.HasComponent(serviceType)) - return builder.Build(serviceType); - else - return null; - } - - public IEnumerable GetServices(Type serviceType) - { - return builder.BuildAll(serviceType); - } - } -} \ No newline at end of file diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Properties/AssemblyInfo.cs b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Properties/AssemblyInfo.cs deleted file mode 100644 index 2f7a9ebe229..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("AsyncPagesMVC3")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("AsyncPagesMVC3")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d8cfa4d3-d21a-4a41-91bc-97ae276070a7")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Views/Home/SendLinks.cshtml b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Views/Home/SendLinks.cshtml deleted file mode 100644 index af27793cc42..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Views/Home/SendLinks.cshtml +++ /dev/null @@ -1,17 +0,0 @@ -@{ - Layout = null; -} - - - - - - SendLinks - - -
    -
  • @Html.ActionLink("SendAndBlock - a Controller uses NServiceBus", "Index", "SendAndBlock")
  • -
  • @Html.ActionLink("SendAsync - an AsyncController uses NServiceBus", "Index", "SendAsync")
  • -
    - - diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Views/Shared/Index.cshtml b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Views/Shared/Index.cshtml deleted file mode 100644 index 0bd1acf7d34..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Views/Shared/Index.cshtml +++ /dev/null @@ -1,14 +0,0 @@ -@using (Html.BeginForm()) -{ -

    @ViewBag.Title

    -

    Enter a number below and click "Go".
    - If the number is even, the result will be "Fail", otherwise it will be "None"

    -
    - @Html.TextBox("textField") - -

    - @ViewBag.ResponseText - -



    - @Html.ActionLink("Home", "SendLinks", "Home") -} diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Views/Web.config b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Views/Web.config deleted file mode 100644 index 4c30ef2275f..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Views/Web.config +++ /dev/null @@ -1,58 +0,0 @@ - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Web.Debug.config b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Web.Debug.config deleted file mode 100644 index 962e6b73a26..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Web.Debug.config +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Web.Release.config b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Web.Release.config deleted file mode 100644 index 141832ba77e..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Web.Release.config +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Web.config b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Web.config deleted file mode 100644 index b94e52873f9..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/Web.config +++ /dev/null @@ -1,73 +0,0 @@ - - - - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/packages.config b/Samples/AsyncPagesMVC3/AsyncPagesMVC3/packages.config deleted file mode 100644 index 43c9924d490..00000000000 --- a/Samples/AsyncPagesMVC3/AsyncPagesMVC3/packages.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/Samples/AsyncPagesMVC3/Messages/Command.cs b/Samples/AsyncPagesMVC3/Messages/Command.cs deleted file mode 100644 index 44c7b744e6c..00000000000 --- a/Samples/AsyncPagesMVC3/Messages/Command.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using NServiceBus; - -namespace Messages -{ - [Serializable] - public class Command : IMessage - { - public int Id { get; set; } - } -} diff --git a/Samples/AsyncPagesMVC3/Messages/ErrorCodes.cs b/Samples/AsyncPagesMVC3/Messages/ErrorCodes.cs deleted file mode 100644 index f39294245b0..00000000000 --- a/Samples/AsyncPagesMVC3/Messages/ErrorCodes.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Messages -{ - public enum ErrorCodes - { - None, - Fail - } -} diff --git a/Samples/AsyncPagesMVC3/Messages/Messages.csproj b/Samples/AsyncPagesMVC3/Messages/Messages.csproj deleted file mode 100644 index d5cf92757bd..00000000000 --- a/Samples/AsyncPagesMVC3/Messages/Messages.csproj +++ /dev/null @@ -1,55 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {B363FF88-1C00-4FB6-A22E-44E2FB754944} - Library - Properties - Messages - Messages - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/AsyncPagesMVC3/Messages/Properties/AssemblyInfo.cs b/Samples/AsyncPagesMVC3/Messages/Properties/AssemblyInfo.cs deleted file mode 100644 index 1bdf4ad375c..00000000000 --- a/Samples/AsyncPagesMVC3/Messages/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Messages")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Messages")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6a27a908-fa6a-4bc1-a991-32d4f480497b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/AsyncPagesMVC3/Server/App.config b/Samples/AsyncPagesMVC3/Server/App.config deleted file mode 100644 index 8f367bce23c..00000000000 --- a/Samples/AsyncPagesMVC3/Server/App.config +++ /dev/null @@ -1,13 +0,0 @@ - - - -
    -
    - - - - - diff --git a/Samples/AsyncPagesMVC3/Server/CommandMessageHandler.cs b/Samples/AsyncPagesMVC3/Server/CommandMessageHandler.cs deleted file mode 100644 index 15472209eb1..00000000000 --- a/Samples/AsyncPagesMVC3/Server/CommandMessageHandler.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Threading; -using Messages; -using NServiceBus; - -namespace Server -{ - public class CommandMessageHandler : IHandleMessages - { - public IBus Bus { get; set; } - - public void Handle(Command message) - { - Console.WriteLine("======================================================================"); - - Thread.Sleep(TimeSpan.FromSeconds(1)); - - if (message.Id % 2 == 0) - Bus.Return(ErrorCodes.Fail); - else - Bus.Return(ErrorCodes.None); - } - } -} diff --git a/Samples/AsyncPagesMVC3/Server/MessageEndpoint.cs b/Samples/AsyncPagesMVC3/Server/MessageEndpoint.cs deleted file mode 100644 index 440c3b9594b..00000000000 --- a/Samples/AsyncPagesMVC3/Server/MessageEndpoint.cs +++ /dev/null @@ -1,17 +0,0 @@ -using NServiceBus; - -namespace Server -{ - public class MessageEndpoint : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization - { - /// - /// Perform initialization logic. - /// - public void Init() - { - Configure.With() - .DefaultBuilder() - .JsonSerializer(); - } - } -} diff --git a/Samples/AsyncPagesMVC3/Server/Properties/AssemblyInfo.cs b/Samples/AsyncPagesMVC3/Server/Properties/AssemblyInfo.cs deleted file mode 100644 index 6b0b99a88cd..00000000000 --- a/Samples/AsyncPagesMVC3/Server/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Server")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Server")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("bce87089-cac7-4db9-8f1d-1d3c2b53c392")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/AsyncPagesMVC3/Server/Server.csproj b/Samples/AsyncPagesMVC3/Server/Server.csproj deleted file mode 100644 index c48bdc086a4..00000000000 --- a/Samples/AsyncPagesMVC3/Server/Server.csproj +++ /dev/null @@ -1,68 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {A3BB0A47-13FE-4021-B4E2-5453CB73753A} - Library - Properties - Server - Server - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\binaries\NServiceBus.dll - - - ..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - {B363FF88-1C00-4FB6-A22E-44E2FB754944} - Messages - - - - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - AllRules.ruleset - - \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.ccproj b/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.ccproj deleted file mode 100644 index 026c443023f..00000000000 --- a/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.ccproj +++ /dev/null @@ -1,63 +0,0 @@ - - - - - Debug - AnyCPU - 1.6 - {f32f2a21-92d3-47b9-a06a-8c23cef55bed} - Library - Properties - AsyncPagesMVC3 - AsyncPagesMVC3 - True - AsyncPagesMVC3 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - Website - {12afc759-8e5f-4b5c-b092-f7ff30a1f8c8} - True - Web - Website - True - - - Worker - {39f7fc6a-4319-4ac5-89af-36d730fc547d} - True - Worker - Worker - True - - - - - 10.0 - $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\1.6\ - - - \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Cloud.cscfg b/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Cloud.cscfg deleted file mode 100644 index 98c1782f123..00000000000 --- a/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Cloud.cscfg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Local.cscfg b/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Local.cscfg deleted file mode 100644 index 210e9e8bbf0..00000000000 --- a/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Local.cscfg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.build.csdef b/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.build.csdef deleted file mode 100644 index 0fa57ee8018..00000000000 --- a/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.build.csdef +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.csdef b/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.csdef deleted file mode 100644 index 5ed78920a3b..00000000000 --- a/Samples/Azure/AzureAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.csdef +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Contract/Contract.csproj b/Samples/Azure/AzureAsyncPagesMVC3/Contract/Contract.csproj deleted file mode 100644 index 306b8f3a20b..00000000000 --- a/Samples/Azure/AzureAsyncPagesMVC3/Contract/Contract.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {A2995239-C5E5-49B6-B134-34CD331BC51F} - Library - Properties - Contract - Contract - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Global.asax.cs b/Samples/Azure/AzureAsyncPagesMVC3/Website/Global.asax.cs deleted file mode 100644 index 9badae35803..00000000000 --- a/Samples/Azure/AzureAsyncPagesMVC3/Website/Global.asax.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Integration.Azure; - -namespace Website -{ - public class MvcApplication : HttpApplication - { - public static IBus Bus; - - private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); - - private static IBus ConfigureNServiceBus() - { - var bus = Configure.WithWeb() - .DefaultBuilder() - .ForMvc() - .Log4Net(new AzureAppender()) - .AzureConfigurationSource() - .AzureMessageQueue() - .JsonSerializer() - .QueuePerInstance() - .PurgeOnStartup(true) - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - - return bus; - } - - public static void RegisterGlobalFilters(GlobalFilterCollection filters) - { - filters.Add(new HandleErrorAttribute()); - } - - public static void RegisterRoutes(RouteCollection routes) - { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - - routes.MapRoute( - "Default", // Route name - "{controller}/{action}/{id}", // URL with parameters - new { controller = "Home", action = "SendLinks", id = UrlParameter.Optional } // Parameter defaults - - ); - } - - protected void Application_Start() - { - AreaRegistration.RegisterAllAreas(); - - RegisterGlobalFilters(GlobalFilters.Filters); - RegisterRoutes(RouteTable.Routes); - } - - protected void Application_BeginRequest(object sender, EventArgs e) - { - Bus = StartBus.Value; - } - } -} \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Web.config b/Samples/Azure/AzureAsyncPagesMVC3/Website/Web.config deleted file mode 100644 index 6c0f7953d8d..00000000000 --- a/Samples/Azure/AzureAsyncPagesMVC3/Website/Web.config +++ /dev/null @@ -1,88 +0,0 @@ - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/Website.csproj b/Samples/Azure/AzureAsyncPagesMVC3/Website/Website.csproj deleted file mode 100644 index 26329ffdd7a..00000000000 --- a/Samples/Azure/AzureAsyncPagesMVC3/Website/Website.csproj +++ /dev/null @@ -1,282 +0,0 @@ - - - - Debug - AnyCPU - - - 2.0 - {12AFC759-8E5F-4B5C-B092-F7FF30A1F8C8} - {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Website - Website - v4.0 - false - false - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\packages\EntityFramework.4.1.10715.0\lib\EntityFramework.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\lib\Ionic.Zip.dll - - - ..\..\..\..\lib\log4net.dll - - - ..\..\..\..\lib\ServiceLocation\Microsoft.Practices.ServiceLocation.dll - - - True - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - - True - - - ..\packages\System.Web.Providers.1.0.1\lib\Net40\System.Web.Providers.dll - - - True - - - True - - - True - - - - - - - - - - - - - True - - - True - - - - - - - - - - - - - - - - - Global.asax - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Web.config - - - Web.config - - - - - - - - - - - - - - - - - - - - - - {A2995239-C5E5-49B6-B134-34CD331BC51F} - Contract - - - - - - - - - - - - - - - - - False - True - 3488 - / - - - False - False - - - False - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Website/packages.config b/Samples/Azure/AzureAsyncPagesMVC3/Website/packages.config deleted file mode 100644 index 2d1ec3be020..00000000000 --- a/Samples/Azure/AzureAsyncPagesMVC3/Website/packages.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Worker/EndpointConfiguration.cs b/Samples/Azure/AzureAsyncPagesMVC3/Worker/EndpointConfiguration.cs deleted file mode 100644 index c5c723cacf6..00000000000 --- a/Samples/Azure/AzureAsyncPagesMVC3/Worker/EndpointConfiguration.cs +++ /dev/null @@ -1,9 +0,0 @@ -using NServiceBus; - -namespace Worker -{ - public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Worker - { - - } -} \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Worker/Worker.csproj b/Samples/Azure/AzureAsyncPagesMVC3/Worker/Worker.csproj deleted file mode 100644 index 1436e101b14..00000000000 --- a/Samples/Azure/AzureAsyncPagesMVC3/Worker/Worker.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {39F7FC6A-4319-4AC5-89AF-36D730FC547D} - Library - Properties - Worker - Worker - v4.0 - 512 - Worker - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\lib\Ionic.Zip.dll - - - ..\..\..\..\lib\log4net.dll - - - ..\..\..\..\lib\ServiceLocation\Microsoft.Practices.ServiceLocation.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - - - - - - - - - - - - - - - - - - - {A2995239-C5E5-49B6-B134-34CD331BC51F} - Contract - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureAsyncPagesMVC3/Worker/app.config b/Samples/Azure/AzureAsyncPagesMVC3/Worker/app.config deleted file mode 100644 index d698a657bb1..00000000000 --- a/Samples/Azure/AzureAsyncPagesMVC3/Worker/app.config +++ /dev/null @@ -1,24 +0,0 @@ - - - - -
    - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureBlobStorageDataBus/Receiver/App.config b/Samples/Azure/AzureBlobStorageDataBus/Receiver/App.config deleted file mode 100644 index 25e971920fe..00000000000 --- a/Samples/Azure/AzureBlobStorageDataBus/Receiver/App.config +++ /dev/null @@ -1,26 +0,0 @@ - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureBlobStorageDataBus/Receiver/Program.cs b/Samples/Azure/AzureBlobStorageDataBus/Receiver/Program.cs deleted file mode 100644 index 4ca07532442..00000000000 --- a/Samples/Azure/AzureBlobStorageDataBus/Receiver/Program.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using NServiceBus; -using NServiceBus.Config; - -namespace Receiver -{ - class Program - { - static void Main(string[] args) - { - BootstrapNServiceBus(); - - Console.WriteLine("Press enter to stop receiving"); - Console.ReadLine(); - - } - - private static void BootstrapNServiceBus() - { - Configure.With() - .DefaultBuilder() - // .AzureConfigurationSource() - .AzureMessageQueue() - .BinarySerializer() - .AzureDataBus() - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - } - } -} diff --git a/Samples/Azure/AzureBlobStorageDataBus/Receiver/Receiver.csproj b/Samples/Azure/AzureBlobStorageDataBus/Receiver/Receiver.csproj deleted file mode 100644 index 2eca39b616b..00000000000 --- a/Samples/Azure/AzureBlobStorageDataBus/Receiver/Receiver.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {6987F415-B4D5-4380-ADED-EED5AF170608} - Exe - Properties - Receiver - Receiver - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - Receiver.Program - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - - - - - - - - - - Designer - - - - - {E4A4B35E-AFD3-456C-A5AC-4A88AAD77156} - Receiver.Messages - - - - - Program - - \ No newline at end of file diff --git a/Samples/Azure/AzureBlobStorageDataBus/Sender/App.config b/Samples/Azure/AzureBlobStorageDataBus/Sender/App.config deleted file mode 100644 index f7ba211632e..00000000000 --- a/Samples/Azure/AzureBlobStorageDataBus/Sender/App.config +++ /dev/null @@ -1,27 +0,0 @@ - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureBlobStorageDataBus/Sender/Program.cs b/Samples/Azure/AzureBlobStorageDataBus/Sender/Program.cs deleted file mode 100644 index bcc127336c2..00000000000 --- a/Samples/Azure/AzureBlobStorageDataBus/Sender/Program.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using NServiceBus; -using NServiceBus.Config; -using Receiver.Messages; - -namespace Sender -{ - class Program - { - private static IBus bus; - - static void Main(string[] args) - { - BootstrapNServiceBus(); - - string key = ""; - - while (key != "q") - { - Console.WriteLine("Press 'q' to quit, Use 'e' to send a message that will exceed the limit and throw, or any other key to send a large message."); - - key = Console.ReadLine(); - - if(key == "q") continue; - if (key == "e") SendMessageThatIsLargerThanQueueStorageCanHandle(); - else SendMessageThroughDataBus(); - - } - } - - private static void SendMessageThroughDataBus() - { - bus.Send(m => - { - m.SomeProperty = "This message contains a large blob that will be sent on the data bus"; - m.LargeBlob = new DataBusProperty(new byte[1024 * 1024 * 5]);//5MB - }); - } - - private static void SendMessageThatIsLargerThanQueueStorageCanHandle() - { - try - { - bus.Send(m => - { - m.LargeBlob = new byte[1024 * 1024 * 5];//5MB - }); - - } - catch (Exception ex) - { - Console.WriteLine(ex); - } - - } - private static void BootstrapNServiceBus() - { - bus = Configure.With() - .DefaultBuilder() - // .AzureConfigurationSource() - .AzureMessageQueue() - .BinarySerializer() - .AzureDataBus() - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - } - } -} diff --git a/Samples/Azure/AzureBlobStorageDataBus/Sender/Sender.csproj b/Samples/Azure/AzureBlobStorageDataBus/Sender/Sender.csproj deleted file mode 100644 index 236214c7659..00000000000 --- a/Samples/Azure/AzureBlobStorageDataBus/Sender/Sender.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {D04CF1FC-C4C0-4959-A817-2BC68770CA9B} - Exe - Properties - Sender - Sender - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - Sender.Program - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - - - - - - - - - {E4A4B35E-AFD3-456C-A5AC-4A88AAD77156} - Receiver.Messages - - - - - Designer - - - - - Program - - \ No newline at end of file diff --git a/Samples/Azure/AzureFullDuplex/OrderService/App.config b/Samples/Azure/AzureFullDuplex/OrderService/App.config deleted file mode 100644 index 1eb4e4fed15..00000000000 --- a/Samples/Azure/AzureFullDuplex/OrderService/App.config +++ /dev/null @@ -1,23 +0,0 @@ - - - - -
    - - - - - - - - - - - - - - - - - - diff --git a/Samples/Azure/AzureFullDuplex/OrderService/DoNotAutoSubscribe.cs b/Samples/Azure/AzureFullDuplex/OrderService/DoNotAutoSubscribe.cs deleted file mode 100644 index b64d2f5ed38..00000000000 --- a/Samples/Azure/AzureFullDuplex/OrderService/DoNotAutoSubscribe.cs +++ /dev/null @@ -1,14 +0,0 @@ -using MyMessages; -using NServiceBus; - -namespace OrderService -{ - public class DoNotAutoSubscribe : IWantCustomInitialization - { - public void Init() - { - // Configure.Instance.UnicastBus().DoNotAutoSubscribe(); - Configure.Instance.DefiningMessagesAs(m => typeof (IDefineMessages).IsAssignableFrom(m)); - } - } -} \ No newline at end of file diff --git a/Samples/Azure/AzureFullDuplex/OrderService/EndpointConfiguration.cs b/Samples/Azure/AzureFullDuplex/OrderService/EndpointConfiguration.cs deleted file mode 100644 index ca74146eeee..00000000000 --- a/Samples/Azure/AzureFullDuplex/OrderService/EndpointConfiguration.cs +++ /dev/null @@ -1,6 +0,0 @@ -using NServiceBus; - -namespace OrderService -{ - public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Worker { } -} \ No newline at end of file diff --git a/Samples/Azure/AzureFullDuplex/OrderService/OrderService.csproj b/Samples/Azure/AzureFullDuplex/OrderService/OrderService.csproj deleted file mode 100644 index f32cfcec9de..00000000000 --- a/Samples/Azure/AzureFullDuplex/OrderService/OrderService.csproj +++ /dev/null @@ -1,155 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8} - Library - Properties - OrderService - OrderService - v4.0 - 512 - Worker - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - True - - - True - - - True - - - True - - - - - - - - - - - - {3871CC9B-235F-4E60-98F7-FEF04DB1201B} - MyMessages - - - - - Designer - - - - - False - Microsoft .NET Framework 4 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureFullDuplex/OrderService/WorkerRole.cs b/Samples/Azure/AzureFullDuplex/OrderService/WorkerRole.cs deleted file mode 100644 index 34da24466f9..00000000000 --- a/Samples/Azure/AzureFullDuplex/OrderService/WorkerRole.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Collections.Specialized; -using System.Threading; -using Common.Logging; -using log4net.Core; -using Microsoft.WindowsAzure.ServiceRuntime; -using MyMessages; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Integration.Azure; - -namespace OrderService -{ - public class WorkerRole : RoleEntryPoint - { - public IBus Bus; - - public OrderList Orders = new OrderList(); - private ILog logger; - - public override void Run() - { - ConfigureLogging(); - - logger.Info("Starting order worker with instance id:" + RoleEnvironment.CurrentRoleInstance.Id); - - ConfigureNServiceBus(); - - while (true) - { - Thread.Sleep(10000); - - logger.Info("Approving orders"); - - foreach (var order in Orders.GetOrdersToApprove()) - { - var updatedOrder = Orders.UpdateStatus(order, OrderStatus.Approved); - - //publish update - var orderUpdatedEvent = Bus.CreateInstance(x => x.UpdatedOrder = updatedOrder); - Bus.Publish(orderUpdatedEvent); - } - } - } - - private void ConfigureNServiceBus() - { - - logger.Info("Initalizing NServiceBus"); - try - { - var config = Configure.With() - .SpringBuilder() - .AzureConfigurationSource() - .XmlSerializer() - .UnicastBus() - .LoadMessageHandlers() - .AzureQueuesTransport() - .IsTransactional(true) - .PurgeOnStartup(false) - .InMemorySubscriptionStorage();//we use inmemory storage until we have a sub storage for TableStorage or SQL Services - - Configure.Instance.Configurer.RegisterSingleton(Orders); - - Bus = config.CreateBus() - .Start(); - - } - catch (Exception ex) - { - logger.Error(ex); - throw; - } - - logger.Info("NServiceBus started"); - - } - - - private void ConfigureLogging() - { - LogManager.Adapter = new Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter(new NameValueCollection - { - {"configType","EXTERNAL"} - }); - - var appender = new AzureAppender - { - ConnectionStringKey = "AzureQueueConfig.ConnectionString", - Threshold = Level.Debug - }; - appender.ActivateOptions(); - - log4net.Config.BasicConfigurator.Configure(appender); - - logger = LogManager.GetLogger(typeof(WorkerRole)); - } - } -} diff --git a/Samples/Azure/AzureFullDuplex/OrderWebSite/Global.asax.cs b/Samples/Azure/AzureFullDuplex/OrderWebSite/Global.asax.cs deleted file mode 100644 index 07040821645..00000000000 --- a/Samples/Azure/AzureFullDuplex/OrderWebSite/Global.asax.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using MyMessages; -using log4net; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Integration.Azure; - -namespace OrderWebSite -{ - public class Global : HttpApplication - { - public static IBus Bus; - public static IList Orders; - - private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); - - private static IBus ConfigureNServiceBus() - { - var bus = Configure.WithWeb() - .DefiningMessagesAs(m => typeof (IDefineMessages).IsAssignableFrom(m)) - .DefaultBuilder() - .Log4Net(new AzureAppender()) - .AzureConfigurationSource() - .AzureMessageQueue() - .JsonSerializer() - .QueuePerInstance() - .PurgeOnStartup(true) - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - - return bus; - } - - protected void Application_Start(object sender, EventArgs e) - { - Orders = new List(); - } - - protected void Application_BeginRequest(object sender, EventArgs e) - { - Bus = StartBus.Value; - } - - protected void Application_AuthenticateRequest(object sender, EventArgs e) - { - - } - - protected void Application_Error(object sender, EventArgs e) - { - //get reference to the source of the exception chain - var ex = Server.GetLastError().GetBaseException(); - - LogManager.GetLogger(typeof(Global)).Error(ex.ToString()); - } - - protected void Session_End(object sender, EventArgs e) - { - - } - - protected void Application_End(object sender, EventArgs e) - { - - } - - } -} \ No newline at end of file diff --git a/Samples/Azure/AzureFullDuplex/OrderWebSite/OrderWebSite.csproj b/Samples/Azure/AzureFullDuplex/OrderWebSite/OrderWebSite.csproj deleted file mode 100644 index 3a58f54d065..00000000000 --- a/Samples/Azure/AzureFullDuplex/OrderWebSite/OrderWebSite.csproj +++ /dev/null @@ -1,146 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - OrderWebSite - OrderWebSite - v4.0 - - - 4.0 - - false - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - - - - - - - - - - - - - Designer - - - - - ASPXCodeBehind - Default.aspx - - - Default.aspx - - - Global.asax - - - - - - {3871CC9B-235F-4E60-98F7-FEF04DB1201B} - MyMessages - - - - - - - - - - - - - False - True - 51188 - / - - - False - False - - - False - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureFullDuplex/OrderWebSite/Web.config b/Samples/Azure/AzureFullDuplex/OrderWebSite/Web.config deleted file mode 100644 index 87899565237..00000000000 --- a/Samples/Azure/AzureFullDuplex/OrderWebSite/Web.config +++ /dev/null @@ -1,20 +0,0 @@ - - - -
    - - - - - - - - - - - - - - - - diff --git a/Samples/Azure/AzureFullDuplex/ServiceConfiguration.cscfg b/Samples/Azure/AzureFullDuplex/ServiceConfiguration.cscfg deleted file mode 100644 index b85401b020c..00000000000 --- a/Samples/Azure/AzureFullDuplex/ServiceConfiguration.cscfg +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureFullDuplex/ServiceDefinition.build.csdef b/Samples/Azure/AzureFullDuplex/ServiceDefinition.build.csdef deleted file mode 100644 index 8c253397fbe..00000000000 --- a/Samples/Azure/AzureFullDuplex/ServiceDefinition.build.csdef +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureFullDuplex/ServiceDefinition.csdef b/Samples/Azure/AzureFullDuplex/ServiceDefinition.csdef deleted file mode 100644 index 0a49fbb1589..00000000000 --- a/Samples/Azure/AzureFullDuplex/ServiceDefinition.csdef +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureHost/AzureHost/ServiceConfiguration.Cloud.cscfg b/Samples/Azure/AzureHost/AzureHost/ServiceConfiguration.Cloud.cscfg deleted file mode 100644 index df1f6b5dbb6..00000000000 --- a/Samples/Azure/AzureHost/AzureHost/ServiceConfiguration.Cloud.cscfg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureHost/AzureHost/ServiceConfiguration.Local.cscfg b/Samples/Azure/AzureHost/AzureHost/ServiceConfiguration.Local.cscfg deleted file mode 100644 index d194d49dca6..00000000000 --- a/Samples/Azure/AzureHost/AzureHost/ServiceConfiguration.Local.cscfg +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureHost/AzureHost/ServiceDefinition.build.csdef b/Samples/Azure/AzureHost/AzureHost/ServiceDefinition.build.csdef deleted file mode 100644 index c3d258bab6e..00000000000 --- a/Samples/Azure/AzureHost/AzureHost/ServiceDefinition.build.csdef +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureHost/AzureHost/ServiceDefinition.csdef b/Samples/Azure/AzureHost/AzureHost/ServiceDefinition.csdef deleted file mode 100644 index 5d6d8e5c3bb..00000000000 --- a/Samples/Azure/AzureHost/AzureHost/ServiceDefinition.csdef +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureHost/Host/Global.asax.cs b/Samples/Azure/AzureHost/Host/Global.asax.cs deleted file mode 100644 index 35d8062a643..00000000000 --- a/Samples/Azure/AzureHost/Host/Global.asax.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Integration.Azure; - -namespace Host -{ - // Note: For instructions on enabling IIS6 or IIS7 classic mode, - // visit http://go.microsoft.com/?LinkId=9394801 - - public class MvcApplication : System.Web.HttpApplication - { - public static IBus Bus; - - private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); - - private static IBus ConfigureNServiceBus() - { - var bus = Configure.WithWeb() - .DefaultBuilder() - .ForMvc() - .Log4Net(new AzureAppender()) - .AzureConfigurationSource() - .AzureMessageQueue() - .JsonSerializer() - .QueuePerInstance() - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - - return bus; - } - - protected void Application_BeginRequest() - { - Bus = StartBus.Value; - } - - public static void RegisterGlobalFilters(GlobalFilterCollection filters) - { - filters.Add(new HandleErrorAttribute()); - } - - public static void RegisterRoutes(RouteCollection routes) - { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - - routes.MapRoute( - "Hello", // Route name - "Hello", // URL with parameters - new { controller = "Home", action = "Hello" } // Parameter defaults - ); - - routes.MapRoute( - "Text", // Route name - "Text", // URL with parameters - new { controller = "Home", action = "Text" } // Parameter defaults - ); - - routes.MapRoute( - "Default", // Route name - "{controller}/{action}/{id}", // URL with parameters - new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults - ); - - } - - protected void Application_Start() - { - AreaRegistration.RegisterAllAreas(); - - RegisterGlobalFilters(GlobalFilters.Filters); - RegisterRoutes(RouteTable.Routes); - } - } -} \ No newline at end of file diff --git a/Samples/Azure/AzureHost/Host/Host.csproj b/Samples/Azure/AzureHost/Host/Host.csproj deleted file mode 100644 index ff301a2f130..00000000000 --- a/Samples/Azure/AzureHost/Host/Host.csproj +++ /dev/null @@ -1,259 +0,0 @@ - - - - Debug - AnyCPU - - - 2.0 - {A60DF3DD-1D45-42B5-9859-1CDB8D90FCFF} - {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Host - Host - v4.0 - false - false - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\lib\Ionic.Zip.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - ..\..\..\..\lib\ServiceLocation\Microsoft.Practices.ServiceLocation.dll - - - True - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - - True - - - ..\packages\System.Web.Providers.1.0\lib\System.Web.Providers.dll - - - True - - - True - - - True - - - - - - - - - - - - True - - - True - - - - - - - - - - - - - - - Global.asax - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Web.config - - - Web.config - - - - - - - - - - - - - - - - - - - - - - - - - - - - {838CE3D7-23D2-4B66-8933-19E283D38363} - Messages - - - - - - - - Designer - Always - - - - - - - - - - - - - False - True - 52104 - / - - - False - False - - - False - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureHost/Host/Web.config b/Samples/Azure/AzureHost/Host/Web.config deleted file mode 100644 index 063bd7f8551..00000000000 --- a/Samples/Azure/AzureHost/Host/Web.config +++ /dev/null @@ -1,68 +0,0 @@ - - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureHost/Host/packages.config b/Samples/Azure/AzureHost/Host/packages.config deleted file mode 100644 index cc862a6e0b2..00000000000 --- a/Samples/Azure/AzureHost/Host/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureHost/Worker/App.config b/Samples/Azure/AzureHost/Worker/App.config deleted file mode 100644 index bf84db4b67b..00000000000 --- a/Samples/Azure/AzureHost/Worker/App.config +++ /dev/null @@ -1,36 +0,0 @@ - - - - -
    -
    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureHost/Worker/Worker.csproj b/Samples/Azure/AzureHost/Worker/Worker.csproj deleted file mode 100644 index bb6031abcbe..00000000000 --- a/Samples/Azure/AzureHost/Worker/Worker.csproj +++ /dev/null @@ -1,174 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {0CF5DB7F-D5B6-45C2-BEA7-4C5EB947A438} - Library - Properties - Worker - Worker - v4.0 - 512 - Worker - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\lib\Ionic.Zip.dll - - - False - ..\..\..\..\build\azure\hosting\log4net.dll - - - ..\..\..\..\lib\Topshelf\Magnum.dll - - - ..\..\..\..\lib\ServiceLocation\Microsoft.Practices.ServiceLocation.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Hosting.Azure.HostProcess.exe - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - - - - - - - ..\..\..\..\lib\Topshelf\Topshelf.dll - - - - - - - - - - Always - Designer - - - - - - Designer - - - Designer - Always - - - - - {838CE3D7-23D2-4B66-8933-19E283D38363} - Messages - - - - - False - Microsoft .NET Framework 4 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureHost/Worker/WorkerRole.cs b/Samples/Azure/AzureHost/Worker/WorkerRole.cs deleted file mode 100644 index 12d8f094324..00000000000 --- a/Samples/Azure/AzureHost/Worker/WorkerRole.cs +++ /dev/null @@ -1,18 +0,0 @@ -using NServiceBus; -using NServiceBus.Hosting.Azure; - -namespace Worker -{ - public class WorkerRole : RoleEntryPoint - { - - } - - public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Worker, IWantCustomInitialization - { - public void Init() - { - Configure.With(AllAssemblies.Except("NServiceBus.Hosting.Azure.HostProcess.exe")); - } - } -} diff --git a/Samples/Azure/AzurePubSub/AzurePubSub.ccproj b/Samples/Azure/AzurePubSub/AzurePubSub.ccproj deleted file mode 100644 index b01349d9b66..00000000000 --- a/Samples/Azure/AzurePubSub/AzurePubSub.ccproj +++ /dev/null @@ -1,71 +0,0 @@ - - - - - Debug - AnyCPU - 1.7 - {adcfc6b6-8bf7-4d56-b6a4-f6d221111666} - Library - Properties - AzureService - AzureService - True - AzureService - False - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - OrderService - {84aca710-e5b3-4a46-b87a-7c12fb2527a8} - True - Worker - OrderService - - - OrderWebSite - {f3798c2c-41dc-407c-9ebe-3f10c1ca9a76} - True - Web - OrderWebSite - - - - - 10.0 - $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\1.7\ - - - - \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/AzurePubSub.sln b/Samples/Azure/AzurePubSub/AzurePubSub.sln deleted file mode 100644 index a9a189af175..00000000000 --- a/Samples/Azure/AzurePubSub/AzurePubSub.sln +++ /dev/null @@ -1,38 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "AzurePubSub", "AzurePubSub.ccproj", "{ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderWebSite", "OrderWebSite\OrderWebSite.csproj", "{F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderService", "OrderService\OrderService.csproj", "{84ACA710-E5B3-4A46-B87A-7C12FB2527A8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyMessages", "MyMessages\MyMessages.csproj", "{3871CC9B-235F-4E60-98F7-FEF04DB1201B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Release|Any CPU.Build.0 = Release|Any CPU - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Release|Any CPU.Build.0 = Release|Any CPU - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Release|Any CPU.Build.0 = Release|Any CPU - {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Samples/Azure/AzurePubSub/MyMessages/LoadOrdersMessage.cs b/Samples/Azure/AzurePubSub/MyMessages/LoadOrdersMessage.cs deleted file mode 100644 index ba9857fe625..00000000000 --- a/Samples/Azure/AzurePubSub/MyMessages/LoadOrdersMessage.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using NServiceBus; - -namespace MyMessages -{ - [Serializable] - public class LoadOrdersMessage:IMessage - { - - } -} \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/MyMessages/OrderMessage.cs b/Samples/Azure/AzurePubSub/MyMessages/OrderMessage.cs deleted file mode 100644 index 1bcbd60558e..00000000000 --- a/Samples/Azure/AzurePubSub/MyMessages/OrderMessage.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using NServiceBus; - -namespace MyMessages -{ - [Serializable] - public class OrderMessage:IMessage - { - public Guid Id { get; set; } - public int Quantity { get; set; } - } -} diff --git a/Samples/Azure/AzurePubSub/MyMessages/OrderUpdatedEvent.cs b/Samples/Azure/AzurePubSub/MyMessages/OrderUpdatedEvent.cs deleted file mode 100644 index 067aabcec69..00000000000 --- a/Samples/Azure/AzurePubSub/MyMessages/OrderUpdatedEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using NServiceBus; - -namespace MyMessages -{ - [Serializable] - public class OrderUpdatedEvent:IMessage - { - public Order UpdatedOrder{ get; set; } - } -} \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderService/App.config b/Samples/Azure/AzurePubSub/OrderService/App.config deleted file mode 100644 index be399b56984..00000000000 --- a/Samples/Azure/AzurePubSub/OrderService/App.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - diff --git a/Samples/Azure/AzurePubSub/OrderService/ConfigOverride.cs b/Samples/Azure/AzurePubSub/OrderService/ConfigOverride.cs deleted file mode 100644 index b73ca856b0b..00000000000 --- a/Samples/Azure/AzurePubSub/OrderService/ConfigOverride.cs +++ /dev/null @@ -1,19 +0,0 @@ -using NServiceBus.Config; -using NServiceBus.Config.ConfigurationSource; - -namespace OrderService -{ - class ConfigOverride : IProvideConfiguration - { - public UnicastBusConfig GetConfiguration() - { - return new UnicastBusConfig - { - MessageEndpointMappings = new MessageEndpointMappingCollection - { - new MessageEndpointMapping { Messages="MyMessages", Endpoint="orderserviceinputqueue" } - } - }; - } - } -} \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderService/DoNotStartSattelites.cs b/Samples/Azure/AzurePubSub/OrderService/DoNotStartSattelites.cs deleted file mode 100644 index 7de0aeeec2e..00000000000 --- a/Samples/Azure/AzurePubSub/OrderService/DoNotStartSattelites.cs +++ /dev/null @@ -1,29 +0,0 @@ -using NServiceBus; - -namespace OrderService -{ - public class DoNotStartSattelites : IWantCustomInitialization - { - /// - /// Perform initialization logic. - /// - public void Init() - { - Configure.Instance - .DisableSecondLevelRetries() - .DisableTimeoutManager(); - } - } - - public class UseBinarySerializer : IWantCustomInitialization - { - /// - /// Perform initialization logic. - /// - public void Init() - { - Configure.Instance - .BinarySerializer(); - } - } -} \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderService/EndpointConfiguration.cs b/Samples/Azure/AzurePubSub/OrderService/EndpointConfiguration.cs deleted file mode 100644 index ca74146eeee..00000000000 --- a/Samples/Azure/AzurePubSub/OrderService/EndpointConfiguration.cs +++ /dev/null @@ -1,6 +0,0 @@ -using NServiceBus; - -namespace OrderService -{ - public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Worker { } -} \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderService/MessageHandlers/OrderMessageHandler.cs b/Samples/Azure/AzurePubSub/OrderService/MessageHandlers/OrderMessageHandler.cs deleted file mode 100644 index 004444c5e07..00000000000 --- a/Samples/Azure/AzurePubSub/OrderService/MessageHandlers/OrderMessageHandler.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Threading; -using MyMessages; -using NServiceBus; -using Order=MyMessages.Order; - -namespace OrderService.MessageHandlers -{ - public class OrderMessageHandler : IHandleMessages - { - private readonly IBus bus; - private readonly OrderList orders; - - public OrderMessageHandler(IBus bus, OrderList orders) - { - this.bus = bus; - this.orders = orders; - } - - public void Handle(OrderMessage message) - { - var order = new Order - { - Id = message.Id, - Quantity = message.Quantity - }; - //simulate processing - Thread.Sleep(4000); - - //simlute business logic - order.Status = message.Quantity < 100 ? OrderStatus.Approved : OrderStatus.AwaitingApproval; - - orders.AddOrder(order); - - //publish update - var orderUpdatedEvent = bus.CreateInstance(x=>x.UpdatedOrder = order); - bus.Publish(orderUpdatedEvent); - } - } -} \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderService/OrderService.csproj b/Samples/Azure/AzurePubSub/OrderService/OrderService.csproj deleted file mode 100644 index ac1788a53a7..00000000000 --- a/Samples/Azure/AzurePubSub/OrderService/OrderService.csproj +++ /dev/null @@ -1,159 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8} - Library - Properties - OrderService - OrderService - v4.0 - 512 - Worker - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - True - - - True - - - True - - - True - - - - - - - - - - - - - - - - {3871CC9B-235F-4E60-98F7-FEF04DB1201B} - MyMessages - - - - - Designer - - - - - False - Microsoft .NET Framework 4 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderService/WorkerRole.cs b/Samples/Azure/AzurePubSub/OrderService/WorkerRole.cs deleted file mode 100644 index 34da24466f9..00000000000 --- a/Samples/Azure/AzurePubSub/OrderService/WorkerRole.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Collections.Specialized; -using System.Threading; -using Common.Logging; -using log4net.Core; -using Microsoft.WindowsAzure.ServiceRuntime; -using MyMessages; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Integration.Azure; - -namespace OrderService -{ - public class WorkerRole : RoleEntryPoint - { - public IBus Bus; - - public OrderList Orders = new OrderList(); - private ILog logger; - - public override void Run() - { - ConfigureLogging(); - - logger.Info("Starting order worker with instance id:" + RoleEnvironment.CurrentRoleInstance.Id); - - ConfigureNServiceBus(); - - while (true) - { - Thread.Sleep(10000); - - logger.Info("Approving orders"); - - foreach (var order in Orders.GetOrdersToApprove()) - { - var updatedOrder = Orders.UpdateStatus(order, OrderStatus.Approved); - - //publish update - var orderUpdatedEvent = Bus.CreateInstance(x => x.UpdatedOrder = updatedOrder); - Bus.Publish(orderUpdatedEvent); - } - } - } - - private void ConfigureNServiceBus() - { - - logger.Info("Initalizing NServiceBus"); - try - { - var config = Configure.With() - .SpringBuilder() - .AzureConfigurationSource() - .XmlSerializer() - .UnicastBus() - .LoadMessageHandlers() - .AzureQueuesTransport() - .IsTransactional(true) - .PurgeOnStartup(false) - .InMemorySubscriptionStorage();//we use inmemory storage until we have a sub storage for TableStorage or SQL Services - - Configure.Instance.Configurer.RegisterSingleton(Orders); - - Bus = config.CreateBus() - .Start(); - - } - catch (Exception ex) - { - logger.Error(ex); - throw; - } - - logger.Info("NServiceBus started"); - - } - - - private void ConfigureLogging() - { - LogManager.Adapter = new Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter(new NameValueCollection - { - {"configType","EXTERNAL"} - }); - - var appender = new AzureAppender - { - ConnectionStringKey = "AzureQueueConfig.ConnectionString", - Threshold = Level.Debug - }; - appender.ActivateOptions(); - - log4net.Config.BasicConfigurator.Configure(appender); - - logger = LogManager.GetLogger(typeof(WorkerRole)); - } - } -} diff --git a/Samples/Azure/AzurePubSub/OrderWebSite/ConfigOverride.cs b/Samples/Azure/AzurePubSub/OrderWebSite/ConfigOverride.cs deleted file mode 100644 index 877d9da9c3b..00000000000 --- a/Samples/Azure/AzurePubSub/OrderWebSite/ConfigOverride.cs +++ /dev/null @@ -1,18 +0,0 @@ -using NServiceBus.Config; -using NServiceBus.Config.ConfigurationSource; - -namespace OrderWebSite -{ - class ConfigOverride : IProvideConfiguration - { - public UnicastBusConfig GetConfiguration() - { - return new UnicastBusConfig { - MessageEndpointMappings = new MessageEndpointMappingCollection - { - new MessageEndpointMapping { Messages="MyMessages", Endpoint="orderserviceinputqueue" } - } - }; - } - } -} \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderWebSite/Global.asax.cs b/Samples/Azure/AzurePubSub/OrderWebSite/Global.asax.cs deleted file mode 100644 index d22b6c14e78..00000000000 --- a/Samples/Azure/AzurePubSub/OrderWebSite/Global.asax.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using log4net; -using MyMessages; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Integration.Azure; - -namespace OrderWebSite -{ - public class Global : HttpApplication - { - public static IBus Bus; - public static IList Orders; - - private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); - - private static IBus ConfigureNServiceBus() - { - var bus = Configure.WithWeb() - .DefaultBuilder() - .AzureConfigurationSource() - .AzureMessageQueue() - //.JsonSerializer() - .BinarySerializer() - .QueuePerInstance() - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .DisableSecondLevelRetries() - .DisableTimeoutManager() - .CreateBus() - .Start(); - - bus.Send(new LoadOrdersMessage()); - - return bus; - } - - protected void Application_Start(object sender, EventArgs e) - { - Orders = new List(); - } - - protected void Application_BeginRequest(object sender, EventArgs e) - { - Bus = StartBus.Value; - } - - protected void Application_AuthenticateRequest(object sender, EventArgs e) - { - - } - - protected void Application_Error(object sender, EventArgs e) - { - //get reference to the source of the exception chain - var ex = Server.GetLastError().GetBaseException(); - - LogManager.GetLogger(typeof(Global)).Error(ex.ToString()); - } - - protected void Session_End(object sender, EventArgs e) - { - - } - - protected void Application_End(object sender, EventArgs e) - { - - } - } -} \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderWebSite/OrderWebSite.csproj b/Samples/Azure/AzurePubSub/OrderWebSite/OrderWebSite.csproj deleted file mode 100644 index db588f7254f..00000000000 --- a/Samples/Azure/AzurePubSub/OrderWebSite/OrderWebSite.csproj +++ /dev/null @@ -1,162 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - OrderWebSite - OrderWebSite - v4.0 - - - 4.0 - - false - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - - - - - Designer - - - - - - ASPXCodeBehind - Default.aspx - - - Default.aspx - - - Global.asax - - - - - - - - {3871CC9B-235F-4E60-98F7-FEF04DB1201B} - MyMessages - - - - - - - - - - - - - False - False - 8089 - / - - - False - False - - - False - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/OrderWebSite/Web.config b/Samples/Azure/AzurePubSub/OrderWebSite/Web.config deleted file mode 100644 index 37ae0f99294..00000000000 --- a/Samples/Azure/AzurePubSub/OrderWebSite/Web.config +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/Samples/Azure/AzurePubSub/ServiceConfiguration.cscfg b/Samples/Azure/AzurePubSub/ServiceConfiguration.cscfg deleted file mode 100644 index f72cfc1d05e..00000000000 --- a/Samples/Azure/AzurePubSub/ServiceConfiguration.cscfg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzurePubSub/ServiceDefinition.csdef b/Samples/Azure/AzurePubSub/ServiceDefinition.csdef deleted file mode 100644 index 67503bd0c58..00000000000 --- a/Samples/Azure/AzurePubSub/ServiceDefinition.csdef +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureSagas/Barista/App.config b/Samples/Azure/AzureSagas/Barista/App.config deleted file mode 100644 index a39c2fb9735..00000000000 --- a/Samples/Azure/AzureSagas/Barista/App.config +++ /dev/null @@ -1,30 +0,0 @@ - - - -
    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - diff --git a/Samples/Azure/AzureSagas/Barista/Barista.csproj b/Samples/Azure/AzureSagas/Barista/Barista.csproj deleted file mode 100644 index dc29bedfb03..00000000000 --- a/Samples/Azure/AzureSagas/Barista/Barista.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065} - WinExe - Properties - Barista - Barista - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - ..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll - - - ..\..\..\..\packages\structuremap.2.6.3\lib\StructureMap.dll - - - - - - - - - - - - - - - - - Form - - - StarbucksBarista.cs - - - - - StarbucksBarista.cs - - - Designer - - - - - - - - - {3963D354-2888-4005-8763-6E54A4D6BFCC} - CashierContracts - - - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} - CustomerContracts - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureSagas/Barista/BaristaMessageHandler.cs b/Samples/Azure/AzureSagas/Barista/BaristaMessageHandler.cs deleted file mode 100644 index af53b709b2c..00000000000 --- a/Samples/Azure/AzureSagas/Barista/BaristaMessageHandler.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; -using System.Threading; -using Barista.ViewData; -using CashierContracts; -using CustomerContracts; -using NServiceBus; -using NServiceBus.Saga; - -namespace Barista -{ - public class BaristaMessageHandler : Saga, - IAmStartedByMessages, - IHandleMessages - { - private readonly IStarbucksBaristaView _view; - - public BaristaMessageHandler() - {} - - public BaristaMessageHandler(IStarbucksBaristaView view) - { - _view = view; - } - - public override void ConfigureHowToFindSaga() - { - ConfigureMapping(s => s.OrderId, m => m.OrderId); - ConfigureMapping(s => s.OrderId, m => m.OrderId); - } - - public void Handle(PrepareOrderMessage message) - { - var viewData = new PrepareOrderView(message.CustomerName, message.Drink, message.DrinkSize); - _view.PrepareOrder(viewData); - - Data.CustomerName = message.CustomerName; - Data.Drink = message.Drink; - Data.OrderId = message.OrderId; - Data.Size = message.DrinkSize; - - RequestUtcTimeout(TimeSpan.FromMinutes(1), new TimeoutMessage(TimeSpan.FromMinutes(1), Data, null)); - - for(var i=0; i<10; i++) - { - Thread.Sleep(1000); - } - - var additionalViewData = new OrderIsDoneView(message.CustomerName); - _view.OrderIsDone(additionalViewData); - - Data.OrderIsReady = true; - DeliverOrder(); - } - - public void Handle(PaymentCompleteMessage message) - { - Data.OrderIsPaid = true; - DeliverOrder(); - } - - private void DeliverOrder() - { - if (!Data.OrderIsReady || !Data.OrderIsPaid) - return; - - var viewData = new DeliverOrderView(Data.Drink, Data.Size); - _view.DeliverOrder(viewData); - - Bus.Send(new OrderReadyMessage{ Drink = Data.Drink, CustomerName = Data.CustomerName}); - - MarkAsComplete(); - } - - [Obsolete("Should be refactored to use the new timeout support",false)] - public override void Timeout(object state) - { - if (!Data.OrderIsReady || !Data.OrderIsPaid) - { - var viewData = new OrderIsTrashedView(Data.Drink, Data.CustomerName, Data.Size); - _view.TrashOrder(viewData); - MarkAsComplete(); - } - else - { - DeliverOrder(); - } - } - } -} diff --git a/Samples/Azure/AzureSagas/Barista/Bootstrapper.cs b/Samples/Azure/AzureSagas/Barista/Bootstrapper.cs deleted file mode 100644 index a37b0cafe25..00000000000 --- a/Samples/Azure/AzureSagas/Barista/Bootstrapper.cs +++ /dev/null @@ -1,39 +0,0 @@ -using NServiceBus; -using NServiceBus.Config; -using StructureMap; - -namespace Barista -{ - public class Bootstrapper - { - private Bootstrapper() - {} - - public static void Bootstrap() - { - BootstrapStructureMap(); - BootstrapNServiceBus(); - } - - private static void BootstrapStructureMap() - { - ObjectFactory.Initialize(x => x.AddRegistry(new BaristaRegistry())); - } - - private static void BootstrapNServiceBus() - { - Configure.With() - .Log4Net() - .StructureMapBuilder(ObjectFactory.Container) - .AzureMessageQueue().JsonSerializer() - .AzureSubcriptionStorage() - .Sagas().AzureSagaPersister().NHibernateUnitOfWork() - - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - } - } -} diff --git a/Samples/Azure/AzureSagas/Barista/MessageSubscriptions.cs b/Samples/Azure/AzureSagas/Barista/MessageSubscriptions.cs deleted file mode 100644 index aaf8dc46d3a..00000000000 --- a/Samples/Azure/AzureSagas/Barista/MessageSubscriptions.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using CashierContracts; -using NServiceBus; - -namespace Barista -{ - public interface IMessageSubscriptions : IDisposable - { - IDisposable Subscribe(); - void Unsubscribe(); - } - - public class MessageSubscriptions : Disposable, - IMessageSubscriptions - { - private readonly IBus _bus; - - private static readonly Type[] MessageTypes = new Type[] - { - typeof(PrepareOrderMessage), - typeof(PaymentCompleteMessage) - }; - - public MessageSubscriptions(IBus bus) - { - _bus = bus; - } - - public IDisposable Subscribe() - { - foreach(var messageType in MessageTypes) - _bus.Subscribe(messageType); - - return this; - } - - public void Unsubscribe() - { - foreach(var messageType in MessageTypes) - _bus.Unsubscribe(messageType); - } - - protected override void DisposeManagedResources() - { - Unsubscribe(); - } - } -} diff --git a/Samples/Azure/AzureSagas/Barista/Properties/AssemblyInfo.cs b/Samples/Azure/AzureSagas/Barista/Properties/AssemblyInfo.cs deleted file mode 100644 index c35fcb35fc9..00000000000 --- a/Samples/Azure/AzureSagas/Barista/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Barista")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Barista")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("5ce23dcd-97df-43c7-a33a-b4abc6c7754d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/AzureSagas/Cashier/App.config b/Samples/Azure/AzureSagas/Cashier/App.config deleted file mode 100644 index 51899d070e6..00000000000 --- a/Samples/Azure/AzureSagas/Cashier/App.config +++ /dev/null @@ -1,29 +0,0 @@ - - - -
    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - diff --git a/Samples/Azure/AzureSagas/Cashier/Bootstrapper.cs b/Samples/Azure/AzureSagas/Cashier/Bootstrapper.cs deleted file mode 100644 index b32d71abe8b..00000000000 --- a/Samples/Azure/AzureSagas/Cashier/Bootstrapper.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Globalization; -using System.Threading; -using log4net.Core; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Integration.Azure; -using StructureMap; - -namespace Cashier -{ - public class Bootstrapper - { - private Bootstrapper() - {} - - public static void Bootstrap() - { - BootstrapStructureMap(); - BootstrapNServiceBus(); - } - - private static void BootstrapStructureMap() - { - ObjectFactory.Initialize(x => x.AddRegistry(new CashierRegistry())); - } - - private static void BootstrapNServiceBus() - { - Configure.With() - .Log4Net() - .StructureMapBuilder(ObjectFactory.Container) - - .AzureMessageQueue().JsonSerializer() - .AzureSubcriptionStorage() - .Sagas().AzureSagaPersister().NHibernateUnitOfWork() - - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - } - } -} diff --git a/Samples/Azure/AzureSagas/Cashier/Cashier.csproj b/Samples/Azure/AzureSagas/Cashier/Cashier.csproj deleted file mode 100644 index dcaf07c40fc..00000000000 --- a/Samples/Azure/AzureSagas/Cashier/Cashier.csproj +++ /dev/null @@ -1,118 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DCCBF183-A703-4999-BB10-046E6C2800B9} - WinExe - Properties - Cashier - Cashier - v4.0 - 512 - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - ..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll - - - ..\..\..\..\packages\structuremap.2.6.3\lib\StructureMap.dll - - - - - - - - - - - - - - - - - - - StarbucksCashier.cs - - - Designer - - - Form - - - StarbucksCashier.cs - - - - - - {3963D354-2888-4005-8763-6E54A4D6BFCC} - CashierContracts - - - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} - CustomerContracts - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureSagas/Cashier/CashierMessageHandler.cs b/Samples/Azure/AzureSagas/Cashier/CashierMessageHandler.cs deleted file mode 100644 index 302ecefa299..00000000000 --- a/Samples/Azure/AzureSagas/Cashier/CashierMessageHandler.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using Cashier.ViewData; -using CashierContracts; -using CustomerContracts; -using NServiceBus; -using NServiceBus.Saga; - -namespace Cashier -{ - public class CashierSaga : Saga, - IAmStartedByMessages, - IHandleMessages - { - private readonly IStarbucksCashierView _view; - - public CashierSaga() - {} - - public CashierSaga(IStarbucksCashierView view) - { - _view = view; - } - - public override void ConfigureHowToFindSaga() - { - ConfigureMapping(s => s.OrderId, m => m.OrderId); - ConfigureMapping(s => s.OrderId, m => m.OrderId); - } - - public void Handle(NewOrderMessage message) - { - _view.NewOrder(new NewOrderView(message)); - - Data.Drink = message.Drink; - Data.DrinkSize = message.DrinkSize; - Data.OrderId = message.OrderId; - Data.CustomerName = message.CustomerName; - Data.Amount = CalculateAmountAccordingTo(message.DrinkSize); - - Bus.Publish(new PrepareOrderMessage{ CustomerName = Data.CustomerName, Drink = Data.Drink, DrinkSize = Data.DrinkSize, OrderId = Data.OrderId}); - Bus.Reply(new PaymentRequestMessage { OrderId = Data.OrderId, CustomerName = Data.CustomerName, Amount = Data.Amount }); - } - - public void Handle(PaymentMessage message) - { - if(message.Amount == 0) - { - var viewData = new CustomerRefusesToPayView(Data.CustomerName, Data.Amount, Data.Drink, Data.DrinkSize); - _view.CustomerRefusesToPay(viewData); - } - else - { - var viewData = new ReceivedFullPaymentView(Data.CustomerName, Data.Drink, Data.DrinkSize); - _view.ReceivedFullPayment(viewData); - - Bus.Publish(new PaymentCompleteMessage{ OrderId = Data.OrderId}); - } - - MarkAsComplete(); - } - - private static Double CalculateAmountAccordingTo(DrinkSize size) - { - switch(size) - { - case DrinkSize.Tall: - return 3.25; - case DrinkSize.Grande: - return 4.00; - case DrinkSize.Venti: - return 4.75; - default: - throw new InvalidOperationException(String.Format("Size '{0}' does not compute!", size)); - } - } - } -} diff --git a/Samples/Azure/AzureSagas/Cashier/Properties/AssemblyInfo.cs b/Samples/Azure/AzureSagas/Cashier/Properties/AssemblyInfo.cs deleted file mode 100644 index 1301b8d53b7..00000000000 --- a/Samples/Azure/AzureSagas/Cashier/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Cashier")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Cashier")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("a23d05c3-f8de-4c46-91bc-99c11db88551")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/AzureSagas/CashierContracts/NewOrderMessage.cs b/Samples/Azure/AzureSagas/CashierContracts/NewOrderMessage.cs deleted file mode 100644 index 620e7d00b9d..00000000000 --- a/Samples/Azure/AzureSagas/CashierContracts/NewOrderMessage.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using NServiceBus; - -namespace CashierContracts -{ - public class NewOrderMessage : IMessage - { - public String CustomerName { get; set; } - public String Drink { get; set; } - public DrinkSize DrinkSize { get; set; } - public Guid OrderId { get; set; } - - public NewOrderMessage() - { - OrderId = Guid.NewGuid(); - } - - public NewOrderMessage(String customerName, String drink, DrinkSize drinkSize) - { - CustomerName = customerName; - Drink = drink; - DrinkSize = drinkSize; - OrderId = Guid.NewGuid(); - } - } -} diff --git a/Samples/Azure/AzureSagas/CashierContracts/PaymentCompleteMessage.cs b/Samples/Azure/AzureSagas/CashierContracts/PaymentCompleteMessage.cs deleted file mode 100644 index dbefadedb1f..00000000000 --- a/Samples/Azure/AzureSagas/CashierContracts/PaymentCompleteMessage.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using NServiceBus; - -namespace CashierContracts -{ - public class PaymentCompleteMessage : IMessage - { - public Guid OrderId { get; set; } - - public PaymentCompleteMessage() - { - } - - public PaymentCompleteMessage(Guid orderId) - { - OrderId = orderId; - } - } -} diff --git a/Samples/Azure/AzureSagas/CashierContracts/PrepareOrderMessage.cs b/Samples/Azure/AzureSagas/CashierContracts/PrepareOrderMessage.cs deleted file mode 100644 index c41c67788e4..00000000000 --- a/Samples/Azure/AzureSagas/CashierContracts/PrepareOrderMessage.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using NServiceBus; - -namespace CashierContracts -{ - public class PrepareOrderMessage : IMessage - { - public String CustomerName { get; set; } - public String Drink { get; set; } - public DrinkSize DrinkSize { get; set; } - public Guid OrderId { get; set; } - - public PrepareOrderMessage() - { - } - - public PrepareOrderMessage(String customerName, String drink, DrinkSize size, Guid orderId) - { - CustomerName = customerName; - Drink = drink; - DrinkSize = size; - OrderId = orderId; - } - } -} diff --git a/Samples/Azure/AzureSagas/CashierContracts/Properties/AssemblyInfo.cs b/Samples/Azure/AzureSagas/CashierContracts/Properties/AssemblyInfo.cs deleted file mode 100644 index d7fd0632540..00000000000 --- a/Samples/Azure/AzureSagas/CashierContracts/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CashierContracts")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CashierContracts")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("15e01ae1-e78d-4467-95a1-b5ce66f67de0")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/AzureSagas/Customer/App.config b/Samples/Azure/AzureSagas/Customer/App.config deleted file mode 100644 index 044c56a96f5..00000000000 --- a/Samples/Azure/AzureSagas/Customer/App.config +++ /dev/null @@ -1,28 +0,0 @@ - - - -
    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - diff --git a/Samples/Azure/AzureSagas/Customer/Bootstrapper.cs b/Samples/Azure/AzureSagas/Customer/Bootstrapper.cs deleted file mode 100644 index 45cd4ce512d..00000000000 --- a/Samples/Azure/AzureSagas/Customer/Bootstrapper.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Cashier; -using NServiceBus; -using NServiceBus.Config; -using StructureMap; - -namespace Customer -{ - public class Bootstrapper - { - private Bootstrapper() - {} - - public static void Bootstrap() - { - BootstrapStructureMap(); - BootstrapNServiceBus(); - } - - private static void BootstrapStructureMap() - { - ObjectFactory.Initialize(x => x.AddRegistry(new CustomerRegistry())); - } - - private static void BootstrapNServiceBus() - { - Configure.With() - .Log4Net() - .StructureMapBuilder(ObjectFactory.Container) - - .AzureMessageQueue().JsonSerializer() - .Sagas().AzureSagaPersister() - - .UnicastBus() - .DoNotAutoSubscribe() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - } - } -} diff --git a/Samples/Azure/AzureSagas/Customer/Customer.csproj b/Samples/Azure/AzureSagas/Customer/Customer.csproj deleted file mode 100644 index 3ea2250b620..00000000000 --- a/Samples/Azure/AzureSagas/Customer/Customer.csproj +++ /dev/null @@ -1,119 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79} - WinExe - Properties - Customer - Customer - v4.0 - 512 - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - ..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll - - - ..\..\..\..\packages\structuremap.2.6.3\lib\StructureMap.dll - - - - - - - - - - - - - Form - - - CustomerOrder.cs - - - - - - - CustomerOrder.cs - - - - - Designer - - - - - {3963D354-2888-4005-8763-6E54A4D6BFCC} - CashierContracts - - - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} - CustomerContracts - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureSagas/Customer/Properties/AssemblyInfo.cs b/Samples/Azure/AzureSagas/Customer/Properties/AssemblyInfo.cs deleted file mode 100644 index 43f37b2f34e..00000000000 --- a/Samples/Azure/AzureSagas/Customer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Starbucks")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Starbucks")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("95d68a80-2651-4438-99f3-dcc3b6ff8fa2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/AzureSagas/CustomerContracts/Properties/AssemblyInfo.cs b/Samples/Azure/AzureSagas/CustomerContracts/Properties/AssemblyInfo.cs deleted file mode 100644 index 6306bcc9b34..00000000000 --- a/Samples/Azure/AzureSagas/CustomerContracts/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CustomerContracts")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CustomerContracts")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b661ecb2-d7f2-4346-94a8-198ec4b10b3b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/AzureSagas/Starbucks.sln b/Samples/Azure/AzureSagas/Starbucks.sln deleted file mode 100644 index d9d20f76aba..00000000000 --- a/Samples/Azure/AzureSagas/Starbucks.sln +++ /dev/null @@ -1,89 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cashier", "Cashier\Cashier.csproj", "{DCCBF183-A703-4999-BB10-046E6C2800B9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Customer", "Customer\Customer.csproj", "{88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CashierContracts", "CashierContracts\CashierContracts.csproj", "{3963D354-2888-4005-8763-6E54A4D6BFCC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomerContracts", "CustomerContracts\CustomerContracts.csproj", "{05882666-3DBD-4B8D-ADAE-439CABDD7DFB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Barista", "Barista\Barista.csproj", "{F5C48D42-06F2-4CCA-88B5-6C49F2A09065}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TimeoutManager", "TimeoutManager\TimeoutManager.csproj", "{402F4888-C262-4AB7-82D2-183ADD631B26}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|x86.ActiveCfg = Debug|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Any CPU.Build.0 = Release|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|x86.ActiveCfg = Release|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|x86.ActiveCfg = Debug|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Any CPU.Build.0 = Release|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|x86.ActiveCfg = Release|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|x86.ActiveCfg = Debug|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Any CPU.Build.0 = Release|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|x86.ActiveCfg = Release|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|x86.ActiveCfg = Debug|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Any CPU.Build.0 = Release|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|x86.ActiveCfg = Release|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|x86.ActiveCfg = Debug|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Any CPU.Build.0 = Release|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|x86.ActiveCfg = Release|Any CPU - {402F4888-C262-4AB7-82D2-183ADD631B26}.Debug|Any CPU.ActiveCfg = Debug|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Debug|x86.ActiveCfg = Debug|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Debug|x86.Build.0 = Debug|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Release|Any CPU.ActiveCfg = Release|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Release|Mixed Platforms.Build.0 = Release|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Release|x86.ActiveCfg = Release|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Samples/Azure/AzureSagas/TimeoutManager/App.config b/Samples/Azure/AzureSagas/TimeoutManager/App.config deleted file mode 100644 index 9e37ec9979c..00000000000 --- a/Samples/Azure/AzureSagas/TimeoutManager/App.config +++ /dev/null @@ -1,26 +0,0 @@ - - - -
    -
    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - diff --git a/Samples/Azure/AzureSagas/TimeoutManager/Bootstrapper.cs b/Samples/Azure/AzureSagas/TimeoutManager/Bootstrapper.cs deleted file mode 100644 index 41ba903b030..00000000000 --- a/Samples/Azure/AzureSagas/TimeoutManager/Bootstrapper.cs +++ /dev/null @@ -1,40 +0,0 @@ -using NServiceBus; -using NServiceBus.Timeout.Hosting.Azure; -using StructureMap; -using Configure = NServiceBus.Configure; - -namespace TimeoutManager -{ - public class Bootstrapper - { - private Bootstrapper() - {} - - public static void Bootstrap() - { - BootstrapStructureMap(); - BootstrapNServiceBus(); - } - - private static void BootstrapStructureMap() - { - ObjectFactory.Initialize(x => x.AddRegistry(new TimeoutRegistry())); - } - - private static void BootstrapNServiceBus() - { - Configure.With() - .Log4Net() - .StructureMapBuilder(ObjectFactory.Container) - .AzureMessageQueue().JsonSerializer() - .RunTimeoutManager() - .UseAzureTimeoutPersister() - .ListenOnAzureStorageQueues() - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - } - } -} diff --git a/Samples/Azure/AzureSagas/TimeoutManager/Program.cs b/Samples/Azure/AzureSagas/TimeoutManager/Program.cs deleted file mode 100644 index 3837508d3b5..00000000000 --- a/Samples/Azure/AzureSagas/TimeoutManager/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Forms; -using StructureMap; - -namespace TimeoutManager -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Bootstrapper.Bootstrap(); - - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - - var startupDialog = ObjectFactory.GetInstance(); - startupDialog.Start(); - } - } -} diff --git a/Samples/Azure/AzureSagas/TimeoutManager/Properties/AssemblyInfo.cs b/Samples/Azure/AzureSagas/TimeoutManager/Properties/AssemblyInfo.cs deleted file mode 100644 index 0c3475e2f78..00000000000 --- a/Samples/Azure/AzureSagas/TimeoutManager/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("TimeoutManager")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Capgemini")] -[assembly: AssemblyProduct("TimeoutManager")] -[assembly: AssemblyCopyright("Copyright © Capgemini 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f3d4d4e2-bc1f-43e2-ac15-d58f2f530819")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/AzureSagas/TimeoutManager/Properties/Resources.Designer.cs b/Samples/Azure/AzureSagas/TimeoutManager/Properties/Resources.Designer.cs deleted file mode 100644 index 20c001b9f1b..00000000000 --- a/Samples/Azure/AzureSagas/TimeoutManager/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.1 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace TimeoutManager.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TimeoutManager.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/Samples/Azure/AzureSagas/TimeoutManager/Properties/Resources.resx b/Samples/Azure/AzureSagas/TimeoutManager/Properties/Resources.resx deleted file mode 100644 index af7dbebbace..00000000000 --- a/Samples/Azure/AzureSagas/TimeoutManager/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - \ No newline at end of file diff --git a/Samples/Azure/AzureSagas/TimeoutManager/Properties/Settings.Designer.cs b/Samples/Azure/AzureSagas/TimeoutManager/Properties/Settings.Designer.cs deleted file mode 100644 index 472b9b20a27..00000000000 --- a/Samples/Azure/AzureSagas/TimeoutManager/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.1 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace TimeoutManager.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/Samples/Azure/AzureSagas/TimeoutManager/Properties/Settings.settings b/Samples/Azure/AzureSagas/TimeoutManager/Properties/Settings.settings deleted file mode 100644 index 39645652af6..00000000000 --- a/Samples/Azure/AzureSagas/TimeoutManager/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/Samples/Azure/AzureSagas/TimeoutManager/StarbucksTimeoutManager.Designer.cs b/Samples/Azure/AzureSagas/TimeoutManager/StarbucksTimeoutManager.Designer.cs deleted file mode 100644 index bfdb03438d3..00000000000 --- a/Samples/Azure/AzureSagas/TimeoutManager/StarbucksTimeoutManager.Designer.cs +++ /dev/null @@ -1,74 +0,0 @@ -namespace TimeoutManager -{ - partial class StarbucksTimeoutManager - { - /// - /// 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.TimoutsListBox = new System.Windows.Forms.ListBox(); - this.TimeoutsLabel = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // TimoutsListBox - // - this.TimoutsListBox.FormattingEnabled = true; - this.TimoutsListBox.Location = new System.Drawing.Point(12, 25); - this.TimoutsListBox.Name = "TimoutsListBox"; - this.TimoutsListBox.Size = new System.Drawing.Size(557, 290); - this.TimoutsListBox.TabIndex = 0; - // - // TimeoutsLabel - // - this.TimeoutsLabel.AutoSize = true; - this.TimeoutsLabel.Location = new System.Drawing.Point(12, 9); - this.TimeoutsLabel.Name = "TimeoutsLabel"; - this.TimeoutsLabel.Size = new System.Drawing.Size(50, 13); - this.TimeoutsLabel.TabIndex = 1; - this.TimeoutsLabel.Text = "Timeouts"; - // - // StarbucksTimeoutManager - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(582, 330); - this.Controls.Add(this.TimeoutsLabel); - this.Controls.Add(this.TimoutsListBox); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Name = "StarbucksTimeoutManager"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Timout Monitor 2000 - Ultimate Edition"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.ListBox TimoutsListBox; - private System.Windows.Forms.Label TimeoutsLabel; - } -} - diff --git a/Samples/Azure/AzureSagas/TimeoutManager/StarbucksTimeoutManager.cs b/Samples/Azure/AzureSagas/TimeoutManager/StarbucksTimeoutManager.cs deleted file mode 100644 index 5ab0c0afe06..00000000000 --- a/Samples/Azure/AzureSagas/TimeoutManager/StarbucksTimeoutManager.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace TimeoutManager -{ - public interface IStarbucksTimeoutManagerView - { - void Start(); - } - - public partial class StarbucksTimeoutManager : Form, IStarbucksTimeoutManagerView - { - public StarbucksTimeoutManager() - { - InitializeComponent(); - } - - public void Start() - { - Application.Run(this); - } - } -} diff --git a/Samples/Azure/AzureSagas/TimeoutManager/StarbucksTimeoutManager.resx b/Samples/Azure/AzureSagas/TimeoutManager/StarbucksTimeoutManager.resx deleted file mode 100644 index d58980a38d7..00000000000 --- a/Samples/Azure/AzureSagas/TimeoutManager/StarbucksTimeoutManager.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Samples/Azure/AzureSagas/TimeoutManager/TimeoutManager.csproj b/Samples/Azure/AzureSagas/TimeoutManager/TimeoutManager.csproj deleted file mode 100644 index 8e1af42cf62..00000000000 --- a/Samples/Azure/AzureSagas/TimeoutManager/TimeoutManager.csproj +++ /dev/null @@ -1,139 +0,0 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {402F4888-C262-4AB7-82D2-183ADD631B26} - WinExe - Properties - TimeoutManager - TimeoutManager - v4.0 - - - 512 - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - x86 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - ..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll - - - ..\..\..\..\binaries\NServiceBus.Timeout.Hosting.Azure.dll - - - ..\..\..\..\packages\structuremap.2.6.3\lib\StructureMap.dll - - - - - - - - - - - - - - - - - - - Form - - - StarbucksTimeoutManager.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - StarbucksTimeoutManager.cs - - - Designer - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065} - Barista - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureSagas/TimeoutManager/TimeoutRegistry.cs b/Samples/Azure/AzureSagas/TimeoutManager/TimeoutRegistry.cs deleted file mode 100644 index fbc44aec814..00000000000 --- a/Samples/Azure/AzureSagas/TimeoutManager/TimeoutRegistry.cs +++ /dev/null @@ -1,15 +0,0 @@ -using StructureMap.Configuration.DSL; - -namespace TimeoutManager -{ - public class TimeoutRegistry : Registry - { - public TimeoutRegistry() - { - For() - .Singleton() - .Use(); - - } - } -} diff --git a/Samples/Azure/AzureThumbnailCreator/AzureThumbnailCreator.ccproj b/Samples/Azure/AzureThumbnailCreator/AzureThumbnailCreator.ccproj deleted file mode 100644 index e7b4fa611d8..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/AzureThumbnailCreator.ccproj +++ /dev/null @@ -1,60 +0,0 @@ - - - - - Debug - AnyCPU - 1.6 - {adcfc6b6-8bf7-4d56-b6a4-f6d221111666} - Library - Properties - AzureService - AzureService - True - AzureService - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - Service - {84aca710-e5b3-4a46-b87a-7c12fb2527a8} - True - Worker - Service - - - WebSite - {f3798c2c-41dc-407c-9ebe-3f10c1ca9a76} - True - Web - WebSite - - - - - 10.0 - $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\1.6\ - - - \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/AzureThumbnailCreator.sln b/Samples/Azure/AzureThumbnailCreator/AzureThumbnailCreator.sln deleted file mode 100644 index 29ed8b4a424..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/AzureThumbnailCreator.sln +++ /dev/null @@ -1,38 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "AzureThumbnailCreator", "AzureThumbnailCreator.ccproj", "{ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebSite", "WebSite\WebSite.csproj", "{F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Service", "Service\Service.csproj", "{84ACA710-E5B3-4A46-B87A-7C12FB2527A8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyMessages", "MyMessages\MyMessages.csproj", "{3871CC9B-235F-4E60-98F7-FEF04DB1201B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Release|Any CPU.Build.0 = Release|Any CPU - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Release|Any CPU.Build.0 = Release|Any CPU - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Release|Any CPU.Build.0 = Release|Any CPU - {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Samples/Azure/AzureThumbnailCreator/MyMessages/ImageUploaded.cs b/Samples/Azure/AzureThumbnailCreator/MyMessages/ImageUploaded.cs deleted file mode 100644 index 36ccfe0c765..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/MyMessages/ImageUploaded.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Drawing.Imaging; -using NServiceBus; - -namespace MyMessages -{ - [Serializable, TimeToBeReceived("01:00:00")] - public class ImageUploaded : IMessage - { - public Guid Id { get; set; } - public string FileName { get; set; } - public string ContentType { get; set; } - public DataBusProperty Image { get; set; } - } -} diff --git a/Samples/Azure/AzureThumbnailCreator/MyMessages/MyMessages.csproj b/Samples/Azure/AzureThumbnailCreator/MyMessages/MyMessages.csproj deleted file mode 100644 index 72879bb39cb..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/MyMessages/MyMessages.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3871CC9B-235F-4E60-98F7-FEF04DB1201B} - Library - Properties - MyMessages - MyMessages - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/MyMessages/Size.cs b/Samples/Azure/AzureThumbnailCreator/MyMessages/Size.cs deleted file mode 100644 index cba1674f7c1..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/MyMessages/Size.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace MyMessages -{ - public enum Size - { - Small, - Medium, - Large - } -} \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/MyMessages/ThumbNailCreated.cs b/Samples/Azure/AzureThumbnailCreator/MyMessages/ThumbNailCreated.cs deleted file mode 100644 index 9c29ce9b0bc..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/MyMessages/ThumbNailCreated.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using NServiceBus; - -namespace MyMessages -{ - [Serializable] - public class ThumbNailCreated : IMessage - { - public string ThumbNailUrl { get; set; } - public Size Size { get; set; } - } -} \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/Service/App.config b/Samples/Azure/AzureThumbnailCreator/Service/App.config deleted file mode 100644 index c27b509b007..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/Service/App.config +++ /dev/null @@ -1,21 +0,0 @@ - - - -
    - - - - - - - - - - - - - - - - - diff --git a/Samples/Azure/AzureThumbnailCreator/Service/EndpointConfiguration.cs b/Samples/Azure/AzureThumbnailCreator/Service/EndpointConfiguration.cs deleted file mode 100644 index a01d5db1234..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/Service/EndpointConfiguration.cs +++ /dev/null @@ -1,9 +0,0 @@ -using NServiceBus; - -namespace OrderService -{ - public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Worker - { - - } -} \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/CreateLargeThumbnail.cs b/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/CreateLargeThumbnail.cs deleted file mode 100644 index 18b634d806c..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/CreateLargeThumbnail.cs +++ /dev/null @@ -1,26 +0,0 @@ -using MyMessages; -using NServiceBus; - -namespace OrderService.MessageHandlers -{ - public class CreateLargeThumbnail : IHandleMessages - { - private readonly IBus bus; - - public CreateLargeThumbnail(IBus bus) - { - this.bus = bus; - } - - public void Handle(ImageUploaded message) - { - var thumb = new ThumbNailCreator().CreateThumbnail(message.Image.Value, 200, 200); - - var uri = new ThumbNailStore().Store(thumb, "large-" + message.FileName, message.ContentType); - - var response = bus.CreateInstance(x => { x.ThumbNailUrl = uri; x.Size = Size.Large; }); - bus.Reply(response); - } - } -} - diff --git a/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/CreateMediumThumbnail.cs b/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/CreateMediumThumbnail.cs deleted file mode 100644 index 98cc5a1efab..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/CreateMediumThumbnail.cs +++ /dev/null @@ -1,25 +0,0 @@ -using MyMessages; -using NServiceBus; - -namespace OrderService.MessageHandlers -{ - public class CreateMediumThumbnail : IHandleMessages - { - private readonly IBus bus; - - public CreateMediumThumbnail(IBus bus) - { - this.bus = bus; - } - - public void Handle(ImageUploaded message) - { - var thumb = new ThumbNailCreator().CreateThumbnail(message.Image.Value, 100, 100); - - var uri = new ThumbNailStore().Store(thumb, "medium-" + message.FileName, message.ContentType); - - var response = bus.CreateInstance(x =>{ x.ThumbNailUrl = uri; x.Size = Size.Medium;}); - bus.Reply(response); - } - } -} \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/CreateSmallThumbnail.cs b/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/CreateSmallThumbnail.cs deleted file mode 100644 index f45f5d2f26a..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/CreateSmallThumbnail.cs +++ /dev/null @@ -1,26 +0,0 @@ -using MyMessages; -using NServiceBus; - -namespace OrderService.MessageHandlers -{ - public class CreateSmallThumbnail : IHandleMessages - { - private readonly IBus bus; - - public CreateSmallThumbnail(IBus bus) - { - this.bus = bus; - } - - public void Handle(ImageUploaded message) - { - var thumb = new ThumbNailCreator().CreateThumbnail(message.Image.Value, 50, 50); - - var uri = new ThumbNailStore().Store(thumb, "small-" + message.FileName, message.ContentType); - - var response = bus.CreateInstance(x => { x.ThumbNailUrl = uri; x.Size = Size.Small; }); - bus.Reply(response); - } - } -} - diff --git a/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/ThumbNailCreator.cs b/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/ThumbNailCreator.cs deleted file mode 100644 index 847a23566e3..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/ThumbNailCreator.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Drawing; -using System.IO; - -namespace OrderService.MessageHandlers -{ - public class ThumbNailCreator - { - public Bitmap CreateThumbnail(byte[] bytes, int width, int height) - { - - Bitmap thumbNail; - try - { - var bmp = new Bitmap(new MemoryStream(bytes)); - - decimal ratio; - int newWidth; - int newHeight; - - if (bmp.Width < width && bmp.Height < height) - return bmp; - - - if (bmp.Width > bmp.Height) - { - ratio = (decimal)width / bmp.Width; - newWidth = width; - var lnTemp = bmp.Height * ratio; - newHeight = (int)lnTemp; - } - else - { - ratio = (decimal)height / bmp.Height; - newHeight = height; - var lnTemp = bmp.Width * ratio; - newWidth = (int)lnTemp; - } - - thumbNail = new Bitmap(newWidth, newHeight); - var g = Graphics.FromImage(thumbNail); - g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; - g.FillRectangle(Brushes.White, 0, 0, newWidth, newHeight); - g.DrawImage(bmp, 0, 0, newWidth, newHeight); - - bmp.Dispose(); - } - catch - { - return null; - } - - return thumbNail; - } - } -} \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/ThumbNailStore.cs b/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/ThumbNailStore.cs deleted file mode 100644 index 7ee7b3c7276..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/Service/MessageHandlers/ThumbNailStore.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Drawing; -using System.Drawing.Imaging; -using System.IO; -using Microsoft.WindowsAzure; -using Microsoft.WindowsAzure.ServiceRuntime; -using Microsoft.WindowsAzure.StorageClient; - -namespace OrderService.MessageHandlers -{ - public class ThumbNailStore - { - public string Store(Bitmap thumb, string fileName, string contentType) - { - var blobClient = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("ThumbNailStore.ConnectionString")).CreateCloudBlobClient(); - var container = blobClient.GetContainerReference("images"); - container.CreateIfNotExist(); - container.SetPermissions( new BlobContainerPermissions{ PublicAccess = BlobContainerPublicAccessType.Container }); - - var blob = container.GetBlockBlobReference(fileName); - - using(var stream = new MemoryStream()) - { - thumb.Save(stream, DetermineImageFormat(contentType)); - stream.Seek(0, SeekOrigin.Begin); - blob.UploadFromStream(stream); - } - - return blob.Uri.ToString(); - } - - - private ImageFormat DetermineImageFormat(string contentType) - { - if (contentType == "image/jpg") - { - return ImageFormat.Jpeg; - } - - return ImageFormat.Jpeg; - } - - } -} \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/Service/Service.csproj b/Samples/Azure/AzureThumbnailCreator/Service/Service.csproj deleted file mode 100644 index b13dc2430a0..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/Service/Service.csproj +++ /dev/null @@ -1,162 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8} - Library - Properties - OrderService - OrderService - v4.0 - 512 - Worker - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - True - - - True - - - True - - - True - - - True - - - - - - - - - - - - - - - - {3871CC9B-235F-4E60-98F7-FEF04DB1201B} - MyMessages - - - - - Designer - - - - - False - Microsoft .NET Framework 4 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/Service/SetupDataBus.cs b/Samples/Azure/AzureThumbnailCreator/Service/SetupDataBus.cs deleted file mode 100644 index 2e8feb0d9de..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/Service/SetupDataBus.cs +++ /dev/null @@ -1,12 +0,0 @@ -using NServiceBus; - -namespace OrderService -{ - internal class SetupDataBus : IWantCustomInitialization - { - public void Init() - { - Configure.Instance.AzureDataBus(); - } - } -} \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/Service/WorkerRole.cs b/Samples/Azure/AzureThumbnailCreator/Service/WorkerRole.cs deleted file mode 100644 index 34da24466f9..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/Service/WorkerRole.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Collections.Specialized; -using System.Threading; -using Common.Logging; -using log4net.Core; -using Microsoft.WindowsAzure.ServiceRuntime; -using MyMessages; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Integration.Azure; - -namespace OrderService -{ - public class WorkerRole : RoleEntryPoint - { - public IBus Bus; - - public OrderList Orders = new OrderList(); - private ILog logger; - - public override void Run() - { - ConfigureLogging(); - - logger.Info("Starting order worker with instance id:" + RoleEnvironment.CurrentRoleInstance.Id); - - ConfigureNServiceBus(); - - while (true) - { - Thread.Sleep(10000); - - logger.Info("Approving orders"); - - foreach (var order in Orders.GetOrdersToApprove()) - { - var updatedOrder = Orders.UpdateStatus(order, OrderStatus.Approved); - - //publish update - var orderUpdatedEvent = Bus.CreateInstance(x => x.UpdatedOrder = updatedOrder); - Bus.Publish(orderUpdatedEvent); - } - } - } - - private void ConfigureNServiceBus() - { - - logger.Info("Initalizing NServiceBus"); - try - { - var config = Configure.With() - .SpringBuilder() - .AzureConfigurationSource() - .XmlSerializer() - .UnicastBus() - .LoadMessageHandlers() - .AzureQueuesTransport() - .IsTransactional(true) - .PurgeOnStartup(false) - .InMemorySubscriptionStorage();//we use inmemory storage until we have a sub storage for TableStorage or SQL Services - - Configure.Instance.Configurer.RegisterSingleton(Orders); - - Bus = config.CreateBus() - .Start(); - - } - catch (Exception ex) - { - logger.Error(ex); - throw; - } - - logger.Info("NServiceBus started"); - - } - - - private void ConfigureLogging() - { - LogManager.Adapter = new Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter(new NameValueCollection - { - {"configType","EXTERNAL"} - }); - - var appender = new AzureAppender - { - ConnectionStringKey = "AzureQueueConfig.ConnectionString", - Threshold = Level.Debug - }; - appender.ActivateOptions(); - - log4net.Config.BasicConfigurator.Configure(appender); - - logger = LogManager.GetLogger(typeof(WorkerRole)); - } - } -} diff --git a/Samples/Azure/AzureThumbnailCreator/ServiceConfiguration.cscfg b/Samples/Azure/AzureThumbnailCreator/ServiceConfiguration.cscfg deleted file mode 100644 index 9b7a3c94998..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/ServiceConfiguration.cscfg +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/ServiceDefinition.build.csdef b/Samples/Azure/AzureThumbnailCreator/ServiceDefinition.build.csdef deleted file mode 100644 index 8f5a5c555e6..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/ServiceDefinition.build.csdef +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/ServiceDefinition.csdef b/Samples/Azure/AzureThumbnailCreator/ServiceDefinition.csdef deleted file mode 100644 index eb41cd6e602..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/ServiceDefinition.csdef +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/WebSite/Default.aspx b/Samples/Azure/AzureThumbnailCreator/WebSite/Default.aspx deleted file mode 100644 index 05b4a0ccaf0..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/WebSite/Default.aspx +++ /dev/null @@ -1,25 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" Async="true" CodeBehind="Default.aspx.cs" Inherits="OrderWebSite._Default" %> - - - - - - -
    -
    - Select File: -
    - -
    -
    - Refresh the page after uploading the image to see the resize status (would of course use Ajax for this in production :) ) -
    - -
    -
    -
    - - - diff --git a/Samples/Azure/AzureThumbnailCreator/WebSite/Default.aspx.cs b/Samples/Azure/AzureThumbnailCreator/WebSite/Default.aspx.cs deleted file mode 100644 index f8276a09554..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/WebSite/Default.aspx.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Drawing.Imaging; -using MyMessages; -using NServiceBus; - -namespace OrderWebSite -{ - public partial class _Default : System.Web.UI.Page, IHandleMessages - { - private static string state; - - protected void Page_PreRender(object sender, EventArgs e) - { - status.InnerHtml = state; - } - - protected void btnUpload_Click(object sender, EventArgs e) - { - Global.Bus - .Send(new ImageUploaded - { - Id = Guid.NewGuid(), - Image = new DataBusProperty(fileUpload.FileBytes), - FileName = fileUpload.FileName, - ContentType = fileUpload.PostedFile.ContentType - }); - - - state = "Creating thumbnail..."; - } - - public void Handle(ThumbNailCreated message) - { - if (state == "Creating thumbnail...") state = ""; - - state += ""; - } - } -} diff --git a/Samples/Azure/AzureThumbnailCreator/WebSite/Default.aspx.designer.cs b/Samples/Azure/AzureThumbnailCreator/WebSite/Default.aspx.designer.cs deleted file mode 100644 index 570fccb5d5e..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/WebSite/Default.aspx.designer.cs +++ /dev/null @@ -1,51 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace OrderWebSite { - - - public partial class _Default { - - /// - /// form1 control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlForm form1; - - /// - /// fileUpload control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.FileUpload fileUpload; - - /// - /// btnUpload control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button btnUpload; - - /// - /// status control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.HtmlControls.HtmlGenericControl status; - } -} diff --git a/Samples/Azure/AzureThumbnailCreator/WebSite/Global.asax.cs b/Samples/Azure/AzureThumbnailCreator/WebSite/Global.asax.cs deleted file mode 100644 index 36c8e7fe8d4..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/WebSite/Global.asax.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using log4net; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Integration.Azure; - -namespace OrderWebSite -{ - public class Global : HttpApplication - { - public static IBus Bus; - private static IStartableBus _configure; - - private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); - - private static IBus ConfigureNServiceBus() - { - var bus = _configure - .Start(); - - return bus; - } - - protected void Application_BeginRequest(object sender, EventArgs e) - { - if(_configure == null) - _configure = Configure.WithWeb() - .DefaultBuilder() - .Log4Net(new AzureAppender()) - .AzureConfigurationSource() - .AzureMessageQueue() - .JsonSerializer() - .QueuePerInstance() - .AzureDataBus() - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus(); - - Bus = StartBus.Value; - } - - protected void Application_AuthenticateRequest(object sender, EventArgs e) - { - - } - - protected void Application_Error(object sender, EventArgs e) - { - //get reference to the source of the exception chain - var ex = Server.GetLastError().GetBaseException(); - - LogManager.GetLogger(typeof(Global)).Error(ex.ToString()); - } - - protected void Session_End(object sender, EventArgs e) - { - - } - - protected void Application_End(object sender, EventArgs e) - { - - } - - } -} \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/WebSite/Web.config b/Samples/Azure/AzureThumbnailCreator/WebSite/Web.config deleted file mode 100644 index c4a71da6dde..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/WebSite/Web.config +++ /dev/null @@ -1,17 +0,0 @@ - - - -
    - - - - - - - - - - - - - diff --git a/Samples/Azure/AzureThumbnailCreator/WebSite/WebRole.cs.cs b/Samples/Azure/AzureThumbnailCreator/WebSite/WebRole.cs.cs deleted file mode 100644 index b7038604de1..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/WebSite/WebRole.cs.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Web; -using Microsoft.WindowsAzure.ServiceRuntime; - -namespace OrderWebSite -{ - public class WebRole : RoleEntryPoint - { - } -} \ No newline at end of file diff --git a/Samples/Azure/AzureThumbnailCreator/WebSite/WebSite.csproj b/Samples/Azure/AzureThumbnailCreator/WebSite/WebSite.csproj deleted file mode 100644 index cafb97b2227..00000000000 --- a/Samples/Azure/AzureThumbnailCreator/WebSite/WebSite.csproj +++ /dev/null @@ -1,147 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - OrderWebSite - OrderWebSite - v4.0 - - - 4.0 - - false - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - - - - - - - - - - - - - Designer - - - - - ASPXCodeBehind - Default.aspx - - - Default.aspx - - - Global.asax - - - - - - - {3871CC9B-235F-4E60-98F7-FEF04DB1201B} - MyMessages - - - - - - - - - - - - - False - True - 51188 - / - - - False - False - - - False - - - - - \ No newline at end of file diff --git a/Samples/Azure/SQLAzure/Barista/App.config b/Samples/Azure/SQLAzure/Barista/App.config deleted file mode 100644 index 3480e61beb4..00000000000 --- a/Samples/Azure/SQLAzure/Barista/App.config +++ /dev/null @@ -1,55 +0,0 @@ - - - -
    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Samples/Azure/SQLAzure/Barista/Barista.csproj b/Samples/Azure/SQLAzure/Barista/Barista.csproj deleted file mode 100644 index 6a48f140e91..00000000000 --- a/Samples/Azure/SQLAzure/Barista/Barista.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065} - WinExe - Properties - Barista - Barista - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - ..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll - - - ..\..\..\..\packages\structuremap.2.6.3\lib\StructureMap.dll - - - - - - - - - - - - - - - - - Form - - - StarbucksBarista.cs - - - - - StarbucksBarista.cs - - - Designer - - - - - - - - {3963D354-2888-4005-8763-6E54A4D6BFCC} - CashierContracts - - - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} - CustomerContracts - - - - - \ No newline at end of file diff --git a/Samples/Azure/SQLAzure/Barista/BaristaMessageHandler.cs b/Samples/Azure/SQLAzure/Barista/BaristaMessageHandler.cs deleted file mode 100644 index 8e1617b9a22..00000000000 --- a/Samples/Azure/SQLAzure/Barista/BaristaMessageHandler.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.Threading; -using Barista.ViewData; -using CashierContracts; -using CustomerContracts; -using NServiceBus; -using NServiceBus.Saga; - -namespace Barista -{ - public class BaristaMessageHandler : Saga, - IAmStartedByMessages, - IHandleMessages - { - private readonly IStarbucksBaristaView _view; - - public BaristaMessageHandler() - {} - - public BaristaMessageHandler(IStarbucksBaristaView view) - { - _view = view; - } - - public override void ConfigureHowToFindSaga() - { - ConfigureMapping(s => s.OrderId, m => m.OrderId); - ConfigureMapping(s => s.OrderId, m => m.OrderId); - } - - public void Handle(PrepareOrderMessage message) - { - var viewData = new PrepareOrderView(message.CustomerName, message.Drink, message.DrinkSize); - _view.PrepareOrder(viewData); - - Data.CustomerName = message.CustomerName; - Data.Drink = message.Drink; - Data.OrderId = message.OrderId; - Data.Size = message.DrinkSize; - - for(var i=0; i<10; i++) - { - Thread.Sleep(1000); - } - - var additionalViewData = new OrderIsDoneView(message.CustomerName); - _view.OrderIsDone(additionalViewData); - - Data.OrderIsReady = true; - DeliverOrder(); - } - - public void Handle(PaymentCompleteMessage message) - { - Data.OrderIsPaid = true; - DeliverOrder(); - } - - private void DeliverOrder() - { - if(!Data.OrderIsReady || !Data.OrderIsPaid) - return; - - var viewData = new DeliverOrderView(Data.Drink, Data.Size); - _view.DeliverOrder(viewData); - - Bus.Send(new OrderReadyMessage(Data.CustomerName, Data.Drink)); - - MarkAsComplete(); - } - } -} diff --git a/Samples/Azure/SQLAzure/Barista/BaristaSagaData.cs b/Samples/Azure/SQLAzure/Barista/BaristaSagaData.cs deleted file mode 100644 index 5d04c97962e..00000000000 --- a/Samples/Azure/SQLAzure/Barista/BaristaSagaData.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using CashierContracts; -using NServiceBus.Saga; - -namespace Barista -{ - public class BaristaSagaData : IContainSagaData - { - public virtual Guid Id { get; set; } - public virtual String Originator { get; set; } - public virtual String OriginalMessageId { get; set; } - - public virtual String CustomerName { get; set; } - public virtual String Drink { get; set; } - public virtual Guid OrderId { get; set; } - public virtual DrinkSize Size { get; set; } - public virtual Boolean OrderIsReady { get; set; } - public virtual Boolean OrderIsPaid { get; set; } - } -} diff --git a/Samples/Azure/SQLAzure/Barista/Bootstrapper.cs b/Samples/Azure/SQLAzure/Barista/Bootstrapper.cs deleted file mode 100644 index acb84b74153..00000000000 --- a/Samples/Azure/SQLAzure/Barista/Bootstrapper.cs +++ /dev/null @@ -1,42 +0,0 @@ -using NServiceBus; -using NServiceBus.Config; -using StructureMap; - -namespace Barista -{ - public class Bootstrapper - { - private Bootstrapper() - {} - - public static void Bootstrap() - { - BootstrapStructureMap(); - BootstrapNServiceBus(); - } - - private static void BootstrapStructureMap() - { - ObjectFactory.Initialize(x => x.AddRegistry(new BaristaRegistry())); - } - - private static void BootstrapNServiceBus() - { - - Configure.With() - .Log4Net() - .StructureMapBuilder(ObjectFactory.Container) - //.AzureConfigurationSource() - .AzureMessageQueue().JsonSerializer() - .DBSubcriptionStorage() - .Sagas() - .NHibernateSagaPersister().NHibernateUnitOfWork() - - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - } - } -} diff --git a/Samples/Azure/SQLAzure/Barista/MessageSubscriptions.cs b/Samples/Azure/SQLAzure/Barista/MessageSubscriptions.cs deleted file mode 100644 index aaf8dc46d3a..00000000000 --- a/Samples/Azure/SQLAzure/Barista/MessageSubscriptions.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using CashierContracts; -using NServiceBus; - -namespace Barista -{ - public interface IMessageSubscriptions : IDisposable - { - IDisposable Subscribe(); - void Unsubscribe(); - } - - public class MessageSubscriptions : Disposable, - IMessageSubscriptions - { - private readonly IBus _bus; - - private static readonly Type[] MessageTypes = new Type[] - { - typeof(PrepareOrderMessage), - typeof(PaymentCompleteMessage) - }; - - public MessageSubscriptions(IBus bus) - { - _bus = bus; - } - - public IDisposable Subscribe() - { - foreach(var messageType in MessageTypes) - _bus.Subscribe(messageType); - - return this; - } - - public void Unsubscribe() - { - foreach(var messageType in MessageTypes) - _bus.Unsubscribe(messageType); - } - - protected override void DisposeManagedResources() - { - Unsubscribe(); - } - } -} diff --git a/Samples/Azure/SQLAzure/Barista/Properties/AssemblyInfo.cs b/Samples/Azure/SQLAzure/Barista/Properties/AssemblyInfo.cs deleted file mode 100644 index c35fcb35fc9..00000000000 --- a/Samples/Azure/SQLAzure/Barista/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Barista")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Barista")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("5ce23dcd-97df-43c7-a33a-b4abc6c7754d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/SQLAzure/Barista/StarbucksBarista.cs b/Samples/Azure/SQLAzure/Barista/StarbucksBarista.cs deleted file mode 100644 index 29a01113429..00000000000 --- a/Samples/Azure/SQLAzure/Barista/StarbucksBarista.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Windows.Forms; -using Barista.ViewData; - -namespace Barista -{ - public interface IStarbucksBaristaView - { - void DeliverOrder(DeliverOrderView view); - void OrderIsDone(OrderIsDoneView view); - void PrepareOrder(PrepareOrderView view); - void Start(); - } - - public partial class StarbucksBarista : Form, IStarbucksBaristaView - { - public StarbucksBarista() - { - InitializeComponent(); - } - - public void DeliverOrder(DeliverOrderView view) - { - var logItem = String.Format("Delivering {0} - {1}.", view.Drink, view.DrinkSize); - Invoke(new Action(Log), logItem); - } - - public void OrderIsDone(OrderIsDoneView view) - { - var logItem = String.Format("Done preparing order for customer {0}.", view.CustomerName); - Invoke(new Action(Log), logItem); - } - - public void PrepareOrder(PrepareOrderView view) - { - var logItem = String.Format("Preparing {0} - {1} for customer {2}.", - view.Drink, view.DrinkSize, view.CustomerName); - - Invoke(new Action(Log), logItem); - } - - public void Start() - { - Application.Run(this); - } - - private void Log(String logItem) - { - OrdersListBox.Items.Add(logItem); - } - } -} diff --git a/Samples/Azure/SQLAzure/Cashier/App.config b/Samples/Azure/SQLAzure/Cashier/App.config deleted file mode 100644 index efcad06c2d0..00000000000 --- a/Samples/Azure/SQLAzure/Cashier/App.config +++ /dev/null @@ -1,53 +0,0 @@ - - - -
    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Samples/Azure/SQLAzure/Cashier/Bootstrapper.cs b/Samples/Azure/SQLAzure/Cashier/Bootstrapper.cs deleted file mode 100644 index 6d34ff29267..00000000000 --- a/Samples/Azure/SQLAzure/Cashier/Bootstrapper.cs +++ /dev/null @@ -1,44 +0,0 @@ -using log4net.Core; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Integration.Azure; -using StructureMap; - -namespace Cashier -{ - public class Bootstrapper - { - private Bootstrapper() - {} - - public static void Bootstrap() - { - BootstrapStructureMap(); - BootstrapNServiceBus(); - } - - private static void BootstrapStructureMap() - { - ObjectFactory.Initialize(x => x.AddRegistry(new CashierRegistry())); - } - - private static void BootstrapNServiceBus() - { - Configure.With() - .Log4Net() - .StructureMapBuilder(ObjectFactory.Container) - - // .AzureConfigurationSource() - .AzureMessageQueue() - .JsonSerializer() - .DBSubcriptionStorage() - .Sagas().NHibernateSagaPersister().NHibernateUnitOfWork() - - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - } - } -} diff --git a/Samples/Azure/SQLAzure/Cashier/Cashier.csproj b/Samples/Azure/SQLAzure/Cashier/Cashier.csproj deleted file mode 100644 index d1c36f7ac15..00000000000 --- a/Samples/Azure/SQLAzure/Cashier/Cashier.csproj +++ /dev/null @@ -1,115 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DCCBF183-A703-4999-BB10-046E6C2800B9} - WinExe - Properties - Cashier - Cashier - v4.0 - 512 - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - ..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll - - - ..\..\..\..\packages\structuremap.2.6.3\lib\StructureMap.dll - - - - - - - - - - - - - - - - - - - StarbucksCashier.cs - - - Designer - - - Form - - - StarbucksCashier.cs - - - - - - {3963D354-2888-4005-8763-6E54A4D6BFCC} - CashierContracts - - - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} - CustomerContracts - - - - - \ No newline at end of file diff --git a/Samples/Azure/SQLAzure/Cashier/CashierMessageHandler.cs b/Samples/Azure/SQLAzure/Cashier/CashierMessageHandler.cs deleted file mode 100644 index 260c3b8f394..00000000000 --- a/Samples/Azure/SQLAzure/Cashier/CashierMessageHandler.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using Cashier.ViewData; -using CashierContracts; -using CustomerContracts; -using NServiceBus; -using NServiceBus.Saga; - -namespace Cashier -{ - public class CashierSaga : Saga, - IAmStartedByMessages, - IHandleMessages - { - private readonly IStarbucksCashierView _view; - - public CashierSaga() - {} - - public CashierSaga(IStarbucksCashierView view) - { - _view = view; - } - - public override void ConfigureHowToFindSaga() - { - ConfigureMapping(s => s.OrderId, m => m.OrderId); - ConfigureMapping(s => s.OrderId, m => m.OrderId); - } - - public void Handle(NewOrderMessage message) - { - _view.NewOrder(new NewOrderView(message)); - - Data.Drink = message.Drink; - Data.DrinkSize = message.DrinkSize; - Data.OrderId = message.OrderId; - Data.CustomerName = message.CustomerName; - Data.Amount = CalculateAmountAccordingTo(message.DrinkSize); - - Bus.Publish(new PrepareOrderMessage(Data.CustomerName, Data.Drink, Data.DrinkSize, Data.OrderId)); - Bus.Reply(new PaymentRequestMessage(Data.Amount, message.CustomerName, message.OrderId)); - } - - public void Handle(PaymentMessage message) - { - if(message.Amount >= Data.Amount) - { - var viewData = new ReceivedFullPaymentView(Data.CustomerName, Data.Drink, Data.DrinkSize); - _view.ReceivedFullPayment(viewData); - - Bus.Publish(new PaymentCompleteMessage(Data.OrderId)); - } - else if(message.Amount == 0) - { - var viewData = new CustomerRefusesToPayView(Data.CustomerName, Data.Amount, Data.Drink, Data.DrinkSize); - _view.CustomerRefusesToPay(viewData); - } - - MarkAsComplete(); - } - - private static Double CalculateAmountAccordingTo(DrinkSize size) - { - switch(size) - { - case DrinkSize.Tall: - return 3.25; - case DrinkSize.Grande: - return 4.00; - case DrinkSize.Venti: - return 4.75; - default: - throw new InvalidOperationException(String.Format("Size '{0}' does not compute!", size)); - } - } - } -} diff --git a/Samples/Azure/SQLAzure/Cashier/CashierSagaData.cs b/Samples/Azure/SQLAzure/Cashier/CashierSagaData.cs deleted file mode 100644 index 4f736accd9d..00000000000 --- a/Samples/Azure/SQLAzure/Cashier/CashierSagaData.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using CashierContracts; -using NServiceBus.Saga; - -namespace Cashier -{ - public class CashierSagaData : IContainSagaData - { - public virtual Guid Id { get; set; } - public virtual String Originator { get; set; } - public virtual String OriginalMessageId { get; set; } - - public virtual Double Amount { get; set; } - public virtual String CustomerName { get; set; } - public virtual String Drink { get; set; } - public virtual DrinkSize DrinkSize { get; set; } - public virtual Guid OrderId { get; set; } - } -} diff --git a/Samples/Azure/SQLAzure/Cashier/Properties/AssemblyInfo.cs b/Samples/Azure/SQLAzure/Cashier/Properties/AssemblyInfo.cs deleted file mode 100644 index 1301b8d53b7..00000000000 --- a/Samples/Azure/SQLAzure/Cashier/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Cashier")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Cashier")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("a23d05c3-f8de-4c46-91bc-99c11db88551")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/SQLAzure/CashierContracts/CashierContracts.csproj b/Samples/Azure/SQLAzure/CashierContracts/CashierContracts.csproj deleted file mode 100644 index 9716f4fb680..00000000000 --- a/Samples/Azure/SQLAzure/CashierContracts/CashierContracts.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3963D354-2888-4005-8763-6E54A4D6BFCC} - Library - Properties - CashierContracts - CashierContracts - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - - - ..\..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/SQLAzure/CashierContracts/NewOrderMessage.cs b/Samples/Azure/SQLAzure/CashierContracts/NewOrderMessage.cs deleted file mode 100644 index 6d5fdd37fbe..00000000000 --- a/Samples/Azure/SQLAzure/CashierContracts/NewOrderMessage.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using NServiceBus; - -namespace CashierContracts -{ - public class NewOrderMessage : IMessage - { - public String CustomerName { get; set; } - public String Drink { get; set; } - public DrinkSize DrinkSize { get; set; } - public Guid OrderId { get; set; } - - public NewOrderMessage(String customerName, String drink, DrinkSize drinkSize) - { - CustomerName = customerName; - Drink = drink; - DrinkSize = drinkSize; - OrderId = Guid.NewGuid(); - } - } -} diff --git a/Samples/Azure/SQLAzure/CashierContracts/PaymentCompleteMessage.cs b/Samples/Azure/SQLAzure/CashierContracts/PaymentCompleteMessage.cs deleted file mode 100644 index 75a656532cc..00000000000 --- a/Samples/Azure/SQLAzure/CashierContracts/PaymentCompleteMessage.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using NServiceBus; - -namespace CashierContracts -{ - public class PaymentCompleteMessage : IMessage - { - public Guid OrderId { get; set; } - - public PaymentCompleteMessage(Guid orderId) - { - OrderId = orderId; - } - } -} diff --git a/Samples/Azure/SQLAzure/CashierContracts/PrepareOrderMessage.cs b/Samples/Azure/SQLAzure/CashierContracts/PrepareOrderMessage.cs deleted file mode 100644 index dc72a453d01..00000000000 --- a/Samples/Azure/SQLAzure/CashierContracts/PrepareOrderMessage.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using NServiceBus; - -namespace CashierContracts -{ - public class PrepareOrderMessage : IMessage - { - public String CustomerName { get; set; } - public String Drink { get; set; } - public DrinkSize DrinkSize { get; set; } - public Guid OrderId { get; set; } - - public PrepareOrderMessage(String customerName, String drink, DrinkSize size, Guid orderId) - { - CustomerName = customerName; - Drink = drink; - DrinkSize = size; - OrderId = orderId; - } - } -} diff --git a/Samples/Azure/SQLAzure/CashierContracts/Properties/AssemblyInfo.cs b/Samples/Azure/SQLAzure/CashierContracts/Properties/AssemblyInfo.cs deleted file mode 100644 index d7fd0632540..00000000000 --- a/Samples/Azure/SQLAzure/CashierContracts/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CashierContracts")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CashierContracts")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("15e01ae1-e78d-4467-95a1-b5ce66f67de0")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/SQLAzure/Customer/App.config b/Samples/Azure/SQLAzure/Customer/App.config deleted file mode 100644 index 5af498a79c8..00000000000 --- a/Samples/Azure/SQLAzure/Customer/App.config +++ /dev/null @@ -1,39 +0,0 @@ - - - -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Samples/Azure/SQLAzure/Customer/Bootstrapper.cs b/Samples/Azure/SQLAzure/Customer/Bootstrapper.cs deleted file mode 100644 index 6cfeadd20c1..00000000000 --- a/Samples/Azure/SQLAzure/Customer/Bootstrapper.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Cashier; -using NServiceBus; -using NServiceBus.Config; -using StructureMap; - -namespace Customer -{ - public class Bootstrapper - { - private Bootstrapper() - {} - - public static void Bootstrap() - { - BootstrapStructureMap(); - BootstrapNServiceBus(); - } - - private static void BootstrapStructureMap() - { - ObjectFactory.Initialize(x => x.AddRegistry(new CustomerRegistry())); - } - - private static void BootstrapNServiceBus() - { - Configure.With() - .Log4Net() - .StructureMapBuilder(ObjectFactory.Container) - - // .AzureConfigurationSource() - .AzureMessageQueue() - .JsonSerializer() - .DBSubcriptionStorage() - - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - } - } -} diff --git a/Samples/Azure/SQLAzure/Customer/Customer.csproj b/Samples/Azure/SQLAzure/Customer/Customer.csproj deleted file mode 100644 index 659598df658..00000000000 --- a/Samples/Azure/SQLAzure/Customer/Customer.csproj +++ /dev/null @@ -1,116 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79} - WinExe - Properties - Customer - Customer - v4.0 - 512 - - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - ..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll - - - ..\..\..\..\packages\structuremap.2.6.3\lib\StructureMap.dll - - - - - - - - - - - - - Form - - - CustomerOrder.cs - - - - - - - CustomerOrder.cs - - - - - Designer - - - - - {3963D354-2888-4005-8763-6E54A4D6BFCC} - CashierContracts - - - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} - CustomerContracts - - - - - \ No newline at end of file diff --git a/Samples/Azure/SQLAzure/Customer/Properties/AssemblyInfo.cs b/Samples/Azure/SQLAzure/Customer/Properties/AssemblyInfo.cs deleted file mode 100644 index 43f37b2f34e..00000000000 --- a/Samples/Azure/SQLAzure/Customer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Starbucks")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Starbucks")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("95d68a80-2651-4438-99f3-dcc3b6ff8fa2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/SQLAzure/CustomerContracts/CustomerContracts.csproj b/Samples/Azure/SQLAzure/CustomerContracts/CustomerContracts.csproj deleted file mode 100644 index f65ff52193e..00000000000 --- a/Samples/Azure/SQLAzure/CustomerContracts/CustomerContracts.csproj +++ /dev/null @@ -1,57 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} - Library - Properties - CustomerContracts - CustomerContracts - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - - - ..\..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/SQLAzure/CustomerContracts/OrderReadyMessage.cs b/Samples/Azure/SQLAzure/CustomerContracts/OrderReadyMessage.cs deleted file mode 100644 index 6c6fa540f5d..00000000000 --- a/Samples/Azure/SQLAzure/CustomerContracts/OrderReadyMessage.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using NServiceBus; - -namespace CustomerContracts -{ - public class OrderReadyMessage : IMessage - { - public String CustomerName { get; set; } - public String Drink { get; set; } - - public OrderReadyMessage(String customerName, String drink) - { - CustomerName = customerName; - Drink = drink; - } - } -} diff --git a/Samples/Azure/SQLAzure/CustomerContracts/Properties/AssemblyInfo.cs b/Samples/Azure/SQLAzure/CustomerContracts/Properties/AssemblyInfo.cs deleted file mode 100644 index 6306bcc9b34..00000000000 --- a/Samples/Azure/SQLAzure/CustomerContracts/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CustomerContracts")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CustomerContracts")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b661ecb2-d7f2-4346-94a8-198ec4b10b3b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/SQLAzure/Starbucks.sln b/Samples/Azure/SQLAzure/Starbucks.sln deleted file mode 100644 index d9d20f76aba..00000000000 --- a/Samples/Azure/SQLAzure/Starbucks.sln +++ /dev/null @@ -1,89 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cashier", "Cashier\Cashier.csproj", "{DCCBF183-A703-4999-BB10-046E6C2800B9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Customer", "Customer\Customer.csproj", "{88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CashierContracts", "CashierContracts\CashierContracts.csproj", "{3963D354-2888-4005-8763-6E54A4D6BFCC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomerContracts", "CustomerContracts\CustomerContracts.csproj", "{05882666-3DBD-4B8D-ADAE-439CABDD7DFB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Barista", "Barista\Barista.csproj", "{F5C48D42-06F2-4CCA-88B5-6C49F2A09065}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TimeoutManager", "TimeoutManager\TimeoutManager.csproj", "{402F4888-C262-4AB7-82D2-183ADD631B26}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|x86.ActiveCfg = Debug|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Any CPU.Build.0 = Release|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|x86.ActiveCfg = Release|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|x86.ActiveCfg = Debug|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Any CPU.Build.0 = Release|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|x86.ActiveCfg = Release|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|x86.ActiveCfg = Debug|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Any CPU.Build.0 = Release|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|x86.ActiveCfg = Release|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|x86.ActiveCfg = Debug|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Any CPU.Build.0 = Release|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|x86.ActiveCfg = Release|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|x86.ActiveCfg = Debug|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Any CPU.Build.0 = Release|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|x86.ActiveCfg = Release|Any CPU - {402F4888-C262-4AB7-82D2-183ADD631B26}.Debug|Any CPU.ActiveCfg = Debug|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Debug|x86.ActiveCfg = Debug|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Debug|x86.Build.0 = Debug|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Release|Any CPU.ActiveCfg = Release|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Release|Mixed Platforms.Build.0 = Release|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Release|x86.ActiveCfg = Release|x86 - {402F4888-C262-4AB7-82D2-183ADD631B26}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Samples/Azure/SQLAzure/TimeoutManager/App.config b/Samples/Azure/SQLAzure/TimeoutManager/App.config deleted file mode 100644 index fb0e18372f9..00000000000 --- a/Samples/Azure/SQLAzure/TimeoutManager/App.config +++ /dev/null @@ -1,51 +0,0 @@ - - - -
    -
    -
    - -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Samples/Azure/SQLAzure/TimeoutManager/Bootstrapper.cs b/Samples/Azure/SQLAzure/TimeoutManager/Bootstrapper.cs deleted file mode 100644 index 51c3a78369e..00000000000 --- a/Samples/Azure/SQLAzure/TimeoutManager/Bootstrapper.cs +++ /dev/null @@ -1,40 +0,0 @@ -using NServiceBus; -using NServiceBus.Timeout.Hosting.Azure; -using StructureMap; -using Configure = NServiceBus.Configure; - -namespace TimeoutManager -{ - public class Bootstrapper - { - private Bootstrapper() - {} - - public static void Bootstrap() - { - BootstrapStructureMap(); - BootstrapNServiceBus(); - } - - private static void BootstrapStructureMap() - { - ObjectFactory.Initialize(x => x.AddRegistry(new TimeoutRegistry())); - } - - private static void BootstrapNServiceBus() - { - Configure.With() - .Log4Net() - .StructureMapBuilder(ObjectFactory.Container) - .AzureMessageQueue().JsonSerializer() - .RunTimeoutManager() - .UseAzureTimeoutPersister() - .ListenOnAzureStorageQueues() - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - } - } -} diff --git a/Samples/Azure/SQLAzure/TimeoutManager/Program.cs b/Samples/Azure/SQLAzure/TimeoutManager/Program.cs deleted file mode 100644 index 3837508d3b5..00000000000 --- a/Samples/Azure/SQLAzure/TimeoutManager/Program.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Windows.Forms; -using StructureMap; - -namespace TimeoutManager -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Bootstrapper.Bootstrap(); - - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - - var startupDialog = ObjectFactory.GetInstance(); - startupDialog.Start(); - } - } -} diff --git a/Samples/Azure/SQLAzure/TimeoutManager/Properties/AssemblyInfo.cs b/Samples/Azure/SQLAzure/TimeoutManager/Properties/AssemblyInfo.cs deleted file mode 100644 index 0c3475e2f78..00000000000 --- a/Samples/Azure/SQLAzure/TimeoutManager/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("TimeoutManager")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Capgemini")] -[assembly: AssemblyProduct("TimeoutManager")] -[assembly: AssemblyCopyright("Copyright © Capgemini 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f3d4d4e2-bc1f-43e2-ac15-d58f2f530819")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Azure/SQLAzure/TimeoutManager/Properties/Resources.Designer.cs b/Samples/Azure/SQLAzure/TimeoutManager/Properties/Resources.Designer.cs deleted file mode 100644 index 20c001b9f1b..00000000000 --- a/Samples/Azure/SQLAzure/TimeoutManager/Properties/Resources.Designer.cs +++ /dev/null @@ -1,63 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.1 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace TimeoutManager.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("TimeoutManager.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - } -} diff --git a/Samples/Azure/SQLAzure/TimeoutManager/Properties/Resources.resx b/Samples/Azure/SQLAzure/TimeoutManager/Properties/Resources.resx deleted file mode 100644 index af7dbebbace..00000000000 --- a/Samples/Azure/SQLAzure/TimeoutManager/Properties/Resources.resx +++ /dev/null @@ -1,117 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - \ No newline at end of file diff --git a/Samples/Azure/SQLAzure/TimeoutManager/Properties/Settings.Designer.cs b/Samples/Azure/SQLAzure/TimeoutManager/Properties/Settings.Designer.cs deleted file mode 100644 index 472b9b20a27..00000000000 --- a/Samples/Azure/SQLAzure/TimeoutManager/Properties/Settings.Designer.cs +++ /dev/null @@ -1,26 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.1 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace TimeoutManager.Properties { - - - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { - - private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default { - get { - return defaultInstance; - } - } - } -} diff --git a/Samples/Azure/SQLAzure/TimeoutManager/Properties/Settings.settings b/Samples/Azure/SQLAzure/TimeoutManager/Properties/Settings.settings deleted file mode 100644 index 39645652af6..00000000000 --- a/Samples/Azure/SQLAzure/TimeoutManager/Properties/Settings.settings +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/Samples/Azure/SQLAzure/TimeoutManager/StarbucksTimeoutManager.Designer.cs b/Samples/Azure/SQLAzure/TimeoutManager/StarbucksTimeoutManager.Designer.cs deleted file mode 100644 index bfdb03438d3..00000000000 --- a/Samples/Azure/SQLAzure/TimeoutManager/StarbucksTimeoutManager.Designer.cs +++ /dev/null @@ -1,74 +0,0 @@ -namespace TimeoutManager -{ - partial class StarbucksTimeoutManager - { - /// - /// 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.TimoutsListBox = new System.Windows.Forms.ListBox(); - this.TimeoutsLabel = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // TimoutsListBox - // - this.TimoutsListBox.FormattingEnabled = true; - this.TimoutsListBox.Location = new System.Drawing.Point(12, 25); - this.TimoutsListBox.Name = "TimoutsListBox"; - this.TimoutsListBox.Size = new System.Drawing.Size(557, 290); - this.TimoutsListBox.TabIndex = 0; - // - // TimeoutsLabel - // - this.TimeoutsLabel.AutoSize = true; - this.TimeoutsLabel.Location = new System.Drawing.Point(12, 9); - this.TimeoutsLabel.Name = "TimeoutsLabel"; - this.TimeoutsLabel.Size = new System.Drawing.Size(50, 13); - this.TimeoutsLabel.TabIndex = 1; - this.TimeoutsLabel.Text = "Timeouts"; - // - // StarbucksTimeoutManager - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(582, 330); - this.Controls.Add(this.TimeoutsLabel); - this.Controls.Add(this.TimoutsListBox); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Name = "StarbucksTimeoutManager"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Timout Monitor 2000 - Ultimate Edition"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.ListBox TimoutsListBox; - private System.Windows.Forms.Label TimeoutsLabel; - } -} - diff --git a/Samples/Azure/SQLAzure/TimeoutManager/StarbucksTimeoutManager.cs b/Samples/Azure/SQLAzure/TimeoutManager/StarbucksTimeoutManager.cs deleted file mode 100644 index 5ab0c0afe06..00000000000 --- a/Samples/Azure/SQLAzure/TimeoutManager/StarbucksTimeoutManager.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Windows.Forms; - -namespace TimeoutManager -{ - public interface IStarbucksTimeoutManagerView - { - void Start(); - } - - public partial class StarbucksTimeoutManager : Form, IStarbucksTimeoutManagerView - { - public StarbucksTimeoutManager() - { - InitializeComponent(); - } - - public void Start() - { - Application.Run(this); - } - } -} diff --git a/Samples/Azure/SQLAzure/TimeoutManager/StarbucksTimeoutManager.resx b/Samples/Azure/SQLAzure/TimeoutManager/StarbucksTimeoutManager.resx deleted file mode 100644 index d58980a38d7..00000000000 --- a/Samples/Azure/SQLAzure/TimeoutManager/StarbucksTimeoutManager.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/Samples/Azure/SQLAzure/TimeoutManager/TimeoutManager.csproj b/Samples/Azure/SQLAzure/TimeoutManager/TimeoutManager.csproj deleted file mode 100644 index fd5d89d4dd8..00000000000 --- a/Samples/Azure/SQLAzure/TimeoutManager/TimeoutManager.csproj +++ /dev/null @@ -1,127 +0,0 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {402F4888-C262-4AB7-82D2-183ADD631B26} - WinExe - Properties - TimeoutManager - TimeoutManager - v4.0 - - - 512 - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - x86 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - ..\..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll - - - ..\..\..\..\binaries\NServiceBus.Timeout.Hosting.Azure.dll - - - ..\..\..\..\packages\structuremap.2.6.3\lib\StructureMap.dll - - - - - - - - - - - - - - - - - - - Form - - - StarbucksTimeoutManager.cs - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - StarbucksTimeoutManager.cs - - - Designer - - - SettingsSingleFileGenerator - Settings.Designer.cs - - - True - Settings.settings - True - - - - - \ No newline at end of file diff --git a/Samples/Azure/SQLAzure/TimeoutManager/TimeoutRegistry.cs b/Samples/Azure/SQLAzure/TimeoutManager/TimeoutRegistry.cs deleted file mode 100644 index 377f926e399..00000000000 --- a/Samples/Azure/SQLAzure/TimeoutManager/TimeoutRegistry.cs +++ /dev/null @@ -1,14 +0,0 @@ -using StructureMap.Configuration.DSL; - -namespace TimeoutManager -{ - public class TimeoutRegistry : Registry - { - public TimeoutRegistry() - { - For() - .Singleton() - .Use(); - } - } -} diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.ccproj b/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.ccproj deleted file mode 100644 index 026c443023f..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/AsyncPagesMVC3.ccproj +++ /dev/null @@ -1,63 +0,0 @@ - - - - - Debug - AnyCPU - 1.6 - {f32f2a21-92d3-47b9-a06a-8c23cef55bed} - Library - Properties - AsyncPagesMVC3 - AsyncPagesMVC3 - True - AsyncPagesMVC3 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - Website - {12afc759-8e5f-4b5c-b092-f7ff30a1f8c8} - True - Web - Website - True - - - Worker - {39f7fc6a-4319-4ac5-89af-36d730fc547d} - True - Worker - Worker - True - - - - - 10.0 - $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\1.6\ - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Cloud.cscfg b/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Cloud.cscfg deleted file mode 100644 index 7db90b3bdb2..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Cloud.cscfg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Local.cscfg b/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Local.cscfg deleted file mode 100644 index ad87b8fd88f..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceConfiguration.Local.cscfg +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.build.csdef b/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.build.csdef deleted file mode 100644 index 8efcaf15021..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.build.csdef +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.csdef b/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.csdef deleted file mode 100644 index 010e261ae3b..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/AsyncPagesMVC3/ServiceDefinition.csdef +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Contract/Command.cs b/Samples/Azure/ServiceBusAsyncPagesMVC3/Contract/Command.cs deleted file mode 100644 index cbcb98af4f4..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/Contract/Command.cs +++ /dev/null @@ -1,9 +0,0 @@ -using NServiceBus; - -namespace Contract -{ - public class Command : IMessage - { - public int Id { get; set; } - } -} diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Contract/Contract.csproj b/Samples/Azure/ServiceBusAsyncPagesMVC3/Contract/Contract.csproj deleted file mode 100644 index 306b8f3a20b..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/Contract/Contract.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {A2995239-C5E5-49B6-B134-34CD331BC51F} - Library - Properties - Contract - Contract - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Global.asax.cs b/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Global.asax.cs deleted file mode 100644 index 8c9153d61ac..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Global.asax.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.Web; -using System.Web.Mvc; -using System.Web.Routing; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Integration.Azure; - -namespace Website -{ - public class MvcApplication : HttpApplication - { - public static IBus Bus; - - private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); - - private static IBus ConfigureNServiceBus() - { - var bus = Configure.WithWeb() - .DefaultBuilder() - .ForMvc() - .Log4Net(new AzureAppender()) - .AzureConfigurationSource() - .AzureServiceBusMessageQueue() - .JsonSerializer() - .QueuePerInstance() - .PurgeOnStartup(true) - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - - return bus; - } - - public static void RegisterGlobalFilters(GlobalFilterCollection filters) - { - filters.Add(new HandleErrorAttribute()); - } - - public static void RegisterRoutes(RouteCollection routes) - { - routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); - - routes.MapRoute( - "Default", // Route name - "{controller}/{action}/{id}", // URL with parameters - new { controller = "Home", action = "SendLinks", id = UrlParameter.Optional } // Parameter defaults - - ); - } - - protected void Application_Start() - { - AreaRegistration.RegisterAllAreas(); - - RegisterGlobalFilters(GlobalFilters.Filters); - RegisterRoutes(RouteTable.Routes); - } - - protected void Application_BeginRequest(object sender, EventArgs e) - { - Bus = StartBus.Value; - } - } -} \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Web.config b/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Web.config deleted file mode 100644 index 6c0f7953d8d..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Web.config +++ /dev/null @@ -1,88 +0,0 @@ - - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Website.csproj b/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Website.csproj deleted file mode 100644 index 62d6487b42e..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/Website.csproj +++ /dev/null @@ -1,277 +0,0 @@ - - - - Debug - AnyCPU - - - 2.0 - {12AFC759-8E5F-4B5C-B092-F7FF30A1F8C8} - {E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - Website - Website - v4.0 - false - false - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\ - TRACE - prompt - 4 - - - - ..\packages\EntityFramework.4.1.10715.0\lib\EntityFramework.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.ServiceBus.dll - - - True - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - - True - - - ..\packages\System.Web.Providers.1.0.1\lib\Net40\System.Web.Providers.dll - - - True - - - True - - - True - - - - - - - - - - - - - True - - - True - - - - - - - - - - - - - - - - - Global.asax - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Web.config - - - Web.config - - - - - - - - - - - - - - - - - - - - - - {A2995239-C5E5-49B6-B134-34CD331BC51F} - Contract - - - - - - - - - - - - - - - - - False - True - 3488 - / - - - False - False - - - False - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/packages.config b/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/packages.config deleted file mode 100644 index 2d1ec3be020..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/Website/packages.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Worker/EndpointConfiguration.cs b/Samples/Azure/ServiceBusAsyncPagesMVC3/Worker/EndpointConfiguration.cs deleted file mode 100644 index c5c723cacf6..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/Worker/EndpointConfiguration.cs +++ /dev/null @@ -1,9 +0,0 @@ -using NServiceBus; - -namespace Worker -{ - public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Worker - { - - } -} \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Worker/Worker.csproj b/Samples/Azure/ServiceBusAsyncPagesMVC3/Worker/Worker.csproj deleted file mode 100644 index 81cffeabb36..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/Worker/Worker.csproj +++ /dev/null @@ -1,109 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {39F7FC6A-4319-4AC5-89AF-36D730FC547D} - Library - Properties - Worker - Worker - v4.0 - 512 - Worker - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.ServiceBus.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - - - - - - - - - - - - - - - - - - - {A2995239-C5E5-49B6-B134-34CD331BC51F} - Contract - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Worker/WorkerRole.cs b/Samples/Azure/ServiceBusAsyncPagesMVC3/Worker/WorkerRole.cs deleted file mode 100644 index d2173682300..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/Worker/WorkerRole.cs +++ /dev/null @@ -1,9 +0,0 @@ -using NServiceBus.Hosting.Azure; - -namespace Worker -{ - public class WorkerRole : RoleEntryPoint - { - - } -} diff --git a/Samples/Azure/ServiceBusAsyncPagesMVC3/Worker/app.config b/Samples/Azure/ServiceBusAsyncPagesMVC3/Worker/app.config deleted file mode 100644 index d698a657bb1..00000000000 --- a/Samples/Azure/ServiceBusAsyncPagesMVC3/Worker/app.config +++ /dev/null @@ -1,24 +0,0 @@ - - - - -
    - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusFullDuplex/OrderService/App.config b/Samples/Azure/ServiceBusFullDuplex/OrderService/App.config deleted file mode 100644 index 706dce9b6e3..00000000000 --- a/Samples/Azure/ServiceBusFullDuplex/OrderService/App.config +++ /dev/null @@ -1,21 +0,0 @@ - - - - -
    - - - - - - - - - - - - - - - - diff --git a/Samples/Azure/ServiceBusFullDuplex/OrderService/EndpointConfiguration.cs b/Samples/Azure/ServiceBusFullDuplex/OrderService/EndpointConfiguration.cs deleted file mode 100644 index 9a63912312e..00000000000 --- a/Samples/Azure/ServiceBusFullDuplex/OrderService/EndpointConfiguration.cs +++ /dev/null @@ -1,6 +0,0 @@ -using NServiceBus; - -namespace OrderService -{ - public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Listener { } -} \ No newline at end of file diff --git a/Samples/Azure/ServiceBusFullDuplex/OrderService/Host.cs b/Samples/Azure/ServiceBusFullDuplex/OrderService/Host.cs deleted file mode 100644 index 2a2f8d372c6..00000000000 --- a/Samples/Azure/ServiceBusFullDuplex/OrderService/Host.cs +++ /dev/null @@ -1,6 +0,0 @@ -using NServiceBus.Hosting.Azure; - -namespace OrderService -{ - public class Host : RoleEntryPoint{} -} \ No newline at end of file diff --git a/Samples/Azure/ServiceBusFullDuplex/OrderService/OrderService.csproj b/Samples/Azure/ServiceBusFullDuplex/OrderService/OrderService.csproj deleted file mode 100644 index 058b68fd121..00000000000 --- a/Samples/Azure/ServiceBusFullDuplex/OrderService/OrderService.csproj +++ /dev/null @@ -1,148 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8} - Library - Properties - OrderService - OrderService - v4.0 - 512 - Worker - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.ServiceBus.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - - - - - - - - - - - - - - {3871CC9B-235F-4E60-98F7-FEF04DB1201B} - MyMessages - - - - - Designer - - - - - False - Microsoft .NET Framework 4 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusFullDuplex/OrderService/WorkerRole.cs b/Samples/Azure/ServiceBusFullDuplex/OrderService/WorkerRole.cs deleted file mode 100644 index 34da24466f9..00000000000 --- a/Samples/Azure/ServiceBusFullDuplex/OrderService/WorkerRole.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Collections.Specialized; -using System.Threading; -using Common.Logging; -using log4net.Core; -using Microsoft.WindowsAzure.ServiceRuntime; -using MyMessages; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Integration.Azure; - -namespace OrderService -{ - public class WorkerRole : RoleEntryPoint - { - public IBus Bus; - - public OrderList Orders = new OrderList(); - private ILog logger; - - public override void Run() - { - ConfigureLogging(); - - logger.Info("Starting order worker with instance id:" + RoleEnvironment.CurrentRoleInstance.Id); - - ConfigureNServiceBus(); - - while (true) - { - Thread.Sleep(10000); - - logger.Info("Approving orders"); - - foreach (var order in Orders.GetOrdersToApprove()) - { - var updatedOrder = Orders.UpdateStatus(order, OrderStatus.Approved); - - //publish update - var orderUpdatedEvent = Bus.CreateInstance(x => x.UpdatedOrder = updatedOrder); - Bus.Publish(orderUpdatedEvent); - } - } - } - - private void ConfigureNServiceBus() - { - - logger.Info("Initalizing NServiceBus"); - try - { - var config = Configure.With() - .SpringBuilder() - .AzureConfigurationSource() - .XmlSerializer() - .UnicastBus() - .LoadMessageHandlers() - .AzureQueuesTransport() - .IsTransactional(true) - .PurgeOnStartup(false) - .InMemorySubscriptionStorage();//we use inmemory storage until we have a sub storage for TableStorage or SQL Services - - Configure.Instance.Configurer.RegisterSingleton(Orders); - - Bus = config.CreateBus() - .Start(); - - } - catch (Exception ex) - { - logger.Error(ex); - throw; - } - - logger.Info("NServiceBus started"); - - } - - - private void ConfigureLogging() - { - LogManager.Adapter = new Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter(new NameValueCollection - { - {"configType","EXTERNAL"} - }); - - var appender = new AzureAppender - { - ConnectionStringKey = "AzureQueueConfig.ConnectionString", - Threshold = Level.Debug - }; - appender.ActivateOptions(); - - log4net.Config.BasicConfigurator.Configure(appender); - - logger = LogManager.GetLogger(typeof(WorkerRole)); - } - } -} diff --git a/Samples/Azure/ServiceBusFullDuplex/OrderWebSite/Global.asax.cs b/Samples/Azure/ServiceBusFullDuplex/OrderWebSite/Global.asax.cs deleted file mode 100644 index 64b06e3dd78..00000000000 --- a/Samples/Azure/ServiceBusFullDuplex/OrderWebSite/Global.asax.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using log4net; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Integration.Azure; - -namespace OrderWebSite -{ - public class Global : HttpApplication - { - public static IBus Bus; - public static IList Orders; - private static IStartableBus _configure; - - private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); - - private static IBus ConfigureNServiceBus() - { - var bus = _configure - .Start(); - - return bus; - } - - protected void Application_Start(object sender, EventArgs e) - { - Orders = new List(); - - - } - - protected void Application_BeginRequest(object sender, EventArgs e) - { - if(_configure == null) - _configure = Configure.WithWeb() - .DefaultBuilder() - .Log4Net(new AzureAppender()) - .AzureConfigurationSource() - .AzureServiceBusMessageQueue() - .JsonSerializer() - .UnicastBus() - .DoNotAutoSubscribe() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus(); - - Bus = StartBus.Value; - } - - protected void Application_AuthenticateRequest(object sender, EventArgs e) - { - - } - - protected void Application_Error(object sender, EventArgs e) - { - //get reference to the source of the exception chain - var ex = Server.GetLastError().GetBaseException(); - - LogManager.GetLogger(typeof(Global)).Error(ex.ToString()); - } - - protected void Session_End(object sender, EventArgs e) - { - - } - - protected void Application_End(object sender, EventArgs e) - { - - } - - } -} \ No newline at end of file diff --git a/Samples/Azure/ServiceBusFullDuplex/OrderWebSite/OrderWebSite.csproj b/Samples/Azure/ServiceBusFullDuplex/OrderWebSite/OrderWebSite.csproj deleted file mode 100644 index 5794908c522..00000000000 --- a/Samples/Azure/ServiceBusFullDuplex/OrderWebSite/OrderWebSite.csproj +++ /dev/null @@ -1,147 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - OrderWebSite - OrderWebSite - v4.0 - - - 4.0 - - false - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.ServiceBus.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - - - - - - - - - - - - - Designer - - - - - ASPXCodeBehind - Default.aspx - - - Default.aspx - - - Global.asax - - - - - - {3871CC9B-235F-4E60-98F7-FEF04DB1201B} - MyMessages - - - - - - - - - - - - - False - True - 51188 - / - - - False - False - - - False - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusFullDuplex/OrderWebSite/Web.config b/Samples/Azure/ServiceBusFullDuplex/OrderWebSite/Web.config deleted file mode 100644 index 54c6de45450..00000000000 --- a/Samples/Azure/ServiceBusFullDuplex/OrderWebSite/Web.config +++ /dev/null @@ -1,18 +0,0 @@ - - - - -
    - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusFullDuplex/ServiceConfiguration.cscfg b/Samples/Azure/ServiceBusFullDuplex/ServiceConfiguration.cscfg deleted file mode 100644 index 7bc16380338..00000000000 --- a/Samples/Azure/ServiceBusFullDuplex/ServiceConfiguration.cscfg +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusFullDuplex/ServiceDefinition.build.csdef b/Samples/Azure/ServiceBusFullDuplex/ServiceDefinition.build.csdef deleted file mode 100644 index 00f82b6bc5e..00000000000 --- a/Samples/Azure/ServiceBusFullDuplex/ServiceDefinition.build.csdef +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusFullDuplex/ServiceDefinition.csdef b/Samples/Azure/ServiceBusFullDuplex/ServiceDefinition.csdef deleted file mode 100644 index 2c1c0593aa1..00000000000 --- a/Samples/Azure/ServiceBusFullDuplex/ServiceDefinition.csdef +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/AzureServiceBusPubSub.ccproj b/Samples/Azure/ServiceBusPubSub/AzureServiceBusPubSub.ccproj deleted file mode 100644 index cfe46914da3..00000000000 --- a/Samples/Azure/ServiceBusPubSub/AzureServiceBusPubSub.ccproj +++ /dev/null @@ -1,76 +0,0 @@ - - - - - Debug - AnyCPU - 1.6 - {adcfc6b6-8bf7-4d56-b6a4-f6d221111666} - Library - Properties - AzureService - AzureService - True - AzureService - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - OrderService - {84aca710-e5b3-4a46-b87a-7c12fb2527a8} - True - Worker - OrderService - - - OrderWebSite - {f3798c2c-41dc-407c-9ebe-3f10c1ca9a76} - True - Web - OrderWebSite - - - - - - - - - - - 10.0 - $(MSBuildExtensionsPath)\Microsoft\VisualStudio\v$(VisualStudioVersion)\Windows Azure Tools\1.6\ - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/AzureServiceBusPubSub.sln b/Samples/Azure/ServiceBusPubSub/AzureServiceBusPubSub.sln deleted file mode 100644 index 043e5dd569c..00000000000 --- a/Samples/Azure/ServiceBusPubSub/AzureServiceBusPubSub.sln +++ /dev/null @@ -1,38 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{CC5FD16D-436D-48AD-A40C-5A424C6E3E79}") = "AzureServiceBusPubSub", "AzureServiceBusPubSub.ccproj", "{ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderWebSite", "OrderWebSite\OrderWebSite.csproj", "{F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderService", "OrderService\OrderService.csproj", "{84ACA710-E5B3-4A46-B87A-7C12FB2527A8}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyMessages", "MyMessages\MyMessages.csproj", "{3871CC9B-235F-4E60-98F7-FEF04DB1201B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ADCFC6B6-8BF7-4D56-B6A4-F6D221111666}.Release|Any CPU.Build.0 = Release|Any CPU - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76}.Release|Any CPU.Build.0 = Release|Any CPU - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8}.Release|Any CPU.Build.0 = Release|Any CPU - {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3871CC9B-235F-4E60-98F7-FEF04DB1201B}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Samples/Azure/ServiceBusPubSub/MyMessages/LoadOrdersMessage.cs b/Samples/Azure/ServiceBusPubSub/MyMessages/LoadOrdersMessage.cs deleted file mode 100644 index ba9857fe625..00000000000 --- a/Samples/Azure/ServiceBusPubSub/MyMessages/LoadOrdersMessage.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using NServiceBus; - -namespace MyMessages -{ - [Serializable] - public class LoadOrdersMessage:IMessage - { - - } -} \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/MyMessages/OrderMessage.cs b/Samples/Azure/ServiceBusPubSub/MyMessages/OrderMessage.cs deleted file mode 100644 index 1bcbd60558e..00000000000 --- a/Samples/Azure/ServiceBusPubSub/MyMessages/OrderMessage.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using NServiceBus; - -namespace MyMessages -{ - [Serializable] - public class OrderMessage:IMessage - { - public Guid Id { get; set; } - public int Quantity { get; set; } - } -} diff --git a/Samples/Azure/ServiceBusPubSub/MyMessages/OrderUpdatedEvent.cs b/Samples/Azure/ServiceBusPubSub/MyMessages/OrderUpdatedEvent.cs deleted file mode 100644 index 067aabcec69..00000000000 --- a/Samples/Azure/ServiceBusPubSub/MyMessages/OrderUpdatedEvent.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using NServiceBus; - -namespace MyMessages -{ - [Serializable] - public class OrderUpdatedEvent:IMessage - { - public Order UpdatedOrder{ get; set; } - } -} \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/OrderService/App.config b/Samples/Azure/ServiceBusPubSub/OrderService/App.config deleted file mode 100644 index b5f6b852516..00000000000 --- a/Samples/Azure/ServiceBusPubSub/OrderService/App.config +++ /dev/null @@ -1,21 +0,0 @@ - - - -
    - - - - - - - - - - - - - - - - - diff --git a/Samples/Azure/ServiceBusPubSub/OrderService/EndpointConfiguration.cs b/Samples/Azure/ServiceBusPubSub/OrderService/EndpointConfiguration.cs deleted file mode 100644 index ec54b6ce114..00000000000 --- a/Samples/Azure/ServiceBusPubSub/OrderService/EndpointConfiguration.cs +++ /dev/null @@ -1,7 +0,0 @@ -using NServiceBus; -using NServiceBus.Hosting.Azure.Roles.Handlers; - -namespace OrderService -{ - public class EndpointConfiguration : IConfigureThisEndpoint, AsA_Worker { } -} \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/OrderService/Host.cs b/Samples/Azure/ServiceBusPubSub/OrderService/Host.cs deleted file mode 100644 index 2a2f8d372c6..00000000000 --- a/Samples/Azure/ServiceBusPubSub/OrderService/Host.cs +++ /dev/null @@ -1,6 +0,0 @@ -using NServiceBus.Hosting.Azure; - -namespace OrderService -{ - public class Host : RoleEntryPoint{} -} \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/OrderService/OrderService.csproj b/Samples/Azure/ServiceBusPubSub/OrderService/OrderService.csproj deleted file mode 100644 index 353eb45e189..00000000000 --- a/Samples/Azure/ServiceBusPubSub/OrderService/OrderService.csproj +++ /dev/null @@ -1,151 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {84ACA710-E5B3-4A46-B87A-7C12FB2527A8} - Library - Properties - OrderService - OrderService - v4.0 - 512 - Worker - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.ServiceBus.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - - - - - - - - - - - - - - - - - {3871CC9B-235F-4E60-98F7-FEF04DB1201B} - MyMessages - - - - - Designer - - - - - False - Microsoft .NET Framework 4 %28x86 and x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/OrderService/WorkerRole.cs b/Samples/Azure/ServiceBusPubSub/OrderService/WorkerRole.cs deleted file mode 100644 index 34da24466f9..00000000000 --- a/Samples/Azure/ServiceBusPubSub/OrderService/WorkerRole.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Collections.Specialized; -using System.Threading; -using Common.Logging; -using log4net.Core; -using Microsoft.WindowsAzure.ServiceRuntime; -using MyMessages; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Integration.Azure; - -namespace OrderService -{ - public class WorkerRole : RoleEntryPoint - { - public IBus Bus; - - public OrderList Orders = new OrderList(); - private ILog logger; - - public override void Run() - { - ConfigureLogging(); - - logger.Info("Starting order worker with instance id:" + RoleEnvironment.CurrentRoleInstance.Id); - - ConfigureNServiceBus(); - - while (true) - { - Thread.Sleep(10000); - - logger.Info("Approving orders"); - - foreach (var order in Orders.GetOrdersToApprove()) - { - var updatedOrder = Orders.UpdateStatus(order, OrderStatus.Approved); - - //publish update - var orderUpdatedEvent = Bus.CreateInstance(x => x.UpdatedOrder = updatedOrder); - Bus.Publish(orderUpdatedEvent); - } - } - } - - private void ConfigureNServiceBus() - { - - logger.Info("Initalizing NServiceBus"); - try - { - var config = Configure.With() - .SpringBuilder() - .AzureConfigurationSource() - .XmlSerializer() - .UnicastBus() - .LoadMessageHandlers() - .AzureQueuesTransport() - .IsTransactional(true) - .PurgeOnStartup(false) - .InMemorySubscriptionStorage();//we use inmemory storage until we have a sub storage for TableStorage or SQL Services - - Configure.Instance.Configurer.RegisterSingleton(Orders); - - Bus = config.CreateBus() - .Start(); - - } - catch (Exception ex) - { - logger.Error(ex); - throw; - } - - logger.Info("NServiceBus started"); - - } - - - private void ConfigureLogging() - { - LogManager.Adapter = new Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter(new NameValueCollection - { - {"configType","EXTERNAL"} - }); - - var appender = new AzureAppender - { - ConnectionStringKey = "AzureQueueConfig.ConnectionString", - Threshold = Level.Debug - }; - appender.ActivateOptions(); - - log4net.Config.BasicConfigurator.Configure(appender); - - logger = LogManager.GetLogger(typeof(WorkerRole)); - } - } -} diff --git a/Samples/Azure/ServiceBusPubSub/OrderWebSite/Global.asax.cs b/Samples/Azure/ServiceBusPubSub/OrderWebSite/Global.asax.cs deleted file mode 100644 index d9a073e95b7..00000000000 --- a/Samples/Azure/ServiceBusPubSub/OrderWebSite/Global.asax.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using NServiceBus.Integration.Azure; -using log4net; -using MyMessages; -using NServiceBus; -using NServiceBus.Config; - -namespace OrderWebSite -{ - public class Global : HttpApplication - { - public static IBus Bus; - public static IList Orders; - - private static readonly Lazy StartBus = new Lazy(ConfigureNServiceBus); - - private static IBus ConfigureNServiceBus() - { - var bus = Configure.WithWeb() - .DefaultBuilder() - .Log4Net(new AzureAppender()) - .AzureConfigurationSource() - .AzureServiceBusMessageQueue() - .QueuePerInstance() - .JsonSerializer() - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - - bus.Send(new LoadOrdersMessage()); - - return bus; - } - - protected void Application_Start(object sender, EventArgs e) - { - Orders = new List(); - } - - protected void Application_BeginRequest(object sender, EventArgs e) - { - Bus = StartBus.Value; - } - - protected void Application_AuthenticateRequest(object sender, EventArgs e) - { - - } - - protected void Application_Error(object sender, EventArgs e) - { - //get reference to the source of the exception chain - var ex = Server.GetLastError().GetBaseException(); - - LogManager.GetLogger(typeof(Global)).Error(ex.ToString()); - } - - protected void Session_End(object sender, EventArgs e) - { - - } - - protected void Application_End(object sender, EventArgs e) - { - - } - } -} \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/OrderWebSite/OrderWebSite.csproj b/Samples/Azure/ServiceBusPubSub/OrderWebSite/OrderWebSite.csproj deleted file mode 100644 index 1dfc1868376..00000000000 --- a/Samples/Azure/ServiceBusPubSub/OrderWebSite/OrderWebSite.csproj +++ /dev/null @@ -1,149 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F3798C2C-41DC-407C-9EBE-3F10C1CA9A76} - {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} - Library - Properties - OrderWebSite - OrderWebSite - v4.0 - - - 4.0 - - false - - - true - full - false - bin\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.ServiceBus.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - - - - - - - - - - - - - Designer - - - - - ASPXCodeBehind - Default.aspx - - - Default.aspx - - - Global.asax - - - - - - - - {3871CC9B-235F-4E60-98F7-FEF04DB1201B} - MyMessages - - - - - - - - - - - - - False - False - 8089 - / - - - False - False - - - False - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/OrderWebSite/Web.config b/Samples/Azure/ServiceBusPubSub/OrderWebSite/Web.config deleted file mode 100644 index 49a90256baf..00000000000 --- a/Samples/Azure/ServiceBusPubSub/OrderWebSite/Web.config +++ /dev/null @@ -1,18 +0,0 @@ - - - -
    - - - - - - - - - - - - - - diff --git a/Samples/Azure/ServiceBusPubSub/ServiceConfiguration.cscfg b/Samples/Azure/ServiceBusPubSub/ServiceConfiguration.cscfg deleted file mode 100644 index 01a5329b7b2..00000000000 --- a/Samples/Azure/ServiceBusPubSub/ServiceConfiguration.cscfg +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/ServiceDefinition.build.csdef b/Samples/Azure/ServiceBusPubSub/ServiceDefinition.build.csdef deleted file mode 100644 index ee0a2c15a07..00000000000 --- a/Samples/Azure/ServiceBusPubSub/ServiceDefinition.build.csdef +++ /dev/null @@ -1,55 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/ServiceBusPubSub/ServiceDefinition.csdef b/Samples/Azure/ServiceBusPubSub/ServiceDefinition.csdef deleted file mode 100644 index bae95d7a62b..00000000000 --- a/Samples/Azure/ServiceBusPubSub/ServiceDefinition.csdef +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/App.config b/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/App.config deleted file mode 100644 index 4397dfd5e7b..00000000000 --- a/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/App.config +++ /dev/null @@ -1,25 +0,0 @@ - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/MyServer.csproj b/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/MyServer.csproj deleted file mode 100644 index 849b47e5b08..00000000000 --- a/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/MyServer.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {5B4F9AC7-B891-4D6A-8804-12B6AF89BE53} - Exe - Properties - MyServer - MyServer - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - MyServer.Program - - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.ServiceBus.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - ..\..\..\..\binaries\NServiceBus.Timeout.Hosting.Azure.dll - - - - - - - - - - - - - - - - - - Designer - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Integration - - \ No newline at end of file diff --git a/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/MyServer.csproj.user b/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/MyServer.csproj.user deleted file mode 100644 index 2fe2a16434f..00000000000 --- a/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/MyServer.csproj.user +++ /dev/null @@ -1,7 +0,0 @@ - - - - Project - - - \ No newline at end of file diff --git a/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/Program.cs b/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/Program.cs deleted file mode 100644 index 8562b559cc7..00000000000 --- a/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/Program.cs +++ /dev/null @@ -1,76 +0,0 @@ -using NServiceBus.Timeout.Hosting.Azure; - -namespace MyServer -{ - using System; - using DeferedProcessing; - using NServiceBus; - using Saga; - - public class Program - { - public static IBus Bus { get; set; } - - static void Main(string[] args) - { - BootstrapNServiceBus(); - - Run(); - } - - public static void Run() - { - Console.WriteLine("Press 'S' to start the saga"); - Console.WriteLine("Press 'D' to defer a message 10 seconds"); - Console.WriteLine("To exit, press Ctrl + C"); - - string cmd; - - while ((cmd = Console.ReadKey().Key.ToString().ToLower()) != "q") - { - switch (cmd) - { - case "s": - StartSaga(); - break; - - case "d": - DeferMessage(); - break; - } - } - } - - static void DeferMessage() - { - Bus.Defer(TimeSpan.FromSeconds(10), new DeferredMessage()); - Console.WriteLine(string.Format("{0} - {1}", DateTime.Now.ToLongTimeString(), "Sent a message that is deferred for 10 seconds")); - } - - static void StartSaga() - { - Bus.SendLocal(new StartSagaMessage - { - OrderId = Guid.NewGuid() - }); - Console.WriteLine(string.Format("{0} - {1}", DateTime.Now.ToLongTimeString(), "Saga start message sent")); - } - - - private static void BootstrapNServiceBus() - { - Bus = Configure.With() - .DefaultBuilder() - .AzureServiceBusMessageQueue() - .JsonSerializer() - .RunTimeoutManager() - .UseAzureTimeoutPersister() - .ListenOnAzureServiceBusQueues() - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - } - } -} \ No newline at end of file diff --git a/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/Saga/SimpleSaga.cs b/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/Saga/SimpleSaga.cs deleted file mode 100644 index a2a9f819363..00000000000 --- a/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/Saga/SimpleSaga.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace MyServer.Saga -{ - using System; - using NServiceBus.Saga; - - public class SimpleSaga:Saga, - IAmStartedByMessages, - IHandleTimeouts - { - public void Handle(StartSagaMessage message) - { - Data.OrderId = message.OrderId; - var someState = new Random().Next(10); - - RequestUtcTimeout(TimeSpan.FromSeconds(10), someState); - LogMessage("v2.6 Timeout (10s) requested with state: " + someState); - } - - public override void Timeout(object state) - { - LogMessage("v2.6 Timeout fired, with state: " + state); - - var someState = new Random().Next(10); - - LogMessage("Requesting a custom timeout v3.0 style, state: " + someState); - RequestUtcTimeout(TimeSpan.FromSeconds(10), new MyTimeOutState - { - SomeValue = someState - }); - } - - public override void ConfigureHowToFindSaga() - { - ConfigureMapping(s => s.OrderId, m => m.OrderId); - } - - void LogMessage(string message) - { - Console.WriteLine(string.Format("{0} - {1}", DateTime.Now.ToLongTimeString(),message)); - } - - public void Timeout(MyTimeOutState state) - { - LogMessage("v3.0 Timeout fired, with state: " + state.SomeValue); - - LogMessage("Marking the saga as complete, be aware that this will remove the document from the storage (RavenDB)"); - MarkAsComplete(); - } - } -} \ No newline at end of file diff --git a/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/Saga/SimpleSagaData.cs b/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/Saga/SimpleSagaData.cs deleted file mode 100644 index e9180545e20..00000000000 --- a/Samples/Azure/TimeoutManagerListeningOnServiceBusQueues/MyServer/Saga/SimpleSagaData.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace MyServer.Saga -{ - using System; - using NServiceBus.Saga; - - public class SimpleSagaData : ISagaEntity - { - public Guid Id { get; set; } - public string Originator { get; set; } - public string OriginalMessageId { get; set; } - - public Guid OrderId { get; set; } - } -} \ No newline at end of file diff --git a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/App.config b/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/App.config deleted file mode 100644 index aa16dd6a09b..00000000000 --- a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/App.config +++ /dev/null @@ -1,25 +0,0 @@ - - - -
    -
    -
    -
    - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/DeferedProcessing/DeferredMessage.cs b/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/DeferedProcessing/DeferredMessage.cs deleted file mode 100644 index 2d75a705cd1..00000000000 --- a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/DeferedProcessing/DeferredMessage.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace MyServer.DeferedProcessing -{ - using NServiceBus; - - public class DeferredMessage:IMessage - { - - } -} \ No newline at end of file diff --git a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/MyServer.csproj b/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/MyServer.csproj deleted file mode 100644 index e5cf0a83781..00000000000 --- a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/MyServer.csproj +++ /dev/null @@ -1,103 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {5B4F9AC7-B891-4D6A-8804-12B6AF89BE53} - Exe - Properties - MyServer - MyServer - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - MyServer.Program - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\binaries\NServiceBus.dll - - - ..\..\..\..\binaries\NServiceBus.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\..\binaries\NServiceBus.Hosting.Azure.dll - - - ..\..\..\..\binaries\NServiceBus.NHibernate.dll - - - ..\..\..\..\binaries\NServiceBus.Timeout.Hosting.Azure.dll - - - - - - - - - - - - - - - - - - Designer - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Integration - - \ No newline at end of file diff --git a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/MyServer.csproj.user b/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/MyServer.csproj.user deleted file mode 100644 index 975a3d7dc39..00000000000 --- a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/MyServer.csproj.user +++ /dev/null @@ -1,7 +0,0 @@ - - - - - Project - - \ No newline at end of file diff --git a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/Program.cs b/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/Program.cs deleted file mode 100644 index 70803439268..00000000000 --- a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/Program.cs +++ /dev/null @@ -1,77 +0,0 @@ -using NServiceBus.Timeout.Hosting.Azure; - -namespace MyServer -{ - using System; - using DeferedProcessing; - using NServiceBus; - using Saga; - - public class Program - { - public static IBus Bus { get; set; } - - static void Main(string[] args) - { - BootstrapNServiceBus(); - - Run(); - } - - public static void Run() - { - Console.WriteLine("Press 'S' to start the saga"); - Console.WriteLine("Press 'D' to defer a message 10 seconds"); - Console.WriteLine("To exit, press Ctrl + C"); - - string cmd; - - while ((cmd = Console.ReadKey().Key.ToString().ToLower()) != "q") - { - switch (cmd) - { - case "s": - StartSaga(); - break; - - case "d": - DeferMessage(); - break; - } - } - } - - static void DeferMessage() - { - Bus.Defer(TimeSpan.FromSeconds(10), new DeferredMessage()); - Console.WriteLine(string.Format("{0} - {1}", DateTime.Now.ToLongTimeString(), "Sent a message that is deferred for 10 seconds")); - } - - static void StartSaga() - { - Bus.SendLocal(new StartSagaMessage - { - OrderId = Guid.NewGuid() - }); - Console.WriteLine(string.Format("{0} - {1}", DateTime.Now.ToLongTimeString(), "Saga start message sent")); - } - - - private static void BootstrapNServiceBus() - { - Bus = Configure.With() - .DefaultBuilder() - .AzureMessageQueue() - .JsonSerializer() - .RunTimeoutManager() - .UseAzureTimeoutPersister() - .ListenOnAzureStorageQueues() - .Sagas().AzureSagaPersister().NHibernateUnitOfWork() - .UnicastBus() - .LoadMessageHandlers() - .IsTransactional(true) - .CreateBus() - .Start(); - } - } -} \ No newline at end of file diff --git a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/Saga/MyTimeOutState.cs b/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/Saga/MyTimeOutState.cs deleted file mode 100644 index bdf73aca924..00000000000 --- a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/Saga/MyTimeOutState.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace MyServer.Saga -{ - using NServiceBus.Saga; - - public class MyTimeOutState: ITimeoutState - { - public int SomeValue { get; set; } - } -} \ No newline at end of file diff --git a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/Saga/SimpleSaga.cs b/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/Saga/SimpleSaga.cs deleted file mode 100644 index a00d99de2d6..00000000000 --- a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/Saga/SimpleSaga.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace MyServer.Saga -{ - using System; - using NServiceBus.Saga; - - public class SimpleSaga: Saga, - IAmStartedByMessages, - IHandleTimeouts - { - public void Handle(StartSagaMessage message) - { - Data.OrderId = message.OrderId; - var someState = new Random().Next(10); - - RequestUtcTimeout(TimeSpan.FromSeconds(10), someState); - LogMessage("v2.6 Timeout (10s) requested with state: " + someState); - } - - public override void Timeout(object state) - { - LogMessage("v2.6 Timeout fired, with state: " + state); - - var someState = new Random().Next(10); - - LogMessage("Requesting a custom timeout v3.0 style, state: " + someState); - RequestUtcTimeout(TimeSpan.FromSeconds(10), new MyTimeOutState - { - SomeValue = someState - }); - } - - public override void ConfigureHowToFindSaga() - { - ConfigureMapping(s => s.OrderId, m => m.OrderId); - } - - void LogMessage(string message) - { - Console.WriteLine(string.Format("{0} - {1}", DateTime.Now.ToLongTimeString(),message)); - } - - public void Timeout(MyTimeOutState state) - { - LogMessage("v3.0 Timeout fired, with state: " + state.SomeValue); - - LogMessage("Marking the saga as complete, be aware that this will remove the document from the storage"); - MarkAsComplete(); - } - } -} \ No newline at end of file diff --git a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/Saga/SimpleSagaData.cs b/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/Saga/SimpleSagaData.cs deleted file mode 100644 index 95619d14b97..00000000000 --- a/Samples/Azure/TimeoutManagerListeningOnStorageQueues/MyServer/Saga/SimpleSagaData.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace MyServer.Saga -{ - using System; - using NServiceBus.Saga; - - public class SimpleSagaData : ISagaEntity - { - public virtual Guid Id { get; set; } - public virtual string Originator { get; set; } - public virtual string OriginalMessageId { get; set; } - - public virtual Guid OrderId { get; set; } - } -} \ No newline at end of file diff --git a/Samples/DataBus/.nuget/NuGet.exe b/Samples/DataBus/.nuget/NuGet.exe deleted file mode 100644 index ddc91051bc4..00000000000 Binary files a/Samples/DataBus/.nuget/NuGet.exe and /dev/null differ diff --git a/Samples/DataBus/DataBus.sln b/Samples/DataBus/DataBus.sln deleted file mode 100644 index 7904596652e..00000000000 --- a/Samples/DataBus/DataBus.sln +++ /dev/null @@ -1,38 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sender", "Sender\Sender.csproj", "{D04CF1FC-C4C0-4959-A817-2BC68770CA9B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Receiver", "Receiver\Receiver.csproj", "{6987F415-B4D5-4380-ADED-EED5AF170608}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Receiver.Messages", "Receiver.Messages\Receiver.Messages.csproj", "{E4A4B35E-AFD3-456C-A5AC-4A88AAD77156}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{11267265-37F8-44CC-8C68-9375E8516EF1}" - ProjectSection(SolutionItems) = preProject - .nuget\NuGet.exe = .nuget\NuGet.exe - .nuget\NuGet.targets = .nuget\NuGet.targets - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D04CF1FC-C4C0-4959-A817-2BC68770CA9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D04CF1FC-C4C0-4959-A817-2BC68770CA9B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D04CF1FC-C4C0-4959-A817-2BC68770CA9B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D04CF1FC-C4C0-4959-A817-2BC68770CA9B}.Release|Any CPU.Build.0 = Release|Any CPU - {6987F415-B4D5-4380-ADED-EED5AF170608}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6987F415-B4D5-4380-ADED-EED5AF170608}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6987F415-B4D5-4380-ADED-EED5AF170608}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6987F415-B4D5-4380-ADED-EED5AF170608}.Release|Any CPU.Build.0 = Release|Any CPU - {E4A4B35E-AFD3-456C-A5AC-4A88AAD77156}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E4A4B35E-AFD3-456C-A5AC-4A88AAD77156}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E4A4B35E-AFD3-456C-A5AC-4A88AAD77156}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E4A4B35E-AFD3-456C-A5AC-4A88AAD77156}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Samples/DataBus/DataBus.suo b/Samples/DataBus/DataBus.suo deleted file mode 100644 index eb80e7c3b7c..00000000000 Binary files a/Samples/DataBus/DataBus.suo and /dev/null differ diff --git a/Samples/DataBus/Receiver.Messages/AnotherMessageWithLargePayload.cs b/Samples/DataBus/Receiver.Messages/AnotherMessageWithLargePayload.cs deleted file mode 100644 index 095a4c95b11..00000000000 --- a/Samples/DataBus/Receiver.Messages/AnotherMessageWithLargePayload.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Receiver.Messages -{ - using NServiceBus; - - public class AnotherMessageWithLargePayload : ICommand - { - public byte[]LargeBlob { get; set; } - } -} \ No newline at end of file diff --git a/Samples/DataBus/Receiver.Messages/MessageWithLargePayload.cs b/Samples/DataBus/Receiver.Messages/MessageWithLargePayload.cs deleted file mode 100644 index 6b19c70a222..00000000000 --- a/Samples/DataBus/Receiver.Messages/MessageWithLargePayload.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Receiver.Messages -{ - using NServiceBus; - - [TimeToBeReceived("00:01:00")]//the data bus is allowed to clean up transmitted properties older than the TTBR - public class MessageWithLargePayload : ICommand - { - public string SomeProperty { get; set; } - public DataBusProperty LargeBlob { get; set; } - } -} diff --git a/Samples/DataBus/Receiver.Messages/Properties/AssemblyInfo.cs b/Samples/DataBus/Receiver.Messages/Properties/AssemblyInfo.cs deleted file mode 100644 index 946d71fb717..00000000000 --- a/Samples/DataBus/Receiver.Messages/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Receiver.Messages")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Receiver.Messages")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3a3ba19e-1d4c-4f83-9c76-5f408c8f13c7")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/DataBus/Receiver.Messages/Receiver.Messages.csproj b/Samples/DataBus/Receiver.Messages/Receiver.Messages.csproj deleted file mode 100644 index 742e2b37867..00000000000 --- a/Samples/DataBus/Receiver.Messages/Receiver.Messages.csproj +++ /dev/null @@ -1,58 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {E4A4B35E-AFD3-456C-A5AC-4A88AAD77156} - Library - Properties - Receiver.Messages - Receiver.Messages - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/DataBus/Receiver/App.config b/Samples/DataBus/Receiver/App.config deleted file mode 100644 index 5b25908f167..00000000000 --- a/Samples/DataBus/Receiver/App.config +++ /dev/null @@ -1,10 +0,0 @@ - - - -
    -
    - - - - - \ No newline at end of file diff --git a/Samples/DataBus/Receiver/EndpointConfig.cs b/Samples/DataBus/Receiver/EndpointConfig.cs deleted file mode 100644 index f616ff66a0a..00000000000 --- a/Samples/DataBus/Receiver/EndpointConfig.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Receiver -{ - using NServiceBus; - - public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization - { - public static string BasePath = "..\\..\\..\\storage"; - - public void Init() - { - Configure.With() - .NinjectBuilder() - .FileShareDataBus(BasePath) - .UnicastBus(); - } - } -} diff --git a/Samples/DataBus/Receiver/MessageWithLargePayloadHandler.cs b/Samples/DataBus/Receiver/MessageWithLargePayloadHandler.cs deleted file mode 100644 index 20a79211555..00000000000 --- a/Samples/DataBus/Receiver/MessageWithLargePayloadHandler.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Receiver -{ - using System; - using Messages; - using NServiceBus; - - public class MessageWithLargePayloadHandler : IHandleMessages - { - public void Handle(MessageWithLargePayload message) - { - Console.WriteLine("Message received, size of blob property: " + message.LargeBlob.Value.Length + " Bytes"); - } - } -} \ No newline at end of file diff --git a/Samples/DataBus/Receiver/Properties/AssemblyInfo.cs b/Samples/DataBus/Receiver/Properties/AssemblyInfo.cs deleted file mode 100644 index 43aaef22474..00000000000 --- a/Samples/DataBus/Receiver/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Receiver")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Receiver")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6108a9fd-0953-4c1b-bf60-396294920d32")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/DataBus/Receiver/Receiver.csproj b/Samples/DataBus/Receiver/Receiver.csproj deleted file mode 100644 index 08100a929b0..00000000000 --- a/Samples/DataBus/Receiver/Receiver.csproj +++ /dev/null @@ -1,84 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {6987F415-B4D5-4380-ADED-EED5AF170608} - Library - Properties - Receiver - Receiver - v4.0 - 512 - ..\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\binaries\log4net.dll - - - ..\packages\Ninject.3.0.0.15\lib\net40\Ninject.dll - - - ..\packages\Ninject.Extensions.ContextPreservation.3.0.0.8\lib\net40\Ninject.Extensions.ContextPreservation.dll - - - ..\packages\Ninject.Extensions.NamedScope.3.0.0.5\lib\net40\Ninject.Extensions.NamedScope.dll - - - ..\..\..\binaries\NServiceBus.dll - - - ..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\binaries\NServiceBus.Host.exe - - - ..\..\..\binaries\containers\ninject\NServiceBus.ObjectBuilder.Ninject.dll - - - - - - - - - - - - - - - - {E4A4B35E-AFD3-456C-A5AC-4A88AAD77156} - Receiver.Messages - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - - - \ No newline at end of file diff --git a/Samples/DataBus/Sender/App.config b/Samples/DataBus/Sender/App.config deleted file mode 100644 index 7d32dc34251..00000000000 --- a/Samples/DataBus/Sender/App.config +++ /dev/null @@ -1,17 +0,0 @@ - - - -
    -
    -
    - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/DataBus/Sender/EndpointConfig.cs b/Samples/DataBus/Sender/EndpointConfig.cs deleted file mode 100644 index d9448a354aa..00000000000 --- a/Samples/DataBus/Sender/EndpointConfig.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace Sender -{ - using NServiceBus; - - public class EndpointConfig : IConfigureThisEndpoint, AsA_Client, IWantCustomInitialization - { - public static string BasePath = "..\\..\\..\\storage"; - - public void Init() - { - Configure.With() - .AutofacBuilder() - .FileShareDataBus(BasePath) - .UnicastBus(); - } - } -} diff --git a/Samples/DataBus/Sender/Properties/AssemblyInfo.cs b/Samples/DataBus/Sender/Properties/AssemblyInfo.cs deleted file mode 100644 index 22cce5d7524..00000000000 --- a/Samples/DataBus/Sender/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Sender")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Sender")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("0e34af25-82c4-4b41-95ab-6dc14a3a4ea8")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/DataBus/Sender/Sender.csproj b/Samples/DataBus/Sender/Sender.csproj deleted file mode 100644 index 66c244bc9aa..00000000000 --- a/Samples/DataBus/Sender/Sender.csproj +++ /dev/null @@ -1,83 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {D04CF1FC-C4C0-4959-A817-2BC68770CA9B} - Library - Properties - Sender - Sender - v4.0 - 512 - ..\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\Autofac.2.6.1.841\lib\NET40\Autofac.dll - - - ..\packages\Autofac.2.6.1.841\lib\NET40\Autofac.Configuration.dll - - - ..\..\..\binaries\log4net.dll - - - ..\..\..\binaries\NServiceBus.dll - - - ..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\binaries\NServiceBus.Host.exe - - - ..\..\..\binaries\containers\autofac\NServiceBus.ObjectBuilder.Autofac.dll - - - - - - - - - - - - {E4A4B35E-AFD3-456C-A5AC-4A88AAD77156} - Receiver.Messages - - - - - Designer - - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - - - \ No newline at end of file diff --git a/Samples/DataBus/Sender/SendingEndpoint.cs b/Samples/DataBus/Sender/SendingEndpoint.cs deleted file mode 100644 index ada285bb72a..00000000000 --- a/Samples/DataBus/Sender/SendingEndpoint.cs +++ /dev/null @@ -1,65 +0,0 @@ -namespace Sender -{ - using System; - using NServiceBus; - using Receiver.Messages; - - public class SendingEndpoint : IWantToRunAtStartup - { - readonly IBus bus; - - public SendingEndpoint(IBus bus) - { - this.bus = bus; - } - - public void Run() - { - Console.WriteLine("Press 'Enter' to send a large message (>4MB)"); - Console.WriteLine("Press 'E' to send a message that will exceed the limit and throw"); - Console.WriteLine("To exit, press Ctrl + C"); - - while (true) - { - var key = Console.ReadKey(); - - if (key.Key == ConsoleKey.E) - SendMessageThatIsLargerThanMsmqCanHandle(); - else if (key.Key == ConsoleKey.Enter) - { - bus.Send(m => - { - m.SomeProperty = - "This message contains a large blob that will be sent on the data bus"; - m.LargeBlob = - new DataBusProperty(new byte[1024*1024*5]); - //5MB - }); - - Console.WriteLine("Message sent, the payload is stored in: " + EndpointConfig.BasePath); - } - } - } - - void SendMessageThatIsLargerThanMsmqCanHandle() - { - try - { - bus.Send(m => - { - m.LargeBlob = new byte[1024 * 1024 * 5];//5MB - }); - - } - catch (Exception ex) - { - Console.WriteLine(ex); - } - - } - - public void Stop() - { - } - } -} \ No newline at end of file diff --git a/Samples/DataBus/Sender/packages.config b/Samples/DataBus/Sender/packages.config deleted file mode 100644 index 3e5116a8c8c..00000000000 --- a/Samples/DataBus/Sender/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Samples/DataBus/packages/repositories.config b/Samples/DataBus/packages/repositories.config deleted file mode 100644 index 6a6c68ad2f5..00000000000 --- a/Samples/DataBus/packages/repositories.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Samples/Encryption/.nuget/NuGet.exe b/Samples/Encryption/.nuget/NuGet.exe deleted file mode 100644 index ddc91051bc4..00000000000 Binary files a/Samples/Encryption/.nuget/NuGet.exe and /dev/null differ diff --git a/Samples/Encryption/Client/App.config b/Samples/Encryption/Client/App.config deleted file mode 100644 index 4eff05c4a67..00000000000 --- a/Samples/Encryption/Client/App.config +++ /dev/null @@ -1,27 +0,0 @@ - - - -
    -
    -
    - - - - - - - - - - - - - - - - - - diff --git a/Samples/Encryption/Client/Client.cs b/Samples/Encryption/Client/Client.cs deleted file mode 100644 index 8467660d156..00000000000 --- a/Samples/Encryption/Client/Client.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using NServiceBus; -using Messages; - -namespace Client -{ - using System.Collections.Generic; - using NServiceBus.Encryption.Config; - - public class EndpointConfig : IConfigureThisEndpoint, AsA_Client {} - - public class SecurityConfig : IWantCustomInitialization - { - public void Init() - { - Configure.Instance.RijndaelEncryptionService(); - //.DisableCompatibilityWithNSB2();//uncomment this line to turn off compatibility with2.X endpoints - } - } - - public class Runner : IWantToRunAtStartup - { - public void Run() - { - Console.WriteLine("Press 'Enter' to send a message."); - while (Console.ReadLine() != null) - { - Bus.Send(m => - { - m.Secret = "betcha can't guess my secret"; - m.SubProperty = new MySecretSubProperty {Secret = "My sub secret"}; - m.CreditCards = new List - { - new CreditCardDetails{ValidTo = DateTime.UtcNow.AddYears(1), Number = "312312312312312"}, - new CreditCardDetails{ValidTo = DateTime.UtcNow.AddYears(2), Number = "543645546546456"} - }; - }); - } - } - - public void Stop() - { - } - - public IBus Bus { get; set; } - } -} diff --git a/Samples/Encryption/Client/Client.csproj b/Samples/Encryption/Client/Client.csproj deleted file mode 100644 index c08c3ca60e5..00000000000 --- a/Samples/Encryption/Client/Client.csproj +++ /dev/null @@ -1,123 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9AF57290-9CEE-4934-BDB4-D201F1EABE49} - Library - Properties - Client - Client - v4.0 - 512 - - - - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\binaries\NServiceBus.Host.exe - - - - 3.5 - - - 3.5 - - - 3.5 - - - - - - - - - - - {E62F2DF8-9E8F-4512-9FD9-C97C97AEC15A} - Messages - - - - - Designer - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - AllRules.ruleset - - \ No newline at end of file diff --git a/Samples/Encryption/Encryption.sln b/Samples/Encryption/Encryption.sln deleted file mode 100644 index d0b09e2f3c9..00000000000 --- a/Samples/Encryption/Encryption.sln +++ /dev/null @@ -1,38 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Messages", "Messages\Messages.csproj", "{E62F2DF8-9E8F-4512-9FD9-C97C97AEC15A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client", "Client\Client.csproj", "{9AF57290-9CEE-4934-BDB4-D201F1EABE49}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Server", "Server\Server.csproj", "{2FAF88E7-8FC9-4AFA-B265-9085F983C702}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{59CA4005-F49B-4592-8B35-E5036D106993}" - ProjectSection(SolutionItems) = preProject - .nuget\NuGet.exe = .nuget\NuGet.exe - .nuget\NuGet.targets = .nuget\NuGet.targets - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E62F2DF8-9E8F-4512-9FD9-C97C97AEC15A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E62F2DF8-9E8F-4512-9FD9-C97C97AEC15A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E62F2DF8-9E8F-4512-9FD9-C97C97AEC15A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E62F2DF8-9E8F-4512-9FD9-C97C97AEC15A}.Release|Any CPU.Build.0 = Release|Any CPU - {9AF57290-9CEE-4934-BDB4-D201F1EABE49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9AF57290-9CEE-4934-BDB4-D201F1EABE49}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9AF57290-9CEE-4934-BDB4-D201F1EABE49}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9AF57290-9CEE-4934-BDB4-D201F1EABE49}.Release|Any CPU.Build.0 = Release|Any CPU - {2FAF88E7-8FC9-4AFA-B265-9085F983C702}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2FAF88E7-8FC9-4AFA-B265-9085F983C702}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2FAF88E7-8FC9-4AFA-B265-9085F983C702}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2FAF88E7-8FC9-4AFA-B265-9085F983C702}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Samples/Encryption/Encryption.suo b/Samples/Encryption/Encryption.suo deleted file mode 100644 index 34c7b5868fc..00000000000 Binary files a/Samples/Encryption/Encryption.suo and /dev/null differ diff --git a/Samples/Encryption/Messages/MessageWithSecretData.cs b/Samples/Encryption/Messages/MessageWithSecretData.cs deleted file mode 100644 index 9edea921f01..00000000000 --- a/Samples/Encryption/Messages/MessageWithSecretData.cs +++ /dev/null @@ -1,25 +0,0 @@ -using NServiceBus; - -namespace Messages -{ - using System; - using System.Collections.Generic; - - public class MessageWithSecretData : IMessage - { - public WireEncryptedString Secret { get; set; } - public MySecretSubProperty SubProperty{ get; set; } - public List CreditCards { get; set; } - } - - public class CreditCardDetails - { - public DateTime ValidTo { get; set; } - public WireEncryptedString Number { get; set; } - } - - public class MySecretSubProperty - { - public WireEncryptedString Secret { get; set; } - } -} diff --git a/Samples/Encryption/Messages/Messages.csproj b/Samples/Encryption/Messages/Messages.csproj deleted file mode 100644 index 52e697c2872..00000000000 --- a/Samples/Encryption/Messages/Messages.csproj +++ /dev/null @@ -1,102 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {E62F2DF8-9E8F-4512-9FD9-C97C97AEC15A} - Library - Properties - Messages - Messages - v4.0 - 512 - - - - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\NServiceBus.dll - - - - 3.5 - - - 3.5 - - - 3.5 - - - - - - - - - - - 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/Samples/Encryption/Server/App.config b/Samples/Encryption/Server/App.config deleted file mode 100644 index e1f8f229597..00000000000 --- a/Samples/Encryption/Server/App.config +++ /dev/null @@ -1,21 +0,0 @@ - - - -
    -
    -
    - - - - - - - - - - - - diff --git a/Samples/Encryption/Server/Server.cs b/Samples/Encryption/Server/Server.cs deleted file mode 100644 index 2798b07941d..00000000000 --- a/Samples/Encryption/Server/Server.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using Messages; -using NServiceBus; - -namespace Server -{ - public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization - { - public void Init() - { - Configure.With() - .StructureMapBuilder() - .RijndaelEncryptionService(); - } - } - - public class Handler : IHandleMessages - { - public void Handle(MessageWithSecretData message) - { - Console.Out.WriteLine("I know your secret - it's '" + message.Secret + "'"); - - if (message.SubProperty != null) - Console.Out.WriteLine("SubSecret: " + message.SubProperty.Secret); - - - if (message.CreditCards != null) - foreach (var creditCard in message.CreditCards) - Console.Out.WriteLine("CreditCard: {0} is valid to {1}", creditCard.Number.Value, creditCard.ValidTo); - } - } -} diff --git a/Samples/Encryption/Server/Server.csproj b/Samples/Encryption/Server/Server.csproj deleted file mode 100644 index d85fa0da032..00000000000 --- a/Samples/Encryption/Server/Server.csproj +++ /dev/null @@ -1,132 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2FAF88E7-8FC9-4AFA-B265-9085F983C702} - Library - Properties - Server - Server - v4.0 - 512 - - - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - ..\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\binaries\NServiceBus.Host.exe - - - ..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll - - - ..\packages\structuremap.2.6.3\lib\StructureMap.dll - - - - 3.5 - - - 3.5 - - - 3.5 - - - - - - - - - - - {E62F2DF8-9E8F-4512-9FD9-C97C97AEC15A} - Messages - - - - - Designer - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - AllRules.ruleset - - - \ No newline at end of file diff --git a/Samples/Encryption/Server/packages.config b/Samples/Encryption/Server/packages.config deleted file mode 100644 index a4bbf561cb4..00000000000 --- a/Samples/Encryption/Server/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Samples/Encryption/packages/repositories.config b/Samples/Encryption/packages/repositories.config deleted file mode 100644 index 1c328ba6a64..00000000000 --- a/Samples/Encryption/packages/repositories.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Samples/ErrorHandling/ErrorHandling.suo b/Samples/ErrorHandling/ErrorHandling.suo index fad9ecbb120..926eaff43c1 100644 Binary files a/Samples/ErrorHandling/ErrorHandling.suo and b/Samples/ErrorHandling/ErrorHandling.suo differ diff --git a/Samples/ErrorHandling/MyServer.Common/Application.cs b/Samples/ErrorHandling/MyServer.Common/Application.cs index 446a804b151..7f1d781988e 100644 --- a/Samples/ErrorHandling/MyServer.Common/Application.cs +++ b/Samples/ErrorHandling/MyServer.Common/Application.cs @@ -1,35 +1,35 @@ namespace MyServer.Common -{ - using System; - using NServiceBus; - - public class Application : IWantToRunAtStartup +{ + using System; + using NServiceBus; + + public class Application : IWantToRunWhenBusStartsAndStops { - public IBus Bus { get; set; } - - public void Run() - { - Console.WriteLine("Press 'S' to send a message that will throw an exception."); - Console.WriteLine("Press 'Q' to exit."); - - string cmd; - - while ((cmd = Console.ReadKey().Key.ToString().ToLower()) != "q") - { - switch (cmd) - { - case "s": - - var m = new MyMessage {Id = Guid.NewGuid()}; - Bus.Send(m); - - break; - } - } - } - + public IBus Bus { get; set; } + + public void Start() + { + Console.WriteLine("Press 'S' to send a message that will throw an exception."); + Console.WriteLine("Press 'Q' to exit."); + + string cmd; + + while ((cmd = Console.ReadKey().Key.ToString().ToLower()) != "q") + { + switch (cmd) + { + case "s": + + var m = new MyMessage {Id = Guid.NewGuid()}; + Bus.Send(m); + + break; + } + } + } + public void Stop() { } } -} \ No newline at end of file +} diff --git a/Samples/ErrorHandling/MyServer.Common/MyMessage.cs b/Samples/ErrorHandling/MyServer.Common/MyMessage.cs index 1bd056c8701..ef7284ebe45 100644 --- a/Samples/ErrorHandling/MyServer.Common/MyMessage.cs +++ b/Samples/ErrorHandling/MyServer.Common/MyMessage.cs @@ -1,8 +1,8 @@ namespace MyServer.Common -{ - using System; - using NServiceBus; - +{ + using System; + using NServiceBus; + public class MyMessage : ICommand { public Guid Id { get; set; } diff --git a/Samples/ErrorHandling/MyServer.Common/MyMessageHandler.cs b/Samples/ErrorHandling/MyServer.Common/MyMessageHandler.cs index 7c3704d725c..0c93f4fbcd9 100644 --- a/Samples/ErrorHandling/MyServer.Common/MyMessageHandler.cs +++ b/Samples/ErrorHandling/MyServer.Common/MyMessageHandler.cs @@ -1,18 +1,18 @@ namespace MyServer.Common -{ - using System; - using System.Collections.Concurrent; - using NServiceBus; - +{ + using System; + using System.Collections.Concurrent; + using NServiceBus; + public class MyMessageHandler : IHandleMessages { - private static readonly ConcurrentDictionary Last = new ConcurrentDictionary(); - + private static readonly ConcurrentDictionary Last = new ConcurrentDictionary(); + public IBus Bus{ get; set; } public void Handle(MyMessage message) - { - Console.WriteLine("ReplyToAddress: " + Bus.CurrentMessageContext.ReplyToAddress); + { + Console.WriteLine("ReplyToAddress: {0} MessageId:{1}",Bus.CurrentMessageContext.ReplyToAddress,Bus.CurrentMessageContext.Id); var numOfRetries = message.GetHeader(Headers.Retries); if (numOfRetries != null) @@ -22,7 +22,7 @@ public void Handle(MyMessage message) if (numOfRetries != value) { - Console.WriteLine("This is second level retry number {0}, MessageId: {1} (Notice that NSB keeps the ID consistent for all retries)", numOfRetries,Bus.CurrentMessageContext.Id); + Console.WriteLine("This is second level retry number {0}", numOfRetries); Last.AddOrUpdate(message.Id, numOfRetries, (key, oldValue) => numOfRetries); } } @@ -30,4 +30,4 @@ public void Handle(MyMessage message) throw new Exception("An exception occurred in the handler."); } } -} \ No newline at end of file +} diff --git a/Samples/ErrorHandling/MyServer.Common/MyServer.Common.csproj b/Samples/ErrorHandling/MyServer.Common/MyServer.Common.csproj index a34334e7cc9..d99fb3f6da8 100644 --- a/Samples/ErrorHandling/MyServer.Common/MyServer.Common.csproj +++ b/Samples/ErrorHandling/MyServer.Common/MyServer.Common.csproj @@ -21,6 +21,7 @@ DEBUG;TRACE prompt 4 + true pdbonly @@ -29,6 +30,7 @@ TRACE prompt 4 + true @@ -53,7 +55,7 @@ - + - - - - - - - - - - - - - - + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/ErrorHandling/MyServer.WithSLR/ChangeRetryPolicy.cs b/Samples/ErrorHandling/MyServer.WithSLR/ChangeRetryPolicy.cs index 57b74384343..b47d36d6144 100644 --- a/Samples/ErrorHandling/MyServer.WithSLR/ChangeRetryPolicy.cs +++ b/Samples/ErrorHandling/MyServer.WithSLR/ChangeRetryPolicy.cs @@ -1,46 +1,36 @@ -using System; -using NServiceBus.Config; -using NServiceBus.Management.Retries; -using NServiceBus.Management.Retries.Helpers; - -namespace MyServerWithSLR +namespace MyServerWithSLR { + using System; using NServiceBus; + using NServiceBus.SecondLevelRetries.Helpers; public class ChangeRetryPolicy : INeedInitialization { public void Init() { - // The default policy will defer the message 10*N (where N is number of retries) seconds 3 times. (60 sec total) - // For this sample we changed that to retry faster and only 3 times - SecondLevelRetries.RetryPolicy = (tm) => - { - if (TransportMessageHelpers.GetNumberOfRetries(tm) >= 3) - { - // To send back a value less than zero tells the - // SecondLevelRetry satellite not to retry this message - // anymore. - return TimeSpan.MinValue; - } + //// The default policy will defer the message 10*N (where N is number of retries) seconds 3 times. (60 sec total) + //// For this sample we changed that to retry faster and only 3 times + //Configure.Features.SecondLevelRetries(f => f.CustomRetryPolicy((tm) => + // { + // if (TransportMessageHelpers.GetNumberOfRetries(tm) >= 3) + // { + // // To send back a value less than zero tells the + // // SecondLevelRetry satellite not to retry this message + // // anymore. + // return TimeSpan.MinValue; + // } - // If an exception is thrown within SLR, we should send the message - // direct to the error queue since we can't do anything with it. - // if (TransportMessageHelpers.GetNumberOfRetries(tm) == 1) - // { - // throw new Exception("This exception it thrown from SLR, message should go to error queue"); - // } + // // If an exception is thrown within SLR, we should send the message + // // direct to the error queue since we can't do anything with it. + // // if (TransportMessageHelpers.GetNumberOfRetries(tm) == 1) + // // { + // // throw new Exception("This exception it thrown from SLR, message should go to error queue"); + // // } - // We will defer this message for 5 seconds, then send it back to the input queue (retry it) - return TimeSpan.FromSeconds(5); - }; + // // We will defer this message for 5 seconds, then send it back to the input queue (retry it) + // return TimeSpan.FromSeconds(5); + // })); - SecondLevelRetries.TimeoutPolicy = (tm) => - { - // This is used as a last chance to abort the retry logic. - // Retry according to the RetryPolicy Func, but not longer than this. - // In this case, we're just returning false, the retry timeout for this message never times out. - return false; - }; } } } \ No newline at end of file diff --git a/Samples/ErrorHandling/MyServer.WithSLR/EndpointConfig.cs b/Samples/ErrorHandling/MyServer.WithSLR/EndpointConfig.cs index 100aff216a0..e0950167722 100644 --- a/Samples/ErrorHandling/MyServer.WithSLR/EndpointConfig.cs +++ b/Samples/ErrorHandling/MyServer.WithSLR/EndpointConfig.cs @@ -1,6 +1,6 @@ -using NServiceBus; - -namespace MyServerWithSLR -{ - public class EndpointConfig : IConfigureThisEndpoint, AsA_Server { } -} +using NServiceBus; + +namespace MyServerWithSLR +{ + public class EndpointConfig : IConfigureThisEndpoint, AsA_Server { } +} diff --git a/Samples/ErrorHandling/MyServer.WithSLR/MyOwnFaultManager.cs b/Samples/ErrorHandling/MyServer.WithSLR/MyOwnFaultManager.cs index 8bc568fa29a..a273d9991be 100644 --- a/Samples/ErrorHandling/MyServer.WithSLR/MyOwnFaultManager.cs +++ b/Samples/ErrorHandling/MyServer.WithSLR/MyOwnFaultManager.cs @@ -1,8 +1,6 @@ using System; using NServiceBus; -using NServiceBus.Config; using NServiceBus.Faults; -using NServiceBus.Unicast.Transport; namespace MyServerWithSLR { @@ -10,25 +8,33 @@ public class MyOwnFaultManager : IManageMessageFailures, INeedInitialization { public void SerializationFailedForMessage(TransportMessage message, Exception e) { - Console.WriteLine("MyOwnFaultManager - SerializationFailedForMessage"); + LogMessage("SerializationFailedForMessage"); } public void ProcessingAlwaysFailsForMessage(TransportMessage message, Exception e) { - Console.WriteLine("MyOwnFaultManager - ProcessingAlwaysFailsForMessage"); + LogMessage("ProcessingAlwaysFailsForMessage"); + throw new Exception("Failure in the MyOwnFaultManager"); } public void Init(Address address) { - Console.WriteLine("MyOwnFaultManager - Init"); + faultManagerFor = address; + LogMessage("Init"); } public void Init() { // Enable this if you would like to use your own Fault Manager, this // will also disable SLR - - // Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + //Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); } + + void LogMessage(string message) + { + Console.WriteLine(string.Format("MyOwnFaultManager(Transport:{1}) - {0}", message, faultManagerFor)); + } + + Address faultManagerFor; } } \ No newline at end of file diff --git a/Samples/ErrorHandling/MyServer.WithSLR/MyServer.WithSLR.csproj b/Samples/ErrorHandling/MyServer.WithSLR/MyServer.WithSLR.csproj index 5d53cadcf9e..ba3f7e5cb09 100644 --- a/Samples/ErrorHandling/MyServer.WithSLR/MyServer.WithSLR.csproj +++ b/Samples/ErrorHandling/MyServer.WithSLR/MyServer.WithSLR.csproj @@ -1,85 +1,83 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {58851E2C-AC34-42EF-A44A-58E99F18E7FB} - Library - Properties - MyServerWithSLR - MyServerWithSLR - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - .exe - ..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - Designer - - - - - - {50D81C5C-2ED8-47DD-AD8B-F22856ACEA24} - MyServer.Common - - - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {58851E2C-AC34-42EF-A44A-58E99F18E7FB} + Library + Properties + MyServerWithSLR + MyServerWithSLR + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + False + ..\..\..\binaries\NServiceBus.dll + + + False + ..\..\..\binaries\NServiceBus.Core.dll + + + False + .exe + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + + + + Designer + + + + + {50D81C5C-2ED8-47DD-AD8B-F22856ACEA24} + MyServer.Common + + + - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Integration - + --> + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + NServiceBus.Integration + true + \ No newline at end of file diff --git a/Samples/ErrorHandling/MyServer.WithSLR/packages.config b/Samples/ErrorHandling/MyServer.WithSLR/packages.config deleted file mode 100644 index 153c8ccb18b..00000000000 --- a/Samples/ErrorHandling/MyServer.WithSLR/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Samples/ErrorHandling/MyServer.WithoutSLR/App.config b/Samples/ErrorHandling/MyServer.WithoutSLR/App.config index de3afd0e3cd..9db0533d80f 100644 --- a/Samples/ErrorHandling/MyServer.WithoutSLR/App.config +++ b/Samples/ErrorHandling/MyServer.WithoutSLR/App.config @@ -1,7 +1,7 @@  -
    +
    @@ -9,7 +9,7 @@ - + diff --git a/Samples/ErrorHandling/MyServer.WithoutSLR/DisableSLR.cs b/Samples/ErrorHandling/MyServer.WithoutSLR/DisableSLR.cs index 3b5c88bee99..aad514c5c19 100644 --- a/Samples/ErrorHandling/MyServer.WithoutSLR/DisableSLR.cs +++ b/Samples/ErrorHandling/MyServer.WithoutSLR/DisableSLR.cs @@ -1,14 +1,15 @@ using NServiceBus; -using NServiceBus.Config; namespace MyServerNoSLR { + using NServiceBus.Features; + public class DisableSLR : INeedInitialization { public void Init() { // Using code we disable the second level retries. - Configure.Instance.DisableSecondLevelRetries(); + Configure.Features.Disable(); } } } \ No newline at end of file diff --git a/Samples/ErrorHandling/MyServer.WithoutSLR/MyServer.WithoutSLR.csproj b/Samples/ErrorHandling/MyServer.WithoutSLR/MyServer.WithoutSLR.csproj index 676b854c03d..7ef0b863175 100644 --- a/Samples/ErrorHandling/MyServer.WithoutSLR/MyServer.WithoutSLR.csproj +++ b/Samples/ErrorHandling/MyServer.WithoutSLR/MyServer.WithoutSLR.csproj @@ -1,82 +1,80 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {43CB6673-3AF0-4D97-AD9F-EB1B9403C768} - Library - Properties - MyServerNoSLR - MyServerNoSLR - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - .exe - ..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - - - - {50D81C5C-2ED8-47DD-AD8B-F22856ACEA24} - MyServer.Common - - - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {43CB6673-3AF0-4D97-AD9F-EB1B9403C768} + Library + Properties + MyServerNoSLR + MyServerNoSLR + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + False + ..\..\..\binaries\NServiceBus.dll + + + False + ..\..\..\binaries\NServiceBus.Core.dll + + + False + .exe + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + + + + + + {50D81C5C-2ED8-47DD-AD8B-F22856ACEA24} + MyServer.Common + + + - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Integration - + --> + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + NServiceBus.Integration + true + \ No newline at end of file diff --git a/Samples/ErrorHandling/MyServer.WithoutSLR/packages.config b/Samples/ErrorHandling/MyServer.WithoutSLR/packages.config deleted file mode 100644 index 153c8ccb18b..00000000000 --- a/Samples/ErrorHandling/MyServer.WithoutSLR/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Samples/FtpSample/FtpSample.sln b/Samples/FtpSample/FtpSample.sln deleted file mode 100644 index c2f98be01cc..00000000000 --- a/Samples/FtpSample/FtpSample.sln +++ /dev/null @@ -1,32 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestClient", "TestClient\TestClient.csproj", "{75A2117A-2443-4677-88A1-88974C8F9A3C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestMessage", "TestMessage\TestMessage.csproj", "{33C480C2-37B9-4772-809A-9E4B522F1574}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestServer", "TestServer\TestServer.csproj", "{5FE8070B-D216-4C83-A05C-BEFAA90538E1}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {75A2117A-2443-4677-88A1-88974C8F9A3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {75A2117A-2443-4677-88A1-88974C8F9A3C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {75A2117A-2443-4677-88A1-88974C8F9A3C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {75A2117A-2443-4677-88A1-88974C8F9A3C}.Release|Any CPU.Build.0 = Release|Any CPU - {33C480C2-37B9-4772-809A-9E4B522F1574}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {33C480C2-37B9-4772-809A-9E4B522F1574}.Debug|Any CPU.Build.0 = Debug|Any CPU - {33C480C2-37B9-4772-809A-9E4B522F1574}.Release|Any CPU.ActiveCfg = Release|Any CPU - {33C480C2-37B9-4772-809A-9E4B522F1574}.Release|Any CPU.Build.0 = Release|Any CPU - {5FE8070B-D216-4C83-A05C-BEFAA90538E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5FE8070B-D216-4C83-A05C-BEFAA90538E1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5FE8070B-D216-4C83-A05C-BEFAA90538E1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5FE8070B-D216-4C83-A05C-BEFAA90538E1}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Samples/FtpSample/FtpSample.suo b/Samples/FtpSample/FtpSample.suo deleted file mode 100644 index 4fea5d1b653..00000000000 Binary files a/Samples/FtpSample/FtpSample.suo and /dev/null differ diff --git a/Samples/FtpSample/TestClient/App.config b/Samples/FtpSample/TestClient/App.config deleted file mode 100644 index d10aaabca28..00000000000 --- a/Samples/FtpSample/TestClient/App.config +++ /dev/null @@ -1,24 +0,0 @@ - - - -
    -
    -
    - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/FtpSample/TestClient/CommandSender.cs b/Samples/FtpSample/TestClient/CommandSender.cs deleted file mode 100644 index ce9c73320ca..00000000000 --- a/Samples/FtpSample/TestClient/CommandSender.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using NServiceBus; -using TestMessage; - -namespace TestClient -{ - class CommandSender : IWantToRunAtStartup - { - readonly Random random = new Random(); - - public IBus Bus { get; set; } - - public void Run() - { - Console.WriteLine("Press 'R' to send a request"); - Console.WriteLine("To exit, press Ctrl + C"); - - while (true) - { - var cmd = Console.ReadKey().Key.ToString().ToLower(); - switch (cmd) - { - case "r": - SendRequest(); - break; - } - } - } - - void SendRequest() - { - var msg = new FtpMessage {Id = random.Next(1000), Name = "John Smith"}; - - Bus.Send(msg); - - Console.WriteLine("Request sent id: " + msg.Id); - } - - public void Stop() - { - } - } -} \ No newline at end of file diff --git a/Samples/FtpSample/TestClient/EndpointConfig.cs b/Samples/FtpSample/TestClient/EndpointConfig.cs deleted file mode 100644 index dc90164af7a..00000000000 --- a/Samples/FtpSample/TestClient/EndpointConfig.cs +++ /dev/null @@ -1,17 +0,0 @@ -using NServiceBus; - -namespace TestClient -{ - public class EndpointConfig : AsA_Client, IWantCustomInitialization, IConfigureThisEndpoint - { - public void Init() - { - Configure.With() - .DefineEndpointName("localhost:1091") - .DefaultBuilder() - .FtpTransport() - .UnicastBus() - .LoadMessageHandlers(); - } - } -} diff --git a/Samples/FtpSample/TestClient/FtpResponseHandler.cs b/Samples/FtpSample/TestClient/FtpResponseHandler.cs deleted file mode 100644 index 4908bfe76e4..00000000000 --- a/Samples/FtpSample/TestClient/FtpResponseHandler.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using NServiceBus; -using TestMessage; - -namespace TestClient -{ - class FtpResponseHandler : IHandleMessages - { - public void Handle(FtpResponse message) - { - Console.WriteLine("Response received from server for request with id:" + message.ResponseId); - } - } -} diff --git a/Samples/FtpSample/TestClient/Properties/AssemblyInfo.cs b/Samples/FtpSample/TestClient/Properties/AssemblyInfo.cs deleted file mode 100644 index cfdb684f77a..00000000000 --- a/Samples/FtpSample/TestClient/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("TestClient")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("TestClient")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("2a29ab6e-948f-4652-be70-fe679c6d5e34")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/FtpSample/TestClient/TestClient.csproj b/Samples/FtpSample/TestClient/TestClient.csproj deleted file mode 100644 index b3556174543..00000000000 --- a/Samples/FtpSample/TestClient/TestClient.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {75A2117A-2443-4677-88A1-88974C8F9A3C} - Library - Properties - TestClient - TestClient - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - .exe - ..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - - - - - Designer - - - - - {33C480C2-37B9-4772-809A-9E4B522F1574} - TestMessage - - - - Program - $(MSBuildProjectDirectory)\$(OutputPath)NServiceBus.Host.exe - NServiceBus.Integration - - - - \ No newline at end of file diff --git a/Samples/FtpSample/TestMessage/FtpMessage.cs b/Samples/FtpSample/TestMessage/FtpMessage.cs deleted file mode 100644 index e828cca5d5f..00000000000 --- a/Samples/FtpSample/TestMessage/FtpMessage.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using NServiceBus; - -namespace TestMessage -{ - [Serializable] - public class FtpMessage : ICommand - { - public int Id { get; set; } - public String Name { get; set; } - } -} diff --git a/Samples/FtpSample/TestMessage/FtpResponse.cs b/Samples/FtpSample/TestMessage/FtpResponse.cs deleted file mode 100644 index 7129b34170b..00000000000 --- a/Samples/FtpSample/TestMessage/FtpResponse.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using NServiceBus; - -namespace TestMessage -{ - [Serializable] - public class FtpResponse : IMessage - { - public int Id { get; set; } - public Guid OtherData { get; set; } - public bool IsThisCool { get; set; } - public String Description { get; set; } - public int ResponseId { get; set; } - } -} diff --git a/Samples/FtpSample/TestMessage/Properties/AssemblyInfo.cs b/Samples/FtpSample/TestMessage/Properties/AssemblyInfo.cs deleted file mode 100644 index e871c966bb4..00000000000 --- a/Samples/FtpSample/TestMessage/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("TestMessage")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("TestMessage")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("cf83e5e7-c90e-43eb-9e48-5cfa2a982fd6")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/FtpSample/TestMessage/TestMessage.csproj b/Samples/FtpSample/TestMessage/TestMessage.csproj deleted file mode 100644 index bd719a2541f..00000000000 --- a/Samples/FtpSample/TestMessage/TestMessage.csproj +++ /dev/null @@ -1,59 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {33C480C2-37B9-4772-809A-9E4B522F1574} - Library - Properties - TestMessage - TestMessage - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/FtpSample/TestServer/App.config b/Samples/FtpSample/TestServer/App.config deleted file mode 100644 index ffdc5649294..00000000000 --- a/Samples/FtpSample/TestServer/App.config +++ /dev/null @@ -1,25 +0,0 @@ - - - -
    -
    -
    - - - - - - - - - - \ No newline at end of file diff --git a/Samples/FtpSample/TestServer/EndpointConfig.cs b/Samples/FtpSample/TestServer/EndpointConfig.cs deleted file mode 100644 index 8ece4c4d3c8..00000000000 --- a/Samples/FtpSample/TestServer/EndpointConfig.cs +++ /dev/null @@ -1,16 +0,0 @@ -using NServiceBus; - -namespace TestServer -{ - public class EndpointConfig : AsA_Server, IConfigureThisEndpoint, IWantCustomInitialization - { - public void Init() - { - Configure.With() - .DefaultBuilder() - .FtpTransport() - .UnicastBus() - .LoadMessageHandlers(); - } - } -} diff --git a/Samples/FtpSample/TestServer/FtpMessageHandler.cs b/Samples/FtpSample/TestServer/FtpMessageHandler.cs deleted file mode 100644 index 15b0066b512..00000000000 --- a/Samples/FtpSample/TestServer/FtpMessageHandler.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using NServiceBus; -using TestMessage; - -namespace TestServer -{ - public class FtpMessageHandler : IHandleMessages - { - public IBus Bus { get; set; } - - public void Handle(FtpMessage message) - { - Console.WriteLine("Request received with id:" + message.Id); - - var rep = new FtpResponse { Id = 500, OtherData = Guid.NewGuid(), IsThisCool = true, Description = "What the?", ResponseId = message.Id }; - Bus.Reply(rep); - } - } -} diff --git a/Samples/FtpSample/TestServer/Properties/AssemblyInfo.cs b/Samples/FtpSample/TestServer/Properties/AssemblyInfo.cs deleted file mode 100644 index 19ec4a9194b..00000000000 --- a/Samples/FtpSample/TestServer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("TestServer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("TestServer")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("d1497bc7-3c15-470e-b070-d1f6321d975f")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/FtpSample/TestServer/TestServer.csproj b/Samples/FtpSample/TestServer/TestServer.csproj deleted file mode 100644 index c10065b50ae..00000000000 --- a/Samples/FtpSample/TestServer/TestServer.csproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {5FE8070B-D216-4C83-A05C-BEFAA90538E1} - Library - Properties - TestServer - TestServer - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - .exe - ..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - - - - {33C480C2-37B9-4772-809A-9E4B522F1574} - TestMessage - - - - - Designer - - - - Program - $(MSBuildProjectDirectory)\$(OutputPath)NServiceBus.Host.exe - NServiceBus.Integration - - - - \ No newline at end of file diff --git a/Samples/FtpSample/readme.txt b/Samples/FtpSample/readme.txt deleted file mode 100644 index 20961c51f0a..00000000000 --- a/Samples/FtpSample/readme.txt +++ /dev/null @@ -1,14 +0,0 @@ -To successfully run this sample you need to set-up 2 ftp servers on your local machine. - -Environment Setup ------------------------------------------------------------------------------------------------------------------------- -Using IIS (or some other ftp server software), create 2 ftp servers (FtpSampleServer and FtpSampleClient) with anonymous authentication and listening on port 1090(FtpSampleServer) and port 1091(FtpSampleClient). -Set the physical path for FtpSampleServer to C:\Temp\FTPServer\receive (if you don't use this location see below). -Set the physical path for FtpSampleClient to C:\Temp\FTPClient\receive (if you don't use this location see below). -Make sure both ftp servers are started. - - -Custom configuration ------------------------------------------------------------------------------------------------------------------------- -If you have changed any of the ftp server ports, please make sure you update the TestClient App.config file and/or EndpointConfig.cs (.DefineEndpointName("localhost:1091")) -If you have used different physical paths for the ftp servers, please make sure you update both App.config files. \ No newline at end of file diff --git a/Samples/FullDuplex/.nuget/NuGet.Config b/Samples/FullDuplex/.nuget/NuGet.Config index 6a318ad9b75..67f8ea046ef 100644 --- a/Samples/FullDuplex/.nuget/NuGet.Config +++ b/Samples/FullDuplex/.nuget/NuGet.Config @@ -1,6 +1,6 @@ - - - - - + + + + + \ No newline at end of file diff --git a/Samples/FullDuplex/.nuget/NuGet.exe b/Samples/FullDuplex/.nuget/NuGet.exe index ddc91051bc4..4645f4b35e8 100644 Binary files a/Samples/FullDuplex/.nuget/NuGet.exe and b/Samples/FullDuplex/.nuget/NuGet.exe differ diff --git a/Samples/FullDuplex/.nuget/NuGet.targets b/Samples/FullDuplex/.nuget/NuGet.targets index 8993f4e5cb4..25380fea2aa 100644 --- a/Samples/FullDuplex/.nuget/NuGet.targets +++ b/Samples/FullDuplex/.nuget/NuGet.targets @@ -1,52 +1,52 @@ - - - - $(MSBuildProjectDirectory)\..\ - $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) - $(NuGetToolsPath)\nuget.exe - $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) - $([System.IO.Path]::Combine($(SolutionDir), "packages")) - $(TargetDir.Trim('\\')) - - - "" - - - false - - - false - - - "$(NuGetExePath)" install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" - "$(NuGetExePath)" pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols - - - - RestorePackages; - $(BuildDependsOn); - - - - - $(BuildDependsOn); - BuildPackage; - - - - - - - - - - - - - - - + + + + $(MSBuildProjectDirectory)\..\ + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $(NuGetToolsPath)\nuget.exe + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + $([System.IO.Path]::Combine($(SolutionDir), "packages")) + $(TargetDir.Trim('\\')) + + + "" + + + false + + + false + + + "$(NuGetExePath)" install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" + "$(NuGetExePath)" pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/FullDuplex/MyClient/ClientEndpoint.cs b/Samples/FullDuplex/MyClient/ClientEndpoint.cs index 87e8286c9c6..b711dd5423b 100644 --- a/Samples/FullDuplex/MyClient/ClientEndpoint.cs +++ b/Samples/FullDuplex/MyClient/ClientEndpoint.cs @@ -5,11 +5,11 @@ namespace MyClient { - public class ClientEndpoint : IWantToRunAtStartup + public class ClientEndpoint : IWantToRunWhenBusStartsAndStops { public IBus Bus { get; set; } - public void Run() + public void Start() { Console.WriteLine("Press 'Enter' to send a message.To exit, Ctrl + C"); diff --git a/Samples/FullDuplex/MyClient/DataResponseMessageHandler.cs b/Samples/FullDuplex/MyClient/DataResponseMessageHandler.cs index efe0e5abd21..5dbed57b278 100644 --- a/Samples/FullDuplex/MyClient/DataResponseMessageHandler.cs +++ b/Samples/FullDuplex/MyClient/DataResponseMessageHandler.cs @@ -11,13 +11,4 @@ public void Handle(DataResponseMessage message) Console.WriteLine("Response received with description: {0}", message.String); } } - - public class PreventSubscription : IWantCustomInitialization - { - public void Init() - { - //so we don't end up subscribing to DataResponseMessage - Configure.Instance.UnicastBus().DoNotAutoSubscribe(); - } - } } diff --git a/Samples/FullDuplex/MyClient/LoggingConfiguration.cs b/Samples/FullDuplex/MyClient/LoggingConfiguration.cs new file mode 100644 index 00000000000..c02016f700c --- /dev/null +++ b/Samples/FullDuplex/MyClient/LoggingConfiguration.cs @@ -0,0 +1,50 @@ +using NServiceBus; +using log4net.Appender; +using log4net.Layout; +using log4net.Core; + +namespace MyClient +{ + public class LoggingConfiguration : IConfigureLoggingForProfile + { + public void Configure(IConfigureThisEndpoint specifier) + { + SetLoggingLibrary.Log4Net(); + + var appender = new ColoredConsoleAppender() + { + Layout = new SimpleLayout(), + Threshold = Level.Debug + }; + + appender.AddMapping( + new ColoredConsoleAppender.LevelColors + { + Level = Level.Debug, + ForeColor = ColoredConsoleAppender.Colors.Purple + }); + appender.AddMapping( + new ColoredConsoleAppender.LevelColors + { + Level = Level.Info, + ForeColor = ColoredConsoleAppender.Colors.Green + }); + appender.AddMapping( + new ColoredConsoleAppender.LevelColors + { + Level = Level.Warn, + ForeColor = ColoredConsoleAppender.Colors.Yellow | ColoredConsoleAppender.Colors.HighIntensity + }); + appender.AddMapping( + new ColoredConsoleAppender.LevelColors + { + Level = Level.Error, + ForeColor = ColoredConsoleAppender.Colors.Red | ColoredConsoleAppender.Colors.HighIntensity + }); + + appender.ActivateOptions(); + + log4net.Config.BasicConfigurator.Configure(appender); + } + } +} \ No newline at end of file diff --git a/Samples/FullDuplex/MyClient/MyClient.csproj b/Samples/FullDuplex/MyClient/MyClient.csproj index 8a6ea309d58..69c17b1eac4 100644 --- a/Samples/FullDuplex/MyClient/MyClient.csproj +++ b/Samples/FullDuplex/MyClient/MyClient.csproj @@ -1,83 +1,86 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9F8E556C-0AFA-4C5D-B64F-AE9376ABF145} - library - Properties - MyClient - MyClient - - - - - v4.0 - - ..\..\FullDuplex\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - - - - - - {20F613ED-C871-477C-B1E4-48B96CACF794} - MyMessages - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {9F8E556C-0AFA-4C5D-B64F-AE9376ABF145} + library + Properties + MyClient + MyClient + + + + + v4.0 + + ..\..\FullDuplex\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + False + ..\..\..\binaries\log4net.dll + + + False + ..\..\..\binaries\NServiceBus.dll + + + False + ..\..\..\binaries\NServiceBus.Core.dll + + + False + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + + + + + + + + + + {20F613ED-C871-477C-B1E4-48B96CACF794} + MyMessages + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + \ No newline at end of file diff --git a/Samples/FullDuplex/MyMessages/MyMessages.csproj b/Samples/FullDuplex/MyMessages/MyMessages.csproj index 2cdab0c60d9..974f5954c95 100644 --- a/Samples/FullDuplex/MyMessages/MyMessages.csproj +++ b/Samples/FullDuplex/MyMessages/MyMessages.csproj @@ -1,63 +1,65 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {20F613ED-C871-477C-B1E4-48B96CACF794} - Library - Properties - MyMessages - MyMessages - - - - - v4.0 - - ..\..\FullDuplex\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {20F613ED-C871-477C-B1E4-48B96CACF794} + Library + Properties + MyMessages + MyMessages + + + + + v4.0 + + ..\..\FullDuplex\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + False + ..\..\..\binaries\NServiceBus.dll + + + + + + + + + + + + + + --> \ No newline at end of file diff --git a/Samples/FullDuplex/MyServer.Tests/MyServer.Tests.csproj b/Samples/FullDuplex/MyServer.Tests/MyServer.Tests.csproj index 820fbacd1ed..67378385245 100644 --- a/Samples/FullDuplex/MyServer.Tests/MyServer.Tests.csproj +++ b/Samples/FullDuplex/MyServer.Tests/MyServer.Tests.csproj @@ -1,91 +1,88 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1AB56FB7-ADB3-40DF-BBF4-53BAAE9A8F6F} - Library - Properties - MyServer.Tests - MyServer.Tests - v4.0 - 512 - - ..\..\FullDuplex\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Testing.dll - - - ..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll - - - ..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll - - - ..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll - - - - - - - - - - - - - - - - - - {20F613ED-C871-477C-B1E4-48B96CACF794} - MyMessages - - - {CA4DB5DB-88E3-45C2-92EC-ED1865FB83B6} - MyServer - - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {1AB56FB7-ADB3-40DF-BBF4-53BAAE9A8F6F} + Library + Properties + MyServer.Tests + MyServer.Tests + v4.0 + 512 + + ..\..\FullDuplex\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + False + ..\..\..\binaries\NServiceBus.dll + + + False + ..\..\..\binaries\NServiceBus.Testing.dll + + + False + ..\packages\NUnit.2.6.2\lib\nunit.framework.dll + + + + + + + + + + + + + + + + + + {20F613ED-C871-477C-B1E4-48B96CACF794} + MyMessages + + + {CA4DB5DB-88E3-45C2-92EC-ED1865FB83B6} + MyServer + + + + + + + + + --> \ No newline at end of file diff --git a/Samples/FullDuplex/MyServer.Tests/packages.config b/Samples/FullDuplex/MyServer.Tests/packages.config index 27a38197546..5c3ca54dd79 100644 --- a/Samples/FullDuplex/MyServer.Tests/packages.config +++ b/Samples/FullDuplex/MyServer.Tests/packages.config @@ -1,4 +1,4 @@ - - - + + + \ No newline at end of file diff --git a/Samples/FullDuplex/MyServer/App.config b/Samples/FullDuplex/MyServer/App.config index 132cf489c26..8bb60f80c90 100644 --- a/Samples/FullDuplex/MyServer/App.config +++ b/Samples/FullDuplex/MyServer/App.config @@ -1,7 +1,7 @@ -
    +
    @@ -12,7 +12,7 @@ --> - + diff --git a/Samples/FullDuplex/MyServer/EndpointConfig.cs b/Samples/FullDuplex/MyServer/EndpointConfig.cs index d8b734beb78..9fcdd331afb 100644 --- a/Samples/FullDuplex/MyServer/EndpointConfig.cs +++ b/Samples/FullDuplex/MyServer/EndpointConfig.cs @@ -1,7 +1,8 @@ using NServiceBus; namespace MyServer -{ - [EndpointSLA("00:00:30")] - public class EndpointConfig : IConfigureThisEndpoint, AsA_Server {} +{ + [EndpointSLA("00:00:30")] + public class EndpointConfig : IConfigureThisEndpoint, AsA_Server { + } } \ No newline at end of file diff --git a/Samples/FullDuplex/MyServer/LoggingConfiguration.cs b/Samples/FullDuplex/MyServer/LoggingConfiguration.cs new file mode 100644 index 00000000000..a315c1c4036 --- /dev/null +++ b/Samples/FullDuplex/MyServer/LoggingConfiguration.cs @@ -0,0 +1,14 @@ +using NServiceBus; + +namespace MyServer +{ + public class LoggingConfiguration : IConfigureLoggingForProfile + { + public void Configure(IConfigureThisEndpoint specifier) + { + SetLoggingLibrary.NLog(); + + NLog.Config.SimpleConfigurator.ConfigureForTargetLogging(new NLog.Targets.ColoredConsoleTarget()); + } + } +} \ No newline at end of file diff --git a/Samples/FullDuplex/MyServer/MyOwnMessageModule.cs b/Samples/FullDuplex/MyServer/MyOwnMessageModule.cs deleted file mode 100644 index 35ae97e53ae..00000000000 --- a/Samples/FullDuplex/MyServer/MyOwnMessageModule.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace MyServer -{ - using System; - using NServiceBus; - - public class MyOwnMessageModule : IMessageModule - { - - public void HandleBeginMessage() - { - LogMessage("Begin"); - } - - public void HandleEndMessage() - { - LogMessage("End"); - } - - public void HandleError() - { - LogMessage("Error"); - } - - void LogMessage(string message) - { - Console.WriteLine(string.Format("MyOwnMessageModule({0}) - MessageID: {1}", GetHashCode(), Bus.CurrentMessageContext.Id)); - } - - public IBus Bus { get; set; } - } -} \ No newline at end of file diff --git a/Samples/FullDuplex/MyServer/MyOwnUnitOfWork.cs b/Samples/FullDuplex/MyServer/MyOwnUnitOfWork.cs index db80fd0fa9f..1b1bed97ae1 100644 --- a/Samples/FullDuplex/MyServer/MyOwnUnitOfWork.cs +++ b/Samples/FullDuplex/MyServer/MyOwnUnitOfWork.cs @@ -1,60 +1,60 @@ -namespace MyServer -{ - using System; - using NServiceBus; - using NServiceBus.ObjectBuilder; - using NServiceBus.UnitOfWork; - - public class MyOwnUnitOfWork : IManageUnitsOfWork - { - public IMySession MySession { get; set; } - - public void Begin() - { - LogMessage("Begin"); - } - - public void End(Exception ex) - { - if (ex == null) - { - LogMessage("Commit"); - MySession.SaveChanges(); - } - else - LogMessage("Rollback, reason: " + ex); - } - - void LogMessage(string message) - { - Console.WriteLine(string.Format("UoW({0}) - {1}",GetHashCode(), message)); - } - } - - public interface IMySession - { - void SaveChanges(); - } - - public class ExampleSession:IMySession - { - public void SaveChanges() - { - Console.WriteLine(string.Format("ExampleSession({0}) - {1}", GetHashCode(), "Saving changes")); - } - } - - public class UoWIntitializer : IWantCustomInitialization - { - public void Init() - { - Configure.Instance.Configurer. - ConfigureComponent(DependencyLifecycle.InstancePerUnitOfWork); - - //this shows the new lambda feature introduced in NServiceBus 3.2.3 - Configure.Instance.Configurer. - ConfigureComponent(()=> new ExampleSession(),DependencyLifecycle.InstancePerUnitOfWork); - - } - } +namespace MyServer +{ + using System; + using NServiceBus; + using NServiceBus.UnitOfWork; + + public class MyOwnUnitOfWork : IManageUnitsOfWork + { + public IMySession MySession { get; set; } + + public void Begin() + { + LogMessage("Begin"); + } + + public void End(Exception ex) + { + if (ex == null) + { + LogMessage("Commit"); + MySession.SaveChanges(); + } + else + LogMessage("Rollback, reason: " + ex); + } + + private void LogMessage(string message) + { + Console.WriteLine("UoW({0}) - {1}", GetHashCode(), message); + } + } + + public interface IMySession + { + void SaveChanges(); + } + + public class ExampleSession : IMySession + { + public void SaveChanges() + { + Console.WriteLine("ExampleSession({0}) - {1}", GetHashCode(), "Saving changes"); + } + } + + public class UoWInitializer : IWantCustomInitialization + { + public void Init() + { + Configure.Instance.Configurer. + ConfigureComponent(DependencyLifecycle.InstancePerUnitOfWork); + + //this shows the new lambda feature introduced in NServiceBus 3.2.3 + Configure.Instance.Configurer. + ConfigureComponent(() => new ExampleSession(), + DependencyLifecycle.InstancePerUnitOfWork); + + } + } } \ No newline at end of file diff --git a/Samples/FullDuplex/MyServer/MyServer.csproj b/Samples/FullDuplex/MyServer/MyServer.csproj index e53fb43442e..3365ab9d3e7 100644 --- a/Samples/FullDuplex/MyServer/MyServer.csproj +++ b/Samples/FullDuplex/MyServer/MyServer.csproj @@ -1,87 +1,90 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CA4DB5DB-88E3-45C2-92EC-ED1865FB83B6} - library - Properties - MyServer - MyServer - - - - - v4.0 - - ..\..\FullDuplex\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Host.exe - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - - - - - - - - - - - - - - - Designer - - - - - {20F613ED-C871-477C-B1E4-48B96CACF794} - MyMessages - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Integration - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {CA4DB5DB-88E3-45C2-92EC-ED1865FB83B6} + library + Properties + MyServer + MyServer + + + + + v4.0 + + ..\..\FullDuplex\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll + + + False + ..\..\..\binaries\NServiceBus.dll + + + False + ..\..\..\binaries\NServiceBus.Host.exe + + + False + ..\..\..\binaries\NServiceBus.Core.dll + + + + + + + + + + + + + + + + + Designer + + + Designer + + + + + {20F613ED-C871-477C-B1E4-48B96CACF794} + MyMessages + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + \ No newline at end of file diff --git a/Samples/FullDuplex/MyServer/RequestDataMessageHandler.cs b/Samples/FullDuplex/MyServer/RequestDataMessageHandler.cs index 0aa6b0292d9..2056904535a 100644 --- a/Samples/FullDuplex/MyServer/RequestDataMessageHandler.cs +++ b/Samples/FullDuplex/MyServer/RequestDataMessageHandler.cs @@ -1,8 +1,8 @@ using System; using System.Threading; -using log4net; using MyMessages; using NServiceBus; +using NServiceBus.Logging; namespace MyServer { @@ -10,14 +10,14 @@ public class RequestDataMessageHandler : IHandleMessages { public IBus Bus { get; set; } - public void Handle(RequestDataMessage message) - { - //try to uncomment the line below to see the error handling in action - // 1. nservicebus will retry the configured number of times configured in app.config - // 2. the UoW will rollback - // 3. When the max retries is reached the message will be given to the faultmanager (in memory in this case) - //throw new Exception("Database connection lost"); - + public void Handle(RequestDataMessage message) + { + //try to uncomment the line below to see the error handling in action + // 1. nservicebus will retry the configured number of times configured in app.config + // 2. the UoW will rollback + // 3. When the max retries is reached the message will be given to the faultmanager (in memory in this case) + //throw new Exception("Database connection lost"); + Logger.Info("=========================================================================="); Logger.InfoFormat("Received request {0}.", message.DataId); Logger.InfoFormat("String received: {0}.", message.String); @@ -30,7 +30,7 @@ public void Handle(RequestDataMessage message) m.String = message.String; }); - response.CopyHeaderFromRequest("Test"); + Bus.SetMessageHeader(response, "Test", Bus.GetMessageHeader(message, "Test")); response.SetHeader("1", "1"); response.SetHeader("2", "2"); diff --git a/Samples/FullDuplex/MyServer/packages.config b/Samples/FullDuplex/MyServer/packages.config new file mode 100644 index 00000000000..4f687641996 --- /dev/null +++ b/Samples/FullDuplex/MyServer/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Samples/FullDuplex/RequestResponse.sln b/Samples/FullDuplex/RequestResponse.sln index c5a60bfa497..c6c3fcb669f 100644 --- a/Samples/FullDuplex/RequestResponse.sln +++ b/Samples/FullDuplex/RequestResponse.sln @@ -1,48 +1,44 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyClient", "MyClient\MyClient.csproj", "{9F8E556C-0AFA-4C5D-B64F-AE9376ABF145}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyServer", "MyServer\MyServer.csproj", "{CA4DB5DB-88E3-45C2-92EC-ED1865FB83B6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyMessages", "MyMessages\MyMessages.csproj", "{20F613ED-C871-477C-B1E4-48B96CACF794}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyServer.Tests", "MyServer.Tests\MyServer.Tests.csproj", "{1AB56FB7-ADB3-40DF-BBF4-53BAAE9A8F6F}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{965AC28E-3EED-4BD6-9E87-FB222CB1FE63}" - ProjectSection(SolutionItems) = preProject - .nuget\NuGet.exe = .nuget\NuGet.exe - .nuget\NuGet.targets = .nuget\NuGet.targets - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9F8E556C-0AFA-4C5D-B64F-AE9376ABF145}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9F8E556C-0AFA-4C5D-B64F-AE9376ABF145}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9F8E556C-0AFA-4C5D-B64F-AE9376ABF145}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9F8E556C-0AFA-4C5D-B64F-AE9376ABF145}.Release|Any CPU.Build.0 = Release|Any CPU - {CA4DB5DB-88E3-45C2-92EC-ED1865FB83B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CA4DB5DB-88E3-45C2-92EC-ED1865FB83B6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CA4DB5DB-88E3-45C2-92EC-ED1865FB83B6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CA4DB5DB-88E3-45C2-92EC-ED1865FB83B6}.Release|Any CPU.Build.0 = Release|Any CPU - {20F613ED-C871-477C-B1E4-48B96CACF794}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {20F613ED-C871-477C-B1E4-48B96CACF794}.Debug|Any CPU.Build.0 = Debug|Any CPU - {20F613ED-C871-477C-B1E4-48B96CACF794}.Release|Any CPU.ActiveCfg = Release|Any CPU - {20F613ED-C871-477C-B1E4-48B96CACF794}.Release|Any CPU.Build.0 = Release|Any CPU - {1AB56FB7-ADB3-40DF-BBF4-53BAAE9A8F6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1AB56FB7-ADB3-40DF-BBF4-53BAAE9A8F6F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1AB56FB7-ADB3-40DF-BBF4-53BAAE9A8F6F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1AB56FB7-ADB3-40DF-BBF4-53BAAE9A8F6F}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(SubversionScc) = preSolution - Svn-Managed = True - Manager = AnkhSVN - Subversion Support for Visual Studio - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyClient", "MyClient\MyClient.csproj", "{9F8E556C-0AFA-4C5D-B64F-AE9376ABF145}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyServer", "MyServer\MyServer.csproj", "{CA4DB5DB-88E3-45C2-92EC-ED1865FB83B6}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyMessages", "MyMessages\MyMessages.csproj", "{20F613ED-C871-477C-B1E4-48B96CACF794}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{965AC28E-3EED-4BD6-9E87-FB222CB1FE63}" + ProjectSection(SolutionItems) = preProject + .nuget\NuGet.exe = .nuget\NuGet.exe + .nuget\NuGet.targets = .nuget\NuGet.targets + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyServer.Tests", "MyServer.Tests\MyServer.Tests.csproj", "{1AB56FB7-ADB3-40DF-BBF4-53BAAE9A8F6F}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9F8E556C-0AFA-4C5D-B64F-AE9376ABF145}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9F8E556C-0AFA-4C5D-B64F-AE9376ABF145}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9F8E556C-0AFA-4C5D-B64F-AE9376ABF145}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9F8E556C-0AFA-4C5D-B64F-AE9376ABF145}.Release|Any CPU.Build.0 = Release|Any CPU + {CA4DB5DB-88E3-45C2-92EC-ED1865FB83B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CA4DB5DB-88E3-45C2-92EC-ED1865FB83B6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CA4DB5DB-88E3-45C2-92EC-ED1865FB83B6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CA4DB5DB-88E3-45C2-92EC-ED1865FB83B6}.Release|Any CPU.Build.0 = Release|Any CPU + {20F613ED-C871-477C-B1E4-48B96CACF794}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {20F613ED-C871-477C-B1E4-48B96CACF794}.Debug|Any CPU.Build.0 = Debug|Any CPU + {20F613ED-C871-477C-B1E4-48B96CACF794}.Release|Any CPU.ActiveCfg = Release|Any CPU + {20F613ED-C871-477C-B1E4-48B96CACF794}.Release|Any CPU.Build.0 = Release|Any CPU + {1AB56FB7-ADB3-40DF-BBF4-53BAAE9A8F6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1AB56FB7-ADB3-40DF-BBF4-53BAAE9A8F6F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1AB56FB7-ADB3-40DF-BBF4-53BAAE9A8F6F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1AB56FB7-ADB3-40DF-BBF4-53BAAE9A8F6F}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Samples/Gateway/Gateway.sln b/Samples/Gateway/Gateway.sln index f3b79ac9e29..3fd528c6060 100644 --- a/Samples/Gateway/Gateway.sln +++ b/Samples/Gateway/Gateway.sln @@ -1,96 +1,96 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Headquarter", "Headquarter\Headquarter.csproj", "{ABE4276E-7A3E-4850-B512-D0EF4010758D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SiteA", "SiteA\SiteA.csproj", "{96657637-C415-47FC-AF78-36084D0DD7E2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Headquarter.Messages", "Headquarter.Messages\Headquarter.Messages.csproj", "{5849DBD1-CBA9-4792-90AA-80F9476E526F}" -EndProject -Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "WebClient", "WebClient\", "{11C5D939-A849-4397-B840-43E45412C594}" - ProjectSection(WebsiteProperties) = preProject - TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" - Debug.AspNetCompiler.VirtualPath = "/WebClient" - Debug.AspNetCompiler.PhysicalPath = "WebClient\" - Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\WebClient\" - Debug.AspNetCompiler.Updateable = "true" - Debug.AspNetCompiler.ForceOverwrite = "true" - Debug.AspNetCompiler.FixedNames = "false" - Debug.AspNetCompiler.Debug = "True" - Release.AspNetCompiler.VirtualPath = "/WebClient" - Release.AspNetCompiler.PhysicalPath = "WebClient\" - Release.AspNetCompiler.TargetPath = "PrecompiledWeb\WebClient\" - Release.AspNetCompiler.Updateable = "true" - Release.AspNetCompiler.ForceOverwrite = "true" - Release.AspNetCompiler.FixedNames = "false" - Release.AspNetCompiler.Debug = "False" - VWDPort = "25905" - EndProjectSection -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SiteB", "SiteB\SiteB.csproj", "{6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Debug|x86.ActiveCfg = Debug|Any CPU - {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Release|Any CPU.Build.0 = Release|Any CPU - {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Release|x86.ActiveCfg = Release|Any CPU - {96657637-C415-47FC-AF78-36084D0DD7E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {96657637-C415-47FC-AF78-36084D0DD7E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {96657637-C415-47FC-AF78-36084D0DD7E2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {96657637-C415-47FC-AF78-36084D0DD7E2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {96657637-C415-47FC-AF78-36084D0DD7E2}.Debug|x86.ActiveCfg = Debug|Any CPU - {96657637-C415-47FC-AF78-36084D0DD7E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {96657637-C415-47FC-AF78-36084D0DD7E2}.Release|Any CPU.Build.0 = Release|Any CPU - {96657637-C415-47FC-AF78-36084D0DD7E2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {96657637-C415-47FC-AF78-36084D0DD7E2}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {96657637-C415-47FC-AF78-36084D0DD7E2}.Release|x86.ActiveCfg = Release|Any CPU - {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Debug|x86.ActiveCfg = Debug|Any CPU - {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Release|Any CPU.Build.0 = Release|Any CPU - {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Release|x86.ActiveCfg = Release|Any CPU - {11C5D939-A849-4397-B840-43E45412C594}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {11C5D939-A849-4397-B840-43E45412C594}.Debug|Any CPU.Build.0 = Debug|Any CPU - {11C5D939-A849-4397-B840-43E45412C594}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {11C5D939-A849-4397-B840-43E45412C594}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {11C5D939-A849-4397-B840-43E45412C594}.Debug|x86.ActiveCfg = Debug|Any CPU - {11C5D939-A849-4397-B840-43E45412C594}.Release|Any CPU.ActiveCfg = Debug|Any CPU - {11C5D939-A849-4397-B840-43E45412C594}.Release|Any CPU.Build.0 = Debug|Any CPU - {11C5D939-A849-4397-B840-43E45412C594}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU - {11C5D939-A849-4397-B840-43E45412C594}.Release|Mixed Platforms.Build.0 = Debug|Any CPU - {11C5D939-A849-4397-B840-43E45412C594}.Release|x86.ActiveCfg = Debug|Any CPU - {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Debug|Any CPU.ActiveCfg = Debug|x86 - {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Debug|x86.ActiveCfg = Debug|x86 - {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Debug|x86.Build.0 = Debug|x86 - {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Release|Any CPU.ActiveCfg = Release|x86 - {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Release|Mixed Platforms.Build.0 = Release|x86 - {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Release|x86.ActiveCfg = Release|x86 - {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Headquarter", "Headquarter\Headquarter.csproj", "{ABE4276E-7A3E-4850-B512-D0EF4010758D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SiteA", "SiteA\SiteA.csproj", "{96657637-C415-47FC-AF78-36084D0DD7E2}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Headquarter.Messages", "Headquarter.Messages\Headquarter.Messages.csproj", "{5849DBD1-CBA9-4792-90AA-80F9476E526F}" +EndProject +Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "WebClient", "WebClient\", "{11C5D939-A849-4397-B840-43E45412C594}" + ProjectSection(WebsiteProperties) = preProject + TargetFrameworkMoniker = ".NETFramework,Version%3Dv4.0" + Debug.AspNetCompiler.VirtualPath = "/WebClient" + Debug.AspNetCompiler.PhysicalPath = "WebClient\" + Debug.AspNetCompiler.TargetPath = "PrecompiledWeb\WebClient\" + Debug.AspNetCompiler.Updateable = "true" + Debug.AspNetCompiler.ForceOverwrite = "true" + Debug.AspNetCompiler.FixedNames = "false" + Debug.AspNetCompiler.Debug = "True" + Release.AspNetCompiler.VirtualPath = "/WebClient" + Release.AspNetCompiler.PhysicalPath = "WebClient\" + Release.AspNetCompiler.TargetPath = "PrecompiledWeb\WebClient\" + Release.AspNetCompiler.Updateable = "true" + Release.AspNetCompiler.ForceOverwrite = "true" + Release.AspNetCompiler.FixedNames = "false" + Release.AspNetCompiler.Debug = "False" + VWDPort = "25905" + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SiteB", "SiteB\SiteB.csproj", "{6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|Mixed Platforms = Debug|Mixed Platforms + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|Mixed Platforms = Release|Mixed Platforms + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Debug|x86.ActiveCfg = Debug|Any CPU + {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Release|Any CPU.Build.0 = Release|Any CPU + {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {ABE4276E-7A3E-4850-B512-D0EF4010758D}.Release|x86.ActiveCfg = Release|Any CPU + {96657637-C415-47FC-AF78-36084D0DD7E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {96657637-C415-47FC-AF78-36084D0DD7E2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {96657637-C415-47FC-AF78-36084D0DD7E2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {96657637-C415-47FC-AF78-36084D0DD7E2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {96657637-C415-47FC-AF78-36084D0DD7E2}.Debug|x86.ActiveCfg = Debug|Any CPU + {96657637-C415-47FC-AF78-36084D0DD7E2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {96657637-C415-47FC-AF78-36084D0DD7E2}.Release|Any CPU.Build.0 = Release|Any CPU + {96657637-C415-47FC-AF78-36084D0DD7E2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {96657637-C415-47FC-AF78-36084D0DD7E2}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {96657637-C415-47FC-AF78-36084D0DD7E2}.Release|x86.ActiveCfg = Release|Any CPU + {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Debug|x86.ActiveCfg = Debug|Any CPU + {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Release|Any CPU.Build.0 = Release|Any CPU + {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {5849DBD1-CBA9-4792-90AA-80F9476E526F}.Release|x86.ActiveCfg = Release|Any CPU + {11C5D939-A849-4397-B840-43E45412C594}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {11C5D939-A849-4397-B840-43E45412C594}.Debug|Any CPU.Build.0 = Debug|Any CPU + {11C5D939-A849-4397-B840-43E45412C594}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {11C5D939-A849-4397-B840-43E45412C594}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {11C5D939-A849-4397-B840-43E45412C594}.Debug|x86.ActiveCfg = Debug|Any CPU + {11C5D939-A849-4397-B840-43E45412C594}.Release|Any CPU.ActiveCfg = Debug|Any CPU + {11C5D939-A849-4397-B840-43E45412C594}.Release|Any CPU.Build.0 = Debug|Any CPU + {11C5D939-A849-4397-B840-43E45412C594}.Release|Mixed Platforms.ActiveCfg = Debug|Any CPU + {11C5D939-A849-4397-B840-43E45412C594}.Release|Mixed Platforms.Build.0 = Debug|Any CPU + {11C5D939-A849-4397-B840-43E45412C594}.Release|x86.ActiveCfg = Debug|Any CPU + {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Debug|Any CPU.ActiveCfg = Debug|x86 + {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Debug|x86.ActiveCfg = Debug|x86 + {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Debug|x86.Build.0 = Debug|x86 + {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Release|Any CPU.ActiveCfg = Release|x86 + {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Release|Mixed Platforms.Build.0 = Release|x86 + {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Release|x86.ActiveCfg = Release|x86 + {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Samples/Gateway/Headquarter.Messages/Headquarter.Messages.csproj b/Samples/Gateway/Headquarter.Messages/Headquarter.Messages.csproj index 9400520dd6c..09811efa39b 100644 --- a/Samples/Gateway/Headquarter.Messages/Headquarter.Messages.csproj +++ b/Samples/Gateway/Headquarter.Messages/Headquarter.Messages.csproj @@ -21,6 +21,7 @@ DEBUG;TRACE prompt 4 + true pdbonly @@ -29,6 +30,7 @@ TRACE prompt 4 + true diff --git a/Samples/Gateway/Headquarter.Messages/PriceUpdated.cs b/Samples/Gateway/Headquarter.Messages/PriceUpdated.cs index 279265e6a29..52ca198adc4 100644 --- a/Samples/Gateway/Headquarter.Messages/PriceUpdated.cs +++ b/Samples/Gateway/Headquarter.Messages/PriceUpdated.cs @@ -7,8 +7,8 @@ public class PriceUpdated : IMessage { public int ProductId { get; set; } public double NewPrice { get; set; } - public DateTime ValidFrom { get; set; } - + public DateTime ValidFrom { get; set; } + public DataBusProperty SomeLargeString { get; set; } } -} \ No newline at end of file +} diff --git a/Samples/Gateway/Headquarter/App.config b/Samples/Gateway/Headquarter/App.config index cc58bd25980..fea219f23c1 100644 --- a/Samples/Gateway/Headquarter/App.config +++ b/Samples/Gateway/Headquarter/App.config @@ -1,22 +1,22 @@ - - - -
    -
    - - - - - - - - - - - - - - - - - \ No newline at end of file + + + +
    +
    + + + + + + + + + + + + + + + + + diff --git a/Samples/Gateway/Headquarter/EndpointConfig.cs b/Samples/Gateway/Headquarter/EndpointConfig.cs index b19a9c438da..3f7bae0fa4e 100644 --- a/Samples/Gateway/Headquarter/EndpointConfig.cs +++ b/Samples/Gateway/Headquarter/EndpointConfig.cs @@ -1,17 +1,16 @@ using NServiceBus; namespace Headquarter -{ - // The endpoint is started with the RunGateway profile which turns it on. The Lite profile is also - // active which will configure the persistence to be InMemory - public class EndpointConfig : IConfigureThisEndpoint, AsA_Server,IWantCustomInitialization - { - public void Init() - { - Configure.With() - .DefaultBuilder() - .XmlSerializer() - .FileShareDataBus(".\\databus"); - } +{ + // The endpoint is started with the RunGateway profile which turns it on. The Lite profile is also + // active which will configure the persistence to be InMemory + public class EndpointConfig : IConfigureThisEndpoint, AsA_Server,IWantCustomInitialization + { + public void Init() + { + Configure.With() + .DefaultBuilder() + .FileShareDataBus(".\\databus"); + } } } diff --git a/Samples/Gateway/Headquarter/Headquarter.csproj b/Samples/Gateway/Headquarter/Headquarter.csproj index dc4299a9213..4432c42e7ad 100644 --- a/Samples/Gateway/Headquarter/Headquarter.csproj +++ b/Samples/Gateway/Headquarter/Headquarter.csproj @@ -1,74 +1,76 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {ABE4276E-7A3E-4850-B512-D0EF4010758D} - Library - Properties - Headquarter - Headquarter - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\binaries\log4net.dll - - - ..\..\..\binaries\NServiceBus.dll - - - ..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - - Designer - - - - - {5849DBD1-CBA9-4792-90AA-80F9476E526F} - Headquarter.Messages - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Lite NServiceBus.MultiSite - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {ABE4276E-7A3E-4850-B512-D0EF4010758D} + Library + Properties + Headquarter + Headquarter + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\log4net.dll + + + ..\..\..\binaries\NServiceBus.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + + + + + Designer + + + + + {5849DBD1-CBA9-4792-90AA-80F9476E526F} + Headquarter.Messages + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + NServiceBus.Lite NServiceBus.MultiSite + true + \ No newline at end of file diff --git a/Samples/Gateway/Headquarter/HeadquarterService.cs b/Samples/Gateway/Headquarter/HeadquarterService.cs index 8c409b28520..ccfa553b171 100644 --- a/Samples/Gateway/Headquarter/HeadquarterService.cs +++ b/Samples/Gateway/Headquarter/HeadquarterService.cs @@ -1,37 +1,37 @@ -using NServiceBus; - -namespace Headquarter -{ - using System; - using Messages; - - public class HeadquarterService : IWantToRunAtStartup - { - public IBus Bus { get; set; } - - public void Run() - { - - Console.WriteLine("Press 'Enter' to send a message to SiteA and SiteB, SiteA will also reply to the sent message. To exit, Ctrl + C"); - - while (Console.ReadLine() != null) - { - Bus.SendToSites(new[] { "SiteA", "SiteB" }, new PriceUpdated - { - ProductId = 2, - NewPrice = 100.0, - ValidFrom = DateTime.Today, - SomeLargeString = new DataBusProperty("This is a random large string " + Guid.NewGuid()) - }); - - Console.WriteLine("Message sent, check the output in the remote sites"); - } - - } - - public void Stop() - { - - } - } -} +using NServiceBus; + +namespace Headquarter +{ + using System; + using Messages; + + public class HeadquarterService : IWantToRunWhenBusStartsAndStops + { + public IBus Bus { get; set; } + + public void Start() + { + + Console.WriteLine("Press 'Enter' to send a message to SiteA and SiteB, SiteA will also reply to the sent message. To exit, Ctrl + C"); + + while (Console.ReadLine() != null) + { + Bus.SendToSites(new[] { "SiteA", "SiteB" }, new PriceUpdated + { + ProductId = 2, + NewPrice = 100.0, + ValidFrom = DateTime.Today, + SomeLargeString = new DataBusProperty("This is a random large string " + Guid.NewGuid()) + }); + + Console.WriteLine("Message sent, check the output in the remote sites"); + } + + } + + public void Stop() + { + + } + } +} diff --git a/Samples/Gateway/Headquarter/Notifications/MessageForwarded.cs b/Samples/Gateway/Headquarter/Notifications/MessageForwarded.cs index 7126ab227d9..d4b187ce795 100644 --- a/Samples/Gateway/Headquarter/Notifications/MessageForwarded.cs +++ b/Samples/Gateway/Headquarter/Notifications/MessageForwarded.cs @@ -1,22 +1,27 @@ -namespace Headquarter.Notifications -{ - using System; - using NServiceBus.Gateway.Notifications; - using NServiceBus.Unicast; - - public class MessageForwarded:IWantToRunWhenTheBusStarts - { - public IMessageNotifier MessageNotifier { get; set; } - - void MessageNotifier_MessageForwarded(object sender, MessageReceivedOnChannelArgs e) - { - Console.WriteLine(string.Format("Message with id {0} arrived on {1} and was forwarded onto a {2} channel",e.Message.Id,e.FromChannel,e.ToChannel)); - } - - public void Run() - { - MessageNotifier.MessageForwarded += MessageNotifier_MessageForwarded; - } - - } -} +namespace Headquarter.Notifications +{ + using System; + using NServiceBus; + using NServiceBus.Gateway.Notifications; + + public class MessageForwarded:IWantToRunWhenBusStartsAndStops + { + public IMessageNotifier MessageNotifier { get; set; } + + void MessageNotifier_MessageForwarded(object sender, MessageReceivedOnChannelArgs e) + { + Console.WriteLine(string.Format("Message with id {0} arrived on {1} and was forwarded onto a {2} channel",e.Message.Id,e.FromChannel,e.ToChannel)); + } + + + public void Start() + { + MessageNotifier.MessageForwarded += MessageNotifier_MessageForwarded; + } + + public void Stop() + { + MessageNotifier.MessageForwarded -= MessageNotifier_MessageForwarded; + } + } +} diff --git a/Samples/Gateway/Headquarter/PriceUpdateReceivedMessageHandler.cs b/Samples/Gateway/Headquarter/PriceUpdateReceivedMessageHandler.cs index 1e9cd541b77..96bef42553a 100644 --- a/Samples/Gateway/Headquarter/PriceUpdateReceivedMessageHandler.cs +++ b/Samples/Gateway/Headquarter/PriceUpdateReceivedMessageHandler.cs @@ -1,15 +1,15 @@ -namespace Headquarter -{ - using System; - using Messages; - using NServiceBus; - - public class PriceUpdateReceivedMessageHandler : IHandleMessages - { - public void Handle(PriceUpdateReceived message) - { - //this shows how the gateway rewrites the return address to marshal replies to and from remote sites - Console.WriteLine("Price update received by: " + message.BranchOffice); - } - } +namespace Headquarter +{ + using System; + using Messages; + using NServiceBus; + + public class PriceUpdateReceivedMessageHandler : IHandleMessages + { + public void Handle(PriceUpdateReceived message) + { + //this shows how the gateway rewrites the return address to marshal replies to and from remote sites + Console.WriteLine("Price update received by: " + message.BranchOffice); + } + } } \ No newline at end of file diff --git a/Samples/Gateway/Headquarter/UpdatePriceMessageHandler.cs b/Samples/Gateway/Headquarter/UpdatePriceMessageHandler.cs index 414445e62f3..da436abf105 100644 --- a/Samples/Gateway/Headquarter/UpdatePriceMessageHandler.cs +++ b/Samples/Gateway/Headquarter/UpdatePriceMessageHandler.cs @@ -5,19 +5,19 @@ namespace Headquarter using NServiceBus; public class UpdatePriceMessageHandler:IHandleMessages - { + { public IBus Bus { get; set; } public void Handle(UpdatePrice message) { - Console.WriteLine("Price update request received from the webclient, going to push it to the remote sites"); - - Bus.SendToSites(new[] { "SiteA", "SiteB" }, new PriceUpdated - { - ProductId = message.ProductId, - NewPrice = message.NewPrice, - ValidFrom = message.ValidFrom, - SomeLargeString = new DataBusProperty("A large string to demonstrate that the gateway supports databus properties") + Console.WriteLine("Price update request received from the webclient, going to push it to the remote sites"); + + Bus.SendToSites(new[] { "SiteA", "SiteB" }, new PriceUpdated + { + ProductId = message.ProductId, + NewPrice = message.NewPrice, + ValidFrom = message.ValidFrom, + SomeLargeString = new DataBusProperty("A large string to demonstrate that the gateway supports databus properties") }); } } diff --git a/Samples/Gateway/SiteA/CustomResponder/CustomHttpResponder.cs b/Samples/Gateway/SiteA/CustomResponder/CustomHttpResponder.cs index c428c17cb1c..f16aaecf9d2 100644 --- a/Samples/Gateway/SiteA/CustomResponder/CustomHttpResponder.cs +++ b/Samples/Gateway/SiteA/CustomResponder/CustomHttpResponder.cs @@ -1,61 +1,60 @@ -namespace SiteA.CustomResponder -{ - using System.Linq; - using System.Net; - using NServiceBus; - using NServiceBus.Config; - using NServiceBus.Gateway.Channels.Http; - using NServiceBus.ObjectBuilder; - - public class CustomHttpResponder:IHttpResponder - { - IBuilder builder; - - public CustomHttpResponder(IBuilder builder) - { - this.builder = builder; - } - - public void Handle(HttpListenerContext ctx) - { - if(ctx.Request.HttpMethod == "GET") - { - ctx.Response.StatusCode = 200; - - var response = string.Format("

    Welcome to {0}

    ", Configure.EndpointName); - - builder.BuildAll().ToList() - .ForEach(inspector => - { - response += "
    " + inspector.GetStatusAsHtml() + "
    "; - }); - - ctx.Response.ContentType = "text/html"; - ctx.Response.Close(System.Text.Encoding.UTF8.GetBytes(response + ""), true); - - } - else - { - //knock your self out - } - } - } - - class ResponderInstaller:INeedInitialization - { - public void Init() - { - Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); - - //register all the inspectors in the container - Configure.TypesToScan.Where(t=>typeof(IEndpointInspector).IsAssignableFrom(t) && !t.IsInterface).ToList() - .ForEach(inspector=> Configure.Instance.Configurer.ConfigureComponent(inspector, - DependencyLifecycle.InstancePerCall)); - } - } - - public interface IEndpointInspector - { - string GetStatusAsHtml(); - } +namespace SiteA.CustomResponder +{ + using System.Linq; + using System.Net; + using NServiceBus; + using NServiceBus.Gateway.Channels.Http; + using NServiceBus.ObjectBuilder; + + public class CustomHttpResponder : IHttpResponder + { + IBuilder builder; + + public CustomHttpResponder(IBuilder builder) + { + this.builder = builder; + } + + public void Handle(HttpListenerContext ctx) + { + if(ctx.Request.HttpMethod == "GET") + { + ctx.Response.StatusCode = 200; + + var response = string.Format("

    Welcome to {0}

    ", Configure.EndpointName); + + builder.BuildAll().ToList() + .ForEach(inspector => + { + response += "
    " + inspector.GetStatusAsHtml() + "
    "; + }); + + ctx.Response.ContentType = "text/html"; + ctx.Response.Close(System.Text.Encoding.UTF8.GetBytes(response + ""), true); + + } + else + { + //knock your self out + } + } + } + + class ResponderInstaller : INeedInitialization + { + public void Init() + { + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + + //register all the inspectors in the container + Configure.TypesToScan.Where(t=>typeof(IEndpointInspector).IsAssignableFrom(t) && !t.IsInterface).ToList() + .ForEach(inspector=> Configure.Instance.Configurer.ConfigureComponent(inspector, + DependencyLifecycle.InstancePerCall)); + } + } + + public interface IEndpointInspector + { + string GetStatusAsHtml(); + } } \ No newline at end of file diff --git a/Samples/Gateway/SiteA/CustomResponder/Inspectors/AuditInspector.cs b/Samples/Gateway/SiteA/CustomResponder/Inspectors/AuditInspector.cs index 490ac4b2fb1..5a202b61be4 100644 --- a/Samples/Gateway/SiteA/CustomResponder/Inspectors/AuditInspector.cs +++ b/Samples/Gateway/SiteA/CustomResponder/Inspectors/AuditInspector.cs @@ -1,23 +1,23 @@ -namespace SiteA.CustomResponder.Inspectors -{ - using NServiceBus.Unicast; - - public class AuditInspector : IEndpointInspector - { - readonly UnicastBus bus; - - public AuditInspector(UnicastBus bus) - { - this.bus = bus; - } - - - public string GetStatusAsHtml() - { - if (bus.ForwardReceivedMessagesTo == null) - return "Audit is turned off"; - - return string.Format("Endpoint sending audit messages to: " + bus.ForwardReceivedMessagesTo); - } - } +namespace SiteA.CustomResponder.Inspectors +{ + using NServiceBus.Unicast; + + public class AuditInspector : IEndpointInspector + { + readonly UnicastBus bus; + + public AuditInspector(UnicastBus bus) + { + this.bus = bus; + } + + + public string GetStatusAsHtml() + { + if (bus.ForwardReceivedMessagesTo == null) + return "Audit is turned off"; + + return string.Format("Endpoint sending audit messages to: " + bus.ForwardReceivedMessagesTo); + } + } } \ No newline at end of file diff --git a/Samples/Gateway/SiteA/CustomResponder/Inspectors/MaximumConcurrencyLevelInspector.cs b/Samples/Gateway/SiteA/CustomResponder/Inspectors/MaximumConcurrencyLevelInspector.cs new file mode 100644 index 00000000000..46c35ca9951 --- /dev/null +++ b/Samples/Gateway/SiteA/CustomResponder/Inspectors/MaximumConcurrencyLevelInspector.cs @@ -0,0 +1,19 @@ +namespace SiteA.CustomResponder.Inspectors +{ + using NServiceBus.Unicast.Transport; + + public class MaximumConcurrencyLevelInspector : IEndpointInspector + { + private readonly ITransport transport; + + public MaximumConcurrencyLevelInspector(ITransport transport) + { + this.transport = transport; + } + + public string GetStatusAsHtml() + { + return string.Format("Maximum concurrency level is: " + transport.MaximumConcurrencyLevel); + } + } +} \ No newline at end of file diff --git a/Samples/Gateway/SiteA/CustomResponder/Inspectors/NumberOfThreadsInspector.cs b/Samples/Gateway/SiteA/CustomResponder/Inspectors/NumberOfThreadsInspector.cs deleted file mode 100644 index f00f3b918df..00000000000 --- a/Samples/Gateway/SiteA/CustomResponder/Inspectors/NumberOfThreadsInspector.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace SiteA.CustomResponder.Inspectors -{ - using NServiceBus.Unicast.Transport; - - public class NumberOfThreadsInspector:IEndpointInspector - { - readonly ITransport transport; - - public NumberOfThreadsInspector(ITransport transport) - { - this.transport = transport; - } - - public string GetStatusAsHtml() - { - return string.Format("Current number of worker threads is: " + transport.NumberOfWorkerThreads); - } - } -} \ No newline at end of file diff --git a/Samples/Gateway/SiteA/EndpointConfig.cs b/Samples/Gateway/SiteA/EndpointConfig.cs index e0e84ce0eea..8da2cab6834 100644 --- a/Samples/Gateway/SiteA/EndpointConfig.cs +++ b/Samples/Gateway/SiteA/EndpointConfig.cs @@ -1,17 +1,16 @@ using NServiceBus; namespace SiteA -{ - // The endpoint is started with the RunGateway profile which turns it on. The Lite profile is also - // active which will configure the persistence to be InMemory - public class EndpointConfig : IConfigureThisEndpoint, AsA_Server,IWantCustomInitialization - { - public void Init() - { - Configure.With() - .DefaultBuilder() - .XmlSerializer() - .FileShareDataBus(".\\databus"); - } +{ + // The endpoint is started with the RunGateway profile which turns it on. The Lite profile is also + // active which will configure the persistence to be InMemory + public class EndpointConfig : IConfigureThisEndpoint, AsA_Server,IWantCustomInitialization + { + public void Init() + { + Configure.With() + .DefaultBuilder() + .FileShareDataBus(".\\databus"); + } } } diff --git a/Samples/Gateway/SiteA/PriceUpdatedHandler.cs b/Samples/Gateway/SiteA/PriceUpdatedHandler.cs index 17a469cca1a..63416e20084 100644 --- a/Samples/Gateway/SiteA/PriceUpdatedHandler.cs +++ b/Samples/Gateway/SiteA/PriceUpdatedHandler.cs @@ -14,7 +14,7 @@ public void Handle(PriceUpdated message) Console.WriteLine("Price update for product: " + message.ProductId + " received. Going to reply over channel: " + message.GetHeader(Headers.OriginatingSite)); - //this shows how the gateway rewrites the return address to marshal replies to and from remote sites + //this shows how the gateway rewrites the return address to marshal replies to and from remote sites Bus.Reply(m=> { m.BranchOffice = "SiteA"; diff --git a/Samples/Gateway/SiteA/SiteA.csproj b/Samples/Gateway/SiteA/SiteA.csproj index 6bb1a61e13f..2fa13dbb800 100644 --- a/Samples/Gateway/SiteA/SiteA.csproj +++ b/Samples/Gateway/SiteA/SiteA.csproj @@ -1,74 +1,76 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {96657637-C415-47FC-AF78-36084D0DD7E2} - Library - Properties - SiteA - SiteA - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\binaries\log4net.dll - - - ..\..\..\binaries\NServiceBus.dll - - - ..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - - Designer - - - - - {5849DBD1-CBA9-4792-90AA-80F9476E526F} - Headquarter.Messages - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Lite NServiceBus.MultiSite - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {96657637-C415-47FC-AF78-36084D0DD7E2} + Library + Properties + SiteA + SiteA + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\log4net.dll + + + ..\..\..\binaries\NServiceBus.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + + + + + Designer + + + + + {5849DBD1-CBA9-4792-90AA-80F9476E526F} + Headquarter.Messages + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + NServiceBus.Lite NServiceBus.MultiSite + true + \ No newline at end of file diff --git a/Samples/Gateway/SiteB/Program.cs b/Samples/Gateway/SiteB/Program.cs index 8a9a9a3b244..2d7167f9952 100644 --- a/Samples/Gateway/SiteB/Program.cs +++ b/Samples/Gateway/SiteB/Program.cs @@ -1,74 +1,72 @@ -using System; -using NServiceBus.Gateway.Persistence.Sql; - -namespace SiteB -{ - using Headquarter.Messages; - using NServiceBus.Gateway.Persistence; - using NServiceBus.Unicast; - using log4net.Appender; - using log4net.Core; - using NServiceBus; - using NServiceBus.Config; - using NServiceBus.Installation.Environments; - - class Program - { - static void Main(string[] args) - { - Configure.With() - .Log4Net(a => { a.Threshold = Level.Warn; }) - .DefaultBuilder() - .XmlSerializer() - .MsmqTransport() - .UnicastBus() - .FileShareDataBus(".\\databus") - .RunGateway()//this line configures the gateway. - .RunTimeoutManagerWithInMemoryPersistence() - .UseInMemoryGatewayPersister() //this tells nservicebus to use Raven to store messages ids for deduplication. If omitted RavenDB will be used by default - //.RunGateway(typeof(SqlPersistence)) // Uncomment this to use Gateway SQL persister (please see InitializeGatewayPersisterConnectionString.cs in this sample). - .CreateBus() - .Start(); - - Console.WriteLine("Waiting for price updates from the headquarter - press any key to exit"); - - Console.ReadLine(); - } - } - - internal class RunInstallers : IWantToRunWhenConfigurationIsComplete - { - public void Run() - { - //run the installers to make sure that all queues are created - Configure.Instance.ForInstallationOn().Install(); - } - } - - - public class PriceUpdatedMessageHandler : IHandleMessages - { - public void Handle(PriceUpdated message) - { - Console.WriteLine("Price update received"); - Console.WriteLine("DataBusProperty: " + message.SomeLargeString.Value); - } - } - - public class DeduplicationCleanup : IWantToRunWhenTheBusStarts - { - public InMemoryPersistence MemoryPersistence { get; set; } - public void Run() - { - Schedule.Every(TimeSpan.FromMinutes(1)) - //delete all ID's older than 5 minutes - .Action(() => - { - var numberOfDeletedMessages = - MemoryPersistence.DeleteDeliveredMessages(DateTime.UtcNow.AddMinutes(-5)); - - Console.Out.WriteLine("InMemory store cleared, number of items deleted: {0}", numberOfDeletedMessages); - }); - } - } -} +using System; + +namespace SiteB +{ + using Headquarter.Messages; + using NServiceBus.Gateway.Persistence; + using NServiceBus; + using NServiceBus.Config; + using NServiceBus.Installation.Environments; + + class Program + { + static void Main() + { + Configure.With() + .DefaultBuilder() + .UseTransport() + .UnicastBus() + .FileShareDataBus(".\\databus") + .RunGateway()//this line configures the gateway. + .UseInMemoryTimeoutPersister() + .UseInMemoryGatewayPersister() //this tells nservicebus to use Raven to store messages ids for deduplication. If omitted RavenDB will be used by default + //.RunGateway(typeof(SqlPersistence)) // Uncomment this to use Gateway SQL persister (please see InitializeGatewayPersisterConnectionString.cs in this sample). + .CreateBus() + .Start(); + + Console.WriteLine("Waiting for price updates from the headquarter - press any key to exit"); + + Console.ReadLine(); + } + } + + internal class RunInstallers : IWantToRunWhenConfigurationIsComplete + { + public void Run() + { + //run the installers to make sure that all queues are created + Configure.Instance.ForInstallationOn().Install(); + } + } + + + public class PriceUpdatedMessageHandler : IHandleMessages + { + public void Handle(PriceUpdated message) + { + Console.WriteLine("Price update received"); + Console.WriteLine("DataBusProperty: " + message.SomeLargeString.Value); + } + } + + public class DeduplicationCleanup : IWantToRunWhenBusStartsAndStops + { + public InMemoryPersistence MemoryPersistence { get; set; } + public void Start() + { + Schedule.Every(TimeSpan.FromMinutes(1)) + //delete all ID's older than 5 minutes + .Action(() => + { + var numberOfDeletedMessages = + MemoryPersistence.DeleteDeliveredMessages(DateTime.UtcNow.AddMinutes(-5)); + + Console.Out.WriteLine("InMemory store cleared, number of items deleted: {0}", numberOfDeletedMessages); + }); + } + + public void Stop() + { + } + } +} diff --git a/Samples/Gateway/SiteB/SiteB.csproj b/Samples/Gateway/SiteB/SiteB.csproj index aa4a15a33eb..39752b16bce 100644 --- a/Samples/Gateway/SiteB/SiteB.csproj +++ b/Samples/Gateway/SiteB/SiteB.csproj @@ -1,75 +1,74 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3} - Exe - Properties - SiteB - SiteB - v4.0 - - - 512 - - - x86 - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - x86 - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\binaries\log4net.dll - - - ..\..\..\binaries\NServiceBus.dll - - - ..\..\..\binaries\NServiceBus.Core.dll - - - - - - - - - - - - - Designer - - - - - {5849DBD1-CBA9-4792-90AA-80F9476E526F} - Headquarter.Messages - - - - + + + + Debug + x86 + 8.0.30703 + 2.0 + {6B74E0EC-1311-46B8-BAE6-70AEC94FCFD3} + Exe + Properties + SiteB + SiteB + v4.0 + + + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + + + + + + + + + + + Designer + + + + + {5849DBD1-CBA9-4792-90AA-80F9476E526F} + Headquarter.Messages + + + + \ No newline at end of file diff --git a/Samples/Gateway/WebClient/Index.htm b/Samples/Gateway/WebClient/Index.htm index 60482ec55bd..68c3dcff023 100644 --- a/Samples/Gateway/WebClient/Index.htm +++ b/Samples/Gateway/WebClient/Index.htm @@ -1,49 +1,49 @@ - - - - - - - - - + + + + + -

    Click the button below to make a JSONP request to the nservicebus gateway

    -

    Gateway address:

    -
    - - - + +

    Click the button below to make a JSONP request to the nservicebus gateway

    +

    Gateway address:

    +
    + + + diff --git a/Samples/GenericHost/GenericHost.suo b/Samples/GenericHost/GenericHost.suo deleted file mode 100644 index 143415039eb..00000000000 Binary files a/Samples/GenericHost/GenericHost.suo and /dev/null differ diff --git a/Samples/GenericHost/Logging/App.config b/Samples/GenericHost/Logging/App.config deleted file mode 100644 index afe5a3c7ff3..00000000000 --- a/Samples/GenericHost/Logging/App.config +++ /dev/null @@ -1,22 +0,0 @@ - - - -
    -
    - - - - - - - - - - - - - - diff --git a/Samples/GenericHost/LoggingFromAppConfig/App.config b/Samples/GenericHost/LoggingFromAppConfig/App.config deleted file mode 100644 index 1607a36b056..00000000000 --- a/Samples/GenericHost/LoggingFromAppConfig/App.config +++ /dev/null @@ -1,31 +0,0 @@ - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Samples/GenericHost/LoggingWithConfigurableThreshold/App.config b/Samples/GenericHost/LoggingWithConfigurableThreshold/App.config deleted file mode 100644 index 3904349c1e3..00000000000 --- a/Samples/GenericHost/LoggingWithConfigurableThreshold/App.config +++ /dev/null @@ -1,17 +0,0 @@ - - - -
    -
    - - - - - - - - - diff --git a/Samples/GenericHost/LoggingWithConfigurableThreshold/EndpointConfig.cs b/Samples/GenericHost/LoggingWithConfigurableThreshold/EndpointConfig.cs deleted file mode 100644 index abae1f5195d..00000000000 --- a/Samples/GenericHost/LoggingWithConfigurableThreshold/EndpointConfig.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using log4net; -using NServiceBus; - -namespace LoggingWithConfigurableThreshold -{ - public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, IWantToRunAtStartup - { - public void Run() - { - Console.WriteLine("The WARN threshold has been set in the config file."); - - LogManager.GetLogger("A").Debug("This should not appear"); - LogManager.GetLogger("A").Warn("This should appear"); - } - - public void Stop() - { - } - } -} diff --git a/Samples/GenericHost/LoggingWithConfigurableThreshold/Properties/AssemblyInfo.cs b/Samples/GenericHost/LoggingWithConfigurableThreshold/Properties/AssemblyInfo.cs deleted file mode 100644 index d9ba11e679c..00000000000 --- a/Samples/GenericHost/LoggingWithConfigurableThreshold/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("LoggingWithConfigurableThreshold")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("LoggingWithConfigurableThreshold")] -[assembly: AssemblyCopyright("Copyright Microsoft 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6ed0b129-bd8e-478e-afea-106c7cdffb92")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Manufacturing/.nuget/NuGet.Config b/Samples/Manufacturing/.nuget/NuGet.Config deleted file mode 100644 index 6a318ad9b75..00000000000 --- a/Samples/Manufacturing/.nuget/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Samples/Manufacturing/.nuget/NuGet.exe b/Samples/Manufacturing/.nuget/NuGet.exe deleted file mode 100644 index ddc91051bc4..00000000000 Binary files a/Samples/Manufacturing/.nuget/NuGet.exe and /dev/null differ diff --git a/Samples/Manufacturing/.nuget/NuGet.targets b/Samples/Manufacturing/.nuget/NuGet.targets deleted file mode 100644 index 8993f4e5cb4..00000000000 --- a/Samples/Manufacturing/.nuget/NuGet.targets +++ /dev/null @@ -1,52 +0,0 @@ - - - - $(MSBuildProjectDirectory)\..\ - $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) - $(NuGetToolsPath)\nuget.exe - $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) - $([System.IO.Path]::Combine($(SolutionDir), "packages")) - $(TargetDir.Trim('\\')) - - - "" - - - false - - - false - - - "$(NuGetExePath)" install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" - "$(NuGetExePath)" pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols - - - - RestorePackages; - $(BuildDependsOn); - - - - - $(BuildDependsOn); - BuildPackage; - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Manufacturing/HR.Host/App.config b/Samples/Manufacturing/HR.Host/App.config deleted file mode 100644 index b0e5fcd69a5..00000000000 --- a/Samples/Manufacturing/HR.Host/App.config +++ /dev/null @@ -1,10 +0,0 @@ - - - -
    -
    - - - - - \ No newline at end of file diff --git a/Samples/Manufacturing/HR.Host/HR.Host.csproj b/Samples/Manufacturing/HR.Host/HR.Host.csproj deleted file mode 100644 index dd5cf3c905d..00000000000 --- a/Samples/Manufacturing/HR.Host/HR.Host.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D3CA0BFC-8AE8-4828-90EE-0296D7DDF679} - Exe - Properties - HR.Host - HR.Host - - - - - v4.0 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - ..\..\Manufacturing\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - - - - - - - - - - - - {96EE6700-2A16-4C7A-8EF9-3D81E0CE3470} - HR.MessageHandlers - - - {BAC04722-7E15-485E-BA17-3EC46AB7FC3C} - HR.Messages - - - - - 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/Samples/Manufacturing/HR.Host/Program.cs b/Samples/Manufacturing/HR.Host/Program.cs deleted file mode 100644 index 2d4a643f913..00000000000 --- a/Samples/Manufacturing/HR.Host/Program.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using NServiceBus; - -namespace HR.Host -{ - class Program - { - static void Main() - { - Configure.With() - .Log4Net() - .DefaultBuilder() - .XmlSerializer() - .MsmqTransport() - .IsTransactional(true) - .PurgeOnStartup(false) - .InMemorySubscriptionStorage() - .UnicastBus() - .ImpersonateSender(false) - .LoadMessageHandlers() - .CreateBus() - .Start(() => Configure.Instance.ForInstallationOn().Install()); - - Console.Read(); - } - } -} diff --git a/Samples/Manufacturing/HR.Host/Properties/AssemblyInfo.cs b/Samples/Manufacturing/HR.Host/Properties/AssemblyInfo.cs deleted file mode 100644 index 21d52154226..00000000000 --- a/Samples/Manufacturing/HR.Host/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("HR.Host")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("HR.Host")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("fb58930e-1b5b-4029-a946-f887280c6180")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Manufacturing/HR.MessageHandlers/HR.MessageHandlers.csproj b/Samples/Manufacturing/HR.MessageHandlers/HR.MessageHandlers.csproj deleted file mode 100644 index 19c7bb3f963..00000000000 --- a/Samples/Manufacturing/HR.MessageHandlers/HR.MessageHandlers.csproj +++ /dev/null @@ -1,103 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {96EE6700-2A16-4C7A-8EF9-3D81E0CE3470} - Library - Properties - HR.MessageHandlers - HR.MessageHandlers - - - - - v4.0 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - ..\..\Manufacturing\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - {BAC04722-7E15-485E-BA17-3EC46AB7FC3C} - HR.Messages - False - - - - - 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/Samples/Manufacturing/HR.MessageHandlers/Properties/AssemblyInfo.cs b/Samples/Manufacturing/HR.MessageHandlers/Properties/AssemblyInfo.cs deleted file mode 100644 index 246641712d5..00000000000 --- a/Samples/Manufacturing/HR.MessageHandlers/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("HR.MessageHandlers")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("HR.MessageHandlers")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("1860fe17-7216-4831-b84a-3f39c59ead03")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Manufacturing/HR.MessageHandlers/RequestOrderAuthorizationMessageHandler.cs b/Samples/Manufacturing/HR.MessageHandlers/RequestOrderAuthorizationMessageHandler.cs deleted file mode 100644 index 7feaed98d2f..00000000000 --- a/Samples/Manufacturing/HR.MessageHandlers/RequestOrderAuthorizationMessageHandler.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using HR.Messages; -using NServiceBus; -using System.Threading; - -namespace HR.MessageHandlers -{ - public class RequestOrderAuthorizationMessageHandler : IHandleMessages - { - public void Handle(RequestOrderAuthorizationMessage message) - { - Console.WriteLine("Recieved Message: " + message); - Console.WriteLine(" PartnerId: " + message.PartnerId); - foreach (var orderLine in message.OrderLines) - Console.WriteLine(" orderLine productId: {0}, Quantity {1}", orderLine.ProductId, orderLine.Quantity); - - - if (message.OrderLines != null) - foreach(IOrderLine ol in message.OrderLines) - if (ol.Quantity > 50F) - Thread.Sleep(10000); - - // This will reply back to the order saga instance that sent us this message. NServiceBus is - // automatically doing the correlationF - Bus.Reply(m => - { - m.Success = true; - m.OrderLines = message.OrderLines; - }); - } - - public IBus Bus { get; set; } - } -} diff --git a/Samples/Manufacturing/HR.Messages/HR.Messages.csproj b/Samples/Manufacturing/HR.Messages/HR.Messages.csproj deleted file mode 100644 index 95fc51fe8d8..00000000000 --- a/Samples/Manufacturing/HR.Messages/HR.Messages.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {BAC04722-7E15-485E-BA17-3EC46AB7FC3C} - Library - Properties - HR.Messages - HR.Messages - - - - - v4.0 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - ..\..\Manufacturing\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - - - 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/Samples/Manufacturing/HR.Messages/IOrderLine.cs b/Samples/Manufacturing/HR.Messages/IOrderLine.cs deleted file mode 100644 index bb409851ea5..00000000000 --- a/Samples/Manufacturing/HR.Messages/IOrderLine.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using NServiceBus; - -namespace HR.Messages -{ - public interface IOrderLine : IMessage - { - Guid ProductId { get; set; } - float Quantity { get; set; } - } -} diff --git a/Samples/Manufacturing/HR.Messages/OrderAuthorizationResponseMessage.cs b/Samples/Manufacturing/HR.Messages/OrderAuthorizationResponseMessage.cs deleted file mode 100644 index a99d76b33e1..00000000000 --- a/Samples/Manufacturing/HR.Messages/OrderAuthorizationResponseMessage.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.Collections.Generic; - -namespace HR.Messages -{ - using NServiceBus; - - public class OrderAuthorizationResponseMessage:IMessage - { - public bool Success { get; set; } - public List OrderLines { get; set; } - } -} diff --git a/Samples/Manufacturing/HR.Messages/Properties/AssemblyInfo.cs b/Samples/Manufacturing/HR.Messages/Properties/AssemblyInfo.cs deleted file mode 100644 index 243191b0ee2..00000000000 --- a/Samples/Manufacturing/HR.Messages/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("HR.Messages")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("HR.Messages")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("9d6db41f-c8de-4992-bca6-3879ea49e571")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Manufacturing/HR.Messages/RequestOrderAuthorizationMessage.cs b/Samples/Manufacturing/HR.Messages/RequestOrderAuthorizationMessage.cs deleted file mode 100644 index bf4c10c9009..00000000000 --- a/Samples/Manufacturing/HR.Messages/RequestOrderAuthorizationMessage.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace HR.Messages -{ - using NServiceBus; - - public class RequestOrderAuthorizationMessage : IMessage - { - public Guid PartnerId { get; set; } - public List OrderLines { get; set; } - } -} diff --git a/Samples/Manufacturing/InteropPartner/InteropPartner.csproj b/Samples/Manufacturing/InteropPartner/InteropPartner.csproj deleted file mode 100644 index 2a01aa71867..00000000000 --- a/Samples/Manufacturing/InteropPartner/InteropPartner.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {AF9929C8-85B8-4A36-9EC8-E46C17FE3B65} - Exe - Properties - InteropPartner - InteropPartner - v4.0 - 512 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - ..\..\Manufacturing\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - - - - - - - - - - - - - - - - - - - - - - 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/Samples/Manufacturing/InteropPartner/Program.cs b/Samples/Manufacturing/InteropPartner/Program.cs deleted file mode 100644 index 3a654d450dd..00000000000 --- a/Samples/Manufacturing/InteropPartner/Program.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Messaging; -using System.Xml.Serialization; - -namespace InteropPartner -{ - class Program - { - static void Main() - { - Console.WriteLine("Using straight xml serialization and msmq to test interop."); - Console.WriteLine("To exit, enter 'q'. Press 'Enter' to send a message."); - - string queueName = string.Format("FormatName:DIRECT=OS:{0}\\private$\\OrderService", Environment.MachineName); - var label = "UDI_MOBILE_2\\Administrator"; - - var q = new MessageQueue(queueName); - - var serializer = new XmlSerializer(typeof(OrderMessage), new[] { typeof(OrderLine) }); - - while ((Console.ReadLine().ToLower()) != "q") - { - var m1 = new OrderMessage - { - PurchaseOrderNumber = Guid.NewGuid().ToString(), - ProvideBy = DateTime.Now, - PartnerId = Guid.NewGuid(), - OrderLines = new[] {new OrderLine {ProductId = Guid.NewGuid(), Quantity = 10F}}, - Done = true - }; - - var toSend = new Message(); - serializer.Serialize(toSend.BodyStream, m1); - toSend.ResponseQueue = new MessageQueue(string.Format("FormatName:DIRECT=OS:{0}\\private$\\Partner", Environment.MachineName)); - toSend.Label = label; - - q.Send(toSend, MessageQueueTransactionType.Single); - Console.WriteLine("Sent order {0}", m1.PurchaseOrderNumber); - } - } - } -} diff --git a/Samples/Manufacturing/InteropPartner/Properties/AssemblyInfo.cs b/Samples/Manufacturing/InteropPartner/Properties/AssemblyInfo.cs deleted file mode 100644 index 81e2173ae2e..00000000000 --- a/Samples/Manufacturing/InteropPartner/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("InteropPartner")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("InteropPartner")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("6e1c25c9-5c7e-4f9c-beee-576f1558a5f8")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Manufacturing/InteropPartner/schema0.xsd b/Samples/Manufacturing/InteropPartner/schema0.xsd deleted file mode 100644 index b95602e0f69..00000000000 --- a/Samples/Manufacturing/InteropPartner/schema0.xsd +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Samples/Manufacturing/InteropPartner/schema1.xsd b/Samples/Manufacturing/InteropPartner/schema1.xsd deleted file mode 100644 index 0b53564abff..00000000000 --- a/Samples/Manufacturing/InteropPartner/schema1.xsd +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/Samples/Manufacturing/InteropPartner/schema1_schema0.cs b/Samples/Manufacturing/InteropPartner/schema1_schema0.cs deleted file mode 100644 index 97e98e5d700..00000000000 --- a/Samples/Manufacturing/InteropPartner/schema1_schema0.cs +++ /dev/null @@ -1,260 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.3053 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -using System.Xml.Serialization; - -// -// This source code was auto-generated by xsd, Version=2.0.50727.3038. -// - - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.net/OrderService.Messages")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://tempuri.net/OrderService.Messages", IsNullable=true)] -public partial class OrderStatusChangedMessage { - - private string purchaseOrderNumberField; - - private System.Guid partnerIdField; - - private OrderStatusEnum statusField; - - private object[] orderLinesField; - - /// - public string PurchaseOrderNumber { - get { - return this.purchaseOrderNumberField; - } - set { - this.purchaseOrderNumberField = value; - } - } - - /// - public System.Guid PartnerId { - get { - return this.partnerIdField; - } - set { - this.partnerIdField = value; - } - } - - /// - public OrderStatusEnum Status { - get { - return this.statusField; - } - set { - this.statusField = value; - } - } - - /// - [System.Xml.Serialization.XmlArrayItemAttribute("OrderLine")] - public object[] OrderLines { - get { - return this.orderLinesField; - } - set { - this.orderLinesField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] -[System.SerializableAttribute()] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.net/OrderService.Messages")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://tempuri.net/OrderService.Messages", IsNullable=false)] -public enum OrderStatusEnum { - - /// - Tentative, - - /// - Recieved, - - /// - Authorized, - - /// - Rejected, - - /// - Accepted, -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.net/OrderService.Messages")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://tempuri.net/OrderService.Messages", IsNullable=true)] -public partial class OrderMessage { - - private bool doneField; - - private System.DateTime provideByField; - - private object[] orderLinesField; - - private string purchaseOrderNumberField; - - private System.Guid partnerIdField; - - /// - public bool Done { - get { - return this.doneField; - } - set { - this.doneField = value; - } - } - - /// - public System.DateTime ProvideBy { - get { - return this.provideByField; - } - set { - this.provideByField = value; - } - } - - /// - [System.Xml.Serialization.XmlArrayItemAttribute("OrderLine")] - public object[] OrderLines { - get { - return this.orderLinesField; - } - set { - this.orderLinesField = value; - } - } - - /// - public string PurchaseOrderNumber { - get { - return this.purchaseOrderNumberField; - } - set { - this.purchaseOrderNumberField = value; - } - } - - /// - public System.Guid PartnerId { - get { - return this.partnerIdField; - } - set { - this.partnerIdField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(TypeName="ArrayOfOrderLine", Namespace="http://tempuri.net/OrderService.Messages")] -[System.Xml.Serialization.XmlRootAttribute("ArrayOfOrderLine", Namespace="http://tempuri.net/OrderService.Messages", IsNullable=true)] -public partial class ArrayOfOrderLine1 { - - private object[] orderLineField; - - /// - [System.Xml.Serialization.XmlElementAttribute("OrderLine", IsNullable=true)] - public object[] OrderLine { - get { - return this.orderLineField; - } - set { - this.orderLineField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.net/OrderService.Messages")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://tempuri.net/OrderService.Messages", IsNullable=true)] -public partial class OrderLine { - - private System.Guid productIdField; - - private float quantityField; - - /// - public System.Guid ProductId { - get { - return this.productIdField; - } - set { - this.productIdField = value; - } - } - - /// - public float Quantity { - get { - return this.quantityField; - } - set { - this.quantityField = value; - } - } -} - -/// -[System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] -[System.SerializableAttribute()] -[System.Diagnostics.DebuggerStepThroughAttribute()] -[System.ComponentModel.DesignerCategoryAttribute("code")] -[System.Xml.Serialization.XmlTypeAttribute(Namespace="http://tempuri.net/OrderService.Messages")] -[System.Xml.Serialization.XmlRootAttribute(Namespace="http://tempuri.net/OrderService.Messages", IsNullable=true)] -public partial class CancelOrderMessage { - - private string purchaseOrderNumberField; - - private System.Guid partnerIdField; - - /// - public string PurchaseOrderNumber { - get { - return this.purchaseOrderNumberField; - } - set { - this.purchaseOrderNumberField = value; - } - } - - /// - public System.Guid PartnerId { - get { - return this.partnerIdField; - } - set { - this.partnerIdField = value; - } - } -} diff --git a/Samples/Manufacturing/Manufacturing.sln b/Samples/Manufacturing/Manufacturing.sln deleted file mode 100644 index 7f946577392..00000000000 --- a/Samples/Manufacturing/Manufacturing.sln +++ /dev/null @@ -1,80 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OrderService", "OrderService", "{B3A86F87-4170-49FF-87A0-7B1B8A7BE087}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HRService", "HRService", "{497655AA-94DF-421F-BD96-D27958E3C465}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderService", "OrderService\OrderService\OrderService.csproj", "{452C5FEA-16C8-49E1-BC95-1EC55E49EECB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HR.Messages", "HR.Messages\HR.Messages.csproj", "{BAC04722-7E15-485E-BA17-3EC46AB7FC3C}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderService.Messages", "OrderService\OrderService.Messages\OrderService.Messages.csproj", "{A490D793-1D1D-486F-B808-827010EF8369}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OrderService.Tests", "OrderService\OrderService.Tests\OrderService.Tests.csproj", "{CB39076B-B46C-416A-A9C1-D1032B4C50D6}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HR.MessageHandlers", "HR.MessageHandlers\HR.MessageHandlers.csproj", "{96EE6700-2A16-4C7A-8EF9-3D81E0CE3470}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HR.Host", "HR.Host\HR.Host.csproj", "{D3CA0BFC-8AE8-4828-90EE-0296D7DDF679}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Partner", "Partner\Partner.csproj", "{646585FC-12F6-4668-9926-A39E6CCD6400}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InteropPartner", "InteropPartner\InteropPartner.csproj", "{AF9929C8-85B8-4A36-9EC8-E46C17FE3B65}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{D51F257D-ADAC-4110-B2D2-175D3CA44258}" - ProjectSection(SolutionItems) = preProject - .nuget\NuGet.exe = .nuget\NuGet.exe - .nuget\NuGet.targets = .nuget\NuGet.targets - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {452C5FEA-16C8-49E1-BC95-1EC55E49EECB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {452C5FEA-16C8-49E1-BC95-1EC55E49EECB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {452C5FEA-16C8-49E1-BC95-1EC55E49EECB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {452C5FEA-16C8-49E1-BC95-1EC55E49EECB}.Release|Any CPU.Build.0 = Release|Any CPU - {BAC04722-7E15-485E-BA17-3EC46AB7FC3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BAC04722-7E15-485E-BA17-3EC46AB7FC3C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BAC04722-7E15-485E-BA17-3EC46AB7FC3C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BAC04722-7E15-485E-BA17-3EC46AB7FC3C}.Release|Any CPU.Build.0 = Release|Any CPU - {A490D793-1D1D-486F-B808-827010EF8369}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A490D793-1D1D-486F-B808-827010EF8369}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A490D793-1D1D-486F-B808-827010EF8369}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A490D793-1D1D-486F-B808-827010EF8369}.Release|Any CPU.Build.0 = Release|Any CPU - {CB39076B-B46C-416A-A9C1-D1032B4C50D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CB39076B-B46C-416A-A9C1-D1032B4C50D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CB39076B-B46C-416A-A9C1-D1032B4C50D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CB39076B-B46C-416A-A9C1-D1032B4C50D6}.Release|Any CPU.Build.0 = Release|Any CPU - {96EE6700-2A16-4C7A-8EF9-3D81E0CE3470}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {96EE6700-2A16-4C7A-8EF9-3D81E0CE3470}.Debug|Any CPU.Build.0 = Debug|Any CPU - {96EE6700-2A16-4C7A-8EF9-3D81E0CE3470}.Release|Any CPU.ActiveCfg = Release|Any CPU - {96EE6700-2A16-4C7A-8EF9-3D81E0CE3470}.Release|Any CPU.Build.0 = Release|Any CPU - {D3CA0BFC-8AE8-4828-90EE-0296D7DDF679}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3CA0BFC-8AE8-4828-90EE-0296D7DDF679}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3CA0BFC-8AE8-4828-90EE-0296D7DDF679}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3CA0BFC-8AE8-4828-90EE-0296D7DDF679}.Release|Any CPU.Build.0 = Release|Any CPU - {646585FC-12F6-4668-9926-A39E6CCD6400}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {646585FC-12F6-4668-9926-A39E6CCD6400}.Debug|Any CPU.Build.0 = Debug|Any CPU - {646585FC-12F6-4668-9926-A39E6CCD6400}.Release|Any CPU.ActiveCfg = Release|Any CPU - {646585FC-12F6-4668-9926-A39E6CCD6400}.Release|Any CPU.Build.0 = Release|Any CPU - {AF9929C8-85B8-4A36-9EC8-E46C17FE3B65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AF9929C8-85B8-4A36-9EC8-E46C17FE3B65}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AF9929C8-85B8-4A36-9EC8-E46C17FE3B65}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AF9929C8-85B8-4A36-9EC8-E46C17FE3B65}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {452C5FEA-16C8-49E1-BC95-1EC55E49EECB} = {B3A86F87-4170-49FF-87A0-7B1B8A7BE087} - {A490D793-1D1D-486F-B808-827010EF8369} = {B3A86F87-4170-49FF-87A0-7B1B8A7BE087} - {CB39076B-B46C-416A-A9C1-D1032B4C50D6} = {B3A86F87-4170-49FF-87A0-7B1B8A7BE087} - {BAC04722-7E15-485E-BA17-3EC46AB7FC3C} = {497655AA-94DF-421F-BD96-D27958E3C465} - {96EE6700-2A16-4C7A-8EF9-3D81E0CE3470} = {497655AA-94DF-421F-BD96-D27958E3C465} - {D3CA0BFC-8AE8-4828-90EE-0296D7DDF679} = {497655AA-94DF-421F-BD96-D27958E3C465} - EndGlobalSection -EndGlobal diff --git a/Samples/Manufacturing/Manufacturing.suo b/Samples/Manufacturing/Manufacturing.suo deleted file mode 100644 index 3e1c639d8fa..00000000000 Binary files a/Samples/Manufacturing/Manufacturing.suo and /dev/null differ diff --git a/Samples/Manufacturing/OrderService/OrderService.Messages/CancelOrderMessage.cs b/Samples/Manufacturing/OrderService/OrderService.Messages/CancelOrderMessage.cs deleted file mode 100644 index 3d2de33abe1..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService.Messages/CancelOrderMessage.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using NServiceBus; - -namespace OrderService.Messages -{ - public interface CancelOrderMessage : IMessage - { - string PurchaseOrderNumber { get; set; } - Guid PartnerId { get; set; } - } -} diff --git a/Samples/Manufacturing/OrderService/OrderService.Messages/IOrderLine.cs b/Samples/Manufacturing/OrderService/OrderService.Messages/IOrderLine.cs deleted file mode 100644 index 6c7055fdf08..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService.Messages/IOrderLine.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using HR.Messages; -using NServiceBus; - -namespace OrderService.Messages -{ - public interface IOrderLine : IMessage - { - Guid ProductId { get; set; } - float Quantity { get; set; } - } -} diff --git a/Samples/Manufacturing/OrderService/OrderService.Messages/IOrderMessage.cs b/Samples/Manufacturing/OrderService/OrderService.Messages/IOrderMessage.cs deleted file mode 100644 index 462a8ff0284..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService.Messages/IOrderMessage.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using NServiceBus; - -namespace OrderService.Messages -{ - public interface IOrderMessage : IMessage - { - bool Done { get; set; } - DateTime ProvideBy { get; set; } - List OrderLines { get; set; } - string PurchaseOrderNumber { get; set; } - Guid PartnerId { get; set; } - } -} diff --git a/Samples/Manufacturing/OrderService/OrderService.Messages/IOrderStatusChangedMessage.cs b/Samples/Manufacturing/OrderService/OrderService.Messages/IOrderStatusChangedMessage.cs deleted file mode 100644 index 7c4405fdaec..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService.Messages/IOrderStatusChangedMessage.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using NServiceBus; - -namespace OrderService.Messages -{ - public interface IOrderStatusChangedMessage : IMessage - { - string PurchaseOrderNumber { get; set; } - Guid PartnerId { get; set; } - OrderStatusEnum Status { get; set; } - List OrderLines { get; set; } - } -} diff --git a/Samples/Manufacturing/OrderService/OrderService.Messages/OrderMessage.cs b/Samples/Manufacturing/OrderService/OrderService.Messages/OrderMessage.cs deleted file mode 100644 index d155fc0fd97..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService.Messages/OrderMessage.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace OrderService.Messages -{ - public class OrderMessage : IOrderMessage - { - public bool Done { get; set; } - public DateTime ProvideBy { get; set; } - public List OrderLines { get; set; } - public string PurchaseOrderNumber { get; set; } - public Guid PartnerId { get; set; } - } -} \ No newline at end of file diff --git a/Samples/Manufacturing/OrderService/OrderService.Messages/OrderService.Messages.csproj b/Samples/Manufacturing/OrderService/OrderService.Messages/OrderService.Messages.csproj deleted file mode 100644 index a9642f3c452..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService.Messages/OrderService.Messages.csproj +++ /dev/null @@ -1,108 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A490D793-1D1D-486F-B808-827010EF8369} - Library - Properties - OrderService.Messages - OrderService.Messages - - - - - v4.0 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - ..\..\..\Manufacturing\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - - - - - - {BAC04722-7E15-485E-BA17-3EC46AB7FC3C} - HR.Messages - False - - - - - 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/Samples/Manufacturing/OrderService/OrderService.Messages/OrderStatusEnum.cs b/Samples/Manufacturing/OrderService/OrderService.Messages/OrderStatusEnum.cs deleted file mode 100644 index 42bb7e65f08..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService.Messages/OrderStatusEnum.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace OrderService.Messages -{ - public enum OrderStatusEnum - { - Tentative, - Recieved, - Authorized, - Rejected, - Accepted - } -} diff --git a/Samples/Manufacturing/OrderService/OrderService.Messages/Properties/AssemblyInfo.cs b/Samples/Manufacturing/OrderService/OrderService.Messages/Properties/AssemblyInfo.cs deleted file mode 100644 index 127aebd64a0..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService.Messages/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Messages")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Messages")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("304e0ad9-8837-4233-a9c4-d888c072987f")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Manufacturing/OrderService/OrderService.Tests/OrderSagaTests.cs b/Samples/Manufacturing/OrderService/OrderService.Tests/OrderSagaTests.cs deleted file mode 100644 index 46d1942970a..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService.Tests/OrderSagaTests.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using System.Collections.Generic; -using HR.Messages; -using NServiceBus.Saga; -using NServiceBus.Testing; -using OrderService.Messages; -using NUnit.Framework; -using NServiceBus; -using IOrderLine = HR.Messages.IOrderLine; - -namespace OrderService.Tests -{ - [TestFixture] - public class OrderSagaTests - { - #region members - - string partnerAddress; - Guid productId; - float quantity; - Guid partnerId; - string purchaseOrderNumber; - List orderLines; - - #endregion - - [TestFixtureSetUp] - public void Setup() - { - Test.Initialize(); - - partnerAddress = "partner"; - productId = Guid.NewGuid(); - quantity = 10.0F; - partnerId = Guid.NewGuid(); - purchaseOrderNumber = Guid.NewGuid().ToString(); - orderLines = new List(); - orderLines.Add(ol => { ol.ProductId = productId; ol.Quantity = quantity; }); - } - - [Test] - public void OrderSagaTest() - { - var sagaId = Guid.NewGuid(); - var order = CreateRequest(); - - Test.Saga(sagaId).WhenReceivesMessageFrom(partnerAddress) - .ExpectReplyToOrginator(m => (Check(m, OrderStatusEnum.Recieved))) - .ExpectPublish(m => Check(m, OrderStatusEnum.Recieved)) - .ExpectSend(m=>Check(m)) - .ExpectTimeoutToBeSetAt((state, at) => at == order.ProvideBy - TimeSpan.FromSeconds(2) && state == "state") - .When(os => os.Handle(order)) - - .ExpectReplyToOrginator(m => (Check(m, OrderStatusEnum.Accepted))) - .ExpectPublish(m => Check(m, OrderStatusEnum.Accepted)) - .When(os => os.Handle(CreateResponse())); - } - - [Test] - public void TimeoutTest() - { - object st = null; - var sagaId = Guid.NewGuid(); - - Test.Saga(sagaId).WhenReceivesMessageFrom(partnerAddress) - .ExpectReplyToOrginator(m => (Check(m, OrderStatusEnum.Recieved))) - .ExpectPublish(m => Check(m, OrderStatusEnum.Recieved)) - .ExpectSend(m => Check(m)) - .ExpectTimeoutToBeSetAt((state, at) => { st = state; return true; }) - .When(os => os.Handle(CreateRequest())) - - .ExpectReplyToOrginator(m => (Check(m, OrderStatusEnum.Accepted))) - .ExpectPublish(m => BasicCheck(m, OrderStatusEnum.Accepted)) - .When(os => os.Timeout(st)) - - .AssertSagaCompletionIs(true); - } - - #region helper methods - - private IOrderMessage CreateRequest() - { - return Test.CreateInstance(m => - { - m.PurchaseOrderNumber = purchaseOrderNumber; - m.PartnerId = partnerId; - m.Done = true; - m.ProvideBy = DateTime.Now + TimeSpan.FromDays(2); - m.OrderLines = orderLines; - }); - } - - private OrderAuthorizationResponseMessage CreateResponse() - { - var hrLines = new List - { - Test.CreateInstance(m => - { - m.ProductId = productId; - m.Quantity = quantity; - }) - }; - - return Test.CreateInstance(m => { m.Success = true; m.OrderLines = hrLines; }); - } - - private bool Check(IOrderStatusChangedMessage m, OrderStatusEnum status) - { - return ( - m.PartnerId == partnerId && - m.PurchaseOrderNumber == purchaseOrderNumber && - m.Status == status && - m.OrderLines.Count == 1 && - m.OrderLines[0].ProductId == productId && - m.OrderLines[0].Quantity == quantity - ); - } - - private bool Check(RequestOrderAuthorizationMessage m) - { - return ( - m.PartnerId == partnerId && - m.OrderLines.Count == 1 && - m.OrderLines[0].ProductId == productId && - m.OrderLines[0].Quantity == quantity - ); - } - - private bool BasicCheck(IOrderStatusChangedMessage m, OrderStatusEnum status) - { - return ( - m.PartnerId == partnerId && - m.PurchaseOrderNumber == purchaseOrderNumber && - m.Status == status - ); - } - #endregion - - } -} diff --git a/Samples/Manufacturing/OrderService/OrderService.Tests/OrderService.Tests.csproj b/Samples/Manufacturing/OrderService/OrderService.Tests/OrderService.Tests.csproj deleted file mode 100644 index a365206ecc0..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService.Tests/OrderService.Tests.csproj +++ /dev/null @@ -1,134 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CB39076B-B46C-416A-A9C1-D1032B4C50D6} - Library - Properties - OrderService.Tests - OrderService.Tests - - - - - v4.0 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - ..\..\..\Manufacturing\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\..\binaries\log4net.dll - - - False - ..\..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\..\binaries\NServiceBus.Testing.dll - - - ..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll - - - ..\..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll - - - ..\..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll - - - - - - - - - - - - - - {BAC04722-7E15-485E-BA17-3EC46AB7FC3C} - HR.Messages - - - {A490D793-1D1D-486F-B808-827010EF8369} - OrderService.Messages - - - {452C5FEA-16C8-49E1-BC95-1EC55E49EECB} - OrderService %28OrderService\OrderService%29 - - - - - 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/Samples/Manufacturing/OrderService/OrderService.Tests/Properties/AssemblyInfo.cs b/Samples/Manufacturing/OrderService/OrderService.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 38fc5eb9f76..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService.Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("OrderService.Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OrderService.Tests")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("380775e6-942a-40fe-a0a1-53eb267960f4")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Manufacturing/OrderService/OrderService.Tests/packages.config b/Samples/Manufacturing/OrderService/OrderService.Tests/packages.config deleted file mode 100644 index 27a38197546..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService.Tests/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Samples/Manufacturing/OrderService/OrderService/26To30TimeoutMessageConverter.cs b/Samples/Manufacturing/OrderService/OrderService/26To30TimeoutMessageConverter.cs deleted file mode 100644 index 93bdfe00ff7..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService/26To30TimeoutMessageConverter.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace OrderService -{ - using NServiceBus; - using NServiceBus.Config; - using NServiceBus.MessageMutator; - using NServiceBus.Saga; - - //public class TimeoutMessageConverter:IMutateIncomingMessages,INeedInitialization - - //{ - // public IBus Bus { get; set; } - - // public object MutateIncoming(object message) - // { - // var m = message as TimeoutMessage; - // if (m != null) - // { - // Bus.CurrentMessageContext.Headers[Headers.SagaId] = m.SagaId.ToString(); - // } - // return message; - - // } - - // public void Init() - // { - // Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - // } - //} -} \ No newline at end of file diff --git a/Samples/Manufacturing/OrderService/OrderService/App.config b/Samples/Manufacturing/OrderService/OrderService/App.config deleted file mode 100644 index d25f37cc46b..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService/App.config +++ /dev/null @@ -1,18 +0,0 @@ - - - -
    -
    -
    - - - - - - - - - - - - diff --git a/Samples/Manufacturing/OrderService/OrderService/EndpointConfig.cs b/Samples/Manufacturing/OrderService/OrderService/EndpointConfig.cs deleted file mode 100644 index 0413efde7cc..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService/EndpointConfig.cs +++ /dev/null @@ -1,6 +0,0 @@ -using NServiceBus; - -namespace OrderService -{ - public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher {} -} \ No newline at end of file diff --git a/Samples/Manufacturing/OrderService/OrderService/NServiceBus.Host.exe.config b/Samples/Manufacturing/OrderService/OrderService/NServiceBus.Host.exe.config deleted file mode 100644 index d1900f4952c..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService/NServiceBus.Host.exe.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Samples/Manufacturing/OrderService/OrderService/OrderSaga.cs b/Samples/Manufacturing/OrderService/OrderService/OrderSaga.cs deleted file mode 100644 index e33d8c9b801..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService/OrderSaga.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using System.Collections.Generic; -using HR.Messages; -using NServiceBus.Saga; -using OrderService.Messages; -using NServiceBus; -using IOrderLine = HR.Messages.IOrderLine; - -namespace OrderService -{ - public class OrderSaga : Saga, - IAmStartedByMessages, - IHandleMessages, - IHandleMessages - { - public override void ConfigureHowToFindSaga() - { - ConfigureMapping(s => s.PurchaseOrderNumber, m => m.PurchaseOrderNumber); - ConfigureMapping(s => s.PurchaseOrderNumber, m => m.PurchaseOrderNumber); - // Notice that we have no mappings for the OrderAuthorizationResponseMessage message. This is not needed since the HR - // endpoint will do a Bus.Reply and NServiceBus will then automatically correlate the reply back to - // the originating saga - } - - public void Handle(IOrderMessage message) - { - Console.WriteLine("Recieved message: " + message); - - Data.PurchaseOrderNumber = message.PurchaseOrderNumber; - Data.PartnerId = message.PartnerId; - Data.ProvideBy = message.ProvideBy; - - foreach (Messages.IOrderLine ol in message.OrderLines) - Data.UpdateOrderLine(ol.ProductId, ol.Quantity); - - var status = GetStatus(OrderStatusEnum.Recieved, GetOrderLines(Data.OrderLines)); - - if (message.Done) - { - ReplyToOriginator(status); - Bus.Publish(status); - - Bus.Send(m => - { - m.PartnerId = Data.PartnerId; - m.OrderLines = Convert(status.OrderLines); - }); - - RequestUtcTimeout(Data.ProvideBy - TimeSpan.FromSeconds(2), "state"); - } - else - { - status.Status = OrderStatusEnum.Tentative; - Console.WriteLine("Publishing: " + OrderStatusEnum.Tentative); - Bus.Publish(status); - } - } - - public void Handle(OrderAuthorizationResponseMessage message) - { - Console.WriteLine("======================================================================"); - - var status = GetStatus( - (message.Success ? OrderStatusEnum.Authorized : OrderStatusEnum.Rejected), - GetOrderLines(message.OrderLines)); - - ReplyToOriginator(status); - Bus.Publish(status); - - foreach (var ol in message.OrderLines) - Data.UpdateAuthorization(message.Success, ol.ProductId, ol.Quantity); - - if (Data.IsAuthorized()) - Complete(); - } - - public void Handle(CancelOrderMessage message) - { - Console.WriteLine("======================================================================"); - - } - - private void Complete() - { - var finalStatus = GetStatus(OrderStatusEnum.Accepted, GetOrderLines(Data.OrderLines)); - - Bus.Publish(finalStatus); - ReplyToOriginator(finalStatus); - - MarkAsComplete(); - } - - public override void Timeout(object state) - { - Console.WriteLine("======================================================================"); - - Complete(); - } - - private List Convert(List list) where T : Messages.IOrderLine where K : IOrderLine - { - var result = new List(list.Count); - - list.ForEach(ol => result.Add(Bus.CreateInstance(k => { k.ProductId = ol.ProductId; k.Quantity = ol.Quantity; }))); - - return result; - } - - private static List GetOrderLines(IEnumerable lines) - { - var result = new List(); - - foreach (OrderLine ol in lines) - result.Add(o => { o.ProductId = ol.ProductId; o.Quantity = ol.Quantity; }); - - return result; - } - - private IOrderStatusChangedMessage GetStatus(OrderStatusEnum status, List lines) - { - return Bus.CreateInstance(m => - { - m.PurchaseOrderNumber = Data.PurchaseOrderNumber; - m.PartnerId = Data.PartnerId; - m.Status = status; - m.OrderLines = lines; - }); - } - - private static List GetOrderLines(IEnumerable lines) - { - var result = new List(); - - foreach (IOrderLine ol in lines) - result.Add(o => { o.ProductId = ol.ProductId; o.Quantity = ol.Quantity; }); - - return result; - } - } -} diff --git a/Samples/Manufacturing/OrderService/OrderService/OrderSagaData.cs b/Samples/Manufacturing/OrderService/OrderService/OrderSagaData.cs deleted file mode 100644 index 536437288d2..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService/OrderSagaData.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Collections.Generic; -using NServiceBus.Saga; - -namespace OrderService -{ - public class OrderSagaData : IContainSagaData - { - public virtual Guid Id { get; set; } - public virtual string Originator { get; set; } - public virtual string OriginalMessageId { get; set; } - - [Unique] - public virtual string PurchaseOrderNumber { get; set; } - public virtual Guid PartnerId { get; set; } - public virtual DateTime ProvideBy { get; set; } - - public virtual void UpdateOrderLine(Guid productId, float quantity) - { - bool found = false; - - foreach (OrderLine line in OrderLines) - if (line.ProductId == productId) - { - line.Quantity = quantity; - found = true; - } - - if (!found) - OrderLines.Add(new OrderLine { ProductId = productId, Quantity = quantity }); - } - - public virtual void UpdateAuthorization(bool authorized, Guid productId, float quantity) - { - OrderLine toRemove = null; - - foreach (OrderLine line in OrderLines) - if (line.ProductId == productId) - if (authorized) - line.AuthorizedQuantity = quantity; - else - toRemove = line; - - if (toRemove != null) - OrderLines.Remove(toRemove); - } - - public virtual bool IsAuthorized() - { - foreach(OrderLine line in OrderLines) - if (line.Quantity != line.AuthorizedQuantity) - return false; - - return true; - } - - - private IList orderLines; - - public virtual IList OrderLines - { - get - { - if (orderLines == null) - orderLines = new List(); - return orderLines; - } - set { orderLines = value; } - } - } - - public class OrderLine - { - public virtual Guid Id { get; set; } - public virtual Guid ProductId { get; set; } - public virtual float Quantity { get; set; } - public virtual float AuthorizedQuantity { get; set; } - } -} diff --git a/Samples/Manufacturing/OrderService/OrderService/OrderService.csproj b/Samples/Manufacturing/OrderService/OrderService/OrderService.csproj deleted file mode 100644 index 5800b18a1db..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService/OrderService.csproj +++ /dev/null @@ -1,137 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {452C5FEA-16C8-49E1-BC95-1EC55E49EECB} - Library - Properties - OrderService - OrderService - - - - - v4.0 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - ..\..\..\Manufacturing\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - - - - False - ..\..\..\..\binaries\log4net.dll - - - False - ..\..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - - - {BAC04722-7E15-485E-BA17-3EC46AB7FC3C} - HR.Messages - - - {A490D793-1D1D-486F-B808-827010EF8369} - OrderService.Messages - - - - - Designer - - - PreserveNewest - Designer - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Integration - AllRules.ruleset - - - \ No newline at end of file diff --git a/Samples/Manufacturing/OrderService/OrderService/Properties/AssemblyInfo.cs b/Samples/Manufacturing/OrderService/OrderService/Properties/AssemblyInfo.cs deleted file mode 100644 index 829aa563e16..00000000000 --- a/Samples/Manufacturing/OrderService/OrderService/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("OrderService")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("OrderService")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("38ec37f2-ea0e-4edd-9c4b-b15a32e26fea")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Revision and Build Numbers -// by using the '*' as shown below: -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Manufacturing/Partner/App.config b/Samples/Manufacturing/Partner/App.config deleted file mode 100644 index 84ada5e95df..00000000000 --- a/Samples/Manufacturing/Partner/App.config +++ /dev/null @@ -1,19 +0,0 @@ - - - -
    -
    -
    - - - - - - - - - - - - - diff --git a/Samples/Manufacturing/Partner/OrderStatusChangedMessageHandler.cs b/Samples/Manufacturing/Partner/OrderStatusChangedMessageHandler.cs deleted file mode 100644 index a768319ff5a..00000000000 --- a/Samples/Manufacturing/Partner/OrderStatusChangedMessageHandler.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using NServiceBus; -using OrderService.Messages; - -namespace Partner -{ - public class OrderStatusChangedMessageHandler : IHandleMessages - { - public void Handle(IOrderStatusChangedMessage message) - { - Console.WriteLine("Received status {0} for PO Number {1}.", Enum.GetName(typeof(OrderStatusEnum), message.Status), message.PurchaseOrderNumber); - } - } - -} diff --git a/Samples/Manufacturing/Partner/Partner.csproj b/Samples/Manufacturing/Partner/Partner.csproj deleted file mode 100644 index f045b6d2cba..00000000000 --- a/Samples/Manufacturing/Partner/Partner.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {646585FC-12F6-4668-9926-A39E6CCD6400} - Exe - Properties - Partner - Partner - - - - - v4.0 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - ..\..\Manufacturing\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\lib\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - - - - - - - - - - - - - {BAC04722-7E15-485E-BA17-3EC46AB7FC3C} - HR.Messages - - - {A490D793-1D1D-486F-B808-827010EF8369} - OrderService.Messages - - - - - - - - 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/Samples/Manufacturing/Partner/Program.cs b/Samples/Manufacturing/Partner/Program.cs deleted file mode 100644 index 08d2cefa001..00000000000 --- a/Samples/Manufacturing/Partner/Program.cs +++ /dev/null @@ -1,118 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Threading; -using log4net; -using NServiceBus; -using OrderService.Messages; - -namespace Partner -{ - class Program - { - private static IBus bus; - private static void BusBootstrap() - { - bus = Configure.With() - .Log4Net() - .DefaultBuilder() - .XmlSerializer() - .MsmqTransport() - .IsTransactional(true) - .PurgeOnStartup(false) - .UnicastBus() - .ImpersonateSender(false) - .LoadMessageHandlers() - .CreateBus() - .Start(() => Configure.Instance.ForInstallationOn().Install()); - } - - static void Main() - { - try - { - BusBootstrap(); - - Guid partnerId = Guid.NewGuid(); - Guid productId = Guid.NewGuid(); - - List orderlines; - - Console.WriteLine("Enter the quantity you wish to order.\nSignal a complete PO with 'y'.\nTo exit, enter 'q'."); - string line; - string poId = Guid.NewGuid().ToString(); - while ((line = Console.ReadLine().ToLower()) != "q") - { - if (line.ToLower().Contains("simulate")) - Simulate(bus, line.ToLower().Contains("step")); - - bool done = (line == "y"); - orderlines = new List(1); - - if (!done) - { - float quantity; - float.TryParse(line, out quantity); - orderlines.Add(ol => { ol.ProductId = productId; ol.Quantity = quantity; }); - } - - var orderMessage = new OrderMessage - { - Done = done, - OrderLines = orderlines, - PartnerId = partnerId, - ProvideBy = DateTime.UtcNow + TimeSpan.FromSeconds(10), - PurchaseOrderNumber = poId - }; - bus.Send(orderMessage).Register(i => Console.WriteLine("OK")); - Console.WriteLine("Send PO Number {0}.", poId); - - if (done) - poId = Guid.NewGuid().ToString(); - } - } - catch (Exception e) - { - LogManager.GetLogger("Partner").Fatal("Exiting", e); - Console.Read(); - } - } - - private static void Simulate(IBus bus, bool step) - { - Guid partnerId = Guid.NewGuid(); - int numberOfOrders; - int secondsToProvideBy; - - while(true) - { - var r = new Random(); - - numberOfOrders = 5 + r.Next(0, 5); - secondsToProvideBy = 10 + r.Next(0, 10); - - for (var i = 0; i < numberOfOrders; i++) - { - var purchaseOrderNumber = Guid.NewGuid().ToString(); - - bus.Send(m => - { - m.PurchaseOrderNumber = purchaseOrderNumber; - m.PartnerId = partnerId; - m.Done = true; - m.ProvideBy = DateTime.UtcNow + TimeSpan.FromSeconds(secondsToProvideBy); - m.OrderLines = new List { - bus.CreateInstance(ol => { - ol.ProductId = Guid.NewGuid(); - ol.Quantity = (float) (Math.Sqrt(2)*r.Next(10)); - }) - }; - }); - } - - Thread.Sleep(10); - if (step) - Console.ReadLine(); - } - } - } -} diff --git a/Samples/Manufacturing/Partner/Properties/AssemblyInfo.cs b/Samples/Manufacturing/Partner/Properties/AssemblyInfo.cs deleted file mode 100644 index 2e63e1127fb..00000000000 --- a/Samples/Manufacturing/Partner/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Partner")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Partner")] -[assembly: AssemblyCopyright("Copyright © 2008")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("2957cb13-b062-4f27-8a25-67e2461ad9a4")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Manufacturing/readme.txt b/Samples/Manufacturing/readme.txt deleted file mode 100644 index 459ad3e9bfe..00000000000 --- a/Samples/Manufacturing/readme.txt +++ /dev/null @@ -1,6 +0,0 @@ -Since the saga in this sample uses timeouts, make sure to run the TimeoutManager process found in the directory /build/timeout/ of nServiceBus. - -This sample uses the MsmqSubscriptionStorage. If you want to try the DB Subscription Storage run the order service with a blank commandline. -If you do make sure to specify a db for the saga storage. (see comments in app.config of the orderservice) - -Experiment with killing the hr process, and notice how the timeout causes the saga to complete anyway. \ No newline at end of file diff --git a/Samples/MessageMutators/Client/App.config b/Samples/MessageMutators/Client/App.config deleted file mode 100644 index 5333dae2175..00000000000 --- a/Samples/MessageMutators/Client/App.config +++ /dev/null @@ -1,23 +0,0 @@ - - - -
    -
    - - - - - - - - - - - - - - - diff --git a/Samples/MessageMutators/Client/Client.cs b/Samples/MessageMutators/Client/Client.cs deleted file mode 100644 index 5a9ecb92088..00000000000 --- a/Samples/MessageMutators/Client/Client.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using NServiceBus; -using Messages; - -namespace Client -{ - public class EndpointConfig : IConfigureThisEndpoint, AsA_Client {} - - public class Runner : IWantToRunAtStartup - { - public void Run() - { - Console.WriteLine("Press 's' to send a valid message, press 'e' to send a failed message. To exit, 'q'\n" ); - - string cmd; - - while ((cmd = Console.ReadKey().Key.ToString().ToLower()) != "q") - { - switch (cmd) - { - case "s": - Bus.Send(m => - { - m.ProductId = "XJ128"; - m.ProductName = "Milk"; - m.ListPrice = 4; - m.SellEndDate = new DateTime(2012, 1, 3); - // 7MB. MSMQ should throw an exception, but it will not since the buffer will be compressed - // before it reaches MSMQ. - m.Image = new byte[1024 * 1024 * 7]; - }); - break; - case "e": - try - { - Bus.Send(m => - { - m.ProductId = "XJ128"; - m.ProductName = "Milk Milk Milk Milk Milk"; - m.ListPrice = 15; - m.SellEndDate = new DateTime(2011, 1, 3); - // 7MB. MSMQ should throw an exception, but it will not since the buffer will be compressed - // before it reaches MSMQ. - m.Image = new byte[1024 * 1024 * 7]; - }); - } - //Just to allow the sample to keep running. - catch{} - break; - } - } - } - - public void Stop() - { - } - - public IBus Bus { get; set; } - } -} diff --git a/Samples/MessageMutators/Client/Client.csproj b/Samples/MessageMutators/Client/Client.csproj deleted file mode 100644 index 561f19f6da7..00000000000 --- a/Samples/MessageMutators/Client/Client.csproj +++ /dev/null @@ -1,114 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9AF57290-9CEE-4934-BDB4-D201F1EABE49} - Library - Properties - Client - Client - v4.0 - 512 - - - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Host.exe - - - - 3.5 - - - - - - - - - {B5B3A66C-7CAD-40A3-ACBC-B82619E62355} - MessageMutators - - - {E62F2DF8-9E8F-4512-9FD9-C97C97AEC15A} - Messages - - - - - Designer - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - AllRules.ruleset - - - - - - \ No newline at end of file diff --git a/Samples/MessageMutators/Client/Properties/AssemblyInfo.cs b/Samples/MessageMutators/Client/Properties/AssemblyInfo.cs deleted file mode 100644 index 6cd75a7f7be..00000000000 --- a/Samples/MessageMutators/Client/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Client")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Client")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("7d18ccd3-65e6-465e-ae13-91cbd150bb93")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/MessageMutators/MessageMutators.suo b/Samples/MessageMutators/MessageMutators.suo deleted file mode 100644 index dd90eb8df4e..00000000000 Binary files a/Samples/MessageMutators/MessageMutators.suo and /dev/null differ diff --git a/Samples/MessageMutators/Messages/Properties/AssemblyInfo.cs b/Samples/MessageMutators/Messages/Properties/AssemblyInfo.cs deleted file mode 100644 index 839a733d56b..00000000000 --- a/Samples/MessageMutators/Messages/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Messages")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Messages")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("8bd53a32-7a35-4572-96c8-544f43be65cb")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/MessageMutators/Server/Properties/AssemblyInfo.cs b/Samples/MessageMutators/Server/Properties/AssemblyInfo.cs deleted file mode 100644 index 643b38772de..00000000000 --- a/Samples/MessageMutators/Server/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Server")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft")] -[assembly: AssemblyProduct("Server")] -[assembly: AssemblyCopyright("Copyright © Microsoft 2010")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("8d6e084c-ad7b-41b0-901e-77a3c5b7ac72")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/MessageMutators/Server/Server.csproj b/Samples/MessageMutators/Server/Server.csproj deleted file mode 100644 index 86f1dfdaf31..00000000000 --- a/Samples/MessageMutators/Server/Server.csproj +++ /dev/null @@ -1,110 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2FAF88E7-8FC9-4AFA-B265-9085F983C702} - Library - Properties - Server - Server - v4.0 - 512 - - - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Host.exe - - - - 3.5 - - - - - - - - - {B5B3A66C-7CAD-40A3-ACBC-B82619E62355} - MessageMutators - - - {E62F2DF8-9E8F-4512-9FD9-C97C97AEC15A} - Messages - - - - - Designer - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - AllRules.ruleset - - \ No newline at end of file diff --git a/Samples/PubSub/.nuget/NuGet.Config b/Samples/PubSub/.nuget/NuGet.Config index 6a318ad9b75..67f8ea046ef 100644 --- a/Samples/PubSub/.nuget/NuGet.Config +++ b/Samples/PubSub/.nuget/NuGet.Config @@ -1,6 +1,6 @@ - - - - - + + + + + \ No newline at end of file diff --git a/Samples/PubSub/.nuget/NuGet.exe b/Samples/PubSub/.nuget/NuGet.exe index ddc91051bc4..4645f4b35e8 100644 Binary files a/Samples/PubSub/.nuget/NuGet.exe and b/Samples/PubSub/.nuget/NuGet.exe differ diff --git a/Samples/PubSub/.nuget/NuGet.targets b/Samples/PubSub/.nuget/NuGet.targets index e470f19f5ed..3ae18ce9ff7 100644 --- a/Samples/PubSub/.nuget/NuGet.targets +++ b/Samples/PubSub/.nuget/NuGet.targets @@ -1,71 +1,71 @@ - - - - $(MSBuildProjectDirectory)\..\ - - - $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) - $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) - $([System.IO.Path]::Combine($(SolutionDir), "packages")) - - - $(SolutionDir).nuget - packages.config - $(SolutionDir)packages - - - $(NuGetToolsPath)\nuget.exe - "$(NuGetExePath)" - mono --runtime=v4.0.30319 $(NuGetExePath) - - $(TargetDir.Trim('\\')) - - - "" - - - false - - - false - - - $(NuGetCommand) install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" - $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols - - - - RestorePackages; - $(BuildDependsOn); - - - - - $(BuildDependsOn); - BuildPackage; - - - - - - - - - - - - - - - - - - - + + + + $(MSBuildProjectDirectory)\..\ + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + $([System.IO.Path]::Combine($(SolutionDir), "packages")) + + + $(SolutionDir).nuget + packages.config + $(SolutionDir)packages + + + $(NuGetToolsPath)\nuget.exe + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + + "" + + + false + + + false + + + $(NuGetCommand) install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" + $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(BuildDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/PubSub/MyMessages/MyMessages.csproj b/Samples/PubSub/MyMessages/MyMessages.csproj index d282bf33e04..40e170bc77e 100644 --- a/Samples/PubSub/MyMessages/MyMessages.csproj +++ b/Samples/PubSub/MyMessages/MyMessages.csproj @@ -1,58 +1,60 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8} - Library - Properties - MyMessages - MyMessages - - - - - v4.0 - ..\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8} + Library + Properties + MyMessages + MyMessages + + + + + v4.0 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + + + + + + + + + + + + --> \ No newline at end of file diff --git a/Samples/PubSub/MyPublisher/EndpointConfig.cs b/Samples/PubSub/MyPublisher/EndpointConfig.cs index ae80bdd0148..93d45e8f93f 100644 --- a/Samples/PubSub/MyPublisher/EndpointConfig.cs +++ b/Samples/PubSub/MyPublisher/EndpointConfig.cs @@ -2,13 +2,13 @@ namespace MyPublisher { - class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher,IWantCustomInitialization - { - public void Init() - { - Configure.With() - .SpringFrameworkBuilder() - //this overrides the NServiceBus default convention of IEvent - .DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("MyMessages"));} + class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher,IWantCustomInitialization + { + public void Init() + { + Configure.With() + .SpringFrameworkBuilder() + //this overrides the NServiceBus default convention of IEvent + .DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("MyMessages"));} } } diff --git a/Samples/PubSub/MyPublisher/MyPublisher.csproj b/Samples/PubSub/MyPublisher/MyPublisher.csproj index 8049db80f5e..941732fd9ab 100644 --- a/Samples/PubSub/MyPublisher/MyPublisher.csproj +++ b/Samples/PubSub/MyPublisher/MyPublisher.csproj @@ -1,99 +1,101 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {7036A49B-359F-4BC7-AFBA-DE3C7AB41986} - Library - Properties - MyPublisher - MyPublisher - - - - - v4.0 - ..\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\binaries\NServiceBus.Host.exe - - - ..\..\..\binaries\containers\spring\NServiceBus.ObjectBuilder.Spring.dll - - - ..\packages\Spring.Core.1.3.2\lib\net40\Spring.Core.dll - - - - - - - - - - - - - - - - Designer - - - PreserveNewest - - - - - - {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8} - MyMessages - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Integration - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {7036A49B-359F-4BC7-AFBA-DE3C7AB41986} + Library + Properties + MyPublisher + MyPublisher + + + + + v4.0 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + False + ..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll + + + False + ..\..\..\binaries\log4net.dll + + + False + ..\..\..\binaries\NServiceBus.dll + + + False + ..\..\..\binaries\NServiceBus.Core.dll + + + False + ..\..\..\binaries\NServiceBus.Host.exe + + + ..\..\..\binaries\containers\spring\NServiceBus.ObjectBuilder.Spring.dll + + + ..\packages\Spring.Core.1.3.2\lib\net40\Spring.Core.dll + + + + + + + + + + + + + + + + Designer + + + PreserveNewest + + + + + + {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8} + MyMessages + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + NServiceBus.Integration + true + + \ No newline at end of file diff --git a/Samples/PubSub/MyPublisher/ServerEndpoint.cs b/Samples/PubSub/MyPublisher/ServerEndpoint.cs index be0548a837a..eae67520663 100644 --- a/Samples/PubSub/MyPublisher/ServerEndpoint.cs +++ b/Samples/PubSub/MyPublisher/ServerEndpoint.cs @@ -5,11 +5,11 @@ namespace MyPublisher { - public class ServerEndpoint : IWantToRunAtStartup + public class ServerEndpoint : IWantToRunWhenBusStartsAndStops { public IBus Bus { get; set; } - public void Run() + public void Start() { Console.WriteLine("This will publish IEvent, EventMessage, and AnotherEventMessage alternately."); Console.WriteLine("Press 'Enter' to publish a message.To exit, Ctrl + C"); diff --git a/Samples/PubSub/PubSub.suo b/Samples/PubSub/PubSub.suo index fe2c8bd223a..b4e5e1fc5c2 100644 Binary files a/Samples/PubSub/PubSub.suo and b/Samples/PubSub/PubSub.suo differ diff --git a/Samples/PubSub/Subscriber1/AnotherEventMessageHandler.cs b/Samples/PubSub/Subscriber1/AnotherEventMessageHandler.cs index 14d1d30fc3a..65fee85ca84 100644 --- a/Samples/PubSub/Subscriber1/AnotherEventMessageHandler.cs +++ b/Samples/PubSub/Subscriber1/AnotherEventMessageHandler.cs @@ -1,10 +1,11 @@ +using System; +using MyMessages; +using MyMessages.Other; +using NServiceBus; +using NServiceBus.Logging; + namespace Subscriber1 -{ - using System; - using MyMessages.Other; - using NServiceBus; - using log4net; - +{ public class AnotherEventMessageHandler : IHandleMessages { public void Handle(AnotherEventMessage message) diff --git a/Samples/PubSub/Subscriber1/EndpointConfig.cs b/Samples/PubSub/Subscriber1/EndpointConfig.cs index 52ef6da985c..1617f8bb5f1 100644 --- a/Samples/PubSub/Subscriber1/EndpointConfig.cs +++ b/Samples/PubSub/Subscriber1/EndpointConfig.cs @@ -1,13 +1,29 @@ -using NServiceBus; - -namespace Subscriber1 -{ - class EndpointConfig : IConfigureThisEndpoint, AsA_Server,IWantCustomInitialization - { - public void Init() - { - Configure.With() - //this overrides the NServiceBus default convention of IEvent - .DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("MyMessages"));} - } +using NServiceBus; + +namespace Subscriber1 +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using NServiceBus.AutomaticSubscriptions; + + class EndpointConfig : IConfigureThisEndpoint, AsA_Server,IWantCustomInitialization + { + public void Init() + { + //uncomment the line below if you want to use a custom auto subscription strategy + //Configure.Features.AutoSubscribe(f => f.CustomAutoSubscriptionStrategy()); + + Configure.With() + //this overrides the NServiceBus default convention of IEvent + .DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("MyMessages"));} + } + + public class MyAutoSub : IAutoSubscriptionStrategy + { + public IEnumerable GetEventsToSubscribe() + { + return new BindingList(); + } + } } \ No newline at end of file diff --git a/Samples/PubSub/Subscriber1/EventMessageHandler.cs b/Samples/PubSub/Subscriber1/EventMessageHandler.cs index 20784c2aebd..b611dfc4ef4 100644 --- a/Samples/PubSub/Subscriber1/EventMessageHandler.cs +++ b/Samples/PubSub/Subscriber1/EventMessageHandler.cs @@ -1,7 +1,7 @@ using System; -using log4net; using MyMessages; using NServiceBus; +using NServiceBus.Logging; namespace Subscriber1 { diff --git a/Samples/PubSub/Subscriber1/Subscriber1.csproj b/Samples/PubSub/Subscriber1/Subscriber1.csproj index df745ca5032..6b2e5dd7b7c 100644 --- a/Samples/PubSub/Subscriber1/Subscriber1.csproj +++ b/Samples/PubSub/Subscriber1/Subscriber1.csproj @@ -1,103 +1,105 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {28DE496A-3885-410E-A0B8-004FAEFF9378} - Library - Properties - Subscriber1 - Subscriber1 - - - - - v4.0 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - ..\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - - - - - Designer - - - - - {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8} - MyMessages - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Integration - - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {28DE496A-3885-410E-A0B8-004FAEFF9378} + Library + Properties + Subscriber1 + Subscriber1 + + + + + v4.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + true + + + + False + ..\..\..\binaries\log4net.dll + + + False + ..\..\..\binaries\NServiceBus.dll + + + False + ..\..\..\binaries\NServiceBus.Core.dll + + + False + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + + + + + + + + Designer + + + + + {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8} + MyMessages + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + NServiceBus.Integration + true + + + \ No newline at end of file diff --git a/Samples/PubSub/Subscriber2/EndpointConfig.cs b/Samples/PubSub/Subscriber2/EndpointConfig.cs index da900f46c39..27e9899d960 100644 --- a/Samples/PubSub/Subscriber2/EndpointConfig.cs +++ b/Samples/PubSub/Subscriber2/EndpointConfig.cs @@ -2,17 +2,18 @@ namespace Subscriber2 { + using NServiceBus.Features; + public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, IWantCustomInitialization { public void Init() { - Configure.With() + Configure.Features.Disable();//The class Subscriber2Endpoint is demonstrating explicit subscibes + + Configure.With() //this overrides the NServiceBus default convention of IEvent - .DefiningEventsAs(t=> t.Namespace != null && t.Namespace.StartsWith("MyMessages")) - .CastleWindsorBuilder() // just to show we can mix and match containers - .XmlSerializer() - .UnicastBus() - .DoNotAutoSubscribe(); //managed by the class Subscriber2Endpoint + .DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("MyMessages")) + .CastleWindsorBuilder(); // just to show we can mix and match containers } } } diff --git a/Samples/PubSub/Subscriber2/EventMessageHandler.cs b/Samples/PubSub/Subscriber2/EventMessageHandler.cs index 69c030b38d3..e9f5825f6f7 100644 --- a/Samples/PubSub/Subscriber2/EventMessageHandler.cs +++ b/Samples/PubSub/Subscriber2/EventMessageHandler.cs @@ -1,6 +1,6 @@ using System; -using log4net; using NServiceBus; +using NServiceBus.Logging; namespace Subscriber2 { diff --git a/Samples/PubSub/Subscriber2/Subscriber2.csproj b/Samples/PubSub/Subscriber2/Subscriber2.csproj index edde4ffd40a..b14499f5172 100644 --- a/Samples/PubSub/Subscriber2/Subscriber2.csproj +++ b/Samples/PubSub/Subscriber2/Subscriber2.csproj @@ -1,116 +1,118 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {6A699A4E-F2FD-4B71-AF73-199B499482BD} - Library - Properties - Subscriber2 - Subscriber2 - - - - - v4.0 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - ..\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\packages\Castle.Core.3.0.0.4001\lib\net40-client\Castle.Core.dll - - - False - ..\packages\Castle.Windsor.3.0.0.4001\lib\net40\Castle.Windsor.dll - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\binaries\NServiceBus.Host.exe - - - False - ..\..\..\binaries\containers\castle\NServiceBus.ObjectBuilder.CastleWindsor.dll - - - - - - - - - - - - - - - - - - Designer - - - - - - {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8} - MyMessages - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Integration NServiceBus.Integration - - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {6A699A4E-F2FD-4B71-AF73-199B499482BD} + Library + Properties + Subscriber2 + Subscriber2 + + + + + v4.0 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + AllRules.ruleset + true + + + + False + ..\packages\Castle.Core.3.2.0\lib\net40-client\Castle.Core.dll + + + False + ..\packages\Castle.Windsor.3.2.0\lib\net40\Castle.Windsor.dll + + + False + ..\..\..\binaries\log4net.dll + + + False + ..\..\..\binaries\NServiceBus.dll + + + False + ..\..\..\binaries\NServiceBus.Core.dll + + + False + ..\..\..\binaries\NServiceBus.Host.exe + + + False + ..\..\..\binaries\containers\castle\NServiceBus.ObjectBuilder.CastleWindsor.dll + + + + + + + + + + + + + + + + + + Designer + + + + + + {5686FE6C-A5E3-40D1-A6BD-25F94DA612F8} + MyMessages + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + NServiceBus.Integration NServiceBus.Integration + true + + \ No newline at end of file diff --git a/Samples/PubSub/Subscriber2/Subscriber2Endpoint.cs b/Samples/PubSub/Subscriber2/Subscriber2Endpoint.cs index f33c94b37ee..88ae55039c7 100644 --- a/Samples/PubSub/Subscriber2/Subscriber2Endpoint.cs +++ b/Samples/PubSub/Subscriber2/Subscriber2Endpoint.cs @@ -7,11 +7,11 @@ namespace Subscriber2 /// /// Showing how to manage subscriptions manually /// - class Subscriber2Endpoint : IWantToRunAtStartup + class Subscriber2Endpoint : IWantToRunWhenBusStartsAndStops { public IBus Bus { get; set; } - public void Run() + public void Start() { Bus.Subscribe(); } diff --git a/Samples/PubSub/Subscriber2/packages.config b/Samples/PubSub/Subscriber2/packages.config index 40d762a5cbd..36e7edfc246 100644 --- a/Samples/PubSub/Subscriber2/packages.config +++ b/Samples/PubSub/Subscriber2/packages.config @@ -1,5 +1,5 @@ - - - - + + + + \ No newline at end of file diff --git a/Samples/ScaleOut/Orders.Handler.Worker1/Orders.Handler.Worker1.csproj b/Samples/ScaleOut/Orders.Handler.Worker1/Orders.Handler.Worker1.csproj index 4b9cd089e9e..6c3cf7a72c0 100644 --- a/Samples/ScaleOut/Orders.Handler.Worker1/Orders.Handler.Worker1.csproj +++ b/Samples/ScaleOut/Orders.Handler.Worker1/Orders.Handler.Worker1.csproj @@ -31,9 +31,6 @@ 4 - - ..\..\..\binaries\log4net.dll - ..\..\..\binaries\NServiceBus.dll @@ -75,13 +72,15 @@ Program $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Production NServiceBus.Worker + NServiceBus.Integration NServiceBus.Worker AllRules.ruleset + true Program $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Production NServiceBus.Worker + NServiceBus.Integration NServiceBus.Worker AllRules.ruleset + true \ No newline at end of file diff --git a/Samples/ScaleOut/Orders.Handler.Worker2/Orders.Handler.Worker2.csproj b/Samples/ScaleOut/Orders.Handler.Worker2/Orders.Handler.Worker2.csproj index b6889faf2b0..303761f58e9 100644 --- a/Samples/ScaleOut/Orders.Handler.Worker2/Orders.Handler.Worker2.csproj +++ b/Samples/ScaleOut/Orders.Handler.Worker2/Orders.Handler.Worker2.csproj @@ -31,9 +31,6 @@ 4 - - ..\..\..\binaries\log4net.dll - ..\..\..\binaries\NServiceBus.dll @@ -77,13 +74,15 @@ Program $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Production NServiceBus.Worker + NServiceBus.Integration NServiceBus.Worker AllRules.ruleset + true Program $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Production NServiceBus.Worker + NServiceBus.Integration NServiceBus.Worker AllRules.ruleset + true \ No newline at end of file diff --git a/Samples/ScaleOut/Orders.Handler/App.config b/Samples/ScaleOut/Orders.Handler/App.config index d2f30ab2a36..4b8b4a78617 100644 --- a/Samples/ScaleOut/Orders.Handler/App.config +++ b/Samples/ScaleOut/Orders.Handler/App.config @@ -2,12 +2,12 @@
    -
    +
    - + diff --git a/Samples/ScaleOut/Orders.Handler/EndpointConfig.cs b/Samples/ScaleOut/Orders.Handler/EndpointConfig.cs index e2508fc262a..fc91a8a38c5 100644 --- a/Samples/ScaleOut/Orders.Handler/EndpointConfig.cs +++ b/Samples/ScaleOut/Orders.Handler/EndpointConfig.cs @@ -1,23 +1,22 @@ -using NServiceBus; -using NServiceBus.Config; - -namespace Orders.Handler -{ - class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher { } - - class ConfiguringTheDistributorWithTheFluentApi : INeedInitialization - { - public void Init() - { - //uncomment one of the following lines if you want to use the fluent api instead. Remember to - // remove the "Master" profile from the command line Properties->Debug - //Configure.Instance.RunDistributor(); - - //or if you want to run the distributor only and no worker - //Configure.Instance.RunDistributorWithNoWorkerOnItsEndpoint(); - - //or if you want to be a worker - //Configure.Instance.EnlistWithDistributor(); - } - } -} +using NServiceBus; + +namespace Orders.Handler +{ + class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher { } + + class ConfiguringTheDistributorWithTheFluentApi : INeedInitialization + { + public void Init() + { + //uncomment one of the following lines if you want to use the fluent api instead. Remember to + // remove the "Master" profile from the command line Properties->Debug + //Configure.Instance.RunDistributor(); + + //or if you want to run the distributor only and no worker + //Configure.Instance.RunDistributorWithNoWorkerOnItsEndpoint(); + + //or if you want to be a worker + //Configure.Instance.EnlistWithDistributor(); + } + } +} diff --git a/Samples/ScaleOut/Orders.Handler/Orders.Handler.csproj b/Samples/ScaleOut/Orders.Handler/Orders.Handler.csproj index 17e5ba379f6..5d768de7cc8 100644 --- a/Samples/ScaleOut/Orders.Handler/Orders.Handler.csproj +++ b/Samples/ScaleOut/Orders.Handler/Orders.Handler.csproj @@ -31,9 +31,6 @@ 4 - - ..\..\..\binaries\log4net.dll - ..\..\..\binaries\NServiceBus.dll @@ -71,13 +68,15 @@ Program $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Production NServiceBus.Master + NServiceBus.Integration NServiceBus.Master AllRules.ruleset + true Program $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Production NServiceBus.Master + NServiceBus.Integration NServiceBus.Master AllRules.ruleset + true \ No newline at end of file diff --git a/Samples/ScaleOut/Orders.Handler/ProcessOrderCommandHandler.cs b/Samples/ScaleOut/Orders.Handler/ProcessOrderCommandHandler.cs index 58195eb7804..14114ddc4e6 100644 --- a/Samples/ScaleOut/Orders.Handler/ProcessOrderCommandHandler.cs +++ b/Samples/ScaleOut/Orders.Handler/ProcessOrderCommandHandler.cs @@ -1,24 +1,24 @@ -using log4net; -using NServiceBus; +using NServiceBus; using Orders.Messages; namespace Orders.Handler { + using System; + public class ProcessOrderCommandHandler : IHandleMessages { public IBus Bus { get; set; } public void Handle(PlaceOrder placeOrder) { - Logger.Info("Received ProcessOrder command, order Id: " + placeOrder.OrderId); + Console.Out.WriteLine("Received ProcessOrder command, order Id: " + placeOrder.OrderId); Bus.Return(PlaceOrderStatus.Ok); - Logger.InfoFormat("Sent Ok status for orderId [{0}].", placeOrder.OrderId); + Console.Out.WriteLine("Sent Ok status for orderId [{0}].", placeOrder.OrderId); // Process Order... - Logger.Info("Processing received order...."); + Console.Out.WriteLine("Processing received order...."); Bus.Publish(m => m.OrderId = placeOrder.OrderId); - Logger.InfoFormat("Sent Order placed event for orderId [{0}].", placeOrder.OrderId); + Console.Out.WriteLine("Sent Order placed event for orderId [{0}].", placeOrder.OrderId); } - private static readonly ILog Logger = LogManager.GetLogger("ProcessOrderCommandHandler"); } } diff --git a/Samples/ScaleOut/Orders.Messages/Orders.Messages.csproj b/Samples/ScaleOut/Orders.Messages/Orders.Messages.csproj index 0161b6d0352..23074ce2209 100644 --- a/Samples/ScaleOut/Orders.Messages/Orders.Messages.csproj +++ b/Samples/ScaleOut/Orders.Messages/Orders.Messages.csproj @@ -21,6 +21,7 @@ DEBUG;TRACE prompt 4 + true pdbonly @@ -29,6 +30,7 @@ TRACE prompt 4 + true diff --git a/Samples/ScaleOut/Orders.Sender/Orders.Sender.csproj b/Samples/ScaleOut/Orders.Sender/Orders.Sender.csproj index ee1f6f2b910..78bf1ee0522 100644 --- a/Samples/ScaleOut/Orders.Sender/Orders.Sender.csproj +++ b/Samples/ScaleOut/Orders.Sender/Orders.Sender.csproj @@ -29,12 +29,9 @@ TRACE prompt 4 + true - - False - ..\..\..\binaries\log4net.dll - False ..\..\..\binaries\NServiceBus.dll @@ -58,7 +55,9 @@ - + + Designer + @@ -77,7 +76,15 @@ Program $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - + NServiceBus.Integration + AllRules.ruleset + true + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + NServiceBus.Integration AllRules.ruleset + true \ No newline at end of file diff --git a/Samples/ScaleOut/Orders.Sender/ProcessOrderSender.cs b/Samples/ScaleOut/Orders.Sender/ProcessOrderSender.cs index f8bc49cf172..3e8050284ab 100644 --- a/Samples/ScaleOut/Orders.Sender/ProcessOrderSender.cs +++ b/Samples/ScaleOut/Orders.Sender/ProcessOrderSender.cs @@ -4,11 +4,11 @@ namespace Orders.Sender { - class ProcessOrderSender : IWantToRunAtStartup + class ProcessOrderSender : IWantToRunWhenBusStartsAndStops { public IBus Bus { get; set; } - public void Run() + public void Start() { Console.WriteLine("Press 'Enter' to send a message. To exit, Ctrl + C"); var counter = 0; diff --git a/Samples/SendOnlyEndpoint/.nuget/NuGet.exe b/Samples/SendOnlyEndpoint/.nuget/NuGet.exe deleted file mode 100644 index ddc91051bc4..00000000000 Binary files a/Samples/SendOnlyEndpoint/.nuget/NuGet.exe and /dev/null differ diff --git a/Samples/SendOnlyEndpoint/.nuget/NuGet.targets b/Samples/SendOnlyEndpoint/.nuget/NuGet.targets deleted file mode 100644 index 3ae18ce9ff7..00000000000 --- a/Samples/SendOnlyEndpoint/.nuget/NuGet.targets +++ /dev/null @@ -1,71 +0,0 @@ - - - - $(MSBuildProjectDirectory)\..\ - - - $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) - $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) - $([System.IO.Path]::Combine($(SolutionDir), "packages")) - - - $(SolutionDir).nuget - packages.config - $(SolutionDir)packages - - - $(NuGetToolsPath)\nuget.exe - "$(NuGetExePath)" - mono --runtime=v4.0.30319 $(NuGetExePath) - - $(TargetDir.Trim('\\')) - - - "" - - - false - - - false - - - $(NuGetCommand) install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" - $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols - - - - RestorePackages; - $(BuildDependsOn); - - - - - $(BuildDependsOn); - BuildPackage; - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/SendOnlyEndpoint/SendOnlyEndpoint.Custom.sln b/Samples/SendOnlyEndpoint/SendOnlyEndpoint.Custom.sln deleted file mode 100644 index 4599d780226..00000000000 --- a/Samples/SendOnlyEndpoint/SendOnlyEndpoint.Custom.sln +++ /dev/null @@ -1,29 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SendOnlyEndpoint.Custom", "SendOnlyEndpoint.Custom\SendOnlyEndpoint.Custom.csproj", "{52E814AA-CD2D-48F5-AD5C-38D8335DEBF4}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{E07D1441-4B8E-403B-9862-9B7F365BE600}" - ProjectSection(SolutionItems) = preProject - .nuget\NuGet.exe = .nuget\NuGet.exe - .nuget\NuGet.targets = .nuget\NuGet.targets - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x86 = Debug|x86 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {52E814AA-CD2D-48F5-AD5C-38D8335DEBF4}.Debug|x86.ActiveCfg = Debug|x86 - {52E814AA-CD2D-48F5-AD5C-38D8335DEBF4}.Debug|x86.Build.0 = Debug|x86 - {52E814AA-CD2D-48F5-AD5C-38D8335DEBF4}.Release|x86.ActiveCfg = Release|x86 - {52E814AA-CD2D-48F5-AD5C-38D8335DEBF4}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EnterpriseLibraryConfigurationToolBinariesPath = packages\Unity.2.1.505.0\lib\NET35;packages\Unity.Interception.2.1.505.0\lib\NET35 - EndGlobalSection -EndGlobal diff --git a/Samples/SendOnlyEndpoint/SendOnlyEndpoint.Custom/App.config b/Samples/SendOnlyEndpoint/SendOnlyEndpoint.Custom/App.config deleted file mode 100644 index 9c3d200cc38..00000000000 --- a/Samples/SendOnlyEndpoint/SendOnlyEndpoint.Custom/App.config +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/Samples/SendOnlyEndpoint/SendOnlyEndpoint.Custom/Program.cs b/Samples/SendOnlyEndpoint/SendOnlyEndpoint.Custom/Program.cs deleted file mode 100644 index f53bd449972..00000000000 --- a/Samples/SendOnlyEndpoint/SendOnlyEndpoint.Custom/Program.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using NServiceBus; - -namespace SendOnlyEndpoint.Custom -{ - public class Program - { - static void Main() - { - var bus = Configure.With() - .UnityBuilder() - .XmlSerializer() - .MsmqTransport() - .UnicastBus() - .SendOnly(); - - bus.Send("SendOnlyDestination@someserver",new TestMessage()); - - Console.WriteLine("Message sent to remote endpoint, you can verify this by looking at the outgoing queues in you msmq MMC-snapin"); - Console.WriteLine("Press any key to exit"); - - Console.ReadKey(); - } - } - - - public class TestMessage : IMessage - { - } -} diff --git a/Samples/SendOnlyEndpoint/packages/repositories.config b/Samples/SendOnlyEndpoint/packages/repositories.config deleted file mode 100644 index 6d111846426..00000000000 --- a/Samples/SendOnlyEndpoint/packages/repositories.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Samples/Starbucks/.nuget/NuGet.Config b/Samples/Starbucks/.nuget/NuGet.Config deleted file mode 100644 index 6a318ad9b75..00000000000 --- a/Samples/Starbucks/.nuget/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Samples/Starbucks/.nuget/NuGet.exe b/Samples/Starbucks/.nuget/NuGet.exe deleted file mode 100644 index ddc91051bc4..00000000000 Binary files a/Samples/Starbucks/.nuget/NuGet.exe and /dev/null differ diff --git a/Samples/Starbucks/.nuget/NuGet.settings.targets b/Samples/Starbucks/.nuget/NuGet.settings.targets deleted file mode 100644 index e69cf843407..00000000000 --- a/Samples/Starbucks/.nuget/NuGet.settings.targets +++ /dev/null @@ -1,41 +0,0 @@ - - - - $(MSBuildProjectDirectory)\..\ - $(SolutionDir).nuget - $(NuGetToolsPath)\nuget.exe - $(ProjectDir)packages.config - $(SolutionDir)packages - $(TargetDir.Trim('\\')) - - - "" - - - false - - - false - - - "$(NuGetExePath)" install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" - "$(NuGetExePath)" pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols - - - - RestorePackages; - $(BuildDependsOn); - - - - - $(BuildDependsOn); - BuildPackage; - - - - - - - - \ No newline at end of file diff --git a/Samples/Starbucks/.nuget/NuGet.targets b/Samples/Starbucks/.nuget/NuGet.targets deleted file mode 100644 index 8993f4e5cb4..00000000000 --- a/Samples/Starbucks/.nuget/NuGet.targets +++ /dev/null @@ -1,52 +0,0 @@ - - - - $(MSBuildProjectDirectory)\..\ - $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) - $(NuGetToolsPath)\nuget.exe - $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) - $([System.IO.Path]::Combine($(SolutionDir), "packages")) - $(TargetDir.Trim('\\')) - - - "" - - - false - - - false - - - "$(NuGetExePath)" install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" - "$(NuGetExePath)" pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols - - - - RestorePackages; - $(BuildDependsOn); - - - - - $(BuildDependsOn); - BuildPackage; - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Starbucks/Barista/App.config b/Samples/Starbucks/Barista/App.config deleted file mode 100644 index 85be51558e7..00000000000 --- a/Samples/Starbucks/Barista/App.config +++ /dev/null @@ -1,17 +0,0 @@ - - - -
    -
    - - - - - - - - - - - - diff --git a/Samples/Starbucks/Barista/Barista.csproj b/Samples/Starbucks/Barista/Barista.csproj deleted file mode 100644 index 0d55d579c71..00000000000 --- a/Samples/Starbucks/Barista/Barista.csproj +++ /dev/null @@ -1,107 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065} - WinExe - Properties - Barista - Barista - v4.0 - 512 - ..\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll - - - False - ..\packages\structuremap.2.6.3\lib\StructureMap.dll - - - - - - - - - - - - - - - - Form - - - StarbucksBarista.cs - - - - - StarbucksBarista.cs - - - - - - - - - - {3963D354-2888-4005-8763-6E54A4D6BFCC} - CashierContracts - - - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} - CustomerContracts - - - - - - \ No newline at end of file diff --git a/Samples/Starbucks/Barista/BaristaMessageHandler.cs b/Samples/Starbucks/Barista/BaristaMessageHandler.cs deleted file mode 100644 index 35d462b8212..00000000000 --- a/Samples/Starbucks/Barista/BaristaMessageHandler.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.Threading; -using Barista.ViewData; -using CashierContracts; -using CustomerContracts; -using NServiceBus; -using NServiceBus.Saga; - -namespace Barista -{ - public class BaristaMessageHandler : Saga, - IAmStartedByMessages, - IHandleMessages - { - private readonly IStarbucksBaristaView _view; - - public BaristaMessageHandler() - {} - - public BaristaMessageHandler(IStarbucksBaristaView view) - { - _view = view; - } - - public override void ConfigureHowToFindSaga() - { - ConfigureMapping(s => s.OrderId, m => m.OrderId); - ConfigureMapping(s => s.OrderId, m => m.OrderId); - } - - public void Handle(OrderPlaced message) - { - var viewData = new PrepareOrderView(message.CustomerName, message.Drink, message.DrinkSize); - _view.PrepareOrder(viewData); - - Data.CustomerName = message.CustomerName; - Data.Drink = message.Drink; - Data.OrderId = message.OrderId; - Data.Size = message.DrinkSize; - - for(var i=0; i<10; i++) - { - Thread.Sleep(1000); - } - - var additionalViewData = new OrderIsDoneView(message.CustomerName); - _view.OrderIsDone(additionalViewData); - - Data.OrderIsReady = true; - DeliverOrder(); - } - - public void Handle(OrderPaid message) - { - Data.OrderIsPaid = true; - DeliverOrder(); - } - - private void DeliverOrder() - { - if(!Data.OrderIsReady || !Data.OrderIsPaid) - return; - - var viewData = new DeliverOrderView(Data.Drink, Data.Size); - _view.DeliverOrder(viewData); - - Bus.Send(new OrderReadyMessage(Data.CustomerName, Data.Drink)); - - MarkAsComplete(); - } - } -} diff --git a/Samples/Starbucks/Barista/BaristaRegistry.cs b/Samples/Starbucks/Barista/BaristaRegistry.cs deleted file mode 100644 index 3b8bacaaafe..00000000000 --- a/Samples/Starbucks/Barista/BaristaRegistry.cs +++ /dev/null @@ -1,18 +0,0 @@ -using StructureMap.Attributes; -using StructureMap.Configuration.DSL; - -namespace Barista -{ - public class BaristaRegistry : Registry - { - public BaristaRegistry() - { - For() - .Singleton() - .Use(); - -// For() - // .Use(); - } - } -} diff --git a/Samples/Starbucks/Barista/BaristaSagaData.cs b/Samples/Starbucks/Barista/BaristaSagaData.cs deleted file mode 100644 index bb321ecda1b..00000000000 --- a/Samples/Starbucks/Barista/BaristaSagaData.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using CashierContracts; -using NServiceBus.Saga; - -namespace Barista -{ - public class BaristaSagaData : IContainSagaData - { - public virtual Guid Id { get; set; } - public virtual String Originator { get; set; } - public virtual String OriginalMessageId { get; set; } - - public virtual String CustomerName { get; set; } - public virtual String Drink { get; set; } - - [Unique] - public virtual Guid OrderId { get; set; } - public virtual DrinkSize Size { get; set; } - public virtual Boolean OrderIsReady { get; set; } - public virtual Boolean OrderIsPaid { get; set; } - } -} diff --git a/Samples/Starbucks/Barista/Bootstrapper.cs b/Samples/Starbucks/Barista/Bootstrapper.cs deleted file mode 100644 index a9ca181ca79..00000000000 --- a/Samples/Starbucks/Barista/Bootstrapper.cs +++ /dev/null @@ -1,45 +0,0 @@ -using NServiceBus; -using StructureMap; - -namespace Barista -{ - public class Bootstrapper - { - private Bootstrapper() - {} - - public static void Bootstrap() - { - BootstrapStructureMap(); - BootstrapNServiceBus(); - } - - private static void BootstrapStructureMap() - { - ObjectFactory.Initialize(x => x.AddRegistry(new BaristaRegistry())); - } - - private static void BootstrapNServiceBus() - { - Configure.With() - .Log4Net() - .StructureMapBuilder(ObjectFactory.Container) - .RunTimeoutManagerWithInMemoryPersistence() - .MsmqSubscriptionStorage() - .XmlSerializer() - // For sagas - .Sagas() - .InMemorySagaPersister() - //.RavenSagaPersister() - // End - .MsmqTransport() - .IsTransactional(true) - .PurgeOnStartup(false) - .UnicastBus() - .ImpersonateSender(false) - .LoadMessageHandlers() - .CreateBus() - .Start(() => Configure.Instance.ForInstallationOn().Install()); - } - } -} diff --git a/Samples/Starbucks/Barista/Disposable.cs b/Samples/Starbucks/Barista/Disposable.cs deleted file mode 100644 index fa0796b716c..00000000000 --- a/Samples/Starbucks/Barista/Disposable.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; - -namespace Barista -{ - public abstract class Disposable : IDisposable - { - protected Boolean IsDisposed { get; private set; } - - private void Dispose(Boolean disposing) - { - // The object has already been disposed - if(IsDisposed) - { - return; - } - - if(disposing) - { - // Dispose managed resources - DisposeManagedResources(); - } - - // Dispose unmanaged resources - DisposeUnmanagedResources(); - - IsDisposed = true; - } - - ~Disposable() - { - Dispose(false); - } - - protected abstract void DisposeManagedResources(); - - protected virtual void DisposeUnmanagedResources() - { } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - } -} diff --git a/Samples/Starbucks/Barista/Program.cs b/Samples/Starbucks/Barista/Program.cs deleted file mode 100644 index 6fe7d5df87a..00000000000 --- a/Samples/Starbucks/Barista/Program.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Windows.Forms; -using StructureMap; - -namespace Barista -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Bootstrapper.Bootstrap(); - - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - var startupDialog = ObjectFactory.GetInstance(); - startupDialog.Start(); - - //using(var messageSubscriptions = ObjectFactory.GetInstance()) - //{ - // messageSubscriptions.Subscribe(); - - // var startupDialog = ObjectFactory.GetInstance(); - // startupDialog.Start(); - //} - } - } -} diff --git a/Samples/Starbucks/Barista/Properties/AssemblyInfo.cs b/Samples/Starbucks/Barista/Properties/AssemblyInfo.cs deleted file mode 100644 index c35fcb35fc9..00000000000 --- a/Samples/Starbucks/Barista/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Barista")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Barista")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("5ce23dcd-97df-43c7-a33a-b4abc6c7754d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Starbucks/Barista/StarbucksBarista.Designer.cs b/Samples/Starbucks/Barista/StarbucksBarista.Designer.cs deleted file mode 100644 index 5da3427deb3..00000000000 --- a/Samples/Starbucks/Barista/StarbucksBarista.Designer.cs +++ /dev/null @@ -1,74 +0,0 @@ -namespace Barista -{ - partial class StarbucksBarista - { - /// - /// 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.OrdersLabel = new System.Windows.Forms.Label(); - this.OrdersListBox = new System.Windows.Forms.ListBox(); - this.SuspendLayout(); - // - // OrdersLabel - // - this.OrdersLabel.AutoSize = true; - this.OrdersLabel.Location = new System.Drawing.Point(12, 11); - this.OrdersLabel.Name = "OrdersLabel"; - this.OrdersLabel.Size = new System.Drawing.Size(38, 13); - this.OrdersLabel.TabIndex = 3; - this.OrdersLabel.Text = "Orders"; - // - // OrdersListBox - // - this.OrdersListBox.FormattingEnabled = true; - this.OrdersListBox.Location = new System.Drawing.Point(12, 27); - this.OrdersListBox.Name = "OrdersListBox"; - this.OrdersListBox.Size = new System.Drawing.Size(557, 290); - this.OrdersListBox.TabIndex = 2; - // - // StarbucksBarista - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(580, 328); - this.Controls.Add(this.OrdersLabel); - this.Controls.Add(this.OrdersListBox); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Name = "StarbucksBarista"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Starbucks Barista Monitor XP - Professional Edition"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Label OrdersLabel; - private System.Windows.Forms.ListBox OrdersListBox; - } -} - diff --git a/Samples/Starbucks/Barista/StarbucksBarista.cs b/Samples/Starbucks/Barista/StarbucksBarista.cs deleted file mode 100644 index 29a01113429..00000000000 --- a/Samples/Starbucks/Barista/StarbucksBarista.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Windows.Forms; -using Barista.ViewData; - -namespace Barista -{ - public interface IStarbucksBaristaView - { - void DeliverOrder(DeliverOrderView view); - void OrderIsDone(OrderIsDoneView view); - void PrepareOrder(PrepareOrderView view); - void Start(); - } - - public partial class StarbucksBarista : Form, IStarbucksBaristaView - { - public StarbucksBarista() - { - InitializeComponent(); - } - - public void DeliverOrder(DeliverOrderView view) - { - var logItem = String.Format("Delivering {0} - {1}.", view.Drink, view.DrinkSize); - Invoke(new Action(Log), logItem); - } - - public void OrderIsDone(OrderIsDoneView view) - { - var logItem = String.Format("Done preparing order for customer {0}.", view.CustomerName); - Invoke(new Action(Log), logItem); - } - - public void PrepareOrder(PrepareOrderView view) - { - var logItem = String.Format("Preparing {0} - {1} for customer {2}.", - view.Drink, view.DrinkSize, view.CustomerName); - - Invoke(new Action(Log), logItem); - } - - public void Start() - { - Application.Run(this); - } - - private void Log(String logItem) - { - OrdersListBox.Items.Add(logItem); - } - } -} diff --git a/Samples/Starbucks/Barista/StarbucksBarista.resx b/Samples/Starbucks/Barista/StarbucksBarista.resx deleted file mode 100644 index 194da1e4138..00000000000 --- a/Samples/Starbucks/Barista/StarbucksBarista.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - diff --git a/Samples/Starbucks/Barista/ViewData/DeliverOrderView.cs b/Samples/Starbucks/Barista/ViewData/DeliverOrderView.cs deleted file mode 100644 index 36b5c869034..00000000000 --- a/Samples/Starbucks/Barista/ViewData/DeliverOrderView.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using CashierContracts; - -namespace Barista.ViewData -{ - public class DeliverOrderView - { - public String Drink { get; private set; } - public String DrinkSize { get; private set; } - - public DeliverOrderView(String drink, DrinkSize size) - { - Drink = drink; - DrinkSize = size.ToString(); - } - } -} diff --git a/Samples/Starbucks/Barista/ViewData/OrderIsDoneView.cs b/Samples/Starbucks/Barista/ViewData/OrderIsDoneView.cs deleted file mode 100644 index 757c06bfc04..00000000000 --- a/Samples/Starbucks/Barista/ViewData/OrderIsDoneView.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace Barista.ViewData -{ - public class OrderIsDoneView - { - public String CustomerName { get; private set; } - - public OrderIsDoneView(String customerName) - { - CustomerName = customerName; - } - } -} diff --git a/Samples/Starbucks/Barista/ViewData/PrepareOrderView.cs b/Samples/Starbucks/Barista/ViewData/PrepareOrderView.cs deleted file mode 100644 index b39518e3067..00000000000 --- a/Samples/Starbucks/Barista/ViewData/PrepareOrderView.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using CashierContracts; - -namespace Barista.ViewData -{ - public class PrepareOrderView - { - public String CustomerName { get; private set; } - public String Drink { get; private set; } - public String DrinkSize { get; private set; } - - public PrepareOrderView(String customerName, String drink, DrinkSize size) - { - CustomerName = customerName; - Drink = drink; - DrinkSize = size.ToString(); - } - } -} diff --git a/Samples/Starbucks/Barista/packages.config b/Samples/Starbucks/Barista/packages.config deleted file mode 100644 index a4bbf561cb4..00000000000 --- a/Samples/Starbucks/Barista/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Samples/Starbucks/Cashier/App.config b/Samples/Starbucks/Cashier/App.config deleted file mode 100644 index e2a755d1380..00000000000 --- a/Samples/Starbucks/Cashier/App.config +++ /dev/null @@ -1,15 +0,0 @@ - - - -
    -
    - - - - - - - - - - diff --git a/Samples/Starbucks/Cashier/Bootstrapper.cs b/Samples/Starbucks/Cashier/Bootstrapper.cs deleted file mode 100644 index 7dcb5ad9a27..00000000000 --- a/Samples/Starbucks/Cashier/Bootstrapper.cs +++ /dev/null @@ -1,44 +0,0 @@ -using NServiceBus; -using StructureMap; - -namespace Cashier -{ - public class Bootstrapper - { - private Bootstrapper() - {} - - public static void Bootstrap() - { - BootstrapStructureMap(); - BootstrapNServiceBus(); - } - - private static void BootstrapStructureMap() - { - ObjectFactory.Initialize(x => x.AddRegistry(new CashierRegistry())); - } - - private static void BootstrapNServiceBus() - { - Configure.With() - .StructureMapBuilder(ObjectFactory.Container) - .MsmqSubscriptionStorage() - .XmlSerializer() - .RunTimeoutManagerWithInMemoryPersistence() - // For sagas - .Sagas() - .InMemorySagaPersister() - //.RavenSagaPersister() - // End - .MsmqTransport() - .IsTransactional(true) - .PurgeOnStartup(false) - .UnicastBus() - .ImpersonateSender(false) - .LoadMessageHandlers() - .CreateBus() - .Start(() => Configure.Instance.ForInstallationOn().Install()); - } - } -} diff --git a/Samples/Starbucks/Cashier/Cashier.csproj b/Samples/Starbucks/Cashier/Cashier.csproj deleted file mode 100644 index 9da3bd85ad2..00000000000 --- a/Samples/Starbucks/Cashier/Cashier.csproj +++ /dev/null @@ -1,105 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DCCBF183-A703-4999-BB10-046E6C2800B9} - WinExe - Properties - Cashier - Cashier - v4.0 - 512 - - - ..\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll - - - ..\packages\structuremap.2.6.3\lib\StructureMap.dll - - - - - - - - - - - - - - - - - - - StarbucksCashier.cs - - - - Form - - - StarbucksCashier.cs - - - - - - - {3963D354-2888-4005-8763-6E54A4D6BFCC} - CashierContracts - - - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} - CustomerContracts - - - - - - \ No newline at end of file diff --git a/Samples/Starbucks/Cashier/CashierMessageHandler.cs b/Samples/Starbucks/Cashier/CashierMessageHandler.cs deleted file mode 100644 index e7fe5c4547b..00000000000 --- a/Samples/Starbucks/Cashier/CashierMessageHandler.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using Cashier.ViewData; -using CashierContracts; -using CustomerContracts; -using NServiceBus; -using NServiceBus.Saga; - -namespace Cashier -{ - public class CashierMessageHandler : Saga, - IAmStartedByMessages, - IHandleMessages - { - private readonly IStarbucksCashierView _view; - - public CashierMessageHandler() - {} - - public CashierMessageHandler(IStarbucksCashierView view) - { - _view = view; - } - - public override void ConfigureHowToFindSaga() - { - ConfigureMapping(s => s.OrderId, m => m.OrderId); - ConfigureMapping(s => s.OrderId, m => m.OrderId); - } - - public void Handle(NewOrderMessage message) - { - _view.NewOrder(new NewOrderView(message)); - - Data.Drink = message.Drink; - Data.DrinkSize = message.DrinkSize; - Data.OrderId = message.OrderId; - Data.CustomerName = message.CustomerName; - Data.Amount = CalculateAmountAccordingTo(message.DrinkSize); - - Bus.Publish(new OrderPlaced(Data.CustomerName, Data.Drink, Data.DrinkSize, Data.OrderId)); - Bus.Reply(new PaymentRequestMessage(Data.Amount, message.CustomerName, message.OrderId)); - } - - public void Handle(PaymentMessage message) - { - if(message.Amount >= Data.Amount) - { - var viewData = new ReceivedFullPaymentView(Data.CustomerName, Data.Drink, Data.DrinkSize); - _view.ReceivedFullPayment(viewData); - - Bus.Publish(new OrderPaid(Data.OrderId)); - } - else if(message.Amount == 0) - { - var viewData = new CustomerRefusesToPayView(Data.CustomerName, Data.Amount, Data.Drink, Data.DrinkSize); - _view.CustomerRefusesToPay(viewData); - } - - MarkAsComplete(); - } - - private static Decimal CalculateAmountAccordingTo(DrinkSize size) - { - switch(size) - { - case DrinkSize.Tall: - return 3.25m; - case DrinkSize.Grande: - return 4.00m; - case DrinkSize.Venti: - return 4.75m; - default: - throw new InvalidOperationException(String.Format("Size '{0}' does not compute!", size)); - } - } - } -} diff --git a/Samples/Starbucks/Cashier/CashierRegistry.cs b/Samples/Starbucks/Cashier/CashierRegistry.cs deleted file mode 100644 index 0c80577e752..00000000000 --- a/Samples/Starbucks/Cashier/CashierRegistry.cs +++ /dev/null @@ -1,14 +0,0 @@ -using StructureMap.Configuration.DSL; - -namespace Cashier -{ - public class CashierRegistry : Registry - { - public CashierRegistry() - { - For() - .Singleton() - .Use(); - } - } -} diff --git a/Samples/Starbucks/Cashier/CashierSagaData.cs b/Samples/Starbucks/Cashier/CashierSagaData.cs deleted file mode 100644 index b1af37b38e3..00000000000 --- a/Samples/Starbucks/Cashier/CashierSagaData.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using CashierContracts; -using NServiceBus.Saga; - -namespace Cashier -{ - public class CashierSagaData : IContainSagaData - { - public virtual Guid Id { get; set; } - public virtual String Originator { get; set; } - public virtual String OriginalMessageId { get; set; } - - public virtual Decimal Amount { get; set; } - public virtual String CustomerName { get; set; } - public virtual String Drink { get; set; } - public virtual DrinkSize DrinkSize { get; set; } - - [Unique] - public virtual Guid OrderId { get; set; } - } -} diff --git a/Samples/Starbucks/Cashier/Program.cs b/Samples/Starbucks/Cashier/Program.cs deleted file mode 100644 index 6680f2ce575..00000000000 --- a/Samples/Starbucks/Cashier/Program.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Windows.Forms; -using StructureMap; - -namespace Cashier -{ - static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - static void Main() - { - Bootstrapper.Bootstrap(); - - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - - var startupDialog = ObjectFactory.GetInstance(); - startupDialog.Start(); - } - } -} diff --git a/Samples/Starbucks/Cashier/Properties/AssemblyInfo.cs b/Samples/Starbucks/Cashier/Properties/AssemblyInfo.cs deleted file mode 100644 index 1301b8d53b7..00000000000 --- a/Samples/Starbucks/Cashier/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Cashier")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Cashier")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("a23d05c3-f8de-4c46-91bc-99c11db88551")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Starbucks/Cashier/StarbucksCashier.Designer.cs b/Samples/Starbucks/Cashier/StarbucksCashier.Designer.cs deleted file mode 100644 index b9ae5a89ff7..00000000000 --- a/Samples/Starbucks/Cashier/StarbucksCashier.Designer.cs +++ /dev/null @@ -1,74 +0,0 @@ -namespace Cashier -{ - partial class StarbucksCashier - { - /// - /// 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.OrdersListBox = new System.Windows.Forms.ListBox(); - this.OrdersLabel = new System.Windows.Forms.Label(); - this.SuspendLayout(); - // - // OrdersListBox - // - this.OrdersListBox.FormattingEnabled = true; - this.OrdersListBox.Location = new System.Drawing.Point(12, 25); - this.OrdersListBox.Name = "OrdersListBox"; - this.OrdersListBox.Size = new System.Drawing.Size(557, 290); - this.OrdersListBox.TabIndex = 0; - // - // OrdersLabel - // - this.OrdersLabel.AutoSize = true; - this.OrdersLabel.Location = new System.Drawing.Point(12, 9); - this.OrdersLabel.Name = "OrdersLabel"; - this.OrdersLabel.Size = new System.Drawing.Size(38, 13); - this.OrdersLabel.TabIndex = 1; - this.OrdersLabel.Text = "Orders"; - // - // StarbucksCashier - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(582, 330); - this.Controls.Add(this.OrdersLabel); - this.Controls.Add(this.OrdersListBox); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Name = "StarbucksCashier"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Starbucks Cashier Monitor 2000 - Ultimate Edition"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.ListBox OrdersListBox; - private System.Windows.Forms.Label OrdersLabel; - } -} - diff --git a/Samples/Starbucks/Cashier/StarbucksCashier.cs b/Samples/Starbucks/Cashier/StarbucksCashier.cs deleted file mode 100644 index 91eab9cc188..00000000000 --- a/Samples/Starbucks/Cashier/StarbucksCashier.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Windows.Forms; -using Cashier.ViewData; - -namespace Cashier -{ - public interface IStarbucksCashierView - { - void CustomerRefusesToPay(CustomerRefusesToPayView view); - void NewOrder(NewOrderView view); - void ReceivedFullPayment(ReceivedFullPaymentView view); - void Start(); - } - - public partial class StarbucksCashier : Form, IStarbucksCashierView - { - public StarbucksCashier() - { - InitializeComponent(); - } - - public void CustomerRefusesToPay(CustomerRefusesToPayView view) - { - var logItem = String.Format("Customer {0} refuses to pay {1} for its order ({2} - {3}).", - view.CustomerName, view.Amount, view.Drink, view.DrinkSize); - - Invoke(new Action(Log), logItem); - } - - public void NewOrder(NewOrderView view) - { - var logItem = String.Format("Customer {0} ordered {1} - {2}.", - view.CustomerName, view.Drink, view.DrinkSize); - - Invoke(new Action(Log), logItem); - } - - public void ReceivedFullPayment(ReceivedFullPaymentView view) - { - var logItem = String.Format("Customer {0} paid for its order ({1} - {2}).", - view.CustomerName, view.Drink, view.DrinkSize); - - Invoke(new Action(Log), logItem); - } - - public void Start() - { - Application.Run(this); - } - - private void Log(String logItem) - { - OrdersListBox.Items.Add(logItem); - } - } -} diff --git a/Samples/Starbucks/Cashier/StarbucksCashier.resx b/Samples/Starbucks/Cashier/StarbucksCashier.resx deleted file mode 100644 index 194da1e4138..00000000000 --- a/Samples/Starbucks/Cashier/StarbucksCashier.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - diff --git a/Samples/Starbucks/Cashier/ViewData/CustomerRefusesToPayView.cs b/Samples/Starbucks/Cashier/ViewData/CustomerRefusesToPayView.cs deleted file mode 100644 index 203c357ee94..00000000000 --- a/Samples/Starbucks/Cashier/ViewData/CustomerRefusesToPayView.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using CashierContracts; - -namespace Cashier.ViewData -{ - public class CustomerRefusesToPayView - { - public Decimal Amount { get; private set; } - public String CustomerName { get; private set; } - public String Drink { get; private set; } - public String DrinkSize { get; private set; } - - public CustomerRefusesToPayView(String customerName, Decimal amount, String drink, DrinkSize drinkSize) - { - CustomerName = customerName; - Amount = amount; - Drink = drink; - DrinkSize = drinkSize.ToString(); - } - } -} diff --git a/Samples/Starbucks/Cashier/ViewData/NewOrderView.cs b/Samples/Starbucks/Cashier/ViewData/NewOrderView.cs deleted file mode 100644 index 5d80b5a21e8..00000000000 --- a/Samples/Starbucks/Cashier/ViewData/NewOrderView.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using CashierContracts; - -namespace Cashier.ViewData -{ - public class NewOrderView - { - public String CustomerName { get; private set; } - public String Drink { get; private set; } - public String DrinkSize { get; private set; } - - public NewOrderView(NewOrderMessage message) - { - CustomerName = message.CustomerName; - Drink = message.Drink; - DrinkSize = message.DrinkSize.ToString(); - } - } -} diff --git a/Samples/Starbucks/Cashier/ViewData/ReceivedFullPaymentView.cs b/Samples/Starbucks/Cashier/ViewData/ReceivedFullPaymentView.cs deleted file mode 100644 index f02fde49959..00000000000 --- a/Samples/Starbucks/Cashier/ViewData/ReceivedFullPaymentView.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using CashierContracts; - -namespace Cashier.ViewData -{ - public class ReceivedFullPaymentView - { - public String CustomerName { get; private set; } - public String Drink { get; private set; } - public String DrinkSize { get; private set; } - - public ReceivedFullPaymentView(String customerName, String drink, DrinkSize drinkSize) - { - CustomerName = customerName; - Drink = drink; - DrinkSize = drinkSize.ToString(); - } - } -} diff --git a/Samples/Starbucks/Cashier/packages.config b/Samples/Starbucks/Cashier/packages.config deleted file mode 100644 index a4bbf561cb4..00000000000 --- a/Samples/Starbucks/Cashier/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Samples/Starbucks/CashierContracts/CashierContracts.csproj b/Samples/Starbucks/CashierContracts/CashierContracts.csproj deleted file mode 100644 index 5e2c195882f..00000000000 --- a/Samples/Starbucks/CashierContracts/CashierContracts.csproj +++ /dev/null @@ -1,61 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3963D354-2888-4005-8763-6E54A4D6BFCC} - Library - Properties - CashierContracts - CashierContracts - v4.0 - 512 - ..\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - - - False - ..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Starbucks/CashierContracts/DrinkSize.cs b/Samples/Starbucks/CashierContracts/DrinkSize.cs deleted file mode 100644 index 24c5666bd98..00000000000 --- a/Samples/Starbucks/CashierContracts/DrinkSize.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace CashierContracts -{ - public enum DrinkSize - { - Tall, - Grande, - Venti - } -} diff --git a/Samples/Starbucks/CashierContracts/NewOrderMessage.cs b/Samples/Starbucks/CashierContracts/NewOrderMessage.cs deleted file mode 100644 index 029f3aa88bc..00000000000 --- a/Samples/Starbucks/CashierContracts/NewOrderMessage.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using NServiceBus; - -namespace CashierContracts -{ - [Serializable] - public class NewOrderMessage : IMessage - { - public String CustomerName { get; private set; } - public String Drink { get; private set; } - public DrinkSize DrinkSize { get; private set; } - public Guid OrderId { get; private set; } - - public NewOrderMessage(String customerName, String drink, DrinkSize drinkSize) - { - CustomerName = customerName; - Drink = drink; - DrinkSize = drinkSize; - OrderId = Guid.NewGuid(); - } - } -} diff --git a/Samples/Starbucks/CashierContracts/OrderPaid.cs b/Samples/Starbucks/CashierContracts/OrderPaid.cs deleted file mode 100644 index 507f5189f1a..00000000000 --- a/Samples/Starbucks/CashierContracts/OrderPaid.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using NServiceBus; - -namespace CashierContracts -{ - [Serializable] - public class OrderPaid : IMessage - { - public Guid OrderId { get; private set; } - - public OrderPaid(Guid orderId) - { - OrderId = orderId; - } - } -} diff --git a/Samples/Starbucks/CashierContracts/OrderPlaced.cs b/Samples/Starbucks/CashierContracts/OrderPlaced.cs deleted file mode 100644 index e117487c0e9..00000000000 --- a/Samples/Starbucks/CashierContracts/OrderPlaced.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using NServiceBus; - -namespace CashierContracts -{ - [Serializable] - public class OrderPlaced : IMessage - { - public String CustomerName { get; private set; } - public String Drink { get; private set; } - public DrinkSize DrinkSize { get; private set; } - public Guid OrderId { get; private set; } - - public OrderPlaced(String customerName, String drink, DrinkSize size, Guid orderId) - { - CustomerName = customerName; - Drink = drink; - DrinkSize = size; - OrderId = orderId; - } - } -} diff --git a/Samples/Starbucks/CashierContracts/PaymentMessage.cs b/Samples/Starbucks/CashierContracts/PaymentMessage.cs deleted file mode 100644 index f30ea867bd5..00000000000 --- a/Samples/Starbucks/CashierContracts/PaymentMessage.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using NServiceBus; - -namespace CashierContracts -{ - [Serializable] - public class PaymentMessage : IMessage - { - public Decimal Amount { get; private set; } - public Guid OrderId { get; private set; } - - public PaymentMessage(Decimal amount, Guid orderId) - { - Amount = amount; - OrderId = orderId; - } - } -} diff --git a/Samples/Starbucks/CashierContracts/Properties/AssemblyInfo.cs b/Samples/Starbucks/CashierContracts/Properties/AssemblyInfo.cs deleted file mode 100644 index d7fd0632540..00000000000 --- a/Samples/Starbucks/CashierContracts/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CashierContracts")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CashierContracts")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("15e01ae1-e78d-4467-95a1-b5ce66f67de0")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Starbucks/Customer/App.config b/Samples/Starbucks/Customer/App.config deleted file mode 100644 index 0c2ed9bb022..00000000000 --- a/Samples/Starbucks/Customer/App.config +++ /dev/null @@ -1,15 +0,0 @@ - - - -
    -
    - - - - - - - - - - diff --git a/Samples/Starbucks/Customer/Bootstrapper.cs b/Samples/Starbucks/Customer/Bootstrapper.cs deleted file mode 100644 index 75bd32bf29e..00000000000 --- a/Samples/Starbucks/Customer/Bootstrapper.cs +++ /dev/null @@ -1,41 +0,0 @@ -using Cashier; -using NServiceBus; -using StructureMap; - -namespace Customer -{ - public class Bootstrapper - { - private Bootstrapper() - {} - - public static void Bootstrap() - { - BootstrapStructureMap(); - BootstrapNServiceBus(); - } - - private static void BootstrapStructureMap() - { - ObjectFactory.Initialize(x => x.AddRegistry(new CustomerRegistry())); - } - - private static void BootstrapNServiceBus() - { - Configure.With() - .Log4Net() - .StructureMapBuilder(ObjectFactory.Container) - .RunTimeoutManagerWithInMemoryPersistence() - .MsmqSubscriptionStorage() - .XmlSerializer() - .MsmqTransport() - .IsTransactional(true) - .PurgeOnStartup(false) - .UnicastBus() - .ImpersonateSender(false) - .LoadMessageHandlers() - .CreateBus() - .Start(() => Configure.Instance.ForInstallationOn().Install()); - } - } -} diff --git a/Samples/Starbucks/Customer/Customer.csproj b/Samples/Starbucks/Customer/Customer.csproj deleted file mode 100644 index dabd30c2b58..00000000000 --- a/Samples/Starbucks/Customer/Customer.csproj +++ /dev/null @@ -1,106 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79} - WinExe - Properties - Customer - Customer - v4.0 - 512 - - - ..\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - - - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\binaries\containers\structuremap\NServiceBus.ObjectBuilder.StructureMap.dll - - - False - ..\packages\structuremap.2.6.3\lib\StructureMap.dll - - - - - - - - - - - - - Form - - - CustomerOrder.cs - - - - - - - CustomerOrder.cs - - - - - - - - - {3963D354-2888-4005-8763-6E54A4D6BFCC} - CashierContracts - - - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} - CustomerContracts - - - - - - \ No newline at end of file diff --git a/Samples/Starbucks/Customer/CustomerOrder.Designer.cs b/Samples/Starbucks/Customer/CustomerOrder.Designer.cs deleted file mode 100644 index 880a72c6629..00000000000 --- a/Samples/Starbucks/Customer/CustomerOrder.Designer.cs +++ /dev/null @@ -1,145 +0,0 @@ -namespace Customer -{ - partial class CustomerOrder - { - /// - /// 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.OrderButton = new System.Windows.Forms.Button(); - this.NameLabel = new System.Windows.Forms.Label(); - this.NameTextBox = new System.Windows.Forms.TextBox(); - this.DrinkLabel = new System.Windows.Forms.Label(); - this.SizeLabel = new System.Windows.Forms.Label(); - this.DrinkComboBox = new System.Windows.Forms.ComboBox(); - this.SizeComboBox = new System.Windows.Forms.ComboBox(); - this.SuspendLayout(); - // - // OrderButton - // - this.OrderButton.Location = new System.Drawing.Point(127, 164); - this.OrderButton.Name = "OrderButton"; - this.OrderButton.Size = new System.Drawing.Size(75, 23); - this.OrderButton.TabIndex = 3; - this.OrderButton.Text = "Order"; - this.OrderButton.UseVisualStyleBackColor = true; - this.OrderButton.Click += new System.EventHandler(this.OrderButton_Click); - // - // NameLabel - // - this.NameLabel.AutoSize = true; - this.NameLabel.Location = new System.Drawing.Point(12, 9); - this.NameLabel.Name = "NameLabel"; - this.NameLabel.Size = new System.Drawing.Size(58, 13); - this.NameLabel.TabIndex = 1; - this.NameLabel.Text = "Your name"; - // - // NameTextBox - // - this.NameTextBox.Location = new System.Drawing.Point(15, 25); - this.NameTextBox.Name = "NameTextBox"; - this.NameTextBox.Size = new System.Drawing.Size(187, 20); - this.NameTextBox.TabIndex = 0; - // - // DrinkLabel - // - this.DrinkLabel.AutoSize = true; - this.DrinkLabel.Location = new System.Drawing.Point(12, 59); - this.DrinkLabel.Name = "DrinkLabel"; - this.DrinkLabel.Size = new System.Drawing.Size(32, 13); - this.DrinkLabel.TabIndex = 3; - this.DrinkLabel.Text = "Drink"; - // - // SizeLabel - // - this.SizeLabel.AutoSize = true; - this.SizeLabel.Location = new System.Drawing.Point(12, 109); - this.SizeLabel.Name = "SizeLabel"; - this.SizeLabel.Size = new System.Drawing.Size(27, 13); - this.SizeLabel.TabIndex = 4; - this.SizeLabel.Text = "Size"; - // - // DrinkComboBox - // - this.DrinkComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.DrinkComboBox.FormattingEnabled = true; - this.DrinkComboBox.Items.AddRange(new object[] { - "Caramel Macchiato", - "Mocha", - "Americano", - "Latte", - "Cuban", - "Frapachappaccino"}); - this.DrinkComboBox.Location = new System.Drawing.Point(15, 75); - this.DrinkComboBox.Name = "DrinkComboBox"; - this.DrinkComboBox.Size = new System.Drawing.Size(187, 21); - this.DrinkComboBox.TabIndex = 1; - // - // SizeComboBox - // - this.SizeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.SizeComboBox.FormattingEnabled = true; - this.SizeComboBox.Items.AddRange(new object[] { - "Tall", - "Grande", - "Venti"}); - this.SizeComboBox.Location = new System.Drawing.Point(15, 125); - this.SizeComboBox.Name = "SizeComboBox"; - this.SizeComboBox.Size = new System.Drawing.Size(187, 21); - this.SizeComboBox.TabIndex = 2; - // - // CustomerOrder - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(217, 196); - this.Controls.Add(this.SizeComboBox); - this.Controls.Add(this.DrinkComboBox); - this.Controls.Add(this.SizeLabel); - this.Controls.Add(this.DrinkLabel); - this.Controls.Add(this.NameTextBox); - this.Controls.Add(this.NameLabel); - this.Controls.Add(this.OrderButton); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Name = "CustomerOrder"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "Order @ Starbucks"; - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Button OrderButton; - private System.Windows.Forms.Label NameLabel; - private System.Windows.Forms.TextBox NameTextBox; - private System.Windows.Forms.Label DrinkLabel; - private System.Windows.Forms.Label SizeLabel; - private System.Windows.Forms.ComboBox DrinkComboBox; - private System.Windows.Forms.ComboBox SizeComboBox; - - } -} diff --git a/Samples/Starbucks/Customer/CustomerOrder.cs b/Samples/Starbucks/Customer/CustomerOrder.cs deleted file mode 100644 index d2d788370c2..00000000000 --- a/Samples/Starbucks/Customer/CustomerOrder.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Windows.Forms; -using CashierContracts; -using CustomerContracts; -using NServiceBus; - -namespace Customer -{ - public partial class CustomerOrder : Form, - IHandleMessages, - IHandleMessages - { - private readonly IBus _bus; - - public CustomerOrder(IBus bus) - { - _bus = bus; - InitializeComponent(); - } - - private void OrderButton_Click(Object sender, EventArgs e) - { - var customerName = NameTextBox.Text; - var drink = DrinkComboBox.Text; - var drinkSize = (DrinkSize) Enum.Parse(typeof(DrinkSize), SizeComboBox.Text); - - var newOrder = new NewOrderMessage(customerName, drink, drinkSize); - _bus.Send(newOrder); - } - - public new void Handle(PaymentRequestMessage message) - { - var text = String.Format("Hi {0}, thanks for your order. That'll be {1} please.", message.CustomerName, message.Amount); - var result = MessageBox.Show(text, "Request payment", MessageBoxButtons.YesNo); - - var amount = (DialogResult.Yes == result) ? message.Amount : 0.0m; - _bus.Reply(new PaymentMessage(amount, message.OrderId)); - } - - public new void Handle(OrderReadyMessage message) - { - var text = String.Format("Here you go {0}, enjoy your {1}. Thank you, come again.", message.CustomerName, message.Drink); - MessageBox.Show(text); - } - } -} diff --git a/Samples/Starbucks/Customer/CustomerOrder.resx b/Samples/Starbucks/Customer/CustomerOrder.resx deleted file mode 100644 index 194da1e4138..00000000000 --- a/Samples/Starbucks/Customer/CustomerOrder.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - diff --git a/Samples/Starbucks/Customer/CustomerRegistry.cs b/Samples/Starbucks/Customer/CustomerRegistry.cs deleted file mode 100644 index 15e1a59718a..00000000000 --- a/Samples/Starbucks/Customer/CustomerRegistry.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Customer; -using StructureMap.Configuration.DSL; - -namespace Cashier -{ - public class CustomerRegistry : Registry - { - public CustomerRegistry() - { - - } - } -} diff --git a/Samples/Starbucks/Customer/Program.cs b/Samples/Starbucks/Customer/Program.cs deleted file mode 100644 index d3fbd980ba3..00000000000 --- a/Samples/Starbucks/Customer/Program.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Windows.Forms; -using StructureMap; - -namespace Customer -{ - internal static class Program - { - /// - /// The main entry point for the application. - /// - [STAThread] - private static void Main() - { - Bootstrapper.Bootstrap(); - - Application.EnableVisualStyles(); - Application.SetCompatibleTextRenderingDefault(false); - - var startupDialog = ObjectFactory.GetInstance(); - Application.Run(startupDialog); - } - } -} diff --git a/Samples/Starbucks/Customer/Properties/AssemblyInfo.cs b/Samples/Starbucks/Customer/Properties/AssemblyInfo.cs deleted file mode 100644 index 43f37b2f34e..00000000000 --- a/Samples/Starbucks/Customer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Starbucks")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Starbucks")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("95d68a80-2651-4438-99f3-dcc3b6ff8fa2")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Starbucks/Customer/packages.config b/Samples/Starbucks/Customer/packages.config deleted file mode 100644 index a4bbf561cb4..00000000000 --- a/Samples/Starbucks/Customer/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Samples/Starbucks/CustomerContracts/CustomerContracts.csproj b/Samples/Starbucks/CustomerContracts/CustomerContracts.csproj deleted file mode 100644 index 1495e30d3c0..00000000000 --- a/Samples/Starbucks/CustomerContracts/CustomerContracts.csproj +++ /dev/null @@ -1,60 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB} - Library - Properties - CustomerContracts - CustomerContracts - v4.0 - 512 - ..\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - - - - False - ..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Starbucks/CustomerContracts/OrderReadyMessage.cs b/Samples/Starbucks/CustomerContracts/OrderReadyMessage.cs deleted file mode 100644 index cdd44cab897..00000000000 --- a/Samples/Starbucks/CustomerContracts/OrderReadyMessage.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using NServiceBus; - -namespace CustomerContracts -{ - [Serializable] - public class OrderReadyMessage : IMessage - { - public String CustomerName { get; set; } - public String Drink { get; set; } - - public OrderReadyMessage(String customerName, String drink) - { - CustomerName = customerName; - Drink = drink; - } - } -} diff --git a/Samples/Starbucks/CustomerContracts/PaymentRequestMessage.cs b/Samples/Starbucks/CustomerContracts/PaymentRequestMessage.cs deleted file mode 100644 index c09d15112ae..00000000000 --- a/Samples/Starbucks/CustomerContracts/PaymentRequestMessage.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using NServiceBus; - -namespace CustomerContracts -{ - [Serializable] - public class PaymentRequestMessage : IMessage - { - public Decimal Amount { get; private set; } - public String CustomerName { get; private set; } - public Guid OrderId { get; private set; } - - public PaymentRequestMessage(Decimal amount, String customerName, Guid orderId) - { - Amount = amount; - CustomerName = customerName; - OrderId = orderId; - } - } -} diff --git a/Samples/Starbucks/CustomerContracts/Properties/AssemblyInfo.cs b/Samples/Starbucks/CustomerContracts/Properties/AssemblyInfo.cs deleted file mode 100644 index 6306bcc9b34..00000000000 --- a/Samples/Starbucks/CustomerContracts/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("CustomerContracts")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CustomerContracts")] -[assembly: AssemblyCopyright("Copyright 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b661ecb2-d7f2-4346-94a8-198ec4b10b3b")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Starbucks/Starbucks.sln b/Samples/Starbucks/Starbucks.sln deleted file mode 100644 index a4a249d177a..00000000000 --- a/Samples/Starbucks/Starbucks.sln +++ /dev/null @@ -1,44 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cashier", "Cashier\Cashier.csproj", "{DCCBF183-A703-4999-BB10-046E6C2800B9}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Customer", "Customer\Customer.csproj", "{88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CashierContracts", "CashierContracts\CashierContracts.csproj", "{3963D354-2888-4005-8763-6E54A4D6BFCC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomerContracts", "CustomerContracts\CustomerContracts.csproj", "{05882666-3DBD-4B8D-ADAE-439CABDD7DFB}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Barista", "Barista\Barista.csproj", "{F5C48D42-06F2-4CCA-88B5-6C49F2A09065}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DCCBF183-A703-4999-BB10-046E6C2800B9}.Release|Any CPU.Build.0 = Release|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88B4585B-A73D-4EFC-9FA4-14B33FBBBE79}.Release|Any CPU.Build.0 = Release|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3963D354-2888-4005-8763-6E54A4D6BFCC}.Release|Any CPU.Build.0 = Release|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {05882666-3DBD-4B8D-ADAE-439CABDD7DFB}.Release|Any CPU.Build.0 = Release|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F5C48D42-06F2-4CCA-88B5-6C49F2A09065}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Samples/Starbucks/Starbucks.suo b/Samples/Starbucks/Starbucks.suo deleted file mode 100644 index 880a0dfbec8..00000000000 Binary files a/Samples/Starbucks/Starbucks.suo and /dev/null differ diff --git a/Samples/TimeoutManager/MyServer/App.config b/Samples/TimeoutManager/MyServer/App.config deleted file mode 100644 index cabca781df5..00000000000 --- a/Samples/TimeoutManager/MyServer/App.config +++ /dev/null @@ -1,16 +0,0 @@ - - - -
    -
    -
    - - - - - - - - - - \ No newline at end of file diff --git a/Samples/TimeoutManager/MyServer/DeferedProcessing/DeferredMessage.cs b/Samples/TimeoutManager/MyServer/DeferedProcessing/DeferredMessage.cs deleted file mode 100644 index b21284cd939..00000000000 --- a/Samples/TimeoutManager/MyServer/DeferedProcessing/DeferredMessage.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace MyServer.DeferedProcessing -{ - using System; - using NServiceBus; - - public class DeferredMessage:IMessage - { - public DateTime ProcessAt { get; set; } - } -} \ No newline at end of file diff --git a/Samples/TimeoutManager/MyServer/DeferedProcessing/DeferredMessageHandler.cs b/Samples/TimeoutManager/MyServer/DeferedProcessing/DeferredMessageHandler.cs deleted file mode 100644 index 79cb608e1f8..00000000000 --- a/Samples/TimeoutManager/MyServer/DeferedProcessing/DeferredMessageHandler.cs +++ /dev/null @@ -1,28 +0,0 @@ -namespace MyServer.DeferedProcessing -{ - using System; - using NServiceBus; - - public class DeferredMessageHandler : IHandleMessages - { - public IBus Bus { get; set; } - - public void Handle(DeferredMessage message) - { - if(DateTime.Now < message.ProcessAt) - { - LogMessage("Message will be processed at " + message.ProcessAt.ToLongTimeString()); - - Bus.Defer(message.ProcessAt, message); - return; - } - - LogMessage("Deferred message processed"); - } - - static void LogMessage(string message) - { - Console.WriteLine(string.Format("{0} - {1}", DateTime.Now.ToLongTimeString(), message)); - } - } -} \ No newline at end of file diff --git a/Samples/TimeoutManager/MyServer/EndpointConfig.cs b/Samples/TimeoutManager/MyServer/EndpointConfig.cs deleted file mode 100644 index 02a1e03013e..00000000000 --- a/Samples/TimeoutManager/MyServer/EndpointConfig.cs +++ /dev/null @@ -1,50 +0,0 @@ -namespace MyServer -{ - using NServiceBus; - using NServiceBus.Config; - using NServiceBus.MessageMutator; - using NServiceBus.Unicast.Transport; - - public class EndpointConfig : IConfigureThisEndpoint, AsA_Server,IWantCustomInitialization - { - public void Init() - { - Configure.With() - .DefaultBuilder() - //shows multi tenant operations of the sagas - .MessageToDatabaseMappingConvention(context => - { - if (context.Headers.ContainsKey("tenant")) - return context.Headers["tenant"]; - - return string.Empty; - }); - - } - } - - /// - /// This mutator makes sure that the tenant id is propagated to all outgoing messages - /// - public class TenantPropagatingMutator : IMutateOutgoingTransportMessages, INeedInitialization - { - public IBus Bus { get; set; } - - public void MutateOutgoing(object[] messages, TransportMessage transportMessage) - { - if (Bus.CurrentMessageContext == null) - return; - if (!Bus.CurrentMessageContext.Headers.ContainsKey("tenant")) - return; - - transportMessage.Headers["tenant"] = Bus.CurrentMessageContext.Headers["tenant"]; - } - - public void Init() - { - - Configure.Instance.Configurer.ConfigureComponent( - DependencyLifecycle.InstancePerCall); - } - } -} diff --git a/Samples/TimeoutManager/MyServer/MyServer.csproj b/Samples/TimeoutManager/MyServer/MyServer.csproj deleted file mode 100644 index 0953a9f171a..00000000000 --- a/Samples/TimeoutManager/MyServer/MyServer.csproj +++ /dev/null @@ -1,78 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {5B4F9AC7-B891-4D6A-8804-12B6AF89BE53} - Library - Properties - MyServer - MyServer - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\binaries\log4net.dll - - - ..\..\..\binaries\NServiceBus.dll - - - ..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - - - - - - - - - - - - Designer - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Integration - - \ No newline at end of file diff --git a/Samples/TimeoutManager/MyServer/Properties/AssemblyInfo.cs b/Samples/TimeoutManager/MyServer/Properties/AssemblyInfo.cs deleted file mode 100644 index 56748736271..00000000000 --- a/Samples/TimeoutManager/MyServer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("MyServer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("MyServer")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("00aeb275-c9b7-4f5b-b095-b5e292ea54e0")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/TimeoutManager/MyServer/Saga/MyTimeOutState.cs b/Samples/TimeoutManager/MyServer/Saga/MyTimeOutState.cs deleted file mode 100644 index 5b431fecb80..00000000000 --- a/Samples/TimeoutManager/MyServer/Saga/MyTimeOutState.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace MyServer.Saga -{ - public class MyTimeOutState - { - public int SomeValue { get; set; } - } -} \ No newline at end of file diff --git a/Samples/TimeoutManager/MyServer/Saga/SimpleSaga.cs b/Samples/TimeoutManager/MyServer/Saga/SimpleSaga.cs deleted file mode 100644 index e8d096ce1eb..00000000000 --- a/Samples/TimeoutManager/MyServer/Saga/SimpleSaga.cs +++ /dev/null @@ -1,47 +0,0 @@ -namespace MyServer.Saga -{ - using System; - using NServiceBus.Saga; - - public class SimpleSaga:Saga, - IAmStartedByMessages, - IHandleTimeouts - { - public void Handle(StartSagaMessage message) - { - Data.OrderId = message.OrderId; - var someState = new Random().Next(10); - - RequestUtcTimeout(TimeSpan.FromSeconds(10), someState); - LogMessage("v2.6 Timeout (10s) requested with state: " + someState); - } - - public override void Timeout(object state) - { - LogMessage("v2.6 Timeout fired, with state: " + state); - - var someState = new Random().Next(10); - - LogMessage("Requesting a custom timeout v3.0 style, state: " + someState); - RequestUtcTimeout(TimeSpan.FromSeconds(10),t=>t.SomeValue = someState); - } - - public override void ConfigureHowToFindSaga() - { - ConfigureMapping(s => s.OrderId, m => m.OrderId); - } - - void LogMessage(string message) - { - Console.WriteLine(string.Format("{0} - {1} - SagaId:{2}", DateTime.Now.ToLongTimeString(),message,Data.Id)); - } - - public void Timeout(MyTimeOutState state) - { - LogMessage("v3.0 Timeout fired, with state: " + state.SomeValue); - - LogMessage("Marking the saga as complete, be aware that this will remove the document from the storage (RavenDB)"); - MarkAsComplete(); - } - } -} \ No newline at end of file diff --git a/Samples/TimeoutManager/MyServer/Saga/SimpleSagaData.cs b/Samples/TimeoutManager/MyServer/Saga/SimpleSagaData.cs deleted file mode 100644 index b331e348670..00000000000 --- a/Samples/TimeoutManager/MyServer/Saga/SimpleSagaData.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace MyServer.Saga -{ - using System; - using NServiceBus.Saga; - - public class SimpleSagaData : ISagaEntity - { - public Guid Id { get; set; } - public string Originator { get; set; } - public string OriginalMessageId { get; set; } - - [Unique] - public Guid OrderId { get; set; } - } -} \ No newline at end of file diff --git a/Samples/TimeoutManager/MyServer/Saga/StartSagaMessage.cs b/Samples/TimeoutManager/MyServer/Saga/StartSagaMessage.cs deleted file mode 100644 index 98de40f3f2e..00000000000 --- a/Samples/TimeoutManager/MyServer/Saga/StartSagaMessage.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace MyServer.Saga -{ - using System; - using NServiceBus; - - public class StartSagaMessage:IMessage - { - public Guid OrderId { get; set; } - } -} \ No newline at end of file diff --git a/Samples/TimeoutManager/TimeoutManager.suo b/Samples/TimeoutManager/TimeoutManager.suo deleted file mode 100644 index c8e50737d9f..00000000000 Binary files a/Samples/TimeoutManager/TimeoutManager.suo and /dev/null differ diff --git a/Samples/Unobtrusive/.nuget/NuGet.Config b/Samples/Unobtrusive/.nuget/NuGet.Config deleted file mode 100644 index 6a318ad9b75..00000000000 --- a/Samples/Unobtrusive/.nuget/NuGet.Config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Samples/Unobtrusive/.nuget/NuGet.exe b/Samples/Unobtrusive/.nuget/NuGet.exe deleted file mode 100644 index ddc91051bc4..00000000000 Binary files a/Samples/Unobtrusive/.nuget/NuGet.exe and /dev/null differ diff --git a/Samples/Unobtrusive/.nuget/NuGet.targets b/Samples/Unobtrusive/.nuget/NuGet.targets deleted file mode 100644 index 8993f4e5cb4..00000000000 --- a/Samples/Unobtrusive/.nuget/NuGet.targets +++ /dev/null @@ -1,52 +0,0 @@ - - - - $(MSBuildProjectDirectory)\..\ - $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) - $(NuGetToolsPath)\nuget.exe - $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) - $([System.IO.Path]::Combine($(SolutionDir), "packages")) - $(TargetDir.Trim('\\')) - - - "" - - - false - - - false - - - "$(NuGetExePath)" install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" - "$(NuGetExePath)" pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols - - - - RestorePackages; - $(BuildDependsOn); - - - - - $(BuildDependsOn); - BuildPackage; - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Unobtrusive/Client/App.config b/Samples/Unobtrusive/Client/App.config deleted file mode 100644 index a054e807a64..00000000000 --- a/Samples/Unobtrusive/Client/App.config +++ /dev/null @@ -1,20 +0,0 @@ - - - -
    -
    -
    - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Unobtrusive/Client/Client.csproj b/Samples/Unobtrusive/Client/Client.csproj deleted file mode 100644 index ef9aca7b384..00000000000 --- a/Samples/Unobtrusive/Client/Client.csproj +++ /dev/null @@ -1,97 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {476D0A88-E281-4BC8-9617-93E53C1F9FE6} - Library - Properties - Client - Client - v4.0 - 512 - ..\..\Unobtrusive\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\binaries\log4net.dll - - - ..\packages\Ninject.3.0.0.15\lib\net40\Ninject.dll - - - ..\packages\Ninject.Extensions.ContextPreservation.3.0.0.8\lib\net40\Ninject.Extensions.ContextPreservation.dll - - - ..\packages\Ninject.Extensions.NamedScope.3.0.0.5\lib\net40\Ninject.Extensions.NamedScope.dll - - - ..\..\..\binaries\NServiceBus.dll - - - ..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\binaries\NServiceBus.Host.exe - - - ..\..\..\binaries\containers\ninject\NServiceBus.ObjectBuilder.Ninject.dll - - - - - - - - - - - - - - Designer - - - - - - {5AD5EAEF-AF56-49B7-A15D-C0F71780049F} - Commands - - - {6F35A2BC-639A-429D-8A40-35784600E956} - Events - - - {DD0DC12D-D6DF-47C0-B75A-AEC351164196} - Messages - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Integration - - - \ No newline at end of file diff --git a/Samples/Unobtrusive/Client/CommandSender.cs b/Samples/Unobtrusive/Client/CommandSender.cs deleted file mode 100644 index ed32a3f92d0..00000000000 --- a/Samples/Unobtrusive/Client/CommandSender.cs +++ /dev/null @@ -1,132 +0,0 @@ -namespace Client -{ - using System; - using Commands; - using Messages; - using NServiceBus; - - public class CommandSender : IWantToRunAtStartup - { - public IBus Bus { get; set; } - - public void Run() - { - Console.WriteLine("Press 'C' to send a command"); - Console.WriteLine("Press 'R' to send a request"); - Console.WriteLine("Press 'S' to start the saga"); - Console.WriteLine("Press 'E' to send a message that is marked as Express"); - Console.WriteLine("Press 'D' to send a large message that is marked to be sent using Data Bus"); - Console.WriteLine("Press 'X' to send a message that is marked with expiration time."); - Console.WriteLine("To exit, press Ctrl + C"); - - while (true) - { - var cmd = Console.ReadKey().Key.ToString().ToLower(); - switch (cmd) - { - case "c": - SendCommand(); - break; - - case "r": - SendRequest(); - break; - - case "s": - StartSaga(); - break; - - case "e": - Express(); - break; - - case "d": - Data(); - break; - - case "x": - Expiration(); - break; - } - } - } - - /// - /// Shut down server before sending this message, after 30 seconds, the message will be moved to Transactional dead-letter messages queue. - /// - private void Expiration() - { - Bus.Send(m => m.RequestId = new Guid()); - Console.WriteLine("message with expiration was sent"); - } - - private void Data() - { - var requestId = Guid.NewGuid(); - - Bus.Send(m => - { - m.RequestId = requestId; - m.LargeDataBus = new byte[1024 * 1024 * 5]; - }); - - Console.WriteLine("Request sent id: " + requestId); - } - - private void Express() - { - var requestId = Guid.NewGuid(); - - Bus.Send(m => - { - m.RequestId = requestId; - }); - - Console.WriteLine("Request sent id: " + requestId); - } - - void StartSaga(string tennant = "") - { - var message = new StartSagaMessage - { - OrderId = Guid.NewGuid() - }; - if (!string.IsNullOrEmpty(tennant)) - message.SetHeader("tennant", tennant); - - Bus.Send(message); - Console.WriteLine("{0} - {1}", DateTime.Now.ToLongTimeString(), "Saga start message sent"); - } - - void SendRequest() - { - var requestId = Guid.NewGuid(); - - Bus.Send(m => - { - m.RequestId = requestId; - }); - - Console.WriteLine("Request sent id: " + requestId); - } - - void SendCommand() - { - var commandId = Guid.NewGuid(); - - Bus.Send(m => - { - m.CommandId = commandId; - m.EncryptedString = "Some sensitive information"; - }) - .Register(outcome => Console.WriteLine("Server returned status: " + outcome)); - - Console.WriteLine("Command sent id: " + commandId); - - } - - public void Stop() - { - } - } -} \ No newline at end of file diff --git a/Samples/Unobtrusive/Client/EndpointConfig.cs b/Samples/Unobtrusive/Client/EndpointConfig.cs deleted file mode 100644 index c98f3b2e4b9..00000000000 --- a/Samples/Unobtrusive/Client/EndpointConfig.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace Client -{ - using System; - using NServiceBus; - - public class EndpointConfig : IConfigureThisEndpoint, AsA_Client, IWantCustomInitialization - { - public void Init() - { - Configure.With() - .NinjectBuilder() - .FileShareDataBus(@"..\..\..\DataBusShare\") - .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.EndsWith("Commands")) - .DefiningEventsAs(t => t.Namespace != null && t.Namespace.EndsWith("Events")) - .DefiningMessagesAs(t => t.Namespace == "Messages") - .DefiningEncryptedPropertiesAs(p => p.Name.StartsWith("Encrypted")) - .DefiningDataBusPropertiesAs(p => p.Name.EndsWith("DataBus")) - .DefiningExpressMessagesAs(t => t.Name.EndsWith("Express")) - .DefiningTimeToBeReceivedAs(t => t.Name.EndsWith("Expires") - ? TimeSpan.FromSeconds(30) - : TimeSpan.MaxValue - ); - } - } - - class EncryptionConfig : IWantCustomInitialization - { - public void Init() - { - Configure.Instance.RijndaelEncryptionService(); - } - } -} diff --git a/Samples/Unobtrusive/Client/Properties/AssemblyInfo.cs b/Samples/Unobtrusive/Client/Properties/AssemblyInfo.cs deleted file mode 100644 index cb7887e308f..00000000000 --- a/Samples/Unobtrusive/Client/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Client")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Client")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("3efbd055-070e-47e3-81a4-08a9a1cecf66")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Unobtrusive/Client/packages.config b/Samples/Unobtrusive/Client/packages.config deleted file mode 100644 index c7cea6ad0ba..00000000000 --- a/Samples/Unobtrusive/Client/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Samples/Unobtrusive/Commands/Properties/AssemblyInfo.cs b/Samples/Unobtrusive/Commands/Properties/AssemblyInfo.cs deleted file mode 100644 index 0f78fa3ea0e..00000000000 --- a/Samples/Unobtrusive/Commands/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Commands")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Commands")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("2469123b-933b-41c0-b758-54011fd59c78")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Unobtrusive/Events/Properties/AssemblyInfo.cs b/Samples/Unobtrusive/Events/Properties/AssemblyInfo.cs deleted file mode 100644 index 3c2af587ada..00000000000 --- a/Samples/Unobtrusive/Events/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Events")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Events")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("a0592aea-2b0d-47ba-b274-937bd28cf969")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Unobtrusive/Messages/Messages.csproj b/Samples/Unobtrusive/Messages/Messages.csproj deleted file mode 100644 index a6d2c537b98..00000000000 --- a/Samples/Unobtrusive/Messages/Messages.csproj +++ /dev/null @@ -1,57 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {DD0DC12D-D6DF-47C0-B75A-AEC351164196} - Library - Properties - Messages - Messages - v4.0 - 512 - ..\..\Unobtrusive\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/Unobtrusive/Messages/Properties/AssemblyInfo.cs b/Samples/Unobtrusive/Messages/Properties/AssemblyInfo.cs deleted file mode 100644 index 7323d931e91..00000000000 --- a/Samples/Unobtrusive/Messages/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Messages")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Messages")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("00acc4fd-5f77-4c73-b1d3-5c38350358f7")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Unobtrusive/Messages/StartSagaMessage.cs b/Samples/Unobtrusive/Messages/StartSagaMessage.cs deleted file mode 100644 index a3b4d2bf337..00000000000 --- a/Samples/Unobtrusive/Messages/StartSagaMessage.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace Messages -{ - using System; - - public class StartSagaMessage - { - public Guid OrderId { get; set; } - } -} \ No newline at end of file diff --git a/Samples/Unobtrusive/Server/App.config b/Samples/Unobtrusive/Server/App.config deleted file mode 100644 index 931665707a3..00000000000 --- a/Samples/Unobtrusive/Server/App.config +++ /dev/null @@ -1,14 +0,0 @@ - - - -
    -
    - - - - - - \ No newline at end of file diff --git a/Samples/Unobtrusive/Server/CommandSender.cs b/Samples/Unobtrusive/Server/CommandSender.cs deleted file mode 100644 index 486745459ca..00000000000 --- a/Samples/Unobtrusive/Server/CommandSender.cs +++ /dev/null @@ -1,58 +0,0 @@ -namespace Server -{ - using System; - using Events; - using Messages; - using NServiceBus; - - class CommandSender : IWantToRunAtStartup - { - public IBus Bus { get; set; } - - public void Run() - { - Console.WriteLine("Press 'E' to publish an event"); - Console.WriteLine("Press 'D' to send a deferred message"); - Console.WriteLine("To exit, press Ctrl + C"); - - while (true) - { - var cmd = Console.ReadKey().Key.ToString().ToLower(); - - switch (cmd) - { - case "e": - PublishEvent(); - break; - case "d": - DeferMessage(); - break; - } - } - } - - void DeferMessage() - { - Bus.Defer(TimeSpan.FromSeconds(10), new DeferredMessage()); - Console.WriteLine(); - Console.WriteLine("{0} - {1}", DateTime.Now.ToLongTimeString(), "Sent a message that is deferred for 10 seconds"); - } - - void PublishEvent() - { - var eventId = Guid.NewGuid(); - - Bus.Publish(m => - { - m.EventId = eventId; - }); - Console.WriteLine("Event published, id: " + eventId); - - } - - public void Stop() - { - - } - } -} \ No newline at end of file diff --git a/Samples/Unobtrusive/Server/DeferredMessageHandler.cs b/Samples/Unobtrusive/Server/DeferredMessageHandler.cs deleted file mode 100644 index ec17e9baa59..00000000000 --- a/Samples/Unobtrusive/Server/DeferredMessageHandler.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace Server -{ - using System; - using Messages; - using NServiceBus; - - public class DeferredMessageHandler : IHandleMessages - { - public void Handle(DeferredMessage message) - { - Console.WriteLine(string.Format("{0} - {1}", DateTime.Now.ToLongTimeString(), "Deferred message processed")); - } - } -} \ No newline at end of file diff --git a/Samples/Unobtrusive/Server/EndpointConfig.cs b/Samples/Unobtrusive/Server/EndpointConfig.cs deleted file mode 100644 index 9a6c8cea608..00000000000 --- a/Samples/Unobtrusive/Server/EndpointConfig.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace Server -{ - using System; - using NServiceBus; - - public class EndpointConfig: IConfigureThisEndpoint, AsA_Publisher, IWantCustomInitialization - { - public void Init() - { - Configure.With() - .CastleWindsorBuilder() - .FileShareDataBus(@"..\..\..\DataBusShare\") - .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.EndsWith("Commands")) - .DefiningEventsAs(t => t.Namespace != null && t.Namespace.EndsWith("Events")) - .DefiningMessagesAs(t => t.Namespace == "Messages") - .DefiningEncryptedPropertiesAs(p => p.Name.StartsWith("Encrypted")) - .DefiningDataBusPropertiesAs(p => p.Name.EndsWith("DataBus")) - .DefiningExpressMessagesAs(t => t.Name.EndsWith("Express")) - .DefiningTimeToBeReceivedAs(t => t.Name.EndsWith("Expires") - ? TimeSpan.FromSeconds(30) - : TimeSpan.MaxValue - ); - } - } - - class EncryptionConfig : IWantCustomInitialization - { - public void Init() - { - Configure.Instance.RijndaelEncryptionService(); - } - } -} diff --git a/Samples/Unobtrusive/Server/Properties/AssemblyInfo.cs b/Samples/Unobtrusive/Server/Properties/AssemblyInfo.cs deleted file mode 100644 index a62c80a5dd8..00000000000 --- a/Samples/Unobtrusive/Server/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Server")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Server")] -[assembly: AssemblyCopyright("Copyright © 2011")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("55ac1832-09f9-40f6-ab9f-ba538b82e67e")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Unobtrusive/Server/Saga/SimpleSaga.cs b/Samples/Unobtrusive/Server/Saga/SimpleSaga.cs deleted file mode 100644 index fe22c988b2f..00000000000 --- a/Samples/Unobtrusive/Server/Saga/SimpleSaga.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Messages; -using System; -using NServiceBus.Saga; - -namespace Server.Saga -{ - public class SimpleSaga : Saga, - IAmStartedByMessages, - IHandleTimeouts - { - public void Handle(StartSagaMessage message) - { - Data.OrderId = message.OrderId; - var someState = new Random().Next(10); - - RequestUtcTimeout(TimeSpan.FromSeconds(10), someState); - LogMessage("v2.6 Timeout (10s) requested with state: " + someState); - } - - [Obsolete] - public override void Timeout(object state) - { - LogMessage("v2.6 Timeout fired, with state: " + state); - - var someState = new Random().Next(10); - - LogMessage("Requesting a custom timeout v3.0 style, state: " + someState); - RequestUtcTimeout(TimeSpan.FromSeconds(10), new MyTimeOutState - { - SomeValue = someState - }); - } - - public override void ConfigureHowToFindSaga() - { - ConfigureMapping(s => s.OrderId, m => m.OrderId); - } - - void LogMessage(string message) - { - Console.WriteLine(string.Format("{0} - {1}", DateTime.Now.ToLongTimeString(),message)); - } - - public void Timeout(MyTimeOutState state) - { - LogMessage("v3.0 Timeout fired, with state: " + state.SomeValue); - - LogMessage("Marking the saga as complete, be aware that this will remove the document from the storage (RavenDB)"); - MarkAsComplete(); - } - } -} \ No newline at end of file diff --git a/Samples/Unobtrusive/Server/Saga/SimpleSagaData.cs b/Samples/Unobtrusive/Server/Saga/SimpleSagaData.cs deleted file mode 100644 index a7be44eb35c..00000000000 --- a/Samples/Unobtrusive/Server/Saga/SimpleSagaData.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using NServiceBus.Saga; - -namespace Server.Saga -{ - public class SimpleSagaData : ISagaEntity - { - public Guid Id { get; set; } - public string Originator { get; set; } - public string OriginalMessageId { get; set; } - - [Unique] - public Guid OrderId { get; set; } - } -} \ No newline at end of file diff --git a/Samples/Unobtrusive/Server/Server.csproj b/Samples/Unobtrusive/Server/Server.csproj deleted file mode 100644 index 93e40ee9e75..00000000000 --- a/Samples/Unobtrusive/Server/Server.csproj +++ /dev/null @@ -1,103 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {75424F0A-458B-42DA-9DDD-600367893A93} - Library - Properties - Server - Server - v4.0 - 512 - ..\..\Unobtrusive\ - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\packages\Castle.Core.3.0.0.4001\lib\net40-client\Castle.Core.dll - - - ..\packages\Castle.Windsor.3.0.0.4001\lib\net40\Castle.Windsor.dll - - - ..\..\..\binaries\log4net.dll - - - ..\..\..\binaries\NServiceBus.dll - - - ..\..\..\binaries\NServiceBus.Core.dll - - - ..\..\..\binaries\NServiceBus.Host.exe - - - ..\..\..\binaries\containers\castle\NServiceBus.ObjectBuilder.CastleWindsor.dll - - - - - - - - - - - - - - - - - - - - - - - Designer - - - - - - {5AD5EAEF-AF56-49B7-A15D-C0F71780049F} - Commands - - - {6F35A2BC-639A-429D-8A40-35784600E956} - Events - - - {DD0DC12D-D6DF-47C0-B75A-AEC351164196} - Messages - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - NServiceBus.Integration - - - \ No newline at end of file diff --git a/Samples/Unobtrusive/Server/packages.config b/Samples/Unobtrusive/Server/packages.config deleted file mode 100644 index 167098d7a70..00000000000 --- a/Samples/Unobtrusive/Server/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Samples/Unobtrusive/Tests/Properties/AssemblyInfo.cs b/Samples/Unobtrusive/Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index c10f073024c..00000000000 --- a/Samples/Unobtrusive/Tests/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Tests")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Tests")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("f7cfeae3-cb6b-4df5-a8d3-a395d94bebb0")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Unobtrusive/Tests/packages.config b/Samples/Unobtrusive/Tests/packages.config deleted file mode 100644 index 27a38197546..00000000000 --- a/Samples/Unobtrusive/Tests/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/Samples/Unobtrusive/Unobtrusive.suo b/Samples/Unobtrusive/Unobtrusive.suo deleted file mode 100644 index 4c3ecd2468d..00000000000 Binary files a/Samples/Unobtrusive/Unobtrusive.suo and /dev/null differ diff --git a/Samples/Unobtrusive/packages/repositories.config b/Samples/Unobtrusive/packages/repositories.config deleted file mode 100644 index 1dbd43197e3..00000000000 --- a/Samples/Unobtrusive/packages/repositories.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Samples/Versioning/V1.Messages/ISomethingHappened.cs b/Samples/Versioning/V1.Messages/ISomethingHappened.cs deleted file mode 100644 index f432e35fa7c..00000000000 --- a/Samples/Versioning/V1.Messages/ISomethingHappened.cs +++ /dev/null @@ -1,9 +0,0 @@ -using NServiceBus; - -namespace V1.Messages -{ - public interface ISomethingHappened : IMessage - { - int SomeData { get; set; } - } -} diff --git a/Samples/Versioning/V1.Messages/Properties/AssemblyInfo.cs b/Samples/Versioning/V1.Messages/Properties/AssemblyInfo.cs deleted file mode 100644 index 088d0808492..00000000000 --- a/Samples/Versioning/V1.Messages/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("V1.Messages")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("V1.Messages")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("8cb47027-5c02-440a-ac79-b1473f8bf5ac")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Versioning/V1.Messages/V1.Messages.csproj b/Samples/Versioning/V1.Messages/V1.Messages.csproj deleted file mode 100644 index 9d0c82239f2..00000000000 --- a/Samples/Versioning/V1.Messages/V1.Messages.csproj +++ /dev/null @@ -1,94 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {9D27D517-B938-4594-8836-CE06A2955FFD} - Library - Properties - V1.Messages - V1.Messages - v4.0 - 512 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - - - - - 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/Samples/Versioning/V1Subscriber/App.config b/Samples/Versioning/V1Subscriber/App.config deleted file mode 100644 index efc2cd860f0..00000000000 --- a/Samples/Versioning/V1Subscriber/App.config +++ /dev/null @@ -1,21 +0,0 @@ - - - -
    -
    - - - - - - - - - - - - - diff --git a/Samples/Versioning/V1Subscriber/Properties/AssemblyInfo.cs b/Samples/Versioning/V1Subscriber/Properties/AssemblyInfo.cs deleted file mode 100644 index 021cbd1871d..00000000000 --- a/Samples/Versioning/V1Subscriber/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("V1Subscriber")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("V1Subscriber")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("8d2802a8-703c-4b6d-82fa-81efe8612eed")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Versioning/V1Subscriber/SomethingHappenedHandler.cs b/Samples/Versioning/V1Subscriber/SomethingHappenedHandler.cs deleted file mode 100644 index 9995c0c9c9b..00000000000 --- a/Samples/Versioning/V1Subscriber/SomethingHappenedHandler.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using NServiceBus; -using V1.Messages; - -namespace V1Subscriber -{ - public class SomethingHappenedHandler : IHandleMessages - { - public void Handle(ISomethingHappened message) - { - Console.WriteLine("======================================================================"); - - Console.WriteLine("Something happened with some data {0} and no more info", message.SomeData); - } - } -} diff --git a/Samples/Versioning/V1Subscriber/V1Subscriber.csproj b/Samples/Versioning/V1Subscriber/V1Subscriber.csproj deleted file mode 100644 index 88989dd0f95..00000000000 --- a/Samples/Versioning/V1Subscriber/V1Subscriber.csproj +++ /dev/null @@ -1,122 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FBA8997D-01C8-458D-ACE6-28DC7BC32711} - Library - Properties - V1Subscriber - V1Subscriber - v4.0 - 512 - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - - - - - - {9D27D517-B938-4594-8836-CE06A2955FFD} - V1.Messages - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - AllRules.ruleset - - \ No newline at end of file diff --git a/Samples/Versioning/V1Subscriber/V1SubscriberEndpoint.cs b/Samples/Versioning/V1Subscriber/V1SubscriberEndpoint.cs deleted file mode 100644 index cd8a03ca769..00000000000 --- a/Samples/Versioning/V1Subscriber/V1SubscriberEndpoint.cs +++ /dev/null @@ -1,6 +0,0 @@ -using NServiceBus; - -namespace V1Subscriber -{ - public class V1SubscriberEndpoint : IConfigureThisEndpoint, AsA_Server { } -} \ No newline at end of file diff --git a/Samples/Versioning/V2.Messages/ISomethingHappened.cs b/Samples/Versioning/V2.Messages/ISomethingHappened.cs deleted file mode 100644 index 2bfb449ad5e..00000000000 --- a/Samples/Versioning/V2.Messages/ISomethingHappened.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace V2.Messages -{ - public interface ISomethingHappened : V1.Messages.ISomethingHappened - { - string MoreInfo { get; set; } - } -} diff --git a/Samples/Versioning/V2.Messages/Properties/AssemblyInfo.cs b/Samples/Versioning/V2.Messages/Properties/AssemblyInfo.cs deleted file mode 100644 index 9c0609dd4f2..00000000000 --- a/Samples/Versioning/V2.Messages/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("V2.Messages")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("V2.Messages")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("72d32ed7-2bb2-4149-adc1-df0370fe72fd")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Versioning/V2.Messages/V2.Messages.csproj b/Samples/Versioning/V2.Messages/V2.Messages.csproj deleted file mode 100644 index 6dbce4919e0..00000000000 --- a/Samples/Versioning/V2.Messages/V2.Messages.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D22F0CFF-D47F-4541-BD6D-3F07808EE468} - Library - Properties - V2.Messages - V2.Messages - v4.0 - 512 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\NServiceBus.dll - - - - - - - - - - - - - - - - - - {9D27D517-B938-4594-8836-CE06A2955FFD} - V1.Messages - - - - - 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/Samples/Versioning/V2Publisher/App.config b/Samples/Versioning/V2Publisher/App.config deleted file mode 100644 index 3338ec0317d..00000000000 --- a/Samples/Versioning/V2Publisher/App.config +++ /dev/null @@ -1,17 +0,0 @@ - - - -
    -
    - - - - - - - - - diff --git a/Samples/Versioning/V2Publisher/EndpointConfig.cs b/Samples/Versioning/V2Publisher/EndpointConfig.cs deleted file mode 100644 index 4fd7e133886..00000000000 --- a/Samples/Versioning/V2Publisher/EndpointConfig.cs +++ /dev/null @@ -1,6 +0,0 @@ -using NServiceBus; - -namespace V2Publisher -{ - class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher { } -} diff --git a/Samples/Versioning/V2Publisher/Properties/AssemblyInfo.cs b/Samples/Versioning/V2Publisher/Properties/AssemblyInfo.cs deleted file mode 100644 index b6bfc845e9e..00000000000 --- a/Samples/Versioning/V2Publisher/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("V2Publisher")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("V2Publisher")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("cd90d941-dc63-48f4-a327-a9a8c1352e6a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Versioning/V2Publisher/V2Publisher.csproj b/Samples/Versioning/V2Publisher/V2Publisher.csproj deleted file mode 100644 index 17bbcc5e8a3..00000000000 --- a/Samples/Versioning/V2Publisher/V2Publisher.csproj +++ /dev/null @@ -1,119 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {CCC62E59-19DD-44B7-B565-CEA7AE8A83EC} - Library - Properties - V2Publisher - V2Publisher - v4.0 - 512 - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - - - - - - {9D27D517-B938-4594-8836-CE06A2955FFD} - V1.Messages - - - {D22F0CFF-D47F-4541-BD6D-3F07808EE468} - V2.Messages - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - AllRules.ruleset - - \ No newline at end of file diff --git a/Samples/Versioning/V2Publisher/V2PublisherEndpoint.cs b/Samples/Versioning/V2Publisher/V2PublisherEndpoint.cs deleted file mode 100644 index ee14b941ffd..00000000000 --- a/Samples/Versioning/V2Publisher/V2PublisherEndpoint.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using NServiceBus; - -namespace V2Publisher -{ - public class V2PublisherEndpoint : IWantToRunAtStartup - { - public IBus Bus { get; set; } - - public void Run() - { - Console.WriteLine("Press 'Enter' to publish a message, Ctrl + C to exit."); - - while (Console.ReadLine() != null) - { - Bus.Publish(sh => - { - sh.SomeData = 1; - sh.MoreInfo = "It's a secret."; - }); - - Console.WriteLine("Published event."); - Console.WriteLine("======================================================================"); - } - } - - public void Stop() - { - } - } -} \ No newline at end of file diff --git a/Samples/Versioning/V2Subscriber/App.config b/Samples/Versioning/V2Subscriber/App.config deleted file mode 100644 index 62e70f6eb12..00000000000 --- a/Samples/Versioning/V2Subscriber/App.config +++ /dev/null @@ -1,21 +0,0 @@ - - - -
    -
    - - - - - - - - - - - - - diff --git a/Samples/Versioning/V2Subscriber/Properties/AssemblyInfo.cs b/Samples/Versioning/V2Subscriber/Properties/AssemblyInfo.cs deleted file mode 100644 index 892c271432f..00000000000 --- a/Samples/Versioning/V2Subscriber/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("V2Subscriber")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("V2Subscriber")] -[assembly: AssemblyCopyright("Copyright © 2009")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("dbcc73b3-ca40-41d1-a4cb-0fb3f2eaaf6d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/Versioning/V2Subscriber/SomethingHappenedHandler.cs b/Samples/Versioning/V2Subscriber/SomethingHappenedHandler.cs deleted file mode 100644 index 0b05d550e9f..00000000000 --- a/Samples/Versioning/V2Subscriber/SomethingHappenedHandler.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using V2.Messages; -using NServiceBus; - -namespace V2Subscriber -{ - public class SomethingHappenedHandler : IHandleMessages - { - public void Handle(ISomethingHappened message) - { - Console.WriteLine("======================================================================"); - - Console.WriteLine("Something happened with some data {0} and more info {1}", message.SomeData, message.MoreInfo); - } - } -} diff --git a/Samples/Versioning/V2Subscriber/V2Subscriber.csproj b/Samples/Versioning/V2Subscriber/V2Subscriber.csproj deleted file mode 100644 index 17b4ccead1c..00000000000 --- a/Samples/Versioning/V2Subscriber/V2Subscriber.csproj +++ /dev/null @@ -1,126 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DCFE28B5-245F-4C28-869B-C42C73E816E5} - Library - Properties - V2Subscriber - V2Subscriber - v4.0 - 512 - - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - False - ..\..\..\binaries\log4net.dll - - - False - ..\..\..\binaries\NServiceBus.dll - - - False - ..\..\..\binaries\NServiceBus.Core.dll - - - False - ..\..\..\binaries\NServiceBus.Host.exe - - - - - - - - - - - - - - - - - - - - - - {9D27D517-B938-4594-8836-CE06A2955FFD} - V1.Messages - - - {D22F0CFF-D47F-4541-BD6D-3F07808EE468} - V2.Messages - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - AllRules.ruleset - - \ No newline at end of file diff --git a/Samples/Versioning/V2Subscriber/V2SubscriberEndpoint.cs b/Samples/Versioning/V2Subscriber/V2SubscriberEndpoint.cs deleted file mode 100644 index c07bebc02ce..00000000000 --- a/Samples/Versioning/V2Subscriber/V2SubscriberEndpoint.cs +++ /dev/null @@ -1,6 +0,0 @@ -using NServiceBus; - -namespace V2Subscriber -{ - public class V2SubscriberEndpoint : IConfigureThisEndpoint, AsA_Server{ } -} \ No newline at end of file diff --git a/Samples/Versioning/Versioning.sln b/Samples/Versioning/Versioning.sln deleted file mode 100644 index 130a68e53c0..00000000000 --- a/Samples/Versioning/Versioning.sln +++ /dev/null @@ -1,44 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "V1.Messages", "V1.Messages\V1.Messages.csproj", "{9D27D517-B938-4594-8836-CE06A2955FFD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "V2.Messages", "V2.Messages\V2.Messages.csproj", "{D22F0CFF-D47F-4541-BD6D-3F07808EE468}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "V2Publisher", "V2Publisher\V2Publisher.csproj", "{CCC62E59-19DD-44B7-B565-CEA7AE8A83EC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "V2Subscriber", "V2Subscriber\V2Subscriber.csproj", "{DCFE28B5-245F-4C28-869B-C42C73E816E5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "V1Subscriber", "V1Subscriber\V1Subscriber.csproj", "{FBA8997D-01C8-458D-ACE6-28DC7BC32711}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9D27D517-B938-4594-8836-CE06A2955FFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9D27D517-B938-4594-8836-CE06A2955FFD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9D27D517-B938-4594-8836-CE06A2955FFD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9D27D517-B938-4594-8836-CE06A2955FFD}.Release|Any CPU.Build.0 = Release|Any CPU - {D22F0CFF-D47F-4541-BD6D-3F07808EE468}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D22F0CFF-D47F-4541-BD6D-3F07808EE468}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D22F0CFF-D47F-4541-BD6D-3F07808EE468}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D22F0CFF-D47F-4541-BD6D-3F07808EE468}.Release|Any CPU.Build.0 = Release|Any CPU - {CCC62E59-19DD-44B7-B565-CEA7AE8A83EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CCC62E59-19DD-44B7-B565-CEA7AE8A83EC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CCC62E59-19DD-44B7-B565-CEA7AE8A83EC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CCC62E59-19DD-44B7-B565-CEA7AE8A83EC}.Release|Any CPU.Build.0 = Release|Any CPU - {DCFE28B5-245F-4C28-869B-C42C73E816E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DCFE28B5-245F-4C28-869B-C42C73E816E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DCFE28B5-245F-4C28-869B-C42C73E816E5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DCFE28B5-245F-4C28-869B-C42C73E816E5}.Release|Any CPU.Build.0 = Release|Any CPU - {FBA8997D-01C8-458D-ACE6-28DC7BC32711}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FBA8997D-01C8-458D-ACE6-28DC7BC32711}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FBA8997D-01C8-458D-ACE6-28DC7BC32711}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FBA8997D-01C8-458D-ACE6-28DC7BC32711}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Samples/Versioning/Versioning.suo b/Samples/Versioning/Versioning.suo deleted file mode 100644 index 83f1b68f724..00000000000 Binary files a/Samples/Versioning/Versioning.suo and /dev/null differ diff --git a/Samples/VideoStore.ActiveMQ/.nuget/NuGet.Config b/Samples/VideoStore.ActiveMQ/.nuget/NuGet.Config new file mode 100644 index 00000000000..308b678b2da --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/.nuget/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/VideoStore.ActiveMQ/.nuget/NuGet.exe b/Samples/VideoStore.ActiveMQ/.nuget/NuGet.exe new file mode 100644 index 00000000000..4645f4b35e8 Binary files /dev/null and b/Samples/VideoStore.ActiveMQ/.nuget/NuGet.exe differ diff --git a/Samples/VideoStore.ActiveMQ/.nuget/NuGet.targets b/Samples/VideoStore.ActiveMQ/.nuget/NuGet.targets new file mode 100644 index 00000000000..4ada616b317 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/.nuget/NuGet.targets @@ -0,0 +1,150 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + + + + + $(SolutionDir).nuget + packages.config + + + + + $(NuGetToolsPath)\nuget.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " + $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(ResolveReferencesDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ActiveMQ.sln b/Samples/VideoStore.ActiveMQ/VideoStore.ActiveMQ.sln new file mode 100644 index 00000000000..d6c86602ae6 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ActiveMQ.sln @@ -0,0 +1,57 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{FC318FC3-ED0F-4130-BD33-E970AE78A56C}" + ProjectSection(SolutionItems) = preProject + .nuget\NuGet.Config = .nuget\NuGet.Config + .nuget\NuGet.exe = .nuget\NuGet.exe + .nuget\NuGet.targets = .nuget\NuGet.targets + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.Messages", "VideoStore.Messages\VideoStore.Messages.csproj", "{59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.CustomerRelations", "VideoStore.CustomerRelations\VideoStore.CustomerRelations.csproj", "{CD522757-4C40-49C7-94C5-CD5DA956BAFC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.Operations", "VideoStore.Operations\VideoStore.Operations.csproj", "{0B353423-4655-4523-B4E0-F191DDDF0ABF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.Sales", "VideoStore.Sales\VideoStore.Sales.csproj", "{C2D005B5-065F-4F81-BA1F-259F90E00AEE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.ContentManagement", "VideoStore.ContentManagement\VideoStore.ContentManagement.csproj", "{C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.ECommerce", "VideoStore.ECommerce\VideoStore.ECommerce.csproj", "{F295D85E-4447-44E4-A9CC-3E017CF2B0D8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Release|Any CPU.Build.0 = Release|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Release|Any CPU.Build.0 = Release|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Release|Any CPU.Build.0 = Release|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Release|Any CPU.Build.0 = Release|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Release|Any CPU.Build.0 = Release|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ActiveMQ.v11.suo b/Samples/VideoStore.ActiveMQ/VideoStore.ActiveMQ.v11.suo new file mode 100644 index 00000000000..55727ce5da4 Binary files /dev/null and b/Samples/VideoStore.ActiveMQ/VideoStore.ActiveMQ.v11.suo differ diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/App.config b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/App.config new file mode 100644 index 00000000000..957858bc791 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/App.config @@ -0,0 +1,25 @@ + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/DebugFlagMutator.cs b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/DebugFlagMutator.cs new file mode 100644 index 00000000000..12cce29e2ee --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/DebugFlagMutator.cs @@ -0,0 +1,37 @@ +namespace VideoStore.Common +{ + using System; + using System.Threading; + using NServiceBus; + using NServiceBus.MessageMutator; + + public class DebugFlagMutator : IMutateTransportMessages, INeedInitialization + { + public static bool Debug { get { return debug.Value; } } + + public void MutateIncoming(TransportMessage transportMessage) + { + var debugFlag = transportMessage.Headers.ContainsKey("Debug") ? transportMessage.Headers["Debug"] : "false"; + if (debugFlag !=null && debugFlag.Equals("true", StringComparison.OrdinalIgnoreCase)) + { + debug.Value = true; + } + else + { + debug.Value = false; + } + } + + public void MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + transportMessage.Headers["Debug"] = Debug.ToString(); + } + + public void Init() + { + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + } + + static readonly ThreadLocal debug = new ThreadLocal(); + } +} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/EndpointConfig.cs b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/EndpointConfig.cs new file mode 100644 index 00000000000..ab2a9811ee9 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/EndpointConfig.cs @@ -0,0 +1,20 @@ +namespace VideoStore.ContentManagement +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, UsingTransport { } + + public class MyClass : IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.ContentManagement endpoint is now started and subscribed to OrderAccepted events from VideoStore.Sales"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/OrderAcceptedHandler.cs b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/OrderAcceptedHandler.cs new file mode 100644 index 00000000000..b5b2d8fb5f8 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/OrderAcceptedHandler.cs @@ -0,0 +1,35 @@ +namespace VideoStore.ContentManagement +{ + using System; + using System.Diagnostics; + using VideoStore.Common; + using VideoStore.Messages.RequestResponse; + using VideoStore.Messages.Events; + using NServiceBus; + + public class OrderAcceptedHandler : IHandleMessages + { + + + public IBus Bus { get; set; } + + public void Handle(OrderAccepted message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.WriteLine("Order # {0} has been accepted, Let's provision the download -- Sending ProvisionDownloadRequest to the VideoStore.Operations endpoint", message.OrderNumber); + + //send out a request (a event will be published when the response comes back) + Bus.Send(r => + { + r.ClientId = message.ClientId; + r.OrderNumber = message.OrderNumber; + r.VideoIds = message.VideoIds; + }); + + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/Properties/AssemblyInfo.cs b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..5b8a651c9ce --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("VideoStore.DownloadVideos")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VideoStore.DownloadVideos")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7121e327-af1c-4c5d-87f5-47fa2799ffa7")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/ProvisionDownloadResponseHandler.cs b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/ProvisionDownloadResponseHandler.cs new file mode 100644 index 00000000000..2818c347035 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/ProvisionDownloadResponseHandler.cs @@ -0,0 +1,49 @@ +namespace VideoStore.ContentManagement +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using Messages.Events; + using Messages.RequestResponse; + using NServiceBus; + using VideoStore.Common; + + public class ProvisionDownloadResponseHandler : IHandleMessages + { + public IBus Bus { get; set; } + private readonly IDictionary videoIdToUrlMap = new Dictionary + { + {"intro1", "http://youtu.be/6lYF83wKerA"}, + {"intro2", "http://youtu.be/icze_WCyEdQ"}, + {"gems", "http://skillsmatter.com/podcast/design-architecture/hidden-nservicebus-gems"}, + {"integ", "http://skillsmatter.com/podcast/home/reliable-integrations-nservicebus/js-1877"}, + {"shiny", "http://skillsmatter.com/podcast/open-source-dot-net/nservicebus-3"}, + {"day", "http://dnrtv.com/dnrtvplayer/player.aspx?ShowNum=0199"}, + {"need", "http://vimeo.com/37728422"}, + }; + + public void Handle(ProvisionDownloadResponse message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.WriteLine("Download for Order # {0} has been provisioned, Publishing Download ready event", message.OrderNumber); + + Bus.Publish(e => + { + e.OrderNumber = message.OrderNumber; + e.ClientId = message.ClientId; + e.VideoUrls = new Dictionary(); + + foreach (var videoId in message.VideoIds) + { + e.VideoUrls.Add(videoId, videoIdToUrlMap[videoId]); + } + }); + + Console.Out.WriteLine("Downloads for Order #{0} is ready, publishing it.", message.OrderNumber); + } + } +} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/UnobtrusiveMessageConventions.cs b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/UnobtrusiveMessageConventions.cs new file mode 100644 index 00000000000..ed699df4fa4 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/UnobtrusiveMessageConventions.cs @@ -0,0 +1,18 @@ +namespace VideoStore.Common +{ + using NServiceBus; + + class UnobtrusiveMessageConventions : IWantToRunBeforeConfiguration + { + public void Init() + { + Configure.Instance + .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("Commands")) + .DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("Events")) + .DefiningMessagesAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("RequestResponse")) + .DefiningEncryptedPropertiesAs(p => p.Name.StartsWith("Encrypted")); + } + } +} + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/VideoStore.ContentManagement.csproj b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/VideoStore.ContentManagement.csproj new file mode 100644 index 00000000000..8ff15f17fff --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/VideoStore.ContentManagement.csproj @@ -0,0 +1,104 @@ + + + + + + Debug + AnyCPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C} + Library + Properties + VideoStore.ContentManagement + VideoStore.ContentManagement + v4.0 + 512 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\packages\Apache.NMS.1.5.1\lib\net40\Apache.NMS.dll + + + ..\..\..\binaries\NServiceBus.Transports.ActiveMQ.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + Designer + + + + + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/packages.config b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/packages.config new file mode 100644 index 00000000000..26f0a5cea34 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ContentManagement/packages.config @@ -0,0 +1,5 @@ + + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/App.config b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/App.config new file mode 100644 index 00000000000..e7bb5c85f31 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/App.config @@ -0,0 +1,25 @@ + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/EndpointConfig.cs b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/EndpointConfig.cs new file mode 100644 index 00000000000..9900c90c145 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/EndpointConfig.cs @@ -0,0 +1,20 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, UsingTransport { } + + public class MyClass : IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.CustomerRelations endpoint is now started and subscribed to events from VideoStore.Sales"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/OrderAcceptedHandler.cs b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/OrderAcceptedHandler.cs new file mode 100644 index 00000000000..af2394a62bd --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/OrderAcceptedHandler.cs @@ -0,0 +1,35 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using System.Diagnostics; + using Messages.Events; + using NServiceBus; + using VideoStore.Common; + + class OrderAcceptedHandler : IHandleMessages + { + public IBus Bus { get; set; } + public void Handle(OrderAccepted message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.WriteLine("Customer: {0} is now a preferred customer -- raising in-memory event, & publishing for other service concerns", message.ClientId); + // Call the domain object to do the raising of the event based on the relevant condition + Bus.InMemory.Raise(m => + { + m.ClientId = message.ClientId; + m.PreferredStatusExpiresOn = DateTime.Now.AddMonths(2); + }); + + // Yes, you can also publish this event as an asynchronous event + Bus.Publish(m => + { + m.ClientId = message.ClientId; + m.PreferredStatusExpiresOn = DateTime.Now.AddMonths(2); + }); + } + } +} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/Properties/AssemblyInfo.cs b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..2ee904c5711 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("VideoStore.CustomerRelations")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VideoStore.CustomerRelations")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2dad9534-21c4-4fd6-b45e-243d1d1a3902")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/SendLimitedTimeOffer.cs b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/SendLimitedTimeOffer.cs new file mode 100644 index 00000000000..76894e2667c --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/SendLimitedTimeOffer.cs @@ -0,0 +1,20 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using System.Diagnostics; + using Messages.Events; + using NServiceBus; + using VideoStore.Common; + + class SendLimitedTimeOffer : IHandleMessages + { + public void Handle(ClientBecamePreferred message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + Console.WriteLine("Handler WhenCustomerIsPreferredSendLimitedTimeOffer invoked for CustomerId: {0}", message.ClientId); + } + } +} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/SendWelcomePacket.cs b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/SendWelcomePacket.cs new file mode 100644 index 00000000000..0981531626d --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/SendWelcomePacket.cs @@ -0,0 +1,26 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using System.Diagnostics; + using Messages.Events; + using NServiceBus; + using VideoStore.Common; + + class SendWelcomePacket : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(ClientBecamePreferred message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + Console.WriteLine("Handler WhenCustomerIsPreferredSendWelcomeEmail invoked for CustomerId: {0}", message.ClientId); + + // Don't write code to do the smtp send here, instead do a Bus.Send. If this handler fails, then + // the message to send email will not be sent. + //Bus.Send(m => { m.ClientId = message.ClientId; }); + } + } +} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/VideoStore.CustomerRelations.csproj b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/VideoStore.CustomerRelations.csproj new file mode 100644 index 00000000000..d0ff6427de2 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/VideoStore.CustomerRelations.csproj @@ -0,0 +1,103 @@ + + + + + + Debug + AnyCPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC} + Library + Properties + VideoStore.CustomerRelations + VideoStore.CustomerRelations + v4.0 + 512 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\packages\Apache.NMS.1.5.1\lib\net40\Apache.NMS.dll + + + ..\..\..\binaries\NServiceBus.Transports.ActiveMQ.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + + + + + + + + + DebugFlagMutator.cs + + + UnobtrusiveMessageConventions.cs + + + + + + + + + + + + + + + + + + + {59f2ba7e-4da5-49f8-9dbc-520fa99f4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/packages.config b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/packages.config new file mode 100644 index 00000000000..26f0a5cea34 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.CustomerRelations/packages.config @@ -0,0 +1,5 @@ + + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/App_Start/FilterConfig.cs b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/App_Start/FilterConfig.cs new file mode 100644 index 00000000000..b8da915c6e2 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/App_Start/FilterConfig.cs @@ -0,0 +1,12 @@ +namespace VideoStore.ECommerce +{ + using System.Web.Mvc; + + public class FilterConfig + { + public static void RegisterGlobalFilters(GlobalFilterCollection filters) + { + filters.Add(new HandleErrorAttribute()); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/App_Start/RouteConfig.cs b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/App_Start/RouteConfig.cs new file mode 100644 index 00000000000..dde7707c577 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/App_Start/RouteConfig.cs @@ -0,0 +1,16 @@ +namespace VideoStore.ECommerce +{ + using System; + using System.Web.Mvc; + using System.Web.Routing; + + public class RouteConfig + { + public static void RegisterRoutes(RouteCollection routes) + { + routes.MapHubs(); + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + routes.MapRoute("Default", String.Empty, new { controller = "Home", action = "Index" }); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/css/bootstrap-responsive.min.css b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/css/bootstrap-responsive.min.css new file mode 100644 index 00000000000..5cb833ff082 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/css/bootstrap-responsive.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap Responsive v2.2.2 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */@-ms-viewport{width:device-width}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/css/bootstrap.min.css b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/css/bootstrap.min.css new file mode 100644 index 00000000000..140f731dfa8 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/css/bootstrap.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap v2.2.2 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}label,select,button,input[type="button"],input[type="reset"],input[type="submit"],input[type="radio"],input[type="checkbox"]{cursor:pointer}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.127659574468085%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;line-height:0;content:""}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;line-height:0;content:""}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}a.muted:hover{color:#808080}.text-warning{color:#c09853}a.text-warning:hover{color:#a47e3c}.text-error{color:#b94a48}a.text-error:hover{color:#953b39}.text-info{color:#3a87ad}a.text-info:hover{color:#2d6987}.text-success{color:#468847}a.text-success:hover{color:#356635}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:20px;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{line-height:40px}h1{font-size:38.5px}h2{font-size:31.5px}h3{font-size:24.5px}h4{font-size:17.5px}h5{font-size:14px}h6{font-size:11.9px}h1 small{font-size:24.5px}h2 small{font-size:17.5px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}ul.inline,ol.inline{margin-left:0;list-style:none}ul.inline>li,ol.inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;line-height:0;content:""}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;white-space:nowrap;background-color:#f7f7f9;border:1px solid #e1e1e8}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;white-space:pre;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555;vertical-align:middle;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}input,textarea,.uneditable-input{width:206px}textarea{height:auto}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;background-color:#fff;border:1px solid #ccc}select[multiple],select[size]{height:auto}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:20px;padding-left:20px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-20px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left}.controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error .control-label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success .control-label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info .control-label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu{font-size:14px}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn,.input-append .btn-group>.dropdown-toggle,.input-prepend .btn-group>.dropdown-toggle{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn:last-child,.input-append select+.btn-group .btn:last-child,.input-append .uneditable-input+.btn-group .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px}.input-append .add-on:last-child,.input-append .btn:last-child,.input-append .btn-group:last-child>.dropdown-toggle{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child{margin-left:0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizontal .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block,.form-horizontal .uneditable-input+.help-block,.form-horizontal .input-prepend+.help-block,.form-horizontal .input-append+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child>th:first-child,.table-bordered tbody:first-child tr:first-child>td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child>th:last-child,.table-bordered tbody:first-child tr:first-child>td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child>th:first-child,.table-bordered tbody:last-child tr:last-child>td:first-child,.table-bordered tfoot:last-child tr:last-child>td:first-child{-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child>th:last-child,.table-bordered tbody:last-child tr:last-child>td:last-child,.table-bordered tfoot:last-child tr:last-child>td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered tfoot+tbody:last-child tr:last-child td:first-child{-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-moz-border-radius-bottomleft:0}.table-bordered tfoot+tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomright:0}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5}table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span"],.row-fluid table th[class*="span"]{display:table-cell;float:none;margin-left:0}.table td.span1,.table th.span1{float:none;width:44px;margin-left:0}.table td.span2,.table th.span2{float:none;width:124px;margin-left:0}.table td.span3,.table th.span3{float:none;width:204px;margin-left:0}.table td.span4,.table th.span4{float:none;width:284px;margin-left:0}.table td.span5,.table th.span5{float:none;width:364px;margin-left:0}.table td.span6,.table th.span6{float:none;width:444px;margin-left:0}.table td.span7,.table th.span7{float:none;width:524px;margin-left:0}.table td.span8,.table th.span8{float:none;width:604px;margin-left:0}.table td.span9,.table th.span9{float:none;width:684px;margin-left:0}.table td.span10,.table th.span10{float:none;width:764px;margin-left:0}.table td.span11,.table th.span11{float:none;width:844px;margin-left:0}.table td.span12,.table th.span12{float:none;width:924px;margin-left:0}.table tbody tr.success td{background-color:#dff0d8}.table tbody tr.error td{background-color:#f2dede}.table tbody tr.warning td{background-color:#fcf8e3}.table tbody tr.info td{background-color:#d9edf7}.table-hover tbody tr.success:hover td{background-color:#d0e9c6}.table-hover tbody tr.error:hover td{background-color:#ebcccc}.table-hover tbody tr.warning:hover td{background-color:#faf2cc}.table-hover tbody tr.info:hover td{background-color:#c4e3f3}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;outline:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999}.dropdown-menu .disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open{*z-index:1000}.open>.dropdown-menu{display:block}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 12px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #bbb;*border:0;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn{border-color:#c5c5c5;border-color:rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-moz-linear-gradient(top,#62c462,#51a351);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover{color:#333;text-decoration:none}.btn-group{position:relative;display:inline-block;*display:inline;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle;*zoom:1}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:14px}.btn-group>.btn-mini{font-size:10.5px}.btn-group>.btn-small{font-size:11.9px}.btn-group>.btn-large{font-size:17.5px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5px;border-right-width:5px;border-left-width:5px}.dropup .btn-large .caret{border-bottom-width:5px}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical>.btn{display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical>.btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical>.btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical>.btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical>.btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert,.alert h4{color:#c09853}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-success h4{color:#468847}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-danger h4,.alert-error h4{color:#b94a48}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-info h4{color:#3a87ad}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li>a>img{max-width:none}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;content:""}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#fff;background-color:#08c}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover{z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;content:""}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover{border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before,.navbar-inner:after{display:table;line-height:0;content:""}.navbar-inner:after{clear:both}.navbar .container{width:auto}.nav-collapse.collapse{height:auto;overflow:visible}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px;color:#777}.navbar-link{color:#777}.navbar-link:hover{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:5px}.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn{margin-top:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;content:""}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:5px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,0.1);box-shadow:0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown>a:hover .caret{border-top-color:#555;border-bottom-color:#555}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#fff}.navbar-inverse .brand{color:#999}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>a:hover .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-moz-linear-gradient(top,#151515,#040404);background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb>li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb>li>.divider{padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li{display:inline}.pagination ul>li>a,.pagination ul>li>span{float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5}.pagination ul>.active>a,.pagination ul>.active>span{color:#999;cursor:default}.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover{color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pagination-large ul>li>a,.pagination-large ul>li>span{padding:11px 19px;font-size:17.5px}.pagination-large ul>li:first-child>a,.pagination-large ul>li:first-child>span{-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.pagination-large ul>li:last-child>a,.pagination-large ul>li:last-child>span{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.pagination-mini ul>li:first-child>a,.pagination-small ul>li:first-child>a,.pagination-mini ul>li:first-child>span,.pagination-small ul>li:first-child>span{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px}.pagination-mini ul>li:last-child>a,.pagination-small ul>li:last-child>a,.pagination-mini ul>li:last-child>span,.pagination-small ul>li:last-child>span{-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px}.pagination-small ul>li>a,.pagination-small ul>li>span{padding:2px 10px;font-size:11.9px}.pagination-mini ul>li>a,.pagination-mini ul>li>span{padding:0 6px;font-size:10.5px}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager li>a:hover{text-decoration:none;background-color:#f5f5f5}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>span{color:#999;cursor:default;background-color:#fff}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:10%;left:50%;z-index:1050;width:560px;margin-left:-280px;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:0;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3s ease-out}.modal.fade.in{top:10%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{position:relative;max-height:400px;padding:15px;overflow-y:auto}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.tooltip{position:absolute;z-index:1030;display:block;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{margin-top:-3px}.tooltip.right{margin-left:3px}.tooltip.bottom{margin-top:3px}.tooltip.left{margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after{bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,0.25);border-left-width:0}.popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0}.popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover{border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.media,.media-body{overflow:hidden;*overflow:visible;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media .pull-left{margin-right:10px}.media .pull-right{margin-left:10px}.media-list{margin-left:0;list-style:none}.label,.badge{display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding-right:9px;padding-left:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}.label:empty,.badge:empty{display:none}a.label:hover,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.accordion{margin-bottom:20px}.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading{border-bottom:0}.accordion-heading .accordion-toggle{display:block;padding:8px 15px}.accordion-toggle{cursor:pointer}.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5}.carousel{position:relative;margin-bottom:20px;line-height:1}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img{display:block;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{right:15px;left:auto}.carousel-control:hover{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-caption{position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{line-height:20px;color:#fff}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit li{line-height:30px}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/img/glyphicons-halflings-white.png b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/img/glyphicons-halflings-white.png new file mode 100644 index 00000000000..3bf6484a29d Binary files /dev/null and b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/img/glyphicons-halflings-white.png differ diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/img/glyphicons-halflings.png b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/img/glyphicons-halflings.png new file mode 100644 index 00000000000..a9969993201 Binary files /dev/null and b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/img/glyphicons-halflings.png differ diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/js/angular.min.js b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/js/angular.min.js new file mode 100644 index 00000000000..569325cf173 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/js/angular.min.js @@ -0,0 +1,160 @@ +/* + AngularJS v1.0.4 + (c) 2010-2012 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(T,Y,p){'use strict';function m(b,a,c){var d;if(b)if(L(b))for(d in b)d!="prototype"&&d!="length"&&d!="name"&&b.hasOwnProperty(d)&&a.call(c,b[d],d);else if(b.forEach&&b.forEach!==m)b.forEach(a,c);else if(M(b)&&va(b.length))for(d=0;d=0&&b.splice(c,1);return a}function U(b,a){if(oa(b)||b&&b.$evalAsync&&b.$watch)throw u("Can't copy Window or Scope");if(a){if(b===a)throw u("Can't copy equivalent objects or arrays");if(I(b)){for(;a.length;)a.pop();for(var c=0;c2?ia.call(arguments,2):[];return L(a)&&!(a instanceof RegExp)?c.length?function(){return arguments.length?a.apply(b,c.concat(ia.call(arguments,0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b, +arguments):a.call(b)}:a}function ic(b,a){var c=a;/^\$+/.test(b)?c=p:oa(a)?c="$WINDOW":a&&Y===a?c="$DOCUMENT":a&&a.$evalAsync&&a.$watch&&(c="$SCOPE");return c}function da(b,a){return JSON.stringify(b,ic,a?" ":null)}function ob(b){return E(b)?JSON.parse(b):b}function Wa(b){b&&b.length!==0?(b=D(""+b),b=!(b=="f"||b=="0"||b=="false"||b=="no"||b=="n"||b=="[]")):b=!1;return b}function pa(b){b=z(b).clone();try{b.html("")}catch(a){}return z("
    ").append(b).html().match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/, +function(a,b){return"<"+D(b)})}function Xa(b){var a={},c,d;m((b||"").split("&"),function(b){b&&(c=b.split("="),d=decodeURIComponent(c[0]),a[d]=v(c[1])?decodeURIComponent(c[1]):!0)});return a}function pb(b){var a=[];m(b,function(b,d){a.push(Ya(d,!0)+(b===!0?"":"="+Ya(b,!0)))});return a.length?a.join("&"):""}function Za(b){return Ya(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Ya(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g, +"$").replace(/%2C/gi,",").replace(a?null:/%20/g,"+")}function jc(b,a){function c(a){a&&d.push(a)}var d=[b],e,g,i=["ng:app","ng-app","x-ng-app","data-ng-app"],f=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;m(i,function(a){i[a]=!0;c(Y.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(m(b.querySelectorAll("."+a),c),m(b.querySelectorAll("."+a+"\\:"),c),m(b.querySelectorAll("["+a+"]"),c))});m(d,function(a){if(!e){var b=f.exec(" "+a.className+" ");b?(e=a,g=(b[2]||"").replace(/\s+/g,",")):m(a.attributes, +function(b){if(!e&&i[b.name])e=a,g=b.value})}});e&&a(e,g?[g]:[])}function qb(b,a){b=z(b);a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");var c=rb(a);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,i){a.$apply(function(){b.data("$injector",i);c(b)(a)})}]);return c}function $a(b,a){a=a||"_";return b.replace(kc,function(b,d){return(d?a:"")+b.toLowerCase()})}function ab(b,a,c){if(!b)throw new u("Argument '"+(a||"?")+"' is "+(c||"required")); +return b}function qa(b,a,c){c&&I(b)&&(b=b[b.length-1]);ab(L(b),a,"not a function, got "+(b&&typeof b=="object"?b.constructor.name||"Object":typeof b));return b}function lc(b){function a(a,b,e){return a[b]||(a[b]=e())}return a(a(b,"angular",Object),"module",function(){var b={};return function(d,e,g){e&&b.hasOwnProperty(d)&&(b[d]=null);return a(b,d,function(){function a(c,d,e){return function(){b[e||"push"]([c,d,arguments]);return k}}if(!e)throw u("No module: "+d);var b=[],c=[],j=a("$injector","invoke"), +k={_invokeQueue:b,_runBlocks:c,requires:e,name:d,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:j,run:function(a){c.push(a);return this}};g&&j(g);return k})}})}function sb(b){return b.replace(mc,function(a,b,d,e){return e?d.toUpperCase():d}).replace(nc, +"Moz$1")}function bb(b,a){function c(){var e;for(var b=[this],c=a,i,f,h,j,k,l;b.length;){i=b.shift();f=0;for(h=i.length;f-1}function wb(b,a){a&&m(a.split(" "),function(a){b.className=Q((" "+b.className+" ").replace(/[\n\t]/g," ").replace(" "+Q(a)+" "," "))})}function xb(b,a){a&&m(a.split(" "), +function(a){if(!Ba(b,a))b.className=Q(b.className+" "+Q(a))})}function cb(b,a){if(a)for(var a=!a.nodeName&&v(a.length)&&!oa(a)?a:[a],c=0;c4096&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!")}else{if(h.cookie!==P){P=h.cookie;d=P.split("; ");ba={};for(f=0;f0&&(ba[unescape(e.substring(0,j))]=unescape(e.substring(j+1)))}return ba}};f.defer=function(a,b){var c;n++;c=l(function(){delete r[c]; +e(a)},b||0);r[c]=!0;return c};f.defer.cancel=function(a){return r[a]?(delete r[a],o(a),e(C),!0):!1}}function wc(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new vc(b,d,a,c)}]}function xc(){this.$get=function(){function b(b,d){function e(a){if(a!=l){if(o){if(o==a)o=a.n}else o=a;g(a.n,a.p);g(a,l);l=a;l.n=null}}function g(a,b){if(a!=b){if(a)a.p=b;if(b)b.n=a}}if(b in a)throw u("cacheId "+b+" taken");var i=0,f=y({},d,{id:b}),h={},j=d&&d.capacity||Number.MAX_VALUE,k={}, +l=null,o=null;return a[b]={put:function(a,b){var c=k[a]||(k[a]={key:a});e(c);t(b)||(a in h||i++,h[a]=b,i>j&&this.remove(o.key))},get:function(a){var b=k[a];if(b)return e(b),h[a]},remove:function(a){var b=k[a];if(b){if(b==l)l=b.p;if(b==o)o=b.n;g(b.n,b.p);delete k[a];delete h[a];i--}},removeAll:function(){h={};i=0;k={};l=o=null},destroy:function(){k=f=h=null;delete a[b]},info:function(){return y({},f,{size:i})}}}var a={};b.info=function(){var b={};m(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]}; +return b}}function yc(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Cb(b){var a={},c="Directive",d=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,e=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,g="Template must have exactly one root element. was: ";this.directive=function f(d,e){E(d)?(ab(e,"directive"),a.hasOwnProperty(d)||(a[d]=[],b.factory(d+c,["$injector","$exceptionHandler",function(b,c){var e=[];m(a[d],function(a){try{var f=b.invoke(a);if(L(f))f={compile:H(f)};else if(!f.compile&&f.link)f.compile= +H(f.link);f.priority=f.priority||0;f.name=f.name||d;f.require=f.require||f.controller&&f.name;f.restrict=f.restrict||"A";e.push(f)}catch(j){c(j)}});return e}])),a[d].push(e)):m(d,nb(f));return this};this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope",function(b,h,j,k,l,o,r,n){function w(a,b,c){a instanceof z||(a=z(a));m(a,function(b,c){b.nodeType==3&&b.nodeValue.match(/\S+/)&&(a[c]=z(b).wrap("").parent()[0])});var d=x(a, +b,a,c);return function(b,c){ab(b,"scope");var e=c?ta.clone.call(a):a;e.data("$scope",b);q(e,"ng-scope");c&&c(e,b);d&&d(b,e,e);return e}}function q(a,b){try{a.addClass(b)}catch(c){}}function x(a,b,c,d){function e(a,c,d,j){var g,h,k,n,o,l,r,q=[];o=0;for(l=c.length;oB.priority)break;if(W=B.scope)K("isolated scope",A,B,s),M(W)&&(q(s,"ng-isolate-scope"),A=B),q(s,"ng-scope"),x=x||B;G= +B.name;if(W=B.controller)t=t||{},K("'"+G+"' controller",t[G],B,s),t[G]=B;if(W=B.transclude)K("transclusion",C,B,s),C=B,n=B.priority,W=="element"?(V=z(b),s=c.$$element=z(Y.createComment(" "+G+": "+c[G]+" ")),b=s[0],Fa(e,z(V[0]),b),v=w(V,d,n)):(V=z(db(b)).contents(),s.html(""),v=w(V,d));if(W=B.template)if(K("template",P,B,s),P=B,W=Ha(W),B.replace){V=z("
    "+Q(W)+"
    ").contents();b=V[0];if(V.length!=1||b.nodeType!==1)throw new u(g+W);Fa(e,s,b);G={$attr:{}};a=a.concat(X(b,a.splice(D+1,a.length- +(D+1)),G));J(c,G);F=a.length}else s.html(W);if(B.templateUrl)K("template",P,B,s),P=B,k=ba(a.splice(D,a.length-D),k,s,c,e,B.replace,v),F=a.length;else if(B.compile)try{y=B.compile(s,c,v),L(y)?f(null,y):y&&f(y.pre,y.post)}catch(H){j(H,pa(s))}if(B.terminal)k.terminal=!0,n=Math.max(n,B.priority)}k.scope=x&&x.scope;k.transclude=C&&v;return k}function s(d,e,g,h){var k=!1;if(a.hasOwnProperty(e))for(var n,e=b.get(e+c),o=0,l=e.length;on.priority)&&n.restrict.indexOf(g)!=-1)d.push(n), +k=!0}catch(r){j(r)}return k}function J(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;m(a,function(d,e){e.charAt(0)!="$"&&(b[e]&&(d+=(e==="style"?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});m(b,function(b,f){f=="class"?(q(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):f=="style"?e.attr("style",e.attr("style")+";"+b):f.charAt(0)!="$"&&!a.hasOwnProperty(f)&&(a[f]=b,d[f]=c[f])})}function ba(a,b,c,d,e,f,j){var h=[],n,o,r=c[0],q=a.shift(),w=y({},q,{controller:null,templateUrl:null,transclude:null,scope:null}); +c.html("");k.get(q.templateUrl,{cache:l}).success(function(k){var l,q,k=Ha(k);if(f){q=z("
    "+Q(k)+"
    ").contents();l=q[0];if(q.length!=1||l.nodeType!==1)throw new u(g+k);k={$attr:{}};Fa(e,c,l);X(l,a,k);J(d,k)}else l=r,c.html(k);a.unshift(w);n=A(a,c,d,j);for(o=x(c.contents(),j);h.length;){var ca=h.pop(),k=h.pop();q=h.pop();var s=h.pop(),m=l;q!==r&&(m=db(l),Fa(k,z(q),m));n(function(){b(o,s,m,e,ca)},s,m,e,ca)}h=null}).error(function(a,b,c,d){throw u("Failed to load template: "+d.url);});return function(a, +c,d,e,f){h?(h.push(c),h.push(d),h.push(e),h.push(f)):n(function(){b(o,c,d,e,f)},c,d,e,f)}}function P(a,b){return b.priority-a.priority}function K(a,b,c,d){if(b)throw u("Multiple directives ["+b.name+", "+c.name+"] asking for "+a+" on: "+pa(d));}function G(a,b){var c=h(b,!0);c&&a.push({priority:0,compile:H(function(a,b){var d=b.parent(),e=d.data("$binding")||[];e.push(c);q(d.data("$binding",e),"ng-binding");a.$watch(c,function(a){b[0].nodeValue=a})})})}function V(a,b,c,d){var e=h(c,!0);e&&b.push({priority:100, +compile:H(function(a,b,c){b=c.$$observers||(c.$$observers={});d==="class"&&(e=h(c[d],!0));c[d]=p;(b[d]||(b[d]=[])).$$inter=!0;(c.$$observers&&c.$$observers[d].$$scope||a).$watch(e,function(a){c.$set(d,a)})})})}function Fa(a,b,c){var d=b[0],e=d.parentNode,f,g;if(a){f=0;for(g=a.length;f0){var e=K[0],f=e.text;if(f==a||f==b||f==c||f==d||!a&&!b&&!c&&!d)return e}return!1}function f(b,c, +d,f){return(b=i(b,c,d,f))?(a&&!b.json&&e("is not valid json",b),K.shift(),b):!1}function h(a){f(a)||e("is unexpected, expecting ["+a+"]",i())}function j(a,b){return function(c,d){return a(c,d,b)}}function k(a,b,c){return function(d,e){return b(d,e,a,c)}}function l(){for(var a=[];;)if(K.length>0&&!i("}",")",";","]")&&a.push(v()),!f(";"))return a.length==1?a[0]:function(b,c){for(var d,e=0;e","<=",">="))a=k(a,b.fn,q());return a}function x(){for(var a=m(),b;b=f("*","/","%");)a=k(a, +b.fn,m());return a}function m(){var a;return f("+")?A():(a=f("-"))?k(ba,a.fn,m()):(a=f("!"))?j(a.fn,m()):A()}function A(){var a;if(f("("))a=v(),h(")");else if(f("["))a=s();else if(f("{"))a=J();else{var b=f();(a=b.fn)||e("not a primary expression",b)}for(var c;b=f("(","[",".");)b.text==="("?(a=z(a,c),c=null):b.text==="["?(c=a,a=ea(a)):b.text==="."?(c=a,a=t(a)):e("IMPOSSIBLE");return a}function s(){var a=[];if(g().text!="]"){do a.push(G());while(f(","))}h("]");return function(b,c){for(var d=[],e=0;e< +a.length;e++)d.push(a[e](b,c));return d}}function J(){var a=[];if(g().text!="}"){do{var b=f(),b=b.string||b.text;h(":");var c=G();a.push({key:b,value:c})}while(f(","))}h("}");return function(b,c){for(var d={},e=0;e1;d++){var e=a.shift(),g=b[e];g||(g={},b[e]=g);b=g}return b[a.shift()]=c}function gb(b,a,c){if(!a)return b;for(var a=a.split("."),d,e=b,g=a.length,i=0;i7),hasEvent:function(c){if(c=="input"&&aa==9)return!1;if(t(a[c])){var e=b.document.createElement("div");a[c]="on"+c in e}return a[c]},csp:!1}}]}function Tc(){this.$get=H(T)}function Nb(b){var a={},c,d,e;if(!b)return a;m(b.split("\n"),function(b){e=b.indexOf(":");c=D(Q(b.substr(0,e)));d=Q(b.substr(e+1));c&&(a[c]?a[c]+=", "+d:a[c]=d)});return a}function Ob(b){var a=M(b)?b:p;return function(c){a||(a=Nb(b));return c? +a[D(c)]||null:a}}function Pb(b,a,c){if(L(c))return c(b,a);m(c,function(c){b=c(b,a)});return b}function Uc(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*$/,c=/^\)\]\}',?\n/,d=this.defaults={transformResponse:[function(d){E(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=ob(d,!0)));return d}],transformRequest:[function(a){return M(a)&&Sa.apply(a)!=="[object File]"?da(a):a}],headers:{common:{Accept:"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest"},post:{"Content-Type":"application/json;charset=utf-8"}, +put:{"Content-Type":"application/json;charset=utf-8"}}},e=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,c,h,j,k){function l(a){function c(a){var b=y({},a,{data:Pb(a.data,a.headers,f)});return 200<=a.status&&a.status<300?b:j.reject(b)}a.method=la(a.method);var e=a.transformRequest||d.transformRequest,f=a.transformResponse||d.transformResponse,h=d.headers,h=y({"X-XSRF-TOKEN":b.cookies()["XSRF-TOKEN"]},h.common,h[D(a.method)], +a.headers),e=Pb(a.data,Ob(h),e),g;t(a.data)&&delete h["Content-Type"];g=o(a,e,h);g=g.then(c,c);m(w,function(a){g=a(g)});g.success=function(b){g.then(function(c){b(c.data,c.status,c.headers,a)});return g};g.error=function(b){g.then(null,function(c){b(c.data,c.status,c.headers,a)});return g};return g}function o(b,c,d){function e(a,b,c){m&&(200<=a&&a<300?m.put(w,[a,b,Nb(c)]):m.remove(w));f(b,a,c);h.$apply()}function f(a,c,d){c=Math.max(c,0);(200<=c&&c<300?k.resolve:k.reject)({data:a,status:c,headers:Ob(d), +config:b})}function i(){var a=ya(l.pendingRequests,b);a!==-1&&l.pendingRequests.splice(a,1)}var k=j.defer(),o=k.promise,m,p,w=r(b.url,b.params);l.pendingRequests.push(b);o.then(i,i);b.cache&&b.method=="GET"&&(m=M(b.cache)?b.cache:n);if(m)if(p=m.get(w))if(p.then)return p.then(i,i),p;else I(p)?f(p[1],p[0],U(p[2])):f(p,200,{});else m.put(w,o);p||a(b.method,w,c,e,d,b.timeout,b.withCredentials);return o}function r(a,b){if(!b)return a;var c=[];fc(b,function(a,b){a==null||a==p||(M(a)&&(a=da(a)),c.push(encodeURIComponent(b)+ +"="+encodeURIComponent(a)))});return a+(a.indexOf("?")==-1?"?":"&")+c.join("&")}var n=c("$http"),w=[];m(e,function(a){w.push(E(a)?k.get(a):k.invoke(a))});l.pendingRequests=[];(function(a){m(arguments,function(a){l[a]=function(b,c){return l(y(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){m(arguments,function(a){l[a]=function(b,c,d){return l(y(d||{},{method:a,url:b,data:c}))}})})("post","put");l.defaults=d;return l}]}function Vc(){this.$get=["$browser","$window","$document", +function(b,a,c){return Wc(b,Xc,b.defer,a.angular.callbacks,c[0],a.location.protocol.replace(":",""))}]}function Wc(b,a,c,d,e,g){function i(a,b){var c=e.createElement("script"),d=function(){e.body.removeChild(c);b&&b()};c.type="text/javascript";c.src=a;aa?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror=d;e.body.appendChild(c)}return function(e,h,j,k,l,o,r){function n(a,c,d,e){c=(h.match(Gb)||["",g])[1]=="file"?d?200:404:c;a(c==1223?204:c,d,e);b.$$completeOutstandingRequest(C)} +b.$$incOutstandingRequestCount();h=h||b.url();if(D(e)=="jsonp"){var p="_"+(d.counter++).toString(36);d[p]=function(a){d[p].data=a};i(h.replace("JSON_CALLBACK","angular.callbacks."+p),function(){d[p].data?n(k,200,d[p].data):n(k,-2);delete d[p]})}else{var q=new a;q.open(e,h,!0);m(l,function(a,b){a&&q.setRequestHeader(b,a)});var x;q.onreadystatechange=function(){q.readyState==4&&n(k,x||q.status,q.responseText,q.getAllResponseHeaders())};if(r)q.withCredentials=!0;q.send(j||"");o>0&&c(function(){x=-1; +q.abort()},o)}}}function Yc(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","), +DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return b===1?"one":"other"}}}}function Zc(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(b,a,c,d){function e(e,f,h){var j=c.defer(), +k=j.promise,l=v(h)&&!h,f=a.defer(function(){try{j.resolve(e())}catch(a){j.reject(a),d(a)}l||b.$apply()},f),h=function(){delete g[k.$$timeoutId]};k.$$timeoutId=f;g[f]=j;k.then(h,h);return k}var g={};e.cancel=function(b){return b&&b.$$timeoutId in g?(g[b.$$timeoutId].reject("canceled"),a.defer.cancel(b.$$timeoutId)):!1};return e}]}function Qb(b){function a(a,e){return b.factory(a+c,e)}var c="Filter";this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}];a("currency", +Rb);a("date",Sb);a("filter",$c);a("json",ad);a("limitTo",bd);a("lowercase",cd);a("number",Tb);a("orderBy",Ub);a("uppercase",dd)}function $c(){return function(b,a){if(!(b instanceof Array))return b;var c=[];c.check=function(a){for(var b=0;b-1;case "object":for(var c in a)if(c.charAt(0)!=="$"&& +d(a[c],b))return!0;return!1;case "array":for(c=0;ce+1?i="0":(f=i,j=!0)}if(!j){i= +(i.split(Wb)[1]||"").length;t(e)&&(e=Math.min(Math.max(a.minFrac,i),a.maxFrac));var i=Math.pow(10,e),b=Math.round(b*i)/i,b=(""+b).split(Wb),i=b[0],b=b[1]||"",j=0,k=a.lgSize,l=a.gSize;if(i.length>=k+l)for(var j=i.length-k,o=0;o0||e>-c)e+=c;e===0&&c==-12&&(e=12);return jb(e,a,d)}}function La(b,a){return function(c,d){var e=c["get"+b](),g=la(a?"SHORT"+b:b);return d[g][e]}}function Sb(b){function a(a){var b;if(b=a.match(c)){var a=new Date(0),g=0,i=0;b[9]&&(g=F(b[9]+b[10]),i=F(b[9]+b[11]));a.setUTCFullYear(F(b[1]),F(b[2])-1,F(b[3]));a.setUTCHours(F(b[4]||0)-g,F(b[5]||0)-i,F(b[6]|| +0),F(b[7]||0))}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var g="",i=[],f,h,e=e||"mediumDate",e=b.DATETIME_FORMATS[e]||e;E(c)&&(c=ed.test(c)?F(c):a(c));va(c)&&(c=new Date(c));if(!na(c))return c;for(;e;)(h=fd.exec(e))?(i=i.concat(ia.call(h,1)),e=i.pop()):(i.push(e),e=null);m(i,function(a){f=gd[a];g+=f?f(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function ad(){return function(b){return da(b, +!0)}}function bd(){return function(b,a){if(!(b instanceof Array))return b;var a=F(a),c=[],d,e;if(!b||!(b instanceof Array))return c;a>b.length?a=b.length:a<-b.length&&(a=-b.length);a>0?(d=0,e=a):(d=b.length+a,e=b.length);for(;dl?(d.$setValidity("maxlength",!1),p):(d.$setValidity("maxlength",!0),a)};d.$parsers.push(c);d.$formatters.push(c)}}function kb(b,a){b="ngClass"+b;return R(function(c,d,e){function g(b, +d){if(a===!0||c.$index%2===a)d&&b!==d&&i(d),f(b)}function i(a){M(a)&&!I(a)&&(a=Ta(a,function(a,b){if(a)return b}));d.removeClass(I(a)?a.join(" "):a)}function f(a){M(a)&&!I(a)&&(a=Ta(a,function(a,b){if(a)return b}));a&&d.addClass(I(a)?a.join(" "):a)}c.$watch(e[b],g,!0);e.$observe("class",function(){var a=c.$eval(e[b]);g(a,a)});b!=="ngClass"&&c.$watch("$index",function(d,g){var k=d%2;k!==g%2&&(k==a?f(c.$eval(e[b])):i(c.$eval(e[b])))})})}var D=function(b){return E(b)?b.toLowerCase():b},la=function(b){return E(b)? +b.toUpperCase():b},u=T.Error,aa=F((/msie (\d+)/.exec(D(navigator.userAgent))||[])[1]),z,ja,ia=[].slice,Ra=[].push,Sa=Object.prototype.toString,Zb=T.angular||(T.angular={}),sa,Db,Z=["0","0","0"];C.$inject=[];ma.$inject=[];Db=aa<9?function(b){b=b.nodeName?b:b[0];return b.scopeName&&b.scopeName!="HTML"?la(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var kc=/[A-Z]/g,hd={full:"1.0.4",major:1,minor:0,dot:4,codeName:"bewildering-hair"},Aa=O.cache={},za= +O.expando="ng-"+(new Date).getTime(),oc=1,$b=T.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},eb=T.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)},mc=/([\:\-\_]+(.))/g,nc=/^moz([A-Z])/,ta=O.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;this.bind("DOMContentLoaded",a);O(T).bind("load",a)},toString:function(){var b=[];m(this,function(a){b.push(""+a)}); +return"["+b.join(", ")+"]"},eq:function(b){return b>=0?z(this[b]):z(this[this.length+b])},length:0,push:Ra,sort:[].sort,splice:[].splice},Da={};m("multiple,selected,checked,disabled,readOnly,required".split(","),function(b){Da[D(b)]=b});var Ab={};m("input,select,option,textarea,button,form".split(","),function(b){Ab[la(b)]=!0});m({data:vb,inheritedData:Ca,scope:function(b){return Ca(b,"$scope")},controller:yb,injector:function(b){return Ca(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)}, +hasClass:Ba,css:function(b,a,c){a=sb(a);if(v(c))b.style[a]=c;else{var d;aa<=8&&(d=b.currentStyle&&b.currentStyle[a],d===""&&(d="auto"));d=d||b.style[a];aa<=8&&(d=d===""?p:d);return d}},attr:function(b,a,c){var d=D(a);if(Da[d])if(v(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||C).specified?d:p;else if(v(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),b===null?p:b},prop:function(b,a,c){if(v(c))b[a]=c;else return b[a]}, +text:y(aa<9?function(b,a){if(b.nodeType==1){if(t(a))return b.innerText;b.innerText=a}else{if(t(a))return b.nodeValue;b.nodeValue=a}}:function(b,a){if(t(a))return b.textContent;b.textContent=a},{$dv:""}),val:function(b,a){if(t(a))return b.value;b.value=a},html:function(b,a){if(t(a))return b.innerHTML;for(var c=0,d=b.childNodes;c":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)}, +"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Kc={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'},ib={},Xc=T.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw new u("This browser does not support XMLHttpRequest.");};Qb.$inject=["$provide"];Rb.$inject= +["$locale"];Tb.$inject=["$locale"];var Wb=".",gd={yyyy:N("FullYear",4),yy:N("FullYear",2,0,!0),y:N("FullYear",1),MMMM:La("Month"),MMM:La("Month",!0),MM:N("Month",2,1),M:N("Month",1,1),dd:N("Date",2),d:N("Date",1),HH:N("Hours",2),H:N("Hours",1),hh:N("Hours",2,-12),h:N("Hours",1,-12),mm:N("Minutes",2),m:N("Minutes",1),ss:N("Seconds",2),s:N("Seconds",1),EEEE:La("Day"),EEE:La("Day",!0),a:function(a,c){return a.getHours()<12?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=a.getTimezoneOffset();return jb(a/60,2)+ +jb(Math.abs(a%60),2)}},fd=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,ed=/^\d+$/;Sb.$inject=["$locale"];var cd=H(D),dd=H(la);Ub.$inject=["$parse"];var id=H({restrict:"E",compile:function(a,c){c.href||c.$set("href","");return function(a,c){c.bind("click",function(a){c.attr("href")||a.preventDefault()})}}}),lb={};m(Da,function(a,c){var d=fa("ng-"+c);lb[d]=function(){return{priority:100,compile:function(){return function(a,g,i){a.$watch(i[d],function(a){i.$set(c,!!a)})}}}}}); +m(["src","href"],function(a){var c=fa("ng-"+a);lb[c]=function(){return{priority:99,link:function(d,e,g){g.$observe(c,function(c){c&&(g.$set(a,c),aa&&e.prop(a,c))})}}}});var Oa={$addControl:C,$removeControl:C,$setValidity:C,$setDirty:C};Xb.$inject=["$element","$attrs","$scope"];var Ra=function(a){return["$timeout",function(c){var d={name:"form",restrict:"E",controller:Xb,compile:function(){return{pre:function(a,d,i,f){if(!i.action){var h=function(a){a.preventDefault?a.preventDefault():a.returnValue= +!1};$b(d[0],"submit",h);d.bind("$destroy",function(){c(function(){eb(d[0],"submit",h)},0,!1)})}var j=d.parent().controller("form"),k=i.name||i.ngForm;k&&(a[k]=f);j&&d.bind("$destroy",function(){j.$removeControl(f);k&&(a[k]=p);y(f,Oa)})}}}};return a?y(U(d),{restrict:"EAC"}):d}]},jd=Ra(),kd=Ra(!0),ld=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,md=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,nd=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,bc={text:Qa,number:function(a, +c,d,e,g,i){Qa(a,c,d,e,g,i);e.$parsers.push(function(a){var c=S(a);return c||nd.test(a)?(e.$setValidity("number",!0),a===""?null:c?a:parseFloat(a)):(e.$setValidity("number",!1),p)});e.$formatters.push(function(a){return S(a)?"":""+a});if(d.min){var f=parseFloat(d.min),a=function(a){return!S(a)&&ah?(e.$setValidity("max",!1),p):(e.$setValidity("max", +!0),a)};e.$parsers.push(d);e.$formatters.push(d)}e.$formatters.push(function(a){return S(a)||va(a)?(e.$setValidity("number",!0),a):(e.$setValidity("number",!1),p)})},url:function(a,c,d,e,g,i){Qa(a,c,d,e,g,i);a=function(a){return S(a)||ld.test(a)?(e.$setValidity("url",!0),a):(e.$setValidity("url",!1),p)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,g,i){Qa(a,c,d,e,g,i);a=function(a){return S(a)||md.test(a)?(e.$setValidity("email",!0),a):(e.$setValidity("email",!1),p)};e.$formatters.push(a); +e.$parsers.push(a)},radio:function(a,c,d,e){t(d.name)&&c.attr("name",wa());c.bind("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var g=d.ngTrueValue,i=d.ngFalseValue;E(g)||(g=!0);E(i)||(i=!1);c.bind("click",function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$formatters.push(function(a){return a=== +g});e.$parsers.push(function(a){return a?g:i})},hidden:C,button:C,submit:C,reset:C},cc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,g,i){i&&(bc[D(g.type)]||bc.text)(d,e,g,i,c,a)}}}],Na="ng-valid",Ma="ng-invalid",Pa="ng-pristine",Yb="ng-dirty",od=["$scope","$exceptionHandler","$attrs","$element","$parse",function(a,c,d,e,g){function i(a,c){c=c?"-"+$a(c,"-"):"";e.removeClass((a?Ma:Na)+c).addClass((a?Na:Ma)+c)}this.$modelValue=this.$viewValue=Number.NaN; +this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var f=g(d.ngModel),h=f.assign;if(!h)throw u(Eb+d.ngModel+" ("+pa(e)+")");this.$render=C;var j=e.inheritedData("$formController")||Oa,k=0,l=this.$error={};e.addClass(Pa);i(!0);this.$setValidity=function(a,c){if(l[a]!==!c){if(c){if(l[a]&&k--,!k)i(!0),this.$valid=!0,this.$invalid=!1}else i(!1),this.$invalid=!0,this.$valid=!1,k++;l[a]=!c;i(c,a);j.$setValidity(a, +c,this)}};this.$setViewValue=function(d){this.$viewValue=d;if(this.$pristine)this.$dirty=!0,this.$pristine=!1,e.removeClass(Pa).addClass(Yb),j.$setDirty();m(this.$parsers,function(a){d=a(d)});if(this.$modelValue!==d)this.$modelValue=d,h(a,d),m(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};var o=this;a.$watch(function(){var c=f(a);if(o.$modelValue!==c){var d=o.$formatters,e=d.length;for(o.$modelValue=c;e--;)c=d[e](c);if(o.$viewValue!==c)o.$viewValue=c,o.$render()}})}],pd=function(){return{require:["ngModel", +"^?form"],controller:od,link:function(a,c,d,e){var g=e[0],i=e[1]||Oa;i.$addControl(g);c.bind("$destroy",function(){i.$removeControl(g)})}}},qd=H({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),dc=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=!0;var g=function(a){if(d.required&&(S(a)||a===!1))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(g);e.$parsers.unshift(g); +d.$observe("required",function(){g(e.$viewValue)})}}}},rd=function(){return{require:"ngModel",link:function(a,c,d,e){var g=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){var c=[];a&&m(a.split(g),function(a){a&&c.push(Q(a))});return c});e.$formatters.push(function(a){return I(a)?a.join(", "):p})}}},sd=/^(true|false|\d+)$/,td=function(){return{priority:100,compile:function(a,c){return sd.test(c.ngValue)?function(a,c,g){g.$set("value",a.$eval(g.ngValue))}:function(a, +c,g){a.$watch(g.ngValue,function(a){g.$set("value",a,!1)})}}}},ud=R(function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==p?"":a)})}),vd=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],wd=[function(){return function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBindHtmlUnsafe);a.$watch(d.ngBindHtmlUnsafe, +function(a){c.html(a||"")})}}],xd=kb("",!0),yd=kb("Odd",0),zd=kb("Even",1),Ad=R({compile:function(a,c){c.$set("ngCloak",p);a.removeClass("ng-cloak")}}),Bd=[function(){return{scope:!0,controller:"@"}}],Cd=["$sniffer",function(a){return{priority:1E3,compile:function(){a.csp=!0}}}],ec={};m("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave".split(" "),function(a){var c=fa("ng-"+a);ec[c]=["$parse",function(d){return function(e,g,i){var f=d(i[c]);g.bind(D(a),function(a){e.$apply(function(){f(e, +{$event:a})})})}}]});var Dd=R(function(a,c,d){c.bind("submit",function(){a.$apply(d.ngSubmit)})}),Ed=["$http","$templateCache","$anchorScroll","$compile",function(a,c,d,e){return{restrict:"ECA",terminal:!0,compile:function(g,i){var f=i.ngInclude||i.src,h=i.onload||"",j=i.autoscroll;return function(g,i){var o=0,m,n=function(){m&&(m.$destroy(),m=null);i.html("")};g.$watch(f,function(f){var q=++o;f?a.get(f,{cache:c}).success(function(a){q===o&&(m&&m.$destroy(),m=g.$new(),i.html(a),e(i.contents())(m), +v(j)&&(!j||g.$eval(j))&&d(),m.$emit("$includeContentLoaded"),g.$eval(h))}).error(function(){q===o&&n()}):n()})}}}}],Fd=R({compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Gd=R({terminal:!0,priority:1E3}),Hd=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,g,i){var f=i.count,h=g.attr(i.$attr.when),j=i.offset||0,k=e.$eval(h),l={},o=c.startSymbol(),r=c.endSymbol();m(k,function(a,e){l[e]=c(a.replace(d,o+f+"-"+j+r))});e.$watch(function(){var c= +parseFloat(e.$eval(f));return isNaN(c)?"":(k[c]||(c=a.pluralCat(c-j)),l[c](e,g,!0))},function(a){g.text(a)})}}}],Id=R({transclude:"element",priority:1E3,terminal:!0,compile:function(a,c,d){return function(a,c,i){var f=i.ngRepeat,i=f.match(/^\s*(.+)\s+in\s+(.*)\s*$/),h,j,k;if(!i)throw u("Expected ngRepeat in form of '_item_ in _collection_' but got '"+f+"'.");f=i[1];h=i[2];i=f.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!i)throw u("'item' in 'item in collection' should be identifier or (key, value) but got '"+ +f+"'.");j=i[3]||i[1];k=i[2];var l=new fb;a.$watch(function(a){var e,f,i=a.$eval(h),m=c,p=new fb,z,A,s,v,t,u;if(I(i))t=i||[];else{t=[];for(s in i)i.hasOwnProperty(s)&&s.charAt(0)!="$"&&t.push(s);t.sort()}z=t.length;e=0;for(f=t.length;ey;)v.pop().element.remove()}for(;s.length>w;)s.pop()[0].element.remove()}var i;if(!(i=w.match(d)))throw u("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+w+"'."); +var j=c(i[2]||i[1]),k=i[4]||i[6],l=i[5],m=c(i[3]||""),o=c(i[2]?i[1]:k),r=c(i[7]),s=[[{element:f,label:""}]];q&&(a(q)(e),q.removeClass("ng-scope"),q.remove());f.html("");f.bind("change",function(){e.$apply(function(){var a,c=r(e)||[],d={},h,i,j,m,q,t;if(n){i=[];m=0;for(t=s.length;m@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}'); diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/js/bootstrap.min.js b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/js/bootstrap.min.js new file mode 100644 index 00000000000..6eeb15ce3b7 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/js/bootstrap.min.js @@ -0,0 +1,6 @@ +/*! +* Bootstrap.js by @fat & @mdo +* Copyright 2012 Twitter, Inc. +* http://www.apache.org/licenses/LICENSE-2.0.txt +*/ +!function($){"use strict";$(function(){$.support.transition=function(){var transitionEnd=function(){var name,el=document.createElement("bootstrap"),transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(name in transEndEventNames)if(void 0!==el.style[name])return transEndEventNames[name]}();return transitionEnd&&{end:transitionEnd}}()})}(window.jQuery),!function($){"use strict";var dismiss='[data-dismiss="alert"]',Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.prototype.close=function(e){function removeElement(){$parent.trigger("closed").remove()}var $parent,$this=$(this),selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),e&&e.preventDefault(),$parent.length||($parent=$this.hasClass("alert")?$this:$this.parent()),$parent.trigger(e=$.Event("close")),e.isDefaultPrevented()||($parent.removeClass("in"),$.support.transition&&$parent.hasClass("fade")?$parent.on($.support.transition.end,removeElement):removeElement())};var old=$.fn.alert;$.fn.alert=function(option){return this.each(function(){var $this=$(this),data=$this.data("alert");data||$this.data("alert",data=new Alert(this)),"string"==typeof option&&data[option].call($this)})},$.fn.alert.Constructor=Alert,$.fn.alert.noConflict=function(){return $.fn.alert=old,this},$(document).on("click.alert.data-api",dismiss,Alert.prototype.close)}(window.jQuery),!function($){"use strict";var Button=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.button.defaults,options)};Button.prototype.setState=function(state){var d="disabled",$el=this.$element,data=$el.data(),val=$el.is("input")?"val":"html";state+="Text",data.resetText||$el.data("resetText",$el[val]()),$el[val](data[state]||this.options[state]),setTimeout(function(){"loadingText"==state?$el.addClass(d).attr(d,d):$el.removeClass(d).removeAttr(d)},0)},Button.prototype.toggle=function(){var $parent=this.$element.closest('[data-toggle="buttons-radio"]');$parent&&$parent.find(".active").removeClass("active"),this.$element.toggleClass("active")};var old=$.fn.button;$.fn.button=function(option){return this.each(function(){var $this=$(this),data=$this.data("button"),options="object"==typeof option&&option;data||$this.data("button",data=new Button(this,options)),"toggle"==option?data.toggle():option&&data.setState(option)})},$.fn.button.defaults={loadingText:"loading..."},$.fn.button.Constructor=Button,$.fn.button.noConflict=function(){return $.fn.button=old,this},$(document).on("click.button.data-api","[data-toggle^=button]",function(e){var $btn=$(e.target);$btn.hasClass("btn")||($btn=$btn.closest(".btn")),$btn.button("toggle")})}(window.jQuery),!function($){"use strict";var Carousel=function(element,options){this.$element=$(element),this.options=options,"hover"==this.options.pause&&this.$element.on("mouseenter",$.proxy(this.pause,this)).on("mouseleave",$.proxy(this.cycle,this))};Carousel.prototype={cycle:function(e){return e||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval)),this},to:function(pos){var $active=this.$element.find(".item.active"),children=$active.parent().children(),activePos=children.index($active),that=this;if(!(pos>children.length-1||0>pos))return this.sliding?this.$element.one("slid",function(){that.to(pos)}):activePos==pos?this.pause().cycle():this.slide(pos>activePos?"next":"prev",$(children[pos]))},pause:function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&$.support.transition.end&&(this.$element.trigger($.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){return this.sliding?void 0:this.slide("next")},prev:function(){return this.sliding?void 0:this.slide("prev")},slide:function(type,next){var e,$active=this.$element.find(".item.active"),$next=next||$active[type](),isCycling=this.interval,direction="next"==type?"left":"right",fallback="next"==type?"first":"last",that=this;if(this.sliding=!0,isCycling&&this.pause(),$next=$next.length?$next:this.$element.find(".item")[fallback](),e=$.Event("slide",{relatedTarget:$next[0]}),!$next.hasClass("active")){if($.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(e),e.isDefaultPrevented())return;$next.addClass(type),$next[0].offsetWidth,$active.addClass(direction),$next.addClass(direction),this.$element.one($.support.transition.end,function(){$next.removeClass([type,direction].join(" ")).addClass("active"),$active.removeClass(["active",direction].join(" ")),that.sliding=!1,setTimeout(function(){that.$element.trigger("slid")},0)})}else{if(this.$element.trigger(e),e.isDefaultPrevented())return;$active.removeClass("active"),$next.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return isCycling&&this.cycle(),this}}};var old=$.fn.carousel;$.fn.carousel=function(option){return this.each(function(){var $this=$(this),data=$this.data("carousel"),options=$.extend({},$.fn.carousel.defaults,"object"==typeof option&&option),action="string"==typeof option?option:options.slide;data||$this.data("carousel",data=new Carousel(this,options)),"number"==typeof option?data.to(option):action?data[action]():options.interval&&data.cycle()})},$.fn.carousel.defaults={interval:5e3,pause:"hover"},$.fn.carousel.Constructor=Carousel,$.fn.carousel.noConflict=function(){return $.fn.carousel=old,this},$(document).on("click.carousel.data-api","[data-slide]",function(e){var href,$this=$(this),$target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"")),options=$.extend({},$target.data(),$this.data());$target.carousel(options),e.preventDefault()})}(window.jQuery),!function($){"use strict";var Collapse=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.collapse.defaults,options),this.options.parent&&(this.$parent=$(this.options.parent)),this.options.toggle&&this.toggle()};Collapse.prototype={constructor:Collapse,dimension:function(){var hasWidth=this.$element.hasClass("width");return hasWidth?"width":"height"},show:function(){var dimension,scroll,actives,hasData;if(!this.transitioning){if(dimension=this.dimension(),scroll=$.camelCase(["scroll",dimension].join("-")),actives=this.$parent&&this.$parent.find("> .accordion-group > .in"),actives&&actives.length){if(hasData=actives.data("collapse"),hasData&&hasData.transitioning)return;actives.collapse("hide"),hasData||actives.data("collapse",null)}this.$element[dimension](0),this.transition("addClass",$.Event("show"),"shown"),$.support.transition&&this.$element[dimension](this.$element[0][scroll])}},hide:function(){var dimension;this.transitioning||(dimension=this.dimension(),this.reset(this.$element[dimension]()),this.transition("removeClass",$.Event("hide"),"hidden"),this.$element[dimension](0))},reset:function(size){var dimension=this.dimension();return this.$element.removeClass("collapse")[dimension](size||"auto")[0].offsetWidth,this.$element[null!==size?"addClass":"removeClass"]("collapse"),this},transition:function(method,startEvent,completeEvent){var that=this,complete=function(){"show"==startEvent.type&&that.reset(),that.transitioning=0,that.$element.trigger(completeEvent)};this.$element.trigger(startEvent),startEvent.isDefaultPrevented()||(this.transitioning=1,this.$element[method]("in"),$.support.transition&&this.$element.hasClass("collapse")?this.$element.one($.support.transition.end,complete):complete())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var old=$.fn.collapse;$.fn.collapse=function(option){return this.each(function(){var $this=$(this),data=$this.data("collapse"),options="object"==typeof option&&option;data||$this.data("collapse",data=new Collapse(this,options)),"string"==typeof option&&data[option]()})},$.fn.collapse.defaults={toggle:!0},$.fn.collapse.Constructor=Collapse,$.fn.collapse.noConflict=function(){return $.fn.collapse=old,this},$(document).on("click.collapse.data-api","[data-toggle=collapse]",function(e){var href,$this=$(this),target=$this.attr("data-target")||e.preventDefault()||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""),option=$(target).data("collapse")?"toggle":$this.data();$this[$(target).hasClass("in")?"addClass":"removeClass"]("collapsed"),$(target).collapse(option)})}(window.jQuery),!function($){"use strict";function clearMenus(){$(toggle).each(function(){getParent($(this)).removeClass("open")})}function getParent($this){var $parent,selector=$this.attr("data-target");return selector||(selector=$this.attr("href"),selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),$parent.length||($parent=$this.parent()),$parent}var toggle="[data-toggle=dropdown]",Dropdown=function(element){var $el=$(element).on("click.dropdown.data-api",this.toggle);$("html").on("click.dropdown.data-api",function(){$el.parent().removeClass("open")})};Dropdown.prototype={constructor:Dropdown,toggle:function(){var $parent,isActive,$this=$(this);if(!$this.is(".disabled, :disabled"))return $parent=getParent($this),isActive=$parent.hasClass("open"),clearMenus(),isActive||$parent.toggleClass("open"),$this.focus(),!1},keydown:function(e){var $this,$items,$parent,isActive,index;if(/(38|40|27)/.test(e.keyCode)&&($this=$(this),e.preventDefault(),e.stopPropagation(),!$this.is(".disabled, :disabled"))){if($parent=getParent($this),isActive=$parent.hasClass("open"),!isActive||isActive&&27==e.keyCode)return $this.click();$items=$("[role=menu] li:not(.divider):visible a",$parent),$items.length&&(index=$items.index($items.filter(":focus")),38==e.keyCode&&index>0&&index--,40==e.keyCode&&$items.length-1>index&&index++,~index||(index=0),$items.eq(index).focus())}}};var old=$.fn.dropdown;$.fn.dropdown=function(option){return this.each(function(){var $this=$(this),data=$this.data("dropdown");data||$this.data("dropdown",data=new Dropdown(this)),"string"==typeof option&&data[option].call($this)})},$.fn.dropdown.Constructor=Dropdown,$.fn.dropdown.noConflict=function(){return $.fn.dropdown=old,this},$(document).on("click.dropdown.data-api touchstart.dropdown.data-api",clearMenus).on("click.dropdown touchstart.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("touchstart.dropdown.data-api",".dropdown-menu",function(e){e.stopPropagation()}).on("click.dropdown.data-api touchstart.dropdown.data-api",toggle,Dropdown.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api",toggle+", [role=menu]",Dropdown.prototype.keydown)}(window.jQuery),!function($){"use strict";var Modal=function(element,options){this.options=options,this.$element=$(element).delegate('[data-dismiss="modal"]',"click.dismiss.modal",$.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};Modal.prototype={constructor:Modal,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var that=this,e=$.Event("show");this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass("fade");that.$element.parent().length||that.$element.appendTo(document.body),that.$element.show(),transition&&that.$element[0].offsetWidth,that.$element.addClass("in").attr("aria-hidden",!1),that.enforceFocus(),transition?that.$element.one($.support.transition.end,function(){that.$element.focus().trigger("shown")}):that.$element.focus().trigger("shown")}))},hide:function(e){e&&e.preventDefault(),e=$.Event("hide"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),$(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),$.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var that=this;$(document).on("focusin.modal",function(e){that.$element[0]===e.target||that.$element.has(e.target).length||that.$element.focus()})},escape:function(){var that=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(e){27==e.which&&that.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var that=this,timeout=setTimeout(function(){that.$element.off($.support.transition.end),that.hideModal()},500);this.$element.one($.support.transition.end,function(){clearTimeout(timeout),that.hideModal()})},hideModal:function(){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(callback){var animate=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate;this.$backdrop=$('
    a",n=p.getElementsByTagName("*"),r=p.getElementsByTagName("a")[0];if(!n||!r||!n.length)return{};s=i.createElement("select"),o=s.appendChild(i.createElement("option")),u=p.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:r.getAttribute("href")==="/a",opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:u.value==="on",optSelected:o.selected,getSetAttribute:p.className!=="t",enctype:!!i.createElement("form").enctype,html5Clone:i.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:i.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},u.checked=!0,t.noCloneChecked=u.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!o.disabled;try{delete p.test}catch(d){t.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",h=function(){t.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick"),p.detachEvent("onclick",h)),u=i.createElement("input"),u.value="t",u.setAttribute("type","radio"),t.radioValue=u.value==="t",u.setAttribute("checked","checked"),u.setAttribute("name","t"),p.appendChild(u),a=i.createDocumentFragment(),a.appendChild(p.lastChild),t.checkClone=a.cloneNode(!0).cloneNode(!0).lastChild.checked,t.appendChecked=u.checked,a.removeChild(u),a.appendChild(p);if(p.attachEvent)for(l in{submit:!0,change:!0,focusin:!0})f="on"+l,c=f in p,c||(p.setAttribute(f,"return;"),c=typeof p[f]=="function"),t[l+"Bubbles"]=c;return v(function(){var n,r,s,o,u="padding:0;margin:0;border:0;display:block;overflow:hidden;",a=i.getElementsByTagName("body")[0];if(!a)return;n=i.createElement("div"),n.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",a.insertBefore(n,a.firstChild),r=i.createElement("div"),n.appendChild(r),r.innerHTML="
    t
    ",s=r.getElementsByTagName("td"),s[0].style.cssText="padding:0;margin:0;border:0;display:none",c=s[0].offsetHeight===0,s[0].style.display="",s[1].style.display="none",t.reliableHiddenOffsets=c&&s[0].offsetHeight===0,r.innerHTML="",r.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=r.offsetWidth===4,t.doesNotIncludeMarginInBodyOffset=a.offsetTop!==1,e.getComputedStyle&&(t.pixelPosition=(e.getComputedStyle(r,null)||{}).top!=="1%",t.boxSizingReliable=(e.getComputedStyle(r,null)||{width:"4px"}).width==="4px",o=i.createElement("div"),o.style.cssText=r.style.cssText=u,o.style.marginRight=o.style.width="0",r.style.width="1px",r.appendChild(o),t.reliableMarginRight=!parseFloat((e.getComputedStyle(o,null)||{}).marginRight)),typeof r.style.zoom!="undefined"&&(r.innerHTML="",r.style.cssText=u+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=r.offsetWidth===3,r.style.display="block",r.style.overflow="visible",r.innerHTML="
    ",r.firstChild.style.width="5px",t.shrinkWrapBlocks=r.offsetWidth!==3,n.style.zoom=1),a.removeChild(n),n=r=s=o=null}),a.removeChild(p),n=r=s=o=u=a=p=null,t}();var D=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;v.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(v.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?v.cache[e[v.expando]]:e[v.expando],!!e&&!B(e)},data:function(e,n,r,i){if(!v.acceptData(e))return;var s,o,u=v.expando,a=typeof n=="string",f=e.nodeType,l=f?v.cache:e,c=f?e[u]:e[u]&&u;if((!c||!l[c]||!i&&!l[c].data)&&a&&r===t)return;c||(f?e[u]=c=v.deletedIds.pop()||v.guid++:c=u),l[c]||(l[c]={},f||(l[c].toJSON=v.noop));if(typeof n=="object"||typeof n=="function")i?l[c]=v.extend(l[c],n):l[c].data=v.extend(l[c].data,n);return s=l[c],i||(s.data||(s.data={}),s=s.data),r!==t&&(s[v.camelCase(n)]=r),a?(o=s[n],o==null&&(o=s[v.camelCase(n)])):o=s,o},removeData:function(e,t,n){if(!v.acceptData(e))return;var r,i,s,o=e.nodeType,u=o?v.cache:e,a=o?e[v.expando]:v.expando;if(!u[a])return;if(t){r=n?u[a]:u[a].data;if(r){v.isArray(t)||(t in r?t=[t]:(t=v.camelCase(t),t in r?t=[t]:t=t.split(" ")));for(i=0,s=t.length;i1,null,!1))},removeData:function(e){return this.each(function(){v.removeData(this,e)})}}),v.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=v._data(e,t),n&&(!r||v.isArray(n)?r=v._data(e,t,v.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=v.queue(e,t),r=n.length,i=n.shift(),s=v._queueHooks(e,t),o=function(){v.dequeue(e,t)};i==="inprogress"&&(i=n.shift(),r--),i&&(t==="fx"&&n.unshift("inprogress"),delete s.stop,i.call(e,o,s)),!r&&s&&s.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return v._data(e,n)||v._data(e,n,{empty:v.Callbacks("once memory").add(function(){v.removeData(e,t+"queue",!0),v.removeData(e,n,!0)})})}}),v.fn.extend({queue:function(e,n){var r=2;return typeof e!="string"&&(n=e,e="fx",r--),arguments.length1)},removeAttr:function(e){return this.each(function(){v.removeAttr(this,e)})},prop:function(e,t){return v.access(this,v.prop,e,t,arguments.length>1)},removeProp:function(e){return e=v.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,s,o,u;if(v.isFunction(e))return this.each(function(t){v(this).addClass(e.call(this,t,this.className))});if(e&&typeof e=="string"){t=e.split(y);for(n=0,r=this.length;n=0)r=r.replace(" "+n[s]+" "," ");i.className=e?v.trim(r):""}}}return this},toggleClass:function(e,t){var n=typeof e,r=typeof t=="boolean";return v.isFunction(e)?this.each(function(n){v(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if(n==="string"){var i,s=0,o=v(this),u=t,a=e.split(y);while(i=a[s++])u=r?u:!o.hasClass(i),o[u?"addClass":"removeClass"](i)}else if(n==="undefined"||n==="boolean")this.className&&v._data(this,"__className__",this.className),this.className=this.className||e===!1?"":v._data(this,"__className__")||""})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;n=0)return!0;return!1},val:function(e){var n,r,i,s=this[0];if(!arguments.length){if(s)return n=v.valHooks[s.type]||v.valHooks[s.nodeName.toLowerCase()],n&&"get"in n&&(r=n.get(s,"value"))!==t?r:(r=s.value,typeof r=="string"?r.replace(R,""):r==null?"":r);return}return i=v.isFunction(e),this.each(function(r){var s,o=v(this);if(this.nodeType!==1)return;i?s=e.call(this,r,o.val()):s=e,s==null?s="":typeof s=="number"?s+="":v.isArray(s)&&(s=v.map(s,function(e){return e==null?"":e+""})),n=v.valHooks[this.type]||v.valHooks[this.nodeName.toLowerCase()];if(!n||!("set"in n)||n.set(this,s,"value")===t)this.value=s})}}),v.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,s=e.type==="select-one"||i<0,o=s?null:[],u=s?i+1:r.length,a=i<0?u:s?i:0;for(;a=0}),n.length||(e.selectedIndex=-1),n}}},attrFn:{},attr:function(e,n,r,i){var s,o,u,a=e.nodeType;if(!e||a===3||a===8||a===2)return;if(i&&v.isFunction(v.fn[n]))return v(e)[n](r);if(typeof e.getAttribute=="undefined")return v.prop(e,n,r);u=a!==1||!v.isXMLDoc(e),u&&(n=n.toLowerCase(),o=v.attrHooks[n]||(X.test(n)?F:j));if(r!==t){if(r===null){v.removeAttr(e,n);return}return o&&"set"in o&&u&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r)}return o&&"get"in o&&u&&(s=o.get(e,n))!==null?s:(s=e.getAttribute(n),s===null?t:s)},removeAttr:function(e,t){var n,r,i,s,o=0;if(t&&e.nodeType===1){r=t.split(y);for(;o=0}})});var $=/^(?:textarea|input|select)$/i,J=/^([^\.]*|)(?:\.(.+)|)$/,K=/(?:^|\s)hover(\.\S+|)\b/,Q=/^key/,G=/^(?:mouse|contextmenu)|click/,Y=/^(?:focusinfocus|focusoutblur)$/,Z=function(e){return v.event.special.hover?e:e.replace(K,"mouseenter$1 mouseleave$1")};v.event={add:function(e,n,r,i,s){var o,u,a,f,l,c,h,p,d,m,g;if(e.nodeType===3||e.nodeType===8||!n||!r||!(o=v._data(e)))return;r.handler&&(d=r,r=d.handler,s=d.selector),r.guid||(r.guid=v.guid++),a=o.events,a||(o.events=a={}),u=o.handle,u||(o.handle=u=function(e){return typeof v=="undefined"||!!e&&v.event.triggered===e.type?t:v.event.dispatch.apply(u.elem,arguments)},u.elem=e),n=v.trim(Z(n)).split(" ");for(f=0;f=0&&(y=y.slice(0,-1),a=!0),y.indexOf(".")>=0&&(b=y.split("."),y=b.shift(),b.sort());if((!s||v.event.customEvent[y])&&!v.event.global[y])return;n=typeof n=="object"?n[v.expando]?n:new v.Event(y,n):new v.Event(y),n.type=y,n.isTrigger=!0,n.exclusive=a,n.namespace=b.join("."),n.namespace_re=n.namespace?new RegExp("(^|\\.)"+b.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,h=y.indexOf(":")<0?"on"+y:"";if(!s){u=v.cache;for(f in u)u[f].events&&u[f].events[y]&&v.event.trigger(n,r,u[f].handle.elem,!0);return}n.result=t,n.target||(n.target=s),r=r!=null?v.makeArray(r):[],r.unshift(n),p=v.event.special[y]||{};if(p.trigger&&p.trigger.apply(s,r)===!1)return;m=[[s,p.bindType||y]];if(!o&&!p.noBubble&&!v.isWindow(s)){g=p.delegateType||y,l=Y.test(g+y)?s:s.parentNode;for(c=s;l;l=l.parentNode)m.push([l,g]),c=l;c===(s.ownerDocument||i)&&m.push([c.defaultView||c.parentWindow||e,g])}for(f=0;f=0:v.find(h,this,null,[s]).length),u[h]&&f.push(c);f.length&&w.push({elem:s,matches:f})}d.length>m&&w.push({elem:this,matches:d.slice(m)});for(r=0;r0?this.on(t,null,e,n):this.trigger(t)},Q.test(t)&&(v.event.fixHooks[t]=v.event.keyHooks),G.test(t)&&(v.event.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function nt(e,t,n,r){n=n||[],t=t||g;var i,s,a,f,l=t.nodeType;if(!e||typeof e!="string")return n;if(l!==1&&l!==9)return[];a=o(t);if(!a&&!r)if(i=R.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&u(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return S.apply(n,x.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&Z&&t.getElementsByClassName)return S.apply(n,x.call(t.getElementsByClassName(f),0)),n}return vt(e.replace(j,"$1"),t,n,r,a)}function rt(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function it(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function st(e){return N(function(t){return t=+t,N(function(n,r){var i,s=e([],n.length,t),o=s.length;while(o--)n[i=s[o]]&&(n[i]=!(r[i]=n[i]))})})}function ot(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function ut(e,t){var n,r,s,o,u,a,f,l=L[d][e+" "];if(l)return t?0:l.slice(0);u=e,a=[],f=i.preFilter;while(u){if(!n||(r=F.exec(u)))r&&(u=u.slice(r[0].length)||u),a.push(s=[]);n=!1;if(r=I.exec(u))s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=r[0].replace(j," ");for(o in i.filter)(r=J[o].exec(u))&&(!f[o]||(r=f[o](r)))&&(s.push(n=new m(r.shift())),u=u.slice(n.length),n.type=o,n.matches=r);if(!n)break}return t?u.length:u?nt.error(e):L(e,a).slice(0)}function at(e,t,r){var i=t.dir,s=r&&t.dir==="parentNode",o=w++;return t.first?function(t,n,r){while(t=t[i])if(s||t.nodeType===1)return e(t,n,r)}:function(t,r,u){if(!u){var a,f=b+" "+o+" ",l=f+n;while(t=t[i])if(s||t.nodeType===1){if((a=t[d])===l)return t.sizset;if(typeof a=="string"&&a.indexOf(f)===0){if(t.sizset)return t}else{t[d]=l;if(e(t,r,u))return t.sizset=!0,t;t.sizset=!1}}}else while(t=t[i])if(s||t.nodeType===1)if(e(t,r,u))return t}}function ft(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function lt(e,t,n,r,i){var s,o=[],u=0,a=e.length,f=t!=null;for(;u-1&&(s[f]=!(o[f]=c))}}else g=lt(g===o?g.splice(d,g.length):g),i?i(null,o,g,a):S.apply(o,g)})}function ht(e){var t,n,r,s=e.length,o=i.relative[e[0].type],u=o||i.relative[" "],a=o?1:0,f=at(function(e){return e===t},u,!0),l=at(function(e){return T.call(t,e)>-1},u,!0),h=[function(e,n,r){return!o&&(r||n!==c)||((t=n).nodeType?f(e,n,r):l(e,n,r))}];for(;a1&&ft(h),a>1&&e.slice(0,a-1).join("").replace(j,"$1"),n,a0,s=e.length>0,o=function(u,a,f,l,h){var p,d,v,m=[],y=0,w="0",x=u&&[],T=h!=null,N=c,C=u||s&&i.find.TAG("*",h&&a.parentNode||a),k=b+=N==null?1:Math.E;T&&(c=a!==g&&a,n=o.el);for(;(p=C[w])!=null;w++){if(s&&p){for(d=0;v=e[d];d++)if(v(p,a,f)){l.push(p);break}T&&(b=k,n=++o.el)}r&&((p=!v&&p)&&y--,u&&x.push(p))}y+=w;if(r&&w!==y){for(d=0;v=t[d];d++)v(x,m,a,f);if(u){if(y>0)while(w--)!x[w]&&!m[w]&&(m[w]=E.call(l));m=lt(m)}S.apply(l,m),T&&!u&&m.length>0&&y+t.length>1&&nt.uniqueSort(l)}return T&&(b=k,c=N),x};return o.el=0,r?N(o):o}function dt(e,t,n){var r=0,i=t.length;for(;r2&&(f=u[0]).type==="ID"&&t.nodeType===9&&!s&&i.relative[u[1].type]){t=i.find.ID(f.matches[0].replace($,""),t,s)[0];if(!t)return n;e=e.slice(u.shift().length)}for(o=J.POS.test(e)?-1:u.length-1;o>=0;o--){f=u[o];if(i.relative[l=f.type])break;if(c=i.find[l])if(r=c(f.matches[0].replace($,""),z.test(u[0].type)&&t.parentNode||t,s)){u.splice(o,1),e=r.length&&u.join("");if(!e)return S.apply(n,x.call(r,0)),n;break}}}return a(e,h)(r,t,s,n,z.test(e)),n}function mt(){}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=String,g=e.document,y=g.documentElement,b=0,w=0,E=[].pop,S=[].push,x=[].slice,T=[].indexOf||function(e){var t=0,n=this.length;for(;ti.cacheLength&&delete e[t.shift()],e[n+" "]=r},e)},k=C(),L=C(),A=C(),O="[\\x20\\t\\r\\n\\f]",M="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",_=M.replace("w","w#"),D="([*^$|!~]?=)",P="\\["+O+"*("+M+")"+O+"*(?:"+D+O+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+_+")|)|)"+O+"*\\]",H=":("+M+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:"+P+")|[^:]|\\\\.)*|.*))\\)|)",B=":(even|odd|eq|gt|lt|nth|first|last)(?:\\("+O+"*((?:-\\d)?\\d*)"+O+"*\\)|)(?=[^-]|$)",j=new RegExp("^"+O+"+|((?:^|[^\\\\])(?:\\\\.)*)"+O+"+$","g"),F=new RegExp("^"+O+"*,"+O+"*"),I=new RegExp("^"+O+"*([\\x20\\t\\r\\n\\f>+~])"+O+"*"),q=new RegExp(H),R=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,U=/^:not/,z=/[\x20\t\r\n\f]*[+~]/,W=/:not\($/,X=/h\d/i,V=/input|select|textarea|button/i,$=/\\(?!\\)/g,J={ID:new RegExp("^#("+M+")"),CLASS:new RegExp("^\\.("+M+")"),NAME:new RegExp("^\\[name=['\"]?("+M+")['\"]?\\]"),TAG:new RegExp("^("+M.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+H),POS:new RegExp(B,"i"),CHILD:new RegExp("^:(only|nth|first|last)-child(?:\\("+O+"*(even|odd|(([+-]|)(\\d*)n|)"+O+"*(?:([+-]|)"+O+"*(\\d+)|))"+O+"*\\)|)","i"),needsContext:new RegExp("^"+O+"*[>+~]|"+B,"i")},K=function(e){var t=g.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}},Q=K(function(e){return e.appendChild(g.createComment("")),!e.getElementsByTagName("*").length}),G=K(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==p&&e.firstChild.getAttribute("href")==="#"}),Y=K(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return t!=="boolean"&&t!=="string"}),Z=K(function(e){return e.innerHTML="",!e.getElementsByClassName||!e.getElementsByClassName("e").length?!1:(e.lastChild.className="e",e.getElementsByClassName("e").length===2)}),et=K(function(e){e.id=d+0,e.innerHTML="
    ",y.insertBefore(e,y.firstChild);var t=g.getElementsByName&&g.getElementsByName(d).length===2+g.getElementsByName(d+0).length;return r=!g.getElementById(d),y.removeChild(e),t});try{x.call(y.childNodes,0)[0].nodeType}catch(tt){x=function(e){var t,n=[];for(;t=this[e];e++)n.push(t);return n}}nt.matches=function(e,t){return nt(e,null,null,t)},nt.matchesSelector=function(e,t){return nt(t,null,null,[e]).length>0},s=nt.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(i===1||i===9||i===11){if(typeof e.textContent=="string")return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=s(e)}else if(i===3||i===4)return e.nodeValue}else for(;t=e[r];r++)n+=s(t);return n},o=nt.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?t.nodeName!=="HTML":!1},u=nt.contains=y.contains?function(e,t){var n=e.nodeType===9?e.documentElement:e,r=t&&t.parentNode;return e===r||!!(r&&r.nodeType===1&&n.contains&&n.contains(r))}:y.compareDocumentPosition?function(e,t){return t&&!!(e.compareDocumentPosition(t)&16)}:function(e,t){while(t=t.parentNode)if(t===e)return!0;return!1},nt.attr=function(e,t){var n,r=o(e);return r||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):r||Y?e.getAttribute(t):(n=e.getAttributeNode(t),n?typeof e[t]=="boolean"?e[t]?t:null:n.specified?n.value:null:null)},i=nt.selectors={cacheLength:50,createPseudo:N,match:J,attrHandle:G?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},find:{ID:r?function(e,t,n){if(typeof t.getElementById!==p&&!n){var r=t.getElementById(e);return r&&r.parentNode?[r]:[]}}:function(e,n,r){if(typeof n.getElementById!==p&&!r){var i=n.getElementById(e);return i?i.id===e||typeof i.getAttributeNode!==p&&i.getAttributeNode("id").value===e?[i]:t:[]}},TAG:Q?function(e,t){if(typeof t.getElementsByTagName!==p)return t.getElementsByTagName(e)}:function(e,t){var n=t.getElementsByTagName(e);if(e==="*"){var r,i=[],s=0;for(;r=n[s];s++)r.nodeType===1&&i.push(r);return i}return n},NAME:et&&function(e,t){if(typeof t.getElementsByName!==p)return t.getElementsByName(name)},CLASS:Z&&function(e,t,n){if(typeof t.getElementsByClassName!==p&&!n)return t.getElementsByClassName(e)}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace($,""),e[3]=(e[4]||e[5]||"").replace($,""),e[2]==="~="&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),e[1]==="nth"?(e[2]||nt.error(e[0]),e[3]=+(e[3]?e[4]+(e[5]||1):2*(e[2]==="even"||e[2]==="odd")),e[4]=+(e[6]+e[7]||e[2]==="odd")):e[2]&&nt.error(e[0]),e},PSEUDO:function(e){var t,n;if(J.CHILD.test(e[0]))return null;if(e[3])e[2]=e[3];else if(t=e[4])q.test(t)&&(n=ut(t,!0))&&(n=t.indexOf(")",t.length-n)-t.length)&&(t=t.slice(0,n),e[0]=e[0].slice(0,n)),e[2]=t;return e.slice(0,3)}},filter:{ID:r?function(e){return e=e.replace($,""),function(t){return t.getAttribute("id")===e}}:function(e){return e=e.replace($,""),function(t){var n=typeof t.getAttributeNode!==p&&t.getAttributeNode("id");return n&&n.value===e}},TAG:function(e){return e==="*"?function(){return!0}:(e=e.replace($,"").toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[d][e+" "];return t||(t=new RegExp("(^|"+O+")"+e+"("+O+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==p&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r,i){var s=nt.attr(r,e);return s==null?t==="!=":t?(s+="",t==="="?s===n:t==="!="?s!==n:t==="^="?n&&s.indexOf(n)===0:t==="*="?n&&s.indexOf(n)>-1:t==="$="?n&&s.substr(s.length-n.length)===n:t==="~="?(" "+s+" ").indexOf(n)>-1:t==="|="?s===n||s.substr(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r){return e==="nth"?function(e){var t,i,s=e.parentNode;if(n===1&&r===0)return!0;if(s){i=0;for(t=s.firstChild;t;t=t.nextSibling)if(t.nodeType===1){i++;if(e===t)break}}return i-=r,i===n||i%n===0&&i/n>=0}:function(t){var n=t;switch(e){case"only":case"first":while(n=n.previousSibling)if(n.nodeType===1)return!1;if(e==="first")return!0;n=t;case"last":while(n=n.nextSibling)if(n.nodeType===1)return!1;return!0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||nt.error("unsupported pseudo: "+e);return r[d]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?N(function(e,n){var i,s=r(e,t),o=s.length;while(o--)i=T.call(e,s[o]),e[i]=!(n[i]=s[o])}):function(e){return r(e,0,n)}):r}},pseudos:{not:N(function(e){var t=[],n=[],r=a(e.replace(j,"$1"));return r[d]?N(function(e,t,n,i){var s,o=r(e,null,i,[]),u=e.length;while(u--)if(s=o[u])e[u]=!(t[u]=s)}):function(e,i,s){return t[0]=e,r(t,null,s,n),!n.pop()}}),has:N(function(e){return function(t){return nt(e,t).length>0}}),contains:N(function(e){return function(t){return(t.textContent||t.innerText||s(t)).indexOf(e)>-1}}),enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&!!e.checked||t==="option"&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},parent:function(e){return!i.pseudos.empty(e)},empty:function(e){var t;e=e.firstChild;while(e){if(e.nodeName>"@"||(t=e.nodeType)===3||t===4)return!1;e=e.nextSibling}return!0},header:function(e){return X.test(e.nodeName)},text:function(e){var t,n;return e.nodeName.toLowerCase()==="input"&&(t=e.type)==="text"&&((n=e.getAttribute("type"))==null||n.toLowerCase()===t)},radio:rt("radio"),checkbox:rt("checkbox"),file:rt("file"),password:rt("password"),image:rt("image"),submit:it("submit"),reset:it("reset"),button:function(e){var t=e.nodeName.toLowerCase();return t==="input"&&e.type==="button"||t==="button"},input:function(e){return V.test(e.nodeName)},focus:function(e){var t=e.ownerDocument;return e===t.activeElement&&(!t.hasFocus||t.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},active:function(e){return e===e.ownerDocument.activeElement},first:st(function(){return[0]}),last:st(function(e,t){return[t-1]}),eq:st(function(e,t,n){return[n<0?n+t:n]}),even:st(function(e,t){for(var n=0;n=0;)e.push(r);return e}),gt:st(function(e,t,n){for(var r=n<0?n+t:n;++r",e.querySelectorAll("[selected]").length||i.push("\\["+O+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||i.push(":checked")}),K(function(e){e.innerHTML="

    ",e.querySelectorAll("[test^='']").length&&i.push("[*^$]="+O+"*(?:\"\"|'')"),e.innerHTML="",e.querySelectorAll(":enabled").length||i.push(":enabled",":disabled")}),i=new RegExp(i.join("|")),vt=function(e,r,s,o,u){if(!o&&!u&&!i.test(e)){var a,f,l=!0,c=d,h=r,p=r.nodeType===9&&e;if(r.nodeType===1&&r.nodeName.toLowerCase()!=="object"){a=ut(e),(l=r.getAttribute("id"))?c=l.replace(n,"\\$&"):r.setAttribute("id",c),c="[id='"+c+"'] ",f=a.length;while(f--)a[f]=c+a[f].join("");h=z.test(e)&&r.parentNode||r,p=a.join(",")}if(p)try{return S.apply(s,x.call(h.querySelectorAll(p),0)),s}catch(v){}finally{l||r.removeAttribute("id")}}return t(e,r,s,o,u)},u&&(K(function(t){e=u.call(t,"div");try{u.call(t,"[test!='']:sizzle"),s.push("!=",H)}catch(n){}}),s=new RegExp(s.join("|")),nt.matchesSelector=function(t,n){n=n.replace(r,"='$1']");if(!o(t)&&!s.test(n)&&!i.test(n))try{var a=u.call(t,n);if(a||e||t.document&&t.document.nodeType!==11)return a}catch(f){}return nt(n,null,null,[t]).length>0})}(),i.pseudos.nth=i.pseudos.eq,i.filters=mt.prototype=i.pseudos,i.setFilters=new mt,nt.attr=v.attr,v.find=nt,v.expr=nt.selectors,v.expr[":"]=v.expr.pseudos,v.unique=nt.uniqueSort,v.text=nt.getText,v.isXMLDoc=nt.isXML,v.contains=nt.contains}(e);var nt=/Until$/,rt=/^(?:parents|prev(?:Until|All))/,it=/^.[^:#\[\.,]*$/,st=v.expr.match.needsContext,ot={children:!0,contents:!0,next:!0,prev:!0};v.fn.extend({find:function(e){var t,n,r,i,s,o,u=this;if(typeof e!="string")return v(e).filter(function(){for(t=0,n=u.length;t0)for(i=r;i=0:v.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,s=[],o=st.test(e)||typeof e!="string"?v(e,t||this.context):0;for(;r-1:v.find.matchesSelector(n,e)){s.push(n);break}n=n.parentNode}}return s=s.length>1?v.unique(s):s,this.pushStack(s,"closest",e)},index:function(e){return e?typeof e=="string"?v.inArray(this[0],v(e)):v.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(e,t){var n=typeof e=="string"?v(e,t):v.makeArray(e&&e.nodeType?[e]:e),r=v.merge(this.get(),n);return this.pushStack(ut(n[0])||ut(r[0])?r:v.unique(r))},addBack:function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))}}),v.fn.andSelf=v.fn.addBack,v.each({parent:function(e){var t=e.parentNode;return t&&t.nodeType!==11?t:null},parents:function(e){return v.dir(e,"parentNode")},parentsUntil:function(e,t,n){return v.dir(e,"parentNode",n)},next:function(e){return at(e,"nextSibling")},prev:function(e){return at(e,"previousSibling")},nextAll:function(e){return v.dir(e,"nextSibling")},prevAll:function(e){return v.dir(e,"previousSibling")},nextUntil:function(e,t,n){return v.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return v.dir(e,"previousSibling",n)},siblings:function(e){return v.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return v.sibling(e.firstChild)},contents:function(e){return v.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:v.merge([],e.childNodes)}},function(e,t){v.fn[e]=function(n,r){var i=v.map(this,t,n);return nt.test(e)||(r=n),r&&typeof r=="string"&&(i=v.filter(r,i)),i=this.length>1&&!ot[e]?v.unique(i):i,this.length>1&&rt.test(e)&&(i=i.reverse()),this.pushStack(i,e,l.call(arguments).join(","))}}),v.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),t.length===1?v.find.matchesSelector(t[0],e)?[t[0]]:[]:v.find.matches(e,t)},dir:function(e,n,r){var i=[],s=e[n];while(s&&s.nodeType!==9&&(r===t||s.nodeType!==1||!v(s).is(r)))s.nodeType===1&&i.push(s),s=s[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)e.nodeType===1&&e!==t&&n.push(e);return n}});var ct="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",ht=/ jQuery\d+="(?:null|\d+)"/g,pt=/^\s+/,dt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,vt=/<([\w:]+)/,mt=/]","i"),Et=/^(?:checkbox|radio)$/,St=/checked\s*(?:[^=]|=\s*.checked.)/i,xt=/\/(java|ecma)script/i,Tt=/^\s*\s*$/g,Nt={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},Ct=lt(i),kt=Ct.appendChild(i.createElement("div"));Nt.optgroup=Nt.option,Nt.tbody=Nt.tfoot=Nt.colgroup=Nt.caption=Nt.thead,Nt.th=Nt.td,v.support.htmlSerialize||(Nt._default=[1,"X
    ","
    "]),v.fn.extend({text:function(e){return v.access(this,function(e){return e===t?v.text(this):this.empty().append((this[0]&&this[0].ownerDocument||i).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(v.isFunction(e))return this.each(function(t){v(this).wrapAll(e.call(this,t))});if(this[0]){var t=v(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&e.firstChild.nodeType===1)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return v.isFunction(e)?this.each(function(t){v(this).wrapInner(e.call(this,t))}):this.each(function(){var t=v(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=v.isFunction(e);return this.each(function(n){v(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){v.nodeName(this,"body")||v(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(e,this.firstChild)})},before:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(e,this),"before",this.selector)}},after:function(){if(!ut(this[0]))return this.domManip(arguments,!1,function(e){this.parentNode.insertBefore(e,this.nextSibling)});if(arguments.length){var e=v.clean(arguments);return this.pushStack(v.merge(this,e),"after",this.selector)}},remove:function(e,t){var n,r=0;for(;(n=this[r])!=null;r++)if(!e||v.filter(e,[n]).length)!t&&n.nodeType===1&&(v.cleanData(n.getElementsByTagName("*")),v.cleanData([n])),n.parentNode&&n.parentNode.removeChild(n);return this},empty:function(){var e,t=0;for(;(e=this[t])!=null;t++){e.nodeType===1&&v.cleanData(e.getElementsByTagName("*"));while(e.firstChild)e.removeChild(e.firstChild)}return this},clone:function(e,t){return e=e==null?!1:e,t=t==null?e:t,this.map(function(){return v.clone(this,e,t)})},html:function(e){return v.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return n.nodeType===1?n.innerHTML.replace(ht,""):t;if(typeof e=="string"&&!yt.test(e)&&(v.support.htmlSerialize||!wt.test(e))&&(v.support.leadingWhitespace||!pt.test(e))&&!Nt[(vt.exec(e)||["",""])[1].toLowerCase()]){e=e.replace(dt,"<$1>");try{for(;r1&&typeof f=="string"&&St.test(f))return this.each(function(){v(this).domManip(e,n,r)});if(v.isFunction(f))return this.each(function(i){var s=v(this);e[0]=f.call(this,i,n?s.html():t),s.domManip(e,n,r)});if(this[0]){i=v.buildFragment(e,this,l),o=i.fragment,s=o.firstChild,o.childNodes.length===1&&(o=s);if(s){n=n&&v.nodeName(s,"tr");for(u=i.cacheable||c-1;a0?this.clone(!0):this).get(),v(o[i])[t](r),s=s.concat(r);return this.pushStack(s,e,o.selector)}}),v.extend({clone:function(e,t,n){var r,i,s,o;v.support.html5Clone||v.isXMLDoc(e)||!wt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(kt.innerHTML=e.outerHTML,kt.removeChild(o=kt.firstChild));if((!v.support.noCloneEvent||!v.support.noCloneChecked)&&(e.nodeType===1||e.nodeType===11)&&!v.isXMLDoc(e)){Ot(e,o),r=Mt(e),i=Mt(o);for(s=0;r[s];++s)i[s]&&Ot(r[s],i[s])}if(t){At(e,o);if(n){r=Mt(e),i=Mt(o);for(s=0;r[s];++s)At(r[s],i[s])}}return r=i=null,o},clean:function(e,t,n,r){var s,o,u,a,f,l,c,h,p,d,m,g,y=t===i&&Ct,b=[];if(!t||typeof t.createDocumentFragment=="undefined")t=i;for(s=0;(u=e[s])!=null;s++){typeof u=="number"&&(u+="");if(!u)continue;if(typeof u=="string")if(!gt.test(u))u=t.createTextNode(u);else{y=y||lt(t),c=t.createElement("div"),y.appendChild(c),u=u.replace(dt,"<$1>"),a=(vt.exec(u)||["",""])[1].toLowerCase(),f=Nt[a]||Nt._default,l=f[0],c.innerHTML=f[1]+u+f[2];while(l--)c=c.lastChild;if(!v.support.tbody){h=mt.test(u),p=a==="table"&&!h?c.firstChild&&c.firstChild.childNodes:f[1]===""&&!h?c.childNodes:[];for(o=p.length-1;o>=0;--o)v.nodeName(p[o],"tbody")&&!p[o].childNodes.length&&p[o].parentNode.removeChild(p[o])}!v.support.leadingWhitespace&&pt.test(u)&&c.insertBefore(t.createTextNode(pt.exec(u)[0]),c.firstChild),u=c.childNodes,c.parentNode.removeChild(c)}u.nodeType?b.push(u):v.merge(b,u)}c&&(u=c=y=null);if(!v.support.appendChecked)for(s=0;(u=b[s])!=null;s++)v.nodeName(u,"input")?_t(u):typeof u.getElementsByTagName!="undefined"&&v.grep(u.getElementsByTagName("input"),_t);if(n){m=function(e){if(!e.type||xt.test(e.type))return r?r.push(e.parentNode?e.parentNode.removeChild(e):e):n.appendChild(e)};for(s=0;(u=b[s])!=null;s++)if(!v.nodeName(u,"script")||!m(u))n.appendChild(u),typeof u.getElementsByTagName!="undefined"&&(g=v.grep(v.merge([],u.getElementsByTagName("script")),m),b.splice.apply(b,[s+1,0].concat(g)),s+=g.length)}return b},cleanData:function(e,t){var n,r,i,s,o=0,u=v.expando,a=v.cache,f=v.support.deleteExpando,l=v.event.special;for(;(i=e[o])!=null;o++)if(t||v.acceptData(i)){r=i[u],n=r&&a[r];if(n){if(n.events)for(s in n.events)l[s]?v.event.remove(i,s):v.removeEvent(i,s,n.handle);a[r]&&(delete a[r],f?delete i[u]:i.removeAttribute?i.removeAttribute(u):i[u]=null,v.deletedIds.push(r))}}}}),function(){var e,t;v.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||e.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e=v.uaMatch(o.userAgent),t={},e.browser&&(t[e.browser]=!0,t.version=e.version),t.chrome?t.webkit=!0:t.webkit&&(t.safari=!0),v.browser=t,v.sub=function(){function e(t,n){return new e.fn.init(t,n)}v.extend(!0,e,this),e.superclass=this,e.fn=e.prototype=this(),e.fn.constructor=e,e.sub=this.sub,e.fn.init=function(r,i){return i&&i instanceof v&&!(i instanceof e)&&(i=e(i)),v.fn.init.call(this,r,i,t)},e.fn.init.prototype=e.fn;var t=e(i);return e}}();var Dt,Pt,Ht,Bt=/alpha\([^)]*\)/i,jt=/opacity=([^)]*)/,Ft=/^(top|right|bottom|left)$/,It=/^(none|table(?!-c[ea]).+)/,qt=/^margin/,Rt=new RegExp("^("+m+")(.*)$","i"),Ut=new RegExp("^("+m+")(?!px)[a-z%]+$","i"),zt=new RegExp("^([-+])=("+m+")","i"),Wt={BODY:"block"},Xt={position:"absolute",visibility:"hidden",display:"block"},Vt={letterSpacing:0,fontWeight:400},$t=["Top","Right","Bottom","Left"],Jt=["Webkit","O","Moz","ms"],Kt=v.fn.toggle;v.fn.extend({css:function(e,n){return v.access(this,function(e,n,r){return r!==t?v.style(e,n,r):v.css(e,n)},e,n,arguments.length>1)},show:function(){return Yt(this,!0)},hide:function(){return Yt(this)},toggle:function(e,t){var n=typeof e=="boolean";return v.isFunction(e)&&v.isFunction(t)?Kt.apply(this,arguments):this.each(function(){(n?e:Gt(this))?v(this).show():v(this).hide()})}}),v.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Dt(e,"opacity");return n===""?"1":n}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":v.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(!e||e.nodeType===3||e.nodeType===8||!e.style)return;var s,o,u,a=v.camelCase(n),f=e.style;n=v.cssProps[a]||(v.cssProps[a]=Qt(f,a)),u=v.cssHooks[n]||v.cssHooks[a];if(r===t)return u&&"get"in u&&(s=u.get(e,!1,i))!==t?s:f[n];o=typeof r,o==="string"&&(s=zt.exec(r))&&(r=(s[1]+1)*s[2]+parseFloat(v.css(e,n)),o="number");if(r==null||o==="number"&&isNaN(r))return;o==="number"&&!v.cssNumber[a]&&(r+="px");if(!u||!("set"in u)||(r=u.set(e,r,i))!==t)try{f[n]=r}catch(l){}},css:function(e,n,r,i){var s,o,u,a=v.camelCase(n);return n=v.cssProps[a]||(v.cssProps[a]=Qt(e.style,a)),u=v.cssHooks[n]||v.cssHooks[a],u&&"get"in u&&(s=u.get(e,!0,i)),s===t&&(s=Dt(e,n)),s==="normal"&&n in Vt&&(s=Vt[n]),r||i!==t?(o=parseFloat(s),r||v.isNumeric(o)?o||0:s):s},swap:function(e,t,n){var r,i,s={};for(i in t)s[i]=e.style[i],e.style[i]=t[i];r=n.call(e);for(i in t)e.style[i]=s[i];return r}}),e.getComputedStyle?Dt=function(t,n){var r,i,s,o,u=e.getComputedStyle(t,null),a=t.style;return u&&(r=u.getPropertyValue(n)||u[n],r===""&&!v.contains(t.ownerDocument,t)&&(r=v.style(t,n)),Ut.test(r)&&qt.test(n)&&(i=a.width,s=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=r,r=u.width,a.width=i,a.minWidth=s,a.maxWidth=o)),r}:i.documentElement.currentStyle&&(Dt=function(e,t){var n,r,i=e.currentStyle&&e.currentStyle[t],s=e.style;return i==null&&s&&s[t]&&(i=s[t]),Ut.test(i)&&!Ft.test(t)&&(n=s.left,r=e.runtimeStyle&&e.runtimeStyle.left,r&&(e.runtimeStyle.left=e.currentStyle.left),s.left=t==="fontSize"?"1em":i,i=s.pixelLeft+"px",s.left=n,r&&(e.runtimeStyle.left=r)),i===""?"auto":i}),v.each(["height","width"],function(e,t){v.cssHooks[t]={get:function(e,n,r){if(n)return e.offsetWidth===0&&It.test(Dt(e,"display"))?v.swap(e,Xt,function(){return tn(e,t,r)}):tn(e,t,r)},set:function(e,n,r){return Zt(e,n,r?en(e,t,r,v.support.boxSizing&&v.css(e,"boxSizing")==="border-box"):0)}}}),v.support.opacity||(v.cssHooks.opacity={get:function(e,t){return jt.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=v.isNumeric(t)?"alpha(opacity="+t*100+")":"",s=r&&r.filter||n.filter||"";n.zoom=1;if(t>=1&&v.trim(s.replace(Bt,""))===""&&n.removeAttribute){n.removeAttribute("filter");if(r&&!r.filter)return}n.filter=Bt.test(s)?s.replace(Bt,i):s+" "+i}}),v(function(){v.support.reliableMarginRight||(v.cssHooks.marginRight={get:function(e,t){return v.swap(e,{display:"inline-block"},function(){if(t)return Dt(e,"marginRight")})}}),!v.support.pixelPosition&&v.fn.position&&v.each(["top","left"],function(e,t){v.cssHooks[t]={get:function(e,n){if(n){var r=Dt(e,t);return Ut.test(r)?v(e).position()[t]+"px":r}}}})}),v.expr&&v.expr.filters&&(v.expr.filters.hidden=function(e){return e.offsetWidth===0&&e.offsetHeight===0||!v.support.reliableHiddenOffsets&&(e.style&&e.style.display||Dt(e,"display"))==="none"},v.expr.filters.visible=function(e){return!v.expr.filters.hidden(e)}),v.each({margin:"",padding:"",border:"Width"},function(e,t){v.cssHooks[e+t]={expand:function(n){var r,i=typeof n=="string"?n.split(" "):[n],s={};for(r=0;r<4;r++)s[e+$t[r]+t]=i[r]||i[r-2]||i[0];return s}},qt.test(e)||(v.cssHooks[e+t].set=Zt)});var rn=/%20/g,sn=/\[\]$/,on=/\r?\n/g,un=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,an=/^(?:select|textarea)/i;v.fn.extend({serialize:function(){return v.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?v.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||an.test(this.nodeName)||un.test(this.type))}).map(function(e,t){var n=v(this).val();return n==null?null:v.isArray(n)?v.map(n,function(e,n){return{name:t.name,value:e.replace(on,"\r\n")}}):{name:t.name,value:n.replace(on,"\r\n")}}).get()}}),v.param=function(e,n){var r,i=[],s=function(e,t){t=v.isFunction(t)?t():t==null?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};n===t&&(n=v.ajaxSettings&&v.ajaxSettings.traditional);if(v.isArray(e)||e.jquery&&!v.isPlainObject(e))v.each(e,function(){s(this.name,this.value)});else for(r in e)fn(r,e[r],n,s);return i.join("&").replace(rn,"+")};var ln,cn,hn=/#.*$/,pn=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,dn=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{cn=s.href}catch(Nn){cn=i.createElement("a"),cn.href="",cn=cn.href}ln=wn.exec(cn.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("
    ").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:cn,isLocal:dn.test(ln[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=(n||T)+"",l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,ln[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]===ln[1]&&a[2]===ln[2]&&(a[3]||(a[1]==="http:"?80:443))==(ln[3]||(ln[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1||n.contentType)&&x.setRequestHeader("Content-Type",c.contentType),c.ifModified&&(r=r||c.url,v.lastModified[r]&&x.setRequestHeader("If-Modified-Since",v.lastModified[r]),v.etag[r]&&x.setRequestHeader("If-None-Match",v.etag[r])),x.setRequestHeader("Accept",c.dataTypes[0]&&c.accepts[c.dataTypes[0]]?c.accepts[c.dataTypes[0]]+(c.dataTypes[0]!=="*"?", "+Tn+"; q=0.01":""):c.accepts["*"]);for(l in c.headers)x.setRequestHeader(l,c.headers[l]);if(!c.beforeSend||c.beforeSend.call(h,x,c)!==!1&&E!==2){S="abort";for(l in{success:1,error:1,complete:1})x[l](c[l]);o=kn(xn,c,n,x);if(!o)T(-1,"No Transport");else{x.readyState=1,f&&p.trigger("ajaxSend",[x,c]),c.async&&c.timeout>0&&(u=setTimeout(function(){x.abort("timeout")},c.timeout));try{E=1,o.send(b,T)}catch(k){if(!(E<2))throw k;T(-1,k)}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var Mn=[],_n=/\?/,Dn=/(=)\?(?=&|$)|\?\?/,Pn=v.now();v.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Mn.pop()||v.expando+"_"+Pn++;return this[e]=!0,e}}),v.ajaxPrefilter("json jsonp",function(n,r,i){var s,o,u,a=n.data,f=n.url,l=n.jsonp!==!1,c=l&&Dn.test(f),h=l&&!c&&typeof a=="string"&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Dn.test(a);if(n.dataTypes[0]==="jsonp"||c||h)return s=n.jsonpCallback=v.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,o=e[s],c?n.url=f.replace(Dn,"$1"+s):h?n.data=a.replace(Dn,"$1"+s):l&&(n.url+=(_n.test(f)?"&":"?")+n.jsonp+"="+s),n.converters["script json"]=function(){return u||v.error(s+" was not called"),u[0]},n.dataTypes[0]="json",e[s]=function(){u=arguments},i.always(function(){e[s]=o,n[s]&&(n.jsonpCallback=r.jsonpCallback,Mn.push(s)),u&&v.isFunction(o)&&o(u[0]),u=o=t}),"script"}),v.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(e){return v.globalEval(e),e}}}),v.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),v.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=i.head||i.getElementsByTagName("head")[0]||i.documentElement;return{send:function(s,o){n=i.createElement("script"),n.async="async",e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,i){if(i||!n.readyState||/loaded|complete/.test(n.readyState))n.onload=n.onreadystatechange=null,r&&n.parentNode&&r.removeChild(n),n=t,i||o(200,"success")},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(0,1)}}}});var Hn,Bn=e.ActiveXObject?function(){for(var e in Hn)Hn[e](0,1)}:!1,jn=0;v.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&Fn()||In()}:Fn,function(e){v.extend(v.support,{ajax:!!e,cors:!!e&&"withCredentials"in e})}(v.ajaxSettings.xhr()),v.support.ajax&&v.ajaxTransport(function(n){if(!n.crossDomain||v.support.cors){var r;return{send:function(i,s){var o,u,a=n.xhr();n.username?a.open(n.type,n.url,n.async,n.username,n.password):a.open(n.type,n.url,n.async);if(n.xhrFields)for(u in n.xhrFields)a[u]=n.xhrFields[u];n.mimeType&&a.overrideMimeType&&a.overrideMimeType(n.mimeType),!n.crossDomain&&!i["X-Requested-With"]&&(i["X-Requested-With"]="XMLHttpRequest");try{for(u in i)a.setRequestHeader(u,i[u])}catch(f){}a.send(n.hasContent&&n.data||null),r=function(e,i){var u,f,l,c,h;try{if(r&&(i||a.readyState===4)){r=t,o&&(a.onreadystatechange=v.noop,Bn&&delete Hn[o]);if(i)a.readyState!==4&&a.abort();else{u=a.status,l=a.getAllResponseHeaders(),c={},h=a.responseXML,h&&h.documentElement&&(c.xml=h);try{c.text=a.responseText}catch(p){}try{f=a.statusText}catch(p){f=""}!u&&n.isLocal&&!n.crossDomain?u=c.text?200:404:u===1223&&(u=204)}}}catch(d){i||s(-1,d)}c&&s(u,f,c,l)},n.async?a.readyState===4?setTimeout(r,0):(o=++jn,Bn&&(Hn||(Hn={},v(e).unload(Bn)),Hn[o]=r),a.onreadystatechange=r):r()},abort:function(){r&&r(0,1)}}}});var qn,Rn,Un=/^(?:toggle|show|hide)$/,zn=new RegExp("^(?:([-+])=|)("+m+")([a-z%]*)$","i"),Wn=/queueHooks$/,Xn=[Gn],Vn={"*":[function(e,t){var n,r,i=this.createTween(e,t),s=zn.exec(t),o=i.cur(),u=+o||0,a=1,f=20;if(s){n=+s[2],r=s[3]||(v.cssNumber[e]?"":"px");if(r!=="px"&&u){u=v.css(i.elem,e,!0)||n||1;do a=a||".5",u/=a,v.style(i.elem,e,u+r);while(a!==(a=i.cur()/o)&&a!==1&&--f)}i.unit=r,i.start=u,i.end=s[1]?u+(s[1]+1)*n:n}return i}]};v.Animation=v.extend(Kn,{tweener:function(e,t){v.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;r-1,f={},l={},c,h;a?(l=i.position(),c=l.top,h=l.left):(c=parseFloat(o)||0,h=parseFloat(u)||0),v.isFunction(t)&&(t=t.call(e,n,s)),t.top!=null&&(f.top=t.top-s.top+c),t.left!=null&&(f.left=t.left-s.left+h),"using"in t?t.using.call(e,f):i.css(f)}},v.fn.extend({position:function(){if(!this[0])return;var e=this[0],t=this.offsetParent(),n=this.offset(),r=er.test(t[0].nodeName)?{top:0,left:0}:t.offset();return n.top-=parseFloat(v.css(e,"marginTop"))||0,n.left-=parseFloat(v.css(e,"marginLeft"))||0,r.top+=parseFloat(v.css(t[0],"borderTopWidth"))||0,r.left+=parseFloat(v.css(t[0],"borderLeftWidth"))||0,{top:n.top-r.top,left:n.left-r.left}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||i.body;while(e&&!er.test(e.nodeName)&&v.css(e,"position")==="static")e=e.offsetParent;return e||i.body})}}),v.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);v.fn[e]=function(i){return v.access(this,function(e,i,s){var o=tr(e);if(s===t)return o?n in o?o[n]:o.document.documentElement[i]:e[i];o?o.scrollTo(r?v(o).scrollLeft():s,r?s:v(o).scrollTop()):e[i]=s},e,i,arguments.length,null)}}),v.each({Height:"height",Width:"width"},function(e,n){v.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){v.fn[i]=function(i,s){var o=arguments.length&&(r||typeof i!="boolean"),u=r||(i===!0||s===!0?"margin":"border");return v.access(this,function(n,r,i){var s;return v.isWindow(n)?n.document.documentElement["client"+e]:n.nodeType===9?(s=n.documentElement,Math.max(n.body["scroll"+e],s["scroll"+e],n.body["offset"+e],s["offset"+e],s["client"+e])):i===t?v.css(n,r,i,u):v.style(n,r,i,u)},n,o?i:t,o,null)}})}),e.jQuery=e.$=v,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return v})})(window); \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/js/jquery.signalR-1.0.0.js b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/js/jquery.signalR-1.0.0.js new file mode 100644 index 00000000000..f9d7e60a162 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/js/jquery.signalR-1.0.0.js @@ -0,0 +1,1995 @@ +/* jquery.signalR.core.js */ +/*global window:false */ +/*! + * ASP.NET SignalR JavaScript Library v1.0.0 + * http://signalr.net/ + * + * Copyright Microsoft Open Technologies, Inc. All rights reserved. + * Licensed under the Apache 2.0 + * https://github.com/SignalR/SignalR/blob/master/LICENSE.md + * + */ + +/// +(function ($, window) { + "use strict"; + + if (typeof ($) !== "function") { + // no jQuery! + throw new Error("SignalR: jQuery not found. Please ensure jQuery is referenced before the SignalR.js file."); + } + + if (!window.JSON) { + // no JSON! + throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8."); + } + + var signalR, + _connection, + _pageLoaded = (window.document.readyState === "complete"), + _pageWindow = $(window), + + events = { + onStart: "onStart", + onStarting: "onStarting", + onReceived: "onReceived", + onError: "onError", + onConnectionSlow: "onConnectionSlow", + onReconnecting: "onReconnecting", + onReconnect: "onReconnect", + onStateChanged: "onStateChanged", + onDisconnect: "onDisconnect" + }, + + log = function (msg, logging) { + if (logging === false) { + return; + } + var m; + if (typeof (window.console) === "undefined") { + return; + } + m = "[" + new Date().toTimeString() + "] SignalR: " + msg; + if (window.console.debug) { + window.console.debug(m); + } else if (window.console.log) { + window.console.log(m); + } + }, + + changeState = function (connection, expectedState, newState) { + if (expectedState === connection.state) { + connection.state = newState; + + $(connection).triggerHandler(events.onStateChanged, [{ oldState: expectedState, newState: newState }]); + return true; + } + + return false; + }, + + isDisconnecting = function (connection) { + return connection.state === signalR.connectionState.disconnected; + }, + + configureStopReconnectingTimeout = function (connection) { + var stopReconnectingTimeout, + onReconnectTimeout; + + // Check if this connection has already been configured to stop reconnecting after a specified timeout. + // Without this check if a connection is stopped then started events will be bound multiple times. + if (!connection._.configuredStopReconnectingTimeout) { + onReconnectTimeout = function (connection) { + connection.log("Couldn't reconnect within the configured timeout (" + connection.disconnectTimeout + "ms), disconnecting."); + connection.stop(/* async */ false, /* notifyServer */ false); + }; + + connection.reconnecting(function () { + var connection = this; + stopReconnectingTimeout = window.setTimeout(function () { onReconnectTimeout(connection); }, connection.disconnectTimeout); + }); + + connection.stateChanged(function (data) { + if (data.oldState === signalR.connectionState.reconnecting) { + // Clear the pending reconnect timeout check + window.clearTimeout(stopReconnectingTimeout); + } + }); + + connection._.configuredStopReconnectingTimeout = true; + } + }; + + signalR = function (url, qs, logging) { + /// Creates a new SignalR connection for the given url + /// The URL of the long polling endpoint + /// + /// [Optional] Custom querystring parameters to add to the connection URL. + /// If an object, every non-function member will be added to the querystring. + /// If a string, it's added to the QS as specified. + /// + /// + /// [Optional] A flag indicating whether connection logging is enabled to the browser + /// console/log. Defaults to false. + /// + + return new signalR.fn.init(url, qs, logging); + }; + + signalR.events = events; + + signalR.changeState = changeState; + + signalR.isDisconnecting = isDisconnecting; + + signalR.connectionState = { + connecting: 0, + connected: 1, + reconnecting: 2, + disconnected: 4 + }; + + signalR.hub = { + start: function () { + // This will get replaced with the real hub connection start method when hubs is referenced correctly + throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. ."); + } + }; + + _pageWindow.load(function () { _pageLoaded = true; }); + + function validateTransport(requestedTransport, connection) { + /// Validates the requested transport by cross checking it with the pre-defined signalR.transports + /// The designated transports that the user has specified. + /// The connection that will be using the requested transports. Used for logging purposes. + /// + if ($.isArray(requestedTransport)) { + // Go through transport array and remove an "invalid" tranports + for (var i = requestedTransport.length - 1; i >= 0; i--) { + var transport = requestedTransport[i]; + if ($.type(requestedTransport) !== "object" && ($.type(transport) !== "string" || !signalR.transports[transport])) { + connection.log("Invalid transport: " + transport + ", removing it from the transports list."); + requestedTransport.splice(i, 1); + } + } + + // Verify we still have transports left, if we dont then we have invalid transports + if (requestedTransport.length === 0) { + connection.log("No transports remain within the specified transport array."); + requestedTransport = null; + } + } else if ($.type(requestedTransport) !== "object" && !signalR.transports[requestedTransport] && requestedTransport !== "auto") { + connection.log("Invalid transport: " + requestedTransport.toString()); + requestedTransport = null; + } + + return requestedTransport; + } + + function getDefaultPort(protocol) { + if(protocol === "http:") { + return 80; + } + else if (protocol === "https:") { + return 443; + } + } + + function addDefaultPort(protocol, url) { + // Remove ports from url. We have to check if there's a / or end of line + // following the port in order to avoid removing ports such as 8080. + if(url.match(/:\d+$/)) { + return url; + } else { + return url + ":" + getDefaultPort(protocol); + } + } + + signalR.fn = signalR.prototype = { + init: function (url, qs, logging) { + this.url = url; + this.qs = qs; + this._ = {}; + if (typeof (logging) === "boolean") { + this.logging = logging; + } + }, + + isCrossDomain: function (url, against) { + /// Checks if url is cross domain + /// The base URL + /// + /// An optional argument to compare the URL against, if not specified it will be set to window.location. + /// If specified it must contain a protocol and a host property. + /// + var link; + + url = $.trim(url); + if (url.indexOf("http") !== 0) { + return false; + } + + against = against || window.location; + + // Create an anchor tag. + link = window.document.createElement("a"); + link.href = url; + + // When checking for cross domain we have to special case port 80 because the window.location will remove the + return link.protocol + addDefaultPort(link.protocol, link.host) !== against.protocol + addDefaultPort(against.protocol, against.host); + }, + + ajaxDataType: "json", + + logging: false, + + state: signalR.connectionState.disconnected, + + keepAliveData: {}, + + reconnectDelay: 2000, + + disconnectTimeout: 40000, // This should be set by the server in response to the negotiate request (40s default) + + keepAliveWarnAt: 2 / 3, // Warn user of slow connection if we breach the X% mark of the keep alive timeout + + start: function (options, callback) { + /// Starts the connection + /// Options map + /// A callback function to execute when the connection has started + var connection = this, + config = { + waitForPageLoad: true, + transport: "auto", + jsonp: false + }, + initialize, + deferred = connection._deferral || $.Deferred(), // Check to see if there is a pre-existing deferral that's being built on, if so we want to keep using it + parser = window.document.createElement("a"); + + if ($.type(options) === "function") { + // Support calling with single callback parameter + callback = options; + } else if ($.type(options) === "object") { + $.extend(config, options); + if ($.type(config.callback) === "function") { + callback = config.callback; + } + } + + config.transport = validateTransport(config.transport, connection); + + // If the transport is invalid throw an error and abort start + if (!config.transport) { + throw new Error("SignalR: Invalid transport(s) specified, aborting start."); + } + + // Check to see if start is being called prior to page load + // If waitForPageLoad is true we then want to re-direct function call to the window load event + if (!_pageLoaded && config.waitForPageLoad === true) { + _pageWindow.load(function () { + connection._deferral = deferred; + connection.start(options, callback); + }); + return deferred.promise(); + } + + configureStopReconnectingTimeout(connection); + + if (changeState(connection, + signalR.connectionState.disconnected, + signalR.connectionState.connecting) === false) { + // Already started, just return + deferred.resolve(connection); + return deferred.promise(); + } + + // Resolve the full url + parser.href = connection.url; + if (!parser.protocol || parser.protocol === ":") { + connection.protocol = window.document.location.protocol; + connection.host = window.document.location.host; + connection.baseUrl = connection.protocol + "//" + connection.host; + } + else { + connection.protocol = parser.protocol; + connection.host = parser.host; + connection.baseUrl = parser.protocol + "//" + parser.host; + } + + // Set the websocket protocol + connection.wsProtocol = connection.protocol === "https:" ? "wss://" : "ws://"; + + // If jsonp with no/auto transport is specified, then set the transport to long polling + // since that is the only transport for which jsonp really makes sense. + // Some developers might actually choose to specify jsonp for same origin requests + // as demonstrated by Issue #623. + if (config.transport === "auto" && config.jsonp === true) { + config.transport = "longPolling"; + } + + if (this.isCrossDomain(connection.url)) { + connection.log("Auto detected cross domain url."); + + if (config.transport === "auto") { + // Try webSockets and longPolling since SSE doesn't support CORS + // TODO: Support XDM with foreverFrame + config.transport = ["webSockets", "longPolling"]; + } + + // Determine if jsonp is the only choice for negotiation, ajaxSend and ajaxAbort. + // i.e. if the browser doesn't supports CORS + // If it is, ignore any preference to the contrary, and switch to jsonp. + if (!config.jsonp) { + config.jsonp = !$.support.cors; + + if (config.jsonp) { + connection.log("Using jsonp because this browser doesn't support CORS"); + } + } + } + + connection.ajaxDataType = config.jsonp ? "jsonp" : "json"; + + $(connection).bind(events.onStart, function (e, data) { + if ($.type(callback) === "function") { + callback.call(connection); + } + deferred.resolve(connection); + }); + + initialize = function (transports, index) { + index = index || 0; + if (index >= transports.length) { + if (!connection.transport) { + // No transport initialized successfully + $(connection).triggerHandler(events.onError, "SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization."); + deferred.reject("SignalR: No transport could be initialized successfully. Try specifying a different transport or none at all for auto initialization."); + // Stop the connection if it has connected and move it into the disconnected state + connection.stop(); + } + return; + } + + var transportName = transports[index], + transport = $.type(transportName) === "object" ? transportName : signalR.transports[transportName]; + + if (transportName.indexOf("_") === 0) { + // Private member + initialize(transports, index + 1); + return; + } + + transport.start(connection, function () { // success + if (transport.supportsKeepAlive && connection.keepAliveData.activated) { + signalR.transports._logic.monitorKeepAlive(connection); + } + + connection.transport = transport; + + changeState(connection, + signalR.connectionState.connecting, + signalR.connectionState.connected); + + $(connection).triggerHandler(events.onStart); + + _pageWindow.unload(function () { // failure + connection.stop(false /* async */); + }); + + }, function () { + initialize(transports, index + 1); + }); + }; + + var url = connection.url + "/negotiate"; + connection.log("Negotiating with '" + url + "'."); + $.ajax({ + url: url, + global: false, + cache: false, + type: "GET", + data: {}, + dataType: connection.ajaxDataType, + error: function (error) { + $(connection).triggerHandler(events.onError, [error.responseText]); + deferred.reject("SignalR: Error during negotiation request: " + error.responseText); + // Stop the connection if negotiate failed + connection.stop(); + }, + success: function (res) { + var keepAliveData = connection.keepAliveData; + + connection.appRelativeUrl = res.Url; + connection.id = res.ConnectionId; + connection.token = res.ConnectionToken; + connection.webSocketServerUrl = res.WebSocketServerUrl; + + // Once the server has labeled the PersistentConnection as Disconnected, we should stop attempting to reconnect + // after res.DisconnectTimeout seconds. + connection.disconnectTimeout = res.DisconnectTimeout * 1000; // in ms + + + // If we have a keep alive + if (res.KeepAliveTimeout) { + // Register the keep alive data as activated + keepAliveData.activated = true; + + // Timeout to designate when to force the connection into reconnecting converted to milliseconds + keepAliveData.timeout = res.KeepAliveTimeout * 1000; + + // Timeout to designate when to warn the developer that the connection may be dead or is hanging. + keepAliveData.timeoutWarning = keepAliveData.timeout * connection.keepAliveWarnAt; + + // Instantiate the frequency in which we check the keep alive. It must be short in order to not miss/pick up any changes + keepAliveData.checkInterval = (keepAliveData.timeout - keepAliveData.timeoutWarning) / 3; + } + else { + keepAliveData.activated = false; + } + + if (!res.ProtocolVersion || res.ProtocolVersion !== "1.2") { + $(connection).triggerHandler(events.onError, "SignalR: Incompatible protocol version."); + deferred.reject("SignalR: Incompatible protocol version."); + return; + } + + $(connection).triggerHandler(events.onStarting); + + var transports = [], + supportedTransports = []; + + $.each(signalR.transports, function (key) { + if (key === "webSockets" && !res.TryWebSockets) { + // Server said don't even try WebSockets, but keep processing the loop + return true; + } + supportedTransports.push(key); + }); + + if ($.isArray(config.transport)) { + // ordered list provided + $.each(config.transport, function () { + var transport = this; + if ($.type(transport) === "object" || ($.type(transport) === "string" && $.inArray("" + transport, supportedTransports) >= 0)) { + transports.push($.type(transport) === "string" ? "" + transport : transport); + } + }); + } else if ($.type(config.transport) === "object" || + $.inArray(config.transport, supportedTransports) >= 0) { + // specific transport provided, as object or a named transport, e.g. "longPolling" + transports.push(config.transport); + } else { // default "auto" + transports = supportedTransports; + } + initialize(transports); + } + }); + + return deferred.promise(); + }, + + starting: function (callback) { + /// Adds a callback that will be invoked before anything is sent over the connection + /// A callback function to execute before each time data is sent on the connection + /// + var connection = this; + $(connection).bind(events.onStarting, function (e, data) { + callback.call(connection); + }); + return connection; + }, + + send: function (data) { + /// Sends data over the connection + /// The data to send over the connection + /// + var connection = this; + + if (connection.state === signalR.connectionState.disconnected) { + // Connection hasn't been started yet + throw new Error("SignalR: Connection must be started before data can be sent. Call .start() before .send()"); + } + + if (connection.state === signalR.connectionState.connecting) { + // Connection hasn't been started yet + throw new Error("SignalR: Connection has not been fully initialized. Use .start().done() or .start().fail() to run logic after the connection has started."); + } + + connection.transport.send(connection, data); + // REVIEW: Should we return deferred here? + return connection; + }, + + received: function (callback) { + /// Adds a callback that will be invoked after anything is received over the connection + /// A callback function to execute when any data is received on the connection + /// + var connection = this; + $(connection).bind(events.onReceived, function (e, data) { + callback.call(connection, data); + }); + return connection; + }, + + stateChanged: function (callback) { + /// Adds a callback that will be invoked when the connection state changes + /// A callback function to execute when the connection state changes + /// + var connection = this; + $(connection).bind(events.onStateChanged, function (e, data) { + callback.call(connection, data); + }); + return connection; + }, + + error: function (callback) { + /// Adds a callback that will be invoked after an error occurs with the connection + /// A callback function to execute when an error occurs on the connection + /// + var connection = this; + $(connection).bind(events.onError, function (e, data) { + callback.call(connection, data); + }); + return connection; + }, + + disconnected: function (callback) { + /// Adds a callback that will be invoked when the client disconnects + /// A callback function to execute when the connection is broken + /// + var connection = this; + $(connection).bind(events.onDisconnect, function (e, data) { + callback.call(connection); + }); + return connection; + }, + + connectionSlow: function (callback) { + /// Adds a callback that will be invoked when the client detects a slow connection + /// A callback function to execute when the connection is slow + /// + var connection = this; + $(connection).bind(events.onConnectionSlow, function(e, data) { + callback.call(connection); + }); + + return connection; + }, + + reconnecting: function (callback) { + /// Adds a callback that will be invoked when the underlying transport begins reconnecting + /// A callback function to execute when the connection enters a reconnecting state + /// + var connection = this; + $(connection).bind(events.onReconnecting, function (e, data) { + callback.call(connection); + }); + return connection; + }, + + reconnected: function (callback) { + /// Adds a callback that will be invoked when the underlying transport reconnects + /// A callback function to execute when the connection is restored + /// + var connection = this; + $(connection).bind(events.onReconnect, function (e, data) { + callback.call(connection); + }); + return connection; + }, + + stop: function (async, notifyServer) { + /// Stops listening + /// Whether or not to asynchronously abort the connection + /// Whether we want to notify the server that we are aborting the connection + /// + var connection = this; + + if (connection.state === signalR.connectionState.disconnected) { + return; + } + + try { + if (connection.transport) { + if (notifyServer !== false) { + connection.transport.abort(connection, async); + } + + if (connection.transport.supportsKeepAlive && connection.keepAliveData.activated) { + signalR.transports._logic.stopMonitoringKeepAlive(connection); + } + + connection.transport.stop(connection); + connection.transport = null; + } + + // Trigger the disconnect event + $(connection).triggerHandler(events.onDisconnect); + + delete connection.messageId; + delete connection.groupsToken; + + // Remove the ID and the deferral on stop, this is to ensure that if a connection is restarted it takes on a new id/deferral. + delete connection.id; + delete connection._deferral; + } + finally { + changeState(connection, connection.state, signalR.connectionState.disconnected); + } + + return connection; + }, + + log: function (msg) { + log(msg, this.logging); + } + }; + + signalR.fn.init.prototype = signalR.fn; + + signalR.noConflict = function () { + /// Reinstates the original value of $.connection and returns the signalR object for manual assignment + /// + if ($.connection === signalR) { + $.connection = _connection; + } + return signalR; + }; + + if ($.connection) { + _connection = $.connection; + } + + $.connection = $.signalR = signalR; + +}(window.jQuery, window)); +/* jquery.signalR.transports.common.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState; + + signalR.transports = {}; + + function checkIfAlive(connection) { + var keepAliveData = connection.keepAliveData, + diff, + timeElapsed; + + // Only check if we're connected + if (connection.state === signalR.connectionState.connected) { + diff = new Date(); + + diff.setTime(diff - keepAliveData.lastKeepAlive); + timeElapsed = diff.getTime(); + + // Check if the keep alive has completely timed out + if (timeElapsed >= keepAliveData.timeout) { + connection.log("Keep alive timed out. Notifying transport that connection has been lost."); + + // Notify transport that the connection has been lost + connection.transport.lostConnection(connection); + } + else if (timeElapsed >= keepAliveData.timeoutWarning) { + // This is to assure that the user only gets a single warning + if (!keepAliveData.userNotified) { + connection.log("Keep alive has been missed, connection may be dead/slow."); + $(connection).triggerHandler(events.onConnectionSlow); + keepAliveData.userNotified = true; + } + } + else { + keepAliveData.userNotified = false; + } + } + + // Verify we're monitoring the keep alive + // We don't want this as a part of the inner if statement above because we want keep alives to continue to be checked + // in the event that the server comes back online (if it goes offline). + if (keepAliveData.monitoring) { + window.setTimeout(function () { + checkIfAlive(connection); + }, keepAliveData.checkInterval); + } + } + + signalR.transports._logic = { + pingServer: function (connection, transport) { + /// Pings the server + /// Connection associated with the server ping + /// + var baseUrl = transport === "webSockets" ? "" : connection.baseUrl, + url = baseUrl + connection.appRelativeUrl + "/ping", + deferral = $.Deferred(); + + $.ajax({ + url: url, + global: false, + cache: false, + type: "GET", + data: {}, + dataType: connection.ajaxDataType, + success: function (data) { + if (data.Response === "pong") { + deferral.resolve(); + } + else { + deferral.reject("SignalR: Invalid ping response when pinging server: " + (data.responseText || data.statusText)); + } + }, + error: function (data) { + deferral.reject("SignalR: Error pinging server: " + (data.responseText || data.statusText)); + } + }); + + return deferral.promise(); + }, + + addQs: function (url, connection) { + if (!connection.qs) { + return url; + } + + if (typeof (connection.qs) === "object") { + return url + "&" + $.param(connection.qs); + } + + if (typeof (connection.qs) === "string") { + return url + "&" + connection.qs; + } + + return url + "&" + window.encodeURIComponent(connection.qs.toString()); + }, + + getUrl: function (connection, transport, reconnecting, appendReconnectUrl) { + /// Gets the url for making a GET based connect request + var baseUrl = transport === "webSockets" ? "" : connection.baseUrl, + url = baseUrl + connection.appRelativeUrl, + qs = "transport=" + transport + "&connectionToken=" + window.encodeURIComponent(connection.token); + + if (connection.data) { + qs += "&connectionData=" + window.encodeURIComponent(connection.data); + } + + if (connection.groupsToken) { + qs += "&groupsToken=" + window.encodeURIComponent(connection.groupsToken); + } + + if (!reconnecting) { + url = url + "/connect"; + } else { + if (appendReconnectUrl) { + url = url + "/reconnect"; + } + if (connection.messageId) { + qs += "&messageId=" + window.encodeURIComponent(connection.messageId); + } + } + url += "?" + qs; + url = this.addQs(url, connection); + url += "&tid=" + Math.floor(Math.random() * 11); + return url; + }, + + maximizePersistentResponse: function (minPersistentResponse) { + return { + MessageId: minPersistentResponse.C, + Messages: minPersistentResponse.M, + Disconnect: typeof (minPersistentResponse.D) !== "undefined" ? true : false, + TimedOut: typeof (minPersistentResponse.T) !== "undefined" ? true : false, + LongPollDelay: minPersistentResponse.L, + GroupsToken: minPersistentResponse.G + }; + }, + + updateGroups: function (connection, groupsToken) { + if (groupsToken) { + connection.groupsToken = groupsToken; + } + }, + + ajaxSend: function (connection, data) { + var url = connection.url + "/send" + "?transport=" + connection.transport.name + "&connectionToken=" + window.encodeURIComponent(connection.token); + url = this.addQs(url, connection); + return $.ajax({ + url: url, + global: false, + type: connection.ajaxDataType === "jsonp" ? "GET" : "POST", + dataType: connection.ajaxDataType, + data: { + data: data + }, + success: function (result) { + if (result) { + $(connection).triggerHandler(events.onReceived, [result]); + } + }, + error: function (errData, textStatus) { + if (textStatus === "abort" || + (textStatus === "parsererror" && connection.ajaxDataType === "jsonp")) { + // The parsererror happens for sends that don't return any data, and hence + // don't write the jsonp callback to the response. This is harder to fix on the server + // so just hack around it on the client for now. + return; + } + $(connection).triggerHandler(events.onError, [errData]); + } + }); + }, + + ajaxAbort: function (connection, async) { + if (typeof (connection.transport) === "undefined") { + return; + } + + // Async by default unless explicitly overidden + async = typeof async === "undefined" ? true : async; + + var url = connection.url + "/abort" + "?transport=" + connection.transport.name + "&connectionToken=" + window.encodeURIComponent(connection.token); + url = this.addQs(url, connection); + $.ajax({ + url: url, + async: async, + timeout: 1000, + global: false, + type: "POST", + dataType: connection.ajaxDataType, + data: {} + }); + + connection.log("Fired ajax abort async = " + async); + }, + + processMessages: function (connection, minData) { + var data; + // Transport can be null if we've just closed the connection + if (connection.transport) { + var $connection = $(connection); + + // If our transport supports keep alive then we need to update the last keep alive time stamp. + // Very rarely the transport can be null. + if (connection.transport.supportsKeepAlive && connection.keepAliveData.activated) { + this.updateKeepAlive(connection); + } + + if (!minData) { + return; + } + + data = this.maximizePersistentResponse(minData); + + if (data.Disconnect) { + connection.log("Disconnect command received from server"); + + // Disconnected by the server + connection.stop(false, false); + return; + } + + this.updateGroups(connection, data.GroupsToken); + + if (data.Messages) { + $.each(data.Messages, function () { + try { + $connection.triggerHandler(events.onReceived, [this]); + } + catch (e) { + connection.log("Error raising received " + e); + $(connection).triggerHandler(events.onError, [e]); + } + }); + } + + if (data.MessageId) { + connection.messageId = data.MessageId; + } + } + }, + + monitorKeepAlive: function (connection) { + var keepAliveData = connection.keepAliveData, + that = this; + + // If we haven't initiated the keep alive timeouts then we need to + if (!keepAliveData.monitoring) { + keepAliveData.monitoring = true; + + // Initialize the keep alive time stamp ping + that.updateKeepAlive(connection); + + // Save the function so we can unbind it on stop + connection.keepAliveData.reconnectKeepAliveUpdate = function () { + that.updateKeepAlive(connection); + }; + + // Update Keep alive on reconnect + $(connection).bind(events.onReconnect, connection.keepAliveData.reconnectKeepAliveUpdate); + + connection.log("Now monitoring keep alive with a warning timeout of " + keepAliveData.timeoutWarning + " and a connection lost timeout of " + keepAliveData.timeout); + // Start the monitoring of the keep alive + checkIfAlive(connection); + } + else { + connection.log("Tried to monitor keep alive but it's already being monitored"); + } + }, + + stopMonitoringKeepAlive: function (connection) { + var keepAliveData = connection.keepAliveData; + + // Only attempt to stop the keep alive monitoring if its being monitored + if (keepAliveData.monitoring) { + // Stop monitoring + keepAliveData.monitoring = false; + + // Remove the updateKeepAlive function from the reconnect event + $(connection).unbind(events.onReconnect, connection.keepAliveData.reconnectKeepAliveUpdate); + + // Clear all the keep alive data + keepAliveData = {}; + connection.log("Stopping the monitoring of the keep alive"); + } + }, + + updateKeepAlive: function (connection) { + connection.keepAliveData.lastKeepAlive = new Date(); + }, + + ensureReconnectingState: function (connection) { + if (changeState(connection, + signalR.connectionState.connected, + signalR.connectionState.reconnecting) === true) { + $(connection).triggerHandler(events.onReconnecting); + } + return connection.state === signalR.connectionState.reconnecting; + }, + + foreverFrame: { + count: 0, + connections: {} + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.transports.webSockets.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState, + transportLogic = signalR.transports._logic; + + signalR.transports.webSockets = { + name: "webSockets", + + supportsKeepAlive: true, + + attemptingReconnect: false, + + currentSocketID: 0, + + send: function (connection, data) { + connection.socket.send(data); + }, + + start: function (connection, onSuccess, onFailed) { + var url, + opened = false, + that = this, + reconnecting = !onSuccess, + $connection = $(connection); + + if (!window.WebSocket) { + onFailed(); + return; + } + + if (!connection.socket) { + if (connection.webSocketServerUrl) { + url = connection.webSocketServerUrl; + } + else { + url = connection.wsProtocol + connection.host; + } + + url += transportLogic.getUrl(connection, this.name, reconnecting); + + connection.log("Connecting to websocket endpoint '" + url + "'"); + connection.socket = new window.WebSocket(url); + connection.socket.ID = ++that.currentSocketID; + connection.socket.onopen = function () { + opened = true; + connection.log("Websocket opened"); + + if (that.attemptingReconnect) { + that.attemptingReconnect = false; + } + + if (onSuccess) { + onSuccess(); + } else if (changeState(connection, + signalR.connectionState.reconnecting, + signalR.connectionState.connected) === true) { + $connection.triggerHandler(events.onReconnect); + } + }; + + connection.socket.onclose = function (event) { + // Only handle a socket close if the close is from the current socket. + // Sometimes on disconnect the server will push down an onclose event + // to an expired socket. + if (this.ID === that.currentSocketID) { + if (!opened) { + if (onFailed) { + onFailed(); + } + else if (reconnecting) { + that.reconnect(connection); + } + return; + } + else if (typeof event.wasClean !== "undefined" && event.wasClean === false) { + // Ideally this would use the websocket.onerror handler (rather than checking wasClean in onclose) but + // I found in some circumstances Chrome won't call onerror. This implementation seems to work on all browsers. + $(connection).triggerHandler(events.onError, [event.reason]); + connection.log("Unclean disconnect from websocket." + event.reason); + } + else { + connection.log("Websocket closed"); + } + + that.reconnect(connection); + } + }; + + connection.socket.onmessage = function (event) { + var data = window.JSON.parse(event.data), + $connection = $(connection); + + if (data) { + // data.M is PersistentResponse.Messages + if ($.isEmptyObject(data) || data.M) { + transportLogic.processMessages(connection, data); + } else { + // For websockets we need to trigger onReceived + // for callbacks to outgoing hub calls. + $connection.triggerHandler(events.onReceived, [data]); + } + } + }; + } + }, + + reconnect: function (connection) { + var that = this; + + if (connection.state !== signalR.connectionState.disconnected) { + if (!that.attemptingReconnect) { + that.attemptingReconnect = true; + } + + window.setTimeout(function () { + if (that.attemptingReconnect) { + that.stop(connection); + } + + if (transportLogic.ensureReconnectingState(connection)) { + connection.log("Websocket reconnecting"); + that.start(connection); + } + }, connection.reconnectDelay); + } + }, + + lostConnection: function (connection) { + this.reconnect(connection); + + }, + + stop: function (connection) { + if (connection.socket !== null) { + connection.log("Closing the Websocket"); + connection.socket.close(); + connection.socket = null; + } + }, + + abort: function (connection) { + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.transports.serverSentEvents.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState, + transportLogic = signalR.transports._logic; + + signalR.transports.serverSentEvents = { + name: "serverSentEvents", + + supportsKeepAlive: true, + + reconnectTimeout: false, + + currentEventSourceID: 0, + + timeOut: 3000, + + start: function (connection, onSuccess, onFailed) { + var that = this, + opened = false, + $connection = $(connection), + reconnecting = !onSuccess, + url, + connectTimeOut; + + if (connection.eventSource) { + connection.log("The connection already has an event source. Stopping it."); + connection.stop(); + } + + if (!window.EventSource) { + if (onFailed) { + connection.log("This browser doesn't support SSE."); + onFailed(); + } + return; + } + + url = transportLogic.getUrl(connection, this.name, reconnecting); + + try { + connection.log("Attempting to connect to SSE endpoint '" + url + "'"); + connection.eventSource = new window.EventSource(url); + connection.eventSource.ID = ++that.currentEventSourceID; + } + catch (e) { + connection.log("EventSource failed trying to connect with error " + e.Message); + if (onFailed) { + // The connection failed, call the failed callback + onFailed(); + } + else { + $connection.triggerHandler(events.onError, [e]); + if (reconnecting) { + // If we were reconnecting, rather than doing initial connect, then try reconnect again + that.reconnect(connection); + } + } + return; + } + + // After connecting, if after the specified timeout there's no response stop the connection + // and raise on failed + connectTimeOut = window.setTimeout(function () { + if (opened === false) { + connection.log("EventSource timed out trying to connect"); + connection.log("EventSource readyState: " + connection.eventSource.readyState); + + if (!reconnecting) { + that.stop(connection); + } + + if (reconnecting) { + // If we're reconnecting and the event source is attempting to connect, + // don't keep retrying. This causes duplicate connections to spawn. + if (connection.eventSource.readyState !== window.EventSource.CONNECTING && + connection.eventSource.readyState !== window.EventSource.OPEN) { + // If we were reconnecting, rather than doing initial connect, then try reconnect again + that.reconnect(connection); + } + } else if (onFailed) { + onFailed(); + } + } + }, + that.timeOut); + + connection.eventSource.addEventListener("open", function (e) { + connection.log("EventSource connected"); + + if (connectTimeOut) { + window.clearTimeout(connectTimeOut); + } + + if (that.reconnectTimeout) { + window.clearTimeout(that.reconnectTimeout); + } + + if (opened === false) { + opened = true; + + if (onSuccess) { + onSuccess(); + } else if (changeState(connection, + signalR.connectionState.reconnecting, + signalR.connectionState.connected) === true) { + // If there's no onSuccess handler we assume this is a reconnect + $connection.triggerHandler(events.onReconnect); + } + } + }, false); + + connection.eventSource.addEventListener("message", function (e) { + // process messages + if (e.data === "initialized") { + return; + } + + transportLogic.processMessages(connection, window.JSON.parse(e.data)); + }, false); + + connection.eventSource.addEventListener("error", function (e) { + // Only handle an error if the error is from the current Event Source. + // Sometimes on disconnect the server will push down an error event + // to an expired Event Source. + if (this.ID === that.currentEventSourceID) { + if (!opened) { + if (onFailed) { + onFailed(); + } + + return; + } + + connection.log("EventSource readyState: " + connection.eventSource.readyState); + + if (e.eventPhase === window.EventSource.CLOSED) { + // We don't use the EventSource's native reconnect function as it + // doesn't allow us to change the URL when reconnecting. We need + // to change the URL to not include the /connect suffix, and pass + // the last message id we received. + connection.log("EventSource reconnecting due to the server connection ending"); + that.reconnect(connection); + } else { + // connection error + connection.log("EventSource error"); + $connection.triggerHandler(events.onError); + } + } + }, false); + }, + + reconnect: function (connection) { + var that = this; + + that.reconnectTimeout = window.setTimeout(function () { + that.stop(connection); + + if (transportLogic.ensureReconnectingState(connection)) { + connection.log("EventSource reconnecting"); + that.start(connection); + } + }, connection.reconnectDelay); + }, + + lostConnection: function (connection) { + this.reconnect(connection); + }, + + send: function (connection, data) { + transportLogic.ajaxSend(connection, data); + }, + + stop: function (connection) { + if (connection && connection.eventSource) { + connection.log("EventSource calling close()"); + connection.eventSource.close(); + connection.eventSource = null; + delete connection.eventSource; + } + }, + abort: function (connection, async) { + transportLogic.ajaxAbort(connection, async); + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.transports.foreverFrame.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState, + transportLogic = signalR.transports._logic; + + signalR.transports.foreverFrame = { + name: "foreverFrame", + + supportsKeepAlive: true, + + timeOut: 3000, + + start: function (connection, onSuccess, onFailed) { + var that = this, + frameId = (transportLogic.foreverFrame.count += 1), + url, + frame = $(""); + + if (window.EventSource) { + // If the browser supports SSE, don't use Forever Frame + if (onFailed) { + connection.log("This browser supports SSE, skipping Forever Frame."); + onFailed(); + } + return; + } + + + // Build the url + url = transportLogic.getUrl(connection, this.name); + url += "&frameId=" + frameId; + + // Set body prior to setting URL to avoid caching issues. + $("body").append(frame); + + frame.prop("src", url); + transportLogic.foreverFrame.connections[frameId] = connection; + + connection.log("Binding to iframe's readystatechange event."); + frame.bind("readystatechange", function () { + if ($.inArray(this.readyState, ["loaded", "complete"]) >= 0) { + connection.log("Forever frame iframe readyState changed to " + this.readyState + ", reconnecting"); + + that.reconnect(connection); + } + }); + + connection.frame = frame[0]; + connection.frameId = frameId; + + if (onSuccess) { + connection.onSuccess = onSuccess; + } + + // After connecting, if after the specified timeout there's no response stop the connection + // and raise on failed + window.setTimeout(function () { + if (connection.onSuccess) { + connection.log("Failed to connect using forever frame source, it timed out after " + that.timeOut + "ms."); + that.stop(connection); + + if (onFailed) { + onFailed(); + } + } + }, that.timeOut); + }, + + reconnect: function (connection) { + var that = this; + window.setTimeout(function () { + if (connection.frame && transportLogic.ensureReconnectingState(connection)) { + var frame = connection.frame, + src = transportLogic.getUrl(connection, that.name, true) + "&frameId=" + connection.frameId; + connection.log("Updating iframe src to '" + src + "'."); + frame.src = src; + } + }, connection.reconnectDelay); + }, + + lostConnection: function (connection) { + this.reconnect(connection); + }, + + send: function (connection, data) { + transportLogic.ajaxSend(connection, data); + }, + + receive: function (connection, data) { + var cw; + + transportLogic.processMessages(connection, data); + // Delete the script & div elements + connection.frameMessageCount = (connection.frameMessageCount || 0) + 1; + if (connection.frameMessageCount > 50) { + connection.frameMessageCount = 0; + cw = connection.frame.contentWindow || connection.frame.contentDocument; + if (cw && cw.document) { + $("body", cw.document).empty(); + } + } + }, + + stop: function (connection) { + var cw = null; + if (connection.frame) { + if (connection.frame.stop) { + connection.frame.stop(); + } else { + try { + cw = connection.frame.contentWindow || connection.frame.contentDocument; + if (cw.document && cw.document.execCommand) { + cw.document.execCommand("Stop"); + } + } + catch (e) { + connection.log("SignalR: Error occured when stopping foreverFrame transport. Message = " + e.message); + } + } + $(connection.frame).remove(); + delete transportLogic.foreverFrame.connections[connection.frameId]; + connection.frame = null; + connection.frameId = null; + delete connection.frame; + delete connection.frameId; + connection.log("Stopping forever frame"); + } + }, + + abort: function (connection, async) { + transportLogic.ajaxAbort(connection, async); + }, + + getConnection: function (id) { + return transportLogic.foreverFrame.connections[id]; + }, + + started: function (connection) { + if (connection.onSuccess) { + connection.onSuccess(); + connection.onSuccess = null; + delete connection.onSuccess; + } else if (changeState(connection, + signalR.connectionState.reconnecting, + signalR.connectionState.connected) === true) { + // If there's no onSuccess handler we assume this is a reconnect + $(connection).triggerHandler(events.onReconnect); + } + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.transports.longPolling.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + var signalR = $.signalR, + events = $.signalR.events, + changeState = $.signalR.changeState, + isDisconnecting = $.signalR.isDisconnecting, + transportLogic = signalR.transports._logic; + + signalR.transports.longPolling = { + name: "longPolling", + + supportsKeepAlive: false, + + reconnectDelay: 3000, + + init: function (connection, onComplete) { + /// Pings the server to ensure availability + /// Connection associated with the server ping + /// Callback to call once initialization has completed + + var that = this, + pingLoop, + // pingFail is used to loop the re-ping behavior. When we fail we want to re-try. + pingFail = function (reason) { + if (isDisconnecting(connection) === false) { + connection.log("SignalR: Server ping failed because '" + reason + "', re-trying ping."); + window.setTimeout(pingLoop, that.reconnectDelay); + } + }; + + connection.log("SignalR: Initializing long polling connection with server."); + pingLoop = function () { + // Ping the server, on successful ping call the onComplete method, otherwise if we fail call the pingFail + transportLogic.pingServer(connection, that.name).done(onComplete).fail(pingFail); + }; + + pingLoop(); + }, + + start: function (connection, onSuccess, onFailed) { + /// Starts the long polling connection + /// The SignalR connection to start + var that = this, + initialConnectedFired = false, + fireConnect = function () { + if (initialConnectedFired) { + return; + } + initialConnectedFired = true; + onSuccess(); + connection.log("Longpolling connected"); + }; + + if (connection.pollXhr) { + connection.log("Polling xhr requests already exists, aborting."); + connection.stop(); + } + + // We start with an initialization procedure which pings the server to verify that it is there. + // On scucessful initialization we'll then proceed with starting the transport. + that.init(connection, function () { + connection.messageId = null; + + window.setTimeout(function () { + (function poll(instance, raiseReconnect) { + var messageId = instance.messageId, + connect = (messageId === null), + reconnecting = !connect, + url = transportLogic.getUrl(instance, that.name, reconnecting, raiseReconnect); + + // If we've disconnected during the time we've tried to re-instantiate the poll then stop. + if (isDisconnecting(instance) === true) { + return; + } + + connection.log("Attempting to connect to '" + url + "' using longPolling."); + instance.pollXhr = $.ajax({ + url: url, + global: false, + cache: false, + type: "GET", + dataType: connection.ajaxDataType, + success: function (minData) { + var delay = 0, + data; + + fireConnect(); + + if (minData) { + data = transportLogic.maximizePersistentResponse(minData); + } + + transportLogic.processMessages(instance, minData); + + if (data && + $.type(data.LongPollDelay) === "number") { + delay = data.LongPollDelay; + } + + if (data && data.Disconnect) { + return; + } + + if (isDisconnecting(instance) === true) { + return; + } + + // We never want to pass a raiseReconnect flag after a successful poll. This is handled via the error function + if (delay > 0) { + window.setTimeout(function () { + poll(instance, false); + }, delay); + } else { + poll(instance, false); + } + }, + + error: function (data, textStatus) { + if (textStatus === "abort") { + connection.log("Aborted xhr requst."); + return; + } + + if (connection.state !== signalR.connectionState.reconnecting) { + connection.log("An error occurred using longPolling. Status = " + textStatus + ". " + data.responseText); + $(instance).triggerHandler(events.onError, [data.responseText]); + } + + // Transition into the reconnecting state + transportLogic.ensureReconnectingState(instance); + + // If we've errored out we need to verify that the server is still there, so re-start initialization process + // This will ping the server until it successfully gets a response. + that.init(instance, function () { + // Call poll with the raiseReconnect flag as true + poll(instance, true); + }); + } + }); + + // This will only ever pass after an error has occured via the poll ajax procedure. + if (reconnecting && raiseReconnect === true) { + if (changeState(connection, + signalR.connectionState.reconnecting, + signalR.connectionState.connected) === true) { + // Successfully reconnected! + connection.log("Raising the reconnect event"); + $(instance).triggerHandler(events.onReconnect); + } + } + }(connection)); + + // Set an arbitrary timeout to trigger onSuccess, this will alot for enough time on the server to wire up the connection. + // Will be fixed by #1189 and this code can be modified to not be a timeout + window.setTimeout(function () { + // Trigger the onSuccess() method because we've now instantiated a connection + fireConnect(); + }, 250); + }, 250); // Have to delay initial poll so Chrome doesn't show loader spinner in tab + }); + }, + + lostConnection: function (connection) { + throw new Error("Lost Connection not handled for LongPolling"); + }, + + send: function (connection, data) { + transportLogic.ajaxSend(connection, data); + }, + + stop: function (connection) { + /// Stops the long polling connection + /// The SignalR connection to stop + if (connection.pollXhr) { + connection.pollXhr.abort(); + connection.pollXhr = null; + delete connection.pollXhr; + } + }, + + abort: function (connection, async) { + transportLogic.ajaxAbort(connection, async); + } + }; + +}(window.jQuery, window)); +/* jquery.signalR.hubs.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// + +(function ($, window) { + "use strict"; + + // we use a global id for tracking callbacks so the server doesn't have to send extra info like hub name + var callbackId = 0, + callbacks = {}, + eventNamespace = ".hubProxy"; + + function makeEventName(event) { + return event + eventNamespace; + } + + // Array.prototype.map + if (!Array.prototype.hasOwnProperty("map")) { + Array.prototype.map = function (fun, thisp) { + var arr = this, + i, + length = arr.length, + result = []; + for (i = 0; i < length; i += 1) { + if (arr.hasOwnProperty(i)) { + result[i] = fun.call(thisp, arr[i], i, arr); + } + } + return result; + }; + } + + function getArgValue(a) { + return $.isFunction(a) ? null : ($.type(a) === "undefined" ? null : a); + } + + function hasMembers(obj) { + for (var key in obj) { + // If we have any properties in our callback map then we have callbacks and can exit the loop via return + if (obj.hasOwnProperty(key)) { + return true; + } + } + + return false; + } + + // hubProxy + function hubProxy(hubConnection, hubName) { + /// + /// Creates a new proxy object for the given hub connection that can be used to invoke + /// methods on server hubs and handle client method invocation requests from the server. + /// + return new hubProxy.fn.init(hubConnection, hubName); + } + + hubProxy.fn = hubProxy.prototype = { + init: function (connection, hubName) { + this.state = {}; + this.connection = connection; + this.hubName = hubName; + this._ = { + callbackMap: {} + }; + }, + + hasSubscriptions: function () { + return hasMembers(this._.callbackMap); + }, + + on: function (eventName, callback) { + /// Wires up a callback to be invoked when a invocation request is received from the server hub. + /// The name of the hub event to register the callback for. + /// The callback to be invoked. + var self = this, + callbackMap = self._.callbackMap; + + // Normalize the event name to lowercase + eventName = eventName.toLowerCase(); + + // If there is not an event registered for this callback yet we want to create its event space in the callback map. + if (!callbackMap[eventName]) { + callbackMap[eventName] = {}; + } + + // Map the callback to our encompassed function + callbackMap[eventName][callback] = function (e, data) { + callback.apply(self, data); + }; + + $(self).bind(makeEventName(eventName), callbackMap[eventName][callback]); + + return self; + }, + + off: function (eventName, callback) { + /// Removes the callback invocation request from the server hub for the given event name. + /// The name of the hub event to unregister the callback for. + /// The callback to be invoked. + var self = this, + callbackMap = self._.callbackMap, + callbackSpace; + + // Normalize the event name to lowercase + eventName = eventName.toLowerCase(); + + callbackSpace = callbackMap[eventName]; + + // Verify that there is an event space to unbind + if (callbackSpace) { + // Only unbind if there's an event bound with eventName and a callback with the specified callback + if (callbackSpace[callback]) { + $(self).unbind(makeEventName(eventName), callbackSpace[callback]); + + // Remove the callback from the callback map + delete callbackSpace[callback]; + + // Check if there are any members left on the event, if not we need to destroy it. + if (!hasMembers(callbackSpace)) { + delete callbackMap[eventName]; + } + } + else if (!callback) { // Check if we're removing the whole event and we didn't error because of an invalid callback + $(self).unbind(makeEventName(eventName)); + + delete callbackMap[eventName]; + } + } + + return self; + }, + + invoke: function (methodName) { + /// Invokes a server hub method with the given arguments. + /// The name of the server hub method. + + var self = this, + args = $.makeArray(arguments).slice(1), + argValues = args.map(getArgValue), + data = { H: self.hubName, M: methodName, A: argValues, I: callbackId }, + d = $.Deferred(), + callback = function (minResult) { + var result = self._maximizeHubResponse(minResult); + + // Update the hub state + $.extend(self.state, result.State); + + if (result.Error) { + // Server hub method threw an exception, log it & reject the deferred + if (result.StackTrace) { + self.connection.log(result.Error + "\n" + result.StackTrace); + } + d.rejectWith(self, [result.Error]); + } else { + // Server invocation succeeded, resolve the deferred + d.resolveWith(self, [result.Result]); + } + }; + + callbacks[callbackId.toString()] = { scope: self, method: callback }; + callbackId += 1; + + if (!$.isEmptyObject(self.state)) { + data.S = self.state; + } + + self.connection.send(window.JSON.stringify(data)); + + return d.promise(); + }, + + _maximizeHubResponse: function (minHubResponse) { + return { + State: minHubResponse.S, + Result: minHubResponse.R, + Id: minHubResponse.I, + Error: minHubResponse.E, + StackTrace: minHubResponse.T + }; + } + }; + + hubProxy.fn.init.prototype = hubProxy.fn; + + // hubConnection + function hubConnection(url, options) { + /// Creates a new hub connection. + /// [Optional] The hub route url, defaults to "/signalr". + /// [Optional] Settings to use when creating the hubConnection. + var settings = { + qs: null, + logging: false, + useDefaultPath: true + }; + + $.extend(settings, options); + + if (!url || settings.useDefaultPath) { + url = (url || "") + "/signalr"; + } + return new hubConnection.fn.init(url, settings); + } + + hubConnection.fn = hubConnection.prototype = $.connection(); + + hubConnection.fn.init = function (url, options) { + var settings = { + qs: null, + logging: false, + useDefaultPath: true + }, + connection = this; + + $.extend(settings, options); + + // Call the base constructor + $.signalR.fn.init.call(connection, url, settings.qs, settings.logging); + + // Object to store hub proxies for this connection + connection.proxies = {}; + + // Wire up the received handler + connection.received(function (minData) { + var data, proxy, dataCallbackId, callback, hubName, eventName; + if (!minData) { + return; + } + + if (typeof (minData.I) !== "undefined") { + // We received the return value from a server method invocation, look up callback by id and call it + dataCallbackId = minData.I.toString(); + callback = callbacks[dataCallbackId]; + if (callback) { + // Delete the callback from the proxy + callbacks[dataCallbackId] = null; + delete callbacks[dataCallbackId]; + + // Invoke the callback + callback.method.call(callback.scope, minData); + } + } else { + data = this._maximizeClientHubInvocation(minData); + + // We received a client invocation request, i.e. broadcast from server hub + connection.log("Triggering client hub event '" + data.Method + "' on hub '" + data.Hub + "'."); + + // Normalize the names to lowercase + hubName = data.Hub.toLowerCase(); + eventName = data.Method.toLowerCase(); + + // Trigger the local invocation event + proxy = this.proxies[hubName]; + + // Update the hub state + $.extend(proxy.state, data.State); + $(proxy).triggerHandler(makeEventName(eventName), [data.Args]); + } + }); + }; + + hubConnection.fn._maximizeClientHubInvocation = function (minClientHubInvocation) { + return { + Hub: minClientHubInvocation.H, + Method: minClientHubInvocation.M, + Args: minClientHubInvocation.A, + State: minClientHubInvocation.S + }; + }; + + hubConnection.fn._registerSubscribedHubs = function () { + /// + /// Sets the starting event to loop through the known hubs and register any new hubs + /// that have been added to the proxy. + /// + + if (!this._subscribedToHubs) { + this._subscribedToHubs = true; + this.starting(function () { + // Set the connection's data object with all the hub proxies with active subscriptions. + // These proxies will receive notifications from the server. + var subscribedHubs = []; + + $.each(this.proxies, function (key) { + if (this.hasSubscriptions()) { + subscribedHubs.push({ name: key }); + } + }); + + this.data = window.JSON.stringify(subscribedHubs); + }); + } + }; + + hubConnection.fn.createHubProxy = function (hubName) { + /// + /// Creates a new proxy object for the given hub connection that can be used to invoke + /// methods on server hubs and handle client method invocation requests from the server. + /// + /// + /// The name of the hub on the server to create the proxy for. + /// + + // Normalize the name to lowercase + hubName = hubName.toLowerCase(); + + var proxy = this.proxies[hubName]; + if (!proxy) { + proxy = hubProxy(this, hubName); + this.proxies[hubName] = proxy; + } + + this._registerSubscribedHubs(); + + return proxy; + }; + + hubConnection.fn.init.prototype = hubConnection.fn; + + $.hubConnection = hubConnection; + +}(window.jQuery, window)); +/* jquery.signalR.version.js */ +// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. + +/*global window:false */ +/// +(function ($) { + $.signalR.version = "1.0.0.rc1"; +}(window.jQuery)); diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/js/jquery.signalR-1.0.0.min.js b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/js/jquery.signalR-1.0.0.min.js new file mode 100644 index 00000000000..6f14d9d5bb5 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Content/js/jquery.signalR-1.0.0.min.js @@ -0,0 +1,10 @@ +/*! + * ASP.NET SignalR JavaScript Library v1.0.0 + * http://signalr.net/ + * + * Copyright Microsoft Open Technologies, Inc. All rights reserved. + * Licensed under the Apache 2.0 + * https://github.com/SignalR/SignalR/blob/master/LICENSE.md + * + */ +(function(n,t){"use strict";function l(t,r){var u,f;if(n.isArray(t)){for(u=t.length-1;u>=0;u--)f=t[u],n.type(t)==="object"||n.type(f)==="string"&&i.transports[f]||(r.log("Invalid transport: "+f+", removing it from the transports list."),t.splice(u,1));t.length===0&&(r.log("No transports remain within the specified transport array."),t=null)}else n.type(t)==="object"||i.transports[t]||t==="auto"||(r.log("Invalid transport: "+t.toString()),t=null);return t}function h(n){return n==="http:"?80:n==="https:"?443:void 0}function o(n,t){return t.match(/:\d+$/)?t:t+":"+h(n)}if(typeof n!="function")throw new Error("SignalR: jQuery not found. Please ensure jQuery is referenced before the SignalR.js file.");if(!t.JSON)throw new Error("SignalR: No JSON parser found. Please ensure json2.js is referenced before the SignalR.js file if you need to support clients without native JSON parsing support, e.g. IE<8.");var i,s,e=t.document.readyState==="complete",f=n(t),r={onStart:"onStart",onStarting:"onStarting",onReceived:"onReceived",onError:"onError",onConnectionSlow:"onConnectionSlow",onReconnecting:"onReconnecting",onReconnect:"onReconnect",onStateChanged:"onStateChanged",onDisconnect:"onDisconnect"},c=function(n,i){if(i!==!1){var r;typeof t.console!="undefined"&&(r="["+(new Date).toTimeString()+"] SignalR: "+n,t.console.debug?t.console.debug(r):t.console.log&&t.console.log(r))}},u=function(t,i,u){return i===t.state?(t.state=u,n(t).triggerHandler(r.onStateChanged,[{oldState:i,newState:u}]),!0):!1},a=function(n){return n.state===i.connectionState.disconnected},v=function(n){var u,r;n._.configuredStopReconnectingTimeout||(r=function(n){n.log("Couldn't reconnect within the configured timeout ("+n.disconnectTimeout+"ms), disconnecting."),n.stop(!1,!1)},n.reconnecting(function(){var n=this;u=t.setTimeout(function(){r(n)},n.disconnectTimeout)}),n.stateChanged(function(n){n.oldState===i.connectionState.reconnecting&&t.clearTimeout(u)}),n._.configuredStopReconnectingTimeout=!0)};i=function(n,t,r){return new i.fn.init(n,t,r)},i.events=r,i.changeState=u,i.isDisconnecting=a,i.connectionState={connecting:0,connected:1,reconnecting:2,disconnected:4},i.hub={start:function(){throw new Error("SignalR: Error loading hubs. Ensure your hubs reference is correct, e.g. + +
    +

    Welcome to NService Bus Video Store!

    +

    Select what videos you would like to watch

    +
    + +
    +
    + List of available NServiceBus videos +
    +
    + + + +
    + +
    + + + Debug me! + +
    + Order failed {{errorMessage}} +
    + + + +
    +
    +
    + List of orders +
    + Heads up! Once you place an order, you have 20 secs to cancel it. +
    + + + + + + + + + + + + + + + + + + + + +
    #Video(s)Status 
    + No order yet, place some orders above +
    {{order.number}}
    {{title}}
    {{order.status}}
    +
    +
    +
    +
    + Orders Received + + + + + + + + + + + + + + + + +
    #Video(s)
    + No orders received yet +
    {{order.number}}
    +
    +
    +
    + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Views/Shared/_Layout.cshtml b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Views/Shared/_Layout.cshtml new file mode 100644 index 00000000000..b6bcbb07c06 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Views/Shared/_Layout.cshtml @@ -0,0 +1,54 @@ + + + + + + @ViewBag.Title + + + + + + + + + + @RenderSection("head", required: false) + + + + +
    + @RenderBody() +
    + + + \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Views/Web.config b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Views/Web.config new file mode 100644 index 00000000000..a575d7cc087 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Views/Web.config @@ -0,0 +1,35 @@ + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Views/_ViewStart.cshtml b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Views/_ViewStart.cshtml new file mode 100644 index 00000000000..efda124b1fc --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Web.Debug.config b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Web.Debug.config new file mode 100644 index 00000000000..2251b2c596e --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Web.Release.config b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Web.Release.config new file mode 100644 index 00000000000..90b9041232d --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Web.config b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Web.config new file mode 100644 index 00000000000..0f3ddb29527 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/Web.config @@ -0,0 +1,28 @@ + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/packages.config b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/packages.config new file mode 100644 index 00000000000..97a42d92f45 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.ECommerce/packages.config @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Commands/CancelOrder.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Commands/CancelOrder.cs new file mode 100644 index 00000000000..5a6b5e9b374 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Commands/CancelOrder.cs @@ -0,0 +1,8 @@ +namespace VideoStore.Messages.Commands +{ + public class CancelOrder + { + public int OrderNumber { get; set; } + public string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Commands/SubmitOrder.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Commands/SubmitOrder.cs new file mode 100644 index 00000000000..6d2ce27cb10 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Commands/SubmitOrder.cs @@ -0,0 +1,11 @@ +namespace VideoStore.Messages.Commands +{ + public class SubmitOrder + { + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + public string EncryptedCreditCardNumber { get; set; } + public string EncryptedExpirationDate { get; set; } + } +} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/ClientBecamePreferred.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/ClientBecamePreferred.cs new file mode 100644 index 00000000000..6f73e54cbdf --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/ClientBecamePreferred.cs @@ -0,0 +1,10 @@ +namespace VideoStore.Messages.Events +{ + using System; + + public class ClientBecamePreferred + { + public string ClientId { get; set; } + public DateTime PreferredStatusExpiresOn { get; set; } + } +} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/DownloadIsReady.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/DownloadIsReady.cs new file mode 100644 index 00000000000..7ba10112e13 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/DownloadIsReady.cs @@ -0,0 +1,11 @@ +namespace VideoStore.Messages.Events +{ + using System.Collections.Generic; + + public interface DownloadIsReady + { + int OrderNumber { get; set; } + Dictionary VideoUrls { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/OrderAccepted.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/OrderAccepted.cs new file mode 100644 index 00000000000..e37e0b6ac56 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/OrderAccepted.cs @@ -0,0 +1,10 @@ +namespace VideoStore.Messages.Events +{ + //NServiceBus messages can be defined using both classes and interfaces + public interface OrderAccepted + { + int OrderNumber { get; set; } + string[] VideoIds { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/OrderCancelled.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/OrderCancelled.cs new file mode 100644 index 00000000000..b7c456edee2 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/OrderCancelled.cs @@ -0,0 +1,8 @@ +namespace VideoStore.Messages.Events +{ + public interface OrderCancelled + { + int OrderNumber { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/OrderPlaced.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/OrderPlaced.cs new file mode 100644 index 00000000000..e638040b37e --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Events/OrderPlaced.cs @@ -0,0 +1,9 @@ +namespace VideoStore.Messages.Events +{ + public interface OrderPlaced + { + int OrderNumber { get; set; } + string[] VideoIds { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Properties/AssemblyInfo.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..5972cb6d3a7 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyMessages")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyMessages")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("4687cda1-7646-49ca-83ad-35500037bda3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Messages/RequestResponse/ProvisionDownloadRequest.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/RequestResponse/ProvisionDownloadRequest.cs new file mode 100644 index 00000000000..8f40dbdfc58 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/RequestResponse/ProvisionDownloadRequest.cs @@ -0,0 +1,9 @@ +namespace VideoStore.Messages.RequestResponse +{ + public class ProvisionDownloadRequest + { + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + } +} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Messages/RequestResponse/ProvisionDownloadResponse.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/RequestResponse/ProvisionDownloadResponse.cs new file mode 100644 index 00000000000..5b58f9d8d8b --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/RequestResponse/ProvisionDownloadResponse.cs @@ -0,0 +1,9 @@ +namespace VideoStore.Messages.RequestResponse +{ + public class ProvisionDownloadResponse + { + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + } +} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Messages/VideoStore.Messages.csproj b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/VideoStore.Messages.csproj new file mode 100644 index 00000000000..7f7656a17b6 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Messages/VideoStore.Messages.csproj @@ -0,0 +1,72 @@ + + + + + + Debug + AnyCPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679} + Library + Properties + VideoStore.Messages + VideoStore.Messages + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Operations/App.config b/Samples/VideoStore.ActiveMQ/VideoStore.Operations/App.config new file mode 100644 index 00000000000..e0b60e5fa91 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Operations/App.config @@ -0,0 +1,17 @@ + + + +
    +
    +
    + + + + + + + + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Operations/EndpointConfig.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Operations/EndpointConfig.cs new file mode 100644 index 00000000000..b774cddc4fd --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Operations/EndpointConfig.cs @@ -0,0 +1,22 @@ +namespace VideoStore.Operations +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, UsingTransport + { + } + + public class MyClass : IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.Operations endpoint is now started and ready to accept messages"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Operations/Properties/AssemblyInfo.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Operations/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..ff7833e6eb7 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Operations/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyRequestResponseEndpoint")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyRequestResponseEndpoint")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f2941769-d352-4bba-aa24-6974cf3d7e2a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Operations/ProvisionDownloadHandler.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Operations/ProvisionDownloadHandler.cs new file mode 100644 index 00000000000..b1bdb94c4bb --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Operations/ProvisionDownloadHandler.cs @@ -0,0 +1,30 @@ +namespace VideoStore.Operations +{ + using System; + using System.Diagnostics; + using VideoStore.Common; + using VideoStore.Messages.RequestResponse; + using NServiceBus; + + public class ProvisionDownloadHandler : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(ProvisionDownloadRequest message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.Out.WriteLine("Provision the videos and make the Urls available to the Content management for download ...[{0}] video(s) to provision", String.Join(", ", message.VideoIds)); + + Bus.Reply(new ProvisionDownloadResponse + { + OrderNumber = message.OrderNumber, + VideoIds = message.VideoIds, + ClientId = message.ClientId + }); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Operations/VideoStore.Operations.csproj b/Samples/VideoStore.ActiveMQ/VideoStore.Operations/VideoStore.Operations.csproj new file mode 100644 index 00000000000..138f543cdaa --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Operations/VideoStore.Operations.csproj @@ -0,0 +1,96 @@ + + + + + + Debug + AnyCPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF} + Library + Properties + VideoStore.Operations + VideoStore.Operations + v4.0 + 512 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\packages\Apache.NMS.1.5.1\lib\net40\Apache.NMS.dll + + + ..\..\..\binaries\NServiceBus.Transports.ActiveMQ.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + DebugFlagMutator.cs + + + UnobtrusiveMessageConventions.cs + + + + + + + + + + + Designer + + + Designer + + + + + {59f2ba7e-4da5-49f8-9dbc-520fa99f4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Operations/packages.config b/Samples/VideoStore.ActiveMQ/VideoStore.Operations/packages.config new file mode 100644 index 00000000000..26f0a5cea34 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Operations/packages.config @@ -0,0 +1,5 @@ + + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Sales/App.config b/Samples/VideoStore.ActiveMQ/VideoStore.Sales/App.config new file mode 100644 index 00000000000..49d803eb1d1 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Sales/App.config @@ -0,0 +1,22 @@ + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Sales/EndpointConfig.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Sales/EndpointConfig.cs new file mode 100644 index 00000000000..dd7823acb13 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Sales/EndpointConfig.cs @@ -0,0 +1,29 @@ +namespace VideoStore.Sales +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, UsingTransport, IWantCustomInitialization + { + public void Init() + { + Configure.With() + .DefaultBuilder() + .RijndaelEncryptionService(); + } + } + + + public class MyClass:IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.Sales endpoint is now started and ready to accept messages"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Sales/ProcessOrderSaga.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Sales/ProcessOrderSaga.cs new file mode 100644 index 00000000000..ee3dfc1358d --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Sales/ProcessOrderSaga.cs @@ -0,0 +1,90 @@ +namespace VideoStore.Sales +{ + using System; + using System.Diagnostics; + using Common; + using Messages.Commands; + using Messages.Events; + using NServiceBus; + using NServiceBus.Saga; + + public class ProcessOrderSaga : Saga, + IAmStartedByMessages, + IHandleMessages, + IHandleTimeouts + { + public void Handle(SubmitOrder message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Data.OrderNumber = message.OrderNumber; + Data.VideoIds = message.VideoIds; + Data.ClientId = message.ClientId; + + RequestTimeout(TimeSpan.FromSeconds(20), new BuyersRemorseIsOver()); + Console.Out.WriteLine("Starting cool down period for order #{0}.", Data.OrderNumber); + } + + public void Timeout(BuyersRemorseIsOver state) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Bus.Publish(e => + { + e.OrderNumber = Data.OrderNumber; + e.VideoIds = Data.VideoIds; + e.ClientId = Data.ClientId; + }); + + MarkAsComplete(); + + Console.Out.WriteLine("Cooling down period for order #{0} has elapsed.", Data.OrderNumber); + } + + public void Handle(CancelOrder message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + MarkAsComplete(); + + Bus.Publish(Bus.CreateInstance(o => + { + o.OrderNumber = message.OrderNumber; + o.ClientId = message.ClientId; + })); + + Console.Out.WriteLine("Order #{0} was cancelled.", message.OrderNumber); + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(m => m.OrderNumber) + .ToSaga(s=>s.OrderNumber); + ConfigureMapping(m => m.OrderNumber) + .ToSaga(s=>s.OrderNumber); + } + + public class OrderData : ContainSagaData + { + [Unique] + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + } + + public class BuyersRemorseIsOver + { + } + } + + +} \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Sales/Properties/AssemblyInfo.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Sales/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..b1f36493d27 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Sales/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyServer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyServer")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d3fd2af3-025c-4690-8ff1-0934a9d37b25")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Sales/SubmitOrderHandler.cs b/Samples/VideoStore.ActiveMQ/VideoStore.Sales/SubmitOrderHandler.cs new file mode 100644 index 00000000000..0a0e91fee1d --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Sales/SubmitOrderHandler.cs @@ -0,0 +1,37 @@ +namespace VideoStore.Sales +{ + using System; + using System.Diagnostics; + using VideoStore.Common; + using VideoStore.Messages.Commands; + using VideoStore.Messages.Events; + using NServiceBus; + + public class SubmitOrderHandler : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(SubmitOrder message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.Out.WriteLine("We have received an order #{0} for [{1}] video(s).", message.OrderNumber, + String.Join(", ", message.VideoIds)); + + Console.Out.WriteLine("The credit card values will be encrypted when looking at the messages in the queues"); + Console.Out.WriteLine("CreditCard Number is {0}", message.EncryptedCreditCardNumber); + Console.Out.WriteLine("CreditCard Expiration Date is {0}", message.EncryptedExpirationDate); + + //tell the client that we received the order + Bus.Publish(Bus.CreateInstance(o => + { + o.ClientId = message.ClientId; + o.OrderNumber = message.OrderNumber; + o.VideoIds = message.VideoIds; + })); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Sales/VideoStore.Sales.csproj b/Samples/VideoStore.ActiveMQ/VideoStore.Sales/VideoStore.Sales.csproj new file mode 100644 index 00000000000..5347037c929 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Sales/VideoStore.Sales.csproj @@ -0,0 +1,97 @@ + + + + + + Debug + AnyCPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE} + Library + Properties + VideoStore.Sales + VideoStore.Sales + v4.0 + 512 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\packages\Apache.NMS.1.5.1\lib\net40\Apache.NMS.dll + + + ..\..\..\binaries\NServiceBus.Transports.ActiveMQ.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + DebugFlagMutator.cs + + + UnobtrusiveMessageConventions.cs + + + + + + + + + + + + + Designer + + + + + + + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + diff --git a/Samples/VideoStore.ActiveMQ/VideoStore.Sales/packages.config b/Samples/VideoStore.ActiveMQ/VideoStore.Sales/packages.config new file mode 100644 index 00000000000..26f0a5cea34 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/VideoStore.Sales/packages.config @@ -0,0 +1,5 @@ + + + + + diff --git a/Samples/VideoStore.ActiveMQ/packages/repositories.config b/Samples/VideoStore.ActiveMQ/packages/repositories.config new file mode 100644 index 00000000000..66c82756846 --- /dev/null +++ b/Samples/VideoStore.ActiveMQ/packages/repositories.config @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/VideoStore.Msmq/.nuget/NuGet.Config b/Samples/VideoStore.Msmq/.nuget/NuGet.Config new file mode 100644 index 00000000000..308b678b2da --- /dev/null +++ b/Samples/VideoStore.Msmq/.nuget/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/VideoStore.Msmq/.nuget/NuGet.exe b/Samples/VideoStore.Msmq/.nuget/NuGet.exe new file mode 100644 index 00000000000..4645f4b35e8 Binary files /dev/null and b/Samples/VideoStore.Msmq/.nuget/NuGet.exe differ diff --git a/Samples/VideoStore.Msmq/.nuget/NuGet.targets b/Samples/VideoStore.Msmq/.nuget/NuGet.targets new file mode 100644 index 00000000000..4ada616b317 --- /dev/null +++ b/Samples/VideoStore.Msmq/.nuget/NuGet.targets @@ -0,0 +1,150 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + + + + + $(SolutionDir).nuget + packages.config + + + + + $(NuGetToolsPath)\nuget.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " + $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(ResolveReferencesDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.ContentManagement/App.config b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/App.config new file mode 100644 index 00000000000..45fd6c47b58 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/App.config @@ -0,0 +1,25 @@ + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.Msmq/VideoStore.ContentManagement/DebugFlagMutator.cs b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/DebugFlagMutator.cs new file mode 100644 index 00000000000..12cce29e2ee --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/DebugFlagMutator.cs @@ -0,0 +1,37 @@ +namespace VideoStore.Common +{ + using System; + using System.Threading; + using NServiceBus; + using NServiceBus.MessageMutator; + + public class DebugFlagMutator : IMutateTransportMessages, INeedInitialization + { + public static bool Debug { get { return debug.Value; } } + + public void MutateIncoming(TransportMessage transportMessage) + { + var debugFlag = transportMessage.Headers.ContainsKey("Debug") ? transportMessage.Headers["Debug"] : "false"; + if (debugFlag !=null && debugFlag.Equals("true", StringComparison.OrdinalIgnoreCase)) + { + debug.Value = true; + } + else + { + debug.Value = false; + } + } + + public void MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + transportMessage.Headers["Debug"] = Debug.ToString(); + } + + public void Init() + { + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + } + + static readonly ThreadLocal debug = new ThreadLocal(); + } +} diff --git a/Samples/VideoStore.Msmq/VideoStore.ContentManagement/EndpointConfig.cs b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/EndpointConfig.cs new file mode 100644 index 00000000000..f28a3c913d1 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/EndpointConfig.cs @@ -0,0 +1,20 @@ +namespace VideoStore.ContentManagement +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, UsingTransport { } + + public class MyClass : IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.ContentManagement endpoint is now started and subscribed to OrderAccepted events from VideoStore.Sales"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.Msmq/VideoStore.ContentManagement/OrderAcceptedHandler.cs b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/OrderAcceptedHandler.cs new file mode 100644 index 00000000000..b5b2d8fb5f8 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/OrderAcceptedHandler.cs @@ -0,0 +1,35 @@ +namespace VideoStore.ContentManagement +{ + using System; + using System.Diagnostics; + using VideoStore.Common; + using VideoStore.Messages.RequestResponse; + using VideoStore.Messages.Events; + using NServiceBus; + + public class OrderAcceptedHandler : IHandleMessages + { + + + public IBus Bus { get; set; } + + public void Handle(OrderAccepted message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.WriteLine("Order # {0} has been accepted, Let's provision the download -- Sending ProvisionDownloadRequest to the VideoStore.Operations endpoint", message.OrderNumber); + + //send out a request (a event will be published when the response comes back) + Bus.Send(r => + { + r.ClientId = message.ClientId; + r.OrderNumber = message.OrderNumber; + r.VideoIds = message.VideoIds; + }); + + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.ContentManagement/Properties/AssemblyInfo.cs b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..5b8a651c9ce --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("VideoStore.DownloadVideos")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VideoStore.DownloadVideos")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7121e327-af1c-4c5d-87f5-47fa2799ffa7")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.Msmq/VideoStore.ContentManagement/ProvisionDownloadResponseHandler.cs b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/ProvisionDownloadResponseHandler.cs new file mode 100644 index 00000000000..2818c347035 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/ProvisionDownloadResponseHandler.cs @@ -0,0 +1,49 @@ +namespace VideoStore.ContentManagement +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using Messages.Events; + using Messages.RequestResponse; + using NServiceBus; + using VideoStore.Common; + + public class ProvisionDownloadResponseHandler : IHandleMessages + { + public IBus Bus { get; set; } + private readonly IDictionary videoIdToUrlMap = new Dictionary + { + {"intro1", "http://youtu.be/6lYF83wKerA"}, + {"intro2", "http://youtu.be/icze_WCyEdQ"}, + {"gems", "http://skillsmatter.com/podcast/design-architecture/hidden-nservicebus-gems"}, + {"integ", "http://skillsmatter.com/podcast/home/reliable-integrations-nservicebus/js-1877"}, + {"shiny", "http://skillsmatter.com/podcast/open-source-dot-net/nservicebus-3"}, + {"day", "http://dnrtv.com/dnrtvplayer/player.aspx?ShowNum=0199"}, + {"need", "http://vimeo.com/37728422"}, + }; + + public void Handle(ProvisionDownloadResponse message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.WriteLine("Download for Order # {0} has been provisioned, Publishing Download ready event", message.OrderNumber); + + Bus.Publish(e => + { + e.OrderNumber = message.OrderNumber; + e.ClientId = message.ClientId; + e.VideoUrls = new Dictionary(); + + foreach (var videoId in message.VideoIds) + { + e.VideoUrls.Add(videoId, videoIdToUrlMap[videoId]); + } + }); + + Console.Out.WriteLine("Downloads for Order #{0} is ready, publishing it.", message.OrderNumber); + } + } +} diff --git a/Samples/VideoStore.Msmq/VideoStore.ContentManagement/UnobtrusiveMessageConventions.cs b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/UnobtrusiveMessageConventions.cs new file mode 100644 index 00000000000..ed699df4fa4 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/UnobtrusiveMessageConventions.cs @@ -0,0 +1,18 @@ +namespace VideoStore.Common +{ + using NServiceBus; + + class UnobtrusiveMessageConventions : IWantToRunBeforeConfiguration + { + public void Init() + { + Configure.Instance + .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("Commands")) + .DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("Events")) + .DefiningMessagesAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("RequestResponse")) + .DefiningEncryptedPropertiesAs(p => p.Name.StartsWith("Encrypted")); + } + } +} + + diff --git a/Samples/VideoStore.Msmq/VideoStore.ContentManagement/VideoStore.ContentManagement.csproj b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/VideoStore.ContentManagement.csproj new file mode 100644 index 00000000000..b7b4be3a072 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/VideoStore.ContentManagement.csproj @@ -0,0 +1,95 @@ + + + + + + Debug + AnyCPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C} + Library + Properties + VideoStore.ContentManagement + VideoStore.ContentManagement + v4.0 + 512 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + Designer + + + + + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.ContentManagement/packages.config b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/packages.config new file mode 100644 index 00000000000..79ece06bef6 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ContentManagement/packages.config @@ -0,0 +1,3 @@ + + + diff --git a/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/App.config b/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/App.config new file mode 100644 index 00000000000..d5ca236da0e --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/App.config @@ -0,0 +1,25 @@ + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/EndpointConfig.cs b/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/EndpointConfig.cs new file mode 100644 index 00000000000..8a778001af8 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/EndpointConfig.cs @@ -0,0 +1,20 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, UsingTransport { } + + public class MyClass : IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.CustomerRelations endpoint is now started and subscribed to events from VideoStore.Sales"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/OrderAcceptedHandler.cs b/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/OrderAcceptedHandler.cs new file mode 100644 index 00000000000..af2394a62bd --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/OrderAcceptedHandler.cs @@ -0,0 +1,35 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using System.Diagnostics; + using Messages.Events; + using NServiceBus; + using VideoStore.Common; + + class OrderAcceptedHandler : IHandleMessages + { + public IBus Bus { get; set; } + public void Handle(OrderAccepted message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.WriteLine("Customer: {0} is now a preferred customer -- raising in-memory event, & publishing for other service concerns", message.ClientId); + // Call the domain object to do the raising of the event based on the relevant condition + Bus.InMemory.Raise(m => + { + m.ClientId = message.ClientId; + m.PreferredStatusExpiresOn = DateTime.Now.AddMonths(2); + }); + + // Yes, you can also publish this event as an asynchronous event + Bus.Publish(m => + { + m.ClientId = message.ClientId; + m.PreferredStatusExpiresOn = DateTime.Now.AddMonths(2); + }); + } + } +} diff --git a/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/Properties/AssemblyInfo.cs b/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..2ee904c5711 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("VideoStore.CustomerRelations")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VideoStore.CustomerRelations")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2dad9534-21c4-4fd6-b45e-243d1d1a3902")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/SendLimitedTimeOffer.cs b/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/SendLimitedTimeOffer.cs new file mode 100644 index 00000000000..76894e2667c --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/SendLimitedTimeOffer.cs @@ -0,0 +1,20 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using System.Diagnostics; + using Messages.Events; + using NServiceBus; + using VideoStore.Common; + + class SendLimitedTimeOffer : IHandleMessages + { + public void Handle(ClientBecamePreferred message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + Console.WriteLine("Handler WhenCustomerIsPreferredSendLimitedTimeOffer invoked for CustomerId: {0}", message.ClientId); + } + } +} diff --git a/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/SendWelcomePacket.cs b/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/SendWelcomePacket.cs new file mode 100644 index 00000000000..0981531626d --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/SendWelcomePacket.cs @@ -0,0 +1,26 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using System.Diagnostics; + using Messages.Events; + using NServiceBus; + using VideoStore.Common; + + class SendWelcomePacket : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(ClientBecamePreferred message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + Console.WriteLine("Handler WhenCustomerIsPreferredSendWelcomeEmail invoked for CustomerId: {0}", message.ClientId); + + // Don't write code to do the smtp send here, instead do a Bus.Send. If this handler fails, then + // the message to send email will not be sent. + //Bus.Send(m => { m.ClientId = message.ClientId; }); + } + } +} diff --git a/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/VideoStore.CustomerRelations.csproj b/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/VideoStore.CustomerRelations.csproj new file mode 100644 index 00000000000..2f422b9f5a7 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.CustomerRelations/VideoStore.CustomerRelations.csproj @@ -0,0 +1,81 @@ + + + + + Debug + AnyCPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC} + Library + Properties + VideoStore.CustomerRelations + VideoStore.CustomerRelations + v4.0 + 512 + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + + DebugFlagMutator.cs + + + UnobtrusiveMessageConventions.cs + + + + + + + + + + + + + {59f2ba7e-4da5-49f8-9dbc-520fa99f4679} + VideoStore.Messages + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/App_Start/FilterConfig.cs b/Samples/VideoStore.Msmq/VideoStore.ECommerce/App_Start/FilterConfig.cs new file mode 100644 index 00000000000..b8da915c6e2 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ECommerce/App_Start/FilterConfig.cs @@ -0,0 +1,12 @@ +namespace VideoStore.ECommerce +{ + using System.Web.Mvc; + + public class FilterConfig + { + public static void RegisterGlobalFilters(GlobalFilterCollection filters) + { + filters.Add(new HandleErrorAttribute()); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/App_Start/RouteConfig.cs b/Samples/VideoStore.Msmq/VideoStore.ECommerce/App_Start/RouteConfig.cs new file mode 100644 index 00000000000..dde7707c577 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ECommerce/App_Start/RouteConfig.cs @@ -0,0 +1,16 @@ +namespace VideoStore.ECommerce +{ + using System; + using System.Web.Mvc; + using System.Web.Routing; + + public class RouteConfig + { + public static void RegisterRoutes(RouteCollection routes) + { + routes.MapHubs(); + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + routes.MapRoute("Default", String.Empty, new { controller = "Home", action = "Index" }); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/css/bootstrap-responsive.min.css b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/css/bootstrap-responsive.min.css new file mode 100644 index 00000000000..5cb833ff082 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/css/bootstrap-responsive.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap Responsive v2.2.2 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */@-ms-viewport{width:device-width}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/css/bootstrap.min.css b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/css/bootstrap.min.css new file mode 100644 index 00000000000..140f731dfa8 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/css/bootstrap.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap v2.2.2 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}label,select,button,input[type="button"],input[type="reset"],input[type="submit"],input[type="radio"],input[type="checkbox"]{cursor:pointer}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.127659574468085%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;line-height:0;content:""}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;line-height:0;content:""}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}a.muted:hover{color:#808080}.text-warning{color:#c09853}a.text-warning:hover{color:#a47e3c}.text-error{color:#b94a48}a.text-error:hover{color:#953b39}.text-info{color:#3a87ad}a.text-info:hover{color:#2d6987}.text-success{color:#468847}a.text-success:hover{color:#356635}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:20px;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{line-height:40px}h1{font-size:38.5px}h2{font-size:31.5px}h3{font-size:24.5px}h4{font-size:17.5px}h5{font-size:14px}h6{font-size:11.9px}h1 small{font-size:24.5px}h2 small{font-size:17.5px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}ul.inline,ol.inline{margin-left:0;list-style:none}ul.inline>li,ol.inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;line-height:0;content:""}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;white-space:nowrap;background-color:#f7f7f9;border:1px solid #e1e1e8}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;white-space:pre;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555;vertical-align:middle;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}input,textarea,.uneditable-input{width:206px}textarea{height:auto}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;background-color:#fff;border:1px solid #ccc}select[multiple],select[size]{height:auto}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:20px;padding-left:20px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-20px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left}.controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error .control-label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success .control-label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info .control-label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu{font-size:14px}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn,.input-append .btn-group>.dropdown-toggle,.input-prepend .btn-group>.dropdown-toggle{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn:last-child,.input-append select+.btn-group .btn:last-child,.input-append .uneditable-input+.btn-group .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px}.input-append .add-on:last-child,.input-append .btn:last-child,.input-append .btn-group:last-child>.dropdown-toggle{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child{margin-left:0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizontal .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block,.form-horizontal .uneditable-input+.help-block,.form-horizontal .input-prepend+.help-block,.form-horizontal .input-append+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child>th:first-child,.table-bordered tbody:first-child tr:first-child>td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child>th:last-child,.table-bordered tbody:first-child tr:first-child>td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child>th:first-child,.table-bordered tbody:last-child tr:last-child>td:first-child,.table-bordered tfoot:last-child tr:last-child>td:first-child{-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child>th:last-child,.table-bordered tbody:last-child tr:last-child>td:last-child,.table-bordered tfoot:last-child tr:last-child>td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered tfoot+tbody:last-child tr:last-child td:first-child{-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-moz-border-radius-bottomleft:0}.table-bordered tfoot+tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomright:0}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5}table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span"],.row-fluid table th[class*="span"]{display:table-cell;float:none;margin-left:0}.table td.span1,.table th.span1{float:none;width:44px;margin-left:0}.table td.span2,.table th.span2{float:none;width:124px;margin-left:0}.table td.span3,.table th.span3{float:none;width:204px;margin-left:0}.table td.span4,.table th.span4{float:none;width:284px;margin-left:0}.table td.span5,.table th.span5{float:none;width:364px;margin-left:0}.table td.span6,.table th.span6{float:none;width:444px;margin-left:0}.table td.span7,.table th.span7{float:none;width:524px;margin-left:0}.table td.span8,.table th.span8{float:none;width:604px;margin-left:0}.table td.span9,.table th.span9{float:none;width:684px;margin-left:0}.table td.span10,.table th.span10{float:none;width:764px;margin-left:0}.table td.span11,.table th.span11{float:none;width:844px;margin-left:0}.table td.span12,.table th.span12{float:none;width:924px;margin-left:0}.table tbody tr.success td{background-color:#dff0d8}.table tbody tr.error td{background-color:#f2dede}.table tbody tr.warning td{background-color:#fcf8e3}.table tbody tr.info td{background-color:#d9edf7}.table-hover tbody tr.success:hover td{background-color:#d0e9c6}.table-hover tbody tr.error:hover td{background-color:#ebcccc}.table-hover tbody tr.warning:hover td{background-color:#faf2cc}.table-hover tbody tr.info:hover td{background-color:#c4e3f3}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;outline:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999}.dropdown-menu .disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open{*z-index:1000}.open>.dropdown-menu{display:block}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 12px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #bbb;*border:0;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn{border-color:#c5c5c5;border-color:rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-moz-linear-gradient(top,#62c462,#51a351);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover{color:#333;text-decoration:none}.btn-group{position:relative;display:inline-block;*display:inline;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle;*zoom:1}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:14px}.btn-group>.btn-mini{font-size:10.5px}.btn-group>.btn-small{font-size:11.9px}.btn-group>.btn-large{font-size:17.5px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5px;border-right-width:5px;border-left-width:5px}.dropup .btn-large .caret{border-bottom-width:5px}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical>.btn{display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical>.btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical>.btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical>.btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical>.btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert,.alert h4{color:#c09853}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-success h4{color:#468847}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-danger h4,.alert-error h4{color:#b94a48}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-info h4{color:#3a87ad}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li>a>img{max-width:none}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;content:""}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#fff;background-color:#08c}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover{z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;content:""}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover{border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before,.navbar-inner:after{display:table;line-height:0;content:""}.navbar-inner:after{clear:both}.navbar .container{width:auto}.nav-collapse.collapse{height:auto;overflow:visible}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px;color:#777}.navbar-link{color:#777}.navbar-link:hover{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:5px}.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn{margin-top:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;content:""}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:5px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,0.1);box-shadow:0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown>a:hover .caret{border-top-color:#555;border-bottom-color:#555}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#fff}.navbar-inverse .brand{color:#999}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>a:hover .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-moz-linear-gradient(top,#151515,#040404);background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb>li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb>li>.divider{padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li{display:inline}.pagination ul>li>a,.pagination ul>li>span{float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5}.pagination ul>.active>a,.pagination ul>.active>span{color:#999;cursor:default}.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover{color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pagination-large ul>li>a,.pagination-large ul>li>span{padding:11px 19px;font-size:17.5px}.pagination-large ul>li:first-child>a,.pagination-large ul>li:first-child>span{-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.pagination-large ul>li:last-child>a,.pagination-large ul>li:last-child>span{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.pagination-mini ul>li:first-child>a,.pagination-small ul>li:first-child>a,.pagination-mini ul>li:first-child>span,.pagination-small ul>li:first-child>span{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px}.pagination-mini ul>li:last-child>a,.pagination-small ul>li:last-child>a,.pagination-mini ul>li:last-child>span,.pagination-small ul>li:last-child>span{-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px}.pagination-small ul>li>a,.pagination-small ul>li>span{padding:2px 10px;font-size:11.9px}.pagination-mini ul>li>a,.pagination-mini ul>li>span{padding:0 6px;font-size:10.5px}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager li>a:hover{text-decoration:none;background-color:#f5f5f5}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>span{color:#999;cursor:default;background-color:#fff}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:10%;left:50%;z-index:1050;width:560px;margin-left:-280px;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:0;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3s ease-out}.modal.fade.in{top:10%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{position:relative;max-height:400px;padding:15px;overflow-y:auto}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.tooltip{position:absolute;z-index:1030;display:block;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{margin-top:-3px}.tooltip.right{margin-left:3px}.tooltip.bottom{margin-top:3px}.tooltip.left{margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after{bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,0.25);border-left-width:0}.popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0}.popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover{border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.media,.media-body{overflow:hidden;*overflow:visible;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media .pull-left{margin-right:10px}.media .pull-right{margin-left:10px}.media-list{margin-left:0;list-style:none}.label,.badge{display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding-right:9px;padding-left:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}.label:empty,.badge:empty{display:none}a.label:hover,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.accordion{margin-bottom:20px}.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading{border-bottom:0}.accordion-heading .accordion-toggle{display:block;padding:8px 15px}.accordion-toggle{cursor:pointer}.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5}.carousel{position:relative;margin-bottom:20px;line-height:1}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img{display:block;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{right:15px;left:auto}.carousel-control:hover{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-caption{position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{line-height:20px;color:#fff}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit li{line-height:30px}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed} diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/img/glyphicons-halflings-white.png b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/img/glyphicons-halflings-white.png new file mode 100644 index 00000000000..3bf6484a29d Binary files /dev/null and b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/img/glyphicons-halflings-white.png differ diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/img/glyphicons-halflings.png b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/img/glyphicons-halflings.png new file mode 100644 index 00000000000..a9969993201 Binary files /dev/null and b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/img/glyphicons-halflings.png differ diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/js/angular.min.js b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/js/angular.min.js new file mode 100644 index 00000000000..569325cf173 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/js/angular.min.js @@ -0,0 +1,160 @@ +/* + AngularJS v1.0.4 + (c) 2010-2012 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(T,Y,p){'use strict';function m(b,a,c){var d;if(b)if(L(b))for(d in b)d!="prototype"&&d!="length"&&d!="name"&&b.hasOwnProperty(d)&&a.call(c,b[d],d);else if(b.forEach&&b.forEach!==m)b.forEach(a,c);else if(M(b)&&va(b.length))for(d=0;d=0&&b.splice(c,1);return a}function U(b,a){if(oa(b)||b&&b.$evalAsync&&b.$watch)throw u("Can't copy Window or Scope");if(a){if(b===a)throw u("Can't copy equivalent objects or arrays");if(I(b)){for(;a.length;)a.pop();for(var c=0;c2?ia.call(arguments,2):[];return L(a)&&!(a instanceof RegExp)?c.length?function(){return arguments.length?a.apply(b,c.concat(ia.call(arguments,0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b, +arguments):a.call(b)}:a}function ic(b,a){var c=a;/^\$+/.test(b)?c=p:oa(a)?c="$WINDOW":a&&Y===a?c="$DOCUMENT":a&&a.$evalAsync&&a.$watch&&(c="$SCOPE");return c}function da(b,a){return JSON.stringify(b,ic,a?" ":null)}function ob(b){return E(b)?JSON.parse(b):b}function Wa(b){b&&b.length!==0?(b=D(""+b),b=!(b=="f"||b=="0"||b=="false"||b=="no"||b=="n"||b=="[]")):b=!1;return b}function pa(b){b=z(b).clone();try{b.html("")}catch(a){}return z("
    ").append(b).html().match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/, +function(a,b){return"<"+D(b)})}function Xa(b){var a={},c,d;m((b||"").split("&"),function(b){b&&(c=b.split("="),d=decodeURIComponent(c[0]),a[d]=v(c[1])?decodeURIComponent(c[1]):!0)});return a}function pb(b){var a=[];m(b,function(b,d){a.push(Ya(d,!0)+(b===!0?"":"="+Ya(b,!0)))});return a.length?a.join("&"):""}function Za(b){return Ya(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Ya(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g, +"$").replace(/%2C/gi,",").replace(a?null:/%20/g,"+")}function jc(b,a){function c(a){a&&d.push(a)}var d=[b],e,g,i=["ng:app","ng-app","x-ng-app","data-ng-app"],f=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;m(i,function(a){i[a]=!0;c(Y.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(m(b.querySelectorAll("."+a),c),m(b.querySelectorAll("."+a+"\\:"),c),m(b.querySelectorAll("["+a+"]"),c))});m(d,function(a){if(!e){var b=f.exec(" "+a.className+" ");b?(e=a,g=(b[2]||"").replace(/\s+/g,",")):m(a.attributes, +function(b){if(!e&&i[b.name])e=a,g=b.value})}});e&&a(e,g?[g]:[])}function qb(b,a){b=z(b);a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");var c=rb(a);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,i){a.$apply(function(){b.data("$injector",i);c(b)(a)})}]);return c}function $a(b,a){a=a||"_";return b.replace(kc,function(b,d){return(d?a:"")+b.toLowerCase()})}function ab(b,a,c){if(!b)throw new u("Argument '"+(a||"?")+"' is "+(c||"required")); +return b}function qa(b,a,c){c&&I(b)&&(b=b[b.length-1]);ab(L(b),a,"not a function, got "+(b&&typeof b=="object"?b.constructor.name||"Object":typeof b));return b}function lc(b){function a(a,b,e){return a[b]||(a[b]=e())}return a(a(b,"angular",Object),"module",function(){var b={};return function(d,e,g){e&&b.hasOwnProperty(d)&&(b[d]=null);return a(b,d,function(){function a(c,d,e){return function(){b[e||"push"]([c,d,arguments]);return k}}if(!e)throw u("No module: "+d);var b=[],c=[],j=a("$injector","invoke"), +k={_invokeQueue:b,_runBlocks:c,requires:e,name:d,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:j,run:function(a){c.push(a);return this}};g&&j(g);return k})}})}function sb(b){return b.replace(mc,function(a,b,d,e){return e?d.toUpperCase():d}).replace(nc, +"Moz$1")}function bb(b,a){function c(){var e;for(var b=[this],c=a,i,f,h,j,k,l;b.length;){i=b.shift();f=0;for(h=i.length;f-1}function wb(b,a){a&&m(a.split(" "),function(a){b.className=Q((" "+b.className+" ").replace(/[\n\t]/g," ").replace(" "+Q(a)+" "," "))})}function xb(b,a){a&&m(a.split(" "), +function(a){if(!Ba(b,a))b.className=Q(b.className+" "+Q(a))})}function cb(b,a){if(a)for(var a=!a.nodeName&&v(a.length)&&!oa(a)?a:[a],c=0;c4096&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!")}else{if(h.cookie!==P){P=h.cookie;d=P.split("; ");ba={};for(f=0;f0&&(ba[unescape(e.substring(0,j))]=unescape(e.substring(j+1)))}return ba}};f.defer=function(a,b){var c;n++;c=l(function(){delete r[c]; +e(a)},b||0);r[c]=!0;return c};f.defer.cancel=function(a){return r[a]?(delete r[a],o(a),e(C),!0):!1}}function wc(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new vc(b,d,a,c)}]}function xc(){this.$get=function(){function b(b,d){function e(a){if(a!=l){if(o){if(o==a)o=a.n}else o=a;g(a.n,a.p);g(a,l);l=a;l.n=null}}function g(a,b){if(a!=b){if(a)a.p=b;if(b)b.n=a}}if(b in a)throw u("cacheId "+b+" taken");var i=0,f=y({},d,{id:b}),h={},j=d&&d.capacity||Number.MAX_VALUE,k={}, +l=null,o=null;return a[b]={put:function(a,b){var c=k[a]||(k[a]={key:a});e(c);t(b)||(a in h||i++,h[a]=b,i>j&&this.remove(o.key))},get:function(a){var b=k[a];if(b)return e(b),h[a]},remove:function(a){var b=k[a];if(b){if(b==l)l=b.p;if(b==o)o=b.n;g(b.n,b.p);delete k[a];delete h[a];i--}},removeAll:function(){h={};i=0;k={};l=o=null},destroy:function(){k=f=h=null;delete a[b]},info:function(){return y({},f,{size:i})}}}var a={};b.info=function(){var b={};m(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]}; +return b}}function yc(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Cb(b){var a={},c="Directive",d=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,e=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,g="Template must have exactly one root element. was: ";this.directive=function f(d,e){E(d)?(ab(e,"directive"),a.hasOwnProperty(d)||(a[d]=[],b.factory(d+c,["$injector","$exceptionHandler",function(b,c){var e=[];m(a[d],function(a){try{var f=b.invoke(a);if(L(f))f={compile:H(f)};else if(!f.compile&&f.link)f.compile= +H(f.link);f.priority=f.priority||0;f.name=f.name||d;f.require=f.require||f.controller&&f.name;f.restrict=f.restrict||"A";e.push(f)}catch(j){c(j)}});return e}])),a[d].push(e)):m(d,nb(f));return this};this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope",function(b,h,j,k,l,o,r,n){function w(a,b,c){a instanceof z||(a=z(a));m(a,function(b,c){b.nodeType==3&&b.nodeValue.match(/\S+/)&&(a[c]=z(b).wrap("").parent()[0])});var d=x(a, +b,a,c);return function(b,c){ab(b,"scope");var e=c?ta.clone.call(a):a;e.data("$scope",b);q(e,"ng-scope");c&&c(e,b);d&&d(b,e,e);return e}}function q(a,b){try{a.addClass(b)}catch(c){}}function x(a,b,c,d){function e(a,c,d,j){var g,h,k,n,o,l,r,q=[];o=0;for(l=c.length;oB.priority)break;if(W=B.scope)K("isolated scope",A,B,s),M(W)&&(q(s,"ng-isolate-scope"),A=B),q(s,"ng-scope"),x=x||B;G= +B.name;if(W=B.controller)t=t||{},K("'"+G+"' controller",t[G],B,s),t[G]=B;if(W=B.transclude)K("transclusion",C,B,s),C=B,n=B.priority,W=="element"?(V=z(b),s=c.$$element=z(Y.createComment(" "+G+": "+c[G]+" ")),b=s[0],Fa(e,z(V[0]),b),v=w(V,d,n)):(V=z(db(b)).contents(),s.html(""),v=w(V,d));if(W=B.template)if(K("template",P,B,s),P=B,W=Ha(W),B.replace){V=z("
    "+Q(W)+"
    ").contents();b=V[0];if(V.length!=1||b.nodeType!==1)throw new u(g+W);Fa(e,s,b);G={$attr:{}};a=a.concat(X(b,a.splice(D+1,a.length- +(D+1)),G));J(c,G);F=a.length}else s.html(W);if(B.templateUrl)K("template",P,B,s),P=B,k=ba(a.splice(D,a.length-D),k,s,c,e,B.replace,v),F=a.length;else if(B.compile)try{y=B.compile(s,c,v),L(y)?f(null,y):y&&f(y.pre,y.post)}catch(H){j(H,pa(s))}if(B.terminal)k.terminal=!0,n=Math.max(n,B.priority)}k.scope=x&&x.scope;k.transclude=C&&v;return k}function s(d,e,g,h){var k=!1;if(a.hasOwnProperty(e))for(var n,e=b.get(e+c),o=0,l=e.length;on.priority)&&n.restrict.indexOf(g)!=-1)d.push(n), +k=!0}catch(r){j(r)}return k}function J(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;m(a,function(d,e){e.charAt(0)!="$"&&(b[e]&&(d+=(e==="style"?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});m(b,function(b,f){f=="class"?(q(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):f=="style"?e.attr("style",e.attr("style")+";"+b):f.charAt(0)!="$"&&!a.hasOwnProperty(f)&&(a[f]=b,d[f]=c[f])})}function ba(a,b,c,d,e,f,j){var h=[],n,o,r=c[0],q=a.shift(),w=y({},q,{controller:null,templateUrl:null,transclude:null,scope:null}); +c.html("");k.get(q.templateUrl,{cache:l}).success(function(k){var l,q,k=Ha(k);if(f){q=z("
    "+Q(k)+"
    ").contents();l=q[0];if(q.length!=1||l.nodeType!==1)throw new u(g+k);k={$attr:{}};Fa(e,c,l);X(l,a,k);J(d,k)}else l=r,c.html(k);a.unshift(w);n=A(a,c,d,j);for(o=x(c.contents(),j);h.length;){var ca=h.pop(),k=h.pop();q=h.pop();var s=h.pop(),m=l;q!==r&&(m=db(l),Fa(k,z(q),m));n(function(){b(o,s,m,e,ca)},s,m,e,ca)}h=null}).error(function(a,b,c,d){throw u("Failed to load template: "+d.url);});return function(a, +c,d,e,f){h?(h.push(c),h.push(d),h.push(e),h.push(f)):n(function(){b(o,c,d,e,f)},c,d,e,f)}}function P(a,b){return b.priority-a.priority}function K(a,b,c,d){if(b)throw u("Multiple directives ["+b.name+", "+c.name+"] asking for "+a+" on: "+pa(d));}function G(a,b){var c=h(b,!0);c&&a.push({priority:0,compile:H(function(a,b){var d=b.parent(),e=d.data("$binding")||[];e.push(c);q(d.data("$binding",e),"ng-binding");a.$watch(c,function(a){b[0].nodeValue=a})})})}function V(a,b,c,d){var e=h(c,!0);e&&b.push({priority:100, +compile:H(function(a,b,c){b=c.$$observers||(c.$$observers={});d==="class"&&(e=h(c[d],!0));c[d]=p;(b[d]||(b[d]=[])).$$inter=!0;(c.$$observers&&c.$$observers[d].$$scope||a).$watch(e,function(a){c.$set(d,a)})})})}function Fa(a,b,c){var d=b[0],e=d.parentNode,f,g;if(a){f=0;for(g=a.length;f0){var e=K[0],f=e.text;if(f==a||f==b||f==c||f==d||!a&&!b&&!c&&!d)return e}return!1}function f(b,c, +d,f){return(b=i(b,c,d,f))?(a&&!b.json&&e("is not valid json",b),K.shift(),b):!1}function h(a){f(a)||e("is unexpected, expecting ["+a+"]",i())}function j(a,b){return function(c,d){return a(c,d,b)}}function k(a,b,c){return function(d,e){return b(d,e,a,c)}}function l(){for(var a=[];;)if(K.length>0&&!i("}",")",";","]")&&a.push(v()),!f(";"))return a.length==1?a[0]:function(b,c){for(var d,e=0;e","<=",">="))a=k(a,b.fn,q());return a}function x(){for(var a=m(),b;b=f("*","/","%");)a=k(a, +b.fn,m());return a}function m(){var a;return f("+")?A():(a=f("-"))?k(ba,a.fn,m()):(a=f("!"))?j(a.fn,m()):A()}function A(){var a;if(f("("))a=v(),h(")");else if(f("["))a=s();else if(f("{"))a=J();else{var b=f();(a=b.fn)||e("not a primary expression",b)}for(var c;b=f("(","[",".");)b.text==="("?(a=z(a,c),c=null):b.text==="["?(c=a,a=ea(a)):b.text==="."?(c=a,a=t(a)):e("IMPOSSIBLE");return a}function s(){var a=[];if(g().text!="]"){do a.push(G());while(f(","))}h("]");return function(b,c){for(var d=[],e=0;e< +a.length;e++)d.push(a[e](b,c));return d}}function J(){var a=[];if(g().text!="}"){do{var b=f(),b=b.string||b.text;h(":");var c=G();a.push({key:b,value:c})}while(f(","))}h("}");return function(b,c){for(var d={},e=0;e1;d++){var e=a.shift(),g=b[e];g||(g={},b[e]=g);b=g}return b[a.shift()]=c}function gb(b,a,c){if(!a)return b;for(var a=a.split("."),d,e=b,g=a.length,i=0;i7),hasEvent:function(c){if(c=="input"&&aa==9)return!1;if(t(a[c])){var e=b.document.createElement("div");a[c]="on"+c in e}return a[c]},csp:!1}}]}function Tc(){this.$get=H(T)}function Nb(b){var a={},c,d,e;if(!b)return a;m(b.split("\n"),function(b){e=b.indexOf(":");c=D(Q(b.substr(0,e)));d=Q(b.substr(e+1));c&&(a[c]?a[c]+=", "+d:a[c]=d)});return a}function Ob(b){var a=M(b)?b:p;return function(c){a||(a=Nb(b));return c? +a[D(c)]||null:a}}function Pb(b,a,c){if(L(c))return c(b,a);m(c,function(c){b=c(b,a)});return b}function Uc(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*$/,c=/^\)\]\}',?\n/,d=this.defaults={transformResponse:[function(d){E(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=ob(d,!0)));return d}],transformRequest:[function(a){return M(a)&&Sa.apply(a)!=="[object File]"?da(a):a}],headers:{common:{Accept:"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest"},post:{"Content-Type":"application/json;charset=utf-8"}, +put:{"Content-Type":"application/json;charset=utf-8"}}},e=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,c,h,j,k){function l(a){function c(a){var b=y({},a,{data:Pb(a.data,a.headers,f)});return 200<=a.status&&a.status<300?b:j.reject(b)}a.method=la(a.method);var e=a.transformRequest||d.transformRequest,f=a.transformResponse||d.transformResponse,h=d.headers,h=y({"X-XSRF-TOKEN":b.cookies()["XSRF-TOKEN"]},h.common,h[D(a.method)], +a.headers),e=Pb(a.data,Ob(h),e),g;t(a.data)&&delete h["Content-Type"];g=o(a,e,h);g=g.then(c,c);m(w,function(a){g=a(g)});g.success=function(b){g.then(function(c){b(c.data,c.status,c.headers,a)});return g};g.error=function(b){g.then(null,function(c){b(c.data,c.status,c.headers,a)});return g};return g}function o(b,c,d){function e(a,b,c){m&&(200<=a&&a<300?m.put(w,[a,b,Nb(c)]):m.remove(w));f(b,a,c);h.$apply()}function f(a,c,d){c=Math.max(c,0);(200<=c&&c<300?k.resolve:k.reject)({data:a,status:c,headers:Ob(d), +config:b})}function i(){var a=ya(l.pendingRequests,b);a!==-1&&l.pendingRequests.splice(a,1)}var k=j.defer(),o=k.promise,m,p,w=r(b.url,b.params);l.pendingRequests.push(b);o.then(i,i);b.cache&&b.method=="GET"&&(m=M(b.cache)?b.cache:n);if(m)if(p=m.get(w))if(p.then)return p.then(i,i),p;else I(p)?f(p[1],p[0],U(p[2])):f(p,200,{});else m.put(w,o);p||a(b.method,w,c,e,d,b.timeout,b.withCredentials);return o}function r(a,b){if(!b)return a;var c=[];fc(b,function(a,b){a==null||a==p||(M(a)&&(a=da(a)),c.push(encodeURIComponent(b)+ +"="+encodeURIComponent(a)))});return a+(a.indexOf("?")==-1?"?":"&")+c.join("&")}var n=c("$http"),w=[];m(e,function(a){w.push(E(a)?k.get(a):k.invoke(a))});l.pendingRequests=[];(function(a){m(arguments,function(a){l[a]=function(b,c){return l(y(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){m(arguments,function(a){l[a]=function(b,c,d){return l(y(d||{},{method:a,url:b,data:c}))}})})("post","put");l.defaults=d;return l}]}function Vc(){this.$get=["$browser","$window","$document", +function(b,a,c){return Wc(b,Xc,b.defer,a.angular.callbacks,c[0],a.location.protocol.replace(":",""))}]}function Wc(b,a,c,d,e,g){function i(a,b){var c=e.createElement("script"),d=function(){e.body.removeChild(c);b&&b()};c.type="text/javascript";c.src=a;aa?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror=d;e.body.appendChild(c)}return function(e,h,j,k,l,o,r){function n(a,c,d,e){c=(h.match(Gb)||["",g])[1]=="file"?d?200:404:c;a(c==1223?204:c,d,e);b.$$completeOutstandingRequest(C)} +b.$$incOutstandingRequestCount();h=h||b.url();if(D(e)=="jsonp"){var p="_"+(d.counter++).toString(36);d[p]=function(a){d[p].data=a};i(h.replace("JSON_CALLBACK","angular.callbacks."+p),function(){d[p].data?n(k,200,d[p].data):n(k,-2);delete d[p]})}else{var q=new a;q.open(e,h,!0);m(l,function(a,b){a&&q.setRequestHeader(b,a)});var x;q.onreadystatechange=function(){q.readyState==4&&n(k,x||q.status,q.responseText,q.getAllResponseHeaders())};if(r)q.withCredentials=!0;q.send(j||"");o>0&&c(function(){x=-1; +q.abort()},o)}}}function Yc(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","), +DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return b===1?"one":"other"}}}}function Zc(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(b,a,c,d){function e(e,f,h){var j=c.defer(), +k=j.promise,l=v(h)&&!h,f=a.defer(function(){try{j.resolve(e())}catch(a){j.reject(a),d(a)}l||b.$apply()},f),h=function(){delete g[k.$$timeoutId]};k.$$timeoutId=f;g[f]=j;k.then(h,h);return k}var g={};e.cancel=function(b){return b&&b.$$timeoutId in g?(g[b.$$timeoutId].reject("canceled"),a.defer.cancel(b.$$timeoutId)):!1};return e}]}function Qb(b){function a(a,e){return b.factory(a+c,e)}var c="Filter";this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}];a("currency", +Rb);a("date",Sb);a("filter",$c);a("json",ad);a("limitTo",bd);a("lowercase",cd);a("number",Tb);a("orderBy",Ub);a("uppercase",dd)}function $c(){return function(b,a){if(!(b instanceof Array))return b;var c=[];c.check=function(a){for(var b=0;b-1;case "object":for(var c in a)if(c.charAt(0)!=="$"&& +d(a[c],b))return!0;return!1;case "array":for(c=0;ce+1?i="0":(f=i,j=!0)}if(!j){i= +(i.split(Wb)[1]||"").length;t(e)&&(e=Math.min(Math.max(a.minFrac,i),a.maxFrac));var i=Math.pow(10,e),b=Math.round(b*i)/i,b=(""+b).split(Wb),i=b[0],b=b[1]||"",j=0,k=a.lgSize,l=a.gSize;if(i.length>=k+l)for(var j=i.length-k,o=0;o0||e>-c)e+=c;e===0&&c==-12&&(e=12);return jb(e,a,d)}}function La(b,a){return function(c,d){var e=c["get"+b](),g=la(a?"SHORT"+b:b);return d[g][e]}}function Sb(b){function a(a){var b;if(b=a.match(c)){var a=new Date(0),g=0,i=0;b[9]&&(g=F(b[9]+b[10]),i=F(b[9]+b[11]));a.setUTCFullYear(F(b[1]),F(b[2])-1,F(b[3]));a.setUTCHours(F(b[4]||0)-g,F(b[5]||0)-i,F(b[6]|| +0),F(b[7]||0))}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var g="",i=[],f,h,e=e||"mediumDate",e=b.DATETIME_FORMATS[e]||e;E(c)&&(c=ed.test(c)?F(c):a(c));va(c)&&(c=new Date(c));if(!na(c))return c;for(;e;)(h=fd.exec(e))?(i=i.concat(ia.call(h,1)),e=i.pop()):(i.push(e),e=null);m(i,function(a){f=gd[a];g+=f?f(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function ad(){return function(b){return da(b, +!0)}}function bd(){return function(b,a){if(!(b instanceof Array))return b;var a=F(a),c=[],d,e;if(!b||!(b instanceof Array))return c;a>b.length?a=b.length:a<-b.length&&(a=-b.length);a>0?(d=0,e=a):(d=b.length+a,e=b.length);for(;dl?(d.$setValidity("maxlength",!1),p):(d.$setValidity("maxlength",!0),a)};d.$parsers.push(c);d.$formatters.push(c)}}function kb(b,a){b="ngClass"+b;return R(function(c,d,e){function g(b, +d){if(a===!0||c.$index%2===a)d&&b!==d&&i(d),f(b)}function i(a){M(a)&&!I(a)&&(a=Ta(a,function(a,b){if(a)return b}));d.removeClass(I(a)?a.join(" "):a)}function f(a){M(a)&&!I(a)&&(a=Ta(a,function(a,b){if(a)return b}));a&&d.addClass(I(a)?a.join(" "):a)}c.$watch(e[b],g,!0);e.$observe("class",function(){var a=c.$eval(e[b]);g(a,a)});b!=="ngClass"&&c.$watch("$index",function(d,g){var k=d%2;k!==g%2&&(k==a?f(c.$eval(e[b])):i(c.$eval(e[b])))})})}var D=function(b){return E(b)?b.toLowerCase():b},la=function(b){return E(b)? +b.toUpperCase():b},u=T.Error,aa=F((/msie (\d+)/.exec(D(navigator.userAgent))||[])[1]),z,ja,ia=[].slice,Ra=[].push,Sa=Object.prototype.toString,Zb=T.angular||(T.angular={}),sa,Db,Z=["0","0","0"];C.$inject=[];ma.$inject=[];Db=aa<9?function(b){b=b.nodeName?b:b[0];return b.scopeName&&b.scopeName!="HTML"?la(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var kc=/[A-Z]/g,hd={full:"1.0.4",major:1,minor:0,dot:4,codeName:"bewildering-hair"},Aa=O.cache={},za= +O.expando="ng-"+(new Date).getTime(),oc=1,$b=T.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},eb=T.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)},mc=/([\:\-\_]+(.))/g,nc=/^moz([A-Z])/,ta=O.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;this.bind("DOMContentLoaded",a);O(T).bind("load",a)},toString:function(){var b=[];m(this,function(a){b.push(""+a)}); +return"["+b.join(", ")+"]"},eq:function(b){return b>=0?z(this[b]):z(this[this.length+b])},length:0,push:Ra,sort:[].sort,splice:[].splice},Da={};m("multiple,selected,checked,disabled,readOnly,required".split(","),function(b){Da[D(b)]=b});var Ab={};m("input,select,option,textarea,button,form".split(","),function(b){Ab[la(b)]=!0});m({data:vb,inheritedData:Ca,scope:function(b){return Ca(b,"$scope")},controller:yb,injector:function(b){return Ca(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)}, +hasClass:Ba,css:function(b,a,c){a=sb(a);if(v(c))b.style[a]=c;else{var d;aa<=8&&(d=b.currentStyle&&b.currentStyle[a],d===""&&(d="auto"));d=d||b.style[a];aa<=8&&(d=d===""?p:d);return d}},attr:function(b,a,c){var d=D(a);if(Da[d])if(v(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||C).specified?d:p;else if(v(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),b===null?p:b},prop:function(b,a,c){if(v(c))b[a]=c;else return b[a]}, +text:y(aa<9?function(b,a){if(b.nodeType==1){if(t(a))return b.innerText;b.innerText=a}else{if(t(a))return b.nodeValue;b.nodeValue=a}}:function(b,a){if(t(a))return b.textContent;b.textContent=a},{$dv:""}),val:function(b,a){if(t(a))return b.value;b.value=a},html:function(b,a){if(t(a))return b.innerHTML;for(var c=0,d=b.childNodes;c":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)}, +"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Kc={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'},ib={},Xc=T.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw new u("This browser does not support XMLHttpRequest.");};Qb.$inject=["$provide"];Rb.$inject= +["$locale"];Tb.$inject=["$locale"];var Wb=".",gd={yyyy:N("FullYear",4),yy:N("FullYear",2,0,!0),y:N("FullYear",1),MMMM:La("Month"),MMM:La("Month",!0),MM:N("Month",2,1),M:N("Month",1,1),dd:N("Date",2),d:N("Date",1),HH:N("Hours",2),H:N("Hours",1),hh:N("Hours",2,-12),h:N("Hours",1,-12),mm:N("Minutes",2),m:N("Minutes",1),ss:N("Seconds",2),s:N("Seconds",1),EEEE:La("Day"),EEE:La("Day",!0),a:function(a,c){return a.getHours()<12?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=a.getTimezoneOffset();return jb(a/60,2)+ +jb(Math.abs(a%60),2)}},fd=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,ed=/^\d+$/;Sb.$inject=["$locale"];var cd=H(D),dd=H(la);Ub.$inject=["$parse"];var id=H({restrict:"E",compile:function(a,c){c.href||c.$set("href","");return function(a,c){c.bind("click",function(a){c.attr("href")||a.preventDefault()})}}}),lb={};m(Da,function(a,c){var d=fa("ng-"+c);lb[d]=function(){return{priority:100,compile:function(){return function(a,g,i){a.$watch(i[d],function(a){i.$set(c,!!a)})}}}}}); +m(["src","href"],function(a){var c=fa("ng-"+a);lb[c]=function(){return{priority:99,link:function(d,e,g){g.$observe(c,function(c){c&&(g.$set(a,c),aa&&e.prop(a,c))})}}}});var Oa={$addControl:C,$removeControl:C,$setValidity:C,$setDirty:C};Xb.$inject=["$element","$attrs","$scope"];var Ra=function(a){return["$timeout",function(c){var d={name:"form",restrict:"E",controller:Xb,compile:function(){return{pre:function(a,d,i,f){if(!i.action){var h=function(a){a.preventDefault?a.preventDefault():a.returnValue= +!1};$b(d[0],"submit",h);d.bind("$destroy",function(){c(function(){eb(d[0],"submit",h)},0,!1)})}var j=d.parent().controller("form"),k=i.name||i.ngForm;k&&(a[k]=f);j&&d.bind("$destroy",function(){j.$removeControl(f);k&&(a[k]=p);y(f,Oa)})}}}};return a?y(U(d),{restrict:"EAC"}):d}]},jd=Ra(),kd=Ra(!0),ld=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,md=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,nd=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,bc={text:Qa,number:function(a, +c,d,e,g,i){Qa(a,c,d,e,g,i);e.$parsers.push(function(a){var c=S(a);return c||nd.test(a)?(e.$setValidity("number",!0),a===""?null:c?a:parseFloat(a)):(e.$setValidity("number",!1),p)});e.$formatters.push(function(a){return S(a)?"":""+a});if(d.min){var f=parseFloat(d.min),a=function(a){return!S(a)&&ah?(e.$setValidity("max",!1),p):(e.$setValidity("max", +!0),a)};e.$parsers.push(d);e.$formatters.push(d)}e.$formatters.push(function(a){return S(a)||va(a)?(e.$setValidity("number",!0),a):(e.$setValidity("number",!1),p)})},url:function(a,c,d,e,g,i){Qa(a,c,d,e,g,i);a=function(a){return S(a)||ld.test(a)?(e.$setValidity("url",!0),a):(e.$setValidity("url",!1),p)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,g,i){Qa(a,c,d,e,g,i);a=function(a){return S(a)||md.test(a)?(e.$setValidity("email",!0),a):(e.$setValidity("email",!1),p)};e.$formatters.push(a); +e.$parsers.push(a)},radio:function(a,c,d,e){t(d.name)&&c.attr("name",wa());c.bind("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var g=d.ngTrueValue,i=d.ngFalseValue;E(g)||(g=!0);E(i)||(i=!1);c.bind("click",function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$formatters.push(function(a){return a=== +g});e.$parsers.push(function(a){return a?g:i})},hidden:C,button:C,submit:C,reset:C},cc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,g,i){i&&(bc[D(g.type)]||bc.text)(d,e,g,i,c,a)}}}],Na="ng-valid",Ma="ng-invalid",Pa="ng-pristine",Yb="ng-dirty",od=["$scope","$exceptionHandler","$attrs","$element","$parse",function(a,c,d,e,g){function i(a,c){c=c?"-"+$a(c,"-"):"";e.removeClass((a?Ma:Na)+c).addClass((a?Na:Ma)+c)}this.$modelValue=this.$viewValue=Number.NaN; +this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var f=g(d.ngModel),h=f.assign;if(!h)throw u(Eb+d.ngModel+" ("+pa(e)+")");this.$render=C;var j=e.inheritedData("$formController")||Oa,k=0,l=this.$error={};e.addClass(Pa);i(!0);this.$setValidity=function(a,c){if(l[a]!==!c){if(c){if(l[a]&&k--,!k)i(!0),this.$valid=!0,this.$invalid=!1}else i(!1),this.$invalid=!0,this.$valid=!1,k++;l[a]=!c;i(c,a);j.$setValidity(a, +c,this)}};this.$setViewValue=function(d){this.$viewValue=d;if(this.$pristine)this.$dirty=!0,this.$pristine=!1,e.removeClass(Pa).addClass(Yb),j.$setDirty();m(this.$parsers,function(a){d=a(d)});if(this.$modelValue!==d)this.$modelValue=d,h(a,d),m(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};var o=this;a.$watch(function(){var c=f(a);if(o.$modelValue!==c){var d=o.$formatters,e=d.length;for(o.$modelValue=c;e--;)c=d[e](c);if(o.$viewValue!==c)o.$viewValue=c,o.$render()}})}],pd=function(){return{require:["ngModel", +"^?form"],controller:od,link:function(a,c,d,e){var g=e[0],i=e[1]||Oa;i.$addControl(g);c.bind("$destroy",function(){i.$removeControl(g)})}}},qd=H({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),dc=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=!0;var g=function(a){if(d.required&&(S(a)||a===!1))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(g);e.$parsers.unshift(g); +d.$observe("required",function(){g(e.$viewValue)})}}}},rd=function(){return{require:"ngModel",link:function(a,c,d,e){var g=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){var c=[];a&&m(a.split(g),function(a){a&&c.push(Q(a))});return c});e.$formatters.push(function(a){return I(a)?a.join(", "):p})}}},sd=/^(true|false|\d+)$/,td=function(){return{priority:100,compile:function(a,c){return sd.test(c.ngValue)?function(a,c,g){g.$set("value",a.$eval(g.ngValue))}:function(a, +c,g){a.$watch(g.ngValue,function(a){g.$set("value",a,!1)})}}}},ud=R(function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==p?"":a)})}),vd=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],wd=[function(){return function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBindHtmlUnsafe);a.$watch(d.ngBindHtmlUnsafe, +function(a){c.html(a||"")})}}],xd=kb("",!0),yd=kb("Odd",0),zd=kb("Even",1),Ad=R({compile:function(a,c){c.$set("ngCloak",p);a.removeClass("ng-cloak")}}),Bd=[function(){return{scope:!0,controller:"@"}}],Cd=["$sniffer",function(a){return{priority:1E3,compile:function(){a.csp=!0}}}],ec={};m("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave".split(" "),function(a){var c=fa("ng-"+a);ec[c]=["$parse",function(d){return function(e,g,i){var f=d(i[c]);g.bind(D(a),function(a){e.$apply(function(){f(e, +{$event:a})})})}}]});var Dd=R(function(a,c,d){c.bind("submit",function(){a.$apply(d.ngSubmit)})}),Ed=["$http","$templateCache","$anchorScroll","$compile",function(a,c,d,e){return{restrict:"ECA",terminal:!0,compile:function(g,i){var f=i.ngInclude||i.src,h=i.onload||"",j=i.autoscroll;return function(g,i){var o=0,m,n=function(){m&&(m.$destroy(),m=null);i.html("")};g.$watch(f,function(f){var q=++o;f?a.get(f,{cache:c}).success(function(a){q===o&&(m&&m.$destroy(),m=g.$new(),i.html(a),e(i.contents())(m), +v(j)&&(!j||g.$eval(j))&&d(),m.$emit("$includeContentLoaded"),g.$eval(h))}).error(function(){q===o&&n()}):n()})}}}}],Fd=R({compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Gd=R({terminal:!0,priority:1E3}),Hd=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,g,i){var f=i.count,h=g.attr(i.$attr.when),j=i.offset||0,k=e.$eval(h),l={},o=c.startSymbol(),r=c.endSymbol();m(k,function(a,e){l[e]=c(a.replace(d,o+f+"-"+j+r))});e.$watch(function(){var c= +parseFloat(e.$eval(f));return isNaN(c)?"":(k[c]||(c=a.pluralCat(c-j)),l[c](e,g,!0))},function(a){g.text(a)})}}}],Id=R({transclude:"element",priority:1E3,terminal:!0,compile:function(a,c,d){return function(a,c,i){var f=i.ngRepeat,i=f.match(/^\s*(.+)\s+in\s+(.*)\s*$/),h,j,k;if(!i)throw u("Expected ngRepeat in form of '_item_ in _collection_' but got '"+f+"'.");f=i[1];h=i[2];i=f.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!i)throw u("'item' in 'item in collection' should be identifier or (key, value) but got '"+ +f+"'.");j=i[3]||i[1];k=i[2];var l=new fb;a.$watch(function(a){var e,f,i=a.$eval(h),m=c,p=new fb,z,A,s,v,t,u;if(I(i))t=i||[];else{t=[];for(s in i)i.hasOwnProperty(s)&&s.charAt(0)!="$"&&t.push(s);t.sort()}z=t.length;e=0;for(f=t.length;ey;)v.pop().element.remove()}for(;s.length>w;)s.pop()[0].element.remove()}var i;if(!(i=w.match(d)))throw u("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+w+"'."); +var j=c(i[2]||i[1]),k=i[4]||i[6],l=i[5],m=c(i[3]||""),o=c(i[2]?i[1]:k),r=c(i[7]),s=[[{element:f,label:""}]];q&&(a(q)(e),q.removeClass("ng-scope"),q.remove());f.html("");f.bind("change",function(){e.$apply(function(){var a,c=r(e)||[],d={},h,i,j,m,q,t;if(n){i=[];m=0;for(t=s.length;m@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}'); diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/js/bootstrap.min.js b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/js/bootstrap.min.js new file mode 100644 index 00000000000..6eeb15ce3b7 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Content/js/bootstrap.min.js @@ -0,0 +1,6 @@ +/*! +* Bootstrap.js by @fat & @mdo +* Copyright 2012 Twitter, Inc. +* http://www.apache.org/licenses/LICENSE-2.0.txt +*/ +!function($){"use strict";$(function(){$.support.transition=function(){var transitionEnd=function(){var name,el=document.createElement("bootstrap"),transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(name in transEndEventNames)if(void 0!==el.style[name])return transEndEventNames[name]}();return transitionEnd&&{end:transitionEnd}}()})}(window.jQuery),!function($){"use strict";var dismiss='[data-dismiss="alert"]',Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.prototype.close=function(e){function removeElement(){$parent.trigger("closed").remove()}var $parent,$this=$(this),selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),e&&e.preventDefault(),$parent.length||($parent=$this.hasClass("alert")?$this:$this.parent()),$parent.trigger(e=$.Event("close")),e.isDefaultPrevented()||($parent.removeClass("in"),$.support.transition&&$parent.hasClass("fade")?$parent.on($.support.transition.end,removeElement):removeElement())};var old=$.fn.alert;$.fn.alert=function(option){return this.each(function(){var $this=$(this),data=$this.data("alert");data||$this.data("alert",data=new Alert(this)),"string"==typeof option&&data[option].call($this)})},$.fn.alert.Constructor=Alert,$.fn.alert.noConflict=function(){return $.fn.alert=old,this},$(document).on("click.alert.data-api",dismiss,Alert.prototype.close)}(window.jQuery),!function($){"use strict";var Button=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.button.defaults,options)};Button.prototype.setState=function(state){var d="disabled",$el=this.$element,data=$el.data(),val=$el.is("input")?"val":"html";state+="Text",data.resetText||$el.data("resetText",$el[val]()),$el[val](data[state]||this.options[state]),setTimeout(function(){"loadingText"==state?$el.addClass(d).attr(d,d):$el.removeClass(d).removeAttr(d)},0)},Button.prototype.toggle=function(){var $parent=this.$element.closest('[data-toggle="buttons-radio"]');$parent&&$parent.find(".active").removeClass("active"),this.$element.toggleClass("active")};var old=$.fn.button;$.fn.button=function(option){return this.each(function(){var $this=$(this),data=$this.data("button"),options="object"==typeof option&&option;data||$this.data("button",data=new Button(this,options)),"toggle"==option?data.toggle():option&&data.setState(option)})},$.fn.button.defaults={loadingText:"loading..."},$.fn.button.Constructor=Button,$.fn.button.noConflict=function(){return $.fn.button=old,this},$(document).on("click.button.data-api","[data-toggle^=button]",function(e){var $btn=$(e.target);$btn.hasClass("btn")||($btn=$btn.closest(".btn")),$btn.button("toggle")})}(window.jQuery),!function($){"use strict";var Carousel=function(element,options){this.$element=$(element),this.options=options,"hover"==this.options.pause&&this.$element.on("mouseenter",$.proxy(this.pause,this)).on("mouseleave",$.proxy(this.cycle,this))};Carousel.prototype={cycle:function(e){return e||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval)),this},to:function(pos){var $active=this.$element.find(".item.active"),children=$active.parent().children(),activePos=children.index($active),that=this;if(!(pos>children.length-1||0>pos))return this.sliding?this.$element.one("slid",function(){that.to(pos)}):activePos==pos?this.pause().cycle():this.slide(pos>activePos?"next":"prev",$(children[pos]))},pause:function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&$.support.transition.end&&(this.$element.trigger($.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){return this.sliding?void 0:this.slide("next")},prev:function(){return this.sliding?void 0:this.slide("prev")},slide:function(type,next){var e,$active=this.$element.find(".item.active"),$next=next||$active[type](),isCycling=this.interval,direction="next"==type?"left":"right",fallback="next"==type?"first":"last",that=this;if(this.sliding=!0,isCycling&&this.pause(),$next=$next.length?$next:this.$element.find(".item")[fallback](),e=$.Event("slide",{relatedTarget:$next[0]}),!$next.hasClass("active")){if($.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(e),e.isDefaultPrevented())return;$next.addClass(type),$next[0].offsetWidth,$active.addClass(direction),$next.addClass(direction),this.$element.one($.support.transition.end,function(){$next.removeClass([type,direction].join(" ")).addClass("active"),$active.removeClass(["active",direction].join(" ")),that.sliding=!1,setTimeout(function(){that.$element.trigger("slid")},0)})}else{if(this.$element.trigger(e),e.isDefaultPrevented())return;$active.removeClass("active"),$next.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return isCycling&&this.cycle(),this}}};var old=$.fn.carousel;$.fn.carousel=function(option){return this.each(function(){var $this=$(this),data=$this.data("carousel"),options=$.extend({},$.fn.carousel.defaults,"object"==typeof option&&option),action="string"==typeof option?option:options.slide;data||$this.data("carousel",data=new Carousel(this,options)),"number"==typeof option?data.to(option):action?data[action]():options.interval&&data.cycle()})},$.fn.carousel.defaults={interval:5e3,pause:"hover"},$.fn.carousel.Constructor=Carousel,$.fn.carousel.noConflict=function(){return $.fn.carousel=old,this},$(document).on("click.carousel.data-api","[data-slide]",function(e){var href,$this=$(this),$target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"")),options=$.extend({},$target.data(),$this.data());$target.carousel(options),e.preventDefault()})}(window.jQuery),!function($){"use strict";var Collapse=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.collapse.defaults,options),this.options.parent&&(this.$parent=$(this.options.parent)),this.options.toggle&&this.toggle()};Collapse.prototype={constructor:Collapse,dimension:function(){var hasWidth=this.$element.hasClass("width");return hasWidth?"width":"height"},show:function(){var dimension,scroll,actives,hasData;if(!this.transitioning){if(dimension=this.dimension(),scroll=$.camelCase(["scroll",dimension].join("-")),actives=this.$parent&&this.$parent.find("> .accordion-group > .in"),actives&&actives.length){if(hasData=actives.data("collapse"),hasData&&hasData.transitioning)return;actives.collapse("hide"),hasData||actives.data("collapse",null)}this.$element[dimension](0),this.transition("addClass",$.Event("show"),"shown"),$.support.transition&&this.$element[dimension](this.$element[0][scroll])}},hide:function(){var dimension;this.transitioning||(dimension=this.dimension(),this.reset(this.$element[dimension]()),this.transition("removeClass",$.Event("hide"),"hidden"),this.$element[dimension](0))},reset:function(size){var dimension=this.dimension();return this.$element.removeClass("collapse")[dimension](size||"auto")[0].offsetWidth,this.$element[null!==size?"addClass":"removeClass"]("collapse"),this},transition:function(method,startEvent,completeEvent){var that=this,complete=function(){"show"==startEvent.type&&that.reset(),that.transitioning=0,that.$element.trigger(completeEvent)};this.$element.trigger(startEvent),startEvent.isDefaultPrevented()||(this.transitioning=1,this.$element[method]("in"),$.support.transition&&this.$element.hasClass("collapse")?this.$element.one($.support.transition.end,complete):complete())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var old=$.fn.collapse;$.fn.collapse=function(option){return this.each(function(){var $this=$(this),data=$this.data("collapse"),options="object"==typeof option&&option;data||$this.data("collapse",data=new Collapse(this,options)),"string"==typeof option&&data[option]()})},$.fn.collapse.defaults={toggle:!0},$.fn.collapse.Constructor=Collapse,$.fn.collapse.noConflict=function(){return $.fn.collapse=old,this},$(document).on("click.collapse.data-api","[data-toggle=collapse]",function(e){var href,$this=$(this),target=$this.attr("data-target")||e.preventDefault()||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""),option=$(target).data("collapse")?"toggle":$this.data();$this[$(target).hasClass("in")?"addClass":"removeClass"]("collapsed"),$(target).collapse(option)})}(window.jQuery),!function($){"use strict";function clearMenus(){$(toggle).each(function(){getParent($(this)).removeClass("open")})}function getParent($this){var $parent,selector=$this.attr("data-target");return selector||(selector=$this.attr("href"),selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),$parent.length||($parent=$this.parent()),$parent}var toggle="[data-toggle=dropdown]",Dropdown=function(element){var $el=$(element).on("click.dropdown.data-api",this.toggle);$("html").on("click.dropdown.data-api",function(){$el.parent().removeClass("open")})};Dropdown.prototype={constructor:Dropdown,toggle:function(){var $parent,isActive,$this=$(this);if(!$this.is(".disabled, :disabled"))return $parent=getParent($this),isActive=$parent.hasClass("open"),clearMenus(),isActive||$parent.toggleClass("open"),$this.focus(),!1},keydown:function(e){var $this,$items,$parent,isActive,index;if(/(38|40|27)/.test(e.keyCode)&&($this=$(this),e.preventDefault(),e.stopPropagation(),!$this.is(".disabled, :disabled"))){if($parent=getParent($this),isActive=$parent.hasClass("open"),!isActive||isActive&&27==e.keyCode)return $this.click();$items=$("[role=menu] li:not(.divider):visible a",$parent),$items.length&&(index=$items.index($items.filter(":focus")),38==e.keyCode&&index>0&&index--,40==e.keyCode&&$items.length-1>index&&index++,~index||(index=0),$items.eq(index).focus())}}};var old=$.fn.dropdown;$.fn.dropdown=function(option){return this.each(function(){var $this=$(this),data=$this.data("dropdown");data||$this.data("dropdown",data=new Dropdown(this)),"string"==typeof option&&data[option].call($this)})},$.fn.dropdown.Constructor=Dropdown,$.fn.dropdown.noConflict=function(){return $.fn.dropdown=old,this},$(document).on("click.dropdown.data-api touchstart.dropdown.data-api",clearMenus).on("click.dropdown touchstart.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("touchstart.dropdown.data-api",".dropdown-menu",function(e){e.stopPropagation()}).on("click.dropdown.data-api touchstart.dropdown.data-api",toggle,Dropdown.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api",toggle+", [role=menu]",Dropdown.prototype.keydown)}(window.jQuery),!function($){"use strict";var Modal=function(element,options){this.options=options,this.$element=$(element).delegate('[data-dismiss="modal"]',"click.dismiss.modal",$.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};Modal.prototype={constructor:Modal,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var that=this,e=$.Event("show");this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass("fade");that.$element.parent().length||that.$element.appendTo(document.body),that.$element.show(),transition&&that.$element[0].offsetWidth,that.$element.addClass("in").attr("aria-hidden",!1),that.enforceFocus(),transition?that.$element.one($.support.transition.end,function(){that.$element.focus().trigger("shown")}):that.$element.focus().trigger("shown")}))},hide:function(e){e&&e.preventDefault(),e=$.Event("hide"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),$(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),$.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var that=this;$(document).on("focusin.modal",function(e){that.$element[0]===e.target||that.$element.has(e.target).length||that.$element.focus()})},escape:function(){var that=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(e){27==e.which&&that.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var that=this,timeout=setTimeout(function(){that.$element.off($.support.transition.end),that.hideModal()},500);this.$element.one($.support.transition.end,function(){clearTimeout(timeout),that.hideModal()})},hideModal:function(){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(callback){var animate=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate;this.$backdrop=$(' +
    +
    +
    + List of orders +
    + Heads up! Once you place an order, you have 20 secs to cancel it. +
    + + + + + + + + + + + + + + + + + + + + +
    #Video(s)Status 
    + No order yet, place some orders above +
    {{order.number}}
    {{title}}
    {{order.status}}
    +
    +
    +
    +
    + Orders Received + + + + + + + + + + + + + + + + +
    #Video(s)
    + No orders received yet +
    {{order.number}}
    +
    +
    +
    + diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/Views/Shared/_Layout.cshtml b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Views/Shared/_Layout.cshtml new file mode 100644 index 00000000000..b6bcbb07c06 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Views/Shared/_Layout.cshtml @@ -0,0 +1,54 @@ + + + + + + @ViewBag.Title + + + + + + + + + + @RenderSection("head", required: false) + + + + +
    + @RenderBody() +
    + + + \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/Views/Web.config b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Views/Web.config new file mode 100644 index 00000000000..a575d7cc087 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Views/Web.config @@ -0,0 +1,35 @@ + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/Views/_ViewStart.cshtml b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Views/_ViewStart.cshtml new file mode 100644 index 00000000000..efda124b1fc --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/Web.Debug.config b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Web.Debug.config new file mode 100644 index 00000000000..2251b2c596e --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/Web.Release.config b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Web.Release.config new file mode 100644 index 00000000000..90b9041232d --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/Web.config b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Web.config new file mode 100644 index 00000000000..2fcb8ba8362 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ECommerce/Web.config @@ -0,0 +1,28 @@ + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.Msmq/VideoStore.ECommerce/packages.config b/Samples/VideoStore.Msmq/VideoStore.ECommerce/packages.config new file mode 100644 index 00000000000..98f61ab987d --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.ECommerce/packages.config @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.Messages/Commands/CancelOrder.cs b/Samples/VideoStore.Msmq/VideoStore.Messages/Commands/CancelOrder.cs new file mode 100644 index 00000000000..5a6b5e9b374 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Messages/Commands/CancelOrder.cs @@ -0,0 +1,8 @@ +namespace VideoStore.Messages.Commands +{ + public class CancelOrder + { + public int OrderNumber { get; set; } + public string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.Messages/Commands/SubmitOrder.cs b/Samples/VideoStore.Msmq/VideoStore.Messages/Commands/SubmitOrder.cs new file mode 100644 index 00000000000..6d2ce27cb10 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Messages/Commands/SubmitOrder.cs @@ -0,0 +1,11 @@ +namespace VideoStore.Messages.Commands +{ + public class SubmitOrder + { + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + public string EncryptedCreditCardNumber { get; set; } + public string EncryptedExpirationDate { get; set; } + } +} diff --git a/Samples/VideoStore.Msmq/VideoStore.Messages/Events/ClientBecamePreferred.cs b/Samples/VideoStore.Msmq/VideoStore.Messages/Events/ClientBecamePreferred.cs new file mode 100644 index 00000000000..6f73e54cbdf --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Messages/Events/ClientBecamePreferred.cs @@ -0,0 +1,10 @@ +namespace VideoStore.Messages.Events +{ + using System; + + public class ClientBecamePreferred + { + public string ClientId { get; set; } + public DateTime PreferredStatusExpiresOn { get; set; } + } +} diff --git a/Samples/VideoStore.Msmq/VideoStore.Messages/Events/DownloadIsReady.cs b/Samples/VideoStore.Msmq/VideoStore.Messages/Events/DownloadIsReady.cs new file mode 100644 index 00000000000..7ba10112e13 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Messages/Events/DownloadIsReady.cs @@ -0,0 +1,11 @@ +namespace VideoStore.Messages.Events +{ + using System.Collections.Generic; + + public interface DownloadIsReady + { + int OrderNumber { get; set; } + Dictionary VideoUrls { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.Messages/Events/OrderAccepted.cs b/Samples/VideoStore.Msmq/VideoStore.Messages/Events/OrderAccepted.cs new file mode 100644 index 00000000000..e37e0b6ac56 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Messages/Events/OrderAccepted.cs @@ -0,0 +1,10 @@ +namespace VideoStore.Messages.Events +{ + //NServiceBus messages can be defined using both classes and interfaces + public interface OrderAccepted + { + int OrderNumber { get; set; } + string[] VideoIds { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.Messages/Events/OrderCancelled.cs b/Samples/VideoStore.Msmq/VideoStore.Messages/Events/OrderCancelled.cs new file mode 100644 index 00000000000..b7c456edee2 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Messages/Events/OrderCancelled.cs @@ -0,0 +1,8 @@ +namespace VideoStore.Messages.Events +{ + public interface OrderCancelled + { + int OrderNumber { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.Messages/Events/OrderPlaced.cs b/Samples/VideoStore.Msmq/VideoStore.Messages/Events/OrderPlaced.cs new file mode 100644 index 00000000000..e638040b37e --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Messages/Events/OrderPlaced.cs @@ -0,0 +1,9 @@ +namespace VideoStore.Messages.Events +{ + public interface OrderPlaced + { + int OrderNumber { get; set; } + string[] VideoIds { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.Messages/Properties/AssemblyInfo.cs b/Samples/VideoStore.Msmq/VideoStore.Messages/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..5972cb6d3a7 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Messages/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyMessages")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyMessages")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("4687cda1-7646-49ca-83ad-35500037bda3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.Msmq/VideoStore.Messages/RequestResponse/ProvisionDownloadRequest.cs b/Samples/VideoStore.Msmq/VideoStore.Messages/RequestResponse/ProvisionDownloadRequest.cs new file mode 100644 index 00000000000..8f40dbdfc58 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Messages/RequestResponse/ProvisionDownloadRequest.cs @@ -0,0 +1,9 @@ +namespace VideoStore.Messages.RequestResponse +{ + public class ProvisionDownloadRequest + { + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + } +} diff --git a/Samples/VideoStore.Msmq/VideoStore.Messages/RequestResponse/ProvisionDownloadResponse.cs b/Samples/VideoStore.Msmq/VideoStore.Messages/RequestResponse/ProvisionDownloadResponse.cs new file mode 100644 index 00000000000..5b58f9d8d8b --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Messages/RequestResponse/ProvisionDownloadResponse.cs @@ -0,0 +1,9 @@ +namespace VideoStore.Messages.RequestResponse +{ + public class ProvisionDownloadResponse + { + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + } +} diff --git a/Samples/VideoStore.Msmq/VideoStore.Messages/VideoStore.Messages.csproj b/Samples/VideoStore.Msmq/VideoStore.Messages/VideoStore.Messages.csproj new file mode 100644 index 00000000000..04e6a791de0 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Messages/VideoStore.Messages.csproj @@ -0,0 +1,67 @@ + + + + + + Debug + AnyCPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679} + Library + Properties + VideoStore.Messages + VideoStore.Messages + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.Msmq.sln b/Samples/VideoStore.Msmq/VideoStore.Msmq.sln new file mode 100644 index 00000000000..d6c86602ae6 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Msmq.sln @@ -0,0 +1,57 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{FC318FC3-ED0F-4130-BD33-E970AE78A56C}" + ProjectSection(SolutionItems) = preProject + .nuget\NuGet.Config = .nuget\NuGet.Config + .nuget\NuGet.exe = .nuget\NuGet.exe + .nuget\NuGet.targets = .nuget\NuGet.targets + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.Messages", "VideoStore.Messages\VideoStore.Messages.csproj", "{59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.CustomerRelations", "VideoStore.CustomerRelations\VideoStore.CustomerRelations.csproj", "{CD522757-4C40-49C7-94C5-CD5DA956BAFC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.Operations", "VideoStore.Operations\VideoStore.Operations.csproj", "{0B353423-4655-4523-B4E0-F191DDDF0ABF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.Sales", "VideoStore.Sales\VideoStore.Sales.csproj", "{C2D005B5-065F-4F81-BA1F-259F90E00AEE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.ContentManagement", "VideoStore.ContentManagement\VideoStore.ContentManagement.csproj", "{C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.ECommerce", "VideoStore.ECommerce\VideoStore.ECommerce.csproj", "{F295D85E-4447-44E4-A9CC-3E017CF2B0D8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Release|Any CPU.Build.0 = Release|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Release|Any CPU.Build.0 = Release|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Release|Any CPU.Build.0 = Release|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Release|Any CPU.Build.0 = Release|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Release|Any CPU.Build.0 = Release|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Samples/VideoStore.Msmq/VideoStore.Msmq.v11.suo b/Samples/VideoStore.Msmq/VideoStore.Msmq.v11.suo new file mode 100644 index 00000000000..911c0ccaef3 Binary files /dev/null and b/Samples/VideoStore.Msmq/VideoStore.Msmq.v11.suo differ diff --git a/Samples/VideoStore.Msmq/VideoStore.Operations/App.config b/Samples/VideoStore.Msmq/VideoStore.Operations/App.config new file mode 100644 index 00000000000..0ce9bd91db0 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Operations/App.config @@ -0,0 +1,17 @@ + + + +
    +
    +
    + + + + + + + + + + + diff --git a/Samples/VideoStore.Msmq/VideoStore.Operations/EndpointConfig.cs b/Samples/VideoStore.Msmq/VideoStore.Operations/EndpointConfig.cs new file mode 100644 index 00000000000..ee1c6ee1592 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Operations/EndpointConfig.cs @@ -0,0 +1,22 @@ +namespace VideoStore.Operations +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, UsingTransport + { + } + + public class MyClass : IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.Operations endpoint is now started and ready to accept messages"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.Msmq/VideoStore.Operations/Properties/AssemblyInfo.cs b/Samples/VideoStore.Msmq/VideoStore.Operations/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..ff7833e6eb7 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Operations/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyRequestResponseEndpoint")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyRequestResponseEndpoint")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f2941769-d352-4bba-aa24-6974cf3d7e2a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.Msmq/VideoStore.Operations/ProvisionDownloadHandler.cs b/Samples/VideoStore.Msmq/VideoStore.Operations/ProvisionDownloadHandler.cs new file mode 100644 index 00000000000..b1bdb94c4bb --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Operations/ProvisionDownloadHandler.cs @@ -0,0 +1,30 @@ +namespace VideoStore.Operations +{ + using System; + using System.Diagnostics; + using VideoStore.Common; + using VideoStore.Messages.RequestResponse; + using NServiceBus; + + public class ProvisionDownloadHandler : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(ProvisionDownloadRequest message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.Out.WriteLine("Provision the videos and make the Urls available to the Content management for download ...[{0}] video(s) to provision", String.Join(", ", message.VideoIds)); + + Bus.Reply(new ProvisionDownloadResponse + { + OrderNumber = message.OrderNumber, + VideoIds = message.VideoIds, + ClientId = message.ClientId + }); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.Operations/VideoStore.Operations.csproj b/Samples/VideoStore.Msmq/VideoStore.Operations/VideoStore.Operations.csproj new file mode 100644 index 00000000000..454b42980e3 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Operations/VideoStore.Operations.csproj @@ -0,0 +1,90 @@ + + + + + + Debug + AnyCPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF} + Library + Properties + VideoStore.Operations + VideoStore.Operations + v4.0 + 512 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + DebugFlagMutator.cs + + + UnobtrusiveMessageConventions.cs + + + + + + + + + + + Designer + + + Designer + + + + + {59f2ba7e-4da5-49f8-9dbc-520fa99f4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.Operations/packages.config b/Samples/VideoStore.Msmq/VideoStore.Operations/packages.config new file mode 100644 index 00000000000..79ece06bef6 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Operations/packages.config @@ -0,0 +1,3 @@ + + + diff --git a/Samples/VideoStore.Msmq/VideoStore.Sales/App.config b/Samples/VideoStore.Msmq/VideoStore.Sales/App.config new file mode 100644 index 00000000000..2c39eaeb5a6 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Sales/App.config @@ -0,0 +1,22 @@ + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.Msmq/VideoStore.Sales/EndpointConfig.cs b/Samples/VideoStore.Msmq/VideoStore.Sales/EndpointConfig.cs new file mode 100644 index 00000000000..f7338ac400d --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Sales/EndpointConfig.cs @@ -0,0 +1,29 @@ +namespace VideoStore.Sales +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, UsingTransport, IWantCustomInitialization + { + public void Init() + { + Configure.With() + .DefaultBuilder() + .RijndaelEncryptionService(); + } + } + + + public class MyClass:IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.Sales endpoint is now started and ready to accept messages"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.Msmq/VideoStore.Sales/ProcessOrderSaga.cs b/Samples/VideoStore.Msmq/VideoStore.Sales/ProcessOrderSaga.cs new file mode 100644 index 00000000000..ee3dfc1358d --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Sales/ProcessOrderSaga.cs @@ -0,0 +1,90 @@ +namespace VideoStore.Sales +{ + using System; + using System.Diagnostics; + using Common; + using Messages.Commands; + using Messages.Events; + using NServiceBus; + using NServiceBus.Saga; + + public class ProcessOrderSaga : Saga, + IAmStartedByMessages, + IHandleMessages, + IHandleTimeouts + { + public void Handle(SubmitOrder message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Data.OrderNumber = message.OrderNumber; + Data.VideoIds = message.VideoIds; + Data.ClientId = message.ClientId; + + RequestTimeout(TimeSpan.FromSeconds(20), new BuyersRemorseIsOver()); + Console.Out.WriteLine("Starting cool down period for order #{0}.", Data.OrderNumber); + } + + public void Timeout(BuyersRemorseIsOver state) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Bus.Publish(e => + { + e.OrderNumber = Data.OrderNumber; + e.VideoIds = Data.VideoIds; + e.ClientId = Data.ClientId; + }); + + MarkAsComplete(); + + Console.Out.WriteLine("Cooling down period for order #{0} has elapsed.", Data.OrderNumber); + } + + public void Handle(CancelOrder message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + MarkAsComplete(); + + Bus.Publish(Bus.CreateInstance(o => + { + o.OrderNumber = message.OrderNumber; + o.ClientId = message.ClientId; + })); + + Console.Out.WriteLine("Order #{0} was cancelled.", message.OrderNumber); + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(m => m.OrderNumber) + .ToSaga(s=>s.OrderNumber); + ConfigureMapping(m => m.OrderNumber) + .ToSaga(s=>s.OrderNumber); + } + + public class OrderData : ContainSagaData + { + [Unique] + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + } + + public class BuyersRemorseIsOver + { + } + } + + +} \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.Sales/Properties/AssemblyInfo.cs b/Samples/VideoStore.Msmq/VideoStore.Sales/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..b1f36493d27 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Sales/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyServer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyServer")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d3fd2af3-025c-4690-8ff1-0934a9d37b25")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.Msmq/VideoStore.Sales/SubmitOrderHandler.cs b/Samples/VideoStore.Msmq/VideoStore.Sales/SubmitOrderHandler.cs new file mode 100644 index 00000000000..0a0e91fee1d --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Sales/SubmitOrderHandler.cs @@ -0,0 +1,37 @@ +namespace VideoStore.Sales +{ + using System; + using System.Diagnostics; + using VideoStore.Common; + using VideoStore.Messages.Commands; + using VideoStore.Messages.Events; + using NServiceBus; + + public class SubmitOrderHandler : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(SubmitOrder message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.Out.WriteLine("We have received an order #{0} for [{1}] video(s).", message.OrderNumber, + String.Join(", ", message.VideoIds)); + + Console.Out.WriteLine("The credit card values will be encrypted when looking at the messages in the queues"); + Console.Out.WriteLine("CreditCard Number is {0}", message.EncryptedCreditCardNumber); + Console.Out.WriteLine("CreditCard Expiration Date is {0}", message.EncryptedExpirationDate); + + //tell the client that we received the order + Bus.Publish(Bus.CreateInstance(o => + { + o.ClientId = message.ClientId; + o.OrderNumber = message.OrderNumber; + o.VideoIds = message.VideoIds; + })); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.Sales/VideoStore.Sales.csproj b/Samples/VideoStore.Msmq/VideoStore.Sales/VideoStore.Sales.csproj new file mode 100644 index 00000000000..a16cc132329 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Sales/VideoStore.Sales.csproj @@ -0,0 +1,91 @@ + + + + + + Debug + AnyCPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE} + Library + Properties + VideoStore.Sales + VideoStore.Sales + v4.0 + 512 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + DebugFlagMutator.cs + + + UnobtrusiveMessageConventions.cs + + + + + + + + + + + + + Designer + + + + + + + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + \ No newline at end of file diff --git a/Samples/VideoStore.Msmq/VideoStore.Sales/packages.config b/Samples/VideoStore.Msmq/VideoStore.Sales/packages.config new file mode 100644 index 00000000000..79ece06bef6 --- /dev/null +++ b/Samples/VideoStore.Msmq/VideoStore.Sales/packages.config @@ -0,0 +1,3 @@ + + + diff --git a/Samples/VideoStore.Msmq/packages/repositories.config b/Samples/VideoStore.Msmq/packages/repositories.config new file mode 100644 index 00000000000..47aa835c255 --- /dev/null +++ b/Samples/VideoStore.Msmq/packages/repositories.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/.nuget/NuGet.Config b/Samples/VideoStore.RabbitMQ/.nuget/NuGet.Config new file mode 100644 index 00000000000..308b678b2da --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/.nuget/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/VideoStore.RabbitMQ/.nuget/NuGet.exe b/Samples/VideoStore.RabbitMQ/.nuget/NuGet.exe new file mode 100644 index 00000000000..4645f4b35e8 Binary files /dev/null and b/Samples/VideoStore.RabbitMQ/.nuget/NuGet.exe differ diff --git a/Samples/VideoStore.RabbitMQ/.nuget/NuGet.targets b/Samples/VideoStore.RabbitMQ/.nuget/NuGet.targets new file mode 100644 index 00000000000..4ada616b317 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/.nuget/NuGet.targets @@ -0,0 +1,150 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + + + + + $(SolutionDir).nuget + packages.config + + + + + $(NuGetToolsPath)\nuget.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " + $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(ResolveReferencesDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/App.config b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/App.config new file mode 100644 index 00000000000..317ba945f9b --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/App.config @@ -0,0 +1,25 @@ + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/DebugFlagMutator.cs b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/DebugFlagMutator.cs new file mode 100644 index 00000000000..12cce29e2ee --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/DebugFlagMutator.cs @@ -0,0 +1,37 @@ +namespace VideoStore.Common +{ + using System; + using System.Threading; + using NServiceBus; + using NServiceBus.MessageMutator; + + public class DebugFlagMutator : IMutateTransportMessages, INeedInitialization + { + public static bool Debug { get { return debug.Value; } } + + public void MutateIncoming(TransportMessage transportMessage) + { + var debugFlag = transportMessage.Headers.ContainsKey("Debug") ? transportMessage.Headers["Debug"] : "false"; + if (debugFlag !=null && debugFlag.Equals("true", StringComparison.OrdinalIgnoreCase)) + { + debug.Value = true; + } + else + { + debug.Value = false; + } + } + + public void MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + transportMessage.Headers["Debug"] = Debug.ToString(); + } + + public void Init() + { + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + } + + static readonly ThreadLocal debug = new ThreadLocal(); + } +} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/EndpointConfig.cs b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/EndpointConfig.cs new file mode 100644 index 00000000000..cea64808ecd --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/EndpointConfig.cs @@ -0,0 +1,20 @@ +namespace VideoStore.ContentManagement +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, UsingTransport { } + + public class MyClass : IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.ContentManagement endpoint is now started and subscribed to OrderAccepted events from VideoStore.Sales"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/OrderAcceptedHandler.cs b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/OrderAcceptedHandler.cs new file mode 100644 index 00000000000..b5b2d8fb5f8 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/OrderAcceptedHandler.cs @@ -0,0 +1,35 @@ +namespace VideoStore.ContentManagement +{ + using System; + using System.Diagnostics; + using VideoStore.Common; + using VideoStore.Messages.RequestResponse; + using VideoStore.Messages.Events; + using NServiceBus; + + public class OrderAcceptedHandler : IHandleMessages + { + + + public IBus Bus { get; set; } + + public void Handle(OrderAccepted message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.WriteLine("Order # {0} has been accepted, Let's provision the download -- Sending ProvisionDownloadRequest to the VideoStore.Operations endpoint", message.OrderNumber); + + //send out a request (a event will be published when the response comes back) + Bus.Send(r => + { + r.ClientId = message.ClientId; + r.OrderNumber = message.OrderNumber; + r.VideoIds = message.VideoIds; + }); + + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/Properties/AssemblyInfo.cs b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..5b8a651c9ce --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("VideoStore.DownloadVideos")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VideoStore.DownloadVideos")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7121e327-af1c-4c5d-87f5-47fa2799ffa7")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/ProvisionDownloadResponseHandler.cs b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/ProvisionDownloadResponseHandler.cs new file mode 100644 index 00000000000..2818c347035 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/ProvisionDownloadResponseHandler.cs @@ -0,0 +1,49 @@ +namespace VideoStore.ContentManagement +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using Messages.Events; + using Messages.RequestResponse; + using NServiceBus; + using VideoStore.Common; + + public class ProvisionDownloadResponseHandler : IHandleMessages + { + public IBus Bus { get; set; } + private readonly IDictionary videoIdToUrlMap = new Dictionary + { + {"intro1", "http://youtu.be/6lYF83wKerA"}, + {"intro2", "http://youtu.be/icze_WCyEdQ"}, + {"gems", "http://skillsmatter.com/podcast/design-architecture/hidden-nservicebus-gems"}, + {"integ", "http://skillsmatter.com/podcast/home/reliable-integrations-nservicebus/js-1877"}, + {"shiny", "http://skillsmatter.com/podcast/open-source-dot-net/nservicebus-3"}, + {"day", "http://dnrtv.com/dnrtvplayer/player.aspx?ShowNum=0199"}, + {"need", "http://vimeo.com/37728422"}, + }; + + public void Handle(ProvisionDownloadResponse message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.WriteLine("Download for Order # {0} has been provisioned, Publishing Download ready event", message.OrderNumber); + + Bus.Publish(e => + { + e.OrderNumber = message.OrderNumber; + e.ClientId = message.ClientId; + e.VideoUrls = new Dictionary(); + + foreach (var videoId in message.VideoIds) + { + e.VideoUrls.Add(videoId, videoIdToUrlMap[videoId]); + } + }); + + Console.Out.WriteLine("Downloads for Order #{0} is ready, publishing it.", message.OrderNumber); + } + } +} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/UnobtrusiveMessageConventions.cs b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/UnobtrusiveMessageConventions.cs new file mode 100644 index 00000000000..ed699df4fa4 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/UnobtrusiveMessageConventions.cs @@ -0,0 +1,18 @@ +namespace VideoStore.Common +{ + using NServiceBus; + + class UnobtrusiveMessageConventions : IWantToRunBeforeConfiguration + { + public void Init() + { + Configure.Instance + .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("Commands")) + .DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("Events")) + .DefiningMessagesAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("RequestResponse")) + .DefiningEncryptedPropertiesAs(p => p.Name.StartsWith("Encrypted")); + } + } +} + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/VideoStore.ContentManagement.csproj b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/VideoStore.ContentManagement.csproj new file mode 100644 index 00000000000..8ef1cd6c305 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/VideoStore.ContentManagement.csproj @@ -0,0 +1,104 @@ + + + + + + Debug + AnyCPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C} + Library + Properties + VideoStore.ContentManagement + VideoStore.ContentManagement + v4.0 + 512 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\packages\RabbitMQ.Client.3.0.0\lib\net30\RabbitMQ.Client.dll + + + ..\..\..\binaries\NServiceBus.Transports.RabbitMQ.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + Designer + + + + + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/packages.config b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/packages.config new file mode 100644 index 00000000000..e0a39cbf5c2 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ContentManagement/packages.config @@ -0,0 +1,4 @@ + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/App.config b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/App.config new file mode 100644 index 00000000000..dc446b46dd1 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/App.config @@ -0,0 +1,25 @@ + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/EndpointConfig.cs b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/EndpointConfig.cs new file mode 100644 index 00000000000..6cc58b7fba4 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/EndpointConfig.cs @@ -0,0 +1,20 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, UsingTransport { } + + public class MyClass : IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.CustomerRelations endpoint is now started and subscribed to events from VideoStore.Sales"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/OrderAcceptedHandler.cs b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/OrderAcceptedHandler.cs new file mode 100644 index 00000000000..af2394a62bd --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/OrderAcceptedHandler.cs @@ -0,0 +1,35 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using System.Diagnostics; + using Messages.Events; + using NServiceBus; + using VideoStore.Common; + + class OrderAcceptedHandler : IHandleMessages + { + public IBus Bus { get; set; } + public void Handle(OrderAccepted message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.WriteLine("Customer: {0} is now a preferred customer -- raising in-memory event, & publishing for other service concerns", message.ClientId); + // Call the domain object to do the raising of the event based on the relevant condition + Bus.InMemory.Raise(m => + { + m.ClientId = message.ClientId; + m.PreferredStatusExpiresOn = DateTime.Now.AddMonths(2); + }); + + // Yes, you can also publish this event as an asynchronous event + Bus.Publish(m => + { + m.ClientId = message.ClientId; + m.PreferredStatusExpiresOn = DateTime.Now.AddMonths(2); + }); + } + } +} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/Properties/AssemblyInfo.cs b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..2ee904c5711 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("VideoStore.CustomerRelations")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VideoStore.CustomerRelations")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2dad9534-21c4-4fd6-b45e-243d1d1a3902")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/SendLimitedTimeOffer.cs b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/SendLimitedTimeOffer.cs new file mode 100644 index 00000000000..76894e2667c --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/SendLimitedTimeOffer.cs @@ -0,0 +1,20 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using System.Diagnostics; + using Messages.Events; + using NServiceBus; + using VideoStore.Common; + + class SendLimitedTimeOffer : IHandleMessages + { + public void Handle(ClientBecamePreferred message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + Console.WriteLine("Handler WhenCustomerIsPreferredSendLimitedTimeOffer invoked for CustomerId: {0}", message.ClientId); + } + } +} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/SendWelcomePacket.cs b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/SendWelcomePacket.cs new file mode 100644 index 00000000000..0981531626d --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/SendWelcomePacket.cs @@ -0,0 +1,26 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using System.Diagnostics; + using Messages.Events; + using NServiceBus; + using VideoStore.Common; + + class SendWelcomePacket : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(ClientBecamePreferred message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + Console.WriteLine("Handler WhenCustomerIsPreferredSendWelcomeEmail invoked for CustomerId: {0}", message.ClientId); + + // Don't write code to do the smtp send here, instead do a Bus.Send. If this handler fails, then + // the message to send email will not be sent. + //Bus.Send(m => { m.ClientId = message.ClientId; }); + } + } +} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/VideoStore.CustomerRelations.csproj b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/VideoStore.CustomerRelations.csproj new file mode 100644 index 00000000000..5ae0c15cf78 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/VideoStore.CustomerRelations.csproj @@ -0,0 +1,103 @@ + + + + + + Debug + AnyCPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC} + Library + Properties + VideoStore.CustomerRelations + VideoStore.CustomerRelations + v4.0 + 512 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\packages\RabbitMQ.Client.3.0.0\lib\net30\RabbitMQ.Client.dll + + + ..\..\..\binaries\NServiceBus.Transports.RabbitMQ.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + + + + + + + + + DebugFlagMutator.cs + + + UnobtrusiveMessageConventions.cs + + + + + + + + + + + + + + + + + + + {59f2ba7e-4da5-49f8-9dbc-520fa99f4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/packages.config b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/packages.config new file mode 100644 index 00000000000..e0a39cbf5c2 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.CustomerRelations/packages.config @@ -0,0 +1,4 @@ + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/App_Start/FilterConfig.cs b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/App_Start/FilterConfig.cs new file mode 100644 index 00000000000..b8da915c6e2 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/App_Start/FilterConfig.cs @@ -0,0 +1,12 @@ +namespace VideoStore.ECommerce +{ + using System.Web.Mvc; + + public class FilterConfig + { + public static void RegisterGlobalFilters(GlobalFilterCollection filters) + { + filters.Add(new HandleErrorAttribute()); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/App_Start/RouteConfig.cs b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/App_Start/RouteConfig.cs new file mode 100644 index 00000000000..dde7707c577 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/App_Start/RouteConfig.cs @@ -0,0 +1,16 @@ +namespace VideoStore.ECommerce +{ + using System; + using System.Web.Mvc; + using System.Web.Routing; + + public class RouteConfig + { + public static void RegisterRoutes(RouteCollection routes) + { + routes.MapHubs(); + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + routes.MapRoute("Default", String.Empty, new { controller = "Home", action = "Index" }); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/css/bootstrap-responsive.min.css b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/css/bootstrap-responsive.min.css new file mode 100644 index 00000000000..5cb833ff082 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/css/bootstrap-responsive.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap Responsive v2.2.2 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */@-ms-viewport{width:device-width}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/css/bootstrap.min.css b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/css/bootstrap.min.css new file mode 100644 index 00000000000..140f731dfa8 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/css/bootstrap.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap v2.2.2 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}label,select,button,input[type="button"],input[type="reset"],input[type="submit"],input[type="radio"],input[type="checkbox"]{cursor:pointer}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.127659574468085%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;line-height:0;content:""}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;line-height:0;content:""}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}a.muted:hover{color:#808080}.text-warning{color:#c09853}a.text-warning:hover{color:#a47e3c}.text-error{color:#b94a48}a.text-error:hover{color:#953b39}.text-info{color:#3a87ad}a.text-info:hover{color:#2d6987}.text-success{color:#468847}a.text-success:hover{color:#356635}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:20px;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{line-height:40px}h1{font-size:38.5px}h2{font-size:31.5px}h3{font-size:24.5px}h4{font-size:17.5px}h5{font-size:14px}h6{font-size:11.9px}h1 small{font-size:24.5px}h2 small{font-size:17.5px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}ul.inline,ol.inline{margin-left:0;list-style:none}ul.inline>li,ol.inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;line-height:0;content:""}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;white-space:nowrap;background-color:#f7f7f9;border:1px solid #e1e1e8}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;white-space:pre;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555;vertical-align:middle;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}input,textarea,.uneditable-input{width:206px}textarea{height:auto}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;background-color:#fff;border:1px solid #ccc}select[multiple],select[size]{height:auto}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:20px;padding-left:20px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-20px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left}.controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error .control-label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success .control-label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info .control-label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu{font-size:14px}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn,.input-append .btn-group>.dropdown-toggle,.input-prepend .btn-group>.dropdown-toggle{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn:last-child,.input-append select+.btn-group .btn:last-child,.input-append .uneditable-input+.btn-group .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px}.input-append .add-on:last-child,.input-append .btn:last-child,.input-append .btn-group:last-child>.dropdown-toggle{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child{margin-left:0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizontal .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block,.form-horizontal .uneditable-input+.help-block,.form-horizontal .input-prepend+.help-block,.form-horizontal .input-append+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child>th:first-child,.table-bordered tbody:first-child tr:first-child>td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child>th:last-child,.table-bordered tbody:first-child tr:first-child>td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child>th:first-child,.table-bordered tbody:last-child tr:last-child>td:first-child,.table-bordered tfoot:last-child tr:last-child>td:first-child{-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child>th:last-child,.table-bordered tbody:last-child tr:last-child>td:last-child,.table-bordered tfoot:last-child tr:last-child>td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered tfoot+tbody:last-child tr:last-child td:first-child{-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-moz-border-radius-bottomleft:0}.table-bordered tfoot+tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomright:0}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5}table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span"],.row-fluid table th[class*="span"]{display:table-cell;float:none;margin-left:0}.table td.span1,.table th.span1{float:none;width:44px;margin-left:0}.table td.span2,.table th.span2{float:none;width:124px;margin-left:0}.table td.span3,.table th.span3{float:none;width:204px;margin-left:0}.table td.span4,.table th.span4{float:none;width:284px;margin-left:0}.table td.span5,.table th.span5{float:none;width:364px;margin-left:0}.table td.span6,.table th.span6{float:none;width:444px;margin-left:0}.table td.span7,.table th.span7{float:none;width:524px;margin-left:0}.table td.span8,.table th.span8{float:none;width:604px;margin-left:0}.table td.span9,.table th.span9{float:none;width:684px;margin-left:0}.table td.span10,.table th.span10{float:none;width:764px;margin-left:0}.table td.span11,.table th.span11{float:none;width:844px;margin-left:0}.table td.span12,.table th.span12{float:none;width:924px;margin-left:0}.table tbody tr.success td{background-color:#dff0d8}.table tbody tr.error td{background-color:#f2dede}.table tbody tr.warning td{background-color:#fcf8e3}.table tbody tr.info td{background-color:#d9edf7}.table-hover tbody tr.success:hover td{background-color:#d0e9c6}.table-hover tbody tr.error:hover td{background-color:#ebcccc}.table-hover tbody tr.warning:hover td{background-color:#faf2cc}.table-hover tbody tr.info:hover td{background-color:#c4e3f3}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;outline:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999}.dropdown-menu .disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open{*z-index:1000}.open>.dropdown-menu{display:block}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 12px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #bbb;*border:0;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn{border-color:#c5c5c5;border-color:rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-moz-linear-gradient(top,#62c462,#51a351);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover{color:#333;text-decoration:none}.btn-group{position:relative;display:inline-block;*display:inline;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle;*zoom:1}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:14px}.btn-group>.btn-mini{font-size:10.5px}.btn-group>.btn-small{font-size:11.9px}.btn-group>.btn-large{font-size:17.5px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5px;border-right-width:5px;border-left-width:5px}.dropup .btn-large .caret{border-bottom-width:5px}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical>.btn{display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical>.btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical>.btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical>.btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical>.btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert,.alert h4{color:#c09853}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-success h4{color:#468847}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-danger h4,.alert-error h4{color:#b94a48}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-info h4{color:#3a87ad}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li>a>img{max-width:none}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;content:""}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#fff;background-color:#08c}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover{z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;content:""}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover{border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before,.navbar-inner:after{display:table;line-height:0;content:""}.navbar-inner:after{clear:both}.navbar .container{width:auto}.nav-collapse.collapse{height:auto;overflow:visible}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px;color:#777}.navbar-link{color:#777}.navbar-link:hover{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:5px}.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn{margin-top:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;content:""}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:5px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,0.1);box-shadow:0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown>a:hover .caret{border-top-color:#555;border-bottom-color:#555}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#fff}.navbar-inverse .brand{color:#999}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>a:hover .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-moz-linear-gradient(top,#151515,#040404);background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb>li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb>li>.divider{padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li{display:inline}.pagination ul>li>a,.pagination ul>li>span{float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5}.pagination ul>.active>a,.pagination ul>.active>span{color:#999;cursor:default}.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover{color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pagination-large ul>li>a,.pagination-large ul>li>span{padding:11px 19px;font-size:17.5px}.pagination-large ul>li:first-child>a,.pagination-large ul>li:first-child>span{-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.pagination-large ul>li:last-child>a,.pagination-large ul>li:last-child>span{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.pagination-mini ul>li:first-child>a,.pagination-small ul>li:first-child>a,.pagination-mini ul>li:first-child>span,.pagination-small ul>li:first-child>span{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px}.pagination-mini ul>li:last-child>a,.pagination-small ul>li:last-child>a,.pagination-mini ul>li:last-child>span,.pagination-small ul>li:last-child>span{-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px}.pagination-small ul>li>a,.pagination-small ul>li>span{padding:2px 10px;font-size:11.9px}.pagination-mini ul>li>a,.pagination-mini ul>li>span{padding:0 6px;font-size:10.5px}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager li>a:hover{text-decoration:none;background-color:#f5f5f5}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>span{color:#999;cursor:default;background-color:#fff}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:10%;left:50%;z-index:1050;width:560px;margin-left:-280px;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:0;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3s ease-out}.modal.fade.in{top:10%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{position:relative;max-height:400px;padding:15px;overflow-y:auto}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.tooltip{position:absolute;z-index:1030;display:block;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{margin-top:-3px}.tooltip.right{margin-left:3px}.tooltip.bottom{margin-top:3px}.tooltip.left{margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after{bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,0.25);border-left-width:0}.popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0}.popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover{border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.media,.media-body{overflow:hidden;*overflow:visible;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media .pull-left{margin-right:10px}.media .pull-right{margin-left:10px}.media-list{margin-left:0;list-style:none}.label,.badge{display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding-right:9px;padding-left:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}.label:empty,.badge:empty{display:none}a.label:hover,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.accordion{margin-bottom:20px}.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading{border-bottom:0}.accordion-heading .accordion-toggle{display:block;padding:8px 15px}.accordion-toggle{cursor:pointer}.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5}.carousel{position:relative;margin-bottom:20px;line-height:1}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img{display:block;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{right:15px;left:auto}.carousel-control:hover{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-caption{position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{line-height:20px;color:#fff}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit li{line-height:30px}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/img/glyphicons-halflings-white.png b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/img/glyphicons-halflings-white.png new file mode 100644 index 00000000000..3bf6484a29d Binary files /dev/null and b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/img/glyphicons-halflings-white.png differ diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/img/glyphicons-halflings.png b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/img/glyphicons-halflings.png new file mode 100644 index 00000000000..a9969993201 Binary files /dev/null and b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/img/glyphicons-halflings.png differ diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/js/angular.min.js b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/js/angular.min.js new file mode 100644 index 00000000000..569325cf173 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/js/angular.min.js @@ -0,0 +1,160 @@ +/* + AngularJS v1.0.4 + (c) 2010-2012 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(T,Y,p){'use strict';function m(b,a,c){var d;if(b)if(L(b))for(d in b)d!="prototype"&&d!="length"&&d!="name"&&b.hasOwnProperty(d)&&a.call(c,b[d],d);else if(b.forEach&&b.forEach!==m)b.forEach(a,c);else if(M(b)&&va(b.length))for(d=0;d=0&&b.splice(c,1);return a}function U(b,a){if(oa(b)||b&&b.$evalAsync&&b.$watch)throw u("Can't copy Window or Scope");if(a){if(b===a)throw u("Can't copy equivalent objects or arrays");if(I(b)){for(;a.length;)a.pop();for(var c=0;c2?ia.call(arguments,2):[];return L(a)&&!(a instanceof RegExp)?c.length?function(){return arguments.length?a.apply(b,c.concat(ia.call(arguments,0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b, +arguments):a.call(b)}:a}function ic(b,a){var c=a;/^\$+/.test(b)?c=p:oa(a)?c="$WINDOW":a&&Y===a?c="$DOCUMENT":a&&a.$evalAsync&&a.$watch&&(c="$SCOPE");return c}function da(b,a){return JSON.stringify(b,ic,a?" ":null)}function ob(b){return E(b)?JSON.parse(b):b}function Wa(b){b&&b.length!==0?(b=D(""+b),b=!(b=="f"||b=="0"||b=="false"||b=="no"||b=="n"||b=="[]")):b=!1;return b}function pa(b){b=z(b).clone();try{b.html("")}catch(a){}return z("
    ").append(b).html().match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/, +function(a,b){return"<"+D(b)})}function Xa(b){var a={},c,d;m((b||"").split("&"),function(b){b&&(c=b.split("="),d=decodeURIComponent(c[0]),a[d]=v(c[1])?decodeURIComponent(c[1]):!0)});return a}function pb(b){var a=[];m(b,function(b,d){a.push(Ya(d,!0)+(b===!0?"":"="+Ya(b,!0)))});return a.length?a.join("&"):""}function Za(b){return Ya(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Ya(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g, +"$").replace(/%2C/gi,",").replace(a?null:/%20/g,"+")}function jc(b,a){function c(a){a&&d.push(a)}var d=[b],e,g,i=["ng:app","ng-app","x-ng-app","data-ng-app"],f=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;m(i,function(a){i[a]=!0;c(Y.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(m(b.querySelectorAll("."+a),c),m(b.querySelectorAll("."+a+"\\:"),c),m(b.querySelectorAll("["+a+"]"),c))});m(d,function(a){if(!e){var b=f.exec(" "+a.className+" ");b?(e=a,g=(b[2]||"").replace(/\s+/g,",")):m(a.attributes, +function(b){if(!e&&i[b.name])e=a,g=b.value})}});e&&a(e,g?[g]:[])}function qb(b,a){b=z(b);a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");var c=rb(a);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,i){a.$apply(function(){b.data("$injector",i);c(b)(a)})}]);return c}function $a(b,a){a=a||"_";return b.replace(kc,function(b,d){return(d?a:"")+b.toLowerCase()})}function ab(b,a,c){if(!b)throw new u("Argument '"+(a||"?")+"' is "+(c||"required")); +return b}function qa(b,a,c){c&&I(b)&&(b=b[b.length-1]);ab(L(b),a,"not a function, got "+(b&&typeof b=="object"?b.constructor.name||"Object":typeof b));return b}function lc(b){function a(a,b,e){return a[b]||(a[b]=e())}return a(a(b,"angular",Object),"module",function(){var b={};return function(d,e,g){e&&b.hasOwnProperty(d)&&(b[d]=null);return a(b,d,function(){function a(c,d,e){return function(){b[e||"push"]([c,d,arguments]);return k}}if(!e)throw u("No module: "+d);var b=[],c=[],j=a("$injector","invoke"), +k={_invokeQueue:b,_runBlocks:c,requires:e,name:d,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:j,run:function(a){c.push(a);return this}};g&&j(g);return k})}})}function sb(b){return b.replace(mc,function(a,b,d,e){return e?d.toUpperCase():d}).replace(nc, +"Moz$1")}function bb(b,a){function c(){var e;for(var b=[this],c=a,i,f,h,j,k,l;b.length;){i=b.shift();f=0;for(h=i.length;f-1}function wb(b,a){a&&m(a.split(" "),function(a){b.className=Q((" "+b.className+" ").replace(/[\n\t]/g," ").replace(" "+Q(a)+" "," "))})}function xb(b,a){a&&m(a.split(" "), +function(a){if(!Ba(b,a))b.className=Q(b.className+" "+Q(a))})}function cb(b,a){if(a)for(var a=!a.nodeName&&v(a.length)&&!oa(a)?a:[a],c=0;c4096&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!")}else{if(h.cookie!==P){P=h.cookie;d=P.split("; ");ba={};for(f=0;f0&&(ba[unescape(e.substring(0,j))]=unescape(e.substring(j+1)))}return ba}};f.defer=function(a,b){var c;n++;c=l(function(){delete r[c]; +e(a)},b||0);r[c]=!0;return c};f.defer.cancel=function(a){return r[a]?(delete r[a],o(a),e(C),!0):!1}}function wc(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new vc(b,d,a,c)}]}function xc(){this.$get=function(){function b(b,d){function e(a){if(a!=l){if(o){if(o==a)o=a.n}else o=a;g(a.n,a.p);g(a,l);l=a;l.n=null}}function g(a,b){if(a!=b){if(a)a.p=b;if(b)b.n=a}}if(b in a)throw u("cacheId "+b+" taken");var i=0,f=y({},d,{id:b}),h={},j=d&&d.capacity||Number.MAX_VALUE,k={}, +l=null,o=null;return a[b]={put:function(a,b){var c=k[a]||(k[a]={key:a});e(c);t(b)||(a in h||i++,h[a]=b,i>j&&this.remove(o.key))},get:function(a){var b=k[a];if(b)return e(b),h[a]},remove:function(a){var b=k[a];if(b){if(b==l)l=b.p;if(b==o)o=b.n;g(b.n,b.p);delete k[a];delete h[a];i--}},removeAll:function(){h={};i=0;k={};l=o=null},destroy:function(){k=f=h=null;delete a[b]},info:function(){return y({},f,{size:i})}}}var a={};b.info=function(){var b={};m(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]}; +return b}}function yc(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Cb(b){var a={},c="Directive",d=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,e=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,g="Template must have exactly one root element. was: ";this.directive=function f(d,e){E(d)?(ab(e,"directive"),a.hasOwnProperty(d)||(a[d]=[],b.factory(d+c,["$injector","$exceptionHandler",function(b,c){var e=[];m(a[d],function(a){try{var f=b.invoke(a);if(L(f))f={compile:H(f)};else if(!f.compile&&f.link)f.compile= +H(f.link);f.priority=f.priority||0;f.name=f.name||d;f.require=f.require||f.controller&&f.name;f.restrict=f.restrict||"A";e.push(f)}catch(j){c(j)}});return e}])),a[d].push(e)):m(d,nb(f));return this};this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope",function(b,h,j,k,l,o,r,n){function w(a,b,c){a instanceof z||(a=z(a));m(a,function(b,c){b.nodeType==3&&b.nodeValue.match(/\S+/)&&(a[c]=z(b).wrap("").parent()[0])});var d=x(a, +b,a,c);return function(b,c){ab(b,"scope");var e=c?ta.clone.call(a):a;e.data("$scope",b);q(e,"ng-scope");c&&c(e,b);d&&d(b,e,e);return e}}function q(a,b){try{a.addClass(b)}catch(c){}}function x(a,b,c,d){function e(a,c,d,j){var g,h,k,n,o,l,r,q=[];o=0;for(l=c.length;oB.priority)break;if(W=B.scope)K("isolated scope",A,B,s),M(W)&&(q(s,"ng-isolate-scope"),A=B),q(s,"ng-scope"),x=x||B;G= +B.name;if(W=B.controller)t=t||{},K("'"+G+"' controller",t[G],B,s),t[G]=B;if(W=B.transclude)K("transclusion",C,B,s),C=B,n=B.priority,W=="element"?(V=z(b),s=c.$$element=z(Y.createComment(" "+G+": "+c[G]+" ")),b=s[0],Fa(e,z(V[0]),b),v=w(V,d,n)):(V=z(db(b)).contents(),s.html(""),v=w(V,d));if(W=B.template)if(K("template",P,B,s),P=B,W=Ha(W),B.replace){V=z("
    "+Q(W)+"
    ").contents();b=V[0];if(V.length!=1||b.nodeType!==1)throw new u(g+W);Fa(e,s,b);G={$attr:{}};a=a.concat(X(b,a.splice(D+1,a.length- +(D+1)),G));J(c,G);F=a.length}else s.html(W);if(B.templateUrl)K("template",P,B,s),P=B,k=ba(a.splice(D,a.length-D),k,s,c,e,B.replace,v),F=a.length;else if(B.compile)try{y=B.compile(s,c,v),L(y)?f(null,y):y&&f(y.pre,y.post)}catch(H){j(H,pa(s))}if(B.terminal)k.terminal=!0,n=Math.max(n,B.priority)}k.scope=x&&x.scope;k.transclude=C&&v;return k}function s(d,e,g,h){var k=!1;if(a.hasOwnProperty(e))for(var n,e=b.get(e+c),o=0,l=e.length;on.priority)&&n.restrict.indexOf(g)!=-1)d.push(n), +k=!0}catch(r){j(r)}return k}function J(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;m(a,function(d,e){e.charAt(0)!="$"&&(b[e]&&(d+=(e==="style"?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});m(b,function(b,f){f=="class"?(q(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):f=="style"?e.attr("style",e.attr("style")+";"+b):f.charAt(0)!="$"&&!a.hasOwnProperty(f)&&(a[f]=b,d[f]=c[f])})}function ba(a,b,c,d,e,f,j){var h=[],n,o,r=c[0],q=a.shift(),w=y({},q,{controller:null,templateUrl:null,transclude:null,scope:null}); +c.html("");k.get(q.templateUrl,{cache:l}).success(function(k){var l,q,k=Ha(k);if(f){q=z("
    "+Q(k)+"
    ").contents();l=q[0];if(q.length!=1||l.nodeType!==1)throw new u(g+k);k={$attr:{}};Fa(e,c,l);X(l,a,k);J(d,k)}else l=r,c.html(k);a.unshift(w);n=A(a,c,d,j);for(o=x(c.contents(),j);h.length;){var ca=h.pop(),k=h.pop();q=h.pop();var s=h.pop(),m=l;q!==r&&(m=db(l),Fa(k,z(q),m));n(function(){b(o,s,m,e,ca)},s,m,e,ca)}h=null}).error(function(a,b,c,d){throw u("Failed to load template: "+d.url);});return function(a, +c,d,e,f){h?(h.push(c),h.push(d),h.push(e),h.push(f)):n(function(){b(o,c,d,e,f)},c,d,e,f)}}function P(a,b){return b.priority-a.priority}function K(a,b,c,d){if(b)throw u("Multiple directives ["+b.name+", "+c.name+"] asking for "+a+" on: "+pa(d));}function G(a,b){var c=h(b,!0);c&&a.push({priority:0,compile:H(function(a,b){var d=b.parent(),e=d.data("$binding")||[];e.push(c);q(d.data("$binding",e),"ng-binding");a.$watch(c,function(a){b[0].nodeValue=a})})})}function V(a,b,c,d){var e=h(c,!0);e&&b.push({priority:100, +compile:H(function(a,b,c){b=c.$$observers||(c.$$observers={});d==="class"&&(e=h(c[d],!0));c[d]=p;(b[d]||(b[d]=[])).$$inter=!0;(c.$$observers&&c.$$observers[d].$$scope||a).$watch(e,function(a){c.$set(d,a)})})})}function Fa(a,b,c){var d=b[0],e=d.parentNode,f,g;if(a){f=0;for(g=a.length;f0){var e=K[0],f=e.text;if(f==a||f==b||f==c||f==d||!a&&!b&&!c&&!d)return e}return!1}function f(b,c, +d,f){return(b=i(b,c,d,f))?(a&&!b.json&&e("is not valid json",b),K.shift(),b):!1}function h(a){f(a)||e("is unexpected, expecting ["+a+"]",i())}function j(a,b){return function(c,d){return a(c,d,b)}}function k(a,b,c){return function(d,e){return b(d,e,a,c)}}function l(){for(var a=[];;)if(K.length>0&&!i("}",")",";","]")&&a.push(v()),!f(";"))return a.length==1?a[0]:function(b,c){for(var d,e=0;e","<=",">="))a=k(a,b.fn,q());return a}function x(){for(var a=m(),b;b=f("*","/","%");)a=k(a, +b.fn,m());return a}function m(){var a;return f("+")?A():(a=f("-"))?k(ba,a.fn,m()):(a=f("!"))?j(a.fn,m()):A()}function A(){var a;if(f("("))a=v(),h(")");else if(f("["))a=s();else if(f("{"))a=J();else{var b=f();(a=b.fn)||e("not a primary expression",b)}for(var c;b=f("(","[",".");)b.text==="("?(a=z(a,c),c=null):b.text==="["?(c=a,a=ea(a)):b.text==="."?(c=a,a=t(a)):e("IMPOSSIBLE");return a}function s(){var a=[];if(g().text!="]"){do a.push(G());while(f(","))}h("]");return function(b,c){for(var d=[],e=0;e< +a.length;e++)d.push(a[e](b,c));return d}}function J(){var a=[];if(g().text!="}"){do{var b=f(),b=b.string||b.text;h(":");var c=G();a.push({key:b,value:c})}while(f(","))}h("}");return function(b,c){for(var d={},e=0;e1;d++){var e=a.shift(),g=b[e];g||(g={},b[e]=g);b=g}return b[a.shift()]=c}function gb(b,a,c){if(!a)return b;for(var a=a.split("."),d,e=b,g=a.length,i=0;i7),hasEvent:function(c){if(c=="input"&&aa==9)return!1;if(t(a[c])){var e=b.document.createElement("div");a[c]="on"+c in e}return a[c]},csp:!1}}]}function Tc(){this.$get=H(T)}function Nb(b){var a={},c,d,e;if(!b)return a;m(b.split("\n"),function(b){e=b.indexOf(":");c=D(Q(b.substr(0,e)));d=Q(b.substr(e+1));c&&(a[c]?a[c]+=", "+d:a[c]=d)});return a}function Ob(b){var a=M(b)?b:p;return function(c){a||(a=Nb(b));return c? +a[D(c)]||null:a}}function Pb(b,a,c){if(L(c))return c(b,a);m(c,function(c){b=c(b,a)});return b}function Uc(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*$/,c=/^\)\]\}',?\n/,d=this.defaults={transformResponse:[function(d){E(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=ob(d,!0)));return d}],transformRequest:[function(a){return M(a)&&Sa.apply(a)!=="[object File]"?da(a):a}],headers:{common:{Accept:"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest"},post:{"Content-Type":"application/json;charset=utf-8"}, +put:{"Content-Type":"application/json;charset=utf-8"}}},e=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,c,h,j,k){function l(a){function c(a){var b=y({},a,{data:Pb(a.data,a.headers,f)});return 200<=a.status&&a.status<300?b:j.reject(b)}a.method=la(a.method);var e=a.transformRequest||d.transformRequest,f=a.transformResponse||d.transformResponse,h=d.headers,h=y({"X-XSRF-TOKEN":b.cookies()["XSRF-TOKEN"]},h.common,h[D(a.method)], +a.headers),e=Pb(a.data,Ob(h),e),g;t(a.data)&&delete h["Content-Type"];g=o(a,e,h);g=g.then(c,c);m(w,function(a){g=a(g)});g.success=function(b){g.then(function(c){b(c.data,c.status,c.headers,a)});return g};g.error=function(b){g.then(null,function(c){b(c.data,c.status,c.headers,a)});return g};return g}function o(b,c,d){function e(a,b,c){m&&(200<=a&&a<300?m.put(w,[a,b,Nb(c)]):m.remove(w));f(b,a,c);h.$apply()}function f(a,c,d){c=Math.max(c,0);(200<=c&&c<300?k.resolve:k.reject)({data:a,status:c,headers:Ob(d), +config:b})}function i(){var a=ya(l.pendingRequests,b);a!==-1&&l.pendingRequests.splice(a,1)}var k=j.defer(),o=k.promise,m,p,w=r(b.url,b.params);l.pendingRequests.push(b);o.then(i,i);b.cache&&b.method=="GET"&&(m=M(b.cache)?b.cache:n);if(m)if(p=m.get(w))if(p.then)return p.then(i,i),p;else I(p)?f(p[1],p[0],U(p[2])):f(p,200,{});else m.put(w,o);p||a(b.method,w,c,e,d,b.timeout,b.withCredentials);return o}function r(a,b){if(!b)return a;var c=[];fc(b,function(a,b){a==null||a==p||(M(a)&&(a=da(a)),c.push(encodeURIComponent(b)+ +"="+encodeURIComponent(a)))});return a+(a.indexOf("?")==-1?"?":"&")+c.join("&")}var n=c("$http"),w=[];m(e,function(a){w.push(E(a)?k.get(a):k.invoke(a))});l.pendingRequests=[];(function(a){m(arguments,function(a){l[a]=function(b,c){return l(y(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){m(arguments,function(a){l[a]=function(b,c,d){return l(y(d||{},{method:a,url:b,data:c}))}})})("post","put");l.defaults=d;return l}]}function Vc(){this.$get=["$browser","$window","$document", +function(b,a,c){return Wc(b,Xc,b.defer,a.angular.callbacks,c[0],a.location.protocol.replace(":",""))}]}function Wc(b,a,c,d,e,g){function i(a,b){var c=e.createElement("script"),d=function(){e.body.removeChild(c);b&&b()};c.type="text/javascript";c.src=a;aa?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror=d;e.body.appendChild(c)}return function(e,h,j,k,l,o,r){function n(a,c,d,e){c=(h.match(Gb)||["",g])[1]=="file"?d?200:404:c;a(c==1223?204:c,d,e);b.$$completeOutstandingRequest(C)} +b.$$incOutstandingRequestCount();h=h||b.url();if(D(e)=="jsonp"){var p="_"+(d.counter++).toString(36);d[p]=function(a){d[p].data=a};i(h.replace("JSON_CALLBACK","angular.callbacks."+p),function(){d[p].data?n(k,200,d[p].data):n(k,-2);delete d[p]})}else{var q=new a;q.open(e,h,!0);m(l,function(a,b){a&&q.setRequestHeader(b,a)});var x;q.onreadystatechange=function(){q.readyState==4&&n(k,x||q.status,q.responseText,q.getAllResponseHeaders())};if(r)q.withCredentials=!0;q.send(j||"");o>0&&c(function(){x=-1; +q.abort()},o)}}}function Yc(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","), +DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return b===1?"one":"other"}}}}function Zc(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(b,a,c,d){function e(e,f,h){var j=c.defer(), +k=j.promise,l=v(h)&&!h,f=a.defer(function(){try{j.resolve(e())}catch(a){j.reject(a),d(a)}l||b.$apply()},f),h=function(){delete g[k.$$timeoutId]};k.$$timeoutId=f;g[f]=j;k.then(h,h);return k}var g={};e.cancel=function(b){return b&&b.$$timeoutId in g?(g[b.$$timeoutId].reject("canceled"),a.defer.cancel(b.$$timeoutId)):!1};return e}]}function Qb(b){function a(a,e){return b.factory(a+c,e)}var c="Filter";this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}];a("currency", +Rb);a("date",Sb);a("filter",$c);a("json",ad);a("limitTo",bd);a("lowercase",cd);a("number",Tb);a("orderBy",Ub);a("uppercase",dd)}function $c(){return function(b,a){if(!(b instanceof Array))return b;var c=[];c.check=function(a){for(var b=0;b-1;case "object":for(var c in a)if(c.charAt(0)!=="$"&& +d(a[c],b))return!0;return!1;case "array":for(c=0;ce+1?i="0":(f=i,j=!0)}if(!j){i= +(i.split(Wb)[1]||"").length;t(e)&&(e=Math.min(Math.max(a.minFrac,i),a.maxFrac));var i=Math.pow(10,e),b=Math.round(b*i)/i,b=(""+b).split(Wb),i=b[0],b=b[1]||"",j=0,k=a.lgSize,l=a.gSize;if(i.length>=k+l)for(var j=i.length-k,o=0;o0||e>-c)e+=c;e===0&&c==-12&&(e=12);return jb(e,a,d)}}function La(b,a){return function(c,d){var e=c["get"+b](),g=la(a?"SHORT"+b:b);return d[g][e]}}function Sb(b){function a(a){var b;if(b=a.match(c)){var a=new Date(0),g=0,i=0;b[9]&&(g=F(b[9]+b[10]),i=F(b[9]+b[11]));a.setUTCFullYear(F(b[1]),F(b[2])-1,F(b[3]));a.setUTCHours(F(b[4]||0)-g,F(b[5]||0)-i,F(b[6]|| +0),F(b[7]||0))}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var g="",i=[],f,h,e=e||"mediumDate",e=b.DATETIME_FORMATS[e]||e;E(c)&&(c=ed.test(c)?F(c):a(c));va(c)&&(c=new Date(c));if(!na(c))return c;for(;e;)(h=fd.exec(e))?(i=i.concat(ia.call(h,1)),e=i.pop()):(i.push(e),e=null);m(i,function(a){f=gd[a];g+=f?f(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function ad(){return function(b){return da(b, +!0)}}function bd(){return function(b,a){if(!(b instanceof Array))return b;var a=F(a),c=[],d,e;if(!b||!(b instanceof Array))return c;a>b.length?a=b.length:a<-b.length&&(a=-b.length);a>0?(d=0,e=a):(d=b.length+a,e=b.length);for(;dl?(d.$setValidity("maxlength",!1),p):(d.$setValidity("maxlength",!0),a)};d.$parsers.push(c);d.$formatters.push(c)}}function kb(b,a){b="ngClass"+b;return R(function(c,d,e){function g(b, +d){if(a===!0||c.$index%2===a)d&&b!==d&&i(d),f(b)}function i(a){M(a)&&!I(a)&&(a=Ta(a,function(a,b){if(a)return b}));d.removeClass(I(a)?a.join(" "):a)}function f(a){M(a)&&!I(a)&&(a=Ta(a,function(a,b){if(a)return b}));a&&d.addClass(I(a)?a.join(" "):a)}c.$watch(e[b],g,!0);e.$observe("class",function(){var a=c.$eval(e[b]);g(a,a)});b!=="ngClass"&&c.$watch("$index",function(d,g){var k=d%2;k!==g%2&&(k==a?f(c.$eval(e[b])):i(c.$eval(e[b])))})})}var D=function(b){return E(b)?b.toLowerCase():b},la=function(b){return E(b)? +b.toUpperCase():b},u=T.Error,aa=F((/msie (\d+)/.exec(D(navigator.userAgent))||[])[1]),z,ja,ia=[].slice,Ra=[].push,Sa=Object.prototype.toString,Zb=T.angular||(T.angular={}),sa,Db,Z=["0","0","0"];C.$inject=[];ma.$inject=[];Db=aa<9?function(b){b=b.nodeName?b:b[0];return b.scopeName&&b.scopeName!="HTML"?la(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var kc=/[A-Z]/g,hd={full:"1.0.4",major:1,minor:0,dot:4,codeName:"bewildering-hair"},Aa=O.cache={},za= +O.expando="ng-"+(new Date).getTime(),oc=1,$b=T.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},eb=T.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)},mc=/([\:\-\_]+(.))/g,nc=/^moz([A-Z])/,ta=O.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;this.bind("DOMContentLoaded",a);O(T).bind("load",a)},toString:function(){var b=[];m(this,function(a){b.push(""+a)}); +return"["+b.join(", ")+"]"},eq:function(b){return b>=0?z(this[b]):z(this[this.length+b])},length:0,push:Ra,sort:[].sort,splice:[].splice},Da={};m("multiple,selected,checked,disabled,readOnly,required".split(","),function(b){Da[D(b)]=b});var Ab={};m("input,select,option,textarea,button,form".split(","),function(b){Ab[la(b)]=!0});m({data:vb,inheritedData:Ca,scope:function(b){return Ca(b,"$scope")},controller:yb,injector:function(b){return Ca(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)}, +hasClass:Ba,css:function(b,a,c){a=sb(a);if(v(c))b.style[a]=c;else{var d;aa<=8&&(d=b.currentStyle&&b.currentStyle[a],d===""&&(d="auto"));d=d||b.style[a];aa<=8&&(d=d===""?p:d);return d}},attr:function(b,a,c){var d=D(a);if(Da[d])if(v(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||C).specified?d:p;else if(v(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),b===null?p:b},prop:function(b,a,c){if(v(c))b[a]=c;else return b[a]}, +text:y(aa<9?function(b,a){if(b.nodeType==1){if(t(a))return b.innerText;b.innerText=a}else{if(t(a))return b.nodeValue;b.nodeValue=a}}:function(b,a){if(t(a))return b.textContent;b.textContent=a},{$dv:""}),val:function(b,a){if(t(a))return b.value;b.value=a},html:function(b,a){if(t(a))return b.innerHTML;for(var c=0,d=b.childNodes;c":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)}, +"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Kc={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'},ib={},Xc=T.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw new u("This browser does not support XMLHttpRequest.");};Qb.$inject=["$provide"];Rb.$inject= +["$locale"];Tb.$inject=["$locale"];var Wb=".",gd={yyyy:N("FullYear",4),yy:N("FullYear",2,0,!0),y:N("FullYear",1),MMMM:La("Month"),MMM:La("Month",!0),MM:N("Month",2,1),M:N("Month",1,1),dd:N("Date",2),d:N("Date",1),HH:N("Hours",2),H:N("Hours",1),hh:N("Hours",2,-12),h:N("Hours",1,-12),mm:N("Minutes",2),m:N("Minutes",1),ss:N("Seconds",2),s:N("Seconds",1),EEEE:La("Day"),EEE:La("Day",!0),a:function(a,c){return a.getHours()<12?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=a.getTimezoneOffset();return jb(a/60,2)+ +jb(Math.abs(a%60),2)}},fd=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,ed=/^\d+$/;Sb.$inject=["$locale"];var cd=H(D),dd=H(la);Ub.$inject=["$parse"];var id=H({restrict:"E",compile:function(a,c){c.href||c.$set("href","");return function(a,c){c.bind("click",function(a){c.attr("href")||a.preventDefault()})}}}),lb={};m(Da,function(a,c){var d=fa("ng-"+c);lb[d]=function(){return{priority:100,compile:function(){return function(a,g,i){a.$watch(i[d],function(a){i.$set(c,!!a)})}}}}}); +m(["src","href"],function(a){var c=fa("ng-"+a);lb[c]=function(){return{priority:99,link:function(d,e,g){g.$observe(c,function(c){c&&(g.$set(a,c),aa&&e.prop(a,c))})}}}});var Oa={$addControl:C,$removeControl:C,$setValidity:C,$setDirty:C};Xb.$inject=["$element","$attrs","$scope"];var Ra=function(a){return["$timeout",function(c){var d={name:"form",restrict:"E",controller:Xb,compile:function(){return{pre:function(a,d,i,f){if(!i.action){var h=function(a){a.preventDefault?a.preventDefault():a.returnValue= +!1};$b(d[0],"submit",h);d.bind("$destroy",function(){c(function(){eb(d[0],"submit",h)},0,!1)})}var j=d.parent().controller("form"),k=i.name||i.ngForm;k&&(a[k]=f);j&&d.bind("$destroy",function(){j.$removeControl(f);k&&(a[k]=p);y(f,Oa)})}}}};return a?y(U(d),{restrict:"EAC"}):d}]},jd=Ra(),kd=Ra(!0),ld=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,md=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,nd=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,bc={text:Qa,number:function(a, +c,d,e,g,i){Qa(a,c,d,e,g,i);e.$parsers.push(function(a){var c=S(a);return c||nd.test(a)?(e.$setValidity("number",!0),a===""?null:c?a:parseFloat(a)):(e.$setValidity("number",!1),p)});e.$formatters.push(function(a){return S(a)?"":""+a});if(d.min){var f=parseFloat(d.min),a=function(a){return!S(a)&&ah?(e.$setValidity("max",!1),p):(e.$setValidity("max", +!0),a)};e.$parsers.push(d);e.$formatters.push(d)}e.$formatters.push(function(a){return S(a)||va(a)?(e.$setValidity("number",!0),a):(e.$setValidity("number",!1),p)})},url:function(a,c,d,e,g,i){Qa(a,c,d,e,g,i);a=function(a){return S(a)||ld.test(a)?(e.$setValidity("url",!0),a):(e.$setValidity("url",!1),p)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,g,i){Qa(a,c,d,e,g,i);a=function(a){return S(a)||md.test(a)?(e.$setValidity("email",!0),a):(e.$setValidity("email",!1),p)};e.$formatters.push(a); +e.$parsers.push(a)},radio:function(a,c,d,e){t(d.name)&&c.attr("name",wa());c.bind("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var g=d.ngTrueValue,i=d.ngFalseValue;E(g)||(g=!0);E(i)||(i=!1);c.bind("click",function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$formatters.push(function(a){return a=== +g});e.$parsers.push(function(a){return a?g:i})},hidden:C,button:C,submit:C,reset:C},cc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,g,i){i&&(bc[D(g.type)]||bc.text)(d,e,g,i,c,a)}}}],Na="ng-valid",Ma="ng-invalid",Pa="ng-pristine",Yb="ng-dirty",od=["$scope","$exceptionHandler","$attrs","$element","$parse",function(a,c,d,e,g){function i(a,c){c=c?"-"+$a(c,"-"):"";e.removeClass((a?Ma:Na)+c).addClass((a?Na:Ma)+c)}this.$modelValue=this.$viewValue=Number.NaN; +this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var f=g(d.ngModel),h=f.assign;if(!h)throw u(Eb+d.ngModel+" ("+pa(e)+")");this.$render=C;var j=e.inheritedData("$formController")||Oa,k=0,l=this.$error={};e.addClass(Pa);i(!0);this.$setValidity=function(a,c){if(l[a]!==!c){if(c){if(l[a]&&k--,!k)i(!0),this.$valid=!0,this.$invalid=!1}else i(!1),this.$invalid=!0,this.$valid=!1,k++;l[a]=!c;i(c,a);j.$setValidity(a, +c,this)}};this.$setViewValue=function(d){this.$viewValue=d;if(this.$pristine)this.$dirty=!0,this.$pristine=!1,e.removeClass(Pa).addClass(Yb),j.$setDirty();m(this.$parsers,function(a){d=a(d)});if(this.$modelValue!==d)this.$modelValue=d,h(a,d),m(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};var o=this;a.$watch(function(){var c=f(a);if(o.$modelValue!==c){var d=o.$formatters,e=d.length;for(o.$modelValue=c;e--;)c=d[e](c);if(o.$viewValue!==c)o.$viewValue=c,o.$render()}})}],pd=function(){return{require:["ngModel", +"^?form"],controller:od,link:function(a,c,d,e){var g=e[0],i=e[1]||Oa;i.$addControl(g);c.bind("$destroy",function(){i.$removeControl(g)})}}},qd=H({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),dc=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=!0;var g=function(a){if(d.required&&(S(a)||a===!1))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(g);e.$parsers.unshift(g); +d.$observe("required",function(){g(e.$viewValue)})}}}},rd=function(){return{require:"ngModel",link:function(a,c,d,e){var g=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){var c=[];a&&m(a.split(g),function(a){a&&c.push(Q(a))});return c});e.$formatters.push(function(a){return I(a)?a.join(", "):p})}}},sd=/^(true|false|\d+)$/,td=function(){return{priority:100,compile:function(a,c){return sd.test(c.ngValue)?function(a,c,g){g.$set("value",a.$eval(g.ngValue))}:function(a, +c,g){a.$watch(g.ngValue,function(a){g.$set("value",a,!1)})}}}},ud=R(function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==p?"":a)})}),vd=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],wd=[function(){return function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBindHtmlUnsafe);a.$watch(d.ngBindHtmlUnsafe, +function(a){c.html(a||"")})}}],xd=kb("",!0),yd=kb("Odd",0),zd=kb("Even",1),Ad=R({compile:function(a,c){c.$set("ngCloak",p);a.removeClass("ng-cloak")}}),Bd=[function(){return{scope:!0,controller:"@"}}],Cd=["$sniffer",function(a){return{priority:1E3,compile:function(){a.csp=!0}}}],ec={};m("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave".split(" "),function(a){var c=fa("ng-"+a);ec[c]=["$parse",function(d){return function(e,g,i){var f=d(i[c]);g.bind(D(a),function(a){e.$apply(function(){f(e, +{$event:a})})})}}]});var Dd=R(function(a,c,d){c.bind("submit",function(){a.$apply(d.ngSubmit)})}),Ed=["$http","$templateCache","$anchorScroll","$compile",function(a,c,d,e){return{restrict:"ECA",terminal:!0,compile:function(g,i){var f=i.ngInclude||i.src,h=i.onload||"",j=i.autoscroll;return function(g,i){var o=0,m,n=function(){m&&(m.$destroy(),m=null);i.html("")};g.$watch(f,function(f){var q=++o;f?a.get(f,{cache:c}).success(function(a){q===o&&(m&&m.$destroy(),m=g.$new(),i.html(a),e(i.contents())(m), +v(j)&&(!j||g.$eval(j))&&d(),m.$emit("$includeContentLoaded"),g.$eval(h))}).error(function(){q===o&&n()}):n()})}}}}],Fd=R({compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Gd=R({terminal:!0,priority:1E3}),Hd=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,g,i){var f=i.count,h=g.attr(i.$attr.when),j=i.offset||0,k=e.$eval(h),l={},o=c.startSymbol(),r=c.endSymbol();m(k,function(a,e){l[e]=c(a.replace(d,o+f+"-"+j+r))});e.$watch(function(){var c= +parseFloat(e.$eval(f));return isNaN(c)?"":(k[c]||(c=a.pluralCat(c-j)),l[c](e,g,!0))},function(a){g.text(a)})}}}],Id=R({transclude:"element",priority:1E3,terminal:!0,compile:function(a,c,d){return function(a,c,i){var f=i.ngRepeat,i=f.match(/^\s*(.+)\s+in\s+(.*)\s*$/),h,j,k;if(!i)throw u("Expected ngRepeat in form of '_item_ in _collection_' but got '"+f+"'.");f=i[1];h=i[2];i=f.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!i)throw u("'item' in 'item in collection' should be identifier or (key, value) but got '"+ +f+"'.");j=i[3]||i[1];k=i[2];var l=new fb;a.$watch(function(a){var e,f,i=a.$eval(h),m=c,p=new fb,z,A,s,v,t,u;if(I(i))t=i||[];else{t=[];for(s in i)i.hasOwnProperty(s)&&s.charAt(0)!="$"&&t.push(s);t.sort()}z=t.length;e=0;for(f=t.length;ey;)v.pop().element.remove()}for(;s.length>w;)s.pop()[0].element.remove()}var i;if(!(i=w.match(d)))throw u("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+w+"'."); +var j=c(i[2]||i[1]),k=i[4]||i[6],l=i[5],m=c(i[3]||""),o=c(i[2]?i[1]:k),r=c(i[7]),s=[[{element:f,label:""}]];q&&(a(q)(e),q.removeClass("ng-scope"),q.remove());f.html("");f.bind("change",function(){e.$apply(function(){var a,c=r(e)||[],d={},h,i,j,m,q,t;if(n){i=[];m=0;for(t=s.length;m@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}'); diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/js/bootstrap.min.js b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/js/bootstrap.min.js new file mode 100644 index 00000000000..6eeb15ce3b7 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Content/js/bootstrap.min.js @@ -0,0 +1,6 @@ +/*! +* Bootstrap.js by @fat & @mdo +* Copyright 2012 Twitter, Inc. +* http://www.apache.org/licenses/LICENSE-2.0.txt +*/ +!function($){"use strict";$(function(){$.support.transition=function(){var transitionEnd=function(){var name,el=document.createElement("bootstrap"),transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(name in transEndEventNames)if(void 0!==el.style[name])return transEndEventNames[name]}();return transitionEnd&&{end:transitionEnd}}()})}(window.jQuery),!function($){"use strict";var dismiss='[data-dismiss="alert"]',Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.prototype.close=function(e){function removeElement(){$parent.trigger("closed").remove()}var $parent,$this=$(this),selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),e&&e.preventDefault(),$parent.length||($parent=$this.hasClass("alert")?$this:$this.parent()),$parent.trigger(e=$.Event("close")),e.isDefaultPrevented()||($parent.removeClass("in"),$.support.transition&&$parent.hasClass("fade")?$parent.on($.support.transition.end,removeElement):removeElement())};var old=$.fn.alert;$.fn.alert=function(option){return this.each(function(){var $this=$(this),data=$this.data("alert");data||$this.data("alert",data=new Alert(this)),"string"==typeof option&&data[option].call($this)})},$.fn.alert.Constructor=Alert,$.fn.alert.noConflict=function(){return $.fn.alert=old,this},$(document).on("click.alert.data-api",dismiss,Alert.prototype.close)}(window.jQuery),!function($){"use strict";var Button=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.button.defaults,options)};Button.prototype.setState=function(state){var d="disabled",$el=this.$element,data=$el.data(),val=$el.is("input")?"val":"html";state+="Text",data.resetText||$el.data("resetText",$el[val]()),$el[val](data[state]||this.options[state]),setTimeout(function(){"loadingText"==state?$el.addClass(d).attr(d,d):$el.removeClass(d).removeAttr(d)},0)},Button.prototype.toggle=function(){var $parent=this.$element.closest('[data-toggle="buttons-radio"]');$parent&&$parent.find(".active").removeClass("active"),this.$element.toggleClass("active")};var old=$.fn.button;$.fn.button=function(option){return this.each(function(){var $this=$(this),data=$this.data("button"),options="object"==typeof option&&option;data||$this.data("button",data=new Button(this,options)),"toggle"==option?data.toggle():option&&data.setState(option)})},$.fn.button.defaults={loadingText:"loading..."},$.fn.button.Constructor=Button,$.fn.button.noConflict=function(){return $.fn.button=old,this},$(document).on("click.button.data-api","[data-toggle^=button]",function(e){var $btn=$(e.target);$btn.hasClass("btn")||($btn=$btn.closest(".btn")),$btn.button("toggle")})}(window.jQuery),!function($){"use strict";var Carousel=function(element,options){this.$element=$(element),this.options=options,"hover"==this.options.pause&&this.$element.on("mouseenter",$.proxy(this.pause,this)).on("mouseleave",$.proxy(this.cycle,this))};Carousel.prototype={cycle:function(e){return e||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval)),this},to:function(pos){var $active=this.$element.find(".item.active"),children=$active.parent().children(),activePos=children.index($active),that=this;if(!(pos>children.length-1||0>pos))return this.sliding?this.$element.one("slid",function(){that.to(pos)}):activePos==pos?this.pause().cycle():this.slide(pos>activePos?"next":"prev",$(children[pos]))},pause:function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&$.support.transition.end&&(this.$element.trigger($.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){return this.sliding?void 0:this.slide("next")},prev:function(){return this.sliding?void 0:this.slide("prev")},slide:function(type,next){var e,$active=this.$element.find(".item.active"),$next=next||$active[type](),isCycling=this.interval,direction="next"==type?"left":"right",fallback="next"==type?"first":"last",that=this;if(this.sliding=!0,isCycling&&this.pause(),$next=$next.length?$next:this.$element.find(".item")[fallback](),e=$.Event("slide",{relatedTarget:$next[0]}),!$next.hasClass("active")){if($.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(e),e.isDefaultPrevented())return;$next.addClass(type),$next[0].offsetWidth,$active.addClass(direction),$next.addClass(direction),this.$element.one($.support.transition.end,function(){$next.removeClass([type,direction].join(" ")).addClass("active"),$active.removeClass(["active",direction].join(" ")),that.sliding=!1,setTimeout(function(){that.$element.trigger("slid")},0)})}else{if(this.$element.trigger(e),e.isDefaultPrevented())return;$active.removeClass("active"),$next.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return isCycling&&this.cycle(),this}}};var old=$.fn.carousel;$.fn.carousel=function(option){return this.each(function(){var $this=$(this),data=$this.data("carousel"),options=$.extend({},$.fn.carousel.defaults,"object"==typeof option&&option),action="string"==typeof option?option:options.slide;data||$this.data("carousel",data=new Carousel(this,options)),"number"==typeof option?data.to(option):action?data[action]():options.interval&&data.cycle()})},$.fn.carousel.defaults={interval:5e3,pause:"hover"},$.fn.carousel.Constructor=Carousel,$.fn.carousel.noConflict=function(){return $.fn.carousel=old,this},$(document).on("click.carousel.data-api","[data-slide]",function(e){var href,$this=$(this),$target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"")),options=$.extend({},$target.data(),$this.data());$target.carousel(options),e.preventDefault()})}(window.jQuery),!function($){"use strict";var Collapse=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.collapse.defaults,options),this.options.parent&&(this.$parent=$(this.options.parent)),this.options.toggle&&this.toggle()};Collapse.prototype={constructor:Collapse,dimension:function(){var hasWidth=this.$element.hasClass("width");return hasWidth?"width":"height"},show:function(){var dimension,scroll,actives,hasData;if(!this.transitioning){if(dimension=this.dimension(),scroll=$.camelCase(["scroll",dimension].join("-")),actives=this.$parent&&this.$parent.find("> .accordion-group > .in"),actives&&actives.length){if(hasData=actives.data("collapse"),hasData&&hasData.transitioning)return;actives.collapse("hide"),hasData||actives.data("collapse",null)}this.$element[dimension](0),this.transition("addClass",$.Event("show"),"shown"),$.support.transition&&this.$element[dimension](this.$element[0][scroll])}},hide:function(){var dimension;this.transitioning||(dimension=this.dimension(),this.reset(this.$element[dimension]()),this.transition("removeClass",$.Event("hide"),"hidden"),this.$element[dimension](0))},reset:function(size){var dimension=this.dimension();return this.$element.removeClass("collapse")[dimension](size||"auto")[0].offsetWidth,this.$element[null!==size?"addClass":"removeClass"]("collapse"),this},transition:function(method,startEvent,completeEvent){var that=this,complete=function(){"show"==startEvent.type&&that.reset(),that.transitioning=0,that.$element.trigger(completeEvent)};this.$element.trigger(startEvent),startEvent.isDefaultPrevented()||(this.transitioning=1,this.$element[method]("in"),$.support.transition&&this.$element.hasClass("collapse")?this.$element.one($.support.transition.end,complete):complete())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var old=$.fn.collapse;$.fn.collapse=function(option){return this.each(function(){var $this=$(this),data=$this.data("collapse"),options="object"==typeof option&&option;data||$this.data("collapse",data=new Collapse(this,options)),"string"==typeof option&&data[option]()})},$.fn.collapse.defaults={toggle:!0},$.fn.collapse.Constructor=Collapse,$.fn.collapse.noConflict=function(){return $.fn.collapse=old,this},$(document).on("click.collapse.data-api","[data-toggle=collapse]",function(e){var href,$this=$(this),target=$this.attr("data-target")||e.preventDefault()||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""),option=$(target).data("collapse")?"toggle":$this.data();$this[$(target).hasClass("in")?"addClass":"removeClass"]("collapsed"),$(target).collapse(option)})}(window.jQuery),!function($){"use strict";function clearMenus(){$(toggle).each(function(){getParent($(this)).removeClass("open")})}function getParent($this){var $parent,selector=$this.attr("data-target");return selector||(selector=$this.attr("href"),selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),$parent.length||($parent=$this.parent()),$parent}var toggle="[data-toggle=dropdown]",Dropdown=function(element){var $el=$(element).on("click.dropdown.data-api",this.toggle);$("html").on("click.dropdown.data-api",function(){$el.parent().removeClass("open")})};Dropdown.prototype={constructor:Dropdown,toggle:function(){var $parent,isActive,$this=$(this);if(!$this.is(".disabled, :disabled"))return $parent=getParent($this),isActive=$parent.hasClass("open"),clearMenus(),isActive||$parent.toggleClass("open"),$this.focus(),!1},keydown:function(e){var $this,$items,$parent,isActive,index;if(/(38|40|27)/.test(e.keyCode)&&($this=$(this),e.preventDefault(),e.stopPropagation(),!$this.is(".disabled, :disabled"))){if($parent=getParent($this),isActive=$parent.hasClass("open"),!isActive||isActive&&27==e.keyCode)return $this.click();$items=$("[role=menu] li:not(.divider):visible a",$parent),$items.length&&(index=$items.index($items.filter(":focus")),38==e.keyCode&&index>0&&index--,40==e.keyCode&&$items.length-1>index&&index++,~index||(index=0),$items.eq(index).focus())}}};var old=$.fn.dropdown;$.fn.dropdown=function(option){return this.each(function(){var $this=$(this),data=$this.data("dropdown");data||$this.data("dropdown",data=new Dropdown(this)),"string"==typeof option&&data[option].call($this)})},$.fn.dropdown.Constructor=Dropdown,$.fn.dropdown.noConflict=function(){return $.fn.dropdown=old,this},$(document).on("click.dropdown.data-api touchstart.dropdown.data-api",clearMenus).on("click.dropdown touchstart.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("touchstart.dropdown.data-api",".dropdown-menu",function(e){e.stopPropagation()}).on("click.dropdown.data-api touchstart.dropdown.data-api",toggle,Dropdown.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api",toggle+", [role=menu]",Dropdown.prototype.keydown)}(window.jQuery),!function($){"use strict";var Modal=function(element,options){this.options=options,this.$element=$(element).delegate('[data-dismiss="modal"]',"click.dismiss.modal",$.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};Modal.prototype={constructor:Modal,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var that=this,e=$.Event("show");this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass("fade");that.$element.parent().length||that.$element.appendTo(document.body),that.$element.show(),transition&&that.$element[0].offsetWidth,that.$element.addClass("in").attr("aria-hidden",!1),that.enforceFocus(),transition?that.$element.one($.support.transition.end,function(){that.$element.focus().trigger("shown")}):that.$element.focus().trigger("shown")}))},hide:function(e){e&&e.preventDefault(),e=$.Event("hide"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),$(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),$.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var that=this;$(document).on("focusin.modal",function(e){that.$element[0]===e.target||that.$element.has(e.target).length||that.$element.focus()})},escape:function(){var that=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(e){27==e.which&&that.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var that=this,timeout=setTimeout(function(){that.$element.off($.support.transition.end),that.hideModal()},500);this.$element.one($.support.transition.end,function(){clearTimeout(timeout),that.hideModal()})},hideModal:function(){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(callback){var animate=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate;this.$backdrop=$(' +
    +
    +
    + List of orders +
    + Heads up! Once you place an order, you have 20 secs to cancel it. +
    + + + + + + + + + + + + + + + + + + + + +
    #Video(s)Status 
    + No order yet, place some orders above +
    {{order.number}}
    {{title}}
    {{order.status}}
    +
    +
    +
    +
    + Orders Received + + + + + + + + + + + + + + + + +
    #Video(s)
    + No orders received yet +
    {{order.number}}
    +
    +
    +
    + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Views/Shared/_Layout.cshtml b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Views/Shared/_Layout.cshtml new file mode 100644 index 00000000000..b6bcbb07c06 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Views/Shared/_Layout.cshtml @@ -0,0 +1,54 @@ + + + + + + @ViewBag.Title + + + + + + + + + + @RenderSection("head", required: false) + + + + +
    + @RenderBody() +
    + + + \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Views/Web.config b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Views/Web.config new file mode 100644 index 00000000000..a575d7cc087 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Views/Web.config @@ -0,0 +1,35 @@ + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Views/_ViewStart.cshtml b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Views/_ViewStart.cshtml new file mode 100644 index 00000000000..efda124b1fc --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Web.Debug.config b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Web.Debug.config new file mode 100644 index 00000000000..2251b2c596e --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Web.Release.config b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Web.Release.config new file mode 100644 index 00000000000..90b9041232d --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Web.config b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Web.config new file mode 100644 index 00000000000..7ac8dd83fb5 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/Web.config @@ -0,0 +1,28 @@ + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/packages.config b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/packages.config new file mode 100644 index 00000000000..5c0ee781a86 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.ECommerce/packages.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Commands/CancelOrder.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Commands/CancelOrder.cs new file mode 100644 index 00000000000..5a6b5e9b374 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Commands/CancelOrder.cs @@ -0,0 +1,8 @@ +namespace VideoStore.Messages.Commands +{ + public class CancelOrder + { + public int OrderNumber { get; set; } + public string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Commands/SubmitOrder.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Commands/SubmitOrder.cs new file mode 100644 index 00000000000..6d2ce27cb10 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Commands/SubmitOrder.cs @@ -0,0 +1,11 @@ +namespace VideoStore.Messages.Commands +{ + public class SubmitOrder + { + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + public string EncryptedCreditCardNumber { get; set; } + public string EncryptedExpirationDate { get; set; } + } +} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/ClientBecamePreferred.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/ClientBecamePreferred.cs new file mode 100644 index 00000000000..6f73e54cbdf --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/ClientBecamePreferred.cs @@ -0,0 +1,10 @@ +namespace VideoStore.Messages.Events +{ + using System; + + public class ClientBecamePreferred + { + public string ClientId { get; set; } + public DateTime PreferredStatusExpiresOn { get; set; } + } +} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/DownloadIsReady.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/DownloadIsReady.cs new file mode 100644 index 00000000000..7ba10112e13 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/DownloadIsReady.cs @@ -0,0 +1,11 @@ +namespace VideoStore.Messages.Events +{ + using System.Collections.Generic; + + public interface DownloadIsReady + { + int OrderNumber { get; set; } + Dictionary VideoUrls { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/OrderAccepted.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/OrderAccepted.cs new file mode 100644 index 00000000000..e37e0b6ac56 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/OrderAccepted.cs @@ -0,0 +1,10 @@ +namespace VideoStore.Messages.Events +{ + //NServiceBus messages can be defined using both classes and interfaces + public interface OrderAccepted + { + int OrderNumber { get; set; } + string[] VideoIds { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/OrderCancelled.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/OrderCancelled.cs new file mode 100644 index 00000000000..b7c456edee2 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/OrderCancelled.cs @@ -0,0 +1,8 @@ +namespace VideoStore.Messages.Events +{ + public interface OrderCancelled + { + int OrderNumber { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/OrderPlaced.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/OrderPlaced.cs new file mode 100644 index 00000000000..e638040b37e --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Events/OrderPlaced.cs @@ -0,0 +1,9 @@ +namespace VideoStore.Messages.Events +{ + public interface OrderPlaced + { + int OrderNumber { get; set; } + string[] VideoIds { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Properties/AssemblyInfo.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..5972cb6d3a7 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyMessages")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyMessages")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("4687cda1-7646-49ca-83ad-35500037bda3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Messages/RequestResponse/ProvisionDownloadRequest.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/RequestResponse/ProvisionDownloadRequest.cs new file mode 100644 index 00000000000..8f40dbdfc58 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/RequestResponse/ProvisionDownloadRequest.cs @@ -0,0 +1,9 @@ +namespace VideoStore.Messages.RequestResponse +{ + public class ProvisionDownloadRequest + { + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + } +} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Messages/RequestResponse/ProvisionDownloadResponse.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/RequestResponse/ProvisionDownloadResponse.cs new file mode 100644 index 00000000000..5b58f9d8d8b --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/RequestResponse/ProvisionDownloadResponse.cs @@ -0,0 +1,9 @@ +namespace VideoStore.Messages.RequestResponse +{ + public class ProvisionDownloadResponse + { + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + } +} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Messages/VideoStore.Messages.csproj b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/VideoStore.Messages.csproj new file mode 100644 index 00000000000..7f7656a17b6 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Messages/VideoStore.Messages.csproj @@ -0,0 +1,72 @@ + + + + + + Debug + AnyCPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679} + Library + Properties + VideoStore.Messages + VideoStore.Messages + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Operations/App.config b/Samples/VideoStore.RabbitMQ/VideoStore.Operations/App.config new file mode 100644 index 00000000000..20fff428106 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Operations/App.config @@ -0,0 +1,17 @@ + + + +
    +
    +
    + + + + + + + + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Operations/EndpointConfig.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Operations/EndpointConfig.cs new file mode 100644 index 00000000000..faaa4162cfa --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Operations/EndpointConfig.cs @@ -0,0 +1,22 @@ +namespace VideoStore.Operations +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, UsingTransport + { + } + + public class MyClass : IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.Operations endpoint is now started and ready to accept messages"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Operations/Properties/AssemblyInfo.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Operations/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..ff7833e6eb7 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Operations/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyRequestResponseEndpoint")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyRequestResponseEndpoint")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f2941769-d352-4bba-aa24-6974cf3d7e2a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Operations/ProvisionDownloadHandler.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Operations/ProvisionDownloadHandler.cs new file mode 100644 index 00000000000..b1bdb94c4bb --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Operations/ProvisionDownloadHandler.cs @@ -0,0 +1,30 @@ +namespace VideoStore.Operations +{ + using System; + using System.Diagnostics; + using VideoStore.Common; + using VideoStore.Messages.RequestResponse; + using NServiceBus; + + public class ProvisionDownloadHandler : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(ProvisionDownloadRequest message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.Out.WriteLine("Provision the videos and make the Urls available to the Content management for download ...[{0}] video(s) to provision", String.Join(", ", message.VideoIds)); + + Bus.Reply(new ProvisionDownloadResponse + { + OrderNumber = message.OrderNumber, + VideoIds = message.VideoIds, + ClientId = message.ClientId + }); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Operations/VideoStore.Operations.csproj b/Samples/VideoStore.RabbitMQ/VideoStore.Operations/VideoStore.Operations.csproj new file mode 100644 index 00000000000..5ec68122b04 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Operations/VideoStore.Operations.csproj @@ -0,0 +1,96 @@ + + + + + + Debug + AnyCPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF} + Library + Properties + VideoStore.Operations + VideoStore.Operations + v4.0 + 512 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\packages\RabbitMQ.Client.3.0.0\lib\net30\RabbitMQ.Client.dll + + + ..\..\..\binaries\NServiceBus.Transports.RabbitMQ.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + DebugFlagMutator.cs + + + UnobtrusiveMessageConventions.cs + + + + + + + + + + + Designer + + + Designer + + + + + {59f2ba7e-4da5-49f8-9dbc-520fa99f4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Operations/packages.config b/Samples/VideoStore.RabbitMQ/VideoStore.Operations/packages.config new file mode 100644 index 00000000000..e0a39cbf5c2 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Operations/packages.config @@ -0,0 +1,4 @@ + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.RabbitMQ.sln b/Samples/VideoStore.RabbitMQ/VideoStore.RabbitMQ.sln new file mode 100644 index 00000000000..d6c86602ae6 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.RabbitMQ.sln @@ -0,0 +1,57 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{FC318FC3-ED0F-4130-BD33-E970AE78A56C}" + ProjectSection(SolutionItems) = preProject + .nuget\NuGet.Config = .nuget\NuGet.Config + .nuget\NuGet.exe = .nuget\NuGet.exe + .nuget\NuGet.targets = .nuget\NuGet.targets + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.Messages", "VideoStore.Messages\VideoStore.Messages.csproj", "{59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.CustomerRelations", "VideoStore.CustomerRelations\VideoStore.CustomerRelations.csproj", "{CD522757-4C40-49C7-94C5-CD5DA956BAFC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.Operations", "VideoStore.Operations\VideoStore.Operations.csproj", "{0B353423-4655-4523-B4E0-F191DDDF0ABF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.Sales", "VideoStore.Sales\VideoStore.Sales.csproj", "{C2D005B5-065F-4F81-BA1F-259F90E00AEE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.ContentManagement", "VideoStore.ContentManagement\VideoStore.ContentManagement.csproj", "{C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.ECommerce", "VideoStore.ECommerce\VideoStore.ECommerce.csproj", "{F295D85E-4447-44E4-A9CC-3E017CF2B0D8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Release|Any CPU.Build.0 = Release|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Release|Any CPU.Build.0 = Release|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Release|Any CPU.Build.0 = Release|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Release|Any CPU.Build.0 = Release|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Release|Any CPU.Build.0 = Release|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.RabbitMQ.v11.suo b/Samples/VideoStore.RabbitMQ/VideoStore.RabbitMQ.v11.suo new file mode 100644 index 00000000000..200aead0811 Binary files /dev/null and b/Samples/VideoStore.RabbitMQ/VideoStore.RabbitMQ.v11.suo differ diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Sales/App.config b/Samples/VideoStore.RabbitMQ/VideoStore.Sales/App.config new file mode 100644 index 00000000000..b86951a73e5 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Sales/App.config @@ -0,0 +1,22 @@ + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Sales/EndpointConfig.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Sales/EndpointConfig.cs new file mode 100644 index 00000000000..d4b4e3763fd --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Sales/EndpointConfig.cs @@ -0,0 +1,29 @@ +namespace VideoStore.Sales +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, UsingTransport, IWantCustomInitialization + { + public void Init() + { + Configure.With() + .DefaultBuilder() + .RijndaelEncryptionService(); + } + } + + + public class MyClass:IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.Sales endpoint is now started and ready to accept messages"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Sales/ProcessOrderSaga.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Sales/ProcessOrderSaga.cs new file mode 100644 index 00000000000..ee3dfc1358d --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Sales/ProcessOrderSaga.cs @@ -0,0 +1,90 @@ +namespace VideoStore.Sales +{ + using System; + using System.Diagnostics; + using Common; + using Messages.Commands; + using Messages.Events; + using NServiceBus; + using NServiceBus.Saga; + + public class ProcessOrderSaga : Saga, + IAmStartedByMessages, + IHandleMessages, + IHandleTimeouts + { + public void Handle(SubmitOrder message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Data.OrderNumber = message.OrderNumber; + Data.VideoIds = message.VideoIds; + Data.ClientId = message.ClientId; + + RequestTimeout(TimeSpan.FromSeconds(20), new BuyersRemorseIsOver()); + Console.Out.WriteLine("Starting cool down period for order #{0}.", Data.OrderNumber); + } + + public void Timeout(BuyersRemorseIsOver state) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Bus.Publish(e => + { + e.OrderNumber = Data.OrderNumber; + e.VideoIds = Data.VideoIds; + e.ClientId = Data.ClientId; + }); + + MarkAsComplete(); + + Console.Out.WriteLine("Cooling down period for order #{0} has elapsed.", Data.OrderNumber); + } + + public void Handle(CancelOrder message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + MarkAsComplete(); + + Bus.Publish(Bus.CreateInstance(o => + { + o.OrderNumber = message.OrderNumber; + o.ClientId = message.ClientId; + })); + + Console.Out.WriteLine("Order #{0} was cancelled.", message.OrderNumber); + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(m => m.OrderNumber) + .ToSaga(s=>s.OrderNumber); + ConfigureMapping(m => m.OrderNumber) + .ToSaga(s=>s.OrderNumber); + } + + public class OrderData : ContainSagaData + { + [Unique] + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + } + + public class BuyersRemorseIsOver + { + } + } + + +} \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Sales/Properties/AssemblyInfo.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Sales/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..b1f36493d27 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Sales/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyServer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyServer")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d3fd2af3-025c-4690-8ff1-0934a9d37b25")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Sales/SubmitOrderHandler.cs b/Samples/VideoStore.RabbitMQ/VideoStore.Sales/SubmitOrderHandler.cs new file mode 100644 index 00000000000..0a0e91fee1d --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Sales/SubmitOrderHandler.cs @@ -0,0 +1,37 @@ +namespace VideoStore.Sales +{ + using System; + using System.Diagnostics; + using VideoStore.Common; + using VideoStore.Messages.Commands; + using VideoStore.Messages.Events; + using NServiceBus; + + public class SubmitOrderHandler : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(SubmitOrder message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.Out.WriteLine("We have received an order #{0} for [{1}] video(s).", message.OrderNumber, + String.Join(", ", message.VideoIds)); + + Console.Out.WriteLine("The credit card values will be encrypted when looking at the messages in the queues"); + Console.Out.WriteLine("CreditCard Number is {0}", message.EncryptedCreditCardNumber); + Console.Out.WriteLine("CreditCard Expiration Date is {0}", message.EncryptedExpirationDate); + + //tell the client that we received the order + Bus.Publish(Bus.CreateInstance(o => + { + o.ClientId = message.ClientId; + o.OrderNumber = message.OrderNumber; + o.VideoIds = message.VideoIds; + })); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Sales/VideoStore.Sales.csproj b/Samples/VideoStore.RabbitMQ/VideoStore.Sales/VideoStore.Sales.csproj new file mode 100644 index 00000000000..3a89f1dff90 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Sales/VideoStore.Sales.csproj @@ -0,0 +1,97 @@ + + + + + + Debug + AnyCPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE} + Library + Properties + VideoStore.Sales + VideoStore.Sales + v4.0 + 512 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\packages\RabbitMQ.Client.3.0.0\lib\net30\RabbitMQ.Client.dll + + + ..\..\..\binaries\NServiceBus.Transports.RabbitMQ.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + DebugFlagMutator.cs + + + UnobtrusiveMessageConventions.cs + + + + + + + + + + + + + Designer + + + + + + + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + diff --git a/Samples/VideoStore.RabbitMQ/VideoStore.Sales/packages.config b/Samples/VideoStore.RabbitMQ/VideoStore.Sales/packages.config new file mode 100644 index 00000000000..e0a39cbf5c2 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/VideoStore.Sales/packages.config @@ -0,0 +1,4 @@ + + + + diff --git a/Samples/VideoStore.RabbitMQ/packages/repositories.config b/Samples/VideoStore.RabbitMQ/packages/repositories.config new file mode 100644 index 00000000000..66c82756846 --- /dev/null +++ b/Samples/VideoStore.RabbitMQ/packages/repositories.config @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/VideoStore.SqlServer/.nuget/NuGet.Config b/Samples/VideoStore.SqlServer/.nuget/NuGet.Config new file mode 100644 index 00000000000..308b678b2da --- /dev/null +++ b/Samples/VideoStore.SqlServer/.nuget/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + diff --git a/Samples/VideoStore.SqlServer/.nuget/NuGet.exe b/Samples/VideoStore.SqlServer/.nuget/NuGet.exe new file mode 100644 index 00000000000..4645f4b35e8 Binary files /dev/null and b/Samples/VideoStore.SqlServer/.nuget/NuGet.exe differ diff --git a/Samples/VideoStore.SqlServer/.nuget/NuGet.targets b/Samples/VideoStore.SqlServer/.nuget/NuGet.targets new file mode 100644 index 00000000000..4ada616b317 --- /dev/null +++ b/Samples/VideoStore.SqlServer/.nuget/NuGet.targets @@ -0,0 +1,150 @@ + + + + $(MSBuildProjectDirectory)\..\ + + + false + + + false + + + true + + + false + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + + + + + $(SolutionDir).nuget + packages.config + + + + + $(NuGetToolsPath)\nuget.exe + @(PackageSource) + + "$(NuGetExePath)" + mono --runtime=v4.0.30319 $(NuGetExePath) + + $(TargetDir.Trim('\\')) + + -RequireConsent + + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(RequireConsentSwitch) -solutionDir "$(SolutionDir) " + $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols + + + + RestorePackages; + $(ResolveReferencesDependsOn); + + + + + $(BuildDependsOn); + BuildPackage; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/App.config b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/App.config new file mode 100644 index 00000000000..813435e3433 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/App.config @@ -0,0 +1,25 @@ + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/DebugFlagMutator.cs b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/DebugFlagMutator.cs new file mode 100644 index 00000000000..12cce29e2ee --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/DebugFlagMutator.cs @@ -0,0 +1,37 @@ +namespace VideoStore.Common +{ + using System; + using System.Threading; + using NServiceBus; + using NServiceBus.MessageMutator; + + public class DebugFlagMutator : IMutateTransportMessages, INeedInitialization + { + public static bool Debug { get { return debug.Value; } } + + public void MutateIncoming(TransportMessage transportMessage) + { + var debugFlag = transportMessage.Headers.ContainsKey("Debug") ? transportMessage.Headers["Debug"] : "false"; + if (debugFlag !=null && debugFlag.Equals("true", StringComparison.OrdinalIgnoreCase)) + { + debug.Value = true; + } + else + { + debug.Value = false; + } + } + + public void MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + transportMessage.Headers["Debug"] = Debug.ToString(); + } + + public void Init() + { + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + } + + static readonly ThreadLocal debug = new ThreadLocal(); + } +} diff --git a/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/EndpointConfig.cs b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/EndpointConfig.cs new file mode 100644 index 00000000000..c78391661c3 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/EndpointConfig.cs @@ -0,0 +1,20 @@ +namespace VideoStore.ContentManagement +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, UsingTransport { } + + public class MyClass : IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.ContentManagement endpoint is now started and subscribed to OrderAccepted events from VideoStore.Sales"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/OrderAcceptedHandler.cs b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/OrderAcceptedHandler.cs new file mode 100644 index 00000000000..b5b2d8fb5f8 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/OrderAcceptedHandler.cs @@ -0,0 +1,35 @@ +namespace VideoStore.ContentManagement +{ + using System; + using System.Diagnostics; + using VideoStore.Common; + using VideoStore.Messages.RequestResponse; + using VideoStore.Messages.Events; + using NServiceBus; + + public class OrderAcceptedHandler : IHandleMessages + { + + + public IBus Bus { get; set; } + + public void Handle(OrderAccepted message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.WriteLine("Order # {0} has been accepted, Let's provision the download -- Sending ProvisionDownloadRequest to the VideoStore.Operations endpoint", message.OrderNumber); + + //send out a request (a event will be published when the response comes back) + Bus.Send(r => + { + r.ClientId = message.ClientId; + r.OrderNumber = message.OrderNumber; + r.VideoIds = message.VideoIds; + }); + + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/Properties/AssemblyInfo.cs b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..5b8a651c9ce --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("VideoStore.DownloadVideos")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VideoStore.DownloadVideos")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("7121e327-af1c-4c5d-87f5-47fa2799ffa7")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/ProvisionDownloadResponseHandler.cs b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/ProvisionDownloadResponseHandler.cs new file mode 100644 index 00000000000..2818c347035 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/ProvisionDownloadResponseHandler.cs @@ -0,0 +1,49 @@ +namespace VideoStore.ContentManagement +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using Messages.Events; + using Messages.RequestResponse; + using NServiceBus; + using VideoStore.Common; + + public class ProvisionDownloadResponseHandler : IHandleMessages + { + public IBus Bus { get; set; } + private readonly IDictionary videoIdToUrlMap = new Dictionary + { + {"intro1", "http://youtu.be/6lYF83wKerA"}, + {"intro2", "http://youtu.be/icze_WCyEdQ"}, + {"gems", "http://skillsmatter.com/podcast/design-architecture/hidden-nservicebus-gems"}, + {"integ", "http://skillsmatter.com/podcast/home/reliable-integrations-nservicebus/js-1877"}, + {"shiny", "http://skillsmatter.com/podcast/open-source-dot-net/nservicebus-3"}, + {"day", "http://dnrtv.com/dnrtvplayer/player.aspx?ShowNum=0199"}, + {"need", "http://vimeo.com/37728422"}, + }; + + public void Handle(ProvisionDownloadResponse message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.WriteLine("Download for Order # {0} has been provisioned, Publishing Download ready event", message.OrderNumber); + + Bus.Publish(e => + { + e.OrderNumber = message.OrderNumber; + e.ClientId = message.ClientId; + e.VideoUrls = new Dictionary(); + + foreach (var videoId in message.VideoIds) + { + e.VideoUrls.Add(videoId, videoIdToUrlMap[videoId]); + } + }); + + Console.Out.WriteLine("Downloads for Order #{0} is ready, publishing it.", message.OrderNumber); + } + } +} diff --git a/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/UnobtrusiveMessageConventions.cs b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/UnobtrusiveMessageConventions.cs new file mode 100644 index 00000000000..ed699df4fa4 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/UnobtrusiveMessageConventions.cs @@ -0,0 +1,18 @@ +namespace VideoStore.Common +{ + using NServiceBus; + + class UnobtrusiveMessageConventions : IWantToRunBeforeConfiguration + { + public void Init() + { + Configure.Instance + .DefiningCommandsAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("Commands")) + .DefiningEventsAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("Events")) + .DefiningMessagesAs(t => t.Namespace != null && t.Namespace.StartsWith("VideoStore") && t.Namespace.EndsWith("RequestResponse")) + .DefiningEncryptedPropertiesAs(p => p.Name.StartsWith("Encrypted")); + } + } +} + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/VideoStore.ContentManagement.csproj b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/VideoStore.ContentManagement.csproj new file mode 100644 index 00000000000..d4fbca9d737 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/VideoStore.ContentManagement.csproj @@ -0,0 +1,101 @@ + + + + + + Debug + AnyCPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C} + Library + Properties + VideoStore.ContentManagement + VideoStore.ContentManagement + v4.0 + 512 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\..\..\binaries\NServiceBus.Transports.SqlServer.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + Designer + + + + + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/packages.config b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/packages.config new file mode 100644 index 00000000000..79ece06bef6 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ContentManagement/packages.config @@ -0,0 +1,3 @@ + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/App.config b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/App.config new file mode 100644 index 00000000000..05033489cf6 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/App.config @@ -0,0 +1,25 @@ + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/EndpointConfig.cs b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/EndpointConfig.cs new file mode 100644 index 00000000000..dad38cacec7 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/EndpointConfig.cs @@ -0,0 +1,20 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, UsingTransport { } + + public class MyClass : IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.CustomerRelations endpoint is now started and subscribed to events from VideoStore.Sales"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/OrderAcceptedHandler.cs b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/OrderAcceptedHandler.cs new file mode 100644 index 00000000000..af2394a62bd --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/OrderAcceptedHandler.cs @@ -0,0 +1,35 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using System.Diagnostics; + using Messages.Events; + using NServiceBus; + using VideoStore.Common; + + class OrderAcceptedHandler : IHandleMessages + { + public IBus Bus { get; set; } + public void Handle(OrderAccepted message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.WriteLine("Customer: {0} is now a preferred customer -- raising in-memory event, & publishing for other service concerns", message.ClientId); + // Call the domain object to do the raising of the event based on the relevant condition + Bus.InMemory.Raise(m => + { + m.ClientId = message.ClientId; + m.PreferredStatusExpiresOn = DateTime.Now.AddMonths(2); + }); + + // Yes, you can also publish this event as an asynchronous event + Bus.Publish(m => + { + m.ClientId = message.ClientId; + m.PreferredStatusExpiresOn = DateTime.Now.AddMonths(2); + }); + } + } +} diff --git a/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/Properties/AssemblyInfo.cs b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..2ee904c5711 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("VideoStore.CustomerRelations")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("VideoStore.CustomerRelations")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2dad9534-21c4-4fd6-b45e-243d1d1a3902")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/SendLimitedTimeOffer.cs b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/SendLimitedTimeOffer.cs new file mode 100644 index 00000000000..76894e2667c --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/SendLimitedTimeOffer.cs @@ -0,0 +1,20 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using System.Diagnostics; + using Messages.Events; + using NServiceBus; + using VideoStore.Common; + + class SendLimitedTimeOffer : IHandleMessages + { + public void Handle(ClientBecamePreferred message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + Console.WriteLine("Handler WhenCustomerIsPreferredSendLimitedTimeOffer invoked for CustomerId: {0}", message.ClientId); + } + } +} diff --git a/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/SendWelcomePacket.cs b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/SendWelcomePacket.cs new file mode 100644 index 00000000000..0981531626d --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/SendWelcomePacket.cs @@ -0,0 +1,26 @@ +namespace VideoStore.CustomerRelations +{ + using System; + using System.Diagnostics; + using Messages.Events; + using NServiceBus; + using VideoStore.Common; + + class SendWelcomePacket : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(ClientBecamePreferred message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + Console.WriteLine("Handler WhenCustomerIsPreferredSendWelcomeEmail invoked for CustomerId: {0}", message.ClientId); + + // Don't write code to do the smtp send here, instead do a Bus.Send. If this handler fails, then + // the message to send email will not be sent. + //Bus.Send(m => { m.ClientId = message.ClientId; }); + } + } +} diff --git a/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/VideoStore.CustomerRelations.csproj b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/VideoStore.CustomerRelations.csproj new file mode 100644 index 00000000000..c00df89c026 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/VideoStore.CustomerRelations.csproj @@ -0,0 +1,100 @@ + + + + + + Debug + AnyCPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC} + Library + Properties + VideoStore.CustomerRelations + VideoStore.CustomerRelations + v4.0 + 512 + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\..\..\binaries\NServiceBus.Transports.SqlServer.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + + + + + + + + + DebugFlagMutator.cs + + + UnobtrusiveMessageConventions.cs + + + + + + + + + + + + + + + + + + + {59f2ba7e-4da5-49f8-9dbc-520fa99f4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/packages.config b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/packages.config new file mode 100644 index 00000000000..79ece06bef6 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.CustomerRelations/packages.config @@ -0,0 +1,3 @@ + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/App_Start/FilterConfig.cs b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/App_Start/FilterConfig.cs new file mode 100644 index 00000000000..b8da915c6e2 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/App_Start/FilterConfig.cs @@ -0,0 +1,12 @@ +namespace VideoStore.ECommerce +{ + using System.Web.Mvc; + + public class FilterConfig + { + public static void RegisterGlobalFilters(GlobalFilterCollection filters) + { + filters.Add(new HandleErrorAttribute()); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/App_Start/RouteConfig.cs b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/App_Start/RouteConfig.cs new file mode 100644 index 00000000000..dde7707c577 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/App_Start/RouteConfig.cs @@ -0,0 +1,16 @@ +namespace VideoStore.ECommerce +{ + using System; + using System.Web.Mvc; + using System.Web.Routing; + + public class RouteConfig + { + public static void RegisterRoutes(RouteCollection routes) + { + routes.MapHubs(); + routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); + routes.MapRoute("Default", String.Empty, new { controller = "Home", action = "Index" }); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/css/bootstrap-responsive.min.css b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/css/bootstrap-responsive.min.css new file mode 100644 index 00000000000..5cb833ff082 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/css/bootstrap-responsive.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap Responsive v2.2.2 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */@-ms-viewport{width:device-width}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.564102564102564%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.7624309392265194%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom,.navbar-static-top{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.uneditable-input[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:100%;margin-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="offset"]:first-child{margin-left:0}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.controls-row [class*="span"]+[class*="span"]{margin-left:0}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade{top:-100px}.modal.fade.in{top:20px}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.media .pull-left,.media .pull-right{display:block;float:none;margin-bottom:10px}.media-object{margin-right:0;margin-left:0}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#777;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#777;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a,.navbar-inverse .nav-collapse .dropdown-menu a{color:#999}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:none;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .open>.dropdown-menu{display:block}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .nav>li>.dropdown-menu:before,.nav-collapse .nav>li>.dropdown-menu:after{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar-inverse .nav-collapse .navbar-form,.navbar-inverse .nav-collapse .navbar-search{border-top-color:#111;border-bottom-color:#111}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/css/bootstrap.min.css b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/css/bootstrap.min.css new file mode 100644 index 00000000000..140f731dfa8 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/css/bootstrap.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap v2.2.2 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img,.google-maps img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,html input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}label,select,button,input[type="button"],input[type="reset"],input[type="submit"],input[type="radio"],input[type="checkbox"]{cursor:pointer}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}.ir a:after,a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}@page{margin:.5cm}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .controls-row [class*="span"]+[class*="span"]{margin-left:2.127659574468085%}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;line-height:0;content:""}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;line-height:0;content:""}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:21px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}a.muted:hover{color:#808080}.text-warning{color:#c09853}a.text-warning:hover{color:#a47e3c}.text-error{color:#b94a48}a.text-error:hover{color:#953b39}.text-info{color:#3a87ad}a.text-info:hover{color:#2d6987}.text-success{color:#468847}a.text-success:hover{color:#356635}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:20px;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1,h2,h3{line-height:40px}h1{font-size:38.5px}h2{font-size:31.5px}h3{font-size:24.5px}h4{font-size:17.5px}h5{font-size:14px}h6{font-size:11.9px}h1 small{font-size:24.5px}h2 small{font-size:17.5px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}ul.inline,ol.inline{margin-left:0;list-style:none}ul.inline>li,ol.inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal{*zoom:1}.dl-horizontal:before,.dl-horizontal:after{display:table;line-height:0;content:""}.dl-horizontal:after{clear:both}.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;white-space:nowrap;background-color:#f7f7f9;border:1px solid #e1e1e8}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;white-space:pre;white-space:pre-wrap;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:10px;font-size:14px;line-height:20px;color:#555;vertical-align:middle;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}input,textarea,.uneditable-input{width:206px}textarea{height:auto}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;background-color:#fff;border:1px solid #ccc}select[multiple],select[size]{height:auto}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:20px;padding-left:20px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-20px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"],.row-fluid .controls-row [class*="span"]{float:left}.controls-row .checkbox[class*="span"],.controls-row .radio[class*="span"]{padding-top:5px}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning .control-label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853}.control-group.warning input,.control-group.warning select,.control-group.warning textarea{border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error .control-label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48}.control-group.error input,.control-group.error select,.control-group.error textarea{border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success .control-label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847}.control-group.success input,.control-group.success select,.control-group.success textarea{border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}.control-group.info .control-label,.control-group.info .help-block,.control-group.info .help-inline{color:#3a87ad}.control-group.info .checkbox,.control-group.info .radio,.control-group.info input,.control-group.info select,.control-group.info textarea{color:#3a87ad}.control-group.info input,.control-group.info select,.control-group.info textarea{border-color:#3a87ad;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.info input:focus,.control-group.info select:focus,.control-group.info textarea:focus{border-color:#2d6987;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7ab5d3}.control-group.info .input-prepend .add-on,.control-group.info .input-append .add-on{color:#3a87ad;background-color:#d9edf7;border-color:#3a87ad}input:focus:invalid,textarea:focus:invalid,select:focus:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:invalid:focus,textarea:focus:invalid:focus,select:focus:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input,.input-append .dropdown-menu,.input-prepend .dropdown-menu{font-size:14px}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;vertical-align:top;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn,.input-append .btn-group>.dropdown-toggle,.input-prepend .btn-group>.dropdown-toggle{vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-append input+.btn-group .btn:last-child,.input-append select+.btn-group .btn:last-child,.input-append .uneditable-input+.btn-group .btn:last-child{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-append .add-on,.input-append .btn,.input-append .btn-group{margin-left:-1px}.input-append .add-on:last-child,.input-append .btn:last-child,.input-append .btn-group:last-child>.dropdown-toggle{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append input+.btn-group .btn,.input-prepend.input-append select+.btn-group .btn,.input-prepend.input-append .uneditable-input+.btn-group .btn{-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.input-prepend.input-append .btn-group:first-child{margin-left:0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:160px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:180px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:180px}.form-horizontal .help-block{margin-bottom:0}.form-horizontal input+.help-block,.form-horizontal select+.help-block,.form-horizontal textarea+.help-block,.form-horizontal .uneditable-input+.help-block,.form-horizontal .input-prepend+.help-block,.form-horizontal .input-append+.help-block{margin-top:10px}.form-horizontal .form-actions{padding-left:180px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child>th:first-child,.table-bordered tbody:first-child tr:first-child>td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child>th:last-child,.table-bordered tbody:first-child tr:first-child>td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child>th:first-child,.table-bordered tbody:last-child tr:last-child>td:first-child,.table-bordered tfoot:last-child tr:last-child>td:first-child{-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child>th:last-child,.table-bordered tbody:last-child tr:last-child>td:last-child,.table-bordered tfoot:last-child tr:last-child>td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered tfoot+tbody:last-child tr:last-child td:first-child{-webkit-border-bottom-left-radius:0;border-bottom-left-radius:0;-moz-border-radius-bottomleft:0}.table-bordered tfoot+tbody:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:0;border-bottom-right-radius:0;-moz-border-radius-bottomright:0}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-striped tbody>tr:nth-child(odd)>td,.table-striped tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5}table td[class*="span"],table th[class*="span"],.row-fluid table td[class*="span"],.row-fluid table th[class*="span"]{display:table-cell;float:none;margin-left:0}.table td.span1,.table th.span1{float:none;width:44px;margin-left:0}.table td.span2,.table th.span2{float:none;width:124px;margin-left:0}.table td.span3,.table th.span3{float:none;width:204px;margin-left:0}.table td.span4,.table th.span4{float:none;width:284px;margin-left:0}.table td.span5,.table th.span5{float:none;width:364px;margin-left:0}.table td.span6,.table th.span6{float:none;width:444px;margin-left:0}.table td.span7,.table th.span7{float:none;width:524px;margin-left:0}.table td.span8,.table th.span8{float:none;width:604px;margin-left:0}.table td.span9,.table th.span9{float:none;width:684px;margin-left:0}.table td.span10,.table th.span10{float:none;width:764px;margin-left:0}.table td.span11,.table th.span11{float:none;width:844px;margin-left:0}.table td.span12,.table th.span12{float:none;width:924px;margin-left:0}.table tbody tr.success td{background-color:#dff0d8}.table tbody tr.error td{background-color:#f2dede}.table tbody tr.warning td{background-color:#fcf8e3}.table tbody tr.info td{background-color:#d9edf7}.table-hover tbody tr.success:hover td{background-color:#d0e9c6}.table-hover tbody tr.error:hover td{background-color:#ebcccc}.table-hover tbody tr.warning:hover td{background-color:#faf2cc}.table-hover tbody tr.info:hover td{background-color:#c4e3f3}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.icon-white,.nav-pills>.active>a>[class^="icon-"],.nav-pills>.active>a>[class*=" icon-"],.nav-list>.active>a>[class^="icon-"],.nav-list>.active>a>[class*=" icon-"],.navbar-inverse .nav>.active>a>[class^="icon-"],.navbar-inverse .nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"],.dropdown-submenu:hover>a>[class^="icon-"],.dropdown-submenu:hover>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu li>a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#fff;text-decoration:none;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;outline:0;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0)}.dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999}.dropdown-menu .disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open{*z-index:1000}.open>.dropdown-menu{display:block}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:""}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover>.dropdown-menu{display:block}.dropup .dropdown-submenu>.dropdown-menu{top:auto;bottom:0;margin-top:0;margin-bottom:-2px;-webkit-border-radius:5px 5px 5px 0;-moz-border-radius:5px 5px 5px 0;border-radius:5px 5px 5px 0}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown-submenu.pull-left{float:none}.dropdown-submenu.pull-left>.dropdown-menu{left:-100%;margin-left:10px;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{z-index:1051;margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 12px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #bbb;*border:0;border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover{color:#333;text-decoration:none;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:11px 19px;font-size:17.5px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.btn-large [class^="icon-"],.btn-large [class*=" icon-"]{margin-top:4px}.btn-small{padding:2px 10px;font-size:11.9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-small [class^="icon-"],.btn-small [class*=" icon-"]{margin-top:0}.btn-mini [class^="icon-"],.btn-mini [class*=" icon-"]{margin-top:-1px}.btn-mini{padding:0 6px;font-size:10.5px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn{border-color:#c5c5c5;border-color:rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-moz-linear-gradient(top,#62c462,#51a351);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-moz-linear-gradient(top,#444,#222);background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active,.btn-link[disabled]{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover{color:#005580;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover{color:#333;text-decoration:none}.btn-group{position:relative;display:inline-block;*display:inline;*margin-left:.3em;font-size:0;white-space:nowrap;vertical-align:middle;*zoom:1}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar>.btn+.btn,.btn-toolbar>.btn-group+.btn,.btn-toolbar>.btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu,.btn-group>.popover{font-size:14px}.btn-group>.btn-mini{font-size:10.5px}.btn-group>.btn-small{font-size:11.9px}.btn-group>.btn-large{font-size:17.5px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5px;border-right-width:5px;border-left-width:5px}.dropup .btn-large .caret{border-bottom-width:5px}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical>.btn{display:block;float:none;max-width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical>.btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical>.btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical>.btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical>.btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert,.alert h4{color:#c09853}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-success h4{color:#468847}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-danger h4,.alert-error h4{color:#b94a48}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-info h4{color:#3a87ad}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>li>a>img{max-width:none}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"],.nav-list [class*=" icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;content:""}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#fff;background-color:#08c}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover{z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;content:""}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover{border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#f2f2f2);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#f2f2f2));background-image:-webkit-linear-gradient(top,#fff,#f2f2f2);background-image:-o-linear-gradient(top,#fff,#f2f2f2);background-image:linear-gradient(to bottom,#fff,#f2f2f2);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fff2f2f2',GradientType=0);*zoom:1;-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar-inner:before,.navbar-inner:after{display:table;line-height:0;content:""}.navbar-inner:after{clear:both}.navbar .container{width:auto}.nav-collapse.collapse{height:auto;overflow:visible}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#777;text-shadow:0 1px 0 #fff}.navbar .brand:hover{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px;color:#777}.navbar-link{color:#777}.navbar-link:hover{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:5px}.navbar .btn-group .btn,.navbar .input-prepend .btn,.navbar .input-append .btn{margin-top:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;content:""}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:5px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{border-width:0 0 1px}.navbar-fixed-bottom .navbar-inner{border-width:1px 0 0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 10px rgba(0,0,0,0.1);box-shadow:0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:0 -1px 10px rgba(0,0,0,0.1);box-shadow:0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right;margin-right:0}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#777;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown>a:hover .caret{border-top-color:#555;border-bottom-color:#555}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#777;border-bottom-color:#777}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#fff}.navbar-inverse .brand{color:#999}.navbar-inverse .navbar-text{color:#999}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>a:hover .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-moz-linear-gradient(top,#151515,#040404);background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb>li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb>li>.divider{padding:0 5px;color:#ccc}.breadcrumb>.active{color:#999}.pagination{margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination ul>li{display:inline}.pagination ul>li>a,.pagination ul>li>span{float:left;padding:4px 12px;line-height:20px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination ul>li>a:hover,.pagination ul>.active>a,.pagination ul>.active>span{background-color:#f5f5f5}.pagination ul>.active>a,.pagination ul>.active>span{color:#999;cursor:default}.pagination ul>.disabled>span,.pagination ul>.disabled>a,.pagination ul>.disabled>a:hover{color:#999;cursor:default;background-color:transparent}.pagination ul>li:first-child>a,.pagination ul>li:first-child>span{border-left-width:1px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.pagination ul>li:last-child>a,.pagination ul>li:last-child>span{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pagination-large ul>li>a,.pagination-large ul>li>span{padding:11px 19px;font-size:17.5px}.pagination-large ul>li:first-child>a,.pagination-large ul>li:first-child>span{-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.pagination-large ul>li:last-child>a,.pagination-large ul>li:last-child>span{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.pagination-mini ul>li:first-child>a,.pagination-small ul>li:first-child>a,.pagination-mini ul>li:first-child>span,.pagination-small ul>li:first-child>span{-webkit-border-bottom-left-radius:3px;border-bottom-left-radius:3px;-webkit-border-top-left-radius:3px;border-top-left-radius:3px;-moz-border-radius-bottomleft:3px;-moz-border-radius-topleft:3px}.pagination-mini ul>li:last-child>a,.pagination-small ul>li:last-child>a,.pagination-mini ul>li:last-child>span,.pagination-small ul>li:last-child>span{-webkit-border-top-right-radius:3px;border-top-right-radius:3px;-webkit-border-bottom-right-radius:3px;border-bottom-right-radius:3px;-moz-border-radius-topright:3px;-moz-border-radius-bottomright:3px}.pagination-small ul>li>a,.pagination-small ul>li>span{padding:2px 10px;font-size:11.9px}.pagination-mini ul>li>a,.pagination-mini ul>li>span{padding:0 6px;font-size:10.5px}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager li>a:hover{text-decoration:none;background-color:#f5f5f5}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>span{color:#999;cursor:default;background-color:#fff}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:10%;left:50%;z-index:1050;width:560px;margin-left:-280px;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;outline:0;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3s ease-out}.modal.fade.in{top:10%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{position:relative;max-height:400px;padding:15px;overflow-y:auto}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.tooltip{position:absolute;z-index:1030;display:block;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{margin-top:-3px}.tooltip.right{margin-left:3px}.tooltip.bottom{margin-top:3px}.tooltip.left{margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;text-align:left;white-space:normal;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover .arrow,.popover .arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow{border-width:11px}.popover .arrow:after{border-width:10px;content:""}.popover.top .arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,0.25);border-bottom-width:0}.popover.top .arrow:after{bottom:1px;margin-left:-10px;border-top-color:#fff;border-bottom-width:0}.popover.right .arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,0.25);border-left-width:0}.popover.right .arrow:after{bottom:-10px;left:1px;border-right-color:#fff;border-left-width:0}.popover.bottom .arrow{top:-11px;left:50%;margin-left:-11px;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,0.25);border-top-width:0}.popover.bottom .arrow:after{top:1px;margin-left:-10px;border-bottom-color:#fff;border-top-width:0}.popover.left .arrow{top:50%;right:-11px;margin-top:-11px;border-left-color:#999;border-left-color:rgba(0,0,0,0.25);border-right-width:0}.popover.left .arrow:after{right:1px;bottom:-10px;border-left-color:#fff;border-right-width:0}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover{border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.media,.media-body{overflow:hidden;*overflow:visible;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media .pull-left{margin-right:10px}.media .pull-right{margin-left:10px}.media-list{margin-left:0;list-style:none}.label,.badge{display:inline-block;padding:2px 4px;font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding-right:9px;padding-left:9px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}.label:empty,.badge:empty{display:none}a.label:hover,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.accordion{margin-bottom:20px}.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading{border-bottom:0}.accordion-heading .accordion-toggle{display:block;padding:8px 15px}.accordion-toggle{cursor:pointer}.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5}.carousel{position:relative;margin-bottom:20px;line-height:1}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img{display:block;line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{right:15px;left:auto}.carousel-control:hover{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-caption{position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{line-height:20px;color:#fff}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;font-size:18px;font-weight:200;line-height:30px;color:inherit;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit li{line-height:30px}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed} diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/img/glyphicons-halflings-white.png b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/img/glyphicons-halflings-white.png new file mode 100644 index 00000000000..3bf6484a29d Binary files /dev/null and b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/img/glyphicons-halflings-white.png differ diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/img/glyphicons-halflings.png b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/img/glyphicons-halflings.png new file mode 100644 index 00000000000..a9969993201 Binary files /dev/null and b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/img/glyphicons-halflings.png differ diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/js/angular.min.js b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/js/angular.min.js new file mode 100644 index 00000000000..569325cf173 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/js/angular.min.js @@ -0,0 +1,160 @@ +/* + AngularJS v1.0.4 + (c) 2010-2012 Google, Inc. http://angularjs.org + License: MIT +*/ +(function(T,Y,p){'use strict';function m(b,a,c){var d;if(b)if(L(b))for(d in b)d!="prototype"&&d!="length"&&d!="name"&&b.hasOwnProperty(d)&&a.call(c,b[d],d);else if(b.forEach&&b.forEach!==m)b.forEach(a,c);else if(M(b)&&va(b.length))for(d=0;d=0&&b.splice(c,1);return a}function U(b,a){if(oa(b)||b&&b.$evalAsync&&b.$watch)throw u("Can't copy Window or Scope");if(a){if(b===a)throw u("Can't copy equivalent objects or arrays");if(I(b)){for(;a.length;)a.pop();for(var c=0;c2?ia.call(arguments,2):[];return L(a)&&!(a instanceof RegExp)?c.length?function(){return arguments.length?a.apply(b,c.concat(ia.call(arguments,0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b, +arguments):a.call(b)}:a}function ic(b,a){var c=a;/^\$+/.test(b)?c=p:oa(a)?c="$WINDOW":a&&Y===a?c="$DOCUMENT":a&&a.$evalAsync&&a.$watch&&(c="$SCOPE");return c}function da(b,a){return JSON.stringify(b,ic,a?" ":null)}function ob(b){return E(b)?JSON.parse(b):b}function Wa(b){b&&b.length!==0?(b=D(""+b),b=!(b=="f"||b=="0"||b=="false"||b=="no"||b=="n"||b=="[]")):b=!1;return b}function pa(b){b=z(b).clone();try{b.html("")}catch(a){}return z("
    ").append(b).html().match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/, +function(a,b){return"<"+D(b)})}function Xa(b){var a={},c,d;m((b||"").split("&"),function(b){b&&(c=b.split("="),d=decodeURIComponent(c[0]),a[d]=v(c[1])?decodeURIComponent(c[1]):!0)});return a}function pb(b){var a=[];m(b,function(b,d){a.push(Ya(d,!0)+(b===!0?"":"="+Ya(b,!0)))});return a.length?a.join("&"):""}function Za(b){return Ya(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Ya(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g, +"$").replace(/%2C/gi,",").replace(a?null:/%20/g,"+")}function jc(b,a){function c(a){a&&d.push(a)}var d=[b],e,g,i=["ng:app","ng-app","x-ng-app","data-ng-app"],f=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;m(i,function(a){i[a]=!0;c(Y.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(m(b.querySelectorAll("."+a),c),m(b.querySelectorAll("."+a+"\\:"),c),m(b.querySelectorAll("["+a+"]"),c))});m(d,function(a){if(!e){var b=f.exec(" "+a.className+" ");b?(e=a,g=(b[2]||"").replace(/\s+/g,",")):m(a.attributes, +function(b){if(!e&&i[b.name])e=a,g=b.value})}});e&&a(e,g?[g]:[])}function qb(b,a){b=z(b);a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");var c=rb(a);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,i){a.$apply(function(){b.data("$injector",i);c(b)(a)})}]);return c}function $a(b,a){a=a||"_";return b.replace(kc,function(b,d){return(d?a:"")+b.toLowerCase()})}function ab(b,a,c){if(!b)throw new u("Argument '"+(a||"?")+"' is "+(c||"required")); +return b}function qa(b,a,c){c&&I(b)&&(b=b[b.length-1]);ab(L(b),a,"not a function, got "+(b&&typeof b=="object"?b.constructor.name||"Object":typeof b));return b}function lc(b){function a(a,b,e){return a[b]||(a[b]=e())}return a(a(b,"angular",Object),"module",function(){var b={};return function(d,e,g){e&&b.hasOwnProperty(d)&&(b[d]=null);return a(b,d,function(){function a(c,d,e){return function(){b[e||"push"]([c,d,arguments]);return k}}if(!e)throw u("No module: "+d);var b=[],c=[],j=a("$injector","invoke"), +k={_invokeQueue:b,_runBlocks:c,requires:e,name:d,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:j,run:function(a){c.push(a);return this}};g&&j(g);return k})}})}function sb(b){return b.replace(mc,function(a,b,d,e){return e?d.toUpperCase():d}).replace(nc, +"Moz$1")}function bb(b,a){function c(){var e;for(var b=[this],c=a,i,f,h,j,k,l;b.length;){i=b.shift();f=0;for(h=i.length;f-1}function wb(b,a){a&&m(a.split(" "),function(a){b.className=Q((" "+b.className+" ").replace(/[\n\t]/g," ").replace(" "+Q(a)+" "," "))})}function xb(b,a){a&&m(a.split(" "), +function(a){if(!Ba(b,a))b.className=Q(b.className+" "+Q(a))})}function cb(b,a){if(a)for(var a=!a.nodeName&&v(a.length)&&!oa(a)?a:[a],c=0;c4096&&c.warn("Cookie '"+a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!")}else{if(h.cookie!==P){P=h.cookie;d=P.split("; ");ba={};for(f=0;f0&&(ba[unescape(e.substring(0,j))]=unescape(e.substring(j+1)))}return ba}};f.defer=function(a,b){var c;n++;c=l(function(){delete r[c]; +e(a)},b||0);r[c]=!0;return c};f.defer.cancel=function(a){return r[a]?(delete r[a],o(a),e(C),!0):!1}}function wc(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new vc(b,d,a,c)}]}function xc(){this.$get=function(){function b(b,d){function e(a){if(a!=l){if(o){if(o==a)o=a.n}else o=a;g(a.n,a.p);g(a,l);l=a;l.n=null}}function g(a,b){if(a!=b){if(a)a.p=b;if(b)b.n=a}}if(b in a)throw u("cacheId "+b+" taken");var i=0,f=y({},d,{id:b}),h={},j=d&&d.capacity||Number.MAX_VALUE,k={}, +l=null,o=null;return a[b]={put:function(a,b){var c=k[a]||(k[a]={key:a});e(c);t(b)||(a in h||i++,h[a]=b,i>j&&this.remove(o.key))},get:function(a){var b=k[a];if(b)return e(b),h[a]},remove:function(a){var b=k[a];if(b){if(b==l)l=b.p;if(b==o)o=b.n;g(b.n,b.p);delete k[a];delete h[a];i--}},removeAll:function(){h={};i=0;k={};l=o=null},destroy:function(){k=f=h=null;delete a[b]},info:function(){return y({},f,{size:i})}}}var a={};b.info=function(){var b={};m(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]}; +return b}}function yc(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Cb(b){var a={},c="Directive",d=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/,e=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,g="Template must have exactly one root element. was: ";this.directive=function f(d,e){E(d)?(ab(e,"directive"),a.hasOwnProperty(d)||(a[d]=[],b.factory(d+c,["$injector","$exceptionHandler",function(b,c){var e=[];m(a[d],function(a){try{var f=b.invoke(a);if(L(f))f={compile:H(f)};else if(!f.compile&&f.link)f.compile= +H(f.link);f.priority=f.priority||0;f.name=f.name||d;f.require=f.require||f.controller&&f.name;f.restrict=f.restrict||"A";e.push(f)}catch(j){c(j)}});return e}])),a[d].push(e)):m(d,nb(f));return this};this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope",function(b,h,j,k,l,o,r,n){function w(a,b,c){a instanceof z||(a=z(a));m(a,function(b,c){b.nodeType==3&&b.nodeValue.match(/\S+/)&&(a[c]=z(b).wrap("").parent()[0])});var d=x(a, +b,a,c);return function(b,c){ab(b,"scope");var e=c?ta.clone.call(a):a;e.data("$scope",b);q(e,"ng-scope");c&&c(e,b);d&&d(b,e,e);return e}}function q(a,b){try{a.addClass(b)}catch(c){}}function x(a,b,c,d){function e(a,c,d,j){var g,h,k,n,o,l,r,q=[];o=0;for(l=c.length;oB.priority)break;if(W=B.scope)K("isolated scope",A,B,s),M(W)&&(q(s,"ng-isolate-scope"),A=B),q(s,"ng-scope"),x=x||B;G= +B.name;if(W=B.controller)t=t||{},K("'"+G+"' controller",t[G],B,s),t[G]=B;if(W=B.transclude)K("transclusion",C,B,s),C=B,n=B.priority,W=="element"?(V=z(b),s=c.$$element=z(Y.createComment(" "+G+": "+c[G]+" ")),b=s[0],Fa(e,z(V[0]),b),v=w(V,d,n)):(V=z(db(b)).contents(),s.html(""),v=w(V,d));if(W=B.template)if(K("template",P,B,s),P=B,W=Ha(W),B.replace){V=z("
    "+Q(W)+"
    ").contents();b=V[0];if(V.length!=1||b.nodeType!==1)throw new u(g+W);Fa(e,s,b);G={$attr:{}};a=a.concat(X(b,a.splice(D+1,a.length- +(D+1)),G));J(c,G);F=a.length}else s.html(W);if(B.templateUrl)K("template",P,B,s),P=B,k=ba(a.splice(D,a.length-D),k,s,c,e,B.replace,v),F=a.length;else if(B.compile)try{y=B.compile(s,c,v),L(y)?f(null,y):y&&f(y.pre,y.post)}catch(H){j(H,pa(s))}if(B.terminal)k.terminal=!0,n=Math.max(n,B.priority)}k.scope=x&&x.scope;k.transclude=C&&v;return k}function s(d,e,g,h){var k=!1;if(a.hasOwnProperty(e))for(var n,e=b.get(e+c),o=0,l=e.length;on.priority)&&n.restrict.indexOf(g)!=-1)d.push(n), +k=!0}catch(r){j(r)}return k}function J(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;m(a,function(d,e){e.charAt(0)!="$"&&(b[e]&&(d+=(e==="style"?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});m(b,function(b,f){f=="class"?(q(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):f=="style"?e.attr("style",e.attr("style")+";"+b):f.charAt(0)!="$"&&!a.hasOwnProperty(f)&&(a[f]=b,d[f]=c[f])})}function ba(a,b,c,d,e,f,j){var h=[],n,o,r=c[0],q=a.shift(),w=y({},q,{controller:null,templateUrl:null,transclude:null,scope:null}); +c.html("");k.get(q.templateUrl,{cache:l}).success(function(k){var l,q,k=Ha(k);if(f){q=z("
    "+Q(k)+"
    ").contents();l=q[0];if(q.length!=1||l.nodeType!==1)throw new u(g+k);k={$attr:{}};Fa(e,c,l);X(l,a,k);J(d,k)}else l=r,c.html(k);a.unshift(w);n=A(a,c,d,j);for(o=x(c.contents(),j);h.length;){var ca=h.pop(),k=h.pop();q=h.pop();var s=h.pop(),m=l;q!==r&&(m=db(l),Fa(k,z(q),m));n(function(){b(o,s,m,e,ca)},s,m,e,ca)}h=null}).error(function(a,b,c,d){throw u("Failed to load template: "+d.url);});return function(a, +c,d,e,f){h?(h.push(c),h.push(d),h.push(e),h.push(f)):n(function(){b(o,c,d,e,f)},c,d,e,f)}}function P(a,b){return b.priority-a.priority}function K(a,b,c,d){if(b)throw u("Multiple directives ["+b.name+", "+c.name+"] asking for "+a+" on: "+pa(d));}function G(a,b){var c=h(b,!0);c&&a.push({priority:0,compile:H(function(a,b){var d=b.parent(),e=d.data("$binding")||[];e.push(c);q(d.data("$binding",e),"ng-binding");a.$watch(c,function(a){b[0].nodeValue=a})})})}function V(a,b,c,d){var e=h(c,!0);e&&b.push({priority:100, +compile:H(function(a,b,c){b=c.$$observers||(c.$$observers={});d==="class"&&(e=h(c[d],!0));c[d]=p;(b[d]||(b[d]=[])).$$inter=!0;(c.$$observers&&c.$$observers[d].$$scope||a).$watch(e,function(a){c.$set(d,a)})})})}function Fa(a,b,c){var d=b[0],e=d.parentNode,f,g;if(a){f=0;for(g=a.length;f0){var e=K[0],f=e.text;if(f==a||f==b||f==c||f==d||!a&&!b&&!c&&!d)return e}return!1}function f(b,c, +d,f){return(b=i(b,c,d,f))?(a&&!b.json&&e("is not valid json",b),K.shift(),b):!1}function h(a){f(a)||e("is unexpected, expecting ["+a+"]",i())}function j(a,b){return function(c,d){return a(c,d,b)}}function k(a,b,c){return function(d,e){return b(d,e,a,c)}}function l(){for(var a=[];;)if(K.length>0&&!i("}",")",";","]")&&a.push(v()),!f(";"))return a.length==1?a[0]:function(b,c){for(var d,e=0;e","<=",">="))a=k(a,b.fn,q());return a}function x(){for(var a=m(),b;b=f("*","/","%");)a=k(a, +b.fn,m());return a}function m(){var a;return f("+")?A():(a=f("-"))?k(ba,a.fn,m()):(a=f("!"))?j(a.fn,m()):A()}function A(){var a;if(f("("))a=v(),h(")");else if(f("["))a=s();else if(f("{"))a=J();else{var b=f();(a=b.fn)||e("not a primary expression",b)}for(var c;b=f("(","[",".");)b.text==="("?(a=z(a,c),c=null):b.text==="["?(c=a,a=ea(a)):b.text==="."?(c=a,a=t(a)):e("IMPOSSIBLE");return a}function s(){var a=[];if(g().text!="]"){do a.push(G());while(f(","))}h("]");return function(b,c){for(var d=[],e=0;e< +a.length;e++)d.push(a[e](b,c));return d}}function J(){var a=[];if(g().text!="}"){do{var b=f(),b=b.string||b.text;h(":");var c=G();a.push({key:b,value:c})}while(f(","))}h("}");return function(b,c){for(var d={},e=0;e1;d++){var e=a.shift(),g=b[e];g||(g={},b[e]=g);b=g}return b[a.shift()]=c}function gb(b,a,c){if(!a)return b;for(var a=a.split("."),d,e=b,g=a.length,i=0;i7),hasEvent:function(c){if(c=="input"&&aa==9)return!1;if(t(a[c])){var e=b.document.createElement("div");a[c]="on"+c in e}return a[c]},csp:!1}}]}function Tc(){this.$get=H(T)}function Nb(b){var a={},c,d,e;if(!b)return a;m(b.split("\n"),function(b){e=b.indexOf(":");c=D(Q(b.substr(0,e)));d=Q(b.substr(e+1));c&&(a[c]?a[c]+=", "+d:a[c]=d)});return a}function Ob(b){var a=M(b)?b:p;return function(c){a||(a=Nb(b));return c? +a[D(c)]||null:a}}function Pb(b,a,c){if(L(c))return c(b,a);m(c,function(c){b=c(b,a)});return b}function Uc(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*$/,c=/^\)\]\}',?\n/,d=this.defaults={transformResponse:[function(d){E(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=ob(d,!0)));return d}],transformRequest:[function(a){return M(a)&&Sa.apply(a)!=="[object File]"?da(a):a}],headers:{common:{Accept:"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest"},post:{"Content-Type":"application/json;charset=utf-8"}, +put:{"Content-Type":"application/json;charset=utf-8"}}},e=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope","$q","$injector",function(a,b,c,h,j,k){function l(a){function c(a){var b=y({},a,{data:Pb(a.data,a.headers,f)});return 200<=a.status&&a.status<300?b:j.reject(b)}a.method=la(a.method);var e=a.transformRequest||d.transformRequest,f=a.transformResponse||d.transformResponse,h=d.headers,h=y({"X-XSRF-TOKEN":b.cookies()["XSRF-TOKEN"]},h.common,h[D(a.method)], +a.headers),e=Pb(a.data,Ob(h),e),g;t(a.data)&&delete h["Content-Type"];g=o(a,e,h);g=g.then(c,c);m(w,function(a){g=a(g)});g.success=function(b){g.then(function(c){b(c.data,c.status,c.headers,a)});return g};g.error=function(b){g.then(null,function(c){b(c.data,c.status,c.headers,a)});return g};return g}function o(b,c,d){function e(a,b,c){m&&(200<=a&&a<300?m.put(w,[a,b,Nb(c)]):m.remove(w));f(b,a,c);h.$apply()}function f(a,c,d){c=Math.max(c,0);(200<=c&&c<300?k.resolve:k.reject)({data:a,status:c,headers:Ob(d), +config:b})}function i(){var a=ya(l.pendingRequests,b);a!==-1&&l.pendingRequests.splice(a,1)}var k=j.defer(),o=k.promise,m,p,w=r(b.url,b.params);l.pendingRequests.push(b);o.then(i,i);b.cache&&b.method=="GET"&&(m=M(b.cache)?b.cache:n);if(m)if(p=m.get(w))if(p.then)return p.then(i,i),p;else I(p)?f(p[1],p[0],U(p[2])):f(p,200,{});else m.put(w,o);p||a(b.method,w,c,e,d,b.timeout,b.withCredentials);return o}function r(a,b){if(!b)return a;var c=[];fc(b,function(a,b){a==null||a==p||(M(a)&&(a=da(a)),c.push(encodeURIComponent(b)+ +"="+encodeURIComponent(a)))});return a+(a.indexOf("?")==-1?"?":"&")+c.join("&")}var n=c("$http"),w=[];m(e,function(a){w.push(E(a)?k.get(a):k.invoke(a))});l.pendingRequests=[];(function(a){m(arguments,function(a){l[a]=function(b,c){return l(y(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){m(arguments,function(a){l[a]=function(b,c,d){return l(y(d||{},{method:a,url:b,data:c}))}})})("post","put");l.defaults=d;return l}]}function Vc(){this.$get=["$browser","$window","$document", +function(b,a,c){return Wc(b,Xc,b.defer,a.angular.callbacks,c[0],a.location.protocol.replace(":",""))}]}function Wc(b,a,c,d,e,g){function i(a,b){var c=e.createElement("script"),d=function(){e.body.removeChild(c);b&&b()};c.type="text/javascript";c.src=a;aa?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror=d;e.body.appendChild(c)}return function(e,h,j,k,l,o,r){function n(a,c,d,e){c=(h.match(Gb)||["",g])[1]=="file"?d?200:404:c;a(c==1223?204:c,d,e);b.$$completeOutstandingRequest(C)} +b.$$incOutstandingRequestCount();h=h||b.url();if(D(e)=="jsonp"){var p="_"+(d.counter++).toString(36);d[p]=function(a){d[p].data=a};i(h.replace("JSON_CALLBACK","angular.callbacks."+p),function(){d[p].data?n(k,200,d[p].data):n(k,-2);delete d[p]})}else{var q=new a;q.open(e,h,!0);m(l,function(a,b){a&&q.setRequestHeader(b,a)});var x;q.onreadystatechange=function(){q.readyState==4&&n(k,x||q.status,q.responseText,q.getAllResponseHeaders())};if(r)q.withCredentials=!0;q.send(j||"");o>0&&c(function(){x=-1; +q.abort()},o)}}}function Yc(){this.$get=function(){return{id:"en-us",NUMBER_FORMATS:{DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:"",posSuf:"",negPre:"-",negSuf:"",gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","),SHORTMONTH:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec".split(","), +DAY:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),SHORTDAY:"Sun,Mon,Tue,Wed,Thu,Fri,Sat".split(","),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a"},pluralCat:function(b){return b===1?"one":"other"}}}}function Zc(){this.$get=["$rootScope","$browser","$q","$exceptionHandler",function(b,a,c,d){function e(e,f,h){var j=c.defer(), +k=j.promise,l=v(h)&&!h,f=a.defer(function(){try{j.resolve(e())}catch(a){j.reject(a),d(a)}l||b.$apply()},f),h=function(){delete g[k.$$timeoutId]};k.$$timeoutId=f;g[f]=j;k.then(h,h);return k}var g={};e.cancel=function(b){return b&&b.$$timeoutId in g?(g[b.$$timeoutId].reject("canceled"),a.defer.cancel(b.$$timeoutId)):!1};return e}]}function Qb(b){function a(a,e){return b.factory(a+c,e)}var c="Filter";this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+c)}}];a("currency", +Rb);a("date",Sb);a("filter",$c);a("json",ad);a("limitTo",bd);a("lowercase",cd);a("number",Tb);a("orderBy",Ub);a("uppercase",dd)}function $c(){return function(b,a){if(!(b instanceof Array))return b;var c=[];c.check=function(a){for(var b=0;b-1;case "object":for(var c in a)if(c.charAt(0)!=="$"&& +d(a[c],b))return!0;return!1;case "array":for(c=0;ce+1?i="0":(f=i,j=!0)}if(!j){i= +(i.split(Wb)[1]||"").length;t(e)&&(e=Math.min(Math.max(a.minFrac,i),a.maxFrac));var i=Math.pow(10,e),b=Math.round(b*i)/i,b=(""+b).split(Wb),i=b[0],b=b[1]||"",j=0,k=a.lgSize,l=a.gSize;if(i.length>=k+l)for(var j=i.length-k,o=0;o0||e>-c)e+=c;e===0&&c==-12&&(e=12);return jb(e,a,d)}}function La(b,a){return function(c,d){var e=c["get"+b](),g=la(a?"SHORT"+b:b);return d[g][e]}}function Sb(b){function a(a){var b;if(b=a.match(c)){var a=new Date(0),g=0,i=0;b[9]&&(g=F(b[9]+b[10]),i=F(b[9]+b[11]));a.setUTCFullYear(F(b[1]),F(b[2])-1,F(b[3]));a.setUTCHours(F(b[4]||0)-g,F(b[5]||0)-i,F(b[6]|| +0),F(b[7]||0))}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var g="",i=[],f,h,e=e||"mediumDate",e=b.DATETIME_FORMATS[e]||e;E(c)&&(c=ed.test(c)?F(c):a(c));va(c)&&(c=new Date(c));if(!na(c))return c;for(;e;)(h=fd.exec(e))?(i=i.concat(ia.call(h,1)),e=i.pop()):(i.push(e),e=null);m(i,function(a){f=gd[a];g+=f?f(c,b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function ad(){return function(b){return da(b, +!0)}}function bd(){return function(b,a){if(!(b instanceof Array))return b;var a=F(a),c=[],d,e;if(!b||!(b instanceof Array))return c;a>b.length?a=b.length:a<-b.length&&(a=-b.length);a>0?(d=0,e=a):(d=b.length+a,e=b.length);for(;dl?(d.$setValidity("maxlength",!1),p):(d.$setValidity("maxlength",!0),a)};d.$parsers.push(c);d.$formatters.push(c)}}function kb(b,a){b="ngClass"+b;return R(function(c,d,e){function g(b, +d){if(a===!0||c.$index%2===a)d&&b!==d&&i(d),f(b)}function i(a){M(a)&&!I(a)&&(a=Ta(a,function(a,b){if(a)return b}));d.removeClass(I(a)?a.join(" "):a)}function f(a){M(a)&&!I(a)&&(a=Ta(a,function(a,b){if(a)return b}));a&&d.addClass(I(a)?a.join(" "):a)}c.$watch(e[b],g,!0);e.$observe("class",function(){var a=c.$eval(e[b]);g(a,a)});b!=="ngClass"&&c.$watch("$index",function(d,g){var k=d%2;k!==g%2&&(k==a?f(c.$eval(e[b])):i(c.$eval(e[b])))})})}var D=function(b){return E(b)?b.toLowerCase():b},la=function(b){return E(b)? +b.toUpperCase():b},u=T.Error,aa=F((/msie (\d+)/.exec(D(navigator.userAgent))||[])[1]),z,ja,ia=[].slice,Ra=[].push,Sa=Object.prototype.toString,Zb=T.angular||(T.angular={}),sa,Db,Z=["0","0","0"];C.$inject=[];ma.$inject=[];Db=aa<9?function(b){b=b.nodeName?b:b[0];return b.scopeName&&b.scopeName!="HTML"?la(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var kc=/[A-Z]/g,hd={full:"1.0.4",major:1,minor:0,dot:4,codeName:"bewildering-hair"},Aa=O.cache={},za= +O.expando="ng-"+(new Date).getTime(),oc=1,$b=T.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},eb=T.document.removeEventListener?function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)},mc=/([\:\-\_]+(.))/g,nc=/^moz([A-Z])/,ta=O.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;this.bind("DOMContentLoaded",a);O(T).bind("load",a)},toString:function(){var b=[];m(this,function(a){b.push(""+a)}); +return"["+b.join(", ")+"]"},eq:function(b){return b>=0?z(this[b]):z(this[this.length+b])},length:0,push:Ra,sort:[].sort,splice:[].splice},Da={};m("multiple,selected,checked,disabled,readOnly,required".split(","),function(b){Da[D(b)]=b});var Ab={};m("input,select,option,textarea,button,form".split(","),function(b){Ab[la(b)]=!0});m({data:vb,inheritedData:Ca,scope:function(b){return Ca(b,"$scope")},controller:yb,injector:function(b){return Ca(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)}, +hasClass:Ba,css:function(b,a,c){a=sb(a);if(v(c))b.style[a]=c;else{var d;aa<=8&&(d=b.currentStyle&&b.currentStyle[a],d===""&&(d="auto"));d=d||b.style[a];aa<=8&&(d=d===""?p:d);return d}},attr:function(b,a,c){var d=D(a);if(Da[d])if(v(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||C).specified?d:p;else if(v(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),b===null?p:b},prop:function(b,a,c){if(v(c))b[a]=c;else return b[a]}, +text:y(aa<9?function(b,a){if(b.nodeType==1){if(t(a))return b.innerText;b.innerText=a}else{if(t(a))return b.nodeValue;b.nodeValue=a}}:function(b,a){if(t(a))return b.textContent;b.textContent=a},{$dv:""}),val:function(b,a){if(t(a))return b.value;b.value=a},html:function(b,a){if(t(a))return b.innerHTML;for(var c=0,d=b.childNodes;c":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)}, +"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Kc={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'},ib={},Xc=T.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw new u("This browser does not support XMLHttpRequest.");};Qb.$inject=["$provide"];Rb.$inject= +["$locale"];Tb.$inject=["$locale"];var Wb=".",gd={yyyy:N("FullYear",4),yy:N("FullYear",2,0,!0),y:N("FullYear",1),MMMM:La("Month"),MMM:La("Month",!0),MM:N("Month",2,1),M:N("Month",1,1),dd:N("Date",2),d:N("Date",1),HH:N("Hours",2),H:N("Hours",1),hh:N("Hours",2,-12),h:N("Hours",1,-12),mm:N("Minutes",2),m:N("Minutes",1),ss:N("Seconds",2),s:N("Seconds",1),EEEE:La("Day"),EEE:La("Day",!0),a:function(a,c){return a.getHours()<12?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){a=a.getTimezoneOffset();return jb(a/60,2)+ +jb(Math.abs(a%60),2)}},fd=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,ed=/^\d+$/;Sb.$inject=["$locale"];var cd=H(D),dd=H(la);Ub.$inject=["$parse"];var id=H({restrict:"E",compile:function(a,c){c.href||c.$set("href","");return function(a,c){c.bind("click",function(a){c.attr("href")||a.preventDefault()})}}}),lb={};m(Da,function(a,c){var d=fa("ng-"+c);lb[d]=function(){return{priority:100,compile:function(){return function(a,g,i){a.$watch(i[d],function(a){i.$set(c,!!a)})}}}}}); +m(["src","href"],function(a){var c=fa("ng-"+a);lb[c]=function(){return{priority:99,link:function(d,e,g){g.$observe(c,function(c){c&&(g.$set(a,c),aa&&e.prop(a,c))})}}}});var Oa={$addControl:C,$removeControl:C,$setValidity:C,$setDirty:C};Xb.$inject=["$element","$attrs","$scope"];var Ra=function(a){return["$timeout",function(c){var d={name:"form",restrict:"E",controller:Xb,compile:function(){return{pre:function(a,d,i,f){if(!i.action){var h=function(a){a.preventDefault?a.preventDefault():a.returnValue= +!1};$b(d[0],"submit",h);d.bind("$destroy",function(){c(function(){eb(d[0],"submit",h)},0,!1)})}var j=d.parent().controller("form"),k=i.name||i.ngForm;k&&(a[k]=f);j&&d.bind("$destroy",function(){j.$removeControl(f);k&&(a[k]=p);y(f,Oa)})}}}};return a?y(U(d),{restrict:"EAC"}):d}]},jd=Ra(),kd=Ra(!0),ld=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,md=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/,nd=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,bc={text:Qa,number:function(a, +c,d,e,g,i){Qa(a,c,d,e,g,i);e.$parsers.push(function(a){var c=S(a);return c||nd.test(a)?(e.$setValidity("number",!0),a===""?null:c?a:parseFloat(a)):(e.$setValidity("number",!1),p)});e.$formatters.push(function(a){return S(a)?"":""+a});if(d.min){var f=parseFloat(d.min),a=function(a){return!S(a)&&ah?(e.$setValidity("max",!1),p):(e.$setValidity("max", +!0),a)};e.$parsers.push(d);e.$formatters.push(d)}e.$formatters.push(function(a){return S(a)||va(a)?(e.$setValidity("number",!0),a):(e.$setValidity("number",!1),p)})},url:function(a,c,d,e,g,i){Qa(a,c,d,e,g,i);a=function(a){return S(a)||ld.test(a)?(e.$setValidity("url",!0),a):(e.$setValidity("url",!1),p)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a,c,d,e,g,i){Qa(a,c,d,e,g,i);a=function(a){return S(a)||md.test(a)?(e.$setValidity("email",!0),a):(e.$setValidity("email",!1),p)};e.$formatters.push(a); +e.$parsers.push(a)},radio:function(a,c,d,e){t(d.name)&&c.attr("name",wa());c.bind("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var g=d.ngTrueValue,i=d.ngFalseValue;E(g)||(g=!0);E(i)||(i=!1);c.bind("click",function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$formatters.push(function(a){return a=== +g});e.$parsers.push(function(a){return a?g:i})},hidden:C,button:C,submit:C,reset:C},cc=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,g,i){i&&(bc[D(g.type)]||bc.text)(d,e,g,i,c,a)}}}],Na="ng-valid",Ma="ng-invalid",Pa="ng-pristine",Yb="ng-dirty",od=["$scope","$exceptionHandler","$attrs","$element","$parse",function(a,c,d,e,g){function i(a,c){c=c?"-"+$a(c,"-"):"";e.removeClass((a?Ma:Na)+c).addClass((a?Na:Ma)+c)}this.$modelValue=this.$viewValue=Number.NaN; +this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var f=g(d.ngModel),h=f.assign;if(!h)throw u(Eb+d.ngModel+" ("+pa(e)+")");this.$render=C;var j=e.inheritedData("$formController")||Oa,k=0,l=this.$error={};e.addClass(Pa);i(!0);this.$setValidity=function(a,c){if(l[a]!==!c){if(c){if(l[a]&&k--,!k)i(!0),this.$valid=!0,this.$invalid=!1}else i(!1),this.$invalid=!0,this.$valid=!1,k++;l[a]=!c;i(c,a);j.$setValidity(a, +c,this)}};this.$setViewValue=function(d){this.$viewValue=d;if(this.$pristine)this.$dirty=!0,this.$pristine=!1,e.removeClass(Pa).addClass(Yb),j.$setDirty();m(this.$parsers,function(a){d=a(d)});if(this.$modelValue!==d)this.$modelValue=d,h(a,d),m(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};var o=this;a.$watch(function(){var c=f(a);if(o.$modelValue!==c){var d=o.$formatters,e=d.length;for(o.$modelValue=c;e--;)c=d[e](c);if(o.$viewValue!==c)o.$viewValue=c,o.$render()}})}],pd=function(){return{require:["ngModel", +"^?form"],controller:od,link:function(a,c,d,e){var g=e[0],i=e[1]||Oa;i.$addControl(g);c.bind("$destroy",function(){i.$removeControl(g)})}}},qd=H({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),dc=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required=!0;var g=function(a){if(d.required&&(S(a)||a===!1))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(g);e.$parsers.unshift(g); +d.$observe("required",function(){g(e.$viewValue)})}}}},rd=function(){return{require:"ngModel",link:function(a,c,d,e){var g=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){var c=[];a&&m(a.split(g),function(a){a&&c.push(Q(a))});return c});e.$formatters.push(function(a){return I(a)?a.join(", "):p})}}},sd=/^(true|false|\d+)$/,td=function(){return{priority:100,compile:function(a,c){return sd.test(c.ngValue)?function(a,c,g){g.$set("value",a.$eval(g.ngValue))}:function(a, +c,g){a.$watch(g.ngValue,function(a){g.$set("value",a,!1)})}}}},ud=R(function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==p?"":a)})}),vd=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate",function(a){d.text(a)})}}],wd=[function(){return function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBindHtmlUnsafe);a.$watch(d.ngBindHtmlUnsafe, +function(a){c.html(a||"")})}}],xd=kb("",!0),yd=kb("Odd",0),zd=kb("Even",1),Ad=R({compile:function(a,c){c.$set("ngCloak",p);a.removeClass("ng-cloak")}}),Bd=[function(){return{scope:!0,controller:"@"}}],Cd=["$sniffer",function(a){return{priority:1E3,compile:function(){a.csp=!0}}}],ec={};m("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave".split(" "),function(a){var c=fa("ng-"+a);ec[c]=["$parse",function(d){return function(e,g,i){var f=d(i[c]);g.bind(D(a),function(a){e.$apply(function(){f(e, +{$event:a})})})}}]});var Dd=R(function(a,c,d){c.bind("submit",function(){a.$apply(d.ngSubmit)})}),Ed=["$http","$templateCache","$anchorScroll","$compile",function(a,c,d,e){return{restrict:"ECA",terminal:!0,compile:function(g,i){var f=i.ngInclude||i.src,h=i.onload||"",j=i.autoscroll;return function(g,i){var o=0,m,n=function(){m&&(m.$destroy(),m=null);i.html("")};g.$watch(f,function(f){var q=++o;f?a.get(f,{cache:c}).success(function(a){q===o&&(m&&m.$destroy(),m=g.$new(),i.html(a),e(i.contents())(m), +v(j)&&(!j||g.$eval(j))&&d(),m.$emit("$includeContentLoaded"),g.$eval(h))}).error(function(){q===o&&n()}):n()})}}}}],Fd=R({compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Gd=R({terminal:!0,priority:1E3}),Hd=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,g,i){var f=i.count,h=g.attr(i.$attr.when),j=i.offset||0,k=e.$eval(h),l={},o=c.startSymbol(),r=c.endSymbol();m(k,function(a,e){l[e]=c(a.replace(d,o+f+"-"+j+r))});e.$watch(function(){var c= +parseFloat(e.$eval(f));return isNaN(c)?"":(k[c]||(c=a.pluralCat(c-j)),l[c](e,g,!0))},function(a){g.text(a)})}}}],Id=R({transclude:"element",priority:1E3,terminal:!0,compile:function(a,c,d){return function(a,c,i){var f=i.ngRepeat,i=f.match(/^\s*(.+)\s+in\s+(.*)\s*$/),h,j,k;if(!i)throw u("Expected ngRepeat in form of '_item_ in _collection_' but got '"+f+"'.");f=i[1];h=i[2];i=f.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!i)throw u("'item' in 'item in collection' should be identifier or (key, value) but got '"+ +f+"'.");j=i[3]||i[1];k=i[2];var l=new fb;a.$watch(function(a){var e,f,i=a.$eval(h),m=c,p=new fb,z,A,s,v,t,u;if(I(i))t=i||[];else{t=[];for(s in i)i.hasOwnProperty(s)&&s.charAt(0)!="$"&&t.push(s);t.sort()}z=t.length;e=0;for(f=t.length;ey;)v.pop().element.remove()}for(;s.length>w;)s.pop()[0].element.remove()}var i;if(!(i=w.match(d)))throw u("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+w+"'."); +var j=c(i[2]||i[1]),k=i[4]||i[6],l=i[5],m=c(i[3]||""),o=c(i[2]?i[1]:k),r=c(i[7]),s=[[{element:f,label:""}]];q&&(a(q)(e),q.removeClass("ng-scope"),q.remove());f.html("");f.bind("change",function(){e.$apply(function(){var a,c=r(e)||[],d={},h,i,j,m,q,t;if(n){i=[];m=0;for(t=s.length;m@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none;}ng\\:form{display:block;}'); diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/js/bootstrap.min.js b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/js/bootstrap.min.js new file mode 100644 index 00000000000..6eeb15ce3b7 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Content/js/bootstrap.min.js @@ -0,0 +1,6 @@ +/*! +* Bootstrap.js by @fat & @mdo +* Copyright 2012 Twitter, Inc. +* http://www.apache.org/licenses/LICENSE-2.0.txt +*/ +!function($){"use strict";$(function(){$.support.transition=function(){var transitionEnd=function(){var name,el=document.createElement("bootstrap"),transEndEventNames={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(name in transEndEventNames)if(void 0!==el.style[name])return transEndEventNames[name]}();return transitionEnd&&{end:transitionEnd}}()})}(window.jQuery),!function($){"use strict";var dismiss='[data-dismiss="alert"]',Alert=function(el){$(el).on("click",dismiss,this.close)};Alert.prototype.close=function(e){function removeElement(){$parent.trigger("closed").remove()}var $parent,$this=$(this),selector=$this.attr("data-target");selector||(selector=$this.attr("href"),selector=selector&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),e&&e.preventDefault(),$parent.length||($parent=$this.hasClass("alert")?$this:$this.parent()),$parent.trigger(e=$.Event("close")),e.isDefaultPrevented()||($parent.removeClass("in"),$.support.transition&&$parent.hasClass("fade")?$parent.on($.support.transition.end,removeElement):removeElement())};var old=$.fn.alert;$.fn.alert=function(option){return this.each(function(){var $this=$(this),data=$this.data("alert");data||$this.data("alert",data=new Alert(this)),"string"==typeof option&&data[option].call($this)})},$.fn.alert.Constructor=Alert,$.fn.alert.noConflict=function(){return $.fn.alert=old,this},$(document).on("click.alert.data-api",dismiss,Alert.prototype.close)}(window.jQuery),!function($){"use strict";var Button=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.button.defaults,options)};Button.prototype.setState=function(state){var d="disabled",$el=this.$element,data=$el.data(),val=$el.is("input")?"val":"html";state+="Text",data.resetText||$el.data("resetText",$el[val]()),$el[val](data[state]||this.options[state]),setTimeout(function(){"loadingText"==state?$el.addClass(d).attr(d,d):$el.removeClass(d).removeAttr(d)},0)},Button.prototype.toggle=function(){var $parent=this.$element.closest('[data-toggle="buttons-radio"]');$parent&&$parent.find(".active").removeClass("active"),this.$element.toggleClass("active")};var old=$.fn.button;$.fn.button=function(option){return this.each(function(){var $this=$(this),data=$this.data("button"),options="object"==typeof option&&option;data||$this.data("button",data=new Button(this,options)),"toggle"==option?data.toggle():option&&data.setState(option)})},$.fn.button.defaults={loadingText:"loading..."},$.fn.button.Constructor=Button,$.fn.button.noConflict=function(){return $.fn.button=old,this},$(document).on("click.button.data-api","[data-toggle^=button]",function(e){var $btn=$(e.target);$btn.hasClass("btn")||($btn=$btn.closest(".btn")),$btn.button("toggle")})}(window.jQuery),!function($){"use strict";var Carousel=function(element,options){this.$element=$(element),this.options=options,"hover"==this.options.pause&&this.$element.on("mouseenter",$.proxy(this.pause,this)).on("mouseleave",$.proxy(this.cycle,this))};Carousel.prototype={cycle:function(e){return e||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval($.proxy(this.next,this),this.options.interval)),this},to:function(pos){var $active=this.$element.find(".item.active"),children=$active.parent().children(),activePos=children.index($active),that=this;if(!(pos>children.length-1||0>pos))return this.sliding?this.$element.one("slid",function(){that.to(pos)}):activePos==pos?this.pause().cycle():this.slide(pos>activePos?"next":"prev",$(children[pos]))},pause:function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&$.support.transition.end&&(this.$element.trigger($.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){return this.sliding?void 0:this.slide("next")},prev:function(){return this.sliding?void 0:this.slide("prev")},slide:function(type,next){var e,$active=this.$element.find(".item.active"),$next=next||$active[type](),isCycling=this.interval,direction="next"==type?"left":"right",fallback="next"==type?"first":"last",that=this;if(this.sliding=!0,isCycling&&this.pause(),$next=$next.length?$next:this.$element.find(".item")[fallback](),e=$.Event("slide",{relatedTarget:$next[0]}),!$next.hasClass("active")){if($.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(e),e.isDefaultPrevented())return;$next.addClass(type),$next[0].offsetWidth,$active.addClass(direction),$next.addClass(direction),this.$element.one($.support.transition.end,function(){$next.removeClass([type,direction].join(" ")).addClass("active"),$active.removeClass(["active",direction].join(" ")),that.sliding=!1,setTimeout(function(){that.$element.trigger("slid")},0)})}else{if(this.$element.trigger(e),e.isDefaultPrevented())return;$active.removeClass("active"),$next.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return isCycling&&this.cycle(),this}}};var old=$.fn.carousel;$.fn.carousel=function(option){return this.each(function(){var $this=$(this),data=$this.data("carousel"),options=$.extend({},$.fn.carousel.defaults,"object"==typeof option&&option),action="string"==typeof option?option:options.slide;data||$this.data("carousel",data=new Carousel(this,options)),"number"==typeof option?data.to(option):action?data[action]():options.interval&&data.cycle()})},$.fn.carousel.defaults={interval:5e3,pause:"hover"},$.fn.carousel.Constructor=Carousel,$.fn.carousel.noConflict=function(){return $.fn.carousel=old,this},$(document).on("click.carousel.data-api","[data-slide]",function(e){var href,$this=$(this),$target=$($this.attr("data-target")||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,"")),options=$.extend({},$target.data(),$this.data());$target.carousel(options),e.preventDefault()})}(window.jQuery),!function($){"use strict";var Collapse=function(element,options){this.$element=$(element),this.options=$.extend({},$.fn.collapse.defaults,options),this.options.parent&&(this.$parent=$(this.options.parent)),this.options.toggle&&this.toggle()};Collapse.prototype={constructor:Collapse,dimension:function(){var hasWidth=this.$element.hasClass("width");return hasWidth?"width":"height"},show:function(){var dimension,scroll,actives,hasData;if(!this.transitioning){if(dimension=this.dimension(),scroll=$.camelCase(["scroll",dimension].join("-")),actives=this.$parent&&this.$parent.find("> .accordion-group > .in"),actives&&actives.length){if(hasData=actives.data("collapse"),hasData&&hasData.transitioning)return;actives.collapse("hide"),hasData||actives.data("collapse",null)}this.$element[dimension](0),this.transition("addClass",$.Event("show"),"shown"),$.support.transition&&this.$element[dimension](this.$element[0][scroll])}},hide:function(){var dimension;this.transitioning||(dimension=this.dimension(),this.reset(this.$element[dimension]()),this.transition("removeClass",$.Event("hide"),"hidden"),this.$element[dimension](0))},reset:function(size){var dimension=this.dimension();return this.$element.removeClass("collapse")[dimension](size||"auto")[0].offsetWidth,this.$element[null!==size?"addClass":"removeClass"]("collapse"),this},transition:function(method,startEvent,completeEvent){var that=this,complete=function(){"show"==startEvent.type&&that.reset(),that.transitioning=0,that.$element.trigger(completeEvent)};this.$element.trigger(startEvent),startEvent.isDefaultPrevented()||(this.transitioning=1,this.$element[method]("in"),$.support.transition&&this.$element.hasClass("collapse")?this.$element.one($.support.transition.end,complete):complete())},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}};var old=$.fn.collapse;$.fn.collapse=function(option){return this.each(function(){var $this=$(this),data=$this.data("collapse"),options="object"==typeof option&&option;data||$this.data("collapse",data=new Collapse(this,options)),"string"==typeof option&&data[option]()})},$.fn.collapse.defaults={toggle:!0},$.fn.collapse.Constructor=Collapse,$.fn.collapse.noConflict=function(){return $.fn.collapse=old,this},$(document).on("click.collapse.data-api","[data-toggle=collapse]",function(e){var href,$this=$(this),target=$this.attr("data-target")||e.preventDefault()||(href=$this.attr("href"))&&href.replace(/.*(?=#[^\s]+$)/,""),option=$(target).data("collapse")?"toggle":$this.data();$this[$(target).hasClass("in")?"addClass":"removeClass"]("collapsed"),$(target).collapse(option)})}(window.jQuery),!function($){"use strict";function clearMenus(){$(toggle).each(function(){getParent($(this)).removeClass("open")})}function getParent($this){var $parent,selector=$this.attr("data-target");return selector||(selector=$this.attr("href"),selector=selector&&/#/.test(selector)&&selector.replace(/.*(?=#[^\s]*$)/,"")),$parent=$(selector),$parent.length||($parent=$this.parent()),$parent}var toggle="[data-toggle=dropdown]",Dropdown=function(element){var $el=$(element).on("click.dropdown.data-api",this.toggle);$("html").on("click.dropdown.data-api",function(){$el.parent().removeClass("open")})};Dropdown.prototype={constructor:Dropdown,toggle:function(){var $parent,isActive,$this=$(this);if(!$this.is(".disabled, :disabled"))return $parent=getParent($this),isActive=$parent.hasClass("open"),clearMenus(),isActive||$parent.toggleClass("open"),$this.focus(),!1},keydown:function(e){var $this,$items,$parent,isActive,index;if(/(38|40|27)/.test(e.keyCode)&&($this=$(this),e.preventDefault(),e.stopPropagation(),!$this.is(".disabled, :disabled"))){if($parent=getParent($this),isActive=$parent.hasClass("open"),!isActive||isActive&&27==e.keyCode)return $this.click();$items=$("[role=menu] li:not(.divider):visible a",$parent),$items.length&&(index=$items.index($items.filter(":focus")),38==e.keyCode&&index>0&&index--,40==e.keyCode&&$items.length-1>index&&index++,~index||(index=0),$items.eq(index).focus())}}};var old=$.fn.dropdown;$.fn.dropdown=function(option){return this.each(function(){var $this=$(this),data=$this.data("dropdown");data||$this.data("dropdown",data=new Dropdown(this)),"string"==typeof option&&data[option].call($this)})},$.fn.dropdown.Constructor=Dropdown,$.fn.dropdown.noConflict=function(){return $.fn.dropdown=old,this},$(document).on("click.dropdown.data-api touchstart.dropdown.data-api",clearMenus).on("click.dropdown touchstart.dropdown.data-api",".dropdown form",function(e){e.stopPropagation()}).on("touchstart.dropdown.data-api",".dropdown-menu",function(e){e.stopPropagation()}).on("click.dropdown.data-api touchstart.dropdown.data-api",toggle,Dropdown.prototype.toggle).on("keydown.dropdown.data-api touchstart.dropdown.data-api",toggle+", [role=menu]",Dropdown.prototype.keydown)}(window.jQuery),!function($){"use strict";var Modal=function(element,options){this.options=options,this.$element=$(element).delegate('[data-dismiss="modal"]',"click.dismiss.modal",$.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};Modal.prototype={constructor:Modal,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var that=this,e=$.Event("show");this.$element.trigger(e),this.isShown||e.isDefaultPrevented()||(this.isShown=!0,this.escape(),this.backdrop(function(){var transition=$.support.transition&&that.$element.hasClass("fade");that.$element.parent().length||that.$element.appendTo(document.body),that.$element.show(),transition&&that.$element[0].offsetWidth,that.$element.addClass("in").attr("aria-hidden",!1),that.enforceFocus(),transition?that.$element.one($.support.transition.end,function(){that.$element.focus().trigger("shown")}):that.$element.focus().trigger("shown")}))},hide:function(e){e&&e.preventDefault(),e=$.Event("hide"),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.escape(),$(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),$.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal())},enforceFocus:function(){var that=this;$(document).on("focusin.modal",function(e){that.$element[0]===e.target||that.$element.has(e.target).length||that.$element.focus()})},escape:function(){var that=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(e){27==e.which&&that.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var that=this,timeout=setTimeout(function(){that.$element.off($.support.transition.end),that.hideModal()},500);this.$element.one($.support.transition.end,function(){clearTimeout(timeout),that.hideModal()})},hideModal:function(){this.$element.hide().trigger("hidden"),this.backdrop()},removeBackdrop:function(){this.$backdrop.remove(),this.$backdrop=null},backdrop:function(callback){var animate=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var doAnimate=$.support.transition&&animate;this.$backdrop=$(' +
    +
    +
    + List of orders +
    + Heads up! Once you place an order, you have 20 secs to cancel it. +
    + + + + + + + + + + + + + + + + + + + + +
    #Video(s)Status 
    + No order yet, place some orders above +
    {{order.number}}
    {{title}}
    {{order.status}}
    +
    +
    +
    +
    + Orders Received + + + + + + + + + + + + + + + + +
    #Video(s)
    + No orders received yet +
    {{order.number}}
    +
    +
    +
    + diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Views/Shared/_Layout.cshtml b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Views/Shared/_Layout.cshtml new file mode 100644 index 00000000000..b6bcbb07c06 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Views/Shared/_Layout.cshtml @@ -0,0 +1,54 @@ + + + + + + @ViewBag.Title + + + + + + + + + + @RenderSection("head", required: false) + + + + +
    + @RenderBody() +
    + + + \ No newline at end of file diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Views/Web.config b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Views/Web.config new file mode 100644 index 00000000000..a575d7cc087 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Views/Web.config @@ -0,0 +1,35 @@ + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Views/_ViewStart.cshtml b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Views/_ViewStart.cshtml new file mode 100644 index 00000000000..efda124b1fc --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} \ No newline at end of file diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Web.Debug.config b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Web.Debug.config new file mode 100644 index 00000000000..2251b2c596e --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Web.Release.config b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Web.Release.config new file mode 100644 index 00000000000..90b9041232d --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Web.config b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Web.config new file mode 100644 index 00000000000..66c619d677b --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/Web.config @@ -0,0 +1,28 @@ + + + +
    +
    +
    + + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.ECommerce/packages.config b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/packages.config new file mode 100644 index 00000000000..1ae22617561 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.ECommerce/packages.config @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.Messages/Commands/CancelOrder.cs b/Samples/VideoStore.SqlServer/VideoStore.Messages/Commands/CancelOrder.cs new file mode 100644 index 00000000000..5a6b5e9b374 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Messages/Commands/CancelOrder.cs @@ -0,0 +1,8 @@ +namespace VideoStore.Messages.Commands +{ + public class CancelOrder + { + public int OrderNumber { get; set; } + public string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.SqlServer/VideoStore.Messages/Commands/SubmitOrder.cs b/Samples/VideoStore.SqlServer/VideoStore.Messages/Commands/SubmitOrder.cs new file mode 100644 index 00000000000..6d2ce27cb10 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Messages/Commands/SubmitOrder.cs @@ -0,0 +1,11 @@ +namespace VideoStore.Messages.Commands +{ + public class SubmitOrder + { + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + public string EncryptedCreditCardNumber { get; set; } + public string EncryptedExpirationDate { get; set; } + } +} diff --git a/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/ClientBecamePreferred.cs b/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/ClientBecamePreferred.cs new file mode 100644 index 00000000000..6f73e54cbdf --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/ClientBecamePreferred.cs @@ -0,0 +1,10 @@ +namespace VideoStore.Messages.Events +{ + using System; + + public class ClientBecamePreferred + { + public string ClientId { get; set; } + public DateTime PreferredStatusExpiresOn { get; set; } + } +} diff --git a/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/DownloadIsReady.cs b/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/DownloadIsReady.cs new file mode 100644 index 00000000000..7ba10112e13 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/DownloadIsReady.cs @@ -0,0 +1,11 @@ +namespace VideoStore.Messages.Events +{ + using System.Collections.Generic; + + public interface DownloadIsReady + { + int OrderNumber { get; set; } + Dictionary VideoUrls { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/OrderAccepted.cs b/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/OrderAccepted.cs new file mode 100644 index 00000000000..e37e0b6ac56 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/OrderAccepted.cs @@ -0,0 +1,10 @@ +namespace VideoStore.Messages.Events +{ + //NServiceBus messages can be defined using both classes and interfaces + public interface OrderAccepted + { + int OrderNumber { get; set; } + string[] VideoIds { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/OrderCancelled.cs b/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/OrderCancelled.cs new file mode 100644 index 00000000000..b7c456edee2 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/OrderCancelled.cs @@ -0,0 +1,8 @@ +namespace VideoStore.Messages.Events +{ + public interface OrderCancelled + { + int OrderNumber { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/OrderPlaced.cs b/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/OrderPlaced.cs new file mode 100644 index 00000000000..e638040b37e --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Messages/Events/OrderPlaced.cs @@ -0,0 +1,9 @@ +namespace VideoStore.Messages.Events +{ + public interface OrderPlaced + { + int OrderNumber { get; set; } + string[] VideoIds { get; set; } + string ClientId { get; set; } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.SqlServer/VideoStore.Messages/Properties/AssemblyInfo.cs b/Samples/VideoStore.SqlServer/VideoStore.Messages/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..5972cb6d3a7 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Messages/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyMessages")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyMessages")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("4687cda1-7646-49ca-83ad-35500037bda3")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.SqlServer/VideoStore.Messages/RequestResponse/ProvisionDownloadRequest.cs b/Samples/VideoStore.SqlServer/VideoStore.Messages/RequestResponse/ProvisionDownloadRequest.cs new file mode 100644 index 00000000000..8f40dbdfc58 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Messages/RequestResponse/ProvisionDownloadRequest.cs @@ -0,0 +1,9 @@ +namespace VideoStore.Messages.RequestResponse +{ + public class ProvisionDownloadRequest + { + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + } +} diff --git a/Samples/VideoStore.SqlServer/VideoStore.Messages/RequestResponse/ProvisionDownloadResponse.cs b/Samples/VideoStore.SqlServer/VideoStore.Messages/RequestResponse/ProvisionDownloadResponse.cs new file mode 100644 index 00000000000..5b58f9d8d8b --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Messages/RequestResponse/ProvisionDownloadResponse.cs @@ -0,0 +1,9 @@ +namespace VideoStore.Messages.RequestResponse +{ + public class ProvisionDownloadResponse + { + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + } +} diff --git a/Samples/VideoStore.SqlServer/VideoStore.Messages/VideoStore.Messages.csproj b/Samples/VideoStore.SqlServer/VideoStore.Messages/VideoStore.Messages.csproj new file mode 100644 index 00000000000..7f7656a17b6 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Messages/VideoStore.Messages.csproj @@ -0,0 +1,72 @@ + + + + + + Debug + AnyCPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679} + Library + Properties + VideoStore.Messages + VideoStore.Messages + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.Operations/App.config b/Samples/VideoStore.SqlServer/VideoStore.Operations/App.config new file mode 100644 index 00000000000..a826b0e0cf5 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Operations/App.config @@ -0,0 +1,17 @@ + + + +
    +
    +
    + + + + + + + + + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.Operations/EndpointConfig.cs b/Samples/VideoStore.SqlServer/VideoStore.Operations/EndpointConfig.cs new file mode 100644 index 00000000000..bfeb5d441ff --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Operations/EndpointConfig.cs @@ -0,0 +1,22 @@ +namespace VideoStore.Operations +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Server, UsingTransport + { + } + + public class MyClass : IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.Operations endpoint is now started and ready to accept messages"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.SqlServer/VideoStore.Operations/Properties/AssemblyInfo.cs b/Samples/VideoStore.SqlServer/VideoStore.Operations/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..ff7833e6eb7 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Operations/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyRequestResponseEndpoint")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyRequestResponseEndpoint")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("f2941769-d352-4bba-aa24-6974cf3d7e2a")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.SqlServer/VideoStore.Operations/ProvisionDownloadHandler.cs b/Samples/VideoStore.SqlServer/VideoStore.Operations/ProvisionDownloadHandler.cs new file mode 100644 index 00000000000..b1bdb94c4bb --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Operations/ProvisionDownloadHandler.cs @@ -0,0 +1,30 @@ +namespace VideoStore.Operations +{ + using System; + using System.Diagnostics; + using VideoStore.Common; + using VideoStore.Messages.RequestResponse; + using NServiceBus; + + public class ProvisionDownloadHandler : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(ProvisionDownloadRequest message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.Out.WriteLine("Provision the videos and make the Urls available to the Content management for download ...[{0}] video(s) to provision", String.Join(", ", message.VideoIds)); + + Bus.Reply(new ProvisionDownloadResponse + { + OrderNumber = message.OrderNumber, + VideoIds = message.VideoIds, + ClientId = message.ClientId + }); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.SqlServer/VideoStore.Operations/VideoStore.Operations.csproj b/Samples/VideoStore.SqlServer/VideoStore.Operations/VideoStore.Operations.csproj new file mode 100644 index 00000000000..0d06d661f85 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Operations/VideoStore.Operations.csproj @@ -0,0 +1,93 @@ + + + + + + Debug + AnyCPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF} + Library + Properties + VideoStore.Operations + VideoStore.Operations + v4.0 + 512 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\..\..\binaries\NServiceBus.Transports.SqlServer.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + DebugFlagMutator.cs + + + UnobtrusiveMessageConventions.cs + + + + + + + + + + + Designer + + + Designer + + + + + {59f2ba7e-4da5-49f8-9dbc-520fa99f4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.Operations/packages.config b/Samples/VideoStore.SqlServer/VideoStore.Operations/packages.config new file mode 100644 index 00000000000..79ece06bef6 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Operations/packages.config @@ -0,0 +1,3 @@ + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.Sales/App.config b/Samples/VideoStore.SqlServer/VideoStore.Sales/App.config new file mode 100644 index 00000000000..0d0974a7287 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Sales/App.config @@ -0,0 +1,22 @@ + + + +
    +
    +
    +
    +
    + + + + + + + + + + + + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.Sales/EndpointConfig.cs b/Samples/VideoStore.SqlServer/VideoStore.Sales/EndpointConfig.cs new file mode 100644 index 00000000000..1426226683e --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Sales/EndpointConfig.cs @@ -0,0 +1,29 @@ +namespace VideoStore.Sales +{ + using System; + using NServiceBus; + + public class EndpointConfig : IConfigureThisEndpoint, AsA_Publisher, UsingTransport, IWantCustomInitialization + { + public void Init() + { + Configure.With() + .DefaultBuilder() + .RijndaelEncryptionService(); + } + } + + + public class MyClass:IWantToRunWhenBusStartsAndStops + { + public void Start() + { + Console.Out.WriteLine("The VideoStore.Sales endpoint is now started and ready to accept messages"); + } + + public void Stop() + { + + } + } +} diff --git a/Samples/VideoStore.SqlServer/VideoStore.Sales/ProcessOrderSaga.cs b/Samples/VideoStore.SqlServer/VideoStore.Sales/ProcessOrderSaga.cs new file mode 100644 index 00000000000..ee3dfc1358d --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Sales/ProcessOrderSaga.cs @@ -0,0 +1,90 @@ +namespace VideoStore.Sales +{ + using System; + using System.Diagnostics; + using Common; + using Messages.Commands; + using Messages.Events; + using NServiceBus; + using NServiceBus.Saga; + + public class ProcessOrderSaga : Saga, + IAmStartedByMessages, + IHandleMessages, + IHandleTimeouts + { + public void Handle(SubmitOrder message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Data.OrderNumber = message.OrderNumber; + Data.VideoIds = message.VideoIds; + Data.ClientId = message.ClientId; + + RequestTimeout(TimeSpan.FromSeconds(20), new BuyersRemorseIsOver()); + Console.Out.WriteLine("Starting cool down period for order #{0}.", Data.OrderNumber); + } + + public void Timeout(BuyersRemorseIsOver state) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Bus.Publish(e => + { + e.OrderNumber = Data.OrderNumber; + e.VideoIds = Data.VideoIds; + e.ClientId = Data.ClientId; + }); + + MarkAsComplete(); + + Console.Out.WriteLine("Cooling down period for order #{0} has elapsed.", Data.OrderNumber); + } + + public void Handle(CancelOrder message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + MarkAsComplete(); + + Bus.Publish(Bus.CreateInstance(o => + { + o.OrderNumber = message.OrderNumber; + o.ClientId = message.ClientId; + })); + + Console.Out.WriteLine("Order #{0} was cancelled.", message.OrderNumber); + } + + public override void ConfigureHowToFindSaga() + { + ConfigureMapping(m => m.OrderNumber) + .ToSaga(s=>s.OrderNumber); + ConfigureMapping(m => m.OrderNumber) + .ToSaga(s=>s.OrderNumber); + } + + public class OrderData : ContainSagaData + { + [Unique] + public int OrderNumber { get; set; } + public string[] VideoIds { get; set; } + public string ClientId { get; set; } + } + + public class BuyersRemorseIsOver + { + } + } + + +} \ No newline at end of file diff --git a/Samples/VideoStore.SqlServer/VideoStore.Sales/Properties/AssemblyInfo.cs b/Samples/VideoStore.SqlServer/VideoStore.Sales/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..b1f36493d27 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Sales/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("MyServer")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("MyServer")] +[assembly: AssemblyCopyright("Copyright © 2012")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("d3fd2af3-025c-4690-8ff1-0934a9d37b25")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Samples/VideoStore.SqlServer/VideoStore.Sales/SubmitOrderHandler.cs b/Samples/VideoStore.SqlServer/VideoStore.Sales/SubmitOrderHandler.cs new file mode 100644 index 00000000000..0a0e91fee1d --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Sales/SubmitOrderHandler.cs @@ -0,0 +1,37 @@ +namespace VideoStore.Sales +{ + using System; + using System.Diagnostics; + using VideoStore.Common; + using VideoStore.Messages.Commands; + using VideoStore.Messages.Events; + using NServiceBus; + + public class SubmitOrderHandler : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(SubmitOrder message) + { + if (DebugFlagMutator.Debug) + { + Debugger.Break(); + } + + Console.Out.WriteLine("We have received an order #{0} for [{1}] video(s).", message.OrderNumber, + String.Join(", ", message.VideoIds)); + + Console.Out.WriteLine("The credit card values will be encrypted when looking at the messages in the queues"); + Console.Out.WriteLine("CreditCard Number is {0}", message.EncryptedCreditCardNumber); + Console.Out.WriteLine("CreditCard Expiration Date is {0}", message.EncryptedExpirationDate); + + //tell the client that we received the order + Bus.Publish(Bus.CreateInstance(o => + { + o.ClientId = message.ClientId; + o.OrderNumber = message.OrderNumber; + o.VideoIds = message.VideoIds; + })); + } + } +} \ No newline at end of file diff --git a/Samples/VideoStore.SqlServer/VideoStore.Sales/VideoStore.Sales.csproj b/Samples/VideoStore.SqlServer/VideoStore.Sales/VideoStore.Sales.csproj new file mode 100644 index 00000000000..4efcf3f4171 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Sales/VideoStore.Sales.csproj @@ -0,0 +1,94 @@ + + + + + + Debug + AnyCPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE} + Library + Properties + VideoStore.Sales + VideoStore.Sales + v4.0 + 512 + ..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + true + + + + ..\..\..\binaries\NServiceBus.dll + + + ..\..\..\binaries\NServiceBus.Transports.SqlServer.dll + + + ..\..\..\binaries\NServiceBus.Core.dll + + + ..\..\..\binaries\NServiceBus.Host.exe + + + + + + + + + + + DebugFlagMutator.cs + + + UnobtrusiveMessageConventions.cs + + + + + + + + + + + + + Designer + + + + + + + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679} + VideoStore.Messages + + + + + + Program + $(ProjectDir)$(OutputPath)NServiceBus.Host.exe + true + + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.Sales/packages.config b/Samples/VideoStore.SqlServer/VideoStore.Sales/packages.config new file mode 100644 index 00000000000..79ece06bef6 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.Sales/packages.config @@ -0,0 +1,3 @@ + + + diff --git a/Samples/VideoStore.SqlServer/VideoStore.SqlServer.sln b/Samples/VideoStore.SqlServer/VideoStore.SqlServer.sln new file mode 100644 index 00000000000..d6c86602ae6 --- /dev/null +++ b/Samples/VideoStore.SqlServer/VideoStore.SqlServer.sln @@ -0,0 +1,57 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{FC318FC3-ED0F-4130-BD33-E970AE78A56C}" + ProjectSection(SolutionItems) = preProject + .nuget\NuGet.Config = .nuget\NuGet.Config + .nuget\NuGet.exe = .nuget\NuGet.exe + .nuget\NuGet.targets = .nuget\NuGet.targets + EndProjectSection +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.Messages", "VideoStore.Messages\VideoStore.Messages.csproj", "{59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.CustomerRelations", "VideoStore.CustomerRelations\VideoStore.CustomerRelations.csproj", "{CD522757-4C40-49C7-94C5-CD5DA956BAFC}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.Operations", "VideoStore.Operations\VideoStore.Operations.csproj", "{0B353423-4655-4523-B4E0-F191DDDF0ABF}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.Sales", "VideoStore.Sales\VideoStore.Sales.csproj", "{C2D005B5-065F-4F81-BA1F-259F90E00AEE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.ContentManagement", "VideoStore.ContentManagement\VideoStore.ContentManagement.csproj", "{C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VideoStore.ECommerce", "VideoStore.ECommerce\VideoStore.ECommerce.csproj", "{F295D85E-4447-44E4-A9CC-3E017CF2B0D8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Debug|Any CPU.Build.0 = Debug|Any CPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Release|Any CPU.ActiveCfg = Release|Any CPU + {59F2BA7E-4DA5-49F8-9DBC-520FA99F4679}.Release|Any CPU.Build.0 = Release|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CD522757-4C40-49C7-94C5-CD5DA956BAFC}.Release|Any CPU.Build.0 = Release|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B353423-4655-4523-B4E0-F191DDDF0ABF}.Release|Any CPU.Build.0 = Release|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C2D005B5-065F-4F81-BA1F-259F90E00AEE}.Release|Any CPU.Build.0 = Release|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C90A7D6C-99BB-4736-B2E5-D6AEA04A8D0C}.Release|Any CPU.Build.0 = Release|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F295D85E-4447-44E4-A9CC-3E017CF2B0D8}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Samples/VideoStore.SqlServer/VideoStore.SqlServer.v11.suo b/Samples/VideoStore.SqlServer/VideoStore.SqlServer.v11.suo new file mode 100644 index 00000000000..b399594709a Binary files /dev/null and b/Samples/VideoStore.SqlServer/VideoStore.SqlServer.v11.suo differ diff --git a/Samples/VideoStore.SqlServer/packages/repositories.config b/Samples/VideoStore.SqlServer/packages/repositories.config new file mode 100644 index 00000000000..66c82756846 --- /dev/null +++ b/Samples/VideoStore.SqlServer/packages/repositories.config @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Samples/WcfIntegration/Messages/ErrorCodes.cs b/Samples/WcfIntegration/Messages/ErrorCodes.cs deleted file mode 100644 index c010676e7e5..00000000000 --- a/Samples/WcfIntegration/Messages/ErrorCodes.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace Messages -{ - public enum ErrorCodes - { - None, - Fail - } -} diff --git a/Samples/WcfIntegration/Messages/ICancelOrderService.cs b/Samples/WcfIntegration/Messages/ICancelOrderService.cs deleted file mode 100644 index 7ebaa505d01..00000000000 --- a/Samples/WcfIntegration/Messages/ICancelOrderService.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.ServiceModel; - -namespace Messages -{ - /// - /// This is an example of using a service contract interface - /// instead of a service reference. Make sure to include the - /// Action / ReplyAction values that correspond to your - /// service inputs and outputs. A simple way to find out these - /// values is to host the service and inspect the auto-generated - /// WSDL by appending ?wsdl to the URL of the service. - /// - [ServiceContract] - public interface ICancelOrderService - { - [OperationContract(Action = "http://tempuri.org/IWcfServiceOf_CancelOrder_ErrorCodes/Process", ReplyAction = "http://tempuri.org/IWcfServiceOf_CancelOrder_ErrorCodes/ProcessResponse")] - ErrorCodes Process(CancelOrder request); - } -} \ No newline at end of file diff --git a/Samples/WcfIntegration/Server/app.config b/Samples/WcfIntegration/Server/app.config deleted file mode 100644 index 24c819ae190..00000000000 --- a/Samples/WcfIntegration/Server/app.config +++ /dev/null @@ -1,40 +0,0 @@ - - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Samples/WcfIntegration/WcfIntegration.suo b/Samples/WcfIntegration/WcfIntegration.suo deleted file mode 100644 index 7b9580d91a9..00000000000 Binary files a/Samples/WcfIntegration/WcfIntegration.suo and /dev/null differ diff --git a/Setup.ps1 b/Setup.ps1 new file mode 100644 index 00000000000..4b6afb3afc0 --- /dev/null +++ b/Setup.ps1 @@ -0,0 +1,46 @@ +properties { + $ProductVersion = "4.0" + $PatchVersion = "0" + $BuildNumber = "0" + $PreRelease = "" +} + +$baseDir = Split-Path (Resolve-Path $MyInvocation.MyCommand.Path) +$outputDir = "$baseDir\NServiceBus Setup\Output Package" +$toolsDir = "$baseDir\tools" +$setupProjectFile = "$baseDir\NServiceBus Setup\NServiceBus.aip" + +include $toolsDir\psake\buildutils.ps1 + +task default -depends Init, Build + +task Init { + + # Install path for Advanced Installer + $AdvancedInstallerPath = "" + $AdvancedInstallerPath = Get-RegistryValue "HKLM:\SOFTWARE\Wow6432Node\Caphyon\Advanced Installer\" "Advanced Installer Path" + $script:AdvinstCLI = $AdvancedInstallerPath + "\bin\x86\AdvancedInstaller.com" +} + +task Build { + # $UpgradeCode = "6bf2f238-54fb-4300-ab68-2416491af0" + $ProductVersion.Replace(".", "") + + if($PreRelease -eq "") { + $archive = "Particular.NServiceBus-$ProductVersion.$PatchVersion" + $preReleaseName = "" + } else { + $archive = "Particular.NServiceBus-$ProductVersion.$PatchVersion-$PreRelease$BuildNumber" + $preReleaseName = "-$PreRelease$BuildNumber" + } + + # edit Advanced Installer Project + exec { &$script:AdvinstCLI /edit $setupProjectFile /SetVersion "$ProductVersion.$PatchVersion" -noprodcode } + exec { &$script:AdvinstCLI /edit $setupProjectFile /SetPackageName "$archive.exe" -buildname DefaultBuild } + exec { &$script:AdvinstCLI /edit $setupProjectFile /SetOutputLocation -buildname DefaultBuild -path "$outputDir" } + + exec { &$script:AdvinstCLI /edit $setupProjectFile /SetProperty OPT_PRERELEASE_NAME="$preReleaseName" } + + # Build setup with Advanced Installer + exec { &$script:AdvinstCLI /rebuild $setupProjectFile } +} + diff --git a/acknowledgements.txt b/acknowledgements.txt index 060f352ee86..fd529a0d856 100644 --- a/acknowledgements.txt +++ b/acknowledgements.txt @@ -1,12 +1,12 @@ -NServiceBus uses multiple existing open source projects that have been invaluable resources and made creating NServiceBus possible. - -The NServiceBus team gives its thanks to: - -Spring Framework .NET (http://springframework.net/) -The Castle Project (http://castleproject.org/) -Rhino Mocks (http://groups.google.com/group/RhinoMocks/) -StructureMap (http://structuremap.sourceforge.net/) -NHibernate (http://nhforge.org/) -FluentNHibernate (http://wiki.fluentnhibernate.org/) -Topshelf (http://code.google.com/p/topshelf/) - +NServiceBus uses multiple existing open source projects that have been invaluable resources and made creating NServiceBus possible. + +The NServiceBus team gives its thanks to: + +Spring Framework .NET (http://springframework.net/) +The Castle Project (http://castleproject.org/) +Rhino Mocks (http://groups.google.com/group/RhinoMocks/) +StructureMap (http://structuremap.sourceforge.net/) +NHibernate (http://nhforge.org/) +FluentNHibernate (http://wiki.fluentnhibernate.org/) +Topshelf (http://code.google.com/p/topshelf/) + diff --git a/build.bat b/build.bat index 64da9f77fcf..8b43f296e86 100644 --- a/build.bat +++ b/build.bat @@ -1,13 +1,13 @@ -@echo off - -if '%1'=='/?' goto help -if '%1'=='-help' goto help -if '%1'=='-h' goto help - -powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\build.ps1' %*; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }" -PAUSE -goto :eof - -:help -powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\build.ps1' -help" -PAUSE \ No newline at end of file +@echo off + +if '%1'=='/?' goto help +if '%1'=='-help' goto help +if '%1'=='-h' goto help + +powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\build.ps1' %*; if ($psake.build_success -eq $false) { exit 1 } else { exit 0 }" +PAUSE +goto :eof + +:help +powershell -NoProfile -ExecutionPolicy Bypass -Command "& '%~dp0\build.ps1' -help" +PAUSE diff --git a/build.ps1 b/build.ps1 index 6ec3fda6792..2c06e3dda00 100644 --- a/build.ps1 +++ b/build.ps1 @@ -4,8 +4,8 @@ # Must match parameter definitions for psake.psm1/invoke-psake # otherwise named parameter binding fails -param( - [Parameter(Position=0,Mandatory=0)] +param( + [Parameter(Position=0,Mandatory=0)] [string]$buildFile = 'default.ps1', [Parameter(Position=1,Mandatory=0)] [string[]]$taskList = @("PrepareBinaries"), @@ -16,7 +16,7 @@ param( [Parameter(Position=4,Mandatory=0)] [System.Collections.Hashtable]$parameters = @{}, [Parameter(Position=5, Mandatory=0)] - [System.Collections.Hashtable]$properties = @{}, + [System.Collections.Hashtable]$properties = @{}, [Parameter(Position=6, Mandatory=0)] [switch]$nologo = $false, [Parameter(Position=7, Mandatory=0)] @@ -24,20 +24,20 @@ param( [Parameter(Position=8, Mandatory=0)] [string]$scriptPath = '.\tools\psake\' ) - + # '[p]sake' is the same as 'psake' but $Error is not polluted remove-module [p]sake import-module (join-path $scriptPath psake.psm1) if ($help) { Get-Help Invoke-psake -full return -} - +} + if (-not(test-path $buildFile)) { $absoluteBuildFile = (join-path $scriptPath $buildFile) if (test-path $absoluteBuildFile) { $buildFile = $absoluteBuildFile } } - + invoke-psake $buildFile $taskList $framework $docs $parameters $properties $nologo diff --git a/default.ps1 b/default.ps1 index cddb72a59af..2ff63fad8c7 100644 --- a/default.ps1 +++ b/default.ps1 @@ -1,778 +1,361 @@ -properties { - $ProductVersion = "3.3" - $PatchVersion = "0" - $BuildNumber = if($env:BUILD_NUMBER -ne $null) { $env:BUILD_NUMBER } else { "0" } - $PreRelease = "alpha" - $TargetFramework = "net-4.0" - $buildConfiguration = "Debug" - $NugetKey = "" - $UploadPackage = $false -} - -$baseDir = resolve-path . -$releaseRoot = "$baseDir\Release" -$releaseDir = "$releaseRoot\net40" -$binariesDir = "$baseDir\binaries" -$coreOnlyDir = "$baseDir\core-only" -$srcDir = "$baseDir\src" -$coreOnlyBinariesDir = "$coreOnlyDir\binaries" -$buildBase = "$baseDir\build" -$outDir = "$buildBase\output" -$coreOnly = "$buildBase\coreonly" -$libDir = "$baseDir\lib" -$artifactsDir = "$baseDir\artifacts" -$toolsDir = "$baseDir\tools" -$nunitexec = "packages\NUnit.2.5.10.11092\tools\nunit-console.exe" -$nugetExec = "$toolsDir\NuGet\NuGet.exe" -$zipExec = "$toolsDir\zip\7za.exe" -$ilMergeKey = "$srcDir\NServiceBus.snk" -$ilMergeExclude = "$toolsDir\IlMerge\ilmerge.exclude" -$script:ilmergeTargetFramework = "" -$script:msBuildTargetFramework = "" -$script:nunitTargetFramework = "/framework=4.0"; -$script:msBuild = "" -$script:isEnvironmentInitialized = $false -$script:releaseVersion = "" - -include $toolsDir\psake\buildutils.ps1 - -task default -depends ReleaseNServiceBus -description "Invokes ReleaseNServiceBus task" - -task Clean -description "Cleans the eviorment for the build" { - - if(Test-Path $buildBase){ - Delete-Directory $buildBase - } - - if(Test-Path $artifactsDir){ - Delete-Directory $artifactsDir - } - - if(Test-Path $binariesDir){ - Delete-Directory $binariesDir - } - - if(Test-Path $coreOnlyDir){ - Delete-Directory $coreOnlyDir - } -} - -task InitEnvironment -description "Initializes the environment for build" { - - if($script:isEnvironmentInitialized -ne $true){ - if ($TargetFramework -eq "net-4.0"){ - $netfxInstallroot = "" - $netfxInstallroot = Get-RegistryValue 'HKLM:\SOFTWARE\Microsoft\.NETFramework\' 'InstallRoot' - - $netfxCurrent = $netfxInstallroot + "v4.0.30319" - - $script:msBuild = $netfxCurrent + "\msbuild.exe" - - echo ".Net 4.0 build requested - $script:msBuild" - - $script:ilmergeTargetFramework = "/targetplatform:v4," + $netfxCurrent - - $ilMergeTargetFrameworkPath = (get-item 'Env:\ProgramFiles').value + '\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0' - if(test-path $ilMergeTargetFrameworkPath) { - $script:ilmergeTargetFramework = "/targetplatform:v4," + $ilMergeTargetFrameworkPath - } else { - $ilMergeTargetFrameworkPath = (get-item 'Env:\ProgramFiles(x86)').value + '\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0' - - if(test-path $ilMergeTargetFrameworkPath) { - $script:ilmergeTargetFramework = "/targetplatform:v4," + $ilMergeTargetFrameworkPath - } - } - - echo "ilmergeTargetFramework requested $script:ilmergeTargetFramework" - - $script:msBuildTargetFramework = "/p:TargetFrameworkVersion=v4.0 /ToolsVersion:4.0" - - $script:nunitTargetFramework = "/framework=4.0"; - - $script:isEnvironmentInitialized = $true - } - } - - if(-not (Test-Path $binariesDir)){ - Create-Directory $binariesDir - } - - if(-not (Test-Path $artifactsDir)){ - Create-Directory $artifactsDir - } -} - -task Init -depends Clean, InstallDependentPackages -description "Initializes the build" { - - echo "Creating build directory at the following path $buildBase" - Delete-Directory $buildBase - Create-Directory $buildBase - - $currentDirectory = Resolve-Path . - - echo "Current Directory: $currentDirectory" - } - -task CompileMain -depends InitEnvironment -description "Builds NServiceBus.dll and keeps the output in \binaries" { - - $solutions = dir "$srcDir\core\*.sln" - $solutions | % { - $solutionFile = $_.FullName - exec { &$script:msBuild $solutionFile /p:OutDir="$buildBase\nservicebus\" /p:Configuration=$buildConfiguration } - } - - $assemblies = @() - $assemblies += dir $buildBase\nservicebus\NServiceBus.dll - $assemblies += dir $buildBase\nservicebus\NServiceBus*.dll -Exclude NServiceBus.dll, **Tests.dll - - Ilmerge $ilMergeKey $outDir "NServiceBus" $assemblies "" "dll" $script:ilmergeTargetFramework "$buildBase\NServiceBusMergeLog.txt" $ilMergeExclude - - Copy-Item $outDir\NServiceBus.dll $binariesDir -Force; - Copy-Item $outDir\NServiceBus.pdb $binariesDir -Force; - Copy-Item $libDir\log4net.dll $binariesDir -Force; - -} - -task TestMain -depends CompileMain -description "Builds NServiceBus.dll, keeps the output in \binaries and unit tests the code responsible for NServiceBus.dll"{ - - if((Test-Path -Path $buildBase\test-reports) -eq $false){ - Create-Directory $buildBase\test-reports - } - $testAssemblies = @() - $testAssemblies += dir $buildBase\nservicebus\*Tests.dll -Exclude *FileShare.Tests.dll,*Gateway.Tests.dll, *Raven.Tests.dll, *Azure.Tests.dll - exec {&$nunitexec $testAssemblies $script:nunitTargetFramework} -} - -task CompileCore -depends InitEnvironment -description "Builds NServiceBus.Core.dll and keeps the output in \binaries" { - -$coreDirs = "unicastTransport", "ObjectBuilder", "config", "faults", "utils","setup","powershell", "messageInterfaces", "impl\messageInterfaces", "config", "logging", "Impl\ObjectBuilder.Common", "installation", "messagemutator", "encryption", "unitofwork", "impl\installation", "impl\unicast\NServiceBus.Unicast.Msmq", "impl\Serializers","forms", "impl\licensing", "unicast", "headers", "impersonation", "impl\unicast\transport", "impl\unicast\queuing", "impl\unicast\NServiceBus.Unicast.Subscriptions.Msmq", "impl\unicast\NServiceBus.Unicast.Subscriptions.InMemory", "impl\faults", "impl\encryption", "databus", "impl\Sagas", "impl\SagaPersisters\InMemory", "impl\SagaPersisters\RavenSagaPersister", "impl\unicast\NServiceBus.Unicast.Subscriptions.Raven", "integration", "impl\databus", "distributor", "gateway", "scheduling", "satellites", "management\retries", "timeout" - $coreDirs | % { - $solutionDir = Resolve-Path "$srcDir\$_" - cd $solutionDir - $solutions = dir "*.sln" - $solutions | % { - $solutionFile = $_.FullName - exec { &$script:msBuild $solutionFile /p:OutDir="$buildBase\nservicebus.core\" /p:Configuration=$buildConfiguration } - } - } - cd $baseDir - - $solutions = dir "$srcDir\AttributeAssemblies\*.sln" - $solutions | % { - $solutionFile = $_.FullName - exec { &$script:msBuild $solutionFile /p:OutDir="$buildBase\attributeAssemblies\" /p:Configuration=$buildConfiguration } - } - - $attributeAssembly = "$buildBase\attributeAssemblies\NServiceBus.Core.dll" - - $assemblies = dir $buildBase\nservicebus.core\NServiceBus.**.dll -Exclude **Tests.dll - Ilmerge $ilMergeKey $coreOnly "NServiceBus.Core" $assemblies $attributeAssembly "dll" $script:ilmergeTargetFramework "$buildBase\NServiceBusCoreCore-OnlyMergeLog.txt" $ilMergeExclude - - <#It's Possible to copy the NServiceBus.Core.dll to Core-Only but not done gain time on development build #> - - $assemblies += dir $buildBase\nservicebus.core\antlr3*.dll - $assemblies += dir $buildBase\nservicebus.core\common.logging.dll - $assemblies += dir $buildBase\nservicebus.core\common.logging.log4net.dll - $assemblies += dir $buildBase\nservicebus.core\Interop.MSMQ.dll - $assemblies += dir $buildBase\nservicebus.core\AutoFac.dll - $assemblies += dir $buildBase\nservicebus.core\NLog.dll - $assemblies += dir $buildBase\nservicebus.core\Raven.Abstractions.dll - $assemblies += dir $buildBase\nservicebus.core\Raven.Client.Lightweight.dll - $assemblies += dir $buildBase\nservicebus.core\Newtonsoft.Json.dll - - Ilmerge $ilMergeKey $outDir "NServiceBus.Core" $assemblies $attributeAssembly "dll" $script:ilmergeTargetFramework "$buildBase\NServiceBusCoreMergeLog.txt" $ilMergeExclude - - Copy-Item $outDir\NServiceBus.Core.dll $binariesDir -Force; - Copy-Item $outDir\NServiceBus.Core.pdb $binariesDir -Force; - -} - -task TestCore -depends CompileCore -description "Builds NServiceBus.Core.dll, keeps the output in \binaries and unit tests the code responsible for NServiceBus.Core.dll" { - - if((Test-Path -Path $buildBase\test-reports) -eq $false){ - Create-Directory $buildBase\test-reports - } - $testAssemblies = @() - $testAssemblies += dir $buildBase\nservicebus.core\*Tests.dll -Exclude *FileShare.Tests.dll,*Gateway.Tests.dll, *Raven.Tests.dll, *Azure.Tests.dll - exec {&$nunitexec $testAssemblies $script:nunitTargetFramework} -} - -task CompileContainers -depends InitEnvironment -description "Builds the container dlls for autofac, castle, ninject, spring, structuremap and MS unity and keeps the output in respective folders in binaries\containers" { - - $solutions = dir "$srcDir\impl\ObjectBuilder\*.sln" - $solutions | % { - $solutionFile = $_.FullName - exec { &$script:msBuild $solutionFile /p:OutDir="$buildBase\containers\" /p:Configuration=$buildConfiguration } - } - - if(Test-Path "$buildBase\output\containers"){ - Delete-Directory "$buildBase\output\containers" - } - Create-Directory "$buildBase\output\containers" - Copy-Item $buildBase\containers\NServiceBus.ObjectBuilder.**.* $buildBase\output\containers -Force - - if(Test-Path "$coreOnly\containers"){ - Delete-Directory "$coreOnly\containers" - } - - if(Test-Path "$binariesDir\containers"){ - Delete-Directory "$binariesDir\containers" - } - - Create-Directory "$binariesDir\containers\autofac" - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.Autofac.*" $binariesDir\containers\autofac -Force -Exclude *.pdb - - Create-Directory "$binariesDir\containers\castle" - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.CastleWindsor.*" $binariesDir\containers\castle -Force -Exclude *.pdb - - - Create-Directory "$binariesDir\containers\structuremap" - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.StructureMap.*" $binariesDir\containers\structuremap -Force -Exclude *.pdb - - - Create-Directory "$binariesDir\containers\spring" - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.Spring.*" $binariesDir\containers\spring -Force -Exclude *.pdb - - - Create-Directory "$binariesDir\containers\unity" - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.Unity.*" $binariesDir\containers\unity -Force -Exclude *.pdb - - - Create-Directory "$binariesDir\containers\ninject" - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.Ninject.*" $binariesDir\containers\ninject -Force -Exclude *.pdb - - -} - -task TestContainers -depends CompileContainers -description "Builds the container dlls for autofac, castle, ninject, spring, structuremap and MS unity, keeps the output in respective folders in binaries\containers and unit tests the code responsible for each container assemblies" { - - if((Test-Path -Path $buildBase\test-reports) -eq $false){ - Create-Directory $buildBase\test-reports - } - $testAssemblies = @() - $testAssemblies += dir $buildBase\containers\*Tests.dll -Exclude *FileShare.Tests.dll,*Gateway.Tests.dll, *Raven.Tests.dll, *Azure.Tests.dll - exec {&$nunitexec $testAssemblies $script:nunitTargetFramework} -} - -task CompileWebServicesIntegration -depends InitEnvironment -description "Builds NServiceBus.Integration.WebServices.dll and keeps the output in \binaries"{ - - $solutions = dir "$srcDir\integration\WebServices\*.sln" - $solutions | % { - $solutionFile = $_.FullName - exec { &$script:msBuild $solutionFile /p:OutDir="$outDir\" /p:Configuration=$buildConfiguration } - } - - Copy-Item $outDir\NServiceBus.Integration.*.* $binariesDir -Force; -} - -task CompileNHibernate -depends InitEnvironment -description "Builds NServiceBus.NHibernate.dll and keeps the output in \binaries" { - - $solutions = dir "$srcDir\nhibernate\*.sln" - $solutions | % { - $solutionFile = $_.FullName - exec { &$script:msBuild $solutionFile /p:OutDir="$buildBase\NServiceBus.NHibernate\" /p:Configuration=$buildConfiguration } - } - $assemblies = dir $buildBase\NServiceBus.NHibernate\NServiceBus.**NHibernate**.dll -Exclude **Tests.dll - Ilmerge $ilMergeKey $outDir "NServiceBus.NHibernate" $assemblies "" "dll" $script:ilmergeTargetFramework "$buildBase\NServiceBusNHibernateMergeLog.txt" $ilMergeExclude - - Copy-Item $outDir\NServiceBus.NHibernate.dll $binariesDir -Force; - Copy-Item $outDir\NServiceBus.NHibernate.pdb $binariesDir -Force; -} - -task TestNHibernate -depends CompileNHibernate -description "Builds NServiceBus.NHibernate.dll, keeps the output in \binaries and unit tests the code responsible for NServiceBus.NHibernate.dll" { - - if((Test-Path -Path $buildBase\test-reports) -eq $false){ - Create-Directory $buildBase\test-reports - } - $testAssemblies = @() - $testAssemblies += dir $buildBase\NServiceBus.NHibernate\**Tests.dll -Exclude *FileShare.Tests.dll,*Gateway.Tests.dll, *Raven.Tests.dll, *Azure.Tests.dll - exec {&$nunitexec $testAssemblies $script:nunitTargetFramework} -} - -task CompileAzure -depends InitEnvironment -description "Builds NServiceBus.Azure.dll and keeps the output in \binaries" { - - $solutions = dir "$srcDir\azure\*.sln" - $solutions | % { - $solutionFile = $_.FullName - exec { &$script:msBuild $solutionFile /p:OutDir="$buildBase\azure\NServiceBus.Azure\" /p:Configuration=$buildConfiguration } - } - $attributeAssembly = "$buildBase\attributeAssemblies\NServiceBus.Azure.dll" - $assemblies = dir $buildBase\azure\NServiceBus.Azure\NServiceBus.**Azure**.dll -Exclude **Tests.dll - $assemblies += dir $buildBase\azure\NServiceBus.Azure\NServiceBus.**AppFabric**.dll -Exclude **Tests.dll - - Ilmerge $ilMergeKey $outDir "NServiceBus.Azure" $assemblies $attributeAssembly "dll" $script:ilmergeTargetFramework "$buildBase\NServiceBusAzureMergeLog.txt" $ilMergeExclude - - Copy-Item $outDir\NServiceBus.Azure.dll $binariesDir -Force; - Copy-Item $outDir\NServiceBus.Azure.pdb $binariesDir -Force; - -} - -task TestAzure -depends CompileAzure -description "Builds NServiceBus.Azure.dll, keeps the output in \binaries and unit test the code responsible for NServiceBus.Azure.dll" { - - if((Test-Path -Path $buildBase\test-reports) -eq $false){ - Create-Directory $buildBase\test-reports - } - $testAssemblies = @() - $testAssemblies += dir $buildBase\azure\NServiceBus.Azure\**Tests.dll -Exclude *FileShare.Tests.dll,*Gateway.Tests.dll, *Raven.Tests.dll - exec {&$nunitexec $testAssemblies $script:nunitTargetFramework} -} - -task CompileHosts -depends InitEnvironment -description "Builds NServiceBus.Host.exe and keeps the output in \binaries" { - - if(Test-Path "$buildBase\hosting"){ - - Delete-Directory "$buildBase\hosting" - } - Create-Directory "$buildBase\hosting" - $solutions = dir "$srcDir\hosting\*.sln" - $solutions | % { - $solutionFile = $_.FullName - exec { &$script:msBuild $solutionFile /p:OutDir="$buildBase\hosting\" /p:Configuration=$buildConfiguration } - } - - $assemblies = @("$buildBase\hosting\NServiceBus.Hosting.Windows.exe", "$buildBase\hosting\NServiceBus.Hosting.dll", - "$buildBase\hosting\Microsoft.Practices.ServiceLocation.dll", "$buildBase\hosting\Magnum.dll", "$buildBase\hosting\Topshelf.dll") - - Ilmerge $ilMergeKey $outDir\host\ "NServiceBus.Host" $assemblies "" "exe" $script:ilmergeTargetFramework "$buildBase\NServiceBusHostMergeLog.txt" $ilMergeExclude - - Copy-Item $outDir\host\NServiceBus.Host.exe $binariesDir -Force; - Copy-Item $outDir\host\NServiceBus.Host.pdb $binariesDir -Force; -} - -task CompileHosts32 -depends InitEnvironment -description "Builds NServiceBus.Host32.exe and keeps the output in \binaries" { - $solutions = dir "$srcDir\hosting\*.sln" - $solutions | % { - $solutionFile = $_.FullName - - exec { &$script:msBuild $solutionFile /p:PlatformTarget=x86 /p:OutDir="$buildBase\hosting32\" /p:Configuration=$buildConfiguration /t:Clean } - - exec { &$script:msBuild $solutionFile /p:PlatformTarget=x86 /p:OutDir="$buildBase\hosting32\" /p:Configuration=$buildConfiguration} - } - - - $assemblies = @("$buildBase\hosting32\NServiceBus.Hosting.Windows.exe", "$buildBase\hosting32\NServiceBus.Hosting.dll", - "$buildBase\hosting32\Microsoft.Practices.ServiceLocation.dll", "$buildBase\hosting32\Magnum.dll", "$buildBase\hosting32\Topshelf.dll") - - Ilmerge $ilMergeKey $outDir\host\ "NServiceBus.Host32" $assemblies "" "exe" $script:ilmergeTargetFramework "$buildBase\NServiceBusHostMerge32Log.txt" $ilMergeExclude - - Copy-Item $outDir\host\NServiceBus.Host32.exe $binariesDir -Force; - Copy-Item $outDir\host\NServiceBus.Host32.pdb $binariesDir -Force; -} - -task CompileAzureHosts -depends InitEnvironment -description "Builds NServiceBus.Hosting.Azure.dll and NServiceBus.Hosting.Azure.HostProcess.exe and keeps the outputs in \binaries" { - - $solutions = dir "$srcDir\azure\Hosting\NServiceBus.Hosting.sln" - $solutions | % { - $solutionFile = $_.FullName - exec { &$script:msBuild $solutionFile /p:OutDir="$buildBase\azure\Hosting\" /p:Configuration=$buildConfiguration} - } - - $assemblies = @("$buildBase\azure\Hosting\NServiceBus.Hosting.Azure.dll", - "$buildBase\azure\Hosting\NServiceBus.Hosting.dll") - - Ilmerge $ilMergeKey $outDir "NServiceBus.Hosting.Azure" $assemblies "" "dll" $script:ilmergeTargetFramework "$buildBase\NServiceBusAzureHostMergeLog.txt" $ilMergeExclude - - Copy-Item $outDir\NServiceBus.Hosting.Azure.dll $binariesDir -Force; - Copy-Item $outDir\NServiceBus.Hosting.Azure.pdb $binariesDir -Force; - - $solutions = dir "$srcDir\azure\Timeout\Timeout.sln" - $solutions | % { - $solutionFile = $_.FullName - exec { &$script:msBuild $solutionFile /p:OutDir="$buildBase\azure\Timeout\" /p:Configuration=$buildConfiguration} - } - - echo "Copying NServiceBus.Timeout.Hosting.Azure....." - Copy-Item $buildBase\azure\Timeout\NServiceBus.Timeout.Hosting.Azure.* $buildBase\output -Force - - $solutions = dir "$srcDir\azure\Hosting\NServiceBus.Hosting.HostProcess.sln" - $solutions | % { - $solutionFile = $_.FullName - exec { &$script:msBuild $solutionFile /p:OutDir="$buildBase\azure\Hosting\" /p:Configuration=$buildConfiguration} - } - - $assemblies = @("$buildBase\azure\Hosting\NServiceBus.Hosting.Azure.HostProcess.exe", - "$buildBase\azure\Hosting\Magnum.dll", "$buildBase\azure\Hosting\Topshelf.dll") - - Ilmerge $ilMergeKey $outDir\host\ "NServiceBus.Hosting.Azure.HostProcess" $assemblies "" "exe" $script:ilmergeTargetFramework "$buildBase\NServiceBusAzureHostProcessMergeLog.txt" $ilMergeExclude - - Copy-Item $outDir\host\NServiceBus.Hosting.Azure.HostProcess.exe $binariesDir -Force; - Copy-Item $outDir\host\NServiceBus.Hosting.Azure.HostProcess.pdb $binariesDir -Force; -} - -task CompileTools -depends InitEnvironment -description "Builds the tools XsdGenerator.exe, runner.exe and ReturnToSourceQueue.exe." { - $toolsDirs = "testing", "claims", "timeout", "proxy", "tools\management\Errors\ReturnToSourceQueue\", "utils","tools\migration\", "tools\licenseinstaller\" - - $toolsDirs | % { - $solutions = dir "$srcDir\$_\*.sln" - $currentOutDir = "$buildBase\$_\" - $solutions | % { - $solutionFile = $_.FullName - exec { &$script:msBuild $solutionFile /p:OutDir="$currentOutDir" /p:Configuration=$buildConfiguration} - } - } - - if(Test-Path $buildBase\tools\MsmqUtils){ - Delete-Directory $buildBase\tools\MsmqUtils - } - - Create-Directory "$buildBase\tools\MsmqUtils" - Copy-Item $buildBase\utils\*.* $buildBase\tools\MsmqUtils -Force - Delete-Directory $buildBase\utils - Copy-Item $buildBase\tools\management\Errors\ReturnToSourceQueue\*.* $buildBase\tools\ -Force - - cd $buildBase\tools - Delete-Directory "management" - cd $baseDir - - Create-Directory $outDir\testing - Copy-Item $buildBase\testing\NServiceBus.Testing.dll $outDir\testing -Force; - Copy-Item $buildBase\testing\NServiceBus.Testing.pdb $outDir\testing -Force; - - Copy-Item $outDir\testing\*.* $binariesDir -Force; - - $assemblies = @("$buildBase\nservicebus.core\XsdGenerator.exe", - "$buildBase\nservicebus.core\NServiceBus.Serializers.XML.dll", - "$buildBase\nservicebus.core\NServiceBus.Utils.Reflection.dll") - - Ilmerge $ilMergeKey $buildBase\tools "XsdGenerator" $assemblies "" "exe" $script:ilmergeTargetFramework "$buildBase\XsdGeneratorMergeLog.txt" $ilMergeExclude -} - -task TestTools -depends CompileTools -description "Builds the tools XsdGenerator.exe, runner.exe and ReturnToSourceQueue.exe and unit tests the code responsible for the tools XsdGenerator.exe, runner.exe and ReturnToSourceQueue.exe " { - exec {&$nunitexec "$buildBase\testing\NServiceBus.Testing.Tests.dll" $script:nunitTargetFramework} -} - -task Test -depends TestMain, TestCore, TestContainers, TestNHibernate, TestTools <#, TestAzure #> -description "Builds and unit tests all the source which has unit tests" { -} - -task PrepareBinaries -depends Init, CompileMain, CompileCore, CompileContainers, CompileWebServicesIntegration, CompileNHibernate, CompileHosts, CompileHosts32, CompileAzure, CompileAzureHosts, CompileTools, Test -description "Builds all the source code in order, Runs thet unit tests and prepares the binaries and Core-only binaries" { - Prepare-Binaries -} - -task JustPrepareBinaries -depends Init, CompileMain, CompileCore, CompileContainers, CompileWebServicesIntegration, CompileNHibernate, CompileHosts, CompileHosts32, CompileAzure, CompileAzureHosts -description "Builds All the source code, just prepare the binaries without testing it" { -} - -function Prepare-Binaries{ - if(Test-Path $binariesDir){ - Delete-Directory "binaries" - } - - Create-Directory $binariesDir - - Create-Directory $coreOnlyDir - Create-Directory $coreOnlyBinariesDir - - Copy-Item $outDir\NServiceBus*.* $binariesDir -Force; - - Copy-Item $outDir\NServiceBus.dll $coreOnlyBinariesDir -Force; - Copy-Item $outDir\NServiceBus.NHibernate.dll $coreOnlyBinariesDir -Force; - Copy-Item $outDir\NServiceBus.Azure.dll $coreOnlyBinariesDir -Force; - Copy-Item $coreOnly\NServiceBus*.* $coreOnlyBinariesDir -Force; - - Copy-Item $outDir\host\*.* $binariesDir -Force; - Copy-Item $outDir\host\*.* $coreOnlyBinariesDir -Force; - - Copy-Item $outDir\testing\*.* $binariesDir -Force; - Copy-Item $outDir\testing\*.* $coreOnlyBinariesDir -Force; - - Copy-Item $libDir\log4net.dll $binariesDir -Force; - - - Create-Directory "$binariesDir\containers\autofac" - Create-Directory "$coreOnlyBinariesDir\containers\autofac" - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.Autofac.*" $binariesDir\containers\autofac -Force -Exclude *.pdb - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.Autofac.*" $coreOnlyBinariesDir\containers\autofac -Force -Exclude *.pdb - - Create-Directory "$binariesDir\containers\castle" - Create-Directory "$coreOnlyBinariesDir\containers\castle" - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.CastleWindsor.*" $binariesDir\containers\castle -Force -Exclude *.pdb - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.CastleWindsor.*" $coreOnlyBinariesDir\containers\castle -Force -Exclude *.pdb - - Create-Directory "$binariesDir\containers\structuremap" - Create-Directory "$coreOnlyBinariesDir\containers\structuremap" - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.StructureMap.*" $binariesDir\containers\structuremap -Force -Exclude *.pdb - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.StructureMap.*" $coreOnlyBinariesDir\containers\structuremap -Force -Exclude *.pdb - - Create-Directory "$binariesDir\containers\spring" - Create-Directory "$coreOnlyBinariesDir\containers\spring" - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.Spring.*" $binariesDir\containers\spring -Force -Exclude *.pdb - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.Spring.*" $coreOnlyBinariesDir\containers\spring -Force -Exclude *.pdb - - Create-Directory "$binariesDir\containers\unity" - Create-Directory "$coreOnlyBinariesDir\containers\unity" - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.Unity.*" $binariesDir\containers\unity -Force -Exclude *.pdb - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.Unity.*" $coreOnlyBinariesDir\containers\unity -Force -Exclude *.pdb - - Create-Directory "$binariesDir\containers\ninject" - Create-Directory "$coreOnlyBinariesDir\containers\ninject" - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.Ninject.*" $binariesDir\containers\ninject -Force -Exclude *.pdb - Copy-Item "$outDir\containers\NServiceBus.ObjectBuilder.Ninject.*" $coreOnlyBinariesDir\containers\ninject -Force -Exclude *.pdb - - Create-Directory $coreOnlyDir\dependencies\ - Copy-Item $buildBase\nservicebus.core\antlr3*.dll $coreOnlyDir\dependencies\ -Exclude **Tests.dll - Copy-Item $buildBase\nservicebus.core\common.logging.dll $coreOnlyDir\dependencies\ -Exclude **Tests.dll - Copy-Item $buildBase\nservicebus.core\common.logging.log4net.dll $coreOnlyDir\dependencies\ -Exclude **Tests.dll - Copy-Item $buildBase\nservicebus.core\Interop.MSMQ.dll $coreOnlyDir\dependencies\ -Exclude **Tests.dll - Copy-Item $buildBase\nservicebus.core\AutoFac.dll $coreOnlyDir\dependencies\ -Exclude **Tests.dll - Copy-Item $buildBase\nservicebus.core\Raven*.dll $coreOnlyDir\dependencies\ -Exclude **Tests.dll, Raven.Client.Debug.dll, Raven.Client.MvcIntegration.dll - Copy-Item $buildBase\nservicebus.core\NLog.dll $coreOnlyDir\dependencies\ -Exclude **Tests.dll - Copy-Item $buildBase\nservicebus.core\Newtonsoft.Json.dll $coreOnlyDir\dependencies\ -Exclude **Tests.dll - Copy-Item $buildBase\nservicebus.core\ICSharpCode.NRefactory.dll $coreOnlyDir\dependencies\ -Exclude **Tests.dll - Copy-Item $buildBase\nservicebus.core\Esent.Interop.dll $coreOnlyDir\dependencies\ -Exclude **Tests.dll - Copy-Item $buildBase\nservicebus.core\Lucene.Net.dll $coreOnlyDir\dependencies\ -Exclude **Tests.dll - Copy-Item $buildBase\nservicebus.core\Lucene.Net.Contrib.SpellChecker.dll $coreOnlyDir\dependencies\ -Exclude **Tests.dll - Copy-Item $buildBase\nservicebus.core\Lucene.Net.Contrib.Spatial.dll $coreOnlyDir\dependencies\ -Exclude **Tests.dll - Copy-Item $buildBase\nservicebus.core\BouncyCastle.Crypto.dll $coreOnlyDir\dependencies\ -Exclude **Tests.dll -} - -task CompileSamples -depends InitEnvironment -description "Compiles all the sample projects." { - $excludeFromBuild = @("AsyncPagesMVC3.sln", "AzureFullDuplex.sln", "AzureHost.sln", "AzurePubSub.sln", "AzureThumbnailCreator.sln", - "ServiceBusFullDuplex.sln", "AzureServiceBusPubSub.sln") - $solutions = ls -path $baseDir\Samples -include *.sln -recurse - $solutions | % { - $solutionName = [System.IO.Path]::GetFileName($_.FullName) - if([System.Array]::IndexOf($excludeFromBuild, $solutionName) -eq -1){ - $solutionFile = $_.FullName - exec {&$script:msBuild $solutionFile} - } - } - } - -task CompileSamplesFull -depends InitEnvironment, PrepareBinaries, CompileSamples -description "Compiles all the sample projects after compiling the full Sourc in order." {} - -task PrepareReleaseWithoutGeneratingAssemblyInfos -depends PrepareBinaries, CompileSamples -description "Compiles all the source code in order, runs the unit tests, prepare the binaries and Core-only binaries, compiles all the sample projects and prepares for the release artifacts" { - - if(Test-Path $releaseRoot){ - Delete-Directory $releaseRoot - } - - Create-Directory $releaseRoot - if ($TargetFramework -eq "net-4.0"){ - $releaseDir = "$releaseRoot\net40" - } - Create-Directory $releaseDir - - - Copy-Item -Force "$baseDir\*.txt" $releaseRoot -ErrorAction SilentlyContinue - Copy-Item -Force "$baseDir\*.txt" $coreOnlyDir -ErrorAction SilentlyContinue - Copy-Item -Force "$baseDir\RunMeFirst.bat" $releaseRoot -ErrorAction SilentlyContinue - Copy-Item -Force "$baseDir\RunMeFirst.ps1" $releaseRoot -ErrorAction SilentlyContinue - - Copy-Item -Force -Recurse "$buildBase\tools" $releaseRoot\tools -ErrorAction SilentlyContinue - - cd $releaseRoot\tools - dir -recurse -include ('*.xml', '*.pdb') |ForEach-Object { - write-host deleting $_ - Remove-Item $_ - } - cd $baseDir - - Copy-Item -Force -Recurse "$baseDir\docs" $releaseRoot\docs -ErrorAction SilentlyContinue - Copy-Item -Force -Recurse "$baseDir\docs" $coreOnlyDir\docs -ErrorAction SilentlyContinue - - Copy-Item -Force -Recurse "$baseDir\Samples" $releaseRoot\samples -ErrorAction SilentlyContinue - cd $releaseRoot\samples - - dir -recurse -include ('bin', 'obj', 'packages') |ForEach-Object { - write-host deleting $_ - Delete-Directory $_ - } - cd $baseDir - - Copy-Item -Force -Recurse "$baseDir\binaries" $releaseDir\binaries -ErrorAction SilentlyContinue -} - -task PrepareRelease -depends GenerateAssemblyInfo, PrepareReleaseWithoutGeneratingAssemblyInfos -description "Compiles all the source code in order, runs the unit tests, prepare the binaries and Core-only binaries, compiles all the sample projects and prepares for the release artifacts" - -task PrepareReleaseWithoutSamples -depends PrepareBinaries -description "Prepare release without compiling the sample projects" { - - if(Test-Path $releaseRoot){ - Delete-Directory $releaseRoot - } - - Create-Directory $releaseRoot - if ($TargetFramework -eq "net-4.0"){ - $releaseDir = "$releaseRoot\net40" - } - Create-Directory $releaseDir - - - Copy-Item -Force "$baseDir\*.txt" $releaseRoot -ErrorAction SilentlyContinue - Copy-Item -Force "$baseDir\RunMeFirst.bat" $releaseRoot -ErrorAction SilentlyContinue - Copy-Item -Force "$baseDir\RunMeFirst.ps1" $releaseRoot -ErrorAction SilentlyContinue - - Copy-Item -Force -Recurse "$buildBase\tools" $releaseRoot\tools -ErrorAction SilentlyContinue - - cd $releaseRoot\tools - dir -recurse -include ('*.xml', '*.pdb') |ForEach-Object { - write-host deleting $_ - Remove-Item $_ - } - cd $baseDir - - Copy-Item -Force -Recurse "$baseDir\docs" $releaseRoot\docs -ErrorAction SilentlyContinue - Copy-Item -Force -Recurse "$baseDir\binaries" $releaseDir\binaries -ErrorAction SilentlyContinue -} - -task GenerateAssemblyInfo -description "Generates assembly info for all the projects with version" { - - Write-Output "Build Number: $BuildNumber" - - $asmVersion = $ProductVersion + ".0.0" - - if($PreRelease -eq "") { - $fileVersion = $ProductVersion + "." + $PatchVersion + ".0" - $infoVersion = $ProductVersion + "." + $PatchVersion - } else { - $fileVersion = $ProductVersion + "." + $PatchVersion + "." + $BuildNumber - $infoVersion = $ProductVersion + "." + $PatchVersion + "-" + $PreRelease + $BuildNumber - } - - $script:releaseVersion = $infoVersion - - Write-Output "##teamcity[buildNumber '$script:releaseVersion']" - - $projectFiles = ls -path $srcDir -include *.csproj -recurse - $projectFiles += ls -path $baseDir\tests -include *.csproj -recurse - - foreach($projectFile in $projectFiles) { - - $projectDir = [System.IO.Path]::GetDirectoryName($projectFile) - $projectName = [System.IO.Path]::GetFileName($projectDir) - $asmInfo = [System.IO.Path]::Combine($projectDir, [System.IO.Path]::Combine("Properties", "AssemblyInfo.cs")) - - $assemblyTitle = gc $asmInfo | select-string -pattern "AssemblyTitle" - - if($assemblyTitle -ne $null){ - $assemblyTitle = $assemblyTitle.ToString() - if($assemblyTitle -ne ""){ - $assemblyTitle = $assemblyTitle.Replace('[assembly: AssemblyTitle("', '') - $assemblyTitle = $assemblyTitle.Replace('")]', '') - $assemblyTitle = $assemblyTitle.Trim() - - } - } - else{ - $assemblyTitle = "" - } - - $assemblyDescription = gc $asmInfo | select-string -pattern "AssemblyDescription" - if($assemblyDescription -ne $null){ - $assemblyDescription = $assemblyDescription.ToString() - if($assemblyDescription -ne ""){ - $assemblyDescription = $assemblyDescription.Replace('[assembly: AssemblyDescription("', '') - $assemblyDescription = $assemblyDescription.Replace('")]', '') - $assemblyDescription = $assemblyDescription.Trim() - } - } - else{ - $assemblyDescription = "" - } - - - $assemblyProduct = gc $asmInfo | select-string -pattern "AssemblyProduct" - - if($assemblyProduct -ne $null){ - $assemblyProduct = $assemblyProduct.ToString() - if($assemblyProduct -ne ""){ - $assemblyProduct = $assemblyProduct.Replace('[assembly: AssemblyProduct("', '') - $assemblyProduct = $assemblyProduct.Replace('")]', '') - $assemblyProduct = $assemblyProduct.Trim() - } - } - else{ - $assemblyProduct = "NServiceBus" - } - - $internalsVisibleTo = gc $asmInfo | select-string -pattern "InternalsVisibleTo" - - if($internalsVisibleTo -ne $null){ - $internalsVisibleTo = $internalsVisibleTo.ToString() - if($internalsVisibleTo -ne ""){ - $internalsVisibleTo = $internalsVisibleTo.Replace('[assembly: InternalsVisibleTo("', '') - $internalsVisibleTo = $internalsVisibleTo.Replace('")]', '') - $internalsVisibleTo = $internalsVisibleTo.Trim() - } - } - else{ - $assemblyProduct = "NServiceBus" - } - - $notclsCompliant = @("") - - $clsCompliant = (($projectDir.ToString().StartsWith("$srcDir")) -and ([System.Array]::IndexOf($notclsCompliant, $projectName) -eq -1)).ToString().ToLower() - - Generate-Assembly-Info $assemblyTitle ` - $assemblyDescription ` - $clsCompliant ` - $internalsVisibleTo ` - "release" ` - "NServiceBus" ` - $assemblyProduct ` - "Copyright (C) NServiceBus 2010-2012" ` - $asmVersion ` - $fileVersion ` - $infoVersion ` - $asmInfo - } -} - -task InstallDependentPackages -description "Installs dependent packages in the environment if required" { - - $packageNames = @{} - - dir -recurse -include ('packages.config') | ForEach-Object { - $packageconfig = [io.path]::Combine($_.directory,$_.name) - $packagexml = [xml] (gc $packageconfig) - - foreach ($pelem in $packagexml.packages.package) { - if ($pelem.id -eq $null) { continue } - - $packageNames["{0}-{1}" -f $pelem.id, $pelem.version] = $pelem - } - } - - $template = [xml] ("") - - $packageNames.GetEnumerator() | Sort-Object Name | % { $template.DocumentElement.AppendChild($template.ImportNode($_.Value, $true)) | Out-Null } - - $template.Save( (Join-Path (pwd) packages\packages.config) ) - exec { &$nugetExec install packages\packages.config -o packages } - rm packages\packages.config -} - -task ReleaseNServiceBus -depends PrepareRelease, CreatePackages, CreateMSI, ZipOutput -description "After preparing for Release creates the nuget packages, if UploadPackage is set to true then publishes the packages to Nuget gallery and compress and release artifacts " { - if(Test-Path -Path $releaseDir) - { - del -Path $releaseDir -Force -recurse - } - - Write-Output "Release completed for NServiceBus v$script:releaseVersion" - - Stop-Process -Name "nunit-agent.exe" -ErrorAction SilentlyContinue -Force - Stop-Process -Name "nunit-console.exe" -ErrorAction SilentlyContinue -Force -} - -task CreatePackages { - Invoke-psake .\Nuget.ps1 -properties @{PreRelease=$PreRelease;buildConfiguration=$buildConfiguration;PatchVersion=$PatchVersion;BuildNumber=$BuildNumber;ProductVersion=$ProductVersion;NugetKey=$NugetKey;UploadPackage=$UploadPackage} -} - -task ZipOutput -description "Ziping artifacts directory for releasing" { - $packagingArtifacts = "$releaseRoot\PackagingArtifacts" - - if(Test-Path -Path $packagingArtifacts ){ - del ($packagingArtifacts + '\*.zip') - } - Copy-Item -Force -Recurse $releaseDir\binaries "$releaseRoot\binaries" -ErrorAction SilentlyContinue - - Delete-Directory $releaseDir - - $archive = "$artifactsDir\NServiceBus.$script:releaseVersion.zip" - $archiveCoreOnly = "$artifactsDir\NServiceBusCore-Only.$script:releaseVersion.zip" - echo "Ziping artifacts directory for releasing" - exec { &$zipExec a -tzip $archive $releaseRoot\** } - exec { &$zipExec a -tzip $archiveCoreOnly $coreOnlyDir\** } -} - -task CreateMSI { - Invoke-psake .\MSI.ps1 -properties @{ProductVersion=$ProductVersion;PatchVersion=$PatchVersion} +properties { + $ProductVersion = "4.0" + $PatchVersion = "0" + $BuildNumber = if($env:BUILD_NUMBER -ne $null) { $env:BUILD_NUMBER } else { "0" } + $PreRelease = "alpha" + $TargetFramework = "net-4.0" + $buildConfiguration = "Debug" + $NugetKey = "" + $UploadPackage = $false +} + +$baseDir = Split-Path (Resolve-Path $MyInvocation.MyCommand.Path) +$releaseRoot = "$baseDir\Release" +$packageOutPutDir = "$baseDir\artifacts" +$toolsDir = "$baseDir\tools" +$srcDir = "$baseDir\src" +$binariesDir = "$baseDir\binaries" +$coreOnlyDir = "$baseDir\core-only" +$coreOnlyBinariesDir = "$coreOnlyDir\binaries" +$outDir = "$baseDir\build" +$outDir32 = "$baseDir\build32" +$buildBase = "$baseDir\build" +$libDir = "$baseDir\lib" +$artifactsDir = "$baseDir\artifacts" +$nunitexec = "$toolsDir\nunit\nunit-console.exe" +$zipExec = "$toolsDir\zip\7za.exe" +$ilMergeKey = "$srcDir\NServiceBus.snk" +$ilMergeExclude = "$toolsDir\IlMerge\ilmerge.exclude" +$script:ilmergeTargetFramework = "" +$script:msBuildTargetFramework = "" +$script:nunitTargetFramework = "/framework=4.0"; + +include $toolsDir\psake\buildutils.ps1 + +task default -depends PrepareBinaries + +task Quick -depends CopyBinaries + +task PrepareBinaries -depends RunTests, CopyBinaries + +task CreateRelease -depends GenerateAssemblyInfo, PrepareBinaries, CompileIntegrationProjects, CreateReleaseFolder, CreateMSI, ZipOutput, CreatePackages + +task Clean { + if(Test-Path $binariesDir){ + Delete-Directory $binariesDir + } + + if(Test-Path $artifactsDir){ + Delete-Directory $artifactsDir + } +} + +task Init { + + $netfxInstallroot ="" + $netfxInstallroot = Get-RegistryValue 'HKLM:\SOFTWARE\Microsoft\.NETFramework\' 'InstallRoot' + + $netfxCurrent = $netfxInstallroot + "v4.0.30319" + + $script:msBuild = $netfxCurrent + "\msbuild.exe" + + echo ".Net 4.0 build requested - $script:msBuild" + + $script:ilmergeTargetFramework = "/targetplatform:v4," + $netfxCurrent + + $ilMergeTargetFrameworkPath = (get-item 'Env:\ProgramFiles').value + '\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0' + if(test-path $ilMergeTargetFrameworkPath) { + $script:ilmergeTargetFramework = '/targetplatform:v4,' + $ilMergeTargetFrameworkPath + } else { + $ilMergeTargetFrameworkPath = (get-item 'Env:\ProgramFiles(x86)').value + '\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0' + + if(test-path $ilMergeTargetFrameworkPath) { + $script:ilmergeTargetFramework = '/targetplatform:v4,' + $ilMergeTargetFrameworkPath + } + } + + $script:msBuildTargetFramework ="/p:TargetFrameworkVersion=v4.0 /ToolsVersion:4.0" + + $script:nunitTargetFramework = "/framework=4.0"; + + Set-Item -path env:COMPLUS_Version -value "v4.0.30319" + + if(-not (Test-Path $binariesDir)){ + Create-Directory $binariesDir + } + + if(-not (Test-Path $artifactsDir)){ + Create-Directory $artifactsDir + } +} + +task GenerateAssemblyInfo -description "Generates assembly info for all the projects with version" { + + Write-Output "Build Number: $BuildNumber" + + $filesThatNeedUpdate = ls -path $srcDir -include NServiceBusVersion.cs -recurse + $filesThatNeedUpdate | % { + (Get-Content $_.FullName) | + Foreach-Object { + $_ -replace "public const string Version = ""[\d\.]*"";", "public const string Version = ""$ProductVersion.$PatchVersion"";" + } | + Set-Content $_.FullName + } + + $projectFiles = ls -path $srcDir -include *.csproj -recurse + $v1Projects = @("NServiceBus.Transports.ActiveMQ.csproj", "NServiceBus.Transports.RabbitMQ.csproj", "NServiceBus.Transports.SQLServer.csproj", "NServiceBus.Notifications.csproj") + + foreach($projectFile in $projectFiles) { + + $projectDir = [System.IO.Path]::GetDirectoryName($projectFile) + $projectName = [System.IO.Path]::GetFileName($projectDir) + $asmInfo = [System.IO.Path]::Combine($projectDir, [System.IO.Path]::Combine("Properties", "AssemblyInfo.cs")) + $assemblyTitle = gc $asmInfo | select-string -pattern "AssemblyTitle" + + if($assemblyTitle -ne $null){ + $assemblyTitle = $assemblyTitle.ToString() + if($assemblyTitle -ne ""){ + $assemblyTitle = $assemblyTitle.Replace('[assembly: AssemblyTitle("', '') + $assemblyTitle = $assemblyTitle.Replace('")]', '') + $assemblyTitle = $assemblyTitle.Trim() + + } + } + else{ + $assemblyTitle = "" + } + + $projectFileName = [System.IO.Path]::GetFileName($projectFile) + Write-Output "Project Name: $projectFileName" + + if([System.Array]::IndexOf($v1Projects, $projectFileName) -eq -1){ + $asmVersion = $ProductVersion + ".0.0" + + if($PreRelease -eq "") { + $fileVersion = $ProductVersion + "." + $PatchVersion + ".0" + $infoVersion = $ProductVersion + "." + $PatchVersion + } else { + $fileVersion = $ProductVersion + "." + $PatchVersion + "." + $BuildNumber + $infoVersion = $ProductVersion + "." + $PatchVersion + "-" + $PreRelease + $BuildNumber + } + } else { + $asmVersion = "1.0.0.0" + + if($PreRelease -eq "") { + $fileVersion = "1.0.0.0" + $infoVersion = "1.0.0" + } else { + $fileVersion = "1.0.0." + $BuildNumber + $infoVersion = "1.0.0." + "-" + $PreRelease + $BuildNumber + } + } + + $assemblyDescription = gc $asmInfo | select-string -pattern "AssemblyDescription" + if($assemblyDescription -ne $null){ + $assemblyDescription = $assemblyDescription.ToString() + if($assemblyDescription -ne ""){ + $assemblyDescription = $assemblyDescription.Replace('[assembly: AssemblyDescription("', '') + $assemblyDescription = $assemblyDescription.Replace('")]', '') + $assemblyDescription = $assemblyDescription.Trim() + } + } + else{ + $assemblyDescription = "" + } + + $assemblyProduct = gc $asmInfo | select-string -pattern "AssemblyProduct" + + if($assemblyProduct -ne $null){ + $assemblyProduct = $assemblyProduct.ToString() + if($assemblyProduct -ne ""){ + $assemblyProduct = $assemblyProduct.Replace('[assembly: AssemblyProduct("', '') + $assemblyProduct = $assemblyProduct.Replace('")]', '') + $assemblyProduct = $assemblyProduct.Trim() + } + } + else{ + $assemblyProduct = "NServiceBus" + } + + $notclsCompliant = @("") + + $clsCompliant = (($projectDir.ToString().StartsWith("$srcDir")) -and ([System.Array]::IndexOf($notclsCompliant, $projectName) -eq -1)).ToString().ToLower() + + Generate-Assembly-Info $assemblyTitle ` + $assemblyDescription ` + $clsCompliant ` + "" ` + "release" ` + "NServiceBus Ltd." ` + $assemblyProduct ` + "Copyright 2010-2013 NServiceBus. All rights reserved" ` + $asmVersion ` + $fileVersion ` + $infoVersion ` + $asmInfo + } +} + +task CopyBinaries -depends Merge { + + Copy-Item $outDir\about_NServiceBus.help.txt $binariesDir -Force + Copy-Item $outDir\log4net.* $binariesDir -Force -Exclude **.Tests.* + Copy-Item $outDir\NServiceBus.??? $binariesDir -Force -Exclude **.Tests.* + Copy-Item $outDir\NServiceBus.PowerShell.??? $binariesDir -Force -Exclude **.Tests.* + Copy-Item $outDir\NServiceBus.Azure.* $binariesDir -Force -Exclude **.Tests.* + Copy-Item $outDir\NServiceBus.Transports.ActiveMQ.* $binariesDir -Force -Exclude **.Tests.* + Copy-Item $outDir\NServiceBus.Transports.RabbitMQ.* $binariesDir -Force -Exclude **.Tests.* + Copy-Item $outDir\NServiceBus.Transports.SqlServer.* $binariesDir -Force -Exclude **.Tests.* + Copy-Item $outDir\NServiceBus.Hosting.Azure.??? $binariesDir -Force -Exclude **.Tests.*, *.config + Copy-Item $outDir\NServiceBus.NHibernate.* $binariesDir -Force -Exclude **.Tests.* + Copy-Item $outDir\NServiceBus.Testing.* $binariesDir -Force -Exclude **.Tests.* + Copy-Item $outDir\NServiceBus.Notifications.* $binariesDir -Force -Exclude **.Tests.* + Copy-Item $outDir\NServiceBus.Timeout.Hosting.Azure.* $binariesDir -Force -Exclude **.Tests.* + + Create-Directory "$binariesDir\containers\autofac" + Copy-Item "$outDir\NServiceBus.ObjectBuilder.Autofac.*" $binariesDir\containers\autofac -Force -Exclude **.Tests.* + + Create-Directory "$binariesDir\containers\castle" + Copy-Item "$outDir\NServiceBus.ObjectBuilder.CastleWindsor.*" $binariesDir\containers\castle -Force -Exclude **.Tests.* + + Create-Directory "$binariesDir\containers\structuremap" + Copy-Item "$outDir\NServiceBus.ObjectBuilder.StructureMap.*" $binariesDir\containers\structuremap -Force -Exclude **.Tests.* + + Create-Directory "$binariesDir\containers\spring" + Copy-Item "$outDir\NServiceBus.ObjectBuilder.Spring.*" $binariesDir\containers\spring -Force -Exclude **.Tests.* + + Create-Directory "$binariesDir\containers\unity" + Copy-Item "$outDir\NServiceBus.ObjectBuilder.Unity.*" $binariesDir\containers\unity -Force -Exclude **.Tests.* + + Create-Directory "$binariesDir\containers\ninject" + Copy-Item "$outDir\NServiceBus.ObjectBuilder.Ninject.*" $binariesDir\containers\ninject -Force -Exclude **.Tests.* +} + +task CreateReleaseFolder { + + Delete-Directory $releaseRoot + Create-Directory $releaseRoot + + Copy-Item $binariesDir $releaseRoot -Force -Recurse + + Copy-Item "$baseDir\acknowledgements.txt" $releaseRoot -Force -ErrorAction SilentlyContinue + Copy-Item "$baseDir\README.md" $releaseRoot -Force -ErrorAction SilentlyContinue + Copy-Item "$baseDir\LICENSE.md" $releaseRoot -Force -ErrorAction SilentlyContinue + Copy-Item "$baseDir\RunMeFirst.bat" $releaseRoot -Force -ErrorAction SilentlyContinue + + Create-Directory $releaseRoot\tools\licenseinstaller + Copy-Item "$outDir\LicenseInstaller.exe" -Destination $releaseRoot\tools\licenseinstaller -Force -ErrorAction SilentlyContinue + + Copy-Item "$binariesDir\NServiceBus.Core.dll" -Destination $releaseRoot\tools -Force -ErrorAction SilentlyContinue + Copy-Item "$binariesDir\NServiceBus.dll" -Destination $releaseRoot\tools -Force -ErrorAction SilentlyContinue + Copy-Item "$outDir\ReturnToSourceQueue.exe" -Destination $releaseRoot\tools -Force -ErrorAction SilentlyContinue + Copy-Item "$outDir\XsdGenerator.exe" -Destination $releaseRoot\tools -Force -ErrorAction SilentlyContinue + + Copy-Item -Force -Recurse "$baseDir\samples" $releaseRoot -ErrorAction SilentlyContinue + dir "$releaseRoot\samples" -recurse -include ('bin', 'obj', 'packages') | ForEach-Object { + write-host deleting $_ + Delete-Directory $_ + } +} + +task Build -depends Clean, Init { + exec { &$script:msBuild $baseDir\NServiceBus.sln /t:"Clean,Build" /p:Platform="Any CPU" /p:Configuration=Release /p:OutDir="$outDir\" /m /nodeReuse:false } + exec { &$script:msBuild $baseDir\NServiceBus.sln /t:"Clean,Build" /p:Platform="x86" /p:Configuration=Release /p:OutDir="$outDir32\" /m /nodeReuse:false} + + del $binariesDir\*.xml -Recurse +} + +task RunTests -depends Build { + + if((Test-Path -Path $buildBase\test-reports) -eq $false){ + Create-Directory $buildBase\test-reports + } + + $testAssemblies = @() + $testAssemblies += dir $buildBase\*Tests.dll + exec {&$nunitexec $testAssemblies $script:nunitTargetFramework /stoponerror /exclude="Azure,Integration"} +} + +task Merge -depends Build { + + $assemblies = @() + $assemblies += dir $outDir\NServiceBus.Core.dll + $assemblies += dir $outDir\log4net.dll + $assemblies += dir $outDir\Interop.MSMQ.dll + $assemblies += dir $outDir\AutoFac.dll + $assemblies += dir $outDir\Autofac.Configuration.dll + $assemblies += dir $outDir\Newtonsoft.Json.dll + + Ilmerge $ilMergeKey $binariesDir "NServiceBus.Core.dll" $assemblies "library" $script:ilmergeTargetFramework $ilMergeExclude + + $assemblies = @() + $assemblies += dir $outDir\NServiceBus.Host.exe + $assemblies += dir $outDir\log4net.dll + $assemblies += dir $outDir\Topshelf.dll + $assemblies += dir $outDir\Microsoft.Practices.ServiceLocation.dll + + Ilmerge $ilMergeKey $binariesDir "NServiceBus.Host.exe" $assemblies "exe" $script:ilmergeTargetFramework $ilMergeExclude + + $assemblies = @() + $assemblies += dir $outDir32\NServiceBus.Host.exe + $assemblies += dir $outDir32\log4net.dll + $assemblies += dir $outDir32\Topshelf.dll + $assemblies += dir $outDir32\Microsoft.Practices.ServiceLocation.dll + + Ilmerge $ilMergeKey $binariesDir "NServiceBus.Host32.exe" $assemblies "exe" $script:ilmergeTargetFramework $ilMergeExclude + + $assemblies = @() + $assemblies += dir $outDir\NServiceBus.Hosting.Azure.HostProcess.exe + $assemblies += dir $outDir\log4net.dll + $assemblies += dir $outDir\Topshelf.dll + $assemblies += dir $outDir\Microsoft.Practices.ServiceLocation.dll + + Ilmerge $ilMergeKey $binariesDir "NServiceBus.Hosting.Azure.HostProcess.exe" $assemblies "exe" $script:ilmergeTargetFramework $ilMergeExclude +} + +task CompileSamples { + $excludeFromBuild = @("AsyncPagesMVC3.sln", "AzureFullDuplex.sln", "AzureHost.sln", "AzurePubSub.sln", "AzureThumbnailCreator.sln", + "ServiceBusFullDuplex.sln", "AzureServiceBusPubSub.sln", "ServiceBusPubSub.sln") + $solutions = ls -path $baseDir\Samples -include *.sln -recurse + $solutions | % { + $solutionName = [System.IO.Path]::GetFileName($_.FullName) + if([System.Array]::IndexOf($excludeFromBuild, $solutionName) -eq -1){ + $solutionFile = $_.FullName + exec { &$script:msBuild $solutionFile /t:"Clean,Build" /m /nodeReuse:false } + } + } +} + +task CompileIntegrationProjects -depends CompileSamples { + $excludeFromBuild = @("AsyncPagesMVC3.sln", "AzureFullDuplex.sln", "AzureHost.sln", "AzurePubSub.sln", "AzureThumbnailCreator.sln", + "ServiceBusFullDuplex.sln", "AzureServiceBusPubSub.sln", "ServiceBusPubSub.sln") + $solutions = ls -path $baseDir\IntegrationTests -include *.sln -recurse + $solutions | % { + $solutionName = [System.IO.Path]::GetFileName($_.FullName) + if([System.Array]::IndexOf($excludeFromBuild, $solutionName) -eq -1){ + $solutionFile = $_.FullName + exec { &$script:msBuild $solutionFile /t:"Clean,Build" /m /nodeReuse:false } + } + } +} + +task CreatePackages { + Invoke-psake .\Nuget.ps1 -properties @{PreRelease=$PreRelease;buildConfiguration=$buildConfiguration;PatchVersion=$PatchVersion;BuildNumber=$BuildNumber;ProductVersion=$ProductVersion;NugetKey=$NugetKey;UploadPackage=$UploadPackage} +} + +task ZipOutput { + + if($PreRelease -eq "") { + $archive = "$artifactsDir\NServiceBus.$ProductVersion.$PatchVersion.zip" + } else { + $archive = "$artifactsDir\NServiceBus.$ProductVersion.$PatchVersion-$PreRelease$BuildNumber.zip" + } + + echo "Ziping artifacts directory for releasing" + exec { &$zipExec a -tzip $archive $releaseRoot\** } +} + +task CreateMSI { + Invoke-psake .\Setup.ps1 -properties @{PreRelease=$PreRelease;BuildNumber=$BuildNumber;ProductVersion=$ProductVersion;PatchVersion=$PatchVersion} + #Invoke-psake .\MSI.ps1 -properties @{PreRelease=$PreRelease;BuildNumber=$BuildNumber;ProductVersion=$ProductVersion;PatchVersion=$PatchVersion} } \ No newline at end of file diff --git a/lib/Apache.NMS-CustomBuild/Apache.NMS.ActiveMQ.dll b/lib/Apache.NMS-CustomBuild/Apache.NMS.ActiveMQ.dll new file mode 100644 index 00000000000..cab5ee4f457 Binary files /dev/null and b/lib/Apache.NMS-CustomBuild/Apache.NMS.ActiveMQ.dll differ diff --git a/lib/Apache.NMS-CustomBuild/Apache.NMS.ActiveMQ.pdb b/lib/Apache.NMS-CustomBuild/Apache.NMS.ActiveMQ.pdb new file mode 100644 index 00000000000..2941455db76 Binary files /dev/null and b/lib/Apache.NMS-CustomBuild/Apache.NMS.ActiveMQ.pdb differ diff --git a/lib/Azure/Microsoft.ServiceBus.dll b/lib/Azure/Microsoft.ServiceBus.dll index 9fb73ecce3c..58db86c81f3 100644 Binary files a/lib/Azure/Microsoft.ServiceBus.dll and b/lib/Azure/Microsoft.ServiceBus.dll differ diff --git a/lib/Azure/Microsoft.ServiceBus.xml b/lib/Azure/Microsoft.ServiceBus.xml index 9485791ee14..ae60c76d206 100644 --- a/lib/Azure/Microsoft.ServiceBus.xml +++ b/lib/Azure/Microsoft.ServiceBus.xml @@ -23,11 +23,7 @@ Gets or sets the error code that describes the cause of authorization attempt failure. One of the values of the enumeration. - - Populates the with information about the exception. - The object that holds the serialized data about the exception being thrown. - The contextual information about the source or destination. - + Enumerates the possible causes of failure during authorization attempts. @@ -49,20 +45,20 @@ Specifies that the token has expired. - - Specifies whether Authorization is required for sending messages to a queue or router, receiving messages from a queue or router (via a listener, a push-subscription, or the dequeue endpoint), or neither, or both. + + Specifies that the claim is invalid. - - Authorization is not required to send or receive messages from the queue or router. + + Specifies that the audience is missing. - - Authorization is required to send to the queue or router, but not to receive from it. + + Specifies that the ‘expires on’ date is missing. - - Authorization is required to receive from the queue or router, but not to send to it. + + Specifies that the issuer is missing. - - (Default) Authorization is required to send to and receive from the queue or router. + + Specifies that the signature is missing. Represents a binding that a client can use to configure endpoints that can communicate with ASMX-based Web services and other services that conform to the WS-I Basic Profile 1.1. @@ -165,7 +161,7 @@ The value is not a legal value for . - Gets or sets the type of authentication used by the Service Bus service. + Gets or sets the type of authentication used by the Windows Azure Service Bus service. Returns a that contains the type of authentication used by the service. @@ -173,7 +169,7 @@ Returns a that contains the security settings. - An endpoint behavior that provides access to the connection status of service listening on the Service Bus. + An endpoint behavior that provides access to the connection status of service listening on the Windows Azure Service Bus. Initializes a new instance of the class. @@ -221,16 +217,16 @@ Describes the connectivity mode. - HTTP mode. Listeners create an HTTP connection with the Service Bus service and poll for messages. This might allow you to more easily work around TCP port constraints. + HTTP mode. Listeners attempt an HTTP connection followed by an HTTPS connection with the Windows Azure Service Bus service and poll for messages. This might allow you to more easily work around TCP port constraints. - TCP mode (default). Listeners create TCP connections with the Service Bus service through port 828 (SSL). + TCP mode (default). Listeners create TCP connections with the Windows Azure Service Bus service through port 828 (SSL). - Auto-detect mode. Automatically selects between the TCP and HTTP modes based on an auto-detection mechanism that probes whether either connectivity option is available for the current network environment. If both are available, the system will choose TCP by default. + Auto-detect mode. Automatically selects between the TCP, HTTP and HTTPS modes based on an auto-detection mechanism that probes whether either connectivity option is available for the current network environment. If both are available, the system will choose TCP by default. - Holds the connectivity settings effective for all Service Bus-based endpoints that are active in the current application domain. + Holds the connectivity settings effective for all Windows Azure Service Bus-based endpoints that are active in the current application domain. Initializes a new instance of the class. @@ -246,21 +242,6 @@ Gets or sets the connectivity mode for the current application domain. Returns .Contains the connectivity mode. - - An enumeration used to specify whether and under what circumstances a message buffer is discoverable in the service registry. - - - The message buffer is publicly discoverable. - - - (Default) The message buffer is discoverable to Managers. - - - The message buffer is discoverable to Managers and Listeners. - - - The message buffer is discoverable to Managers, Listeners, and Senders. - Describes the publishing behavior of a service in the Service Registry. @@ -286,7 +267,7 @@ Integrity, confidentiality and server authentication are provided by HTTPS. The service must be configured with a certificate. Client authentication is provided by means of SOAP message security. This mode is applicable when the user is authenticating with a UserName or Certificate credential and there is an existing HTTPS deployment for securing message transfer. - Determines the security settings for an Service Bus binding and describes the security relationship between the client and the service endpoint. + Determines the security settings for an Windows Azure Service Bus binding and describes the security relationship between the client and the service endpoint. Security is disabled. @@ -316,7 +297,7 @@ A parse error encountered while processing a request. - The generic that is not authorized. + A generic unauthorized error. The service bus has no transport security. @@ -336,8 +317,20 @@ The token had expired. + + The audience is not found. + + + The expiry date not found. + + + The issuer cannot be found. + + + The signature cannot be found. + - The generic is forbidden. + A generic forbidden error. The endpoint is not found. @@ -352,16 +345,19 @@ The store lock is lost. - The SQL filters exceeded from its maximum number. + The SQL filters exceeded its allowable maximum number. - The correlation filters exceeded from its maximum number. + The correlation filters exceeded its allowable maximum number. - The subscriptions exceeded from its maximum number. + The subscriptions exceeded its allowable maximum number. + + + A conflict during updating occurred. - The generic is a conflict. + A generic conflict error. An internal error that is not specified. @@ -388,7 +384,7 @@ The detail of an unknown exception. - Represents the binding element used to specify an HTTP transport for transmitting messages on the Service Bus. + Represents the binding element used to specify an HTTP transport for transmitting messages on the Windows Azure Service Bus. Initializes a new instance of the class. @@ -547,10 +543,10 @@ Describes the current connection state for a hybrid connection. - A relayed connection. The communicating parties connect through a relayed socket and the Service Bus infrastructure. + A relayed connection. The communicating parties connect through a relayed socket and the Windows Azure Service Bus infrastructure. - A direct connection. The communicating parties connect using a socket routed on the most direct network path, rather than through the Service Bus infrastructure. + A direct connection. The communicating parties connect using a socket routed on the most direct network path, rather than through the Windows Azure Service Bus infrastructure. Represents the arguments to the hybrid connection state change. @@ -571,7 +567,7 @@ Gets a value that determines whether the connection is online. - true if the connection is alive and online; false if there is no connectivity towards the Service Bus from the current network location. + true if the connection is alive and online; false if there is no connectivity towards the Windows Azure Service Bus from the current network location. Retrieves the last error encountered when trying to reestablish the connection from the offline state. @@ -613,140 +609,6 @@ The error message that explains the reason for the exception. The exception that is the cause of the current exception, or null if no inner exception is specified. - - The message buffer client enables the management and use of an Service Bus message buffer. - - - Creates a new message buffer on the Service Bus, using the specified credentials, URI, and policy. - Returns a that contains the message buffer client that will interact with the message buffer. - The credentials to use to access the message buffer. - The URI for the message buffer. - The policies to apply to the message buffer. - - - Creates a new message buffer on the Service Bus, using the specified credentials, URI, policy, and message version. - Returns a that contains the message buffer client that will interact with the message buffer. - The credentials to use to access the message buffer. - The URI for the message buffer. - The policies to apply to the message buffer. - The version of the messages allowed to be sent to the message buffer. - - - Deletes the specified locked message from the message buffer. - The locked message to delete. - - - Deletes the message buffer associated with this client. - - - Retrieves a message buffer client, based on the specified credentials and URI. - Returns a that is associated with the specified message buffer. - The credentials to access the message buffer. - The URI that identifies the message buffer. - - - Retrieves a message buffer from the specified URI, using the specified credentials and message version. - Returns a that is associated with the specified message buffer. - The credentials to access the message buffer. - The URI on which the message buffer is exposed. - The message version of the message buffer to retrieve. - - - Retrieves the policy of the message buffer with which the current instance is associated. - Returns a that contains the message buffer policy. - - - Retrieves the URI for the message buffer. - Returns a that contains the message buffer URI. - - - Retrieves the first available message from the message buffer, and locks that message on the buffer. - Returns a instance containing the message. - - - Retrieves the first message from the message buffer and locks the message on the buffer for the default lock duration of two minutes. - Returns a that contains the message from the buffer. - The length of time to wait for the call to return. The default is one minute, which is the maximum supported timeout interval. - - - Retrieves a copy of the first message from the message buffer, while locking the original message in the buffer, using the specified timeout and lock duration. - Returns a that contains a copy of the first message in the message buffer. - The length of time to wait for the method to return. The default is one minute, which is the maximum supported timeout interval. - The time to keep the original message locked on the message buffer; the default is two minutes. The maximum supported lock duration is 5 minutes and the minimum is 10 seconds. - - - Releases the lock on the specified message in the message buffer. - The message to unlock. - - - Releases the lock on the message contained at the specified URI. - The lock URI of the message buffer. - - - Retrieves the first message from the message buffer. - Returns a that contains the message. - - - Retrieves the first message from the message buffer, using the specified timeout. - Returns a that contains the message. - The length of time to wait for the method to return. The default is one minute, which is the maximum supported timeout value. - - - Sends the specified message to the message buffer. - The message to send. - - - Sends the specified message, using the specified timeout. - The message to send. - The length of time to wait for the method to finish before returning a failure. - - - The policy to set on an Service Bus message buffer endpoint. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class, using the specified message buffer as a copy. - The policy to base the current instance on. - - - Gets or sets the authorization policy for the message buffer. - Returns a that contains the authorization policy. - - - Gets or sets the discoverability policy for the message buffer. - Returns a that contains the discoverability policy. - - - Returns a value that indicates whether the specified object has the same properties as this message buffer policy. - true if the specified object has the same properties as this message buffer policy; otherwise, false. - The object to compare the properties of with this message buffer policy. Should be castable to . - - - Gets or sets the duration after which the message buffer expires. - Returns a that contains the duration after which the message buffer expires. The default is 5 minutes. - - - Serves as a hash function for a particular type. - The hash code for the current object. - - - Gets or sets the maximum message count. - Returns the maximum message count. The default is 10 messages. - - - Gets or sets the overflow policy. - Returns a that contains the overflow policy. - - - Gets or sets the structure that contains extra data. - Returns that contains data that is not recognized as belonging to the data contract. - - - Gets or sets the transport protection policy. - Returns a that contains the transport protection policy. The default is . - Describes the message security on a relay connection for a binding. @@ -778,7 +640,7 @@ Returns true if service credential is obtained through a process of negotiation; otherwise, false. The default is true. - The message security on a one-way connection over the Service Bus relay. + The message security on a one-way connection over the Windows Azure Service Bus relay. Gets or sets the algorithm suite to be used for securing messages at the SOAP level. @@ -793,6 +655,38 @@ An anchor class used in managing entities, such as queues, topics, subscriptions, and rules, in your service namespace. You must provide service namespace address and access credentials in order to manage your service namespace. + + Initializes a new instance of the class with the given addresses. + The full addresses of the service namespace. + + + Initializes a new instance of the class with the given addresses and settings. + The full addresses of the service namespace. + A object, which contains the and properties. + + + Initializes a new instance of the class with the given addresses and token provider. + The full addresses of the service namespace. + The security token provider. + + + Initializes a new instance of the class with the given service namespace URI base addresses. + The full URI addresses of the service namespace. + + + Initializes a new instance of the class with the given service namespace URI base addresses and settings. + The full URI addresses of the service namespace. + A object, which contains the and properties. + + + Initializes a new instance of the class with the given service namespace URI base addresses and token provider. + The full URI addresses of the service namespace. + The security token provider. + + + Initializes a new instance of the class with the given service namespace address. + The full address of the service namespace. + Initializes a new instance of the class with the given service namespace base address and object. The full address of the service namespace. @@ -811,6 +705,10 @@ or is null. + + Initializes a new instance of the class with the given service namespace URI base address. + The full URI address of the service namespace. + Initializes a new instance of the class with the given service namespace URI base address and object. The full URI address of the service namespace. @@ -985,6 +883,13 @@ The object does not have sufficient permission to perform this operation. You should check to ensure that your has the correct credentials to perform this operation. An internal error or unexpected exception occurs. + + Asynchronous version of method. + An that references the asynchronous operation to get a queue collection. + The sting used to filter the queues. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. This object is passed to the delegate when the operation is complete. + Asynchronous version of method. An that references the asynchronous operation to get all rules in the service namespace. @@ -993,6 +898,15 @@ An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. This object is passed to the delegate when the operation is complete. + + Asynchronous version of method. + An that references the asynchronous operation to get all rules in the service namespace. + The path of the topic relative to the service namespace base address. + The name of the subscription. + The string used to filter the rules. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. This object is passed to the delegate when the operation is complete. + Asynchronous version of method. An that references the asynchronous operation to get a subscription. @@ -1008,6 +922,14 @@ An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. This object is passed to the delegate when the operation is complete. + + Asynchronous version of . + An that references the asynchronous operation to get all subscriptions in the service namespace. + The path of the topic relative to the service namespace base address. + The string used to filter the subscriptions. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. This object is passed to the delegate when the operation is complete. + Asynchronous version of method. An object that references the asynchronous operation to get a topic. @@ -1029,6 +951,19 @@ The object does not have sufficient permission to perform this operation. You should check to ensure that your has the correct credentials to perform this operation. An internal error or unexpected exception occurs. + + Asynchronous version of method. + An object that references the asynchronous operation to get all topics in the service namespace. + The string used to filter the topics to be retrieved. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. This object is passed to the delegate when the operation is complete. + + + Asynchronous version of method. + An object that references the asynchronous operation to get the version information. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. This object is passed to the delegate when the operation is complete. + Asynchronous version of method. An object that references the asynchronous operation to check the existence of a queue in the service namespace. @@ -1051,6 +986,27 @@ An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. This object is passed to the delegate when the operation is complete. + + Asynchronous version of method. + An object that references the asynchronous operation to update a queue. + The queue description. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. This object is passed to the delegate when the operation is complete. + + + Asynchronous version of method. + An object that references the asynchronous operation to update a subscription. + The subscription description. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. This object is passed to the delegate when the operation is complete. + + + Asynchronous version of method. + An object that references the asynchronous operation to update a topic. + The topic description. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. This object is passed to the delegate when the operation is complete. + Creates a new instance of . A new instance of . @@ -1079,6 +1035,16 @@ An internal error or unexpected exception occurs. The server is overloaded with logical operations. You can consider any of the following actions:Wait and retry calling this function.Remove entities before retry (for example, receive messages before sending any more). + + Asynchronously creates a new queue in the service namespace with the specified queue description. + The of the newly created queue. + A object describing the attributes with which the new queue will be created. + + + Asynchronously creates a new queue in the service namespace with the given path. + The of the newly created queue. + The path of the queue relative to the service namespace base address. + Creates a new subscription in the service namespace with the specified subscription description. The of the newly created subscription. @@ -1116,6 +1082,43 @@ The name of the subscription. A object describing the attributes with which the messages are matched and acted upon. + + Asynchronously creates a new subscription in the service namespace with the specified subscription description. + The asynchronously created subscription. + A object describing the attributes with which the new subscription will be created. + + + Asynchronously creates a new subscription in the service namespace with the specified subscription description and filter expression. + The asynchronously created subscription. + A object describing the attributes with which the new subscription will be created. + The filter expression used to capture messages satisfying the filtering expression value. + + + Asynchronously creates a new subscription in the service namespace with the specified subscription description and rule description. + The asynchronously created subscription. + A object describing the attributes with which the new subscription will be created. + A object describing the attributes with which the messages are matched and acted upon. + + + Asynchronously creates a new subscription in the service namespace with the specified topic path and subscription name. + The asynchronously created subscription. + The topic path relative to the service namespace base address. + The name of the subscription. + + + Asynchronously creates a new subscription in the service namespace with the specified topic path, subscription name, and filter expression. + The asynchronously created subscription. + The topic path relative to the service namespace base address. + The name of the subscription. + The filter expression used to capture messages satisfying the filtering expression value. + + + Asynchronously creates a new subscription in the service namespace with the specified topic path, subscription name, and rule description. + The asynchronously created subscription. + The topic path relative to the service namespace base address. + The name of the subscription. + A object describing the attributes with which the messages are matched and acted upon. + Creates a new topic inside the service namespace with the specified topic description. The of the newly created topic. @@ -1134,6 +1137,16 @@ Either the specified size in the description is not supported or the maximum allowable quota has been reached. You must specify one of the supported size values, delete existing entities, or increase your quota size. An internal error or unexpected exception occurs. + + Asynchronously creates a new topic inside the service namespace with the specified topic description. + The asynchronously created topic. + A object. + + + Asynchronously creates a new topic inside the service namespace with the given service namespace path. + The asynchronously created topic. + The path of the topic relative to the service namespace base address. + Deletes the queue described by the path relative to the service namespace base address. The path of the queue relative to the service namespace base address. @@ -1145,17 +1158,33 @@ The object does not have sufficient permission to perform this operation. You should check to ensure that your has the correct credentials to perform this operation. An internal error or unexpected exception occurs. + + Asynchronously deletes the queue described by the path relative to the service namespace base address. + The asynchronously deleted queue. + The path of the queue relative to the service namespace base address. + Deletes the subscription with the specified topic path and subscription name. The topic path relative to the service namespace base address. The name of the subscription. + + Asynchronously deletes the subscription with the specified topic path and subscription name. + The ssynchronously deleted subscription. + The topic path relative to the service namespace base address. + The name of the subscription. + Deletes the topic described by path relative to the service namespace base address. The path of the topic relative to the service namespace base address. is null or empty, or starts or ends with "/". + + Asynchronously deletes the topic described by path relative to the service namespace base address. + The asynchronously deleted topic. + The path of the topic relative to the service namespace base address. + Ends an asynchronous request to create a queue. The of the newly created queue. @@ -1184,6 +1213,10 @@ The object does not have sufficient permission to perform this operation. You should check to ensure that your has the correct credentials to perform this operation. An internal error or unexpected exception occurs. + + Ends an asynchronous request to delete a registration. + An object that represents the result of the registration deletion operation. + Ends an asynchronous request to delete a subscription. An object that represents the result of the subscription deletion operation. @@ -1234,6 +1267,11 @@ An object that represents the collection of topics in this service namespace. Returns an empty collection if no topic exists in this service namespace. An object that references the outstanding asynchronous request to retrieve all topics from the service namespace. + + Ends an asynchronous request to get version information. + The version information. + An object that represents the result of the get version information. + Ends an asynchronous request to determine whether a queue exists from the service namespace. true if a queue exists in the service namespace; otherwise, false. @@ -1249,6 +1287,21 @@ true if a subscription exists in the service namespace; otherwise, false. An object that represents the result of the topic existence checking operation. + + Ends an asynchronous request to update queue. + A handle to the queue, or null if the queue does not exist in the service namespace. + An object that represents the result of the update queue operation. + + + Ends an asynchronous request to update subscription. + A handle to the subscription, or null if the subscription does not exist in the service namespace. + An object that represents the result of the update subscription operation. + + + Ends an asynchronous request to update topic. + A handle to the topic, or null if the topic does not exist in the service namespace. + An object that represents the result of the update topic operation. + Retrieves a queue from the service namespace. A handle to the queue, or a exception if the queue does not exist in the service namespace. @@ -1260,19 +1313,58 @@ The queue does not exist in the service namespace. An internal error or unexpected exception occurs. + + Asynchronously retrieves a queue from the service namespace. + The asynchronously retrieved queue. + The path of the queue relative to the service namespace base address. + Retrieves an enumerable collection of all queues in the service namespace. - Returns an object that represents the collection of all queues in the service namespace or returns an empty collection if no queue exists. + Returns an object that represents the collection of all queues in the service namespace or returns an empty collection if no queue exists. The operation times out. The timeout period is initialized through the class. You may need to increase the value of the property to avoid this exception if the timeout value is relatively low. The object does not have sufficient permission to perform this operation. You should check to ensure that your has the correct credentials to perform this operation. An internal error or unexpected exception occurs. + + Retrieves an enumerable collection of all queues in the service namespace with specified filter. + Returns an object that represents the collection of all queues in the service namespace or returns an empty collection if no queue exists. + A string used to filter the queues to be retrieved. + + + Asynchronously retrieves an enumerable collection of all queues in the service namespace. + The asynchronously retrieved queues. + + + Asynchronously retrieves an enumerable collection of all queues in the service namespace with specified filter. + The asynchronously retrieved queues. + The string used to filter the queues to be retrieved. + Retrieves an enumerable collection of all rules in the service namespace. Returns an object that represents the collection of all rules in the service namespace or returns an empty collection if no rule exists. The path of the topic relative to the service namespace base address. The name of the subscription. + + Retrieves an enumerable collection of all rules in the service namespace with specified topic path, subscription name and filter. + Returns an object that represents the collection of all rules in the service namespace or returns an empty collection if no rule exists. + The topic path relative to the service namespace base address. + The name of the subscription. + The string used to filter the rules to be retrieved. + + + Asynchronously retrieves an enumerable collection of all rules in the service namespace. + The asynchronously retrieved rules. + The topic path relative to the service namespace base address. + The name of the subscription. + + + Asynchronously retrieves an enumerable collection of all rules in the service namespace with specified topic path, subscription name and filter. + The asynchronously retrieved rules. + The topic path relative to the service namespace base address. + The name of the subscription. + The string used to filter the rules to be retrieved. + Retrieves the topic from the service namespace. A handle to the subscription, or a exception if the subscription does not exist in the service namespace. @@ -1280,11 +1372,34 @@ The name of the subscription. The subscription does not exist in the service namespace. + + Asynchronously retrieves the topic from the service namespace. + The asynchronously retrieved subscription. + The path of the topic relative to the service namespace base address. + The name of the subscription. + Retrieves an enumerable collection of all subscriptions in the service namespace. Returns an object that represents the collection of all subscriptions in the service namespace or returns an empty collection if no subscription exists. The path of the topic relative to the service namespace base address. + + Retrieves an enumerable collection of all subscriptions in the service namespace with specified topic path and filter. + Returns an object that represents the collection of all subscriptions in the service namespace or returns an empty collection if no subscription exists. + The path of the topic relative to the service namespace base address. + The string used to filter the subscriptions to be retrieved. + + + Asynchronously retrieves an enumerable collection of all subscriptions in the service namespace. + The asynchronously retrieved subscriptions. + The path of the topic relative to the service namespace base address. + + + Asynchronously retrieves an enumerable collection of all subscriptions in the service namespace. + The asynchronously retrieved subscriptions. + The path of the topic relative to the service namespace base address. + The string used to filter the subscriptions to be retrieved. + Retrieves the topic from the service namespace. A reference to the topic, or a exception if the topic does not exist in the service namespace. @@ -1296,6 +1411,11 @@ The topic does not exist in the service namespace. An internal error or unexpected exception occurs. + + Asynchronously retrieves the topic from the service namespace. + The asynchronously retrieved topic. + The path of the topic relative to the service namespace base address. + Retrieves a collection of topics in a service namespace. An object that represents the collection of topics under the current namespace, or returns an empty collection if no topic exists. @@ -1303,11 +1423,40 @@ The object does not have sufficient permission to perform this operation. You should check to ensure that your has the correct credentials to perform this operation. An internal error or unexpected exception occurs. + + Retrieves a collection of topics in a service namespace with specified filter. + An object that represents the collection of topics under the current namespace, or returns an empty collection if no topic exists. + The string used to filter the topics to be retrieved. + + + Asynchronously retrieves a collection of topics in a service namespace. + The asynchronously retrieved topics. + + + Asynchronously retrieves a collection of topics in a service namespace. + The asynchronously retrieved topics. + + + Retrieves a string of the format "YYYY-MM" that indicates the maximum supported protocol version that the server or service can handle. + A string that indicates the maximum supported protocol version that the server or service can handle. + + + Asynchronously retrieves a string of the format "YYYY-MM" that indicates the maximum supported protocol version that the server or service can handle. + The asynchronously retrieved information. + + + Specifies the string of the format "YYYY-MM" that indicates the client's protocol version. + Determines whether a queue exists in the service namespace. true if a queue exists in the service namespace; otherwise, false. The path of the queue relative to the service namespace base address. + + Asynchronously determines whether a queue exists in the service namespace. + The asynchronous operation. + The path of the queue relative to the service namespace base address. + Gets the service namespace client settings. A object that represents the service namespace client settings. @@ -1318,11 +1467,52 @@ The path of the topic relative to the service namespace base address. The name of the subscription. + + Asynchronously determines whether a subscription exists in the service namespace. + The asynchronous operation. + The path of the topic relative to the service namespace base address. + The name of the subscription. + Determines whether a topic exists in the service namespace. true if a topic exists in the service namespace; otherwise, false. The path of the topic relative to the service namespace base address. + + Asynchronously determines whether a topic exists in the service namespace. + The asynchronous operation. + The path of the topic relative to the service namespace base address. + + + Enables you to suspend or resume the queue. + The of the updated queue. + A object describing the queue to be suspended or resumed. + + + Asynchronously enables you to suspend or resume the queue. + The asynchronous operation. + A object describing the queue to be suspended or resumed. + + + Enables you to suspend or resume the subscription. + The of the updated subscription. + A object describing the subscription to be suspended or resumed. + + + Asynchronously enables you to suspend or resume the subscription. + The asynchronous operation. + A object describing the subscription to be suspended or resumed. + + + Enables you to suspend or resume the topic. + The of the updated topic. + A object describing the topic to be suspended or resumed. + + + Asynchronously enables you to suspend or resume the topic. + The asynchronous operation. + A object describing the topic to be suspended or resumed. + Contains the settings for the namespace manager. @@ -1369,27 +1559,6 @@ The encoding to check against the current instance. The session to check against the current instance. - - The collection of security settings for a binding. - - - Gets the message security. - Returns a object that contains the message security. The default returned object has a value of and an value of . - - - Gets or sets the end-to-end security mode. - Returns an that contains the security mode. The default is . - The value is not a valid security mode. - - - Gets or sets the relay authentication type for the relay events subscriber. - Returns a that contains the authentication type. The default is . - The value is not a valid value. - - - Gets the transport-level security settings. - Returns a that contains the transport security. The default value has the property set to . - Represents a binding for a secure, one-way connection through the cloud. @@ -1466,7 +1635,7 @@ Gets the URI scheme for the transport. - Returns the URI scheme for the transport. The default value is “sb”, indicating the Service Bus. + Returns the URI scheme for the transport. The default value is “sb”, indicating the Windows Azure Service Bus. Gets an object that specifies the type of security used with services configured with this binding. @@ -1514,7 +1683,7 @@ Initializes a new instance of the class with the type of security used, the type of client authentication, and a value that indicates whether reliable sessions are explicitly enabled. - The type of security used with the Service Bus binding. + The type of security used with the Windows Azure Service Bus binding. The type of client authentication used on the relay. true if reliable sessions are enabled; otherwise, false. @@ -1549,7 +1718,7 @@ The session to match. - Gets an object that indicates whether a reliable session is established between Service Bus channel endpoints. + Gets an object that indicates whether a reliable session is established between Windows Azure Service Bus channel endpoints. Returns .Indicates whether a WS-RM reliable session is established between channel endpoints. The default is false. @@ -1680,23 +1849,61 @@ Gets or sets a value that specifies whether a security context token is established. true if the security context token is established; otherwise, false. - - Specifies the handling of messages for the in case the buffer reached capacity and the BufferTimeout expired. + + Provides authentication token for the service bus. + + + Builds a key for the provider. + A Key. + The provider in which the key will be applied. + The action. + + + Applies normalization into the token provider. + The normalized token provider. + The token provider where the normalization will be applied. + + + Retrieves a token when the provider begins. + The asynchronous result of the operation. + The provider in which the token will be applied. + The action. + The duration. + The callback. + The state of the operation. + + + Retrieves a web token when the provider begins. + The asynchronous result of the operation. + The provider in which the web token will be applied. + The action. + The duration. + The callback. + The state of the operation. + + + Retrieves a token when the provider ends. + The retrieved token. + The result of the operation. + The duration for the provider to store data. - - Rejects the incoming message by faulting back to the sender. + + Retrieves a web token when the provider ends. + The retrieved token. + The result of the operation. + The duration for the provider to store data. - Describes whether clients of a service are required to present a security token issued by Access Control to the Service Bus when sending messages. + Describes whether clients of a service are required to present a security token issued by Windows Azure Access Control to the Windows Azure Service Bus when sending messages. If specified by a listener, the client is required to provide a security token. - If specified by a listener, the client will not be required to provide a security token. This represents an opt-out mechanism with which listeners can waive the Access Control protection on the endpoint. + If specified by a listener, the client will not be required to provide a security token. This represents an opt-out mechanism with which listeners can waive the Windows Azure Access Control protection on the endpoint. - Represents the different types of one-way connections available through the Access Control. + Represents the different types of one-way connections available through the Windows Azure Access Control. Specifies that only one service application can listen on a given endpoint. Used by . @@ -1794,7 +2001,7 @@ The maximum number of pending connections. - Gets or sets the type of Access Control authentication used by this binding element. + Gets or sets the type of Windows Azure Access Control authentication used by this binding element. Returns a that represents the type of authentication used by this binding element.The default value is . @@ -1814,13 +2021,13 @@ Returns a that contains the transport security protection level. - Describes whether subscribers to a are required to present a security token issued by the Access Control service to the Service Bus service when sending messages. + Describes whether subscribers to a are required to present a security token issued by the Windows Azure Access Control service to the Windows Azure Service Bus service when sending messages. If specified by a NetEventRelay listener, the client is required to provide a relay access token. - If specified by a NetEventRelay subscriber, the client will not be required to provide a relay access token. This represents an opt-out mechanism with which listeners can waive the Access Control protection on the endpoint and perform their own access control. + If specified by a NetEventRelay subscriber, the client will not be required to provide a relay access token. This represents an opt-out mechanism with which listeners can waive the Windows Azure Access Control protection on the endpoint and perform their own access control. Describes the types of protection on a transport relay. @@ -1837,6 +2044,12 @@ Provides a set of methods that execute asynchronous SAML token retrieval operations. + + Generates a key for the token provider. + A generated key for the token provider. + The URI which the access token applies to. + The request action. + Executes the begin get token action. An object that references the asynchronous operation to get a token. @@ -1868,7 +2081,7 @@ When this method returns, contains the expiration date and time of the token information in the cache. - An exception that is thrown by the Service Bus when an error occurs while processing a request. + An exception that is thrown by the Windows Azure Service Bus when an error occurs while processing a request. Initializes a new instance of the class. @@ -1887,8 +2100,112 @@ The error message that describes this exception. The exception that caused the current exception to be thrown. + + Provides a simple way to create and manage the contents of connection strings used by the MessagingFactory class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with the specified connection string. + The connection string. + + + + + Create a connection using the shared access key. + The created connection using the shared access key. + The endpoint. + The name of the shared access key. + The shared access key. + + + + Creates a connection using the shared secret credentials. + The created connection using the shared secret credentials. + The endpoint. + The issuer + The issuer secret. + + + + Gets a set of endpoints. + A set of endpoints. + + + Retrieves the absolute management endpoints. + The absolute management endpoints + + + Retrieves the absolute runtime endpoints. + The absolute runtime endpoints. + + + Gets or sets the management port. + The management port. + + + Gets or sets the authentication domain for the connection. + The authentication domain for the connection. + + + Gets or sets the authentication password for the connection. + The authentication password for the connection. + + + Gets or sets the authentication user name for the connection. + The authentication user name for the connection. + + + Gets or sets the that specifies how long the messaging operation has to complete before timing out. + The that specifies how long the messaging operation has to complete before timing out. The default value is one minute. + + + Gets or sets the runtime port. + The runtime port. + + + Gets or sets the shared access key for the connection authentication. + The shared access key for the connection authentication. + + + Gets or sets the name of the shared access key. + The name of the shared access key. + + + Gets or sets the shared secret issuer name. + The shared secret issuer name. + + + Gets or sets the shared secret issuer secret. + The shared secret issuer secret. + + + Gets a set of STS endpoints. + A set of STS endpoints. + + + Returns a string that represents the current object. + A string that represents the current object. + + + Gets or sets the transport type associated with the connection. + The transport type associated with the connection. + + + Gets or sets the Windows credential domain. + The Windows credential domain. + + + Gets or sets the Windows credential password. + The Windows credential password. + + + Gets or sets the Windows credential user name. + The Windows credential user name. + - Describes the Service Bus environment. + Describes the Windows Azure Service Bus environment. Creates a URI string to use with access control for the specified . @@ -1896,14 +2213,14 @@ The to create the URI for. - Constructs the Service Bus URI for an application, using the specified scheme, name, and service path. + Constructs the Windows Azure Service Bus URI for an application, using the specified scheme, name, and service path. Returns a that contains the new URI. The scheme of the URI. The name used by the application. The service path that follows the host name section of the URI. - Constructs the Service Bus URI for an application, using the specified scheme, name, service path, and relayed path prefix. + Constructs the Windows Azure Service Bus URI for an application, using the specified scheme, name, service path, and relayed path prefix. Returns a that contains the new URI. The scheme of the URI. The name used by the application. @@ -1911,7 +2228,7 @@ True if the relay path prefix is suppressed; otherwise, false. - Gets the default host name for the Access Control Service. + Gets the default host name for the Windows Azure Access Control Service. Returns the default identity host name. @@ -1919,7 +2236,7 @@ Returns a that contains the connectivity settings. - Contains the settings for the Service Bus registry. + Contains the settings for the Windows Azure Service Bus registry. Initializes a new instance of the class. @@ -1961,9 +2278,108 @@ true if transport protection is enabled; otherwise, false. The default value is true. + + + Initializes a new instance of the class with specified token string. + The token string. + + + Initializes a new instance of the class with specified token string and expiry. + The token string. + The token expiry. + + + Initializes a new instance of the class with specified identifier and token string. + The token identifier. + The token string. + + + Gets the value that expires on field name. + The value that expires on field name. + + + Gets the key value separator. + The key value separator. + + + Returns . + + + Represents the shared access signature associated with the token provider. + + + The epoch time. + + + The key value separator. + + + The maximum key length. + + + The maximum key name length. + + + Executes upon calling the BeginGetToken method. + The result of the operation. + The URI which the access token applies to. + The request action. + The time span that specifies the timeout value for the message that gets the security token. + An AsyncCallback delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Executes upon calling the BeginGetWebToken method. + The result of the operation. + The URI which the access token applies to. + The request action. + The time span that specifies the timeout value for the message that gets the security token. + An AsyncCallback delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Executes upon calling the EndGetToken method. + The object. + An IAsyncResult object that references the asynchronous operation to get a token. + When this method returns, contains the expiration date and time of the token information in the cache. + + + Executes upon calling the EndGetWebToken method. + The String that represents the web token. + An IAsyncResult object that references the asynchronous operation to get a web token. + When this method returns, contains the expiration date and time of the token information in the cache. + + + The pair separator. + + + The shared access signature. + + + The signature. + + + The signed expiry. + + + The signed key name. + + + The signed resource. + + + Gets whether the token provider strips query parameters. + true if the token provider strips query parameters; otherwise, false. + Provides methods that return name/value pairs for web token assertions, and that execute asynchronous shared secret token retrieval operations. + + Generates a key for the token provider. + A generated key for the token provider. + The URI which the access token applies to. + The request action. + Returns a string of URL encoded name/value pairs for a simple web token assertion using the specified issuer name and issuer secret. A URL encoded name/value pairs for a simple web token assertion. @@ -2024,10 +2440,26 @@ A string that represents the Simple Web Token. The parameter or parameter is null. + + Gets the date and time the security token will expire. + The date and time the security token will expire. + + + Gets the field name associated with the token expiration. + The field name associated with the token expiration. + Gets the ID associated with the Simple Web Token. The ID associated with the Simple Web Token. + + Gets the key value separator associated with the token. + The key value separator associated with the token. + + + Gets the pair separator associated with the token. + The pair separator associated with the token. + Gets the cryptographic keys associated with the security token. A of type that contains the set of keys associated with the Simple Web Token. @@ -2136,6 +2568,12 @@ Provides a set of methods that execute asynchronous simple Web token (SWT) retrieval operations. + + Generates a key for the simple web token provider. + A generated key for the simple web token provider. + The URI which the access token applies to. + The request action. + Executes the begin get token action. An object that references the asynchronous operation to get a token. @@ -2221,10 +2659,10 @@ Describes the connection mode for the . - All communication is relayed through the Service Bus cloud. The SSL-protected control connection is used to negotiate a relayed end-to-end socket connection that all Client-Service communication flows through. After the connection is established, the Service Bus infrastructure acts much like a socket forwarder proxy relaying a bidirectional byte stream. This mode additionally requires outbound port 819 for the NAT prediction algorithm. With most personal firewall products, the outbound socket connection that is being established by the direct connect mode will also require a one-time policy exception to be granted by the user (the Windows Personal Firewall and other products will typically prompt the user) to the hosting application. + All communication is relayed through the Windows Azure Service Bus cloud. The SSL-protected control connection is used to negotiate a relayed end-to-end socket connection that all Client-Service communication flows through. After the connection is established, the Windows Azure Service Bus infrastructure acts much like a socket forwarder proxy relaying a bidirectional byte stream. This mode additionally requires outbound port 819 for the NAT prediction algorithm. With most personal firewall products, the outbound socket connection that is being established by the direct connect mode will also require a one-time policy exception to be granted by the user (the Windows Personal Firewall and other products will typically prompt the user) to the hosting application. - Communication is relayed through the Service Bus infrastructure while the Client and Service endpoints negotiate a direct socket connection to each other. The coordination of this direct connection is governed by the Service Bus cloud service. The direct socket connection algorithm is capable of establishing direct connections between two parties that sit behind opposing Firewalls and NAT devices. The algorithm uses only outbound connections for Firewall traversal and relies on a mutual port prediction algorithm for NAT traversal. Since the NAT traversal algorithm is dependent on a very narrowly timed coordination and a best-guess prediction about the expected NAT behavior, the algorithm tends to have a very high success rate for Home and Small Business scenarios with a small number of clients and degrades in its success rate with larger NATs. If a direct connection can be established, the relayed connection is automatically upgraded to the direct connection without message or data loss. If the direct connection cannot be established, data will continue to flow through the Service Bus Relay. + Communication is relayed through the Windows Azure Service Bus infrastructure while the Client and Service endpoints negotiate a direct socket connection to each other. The coordination of this direct connection is governed by the Windows Azure Service Bus cloud service. The direct socket connection algorithm is capable of establishing direct connections between two parties that sit behind opposing Firewalls and NAT devices. The algorithm uses only outbound connections for Firewall traversal and relies on a mutual port prediction algorithm for NAT traversal. Since the NAT traversal algorithm is dependent on a very narrowly timed coordination and a best-guess prediction about the expected NAT behavior, the algorithm tends to have a very high success rate for Home and Small Business scenarios with a small number of clients and degrades in its success rate with larger NATs. If a direct connection can be established, the relayed connection is automatically upgraded to the direct connection without message or data loss. If the direct connection cannot be established, data will continue to flow through the Windows Azure Service Bus Relay. This mode additionally requires outbound port 819 for the NAT prediction algorithm. With most personal firewall products, the outbound socket connection that is being established by the direct connect mode will also require a one-time policy exception to be granted by the user (the Windows Personal Firewall and other products will typically prompt the user) to the hosting application. @@ -2316,8 +2754,11 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The string used to represent the TRACE verb in an HTTP request. + + A character designating the separation between a key and a value. + - The default issuer name string value used to gain access to the Access Control management service. + The default issuer name string value used to gain access to the Windows Azure Access Control management service. The maximum size of the issuer name. @@ -2326,13 +2767,13 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The maximum size of the issuer secret key. - The issuer ID for all output claims from the Access Control service. + The issuer ID for all output claims from the Windows Azure Access Control service. The value of the ConfirmationMethod attribute used in a Security Assertion Markup Language (SAML) bearer assertion. - The default issuer name string value used to gain access to the Service Bus. + The default issuer name string value used to gain access to the Windows Azure Service Bus. The token audience attribute name that is used in a Simple Web Token (SWT). The token audience is the SWT processor that the SWT is intended for. @@ -2356,7 +2797,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The parameter name for the access token that is returned in the response by the Security Token Service using the WRAP protocol. - The name of the AppliesTo field that is in the token request body that is sent to the Access Control service. + The name of the AppliesTo field that is in the token request body that is sent to the Windows Azure Access Control service. The parameter name for the WRAP assertion that is sent in the token request using the WRAP protocol. @@ -2368,7 +2809,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The WRAP authentication protocol type name. - The parameter name of the access token that is sent in the authorization header of a request to the Service Bus. + The parameter name of the access token that is sent in the authorization header of a request to the Windows Azure Service Bus. The base date and time used in the WRAP protocol. @@ -2402,6 +2843,19 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit true if new security tokens are being cached; otherwise, false. true if web token is supported by this provider; otherwise, false. + + Initializes a new instance of the class. + true if new security tokens are being cached; otherwise, false. + true if web token is supported by this provider; otherwise, false. + The token scope associated with the provider. + + + Initializes a new instance of the class. + true if new security tokens are being cached; otherwise, false. + true if web token is supported by this provider; otherwise, false. + The size of the cache. + The token scope associated with the provider. + Begins an asynchronous operation to get a security token. An object that references the asynchronous operation to get a token. @@ -2422,40 +2876,124 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. - + + Generates a key for the token provider. + A generated key for the token provider. + The URI which the access token applies to. + The request action. + + + Gets or sets the size of the cache. + The size of the cache. + + Gets or sets a value that indicates whether new security tokens are being cached. true if new security tokens are being cached; otherwise, false. + + Clears the token provider. + + + Creates an OAuth (open standard for authorization) token provider. + The for returning OAuth token. + The URIs of the Security Token Service (STS). + The user credential. + - Creates a Saml token provider with the specified Saml token. - The for returning Saml token. - The string that represents the Saml token. + Creates a SAML token provider with the specified SAML token. + The for returning SAML token. + The string that represents the SAML token. + + + Creates a SAML token provider with the specified SAML token and scope. + The for returning SAML token. + The string that represents the SAML token. + The token scope associated with the provider. - Creates a Saml token provider with the specified Saml token and URI of the Security Token Service (STS). - The for returning Saml token. - The string that represents the Saml token. + Creates a SAML token provider with the specified SAML token and URI of the Security Token Service (STS). + The for returning SAML token. + The string that represents the SAML token. The URI of the Security Token Service (STS). + + Creates a SAML token provider with the specified SAML token, URI of the Security Token Service (STS) and token scope. + The for returning SAML token. + The string that represents the SAML token. + The URI of the Security Token Service (STS). + The token scope associated with the provider. + + + Creates a SAML token provider with the specified SAML token, URI of the Security Token Service (STS) and cache size. + The for returning SAML token. + The string that represents the SAML token. + The URI of the Security Token Service (STS). + The size of the cache. + + + Creates a SAML token provider with the specified SAML token, URI of the Security Token Service (STS), cache size and token scope. + The for returning SAML token. + The string that represents the SAML token. + The URI of the Security Token Service (STS). + The size of the cache. + The token scope associated with the provider. + + + Creates a URL that grants access to token provider with specified key name and shared access key. + The created URL that grants access to token provider. + The key name. + The shared access key. + + + Creates a URL that grants access to token provider with specified key name, shared access key and token scope. + The created URL that grants access to token provider. + The key name. + The shared access key. + The token scope associated with the provider. + + + Creates a shared secret token provider. The for returning shared secret token. The issuer name. The issuer secret. + + Creates a shared secret token provider. + The created token provider. + The name of the issuer. + The set of issuer secret. + The token scope associated with the provider. + Creates a shared secret token provider. The for returning shared secret token. The issuer name. - The issuer secret. + The set of issuer secret. The URI of the Security Token Service (STS). + + Creates a shared secret token provider. + The created token provider. + The issuer name. + The set of issuer secret. + The Security Token Service's endpoint Uri. + The token scope associated with the provider. + Creates a shared secret token provider. The for returning shared secret token. The issuer name. The issuer secret. + + Creates a shared secret token provider. + The created token provider. + The issuer name. + The issuer secret. + The token scope associated with the provider. + Creates a shared secret token provider. The for returning shared secret token. @@ -2463,17 +3001,55 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The issuer secret. The URI of the Security Token Service (STS). + + Creates a shared secret token provider. + The created token provider. + The issuer name. + The issuer secret. + The URI of the Security Token Service (STS). + The token scope associated with the provider. + Creates a simple web token provider. The for returning simple web token. The string that represents the simple web token. + + Creates a simple web token provider. + The created simple web token provider. + The string that represents the simple web token. + The token scope associated with the provider. + Creates a simple web token provider. The for returning simple web token. The string that represents the simple web token. The URI of the Security Token Service (STS). + + Creates a simple web token provider. + The created simple web token provider. + The string that represents the simple web token. + The URI of the Security Token Service (STS). + The token scope associated with the provider. + + + Created a user name and password for the token provider. + The created username and password for the token provider. + The username for the token provider. + The password for the token provider. + + + Creates a windows token provider. + The for returning the windows token. + The URIs of the Security Token Service (STS). + + + Creates a windows token provider. + The for returning the windows token. + The URIs of the Security Token Service (STS). + The user credential. + Completes an asynchronous operation to get a security token. The object. @@ -2484,10 +3060,31 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The that represents the web token. An object that references the asynchronous operation to get a web token. + + Asynchronously retrieves the token for the provider. + The result of the asynchronous operation. + The URI which the access token applies to. + The request action. + true to ignore existing token information in the cache; false to use the token information in the cache. + The time span that specifies the timeout value for the message that gets the security token. + + + Asynchronously retrieves the web token for the provider. + The result of the asynchronous operation. + The URI which the access token applies to. + The request action. + true to ignore existing token information in the cache; false to use the token information in the cache. + The time span that specifies the timeout value for the message that gets the security token. + Gets or sets a value that indicates whether web token is supported by this provider. true if web token is supported by this provider; otherwise, false. + + Returns an object whose value is the same as the token provider. + The returned object. + The URI which the access token applies to. + Executes upon calling the BeginGetToken method. An object that references the asynchronous operation to get a token. @@ -2518,23 +3115,70 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An object that references the asynchronous operation to get a web token. When this method returns, contains the expiration date and time of the token information in the cache. + + Gets whether the token provider strips query parameters. + true if the token provider strips query parameters; otherwise, false. + + + Gets or sets the token scope associated with the provider. + The token scope associated with the provider. + + + Represents a key associated with the token. + + + Initializes a new instance of the class. + Specifies the address where the key applies to. + Specifies a specific user, application, computer, or other entity + + + Determines whether the specified key is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The key to compare with the current object. + + + Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Returns the hash code for the key. + The hash code for the key. + + + Represents an exception regarding the token provider for the Service Bus. + + + Initializes a new instance of the class. + The exception message. + The error that caused the exception. + + + Enumerates the token scope for the service bus. + + + The namespace. + + + The entity. + - Represents the type of client credential to be used for authentication on the Service Bus transport. + Represents the type of client credential to be used for authentication on the Windows Azure Service Bus transport. - Specifies that the shared secret credential is used to authenticate with the Service Bus. + Specifies that the shared secret credential is used to authenticate with the Windows Azure Service Bus. - Specifies that the Simple Web Token credential is used to authenticate with the Service Bus. + Specifies that the Simple Web Token credential is used to authenticate with the Windows Azure Service Bus. - Specifies that the Security Assertion Markup Language credential is used to authenticate with the Service Bus. + Specifies that the Security Assertion Markup Language credential is used to authenticate with the Windows Azure Service Bus. No client credential provided. This option avoids acquiring and sending a token altogether and is required for all clients that are not required to authenticate per their service binding's policy. - Specifies that the custom token provider credential is used to authenticate with the Service Bus. + Specifies that the custom token provider credential is used to authenticate with the Windows Azure Service Bus. Describes the WCF endpoint behavior that is used to specify the Service Bus credentials for a particular endpoint. @@ -2570,22 +3214,13 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The endpoint dispatcher to be modified or extended. - Confirms that the endpoint is a valid Service Bus endpoint that can be modified by the behavior of this instance. + Confirms that the endpoint is a valid Windows Azure Service Bus endpoint that can be modified by the behavior of this instance. The endpoint to validate. Gets or sets the token provider that is used as a binding parameter. The token provider used as a binding parameter. - - Indicates the transport protection requirements for messages flowing into and out of a message buffer. - - - Messages can be sent into and received without any transport protection measures: that is, both sender and receiver can voluntarily opt to secure their individual message path. - - - Messages must be sent into and received from message buffer using a secure communication channel. - A binding used to configure endpoints for Web services that are exposed through HTTP requests instead of SOAP messages. @@ -2605,13 +3240,17 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets a value that specifies whether cookies are allowed in the messages sent via the . Returns true if cookies are allowed; otherwise, false. The default value is false. + + Gets or sets the content type mapper. + The content type mapper. + Creates a collection with the binding elements for the binding. Returns a that contains the ordered stack of binding elements used by the . Gets the SOAP envelope version. - Returns a . Since the does not use SOAP, this always returns EnvelopeVersion.None. is not likely the binding you should be using for SOAP messaging. However, Service Bus does support SOAP. + Returns a . Since the does not use SOAP, this always returns EnvelopeVersion.None. is not likely the binding you should be using for SOAP messaging. However, Windows Azure Service Bus does support SOAP. Gets or sets the maximum buffer pool size used by the transport. @@ -2673,6 +3312,50 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets the Transport-level security settings for a binding. Returns a that contains the binding. The default values set are a ClientCredentialType of None, a ProxyCredentialType of None, and Realm = "". + + Represents the token provider for the service bus. + + + Generates a key for the token provider. + A generated key. + The URI which the access token applies to. + The request action. + + + Returns the normalize URI form of the target address. + The normalize URI form for the target address. + The URI which the normalization applies to. + + + Retrieves a token when the provider service was started. + The result of the operation. + The object where the token will be applied. + The action. + The duration of the operation. + The argument fir the provider. + The state of the provider. + + + Retrieves a web token when the provider service was started. + The result of the operation. + The object where the token will be applied. + The action. + The duration of the operation. + The argument fir the provider. + The state of the provider. + + + Retrieves a token when the provider service was stopped. + The retrieved token. + The result of the operation. + The specified duration of time for the provider to store data. + + + Retrieves a web token when the provider service was stopped. + The retrieved web token. + The result of the operation. + The specified duration of time for the provider to store data. + Represents an interoperable binding that derives from and provides support for the updated versions of the Security, ReliableSession, and TransactionFlow binding elements. @@ -2729,28 +3412,28 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit true, if a reliable session is enabled; otherwise, false. - Returns an ordered collection of binding elements contained in the current Service Bus binding. + Returns an ordered collection of binding elements contained in the current Windows Azure Service Bus binding. Returns .Contains the objects for the binding. - When implemented in a derived class, returns the security binding element from the current Service Bus binding. - Returns .Contains the security binding element from the current Service Bus binding. + When implemented in a derived class, returns the security binding element from the current Windows Azure Service Bus binding. + Returns .Contains the security binding element from the current Windows Azure Service Bus binding. Gets the version of SOAP that is used for messages that are processed by this binding. - Returns .The value of the envelope version that is used with this Service Bus binding. The value is always SOAP 1.2. + Returns .The value of the envelope version that is used with this Windows Azure Service Bus binding. The value is always SOAP 1.2. - When implemented in a derived class, returns the transport binding element from the current Service Bus binding. - Returns .Contains the transport binding element from the current Service Bus binding. + When implemented in a derived class, returns the transport binding element from the current Windows Azure Service Bus binding. + Returns .Contains the transport binding element from the current Windows Azure Service Bus binding. - Gets or sets the maximum amount of memory allocated for the buffer manager that manages the buffers required by endpoints using this Service Bus binding. + Gets or sets the maximum amount of memory allocated for the buffer manager that manages the buffers required by endpoints using this Windows Azure Service Bus binding. Returns .The maximum size, in bytes, for the pool of buffers used by an endpoint configured with this binding. The default value is 65,536 bytes. - Gets or sets the maximum size for a message that can be processed by the Service Bus binding. - Returns .The maximum size, in bytes, for a message that is processed by the Service Bus binding. The default value is 65,536 bytes. + Gets or sets the maximum size for a message that can be processed by the Windows Azure Service Bus binding. + Returns .The maximum size, in bytes, for a message that is processed by the Windows Azure Service Bus binding. The default value is 65,536 bytes. Gets or sets whether MTOM or Text/XML is used to encode SOAP messages. @@ -2765,8 +3448,8 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Returns .Specifies the complexity constraints. - Gets an object that provides convenient access to the properties of a reliable Service Bus session binding element that are available when using one of the system-provided bindings. - Returns .Provides convenient access to the properties of a reliable Service Bus session binding element that are available when using one of the system-provided bindings. + Gets an object that provides convenient access to the properties of a reliable Windows Azure Service Bus session binding element that are available when using one of the system-provided bindings. + Returns .Provides convenient access to the properties of a reliable Windows Azure Service Bus session binding element that are available when using one of the system-provided bindings. Gets the URI transport scheme for the channels and listeners that are configured with this binding. @@ -2789,19 +3472,19 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit - Gets the message-level security settings for this Service Bus binding. + Gets the message-level security settings for this Windows Azure Service Bus binding. Returns .Contains the security settings. The default value includes: EstablishSecurityContext with default set to true, ClientCredentialType is Windows, AlgorithmSuite is Basic256, and NegotiateServiceCredential is true. - Specifies the message security mode for this Service Bus binding. - Returns .Contains the security mode for this Service Bus binding. The default is Transport. + Specifies the message security mode for this Windows Azure Service Bus binding. + Returns .Contains the security mode for this Windows Azure Service Bus binding. The default is Transport. - Gets or sets the authentication type required for the service application or client application to provide to the Service Bus. - The authentication type required for the service application or client application to provide to the Service Bus. The default is . + Gets or sets the authentication type required for the service application or client application to provide to the Windows Azure Service Bus. + The authentication type required for the service application or client application to provide to the Windows Azure Service Bus. The default is . - Gets an object that contains the transport-level security settings for this Service Bus binding. + Gets an object that contains the transport-level security settings for this Windows Azure Service Bus binding. Returns .Contains the transport security for this item. The default value includes a ClientCredentialType of None and a ProxyCredentialType of None. @@ -2869,6 +3552,26 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Returns a which indicates whether a channel uses streamed or buffered modes of message transfer. The default is Buffered. The value is not a valid TransferMode. + + Represents an address configuration. + + + Initializes a new instance of the class. + + + Gets or sets the URI of the address. + The URI of the address. + + + Represents a collection of elements in address configuration. + + + Initializes a new instance of the class. + + + Gets the addresses of the elements in the collection. + The addresses of the elements in the collection. + Represents a configuration section that holds a collection of instances. @@ -2876,7 +3579,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Initializes a new instance of the class. - Represents a configuration element that specifies a binding used to communicate with WS-I Basic Profile 1.1-conformant Web Services like ASMX-based services or to accept messages from ASMX-based clients through the Service Bus. + Represents a configuration element that specifies a binding used to communicate with WS-I Basic Profile 1.1-conformant Web Services like ASMX-based services or to accept messages from ASMX-based clients through the Windows Azure Service Bus. Initializes a new instance of the class. @@ -3115,7 +3818,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Returns a that contains the proxy type. - Represents the configuration element that specifies an HTTPS transport for transmitting SOAP messages through the Service Bus. + Represents the configuration element that specifies an HTTPS transport for transmitting SOAP messages through the Windows Azure Service Bus. Initializes a new instance of the class. @@ -3129,7 +3832,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Returns a whose properties are copied from the settings in this configuration element. - A configuration element that describes an issuer of a token for the Service Bus. + A configuration element that describes an issuer of a token for the Windows Azure Service Bus. Gets or sets the URI address of the token issuer. @@ -3144,7 +3847,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The collection of properties contained in this configuration element. - A configuration element that describes message security options over a relayed connection through the Service Bus. + A configuration element that describes message security options over a relayed connection through the Windows Azure Service Bus. Initializes a new instance of the class. @@ -3158,7 +3861,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Returns a that contains the type of credential. The default is Windows. - A configuration element that describes the message security over the Service Bus relay, using an HTTP transport mechanism. + A configuration element that describes the message security over the Windows Azure Service Bus relay, using an HTTP transport mechanism. Gets or sets from the configuration file the message encryption and key-wrap algorithms used to secure an HTTP message. @@ -3173,7 +3876,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit true if the service credential is provisioned at the client out-of-band, or is obtained from the service to the client through a process of negotiation; otherwise, false. - A configuration element that describes the message security for a one-way message to the Service Bus relay. + A configuration element that describes the message security for a one-way message to the Windows Azure Service Bus relay. Initializes a new instance of the class. @@ -3243,7 +3946,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Returns a that specifies the complexity constraints on SOAP messages. - Gets a configuration element that contains the security options for an Service Bus net event relay binding. + Gets a configuration element that contains the security options for an Windows Azure Service Bus net event relay binding. Returns a that describes the security options. The default is Transport. @@ -3321,7 +4024,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Returns an instance that contains the security mode. - Gets a value that describes whether clients of a service are required to present a security token issued by the Service Bus service to the Service Bus service when sending messages. + Gets a value that describes whether clients of a service are required to present a security token issued by the Windows Azure Service Bus service to the Windows Azure Service Bus service when sending messages. Returns a that contains the relay client authentication type. @@ -3335,7 +4038,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Initializes a new instance of the class. - A configuration element that describes a secure, reliable binding suitable for cross-machine communication through the Service Bus relay. + A configuration element that describes a secure, reliable binding suitable for cross-machine communication through the Windows Azure Service Bus relay. Initializes a new instance of the class. @@ -3401,7 +4104,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Returns a that contains indicates whether the service configured with the binding uses streamed or buffered (or both) modes of message transfer. The possible values are as follows: BufferedStreamedStreamedRequestStreamedResponseThe default value is Buffered.Specifying to Streamed implies both StreamedRequest and StreamedResponse. - Represents a configuration element that configures the security for a net TCP service through the Service Bus relay. + Represents a configuration element that configures the security for a net TCP service through the Windows Azure Service Bus relay. Initializes a new instance of the class. @@ -3415,7 +4118,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Returns a that contains the security mode. The default value is Transport. - Gets or sets the authentication type required for the client to present to the Service Bus when sending messages. + Gets or sets the authentication type required for the client to present to the Windows Azure Service Bus when sending messages. Returns a that contains the authentication type. @@ -3433,14 +4136,14 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit true if the context is established; otherwise, false. - Installs the Machine.config settings for the Service Bus relay. + Installs the Machine.config settings for the Windows Azure Service Bus relay. Initializes a new instance of the class. Adds the entries of the current instance to the specified configuration. - A configuration that the Service Bus configuration will be added to. + A configuration that the Windows Azure Service Bus configuration will be added to. A valid configuration file could not be loaded. @@ -3464,7 +4167,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An exception occurred while uninstalling. This exception is ignored and the uninstall continues. However, the application might not be fully uninstalled after the uninstallation completes. - Represents a configuration element that, when included in a custom binding, specifies a channel to transfer one-way messages through the Service Bus. This class cannot be inherited. + Represents a configuration element that, when included in a custom binding, specifies a channel to transfer one-way messages through the Windows Azure Service Bus. This class cannot be inherited. Initializes a new instance of the class. @@ -3507,6 +4210,18 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets the transport security protection level that is applied to messages transmitted through bindings configured with this configuration element. Returns a that contains the transport security protection level specified in this configuration element. + + Enumerates the service bus section type. + + + The All section type. + + + The Namespace Manager section type. + + + The Messaging Factory section type. + Contains the settings for the AppFabric Service Bus registry. @@ -3529,6 +4244,12 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets the display name for the endpoint. The display name. + + + + + + A configuration element that specifies the credentials for a service or client endpoint that is configured to use the credential type. @@ -3548,6 +4269,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets the properties of this configuration element that contain the issuer name and the issuer secret key. The properties of this configuration element that contain the issuer name and the issuer secret key. + Represents a configuration element that specifies additional connection pool settings for a TCP transport. This class cannot be inherited. @@ -3570,6 +4292,26 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets the maximum number of connections to a remote endpoint initiated by the service. Returns the maximum number of connections to a remote endpoint initiated by the service. The default is 10. + + Represents the security token service of the URI element. + + + Initializes a new instance of the class. + + + Gets or sets the value of the element. + The value of the element. + + + Represents a URI element collection for the Security Token Service. + + + Initializes a new instance of the class. + + + Gets the addresses of the element in the collection. + The addresses of the element in the collection. + Specifies a configuration element that causes a channel to transfer messages on the TCP transport when it is included in a custom binding. This class cannot be inherited. @@ -3605,7 +4347,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Returns a that contains the relay client authentication type. The default is RelayClientAuthenticationType.RelayAccessToken. - Represents a configuration element that configures the security for a TCP transport service through the Service Bus relay. + Represents a configuration element that configures the security for a TCP transport service through the Windows Azure Service Bus relay. Initializes a new instance of the class. @@ -3621,20 +4363,36 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Copies the contents of the specified configuration element to this configuration element. The configuration element to copy the contents from. - - Adds the invalid-property errors in this configuration element object, and in all subelements, to the passed list. - An object that implements the interface. + + Gets the name of the specified object. + The specified object. Gets the collection of properties contained in the configuration element. The collection of properties contained in the configuration element. + Gets the shared secret element contained in the token provider element. The shared secret element contained in the token provider element. + + Gets the Windows authentication settings for this element. + The Windows authentication settings for this element. + + + Represents a collection of elements for the token provider. + + + Initializes a new instance of the class. + + + Gets an item in the collection. + An item in the collection. + The name of the item. + - A configuration element that contains the credentials of a service or client endpoint for a transport on the Service Bus relay. + A configuration element that contains the credentials of a service or client endpoint for a transport on the Windows Azure Service Bus relay. Applies the settings of this configuration element to the specified . @@ -3657,7 +4415,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The shared secret element contained in this credential element. - A configuration element that specifies the behavior of a service or client endpoint for a transport on the Service Bus relay. + A configuration element that specifies the behavior of a service or client endpoint for a transport on the Windows Azure Service Bus relay. Initializes a new instance of the class. @@ -3667,8 +4425,8 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The behavior type for the transport client endpoint. - Gets or sets the credentials of a service or client endpoint for a transport on the Service Bus relay. - The credentials of a service or client endpoint for a transport on the Service Bus relay. + Gets or sets the credentials of a service or client endpoint for a transport on the Windows Azure Service Bus relay. + The credentials of a service or client endpoint for a transport on the Windows Azure Service Bus relay. Copies the contents of the specified configuration element to this configuration element. @@ -3701,7 +4459,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Returns a that represents the default binding. - A binding element used to configure endpoints for an Service Bus relay service that responds to HTTP requests instead of SOAP messages. + A binding element used to configure endpoints for an Windows Azure Service Bus relay service that responds to HTTP requests instead of SOAP messages. Initializes a new instance of the class. @@ -3774,7 +4532,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The value set is null. - Represents a configuration element that configures the security for a Web HTTP service through the Service Bus relay. + Represents a configuration element that configures the security for a Web HTTP service through the Windows Azure Service Bus relay. Initializes a new instance of the class. @@ -3791,6 +4549,37 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets a configuration element that indicates the transport-level security settings for a service endpoint configured to receive HTTP requests. Returns a that contains the security settings. + + Represents the windows element for the configuration of the service bus. + + + Copies the specified windows element into the current instance. + The windows element to copy. + + + Gets or sets the domain. + The domain. + + + Gets or sets the password. + The password. + + + Gets or sets the collection of configuration properties. + The collection of configuration properties. + + + Gets or sets the collection of security token service (STS) URI. + The collection of security token service (STS) URI. + + + Gets or sets a value that indicates whether to use default credentials. + true if to use default credentials; otherwise, false. + + + Gets or sets the username. + The username. + Represents a configuration section that holds a collection of instances. @@ -3893,7 +4682,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The configuration element that contains the security settings for the binding. - Represents a configuration element that configures the security for a WS-HTTP service through the Service Bus relay. + Represents a configuration element that configures the security for a WS-HTTP service through the Windows Azure Service Bus relay. Initializes a new instance of the class. @@ -3915,7 +4704,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Returns a that specifies the security settings for the transport.Use the object returned by this property to set the transport security parameters for the . If the TransportCredentialOnly value is specified by , then the settings provided by the Transport property become effective for the service endpoint. The value of this property can set only in the constructor it as an explicit parameter and its value cannot be set again after the binding instance is created. - A configuration element that describes the security on an HTTP transport over the Service Bus relay. + A configuration element that describes the security on an HTTP transport over the Windows Azure Service Bus relay. Initializes a new instance of the class. @@ -3951,7 +4740,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The maximum number of characters allowed in XML element content. - Maps WSDL contracts and policy assertions into Service Bus HttpRelayTransport bindings. + Maps WSDL contracts and policy assertions into Windows Azure Service Bus HttpRelayTransport bindings. Initializes a new instance of the class. @@ -3968,7 +4757,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Contains the policy elements. - Imports WSDL contract information for Service Bus HttpRelayTransport bindings. + Imports WSDL contract information for Windows Azure Service Bus HttpRelayTransport bindings. The WSDL importer for importing and resolving WSDL metadata. The context for the conversion from WSDL to the service description. @@ -3978,7 +4767,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The context for the conversion. - Maps WSDL contracts and policy assertions into Service Bus OnewayRelayTransport bindings. + Maps WSDL contracts and policy assertions into Windows Azure Service Bus OnewayRelayTransport bindings. Initializes a new instance of the class. @@ -3995,7 +4784,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Contains the policy elements. - Imports WSDL contract information for Service Bus OnewayRelayTransport bindings. + Imports WSDL contract information for Windows Azure Service Bus OnewayRelayTransport bindings. The WSDL importer for importing and resolving WSDL metadata. The context for the conversion from WSDL to the service description. @@ -4042,7 +4831,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The token string for a Simple Web Token assertion. - Maps WSDL contracts and policy assertions into Service Bus standard bindings. + Maps WSDL contracts and policy assertions into Windows Azure Service Bus standard bindings. Initializes a new instance of the class. @@ -4064,7 +4853,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The context for the conversion. - Maps WSDL contracts and policy assertions into Service Bus TcpRelayTransport bindings. + Maps WSDL contracts and policy assertions into Windows Azure Service Bus TcpRelayTransport bindings. Initializes a new instance of the class. @@ -4081,7 +4870,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Contains the policy elements. - Imports WSDL contract information for Service Bus TcpRelayTransport bindings. + Imports WSDL contract information for Windows Azure Service Bus TcpRelayTransport bindings. The WSDL importer for importing and resolving WSDL metadata. The context for the conversion from WSDL to the service description. @@ -4110,7 +4899,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The simple web token. - The credentials used by a listener (host) or client to authenticate with the Service Bus relay. The Service Bus supports well-known types of credential schemes: SAML, Shared Secret, and Simple Web Token. + The credentials used by a listener (host) or client to authenticate with the Windows Azure Service Bus relay. The Windows Azure Service Bus supports well-known types of credential schemes: SAML, Shared Secret, and Simple Web Token. Gets the Security Assertion Markup Language credential object stored in this instance. @@ -4125,9 +4914,155 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The Simple Web Token object stored in this instance. - Gets the token provider used by the client or service for presenting credentials to the Service Bus relay. - The token provider used by the client or service for presenting credentials to the Service Bus relay. + Gets the token provider used by the client or service for presenting credentials to the Windows Azure Service Bus relay. + The token provider used by the client or service for presenting credentials to the Windows Azure Service Bus relay. + + + Specifies the possible access rights for a user. + + + The access right is Manage. + + + The access right is Send. + + + The access right is Listen. + + + Represents the rule to allow. + + + Initializes a new instance of class. + The distinguished name of the certificate issuer. + The claim type. + The claim value. + The possible access rights. + + + Gets or sets the allow rule key name. + The allow rule key name. + + + Defines the Azure Service Bus authorization rule that is used to determine whether an operation is permissible or not. + + + Gets or sets the claim type. + The claim type. + + + Gets or sets the claim value which is either ‘Send’, ‘Listen’, or ‘Manage’. + The claim value which is either ‘Send’, ‘Listen’, or ‘Manage’. + + + Creates a copy of . + A created copy of . + + + Gets or sets the date and time when the authorization rule was created. + The date and time when the authorization rule was created. + + + Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Returns the hash code for this instance. + The hash code for this instance. + + + Gets or sets the name identifier of the issuer. + The name identifier of the issuer. + + + Gets or sets the authorization rule key name. + The authorization rule key name. + + + Gets or sets the date and time when the authorization rule was modified. + The date and time when the authorization rule was modified. + + + Enables derived classes to provide custom handling when validating the authorization rule. + + + Gets or sets the modification revision number. + The modification revision number. + + + Gets or sets the list of rights. + The list of rights. + + + Checks the validity of the specified access rights. + The access rights to check. + + + Represents a collection of . + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with a list of . + The list of . + + + Adds the specified into the collection. + The to be added. + + + Clears all elements in the collection. + + + Determines whether the specified item exists in the collection. + true if the specified item is found; otherwise, false. + The item to search in the collection. + + + Copies the elements into an array starting at the specified array index. + The array to hold the copied elements. + The zero-based index at which copying starts. + + Gets or sets the number of contained in the collection. + The number of contained in the collection. + + + Gets the enumerator that iterates through the collection. + The enumerator that can be used to iterate through the collection. + + + + Gets the set of that matches the specified value. + The sets of that match the specified value. + The value to search for. + + + Determines whether the specified has equal runtime behavior as this current object. + true if the they are the equal runtime behavior; otherwise, false. + The to compare to the current object. + + + + Gets or sets whether the is read only. + true if the is read only; otherwise, false. + + + Removes the specified from the collection. + true if the operation succeeded; otherwise, false. + The item to remove. + + + + Specifies the serializer for serializing and deserializing the object. + + + Gets the enumerator that iterates through the collection. + The enumerator that can be used to iterate through the collection. + + Represents the unit of communication between AppFabric ServiceBus clients. @@ -4161,6 +5096,19 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit When the security token provided by the TokenProvider does not contain the claims to perform this operation. When the number of concurrent connections to an entity exceed the maximum allowed value. + + Abandons the lock on a peek-locked message. + The key-value pair collection of properties to modify. + + + Asynchronously abandons the lock on a peek-locked message. + The asynchronous result of the operation. + + + Asynchronously abandons the lock on a peek-locked message. + The asynchronous result of the operation. + The key-value pair collection of properties to modify. + Begins an asynchronous operation to abandon the lock on a peek-locked message. An that references the asynchronous request to abandon the lock on a peek-locked message. @@ -4169,6 +5117,13 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown when the message is in the disposed state or the receiver with which the message was received is in the disposed state. Thrown when invoked on a message that has not been received from the message server. + + Begins an asynchronous operation to abandon the lock on a peek-locked message. + An that references the asynchronous request to abandon the lock on a peek-locked message. + The key-value pair collection of properties to modify. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains information about the receive operation. This object is passed to the EndAbandon delegate when the operation is complete. + Begins an asynchronous operation to complete a message. An that references the asynchronous request to complete a message. @@ -4183,6 +5138,13 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains information about the receive operation. This object is passed to the EndDeadLetter delegate when the operation is complete. + + Begins an asynchronous operation to move the message to the dead letter queue. + An that references the asynchronous request to dead letter the message. + The key-value pair collection of properties to modify. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains information about the receive operation. This object is passed to the EndDeadLetter delegate when the operation is complete. + Begins an asynchronous operation to move the message to the dead letter queue. An that references the asynchronous request to dead letter the message. @@ -4201,6 +5163,23 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown when the message is in disposed state or the receiver with which the message was received is in disposed state. Thrown when invoked on a message that has not been received from the message server. + + Begins an asynchronous operation to defer a message. + An that references the asynchronous request to defer a message. + The key-value pair collection of properties to modify. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains information about the receive operation. This object is passed to the EndDefer(System.IAsyncResult) delegate when the operation is complete. + + + Begins an asynchronous operation to renew lock on a message. + An that references the asynchronous request to renew lock on a message. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains information about the receive operation. This object is passed to the EndRenewLock(System.IAsyncResult) delegate when the operation is complete. + + + Clones a message, so that it is possible to send a clone of a message as a new message. + Returns that contains the cloned message. + Completes the receive operation of a message and indicates that the message should be marked as processed and deleted or archived. Thrown when the message is in disposed state or the receiver with which the message was received is in disposed state. @@ -4214,6 +5193,10 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit When the security token provided by the TokenProvider does not contain the claims to perform this operation. When the number of concurrent connections to an entity exceed the maximum allowed value. + + Asynchronously completes the receive operation of a message and indicates that the message should be marked as processed and deleted or archived. + The asynchronous result of the operation. + Gets or sets the type of the content. The type of the content of the message body. This is a content type identifier utilized by the sender and receiver for application specific logic. @@ -4229,6 +5212,10 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown when the message is in disposed state or the receiver with which the message was received is in disposed state. Thrown when invoked on a message that has not been received from the message server or invoked on a message that has not been received in peek-lock mode. + + Moves the message to the dead letter queue. + The key-value pair collection of properties to modify. + Moves the message to the dead letter queue. The reason for deadlettering the message. @@ -4240,6 +5227,21 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown if the lock on the message has expired. LockDuration is an entity-wide setting and can be initialized through and for Queues and Subscriptions respectively. Thrown if the lock on the session has expired. Session lock duration is the same as message LockDuration and is an entity-wide setting. It can be initialized through and for Queues and Subscriptions respectively. + + Asynchronously moves the message to the dead letter queue. + The asynchronous result of the operation. + + + Asynchronously moves the message to the dead letter queue. + The asynchronous result of the operation. + The key-value pair collection of properties to modify. + + + Asynchronously moves the message to the dead letter queue. + The asynchronous result of the operation. + The reason for deadlettering the message. + The description information for deadlettering the message. + Indicates that the receiver wants to defer the processing for this message. Thrown when the message is in the disposed state or the receiver with which the message was received is in the disposed state. @@ -4253,6 +5255,19 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit When the security token provided by the TokenProvider does not contain the claims to perform this operation. When the number of concurrent connections to an entity exceed the maximum allowed value. + + Indicates that the receiver wants to defer the processing for this message. + The key-value pair collection of properties to modify. + + + Asynchronously indicates that the receiver wants to defer the processing for this message. + The asynchronous result of the operation. + + + Asynchronously indicates that the receiver wants to defer the processing for this message. + The asynchronous result of the operation. + The key-value pair collection of properties to modify. + Gets the number of deliveries. The number of deliveries. @@ -4322,6 +5337,14 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit When the security token provided by the TokenProvider does not contain the claims to perform this operation. When the number of concurrent connections to an entity exceed the maximum allowed value. + + Ends an asynchronous request to renew lock on a message. + An that references the RenewLock method. + + + Gets or sets the enqueued sequence number of the message. + The enqueued sequence number of the message. + Gets or sets the date and time of the sent time in UTC. The enqueue time in UTC. This value represents the actual time of enqueuing the message. @@ -4349,6 +5372,10 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown when invoked with a null object. Thrown if the message contains a null body stream or the body stream contains no data or the message body has already been consumed. + + Specifies whether the message has been consumed. + true if the message has been consumed; otherwise, false.. + Gets or sets the application specific label. The application specific label. @@ -4377,6 +5404,17 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The application specific message properties. Thrown if the message is in disposed state. + + Renews the lock on a message. + If is true, you can retry the operation immediately. + You can retry the operation immediately. + Thrown if you have called too late. In a session, this is never thrown. + Thrown instead of if the message is from a . + + + Asynchronously renews the lock on a message. + The asynchronous result of the operation. + Gets or sets the address of the queue to reply to. The reply to queue address. @@ -4409,6 +5447,10 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The message size in bytes. Thrown if the message is in disposed state. + + Gets or sets the message of the state. + The message of the state. + This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the XmlSchemaProviderAttribute to the class. An XmlSchema that describes the XML representation of the object that is produced by the WriteXml method and consumed by the ReadXml method. @@ -4547,31 +5589,78 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Represents the correlation filter expression. + + Initializes a new instance of the class with default values. + Initializes a new instance of the class with the specified correlation identifier. The identifier for the correlation. Thrown when the is null or empty. + + Gets the content type of the message. + The content type of the message. + Gets the identifier of the correlation. The identifier of the correlation. + + Gets the application specific label. + The application specific label. + Indicates whether a message matches against the current SQL expression. true if a message matches against the current SQL expression; otherwise, false. The . + + Gets the identifier of the message. + The identifier of the message. + Gets the preprocessed filter expression. The preprocessed filter expression. + + Gets the application specific properties of the message. + The application specific properties of the message. + + + Gets the address of the queue to reply to. + The address of the queue to reply to. + + + Gets the session identifier to reply to. + The session identifier to reply to. + Gets a value indicating whether the expression requires preprocessing. true if the expression requires preprocessing; otherwise, false. + + Gets the session identifier. + The session identifier. + + + Gets the address to send to. + The address to send to. + Validates the object. + + Exception for signaling message duplicate errors. + + + Initializes a new instance of the class. + The error message about the exception. + + + Initializes a new instance of the class. + The error message about the exception. + The inner exception that is the cause of the current exception. + Represents the description of an entity. @@ -4586,6 +5675,35 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Throws an exception if the entity description is read-only. + + Enumerates the possible values for the status of a messaging entity. + + + The status of the messaging entity is active. + + + The status of the messaging entity is disabled. + + + Resuming the previous status of the messaging entity. + + + The sending status of the messaging entity is disabled. + + + The receiving status of the messaging entity is disabled. + + + Provides data for the event. + + + Initializes a new instance of the with the specified exception. + The exception that this event data belongs to. + + + Gets or sets the exception that this event data belongs to. + The exception that this event data belongs to. + Represents the false filter expression. @@ -4627,10 +5745,6 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets a value indicating whether the filter expression requires preprocessing. true if the filter expression requires preprocessing; otherwise, false. - - Gets or sets the object that contains extra data. - The object that contains extra data. - Validates the FilterExpression and make sure it complies with the valid grammar rules. The filter statement is invalid or is potentially complex enough to consume too much computing power when evaluating the statement. @@ -4662,6 +5776,10 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Closes the message client entity and puts its status into a closed state. + + Asynchronously closes the message client entity and puts its status into a closed state. + The asynchronous operation. + Finishes an asynchronous operation to close the message client entity. An that references the asynchronous operation to close the message client entity. @@ -4715,6 +5833,10 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Executes when the message client entity is opened. + + Gents an object used for locking the instance. + An object used for locking the instance. + Throws an exception if the message client entity is closed. @@ -4730,6 +5852,40 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Throws an exception if the client is faulted. + + This class contains properties that enable you to retrieve details of messages from sub-queues of primary messaging entities (queues, topics, subscriptions). + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with the number of active messages, dead letters, scheduled messages, messages transferred to other queues, subscriptions, or topics, and the number of messages transferred to the dead letter queue. + The number of active messages. + The number of dead letters. + The number of scheduled messages. + The number of messages transferred to other queues, subscriptions, or topics. + The number of messages transferred to the dead letter queue. + + + Gets or sets the number of active messages in the queue, topic, or subscription. + Returns that specifies the number of active messages. + + + Gets or sets the number of messages that are dead letters. + Returns that specifies the number of messages that are dead letters. + + + Gets or sets the number scheduled messages. + Returns the number of scheduled messages. + + + Gets or sets the number messages transferred into dead letters. + Returns that specifies the number messages transferred into dead letters. + + + Gets or sets the number of messages transferred to another queue, topic, or subscription. + Returns that specifies the number of messages transferred to another queue, topic, or subscription + The exception that is thrown to signal message lock lost errors. @@ -4761,6 +5917,22 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Discards the message and relinquishes the message lock ownership. The lock token bound to the locked message instance to abandon. + + Discards the message and relinquishes the message lock ownership. + The lock token. + The properties to modify. + + + Asynchronously discards the message and relinquishes the message lock ownership. + The asynchronous operation. + The lock token bound to the locked message instance to abandon. + + + Asynchronously discards the message and relinquishes the message lock ownership. + The asynchronous operation. + The lock token. + The properties to modify. + Gets the batch flush interval. The batch flush interval. The default value is 20 ms. @@ -4776,6 +5948,14 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. + + Begins an asynchronous operation to abandon the message and relinquish its lock. + An that references the asynchronous operation to abandon the message and relinquish its lock. + The lock token. + The properties to modify. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Begins an asynchronous operation to complete receipt of a message. An object that references the asynchronous . @@ -4783,6 +5963,13 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. + + Begins an asynchronous operation to complete a message batching. + A that references the operation. + The lock tokens. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Begins an asynchronous operation to move a message to the dead letter queue. An that references the asynchronous operation to move a message to the dead letter queue. @@ -4790,6 +5977,14 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. + + Begins an asynchronous operation to move a message to the dead letter queue. + An that references the asynchronous operation to move a message to the dead letter queue. + The lock token. + The properties to modify. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Begins an asynchronous operation to move a message to the dead letter queue. An that references the asynchronous operation to move a message to the dead letter queue. @@ -4806,6 +6001,42 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. + + Begins an asynchronous operation to suspend receipt of a message. + An object that references the asynchronous operation to suspend receipt of a message. + The lock token. + The properties to modify. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an operation to peek a message. + The result of the operation to peek a message. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an operation to peek a message. + The result of the operation to peek a message. + The sequence number from where to peek a message. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an operation to peek a batch of message. + The result of the operation to peek a message. + The number of message. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an operation to peek a batch of message. + The result of the operation to peek a message. + The sequence number from where to peek a batch of message. + The number of message. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Begins an asynchronous operation to receive a message. An that references the asynchronous operation to receive a message. @@ -4826,13 +6057,54 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. + + Begins an asynchronous operation to receive a batch of message. + An that references the asynchronous operation to receive a batch of message. + The sequence numbers. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to receive a batch of message. + An that references the asynchronous operation to receive a batch of message. + The number of message. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to receive a batch of message. + An that references the asynchronous operation to receive a batch of message. + The number of message. + The server wait time. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Completes the receive operation on a message. The lock token of the . This is only available when a message is received in peek-lock mode. The lock token is used internally to complete or abandon a message. - - Moves the undelivered message to the dead letter queue. + + Asynchronously completes the receive operation on a message. + The asynchronous operation. + The lock token. + + + Completes the receive operation on a batch of message. + The lock tokens. + + + Asynchronously completes the receive operation on a batch of message. + The asynchronous operation. + The lock tokens. + + + Moves the undelivered message to the dead letter queue. + The lock token bound to the locked message instance. + + + Moves the undelivered message to the dead letter queue. The lock token bound to the locked message instance. + The properties to modify. Moves the undelivered message to the dead letter queue. @@ -4840,11 +6112,45 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The reason for deadlettering the message. The error description for deadlettering the message. + + Asynchronously moves the undelivered message to the dead letter queue. + The asynchronous operation. + The lock token bound to the locked message instance. + + + Asynchronously moves the undelivered message to the dead letter queue. + The asynchronous operation. + The lock token bound to the locked message instance. + The properties to modify. + + + Asynchronously moves the undelivered message to the dead letter queue. + The asynchronous operation. + The lock token bound to the locked message instance. + The reason for deadlettering the message. + The error description for deadlettering the message. + Indicates that the receiver wants to defer the processing for the message. The lock token of the . This is only available when a message is received in peek-lock mode. The lock token is used internally to complete or abandon a message. Receive context is null. + + Indicates that the receiver wants to defer the processing for the message. + The lock token. + The properties to modify. + + + Asynchronously defer the processing of the message. + Returns . + The lock token. + + + Asynchronously defer the processing of the message. + The asynchronous operation. + The lock token. + The properties to modify. + Ends the asynchronous operation to abandon the message and relinquish its lock. An that references the asynchronous operation to abandon the message and relinquish its lock. @@ -4853,6 +6159,10 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Ends the asynchronous operation to complete receipt of a message. An that references the asynchronous operation to complete receipt of a message. + + Ends the asynchronous operation to complete receipt of a batch message. + The result of the operation. + Ends an asynchronous operation to move the message to the dead letter queue. An object that references the asynchronous operation to move the message to the dead letter queue. @@ -4862,12 +6172,27 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Ends an asynchronous operation to defer receipt of a message. An object that references the asynchronous operation to defer receipt of a message. + + Ends an asynchronous operation to peek a message. + The that represents the message peeked. + An object that references the asynchronous operation to peek a message. + + + Ends an asynchronous operation to peek a batch of message. + The batch of message. + An object that references the asynchronous operation to peek a message. + Ends an asynchronous operation to receive a message. - The that represents the received message. + The that represents the received message. An object that references the asynchronous operation to receive a message. The operation times out. + + Ends an asynchronous operation to receive a batch of message. + An object that represents the batch of message. + The result of the operation. + Gets the lock token bound to the message. The lock token of the message. @@ -4878,24 +6203,30 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The collection of lock tokens from the specified messages. The collection of messages from which to get the lock tokens. + + Gets or sets the sequence number of the message last peeked. + The sequence number of the message last peeked. + Gets the message receive mode. The message receive mode. - + Executes upon calling the Abandon operation. The context information associated by a transaction tracking this operation. The collection of lock tokens bound to the locked message instances. + The properties to modify. The time span the operation waits before it times out. - + Executes upon calling the OnAbandon or BeginAbandon operation. An that references the asynchronous operation to abandon the messages and relinquish its lock. The context information associated by a transaction tracking this operation. The collection of lock tokens bound to the locked message instances. + The properties to modify. The time span the operation waits before it times out. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Executes upon calling the OnComplete or BeginComplete operation. @@ -4906,34 +6237,55 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. - + Executes upon calling the OnDeadLetter or BeginDeadLetter operation. - An that references the asynchronous operation to move undelivered of messages to the deadletter queue. + Returns . The context information associated by a transaction tracking this operation. The collection of lock tokens bound to the locked message instances. + The properties to modify. The reason for deadlettering the messages. The error description for deadlettering the messages. The time span the operation waits before it times out. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. - + Executes upon calling the OnDefer or BeginDefer operation. An that references the asynchronous operation to suspend processing of messages. The context information associated by a transaction tracking this operation. The collection of lock tokens bound to the locked message instances. + The properties to modify. The time span the operation waits before it times out. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. + + + Executes upon calling the BeginPeek operation. + The result of the operation. + The context information associated by a transaction tracking this operation. + The sequence number from where to begin the operation. + The number of message. + The time span the operation waits before it times out. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Executes upon calling the OnBegin operation for lock messages. + An that references the asynchronous operation to renew processing of lock messages. + The context information associated by a transaction tracking this operation. + The collection of lock tokens bound to the locked message instances. + The time span the operation waits before it times out. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. Executes upon calling the OnTryReceive or BeginTryReceive operation. An that references the asynchronous operation to try to receive messages. The context information associated by a transaction tracking this operation. - The collection of unique numbers assigned to messages, by the Service Bus. + The collection of unique numbers assigned to messages, by the Service Bus. The time span the operation waits before it times out. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Executes upon calling the OnTryReceive or BeginTryReceive operation. @@ -4950,18 +6302,20 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The collection of lock tokens bound to the locked message instances. The time span the operation waits before it times out. - + Executes upon calling the DeadLetter operation. The context information associated by a transaction tracking this operation. The collection of lock tokens bound to the locked message instances. + The properties to modify. The reason for deadlettering the message. The error description for deadlettering the message. The time span the operation waits before it times out. - + Executes upon calling the Defer operation. The context information associated by a transaction tracking this operation. The collection of lock tokens bound to the locked message instances. + The properties to modify. The time span the operation waits before it times out. @@ -4980,17 +6334,42 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Executes the end defer action. The result. + + Executes the EndPeek operation. + A list of messages. + The result of the operation. + + + Executes the EndRenew action for message locks. + A of lock messages. + The result of the operation. + Executes the end try receive action. true if it succeeds; false if it fails. The result. The received message collection. + + Executes upon calling the Peek operation. + The messages peeked. + The tracking context. + The sequence number from where to peek. + The number of message. + The time span the operation waits before it times out. + + + Executes the Renew action for lock messages. + The renewed lock messages. + The tracking context. + The lock tokens. + The time span the operation waits before it times out. + Executes upon calling the TryReceive operation. true indicating that this method operation succeeded; otherwise, false. The context information associated by a transaction tracking this operation. - The collection of unique numbers assigned to messages, by the Service Bus. + The collection of unique numbers assigned to messages, by the Service Bus. The time span the operation waits before it times out. When this method returns, contains the collection of messages received. @@ -5006,6 +6385,46 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets the path of the queue or topic, relative to the base address. A string representing the path of the queue or topic. + + Reads the next message without changing the state of the receiver or the message source. + The that represents the next message to be read. + + + Reads the next message without changing the state of the receiver or the message source. + The that represents the next message to be read. + The sequence number from where to read the message. + + + Asynchronously reads the next message without changing the state of the receiver or the message source. + The asynchronous operation. + + + Asynchronously reads the next message without changing the state of the receiver or the message source. + The asynchronous operation. + The sequence number from where to read the message. + + + Reads the next batch of message without changing the state of the receiver or the message source. + The batch of message to be read. + The number of message. + + + Reads the next batch of message without changing the state of the receiver or the message source. + The batch of message to be read. + The sequence number from where to read a batch message. + The number of message. + + + Asynchronously reads the next batch of message without changing the state of the receiver or the message source. + The asynchronous operation. + The number of message. + + + Asynchronously reads the next batch of message without changing the state of the receiver or the message source. + The asynchronous operation. + The sequence number from where to read a batch message. + The number of message. + Gets or sets the number of messages that the message receiver can simultaneously request. The number of messages that the message receiver can simultaneously request. @@ -5023,7 +6442,52 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Receives a from the current queue or topic. The that represents the received message. The time span the server waits before the operation times out. - Thrown when operation times out. + + + Asynchronously receives a message from the current queue or topic. + The asynchronous operation. + + + Asynchronously receives a message from the current queue or topic. + The asynchronous operation. + The sequence number of the message to receive. + + + Asynchronously receives a message from the current queue or topic. + The asynchronous operation. + The time span the server waits before the operation times out. + + + Receives a batch of messages. + A batch of messages. + The sequence numbers. + + + Receives a batch of messages. + A batch of messages. + The maximum number of messages to return in the batch. As this is an approximation, fewer messages may be returned even if the number of messages is higher than . + + + Receives a batch of messages. + A batch of messages. + The maximum number of messages to receive. + The server wait time. + + + Asynchronously receives a batch of messages. + The asynchronous operation. + The sequence numbers. + + + Asynchronously receives a batch of messages. + The asynchronous operation. + The maximum number of messages to return in the batch. As this is an approximation, fewer messages may be returned even if the number of messages is higher than . + + + Asynchronously receives a batch of messages. + The asynchronous operation. + The maximum number of messages to receive. + The server wait time. The class is used to send messages from the Service Bus. Although you can use the class to send and receive messages without creating a object, you can also use and to create a sender and receiver on an entity without knowing whether it is a topic or a queue. @@ -5031,7 +6495,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets the batch flush interval. A batch flush interval. The default value is 20 ms. - Thrown when the is in closing, closed, or faulted state. + Thrown when the is in closing, closed, or faulted state. Gets a value indicating whether the batching is enabled. @@ -5046,10 +6510,21 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown when operation times out. Timeout period is initialized through the . You may need to increase the value of the to avoid this exception if the timeout value is relatively low. Thrown when the brokered message is null. + + Begins an asynchronous request to send a brokered message by batch. + The synchronous result of the operation. + The brokered message to send. + A delegate that references the method to invoke when the operation is complete. + A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete. + Ends an asynchronous request to send a message. A that references the method. + + Ends an asynchronous request to send a message by batch. + The result of the operation. + Allows concrete implementations to define what should be done when sending messages. This method cannot be implemented in a concrete class by the user. A for the operation. @@ -5079,6 +6554,20 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown when operation times out. Timeout period is initialized through the . You may need to increase the value of to avoid this exception if the timeout value is relatively low. Thrown when is null. + + Asynchronously sends the specified brokered message. + The asynchronous result of the operation. + The brokered message to send. + + + Sends a set of brokered messages (for batch processing). + The collection of brokered messages to send. + + + Asynchronously sends a set of brokered messages (for batch processing). + The asynchronous result of the operation. + The collection of brokered messages to send. + Represents a message session that allows grouping of related messages for processing in a single transaction. @@ -5088,6 +6577,12 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. + + Starts the renewal of lock of the message session. + An that references the asynchronous operation to get the state of the operation. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Begins an asynchronous operation to set the state of the message session. An that references the asynchronous operation to get the state of the message session. @@ -5100,6 +6595,10 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The stream from which the state information is persisted. An that references the asynchronous operation to get the state of the message session. + + Starts the renewal of lock of the message session. + The result of the operation. + Ends an asynchronous operation to set the state of the message session. An that references the asynchronous operation to set the state of the message session. @@ -5108,23 +6607,37 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets the state of the message session. The stream from which the state information is persisted. - - Abandons the message. + + Asynchronously gets the state of the message session. + The stream from which the state information is persisted. + + + Gets or sets the last peeked sequence number in the session. + The last peeked sequence number in the session. + + + Gets or sets the date and time at which the message session is unlocked. + The date and time for the message session to be locked. + + + Executes upon calling the Abandon operation. The context information associated by a transaction tracking this operation. - The lock tokens of the collection. This is only available when a message is received in peek-lock mode. The lock token is used internally to complete or abandon a message. - The time span interval the operation waits before it times out. + The collection of lock tokens bound to the locked message instances. + The properties to modify. + The time span the operation waits before it times out. Aborts the message session. - - Begins an asynchronous operation to abandon the message and relinquish its lock. - An that references the asynchronous operation to abandon the messages and relinquish its lock. + + Executes upon calling the OnAbandon or BeginAbandon operation. + An that references the asynchronous operation to get the result of the operation. The context information associated by a transaction tracking this operation. - The lock tokens of the collection. This is only available when a message is received in peek-lock mode. The lock token is used internally to complete or abandon a message. - The time span interval the operation waits before it times out. + The collection of lock tokens bound to the locked message instances. + The properties to modify. + The time span the operation waits before it times out. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Begins an asynchronous operation to close the communication object for the message session. @@ -5142,25 +6655,27 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. - + Executes upon calling the OnDeadLetter or BeginDeadLetter operation. - An that references the asynchronous operation to move undelivered messages to the deadletter queue. + An that references the asynchronous operation to get the state of the operation. The context information associated by a transaction tracking this operation. The collection of lock tokens bound to the locked message instances. + The properties to modify. The reason for deadlettering the messages. The error description for deadlettering the messages. - The time span interval the operation waits before it times out. + The time span the operation waits before it times out. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. - + Executes upon calling the OnDefer or BeginDefer operation. An that references the asynchronous operation to suspend processing of messages. The context information associated by a transaction tracking this operation. The collection of lock tokens bound to the locked message instances. - The time span interval the operation waits before it times out. + The properties to modify. + The time span the operation waits before it times out. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Executes upon calling the OnGetState or BeginGetState operation. @@ -5177,6 +6692,33 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. + + Executes upon calling the OnPeek or BeginPeek operation. + An that references the asynchronous operation to peek a communication of the message session. + The context information associated by a transaction tracking this operation. + The sequence number to peek from the session. + The number of message in the operation. + The time span interval the operation waits before it times out. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Executes upon calling the RenewLock or BeginRenewLock operation. + An that references the asynchronous operation to get the state of the operation. + The context information associated by a transaction tracking this operation. + The time span interval the operation waits before it times out. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Executes upon calling the OnBegin operation for lock messages. + An that references the asynchronous operation to renew processing of lock messages. + The context information associated by a transaction tracking this operation. + The collection of lock tokens bound to the locked message instances. + The time span the operation waits before it times out. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Executes upon calling the OnSetState or BeginSetState operation. An that references the asynchronous operation to set the state of the message session. @@ -5210,19 +6752,21 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The collection of lock tokens bound to the locked message instances. The time span interval the operation waits before it times out. - - Deadletters a message. + + Executes upon calling the DeadLetter operation. The context information associated by a transaction tracking this operation. The collection of lock tokens bound to the locked message instances. - The reason for deadlettering the messages. - The error description for deadlettering the messages. - The time span interval the operation waits before it times out. + The properties to modify. + The reason for deadlettering the message. + The error description for deadlettering the message. + The time span the operation waits before it times out. - - Defers the delivery of a message. + + Executes upon calling the Defer operation. The context information associated by a transaction tracking this operation. The collection of lock tokens bound to the locked message instances. - The time span interval the operation waits before it times out. + The properties to modify. + The time span the operation waits before it times out. Ends an asynchronous operation to abandon the message and relinquish its lock. @@ -5253,6 +6797,21 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Ends the asynchronous operation to open a communication object for the message session. An that references the asynchronous operation to open a communication object for the message session. + + Executes upon calling the EndPeek operation. + The list of message from the session. + An that references the asynchronous operation to peek a communication of the message session. + + + Executes the EndRenewLock operation of the message receiver. + The date and time when the renewal of lock ends. + An that references the asynchronous operation to get the state of the message session. + + + Executes the EndRenew action for message locks. + An of locked messages.. + The result of the operation. + Ends the asynchronous operation to set the state of the message session. An that references the asynchronous operation to set the state of the message session. @@ -5269,6 +6828,12 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The context information associated by a transaction tracking this operation. The time span interval the get operation waits before it times out. + + Executes the RenewLock action for message locks. + The time span the operation waits before it times out. + The context information associated by a transaction tracking this operation. + The time span interval the operation waits before it times out. + Executes upon calling the SetState operation. The context information associated by a transaction tracking this operation. @@ -5299,6 +6864,17 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets the number of messages that the message receiver can simultaneously request. The number of messages that the message receiver can simultaneously request. + + Specifies the time period within which the host renews its lock on a message. + If is true, you can retry the operation immediately. + You can retry the operation immediately. + You can retry the operation immediately. + Thrown instead of if the message is from a . + + + Specifies the time period within which the host renews its lock on a message. + The host that is being locked. + Gets or sets the message session identifier. The message session identifier. @@ -5307,6 +6883,23 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Sets the state of the message session. The stream to which the state information is persisted. + + Asynchronously sets the state of the message session. + The state of the message session. + The stream to which the state information is persisted. + + + Enumerates a message state. + + + Specifies an active message state. + + + Specifies a deferred message state. + + + Specifies the scheduled message state. + The exception that is thrown for signaling message store lock lost errors. @@ -5343,6 +6936,23 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The error message that explains the reason for the exception. The exception that is the cause of the current exception. + + Populates the serialization information with data about the exception. + The serialized object data about the exception being thrown. + The contextual information about the source or destinations. + + + Exception for signaling messaging entity disabled errors. + + + Initializes a new instance of the class. + The name of the entity responsible for the exception. + + + Initializes a new instance of the class. + The error message about the exception. + The inner exception that is the cause of the current exception. + The exception that is thrown for signaling messaging entity not found errors. @@ -5355,6 +6965,10 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The error message that explains the reason for the exception. The exception that is the cause of the current exception. + + Returns a string representation of the current exception. + A string representation of the current exception. + The exception that is thrown for signaling messaging errors. @@ -5382,7 +6996,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The contextual information about the source or destinations. - Gets a value indicating whether the exception is transient. + Gets a value indicating whether the exception is transient. Check this property to determine if the operation should be retried. True if the exception is transient; otherwise, false. @@ -5407,13 +7021,18 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The exception details for the entity not found error. The descriptive message about the exception. + + Returns the exception details for the entity update conflict error. + The exception details for the entity update conflict error. + The name of the entity. + Gets the error code. The error code. Gets the error level. - One of the values of the enumeration. + One of the values of the enumeration. Gets the descriptive message about the exception. @@ -5461,10 +7080,87 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Represents a messaging factory. This is the anchor class used for run-time operations to send and receive to and from queues, topics, or subscriptions. + + Returns available sessions across all session-enabled subscriptions and queues in the service namespace. + A that allows grouping of related messages for processing in a single transaction. + + + Returns available sessions across all session-enabled subscriptions and queues in the service namespace. + A that allows grouping of related messages for processing in a single transaction. + The processing time out. + + + Asynchronously returns available sessions across all session-enabled subscriptions and queues in the service namespace. + A task instance that represents the asynchronous operation for accept message session. + + + Asynchronously returns available sessions across all session-enabled subscriptions and queues in the service namespace. + A task instance that represents the asynchronous operation for accept message session. + The processing time out. + Gets the base address of the messaging factory. A URI that represents the base address of the messaging factory. + + Begin an asynchronous operation to accept a message session. + An that references the asynchronous operation to accept a message session. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begin an asynchronous operation to accept a message session. + An that references the asynchronous operation to accept a message session. + The operation timeout. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous request to create a object. + An object that references the asynchronous create a operation. + An enumeration of namespace base address. + The settings. + An delegate that references the method to invoke when the operation is complete. + A user-provided object that contains information about the create operation. + + + Begins an asynchronous request to create a object. + An object that references the asynchronous create a operation. + An enumeration of namespace base address. + The token provider. + An delegate that references the method to invoke when the operation is complete. + A user-provided object that contains information about the create operation. + + + Begins an asynchronous request to create a object. + An object that references the asynchronous create a operation. + An enumeration of namespace base address. + An delegate that references the method to invoke when the operation is complete. + A user-provided object that contains information about the create operation. + + + Begins an asynchronous request to create a object. + An object that references the asynchronous create a operation. + An enumeration of namespace base address. + The settings. + An delegate that references the method to invoke when the operation is complete. + A user-provided object that contains information about the create operation. + + + Begins an asynchronous request to create a object. + An object that references the asynchronous create a operation. + An enumeration of namespace base address. + The token provider. + An delegate that references the method to invoke when the operation is complete. + A user-provided object that contains information about the create operation. + + + Begins an asynchronous request to create a object. + An object that references the asynchronous create a operation. + An enumeration of namespace base address. + An delegate that references the method to invoke when the operation is complete. + A user-provided object that contains information about the create operation. + Begins an asynchronous request to create a object. An object that references the asynchronous create a operation. @@ -5489,6 +7185,13 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit contains a path appended to the full address of the service namespace. + + Begins an asynchronous request to create a object. + An object that references the asynchronous create a operation. + The namespace base address. + An delegate that references the method to invoke when the operation is complete. + A user-provided object that contains information about the create operation. + Begins an asynchronous request to create a object. An object that references the asynchronous create a operation. @@ -5513,6 +7216,13 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit contains a path appended to the full address of the service namespace. + + Begins an asynchronous request to create a object. + An object that references the asynchronous create a operation. + The namespace base address. + An delegate that references the method to invoke when the operation is complete. + A user-provided object that contains information about the create operation. + Begins a create message receiver. An object that references the asynchronous create message receiver. @@ -5535,10 +7245,57 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The callback. The state. + + Begins a create message sender. + An object that references the asynchronous create message sender. + The transfer destination entity path. + The via-entity path. + The callback. + The state. + Creates a new messaging factory object. The newly created object. + + Creates a new object. + The newly created object. + An enumeration of base addresses. + + + Creates a new object. + The newly created object. + An enumeration of base addresses. + The factory settings. + + + Creates a new object. + The newly created object. + An enumeration of base addresses. + The token provider. + + + Creates a new object. + The newly created object. + An enumeration of address. + + + Creates a new object. + The newly created object. + An enumeration of address. + The factory settings. + + + Creates a new object. + The newly created object. + An enumeration of address. + The token provider. + + + Creates a new object. + The newly created object. + The base address of the service namespace. + Creates a new object. The newly created object. @@ -5559,6 +7316,11 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown when is empty. Thrown when or are null. + + Creates a new object. + The newly created object. + The namespace base address. + Creates a new object. The newly created object. @@ -5577,38 +7339,134 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit contains a path appended to the full address of the service namespace. Thrown when or are null. - - Creates a new object from a connection string. - The newly created object. - The connection string. + + Asynchronously creates a new messaging factory object. + A task instance that represents the asynchronous create operation. + An enumeration of base addresses. - - Creates a message receiver. - The newly created message receiver. - The path of the entity. + + Asynchronously creates a new messaging factory object. + A task instance that represents the asynchronous create operation. + An enumeration of base addresses. + The settings. - - Creates a message receiver. - The newly created message receiver. - The path of the entity. - The receive mode. + + Asynchronously creates a new messaging factory object. + A task instance that represents the asynchronous create operation. + An enumeration of base addresses. + The token provider. - - Creates a message sender. - The newly created message sender. - The path of the entity. + + Asynchronously creates a new messaging factory object. + A task instance that represents the asynchronous create operation. + An enumeration of address. - - Creates a new queue client. - The newly created queue client. - The path of the queue relative to the service namespace base address. - + + Asynchronously creates a new messaging factory object. + A task instance that represents the asynchronous create operation. + An enumeration of address. + The settings. + + + Asynchronously creates a new messaging factory object. + A task instance that represents the asynchronous create operation. + An enumeration of address. + The token provider. + + + Asynchronously creates a new messaging factory object. + A task instance that represents the asynchronous create operation. + The base address of the service namespace. + + + Asynchronously creates a new messaging factory object. + A task instance that represents the asynchronous create operation. + The base address of the service namespace. + The settings. + + + Asynchronously creates a new messaging factory object. + A task instance that represents the asynchronous create operation. + The base address of the service namespace. + The token provider. + + + Asynchronously creates a new messaging factory object. + A task instance that represents the asynchronous create operation. + The namespace base address. + + + Asynchronously creates a new messaging factory object. + A task instance that represents the asynchronous create operation. + The namespace base address. + The settings. + + + Asynchronously creates a new messaging factory object. + A task instance that represents the asynchronous create operation. + The namespace base address. + The token provider. + + + Creates a new object from a connection string. + The newly created object. + The connection string. + + + Creates a message receiver. + The newly created message receiver. + The path of the entity. + + + Creates a message receiver. + The newly created message receiver. + The path of the entity. + The receive mode. + + + Asynchronously creates a message receiver. + A task instance that represents the asynchronous create message receiver operation. + The path of the entity. + + + Asynchronously creates a message receiver. + A task instance that represents the asynchronous create message receiver operation. + The path of the entity. + The receive mode. + + + Creates a message sender. + The newly created message sender. + The path of the entity. + + + Creates a message sender. + The created object. + The transfer destination entity path. + The via-entity path. + + + Asynchronously creates a message sender. + A task instance that represents the asynchronous create message sender operation. + The path of the entity. + + + Asynchronously creates a message sender. + A task instance that represents the asynchronous create message sender operation. + The transfer destination entity path. + The via-entity path. + + + Creates a new queue client. + The newly created queue client. + The path of the queue relative to the service namespace base address. + is null or empty. length is greater than . The operation times out. The timeout period is initialized through the object. You may need to increase the value of to avoid this exception if the timeout value is relatively low. An internal error or unexpected exception occurs. - The factory has been closed or aborted. + The factory has been closed or aborted. Creates a new queue client. @@ -5621,7 +7479,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit length is greater than . The operation times out. The timeout period is initialized through the object. You may need to increase the value of to avoid this exception if the timeout value is relatively low. An internal error or unexpected exception occurs. - The factory has been closed or aborted. + The factory has been closed or aborted. Creates a subscription client. @@ -5632,7 +7490,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The length of is greater than . The operation times out. The timeout period is initialized through the object. You may need to increase the value of to avoid this exception if the timeout value is relatively low. An internal error or unexpected exception occurs. - The factory has been closed or aborted. + The factory has been closed or aborted. Creates a new subscription client. @@ -5644,7 +7502,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The length of is greater than . The operation times out. The timeout period is initialized through the object. You may need to increase the value of to avoid this exception if the timeout value is relatively low. An internal error or unexpected exception occurs. - The factory has been closed or aborted. + The factory has been closed or aborted. Creates a new topic client. @@ -5653,7 +7511,12 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The supplied is null. The operation times out. The timeout period is initialized through the object. You may need to increase the value of to avoid this exception if the timeout value is relatively low. An internal error or unexpected exception occurs. - The factory has been closed or aborted. + The factory has been closed or aborted. + + + Ends an asynchronous request to accept a object. + A that has been ended. + The result. Ends an asynchronous request to create a object. @@ -5677,6 +7540,12 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Executes the abort action. + + Executes the accept message session. + The that has been executed. + The message receive mode. + The operation timeout. + Executes the accept session receiver action. An object that references the asynchronous accept session receiver action. @@ -5685,6 +7554,14 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The message receive mode. The wait time before the operation times out. + + Executes the begin accept message session action. + An object that references the asynchronous accept message session action. + The message receive mode. + The wait time before the operation times out. + The message callback. + The state. + Executes the begin accept session receiver action. An object that references the asynchronous accept session receiver action. @@ -5711,6 +7588,15 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains information about the receive operation. + + Executes the begin create message sender action. + An object that references the asynchronous create message sender action. + The name of the transfer destination entity. + The via-entity name. + The timeout. + The callback message. + The state. + Executes the begin create message sender action. An object that references the asynchronous create message sender action. @@ -5730,6 +7616,13 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The message receive mode. The timeout. + + Executes the create message sender action. + The executed action. + The name of the transfer destination entity. + The via-entity name. + The message timeout. + Executes the create message sender action. An object that references the asynchronous create message sender action. @@ -5742,6 +7635,12 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The path of the queue relative to the service namespace base address. The receive mode. + + Executes a create subscription client action. + A newly created subscription client. + The subscription path. + The receive mode. + Executes a create subscription client action. A newly created subscription client. @@ -5754,9 +7653,14 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The newly created topic client. The path of the topic relative to the service namespace base address. + + Executes the end accept message session action. + The executed action. + The result of the operation. + Executes the end accept session receiver action. - A object. + The executed object. An object that stores state information and any user-defined data for this asynchronous operation. @@ -5765,14 +7669,18 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Executes the end create message receiver action. - A object. + The executed action. The result. Executes the end create message sender action. - A object. + The executed action. The result. + + Gets or sets the number of messages that the message receiver can simultaneously request. + The number of messages that the message receiver can simultaneously request. + Represents the messaging factory settings. @@ -5783,25 +7691,37 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Initializes a new instance of the class with the specified messaging factory settings for cloning. The specified messaging factory settings. + + Gets or set the transport settings for the Advanced Message Queuing Protocol (AMQP). + The transport settings for the Advanced Message Queuing Protocol (AMQP). + Creates a copy of . A created copy of . + Gets or sets the transport settings required for the net messaging. The transport settings required for the net messaging. + + Executes the asynchronous begin create factory action. + An that references the asynchronous request to create factory. + The collection of uniform resource identifiers. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains information about the receive operation. + - Executes the begin create factory action. - The executed action. + Executes the asynchronous begin create factory action. + An that references the asynchronous request to create factory. The uniform resource identifier. - The asynchronous callback. - The state. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains information about the receive operation. - Executes the end create factory action. - The result of the execution. - The result of the execution. + Ends an asynchronous request to create factory. + The newly created messaging factory. + An that references the asynchronous request to create factory. Gets or sets the that specifies how long the messaging operation has to complete before timing out. @@ -5813,6 +7733,10 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets the token provider of the factory settings. The token provider of the factory settings. + + Gets or sets the messaging transport type. + The messaging transport type. + Represents the binding that is used for net messaging. @@ -5936,6 +7860,43 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Makes a deep copy of this object. A copy of this object. + + Gets a value that indicates whether the message redirect is enabled. + true if the message redirect is enabled; otherwise, false. + + + The exception that is thrown when subscription matching resulted no match. + + + Initializes a new instance of the class with error message. + The error message about the exception. + + + Initializes a new instance of the class with error message and inner exception. + The error message about the exception. + The inner exception that is the cause of the current exception. + + + Returns the string representation of the . + The string representation of the . + + + Provides options associated with message pump processing using and . + + + Initializes a new instance of the class. + + + Gets or sets a value that indicates whether the message-pump should call or on messages after the callback has completed processing. + true to complete the message processing automatically on successful execution of the operation; otherwise, false. + + + Occurs when exception is received. Enables you to be notified of any errors encountered by the message pump + + + Gets or sets the maximum number of concurrent calls to the callback the message pump should initiate. + The maximum number of concurrent calls to the callback. + The exception that is thrown for signaling partition not owned errors. @@ -5948,6 +7909,12 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The error message that describes the cause of the exception. The inner exception that is the cause of the current exception. + + Represents credential properties for a push notification service. + + + Initializes a new instance of the class. + Represents the queue client object. @@ -5955,13 +7922,29 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Discards the message and relinquishes the message lock ownership. The lock token bound to the locked message instance to abandon. Thrown if the operation exceeded the timeout value set by . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. + + + Discards the message and relinquishes the message lock ownership. + The lock token bound to the locked message instance to abandon. + The properties of the message to modify. + + + Asynchronously discards the message and relinquishes the message lock ownership. + The discarded message. + The lock token bound to the locked message instance to abandon. + + + Asynchronously discards the message and relinquishes the message lock ownership. + The discarded message. + The lock token bound to the locked message instance to abandon. + The properties of the message to modify. Accepts a message session that allows grouping of related messages for processing in a single transaction. A that allows grouping of related messages for processing in a single transaction. Thrown if the operation exceeded the timeout value set by . - Thrown if the client is already closed, aborted, or disposed. + Thrown if the client is already closed, aborted, or disposed. Accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier. @@ -5969,7 +7952,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The session identifier of the message session. Thrown if sessionId is null, empty, or white spaces. Thrown if the operation exceeded the timeout value set by . - Thrown if the client is already closed, aborted, or disposed. + Thrown if the client is already closed, aborted, or disposed. Accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier and wait time. @@ -5979,40 +7962,68 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown if sessionId is null, empty, or white spaces. Thrown if is not a positive TimeSpan value. Thrown if the operation exceeded the timeout value set by . - Thrown if the client is already closed, aborted, or disposed. + Thrown if the client is already closed, aborted, or disposed. Accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time. A that allows grouping of related messages for processing in a single transaction. The time span the server waits for processing messages before it times out. Thrown if is not a positive TimeSpan value. - Thrown if the operation exceeded the timeout value set by . - Thrown if the client is already closed, aborted, or disposed. + Thrown if the operation exceeded the timeout value set by . + Thrown if the client is already closed, aborted, or disposed. + + + Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction. + The result of an asynchronous operation. + + + Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier. + The result of an asynchronous operation. + The session identifier of the message session. + + + Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier and wait time. + The result of an asynchronous operation. + The session identifier of the message session. + The time span the server waits for processing messages before it times out. + + + Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time. + The result of an asynchronous operation. + The time span the server waits for processing messages before it times out. Begins an asynchronous operation to abandon the message and relinquish its lock. An that references the asynchronous operation to abandon the message and relinquish its lock. The lock token bound to the locked message instance to abandon. An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to abandon the message and relinquish its lock. + An that references the asynchronous operation to abandon the message and relinquish its lock. + The lock token bound to the locked message instance to abandon. + The properties of the message to modify. + An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. Begin an asynchronous operation to accept a message session. An that references the asynchronous operation to accept a message session. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown if the operation exceeded the timeout value set by . - Thrown if the client is already closed, aborted, or disposed. + Thrown if the client is already closed, aborted, or disposed. Begin an asynchronous operation to accept a message session. An that references the asynchronous operation to accept a message session. The session identifier of the message session. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown if sessionId is null, empty, or white spaces. Thrown if the operation exceeded the timeout value set by . - Thrown if the client is already closed, aborted, or disposed. + Thrown if the client is already closed, aborted, or disposed. Begin an asynchronous operation to accept a message session. @@ -6020,42 +8031,57 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The session identifier of the message session. The time span the server waits for processing messages before it times out. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown if sessionId is null, empty, or white spaces. Thrown if is not a positive TimeSpan value. Thrown if the operation exceeded the timeout value set by . - Thrown if the client is already closed, aborted, or disposed. + Thrown if the client is already closed, aborted, or disposed. Begin an asynchronous operation to accept a message session. An that references the asynchronous operation to accept a message session. The time span the server waits for processing messages before it times out. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown if is not a positive TimeSpan value. - Thrown if the operation exceeded the timeout value set by . - Thrown if the client is already closed, aborted, or disposed. + Thrown if the operation exceeded the timeout value set by . + Thrown if the client is already closed, aborted, or disposed. Begins an asynchronous operation to complete processing of a message. An that references the asynchronous operation to complete processing of a message. The lock token bound to the locked message instance. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown if the operation exceeded the timeout value set by . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the message represented by the has lost the message lock. + + Begins an asynchronous operation to complete processing of a message batch. + An that references the asynchronous operation to complete processing of a message batch. + The lock tokens associated with locked messages in the batch. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Begins an asynchronous operation to move a message to the dead letter queue. An that references the asynchronous operation to move a message to the dead letter queue. The lock token bound to the locked message instance. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown if the operation exceeded the timeout value set by . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the message represented by the has lost the message lock. + + Begins an asynchronous operation to move a message to the dead letter queue. + An that references the asynchronous operation to move a message to the dead letter queue. + The lock token bound to the locked message instance. + The properties of the message to modify. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Begins an asynchronous operation to move a message to the dead letter queue. An that references the asynchronous operation to move a message to the dead letter queue. @@ -6063,9 +8089,9 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The reason for deadlettering the message. The error description for deadlettering the message. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown if the operation exceeded the timeout value set by . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the message represented by the has lost the message lock. @@ -6073,54 +8099,146 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An that references the asynchronous operation to suspend processing of a message. The lock token bound to the locked message instance. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown if the operation exceeded the timeout value set by . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the message represented by the has lost the message lock. + + Begins an asynchronous operation to suspend processing of a message. + An that references the asynchronous operation to suspend processing of a message. + The lock token bound to the locked message instance. + The properties of the message to modify. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to get the message sessions. + An that references the asynchronous operation to get the message sessions. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to get the message sessions. + An that references the asynchronous operation to get the message sessions. + The date and time of the last update. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to peek a message. + An that references the asynchronous operation to peek a message. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to peek a message. + An that references the asynchronous operation to peek a message. + A sequence number from where to peek a message. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to peek a batch of messages. + An that references the asynchronous operation to peek a batch of messages. + The number of messages to peek. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to peek a batch of messages. + An that references the asynchronous operation to peek a batch of messages. + A sequence number from where to peek a batch of messages. + The number of messages to peek. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Begins an asynchronous operation to receive a message. An that references the asynchronous operation to receive a message. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. - Thrown if the client entity has been closed or aborted. + A user-defined object that contains state information about the asynchronous operation. + Thrown if the client entity has been closed or aborted. Begins an asynchronous operation to receive a message. An that references the asynchronous operation to receive a message. The unique number assigned to a message by the Service Bus. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. - Thrown if the client entity has been closed or aborted. + A user-defined object that contains state information about the asynchronous operation. + Thrown if the client entity has been closed or aborted. Begins an asynchronous operation to receive a message. An that references the asynchronous operation to receive a message. The time span the server waits for processing messages before it times out. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown if the is negative. - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. + + + Begins an asynchronous operation to receive a message batch. + An that references the asynchronous operation to receive a message batch. + The sequence numbers associated with the messages in the batch. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to receive a message batch. + An that references the asynchronous operation to receive a message batch. + The maximum number of messages to receive in a batch. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to receive a message batch. + An that references the asynchronous operation to receive a message batch. + The maximum number of messages to receive in a batch. + The time span that the server will wait for the message batch to arrive before it times out. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. Begins an asynchronous operation to send a message. An that references the asynchronous operation to send a message. The message to send. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown when operation times out. Timeout period is initialized through the may need to increase the value of to avoid this exception if timeout value is relatively low. Thrown when the is null. Thrown if the has already been sent by a QueueClient or once already. Thrown if the topic/subscription we are point to does not support the send operation. That is, Deadletter queue does not support send operations. - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. + + + Begins an asynchronous operation to send a message batch. + An that references the asynchronous operation to send a message batch. + The message batch to send. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. Completes processing of a message. The lock token bound to the locked message instance. Thrown if the operation exceeded the timeout value set by - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the message represented by the has lost the message lock. + + Asynchronously completes processing of a message. + The asynchronous operation. + The lock token bound to the locked message instance. + + + Completes processing of a message batch. + The lock tokens associated with locked messages in the batch. + + + Asynchronously completes processing of a message batch. + The asynchronous operation. + The lock tokens associated with locked messages in the batch. + Creates a new copy of with specified path. The created . @@ -6148,26 +8266,65 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Moves the undelivered message to the dead letter queue. The lock token bound to the locked message instance. - Thrown if the operation exceeded the timeout value set by - Thrown if the client entity has been closed or aborted. + Thrown if the operation exceeded the timeout value set by + Thrown if the client entity has been closed or aborted. Thrown if the message represented by the has lost the message lock. + + Moves the undelivered message to the dead letter queue. + The lock token bound to the locked message instance. + The properties of the message to modify. + Moves the undelivered message to the dead letter queue. The lock token bound to the locked message instance. The reason for deadlettering the message. The error description for deadlettering the message. - Thrown if the operation exceeded the timeout value set by - Thrown if the client entity has been closed or aborted. + Thrown if the operation exceeded the timeout value set by + Thrown if the client entity has been closed or aborted. Thrown if the message represented by the has lost the message lock. + + Asynchronously moves the undelivered message to the dead letter queue. + The asynchronous operation. + The lock token bound to the locked message instance. + + + Asynchronously moves the undelivered message to the dead letter queue. + The asynchronous operation. + The lock token bound to the locked message instance. + The properties of the message to modify. + + + Asynchronously moves the undelivered message to the dead letter queue. + The asynchronous operation. + The lock token bound to the locked message instance. + The reason for deadlettering the message. + The error description for deadlettering the message. + Suspends the processing of a message. The lock token bound to the locked message instance. - Thrown if the operation exceeded the timeout value set by - Thrown if the client entity has been closed or aborted. + Thrown if the operation exceeded the timeout value set by + Thrown if the client entity has been closed or aborted. Thrown if the message represented by the has lost the message lock. + + Suspends the processing of a message. + The lock token bound to the locked message instance. + The properties of the message to modify. + + + Asynchronously suspends the processing of a message. + The asynchronous operation. + The lock token bound to the locked message instance. + + + Asynchronously suspends the processing of a message. + The asynchronous operation. + The lock token bound to the locked message instance. + The properties of the message to modify. + Finishes an asynchronous operation to abandon the message and relinquish its lock. An that represents the status of the asynchronous abandon message operation. @@ -6179,7 +8336,11 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Finishes an asynchronous operation to complete processing of a message. - An that represents the status of the asynchronous complete message processing operation. + An that references the asynchronous operation to complete processing of a message. + + + Finishes an asynchronous operation to complete processing of a message batch. + An that references the asynchronous operation to complete processing of a message batch. Finishes an asynchronous operation to move message to the dead letter queue. @@ -6189,31 +8350,61 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Finishes an asynchronous operation to suspend processing of a message. An that represents the status of the asynchronous operation to suspend processing of a message. + + Ends an asynchronous operation to get the message sessions. + The message sessions. + An that references the asynchronous operation to get the message sessions. + + + Ends an asynchronous operation to peek a message. + A brokered message. + An that represents the status of the asynchronous operation to peek a message. + + + Ends an asynchronous operation to peek a batch of messages. + A batch of message. + An that represents the status of the asynchronous operation to peek a batch of messages. + Finishes an asynchronous operation to receive a message. Returns . An that represents the status of the asynchronous operation to receive a message. + + Finishes an asynchronous operation to receive a message batch. + The message batch. + An that references the asynchronous operation to receive a message batch. + Finishes an asynchronous operation to send a message. An that represents the status of the asynchronous operation to send a message. + + Finishes an asynchronous operation to send a message batch. + An that references the asynchronous operation to send a message batch. + Builds a format name from the specified dead letter queue path. The resulted from building the format name for the specified dead letter queue path. The path to the dead letter queue. - - Gets or sets the message receiver for the queue. - The for the queue. + + Gets the message sessions, enabling you to browse sessions on queues. + The message session. - - Gets or sets the message sender for the queue. - The for the queue. + + Retrieves all message sessions whose session state was updated since . + The message sessions. + The time the session was last updated. - - Gets or sets a value that indicates whether the message receiver is created from a subqueue. - true if the message receiver is created from a subqueue; otherwise, false. + + Asynchronously gets the message sessions, enabling you to browse sessions on queues. + The asynchronous operation. + + + Asynchronously retrieves all message sessions whose session state was updated since . + The asynchronous operation. + The time the session was last updated. Gets or sets the messaging factory. @@ -6221,7 +8412,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets the message receive mode when processing the received message. - The message when processing the received message. + The message when processing the received message. Executes upon calling the Abort event. @@ -6233,7 +8424,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The receive mode when processing with the receive messages. The time span the server waits for processing messages before it times out. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Executes when the Close operation is called. @@ -6266,6 +8457,13 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete. + + Executes the BeginGetMessageSessions action. + An that references the asynchronous operation to get the message sessions. + The date and time of the last update. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Executes upon calling the Close action. The maximum time before the close operation times out. @@ -6289,10 +8487,84 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit A object. An object that references the . + + Executes the end get message action. + The that allows grouping of related messages for processing in a single transaction. + The result of the session. + + + Processes a message in an event-driven message pump. + The method to invoke when the operation is complete. + + + Processes a message in an event-driven message pump, with the given set of options. + The method to invoke when the operation is complete. + Specifies the options with which to instantiate the message pump. + + + Asynchronously processes a message. + The method to invoke when the operation is complete. + + + Asynchronously processes a message. + The method to invoke when the operation is complete. + Calls a message option. + + + Asynchronously processes a message. + Begins a callback. + Ends a callback. + + + Asynchronously processes a message. + Begins a callback. + Ends a callback. + Calls a message options. + Gets or sets the full path name of the queue. The queue path relative to the base address. + + Returns without removing the first message in the queue. + A brokered message. Returns all properties and the message body. + + + Returns without removing the first message in the queue. + The brokered message. + The starting point from which to browse a message. + + + Asynchronously returns without removing the first message in the queue. + The asynchronous operation. + + + Asynchronously returns without removing the first message in the queue. + The asynchronous operation. + The sequence number from where to peek a message. + + + Peeks a batch of message. + A batch of messages peeked. Returns all properties and the message body. + The number of messages. + + + Peeks a batch of messages. + A batch of messages peeked. + The starting point from which to browse a batch of messages. + The number of messages. + + + Asynchronously peeks a batch of message. + The asynchronous operation. + The number of message. + + + Asynchronously peeks a batch of message. + The asynchronous operation. + The sequence number from where to peek a batch of message. + The number of message. + Gets or sets the number of messages that the queue receiver can simultaneously request. The number of messages that the queue receiver can simultaneously request. @@ -6300,7 +8572,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Receives a message using the . The that represents the received message. If no message is available to be received, the method returns NULL, and you can retry the operation at a later time. - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the message receive operation times out. Thrown if an I/O or security error occurs. Thrown if the messaging entity associated with the operation does not exist or it has been deleted. @@ -6310,7 +8582,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Receives a message using the . The that represents the received message. If no message is available to be received, the method returns NULL, and you can retry the operation at a later time. The sequence number of the deferred message to receive. - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Receives a message using the . @@ -6318,11 +8590,57 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The time span the server waits for receiving a message before it times out. Thrown if the is negative. Thrown if the message receive operation times out. - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if an I/O or security error occurs. Thrown if the messaging entity associated with the operation does not exist or it has been deleted. Thrown if the user code has performed some unexpected operations, or the Service Bus gateway is down. Check the exception message for the actual error. + + Asynchronously receives a message using the . + The asynchronous operation. + + + Asynchronously receives a message using the . + The asynchronous operation. + The sequence number of the deferred message to receive. + + + Asynchronously receives a message using the . + The asynchronous operation. + The time span the server waits for receiving a message before it times out. + + + Receives a message batch. + A message batch. + The sequence numbers associated with the messages in the batch. + + + Receives a message batch. + A message batch. + The maximum number of messages to return in the batch. As this is an approximation, fewer messages may be returned even if the number of messages is higher than . + + + Receives a message batch. + A message batch. + The maximum number of messages to receive in a batch. + The time span that the server will wait for the message batch to arrive before it times out. + + + Asynchronously receives a message batch. + The asynchronous operation. + The sequence numbers associated with the messages in the batch. + + + Asynchronously receives a message batch. + The asynchronous operation. + The maximum number of messages to return in the batch. As this is an approximation, fewer messages may be returned even if the number of messages is higher than . + + + Asynchronously receives a message batch. + The asynchronous operation. + The maximum number of messages to receive in a batch. + The time span that the server will wait for the message batch to arrive before it times out. + Sends a message using the . The message to send. @@ -6330,15 +8648,45 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown when the is null. Thrown if the has already been sent by a QueueClient or once already. Thrown if the topic/subscription pointed to does not support the send operation. That is, Deadletter queue does not support send operations. - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. - - Represents the metadata description of the queue. + + Asynchronously sends a message using the . + The asynchronous operation. + The message to send. + + + Sends a set of brokered messages (for batch processing). + The collection of brokered messages to send. + + + Asynchronously sends a set of brokered messages (for batch processing). + The asynchronous operation. + The collection of brokered messages to send. + + + Represents the metadata description of the queue. Initializes a new instance of the class with the specified relative path. Path of the queue relative to the service namespace base address. + + Gets the time the message will be accessible. + The time the message will be accessible. + + + Gets the . + The . + + + Gets or sets the idle interval after which the queue is automatically deleted. The minimum duration is 5 minutes. + The auto delete on idle time span for the queue. + + + Gets the exact time the message was created. + The time the message was created. + Gets or sets the default message time to live value. This is the duration after which the message expires, starting from when the message is sent to the Service Bus. This is the default value used when is not set on a message itself.Messages older than their TimeToLive value will expire and no longer be retained in the message store. Subscribers will be unable to receive expired messages. The default message time to live value. @@ -6355,6 +8703,14 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets a value that indicates whether this queue has dead letter support when a message expires. true if the queue has a dead letter support when a message expires; otherwise, false. + + Gets or sets the path to the recipient to which the message is forwarded. + The path to the recipient to which the message is forwarded. + + + Gets or sets a value that indicates whether the message is anonymous accessible. + true if the message is anonymous accessible; otherwise, false. + Gets or sets the duration of a peek lock; that is, the amount of time that the message is locked for other receivers. The maximum value for is 5 minutes; the default value is 1 minute. The duration of the lock. @@ -6364,13 +8720,17 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The number of maximum deliveries. - Gets or sets the maximum size in megabytes, which is the size of memory allocated for the queue. + Gets or sets the maximum size of the queue in megabytes, which is the size of memory allocated for the queue. The maximum size of the queue in megabytes. Gets the number of messages in the queue. The number of messages. + + Gets message details for a queue. + Returns with the number of active messages, dead letters, scheduled messages, messages transferred to other queues, subscriptions, or topics, and the number of messages transferred to the dead letter queue. + Specifies the message time to live default value. @@ -6380,7 +8740,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets the value indicating if this queue requires duplicate detection. - True if this queue requires duplicate detection; otherwise, false. + true if this queue requires duplicate detection; otherwise, false. Gets or sets a value that indicates whether the queue supports the concept of session. @@ -6390,9 +8750,30 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets the size of the queue in bytes. The size of the queue. + + Gets or sets the current status of the queue (enabled or disabled). When an entity is disabled, that entity cannot send or receive messages. + The current status of the queue. + + + Gets or sets a value that indicates whether the queue supports ordering. + true if the queue supports ordering; otherwise, false. + + + Gets the exact time the message has been updated. + The time the message has been updated. + + + Gets or sets the user metadata. + The user metadata. + The exception that is thrown for signaling quota exceeded errors. + + Initializes a new instance of the class with serialized data. + The object that contains the serialized information about the exception. + The contextual information about the source or destination. + Initializes a new instance of the class with a specified error message. The error message that explains the reason for the exception. @@ -6427,10 +8808,6 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets a value that indicates whether the rule action requires preprocessing. true if the rule action requires preprocessing; otherwise, false. - - Gets or sets the object that contains extra data. - The object that contains extra data. - Validates the rule action against the grammar. @@ -6469,8 +8846,12 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets the action to perform if the message satisfies the filtering expression. The action to perform if the message satisfies the filtering expression. + + Gets creation time of the rule. + The creation time of the rule. + - Specifies the name of the default rule. + Specifies the name of the default rule. Gets or sets the filter expression used to match messages. @@ -6479,7 +8860,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets the name of the rule. - Returns a Representing the name of the rule. + Returns a Representing the name of the rule. The exception that is thrown when a server is overloaded with logical operations. @@ -6517,6 +8898,54 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The error message that explains the reason for the exception. The exception that is the cause of the current exception. + + Defines the authorization rule for shared access operation. + + + Initializes a new instance of the class. + The authorization rule key name. + The primary key for the authorization rule. + The list of rights. + + + Initializes a new instance of the class. + The authorization rule key name. + The primary key for the authorization rule. + The secondary key for the authorization rule. + The list of rights. + + + Determines whether the specified object is equal to the current object. + true if the specified object is equal to the current object; otherwise, false. + The object to compare with the current object. + + + Generates the random key for the authorization rule. + The random key for the authorization rule. + + + Returns the hash code for this instance. + The hash code for this instance. + + + Gets or sets the authorization rule key name. + The authorization rule key name. + + + Checks the validity of the authorization rule. + + + Gets or sets the primary key for the authorization rule. + The primary key for the authorization rule. + + + Gets or sets the secondary key for the authorization rule. + The secondary key for the authorization rule. + + + Checks the validity of the specified access rights. + The access rights to check. + Represents a filter which is a composition of an expression and an action that is executed in the pub/sub pipeline. @@ -6533,6 +8962,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit truea message matches against the current SQL expression; otherwise, false. The BrokeredMessage. + Gets the preprocessed filter expression. The preprocessed filter expression. @@ -6570,6 +9000,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The to which the will be applied. Thrown when the operation is not valid for the current state. + Gets the pre-processed expression. The preprocessed expression. @@ -6588,13 +9019,29 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown when the rule action statement is invalid or exceeds maximum allowed number of actions. - The anchor class used in run-time operations related to a topic subscription. + Represents the anchor class used in run-time operations related to a topic subscription. Discards the message and relinquishes the message lock ownership. The lock token bound to the locked message instance to abandon. Thrown if the operation exceeded the timeout value set via . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. + + + Discards the message and relinquishes the message lock ownership. + The lock token bound to the locked message instance to abandon. + A collection of property objects to be modified. + + + Asynchronously discards the message and relinquishes the message lock ownership. + A task instance that represents the asynchronous abandon operation. + The lock token bound to the locked message instance to abandon. + + + Asynchronously discards the message and relinquishes the message lock ownership. + A task instance that represents the asynchronous abandon operation. + The lock token bound to the locked message instance to abandon. + A collection of property objects to be modified. Accepts a message session that allows grouping of related messages for processing in a single transaction. @@ -6606,7 +9053,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The session identifier of the message session. Thrown if sessionId is null, empty, or white spaces. Thrown if the operation exceeded the timeout value set by . - Thrown if the client is already closed, aborted, or disposed. + Thrown if the client is already closed, aborted, or disposed. Accepts a message session that allows grouping of related messages for processing in a single transaction using the given session identifier and wait time. @@ -6616,7 +9063,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown if sessionId is null, empty, or white spaces. Thrown if serverWaitTime is not a positive TimeSpan value. Thrown if the operation exceeded the timeout value set by . - Thrown if the client is already closed, aborted, or disposed. + Thrown if the client is already closed, aborted, or disposed. Accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time. @@ -6624,7 +9071,27 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The time span the server waits for processing messages before it times out. Thrown if serverWaitTime is not a positive TimeSpan value. Thrown if the operation exceeded the timeout value set by . - Thrown if the client is already closed, aborted, or disposed. + Thrown if the client is already closed, aborted, or disposed. + + + Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time. + A task instance that represents the asynchronous accept message session operation. + + + Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time. + A task instance that represents the asynchronous accept message session operation. + The session identifier of the message session. + + + Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time. + A task instance that represents the asynchronous accept message session operation. + The session identifier of the message session. + The time span the server waits for processing messages before it times out. + + + Asynchronously accepts a message session that allows grouping of related messages for processing in a single transaction using the specified server wait time. + A task instance that represents the asynchronous accept message session operation. + The time span the server waits for processing messages before it times out. Adds a new rule to the using the specified rule description. @@ -6633,49 +9100,68 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown if is null, white space empty or not in the right format. Thrown if length has exceeded the limit of 50 characters. Thrown if the operation exceeded the timeout value set by . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the rule with the same name as already existed for this subscription. Adds a rule to the current subscription with the specified name and filter expression. - The name of the rule to add + The name of the rule to add. The filter expression against which messages will be matched. Thrown if is null. Thrown if is null, white space empty or not in the right format. Thrown if length has exceeded the limit of 50 characters. Thrown if the operation exceeded the timeout value set via . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the rule with the same name as already existed for this subscription. + + Asynchronously adds a new rule to the using the specified rule description. + A task instance that represents the asynchronous add rule operation. + The rule description that provides metadata of the rule to add. + + + Asynchronously adds a rule to the current subscription with the specified name and filter expression. + A task instance that represents the asynchronous add rule operation. + The name of the rule to add. + The filter expression against which messages will be matched. + Begins an asynchronous operation to abandon the message and relinquish its lock. An that references the asynchronous operation to abandon the message and relinquish its lock. The lock token bound to the locked message instance to abandon. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown if the operation exceeded the timeout value set by . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. + + + Begins an asynchronous operation to abandon the message and relinquish its lock. + An asynchronous operation to abandon the message and relinquish its lock. + The lock token bound to the locked message instance to abandon. + A collection of property objects to be modified. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. - Begin an asynchronous operation to accept a message session. + Begins an asynchronous operation to accept a message session. An that references the asynchronous operation to accept a message session. An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. Thrown if the operation exceeded the timeout value set by - Thrown if the client is already closed, aborted, or disposed. + Thrown if the client is already closed, aborted, or disposed. - Begin an asynchronous operation to accept a message session. + Begins an asynchronous operation to accept a message session. An that references the asynchronous operation to accept a message session. The session identifier of the message session. An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. Thrown if sessionId is null, empty, or white spaces. Thrown if the operation exceeded the timeout value set by . - Thrown if the client is already closed, aborted, or disposed. + Thrown if the client is already closed, aborted, or disposed. - Begin an asynchronous operation to accept a message session. + Begins an asynchronous operation to accept a message session. An that references the asynchronous operation to accept a message session. The session identifier of the message session. The time span the server waits for processing messages before it times out. @@ -6684,29 +9170,29 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown if sessionId is null, empty, or white spaces. Thrown if serverWaitTime is not a positive TimeSpan value. Thrown if the operation exceeded the timeout value set by . - Thrown if the client is already closed, aborted, or disposed. + Thrown if the client is already closed, aborted, or disposed. - Begin an asynchronous operation to accept a message session. + Begins an asynchronous operation to accept a message session. An that references the asynchronous operation to accept a message session. The time span the server waits for processing messages before it times out. An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. Thrown if serverWaitTime is not a positive TimeSpan value. Thrown if the operation exceeded the timeout value set by . - Thrown if the client is already closed, aborted, or disposed. + Thrown if the client is already closed, aborted, or disposed. Begins an asynchronous operation to add a new rule to the subscription. An that references the asynchronous operation to add a new rule to the subscription. The rule description that provides metadata of the rule to add. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown if is null. Thrown if is null, white space empty or not in the right format. Thrown if length has exceeded the limit of 50 characters. Thrown if the operation exceeded the timeout value set via . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the rule with the same name as already existed for this subscription. @@ -6720,7 +9206,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown if is null, white space empty or not in the right format. Thrown if length has exceeded the limit of 50 characters. Thrown if the operation exceeded the timeout value set via . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the rule with the same name as already existed for this subscription. @@ -6730,19 +9216,34 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. Thrown if the operation exceeded the timeout value set b y . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the message represented by has lost the message lock. + + Begins an asynchronous operation to complete processing of a message. + An asynchronous operation to complete processing of a message. + The lock tokens bound to the locked message instance. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Begins an asynchronous operation to move a message to the dead letter queue. An that references the asynchronous operation to move a message to the dead letter queue. The lock token bound to the locked message instance. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown if the operation exceeded the timeout value set by . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the message represented by has lost the message lock. + + Begins an asynchronous operation to move a message to the dead letter queue. + An asynchronous operation to move a message to the dead letter queue. + The lock token bound to the locked message instance. + A collection of property objects to be modified. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Begins an asynchronous operation to move a message to the dead letter queue. An that references the asynchronous operation to move a message to the dead letter queue. @@ -6750,9 +9251,9 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The reason for deadlettering the message. The error description for deadlettering the message. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown if the operation exceeded the timeout value set by . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the message represented by has lost the message lock. @@ -6762,32 +9263,103 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains state information about the asynchronous operation. Thrown if the operation exceeded the timeout value set via . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the message represented by has lost the message lock. + + Begins an asynchronous operation to suspend processing of a message. + An asynchronous operation to suspend processing of a message. + The lock token bound to the locked message instance. + A collection of property objects to be modified. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to get a message session. + An asynchronous operation to get a message session. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to get a message session. + An asynchronous operation to get a message session. + The time the session was last updated. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to return without removing the first message in the queue. + An asynchronous operation to peek a message in the queue. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to return without removing the first message in the queue. + An asynchronous operation to peek a message in the queue. + The starting point from which to browse a message. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to peek a batch. + An asynchronous operation to peek a batch. + The number of messages in a batch. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to peek a batch. + An asynchronous operation to peek a batch. + The starting point from which to browse a message. + The number of messages in a batch. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Begins an asynchronous operation to receive a message. An that references the asynchronous operation to receive a message. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. - Thrown if the client entity has been closed or aborted. + A user-defined object that contains state information about the asynchronous operation. + Thrown if the client entity has been closed or aborted. Begins an asynchronous operation to receive a message. An that references the asynchronous operation to receive a message. The unique number assigned to a message by the Service Bus. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. - Thrown if the client entity has been closed or aborted. + A user-defined object that contains state information about the asynchronous operation. + Thrown if the client entity has been closed or aborted. Begins an asynchronous operation to receive a message. An that references the asynchronous operation to receive a message. The time span the server waits for processing messages before it times out. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Thrown if the is negative. - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. + + + Begins an asynchronous operation to receive a batch. + An that references the asynchronous operation to receive a message. + The unique number assigned to a message by the Service Bus. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to receive a batch. + An that references the asynchronous operation to receive a message. + The maximum number of messages to receive in a batch. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + + + Begins an asynchronous operation to receive a batch. + An that references the asynchronous operation to receive a message. + The maximum number of messages to receive in a batch. + The waiting time. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. Begins an asynchronous remove rule action. @@ -6798,15 +9370,29 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown when rule does not exist. Thrown if is null, white space empty or not in the right format. ThrowN if the operation exceeded the timeout value set via . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Completes processing of a message. The lock token bound to the locked message instance. Thrown if the operation exceeded the timeout value set by . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the message represented by has lost the message lock. + + Asynchronously completes processing of a message. + A task instance that represents the asynchronous complete operation. + The lock token bound to the locked message instance. + + + Completes processing of a batch. + The lock tokens bound to the locked message instance. + + + Asynchronously completes processing of a batch. + A task instance that represents the asynchronous complete batch operation. + The lock tokens bound to the locked message instance. + Creates a new copy of with specified name and topic path. A new copy of . @@ -6839,25 +9425,64 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Moves the undelivered message to the dead letter queue. The lock token bound to the locked message instance. Thrown if the operation exceeded the timeout value set by . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the message represented by has lost the message lock. + + Moves the undelivered message to the dead letter queue. + The lock token bound to the locked message instance. + The properties to modify. + Moves the undelivered message to the dead letter queue. The lock token bound to the locked message instance. The reason for deadlettering the message. The error description for deadlettering the message. Thrown if the operation exceeded the timeout value set by . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the message represented by has lost the message lock. + + Asynchronously moves the undelivered message to the dead letter queue. + A task instance that represents the asynchronous deadletter operation. + The lock token bound to the locked message instance. + + + Asynchronously moves the undelivered message to the dead letter queue. + A task instance that represents the asynchronous deadletter operation. + The lock token bound to the locked message instance. + The properties to modify. + + + Asynchronously moves the undelivered message to the dead letter queue. + A task instance that represents the asynchronous deadletter operation. + The lock token bound to the locked message instance. + The reason for deadlettering the message. + The error description for deadlettering the message. + Suspends the processing of a message. The lock token bound to the locked message instance. Thrown if the operation exceeded the timeout value set by . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the message represented by has lost the message lock. + + Suspends the processing of a message. + The lock token bound to the locked message instance. + The properties to modify. + + + Asynchronously suspends the processing of a message. + A task instance that represents the asynchronous defer operation. + The lock token bound to the locked message instance. + + + Asynchronously suspends the processing of a message. + A task instance that represents the asynchronous defer operation. + The lock token bound to the locked message instance. + The properties to modify. + Finishes an asynchronous operation to abandon the message and relinquish its lock. An that represents the status of the asynchronous abandon message operation. @@ -6869,12 +9494,16 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Ends an asynchronous add rule operation. - An that references the . + An that references the . Finishes an asynchronous operation to complete processing of a message. An that represents the status of the asynchronous complete message processing operation. + + Finishes an asynchronous operation to complete processing of a batch. + An that represents the status of the asynchronous complete message processing operation. + Finishes an asynchronous operation to move message to the dead letter queue. An that represents the status of the asynchronous operation to move message to the dead letter queue. @@ -6883,9 +9512,29 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Finishes an asynchronous operation to suspend processing of a message. An that represents the status of the asynchronous operation to suspend processing of a message. + + Finishes an asynchronous operation to get the processing of a message. + An asynchronous operation to get the processing of a message. + An that represents the status of the asynchronous operation to suspend processing of a message. + + + Finishes an asynchronous peek operation. + The first message in the queue. + An that represents the status of the asynchronous peek operation. + + + Finishes an asynchronous peek operation on a batch of messages. + The collection of first messages in the batch. + An that represents the status of the asynchronous peek batch operation. + Finishes an asynchronous operation to receive a message. - The that represents the received message. + The that represents the received message. + An that represents the status of the asynchronous operation to receive a message. + + + Finishes an asynchronous operation to receive a batch. + An asynchronous operation to receive a batch. An that represents the status of the asynchronous operation to receive a message. @@ -6904,13 +9553,23 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The full pathname of the topic. The name of the subscription. - - Gets or sets the message receiver for the subscription. - The for the subscription. + + Gets a message session that allows grouping of related messages for processing in a single transaction. + A message session that allows grouping of related messages for processing in a single transaction. - - Gets or sets a value that indicates whether the message receiver is created from a subqueue. - true if the message receiver is created from a subqueue; otherwise, false. + + Retrieves all message sessions whose session state was updated since . + A message session that allows grouping of related messages for processing in a single transaction. + The time the session was last updated. + + + Asynchronously gets a message session that allows grouping of related messages for processing in a single transaction. + A task instance that represents the asynchronous get message sessions operation. + + + Asynchronously gets a message session that allows grouping of related messages for processing in a single transaction. + A task instance that represents the asynchronous get message sessions operation. + The time the session was last updated. Gets the messaging factory used to create this subscription client. @@ -6918,7 +9577,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets the message receive mode when processing the received message. - The message when processing the received message. + The message when processing the received message. Gets the name of the subscription. @@ -6934,7 +9593,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The receive mode when processing with the receive messages. The time span the server waits for processing messages before it times out. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Executes upon calling the BeginAddRule operation. @@ -6942,7 +9601,7 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The rule description that provides metadata of the rule to add. The time span this operation waits before it times out. An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains state information about the asynchronous operation. + A user-defined object that contains state information about the asynchronous operation. Executes the begin close action. @@ -6969,6 +9628,13 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete. + + Executes upon calling the BeginGetMessageSessions operation. + An that references the asynchronous operation to add a new rule to the subscription. + The time the session was last updated. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. + Begins removing a from a through the run-time client protocol. An that references the asynchronous . @@ -6977,6 +9643,14 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An delegate that references the method to invoke when the operation is complete. A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete. + + Begins removing a from a through the run-time client protocol using a tag. + An that references the asynchronous operation to add a new rule to the subscription. + The tag to be used. + The wait time before the operation times out. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete. + Executes the close action. The wait time before the operation times out. @@ -6987,39 +9661,117 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit An that represents the status of the asynchronous accept message session operation. - Ends the asynchronous call to . - An from a . + Ends the asynchronous call to . + An from a . Executes the end close action. - An that references the asynchronous BeginClose. + An that references the asynchronous BeginClose. Executes the end create receiver action. A newly-created object. An object that references the . + + Executes the end get message action. + The end get message action. + The result of the message. + Ends the asynchronous call to . An from a . + + Ends the asynchronous call to . + The result of the asynchronization. + + + Processes a message in an event-driven message pump. + The method to invoke when the operation is complete. + + + Processes a message in an event-driven message pump, with the given set of options. + The method to invoke when the operation is complete. + Specifies the options with which to instantiate the message pump. + + + Asynchronously processes a message. + The asynchronous method to invoke when the operation is complete. + + + Asynchronously processes a message. + The asynchronous method to invoke when the operation is complete. + The options associated with the message. + + + Asynchronously processes a message. + The asynchronous method to invoke before the operation begins. + The asynchronous method to invoke after the operation ends. + + + Asynchronously processes a message. + The asynchronous method to invoke before the operation begins. + The asynchronous method to invoke after the operation ends. + The options associated with the message. + + + Returns without removing the first message in the queue. + The returned message. + + + Returns without removing the first message in the queue. + The returned message. + The starting point from which to browse a message. + + + Asynchronously returns without removing the first message in the queue. + A task instance that represents the asynchronous peek operation. + + + Asynchronously returns without removing the first message in the queue. + A task instance that represents the asynchronous peek operation. + The starting point from which to browse a message. + + + Returns without removing the first messages in a batch. + The collection of first messages in a batch. + The number of messages in a batch. + + + Returns without removing the first messages in a batch. + The collection of first messages in a batch. + The starting point from which to browse a message. + The number of messages in a batch. + + + Asynchronously returns without removing the first messages in a batch. + A task instance that represents the asynchronous peek batch operation. + The number of messages in a batch. + + + Asynchronously returns without removing the first messages in a batch. + A task instance that represents the asynchronous peek batch operation. + The starting point from which to browse a message. + The number of messages in a batch. + Gets or sets the number of messages that the message receiver can simultaneously request. The number of messages that the message receiver can simultaneously request. Receives a message using the . - The that represents the received message. + The that represents the received message. Thrown when the subscription does not exist. Thrown if the operation exceeded the timeout value set via . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if there is an authentication error. Receives a message using the . The that represents the received message. The sequence number of the deferred message to receive. - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Receives a message using the . @@ -7027,17 +9779,68 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The time span the server waits for receiving a message before it times out. Thrown if the is negative. Thrown when the subscription does not exist. - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. Thrown if the operation exceeded the timeout value set via . Thrown if there is an authentication error. + + Asynchronously receives a message using the . + A task instance that represents the asynchronous receive operation. + + + Asynchronously receives a message using the . + A task instance that represents the asynchronous receive operation. + The sequence number of the deferred message to receive. + + + Asynchronously receives a message using the . + A task instance that represents the asynchronous receive operation. + The time span the server waits for receiving a message before it times out. + + + Receives a batch after the asynchronous operation. + A batch after the asynchronous operation. + The sequence number. + + + Receives a batch after the asynchronous operation. + A batch after the asynchronous operation. + The maximum number of messages to return in the batch. As this is an approximation, fewer messages may be returned even if the number of messages is higher than . + + + Receives a batch after the asynchronous operation. + A batch after the asynchronous operation. + The maximum number of messages to receive in a batch. + The time span the server waits for processing messages. + + + Asynchronously receives a set of messages (for batch processing). + A task instance that represents the asynchronous receive batch operation. + The sequence number. + + + Asynchronously receives a set of messages (for batch processing). + A task instance that represents the asynchronous receive batch operation. + The maximum number of messages to return in the batch. + + + Asynchronously receives a set of messages (for batch processing). + A task instance that represents the asynchronous receive batch operation. + The maximum number of messages to return in the batch. + The time span the server waits for processing messages. + Removes the rule described by . The name of the rule. Thrown when rule does not exist. Thrown if is null, white space empty or not in the right format. Thrown if the operation exceeded the timeout value set via . - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. + + + Asynchronously removes the rule described by . + A task instance that represents the asynchronous remove rule operation. + The name of the rule. Gets the full pathname of the topic. @@ -7051,6 +9854,18 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit The topic path. The subscription name. + + Gets the time the message will be accessible. + The time the message will be accessible. + + + Gets or sets the idle interval after which the subscription is automatically deleted. The minimum duration is 5 minutes. + The auto delete on idle time span for the subscription. + + + Gets the exact time the message was created. + The time the message was created. + Gets or sets the default message time to live value. This is the duration after which the message expires, starting from when the message is sent to the Service Bus. This is the default value used when is not set on a message itself. Messages older than their TimeToLive value will expire and no longer be retained in the message store. Subscribers will be unable to receive expired messages. The default message time to live for a subscription. @@ -7067,6 +9882,10 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets the value that indicates if a subscription has dead letter support when a message expires. true if a subscription has dead letter support when a message expires; otherwise, false. + + Gets or sets the path to the recipient to which the message is forwarded. + The path to the recipient to which the message is forwarded. + Gets or sets the lock duration time span for the subscription. The lock duration time span for the subscription. @@ -7079,6 +9898,10 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets the number of messages. The number of messages. + + Gets message details about the subscription. + Returns with the number of active messages, dead letters, scheduled messages, messages transferred to other queues, subscriptions, or topics, and the number of messages transferred to the dead letter queue. + Specifies the message time to live default value. @@ -7090,10 +9913,157 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets the value indicating if a subscription supports the concept of session. true if the receiver application can only receive from the queue through a ; false if a queue cannot receive using . + + Gets or sets the current status of the subscription (enabled or disabled). When an entity is disabled, that entity cannot send or receive messages. + The current status of the subscription. + Gets the path of the topic that this subscription description belongs to. The path of the topic that this subscription description belongs to. + + Gets the exact time the message has been updated. + The time the message has been updated. + + + Gets or sets the user metadata. + The user metadata. + + + Enumerates types of messaging tile. + + + A TileSquareImage type. + + + A TileWideImage type. + + + A TileWideImageAndText type. + + + A TileWideImageCollection type. + + + A TileWideText01 type. + + + A TileWideText02 type. + + + A TileWideText03 type. + + + A TileWideText04 type. + + + A TileWideText05 type. + + + A TileWideText06 type. + + + A TileWideText07 type. + + + A TileWideText08 type. + + + A TileWideText09 type. + + + A TileWideSmallImageAndText01 type. + + + A TileWideSmallImageAndText02 type. + + + A TileWideSmallImageAndText03 type. + + + A TileWideSmallImageAndText04 type. + + + A TileWidePeekImageAndText type. + + + A TileWidePeekImage01 type. + + + A TileWidePeekImage02 type. + + + A TileWidePeekImage03 type. + + + A TileWidePeekImage04 type. + + + A TileWidePeekImage05 type. + + + A TileWidePeekImage06 type. + + + A TileWidePeekImageCollection01 type. + + + A TileWidePeekImageCollection02 type. + + + A TileWidePeekImageCollection03 type. + + + A TileWidePeekImageCollection04 type. + + + A TileWidePeekImageCollection05 type. + + + A TileWidePeekImageCollection06 type. + + + A TileWideBlockAndText01 type. + + + Enumerates the types of image and text for toast notification. + + + Specifies the first type image and text. + + + Specifies the second type image and text. + + + Specifies the third type image and text. + + + Specifies the fourth type image and text. + + + Specifies the first type small image and text. + + + Specifies the second type small image and text. + + + Specifies the third type small image and text. + + + Specifies the fourth type small image and text. + + + Specifies the first type text. + + + Specifies the second type text. + + + Specifies the third type text. + + + Specifies the fourth type text. + An anchor class used to access a to perform run-time operations. @@ -7107,7 +10077,14 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown when the BrokeredMessage is null. Thrown if the has already been sent by a or once already. Thrown if the Deadletter topic/subscription pointed to does not support the send operation. - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. + + + Begins an asynchronous operation to send a message by batch. + An that references the asynchronous operation to send a message. + The message to send. + An delegate that references the method to invoke when the operation is complete. + A user-defined object that contains state information about the asynchronous operation. Creates a new instance of . @@ -7124,9 +10101,9 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Finishes an asynchronous operation to send a message. An that represents the status of the asynchronous operation to send a message. - - Gets or sets the message sender for the topic. - The for the topic. + + Finishes an asynchronous operation to send a message. + An that represents the status of the asynchronous operation to send a message. Gets or sets a value that indicates whether the message receiver is created from a subqueue. @@ -7176,7 +10153,21 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Thrown when operation times out. Timeout period is initialized through the to avoid this exception if timeout value is relatively low. Thrown when the is null. Thrown if the has already been sent by a or once already. - Thrown if the client entity has been closed or aborted. + Thrown if the client entity has been closed or aborted. + + + Asynchronously sends a message using the . + The asynchronous result of the operation. + The message to send. + + + Sends a set of brokered messages (for batch processing). + The messages to send. + + + Asynchronously sends a set of brokered messages (for batch processing). + The asynchronous result of the operation. + The messages to send. Represents a description of the topic. @@ -7185,6 +10176,22 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Initializes a new instance of the class with the specified relative path. Path of the topic relative to the service namespace base address. + + Gets the time and date when the topic is opened. + The time and date when the topic is opened. + + + Gets the authorization rules for the description. + The authorization rules for the description. + + + Gets or sets the idle interval after which the topic is automatically deleted. The minimum duration is 5 minutes. + The auto delete on idle time span for the topic. + + + Gets the time and date when the topic was created. + The time and date when the topic was created. + Gets or sets the default message time to live value for a topic. This is the duration after which the message expires, starting from when the message is sent to the Service Bus. This is the default value used when is not set on a message itself.Messages older than their TimeToLive value will expire and no longer be retained in the message store. Subscribers will be unable to receive expired messages. The default message time to live for a topic. @@ -7197,10 +10204,23 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets a value that indicates whether server-side batched operations are enabled. true if the batched operations are enabled; otherwise, false. + + Gets or sets whether messages should be filtered before publishing. + true if message filtering is enabled before publishing; otherwise, false. + Thrown if the subscriptions do not match. + + + Gets whether anonymous access is allowed. + true if anonymous access is allowed; otherwise, false. + - Gets or sets the maximum size in megabytes, which is the size of memory allocated for the topic. + Gets or sets the maximum size of the topic in megabytes, which is the size of memory allocated for the topic. The maximum size in megabytes. + + Gets message details about the topic. + Returns that contains the number of active messages, dead letters, scheduled messages, messages transferred to other queues, subscriptions, or topics, and the number of messages transferred to the dead letter queue. + Specifies the message time to live default value. @@ -7216,6 +10236,47 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets the size of the topic in bytes. The size in bytes. + + Gets or sets the current status of the topic (enabled or disabled). When an entity is disabled, that entity cannot send or receive messages. + The status of the topic. + + + Gets then number of subscriptions. + Returns that represents the number of subscriptions. + + + Gets or sets the support ordering. + The support ordering method. + + + Gets the time and date when the topic was updated. + The time and date when the topic was updated. + + + Gets or sets the user metadata associated with the description. + The user metadata associated with the description. + + + Represents an exception when the transaction size exceeds. + + + Initializes a new instance of the class. + The exception message. + + + Initializes a new instance of the class. + The exception message. + The error that caused the exception. + + + Enumerates the messaging transport type. + + + The network messaging transport type. + + + The advanced message queuing protocol transport type. + Matches a filter expression. @@ -7238,6 +10299,37 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Validates the SQL expression. + + Represents the Advanced Message Queuing Protocol transport settings. + + + Initializes a new instance of the class. + + + Gets or sets the batch flush interval associated with the transport. + The batch flush interval associated with the transport. + + + Creates a new object that is a copy of the current instance. + A new object that is a copy of this instance. + + + Gets or sets the maximum frame size. + The maximum frame size. + + + Gets a value that indicates whether the SSL stream uses a custom binding element. + true if the SSL stream uses a custom binding element; otherwise, false. + + + Enumerates the encoding type associated with the serialization. + + + The List encoding type. + + + The Map encoding type. + Represents a configuration element that contains sub-elements that specify settings for using the binding. @@ -7306,6 +10398,205 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Gets or sets the batch flush interval. The that represents the batch flush interval. + + Gets or set a value that indicates whether redirection is enabled. + true if redirection is enabled; otherwise, false. + + + Represents the notifications of the . + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with the specified value. + The specified value. + + + Generates the schema representation for the XML schema conversion. + The schema representation for the XML schema conversion. + The XML schema. + + + Returns schema representation for the XML schemas. + The schema representation for the XML schemas. + + + Converts the specified value to a object. + The value to converts the object. + The value to be converted. + + + Converts the object to a specified value. + The converted object to a specified value. + The value to be converted. + + + Reads XML schema from its XML representation. + The XML reader to read the data. + + + Returns a string that represents the current object. + A string that represents the current object. + + + Gets or sets the value of the . + The value of the . + + + Writes XML data into its XML representation. + The XML writer to write. + + + Represents the collection of Windows Push Notification Services (WNS) headers. + + + Initializes a new instance of the class. + + + Specifies an enumeration of controller command. + + + The Update command. + + + The SendManifest command. + + + The Enable command. + + + The Disable command. + + + Enumerates the events associated with the service bus. + + + The default event. + + + The application event. + + + The security event. + + + The setup event. + + + The system event. + + + The reserved event. + + + Specifies an enumeration of event command. + + + The Update command. + + + The SendManifest command. + + + The Enable command. + + + The Disable command. + + + Specifies the standard keywords that apply to events. + + + The keyword is None. + + + The keyword is WdiContext. + + + The keyword is WdiDiagnostic. + + + The keyword is Sqm. + + + The keyword is AuditFailure. + + + The keyword is AuditSuccess. + + + The keyword is CorrelationHint. + + + The keyword is EventLogClassic. + + + The keyword is All. + + + Specifies an enumeration of event level defined in an event provider. + + + The level is LogAlways. + + + The level is Critical. + + + The level is Error. + + + The level is Warning. + + + The level is Informational. + + + The level is Verbose. + + + Specifies an enumeration of event opcode. + + + The Info opcode. + + + The Start opcode. + + + The Stop opcode. + + + The DataCollectionStart opcode. + + + The DataCollectionStop opcode. + + + The Extension opcode. + + + The Reply opcode. + + + The Resume opcode. + + + The Suspend opcode. + + + The Send opcode. + + + The Receive opcode. + + + Specifies an enumeration containing an event task that is defined in an event provider. + + + Task is None. + Provides contextual properties for tracking changes in the messaging entities. @@ -7318,9 +10609,94 @@ This mode additionally requires outbound port 819 for the NAT prediction algorit Specifies the attribute name for the tracking identifier in the returned token response. + + Specifies the configuration settings required to connect to the Service Bus relay service. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class with the specified connection string. + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Returns . + + + Implements the connection to the Service Bus relay service. + + + Initializes a new instance of the class. + + + + Returns . + + + Occurs when the connection is connecting. + + + + + Gets a value that determines if the connection is online. + true if the connection is online; otherwise, false. + + + Gets the last error. + Returns a that contains the last error. + + + Occurs when the connection is offline. + + + Occurs when the connection is online. + + + Uses the information specified in the to open the relay listener connection from a WebAPI application to the Relay service. + + + Asynchronous version of . + Returns . + Helper class for creating a Message object from streaming content. + Creates a message from a stream, using the specified version, action, and delegate. Returns a stream-created . diff --git a/lib/Azure/Microsoft.WindowsAzure.CloudDrive.dll b/lib/Azure/Microsoft.WindowsAzure.CloudDrive.dll index 807f3d02e1f..ab3be5d84ce 100644 Binary files a/lib/Azure/Microsoft.WindowsAzure.CloudDrive.dll and b/lib/Azure/Microsoft.WindowsAzure.CloudDrive.dll differ diff --git a/lib/Azure/Microsoft.WindowsAzure.CloudDrive.xml b/lib/Azure/Microsoft.WindowsAzure.CloudDrive.xml index 0f830679e3d..226045febbd 100644 --- a/lib/Azure/Microsoft.WindowsAzure.CloudDrive.xml +++ b/lib/Azure/Microsoft.WindowsAzure.CloudDrive.xml @@ -1,314 +1,314 @@ - - - - Microsoft.WindowsAzure.CloudDrive - - - - - Defines extension methods for creating Windows Azure drives from storage account credentials. - - - - - Create a new instance of a object from a storage account. - - The name of the storage account where the drive's data - is to be stored. - The path to the page blob where the drive's data - is to be stored. - A reference to a Windows Azure drive. - - - - Represents a Windows Azure drive. - - - - A Windows Azure drive acts as a local drive mounted on the file system and is accessible - to code running in a role. The data written to a Windows Azure drive is stored in a page blob - defined within the Windows Azure Blob service, and cached on the local file system. Because - data written to the drive is stored in a page blob, the data is maintained across the - lifecycle of the role instance. - - - - - - Creates a new instance of a object. - - A URI that identifies the page blob where the drive's data will be stored. - Credentials for the storage account that will contain the page blob. - - - - Creates an NTFS-formatted Windows Azure drive and its associated page blob. The page blob - is created at the URI specified for this object. - - The size of the drive to create. The minimum size permitted is 16 MB. - - - - Creates an NTFS-formatted Windows Azure drive and its associated page blob if the drive does not already exist. - The page blob is created at the URI specified for this object. - - The size of the drive to create. The minimum size permitted is 16 MB. - true if the Windows Azure drive was created, or false if it already existed. - - - - Creates a snapshot of the page blob associated with this Windows Azure drive. - - A URI to the newly created snapshot. - - - - Copies the data in this Windows Azure drive to a new page blob. - - The URI of the destination blob. - The copy operation takes place entirely within the Windows Azure Blob service and does not involve the client. - - - - Deletes the Windows Azure drive and its associated page blob. - - - If the page blob behind this Windows Azure drive has associated snapshots, you must - delete the snapshots using the Windows Azure Managed API before deleting the drive. - - - - - Mounts the Windows Azure drive and returns a path to the drive on the local file system. - - The size of the read cache for this mounted drive. Set this - parameter to 0 for unbuffered access to the drive. - The set of for mounting the drive. - The local path to the mounted drive. - - - A Windows Azure drive may be mounted as a writable drive, or as a read-only drive if it is created - from a snapshot of a page blob. - - - Note that before a role instance mounts a drive for the first time, it must initialize the cache - by calling the method. - - - To create a writable drive, create a new instance of the object, specifying - the desired URI for the page blob. Call the method, then call the Mount - method to mount the drive. - - - To create a read-only drive, call the method to create a new snapshot and - return the snapshot's URI, then create a new instance of the object from the snapshot's URI - and mount the drive. - - - When a role instance mounts a writable drive, it acquires an exclusive-write lease on the associated page - blob that it retains as long as the drive is mounted. If the same role instance attempts to mount a drive - with the same URI a second time, the operation is ignored and the Mount method returns the local path to the - existing drive. - - - If a role instance other than the one that has mounted the drive and acquired the lease attempts - to mount a drive with the same URI, the operation fails with a . Only one - instance at a time may mount a writable drive and acquire its lease. Once the drive has been unmounted, another instance may - mount the drive and successfully acquire its lease. - - - If a role instance mounts a read-only drive, there is no associated lease, as snapshots cannot be leased. - Multiple role instances can mount and access the same read-only drive. - - - - - - - Mounts the Windows Azure drive using the specified drive letter and returns a path to the drive on the local file system. - - The drive letter for the mounted drive. - The size of the read cache for this mounted drive. Set this - parameter to 0 for unbuffered access to the drive. - The set of for mounting the drive. - The local path to the mounted drive. - - - A Windows Azure drive may be mounted as a writable drive, or as a read-only drive if it is created - from a snapshot of a page blob. - - - Note that before a role instance mounts a drive for the first time, it must initialize the cache - by calling the method. - - - To create a writable drive, create a new instance of the object, specifying - the desired URI for the page blob. Call the method, then call the Mount - method to mount the drive. - - - To create a read-only drive, call the method to create a new snapshot and - return the snapshot's URI, then create a new instance of the object from the snapshot's URI - and mount the drive. - - - When a role instance mounts a writable drive, it acquires an exclusive-write lease on the associated page - blob that it retains as long as the drive is mounted. If the same role instance attempts to mount a drive - with the same URI a second time, the operation is ignored and the Mount method returns the local path to the - existing drive. - - - If a role instance other than the one that has mounted the drive and acquired the lease attempts - to mount a drive with the same URI, the operation fails with a . Only one - instance at a time may mount a writable drive and acquire its lease. Once the drive has been unmounted, another instance may - mount the drive and successfully acquire its lease. - - - If a role instance mounts a read-only drive, there is no associated lease, as snapshots cannot be leased. - Multiple role instances can mount and access the same read-only drive. - - - - - - - Unmounts the drive and releases any lease associated with it. - - - Note that when you unmount a drive, its contents are not deleted. To delete the contents of - a drive, call the method. - - - - - Initializes the read cache for any subsequently mounted drives associated with the role instance. - - The local file system path to the directory containing the cache. - If the directory does not exist, it will be created. - The total cache size, in megabytes. - - - Before you mount a drive, you must call the InitializeCache method to initialize a cache for the drive. - If a role instance attempts to mount a drive before a cache has been initialized, a - is thrown. - - - When a drive is mounted, it stores cache data in the cache defined by the most recent call to InitializeCache. - In other words, if a role instance calls the InitializeCache method a second time with different arguments, - any drives mounted subsequently will store cache data in the newly defined cache. Any previously mounted drives - continue to store cache data in the cache that was defined before those drives were mounted. - - - - - - Returns a mapping of local file system paths for mounted drives to page blob URIs for the current role instance. - - A read-only dictionary that maps local paths to page blob URIs. - - - - Ensure operation is allowed in this context. - - - - - Gets the credentials for the storage account where this drive's data is stored. - - - - - Gets the local file system path to the mounted drive. Returns null if no drive is currently mounted. - - - - - Gets the URI of the page blob where this drive's data is stored. - - - - - Defines an exception that may be thrown on operations on Windows Azure drives. - - - - - 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). - - - - - Returns the exception code for this exception - - - - - Appends a path to a Uri correctly using "/" as separator - - AppendPathToUri(new Uri("http://test.blob.core.windows.net/test", "abc") - => new Uri("http://test.blob.core.windows.net/test/abc") - - AppendPathToUri(new Uri("http://test.blob.core.windows.net/test"), "http://test.blob.core.windows.net/test/abc") - => new Uri("http://test.blob.core.windows.net/test/abc") - - - - - - - - Append a relative path to a URI, handling trailing slashes appropriately. - - - - - - - - - Specifies options for mounting a Windows Azure drive. - - - - - No options specified for mounting the drive. - - - - - Acquires the lease for this instance and forces the drive to be mounted. - - - - - Attempts to fix file system errors. Note may result in loss of data. See remarks. - - - Setting this flag calls chkdsk /F on the mounted drive. - To avoid any potential data-loss it is recommed a snapshot of the drive is taken first before - attempting to fix file system errors. - - - - - Use Shared Access Credentials to authenticate with the Azure Blob Service. - - - By default, Azure Drives will use the Account Shared Key to authenticate with the - Azure Blob Service. It requires the secret key to be cached outside the calling - process. This may be a security concern for some applications and the risk can be - mitigated by setting this flag. However if this flag is set and the calling - process is terminated, then the drive will auto-unmount when the Shared Access - Credentials expire. - - - - + + + + Microsoft.WindowsAzure.CloudDrive + + + + + Defines extension methods for creating Windows Azure drives from storage account credentials. + + + + + Create a new instance of a object from a storage account. + + The name of the storage account where the drive's data + is to be stored. + The path to the page blob where the drive's data + is to be stored. + A reference to a Windows Azure drive. + + + + Represents a Windows Azure drive. + + + + A Windows Azure drive acts as a local drive mounted on the file system and is accessible + to code running in a role. The data written to a Windows Azure drive is stored in a page blob + defined within the Windows Azure Blob service, and cached on the local file system. Because + data written to the drive is stored in a page blob, the data is maintained across the + lifecycle of the role instance. + + + + + + Creates a new instance of a object. + + A URI that identifies the page blob where the drive's data will be stored. + Credentials for the storage account that will contain the page blob. + + + + Creates an NTFS-formatted Windows Azure drive and its associated page blob. The page blob + is created at the URI specified for this object. + + The size of the drive to create. The minimum size permitted is 16 MB. + + + + Creates an NTFS-formatted Windows Azure drive and its associated page blob if the drive does not already exist. + The page blob is created at the URI specified for this object. + + The size of the drive to create. The minimum size permitted is 16 MB. + true if the Windows Azure drive was created, or false if it already existed. + + + + Creates a snapshot of the page blob associated with this Windows Azure drive. + + A URI to the newly created snapshot. + + + + Copies the data in this Windows Azure drive to a new page blob. + + The URI of the destination blob. + The copy operation takes place entirely within the Windows Azure Blob service and does not involve the client. + + + + Deletes the Windows Azure drive and its associated page blob. + + + If the page blob behind this Windows Azure drive has associated snapshots, you must + delete the snapshots using the Windows Azure Managed API before deleting the drive. + + + + + Mounts the Windows Azure drive and returns a path to the drive on the local file system. + + The size of the read cache for this mounted drive. Set this + parameter to 0 for unbuffered access to the drive. + The set of for mounting the drive. + The local path to the mounted drive. + + + A Windows Azure drive may be mounted as a writable drive, or as a read-only drive if it is created + from a snapshot of a page blob. + + + Note that before a role instance mounts a drive for the first time, it must initialize the cache + by calling the method. + + + To create a writable drive, create a new instance of the object, specifying + the desired URI for the page blob. Call the method, then call the Mount + method to mount the drive. + + + To create a read-only drive, call the method to create a new snapshot and + return the snapshot's URI, then create a new instance of the object from the snapshot's URI + and mount the drive. + + + When a role instance mounts a writable drive, it acquires an exclusive-write lease on the associated page + blob that it retains as long as the drive is mounted. If the same role instance attempts to mount a drive + with the same URI a second time, the operation is ignored and the Mount method returns the local path to the + existing drive. + + + If a role instance other than the one that has mounted the drive and acquired the lease attempts + to mount a drive with the same URI, the operation fails with a . Only one + instance at a time may mount a writable drive and acquire its lease. Once the drive has been unmounted, another instance may + mount the drive and successfully acquire its lease. + + + If a role instance mounts a read-only drive, there is no associated lease, as snapshots cannot be leased. + Multiple role instances can mount and access the same read-only drive. + + + + + + + Mounts the Windows Azure drive using the specified drive letter and returns a path to the drive on the local file system. + + The drive letter for the mounted drive. + The size of the read cache for this mounted drive. Set this + parameter to 0 for unbuffered access to the drive. + The set of for mounting the drive. + The local path to the mounted drive. + + + A Windows Azure drive may be mounted as a writable drive, or as a read-only drive if it is created + from a snapshot of a page blob. + + + Note that before a role instance mounts a drive for the first time, it must initialize the cache + by calling the method. + + + To create a writable drive, create a new instance of the object, specifying + the desired URI for the page blob. Call the method, then call the Mount + method to mount the drive. + + + To create a read-only drive, call the method to create a new snapshot and + return the snapshot's URI, then create a new instance of the object from the snapshot's URI + and mount the drive. + + + When a role instance mounts a writable drive, it acquires an exclusive-write lease on the associated page + blob that it retains as long as the drive is mounted. If the same role instance attempts to mount a drive + with the same URI a second time, the operation is ignored and the Mount method returns the local path to the + existing drive. + + + If a role instance other than the one that has mounted the drive and acquired the lease attempts + to mount a drive with the same URI, the operation fails with a . Only one + instance at a time may mount a writable drive and acquire its lease. Once the drive has been unmounted, another instance may + mount the drive and successfully acquire its lease. + + + If a role instance mounts a read-only drive, there is no associated lease, as snapshots cannot be leased. + Multiple role instances can mount and access the same read-only drive. + + + + + + + Unmounts the drive and releases any lease associated with it. + + + Note that when you unmount a drive, its contents are not deleted. To delete the contents of + a drive, call the method. + + + + + Initializes the read cache for any subsequently mounted drives associated with the role instance. + + The local file system path to the directory containing the cache. + If the directory does not exist, it will be created. + The total cache size, in megabytes. + + + Before you mount a drive, you must call the InitializeCache method to initialize a cache for the drive. + If a role instance attempts to mount a drive before a cache has been initialized, a + is thrown. + + + When a drive is mounted, it stores cache data in the cache defined by the most recent call to InitializeCache. + In other words, if a role instance calls the InitializeCache method a second time with different arguments, + any drives mounted subsequently will store cache data in the newly defined cache. Any previously mounted drives + continue to store cache data in the cache that was defined before those drives were mounted. + + + + + + Returns a mapping of local file system paths for mounted drives to page blob URIs for the current role instance. + + A read-only dictionary that maps local paths to page blob URIs. + + + + Ensure operation is allowed in this context. + + + + + Gets the credentials for the storage account where this drive's data is stored. + + + + + Gets the local file system path to the mounted drive. Returns null if no drive is currently mounted. + + + + + Gets the URI of the page blob where this drive's data is stored. + + + + + Defines an exception that may be thrown on operations on Windows Azure drives. + + + + + 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). + + + + + Returns the exception code for this exception + + + + + Appends a path to a Uri correctly using "/" as separator + + AppendPathToUri(new Uri("http://test.blob.core.windows.net/test", "abc") + => new Uri("http://test.blob.core.windows.net/test/abc") + + AppendPathToUri(new Uri("http://test.blob.core.windows.net/test"), "http://test.blob.core.windows.net/test/abc") + => new Uri("http://test.blob.core.windows.net/test/abc") + + + + + + + + Append a relative path to a URI, handling trailing slashes appropriately. + + + + + + + + + Specifies options for mounting a Windows Azure drive. + + + + + No options specified for mounting the drive. + + + + + Acquires the lease for this instance and forces the drive to be mounted. + + + + + Attempts to fix file system errors. Note may result in loss of data. See remarks. + + + Setting this flag calls chkdsk /F on the mounted drive. + To avoid any potential data-loss it is recommed a snapshot of the drive is taken first before + attempting to fix file system errors. + + + + + Use Shared Access Credentials to authenticate with the Azure Blob Service. + + + By default, Azure Drives will use the Account Shared Key to authenticate with the + Azure Blob Service. It requires the secret key to be cached outside the calling + process. This may be a security concern for some applications and the risk can be + mitigated by setting this flag. However if this flag is set and the calling + process is terminated, then the drive will auto-unmount when the Shared Access + Credentials expire. + + + + diff --git a/lib/Azure/Microsoft.WindowsAzure.Configuration.dll b/lib/Azure/Microsoft.WindowsAzure.Configuration.dll index b91c22bc526..1fda5cd5489 100644 Binary files a/lib/Azure/Microsoft.WindowsAzure.Configuration.dll and b/lib/Azure/Microsoft.WindowsAzure.Configuration.dll differ diff --git a/lib/Azure/Microsoft.WindowsAzure.Diagnostics.StorageUtility.dll b/lib/Azure/Microsoft.WindowsAzure.Diagnostics.StorageUtility.dll new file mode 100644 index 00000000000..d159ec7958f Binary files /dev/null and b/lib/Azure/Microsoft.WindowsAzure.Diagnostics.StorageUtility.dll differ diff --git a/lib/Azure/Microsoft.WindowsAzure.Diagnostics.dll b/lib/Azure/Microsoft.WindowsAzure.Diagnostics.dll index 9ab222ad288..bc937100f73 100644 Binary files a/lib/Azure/Microsoft.WindowsAzure.Diagnostics.dll and b/lib/Azure/Microsoft.WindowsAzure.Diagnostics.dll differ diff --git a/lib/Azure/Microsoft.WindowsAzure.Diagnostics.xml b/lib/Azure/Microsoft.WindowsAzure.Diagnostics.xml index 5670b5b9b1b..a536beb941e 100644 --- a/lib/Azure/Microsoft.WindowsAzure.Diagnostics.xml +++ b/lib/Azure/Microsoft.WindowsAzure.Diagnostics.xml @@ -1,2221 +1,2206 @@ - - - - Microsoft.WindowsAzure.Diagnostics - - - - - Provides access to common SDK constants. - - - - - The version to display in the command line tools banners. - - - - - Path to the SDK installation registry key. - - - - - Name of the registry value that contains the SDK installation path. - - - - - Name of the registry value that contains the SDK version string. - - - - - The version to display in the command line tools banners. - - - - - The GUID of the ETW log to use for Azure infrastructure logging. - - - - - Environment variable read by hosts to enable partial trust. - - - - - Environment variable for Agent RPC Endpoint. - - - - - String environment variable that defines the module name for system plugin tasks. - It is required to differenciate user startup task and system startup task. - - - - - Boolean environment variable that causes IISConfigurator to delete existing sites. - - - - - Boolean environment variable that causes IISConfigurator to configure URL rewrite. - - - - - Configurable operation timeout for IISConfigurator client connection through WCF. - This is in terms of minutes. - - - - - The name of the environment variable that contains the role type. - - - - - The role type value indicating a worker role. - - - - - The role type value indicating a web role hosted in HWC. - - - - - The role type value indicating a web role hosted in IIS. - - - - - Base path to SDK runtime endpoint discovery (no version specified). - - - - - Path to SDK runtime endpoint discovery. - - - - - Name of the runtime endpoint value. - - - - - Name of the runtime endpoint value. - - - - - Subject name of generated management certificates. - - - - - Registry key path to storage key path. - - - - - Registry key path to cloud drive devpath. - - - - - Name of the registry value that contains path for the devpath. - - - - - Name of the registry value that contains path for the devpath. - - - - - Name of the event log. - - - - - Name of the event guest agent source. - - - - - Name of the event runtime source. - - - - - The name of the private configuration setting use to determine if code is running under - the devfabric or not. - - - This is shared between the runtime and the devfabric. Do not change this, as it breaks - a contract between the two. - - - - - The name of the private configuration setting use to pass the path to the IIS Express installation root. - - - This is shared between the runtime and the devfabric. Do not change this, as it breaks - a contract between the two. - - - - - Path to a debugger to launch the role host process under. - - - - - Provides extension methods to the class. - - - - - Creates a new instance of the class for the specified deployment. - - A object. - The deployment ID for the current deployment. - A object. - - - - Creates an new instance of the class for the specified deployment, role, - and instance. - - A object. - The deployment ID for the current deployment. - The name of the role in the specified deployment. - The role instance ID. - A object. - - - - Allows sending configuration requests to a ConfigChannelServer. - - - - - Stores the name of the pipe. - - - - - Initializes a new instance of the class. - - Name of the pipe. - - - - Sends the configuration request. - - The config request. - The timeout. - true if the config was sent; otherwise false. - - - - Starts a named pipe server that listens for configuration change events. - - - - - Stores the name of the pipe. - - - - - Stores the server pipe. - - - - - Initializes a new instance of the class. - - Name of the pipe. - - - - Starts a named pipe server. - - - - - Stops the server. - - - - - Raises the event. - - The instance containing the event data. - - - - Handles client connections. - - The async result. - - - - Raised when a new configuration is sent. - - - - - Stores the data required for the ConfigurationRequest event. - - - - - Initializes a new instance of the class. - - The request. - - - - Gets the config request. - - The config request. - - - - Determines if a URI requires path style addressing - - - - - - - Advanced class used to explicitly configure the monitoring agent. - - - - - Creates an inital configuration for the diagnostic monitor. - - - - - Gets or sets the storage account to which logs are transferred. - - - - - Gets or sets the deployment ID of the role instance for which this diagnostic monitor is running. - - - - - Gets or sets the role instance ID. - - - - - Gets or sets the name of the role. - - - - - Gets or sets the name of the local directory where diagnostic monitor state is written. - - - - - Gets or sets the diagnostic monitor tools directory. - - - - - Gets or sets the polling interval for the diagnostic monitor. - - - - - Represents the configuation for performance counter data sources. - - - - - Gets or sets the rate at which to sample the performance counter, rounded up to the nearest second. - - - - - Gets or sets a performance counter specifier using standard Windows counter syntax. - - - See Specifying a Counter Path - for more information on performance counters. - - - - - Class to configure data buffers used to store diagnostic information. - - - - - Gets or sets the interval between scheduled transfers for this data buffer, in minutes. - - - This value is rounded up to the nearest minute. A value of TimeSpan.Zero disables any scheduled - data transfer. - - - - - Gets or sets the maximum amount of file system storage available to the specified data buffer. - - - By default buffer sizes are automatically allocated by Windows Azure. You can set this property - if you need to manage the buffer size explicitly. - - - - - Configuration class for data buffers that contain file-based logs. - - - Represents the configuration for file-based data buffers. - - - - - Gets a list of configured directories for file-based logs. - - - - - Configuation class for data buffers that hold performance counter information. - - - Represents the buffer configuration for performance counters. - - - - - Gets a list of configurations for performance counters that are being collected. - - - - - Configuration class for buffers used to hold information gathered from the Windows event logs. - - - Represents the buffer configuration for Windows event logs. - - - - - Gets a list of configured data sources for Windows event logs. - - - - - Specifies a logging level by which to filter records when performing a scheduled transfer. - - - When this property is set to LogLevel.Undefined, no filter is applied and all logging events at all levels are transferred. - - - - - Represents the configuration for a set of standard fixed data buffers for logging and diagnostic information. - - - - - Gets or sets the interval at which the diagnostic monitor polls for diagnostic configuration changes. - - - - Increasing the rate at which your service polls for configuration changes may affect your - storage costs. For more information, see . - - - Note that the configuration change polling interval cannot be set remotely. - - - - - - Gets or sets the total amount of file system storage allocated for all logging buffers. - - - - - Gets or sets the buffer configuration for basic Windows Azure logs. - - - - - - Gets or sets the buffer configuration for the logs generated by the underlying diagnostics infrastructure. - The diagnostic infrastructure logs are useful for troubleshooting the diagnostics system itself. - - - - - Gets or sets the buffer configuration for performance counter data. - - - - - Gets or sets the buffer configuration for Windows event logs. - - - - - Gets or sets the buffer configuration for file-based logs defined by the developer. - - - - - Represents information about ongoing data transfers from the local logs to a Windows Azure storage account. - - - - - Constructs an OnDemandTransferInfo object from queue messages sent by a diagnostic monitor on completion of an on-demand - transfer. - - The queue message. - An object. - - - - Gets or sets the unique ID for a given transfer request. - - - - - Gets or sets the deployment ID from which the source data is being transferred. - - - - - Gets or sets the name of the role from which the source data is being transferred. - - - - - Gets or sets the ID of the role instance from which the source data is being transferred. - - - - - Gets or sets the name of a queue where a completion message will be enqueued to provide information - about this transfer. - - - If notification of completion is requested, a single message will - be placed in the specified queue to signal completion. - - - - - Enumeration of a standard set of data buffers for logging. - - - - - Basic Windows Azure logs - - - - - Diagnostic infrastructure logs - - - - - Performance counters - - - - - Windows event logs - - - - - File-based logs defined by the developer. - - - IIS logs, Failed Request logs, and application crash dumps are a special case of file-based logs that are automatically - configured for the service. - - - - - Describes the configuration of a directory to which file-based logs are written. - - - IIS logs, Failed Request logs, and application crash dumps are a special case of file-based logs that are automatically - configured for the service. - - - - - Gets or sets the absolute path for the local directory to which file-based logs are being written. - - - - - Gets or sets the name of a container defined in a storage account where the - contents of file-based logs are to be transferred. - - - - A container is a resource defined by the Blob service under which blob data is stored. File-based logs are - copied from the local directory to blobs within this container when a scheduled or on-demand transfer is performed. - - - The Blob service endpoint is determined by the cloud storage account used to initialize the - for the role instance. - - - The directory from which file-based logs are transferred is the directory defined by the property - for this object. - - - - - - Gets or sets the maximum size of the directory defined by the property to which - file-based logs are written. - - - - - Defines a standard set of logging levels. - - - - - Logs all events at all levels. - - - - - Logs a critical alert. - - - - - Logs an error. - - - - - Logs a warning. - - - - - Logs an informational message. - - - - - Logs a verbose message. - - - - - Represents the buffer configuration for basic Windows Azure logs. - - - - - Gets or sets the logging level by which to filter records when performing a scheduled transfer. - - - When this property is set to LogLevel.Undefined, no filter is applied and all logging events at all levels are transferred. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Represents an active instance of a diagnostic monitor. - - - - - Returns the default initial diagnostic monitor configuration for the current role instance. - - A object. - - - Call this method to retrieve the initial configuration for all logging and diagnostic parameters for the current - role instance. Once you retrieve the initial configuration, you can modify configuration parameters and - update the configuration for the current instance. - - - By default, the overall quota for file system storage for all logging buffers is approximately 4 GB. This - storage space is automatically allocated across the various logging buffers in a dynamic fashion. - You can also configure individual buffer quotas if you prefer to manage them yourself. - - - The size of the overall quota for logging buffers is limited by the size of the DiagnosticStore local resource. - To increase the size of the overall quota, first increase the size of the DiagnosticStore resource. - - - - - - Starts a diagnostic monitor. - - The name of a configuration setting that - provides a connection string to a storage account. - - A object. - - - This method starts a diagnostic monitor with the default initial configuration. - Data buffers are written to the storage account indicated by the specified configuration setting. The storage - account may be the well-known development storage account, or a Windows Azure storage account in the cloud. - - - See Configuring Connection Strings for more information - about how to construct a connection string to a storage account. - - - This method also registers for notification of changes to configuration settings. - If the value of the connection string is changed, the diagnostic monitor will be - automatically reconfigured to use the new connection. - - - See Configuring Connection Strings for more information - about how to construct a connection string to a storage account. - - - - - - Starts a diagnostic monitor with a user-defined initial configuration. - - The name of a configuration setting that - provides a connection string to a storage account. - A object that - provides a custom initial configuration. - A object. - - - This method starts a diagnostic monitor with the specified initial configuration. - Data buffers are written to the storage account indicated by the specified configuration setting. The storage - account may be the well-known development storage account, or a Windows Azure storage account in the cloud. - - - This method also registers for notification of changes to configuration settings. - If the value of the connection string is changed, the monitoring agent will be - automatically reconfigured to use the new connection. - - - See Configuring Connection Strings for more information - about how to construct a connection string to a storage account. - - - - - - Starts a diagnostic monitor with a user-defined initial configuration. - - A object. - A object that - provides a custom initial configuration. - - A object. - - - - This method starts a diagnostic monitor with the specified storage account and initial configuration. - Data buffers are written to the specified storage account. - - - This method also registers for notification of changes to configuration settings. - If the value of the connection string is changed, the monitoring agent will be - automatically reconfigured to use the new connection. - - - See Configuring Connection Strings for more information - about how to construct a connection string to a storage account. - - - - - - Updates the storage account information for the current diagnostic monitor. - - A object. - - - - Stops the diagnostic monitor. - - - - - Specifies that the diagnostic monitor may use non-secure (HTTP) connections to - communicate with the storage account. - - - true if [allow insecure remote connections]; otherwise, false. - - - - This property should be set to true only in debugging - scenarios. In a production environment, the default connection used by the diagnostic monitor is secure (HTTPS). - When the diagnostic monitor is configured to use the development storage account, this property is ignored. - - - - - - Gets the local directory where state information for the diagnostic monitor is stored. - - - - - Represents the application crash dumps. - - - - - Enables collection of application crash dumps (mini dumps or full dumps) for this process. - - if set to true [enable full dumps]; if false, collect mini dumps only. - - - When you enable collection of crash dumps with this method, crash dumps are written to the crash dumps - directory (named "CrashDumps") in the default diagnostic store. The default diagnostic store is a local - resource that is automatically configured for the role and is named "DiagnosticStore". - You can retrieve the default diagnostic store by calling the - method. - - - - - - Enables collection of crash dumps (mini dumps or full dumps) for this process to a specified local directory. - - The absolute path to the local directory. - if set to true [enable full dumps]; if false, collect mini dumps only. - - - - Provides a class for managing the configuration of diagnostic monitors remotely. - - - - - Creates a new instance of the class. - - A connection string for a storage account. - The deployment ID. - - - See Configuring Connection Strings for more information - about how to construct a connection string to a storage account. - - - - - - Creates a new instance of the class. - - A object. - The deployment ID. - - - - Lists the set of roles which have successfully started at least one diagnostic monitor. - - A list of role names. - This method does not return a list of all roles in a deployment, but only the roles for which there is currently at least - once instance running a diagnostic monitor. - - - - Returns a list of IDs of active role instances that have a diagnostic monitor running. - - The name of the role. - A list of role instance IDs. - - - - Returns the list of role instance diagnostic managers for the specified role. - - The name of the role. - A list of objects. - - - - Returns the for the specified role instance. - - The name of the role. - The role instance ID. - A object. - - - - Specifies that the deployment diagnostic manager may use non-secure (HTTP) connections to - communicate with the storage account. - - - true if [allow insecure remote connections]; otherwise, false. - - - - This property should be set to true only in debugging - scenarios. In a production environment, the default connection used by the deployment diagnostic manager is secure (HTTPS). - When the deployment diagnostic manager is configured to use the development storage account, this property is ignored. - - - - - - Specifies options for an on-demand transfer. - - - - - Gets or sets the start of the time window for which event data is to be transferred. - - - - - Gets or sets the end of the time window for which event data is to be transferred. - - - - - Gets or sets the filter level for event data that has been logged with level information. - - - If the logging level is set to LogLevel.Undefined, all data is transferred regardless of logging level. - - - - - Gets or sets the name of the queue where transfer completion notification can optionally be sent. - - - - - Class for remotely mananging the configruation and diagnostic data for a given role instnace. - - - - - Initializes a new instance of the class. - - A object. - The deployment ID. - The name of the role. - The role instance ID. - - - - Gets the current diagnostic monitor configuration. - - A object. - - - - Sets the configuration for the diagnostic monitor. - - A object representing the new configuration. - - Setting the current configuration while on-demand transfers are pending results in an error. - - - - - Returns the set of active transfers, with associated transfer information. - - A Dictionary of data buffers and their associated on-demand transfer information. - - - - Begins an on-demand transfer of the specified data buffer. - - The name of the source buffer. - A request ID identifying the transfer. - - - - Begins an on-demand transfer of the specified data buffer. - - The name of the source buffer. - Options for the on-demand transfer. - A request ID identifying the transfer. - - - - Cancel all on-demand transfers that are currently in progress, returning the request ID for each transfer. - - Name of the data buffer. - A list of request IDs for the on-demand transfers that are in progress. - Currently there can be at most one active transfer per data buffer. - - - - Stops an on-demand transfer based on its request ID. - - The request ID. - - A boolean indicating whether the on-demand transfer was stopped. This method - may return false if the there is no active tranfer with the given request ID. - - - - - Specifies that the role instance diagnostic manager may use non-secure (HTTP) connections to - communicate with the storage account. - - - true if [allow insecure remote connections]; otherwise, false. - - - - This property should be set to true only in debugging - scenarios. In a production environment, the default connection used by the role instance diagnostic manager is secure (HTTPS). - When the role instance diagnostic manager is configured to use the development storage account, this property is ignored. - - - - - - Gets the deployment ID of this role instance. - - - - - Gets the name of the role for this role instance. - - - - - Gets the ID of this role instance. - - - - - Represents the trace listener used for basic Windows Azure logs. - - - - - Constructor for the class. - - - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - When overridden in a derived class, writes the specified message to the listener you create in the derived class. - - The message to write. - - - - When overridden in a derived class, writes a message to the listener you create in the derived class, followed by a line terminator. - - A message to write. - - - - 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 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 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, 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 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. - - - - - - - - Indicates whether the diagnostic monitor trace listener is thread-safe. - - - - + + + + Microsoft.WindowsAzure.Diagnostics + + + + + Provides access to common SDK constants. + + + + + The version to display in the command line tools banners. + + + + + Path to the SDK installation registry key. + + + + + Name of the registry value that contains the SDK installation path. + + + + + Name of the registry value that contains the SDK version string. + + + + + The version to display in the command line tools banners. + + + + + The GUID of the ETW log to use for Azure infrastructure logging. + + + + + Environment variable read by hosts to enable partial trust. + + + + + Environment variable for Agent RPC Endpoint. + + + + + String environment variable that defines the module name for system plugin tasks. + It is required to differenciate user startup task and system startup task. + + + + + Boolean environment variable that causes IISConfigurator to delete existing sites. + + + + + Boolean environment variable that causes IISConfigurator to configure URL rewrite. + + + + + Configurable operation timeout for IISConfigurator client connection through WCF. + This is in terms of minutes. + + + + + The name of the environment variable that contains the role type. + + + + + The role type value indicating a worker role. + + + + + The role type value indicating a web role hosted in HWC. + + + + + The role type value indicating a web role hosted in IIS. + + + + + Base path to SDK runtime endpoint discovery (no version specified). + + + + + Path to SDK runtime endpoint discovery. + + + + + Name of the runtime endpoint value. + + + + + Name of the runtime endpoint value. + + + + + Subject name of generated management certificates. + + + + + Registry key path to storage key path. + + + + + Registry key path to cloud drive devpath. + + + + + Name of the registry value that contains path for the devpath. + + + + + Name of the registry value that contains path for the devpath. + + + + + Name of the event log. + + + + + Name of the event guest agent source. + + + + + Name of the event runtime source. + + + + + The name of the private configuration setting use to determine if code is running under + the devfabric or not. + + + This is shared between the runtime and the devfabric. Do not change this, as it breaks + a contract between the two. + + + + + The name of the private configuration setting use to pass the path to the IIS Express installation root. + + + This is shared between the runtime and the devfabric. Do not change this, as it breaks + a contract between the two. + + + + + Path to a debugger to launch the role host process under. + + + + + Provides extension methods to the DiagnosticMonitor class + + + + + Creates a new instance of the class for the specified deployment + + Storage account connection string. + The deployment ID for the current deployment. + A object. + + + + Creates an new instance of the class for the specified deployment, role, + and instance. + " + Storage account connection string. + The deployment ID for the current deployment. + The name of the role in the specified deployment. + The role instance ID. + A object. + + + + Allows sending configuration requests to a ConfigChannelServer. + + + + + Stores the name of the pipe. + + + + + Initializes a new instance of the class. + + Name of the pipe. + + + + Sends the configuration request. + + The config request. + The timeout. + true if the config was sent; otherwise false. + + + + Starts a named pipe server that listens for configuration change events. + + + + + Stores the name of the pipe. + + + + + Stores the server pipe. + + + + + Initializes a new instance of the class. + + Name of the pipe. + + + + Starts a named pipe server. + + + + + Stops the server. + + + + + Raises the event. + + The instance containing the event data. + + + + Handles client connections. + + The async result. + + + + Raised when a new configuration is sent. + + + + + Stores the data required for the ConfigurationRequest event. + + + + + Initializes a new instance of the class. + + The request. + + + + Gets the config request. + + The config request. + + + + XML serializer for configuration request. + + + + + Advanced class used to explicitly configure the monitoring agent. + + + + + Creates an inital configuration for the diagnostic monitor. + + + + + Gets or sets the connection string for storage account to which logs are transferrred. + + + + + Gets or sets the deployment ID of the role instance for which this diagnostic monitor is running. + + + + + Gets or sets the role instance ID. + + + + + Gets or sets the name of the role. + + + + + Gets or sets the name of the local directory where diagnostic monitor state is written. + + + + + Gets or sets the diagnostic monitor tools directory. + + + + + Gets or sets the polling interval for the diagnostic monitor. + + + + + Represents the configuation for performance counter data sources. + + + + + Gets or sets the rate at which to sample the performance counter, rounded up to the nearest second. + + + + + Gets or sets a performance counter specifier using standard Windows counter syntax. + + + See Specifying a Counter Path + for more information on performance counters. + + + + + Class to configure data buffers used to store diagnostic information. + + + + + Gets or sets the interval between scheduled transfers for this data buffer, in minutes. + + + This value is rounded up to the nearest minute. A value of TimeSpan.Zero disables any scheduled + data transfer. + + + + + Gets or sets the maximum amount of file system storage available to the specified data buffer. + + + By default buffer sizes are automatically allocated by Windows Azure. You can set this property + if you need to manage the buffer size explicitly. + + + + + Configuration class for data buffers that contain file-based logs. + + + Represents the configuration for file-based data buffers. + + + + + Gets a list of configured directories for file-based logs. + + + + + Configuation class for data buffers that hold performance counter information. + + + Represents the buffer configuration for performance counters. + + + + + Gets a list of configurations for performance counters that are being collected. + + + + + Configuration class for buffers used to hold information gathered from the Windows event logs. + + + Represents the buffer configuration for Windows event logs. + + + + + Gets a list of configured data sources for Windows event logs. + + + + + Specifies a logging level by which to filter records when performing a scheduled transfer. + + + When this property is set to LogLevel.Undefined, no filter is applied and all logging events at all levels are transferred. + + + + + Represents the configuration for a set of standard fixed data buffers for logging and diagnostic information. + + + + + Gets or sets the interval at which the diagnostic monitor polls for diagnostic configuration changes. + + + + Increasing the rate at which your service polls for configuration changes may affect your + storage costs. For more information, see . + + + Note that the configuration change polling interval cannot be set remotely. + + + + + + Gets or sets the total amount of file system storage allocated for all logging buffers. + + + + + Gets or sets the buffer configuration for basic Windows Azure logs. + + + + + + Gets or sets the buffer configuration for the logs generated by the underlying diagnostics infrastructure. + The diagnostic infrastructure logs are useful for troubleshooting the diagnostics system itself. + + + + + Gets or sets the buffer configuration for performance counter data. + + + + + Gets or sets the buffer configuration for Windows event logs. + + + + + Gets or sets the buffer configuration for file-based logs defined by the developer. + + + + + Represents information about ongoing data transfers from the local logs to a Windows Azure storage account. + + + + + Constructs an OnDemandTransferInfo object from queue messages sent by a diagnostic monitor on completion of an on-demand + transfer. + + The queue message content. + An object. + + + + Gets or sets the unique ID for a given transfer request. + + + + + Gets or sets the deployment ID from which the source data is being transferred. + + + + + Gets or sets the name of the role from which the source data is being transferred. + + + + + Gets or sets the ID of the role instance from which the source data is being transferred. + + + + + Gets or sets the name of a queue where a completion message will be enqueued to provide information + about this transfer. + + + If notification of completion is requested, a single message will + be placed in the specified queue to signal completion. + + + + + Enumeration of a standard set of data buffers for logging. + + + + + Basic Windows Azure logs + + + + + Diagnostic infrastructure logs + + + + + Performance counters + + + + + Windows event logs + + + + + File-based logs defined by the developer. + + + IIS logs, Failed Request logs, and application crash dumps are a special case of file-based logs that are automatically + configured for the service. + + + + + Describes the configuration of a directory to which file-based logs are written. + + + IIS logs, Failed Request logs, and application crash dumps are a special case of file-based logs that are automatically + configured for the service. + + + + + Gets or sets the absolute path for the local directory to which file-based logs are being written. + + + + + Gets or sets the name of a container defined in a storage account where the + contents of file-based logs are to be transferred. + + + + A container is a resource defined by the Blob service under which blob data is stored. File-based logs are + copied from the local directory to blobs within this container when a scheduled or on-demand transfer is performed. + + + The Blob service endpoint is determined by the cloud storage account used to initialize the + for the role instance. + + + The directory from which file-based logs are transferred is the directory defined by the property + for this object. + + + + + + Gets or sets the maximum size of the directory defined by the property to which + file-based logs are written. + + + + + Defines a standard set of logging levels. + + + + + Logs all events at all levels. + + + + + Logs a critical alert. + + + + + Logs an error. + + + + + Logs a warning. + + + + + Logs an informational message. + + + + + Logs a verbose message. + + + + + Represents the buffer configuration for basic Windows Azure logs. + + + + + Gets or sets the logging level by which to filter records when performing a scheduled transfer. + + + When this property is set to LogLevel.Undefined, no filter is applied and all logging events at all levels are transferred. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Represents an active instance of a diagnostic monitor. + + + + + Returns the default initial diagnostic monitor configuration for the current role instance. + + A object. + + + Call this method to retrieve the initial configuration for all logging and diagnostic parameters for the current + role instance. Once you retrieve the initial configuration, you can modify configuration parameters and + update the configuration for the current instance. + + + By default, the overall quota for file system storage for all logging buffers is approximately 4 GB. This + storage space is automatically allocated across the various logging buffers in a dynamic fashion. + You can also configure individual buffer quotas if you prefer to manage them yourself. + + + The size of the overall quota for logging buffers is limited by the size of the DiagnosticStore local resource. + To increase the size of the overall quota, first increase the size of the DiagnosticStore resource. + + + + + + Starts a diagnostic monitor. + + The name of a configuration setting that + provides a connection string to a storage account. + + A object. + + + This method starts a diagnostic monitor with the default initial configuration. + Data buffers are written to the storage account indicated by the specified configuration setting. The storage + account may be the well-known development storage account, or a Windows Azure storage account in the cloud. + + + See Configuring Connection Strings for more information + about how to construct a connection string to a storage account. + + + This method also registers for notification of changes to configuration settings. + If the value of the connection string is changed, the diagnostic monitor will be + automatically reconfigured to use the new connection. + + + See Configuring Connection Strings for more information + about how to construct a connection string to a storage account. + + + + + + Starts a diagnostic monitor with a user-defined initial configuration. + + The name of a configuration setting that + provides a connection string to a storage account. + A object that + provides a custom initial configuration. + A object. + + + This method starts a diagnostic monitor with the specified initial configuration. + Data buffers are written to the storage account indicated by the specified configuration setting. The storage + account may be the well-known development storage account, or a Windows Azure storage account in the cloud. + + + This method also registers for notification of changes to configuration settings. + If the value of the connection string is changed, the monitoring agent will be + automatically reconfigured to use the new connection. + + + See Configuring Connection Strings for more information + about how to construct a connection string to a storage account. + + + + + + Starts a diagnostic monitor with an explicitly supplied storage connection string and initial configuration. + + The connection string to a storage account. + A object that + provides a custom initial configuration. + A object. + + + This method starts a diagnostic monitor with the specified initial configuration. + Data buffers are written to the storage account indicated by the connection string. The storage + account may be the well-known development storage account, or a Windows Azure storage account in the cloud. + + + See Configuring Connection Strings for more information + about how to construct a connection string to a storage account. + + + + + + Updates the storage account information for the current diagnostic monitor. + + Storage account connection string. + + + + Stops the diagnostic monitor. + + + + + Specifies that the diagnostic monitor may use non-secure (HTTP) connections to + communicate with the storage account. + + + true if [allow insecure remote connections]; otherwise, false. + + + + This property should be set to true only in debugging + scenarios. In a production environment, the default connection used by the diagnostic monitor is secure (HTTPS). + When the diagnostic monitor is configured to use the development storage account, this property is ignored. + + + + + + Gets the local directory where state information for the diagnostic monitor is stored. + + + + + Represents the application crash dumps. + + + + + Enables collection of application crash dumps (mini dumps or full dumps) for this process. + + if set to true [enable full dumps]; if false, collect mini dumps only. + + + When you enable collection of crash dumps with this method, crash dumps are written to the crash dumps + directory (named "CrashDumps") in the default diagnostic store. The default diagnostic store is a local + resource that is automatically configured for the role and is named "DiagnosticStore". + You can retrieve the default diagnostic store by calling the + method. + + + + + + Enables collection of crash dumps (mini dumps or full dumps) for this process to a specified local directory. + + The absolute path to the local directory. + if set to true [enable full dumps]; if false, collect mini dumps only. + + + + Provides a class for managing the configuration of diagnostic monitors remotely. + + + + + Creates a new instance of the class. + + A connection string for a storage account. + The deployment ID. + + + See Configuring Connection Strings for more information + about how to construct a connection string to a storage account. + + + + + + Lists the set of roles which have successfully started at least one diagnostic monitor. + + A list of role names. + This method does not return a list of all roles in a deployment, but only the roles for which there is currently at least + once instance running a diagnostic monitor. + + + + Returns a list of IDs of active role instances that have a diagnostic monitor running. + + The name of the role. + A list of role instance IDs. + + + + Returns the list of role instance diagnostic managers for the specified role. + + The name of the role. + A list of objects. + + + + Returns the for the specified role instance. + + The name of the role. + The role instance ID. + A object. + + + + Specifies that the deployment diagnostic manager may use non-secure (HTTP) connections to + communicate with the storage account. + + + true if [allow insecure remote connections]; otherwise, false. + + + + This property should be set to true only in debugging + scenarios. In a production environment, the default connection used by the deployment diagnostic manager is secure (HTTPS). + When the deployment diagnostic manager is configured to use the development storage account, this property is ignored. + + + + + + Specifies options for an on-demand transfer. + + + + + Gets or sets the start of the time window for which event data is to be transferred. + + + + + Gets or sets the end of the time window for which event data is to be transferred. + + + + + Gets or sets the filter level for event data that has been logged with level information. + + + If the logging level is set to LogLevel.Undefined, all data is transferred regardless of logging level. + + + + + Gets or sets the name of the queue where transfer completion notification can optionally be sent. + + + + + Class for remotely mananging the configruation and diagnostic data for a given role instnace. + + + + + Initializes a new instance of the class. + + Storage account connection string. + The deployment ID. + The name of the role. + The role instance ID. + + + + Gets the current diagnostic monitor configuration. + + A object. + + + + Sets the configuration for the diagnostic monitor. + + A object representing the new configuration. + + Setting the current configuration while on-demand transfers are pending results in an error. + + + + + Returns the set of active transfers, with associated transfer information. + + A Dictionary of data buffers and their associated on-demand transfer information. + + + + Begins an on-demand transfer of the specified data buffer. + + The name of the source buffer. + A request ID identifying the transfer. + + + + Begins an on-demand transfer of the specified data buffer. + + The name of the source buffer. + Options for the on-demand transfer. + A request ID identifying the transfer. + + + + Cancel all on-demand transfers that are currently in progress, returning the request ID for each transfer. + + Name of the data buffer. + A list of request IDs for the on-demand transfers that are in progress. + Currently there can be at most one active transfer per data buffer. + + + + Stops an on-demand transfer based on its request ID. + + The request ID. + + A boolean indicating whether the on-demand transfer was stopped. This method + may return false if the there is no active tranfer with the given request ID. + + + + + Specifies that the role instance diagnostic manager may use non-secure (HTTP) connections to + communicate with the storage account. + + + true if [allow insecure remote connections]; otherwise, false. + + + + This property should be set to true only in debugging + scenarios. In a production environment, the default connection used by the role instance diagnostic manager is secure (HTTPS). + When the role instance diagnostic manager is configured to use the development storage account, this property is ignored. + + + + + + Gets the deployment ID of this role instance. + + + + + Gets the name of the role for this role instance. + + + + + Gets the ID of this role instance. + + + + + Represents the trace listener used for basic Windows Azure logs. + + + + + Constructor for the class. + + + + + Releases the unmanaged resources used by the and optionally releases the managed resources. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + When overridden in a derived class, writes the specified message to the listener you create in the derived class. + + The message to write. + + + + When overridden in a derived class, writes a message to the listener you create in the derived class, followed by a line terminator. + + A message to write. + + + + 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 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 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, 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 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. + + + + + + + + Indicates whether the diagnostic monitor trace listener is thread-safe. + + + + diff --git a/lib/Azure/Microsoft.WindowsAzure.ServiceRuntime.dll b/lib/Azure/Microsoft.WindowsAzure.ServiceRuntime.dll index 8ef49f3e614..642e2ff5a94 100644 Binary files a/lib/Azure/Microsoft.WindowsAzure.ServiceRuntime.dll and b/lib/Azure/Microsoft.WindowsAzure.ServiceRuntime.dll differ diff --git a/lib/Azure/Microsoft.WindowsAzure.ServiceRuntime.xml b/lib/Azure/Microsoft.WindowsAzure.ServiceRuntime.xml index eab0be2ea87..ee74164bf17 100644 --- a/lib/Azure/Microsoft.WindowsAzure.ServiceRuntime.xml +++ b/lib/Azure/Microsoft.WindowsAzure.ServiceRuntime.xml @@ -1,602 +1,602 @@ - - - - Microsoft.WindowsAzure.ServiceRuntime - - - - - Represents the Windows Azure environment in which an instance of a role is running. - - - - - Retrieves the value of a setting in the service configuration file. - - The name of the configuration setting. - A String containing the value of the configuration setting. - - A role's configuration settings are defined in the service definition file. Values for configuration settings - are set in the service configuration file. - - - - - Populates the role information. - - - - - Reads the static role data. - - - Note that instance-level information is not populated. - - - - - - Requests that the current role instance be stopped and restarted. - - - - Before the role instance is recycled, the Windows Azure load balancer takes the role instance out of rotation. - This ensures that no new requests are routed to the instance while it is restarting. - - - A call to RequestRecycle initiates the normal operating system reboot. The current execution context - must have 'SeShutdownPrivilege' privilege. - - - - - - Initializes the role runtime environment. - - - Initializing the runtime is optional; it is initialized automatically as needed. - - - - - Initializes the role runtime environment. - - - Initializing the runtime is optional; it is initialized automatically as needed. - - Note that initialization blocks until the system is configured. - - The amount of time to wait for initialization to complete. - - - - Retrieves a named local storage resource. - - The name of the local resource, as declared in the service definiton file. - A object that represents the local storage resource. - - - - Occurs before a change to the service configuration is applied to the running instances of the role. - - - - Service configuration changes are applied on-the-fly to running role instances. Configuration changes include - changes to the service configuration changes and changes to the number of instances in the service. - - - This event occurs after the new configuration file has been submitted to Windows Azure but - before the changes have been applied to each running role instance. This event can be cancelled - for a given instance to prevent the configuration change. - - - Note that cancelling this event causes the instance to be automatically recycled. When the instance is recycled, - the configuration change is applied when it restarts. - - - - - - Occurs after a change to the service configuration has been applied to the running instances of the role. - - - - - Gets the set of objects defined for your service. - - - Roles are defined in the service definition file. - - - - - Gets a object representing the role instance in which this code is currently executing. - - - - - Indicates the status of the role instance. - - - An instance may indicate that it is in one of two states: Ready or Busy. - If an instance's state is Ready, it is prepared to receive requests from the load balancer. If the instance's state is Busy, - it will not receive requests from the load balancer. - - - - - Indicates whether the role instance is running in the Windows Azure environment. - - - true if this instance is running in the development fabric or in the - Windows Azure environment in the cloud; otherwise, false. - - - - - Indicates whether the role instance is running in the Windows Azure Compute Emulator. - - - true if this instance is running in the compute emulator; otherwise, false. - - - - - Occurs when the availability of the role environment has changed. - - - - - Occurs when the role instance is about to be stopped. - - - - - Gets the deployment ID, a string value that uniquely identifies the deployment in which this role instance is running. - - The deployment ID. - - - - Represents a local storage resource reserved for a service. - - - - - Gets the maximum size in megabytes allocated for the local storage resource, as defined in the service definition file. - - - - - Gets the name of the local store as declared in the service definition file. - - - - - Gets the full directory path to the local storage resource. - - - - - Arguments for the event, which occurs before a configuration change is applied to a role instance. - - - Set the Cancel property to cancel the configuration change. - Cancellation causes the role instance to be immediately recycled. The configuration changes are applied when the instance restarts. - - - - - Gets a collection of the configuration changes that are about to be applied to the role instance. - - - - - Arguments for the event, which occurs after a configuration change has been applied to a role instance. - - - - - Gets a collection of the configuration changes that were applied to the role instance. - - - - - Represents a change to the service's configuration. - - - - - Represents a change to the topology of the service. The service's topology refers to the number of instances - deployed for each role that the service defines. - - - - - Indicates whether two environment changes are equivalent. - - - - - Indicates whether two environment changes are equivalent. - - - - - Gets the hash code corresponding to this object. - - - - - Gets the name of the affected role. - - - - - Represents a change to a configuration setting. - - - - - Indicates whether two environment changes are equivalent. - - - - - Determines whether two changes are equivalent. - - - - - Gets the hash code corresponding to this object. - - - - - Gets the name of the configuration setting that has been changed. - - - - - Represents a role that is defined as part of a hosted service. - - - - - Gets the name of the role as it is declared in the service definition file. - - - - - Gets the collection of instances for the role. - - - - The number of instances of a role to be deployed to Windows Azure is specified in the service's configuration file. - - - A role must define at least one internal endpoint in order for its set of instances to be known at runtime. - - - - - - Represents a logical endpoint on a role. - - - - - Gets the name of the role endpoint. - - - - - Gets a list of all endpoints defined for a role instance. - - - - - Provides callbacks to initialize, run, and stop instances of the role. - - - - All worker roles must extend RoleEntryPoint. - - - Web roles can optionally extend RoleEntryPoint, or can use the ASP.NET lifecycle management - methods to handle the role's startup and stopping sequences. - - - All exceptions that occur within the methods of the RoleEntryPoint class are unhandled exceptions. - - - - - - Called by Windows Azure to initialize the role instance. - - True if initialization succeeds, False if it fails. The default implementation returns True. - - - Override the OnStart method to run initialization code for your role. - - - Before the OnStart method returns, the instance's status is set to Busy and the instance is not available - for requests via the load balancer. - - - If the OnStart method returns false, the instance is immediately stopped. If the method - returns true, then Windows Azure starts the role by calling the method. - - - A web role can include initialization code in the ASP.NET Application_Start method instead of the OnStart method. - Application_Start is called after the OnStart method. - - - Any exception that occurs within the OnStart method is an unhandled exception. - - - - - - Called by Windows Azure after the role instance has been initialized. This method serves as the - main thread of execution for your role. - - - - Override the Run method to implement your own code to manage the role's execution. The Run method should implement - a long-running thread that carries out operations for the role. The default implementation sleeps for an infinite - period, blocking return indefinitely. - - - The role recycles when the Run method returns. - - - Any exception that occurs within the Run method is an unhandled exception. - - - - - - Called by Windows Azure when the role instance is to be stopped. - - - - Override the OnStop method to implement any code your role requires to shut down in an orderly fashion. - - - This method must return within certain period of time. If it does not, Windows Azure - will stop the role instance. - - - A web role can include shutdown sequence code in the ASP.NET Application_End method instead of the OnStop method. - Application_End is called before the Stopping event is raised or the OnStop method is called. - - - Any exception that occurs within the OnStop method is an unhandled exception. - - - - - - Arguments for the event. - - - - - Represents an instance of a role. - - - - - Gets the ID of this instance. - - - - - Gets an integer value that indicates the update domain in which this instance resides. - - - - - Gets an integer value that indicates the fault domain in which this instance resides. - - - - - Gets the object associated with this instance. - - - - - Gets the set of endpoints associated with this role instance. - - - - - Represents an endpoint associated with a role instance. - - - - - Gets an object for this role instance endpoint. The object - provides the IP address and port number for the endpoint. - - - - - Gets the protocol associated with the endpoint - - - - - Gets the object associated with this endpoint. - - - - - Represents a role. - - - - - Represents a role instance. - - - A role instance can represent either the current instance or some other instance discovered - via an endpoint; a subclass exists for each purpose. - - - - - Creates a role instance corresponding to the current instance. - - - - - Gets or sets the deployment ID, a value which uniquely identifies the deployment in which the role instance is running. - - The deployment ID. - - - - Represents a role endpoint. - - - - - Represents a role instance endpoint. - - - - - Arguments for the event. - - - - - Specifies that the instance's status is Busy and that it should not receive requests from the load balancer at this time. - - - When you call SetBusy, the instance's status remains Busy for a period of 10 seconds. To extend the Busy period, call SetBusy again - after this time interval has elapsed. - - - - - Gets a value indicating the status of the role instance. - - - - Event handlers can invoke the SetBusy method to change the status of a role instance. - - - If an instance's status is Ready, it is prepared to receive requests from the load balancer. If the instance's status is Busy, - it will not receive requests from the load balancer. - - - - - - Indicates that the role runtime environment is not available. - - - This exception indicates that either the the caller is running outside the Windows Azure - environment, or that the environment is unavailable due to a critical error. - - - - - Exceptions - - - - - Status of a given role instance - - - - - The role instance is ready to accept requests. - - - - - The role instance is unavailable for requests. - - - - - Represents access to the Windows Azure runtime environment. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + Microsoft.WindowsAzure.ServiceRuntime + + + + + Represents the Windows Azure environment in which an instance of a role is running. + + + + + Retrieves the value of a setting in the service configuration file. + + The name of the configuration setting. + A String containing the value of the configuration setting. + + A role's configuration settings are defined in the service definition file. Values for configuration settings + are set in the service configuration file. + + + + + Populates the role information. + + + + + Reads the static role data. + + + Note that instance-level information is not populated. + + + + + + Requests that the current role instance be stopped and restarted. + + + + Before the role instance is recycled, the Windows Azure load balancer takes the role instance out of rotation. + This ensures that no new requests are routed to the instance while it is restarting. + + + A call to RequestRecycle initiates the normal operating system reboot. The current execution context + must have 'SeShutdownPrivilege' privilege. + + + + + + Initializes the role runtime environment. + + + Initializing the runtime is optional; it is initialized automatically as needed. + + + + + Initializes the role runtime environment. + + + Initializing the runtime is optional; it is initialized automatically as needed. + + Note that initialization blocks until the system is configured. + + The amount of time to wait for initialization to complete. + + + + Retrieves a named local storage resource. + + The name of the local resource, as declared in the service definiton file. + A object that represents the local storage resource. + + + + Occurs before a change to the service configuration is applied to the running instances of the role. + + + + Service configuration changes are applied on-the-fly to running role instances. Configuration changes include + changes to the service configuration changes and changes to the number of instances in the service. + + + This event occurs after the new configuration file has been submitted to Windows Azure but + before the changes have been applied to each running role instance. This event can be cancelled + for a given instance to prevent the configuration change. + + + Note that cancelling this event causes the instance to be automatically recycled. When the instance is recycled, + the configuration change is applied when it restarts. + + + + + + Occurs after a change to the service configuration has been applied to the running instances of the role. + + + + + Gets the set of objects defined for your service. + + + Roles are defined in the service definition file. + + + + + Gets a object representing the role instance in which this code is currently executing. + + + + + Indicates the status of the role instance. + + + An instance may indicate that it is in one of two states: Ready or Busy. + If an instance's state is Ready, it is prepared to receive requests from the load balancer. If the instance's state is Busy, + it will not receive requests from the load balancer. + + + + + Indicates whether the role instance is running in the Windows Azure environment. + + + true if this instance is running in the development fabric or in the + Windows Azure environment in the cloud; otherwise, false. + + + + + Indicates whether the role instance is running in the Windows Azure Compute Emulator. + + + true if this instance is running in the compute emulator; otherwise, false. + + + + + Occurs when the availability of the role environment has changed. + + + + + Occurs when the role instance is about to be stopped. + + + + + Gets the deployment ID, a string value that uniquely identifies the deployment in which this role instance is running. + + The deployment ID. + + + + Represents a local storage resource reserved for a service. + + + + + Gets the maximum size in megabytes allocated for the local storage resource, as defined in the service definition file. + + + + + Gets the name of the local store as declared in the service definition file. + + + + + Gets the full directory path to the local storage resource. + + + + + Arguments for the event, which occurs before a configuration change is applied to a role instance. + + + Set the Cancel property to cancel the configuration change. + Cancellation causes the role instance to be immediately recycled. The configuration changes are applied when the instance restarts. + + + + + Gets a collection of the configuration changes that are about to be applied to the role instance. + + + + + Arguments for the event, which occurs after a configuration change has been applied to a role instance. + + + + + Gets a collection of the configuration changes that were applied to the role instance. + + + + + Represents a change to the service's configuration. + + + + + Represents a change to the topology of the service. The service's topology refers to the number of instances + deployed for each role that the service defines. + + + + + Indicates whether two environment changes are equivalent. + + + + + Indicates whether two environment changes are equivalent. + + + + + Gets the hash code corresponding to this object. + + + + + Gets the name of the affected role. + + + + + Represents a change to a configuration setting. + + + + + Indicates whether two environment changes are equivalent. + + + + + Determines whether two changes are equivalent. + + + + + Gets the hash code corresponding to this object. + + + + + Gets the name of the configuration setting that has been changed. + + + + + Represents a role that is defined as part of a hosted service. + + + + + Gets the name of the role as it is declared in the service definition file. + + + + + Gets the collection of instances for the role. + + + + The number of instances of a role to be deployed to Windows Azure is specified in the service's configuration file. + + + A role must define at least one internal endpoint in order for its set of instances to be known at runtime. + + + + + + Represents a logical endpoint on a role. + + + + + Gets the name of the role endpoint. + + + + + Gets a list of all endpoints defined for a role instance. + + + + + Provides callbacks to initialize, run, and stop instances of the role. + + + + All worker roles must extend RoleEntryPoint. + + + Web roles can optionally extend RoleEntryPoint, or can use the ASP.NET lifecycle management + methods to handle the role's startup and stopping sequences. + + + All exceptions that occur within the methods of the RoleEntryPoint class are unhandled exceptions. + + + + + + Called by Windows Azure to initialize the role instance. + + True if initialization succeeds, False if it fails. The default implementation returns True. + + + Override the OnStart method to run initialization code for your role. + + + Before the OnStart method returns, the instance's status is set to Busy and the instance is not available + for requests via the load balancer. + + + If the OnStart method returns false, the instance is immediately stopped. If the method + returns true, then Windows Azure starts the role by calling the method. + + + A web role can include initialization code in the ASP.NET Application_Start method instead of the OnStart method. + Application_Start is called after the OnStart method. + + + Any exception that occurs within the OnStart method is an unhandled exception. + + + + + + Called by Windows Azure after the role instance has been initialized. This method serves as the + main thread of execution for your role. + + + + Override the Run method to implement your own code to manage the role's execution. The Run method should implement + a long-running thread that carries out operations for the role. The default implementation sleeps for an infinite + period, blocking return indefinitely. + + + The role recycles when the Run method returns. + + + Any exception that occurs within the Run method is an unhandled exception. + + + + + + Called by Windows Azure when the role instance is to be stopped. + + + + Override the OnStop method to implement any code your role requires to shut down in an orderly fashion. + + + This method must return within certain period of time. If it does not, Windows Azure + will stop the role instance. + + + A web role can include shutdown sequence code in the ASP.NET Application_End method instead of the OnStop method. + Application_End is called before the Stopping event is raised or the OnStop method is called. + + + Any exception that occurs within the OnStop method is an unhandled exception. + + + + + + Arguments for the event. + + + + + Represents an instance of a role. + + + + + Gets the ID of this instance. + + + + + Gets an integer value that indicates the update domain in which this instance resides. + + + + + Gets an integer value that indicates the fault domain in which this instance resides. + + + + + Gets the object associated with this instance. + + + + + Gets the set of endpoints associated with this role instance. + + + + + Represents an endpoint associated with a role instance. + + + + + Gets an object for this role instance endpoint. The object + provides the IP address and port number for the endpoint. + + + + + Gets the protocol associated with the endpoint + + + + + Gets the object associated with this endpoint. + + + + + Represents a role. + + + + + Represents a role instance. + + + A role instance can represent either the current instance or some other instance discovered + via an endpoint; a subclass exists for each purpose. + + + + + Creates a role instance corresponding to the current instance. + + + + + Gets or sets the deployment ID, a value which uniquely identifies the deployment in which the role instance is running. + + The deployment ID. + + + + Represents a role endpoint. + + + + + Represents a role instance endpoint. + + + + + Arguments for the event. + + + + + Specifies that the instance's status is Busy and that it should not receive requests from the load balancer at this time. + + + When you call SetBusy, the instance's status remains Busy for a period of 10 seconds. To extend the Busy period, call SetBusy again + after this time interval has elapsed. + + + + + Gets a value indicating the status of the role instance. + + + + Event handlers can invoke the SetBusy method to change the status of a role instance. + + + If an instance's status is Ready, it is prepared to receive requests from the load balancer. If the instance's status is Busy, + it will not receive requests from the load balancer. + + + + + + Indicates that the role runtime environment is not available. + + + This exception indicates that either the the caller is running outside the Windows Azure + environment, or that the environment is unavailable due to a critical error. + + + + + Exceptions + + + + + Status of a given role instance + + + + + The role instance is ready to accept requests. + + + + + The role instance is unavailable for requests. + + + + + Represents access to the Windows Azure runtime environment. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/Azure/Microsoft.WindowsAzure.Storage.dll b/lib/Azure/Microsoft.WindowsAzure.Storage.dll new file mode 100644 index 00000000000..f07e4fcbae0 Binary files /dev/null and b/lib/Azure/Microsoft.WindowsAzure.Storage.dll differ diff --git a/lib/Azure/Microsoft.WindowsAzure.Storage.xml b/lib/Azure/Microsoft.WindowsAzure.Storage.xml new file mode 100644 index 00000000000..ffd7fa66c3e --- /dev/null +++ b/lib/Azure/Microsoft.WindowsAzure.Storage.xml @@ -0,0 +1,15561 @@ + + + + Microsoft.WindowsAzure.Storage + + + + + Represents the status of an asynchronous operation and provides support for cancellation. + + + + + Cancels the asynchronous operation. + + + + + Initializes a new instance of the BlobReadStreamBase class. + + Blob reference to read from + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + An object for tracking the current operation. + + + + Sets the position within the current stream. + + A byte offset relative to the origin parameter. + A value of type SeekOrigin indicating the reference + point used to obtain the new position. + The new position within the current stream. + + + + This operation is not supported in BlobReadStreamBase. + + Not used. + + + + This operation is not supported in BlobReadStreamBase. + + Not used. + Not used. + Not used. + + + + This operation is not supported in BlobReadStreamBase. + + + + + Locks all further read operations to the current ETag value. + Therefore, if someone else writes to the blob while we are reading, + all our operations will start failing with condition mismatch error. + + + + + Updates the blob MD5 with newly downloaded content. + + + + + + + + Gets a value indicating whether the current stream supports reading. + + + + + Gets a value indicating whether the current stream supports seeking. + + + + + Gets a value indicating whether the current stream supports writing. + + + + + Gets or sets the position within the current stream. + + + + + Initializes a new instance of the BlobReadStrea class. + + Blob reference to read from + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + An object for tracking the current operation. + + + + Reads a sequence of bytes from the current stream and advances the + position within the stream by the number of bytes read. + + The buffer to read the data into. + The byte offset in buffer at which to begin writing + data read from the stream. + The maximum number of bytes to read. + The total number of bytes read into the buffer. This can be + less than the number of bytes requested if that many bytes are not + currently available, or zero (0) if the end of the stream has been reached. + + + + Begins an asynchronous read operation. + + The buffer to read the data into. + The byte offset in buffer at which to begin writing + data read from the stream. + The maximum number of bytes to read. + An optional asynchronous callback, to be called when the read is complete. + A user-provided object that distinguishes this particular asynchronous read request from other requests. + An IAsyncResult that represents the asynchronous read, which could still be pending. + + + + Waits for the pending asynchronous read to complete. + + The reference to the pending asynchronous request to finish. + The total number of bytes read into the buffer. This can be + less than the number of bytes requested if that many bytes are not + currently available, or zero (0) if the end of the stream has been reached. + + + + Dispatches a read operation that either reads from the cache or makes a call to + the server. + + The reference to the pending asynchronous request to finish. + The buffer to read the data into. + The byte offset in buffer at which to begin writing + data read from the stream. + The maximum number of bytes to read. + Even though this code looks like it can run in parallel, the semaphore only allows + 1 active read. This is required because of caching. + + + + Gets the length in bytes of the stream. + + + + + Initializes a new instance of the BlobWriteStreamBase class. + + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + An object for tracking the current operation. + + + + Initializes a new instance of the BlobWriteStreamBase class for a block blob. + + Blob reference to write to. + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + An object for tracking the current operation. + + + + Initializes a new instance of the BlobWriteStreamBase class for a page blob. + + Blob reference to write to. + Size of the page blob. + Use true if the page blob is newly created, false otherwise. + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + An object for tracking the current operation. + + + + This operation is not supported in BlobWriteStreamBase. + + Not used. + Not used. + Not used. + + + + Sets the position within the current stream. + + A byte offset relative to the origin parameter. + A value of type SeekOrigin indicating the reference + point used to obtain the new position. + The new position within the current stream. + + + + This operation is not supported in BlobWriteStreamBase. + + Not used. + + + + Generates a new block ID to be used for PutBlock. + + Base64 encoded block ID + + + + Gets a value indicating whether the current stream supports reading. + + + + + Gets a value indicating whether the current stream supports seeking. + + + + + Gets a value indicating whether the current stream supports writing. + + + + + Gets the length in bytes of the stream. + + + + + Gets or sets the position within the current stream. + + + + + Initializes a new instance of the BlobWriteStream class for a block blob. + + Blob reference to write to. + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + An object for tracking the current operation. + + + + Initializes a new instance of the BlobWriteStream class for a page blob. + + Blob reference to write to. + Size of the page blob. + Use true if the page blob is newly created, false otherwise. + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + An object for tracking the current operation. + + + + Sets the position within the current stream. + + A byte offset relative to the origin parameter. + A value of type SeekOrigin indicating the reference + point used to obtain the new position. + The new position within the current stream. + + + + Writes a sequence of bytes to the current stream and advances the current + position within this stream by the number of bytes written. + + An array of bytes. This method copies count bytes from + buffer to the current stream. + The zero-based byte offset in buffer at which to begin + copying bytes to the current stream. + The number of bytes to be written to the current stream. + + + + Begins an asynchronous write operation. + + An array of bytes. This method copies count bytes from + buffer to the current stream. + The zero-based byte offset in buffer at which to begin + copying bytes to the current stream. + The number of bytes to be written to the current stream. + An optional asynchronous callback, to be called when the write is complete. + A user-provided object that distinguishes this particular asynchronous write request from other requests. + An IAsyncResult that represents the asynchronous write, which could still be pending. + + + + Waits for the pending asynchronous write to complete. + + The reference to the pending asynchronous request to finish. + + + + Clears all buffers for this stream and causes any buffered data to be written to the underlying blob. + + + + + Releases the blob resources used by the Stream. + + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Commits the blob. For block blobs, this means uploading the block list. For + page blobs, however, it only uploads blob properties. + + + + + Dispatches a write operation. + + The reference to the pending asynchronous request to finish. + + + + Starts an asynchronous PutBlock operation as soon as the parallel + operation semaphore becomes available. + + Data to be uploaded + Block ID + MD5 hash of the data to be uploaded + The reference to the pending asynchronous request to finish. + + + + Starts an asynchronous WritePages operation as soon as the parallel + operation semaphore becomes available. + + Data to be uploaded + Offset within the page blob + MD5 hash of the data to be uploaded + The reference to the pending asynchronous request to finish. + + + + Provides a client-side logical representation of the Windows Azure Blob Service. This client is used to configure and execute requests against the Blob Service. + + The service client encapsulates the base URI for the Blob service. If the service client will be used for authenticated access, it also encapsulates the credentials for accessing the storage account. + + Provides a client-side logical representation of the Windows Azure Blob Service. This client is used to configure and execute requests against the Blob Service. + + The service client encapsulates the base URI for the Blob service. If the service client will be used for authenticated access, it also encapsulates the credentials for accessing the storage account. + + + + Constant for the max value of ParallelOperationThreadCount. + + + + + Returns an enumerable collection of containers. + + An enumerable collection of containers. + + + + Returns an enumerable collection of containers whose names + begin with the specified prefix and that are retrieved lazily. + + The container name prefix. + A value that indicates whether to return container metadata with the listing. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object that represents the context for the current operation. + An enumerable collection of containers that are retrieved lazily. + + + + Returns a result segment containing a collection of objects. + + A returned by a previous listing operation. + A result segment of containers. + + + + Returns a result segment containing a collection of containers whose names begin with the specified prefix. + + The container name prefix. + A value that indicates whether to return container metadata with the listing. + A non-negative integer value that indicates the maximum number of results to be returned + in the result segment, up to the per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + A returned by a previous listing operation. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object that represents the context for the current operation. + A result segment of containers. + + + + Returns a result segment containing a collection of containers + whose names begin with the specified prefix. + + The container name prefix. + A value that indicates whether to return container metadata with the listing. + A non-negative integer value that indicates the maximum number of results to be returned + in the result segment, up to the per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object that represents the context for the current operation. + A result segment of containers. + + + + Begins an asynchronous request to return a result segment containing a collection of containers. + + A continuation token returned by a previous listing operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to return a result segment containing a collection of containers + whose names begin with the specified prefix. + + The container name prefix. + A value that indicates whether to return container metadata with the listing. + A non-negative integer value that indicates the maximum number of results to be returned + in the result segment, up to the per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return a result segment containing a collection of containers. + + An that references the pending asynchronous operation. + A result segment of containers. + + + + Returns an enumerable collection of the blobs in the container that are retrieved lazily. + + The blob name prefix. + Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory. + A enumeration describing which items to include in the listing. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + An enumerable collection of objects that implement and are retrieved lazily. + + + + Returns a result segment containing a collection of blob items + in the container. + + The blob name prefix. + A returned by a previous listing operation. + A result segment containing objects that implement . + + + + Returns a result segment containing a collection of blob items + in the container. + + The blob name prefix. + Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory. + A enumeration describing which items to include in the listing. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + A returned by a previous listing operation. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + A result segment containing objects that implement . + + + + Begins an asynchronous operation to return a result segment containing a collection of blob items + in the container. + + The blob name prefix. + A returned by a previous listing operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a result segment containing a collection of blob items + in the container. + + The blob name prefix. + Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory. + A enumeration describing which items to include in the listing. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + A returned by a previous listing operation. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return a result segment containing a collection of blob items + in the container. + + An that references the pending asynchronous operation. + A result segment containing objects that implement . + + + + Gets a reference to a blob in this container. + + The URI of the blob. + An object that represents the access conditions for the container. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + A reference to the blob. + + + + Begins an asynchronous operation to get a reference to a blob in this container. + + The URI of the blob. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to get a reference to a blob in this container. + + The URI of the blob. + An object that represents the access conditions for the container. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to get a reference to a blob in this container. + + An that references the pending asynchronous operation. + A reference to the blob. + + + + Core implementation for the ListContainers method. + + The container prefix. + The details included. + The continuation token. + A non-negative integer value that indicates the maximum number of results to be returned + in the result segment, up to the per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + A object that specifies any additional options for the request. + A that lists the containers. + + + + Implements the FetchAttributes method. The attributes are updated immediately. + + The URI of the blob. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + A that fetches the attributes. + + + + Begins an asynchronous operation to get the properties of the blob service. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to get the properties of the blob service. + + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to get the properties of the blob service. + + The result returned from a prior call to + BeginGetServiceProperties + . + The blob service properties. + + + + Gets the properties of the blob service. + + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object that represents the context for the current operation. + The blob service properties. + + + + Begins an asynchronous operation to set the properties of the blob service. + + The blob service properties. + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to set the properties of the blob service. + + The blob service properties. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to set the properties of the blob service. + + The result returned from a prior call to + BeginSetServiceProperties . + + + + Sets the properties of the blob service. + + The blob service properties. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object that represents the context for the current operation. + + + + Stores the default delimiter. + + + + + Stores the parallelism factor. + + + + + Default is 32 MB. + + + + + The default server and client timeout interval. + + + + + Max execution time accross all potential retries. + + + + + Initializes a new instance of the class using the specified Blob service endpoint + and anonymous credentials. + + The Blob service endpoint to use to create the client. + + + + Initializes a new instance of the class using the specified Blob service endpoint + and account credentials. + + The Blob service endpoint to use to create the client. + The account credentials. + + + + Initializes a new instance of the class. + + True to use path style Uris. + The Blob service endpoint to use to create the client. + The account credentials. + + + + Returns a reference to a object. + + A reference to the root container. + + + + Returns a reference to a object with the specified name. + + The name of the container, or an absolute URI to the container. + A reference to a container. + + + + Parses the user prefix. + + The prefix. + Name of the container. + The listing prefix. + + + + Gets the authentication handler used to sign requests. + + The authentication handler used to sign requests. + + + + Gets the account credentials used to create the Blob service client. + + The account credentials. + + + + Gets the base URI for the Blob service client. + + The base URI used to construct the Blob service client. + + + + Gets or sets the default retry policy for requests made via the Blob service client. + + The retry policy. + + + + Gets or sets the default server and client timeout for requests. + + The server and client timeout interval. + + + + Gets or sets the maximum execution time accross all potential retries. + + The maximum execution time accross all potential retries. + + + + Gets or sets the default delimiter that may be used to create a virtual directory structure of blobs. + + The default delimiter. + + + + Gets or sets the maximum size of a blob in bytes that may be uploaded as a single blob. + + The maximum size of a blob, in bytes, that may be uploaded as a single blob, + ranging from between 1 and 64 MB inclusive. + + + + Gets or sets the number of blocks that may be simultaneously uploaded when uploading a blob that is greater than + the value specified by the property in size. + + The number of parallel operations that may proceed. + + + + Gets a value indicating whether the service client is used with Path style or Host style. + + Is true if use path style uris; otherwise, false. + + + + Represents a container in the Windows Azure Blob service. + + Containers hold directories, which are encapsulated as objects, and directories hold block blobs and page blobs. Directories can also contain sub-directories. + + Represents a container in the Windows Azure Blob service. + + Containers hold directories, which are encapsulated as objects, and directories hold block blobs and page blobs. Directories can also contain sub-directories. + + + + Creates the container. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object + is used to track requests to the storage service, and to provide additional runtime information about the operation. + + + + Begins an asynchronous operation to create a container. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to create a container. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to create a container. + + An that references the pending asynchronous operation. + + + + Creates the container if it does not already exist. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + true if the container did not already exist and was created; otherwise false. + + + + Begins an asynchronous request to create the container if it does not already exist. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to create the container if it does not already exist. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the result of an asynchronous request to create the container if it does not already exist. + + An that references the pending asynchronous operation. + true if the container did not already exist and was created; otherwise, false. + + + + Deletes the container. + + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to delete a container. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to delete a container. + + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to delete a container. + + An that references the pending asynchronous operation. + + + + Deletes the container if it already exists. + + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + true if the container did not already exist and was created; otherwise false. + + + + Begins an asynchronous request to delete the container if it already exists. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to delete the container if it already exists. + + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the result of an asynchronous request to delete the container if it already exists. + + An that references the pending asynchronous operation. + true if the container did not already exist and was created; otherwise, false. + + + + Gets a reference to a blob in this container. + + The name of the blob. + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + A reference to the blob. + + + + Begins an asynchronous operation to get a reference to a blob in this container. + + The name of the blob. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to get a reference to a blob in this container. + + The name of the blob. + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to get a reference to a blob in this container. + + An that references the pending asynchronous operation. + A reference to the blob. + + + + Returns an enumerable collection of the blobs in the container that are retrieved lazily. + + The blob name prefix. + Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory. + A enumeration describing which items to include in the listing. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + An enumerable collection of objects that implement and are retrieved lazily. + + + + Returns a result segment containing a collection of blob items + in the container. + + A continuation token returned by a previous listing operation. + A result segment containing objects that implement . + + + + Returns a result segment containing a collection of blob items + in the container. + + The blob name prefix. + Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory. + A enumeration describing which items to include in the listing. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + A result segment containing objects that implement . + + + + Returns a result segment containing a collection of blob items + in the container. + + The blob name prefix. + Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory. + A enumeration describing which items to include in the listing. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + A result segment containing objects that implement . + + + + Begins an asynchronous operation to return a result segment containing a collection of blob items + in the container. + + A continuation token returned by a previous listing operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a result segment containing a collection of blob items + in the container. + + The blob name prefix. + Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory. + A enumeration describing which items to include in the listing. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return a result segment containing a collection of blob items + in the container. + + An that references the pending asynchronous operation. + A result segment containing objects that implement . + + + + Sets permissions for the container. + + The permissions to apply to the container. + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous request to set permissions for the container. + + The permissions to apply to the container. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to set permissions for the container. + + The permissions to apply to the container. + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the result of an asynchronous request to set permissions for the container. + + An that references the pending asynchronous operation. + + + + Gets the permissions settings for the container. + + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The container's permissions. + + + + Begins an asynchronous request to get the permissions settings for the container. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to get the permissions settings for the container. + + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the asynchronous result of the request to get the permissions settings for the container. + + An that references the pending asynchronous operation. + The container's permissions. + + + + Checks existence of the container. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + true if the container exists. + + + + Begins an asynchronous request to check existence of the container. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to check existence of the container. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the asynchronous result of the request to check existence of the container. + + An that references the pending asynchronous operation. + true if the container exists. + + + + Retrieves the container's attributes. + + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to retrieve the container's attributes. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to retrieve the container's attributes. + + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to retrieve the container's attributes. + + An that references the pending asynchronous operation. + + + + Sets the container's user-defined metadata. + + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to set user-defined metadata on the container. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to set user-defined metadata on the container. + + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous request operation to set user-defined metadata on the container. + + An that references the pending asynchronous operation. + + + + Acquires a lease on this container. + + A representing the span of time for which to acquire the lease, + which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be + greater than zero. + A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed. + An object that represents the access conditions for the container. If null, no condition is used. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + The ID of the acquired lease. + + + + Begins an asynchronous operation to acquire a lease on this container. + + A representing the span of time for which to acquire the lease, + which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be + greater than zero. + A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to acquire a lease on this container. + + A representing the span of time for which to acquire the lease, + which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be + greater than zero. + A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed. + An object that represents the access conditions for the container. If null, no condition is used. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to acquire a lease on this container. + + An IAsyncResult that references the pending asynchronous operation. + The ID of the acquired lease. + + + + Renews a lease on this container. + + An object that represents the access conditions for the container, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to renew a lease on this container. + + An object that represents the access conditions for the container, including a required lease ID. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to renew a lease on this container. + + An object that represents the access conditions for the container, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to renew a lease on this container. + + An IAsyncResult that references the pending asynchronous operation. + + + + Changes the lease ID on this container. + + A string representing the proposed lease ID for the new lease. This cannot be null. + An object that represents the access conditions for the container, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + The new lease ID. + + + + Begins an asynchronous operation to change the lease on this container. + + A string representing the proposed lease ID for the new lease. This cannot be null. + An object that represents the access conditions for the container, including a required lease ID. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to change the lease on this container. + + A string representing the proposed lease ID for the new lease. This cannot be null. + An object that represents the access conditions for the container, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to change the lease on this container. + + An IAsyncResult that references the pending asynchronous operation. + The new lease ID. + + + + Releases the lease on this container. + + An object that represents the access conditions for the container, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to release the lease on this container. + + An object that represents the access conditions for the container, including a required lease ID. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to release the lease on this container. + + An object that represents the access conditions for the container, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to release the lease on this container. + + An IAsyncResult that references the pending asynchronous operation. + + + + Breaks the current lease on this container. + + A representing the amount of time to allow the lease to remain, + which will be rounded down to seconds. If null, the break period is the remainder of the current lease, + or zero for infinite leases. + An object that represents the access conditions for the container. If null, no condition is used. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + A representing the amount of time before the lease ends, to the second. + + + + Begins an asynchronous operation to break the current lease on this container. + + A representing the amount of time to allow the lease to remain, + which will be rounded down to seconds. If null, the break period is the remainder of the current lease, + or zero for infinite leases. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to break the current lease on this container. + + A representing the amount of time to allow the lease to remain, + which will be rounded down to seconds. If null, the break period is the remainder of the current lease, + or zero for infinite leases. + An object that represents the access conditions for the container. If null, no condition is used. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to break the current lease on this container. + + An IAsyncResult that references the pending asynchronous operation. + A representing the amount of time before the lease ends, to the second. + + + + Generates a RESTCommand for acquiring a lease. + + A representing the span of time for which to acquire the lease, + which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be + greater than zero. + A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed. + An object that represents the access conditions for the container. If null, no condition is used. + The options for this operation. This parameter must not be null. + A RESTCommand implementing the acquire lease operation. + + + + Generates a RESTCommand for renewing a lease. + + An object that represents the access conditions for the container. If null, no condition is used. + The options for this operation, including the current lease ID. + This cannot be null. + A RESTCommand implementing the renew lease operation. + + + + Generates a RESTCommand for changing a lease ID. + + The proposed new lease ID. + An object that represents the access conditions for the container. If null, no condition is used. + The options for this operation, including the current lease ID. This cannot be null. + A RESTCommand implementing the change lease ID operation. + + + + Generates a RESTCommand for releasing a lease. + + An object that represents the access conditions for the container. If null, no condition is used. + The options for this operation, including the current lease ID. + This cannot be null. + A RESTCommand implementing the release lease operation. + + + + Generates a RESTCommand for breaking a lease. + + The amount of time to allow the lease to remain, rounded down to seconds. + If null, the break period is the remainder of the current lease, or zero for infinite leases. + An object that represents the access conditions for the container. If null, no condition is used. + The options for this operation. Cannot be null. + A RESTCommand implementing the break lease operation. + + + + Implementation for the Create method. + + An object that specifies any additional options for the request. + A that creates the container. + + + + Implementation for the Delete method. + + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + A that deletes the container. + + + + Implementation for the FetchAttributes method. + + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + A that fetches the attributes. + + + + Implementation for the Exists method. + + An object that specifies any additional options for the request. + A that checks existence. + + + + Implementation for the SetMetadata method. + + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + A that sets the metadata. + + + + Implementation for the SetPermissions method. + + The permissions to set. + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + A that sets the permissions. + + + + Implementation for the GetPermissions method. + + An object that represents the access conditions for the container. If null, no condition is used. + An object that specifies any additional options for the request. + A that gets the permissions. + + + + Selects the protocol response. + + The protocol item. + The parsed . + + + + Core implementation of the ListBlobs method. + + The blob prefix. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory. + A enumeration describing which items to include in the listing. + An object that specifies any additional options for the request. + A continuation token returned by a previous listing operation. + A that lists the blobs. + + + + Retreive ETag and LastModified date time from response. + + The response to parse. + + + + Initializes a new instance of the class. + + The absolute URI to the container. + + + + Initializes a new instance of the class. + + The absolute URI to the container. + The account credentials. + + + + Initializes a new instance of the class. + + The container name. + A client object that specifies the endpoint for the Blob service. + + + + Initializes a new instance of the class. + + The container name. + The client to be used. + + + + Parse URI for SAS (Shared Access Signature) information. + + The complete Uri. + The credentials to use. + + + + Returns the canonical name for shared access. + + The canonical name. + + + + Returns a shared access signature for the container. + + The access policy for the shared access signature. + A shared access signature. + + + + Returns a shared access signature for the container. + + The access policy for the shared access signature. + A container-level access policy. + A shared access signature. + + + + Gets a reference to a page blob in this container. + + The name of the blob. + A reference to a page blob. + + + + Returns a reference to a page blob in this virtual directory. + + The name of the page blob. + The snapshot timestamp, if the blob is a snapshot. + A reference to a page blob. + + + + Gets a reference to a block blob in this container. + + The name of the blob. + A reference to a block blob. + + + + Gets a reference to a block blob in this container. + + The name of the blob. + The snapshot timestamp, if the blob is a snapshot. + A reference to a block blob. + + + + Gets a reference to a virtual blob directory beneath this container. + + The name of the virtual blob directory. + A reference to a virtual blob directory. + + + + Gets the service client for the container. + + A client object that specifies the endpoint for the Blob service. + + + + Gets the container's URI. + + The absolute URI to the container. + + + + Gets the name of the container. + + The container's name. + + + + Gets the container's metadata. + + The container's metadata. + + + + Gets the container's system properties. + + The container's properties. + + + + Represents a virtual directory of blobs, designated by a delimiter character. + + Containers, which are encapsulated as objects, hold directories, and directories hold block blobs and page blobs. Directories can also contain sub-directories. + + Represents a virtual directory of blobs on the client which emulates a hierarchical data store by using delimiter characters. + + Containers, which are encapsulated as objects, hold directories, and directories hold block blobs and page blobs. Directories can also contain sub-directories. + + + + Represents an item that may be returned by a blob listing operation. + + + + + Gets the URI to the blob item. + + The blob item's URI. + + + + Gets the blob item's parent. + + The blob item's parent. + + + + Gets the blob item's container. + + The blob item's container. + + + + Returns an enumerable collection of the blobs in the container that are retrieved lazily. + + Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory. + A enumeration describing which items to include in the listing. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + An enumerable collection of objects that implement and are retrieved lazily. + + + + Returns a result segment containing a collection of blob items + in the container. + + A continuation token returned by a previous listing operation. + A result segment containing objects that implement . + + + + Returns a result segment containing a collection of blob items + in the container. + + Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory. + A enumeration describing which items to include in the listing. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + A result segment containing objects that implement . + + + + Begins an asynchronous operation to return a result segment containing a collection of blob items + in the container. + + A continuation token returned by a previous listing operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a result segment containing a collection of blob items + in the container. + + Whether to list blobs in a flat listing, or whether to list blobs hierarchically, by virtual directory. + A enumeration describing which items to include in the listing. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return a result segment containing a collection of blob items + in the container. + + An that references the pending asynchronous operation. + A result segment containing objects that implement . + + + + Stores the parent directory. + + + + + Stores the parent container. + + + + + Stores the prefix this directory represents. + + + + + Initializes a new instance of the class given an address and a client. + + The blob directory's address. + The client to use. + + + + Gets a reference to a page blob in this virtual directory. + + The name of the blob. + A reference to a page blob. + + + + Returns a reference to a page blob in this virtual directory. + + The name of the page blob. + The snapshot timestamp, if the blob is a snapshot. + A reference to a page blob. + + + + Gets a reference to a block blob in this virtual directory. + + The name of the blob. + A reference to a block blob. + + + + Gets a reference to a block blob in this virtual directory. + + The name of the blob. + The snapshot timestamp, if the blob is a snapshot. + A reference to a block blob. + + + + Returns a virtual subdirectory within this virtual directory. + + The name of the virtual subdirectory. + A object representing the virtual subdirectory. + + + + Initializes the prefix. + + + + + Gets the service client for the virtual directory. + + A client object that specifies the endpoint for the Windows Azure Blob service. + + + + Gets the URI that identifies the virtual directory. + + The URI to the virtual directory. + + + + Gets the container for the virtual directory. + + The container for the virtual directory. + + + + Gets the parent directory for the virtual directory. + + The virtual directory's parent directory. + + + + Gets the prefix. + + The prefix. + + + + Implements getting the stream without specifying a range. + + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + A that gets the stream. + + + + Implements the FetchAttributes method. The attributes are updated immediately. + + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + A that fetches the attributes. + + + + Implementation for the Exists method. + + An object that specifies any additional options for the request. + A that checks existence. + + + + Implementation for the SetMetadata method. + + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + A that sets the metadata. + + + + Implementation for the SetProperties method. + + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + A that sets the metadata. + + + + Implements the DeleteBlob method. + + Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots. + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + A that deletes the blob. + + + + Generates a for acquiring a lease. + + A representing the span of time for which to acquire the lease, + which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be + greater than zero. + A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed. + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + A implementing the acquire lease operation. + + + + Generates a for renewing a lease. + + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + A implementing the renew lease operation. + + + + Generates a for changing a lease ID. + + The proposed new lease ID. + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + A implementing the change lease ID operation. + + + + Generates a for releasing a lease. + + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + A implementing the release lease operation. + + + + Generates a for breaking a lease. + + The amount of time to allow the lease to remain, rounded down to seconds. + If null, the break period is the remainder of the current lease, or zero for infinite leases. + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + A implementing the break lease operation. + + + + Implementation of the StartCopyFromBlob method. Result is a BlobAttributes object derived from the response headers. + + The URI of the source blob. + An object that represents the access conditions for the source blob. If null, no condition is used. + An object that represents the access conditions for the destination blob. If null, no condition is used. + An object that specifies any additional options for the request. + A that starts to copy the blob. + + + + Implementation of the AbortCopy method. No result is produced. + + The copy ID of the copy operation to abort. + An object that represents the access conditions for the operation. If null, no condition is used. + An object that specifies any additional options for the request. + A that aborts the copy. + + + + Updates this blob with the given attributes a the end of a fetch attributes operation. + + The new attributes. + + + + Retreive ETag and LastModified date time from response. + + The response to parse. + + + + Converts the source blob of a copy operation to an appropriate access URI, taking Shared Access Signature credentials into account. + + The source blob. + A URI addressing the source blob, using SAS if appropriate. + + + + Represents a blob that is uploaded as a set of blocks. + + + Represents a blob that is uploaded as a set of blocks. + + + + + An interface required for Windows Azure blob types. The and classes implement the interface. + + + An interface required for Windows Azure blob types. The and classes implement the interface. + + + + + Opens a stream for reading from the blob. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + A stream to be used for reading from the blob. + On the object returned by this method, the method must be called exactly once for every call. Failing to end a read process before beginning another read can cause unknown behavior. + + + + Uploads a stream to the Windows Azure Blob Service. + + The stream providing the blob content. Use a seek-able stream for optimal performance. + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to upload a stream to a blob. + + The stream providing the blob content. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to upload a stream to a blob. + + The stream providing the blob content. + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to upload a stream to a blob. + + An that references the pending asynchronous operation. + + + + Downloads the contents of a blob to a stream. + + The target stream. + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to download the contents of a blob to a stream. + + The target stream. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to download the contents of a blob to a stream. + + The target stream. + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to download the contents of a blob to a stream. + + An that references the pending asynchronous operation. + + + + Downloads the contents of a blob to a stream. + + The target stream. + The starting offset of the data range, in bytes. + The length of the data range, in bytes. + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to download the contents of a blob to a stream. + + The target stream. + The starting offset of the data range, in bytes. + The length of the data range, in bytes. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to download the contents of a blob to a stream. + + The target stream. + The starting offset of the data range, in bytes. + The length of the data range, in bytes. + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to download the contents of a blob to a stream. + + An that references the pending asynchronous operation. + + + + Checks existence of the blob. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + true if the blob exists. + + + + Begins an asynchronous request to check existence of the blob. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to check existence of the blob. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the asynchronous result of the request to check existence of the blob. + + An that references the pending asynchronous operation. + true if the blob exists. + + + + Populates a blob's properties and metadata. + + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to populate the blob's properties and metadata. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to populate the blob's properties and metadata. + + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to populate the blob's properties and metadata. + + An that references the pending asynchronous operation. + + + + Updates the blob's metadata. + + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to update the blob's metadata. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to update the blob's metadata. + + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to update the blob's metadata. + + An that references the pending asynchronous operation. + + + + Updates the blob's properties. + + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to update the blob's properties. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to update the blob's properties. + + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to update the blob's properties. + + An that references the pending asynchronous operation. + + + + Deletes the blob. + + Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots. + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to delete the blob. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to delete the blob. + + Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots. + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to delete the blob. + + An that references the pending asynchronous operation. + + + + Deletes the blob if it already exists. + + Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots. + An object that represents the access conditions for the container. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + true if the blob did not already exist and was created; otherwise false. + + + + Begins an asynchronous request to delete the blob if it already exists. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to delete the blob if it already exists. + + Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots. + An object that represents the access conditions for the container. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the result of an asynchronous request to delete the blob if it already exists. + + An that references the pending asynchronous operation. + true if the blob did not already exist and was created; otherwise, false. + + + + Acquires a lease on this blob. + + A representing the span of time for which to acquire the lease, + which will be rounded down to seconds. + A string representing the proposed lease ID for the new lease. + An object that represents the access conditions for the blob. + The options for this operation. + An object that represents the context for the current operation. + The ID of the acquired lease. + + + + Begins an asynchronous operation to acquire a lease on this blob. + + A representing the span of time for which to acquire the lease, + which will be rounded down to seconds. + A string representing the proposed lease ID for the new lease. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to acquire a lease on this blob. + + A representing the span of time for which to acquire the lease, + which will be rounded down to seconds. + A string representing the proposed lease ID for the new lease. + An object that represents the access conditions for the blob. + The options for this operation. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to acquire a lease on this blob. + + An IAsyncResult that references the pending asynchronous operation. + The ID of the acquired lease. + + + + Renews a lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to renew a lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to renew a lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to renew a lease on this blob. + + An that references the pending asynchronous operation. + + + + Changes the lease ID on this blob. + + A string representing the proposed lease ID for the new lease. + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. + An object that represents the context for the current operation. + The new lease ID. + + + + Begins an asynchronous operation to change the lease on this blob. + + A string representing the proposed lease ID for the new lease. + An object that represents the access conditions for the blob, including a required lease ID. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to change the lease on this blob. + + A string representing the proposed lease ID for the new lease. + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to change the lease on this blob. + + An that references the pending asynchronous operation. + The new lease ID. + + + + Releases the lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to release the lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to release the lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to release the lease on this blob. + + An IAsyncResult that references the pending asynchronous operation. + + + + Breaks the current lease on this blob. + + A representing the amount of time to allow the lease to remain, + which will be rounded down to seconds. + An object that represents the access conditions for the blob. + The options for this operation. + An object that represents the context for the current operation. + A representing the amount of time before the lease ends, to the second. + + + + Begins an asynchronous operation to break the current lease on this blob. + + A representing the amount of time to allow the lease to remain, + which will be rounded down to seconds. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to break the current lease on this blob. + + A representing the amount of time to allow the lease to remain, + which will be rounded down to seconds. + An object that represents the access conditions for the blob. + The options for this operation. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to break the current lease on this blob. + + An IAsyncResult that references the pending asynchronous operation. + A representing the amount of time before the lease ends, to the second. + + + + Requests that the service start to copy a blob's contents, properties, and metadata to a new blob. + + The URI of a source blob. + An object that represents the access conditions for the source blob. + An object that represents the access conditions for the destination blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The copy ID associated with the copy operation. + + + + Begins an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob. + + The URI of a source blob. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to request that the service start to copy another blob's contents, properties, and metadata + to the blob referenced by this object. + + The URI of a source blob. + An object that represents the access conditions for the source blob. + An object that represents the access conditions for the destination blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob. + + An that references the pending asynchronous operation. + The copy ID associated with the copy operation. + + + + Aborts an ongoing blob copy operation. + + A string identifying the copy operation. + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to abort an ongoing blob copy operation. + + A string identifying the copy operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to abort an ongoing blob copy operation. + + A string identifying the copy operation. + An object that represents the access conditions for the blob. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to abort an ongoing blob copy operation. + + An that references the pending asynchronous operation. + + + + Returns a shared access signature for the blob. + + The access policy for the shared access signature. + A shared access signature. + + + + Returns a shared access signature for the blob. + + The access policy for the shared access signature. + A container-level access policy. + A shared access signature. + + + + Gets the blob item's name. + + The blob item's name. + + + + Gets the object that represents the Blob service. + + A client object that specifies the Blob service endpoint. + + + + Gets or sets the number of bytes to buffer when writing to a page blob stream or + the block size for writing to a block blob. + + The number of bytes to buffer or the size of a block, in bytes. + + + + Gets or sets the minimum number of bytes to buffer when reading from a blob stream. + + The minimum number of bytes to buffer. + + + + Gets the blob's system properties. + + The blob's properties. + + + + Gets the user-defined metadata for the blob. + + The blob's metadata, as a collection of name-value pairs. + + + + Gets the date and time that the blob snapshot was taken, if this blob is a snapshot. + + The blob's snapshot time if the blob is a snapshot; otherwise, null. + + If the blob is not a snapshot, the value of this property is null. + + + + + Gets the state of the most recent or pending copy operation. + + A object containing the copy state, or null if no copy blob state exists for this blob. + + + + Gets the type of the blob. + + The type of the blob. + + + + Opens a stream for reading from the blob. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + A stream to be used for reading from the blob. + On the object returned by this method, the method must be called exactly once for every call. Failing to end a read process before beginning another read can cause unknown behavior. + + + + Opens a stream for writing to the blob. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + A stream to be used for writing to the blob. + + + + Begins an asynchronous operation to open a stream for writing to the blob. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to open a stream for writing to the blob. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to open a stream for writing to the blob. + + An that references the pending asynchronous operation. + A stream to be used for writing to the blob. + + + + Uploads a stream to a block blob. + + The stream providing the blob content. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to upload a stream to a block blob. + + The stream providing the blob content. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to upload a stream to a block blob. + + The stream providing the blob content. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to upload a stream to a block blob. + + An that references the pending asynchronous operation. + + + + Downloads the contents of a blob to a stream. + + The target stream. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to download the contents of a blob to a stream. + + The target stream. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to download the contents of a blob to a stream. + + The target stream. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to download the contents of a blob to a stream. + + An that references the pending asynchronous operation. + + + + Downloads the contents of a blob to a stream. + + The target stream. + The offset at which to begin downloading the blob, in bytes. + The length of the data to download from the blob, in bytes. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to download the contents of a blob to a stream. + + The target stream. + The offset at which to begin downloading the blob, in bytes. + The length of the data to download from the blob, in bytes. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to download the contents of a blob to a stream. + + The target stream. + The offset at which to begin downloading the blob, in bytes. + The length of the data to download from the blob, in bytes. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to download the contents of a blob to a stream. + + An that references the pending asynchronous operation. + + + + Checks existence of the blob. + + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + true if the blob exists. + + + + Begins an asynchronous request to check existence of the blob. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to check existence of the blob. + + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the asynchronous result of the request to check existence of the blob. + + An that references the pending asynchronous operation. + true if the blob exists. + + + + Populates a blob's properties and metadata. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to populate the blob's properties and metadata. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to populate the blob's properties and metadata. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to populate the blob's properties and metadata. + + An that references the pending asynchronous operation. + + + + Updates the blob's metadata. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to update the blob's metadata. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to update the blob's metadata. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to update the blob's metadata. + + An that references the pending asynchronous operation. + + + + Updates the blob's properties. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to update the blob's properties. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to update the blob's properties. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to update the blob's properties. + + An that references the pending asynchronous operation. + + + + Deletes the blob. + + Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to delete the blob. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to delete the blob. + + Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to delete the blob. + + An that references the pending asynchronous operation. + + + + Deletes the blob if it already exists. + + Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots. + An object that represents the access conditions for the container. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + true if the blob did already exist and was deleted; otherwise false. + + + + Begins an asynchronous request to delete the blob if it already exists. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to delete the blob if it already exists. + + Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots. + An object that represents the access conditions for the container. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the result of an asynchronous request to delete the blob if it already exists. + + An that references the pending asynchronous operation. + true if the blob did already exist and was deleted; otherwise, false. + + + + Creates a snapshot of the blob. + + A collection of name-value pairs defining the metadata of the snapshot. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request, or null. + An object that represents the context for the current operation. + A blob snapshot. + + + + Begins an asynchronous operation to create a snapshot of the blob. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to create a snapshot of the blob. + + A collection of name-value pairs defining the metadata of the snapshot. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request, or null. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to create a snapshot of the blob. + + An that references the pending asynchronous operation. + A blob snapshot. + + + + Acquires a lease on this blob. + + A representing the span of time for which to acquire the lease, + which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be + greater than zero. + A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed. + An object that represents the access conditions for the blob. If null, no condition is used. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + The ID of the acquired lease. + + + + Begins an asynchronous operation to acquire a lease on this blob. + + A representing the span of time for which to acquire the lease, + which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be + greater than zero. + A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to acquire a lease on this blob. + + A representing the span of time for which to acquire the lease, + which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be + greater than zero. + A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed. + An object that represents the access conditions for the blob. If null, no condition is used. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to acquire a lease on this blob. + + An IAsyncResult that references the pending asynchronous operation. + The ID of the acquired lease. + + + + Renews a lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to renew a lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to renew a lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to renew a lease on this blob. + + An IAsyncResult that references the pending asynchronous operation. + + + + Changes the lease ID on this blob. + + A string representing the proposed lease ID for the new lease. This cannot be null. + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + The new lease ID. + + + + Begins an asynchronous operation to change the lease on this blob. + + A string representing the proposed lease ID for the new lease. This cannot be null. + An object that represents the access conditions for the blob, including a required lease ID. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to change the lease on this blob. + + A string representing the proposed lease ID for the new lease. This cannot be null. + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to change the lease on this blob. + + An IAsyncResult that references the pending asynchronous operation. + The new lease ID. + + + + Releases the lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to release the lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to release the lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to release the lease on this blob. + + An IAsyncResult that references the pending asynchronous operation. + + + + Breaks the current lease on this blob. + + A representing the amount of time to allow the lease to remain, + which will be rounded down to seconds. If null, the break period is the remainder of the current lease, + or zero for infinite leases. + An object that represents the access conditions for the blob. If null, no condition is used. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + A representing the amount of time before the lease ends, to the second. + + + + Begins an asynchronous operation to break the current lease on this blob. + + A representing the amount of time to allow the lease to remain, + which will be rounded down to seconds. If null, the break period is the remainder of the current lease, + or zero for infinite leases. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to break the current lease on this blob. + + A representing the amount of time to allow the lease to remain, + which will be rounded down to seconds. If null, the break period is the remainder of the current lease, + or zero for infinite leases. + An object that represents the access conditions for the blob. If null, no condition is used. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to break the current lease on this blob. + + An IAsyncResult that references the pending asynchronous operation. + A representing the amount of time before the lease ends, to the second. + + + + Uploads a single block. + + A base64-encoded block ID that identifies the block. + A stream that provides the data for the block. + An optional hash value that will be used to set the property + on the blob. May be null or an empty string. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to upload a single block. + + A base64-encoded block ID that identifies the block. + A stream that provides the data for the block. + An optional hash value that will be used to set the property + on the blob. May be null or an empty string. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to upload a single block. + + A base64-encoded block ID that identifies the block. + A stream that provides the data for the block. + An optional hash value that will be used to set the property + on the blob. May be null or an empty string. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to upload a single block. + + An that references the pending asynchronous operation. + + + + Uploads a list of blocks to a new or existing blob. + + An enumerable collection of block IDs, as base64-encoded strings. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to upload a list of blocks to a new or existing blob. + + An enumerable collection of block IDs, as base64-encoded strings. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to upload a list of blocks to a new or existing blob. + + An enumerable collection of block IDs, as base64-encoded strings. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to upload a list of blocks to a new or existing blob. + + An that references the pending asynchronous operation. + + + + Returns an enumerable collection of the blob's blocks, using the specified block list filter. + + One of the enumeration values that indicates whether to return + committed blocks, uncommitted blocks, or both. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + An enumerable collection of objects implementing . + + + + Begins an asynchronous operation to return an enumerable collection of the blob's blocks, + using the specified block list filter. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return an enumerable collection of the blob's blocks, + using the specified block list filter. + + One of the enumeration values that indicates whether to return + committed blocks, uncommitted blocks, or both. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return an enumerable collection of the blob's blocks, + using the specified block list filter. + + An that references the pending asynchronous operation. + An enumerable collection of objects implementing . + + + + Requests that the service start to copy a blob's contents, properties, and metadata to a new blob. + + The URI of a source blob. + An object that represents the access conditions for the source blob. If null, no condition is used. + An object that represents the access conditions for the destination blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The copy ID associated with the copy operation. + + This method fetches the blob's ETag, last modified time, and part of the copy state. + The copy ID and copy status fields are fetched, and the rest of the copy state is cleared. + + + + + Requests that the service start to copy a blob's contents, properties, and metadata to a new blob. + + The URI of a source blob. + An object that represents the access conditions for the source blob. If null, no condition is used. + An object that represents the access conditions for the destination blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The copy ID associated with the copy operation. + + This method fetches the blob's ETag, last modified time, and part of the copy state. + The copy ID and copy status fields are fetched, and the rest of the copy state is cleared. + + + + + Begins an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob. + + The URI of a source blob. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob. + + The URI of a source blob. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to request that the service start to copy another blob's contents, properties, and metadata + to the blob referenced by this object. + + The URI of a source blob. + An object that represents the access conditions for the source blob. If null, no condition is used. + An object that represents the access conditions for the destination blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to request that the service start to copy another blob's contents, properties, and metadata + to the blob referenced by this object. + + The URI of a source blob. + An object that represents the access conditions for the source blob. If null, no condition is used. + An object that represents the access conditions for the destination blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob. + + An that references the pending asynchronous operation. + The copy ID associated with the copy operation. + + This method fetches the blob's ETag, last modified time, and part of the copy state. + The copy ID and copy status fields are fetched, and the rest of the copy state is cleared. + + + + + Aborts an ongoing blob copy operation. + + A string identifying the copy operation. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to abort an ongoing blob copy operation. + + A string identifying the copy operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to abort an ongoing blob copy operation. + + A string identifying the copy operation. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to abort an ongoing blob copy operation. + + An that references the pending asynchronous operation. + + + + Implementation for the CreateSnapshot method. + + A collection of name-value pairs defining the metadata of the snapshot, or null. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + A that creates the snapshot. + If the metadata parameter is null then no metadata is associated with the request. + + + + Uploads the full blob. + + The content stream. + The content MD5. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + A that gets the stream. + + + + Uploads the block. + + The source stream. + The block ID. + The content MD5. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + A that uploads the block. + + + + Uploads the block list. + + The blocks to upload. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + A that uploads the block list. + + + + Gets the download block list. + + The types of blocks. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + A that gets the download block list. + + + + Default is 4 MB. + + + + + Default is 4 MB. + + + + + Initializes a new instance of the class using an absolute URI to the blob. + + The absolute URI to the blob. + + + + Initializes a new instance of the class using an absolute URI to the blob. + + The absolute URI to the blob. + The account credentials. + + + + Initializes a new instance of the class using an absolute URI to the blob. + + The absolute URI to the blob. + The snapshot timestamp, if the blob is a snapshot. + The account credentials. + + + + Initializes a new instance of the class using the specified blob name and + the parent container reference. + If snapshotTime is not null, the blob instance represents a Snapshot. + + Name of the blob. + Snapshot time in case the blob is a snapshot. + The reference to the parent container. + + + + Initializes a new instance of the class. + + The attributes. + The service client. + + + + Stores the that contains this blob. + + + + + Stores the name of this blob. + + + + + Stores the blob's parent . + + + + + Stores the blob's attributes. + + + + + Returns a shared access signature for the blob. + + The access policy for the shared access signature. + A shared access signature. + + + + Returns a shared access signature for the blob. + + The access policy for the shared access signature. + A container-level access policy. + A shared access signature. + + + + Gets the canonical name of the blob, formatted as /<account-name>/<container-name>/<blob-name>. + If ignoreSnapshotTime is false and this blob is a snapshot, the canonical name is augmented with a + query of the form ?snapshot=<snapshot-time>. + This is used by both Shared Access and Copy blob operations. + + Indicates if the snapshot time is ignored. + The canonical name of the blob. + + + + Parse URI for SAS (Shared Access Signature) and snapshot information. + + The complete Uri. + The credentials to use. + + + + Gets the object that represents the Blob service. + + A client object that specifies the Blob service endpoint. + + + + Gets or sets the block size for writing to a block blob. + + The size of a block, in bytes, ranging from between 16 KB and 4 MB inclusive. + + + + Gets or sets the minimum number of bytes to buffer when reading from a blob stream. + + The minimum number of bytes to buffer, ranging from between 1 and 4 MB inclusive. + + + + Gets the blob's system properties. + + The blob's properties. + + + + Gets the user-defined metadata for the blob. + + The blob's metadata, as a collection of name-value pairs. + + + + Gets the blob's URI. + + The absolute URI to the blob. + + + + Gets the date and time that the blob snapshot was taken, if this blob is a snapshot. + + The blob's snapshot time if the blob is a snapshot; otherwise, null. + + If the blob is not a snapshot, the value of this property is null. + + + + + Gets the state of the most recent or pending copy operation. + + A object containing the copy state, or null if no copy blob state exists for this blob. + + + + Gets the type of the blob. + + The type of the blob. + + + + Gets the blob's name. + + The blob's name. + + + + Gets a object representing the blob's container. + + The blob's container. + + + + Gets the object representing the + virtual parent directory for the blob. + + The blob's virtual parent directory. + + + + Represents a Windows Azure page blob. + + + Represents a Windows Azure page blob. + + + + + Opens a stream for reading from the blob. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + A stream to be used for reading from the blob. + On the object returned by this method, the method must be called exactly once for every call. Failing to end a read process before beginning another read can cause unknown behavior. + + + + Opens a stream for writing to the blob. + + The size of the page blob, in bytes. The size must be a multiple of 512. If null, the page blob must already exist. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + A stream to be used for writing to the blob. + + + + Begins an asynchronous operation to open a stream for writing to the blob. + + The size of the page blob, in bytes. The size must be a multiple of 512. If null, the page blob must already exist. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to open a stream for writing to the blob. + + The size of the page blob, in bytes. The size must be a multiple of 512. If null, the page blob must already exist. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to open a stream for writing to the blob. + + An that references the pending asynchronous operation. + A stream to be used for writing to the blob. + + + + Downloads the contents of a blob to a stream. + + The target stream. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to download the contents of a blob to a stream. + + The target stream. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to download the contents of a blob to a stream. + + The target stream. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to download the contents of a blob to a stream. + + An that references the pending asynchronous operation. + + + + Downloads the contents of a blob to a stream. + + The target stream. + The starting offset of the data range, in bytes. + The length of the data range, in bytes. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to download the contents of a blob to a stream. + + The target stream. + The starting offset of the data range, in bytes. + The length of the data range, in bytes. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to download the contents of a blob to a stream. + + The target stream. + The starting offset of the data range, in bytes. + The length of the data range, in bytes. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to download the contents of a blob to a stream. + + An that references the pending asynchronous operation. + + + + Uploads a stream to a page blob. + + The stream providing the blob content. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to upload a stream to a page blob. + + The stream providing the blob content. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to upload a stream to a page blob. + + The stream providing the blob content. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to upload a stream to a page blob. + + An that references the pending asynchronous operation. + + + + Creates a page blob. + + The maximum size of the page blob, in bytes. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to create a page blob. + + The maximum size of the page blob, in bytes. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to create a page blob. + + The maximum size of the blob, in bytes. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to create a page blob. + + An that references the pending asynchronous operation. + + + + Resizes the blob to the specified size. + + The size of the page blob, in bytes. + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to resize the blob to the specified size. + + The size of the page blob, in bytes. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to resize a page blob to the specified size. + + The size of the blob, in bytes. + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to resize a page blob. + + An that references the pending asynchronous operation. + + + + Checks existence of the blob. + + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + true if the blob exists. + + + + Begins an asynchronous request to check existence of the blob. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to check existence of the blob. + + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the asynchronous result of the request to check existence of the blob. + + An that references the pending asynchronous operation. + true if the blob exists. + + + + Populates a blob's properties and metadata. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to populate the blob's properties and metadata. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to populate the blob's properties and metadata. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to populate the blob's properties and metadata. + + An that references the pending asynchronous operation. + + + + Gets a collection of page ranges and their starting and ending bytes. + + The starting offset of the data range, in bytes. Must be a multiple of 512. + The length of the data range, in bytes. Must be a multiple of 512. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + An enumerable collection of page ranges. + + + + Begins an asynchronous operation to return a collection of page ranges and their starting and ending bytes. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a collection of page ranges and their starting and ending bytes. + + The starting offset of the data range, in bytes. Must be a multiple of 512. + The length of the data range, in bytes. Must be a multiple of 512. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return a collection of page ranges and their starting and ending bytes. + + An that references the pending asynchronous operation. + An enumerable collection of page ranges. + + + + Updates the blob's metadata. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to update the blob's metadata. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to update the blob's metadata. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to update the blob's metadata. + + An that references the pending asynchronous operation. + + + + Updates the blob's properties. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to update the blob's properties. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to update the blob's properties. + + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to update the blob's properties. + + An that references the pending asynchronous operation. + + + + Deletes the blob. + + Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to delete the blob. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to delete the blob. + + Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to delete the blob. + + An that references the pending asynchronous operation. + + + + Deletes the blob if it already exists. + + Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots. + An object that represents the access conditions for the container. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + true if the blob did already exist and was deleted; otherwise false. + + + + Begins an asynchronous request to delete the blob if it already exists. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to delete the blob if it already exists. + + Whether to only delete the blob, to delete the blob and all snapshots, or to only delete the snapshots. + An object that represents the access conditions for the container. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the result of an asynchronous request to delete the blob if it already exists. + + An that references the pending asynchronous operation. + true if the blob did already exist and was deleted; otherwise, false. + + + + Creates a snapshot of the blob. + + A collection of name-value pairs defining the metadata of the snapshot. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request, or null. + An object that represents the context for the current operation. + A blob snapshot. + + + + Begins an asynchronous operation to create a snapshot of the blob. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to create a snapshot of the blob. + + A collection of name-value pairs defining the metadata of the snapshot. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request, or null. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to create a snapshot of the blob. + + An that references the pending asynchronous operation. + A blob snapshot. + + + + Acquires a lease on this blob. + + A representing the span of time for which to acquire the lease, + which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be + greater than zero. + A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed. + An object that represents the access conditions for the blob. If null, no condition is used. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + The ID of the acquired lease. + + + + Begins an asynchronous operation to acquire a lease on this blob. + + A representing the span of time for which to acquire the lease, + which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be + greater than zero. + A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to acquire a lease on this blob. + + A representing the span of time for which to acquire the lease, + which will be rounded down to seconds. If null, an infinite lease will be acquired. If not null, this must be + greater than zero. + A string representing the proposed lease ID for the new lease, or null if no lease ID is proposed. + An object that represents the access conditions for the blob. If null, no condition is used. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to acquire a lease on this blob. + + An IAsyncResult that references the pending asynchronous operation. + The ID of the acquired lease. + + + + Renews a lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to renew a lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to renew a lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to renew a lease on this blob. + + An that references the pending asynchronous operation. + + + + Changes the lease ID on this blob. + + A string representing the proposed lease ID for the new lease. This cannot be null. + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + The new lease ID. + + + + Begins an asynchronous operation to change the lease on this blob. + + A string representing the proposed lease ID for the new lease. This cannot be null. + An object that represents the access conditions for the blob, including a required lease ID. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to change the lease on this blob. + + A string representing the proposed lease ID for the new lease. This cannot be null. + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to change the lease on this blob. + + An that references the pending asynchronous operation. + The new lease ID. + + + + Releases the lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to release the lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to release the lease on this blob. + + An object that represents the access conditions for the blob, including a required lease ID. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to release the lease on this blob. + + An IAsyncResult that references the pending asynchronous operation. + + + + Breaks the current lease on this blob. + + A representing the amount of time to allow the lease to remain, + which will be rounded down to seconds. If null, the break period is the remainder of the current lease, + or zero for infinite leases. + An object that represents the access conditions for the blob. If null, no condition is used. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + A representing the amount of time before the lease ends, to the second. + + + + Begins an asynchronous operation to break the current lease on this blob. + + A representing the amount of time to allow the lease to remain, + which will be rounded down to seconds. If null, the break period is the remainder of the current lease, + or zero for infinite leases. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to break the current lease on this blob. + + A representing the amount of time to allow the lease to remain, + which will be rounded down to seconds. If null, the break period is the remainder of the current lease, + or zero for infinite leases. + An object that represents the access conditions for the blob. If null, no condition is used. + The options for this operation. If null, default options will be used. + An object that represents the context for the current operation. + An optional callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to break the current lease on this blob. + + An IAsyncResult that references the pending asynchronous operation. + A representing the amount of time before the lease ends, to the second. + + + + Writes pages to a page blob. + + A stream providing the page data. + The offset at which to begin writing, in bytes. The offset must be a multiple of 512. + An optional hash value that will be used to set the property + on the blob. May be null or an empty string. + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to write pages to a page blob. + + A stream providing the page data. + The offset at which to begin writing, in bytes. The offset must be a multiple of 512. + An optional hash value that will be used to set the property + on the blob. May be null or an empty string. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to write pages to a page blob. + + A stream providing the page data. + The offset at which to begin writing, in bytes. The offset must be a multiple of 512. + An optional hash value that will be used to set the property + on the blob. May be null or an empty string. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to write pages to a page blob. + + An that references the pending asynchronous operation. + + + + Clears pages from a page blob. + + The offset at which to begin clearing pages, in bytes. The offset must be a multiple of 512. + The length of the data range to be cleared, in bytes. The length must be a multiple of 512. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to clear pages from a page blob. + + The offset at which to begin clearing pages, in bytes. The offset must be a multiple of 512. + The length of the data range to be cleared, in bytes. The length must be a multiple of 512. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to clear pages from a page blob. + + The offset at which to begin clearing pages, in bytes. The offset must be a multiple of 512. + The length of the data range to be cleared, in bytes. The length must be a multiple of 512. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to clear pages from a page blob. + + An that references the pending asynchronous operation. + + + + Requests that the service start to copy a blob's contents, properties, and metadata to a new blob. + + The URI of a source blob. + An object that represents the access conditions for the source blob. If null, no condition is used. + An object that represents the access conditions for the destination blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The copy ID associated with the copy operation. + + This method fetches the blob's ETag, last modified time, and part of the copy state. + The copy ID and copy status fields are fetched, and the rest of the copy state is cleared. + + + + + Requests that the service start to copy a blob's contents, properties, and metadata to a new blob. + + The URI of a source blob. + An object that represents the access conditions for the source blob. If null, no condition is used. + An object that represents the access conditions for the destination blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The copy ID associated with the copy operation. + + This method fetches the blob's ETag, last modified time, and part of the copy state. + The copy ID and copy status fields are fetched, and the rest of the copy state is cleared. + + + + + Begins an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob. + + The URI of a source blob. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob. + + The URI of a source blob. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to request that the service start to copy another blob's contents, properties, and metadata + to the blob referenced by this object. + + The URI of a source blob. + An object that represents the access conditions for the source blob. If null, no condition is used. + An object that represents the access conditions for the destination blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to request that the service start to copy another blob's contents, properties, and metadata + to the blob referenced by this object. + + The URI of a source blob. + An object that represents the access conditions for the source blob. If null, no condition is used. + An object that represents the access conditions for the destination blob. If null, no condition is used. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to request that the service start to copy a blob's contents, properties, and metadata to a new blob. + + An that references the pending asynchronous operation. + The copy ID associated with the copy operation. + + This method fetches the blob's ETag, last modified time, and part of the copy state. + The copy ID and copy status fields are fetched, and the rest of the copy state is cleared. + + + + + Aborts an ongoing blob copy operation. + + A string identifying the copy operation. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to abort an ongoing blob copy operation. + + A string identifying the copy operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to abort an ongoing blob copy operation. + + A string identifying the copy operation. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to abort an ongoing blob copy operation. + + An that references the pending asynchronous operation. + + + + Implements the Create method. + + The size in bytes. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + A that creates the blob. + + + + Implementation for the Resize method. + + The size in bytes. + An object that represents the access conditions for the blob. If null, no condition is used. + An object that specifies any additional options for the request. + A that sets the metadata. + + + + Implementation for the CreateSnapshot method. + + A collection of name-value pairs defining the metadata of the snapshot, or null. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + A that creates the snapshot. + If the metadata parameter is null then no metadata is associated with the request. + + + + Gets the page ranges impl. + + The start offset. Must be multiples of 512. + Length of the data range to be cleared. Must be multiples of 512. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + A for getting the page ranges. + + + + Implementation method for the WritePage methods. + + The page data. + The start offset. + The content MD5. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + A that writes the pages. + + + + Implementation method for the ClearPage methods. + + The start offset. Must be multiples of 512. + Length of the data range to be cleared. Must be multiples of 512. + An object that represents the access conditions for the blob. If null, no condition is used. + A object that specifies any additional options for the request. + A that writes the pages. + + + + Default is 4 MB. + + + + + Default is 4 MB. + + + + + Initializes a new instance of the class using an absolute URI to the blob. + + The absolute URI to the blob. + + + + Initializes a new instance of the class using an absolute URI to the blob. + + The absolute URI to the blob. + The account credentials. + + + + Initializes a new instance of the class using an absolute URI to the blob. + + The absolute URI to the blob. + The snapshot timestamp, if the blob is a snapshot. + The account credentials. + + + + Initializes a new instance of the class using the specified blob name and + the parent container reference. + If snapshotTime is not null, the blob instance represents a Snapshot. + + Name of the blob. + Snapshot time in case the blob is a snapshot. + The reference to the parent container. + + + + Initializes a new instance of the class. + + The attributes. + The service client. + + + + Stores the that contains this blob. + + + + + Stores the name of this blob. + + + + + Stores the blob's parent . + + + + + Stores the blob's attributes. + + + + + Returns a shared access signature for the blob. + + The access policy for the shared access signature. + A shared access signature. + + + + Returns a shared access signature for the blob. + + The access policy for the shared access signature. + A container-level access policy. + A shared access signature. + + + + Gets the canonical name of the blob, formatted as /<account-name>/<container-name>/<blob-name>. + If ignoreSnapshotTime is false and this blob is a snapshot, the canonical name is augmented with a + query of the form ?snapshot=<snapshot-time>. + This is used by both Shared Access and Copy blob operations. + + Indicates if the snapshot time is ignored. + The canonical name of the blob. + + + + Parse URI for SAS (Shared Access Signature) and snapshot information. + + The complete Uri. + The credentials to use. + + + + Gets the object that represents the Blob service. + + A client object that specifies the Blob service endpoint. + + + + Gets or sets the number of bytes to buffer when writing to a page blob stream. + + The number of bytes to buffer, ranging from between 512 bytes and 4 MB inclusive. + + + + Gets or sets the minimum number of bytes to buffer when reading from a blob stream. + + The minimum number of bytes to buffer, ranging from between 1 and 4 MB inclusive. + + + + Gets the blob's system properties. + + The blob's properties. + + + + Gets the user-defined metadata for the blob. + + The blob's metadata, as a collection of name-value pairs. + + + + Gets the blob's URI. + + The absolute URI to the blob. + + + + Gets the date and time that the blob snapshot was taken, if this blob is a snapshot. + + The blob's snapshot time if the blob is a snapshot; otherwise, null. + + If the blob is not a snapshot, the value of this property is null. + + + + + Gets the state of the most recent or pending copy operation. + + A object containing the copy state, or null if no copy blob state exists for this blob. + + + + Gets the type of the blob. + + The type of the blob. + + + + Gets the blob's name. + + The blob's name. + + + + Gets a object representing the blob's container. + + The blob's container. + + + + Gets the object representing the + virtual parent directory for the blob. + + The blob's virtual parent directory. + + + + Gets the request ID from the response. + + The web response. + A unique value associated with the request. + + + + Gets the blob's properties from the response. + + The web response. + The blob's properties. + + + + Extracts the lease status from a web response. + + The web response. + A enumeration from the web response. + If the appropriate header is not present, a status of is returned. + The header contains an unrecognized value. + + + + Extracts the lease state from a web response. + + The web response. + A enumeration from the web response. + If the appropriate header is not present, a status of is returned. + The header contains an unrecognized value. + + + + Extracts the lease duration from a web response. + + The web response. + A enumeration from the web response. + If the appropriate header is not present, a status of is returned. + The header contains an unrecognized value. + + + + Extracts the lease ID header from a web response. + + The web response. + The lease ID. + + + + Extracts the remaining lease time from a web response. + + The web response. + The remaining lease time, in seconds. + + + + Gets the user-defined metadata. + + The response from server. + A of the metadata. + + + + Extracts a object from the headers of a web response. + + The HTTP web response. + A object, or null if the web response does not contain a copy status. + + + + Gets the snapshot timestamp from the response. + + The web response. + The snapshot timestamp. + + + + Reads service properties from a stream. + + The stream from which to read the service properties. + The service properties stored in the stream. + + + + Gets a from a string. + + The lease status string. + A enumeration. + If a null or empty string is supplied, a status of is returned. + The string contains an unrecognized value. + + + + Gets a from a string. + + The lease state string. + A enumeration. + If a null or empty string is supplied, a status of is returned. + The string contains an unrecognized value. + + + + Gets a from a string. + + The lease duration string. + A enumeration. + If a null or empty string is supplied, a status of is returned. + The string contains an unrecognized value. + + + + Builds a object from the given strings containing formatted copy information. + + The copy status, as a string. + The copy ID. + The source URI of the copy, as a string. + A string formatted as progressBytes/TotalBytes. + The copy completion time, as a string, or null. + The copy status description, if any. + A object populated from the given strings. + + + + Creates a web request to get the properties of the service. + + The absolute URI to the service. + The server timeout interval, in seconds. + An object for tracking the current operation. + A web request to get the service properties. + + + + Creates a web request to set the properties of the service. + + The absolute URI to the service. + The server timeout interval, in seconds. + An object for tracking the current operation. + A web request to set the service properties. + + + + Writes service properties to a stream, formatted in XML. + + The service properties to format and write to the stream. + The stream to which the formatted properties are to be written. + + + + Constructs a web request to create a new block blob or page blob, or to update the content + of an existing block blob. + + The absolute URI to the blob. + The server timeout interval. + The properties to set for the blob. + The type of the blob. + For a page blob, the size of the blob. This parameter is ignored + for block blobs. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Adds the snapshot. + + The builder. + The snapshot version, if the blob is a snapshot. + + + + Constructs a web request to return the list of active page ranges for a page blob. + + The absolute URI to the blob. + The server timeout interval. + The snapshot timestamp, if the blob is a snapshot. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Adds the Range Header for Blob Service Operations. + + Request + Starting byte of the range + Number of bytes in the range + + + + Constructs a web request to return the blob's system properties. + + The absolute URI to the blob. + The server timeout interval. + The snapshot timestamp, if the blob is a snapshot. + The access condition to apply to the request. + An object for tracking the current operation. + A web request for performing the operation. + + + + Constructs a web request to set system properties for a blob. + + The absolute URI to the blob. + The server timeout interval. + The blob's properties. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to resize a blob. + + The absolute URI to the blob. + The server timeout interval. + The new blob size, if the blob is a page blob. Set this parameter to null to keep the existing blob size. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to return the user-defined metadata for the blob. + + The absolute URI to the blob. + The server timeout interval. + The snapshot timestamp, if the blob is a snapshot. + The access condition to apply to the request. + An object for tracking the current operation. + A web request for performing the operation. + + + + Constructs a web request to set user-defined metadata for the blob. + + The absolute URI to the blob. + The server timeout interval. + The access condition to apply to the request. + An object for tracking the current operation. + A web request for performing the operation. + + + + Adds user-defined metadata to the request as one or more name-value pairs. + + The web request. + The user-defined metadata. + + + + Adds user-defined metadata to the request as a single name-value pair. + + The web request. + The metadata name. + The metadata value. + + + + Constructs a web request to delete a blob. + + The absolute URI to the blob. + The server timeout interval. + The snapshot timestamp, if the blob is a snapshot. + A set of options indicating whether to delete only blobs, only snapshots, or both. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to create a snapshot of a blob. + + The absolute URI to the blob. + The server timeout interval. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Generates a web request to use to acquire, renew, change, release or break the lease for the blob. + + The absolute URI to the blob. + The server timeout interval, in seconds. + The lease action to perform. + A lease ID to propose for the result of an acquire or change operation, + or null if no ID is proposed for an acquire operation. This should be null for renew, release, and break operations. + The lease duration, in seconds, for acquire operations. + If this is -1 then an infinite duration is specified. This should be null for renew, change, release, and break operations. + The amount of time to wait, in seconds, after a break operation before the lease is broken. + If this is null then the default time is used. This should be null for acquire, renew, change, and release operations. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Adds a proposed lease id to a request. + + The request. + The proposed lease id. + + + + Adds a lease duration to a request. + + The request. + The lease duration. + + + + Adds a lease break period to a request. + + The request. + The lease break period. + + + + Adds a lease action to a request. + + The request. + The lease action. + + + + Constructs a web request to write a block to a block blob. + + The absolute URI to the blob. + The server timeout interval. + The block ID for this block. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to create or update a blob by committing a block list. + + The absolute URI to the blob. + The server timeout interval. + The properties to set for the blob. + The access condition to apply to the request. + An object for tracking the current operation. + A web request for performing the operation. + + + + Constructs a web request to return the list of blocks for a block blob. + + The absolute URI to the blob. + The server timeout interval. + The snapshot timestamp, if the blob is a snapshot. + The types of blocks to include in the list: committed, uncommitted, or both. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to write or clear a range of pages in a page blob. + + The absolute URI to the blob. + The server timeout interval. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Generates a web request to copy a blob. + + The absolute URI to the destination blob. + The server timeout interval. + The absolute URI to the source blob, including any necessary authentication parameters. + The access condition to apply to the source blob. + The access condition to apply to the destination blob. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Generates a web request to abort a copy operation. + + The absolute URI to the blob. + The server timeout interval. + The ID string of the copy operation to be aborted. + The access condition to apply to the request. Only lease conditions are supported for this operation. + An object for tracking the current operation. + A web request for performing the operation. + + + + Constructs a web request to get the blob's content, properties, and metadata. + + The absolute URI to the blob. + The server timeout interval. + The snapshot version, if the blob is a snapshot. + The access condition to apply to the request. + An object for tracking the current operation. + A web request for performing the operation. + + + + Constructs a web request to return a specified range of the blob's content, together with its properties and metadata. + + The absolute URI to the blob. + The server timeout interval, in seconds. + The snapshot version, if the blob is a snapshot. + The byte offset at which to begin returning content. + The number of bytes to return, or null to return all bytes through the end of the blob. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Gets the request ID from the response. + + The web response. + A unique value associated with the request. + + + + Gets the container's properties from the response. + + The web response. + The container's attributes. + + + + Gets the user-defined metadata. + + The response from server. + A of the metadata. + + + + Gets the ACL for the container from the response. + + The web response. + A value indicating the public access level for the container. + + + + Reads the share access policies from a stream in XML. + + The stream of XML policies. + The permissions object to which the policies are to be written. + + + + Converts the ACL string to a object. + + The string to convert. + The resulting object. + + + + Constructs a web request to create a new container. + + The absolute URI to the container. + The server timeout interval. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to delete the container and all of the blobs within it. + + The absolute URI to the container. + The server timeout interval. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Generates a web request to return the user-defined metadata for this container. + + The absolute URI to the container. + The server timeout interval. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Generates a web request to return the properties and user-defined metadata for this container. + + The absolute URI to the container. + The server timeout interval. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Generates a web request to set user-defined metadata for the container. + + The absolute URI to the container. + The server timeout interval. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Generates a web request to use to acquire, renew, change, release or break the lease for the container. + + The absolute URI to the container. + The server timeout interval, in seconds. + The lease action to perform. + A lease ID to propose for the result of an acquire or change operation, + or null if no ID is proposed for an acquire operation. This should be null for renew, release, and break operations. + The lease duration, in seconds, for acquire operations. + If this is -1 then an infinite duration is specified. This should be null for renew, change, release, and break operations. + The amount of time to wait, in seconds, after a break operation before the lease is broken. + If this is null then the default time is used. This should be null for acquire, renew, change, and release operations. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Adds user-defined metadata to the request as one or more name-value pairs. + + The web request. + The user-defined metadata. + + + + Adds user-defined metadata to the request as a single name-value pair. + + The web request. + The metadata name. + The metadata value. + + + + Constructs a web request to return a listing of all containers in this storage account. + + The absolute URI for the account. + The server timeout interval. + A set of parameters for the listing operation. + Additional details to return with the listing. + An object for tracking the current operation. + A web request for the specified operation. + + + + Constructs a web request to return the ACL for a container. + + The absolute URI to the container. + The server timeout interval. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to set the ACL for a container. + + The absolute URI to the container. + The server timeout interval. + The type of public access to allow for the container. + The access condition to apply to the request. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Generates a web request to return a listing of all blobs in the container. + + The absolute URI to the container. + The server timeout interval. + A set of parameters for the listing operation. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Gets the container Uri query builder. + + A for the container. + + + + This class represents a queue in the Windows Azure Queue service. + + + This class represents a queue in the Windows Azure Queue service. + + + + + Creates the queue. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + + + + Begins an asynchronous operation to create a queue. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to create a queue. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to create a queue. + + An that references the pending asynchronous operation. + + + + Creates the queue if it does not already exist. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + true if the queue did not already exist and was created; otherwise false. + + + + Begins an asynchronous request to create the queue if it does not already exist. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to create the queue if it does not already exist. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the result of an asynchronous request to create the queue if it does not already exist. + + An that references the pending asynchronous operation. + true if the queue did not already exist and was created; otherwise, false. + + + + Deletes the queue if it already exists. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + true if the queue did not already exist and was created; otherwise false. + + + + Begins an asynchronous request to delete the queue if it already exists. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to delete the queue if it already exists. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the result of an asynchronous request to delete the queue if it already exists. + + An that references the pending asynchronous operation. + true if the queue did not already exist and was created; otherwise, false. + + + + Deletes the queue. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + + + + Begins an asynchronous operation to delete a queue. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to delete a queue. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to delete a queue. + + An that references the pending asynchronous operation. + + + + Sets permissions for the queue. + + The permissions to apply to the queue. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + + + + Begins an asynchronous request to set permissions for the queue. + + The permissions to apply to the queue. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to set permissions for the queue. + + The permissions to apply to the queue. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the result of an asynchronous request to set permissions for the queue. + + An that references the pending asynchronous operation. + + + + Gets the permissions settings for the queue. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The queue's permissions. + + + + Begins an asynchronous request to get the permissions settings for the queue. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to get the permissions settings for the queue. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the asynchronous result of the request to get the permissions settings for the queue. + + An that references the pending asynchronous operation. + The queue's permissions. + + + + Checks existence of the queue. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + true if the queue exists. + + + + Begins an asynchronous request to check existence of the queue. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to check existence of the queue. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the asynchronous result of the request to check existence of the queue. + + An that references the pending asynchronous operation. + true if the queue exists. + + + + Sets the queue's user-defined metadata. + + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + + + + Begins an asynchronous operation to set user-defined metadata on the queue. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to set user-defined metadata on the queue. + + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous request operation to set user-defined metadata on the queue. + + An that references the pending asynchronous operation. + + + + Fetches the queue's attributes. + + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + + + + Begins an asynchronous operation to fetch the queue's attributes. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to fetch the queue's attributes. + + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to fetch a queue's attributes. + + An that references the pending asynchronous operation. + + + + Adds a message to the queue. + + The message to add. + The maximum time to allow the message to be in the queue, or null. + The length of time from now during which the message will be invisible. + If null then the message will be visible immediately. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to add a message to the queue. + + The message to add. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to add a message to the queue. + + The message to add. + The maximum time to allow the message to be in the queue, or null. + The length of time from now during which the message will be invisible. + If null then the message will be visible immediately. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to add a message to the queue. + + An that references the pending asynchronous operation. + + + + Updates the visibility timeout and optionally the content of a message. + + The message to update. + The visibility timeout interval. + Flags of values that specifies which parts of the message are to be updated. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + + + + Begins an asynchronous operation to update the visibility timeout and optionally the content of a message. + + The message to update. + The visibility timeout interval. + An EnumSet of values that specifies which parts of the message are to be updated. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to update the visibility timeout and optionally the content of a message. + + The message to update. + The visibility timeout interval. + An EnumSet of values that specifies which parts of the message are to be updated. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to add a message to the queue. + + An that references the pending asynchronous operation. + + + + Deletes a message. + + A message. + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + + + + Deletes the specified message from the queue. + + The message ID. + The pop receipt value. + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + + + + Begins an asynchronous operation to delete a message. + + A message. + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to delete a message. + + The message ID. + The pop receipt value. + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to delete a message. + + An that references the pending asynchronous operation. + + + + Gets the specified number of messages from the queue using the specified request options and + operation context. This operation marks the retrieved messages as invisible in the queue for the default + visibility timeout period. + + The number of messages to retrieve. + The visibility timeout interval. + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + An enumerable collection of messages. + + + + Begins an asynchronous operation to get messages from the queue. + + The number of messages to retrieve. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to get the specified number of messages from the queue using the + specified request options and operation context. This operation marks the retrieved messages as invisible in the + queue for the default visibility timeout period. + + The number of messages to retrieve. + The visibility timeout interval. + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to get messages from the queue. + + An that references the pending asynchronous operation. + An enumerable collection of messages. + + + + Gets a message from the queue using the default request options. This operation marks the retrieved message as invisible in the queue for the default visibility timeout period. + + The visibility timeout interval. + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + A message. + + + + Begins an asynchronous operation to get a single message from the queue. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to get a single message from the queue, and specifies how long the message should be + reserved before it becomes visible, and therefore available for deletion. + + The visibility timeout interval. + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to get a single message from the queue. + + An that references the pending asynchronous operation. + A message. + + + + Peeks a message from the queue, using the specified request options and operation context. A peek request retrieves a message from the queue without changing its visibility. + + The number of messages to peek. + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + An enumerable collection of messages. + + + + Begins an asynchronous operation to peek messages from the queue. + + The number of messages to peek. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to peek messages from the queue. + + The number of messages to peek. + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to peek messages from the queue. + + An that references the pending asynchronous operation. + An enumerable collection of messages. + + + + Peeks a single message from the queue. A peek request retrieves a message from the queue without changing its visibility. + + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + A message. + + + + Begins an asynchronous operation to get a single message from the queue. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to peek a single message from the queue. + + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to peek a single message from the queue. + + An that references the pending asynchronous operation. + A message. + + + + Clears all messages from the queue. + + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + + + + Begins an asynchronous operation to clear all messages from the queue. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to clear all messages from the queue. + + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests to the storage service, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to clear all messages from the queue. + + An that references the pending asynchronous operation. + + + + Implementation for the ClearMessages method. + + An object that specifies any additional options for the request. + A that gets the permissions. + + + + Implementation for the Create method. + + An object that specifies any additional options for the request. + A that creates the queue. + + + + Implementation for the Delete method. + + An object that specifies any additional options for the request. + A that deletes the queue. + + + + Implementation for the FetchAttributes method. + + An object that specifies any additional options for the request. + A that fetches the attributes. + + + + Implementation for the Exists method. + + An object that specifies any additional options for the request. + A that checks existence. + + + + Implementation for the SetMetadata method. + + An object that specifies any additional options for the request. + A that sets the metadata. + + + + Implementation for the SetPermissions method. + + The permissions to set. + An object that specifies any additional options for the request. + A that sets the permissions. + + + + Implementation for the GetPermissions method. + + An object that specifies any additional options for the request. + A that gets the permissions. + + + + Implementation for the AddMessageImpl method. + + A queue message. + A value indicating the message time-to-live. + The visibility delay for the message. + An object that specifies any additional options for the request. + A that sets the permissions. + + + + Implementation for the UpdateMessage method. + + A queue message. + The visibility timeout for the message. + Indicates whether to update the visibility delay, message contents, or both. + An object that specifies any additional options for the request. + A that sets the permissions. + + + + Implementation for the DeleteMessage method. + + The message ID. + The pop receipt value. + An object that specifies any additional options for the request. + A that deletes the queue. + + + + Implementation for the GetPermissions method. + + The number of messages to retrieve. + The visibility timeout interval. + An object that specifies any additional options for the request. + A that gets the permissions. + + + + Implementation for the PeekMessages method. + + The number of messages to retrieve. + An object that specifies any additional options for the request. + A that gets the permissions. + + + + Gets the ApproximateMessageCount and metadata from response. + + The web response. + + + + Update the message pop receipt and next visible time. + + The Cloud Queue Message. + The web response. + + + + Initializes a new instance of the class. + + The absolute URI to the queue. + + + + Initializes a new instance of the class. + + The absolute URI to the queue. + The account credentials. + + + + Initializes a new instance of the class. + + The queue name. + A client object that specifies the endpoint for the queue service. + + + + Uri for the messages. + + + + + Gets the Uri for general message operations. + + + + + Gets the individual message address. + + The message id. + The Uri of the message. + + + + Parse URI for SAS (Shared Access Signature) information. + + The complete Uri. + The credentials to use. + + + + Returns the canonical name for shared access. + + The canonical name. + + + + Selects the get message response. + + The protocol message. + The parsed message. + + + + Selects the peek message response. + + The protocol message. + The parsed message. + + + + Returns a shared access signature for the queue. + + The access policy for the shared access signature. + A queue-level access policy. + A shared access signature. + + + + Gets the service client for the queue. + + A client object that specifies the endpoint for the queue service. + + + + Gets the queue's URI. + + The absolute URI to the queue. + + + + Gets the name of the queue. + + The queue's name. + + + + Gets the approximate message count for the queue. + + The approximate message count. + + + + Gets or sets a value indicating whether to apply base64 encoding when adding or retrieving messages. + + True to encode messages; otherwise, false. The default value is true. + + + + Gets the queue's metadata. + + The queue's metadata. + + + + Provides a client-side logical representation of the Windows Azure Queue Service. This client is used to configure and execute requests against the Queue Service. + + The service client encapsulates the base URI for the Queue service. If the service client will be used for authenticated access, it also encapsulates the credentials for accessing the storage account. + + Provides a client-side logical representation of the Windows Azure Queue Service. This client is used to configure and execute requests against the Queue Service. + + The service client encapsulates the base URI for the Queue service. If the service client will be used for authenticated access, it also encapsulates the credentials for accessing the storage account. + + + + Returns an enumerable collection of the queues in the storage account. + + An enumerable collection of queues . + + + + Returns an enumerable collection of the queues in the storage account whose names begin with the specified prefix and that are retrieved lazily. + + The queue name prefix. + An enumeration value that indicates which details to include in the listing. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation. + An enumerable collection of objects that implement and are retrieved lazily. + + + + Returns a result segment containing a collection of queues in the storage account. + + A continuation token returned by a previous listing operation. + A result segment containing objects that implement . + + + + Returns a result segment containing a collection of queues in the storage account. + + The queue name prefix. + A enumeration describing which items to include in the listing. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + A returned by a previous listing operation. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation. + A result segment containing objects that implement . + + + + Returns a result segment containing a collection of queues in the storage account. + + The queue name prefix. + A enumeration describing which items to include in the listing. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + A returned by a previous listing operation. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation. + A result segment. + + + + Begins an asynchronous operation to return a result segment containing a collection of queue items. + + A returned by a previous listing operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a result segment containing a collection of queue items. + + The queue name prefix. + A enumeration describing which items to include in the listing. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. + A returned by a previous listing operation. + An object that specifies any additional options for the request. + An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return a result segment containing a collection of queue items. + + An that references the pending asynchronous operation. + A queue result segment. + + + + Core implementation of the ListQueues method. + + The queue name prefix. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is null, the maximum possible number of results will be returned, up to 5000. + A enumeration describing which items to include in the listing. + An object that specifies any additional options for the request. + The continuation token. + A that lists the queues. + + + + Begins an asynchronous operation to get the properties of the queue service. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to get the properties of the queue service. + + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to get the properties of the queue service. + + The result returned from a prior call to . + A object containing the queue service properties. + + + + Gets the properties of the queue service. + + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation. + The queue service properties. + + + + Begins an asynchronous operation to set the properties of the queue service. + + The queue service properties. + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to set the properties of the queue service. + + The queue service properties. + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to set the properties of the queue service. + + The result returned from a prior call to . + + + + Sets the properties of the queue service. + + The queue service properties. + A object that specifies any additional options for the request. Specifying null will use the default request options from the associated service client (). + An object that represents the context for the current operation. This object is used to track requests, and to provide additional runtime information about the operation. + + + + The default server and client timeout interval. + + + + + Max execution time across all potential retries. + + + + + Initializes a new instance of the class using the specified queue service endpoint + and anonymous credentials. + + The queue service endpoint to use to create the client. + + + + Initializes a new instance of the class using the specified queue service endpoint + and account credentials. + + The queue service endpoint to use to create the client. + The account credentials. + + + + Initializes a new instance of the class. + + True to use path style Uris. + The queue service endpoint to use to create the client. + The account credentials. + + + + Returns a reference to a object with the specified name. + + The name of the queue, or an absolute URI to the queue. + A reference to a queue. + + + + Gets the authentication handler used to sign requests. + + Authentication handler. + + + + Gets the account credentials used to create the queue service client. + + The account credentials. + + + + Gets the base URI for the queue service client. + + The base URI used to construct the queue service client. + + + + Gets or sets the default retry policy for requests made via the queue service client. + + The retry policy. + + + + Gets or sets the default server and client timeout for requests. + + The server and client timeout interval. + + + + Gets or sets the maximum execution time across all potential retries. + + The maximum execution time across all potential retries. + + + + Gets a value indicating whether the service client is used with Path style or Host style. + + Is true if use path style uris; otherwise, false. + + + + Represents a message in the Windows Azure Queue service. + + + Represents a message in the Windows Azure Queue service. + + + + + The maximum message size in bytes. + + + + + The maximum number of messages that can be peeked at a time. + + + + + Initializes a new instance of the class with the given byte array. + + The content of the message as a byte array. + + + + Sets the content of this message. + + The new message content. + + + + The maximum amount of time a message is kept in the queue. + + + + + Custom UTF8Encoder to throw exception in case of invalid bytes. + + + + + Initializes a new instance of the class with the given byte array. + + + + + Initializes a new instance of the class with the given string. + + The content of the message as a string of text. + + + + Initializes a new instance of the class with the given message ID and pop receipt. + + The message ID. + The pop receipt token. + + + + Initializes a new instance of the class with the given Base64 encoded string. + This method is only used internally. + + The text string. + Whether the string is Base64 encoded. + + + + Gets the content of the message for transfer (internal use only). + + Indicates if the message should be encoded. + The message content as a string. + + + + Sets the content of this message. + + The new message content. + + + + Gets the maximum message size in bytes. + + The maximum message size in bytes. + + + + Gets the maximum amount of time a message is kept in the queue. + + The maximum amount of time a message is kept in the queue. + + + + Gets the maximum number of messages that can be peeked at a time. + + The maximum number of messages that can be peeked at a time. + + + + Gets the content of the message as a byte array. + + The content of the message as a byte array. + + + + Gets the message ID. + + The message ID. + + + + Gets the message's pop receipt. + + The pop receipt value. + + + + Gets the time that the message was added to the queue. + + The time that that message was added to the queue. + + + + Gets the time that the message expires. + + The time that the message expires. + + + + Gets the time that the message will next be visible. + + The time that the message will next be visible. + + + + Gets the content of the message, as a string. + + The message content. + + + + Gets the number of times this message has been dequeued. + + The number of times this message has been dequeued. + + + + Gets message type that indicates if the RawString is the original message string or Base64 encoding of the original binary data. + + + + + Gets or sets the original message string or Base64 encoding of the original binary data. + + The original message string. + + + + Gets the request ID from the response. + + The web response. + A unique value associated with the request. + + + + Gets the approximate message count for the queue. + + The web response. + The approximate count for the queue. + + + + Gets the user-defined metadata. + + The response from server. + A of the metadata. + + + + Extracts the pop receipt from a web response header. + + The web response. + The pop receipt stored in the header of the response. + + + + Extracts the next visibility time from a web response header. + + The web response. + The time of next visibility stored in the header of the response. + + + + Reads service properties from a stream. + + The stream from which to read the service properties. + The service properties stored in the stream. + + + + Reads the share access policies from a stream in XML. + + The stream of XML policies. + The permissions object to which the policies are to be written. + + + + Creates a web request to get the properties of the service. + + The absolute URI to the service. + The server timeout interval, in seconds. + An object for tracking the current operation. + A web request to get the service properties. + + + + Creates a web request to set the properties of the service. + + The absolute URI to the service. + The server timeout interval, in seconds. + An object for tracking the current operation. + A web request to set the service properties. + + + + Writes service properties to a stream, formatted in XML. + + The service properties to format and write to the stream. + The stream to which the formatted properties are to be written. + + + + Constructs a web request to create a new queue. + + The absolute URI to the queue. + The server timeout interval. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to delete the queue and all of the messages within it. + + The absolute URI to the queue. + The server timeout interval. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to clear all messages in the queue. + + The absolute URI to the queue. + The server timeout interval. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Generates a web request to return the user-defined metadata for this queue. + + The absolute URI to the queue. + The server timeout interval. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Generates a web request to set user-defined metadata for the queue. + + The absolute URI to the queue. + The server timeout interval. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Adds user-defined metadata to the request as one or more name-value pairs. + + The web request. + The user-defined metadata. + + + + Adds user-defined metadata to the request as a single name-value pair. + + The web request. + The metadata name. + The metadata value. + + + + Constructs a web request to return a listing of all queues in this storage account. + + The absolute URI for the account. + The server timeout interval. + A set of parameters for the listing operation. + Additional details to return with the listing. + An object for tracking the current operation. + A web request for the specified operation. + + + + Constructs a web request to return the ACL for a queue. + + The absolute URI to the queue. + The server timeout interval. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to set the ACL for a queue. + + The absolute URI to the queue. + The server timeout interval. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to add a message for a queue. + + The absolute URI to the queue. + The server timeout interval. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to update a message. + + The absolute URI to the message to update. + The server timeout interval, in seconds. + The pop receipt of the message. + The length of time from now during which the message will be invisible, in seconds. + An object for tracking the current operation. + A web request for the update operation. + + + + Constructs a web request to update a message. + + The absolute URI to the message to update. + The server timeout interval, in seconds. + The pop receipt of the message. + An object for tracking the current operation. + A web request for the update operation. + + + + Constructs a web request to get messages for a queue. + + The absolute URI to the queue. + The server timeout interval. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to peeks messages for a queue. + + The absolute URI to the queue. + The server timeout interval. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Represents a object for use with the Windows Azure Table service. + + The class does not support concurrent queries or requests. + + + + Initializes a new instance of the class. + + + + + Callback on DataContext object sending request. + + The sender. + The instance containing the event data. + + + + Begins an asynchronous operation to save changes, using the retry policy specified for the service context. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to save changes, using the retry policy specified for the service context. + + Additional options for saving changes. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to save changes, using the retry policy specified for the service context. + + Additional options for saving changes. + An object for tracking the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + + An that references the asynchronous operation. + + + + Ends an asynchronous operation to save changes. + + An that references the pending asynchronous operation. + A that represents the result of the operation. + + + + Saves changes, using the retry policy specified for the service context. + + A that represents the result of the operation. + + + + Saves changes, using the retry policy specified for the service context. + + Additional options for saving changes. + + + A that represents the result of the operation. + + + + Releases unmanaged resources. + + + + + Gets the object that represents the Table service. + + A client object that specifies the Table service endpoint. + + + + Represents an entity in the Windows Azure Table service. + + + + + Initializes a new instance of the class. + + The partition key. + The row key. + + + + Initializes a new instance of the class. + + + + + Gets or sets the timestamp for the entity. + + The entity's timestamp. + + + + Gets or sets the partition key of a table entity. + + The partition key. + + + + Gets or sets the row key of a table entity. + + The row key. + + + + Provides a set of extensions for the Table service. + + + + + Converts the query into a object that supports + additional operations like retries. + + The type of the element. + The query. + A object that represents the runtime context of the Table service. + The converted query. + + + + Expands the specified path. + + The path to expand. + A new query with the expanded path. + + + + Begins an asynchronous operation to execute a query and return the results as a result segment. + + A continuation token returned by a previous listing operation, can be null. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to execute a query and return the results as a result segment. + + A continuation token returned by a previous listing operation, can be null. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + + An that references the asynchronous operation. + + + + Ends an asynchronous operation to execute a query and return the results as a result segment. + + The reference to the pending asynchronous request to finish. + A result segment containing objects of type . + + + + Stores the wrapped . + + + + + Gets the type of the element(s) that are returned when the expression tree associated with this + instance of is executed. + + + A that represents the type of the element(s) that are returned when the expression tree associated with this object is executed. + + + + + Gets the expression tree that is associated with the instance of . + + + The that is associated with this instance of . + + + + + Gets the query provider that is associated with this data source. + + + The that is associated with this data source. + + + + + Provides a set of methods for constructing requests for table operations. + + + + + Creates a web request to get the properties of the service. + + The absolute URI to the service. + The server timeout interval, in seconds. + An object for tracking the current operation. + A web request to get the service properties. + + + + Creates a web request to set the properties of the service. + + The absolute URI to the service. + The server timeout interval, in seconds. + An object for tracking the current operation. + A web request to set the service properties. + + + + Writes service properties to a stream, formatted in XML. + + The service properties to format and write to the stream. + The stream to which the formatted properties are to be written. + + + + Constructs a web request to return the ACL for a table. + + The absolute URI to the table. + The server timeout interval. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to set the ACL for a table. + + The absolute URI to the table. + The server timeout interval. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Gets the request ID from the response. + + The web response. + A unique value associated with the request. + + + + Reads service properties from a stream. + + The stream from which to read the service properties. + The service properties stored in the stream. + + + + Reads the share access policies from a stream in XML. + + The stream of XML policies. + The permissions object to which the policies are to be written. + + + + Translates the data service client exception. + + The exception. + The translated exception. + + + + Look for an inner exception of type T. + + The exception. + The found exception or null. + + + + Applies the continuation to query. + + The continuation token. + The local query. + The modified query. + + + + Gets the query take count. + + The query. + The take count of the query, if any. + + + + Gets the table continuation from response. + + The response. + The continuation. + + + + Copies the headers and properties from a request into a different request. + + The request to copy into. + The request to copy from. + + + + Gets an ETag from a response. + + The web response. + A quoted ETag string. + + + + Gets the user-defined metadata. + + The response from server. + A of the metadata. + + + + Gets the metadata or properties. + + The response from server. + The prefix for all the headers. + A of the headers with the prefix. + + + + Reads service properties from a stream. + + The stream from which to read the service properties. + The service properties stored in the stream. + + + + Reads a collection of shared access policies from the specified object. + + A collection of shared access policies to be filled. + A policy response object for reading the stream. + The type of policy to read. + + + + Creates the web request. + + The request Uri. + The timeout. + The builder. + An object for tracking the current operation. + A web request for performing the operation. + + + + Creates the specified Uri. + + The Uri to create. + The timeout. + The builder. + An object for tracking the current operation. + A web request for performing the operation. + + + + Constructs a web request to return the ACL for a cloud resource. + + The absolute URI to the resource. + The server timeout interval. + An optional query builder to use. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Constructs a web request to set the ACL for a cloud resource. + + The absolute URI to the resource. + The server timeout interval. + An optional query builder to use. + An object for tracking the current operation. + A web request to use to perform the operation. + + + + Gets the properties. + + The Uri to query. + The timeout. + The builder. + An object for tracking the current operation. + A web request for performing the operation. + + + + Gets the metadata. + + The blob Uri. + The timeout. + The builder. + An object for tracking the current operation. + A web request for performing the operation. + + + + Sets the metadata. + + The blob Uri. + The timeout. + The builder. + An object for tracking the current operation. + A web request for performing the operation. + + + + Adds the metadata. + + The request. + The metadata. + + + + Adds the metadata. + + The request. + The metadata name. + The metadata value. + + + + Deletes the specified Uri. + + The Uri to delete. + The timeout. + The builder. + An object for tracking the current operation. + A web request for performing the operation. + + + + Creates a web request to get the properties of the service. + + The absolute URI to the service. + The server timeout interval. + An object for tracking the current operation. + A web request to get the service properties. + + + + Creates a web request to set the properties of the service. + + The absolute URI to the service. + The server timeout interval. + An object for tracking the current operation. + A web request to set the service properties. + + + + Generates a query builder for building service requests. + + A for building service requests. + + + + Adds the lease id. + + The request. + The lease id. + + + + Adds an optional header to a request. + + The web request. + The metadata name. + The metadata value. + + + + Adds an optional header to a request. + + The web request. + The header name. + The header value. + + + + Applies the condition to the web request. + + The request to be modified. + Access condition to be added to the request. + + + + Applies the condition for a source blob to the web request. + + The request to be modified. + Access condition to be added to the request. + + + + Add x-ms- prefixed headers in a fixed order. + + The headers. + The canonicalized string. + + + + Gets the canonicalized resource string for a Blob or Queue service request under the Shared Key authentication scheme. + + The resource URI. + The name of the storage account. + The canonicalized resource string. + + + + Gets the canonicalized resource string under the Shared Key Lite authentication scheme. + + The resource URI. + The name of the storage account. + The canonicalized resource string. + + + + Helper class to allow an APM Method to be executed with a given timeout in milliseconds + + + + + User's timeout callback + + + + + This class provides asynchronous semaphore functionality (based on Stephen Toub's blog). + + + + + Represnts the async result returned by a storage command. + + + + + The callback provided by the user. + + + + + The state for the callback. + + + + + Indicates whether a task is completed. + + + + + Indicates whether task completed synchronously. + + + + + The event for blocking on this task's completion. + + + + + Initializes a new instance of the StorageCommandAsyncResult class. + + The callback method to be used on completion. + The state for the callback. + + + + We implement the dispose only to allow the explicit closing of the event. + + + + + Releases unmanaged and - optionally - managed resources. + + Set to true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Provides the lazy initialization of the WaitHandle (based on Joe Duffy's blog). + + The WaitHandle to use for waiting on completion. + + + + Called on completion of the async operation to notify the user + (Based on Joe Duffy's lockless design). + + + + + Blocks the calling thread until the async operation is completed. + + + + + Updates the CompletedSynchronously flag with another asynchronous operation result. + + Set to true if the last operation was completed synchronously; false if it was completed asynchronously. + + + + Gets A user-defined object that contains information about the asynchronous operation. + + + + + Gets a System.Threading.WaitHandle that is used to wait for an asynchronous operation to complete. + + + + + Gets a value indicating whether the asynchronous operation completed synchronously. + + + + + Gets a value indicating whether the asynchronous operation has completed. + + + + + Initializes a new instance of the ChainedAsyncResult class. + + The callback method to be used on completion. + The state for the callback. + + + + Called on completion of the async operation to notify the user + + Exception that was caught by the caller. + + + + Blocks the calling thread until the async operation is completed and throws + any stored exceptions. + + + + + The class is provides the helper functions to do Fisma compliant MD5. + + + + + Cryptographic service provider. + + + + + Access to the private keys is not required and the user interface can be bypassed. + + + + + ALG_ID value that identifies the hash algorithm to use. + + + + + The hash value or message hash for the hash object specified by hashHandle. + + + + + The address to which the function copies a handle to the new hash object. Has to be released by calling the CryptDestroyHash function after we are finished using the hash object. + + + + + A handle to a CSP created by a call to CryptAcquireContext. + + + + + Whether this object has been torn down or not. + + + + + Finalizes an instance of the NativeMD5 class, unhooking it from all events. + + + + + Create a Fisma hash. + + + + + Calculates an ongoing hash. + + The data to calculate the hash on. + The offset in the input buffer to calculate from. + The number of bytes to use from input. + + + + Retrieves the string representation of the hash. (Completes the creation of the hash). + + The data to calculate the hash on. + The offset in the input buffer to calculate from. + The number of bytes to use from input. + A byte aray that is the content of the hash. + + + + Validates the status returned by all the crypto functions and throws exception. + + The boolean status returned by the crypto functions. + + + + Releases the unmanaged resources and optionally releases the managed resources. + + + + + Releases the unmanaged resources. + + + + + Represents a Windows Azure Table. + + + Represents a Windows Azure Table. + + + + + Executes the operation on a table, using the specified and . + + A object that represents the operation to perform. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + A containing the result of executing the operation on the table. + + + + Begins an asynchronous table operation. + + A object that represents the operation to perform. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous table operation using the specified and . + + A object that represents the operation to perform. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous table operation. + + An that references the pending asynchronous operation. + A containing the result executing the operation on the table. + + + + Executes a batch operation on a table as an atomic operation, using the specified and . + + The object representing the operations to execute on the table. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + An enumerable collection of objects that contains the results, in order, of each operation in the on the table. + + + + Begins an asynchronous operation to execute a batch of operations on a table. + + The object representing the operations to execute on the table. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to execute a batch of operations on a table, using the specified and . + + The object representing the operations to execute on the table. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous batch of operations on a table. + + An that references the pending asynchronous operation. + A enumerable collection of type that contains the results, in order, of each operation in the on the table. + + + + Executes a query on a table, using the specified and . + + A representing the query to execute. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + An enumerable collection of objects, representing table entities returned by the query. + + + + Executes a query in segmented mode with the specified continuation token, , and . + + A representing the query to execute. + A object representing a continuation token from the server when the operation returns a partial result. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + A object containing the results of executing the query. + + + + Begins an asynchronous segmented query operation using the specified continuation token. + + A representing the query to execute. + A object representing a continuation token from the server when the operation returns a partial result. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to query a table in segmented mode using the specified continuation token, , and . + + A representing the query to execute. + A object representing a continuation token from the server when the operation returns a partial result. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous segmented query operation. + + An that references the pending asynchronous operation. + A object containing the results of executing the query. + + + + Executes a query on a table, using the specified and . + + The entity type of the query. + A TableQuery instance specifying the table to query and the query parameters to use, specialized for a type T implementing TableEntity. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + An enumerable collection, specialized for type TElement, of the results of executing the query. + + + + Queries a table in segmented mode using the specified continuation token, , and . + + The entity type of the query. + A instance specifying the table to query and the query parameters to use, specialized for a type TElement. + A object representing a continuation token from the server when the operation returns a partial result. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + A , specialized for type TElement, containing the results of executing the query. + + + + Begins an asynchronous operation to query a table in segmented mode, using the specified continuation token. + + The entity type of the query. + A instance specifying the table to query and the query parameters to use, specialized for a type TElement. + A object representing a continuation token from the server when the operation returns a partial result. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to query a table in segmented mode using the specified continuation token and . + + The entity type of the query. + A instance specifying the table to query and the query parameters to use, specialized for a type TElement. + A object representing a continuation token from the server when the operation returns a partial result. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous segmented table query operation. + + The entity type of the query. + An that references the pending asynchronous operation. + A , specialized for type TElement, containing the results of executing the query. + + + + Executes a query, using the specified and , applying the to the result. + + The entity type of the query. + The type into which the will project the query results. + A instance specifying the table to query and the query parameters to use, specialized for a type TElement. + An instance which creates a projection of the table query result entities into the specified type R. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + An enumerable collection, containing the projection into type R, of the results of executing the query. + + + + Executes a query in segmented mode with the specified continuation token, using the specified and , applying the to the results. + + The entity type of the query. + The type into which the will project the query results. + A instance specifying the table to query and the query parameters to use, specialized for a type TElement. + An instance which creates a projection of the table query result entities into the specified type R. + A object representing a continuation token from the server when the operation returns a partial result. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + A containing the projection into type R of the results of executing the query. + + + + Begins an asynchronous operation to query a table in segmented mode, using the specified and continuation token. + + The entity type of the query. + The type into which the will project the query results. + A instance specifying the table to query and the query parameters to use, specialized for a type TElement. + An instance which creates a projection of the table query result entities into the specified type R. + A object representing a continuation token from the server when the operation returns a partial result. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to execute a query in segmented mode with the specified continuation token, , and , applies the to the results. + + The entity type of the query. + The type into which the will project the query results. + A instance specifying the table to query and the query parameters to use, specialized for a type TElement. + An instance which creates a projection of the table query result entities into the specified type R. + A object representing a continuation token from the server when the operation returns a partial result. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous segmented table query operation. + + The entity type of the query. + The type into which the will project the query results. + An that references the pending asynchronous operation. + A containing the projection into type R of the results of executing the query. + + + + Begins an asynchronous operation to create a table. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to create a table. + + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to create a table. + + An that references the pending asynchronous operation. + + + + Creates a table. + + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + + + + Begins an asynchronous operation to create a table if it does not already exist. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to create a table if it does not already exist. + + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to determine whether a table exists. + + An that references the pending asynchronous operation. + true if table exists; otherwise, false. + + + + Creates the table if it does not already exist. + + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + true if table was created; otherwise, false. + + + + Begins an asynchronous operation to delete a table. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to delete a table. + + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to delete a table. + + An that references the pending asynchronous operation. + + + + Deletes a table. + + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + + + + Begins an asynchronous operation to delete the tables if it exists. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to delete the tables if it exists. + + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to delete the tables if it exists. + + An that references the pending asynchronous operation. + true if the table was deleted; otherwise, false. + + + + Deletes the table if it exists. + + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + true if the table was deleted; otherwise, false. + + + + Begins an asynchronous operation to determine whether a table exists. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to determine whether a table exists. + + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to determine whether a table exists. + + An that references the pending asynchronous operation. + true if table exists; otherwise, false. + + + + Checks whether the table exists. + + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + true if table exists; otherwise, false. + + + + Begins an asynchronous request to get the permissions settings for the table. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to get the permissions settings for the table. + + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the asynchronous result of the request to get the permissions settings for the table. + + An that references the pending asynchronous operation. + The table's permissions. + + + + Gets the permissions settings for the table. + + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + The table's permissions. + + + + Begins an asynchronous request to set permissions for the table. + + The permissions to apply to the table. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to set permissions for the table. + + The permissions to apply to the table. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the asynchronous result of the request to get the permissions settings for the table. + + An that references the pending asynchronous operation. + + + + Sets the permissions settings for the table. + + A object that represents the permissions to set. + A object that specifies execution options, such as retry policy and timeout settings, for the operation. + An object for tracking the current operation. + + + + Initializes a new instance of the class. + + The Table address. + The client. + + + + Initializes a new instance of the class. + + The absolute URI to the table. + The account credentials. + + + + Initializes a new instance of the class. + + The absolute URI to the table. + The storage account credentials. + If set to true, use path style Uris. + + + + Initializes a new instance of the class. + + True to use path style Uris. + The absolute URI to the table. + The credentials. + + + + Returns a shared access signature for the table. + + The access policy for the shared access signature. + An access policy identifier. + The start partition key, or null. + The start row key, or null. + The end partition key, or null. + The end row key, or null. + A shared access signature. + Thrown if the current credentials don't support creating a shared access signature. + + + + Returns the name of the table. + + The name of the table. + + + + Gets the canonical name of the table, formatted as /<account-name>/<table-name>. + + The canonical name of the table. + + + + Gets the object that represents the Table service. + + A client object that specifies the Table service endpoint. + + + + Gets the table name. + + The table name. + + + + Gets the URI that identifies the table. + + The address of the table. + + + + Provides a client-side logical representation of the Windows Azure Table Service. This client is used to configure and execute requests against the Table Service. + + The service client encapsulates the base URI for the Table service. If the service client will be used for authenticated access, it also encapsulates the credentials for accessing the storage account. + + Provides a client-side logical representation of the Windows Azure Table Service. This client is used to configure and execute requests against the Table Service. + + The service client encapsulates the base URI for the Table Service. If the service client will be used for authenticated access, it also encapsulates the credentials for accessing the storage account. + + + + Returns an enumerable collection of tables that begin with the specified prefix and that are retrieved lazily. + + An enumerable collection of tables that are retrieved lazily. + + + + Returns an enumerable collection of tables, which are retrieved lazily, that begin with the specified prefix. + + The table name prefix. + A object that specifies any additional options for the request. + An object that provides information on how the operation executed. + An enumerable collection of tables that are retrieved lazily. + + + + Begins an asynchronous operation to return a result segment containing a collection of tables + in the storage account. + + A returned by a previous listing operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a result segment containing a collection + of tables beginning with the specified prefix. + + The table name prefix. + A returned by a previous listing operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a result segment containing a collection + of tables beginning with the specified prefix. + + The table name prefix. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is zero the maximum possible number of results will be returned, up to 5000. + A returned by a previous listing operation. + The server timeout, maximum execution time, and retry policies for the operation. + An object that provides information on how the operation executed. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return a result segment containing a collection + of tables. + + An that references the pending asynchronous operation. + A result segment containing tables. + + + + Returns an enumerable collection of tables in the storage account. + + A returned by a previous listing operation. + An enumerable collection of tables. + + + + Returns an enumerable collection of tables, which are retrieved lazily, that begin with the specified prefix. + + The table name prefix. + A returned by a previous listing operation. + An enumerable collection of tables that are retrieved lazily. + + + + Returns an enumerable collection of tables that begin with the specified prefix and that are retrieved lazily. + + The table name prefix. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is zero the maximum possible number of results will be returned, up to 5000. + A returned by a previous listing operation. + A object that specifies any additional options for the request. + An object that provides information on how the operation executed. + An enumerable collection of tables that are retrieved lazily. + + + + Begins an asynchronous operation to get the properties of the table service. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to get the properties of the table service. + + A object that specifies any additional options for the request. + An object that provides information on how the operation executed. + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to get the properties of the table service. + + The result returned from a prior call to . + The table service properties. + + + + Gets the properties of the table service. + + A object that specifies any additional options for the request. + An object that provides information on how the operation executed. + The table service properties as a object. + + + + Begins an asynchronous operation to set the properties of the table service. + + The table service properties. + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to set the properties of the table service. + + The table service properties. + A object that specifies any additional options for the request. + An object that provides information on how the operation executed. + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to set the properties of the table service. + + The result returned from a prior call to + + + + Sets the properties of the table service. + + The table service properties. + A object that specifies any additional options for the request. + An object that provides information on how the operation executed. + + + + Creates a new object for performing operations against the Table service. + + A service context to use for performing operations against the Table service. + + + + The default server and client timeout interval. + + + + + Max execution time across all potential retries. + + + + + Initializes a new instance of the class using the specified Blob service endpoint + and anonymous credentials. + + The Blob service endpoint to use to create the client. + + + + Initializes a new instance of the class using the specified Blob service endpoint + and account credentials. + + The Blob service endpoint to use to create the client. + The account credentials. + + + + Initializes a new instance of the class. + + True to use path style Uris. + The Blob service endpoint to use to create the client. + The account credentials. + + + + Gets a reference to the table at the specified address. + + Either the name of the table, or the absolute URI to the table. + A reference to the table. + + + + Gets the account credentials used to create the Blob service client. + + The account credentials. + + + + Gets the base URI for the Blob service client. + + The base URI used to construct the Blob service client. + + + + Gets or sets the default retry policy for requests made via the Blob service client. + + The retry policy. + + + + Gets or sets the default server and client timeout for requests. + + The server and client timeout interval. + + + + Gets or sets the maximum execution time across all potential retries. + + The maximum execution time across all potential retries. + + + + Gets a value indicating whether the service client is used with Path style or Host style. + + Is true if use path style URIs; otherwise, false. + + + + Gets the authentication handler used to sign requests. + + Authentication handler. + + + + Represents a query against a specified table. + + A instance aggregates the query parameters to use when the query is executed. One of the executeQuery or executeQuerySegmented methods + of must be called to execute the query. The parameters are encoded and passed to the server when the table query is executed. + + + + Represents a query against a specified table. + + A instance aggregates the query parameters to use when the query is executed. One of the executeQuery or executeQuerySegmented methods + of must be called to execute the query. The parameters are encoded and passed to the server when the table query is executed. + + + + Generates a property filter condition string for the string value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A string containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the boolean value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A bool containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the binary value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A byte array containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the value, formatted as the specified . + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A string containing the value to compare with the property. + The to format the value as. + A string containing the formatted filter condition. + + + + Creates a filter condition using the specified logical operator on two filter conditions. + + A string containing the first formatted filter condition. + A string containing Operators.AND or Operators.OR. + A string containing the second formatted filter condition. + A string containing the combined filter expression. + + + + Defines the property names of the table entity properties to return when the table query is executed. + + The select clause is optional on a table query, used to limit the table properties returned from the server. By default, a query will return all properties from the table entity. + A list of string objects containing the property names of the table entity properties to return when the query is executed. + A instance set with the table entity properties to return. + + + + Defines the upper bound for the number of entities the query returns. + + The maximum number of entities for the table query to return. + A instance set with the number of entities to return. + + + + Defines a filter expression for the table query. Only entities that satisfy the specified filter expression will be returned by the query. + + Setting a filter expression is optional; by default, all entities in the table are returned if no filter expression is specified in the table query. + A string containing the filter expression to apply to the table query. + A instance set with the filter on entities to return. + + + + Gets or sets the number of entities the table query will return. + + The maximum number of entities for the table query to return. + + + + Gets or sets the filter expression to use in the table query. + + A string containing the filter expression to use in the query. + + + + Gets or sets the property names of the table entity properties to return when the table query is executed. + + A list of strings containing the property names of the table entity properties to return when the query is executed. + + + + Gets the table continuation from response. + + The response. + The continuation. + + + + Represents a batch operation on a table. + + + Represents a batch operation on a table. + + A batch operation is a collection of table operations which are executed by the Storage Service REST API as a single atomic operation, by invoking an + Entity Group Transaction.A batch operation may contain up to 100 individual + table operations, with the requirement that each operation entity must have same partition key. A batch with a retrieve operation cannot contain any other operations. + Note that the total payload of a batch operation is limited to 4MB. + + + + Inserts a into the batch that retrieves an entity based on its row key and partition key. The entity will be deserialzed into the specified class type which extends . + + The class of type for the entity to retrieve. + A string containing the partition key of the entity to retrieve. + A string containing the row key of the entity to retrieve. + + + + Adds a table operation to retrieve an entity of the specified class type with the specified partition key and row key to the batch operation. + + The return type which the specified will resolve the given entity to. + A string containing the partition key of the entity to retrieve. + A string containing the row key of the entity to retrieve. + The implementation to project the entity to retrieve as a particular type in the result. + + + + Initializes a new instance of the class. + + + + + Adds a to the that deletes the specified entity from a table. + + The entity to be deleted from the table. + + + + Adds a to the that inserts the specified entity into a table. + + The entity to be inserted into the table. + + + + Adds a to the that inserts the specified entity into a table if the entity does not exist; if the entity does exist then its contents are merged with the provided entity. + + The entity whose contents are being inserted or merged. + + + + Adds a to the that inserts the specified entity into a table if the entity does not exist; if the entity does exist then its contents are replaced with the provided entity. + + The entity whose contents are being inserted or replaced. + + + + Adds a to the that merges the contents of the specified entity with the existing entity in a table. + + The entity whose contents are being merged. + + + + Adds a to the that replaces the contents of the specified entity in a table. + + The entity whose contents are being replaced. + + + + CAdds a to the that retrieves an entity with the specified partition key and row key. + + A string containing the partition key of the entity to retrieve. + A string containing the row key of the entity to retrieve. + + + + Returns the zero-based index of the first occurrence of the specified item, or -1 if the does not contain the item. + + The item to search for. + The zero-based index of the first occurrence of item within the , if found; otherwise, –1. + + + + Inserts a into the at the specified index. + + The index at which to insert the . + The item to insert. + + + + Removes the at the specified index from the . + + The index of the to remove from the . + + + + Adds the to the . + + The item to add to the . + + + + Clears all objects from the . + + + + + Returns true if this contains the specified element. + + The item to search for. + true if the item is contained in the ; false, otherwise. + + + + Copies all the elements of the to the specified one-dimensional array starting at the specified destination array index. + + The one-dimensional array that is the destination of the elements copied from the . + The index in the destination array at which copying begins. + + + + Removes the specified item from the . + + The item to remove. + true if the item was successfully removed; false, otherwise. + + + + Returns an for the . + + An enumerable collection of items. + + + + Returns an . + + An for the . + + + + Gets or sets the item at the specified index. + + The index at which to get or set the TableOperation. + The item at the specified index. + + + + Gets the number of operations in this . + + The number of operations in the . + + + + Gets a value indicating whether the is read-only. + + true if the is read-only; false, otherwise. + + + + Represents a single table operation. + + + Represents a single table operation. + + + + + Creates a new table operation that replaces the contents of + the given entity in a table. + + The class of type for the entity to retrieve. + A string containing the partition key of the entity to retrieve. + A string containing the row key of the entity to retrieve. + The table operation. + + + + Creates a new table operation that replaces the contents of + the given entity in a table. + + The return type which the specified will resolve the given entity to. + A string containing the partition key of the entity to retrieve. + A string containing the row key of the entity to retrieve. + The implementation to project the entity to retrieve as a particular type in the result. + The table operation. + + + + Creates a new instance of the TableOperation class given the + entity to operate on and the type of operation that is being + performed. + + The entity that is being operated upon. + The type of operation. + + + + Creates a new table operation that deletes the given entity + from a table. + + The entity to be deleted from the table. + The table operation. + + + + Creates a new table operation that inserts the given entity + into a table. + + The entity to be inserted into the table. + The table operation. + + + + Creates a new table operation that inserts the given entity + into a table if the entity does not exist; if the entity does + exist then its contents are merged with the provided entity. + + The entity whose contents are being inserted + or merged. + The table operation. + + + + Creates a new table operation that inserts the given entity + into a table if the entity does not exist; if the entity does + exist then its contents are replaced with the provided entity. + + The entity whose contents are being inserted + or replaced. + The table operation. + + + + Creates a new table operation that merges the contents of + the given entity with the existing entity in a table. + + The entity whose contents are being merged. + The table operation. + + + + Creates a new table operation that replaces the contents of + the given entity in a table. + + The entity whose contents are being replaced. + The table operation. + + + + Creates a new table operation that replaces the contents of + the given entity in a table. + + The partition key of the entity to be replaced. + The row key of the entity to be replaced. + The table operation. + + + + Gets the entity that is being operated upon. + + + + + Gets the type of operation. + + + + + Represents a query against a specified table. + + A class which implements . + + Represents a query against a specified table. + + A class type which implements . + + + + Initializes a new instance of the class. + + + + + Generates a property filter condition string for the string value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A string containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the boolean value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A bool containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the binary value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A byte array containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the value. + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A containing the value to compare with the property. + A string containing the formatted filter condition. + + + + Generates a property filter condition string for the value, formatted as the specified . + + A string containing the name of the property to compare. + A string containing the comparison operator to use. + A string containing the value to compare with the property. + The to format the value as. + A string containing the formatted filter condition. + + + + Creates a filter condition using the specified logical operator on two filter conditions. + + A string containing the first formatted filter condition. + A string containing Operators.AND or Operators.OR. + A string containing the second formatted filter condition. + A string containing the combined filter expression. + + + + Defines the property names of the table entity properties to return when the table query is executed. + + The select clause is optional on a table query, used to limit the table properties returned from the server. By default, a query will return all properties from the table entity. + A list of string objects containing the property names of the table entity properties to return when the query is executed. + A instance set with the table entity properties to return. + + + + Defines the upper bound for the number of entities the query returns. + + The maximum number of entities for the table query to return. + A instance set with the number of entities to return. + + + + Defines a filter expression for the table query. Only entities that satisfy the specified filter expression will be returned by the query. + + Setting a filter expression is optional; by default, all entities in the table are returned if no filter expression is specified in the table query. + A string containing the filter expression to apply to the table query. + A instance set with the filter on entities to return. + + + + Gets or sets the number of entities the query returns specified in the table query. + + The maximum number of entities for the table query to return. + + + + Gets or sets the filter expression to use in the table query. + + A string containing the filter expression to use in the query. + + + + Gets or sets the property names of the table entity properties to return when the table query is executed. + + A list of strings containing the property names of the table entity properties to return when the query is executed. + + + + Represents a set of access conditions to be used for operations against the storage services. + + + + + Time for IfModifiedSince. + + + + + Time for IfUnmodifiedSince. + + + + + Constructs an empty access condition. + + An empty access condition. + + + + Constructs an access condition such that an operation will be performed only if the resource's ETag value + matches the specified ETag value. + + The ETag value that must be matched. + An AccessCondition object that represents the If-Match condition. + + + + Constructs an access condition such that an operation will be performed only if the resource has been + modified since the specified time. + + The time that must be before the last modified time of the resource. + An AccessCondition object that represents the If-Modified-Since condition. + + + + Constructs an access condition such that an operation will be performed only if the resource's ETag value + does not match the specified ETag value. + + The ETag value that must be matched, or "*". + An AccessCondition object that represents the If-None-Match condition. + + If "*" is specified as the parameter then this condition requires that the resource does not exist. + + + + + Constructs an access condition such that an operation will be performed only if the resource has not been + modified since the specified time. + + The time that must not be before the last modified time of the resource. + An AccessCondition object that represents the If-Unmodified-Since condition. + + + + Constructs an access condition such that an operation will be performed only if the lease ID on the + resource matches the specified lease ID. + + The lease ID that must match the lease ID of the resource. + An AccessCondition object that represents the lease condition. + + + + Gets or sets an "etag" that must match the ETag of a resource. + + A quoted ETag string. If null, no condition exists. + + + + Gets or sets an ETag that must not match the ETag of a resource. + + A quoted ETag string, or "*" to match any ETag. If null, no condition exists. + + + + Gets or sets a time that must be before the last modification of a resource. + + A DateTimeOffset in UTC, or null if no condition exists. + + + + Gets or sets a time that must not be before the last modification of a resource. + + A DateTimeOffset in UTC, or null if no condition exists. + + + + Gets or sets a lease ID that must match the lease on a resource. + + A lease ID, or null if no condition exists. + + + + Determines whether the access condition is one of the four conditional headers. + + true if the access condition is a conditional header; otherwise, false. + + + + Represents a Windows Azure Storage account. + + + + + The setting name for using the development storage. + + + + + The setting name for specifying a development storage proxy Uri. + + + + + The setting name for using the default storage endpoints with the specified protocol. + + + + + The setting name for the account name. + + + + + The setting name for the account key name. + + + + + The setting name for the account key. + + + + + The setting name for a custom blob storage endpoint. + + + + + The setting name for a custom queue endpoint. + + + + + The setting name for a custom table storage endpoint. + + + + + The setting name for a shared access key. + + + + + The default account name for the development storage. + + + + + The default account key for the development storage. + + + + + The credentials string used to test for the development storage credentials. + + + + + The root blob storage DNS name. + + + + + The root queue DNS name. + + + + + The root table storage DNS name. + + + + + The Fisma compliance default value. + + + + + Validator for the UseDevelopmentStorage setting. Must be "true". + + + + + Validator for the DevelopmentStorageProxyUri setting. Must be a valid Uri. + + + + + Validator for the DefaultEndpointsProtocol setting. Must be either "http" or "https". + + + + + Validator for the AccountName setting. No restrictions. + + + + + Validator for the AccountKey setting. No restrictions. + + + + + Validator for the AccountKey setting. Must be a valid base64 string. + + + + + Validator for the BlobEndpoint setting. Must be a valid Uri. + + + + + Validator for the QueueEndpoint setting. Must be a valid Uri. + + + + + Validator for the TableEndpoint setting. Must be a valid Uri. + + + + + Validator for the SharedAccessSignature setting. No restrictions. + + + + + Singleton instance for the development storage account. + + + + + Initializes a new instance of the class using the specified + account credentials and service endpoints. + + The account credentials. + The Blob service endpoint. + The Queue service endpoint. + The Table service endpoint. + + + + Initializes a new instance of the class using the specified + account credentials and the default service endpoints. + + An object of type that + specifies the account name and account key for the storage account. + True to use HTTPS to connect to storage service endpoints; otherwise, false. + + + + Parses a connection string and returns a created + from the connection string. + + A valid connection string. + Thrown if is null or empty. + Thrown if is not a valid connection string. + Thrown if cannot be parsed. + A object constructed from the values provided in the connection string. + + + + Indicates whether a connection string can be parsed to return a object. + + The connection string to parse. + A object to hold the instance returned if + the connection string can be parsed. + true if the connection string was successfully parsed; otherwise, false. + + + + Creates the Table service client. + + A client object that specifies the Table service endpoint. + + + + Creates the Queue service client. + + A client object that specifies the Queue service endpoint. + + + + Creates the Blob service client. + + A client object that specifies the Blob service endpoint. + + + + Returns a connection string for this storage account, without sensitive data. + + A connection string. + + + + Returns a connection string for the storage account, optionally with sensitive data. + + True to include sensitive data in the string; otherwise, false. + A connection string. + + + + Returns a with development storage credentials using the specified proxy Uri. + + The proxy endpoint to use. + The new . + + + + Internal implementation of Parse/TryParse. + + The string to parse. + The to return. + A callback for reporting errors. + If true, the parse was successful. Otherwise, false. + + + + Tokenizes input and stores name value pairs. + + The string to parse. + Error reporting delegate. + Tokenized collection. + + + + Encapsulates a validation rule for an enumeration based account setting. + + The name of the setting. + A list of valid values for the setting. + An representing the enumeration constraint. + + + + Encapsulates a validation rule using a func. + + The name of the setting. + A func that determines if the value is valid. + An representing the constraint. + + + + Determines whether the specified setting value is a valid base64 string. + + The setting value. + true if the specified setting value is a valid base64 string; otherwise, false. + + + + Validation function that validates Uris. + + Value to validate. + true if the specified setting value is a valid Uri; otherwise, false. + + + + Settings filter that requires all specified settings be present and valid. + + A list of settings that must be present. + The remaining settings or null if the filter's requirement is not satisfied. + + + + Settings filter that removes optional values. + + A list of settings that are optional. + The remaining settings or null if the filter's requirement is not satisfied. + + + + Settings filter that ensures that at least one setting is present. + + A list of settings of which one must be present. + The remaining settings or null if the filter's requirement is not satisfied. + + + + Settings filter that ensures that a valid combination of credentials is present. + + The remaining settings or null if the filter's requirement is not satisfied. + + + + Tests to see if a given list of settings matches a set of filters exactly. + + The settings to check. + A list of filters to check. + + If any filter returns null, false. + If there are any settings left over after all filters are processed, false. + Otherwise true. + + + + + Gets a StorageCredentials object corresponding to whatever credentials are supplied in the given settings. + + The settings to check. + The StorageCredentials object specified in the settings. + + + + Gets the default blob endpoint using specified settings. + + The settings to use. + The default blob endpoint. + + + + Gets the default blob endpoint using the specified protocol and account name. + + The protocol to use. + The name of the storage account. + The default blob endpoint. + + + + Gets the default queue endpoint using the specified settings. + + The settings. + The default queue endpoint. + + + + Gets the default queue endpoint using the specified protocol and account name. + + The protocol to use. + The name of the storage account. + The default queue endpoint. + + + + Gets the default table endpoint using the specified settings. + + The settings. + The default table endpoint. + + + + Gets the default table endpoint using the specified protocol and account name. + + The protocol to use. + The name of the storage account. + The default table endpoint. + + + + Gets or sets a value indicating whether the Fisma MD5 setting will be used. + + false to use the Fisma MD5 setting; true to use the .Net default implementation. + + + + Gets a object that references the development storage account. + + A reference to the development storage account. + + + + Gets the endpoint for the Blob service, as configured for the storage account. + + The Blob service endpoint. + + + + Gets the endpoint for the Queue service, as configured for the storage account. + + The Queue service endpoint. + + + + Gets the endpoint for the Table service, as configured for the storage account. + + The Table service endpoint. + + + + Gets the credentials used to create this object. + + The credentials used to create the object. + + + + Specifies that the method will make one or more requests to the storage service. + + + + + An interface required for continuation token types. + + The , , and classes implement the interface. + + + + An interface required for request option types. + + The , , and classes implement the interface. + + + + Gets or sets the retry policy for the request. + + The retry policy delegate. + + + + Gets or sets the server timeout for the request. + + The client and server timeout interval for the request. + + + + Gets or sets the maximum execution time across all potential retries. + + The maximum execution time across all potential retries. + + + + Represents the context for a request to the storage service and provides additional runtime information about its execution. + + + + + Gets or sets additional headers, for example proxy or logging information. + + A object containing additional header information. + + + + Gets or sets the client request ID. + + The client request ID. + + + + Occurs immediately before a request is signed. + + + + + Occurs when a response is received from the server. + + + + + Gets or sets the start time of the operation. + + The start time of the operation. + + + + Gets or sets the end time of the operation. + + The end time of the operation. + + + + Gets or sets the set of request results that the current operation has created. + + An object that contains objects that represent the request results created by the current operation. + + + + Gets the last request result encountered for the operation. + + A object that represents the last request result. + + + + Provides information and event data that is associated with a request event. + + + + + Initializes a new instance of the class by using the specified parameter. + + The object. + + + + Gets the request information associated with this event. + + The request information associated with this event. + + + + Gets the HTTP request associated with this event. + + The HTTP request associated with this event. + + + + Gets the HTTP response associated with this event. + + The HTTP response associated with this event. + + + + Represents the result of a physical request. + + + + + Translates the specified message into a object. + + The message to translate. + The translated . + + + + Generates a serializable RequestResult from its XML representation. + + The stream from which the RequestResult is deserialized. + + + + Converts a serializable RequestResult object into its XML representation. + + The stream to which the RequestResult is serialized. + + + + Gets or sets the HTTP status code for the request. + + The HTTP status code for the request. + + + + Gets the HTTP status message for the request. + + The HTTP status message for the request. + + + + Gets the service request ID for this request. + + The service request ID for this request. + + + + Gets the content-MD5 value for the request. + + The content-MD5 value for the request. + + + + Gets the ETag value of the request. + + The ETag value of the request. + + + + Gets the request date. + + The request date. + + + + Gets the extended error information. + + The extended error information. + + + + Gets or sets the exception. + + The exception. + + + + Gets the start time of the operation. + + The start time of the operation. + + + + Gets the end time of the operation. + + The end time of the operation. + + + + Represents a result segment that was retrieved from the total set of possible results. + + The type of the element. + + + + Stores the continuation token used to retrieve the next segment of results. + + + + + Initializes a new instance of the ResultSegment class. + + The result. + + + + Gets an enumerable collection of results. + + An enumerable collection of results. + + + + Gets a continuation token to use to retrieve the next set of results with a subsequent call to the operation. + + The continuation token. + + + + Represents an exception for the Windows Azure storage service. + + + + + Initializes a new instance of the class by using the specified parameters. + + The request result. + The message. + The inner exception. + + + + Initializes a new instance of the class with serialized data. + + The that contains contextual information about the source or destination. + The object that holds the serialized object data for the exception being thrown. + This constructor is called during deserialization to reconstitute the exception object transmitted over a stream. + + + + Populates a object with the data needed to serialize the target object. + + The destination context for this serialization. + The object to populate with data. + + + + Translates the specified exception into a storage exception. + + The exception to translate. + The request result. + The storage exception. + + + + Represents an exception thrown by the Windows Azure storage client library. + + A string that represents the exception. + + + + Gets the object for this object. + + The object for this object. + + + + Represents extended error information returned by the Windows Azure storage services. + + + + + Initializes a new instance of the class. + + + + + Gets the error details from stream. + + The input stream. + The error details. + + + + Generates a serializable StorageExtendedErrorInformation from its XML representation. + + The stream from which the StorageExtendedErrorInformation is deserialized. + + + + Converts a serializable StorageExtendedErrorInformation object into its XML representation. + + The stream to which the StorageExtendedErrorInformation is serialized. + + + + Gets the storage service error code. + + The storage service error code. + + + + Gets the storage service error message. + + The storage service error message. + + + + Gets additional error details. + + The additional error details. + + + + Represents a set of credentials used to authenticate access to a Windows Azure storage account. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified account name and key value. + + A string that represents the name of the storage account. + A string that represents the Base-64-encoded account access key. + + + + Initializes a new instance of the class with the specified account name and key value. + + A string that represents the name of the storage account. + An array of bytes that represent the account access key. + + + + Initializes a new instance of the class with the specified account name, key value, and key name. + + A string that represents the name of the storage account. + A string that represents the Base-64-encoded account access key. + A string that represents the name of the key. + + + + Initializes a new instance of the class with the specified account name, key value, and key name. + + A string that represents the name of the storage account. + An array of bytes that represent the account access key. + A string that represents the name of the key. + + + + Initializes a new instance of the class with the specified shared access signature token. + + A string representing the shared access signature token. + + + + Updates the key value and key name for the credentials. + + The key value, as a Base-64 encoded string, to update. + The key name to update. + + + + Updates the key value and key name for the credentials. + + The key value, as an array of bytes, to update. + The key name to update. + + + + Returns the key for the credentials. + + An array of bytes that contains the key. + + + + Transforms a resource URI into a shared access signature URI, by appending a shared access token. + + A object that represents the resource URI to be transformed. + A object that represents the signature, including the resource URI and the shared access token. + + + + Determines whether an other object is equal to this one by comparing their SAS tokens, account names, key names, and key values. + + The object to compare to this one. + true if the two objects are equal; otherwise, false. + + + + Gets the associated shared access signature token for the credentials. + + The shared access signature token. + + + + Gets the associated account name for the credentials. + + The account name. + + + + Gets the associated key name for the credentials. + + The key name. + + + + Gets a value indicating whether the credentials are for anonymous access. + + true if the credentials are for anonymous access; otherwise, false. + + + + Gets a value indicating whether the credentials are a shared access signature token. + + true if the credentials are a shared access signature token; otherwise, false. + + + + Gets a value indicating whether the credentials are a shared key. + + true if the credentials are a shared key; otherwise, false. + + + + Represents a canonicalized string used in authenticating a request against the azure service. + + + + + Stores the internal that holds the canonicalized string. + + + + + Initializes a new instance of the class. + + The first canonicalized element to start the string with. + + + + Append additional canonicalized element to the string. + + An additional canonicalized element to append to the string. + + + + Gets the canonicalized string. + + + + + A NullTaskReturn type. + + + + + Represents a no-return from a task. + + + + + Prevents a default instance of the class from being created. + + + + + Provides a standard set of errors that could be thrown from the client library. + + + + + A style class for creating Uri query strings. + + + + + Stores the query parameters. + + + + + Add the value with Uri escaping. + + The query name. + The query value. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Add query parameter to an existing Uri. This takes care of any existing query parameters in the Uri. + + Original Uri which may contain query parameters already. + The appended Uri. + + + + Contains helper methods for implementing shared access signatures. + + + + + Get the complete query builder for creating the Shared Access Signature query. + + The shared access policy to hash. + An optional identifier for the policy. + Either "b" for blobs or "c" for containers. + The signature to use. + The name of the key used to create the signature, or null if the key is implicit. + The finished query builder. + + + + Get the complete query builder for creating the Shared Access Signature query. + + The shared access policy to hash. + An optional identifier for the policy. + The signature to use. + The name of the key used to create the signature, or null if the key is implicit. + The finished query builder. + + + + Get the complete query builder for creating the Shared Access Signature query. + + The shared access policy to hash. + The name of the table associated with this shared access signature. + An optional identifier for the policy. + The start partition key, or null. + The start row key, or null. + The end partition key, or null. + The end row key, or null. + The signature to use. + The name of the key used to create the signature, or null if the key is implicit. + The finished query builder. + + + + Converts the specified value to either a string representation or . + + The value to convert. + A string representing the specified value. + + + + Converts the specified value to either a string representation or null. + + The value to convert. + A string representing the specified value. + + + + Escapes and adds the specified name/value pair to the query builder if it is not null. + + The builder to add the value to. + The name of the pair. + The value to be escaped. + + + + Parses the query. + + The query parameters. + + + + Get the complete query builder for creating the Shared Access Signature query. + + The permissions string for the resource, or null. + The start time, or null. + The expiration time, or null. + The start partition key, or null. + The start row key, or null. + The end partition key, or null. + The end row key, or null. + An optional identifier for the policy. + Either "b" for blobs or "c" for containers, or null if neither. + The name of the table this signature is associated with, + or null if not using table SAS. + The signature to use. + The name of the key used to create the signature, or null if the key is implicit. + The finished query builder. + + + + Get the signature hash embedded inside the Shared Access Signature. + + The shared access policy to hash. + An optional identifier for the policy. + The canonical resource string, unescaped. + Credentials to be used for signing. + The signed hash. + + + + Get the signature hash embedded inside the Shared Access Signature. + + The shared access policy to hash. + An optional identifier for the policy. + The canonical resource string, unescaped. + Credentials to be used for signing. + The signed hash. + + + + Get the signature hash embedded inside the Shared Access Signature. + + The shared access policy to hash. + An optional identifier for the policy. + The start partition key, or null. + The start row key, or null. + The end partition key, or null. + The end row key, or null. + The canonical resource string, unescaped. + Credentials to be used for signing. + The signed hash. + + + + Get the signature hash embedded inside the Shared Access Signature. + + The permissions string for the resource, or null. + The start time, or null. + The expiration time, or null. + The start partition key, or null. + The start row key, or null. + The end partition key, or null. + The end row key, or null. + Whether to use the table string-to-sign. + An optional identifier for the policy. + The canonical resource string, unescaped. + The credentials to be used for signing. + The signed hash. + + + + Apply timeout options to StorageCommandBase + + Return value type of StorageCommandBase + An instance of StorageCommandBase to apply options to + + + + Apply timeout options to StorageCommandBase + + Return value type of StorageCommandBase + An instance of StorageCommandBase to apply options to + + + + Apply timeout options to StorageCommandBase + + Return value type of StorageCommandBase + An instance of StorageCommandBase to apply options to + + + + If the values list is null or empty, return empty string, + otherwise return the first value. + + Type of value + List of values + A single value + + + + Returns the date/time in a DateTimeOffset or an empty string + + DateTimeOffset value + String representation of the date/time + + + + Throws an exception if the string is empty or null. + + The name of the parameter. + The value of the parameter. + Thrown if value is empty. + Thrown if value is null. + + + + Throw an exception if the value is null. + + The name of the parameter. + The value of the parameter. + Thrown if value is null. + + + + Throw an exception indicating argument is out of range. + + The name of the parameter. + The value of the parameter. + + + + Throw an exception if the argument is out of bounds. + + The type of the value. + The name of the parameter. + The value of the parameter. + The minimum value for the parameter. + The maximum value for the parameter. + + + + Checks that the given timeout in within allowed bounds. + + The timeout to check. + The timeout is not within allowed bounds. + + + + Combines AssertNotNullOrEmpty and AssertInBounds for convenience. + + The name of the parameter. + Turns on or off null/empty checking. + The value of the parameter. + The maximum size of value. + + + + Rounds up to seconds. + + The time span. + The time rounded to seconds. + + + + Determines if a Uri requires path style addressing. + + The Uri to check. + Returns true if the Uri uses path style addressing; otherwise, false. + + + + Applies the request optimizations such as disabling buffering and 100 continue. + + The request to be modified. + The length of the content, -1 if the content length is not settable. + + + + General class that provides helper methods for XML processing and lazy execution of segmented results. + + + + + Read the value of an element in the XML. + + The name of the element whose value is retrieved. + A reader that provides access to XML data. + A string representation of the element's value. + + + + Skip white spaces. + + A reader that provides access to XML data. + + + + Returns an enumerable collection of results that is retrieved lazily. + + The type of ResultSegment like Blob, Container, Queue and Table. + The segment generator. + >A non-negative integer value that indicates the maximum number of results to be returned + in the result segment, up to the per-operation limit of 5000. + An object that represents the context for the current operation. + + + + + Provides helper functions for http request/response processing. + + + + + Parse the http query string. + + Http query string. + + + + + Parse the http query string. + + Http query string. + Character encoding. + + + + + Converts the DateTimeOffset object to an Http string of form: Sun, 28 Jan 2008 12:11:37 GMT. + + The DateTimeOffset object to convert to an Http string. + String of form: Sun, 28 Jan 2008 12:11:37 GMT. + + + + Combine all the header values int he IEnumerable to a single comma separated string. + + An IEnumerable object representing the header values. + A comma separated string of header values. + + + + Try to get the value of the specified header name. + + The Http web response from which to get the header value. + The name of the header whose value is to be retrieved. + The default value for the header that is returned if we can't get the actual header value. + A string representing the header value. + + + + Wrapper class for MD5. + + + + + Calculates an on-going hash using the input byte array. + + The input array used for calculating the hash. + The offset in the input buffer to calculate from. + The number of bytes to use from input. + + + + Retrieves the string representation of the hash. (Completes the creation of the hash). + + A byte array that is the content of the hash. + + + + Computes the hash value of the specified MemoryStream. + + The memory stream to calculate hash on. + The computed hash value string. + + + + Contains methods for dealing with navigation. + + + + + The name of the root container. + + + + + Used in address parsing. + + + + + Used in address parsing. + + + + + Used in address parsing. + + + + + Used to split string on slash. + + + + + Used to split hostname. + + + + + Retrieves the container part of a storage Uri, or "$root" if the container is implicit. + + The blob address. + If set to true use path style Uris. + Name of the container. + + The trailing slash is always removed. + + GetContainerName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob")) will return "mycontainer" + GetConatinerName(new Uri("http://test.blob.core.windows.net/mycontainer/")) will return "mycontainer" + GetConatinerName(new Uri("http://test.blob.core.windows.net/myblob")) will return "$root" + GetConatinerName(new Uri("http://test.blob.core.windows.net/")) will throw ArgumentException + + + + + + Retrieves the blob part of a storage Uri. + + The blob address. + If set to true use path style Uris. + The name of the blob. + + + + Retreives the complete container address from a storage Uri + Example GetContainerAddress(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob")) + will return http://test.blob.core.windows.net/mycontainer. + + The blob address. + True to use path style Uris. + Uri of the container. + + + + Retreives the parent name from a storage Uri. + + The BLOB address. + The delimiter. + If set to true use path style Uris. + The name of the parent. + + Adds the trailing delimiter as the prefix returned by the storage REST api always contains the delimiter. + + + GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob", "/")) will return "/mycontainer/myfolder/" + GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder|myblob", "|") will return "/mycontainer/myfolder|" + GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myblob", "/") will return "/mycontainer/" + GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/", "/") will return "/mycontainer/" + + + + + Retrieves the parent address for a blob Uri. + + The BLOB address. + The delimiter. + If set to true use path style Uris. + The address of the parent. + + GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob", null)) + will return "http://test.blob.core.windows.net/mycontainer/myfolder/" + + + + + Gets the service client base address. + + The address Uri. + The use path style Uris. + The base address of the client. + + GetServiceClientBaseAddress("http://testaccount.blob.core.windows.net/testconatiner/blob1") + returns "http://testaccount.blob.core.windows.net" + + + + + Appends a path to a Uri correctly using "/" as separator. + + The base Uri. + The relative or absolute URI. + The appended Uri. + + AppendPathToUri(new Uri("http://test.blob.core.windows.net/test", "abc") + will return "http://test.blob.core.windows.net/test/abc" + AppendPathToUri(new Uri("http://test.blob.core.windows.net/test"), "http://test.blob.core.windows.net/test/abc") + will return "http://test.blob.core.windows.net/test/abc" + + + + + Append a relative path to a Uri, handling traling slashes appropiately. + + The base Uri. + The relative or absloute URI. + The seperator. + The appended Uri. + + + + Get container name from address for styles of paths + Eg: http://test.blob.core.windows.net/container/blob => container + http://127.0.0.1:10000/test/container/blob => container. + + The container Uri. + If set to true use path style Uris. + The container name. + + + + Gets the canonical path from creds. + + The credentials. + The absolute path. + The canonical path. + + + + Similar to getting container name from Uri. + + The queue Uri. + If set to true use path style Uris. + The queue name. + + + + Extracts a table name from the table's Uri. + + The queue Uri. + If set to true use path style Uris. + The queue name. + + + + Retrieve the container address and address. + + The BLOB address. + True to use path style Uris. + Name of the container. + The container URI. + + + + Retrieve the container name and the blob name from a blob address. + + The blob address. + If set to true use path style Uris. + The resulting container name. + The resulting blob name. + + + + Parses the snapshot time. + + The snapshot time. + The parsed snapshot time. + + + + Parse Uri for SAS (Shared access signature) information. + + The complete Uri. + The credentials to use. + + Validate that no other query parameters are passed in. + Any SAS information will be recorded as corresponding credentials instance. + If credentials is passed in and it does not match the SAS information found, an + exception will be thrown. + Otherwise a new client is created based on SAS information or as anonymous credentials. + + + + + Provides properties to keep track of Md5 / Length of a stream as it is being copied. + + + + + Provides stream helper methods that allow us to copy streams and measure the stream size. + + + + + Reads synchronously the entire content of the stream and writes it to the given output stream. + + The origin stream. + The destination stream. + Maximum length of the stream to write. + DateTime indicating the expiry time. + Bool value indicating whether the Md5 should be calculated. + A boolean indicating whether the write happens synchronously. + An object that represents the context for the current operation. + + + + Reads synchronously the entire content of the stream and writes it to the given output stream. + + The origin stream. + The destination stream. + Maximum length of the stream to write. + DateTime indicating the expiry time. + Bool value indicating whether the Md5 should be calculated. + StorageCommand that stores state about its execution. + An object that represents the context for the current operation. + The action taken when the execution is completed. + + + + Represents a retry policy that performs a specified number of retries, using a randomized exponential backoff scheme to determine the interval between retries. + + + + + Represents a retry policy. + + + + + Generates a new retry policy for the current request attempt. + + An object that represents the retry policy for the current request attempt. + + + + Determines if the operation should be retried and how long to wait until the next retry. + + The number of retries for the given operation. A value of zero signifies this is the first error encountered. + The status code for the last operation. + An object that represents the last exception encountered. + The interval to wait until the next retry. + An object for tracking the current operation. + true if the operation should be retried; otherwise, false. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class using the specified delta and maximum number of retries. + + The backoff interval between retries. + The maximum number of retry attempts. + + + + Determines if the operation should be retried and how long to wait until the next retry. + + The number of retries for the given operation. A value of zero signifies this is the first error encountered. + The status code for the last operation. + An object that represents the last exception encountered. + The interval to wait until the next retry. + An object for tracking the current operation. + true if the operation should be retried; otherwise, false. + + + + Generates a new retry policy for the current request attempt. + + An object that represents the retry policy for the current request attempt. + + + + Represents a retry policy that performs a specified number of retries, using a specified fixed time interval between retries. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class using the specified delta and maximum number of retries. + + The backoff interval between retries. + The maximum number of retry attempts. + + + + Determines if the operation should be retried and how long to wait until the next retry. + + The number of retries for the given operation. A value of zero signifies this is the first error encountered. + The status code for the last operation. + An object that represents the last exception encountered. + The interval to wait until the next retry. + An object for tracking the current operation. + true if the operation should be retried; otherwise, false. + + + + Generates a new retry policy for the current request attempt. + + An object that represents the retry policy for the current request attempt. + + + + Represents a retry policy that performs no retries. + + + + + Initializes a new instance of the class. + + + + + Determines if the operation should be retried and how long to wait until the next retry. + + The number of retries for the given operation. A value of zero signifies this is the first error encountered. + The status code for the last operation. + An object that represents the last exception encountered. + The interval to wait until the next retry. + An object for tracking the current operation. + true if the operation should be retried; otherwise, false. + + + + Generates a new retry policy for the current request attempt. + + An object that represents the retry policy for the current request attempt. + + + + Verifies that the blob is not a snapshot. + + + + + Gets the blob's system properties. + + The blob's properties. + + + + Gets the user-defined metadata for the blob. + + The blob's metadata, as a collection of name-value pairs. + + + + Gets the blob's URI. + + The absolute URI to the blob. + + + + Gets the date and time that the blob snapshot was taken, if this blob is a snapshot. + + The blob's snapshot time if the blob is a snapshot; otherwise, null. + + If the blob is not a snapshot, the value of this property is null. + + + + + Gets the state of the most recent or pending copy operation. + + A object containing the copy state, or null if no copy blob state exists for this blob. + + + + Represents the permissions for a container. + + + + + Initializes a new instance of the class. + + + + + Gets or sets the public access setting for the container. + + The public access setting for the container. + + + + Gets the set of shared access policies for the container. + + The set of shared access policies for the container. + + + + Represents the system properties for a container. + + + + + Gets the ETag value for the container. + + The container's quoted ETag value. + + + + Gets the container's last-modified time. + + The container's last-modified time. + + + + Gets the container's lease status. + + A object that indicates the container's lease status. + + + + Gets the container's lease state. + + A object that indicates the container's lease state. + + + + Gets the container's lease duration. + + A object that indicates the container's lease duration. + + + + Specifies the level of public access that is allowed on the container. + + + + + No public access. Only the account owner can read resources in this container. + + + + + Container-level public access. Anonymous clients can read container and blob data. + + + + + Blob-level public access. Anonymous clients can read only blob data within this container. + + + + + Represents a continuation token for listing operations. + + continuation tokens are used in methods that return a object, such as . + + + + Gets an XML representation of an object. + + + An that describes the XML representation of the object that is produced by the method and consumed by the method. + + + + + Generates a serializable continuation token from its XML representation. + + The stream from which the continuation token is deserialized. + + + + Converts a serializable continuation token into its XML representation. + + The stream to which the continuation token is serialized. + + + + Gets or sets the next marker for continuing results for enumeration operations. + + The next marker. + + + + Specifies which items to include when listing a set of blobs. + + + + + List only committed blobs, and do not return blob metadata. + + + + + List committed blobs and blob snapshots. + + + + + Retrieve blob metadata for each blob returned in the listing. + + + + + List committed and uncommitted blobs. + + + + + Include copy properties in the listing. + + + + + List all available committed blobs, uncommitted blobs, and snapshots, and return all metadata and copy status for those blobs. + + + + + Represents the system properties for a blob. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class based on an existing instance. + + The set of properties to clone. + + + + Gets or sets the cache-control value stored for the blob. + + The blob's cache-control value. + + + + Gets or sets the content-encoding value stored for the blob. + + The blob's content-encoding value. + + If this property has not been set for the blob, it returns null. + + + + + Gets or sets the content-language value stored for the blob. + + The blob's content-language value. + + If this property has not been set for the blob, it returns null. + + + + + Gets the size of the blob, in bytes. + + The blob's size in bytes. + + + + Gets or sets the content-MD5 value stored for the blob. + + The blob's content-MD5 hash. + + + + Gets or sets the content-type value stored for the blob. + + The blob's content-type value. + + If this property has not been set for the blob, it returns null. + + + + + Gets the blob's ETag value. + + The blob's ETag value. + + + + Gets the the last-modified time for the blob, expressed as a UTC value. + + The blob's last-modified time, in UTC format. + + + + Gets the type of the blob. + + A object that indicates the type of the blob. + + + + Gets the blob's lease status. + + A object that indicates the blob's lease status. + + + + Gets the blob's lease state. + + A object that indicates the blob's lease state. + + + + Gets the blob's lease duration. + + A object that indicates the blob's lease duration. + + + + Represents a set of timeout and retry policy options that may be specified for a blob operation request. + + + + + Initializes a new instance of the class. + + + + + Clones an instance of BlobRequestOptions so that we can apply defaults. + + BlobRequestOptions instance to be cloned. + + + + Gets or sets the retry policy. + + The retry policy. + + + + Gets or sets the server timeout interval for the request. + + The server timeout interval for the request. + + + + Gets or sets the maximum execution time accross all potential retries etc. + + The maximum execution time. + + + + Gets or sets a value to calculate and send/validate content MD5 for transactions. + + Use true to calculate and send/validate content MD5 for transactions; otherwise, false. + + + + Gets or sets a value to indicate that an MD5 hash will be calculated and stored when uploading a blob. + + Use true to calculate and store an MD5 hash when uploading a blob; otherwise, false. + + + + Gets or sets a value to indicate that MD5 validation will be disabled when downloading blobs. + + Use true to disable MD5 validation; false to enable MD5 validation. + + + + Represents a segment of results and contains continuation and pagination information. + + + + + Gets an enumerable collection of results. + + An enumerable collection of results. + + + + Gets the continuation token used to retrieve the next segment of results. + + The continuation token. + + + + The type of a blob. + + + + + Not specified. + + + + + A page blob. + + + + + A block blob. + + + + + Indicates whether to list only committed blocks, only uncommitted blocks, or all blocks. + + + + + Committed blocks. + + + + + Uncommitted blocks. + + + + + Both committed and uncommitted blocks. + + + + + Indicates which block lists should be searched to find a specified block. + + + + + Search the committed block list only. + + + + + Search the uncommitted block list only. + + + + + Search the uncommitted block list first, and if the block is not found there, search + the committed block list. + + + + + Specifies which details to include when listing the containers in this storage account. + + + + + No additional details. + + + + + Retrieve container metadata. + + + + + Retrieve all available details. + + + + + Represents a segment of results and contains continuation and pagination information. + + + + + Gets an enumerable collection of results. + + An enumerable collection of results. + + + + Gets the continuation token used to retrieve the next segment of results. + + The continuation token. + + + + Represents the attributes of a copy operation. + + + + + Gets the ID of the copy operation. + + A copy ID string. + + + + Gets the time the copy operation completed, whether completion was due to a successful copy, abortion, or a failure. + + A containing the completion time, or null. + + + + Gets the status of the copy operation. + + A enumeration indicating the status of the operation. + + + + Gets the source URI of a copy operation. + + A indicating the source of a copy operation, or null. + + + + Gets the number of bytes copied in the operation so far. + + The number of bytes copied in the operation so far, or null. + + + + Gets the total number of bytes in the source of the copy. + + The number of bytes in the source, or null. + + + + Gets the description of the current status, if any. + + A status description string, or null. + + + + Represents the status of a copy blob operation. + + + + + The copy status is invalid. + + + + + The copy operation is pending. + + + + + The copy operation succeeded. + + + + + The copy operation has been aborted. + + + + + The copy operation encountered an error. + + + + + The set of options describing delete operation. + + + + + Delete blobs but not snapshots. + + + + + Delete the blob and its snapshots. + + + + + Delete the blob's snapshots only. + + + + + Describes actions that can be performed on a lease. + + + + + Acquire the lease. + + + + + Renew the lease. + + + + + Release the lease. + + + + + Break the lease. + + + + + Change the lease ID. + + + + + The lease duration of a resource. + + + + + The lease duration is not specified. + + + + + The lease duration is finite. + + + + + The lease duration is infinite. + + + + + The lease state of a resource. + + + + + The lease state is not specified. + + + + + The lease is in the Available state. + + + + + The lease is in the Leased state. + + + + + The lease is in the Expired state. + + + + + The lease is in the Breaking state. + + + + + The lease is in the Broken state. + + + + + The lease status of a resource. + + + + + The lease status is not specified. + + + + + The resource is locked. + + + + + The resource is available to be locked. + + + + + Represents a block retrieved from the blob's block list. + + + + + Gets the name of the block. + + The block name. + + + + Gets the size of block in bytes. + + The block size. + + + + Gets a value indicating whether or not the block has been committed. + + True if the block has been committed; otherwise, false. + + + + Represents a range of pages in a page blob. + + + + + Initializes a new instance of the class. + + The starting offset. + The ending offset. + + + + Returns the content of the page range as a string. + + The content of the page range. + + + + Gets the starting offset of the page range. + + The starting offset. + + + + Gets the ending offset of the page range. + + The ending offset. + + + + Specifies the set of possible permissions for a shared access policy. + + + + + No shared access granted. + + + + + Read access granted. + + + + + Write access granted. + + + + + Delete access granted for blobs. + + + + + List access granted. + + + + + Represents the collection of shared access policies defined for a container. + + + + + Adds the specified key and value to the collection of shared access policies. + + The key of the value to add. + The value to add the collection of shared access policies. + + + + Determines whether the collection of shared access policies contains the specified key. + + The key to locate in the collection of shared access policies. + true if the collection of shared access policies contains an element with the specified key; otherwise, false. + + + + Removes the value with the specified key from the shared access policies collection. + + The key of the item to remove. + true if the element is successfully found and removed; otherwise, false. This method returns false if the key is not found. + + + + Gets the item associated with the specified key. + + The key of the value to get. + The item to get. + The item associated with the specified key, if the key is found; otherwise, the default value for the type. + + + + Adds the specified key/ value, stored in a , to the collection of shared access policies. + + The object, containing a key/ value pair, to add to the shared access policies collection. + + + + Removes all keys and values from the shared access collection. + + + + + Determines whether the collection of shared access policies contains the key and value in the specified object. + + A object containing the key and value to search for. + true if the shared access policies collection contains the specified key/value; otherwise, false. + + + + Copies each key/ value pair in the shared access policies collection to a compatible one-dimensional array, starting at the specified index of the target array. + + The one-dimensional array of objects that is the destination of the elements copied from the shared access policies collection. + The zero-based index in at which copying begins. + + + + Removes the value, specified in the object, from the shared access policies collection. + + The object, containing a key and value, to remove from the shared access policies collection. + true if the item was successfully removed; otherwise, false. + + + + Returns an enumerator that iterates through the collection of shared access policies. + + An of type . + + + + Returns an enumerator that iterates through the collection of shared access policies. + + An object that can be used to iterate through the collection of shared access policies. + + + + Gets a collection containing the keys in the shared access policies collection. + + A collection containing the keys in the of shared access policies collection. + + + + Gets a collection containing the values in the shared access policies collection. + + A collection of items in the shared access policies collection. + + + + Gets or sets the item associated with the specified key. + + The key of the value to get or set. + The item associated with the specified key, or null if key is not in the shared access policies collection. + + + + Gets the number of key/ value pairs contained in the shared access policies collection. + + The number of key/ value pairs contained in the shared access policies collection. + + + + Gets a value indicating whether the collection of shared access policies is read-only. + + true if the collection of shared access policies is read-only; otherwise, false. + + + + Represents a shared access policy, which specifies the start time, expiry time, + and permissions for a shared access signature. + + + + + Initializes a new instance of the class. + + + + + Converts the permissions specified for the shared access policy to a string. + + The shared access permissions. + The shared access permissions in string format. + + + + Constructs a object from a permissions string. + + The shared access permissions in string format. + A set of shared access permissions. + + + + Gets or sets the start time for a shared access signature associated with this shared access policy. + + The shared access start time. + + + + Gets or sets the expiry time for a shared access signature associated with this shared access policy. + + The shared access expiry time. + + + + Gets or sets the permissions for a shared access signature associated with this shared access policy. + + The permissions. + + + + Parses the response XML from an operation to set the access policy for a container. + + + + + Parses the response XML from an operation to set the access policy for a cloud object. + + The policy type to be filled. + + + + Provides a base class that is used internally to parse XML streams from storage service operations. + + The type to be parsed. + + + + Indicates that all parsable objects have been consumed. This field is reserved and should not be used. + + + + + Stores any objects that have not yet been parsed. This field is reserved and should not be used. + + + + + The reader used for parsing. This field is reserved and should not be used. + + + + + The IEnumerator over the parsed content. + + + + + Used to make sure that parsing is only done once, since a stream is not re-entrant. + + + + + Initializes a new instance of the ResponseParsingBase class. + + The stream to be parsed. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Parses the XML response. This method is reserved and should not be used. + + A collection of enumerable objects. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources, and optional + managed resources. + + True to release both managed and unmanaged resources; otherwise, false. + + + + This method is reserved and should not be used. + + True when the object is consumable. + + + + Parses the XML and close. + + A list of parsed results. + + + + Gets the parsable objects. This method is reserved and should not be used. + + The objects to parse. + + + + Initializes a new instance of the AccessPolicyResponseBase class. + + The stream to be parsed. + + + + Parses the current element. + + The shared access policy element to parse. + The shared access policy. + + + + Parses the response XML from a Set Container ACL operation to retrieve container-level access policy data. + + A list of enumerable key-value pairs. + + + + Gets an enumerable collection of container-level access policy identifiers. + + An enumerable collection of container-level access policy identifiers. + + + + Initializes a new instance of the BlobAccessPolicyResponse class. + + The stream to be parsed. + + + + Parses the current element. + + The shared access policy element to parse. + The shared access policy. + + + + Represents a container item returned in the XML response for a container listing operation. + + + + + + Initializes a new instance of the class. + + + + + Gets the user-defined metadata for the container. + + The container's metadata, as a collection of name-value pairs. + + + + Gets the container's system properties. + + The container's properties. + + + + Gets the name of the container. + + The container's name. + + + + Gets the container's URI. + + The absolute URI to the container. + + + + Provides error code strings that are specific to the Blob service. + + + + + Error code that may be returned when a block ID is invalid. + + + + + Error code that may be returned when a blob with the specified address cannot be found. + + + + + Error code that may be returned when a client attempts to create a blob that already exists. + + + + + Error code that may be returned when the specified block or blob is invalid. + + + + + Error code that may be returned when a block list is invalid. + + + + + The specified container was not found. + + + + + The specified container already exists. + + + + + The specified container is disabled. + + + + + The specified container is being deleted. + + + + + Error code that may be returned when there is currently no lease on the blob. + + + + + Error code that may be returned when there is currently no lease on the container. + + + + + Error code that may be returned when a lease ID was specified, but the lease has expired. + + + + + Error code that may be returned when the lease ID specified did not match the lease ID for the blob. + + + + + Error code that may be returned when the lease ID specified did not match the lease ID for the container. + + + + + Error code that may be returned when there is currently a lease on the resource and no lease ID was specified in the request. + + + + + Error code that may be returned when there is currently no lease on the resource. + + + + + Error code that may be returned when the lease ID specified did not match the lease ID. + + + + + Error code that may be returned when there is already a lease present. + + + + + Error code that may be returned when the lease has already been broken and cannot be broken again. + + + + + Error code that may be returned when the lease ID matched, but the lease has been broken explicitly and cannot be renewed. + + + + + Error code that may be returned when the lease ID matched, but the lease is breaking and cannot be acquired. + + + + + Error code that may be returned when the lease ID matched, but the lease is breaking and cannot be changed. + + + + + Error code that may be returned when the copy ID specified in an Abort Copy operation does not match the current pending copy ID. + + + + + Error code that may be returned when an Abort Copy operation is called when there is no pending copy. + + + + + Error code that may be returned when an attempt to modify the destination of a pending copy is made. + + + + + Error code that may be returned when the source of a copy cannot be accessed. + + + + + Error code that may be returned when the destination of a copy operation has a lease of fixed duration. + + + + + Provides a set of parameters for a blob listing operation. + + + + + Represents the listing context for enumeration operations. + + + + + Initializes a new instance of the class. + + The resource name prefix. + The maximum number of resources to return in a single operation, up to the per-operation limit of 5000. + + + + Gets or sets the Prefix value. + + The Prefix value. + + + + Gets or sets the MaxResults value. + + The MaxResults value. + + + + Gets or sets the Marker value. + + The Marker value. + + + + Initializes a new instance of the class. + + The blob prefix. + The maximum number of results to return. + The blob delimiter. + The include parameter. + + + + Gets or sets the delimiter for a blob listing operation. + + The delimiter to use to traverse the virtual hierarchy of blobs. + + The delimiter parameter enables the caller to traverse the blob namespace by using a user-configured delimiter. + Using this parameter, it is possible to traverse a virtual hierarchy of blobs as though it were a file system. + + + + + Gets or sets the details for the listing operation, which indicates the types of data to include in the + response. + + The details to include in the listing operation. + + The include parameter specifies that the response should include one or more of the following subsets: snapshots, + metadata, uncommitted blobs. + + + + + Converts the date time to snapshot string. + + The date time. + The converted string. + + + + Writes a collection of shared access policies to the specified stream in XML format. + + A collection of shared access policies. + An output stream. + + + + Writes the body of the block list to the specified stream in XML format. + + An enumerable collection of objects. + The stream to which the block list is written. + + + + Provides methods for parsing the response from an operation to return a block list. + + + + + Initializes a new instance of the class. + + The stream to be parsed. + + + + Reads a block item for block listing. + + Whether we are currently listing committed blocks or not + Block listing entry + + + + Parses the XML response returned by an operation to retrieve a list of blocks. + + An enumerable collection of objects. + + + + Gets an enumerable collection of objects from the response. + + An enumerable collection of objects. + + + + Provides methods for parsing the response from an operation to get a range of pages for a page blob. + + + + + Initializes a new instance of the class. + + The stream of page ranges to be parsed. + + + + Reads a page range. + + Page range entry + + + + Parses the XML response for an operation to get a range of pages for a page blob. + + An enumerable collection of objects. + + + + Gets an enumerable collection of objects from the response. + + An enumerable collection of objects. + + + + Represents a blob item returned in the XML response for a blob listing operation. + + + + + Initializes a new instance of the class. + + The name of the blob. + The blob's attributes. + + + + Stores the blob item's attributes. + + + + + Gets the name of the blob item. + + The name of the blob item. + + + + Gets the blob item's system properties. + + The blob item's properties. + + + + Gets the user-defined metadata for the blob item. + + The blob item's metadata, as a collection of name-value pairs. + + + + Gets the blob item's URI. + + The absolute URI to the blob item. + + + + Gets the date and time that the blob snapshot was taken, if this blob is a snapshot. + + The blob's snapshot time if the blob is a snapshot; otherwise, null. + + If the blob is not a snapshot, the value of this property is null. + + + + + Gets the state of the most recent or pending copy operation. + + A object containing the copy state, or null if no copy blob state exists for this blob. + + + + Represents the blob name prefix that is returned in the XML response for a blob listing operation. + + + + + Gets the blob name prefix. + + The blob name prefix. + + + + Provides methods for parsing the response from a blob listing operation. + + + + + Stores the blob prefix. + + + + + Signals when the blob prefix can be consumed. + + + + + Stores the marker. + + + + + Signals when the marker can be consumed. + + + + + Stores the blob delimiter. + + + + + Signals when the blob delimiter can be consumed. + + + + + Stores the max results. + + + + + Signals when the max results can be consumed. + + + + + Stores the next marker. + + + + + Signals when the next marker can be consumed. + + + + + Initializes a new instance of the class. + + The stream to be parsed. + + + + Parses a blob entry in a blob listing response. + + Blob listing entry + + + + Parses a blob prefix entry in a blob listing response. + + Blob listing entry + + + + Parses the response XML for a blob listing operation. + + An enumerable collection of objects that implement . + + + + Gets the listing context from the XML response. + + A set of parameters for the listing operation. + + + + Gets an enumerable collection of objects that implement from the response. + + An enumerable collection of objects that implement . + + + + Gets the Prefix value provided for the listing operation from the XML response. + + The Prefix value. + + + + Gets the Marker value provided for the listing operation from the XML response. + + The Marker value. + + + + Gets the Delimiter value provided for the listing operation from the XML response. + + The Delimiter value. + + + + Gets the MaxResults value provided for the listing operation from the XML response. + + The MaxResults value. + + + + Gets the NextMarker value from the XML response, if the listing was not complete. + + The NextMarker value. + + + + Provides methods for parsing the response from a container listing operation. + + + + + Stores the container prefix. + + + + + Signals when the container prefix can be consumed. + + + + + Stores the marker. + + + + + Signals when the marker can be consumed. + + + + + Stores the max results. + + + + + Signals when the max results can be consumed. + + + + + Stores the next marker. + + + + + Signals when the next marker can be consumed. + + + + + Initializes a new instance of the class. + + The stream to be parsed. + + + + Reads a container entry completely including its properties and metadata. + + Container listing entry + + + + Parses the response XML for a container listing operation. + + An enumerable collection of objects. + + + + Gets the listing context from the XML response. + + A set of parameters for the listing operation. + + + + Gets an enumerable collection of objects from the response. + + An enumerable collection of objects. + + + + Gets the Prefix value provided for the listing operation from the XML response. + + The Prefix value. + + + + Gets the Marker value provided for the listing operation from the XML response. + + The Marker value. + + + + Gets the MaxResults value provided for the listing operation from the XML response. + + The MaxResults value. + + + + Gets the NextMarker value from the XML response, if the listing was not complete. + + The NextMarker value. + + + + Describes actions that may be used for writing to a page blob or clearing a set of pages. + + + + + Update the page with new data. + + + + + Clear the page. + + + + + Represents a block in a block list. + + + + + Initializes a new instance of the class. + + The block ID. + One of the enumeration values that specifies in which block lists to search for the block. + + + + Gets the block ID. + + The block ID. + + + + Gets a value that indicates which block lists to search for the block. + + One of the enumeration values that specifies in which block lists to search for the block. + + + + Enumeration controlling the options for updating queue messages. + + + + + Update the message visibility timeout. + + + + + Update the message content. + + + + + Enum for Queue message type. + Internal use only. + + + + + Indicates the message object stores the raw text string. + + + + + Indicates the message object stores the Base64-Encoded representation of the raw data. + + + + + Represents a set of timeout and retry policy options that may be specified for a queue operation request. + + + + + Initializes a new instance of the class. + + + + + Clones an instance of QueueRequestOptions so that we can apply defaults. + + QueueRequestOptions instance to be cloned. + + + + Gets or sets the retry policy for the request. + + The retry policy delegate. + + + + Gets or sets the server timeout for the request. + + The client and server timeout interval for the request. + + + + Gets or sets the maximum execution time accross all potential retries etc. + + The maximum execution time. + + + + Represents a segment of results and contains continuation and pagination information. + + + + + Gets an enumerable collection of results. + + An enumerable collection of results. + + + + Gets the continuation token used to retrieve the next segment of results. + + The continuation token. + + + + Specifies the set of possible permissions for a shared access queue policy. + + + + + No shared access granted. + + + + + Permission to peek messages and get queue metadata granted. + + + + + Permission to add messages granted. + + + + + Permissions to update messages granted. + + + + + Permission to get and delete messages granted. + + + + + Represents the collection of shared access policies defined for a queue. + + + + + Adds the specified key and value to the collection of shared access policies. + + The key of the value to add. + The value to add the collection of shared access policies. + + + + Determines whether the collection of shared access policies contains the specified key. + + The key to locate in the collection of shared access policies. + true if the collection of shared access policies contains an element with the specified key; otherwise, false. + + + + Removes the value with the specified key from the shared access policies collection. + + The key of the item to remove. + true if the element is successfully found and removed; otherwise, false. This method returns false if the key is not found. + + + + Gets the item associated with the specified key. + + The key of the value to get. + The item to get. + The item associated with the specified key, if the key is found; otherwise, the default value for the type. + + + + Adds the specified key/ value, stored in a , to the collection of shared access policies. + + The object, containing a key/ value pair, to add to the shared access policies collection. + + + + Removes all keys and values from the shared access collection. + + + + + Determines whether the collection of shared access policies contains the key and value in the specified object. + + A object containing the key and value to search for. + true if the shared access policies collection contains the specified key/value; otherwise, false. + + + + Copies each key/ value pair in the shared access policies collection to a compatible one-dimensional array, starting at the specified index of the target array. + + The one-dimensional array of objects that is the destination of the elements copied from the shared access policies collection. + The zero-based index in at which copying begins. + + + + Removes the value, specified in the object, from the shared access policies collection. + + The object, containing a key and value, to remove from the shared access policies collection. + true if the item was successfully removed; otherwise, false. + + + + Returns an enumerator that iterates through the collection of shared access policies. + + An of type . + + + + Returns an enumerator that iterates through the collection of shared access policies. + + An object that can be used to iterate through the collection of shared access policies. + + + + Gets a collection containing the keys in the shared access policies collection. + + A collection containing the keys in the of shared access policies collection. + + + + Gets a collection containing the values in the shared access policies collection. + + A collection of items in the shared access policies collection. + + + + Gets or sets the item associated with the specified key. + + The key of the value to get or set. + The item associated with the specified key, or null if key is not in the shared access policies collection. + + + + Gets the number of key/ value pairs contained in the shared access policies collection. + + The number of key/ value pairs contained in the shared access policies collection. + + + + Gets a value indicating whether the collection of shared access policies is read-only. + + true if the collection of shared access policies is read-only; otherwise, false. + + + + Represents a shared access policy for a queue, which specifies the start time, expiry time, + and permissions for a shared access signature. + + + + + Initializes a new instance of the SharedAccessQueuePolicy class. + + + + + Converts the permissions specified for the shared access policy to a string. + + The shared access permissions. + The shared access permissions in string format. + + + + Constructs a object from a permissions string. + + The shared access permissions in string format. + A set of shared access permissions. + + + + Gets or sets the start time for a shared access signature associated with this shared access policy. + + The shared access start time. + + + + Gets or sets the expiry time for a shared access signature associated with this shared access policy. + + The shared access expiry time. + + + + Gets or sets the permissions for a shared access signature associated with this shared access policy. + + The permissions. + + + + Provides methods for parsing the response from an operation to get messages from a queue. + + + + + Initializes a new instance of the class. + + The stream of messages to parse. + + + + Parses the XML response returned by an operation to get messages from a queue. + + An enumerable collection of objects. + + + + Gets an enumerable collection of objects from the response. + + An enumerable collection of objects. + + + + Provides methods for parsing the response from a queue listing operation. + + + + + Stores the container prefix. + + + + + Signals when the container prefix can be consumed. + + + + + Stores the marker. + + + + + Signals when the marker can be consumed. + + + + + Stores the max results. + + + + + Signals when the max results can be consumed. + + + + + Stores the next marker. + + + + + Signals when the next marker can be consumed. + + + + + Initializes a new instance of the class. + + The stream to be parsed. + + + + Parses the response XML for a container listing operation. + + An enumerable collection of objects. + + + + Gets the listing context from the XML response. + + A set of parameters for the listing operation. + + + + Gets an enumerable collection of objects from the response. + + An enumerable collection of objects. + + + + Gets the Prefix value provided for the listing operation from the XML response. + + The Prefix value. + + + + Gets the Marker value provided for the listing operation from the XML response. + + The Marker value. + + + + Gets the MaxResults value provided for the listing operation from the XML response. + + The MaxResults value. + + + + Gets the NextMarker value from the XML response, if the listing was not complete. + + The NextMarker value. + + + + Parses the response XML from an operation to set the access policy for a queue. + + + + + Initializes a new instance of the QueueAccessPolicyResponse class. + + The stream to be parsed. + + + + Parses the current element. + + The shared access policy element to parse. + The shared access policy. + + + + Gets an XML representation of an object. + + + An that describes the XML representation of the object that is produced by the method and consumed by the method. + + + + + Generates a serializable continuation token from its XML representation. + + The stream from which the continuation token is deserialized. + + + + Converts a serializable continuation token into its XML representation. + + The stream to which the continuation token is serialized. + + + + Gets or sets the NextMarker for continuing results for CloudQueeu enumeration operations. + + The next marker. + + + + Represents a queue item returned in the XML response for a queue listing operation. + + + + + Initializes a new instance of the class. + + + + + Gets the user-defined metadata for the queue. + + The queue's metadata, as a collection of name-value pairs. + + + + Gets the name of the queue. + + The queue's name. + + + + Gets the queue's URI. + + The absolute URI to the queue. + + + + Provides error code strings that are specific to the Queue service. + + + + + Error code that may be returned when the specified queue was not found. + + + + + Error code that may be returned when the specified queue is disabled. + + + + + Error code that may be returned when the specified queue already exists. + + + + + Error code that may be returned when the specified queue is not empty. + + + + + Error code that may be returned when the specified queue is being deleted. + + + + + Error code that may be returned when the specified pop receipt does not match. + + + + + Error code that may be returned when one or more request parameters are invalid. + + + + + Error code that may be returned when the specified message was not found. + + + + + Error code that may be returned when the specified message is too large. + + + + + Error code that may be returned when the specified marker is invalid. + + + + + Provides a set of parameters for a queue listing operation. + + + + + Initializes a new instance of the class. + + The queue prefix. + The maximum number of results to return. + The include parameter. + + + + Gets or sets the details for the listing operation, which indicates the types of data to include in the + response. + + The details to include in the listing operation. + + + + Specifies which details to include when listing the queues in this storage account. + + + + + No additional details. + + + + + Retrieve queue metadata. + + + + + Retrieve all available details. + + + + + Represents a message retrieved from a queue. + + + + + Initializes a new instance of the class. + + + + + Gets the message expiration time. + + The message expiration time. + + + + Gets the message ID. + + The message ID. + + + + Gets the time the message was added to the queue. + + The message insertion time. + + + + Gets the time the message is next visible. + + The time the message is next visible. + + + + Gets the pop receipt for the message. + + The message's pop receipt. + + + + Gets the text of the message. + + The message text. + + + + Gets the number of times this message has been dequeued. + + The dequeue count. + + + + Represents the permissions for a queue. + + + + + Initializes a new instance of the class. + + + + + Gets the set of shared access policies for the queue. + + The set of shared access policies for the queue. + + + + Writes a collection of shared access policies to the specified stream in XML format. + + A collection of shared access policies. + An output stream. + + + + Writes a message to the specified stream in XML format. + + The message body. + An output stream. + + + + A type which allows callers direct access to the property map of the entity. This class eliminates the use of reflection for serialization and deserialization. + + + + + An interface required for table entity types. The interface declares getter and setter methods for the mandatory entity properties, and + and methods for serialization and de-serialization of all entity properties using a property dictionary. Create classes implementing to customize property + storage, retrieval, serialization and de-serialization, and to provide additional custom logic for a table entity. + + The Storage client library includes two implementations of that provide for simple property access and serialization: + implements and provides a simple property dictionary to store and retrieve properties. Use a for simple access + to entity properties when only a subset of properties are returned (for example, by a select clause in a query), or for when your query can return multiple entity types + with different properties. You can also use this type to perform bulk table updates of heterogeneous entities without losing property information. + is an implementation of that uses reflection-based serialization and de-serialization behavior in its and methods. + -derived classes with methods that follow a convention for types and naming are serialized and de-serialized automatically. -derived classes must also provide a get-able and set-able public + property of a type that is supported by the Windows Azure Table Service. + + + + Populates the entity's properties from the data values in the dictionary. + + The dictionary of string property names to data values to de-serialize and store in this table entity instance. + An object used to track the execution of the operation. + + + + Serializes the of property names mapped to data values from the entity instance. + + An object used to track the execution of the operation. + A dictionary of property names to data typed values created by serializing this table entity instance. + + + + Gets or sets the entity's partition key. + + The entity's partition key. + + + + Gets or sets the entity's row key. + + The entity's row key. + + + + Gets or sets the entity's time stamp. + + The entity's time stamp. The property is populated by the Windows Azure Table Service. + + + + Gets or sets the entity's current ETag. Set this value to '*' + in order to blindly overwrite an entity as part of an update + operation. + + The entity's time stamp. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified partition key and row key. + + The partition key value for the entity. + The row key value for the entity. + + + + Initializes a new instance of the class with the entity's partition key, row key, ETag (if available/required), and properties. + + The entity's partition key. + The entity's row key. + The entity's current ETag. + The entity's properties, indexed by property name. + + + + Initializes a new instance of the class with the entity's partition key, row key, time stamp, ETag (if available/required), and properties. + + The entity's partition key. + The entity's row key. + The timestamp for this entity as returned by Windows Azure. + The entity's current ETag; set to null to ignore the ETag during subsequent update operations. + An containg a map of property names to data typed values to store in the new . + + + + Deserializes this instance using the specified of property names to data typed values. + + A collection containing the of string property names mapped to data typed values to store in this instance. + An object used to track the execution of the operation. + + + + Serializes the of property names mapped to data values from this instance. + + An object used to track the execution of the operation. + A collection containing the map of string property names to data typed values stored in this instance. + + + + Gets or sets the properties in the table entity, indexed by property name. + + The entity properties. + + + + Gets or sets the entity's partition key. + + The entity partition key. + + + + Gets or sets the entity's row key. + + The entity row key. + + + + Gets or sets the entity's time stamp. + + The entity time stamp. + + + + Gets or sets the entity's current ETag. Set this value to '*' in order to blindly overwrite an entity as part of an update operation. + + The entity Etag. + + + + Gets or sets the entity's property, given the name of the property. + + The name of the property. + The property. + + + + Enumeration containing the types of values that can be stored in + a table entity property. + + + + + Represents fixed- or variable-length character data. + + + + + Represents fixed- or variable-length binary data. + + + + + Represents the mathematical concept of binary-valued logic. + + + + + Represents date and time. + + + + + Represents a floating point number with 15 digits precision that can represent values with approximate range of +/- 2.23e -308 through +/- 1.79e +308. + + + + + Represents a 16-byte (128-bit) unique identifier value. + + + + + Represents a signed 32-bit integer value. + + + + + Represents a signed 64-bit integer value. + + + + + Class for storing information about a single property in an Azure + Table entity. + + + + + Creates a new object that represents the specified offset value. + + The value for the new . + A new of the offset type. + + + + Creates a new object that represents the specified byte array. + + The value for the new . + A new of the byte array. + + + + Creates a new object that represents the specified value. + + The value for the new . + A new of the type. + + + + Creates a new object that represents the specified value. + + The value for the new . + A new of the type. + + + + Creates a new object that represents the specified value. + + The value for the new . + A new of the type. + + + + Creates a new object that represents the specified value. + + The value for the new . + A new of the type. + + + + Creates a new object that represents the specified value. + + The value for the new . + A new of the type. + + + + Creates a new object that represents the specified value. + + The value for the new . + A new of the type. + + + + Initializes a new instance of the class by using the + byte array value of the property. + + The value for the new . + + + + Initializes a new instance of the class by using the + value of the property. + + The value for the new . + + + + Initializes a new instance of the class by using the + offset value of the property. + + The value for the new . + + + + Initializes a new instance of the class by using the + value of the property. + + The value for the new . + + + + Initializes a new instance of the class by using the + value of the property. + + The value for the new . + + + + Initializes a new instance of the class by using the + value of the property. + + The value for the new . + + + + Initializes a new instance of the class by using the + value of the property. + + The value for the new . + + + + Initializes a new instance of the class by using the + value of the property. + + The value for the new . + + + + Initializes a new instance of the class by using the + value of the property. + + The value for the new . + + + + Initializes a new instance of the EntityProperty class given the + EdmType of the property (the value must be set by a public + constructor). + + + + + Compares the given object (which is probably an ) + for equality with this object. + + The other object. + true if the objects are equivalent; false otherwise. + + + + Gets the hash code for this entity property. + + The hash code for the entity property. + + + + Ensures that the given type matches the type of this entity + property; throws an exception if the types do not match. + + + + + Gets the of this object. + + The of this object. + + + + Gets or sets the byte array value of this object. + An exception will be thrown if you attempt to set this property to anything other than an byte array. + + The byte array value of this object. + + + + Gets or sets the value of this object. + An exception will be thrown if you attempt to set this property to anything other than an Object. + + The value of this object. + + + + Gets or sets the offset value of this object. + An exception will be thrown if you attempt to set this property to anything other than a object. + + The offset value of this object. + + + + Gets or sets the value of this object. + An exception will be thrown if you attempt to set this property to anything other than a object. + + The value of this object. + + + + Gets or sets the value of this object. + An exception will be thrown if you attempt to set this property to anything other than a object. + + The value of this object. + + + + Gets or sets the value of this object. + An exception will be thrown if you attempt to set this property to anything other than an Object. + + The value of this object. + + + + Gets or sets the value of this object. + An exception will be thrown if you attempt to set this property to anything other than an Object. + + The value of this object. + + + + Gets or sets the value of this object. + An exception will be thrown if you attempt to set this property to anything other than a object. + + The value of this object. + + + + Represents a segment of results and contains continuation token information. + + + + + Initializes a new instance of the class. + + The result. + + + + Stores the continuation token used to retrieve the next segment of results. + + + + + Returns an enumerator that iterates through the segment of results. + + An enumerator that iterates through the segment of results. + + + + Gets an enumerable collection of results. + + An enumerable collection of results. + + + + Gets a continuation token to use to retrieve the next set of results with a subsequent call to the operation. + + The continuation token. + + + + Specifies the set of possible permissions for a shared access table policy. + + + + + No shared access granted. + + + + + Permission to query entities granted. + + + + + Permission to add entities granted. + + + + + Permission to modify entities granted. + + + + + Permission to delete entities granted. + + + + + Represents the collection of shared access policies defined for a table. + + + + + Adds the specified key and value to the collection of shared access policies. + + The key of the value to add. + The value to add to the collection of shared access policies. + + + + Determines whether the collection of shared access policies contains the specified key. + + The key to locate in the collection of shared access policies. + true if the collection of shared access policies contains an element with the specified key; otherwise, false. + + + + Removes the value with the specified key from the shared access policies collection. + + The key of the item to remove. + true if the element is successfully found and removed; otherwise, false. This method returns false if the key is not found. + + + + Gets the item associated with the specified key. + + The key of the value to get. + The item to get. + The item associated with the specified key, if the key is found; otherwise, the default value for the type. + + + + Adds the specified key/ value, stored in a , to the collection of shared access policies. + + The object, containing a key/ value pair, to add to the shared access policies collection. + + + + Removes all keys and values from the shared access collection. + + + + + Determines whether the collection of shared access policies contains the key and value in the specified object. + + A object containing the key and value to search for. + true if the shared access policies collection contains the specified key/value; otherwise, false. + + + + Copies each key/ value pair in the shared access policies collection to a compatible one-dimensional array, starting at the specified index of the target array. + + The one-dimensional array of objects that is the destination of the elements copied from the shared access policies collection. + The zero-based index in at which copying begins. + + + + Removes the value, specified in the object, from the shared access policies collection. + + The object, containing a key and value, to remove from the shared access policies collection. + true if the item was successfully removed; otherwise, false. + + + + Returns an enumerator that iterates through the collection of shared access policies. + + An of type . + + + + Returns an enumerator that iterates through the collection of shared access policies. + + An object that can be used to iterate through the collection of shared access policies. + + + + Gets a collection containing the keys in the shared access policies collection. + + A collection containing the keys in the of shared access policies collection. + + + + Gets a collection containing the values in the shared access policies collection. + + A collection of items in the shared access policies collection. + + + + Gets or sets the item associated with the specified key. + + The key of the value to get or set. + The item associated with the specified key, or null if key is not in the shared access policies collection. + + + + Gets the number of key/ value pairs contained in the shared access policies collection. + + The number of key/ value pairs contained in the shared access policies collection. + + + + Gets a value indicating whether the collection of shared access policies is read-only. + + true if the collection of shared access policies is read-only; otherwise, false. + + + + Represents a shared access policy, which specifies the start time, expiry time, + and permissions for a shared access signature. + + + + + Initializes a new instance of the SharedAccessTablePolicy class. + + + + + Converts the permissions specified for the shared access policy to a string. + + The shared access permissions. + The shared access permissions in string format. + + + + Constructs a object from a permissions string. + + The shared access permissions in string format. + A set of shared access permissions. + + + + Gets or sets the start time for a shared access signature associated with this shared access policy. + + The shared access start time. + + + + Gets or sets the expiry time for a shared access signature associated with this shared access policy. + + The shared access expiry time. + + + + Gets or sets the permissions for a shared access signature associated with this shared access policy. + + The permissions. + + + + Gets an XML representation of an object. + + + An that describes the XML representation of the object that is produced by the method and consumed by the method. + + + + + Generates a serializable continuation token from its XML representation. + + The stream from which the continuation token is deserialized. + + + + Converts a serializable continuation token into its XML representation. + + The stream to which the continuation token is serialized. + + + + Gets or sets the next partition key for enumeration operations. + + The next partition key. + + + + Gets or sets the next row key for enumeration operations. + + The next row key. + + + + Gets or sets the next table name for enumeration operations. + + The name of the next table. + + + + Represents the base object type for a table entity in the Table Storage service. + + provides a base implementation for the interface that provides and methods that by default serialize and + de-serialize all properties via reflection. A table entity class may extend this class and override the and methods to provide customized or better performing serialization logic. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified partition key and row key. + + The partition key of the to be initialized. + The row key of the to be initialized. + + + + De-serializes this instance using the specified of property names to data typed values. + + The map of string property names to data values to de-serialize and store in this table entity instance. + An object used to track the execution of the operation. + + + + Serializes the of property names mapped to data values from this instance. + + An object used to track the execution of the operation. + A map of property names to data typed values created by serializing this table entity instance. + + + + Gets or sets the entity's partition key. + + The partition key of the entity. + + + + Gets or sets the entity's row key. + + The row key of the entity. + + + + Gets or sets the entity's timestamp. + + The timestamp of the entity. + + + + Gets or sets the entity's current ETag. Set this value to '*' in order to blindly overwrite an entity as part of an update operation. + + The ETag of the entity. + + + + Enumeration containing the types of operations that can be + performed by a . + + + + + Represents the permissions for a table. + + + + + Initializes a new instance of the TablePermissions class. + + + + + Gets the set of shared access policies for the container. + + The set of shared access policies for the container. + + + + Represents a segment of results and contains continuation token information. + + The type of the result that the segment contains. + + + + Stores the continuation token used to retrieve the next segment of results. + + + + + Initializes a new instance of the class. + + The result. + + + + Returns an enumerator that iterates through the . + + An enumerator that iterates through the . + + + + Gets an enumerable collection of results. + + An enumerable collection of results. + + + + Gets a continuation token to use to retrieve the next set of results with a subsequent call to the operation. + + The continuation token. + + + + Represents a set of timeout and retry policy options that may be specified for a table operation request. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified . + + The request options used to initialize this instance of the class. + + + + Gets or sets the retry policy for the request. + + The retry policy delegate. + + + + Gets or sets the server timeout for the request. + + The client and server timeout interval for the request. + + + + Gets or sets the maximum execution time for all potential retries. + + A representing the maximum execution time for retries. + + + + Represents the result of a table operation. + + The class encapsulates the HTTP response and any table entity results returned by the Storage Service REST API operation called for a particular . + + + + Gets or sets the result returned by the as an . + + The result of the table operation as an . + + + + Gets or sets the HTTP status code returned by a request. + + The HTTP status code returned by a request. + + + + Gets or sets the Etag returned with the request results. + + The Etag returned with the request results. + + + + Parses the response XML from an operation to set the access policy for a table. + + + + + Initializes a new instance of the TableAccessPolicyResponse class. + + The stream to be parsed. + + + + Parses the current element. + + The shared access policy element to parse. + The shared access policy. + + + + Stores the header prefix for continuation information. + + + + + Stores the header suffix for the next partition key. + + + + + Stores the header suffix for the next row key. + + + + + Stores the table suffix for the next table name. + + + + + Stores the maximum results the table service can return. + + + + + The maximum size of a string property for the table service in bytes. + + + + + The maximum size of a string property for the table service in bytes. + + + + + The maximum size of a string property for the table service in chars. + + + + + The name of the special table used to store tables. + + + + + XML element for table error codes. + + + + + XML element for table error messages. + + + + + The name of the partition key property. + + + + + The name of the row key property. + + + + + The name of the Timestamp property. + + + + + The name of the special table used to store tables. + + + + + The name of the property that stores the table name. + + + + + The query filter clause name. + + + + + The query top clause name. + + + + + The query select clause name. + + + + + The minimum DateTime supported. + + + + + Provides error code strings that are specific to the Windows Azure Table service. + + + + + The request uses X-HTTP-Method with an HTTP verb other than POST. + + + + + The specified X-HTTP-Method is invalid. + + + + + More than one X-HTTP-Method is specified. + + + + + The specified table has no properties. + + + + + A property is specified more than once. + + + + + The specified table has no such property. + + + + + A duplicate key property was specified. + + + + + The specified table already exists. + + + + + The specified table was not found. + + + + + The specified entity was not found. + + + + + The specified entity already exists. + + + + + The partition key was not specified. + + + + + One or more specified operators are invalid. + + + + + The specified update condition was not satsified. + + + + + All properties must have values. + + + + + The partition key property cannot be updated. + + + + + The entity contains more properties than allowed. + + + + + The entity is larger than the maximum size permitted. + + + + + The property value is larger than the maximum size permitted. + + + + + One or more value types are invalid. + + + + + The specified table is being deleted. + + + + + The Table service server is out of memory. + + + + + The type of the primary key property is invalid. + + + + + The property name exceeds the maximum allowed length. + + + + + The property name is invalid. + + + + + Batch operations are not supported for this operation type. + + + + + JSON format is not supported. + + + + + The specified method is not allowed. + + + + + The specified operation is not yet implemented. + + + + + Writes a collection of shared access policies to the specified stream in XML format. + + A collection of shared access policies. + An output stream. + + + + Converts a string to UTC time. + + The string to convert. + A UTC representation of the string. + + + + Contains storage constants. + + + + + Maximum number of shared access policy identifiers supported by server. + + + + + Default Write Block Size used by Blob stream. + + + + + The maximum size of a blob before it must be separated into blocks. + + + + + The maximum size of a single block. + + + + + The maximum number of blocks. + + + + + The maximum size of a blob with blocks. + + + + + Default size of buffer for unknown sized requests. + + + + + The size of a page in a PageBlob. + + + + + A constant representing a kilo-byte (Non-SI version). + + + + + A constant representing a megabyte (Non-SI version). + + + + + A constant representing a megabyte (Non-SI version). + + + + + XML element for committed blocks. + + + + + XML element for uncommitted blocks. + + + + + XML element for blocks. + + + + + XML element for names. + + + + + XML element for sizes. + + + + + XML element for block lists. + + + + + XML element for queue message lists. + + + + + XML element for queue messages. + + + + + XML element for message IDs. + + + + + XML element for insertion times. + + + + + XML element for expiration times. + + + + + XML element for pop receipts. + + + + + XML element for the time next visible fields. + + + + + XML element for message texts. + + + + + XML element for dequeue counts. + + + + + XML element for page ranges. + + + + + XML element for page list elements. + + + + + XML element for page range start elements. + + + + + XML element for page range end elements. + + + + + XML element for delimiters. + + + + + XML element for blob prefixes. + + + + + XML element for content type fields. + + + + + XML element for content type fields. + + + + + XML element for content encoding fields. + + + + + XML element for content language fields. + + + + + XML element for content length fields. + + + + + XML element for content MD5 fields. + + + + + XML element for enumeration results. + + + + + XML element for blobs. + + + + + XML element for prefixes. + + + + + XML element for maximum results. + + + + + XML element for markers. + + + + + XML element for the next marker. + + + + + XML element for the ETag. + + + + + XML element for the last modified date. + + + + + XML element for the Url. + + + + + XML element for blobs. + + + + + XML element for copy ID. + + + + + XML element for copy status. + + + + + XML element for copy source. + + + + + XML element for copy progress. + + + + + XML element for copy completion time. + + + + + XML element for copy status description. + + + + + Constant signaling a page blob. + + + + + Constant signaling a block blob. + + + + + Constant signaling the blob is locked. + + + + + Constant signaling the blob is unlocked. + + + + + Constant signaling the resource is available for leasing. + + + + + Constant signaling the resource is leased. + + + + + Constant signaling the resource's lease has expired. + + + + + Constant signaling the resource's lease is breaking. + + + + + Constant signaling the resource's lease is broken. + + + + + Constant signaling the resource's lease is infinite. + + + + + Constant signaling the resource's lease is fixed (finite). + + + + + Constant for a pending copy. + + + + + Constant for a successful copy. + + + + + Constant for an aborted copy. + + + + + Constant for a failed copy. + + + + + XML element for blob types. + + + + + XML element for the lease status. + + + + + XML element for the lease status. + + + + + XML element for the lease status. + + + + + XML element for snapshots. + + + + + XML element for containers. + + + + + XML element for a container. + + + + + XML element for queues. + + + + + XML element for the queue name. + + + + + Version 2 of the XML element for the queue name. + + + + + XML element for the queue. + + + + + XML element for properties. + + + + + XML element for the metadata. + + + + + XML element for an invalid metadata name. + + + + + XPath query for error codes. + + + + + XPath query for error messages. + + + + + XML element for maximum results. + + + + + XML element for committed blocks. + + + + + XML element for uncommitted blocks. + + + + + XML element for the latest. + + + + + XML element for signed identifiers. + + + + + XML element for a signed identifier. + + + + + XML element for access policies. + + + + + XML attribute for IDs. + + + + + XML element for the start time of an access policy. + + + + + XML element for the end of an access policy. + + + + + XML element for the permissions of an access policy. + + + + + The Uri path component to access the messages in a queue. + + + + + XML root element for errors. + + + + + XML element for error codes. + + + + + XML element for error messages. + + + + + XML element for exception details. + + + + + XML element for exception messages. + + + + + XML element for stack traces. + + + + + XML element for the authentication error details. + + + + + XML namespace for the WCF Data Services metadata. + + + + + Default client side timeout for all service clients. + + + + + Default server side timeout for all service clients. + + + + + Maximum Retry Policy Backoff + + + + + Maximum allowed timeout for any request. + + + + + Constants for HTTP headers. + + + + + Specifies the value to use for UserAgent header. + + + + + Specifies the value to use for UserAgent header. + + + + + Specifies the value to use for UserAgent header. + + + + + Master Windows Azure Storage header prefix. + + + + + Header prefix for properties. + + + + + Header prefix for metadata. + + + + + Header for data ranges. + + + + + Header for range content MD5. + + + + + Header for storage version. + + + + + Header for copy source. + + + + + Header for the If-Match condition. + + + + + Header for the If-Modified-Since condition. + + + + + Header for the If-None-Match condition. + + + + + Header for the If-Unmodified-Since condition. + + + + + Header for the blob content length. + + + + + Header for the blob type. + + + + + Header for snapshots. + + + + + Header to delete snapshots. + + + + + Header that specifies approximate message count of a queue. + + + + + Header that specifies blob caching control. + + + + + Header that specifies blob content encoding. + + + + + Header that specifies blob content language. + + + + + Header that specifies blob content MD5. + + + + + Header that specifies blob content type. + + + + + Header that specifies blob content length. + + + + + Header that specifies lease ID. + + + + + Header that specifies lease status. + + + + + Header that specifies lease status. + + + + + Header that specifies page write mode. + + + + + Header that specifies the date. + + + + + Header indicating the request ID. + + + + + Header indicating the client request ID. + + + + + Header that specifies public access to blobs. + + + + + Format string for specifying ranges. + + + + + Current storage version header value. + Every time this version changes, assembly version needs to be updated as well. + + + + + Specifies the page blob type. + + + + + Specifies the block blob type. + + + + + Specifies only snapshots are to be included. + + + + + Specifies snapshots are to be included. + + + + + Header that specifies the pop receipt for a message. + + + + + Header that specifies the next visible time for a message. + + + + + Header that specifies the lease action to perform. + + + + + Header that specifies the proposed lease ID for a leasing operation. + + + + + Header that specifies the duration of a lease. + + + + + Header that specifies the break period of a lease. + + + + + Header that specifies the remaining lease time. + + + + + Header that specifies the key name for explicit keys. + + + + + Header that specifies the copy ID. + + + + + Header that specifies the copy last modified time. + + + + + Header that specifies the copy status. + + + + + Header that specifies the copy progress. + + + + + Header that specifies a copy error message. + + + + + Header that specifies the copy action. + + + + + The value of the copy action header that signifies an abort operation. + + + + + Constants for query strings. + + + + + Query component for snapshot time. + + + + + Query component for the signed SAS start time. + + + + + Query component for the signed SAS expiry time. + + + + + Query component for the signed SAS resource. + + + + + Query component for the SAS table name. + + + + + Query component for the signed SAS permissions. + + + + + Query component for the SAS start partition key. + + + + + Query component for the SAS start row key. + + + + + Query component for the SAS end partition key. + + + + + Query component for the SAS end row key. + + + + + Query component for the signed SAS identifier. + + + + + Query component for the signing SAS key. + + + + + Query component for the signed SAS version. + + + + + Query component for SAS signature. + + + + + Query component for message time-to-live. + + + + + Query component for message visibility timeout. + + + + + Query component for the number of messages. + + + + + Query component for message pop receipt. + + + + + Query component for resource type. + + + + + Query component for the operation (component) to access. + + + + + Query component for the copy ID. + + + + + Constants for Result Continuations + + + + + Top Element for Continuation Tokens + + + + + XML element for the next marker. + + + + + XML element for the next partition key. + + + + + XML element for the next row key. + + + + + XML element for the next table name. + + + + + XML element for the token version. + + + + + Stores the current token version value. + + + + + XML element for the token type. + + + + + Enumeration representing the state of logging in a service. + + + + + Logging is disabled. + + + + + Log read operations. + + + + + Log write operations. + + + + + Log delete operations. + + + + + Log all operations. + + + + + Class representing the service properties pertaining to logging. + + + + + Gets or sets the version of the analytics service. + + A string identifying the version of the service. + + + + Gets or sets the state of logging. + + A combination of flags describing the operations that are logged. + + + + Gets or sets the logging retention policy. + + The number of days to retain the logs. + + + + Enumeration representing the state of metrics collection in a service. + + + + + Metrics collection is disabled. + + + + + Service-level metrics collection is enabled. + + + + + Service-level and API metrics collection are enabled. + + + + + Class representing the service properties pertaining to metrics. + + + + + Gets or sets the version of the analytics service. + + A string identifying the version of the service. + + + + Gets or sets the state of metrics collection. + + A value indicating which metrics to collect, if any. + + + + Gets or sets the logging retention policy. + + The number of days to retain the logs. + + + + Writes a collection of shared access policies to the specified stream in XML format. + + A collection of shared access policies. + An output stream. + A delegate that writes a policy to an XML writer. + The type of policy to write. + + + + Gets the request id. + + The response from server. + The request ID. + + + + Reads a collection of shared access policies from the specified object. + + A collection of shared access policies to be filled. + A policy response object for reading the stream. + The type of policy to read. + + + + Parses the metadata. + + The reader. + A of metadata. + + Precondition: reader at <Metadata> + Postcondition: reader after </Metadata> (<Metadata/> consumed) + + + + + Class representing a set of properties pertaining to a cloud storage service. + + + + + The name of the root XML element. + + + + + The name of the logging XML element. + + + + + The name of the metrics XML element. + + + + + The name of the version XML element. + + + + + The name of the delete operation XML element. + + + + + The name of the read operation XML element. + + + + + The name of the write operation XML element. + + + + + The name of the retention policy XML element. + + + + + The name of the enabled XML element. + + + + + The name of the days XML element. + + + + + The name of the include APIs XML element. + + + + + The name of the default service version XML element. + + + + + Initializes a new instance of the ServiceProperties class. + + + + + Constructs a ServiceProperties object from an XML document received from the service. + + The XML document. + A ServiceProperties object containing the properties in the XML document. + + + + Converts these properties into XML for communicating with the service. + + An XML document containing the service properties. + + + + Generates XML representing the given retention policy. + + The number of days to retain, or null if the policy is disabled. + An XML retention policy element. + + + + Generates XML representing the given metrics properties. + + The metrics properties. + An XML metrics element. + + + + Generates XML representing the given logging properties. + + The logging properties. + An XML logging element. + + + + Constructs a LoggingProperties object from an XML element. + + The XML element. + A LoggingProperties object containing the properties in the element. + + + + Constructs a MetricsProperties object from an XML element. + + The XML element. + A MetricsProperties object containing the properties in the element. + + + + Constructs a retention policy (number of days) from an XML element. + + The XML element. + The number of days to retain, or null if retention is disabled. + + + + Writes service properties to a stream, formatted in XML. + + The stream to which the formatted properties are to be written. + + + + Gets or sets the logging properties. + + The logging properties. + + + + Gets or sets the metrics properties. + + The metrics properties. + + + + Gets or sets the default service version. + + The default service version identifier. + + + + Provides error code strings that are common to all storage services. + + + + + The specified HTTP verb is not supported. + + + + + The Content-Length header is required for this request. + + + + + A required header was missing. + + + + + A required XML node was missing. + + + + + One or more header values are not supported. + + + + + One or more XML nodes are not supported. + + + + + One or more header values are invalid. + + + + + One or more XML node values are invalid. + + + + + A required query parameter is missing. + + + + + One or more query parameters is not supported. + + + + + One or more query parameters are invalid. + + + + + One or more query parameters are out of range. + + + + + The URI is invalid. + + + + + The HTTP verb is invalid. + + + + + The metadata key is empty. + + + + + The request body is too large. + + + + + The specified XML document is invalid. + + + + + An internal error occurred. + + + + + Authentication failed. + + + + + The specified MD5 hash does not match the server value. + + + + + The specified MD5 hash is invalid. + + + + + The input is out of range. + + + + + The input is invalid. + + + + + The operation timed out. + + + + + The specified resource was not found. + + + + + The specified metadata is invalid. + + + + + The specified metadata is too large. + + + + + The specified condition was not met. + + + + + The specified range is invalid. + + + + + The specified container was not found. + + + + + The specified container already exists. + + + + + The specified container is disabled. + + + + + The specified container is being deleted. + + + + + The server is busy. + + + + diff --git a/lib/Azure/Microsoft.WindowsAzure.StorageClient.dll b/lib/Azure/Microsoft.WindowsAzure.StorageClient.dll index a2760d4aaf4..80e2ce08908 100644 Binary files a/lib/Azure/Microsoft.WindowsAzure.StorageClient.dll and b/lib/Azure/Microsoft.WindowsAzure.StorageClient.dll differ diff --git a/lib/Azure/Microsoft.WindowsAzure.StorageClient.xml b/lib/Azure/Microsoft.WindowsAzure.StorageClient.xml index a6e42c00304..a2d6887159d 100644 --- a/lib/Azure/Microsoft.WindowsAzure.StorageClient.xml +++ b/lib/Azure/Microsoft.WindowsAzure.StorageClient.xml @@ -1,13895 +1,13895 @@ - - - - Microsoft.WindowsAzure.StorageClient - - - - - Represents a Windows Azure storage account. - - - - - The setting name for using the development storage. - - - - - The setting name for specifying a development storage proxy Uri. - - - - - The setting name for using the default storage endpoints with the specified protocol. - - - - - The setting name for the account name. - - - - - The setting name for the account key. - - - - - The setting name for a custom blob storage endpoint. - - - - - The setting name for a custom queue endpoint. - - - - - The setting name for a custom table storage endpoint. - - - - - The setting name for a shared access key. - - - - - The default account name for the development storage. - - - - - The default account key for the development storage. - - - - - The credentials string used to test for the development storage credentials. - - - - - The root blob storage DNS name. - - - - - The root queue DNS name. - - - - - The root table storage DNS name. - - - - - Validator for the UseDevelopmentStorage setting. Must be "true". - - - - - Validator for the DevelopmentStorageProxyUri setting. Must be a valid Uri. - - - - - Validator for the DefaultEndpointsProtocol setting. Must be either "http" or "https". - - - - - Validator for the AccountName setting. No restrictions. - - - - - Validator for the AccountKey setting. Must be a valid base64 string. - - - - - Validator for the BlobEndpoint setting. Must be a valid Uri. - - - - - Validator for the QueueEndpoint setting. Must be a valid Uri. - - - - - Validator for the TableEndpoint setting. Must be a valid Uri. - - - - - Validator for the SharedAccessSignature setting. No restrictions. - - - - - Stores the user-specified configuration setting publisher. - - - - - Singleton instance for the development storage account. - - - - - Initializes a new instance of the class using the specified - account credentials and service endpoints. - - The account credentials. - The Blob service endpoint. - The Queue service endpoint. - The Table service endpoint. - - - - Initializes a new instance of the class using the specified - account credentials and the default service endpoints. - - An object of type that - specifies the account name and account key for the storage account. - True to use HTTPS to connect to storage service endpoints; otherwise, false. - - - - Parses a connection string and returns a created - from the connection string. - - A valid connection string. - Thrown if is null or empty. - Thrown if is not a valid connection string. - Thrown if cannot be parsed. - A object constructed from the values provided in the connection string. - - - - Create a new instance of a object from a specified configuration - setting. This method may be called only after the - method has been called to configure the global configuration setting publisher. - - The name of the configuration setting. - Thrown if the global configuration setting - publisher has not been configured, or if the configuration setting cannot be found. - A constructed from the values in the configuration string. - - - - Indicates whether a connection string can be parsed to return a object. - - The connection string to parse. - A object to hold the instance returned if - the connection string can be parsed. - true if the connection string was successfully parsed; otherwise, false. - - - - Sets the global configuration setting publisher for the storage account, which will be called when - the account access keys are updated in the service configuration file. - - The configuration setting publisher for the storage account. - - - - Returns a connection string for this storage account, without sensitive data. - - A connection string. - - - - Returns a connection string for the storage account, optionally with sensitive data. - - True to include sensitive data in the string; otherwise, false. - A connection string. - - - - Returns a with development storage credentials using the specified proxy Uri. - - The proxy endpoint to use. - The new . - - - - Internal implementation of Parse/TryParse. - - The string to parse. - The to return. - A callback for reporting errors. - If true, the parse was successful. Otherwise, false. - - - - Tokenizes input and stores name/value pairs in a NameValueCollection. - - The string to parse. - Error reporting delegate. - Tokenized collection. - - - - Encapsulates a validation rule for an enumeration based account setting. - - The name of the setting. - A list of valid values for the setting. - An representing the enumeration constraint. - - - - Encapsulates a validation rule using a func. - - The name of the setting. - A func that determines if the value is valid. - An representing the constraint. - - - - Determines whether the specified setting value is a valid base64 string. - - The setting value. - true if the specified setting value is a valid base64 string; otherwise, false. - - - - Validation function that validates Uris. - - Value to validate. - true if the specified setting value is a valid Uri; otherwise, false. - - - - Settings filter that requires all specified settings be present and valid. - - A list of settings that must be present. - The remaining settings or null if the filter's requirement is not satisfied. - - - - Settings filter that removes optional values. - - A list of settings that are optional. - The remaining settings or null if the filter's requirement is not satisfied. - - - - Settings filter that ensures that at least one setting is present. - - A list of settings of which one must be present. - The remaining settings or null if the filter's requirement is not satisfied. - - - - Settings filter that ensures that a valid combination of credentials is present. - - The remaining settings or null if the filter's requirement is not satisfied. - - - - Tests to see if a given list of settings matches a set of filters exactly. - - The settings to check. - A list of filters to check. - - If any filter returns null, false. - If there are any settings left over after all filters are processed, false. - Otherwise true. - - - - - Gets a StorageCredentials object corresponding to whatever credentials are supplied in the given settings. - - The settings to check. - The StorageCredentials object specified in the settings. - - - - Gets the default blob endpoint using specified settings. - - The settings to use. - The default blob endpoint. - - - - Gets the default blob endpoint using the specified protocol and account name. - - The protocol to use. - The name of the storage account. - The default blob endpoint. - - - - Gets the default queue endpoint using the specified settings. - - The settings. - The default queue endpoint. - - - - Gets the default queue endpoint using the specified protocol and account name. - - The protocol to use. - The name of the storage account. - The default queue endpoint. - - - - Gets the default table endpoint using the specified settings. - - The settings. - The default table endpoint. - - - - Gets the default table endpoint using the specified protocol and account name. - - The protocol to use. - The name of the storage account. - The default table endpoint. - - - - Gets a object that references the development storage account. - - A reference to the development storage account. - - - - Gets the endpoint for the Blob service, as configured for the storage account. - - The Blob service endpoint. - - - - Gets the endpoint for the Queue service, as configured for the storage account. - - The Queue service endpoint. - - - - Gets the endpoint for the Table service, as configured for the storage account. - - The Table service endpoint. - - - - Gets the credentials used to create this object. - - The credentials used to create the object. - - - - Encapsulates a mutable storage credentials object. - - - - - Stores the mutable storage credentials. - - - - - Initializes a new instance of the class. - - Name of the configuration setting. - - - - Sets the configuration value. - - The value. - true if the value was set; otherwise, false. - - - - Gets or sets the name of the configuration setting from which we retrieve storage account information. - - - - - Gets or sets the cloud storage account. - - The cloud storage account. - - - - Represents a object that is mutable to support key rotation. - - - - - Represents a set of credentials used to authenticate access to a Windows Azure storage account. - - - - - Transforms a resource URI into a shared access signature URI, by appending a - shared access token. - - The resource URI to be transformed. - The URI for a shared access signature, including the resource URI and the shared access token. - - - - Signs a request using the specified credentials under the Shared Key authentication scheme. - - The web request to be signed. - - - - Signs a request using the specified credentials under the Shared Key Lite authentication scheme. - - The web request to be signed. - - - - Encodes a Shared Key or Shared Key Lite signature string by using the HMAC-SHA256 algorithm over a UTF-8-encoded string-to-sign. - - A UTF-8-encoded string-to-sign. - An HMAC-encoded signature string. - - - - Performs the computation of the signature based on the private key. - - The string to be signed. - The signature for the string. - Need for D-SAS not public. - - - - Returns a that represents this instance. - - If set to true exports secrets. - - A that represents this instance. - - - - - Gets the name of the storage account associated with the specified credentials. - - The name of the account. - - - - Gets a value indicating whether the method should be called - to transform a resource URI to a URI that includes a token for a shared access signature. - - True if the URI must be transformed; otherwise, false. - - - - Gets a value indicating whether a request can be signed under the Shared Key authentication - scheme using the specified credentials. - - True if a request can be signed with these credentials; otherwise, false. - - - - Gets a value indicating whether a request can be signed under the Shared Key Lite authentication - scheme using the specified credentials. - - True if a request can be signed with these credentials; otherwise, false. - - - - Gets a value indicating whether the method will return a valid - HMAC-encoded signature string when called using the specified credentials. - - True if these credentials will yield a valid signature string; otherwise, false. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The initial credentials. - - - - Updates the object with new credentials. - - The new credentials. - - - - Computes the HMAC signature of the specified string. - - The string to sign. - The computed signature. - - - - Signs a request using the specified credentials under the Shared Key authentication scheme. - - The request to be signed. - - - - Signs a request using the specified credentials under the Shared Key Lite authentication scheme. - - The request to be signed. - - - - Transforms the Uri. - - The resource Uri. - The transformed Uri. - - - - Computes the 512-bit HMAC signature of the specified string. - - The string to sign. - The computed signature. - - - - Returns a that represents this instance. - - If set to true the string exposes key information. - - A that represents this instance. - - - - - Gets the name of the storage account associated with the specified credentials. - - The account name. - - - - Gets a value indicating whether the method will return a valid - HMAC-encoded signature string when called with the specified credentials. - - - Returns true if these credentials will yield a valid signature string; otherwise, false. - - - - - Gets a value indicating whether a request can be signed under the Shared Key authentication - scheme using the specified credentials. - - - Returns true if a request can be signed with these credentials; otherwise, false. - - - - - Gets a value indicating whether a request can be signed under the Shared Key Lite authentication - scheme using the specified credentials. - - - Returns true if a request can be signed with these credentials; otherwise, false. - - - - - Gets a value indicating whether the method must be called - before generating a signature string with the specified credentials. - - - Returns true if [needs transform Uri]; otherwise, false. If false, - calling returns the original, unmodified Uri. - - - - - Gets or sets the current object that this instance represents. - - - - - Contains helper methods for implementing shared access signatures. - - - - - Get the signature hash embedded inside the Shared Access Signature. - - The shared access policy to hash. - An optional identifier for the policy. - The canonical resource string, unescaped. - The client whose credentials are to be used for signing. - The signed hash. - - - - Get the complete query builder for creating the Shared Access Signature query. - - The shared access policy to hash. - An optional identifier for the policy. - Either "b" for blobs or "c" for containers. - The signature to use. - The finished query builder. - - - - Converts the specified value to either a string representation or . - - The value to convert. - A string representing the specified value. - - - - Converts the specified value to either a string representation or null. - - The value to convert. - A string representing the specified value. - - - - Escapes and adds the specified name/value pair to the query builder if it is not null. - - The builder to add the value to. - The name of the pair. - The value to be escaped. - - - - Parses the query. - - The query parameters. - The credentials. - - - - 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 The argument must not be empty string.. - - - - - Looks up a localized string similar to The argument is out of range. - - - - - Looks up a localized string similar to The argument '{0}' is larger than maximum of '{1}'. - - - - - Looks up a localized string similar to The argument '{0}' is smaller than minimum of '{1}'. - - - - - Looks up a localized string similar to Cannot attach to a TableStorageDataServiceContext object. These objects already contain the functionality for accessing the table storage service.. - - - - - Looks up a localized string similar to EncodeMessage should be true for binary message.. - - - - - Looks up a localized string similar to "Versions before 2009-09-19 do not support Shared Key Lite for Blob And Queue, current target version '{0}'". - - - - - Looks up a localized string similar to Cannot change size below currently written size. - - - - - Looks up a localized string similar to A stream blob must have a blob size of 0.. - - - - - Looks up a localized string similar to The blob is larger than maximum supported size '{0}'. - - - - - Looks up a localized string similar to BlobType of the blob reference doesn't match BlobType of the blob.. - - - - - Looks up a localized string similar to Data already uploaded. - - - - - Looks up a localized string similar to The block size must be positive value. - - - - - Looks up a localized string similar to Block size can not be larger than '{0}'. - - - - - Looks up a localized string similar to Cannot create Shared Access Signature for snapshots. Perform the operation on the root blob instead.. - - - - - Looks up a localized string similar to Cannot create Shared Access Signature as the credentials does not have account name information. Please check that the credentials used support creating Shared Access Signature.. - - - - - Looks up a localized string similar to Cannot create Shared Access Signature unless the Account Key credentials are used by the BlobServiceClient.. - - - - - Looks up a localized string similar to Cannot perform this operation on a blob representing a snapshot.. - - - - - Looks up a localized string similar to Cannot retry operation using a source stream which does not support seek. To avoid this exception set the RetryPolicy to NoRetry or use a seekable stream.. - - - - - Looks up a localized string similar to Server operation did not finish within user specified timeout '{0}' seconds, check if operation is valid or try increasing the timeout.. - - - - - Looks up a localized string similar to If-Modified-Since and If-Unmodified-Since require a DateTime value.. - - - - - Looks up a localized string similar to If-Match and If-None-Match require an ETag value.. - - - - - Looks up a localized string similar to The conditionals specified for this operation did not match server.. - - - - - Looks up a localized string similar to SetConfigurationSettingPublisher needs to be called before FromConfigurationSetting can be used. - - - - - Looks up a localized string similar to The supplied credentials '{0'} cannot be used to sign request. - - - - - Looks up a localized string similar to The option '{0}' must be 'None' to delete a specific snapshot specified by '{1}'. - - - - - Looks up a localized string similar to Cannot combine incompatible absolute Uris base '{0}' relative '{1}'.When trying to combine 2 absolute Uris, the base uri should be a valid base of the relative Uri.. - - - - - Looks up a localized string similar to Invalid acl public access type returned '{0}'. Expected blob or container.. - - - - - Looks up a localized string similar to The continuation type passed in is unexpected. Please verify that the correct continuation type is passed in. Expected {0}, found {1}. - - - - - Looks up a localized string similar to Invalid query parameters inside Blob address '{0}'.. - - - - - Looks up a localized string similar to Listing snapshots is only supported in flat mode (no delimiter). Consider setting BlobRequestOptions.UseFlatBlobListing property to true.. - - - - - Looks up a localized string similar to Calculated MD5 does not match existing property. - - - - - Looks up a localized string similar to Messages cannot be larger than {0} bytes.. - - - - - Looks up a localized string similar to Cannot find account information inside Uri '{0}'. - - - - - Looks up a localized string similar to Invalid blob address '{0}', missing container information. - - - - - Looks up a localized string similar to Missing mandatory parameters for valid Shared Access Signature. - - - - - Looks up a localized string similar to Canonicalization did not find a non empty x-ms-date header in the WebRequest. Please use a WebRequest with a valid x-ms-date header in RFC 123 format (example request.Headers["x-ms-date"] = DateTime.UtcNow.ToString("R", CultureInfo.InvariantCulture)). - - - - - Looks up a localized string similar to Cannot provide credentials as part of the address and as constructor parameter. Either pass in the address or use a different constructor.. - - - - - Looks up a localized string similar to Multiple different snapshot times provided as part of query '{0}' and as constructor parameter '{1}'.. - - - - - Looks up a localized string similar to EndMoveNextSegment must be called before the Current property can be accessed.. - - - - - Looks up a localized string similar to The segment cursor has no more results.. - - - - - Looks up a localized string similar to This operation is not supported for creating a PageBlob. Use other operations to create a PageBlob.. - - - - - Looks up a localized string similar to Missing account name information inside path style uri. Path style uris should be of the form http://<IPAddressPlusPort>/<accountName>. - - - - - Looks up a localized string similar to Address '{0}' is not an absolute address. Relative addresses are not permitted in here.. - - - - - Looks up a localized string similar to Attempting to seek past the end of the stream. - - - - - Looks up a localized string similar to Attempting to seek before the start of the stream. - - - - - Looks up a localized string similar to Server returned more that MaxResults requested. - - - - - Looks up a localized string similar to Snapshot query parameter is already defined in the blobUri. Either pass in a snapshotTime parameter or use a full URL with a snapshot query parameter.. - - - - - Looks up a localized string similar to '{0}' is not a valid table name.. - - - - - Looks up a localized string similar to The number of blocks is larger than the maximum of '{0}'. - - - - - Looks up a localized string similar to Too many '{0}' shared access policy identifiers provided. Server does not support setting more than '{1}' on a single container.. - - - - - Looks up a localized string similar to The blob type cannot be undefined.. - - - - - Represents a set of access conditions to be used for operations against the storage services. - - - - - Indicates that no access condition is set. - - - - - Returns an access condition such that an operation will be performed only if the resource has been modified since the specified time. - - The last-modified time for the resource, expressed as a UTC value. - A structure specifying the if-modified-since condition. - - - - Returns an access condition such that an operation will be performed only if the resource has not been modified since the specified time. - - The last-modified time for the resource, expressed as a UTC value. - A structure specifying the if-not-modified-since condition. - - - - Returns an access condition such that an operation will be performed only if the resource's ETag value matches the ETag value provided. - - The quoted ETag value to check. - A structure specifying the if-match condition. - - - - Returns an access condition such that an operation will be performed only if the resource's ETag value does not match the ETag value provided. - - The quoted ETag value to check. - A structure specifying the if-none-match condition. - - - - Converts AccessCondition into a type for use as a source conditional to Copy. - - The original condition. - The resulting header for the condition. - The value for the condition. - - - - Applies the condition to the web request. - - The request to be modified. - - - - Verifies the condition is satisfied. - - The ETag to check. - The last modified time UTC. - true if the condition is satisfied, otherwise false. - - - - Gets or sets the header of the request to be set. - - The access condition header. - - - - Gets or sets the value of the access condition header. - - The access condition header value. - - - - Represents a blob's attributes. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from an existing object. - - The set of blob attributes to clone. - - - - Gets the blob's system properties. - - The blob's properties. - - - - Gets the user-defined metadata for the blob. - - The blob's metadata, as a collection of name-value pairs. - - - - Gets the blob's URI. - - The absolute URI to the blob. - - - - Gets the date and time that the blob snapshot was taken, if this blob is a snapshot. - - The blob's snapshot time if the blob is a snapshot; otherwise, null. - - If the blob is not a snapshot, the value of this property is null. - - - - - Represents a container's attributes, including its properties and metadata. - - - - - Initializes a new instance of the class. - - - - - Gets the user-defined metadata for the container. - - The container's metadata, as a collection of name-value pairs. - - - - Gets the container's system properties. - - The container's properties. - - - - Gets the name of the container. - - The container's name. - - - - Gets the container's URI. - - The absolute URI to the container. - - - - Represents the permissions for a container. - - - - - Initializes a new instance of the class. - - - - - Gets or sets the public access setting for the container. - - The public access setting for the container. - - - - Gets the set of shared access policies for the container. - - The set of shared access policies for the container. - - - - Represents the system properties for a container. - - - - - Gets the ETag value for the container. - - The container's quoted ETag value. - - - - Gets the container's last-modified time, expressed as a UTC value. - - The container's last-modified time. - - - - Specifies the level of public access that is allowed on the container. - - - - - No public access. Only the account owner can read resources in this container. - - - - - Container-level public access. Anonymous clients can read container and blob data. - - - - - Blob-level public access. Anonymous clients can read only blob data within this container. - - - - - Provides error code strings that are specific to the Blob service. - - - - - Error code that may be returned when a block ID is invalid. - - - - - Error code that may be returned when a blob with the specified address cannot be found. - - - - - Error code that may be returned when a client attempts to create a blob that already exists. - - - - - Error code that may be returned when the specified block or blob is invalid. - - - - - Error code that may be returned when a block list is invalid. - - - - - Specifies which items to include when listing a set of blobs. - - - - - List only committed blobs, and do not return blob metadata. - - - - - List committed blobs and blob snapshots. - - - - - Retrieve blob metadata for each blob returned in the listing. - - - - - List committed and uncommitted blobs. - - - - - List all available committed blobs, uncommitted blobs, and snapshots, and return all metadata for those blobs. - - - - - Represents the system properties for a blob. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class based on an existing instance. - - The set of properties to clone. - - - - Gets or sets the cache-control value stored for the blob. - - The blob's cache-control value. - - - - Gets or sets the content-encoding value stored for the blob. - - The blob's content-encoding value. - - If this property has not been set for the blob, it returns null. - - - - - Gets or sets the content-language value stored for the blob. - - The blob's content-language value. - - If this property has not been set for the blob, it returns null. - - - - - Gets the size of the blob, in bytes. - - The blob's size in bytes. - - - - Gets or sets the content-MD5 value stored for the blob. - - The blob's content-MD5 hash. - - - - Gets or sets the content-type value stored for the blob. - - The blob's content-type value. - - If this property has not been set for the blob, it returns null. - - - - - Gets the blob's ETag value. - - The blob's quoted ETag value. - - - - Gets the the last-modified time for the blob, expressed as a UTC value. - - The blob's last-modified time, in UTC format. - - - - Gets the type of the blob. - - A object that indicates the type of the blob. - - - - Gets the blob's lease status. - - A object that indicates the blob's lease status. - - - - This class represents a seekable, read-only stream on a blob. - - - - - Represents a stream for reading and writing to a blob. - - - - - Aborts the operation to write to the blob. - - - - - Begins an asynchronous operation to commit a blob. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - This operation is not currently supported. - - - - - Ends an asynchronous operation to commit the blob. - - An that references the pending asynchronous operation. - asyncResult is null - - This operation is not currently supported. - - - - - Commits the blob. - - - This operation is not currently supported. - - - - - Gets a reference to the blob on which the stream is opened. - - The blob this stream accesses. - - - - Gets a value indicating whether the signature of each block should be verified. - - - Returns true if integrity control verification is enabled; otherwise, false. - - - - - Gets or sets the number of bytes to read ahead. - - The number of bytes to read ahead. - - This operation is not currently supported. - - - - - Gets or sets the block size. - - The size of the block. - - This operation is not currently supported. - - - - - The threshold beyond which we start a new read-Ahead. - - - - - The current position with the stream. - - - - - The number of bytes to read forward on every request. - - - - - The options applied to the stream. - - - - - True if the AccessCondition has been changed to match a single ETag. - - - - - The list of blocks for this blob. - - - - - The already available blocks for reading. This member is the only possible point of thread contention between the user's requests and ReadAhead async work. - At any particular time, the ReadAhead thread may be adding more items into the list. The second thread will never remove/modify an existing item within the list. - - - - - A handle to the parallel download of data for ReadAhead. - - - - - Initializes a new instance of the BlobReadStream class. - - The blob used for downloads. - Modifiers to be applied to the blob. After first request, the ETag is always applied. - The number of bytes to read ahead. - Controls whether block's signatures are verified. - - - - Setting the length of the blob is not supported. - - The desired length. - Always thrown. - - - - Write is not supported. - - An array of bytes. This method copies count bytes from buffer to the current stream. - The zero-based byte offset in buffer at which to begin copying bytes to the current stream. - The number of bytes to be written to the current stream. - - - - Flush is not supported on read-only stream. - - - - - Seeks to the desired position. Any seek outside of the buffered/read-ahead data will cancel read-ahead and clear the buffered data. - - A byte offset relative to the origin parameter. - A value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position. - The new position within the current stream. - Thrown if offset is invalid for SeekOrigin - - - - Copies the specified amount of data from internal buffers to the buffer and advances the position. - - An array of bytes. When this method returns, the buffer contains the specified byte array with the values - between offset and (offset + count - 1) replaced by the bytes read from the current source. - The zero-based byte offset in buffer at which to begin storing the data read from the current stream. - The maximum number of bytes to be read from the current stream. - The total number of bytes read into the buffer. This can be less than the number of bytes requested - if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. - - The sum of offset and count is larger than the buffer length. - The buffer parameter is null. - The offset or count parameters are negative. - An I/O error occurs. - - - - Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream. - - The unsigned byte cast to an Int32, or -1 if at the end of the stream. - - - - Begins an asynchronous read operation. - - The buffer to read the data into. - The byte offset in at which to begin writing data read from the stream. - The maximum number of bytes to read. - An optional asynchronous callback, to be called when the read is complete. - A user-provided object that distinguishes this particular asynchronous read request from other requests. - - An that represents the asynchronous read, which could still be pending. - - - Attempted an asynchronous read past the end of the stream, or a disk error occurs. - - - One or more of the arguments is invalid. - - - Methods were called after the stream was closed. - - - The current Stream implementation does not support the read operation. - - - - - Ends an asynchronous read operation. - - The reference to the pending asynchronous request to finish. - - The number of bytes read from the stream, between zero (0) and the number of bytes you requested. - Streams return zero (0) only at the end of the stream, otherwise, they should block until at least one byte is available. - - - is null. - - - did not originate from a method on the current stream. - - - The stream is closed or an internal error has occurred. - - - - - Wraps the Read operation to remap any exceptions into IOException. - - The buffer to read the data into. - The zero-based byte offset in buffer at which to begin storing the data read from the current stream. - The maximum number of bytes to be read from the current stream. - The action to be done upon completion to return the number of bytes read. - A task sequence representing the operation. - The sum of offset and count is larger than the buffer length. - The buffer parameter is null. - The offset or count parameters are negative - An I/O error occurs. - - - - Performs the read operation. - - The buffer to read the data into. - The zero-based byte offset in buffer at which to begin storing the data read from the current stream. - The maximum number of bytes to be read from the current stream. - The action to be done upon completion to return the number of bytes read. - A task sequence representing the operation. - - If verification is on, retrieve the blocklist. - If there are downloaded blocks, read from there. - Otherwise, if there's an outstanding request, wait for completion and read from there. - Otherwise perform a new request. - - - - - Locks download to a specific ETag. - - - - - Reads the data from the service starting at the specified location. Verifies the block's signature (if required) and adds it to the buffered data. - - The starting position of the read-ahead. - The number of bytes to read ahead. - An TaskSequence that represents the asynchronous read action. - - - - Ends an asynchronous read-ahead operation. - - An that references the pending asynchronous operation. - asyncResult is null - - - - Retrieves the size of the blob. - - If verification is on, it will retrieve the blocklist as well - - - - Verifies if the blocks are in expected format. Disables the integrity control if they are not appropriate for validation. - - - - - Calculates the ReadAhead bounds (start and count) as required by the existing data. - - The desired start position. - The end of the existing gap. - The desired number of bytes. - The start position rounded down to the nearest block start. - The number of bytes with readAheadSize included and rounded up to the end of the nearest block. - This calculates the bounds based on the blocklist, not any existing data. - - - - Reads from the verified blocks as much data as is available and needed. - - The buffer to read the data into. - The zero-based byte offset in buffer at which to begin storing the data read from the current stream. - The maximum number of bytes to be read from the current stream. - True if there was any data read. - - - - Calculates if the currently held data is less than percentage depleted. - - The start position for any ReadAhead based on the last block. - True if more data is needed. - - - - Verifies if the given offset is within the bounds of the stream. - - The offset to be checked. - This may do a server round-trip if the length is not known. - - - - Gets a value indicating whether the current stream supports reading. - - Returns true if the stream supports reading; otherwise, false. - - - - Gets a value indicating whether the current stream supports seeking. - - Returns true if the stream supports seeking; otherwise, false. - - - - Gets a value indicating whether the current stream supports writing. - - Returns true if the stream supports writing; otherwise, false. - - - - Gets a value indicating whether the current stream can time out. - - A value that determines whether the current stream can time out. - - - - Gets or sets a value, in miliseconds, that determines how long the stream will attempt to read before timing out. - - A value, in miliseconds, that determines how long the stream will attempt to read before timing out. - - - - Gets the length of the blob. - - May need to do a roundtrip to retrieve it. - - - - Gets or sets the position within the stream. - - - - - Gets or sets the number of bytes to read ahead. - - - - - Gets a value indicating whether the signature of each downloaded block should be verified. - - This requires having a blocklist, having blockIDs to be in the appropriate format. This causes all reads to be rounded to the nearest block. - - - - Gets the number of bytes that are cached locally but not yet read by user. - - - - - Gets a value indicating whether length is available. - - - - - Represents a single block of data that was downloaded. - - - - - Initializes a new instance of the class. - - The start offset. - The content. - - - - Gets the starting location of the block. - - - - - Gets the content of the block. - - - - - Encapsulates the collection of downloaded blocks and provides appropriate locking mechanism. - - - - - Holds the downloaded blocks. - - - - - Finds the block that contains the data for the . - - The position which is requested. - A block that contains the data for the or null. - - - - Removes any downloaded blocks that are outside the current bounds (position and readAheadSize). - - The position before which all blocks should be purged. - Size of the read-ahead beyond position for blocks to be kept. - - - - Calculates the length of the gap relative to . - - The position from which to find the gap. - Size of the desired. - The gap start. - The gap end. - - - - Tells if there are any blocks available. - - Returns true if there are any blocks; otherwise, false. - - - - Adds the specified downloaded block. - - The downloaded block. - - - - Removes the specified block based on the startOffset key. - - The key for the block. - - - - Represents a set of options that may be specified on a request. - - - - - The server and client timeout interval for the request. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class based on an - existing instance. - - The set of request options to clone. - - - - Initializes a new instance of the class. - - An object of type . - - - - Creates the full modifier. - - The type of the options. - The service. - An object that specifies any additional options for the request. - A full modifier of the requested type. - - - - Clones this instance. - - A clone of the instance. - - - - Applies the defaults. - - The service. - - - - Gets or sets the retry policy for the request. - - The retry policy delegate. - - - - Gets or sets the server and client timeout for the request. - - The server and client timeout interval for the request. - - - - Gets or sets the access condition for the request. - - A structure that specifies any conditional parameters on the request. - - - - Gets or sets the access condition on the source blob, when the request is to copy a blob. - - A structure that specifies any conditional parameters on the request. - - This property is applicable only to a request that will copy a blob. - - - - - Gets or sets options for deleting snapshots when a blob is to be deleted. - - One of the enumeration values that specifies whether to delete blobs and snapshots, delete blobs only, or delete snapshots only. - - This property is applicable only to a request that will delete a blob. - - - - - Gets or sets options for listing blobs. - - One of the enumeration values that indicates what items a listing operation will return. - - This property is applicable only to a request to list blobs. - - - - - Gets or sets a value indicating whether the blob listing operation will list all blobs in a container in a flat listing, - or whether it will list blobs hierarchically, by virtual directory. - - True if blobs will be listed in a flat listing; otherwise, false. The default value is false. - - This property is applicable only to a request to list blobs. - - - - - The type of a blob. - - - - - Not specified. - - - - - A page blob. - - - - - A block blob. - - - - - The class is an append-only stream for writing into storage. - - - - - Internal Block ID sequence number. Used in generating Block IDs. - - - - - The stream is writable until committed/close. - - - - - The current position within the blob. - - - - - The size of the blocks to use. - - - - - The list of uploaded blocks. - - - - - A memory stream holding the current block information. - - - - - The hash of the current block. - - - - - The ongoing blob hash. - - - - - The set of options applying to the current blob. - - - - - Initializes a new instance of the BlobWriteStream class. - - The blob used for uploads. - The options used for the stream. - The size of the blocks to use. - - - - The stream does not support reading. - - An array of bytes. When this method returns, the buffer contains the specified byte array with the values - between offset and (offset + count - 1) replaced by the bytes read from the current source. - The zero-based byte offset in buffer at which to begin storing the data read from the current stream. - The maximum number of bytes to be read from the current stream. - The total number of bytes read into the buffer. This can be less than the number of bytes requested - if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. - - Not supported operation as this is a write-only stream - - - - The stream does not support seeking. - - A byte offset relative to the origin parameter. - A value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position. - The new position within the current stream. - Not supported operation as this is a write-only stream - - - - The stream does not support setting of length. - - The desired length of the current stream in bytes. - Growing a stream is not possible without writing. - - - - Write the provided data into the underlying stream. - - An array of bytes. This method copies count bytes from buffer to the current stream. - The zero-based byte offset in buffer at which to begin copying bytes to the current stream. - The number of bytes to be written to the current stream. - is null. - offset or count is negative. - Thrown if blob is already committed/closed - - - - Copies a single byte into the stream. - - The byte of data to be written. - - - - Begins an asynchronous write operation. - - The buffer to write data from. - The byte offset in buffer from which to begin writing. - The number of bytes to write. - An optional asynchronous callback, to be called when the write is complete. - A user-provided object that distinguishes this particular asynchronous write request from other requests. - An IAsyncResult that represents the asynchronous write, which could still be pending. - is null. - offset or count is negative. - Thrown if blob is already committed/closed - The operation will be completed synchronously if the buffer is not filled - - - B - Ends an asynchronous write operation. - - An that references the pending asynchronous operation. - asyncResult is null - - - - Causes any buffered data to be written to the remote storage. If the blob is not using blocks, the blob is fully committed. - - An I/O error occurs while writing to storage. - - - - Aborts the upload of the blob. - - - - - Begins an asynchronous operation to commit the blob. - - An optional asynchronous callback, to be called when the commit is complete. - A user-provided object that distinguishes this particular asynchronous commit request from other requests. - An IAsyncResult that represents the asynchronous commit, which could still be pending. - - - - Ends an asynchronous operation to commit the blob. - - An that references the pending asynchronous operation. - asyncResult is null - - - - Commits the blob on the server. - - - - - Implements the disposing logic of committing the blob. - - True to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Generates a blockID using the block's hash and a prefix. - - The base64 encoded blockID. - - - - Implements the block writing task. - - The buffer to write data from. - The byte offset in buffer from which to begin writing. - The number of bytes to write. - The sequence representing the uploading of the blocks. - - - - Creates a task that writes data for a full blob. - - The buffer to write data from. - The byte offset in buffer from which to begin writing. - The number of bytes to write. - The (synchronous) sequence that copies the data into a buffer. - Thrown if the buffer is larger than maximum blob size. - Since a non-block based blob is always fully buffered before upload, this task is a synchronous copy. - - - - Implements the flushing sequence. - - The sequence of events for a flush. - - - - Commits the blob by uploading any remaining data and the blocklist asynchronously. - - A sequence of events required for commit. - - - - Implements a sequence of events to upload a full blob. - - The sequence of events required to upload the blob. - - - - Sets the MD5 of the blob. - - - - - Implements a sequence to upload a block. - - The sequence of events for upload. - - - - Verifies that the blob is in writable state. - - Thrown if stream is non-writable. - - - - Resets the block and the block hash. - - - - - Creates the new block and the block hash. - - - - - Gets a value indicating whether the current stream supports reading. - - Returns true if the stream supports reading; otherwise, false. - - - - Gets a value indicating whether the current stream supports seeking. - - Returns true if the stream supports seeking; otherwise, false. - - - - Gets a value indicating whether the current stream supports writing. - - Returns true if the stream supports writing; otherwise, false. - - - - Gets a value indicating whether the current stream can time out. - - A value that determines whether the current stream can time out. - - - - Gets or sets a value, in milliseconds, that determines how long the stream will attempt to write before timing out. - - - - - Gets the current length (equal to the position). - - - A long value representing the length of the stream in bytes. - - - A class derived from Stream does not support seeking. - - - Methods were called after the stream was closed. - - - - - Gets or sets the current position. - - - The current position within the stream. - - - An I/O error occurs. - - - The stream does not support seeking. - - - Methods were called after the stream was closed. - - - - - Gets or sets the block size. - - - - - Gets a value indicating whether the upload is done in blocks. - - Returns true if blocks are to be used; otherwise, false. - - - - Indicates whether to list only committed blocks, only uncommitted blocks, or all blocks. - - - - - Committed blocks. - - - - - Uncommitted blocks. - - - - - Both committed and uncommitted blocks. - - - - - Represents a Windows Azure blob. - - - - - Represents an item that may be returned by a blob listing operation. - - - - - Gets the URI to the blob item. - - The blob item's URI. - - - - Gets the blob item's parent. - - The blob item's parent. - - - - Gets the blob item's container. - - The blob item's container. - - - - Stores the blob's attributes. - - - - - Stores the that contains this blob. - - - - - Stores the name of this blob. - - - - - Stores the blob's parent . - - - - - Stores the blob's transformed address. - - - - - Initializes a new instance of the class using an absolute URI to the blob. - - The absolute URI to the blob. - - - - Initializes a new instance of the class using an absolute URI to the blob - and a set of credentials. - - The absolute URI to the blob. - The account credentials. - - - - Initializes a new instance of the class using an absolute URI to the blob, and the snapshot timestamp, - if the blob is a snapshot. - - The absolute URI to the blob. - The snapshot timestamp, if the blob is a snapshot. - The account credentials. - - - - Initializes a new instance of the class using a relative URI to the blob, and the snapshot timestamp, - if the blob is a snapshot. - - The relative URI to the blob, beginning with the container name. - The snapshot timestamp, if the blob is a snapshot. - A client object that specifies the endpoint for the Blob service. - - - - Initializes a new instance of the class using a relative URI to the blob. - - The relative URI to the blob, beginning with the container name. - A client object that specifies the endpoint for the Blob service. - - - - Initializes a new instance of the class based on an existing instance. - - An existing reference to a blob. - - - - Initializes a new instance of the class. - - Absolute Uri. - True to use path style Uri. - - Any authentication information inside the address will be used. - Otherwise a blob for anonymous access is created. - Any snapshot information as part of the address will be recorded - Explicity specify whether to use host style or path style Uri - - - - - Initializes a new instance of the class creating a new service client. - - Complete Uri. - Storage credentials. - True to use path style Uris. - - - - Initializes a new instance of the class with the given absolute Uri. - - True to use path style Uris. - The absolute blob Uri. - - - - Initializes a new instance of the class with existing attributes. - - The attributes (NOTE: Saved by reference, does not make a copy). - The service client. - The snapshot time. - - - - Initializes a new instance of the class using the specified blob Uri. - Note that this is just a reference to a blob instance and no requests are issued to the service - yet to update the blob properties, attribute or metaddata. FetchAttributes is the API that - issues such request to the service. - - A relative Uri to the blob. - A object that specifies the endpoint for the Blob service. - The reference to the parent container. - - - - Initializes a new instance of the class using the specified relative blob Uri. - If snapshotTime is not null, the blob instance represents a Snapshot. - Note that this is just a reference to a blob instance and no requests are issued to the service - yet to update the blob properties, attribute or metaddata. FetchAttributes is the API that - issues such request to the service. - - A relative Uri to the blob. - Snapshot time in case the blob is a snapshot. - A object that specifies the endpoint for the Blob service. - The reference to the parent container. - - - - Populates a blob's properties and metadata. - - - - - Populates a blob's properties and metadata. - - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to populate the blob's properties and metadata. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to populate the blob's properties and metadata. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to populate the blob's properties and metadata. - - An that references the pending asynchronous operation. - - - - Updates the blob's metadata. - - - - - Updates the blob's metadata. - - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to update the blob's metadata. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to update the blob's metadata. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to update the blob's metadata. - - An that references the pending asynchronous operation. - - - - Updates the blob's properties. - - - - - Updates the blob's properties. - - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to update the blob's properties. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to update the blob's properties. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to update the blob's properties. - - An that references the pending asynchronous operation. - - - - Copies an existing blob's contents, properties, and metadata to a new blob. - - The source blob. - - - - Copies a blob's contents, properties, and metadata to a new blob. - - The source blob. - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to copy a blob's contents, properties, and metadata to a new blob. - - The source blob. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to copy another blob's contents, properties, and metadata to the blob referenced by this object. - - The source blob. - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to copy a blob's contents, properties, and metadata to a new blob. - - An that references the pending asynchronous operation. - - - - Deletes the blob. - - - - - Deletes the blob. - - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to delete the blob. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to delete the blob. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to delete the blob. - - An that references the pending asynchronous operation. - - - - Deletes the blob if it exists. - - true if the blob was deleted; otherwise, false. - - - - Deletes the blob if it exists. - - An object that specifies any additional options for the request. - true if the blob was deleted; otherwise, false. - - - - Begins an asynchronous operation to delete the blob if it exists. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to delete the blob if it exists. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to delete the blob if it exists. - - An that references the pending asynchronous operation. - true if the blob was successfully deleted; otherwise, false. - - - - Opens a stream for writing to the blob. - - A stream to be used for writing to the blob. - - - - Opens a stream for writing to the blob. - - An object that specifies any additional options for the request. - A stream to be used for writing to the blob. - - - - Uploads a stream to a block blob. - - The stream providing the blob content. - - - - Uploads a stream to a block blob. - - The stream providing the blob content. - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to upload a stream to a block blob. - - The stream providing the blob content. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to upload a stream to a block blob. - - The stream providing the blob content. - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to upload a stream to a block blob. - - An that references the pending asynchronous operation. - - - - Uploads a string of text to a block blob. - - The text to upload, encoded as a UTF-8 string. - - - - Uploads a string of text to a block blob. - - The text to upload. - An object that indicates the text encoding to use. - An object that specifies any additional options for the request. - - - - Uploads a file from the file system to a block blob. - - The path and file name of the file to upload. - - - - Uploads a file from the file system to a block blob. - - The path and file name of the file to upload. - An object that specifies any additional options for the request. - - - - Uploads an array of bytes to a block blob. - - The array of bytes to upload. - - - - Uploads an array of bytes to a blob. - - The array of bytes to upload. - An object that specifies any additional options for the request. - - - - Opens a stream for reading the blob's contents. - - A stream to use for reading from the blob. - - - - Opens a stream for reading the blob's contents. - - An object that specifies any additional options for the request. - A stream to use for reading from the blob. - - - - Downloads the contents of a blob to a stream. - - The target stream. - - - - Downloads the contents of a blob to a stream. - - The target stream. - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to download the contents of a blob to a stream. - - The target stream. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to download the contents of a blob to a stream. - - The target stream. - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to download the contents of a blob to a stream. - - An that references the pending asynchronous operation. - - - - Downloads the blob's contents. - - The contents of the blob, as a string. - - - - Downloads the blob's contents. - - An object that specifies any additional options for the request. - The contents of the blob, as a string. - - - - Downloads the blob's contents to a file. - - The path and file name of the target file. - - - - Downloads the blob's contents to a file. - - The path and file name of the target file. - An object that specifies any additional options for the request. - - - - Downloads the blob's contents as an array of bytes. - - The contents of the blob, as an array of bytes. - - - - Downloads the blob's contents as an array of bytes. - - An object that specifies any additional options for the request. - The contents of the blob, as an array of bytes. - - - - Creates a snapshot of the blob. - - A blob snapshot. - - - - Creates a snapshot of the blob. - - An object that specifies any additional options for the request. - A blob snapshot. - - - - Creates a snapshot of the blob. - - A collection of name-value pairs defining the metadata of the snapshot. - An object that specifies any additional options for the request, or null. - A blob snapshot. - - - - Begins an asynchronous operation to create a snapshot of the blob. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to create a snapshot of the blob. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to create a snapshot of the blob. - - A collection of name-value pairs defining the metadata of the snapshot. - An object that specifies any additional options for the request, or null. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to create a snapshot of the blob. - - An that references the pending asynchronous operation. - A blob snapshot. - - - - Returns a shared access signature for the blob. - - The access policy for the shared access signature. - A shared access signature. - Thrown if the current credentials don't support creating a shared access signature. - Thrown if blob is a snapshot. - - - - Returns a shared access signature for the blob. - - The access policy for the shared access signature. - A container-level access policy. - A shared access signature. - Thrown if the current credentials don't support creating a shared access signature. - Thrown if blob is a snapshot. - - - - Dispatches the stream upload to a specific implementation method. - - The source stream. - An object that specifies any additional options for the request. - A that uploads the stream. - - - - Uploads the blob with buffering. - - The source stream. - An object that specifies any additional options for the request. - The size of the block. - A that uploads the blob. - - - - Uploads the full blob with retry. - - The source stream. - An object that specifies any additional options for the request. - A that uploads the blob. - - - - Uploads the full blob. - - The source stream. - An object that specifies any additional options for the request. - A that uploads the blob. - - - - Uploads the blob in parallel with blocks. - - The source stream. - The size of the block. - An object that specifies any additional options for the request. - A that uploads the blob. - - - - Uploads the block with retry. - - The source stream. - The block IS. - The content MD5. - An object that specifies any additional options for the request. - A that uploads the block. - - - - Uploads the block. - - The source stream. - The block ID. - The content MD5. - An object that specifies any additional options for the request. - A that uploads the block. - - - - Uploads the data into the web request. - - The request that is setup for a put. - The source of data. - The response from the server. - The sequence used for uploading data. - - - - Implements the FetchAttributes method. - - An object that specifies any additional options for the request. - A that fetches the attributes. - - - - Implements the DownloadToStream method. - - The target stream. - An object that specifies any additional options for the request. - A that downloads the blob to the stream. - - - - Implements the DownloadToStream method. - - The target stream. - An object that specifies any additional options for the request. - A that downloads the blob to the stream. - - - - Implements getting the stream. - - An object that specifies any additional options for the request. - The offset. - The count. - The set result. - A that gets the stream. - - - - Implements getting the stream without specifying a range. - - An object that specifies any additional options for the request. - A that gets the stream. - - - - Implements getting the stream without specifying a range. - - An object that specifies any additional options for the request. - The set result. - A that gets the stream. - - - - Retreive ETag and LastModified date time from response. - - The response to parse. - - - - Parses the blob address query and returns snapshot and SAS. - - The query to parse. - The snapshot value, if any. - The SAS credentials. - - - - Gets the default encoding for the blob, which is UTF-8. - - The default object. - - - - Gets the canonical name of the blob, formatted as /<account-name>/<container-name>/<blob-name>. - If ignoreSnapshotTime is false and this blob is a snapshot, the canonical name is augmented with a - query of the form ?snapshot=<snapshot-time>. - This is used by both Shared Access and Copy blob operations. - Used by both Shared Access and Copy blob operation. - - Indicates if the snapshot time is ignored. - The canonical name of the blob. - - - - Uploads a stream that doesn't have a known length. In this case we can't do any optimizations like creating a request before we read all of the data. - - The stream that is the source of data. - An object that specifies any additional options for the request. - The block size to be used (null - no blocks). - A sequence that represents uploading the blob. - This is implemented by creating a BlobStream and using that to buffer data until we have sufficient amount to be sent. - - - - Uploads the blob with blocks. - - The source stream. - An object that specifies any additional options for the request. - The size of the block. - A that uploads the blob. - - - - Uploads the full blob with a retry sequence. The stream must be seekable. - - The source stream, which must be seekable. - An object that specifies any additional options for the request. - A that uploads the blob. - - - - Implementation of the CopyFromBlob method. - - The source blob. - An object that specifies any additional options for the request. - A that copies the blob. - - - - Implements the DeleteBlob method. - - An object that specifies any additional options for the request. - A that deletes the blob. - - - - Implementation for the DeleteIfExists method. - - An object that specifies any additional options for the request. - The set result. - A that deletes the blob if it exists. - - - - Implementation for the CreateSnapshot method. - - A collection of name-value pairs defining the metadata of the snapshot, or null. - An object that specifies any additional options for the request. - The result report delegate. - A that creates the snapshot. - If the metadata parameter is null then no metadata is associated with the request. - - - - Implementation for the SetMetadata method. - - An object that specifies any additional options for the request. - A that sets the metadata. - - - - Implementation for the SetProperties method. - - An object that specifies any additional options for the request. - A that sets the properties. - - - - Verifies that write operation is not done for snapshot. - - - - - Parses the snapshot time. - - The snapshot time. - The parsed snapshot time. - - - - Parse Uri for any snapshot and SAS (Shared access signature) information. Validate that no other query parameters are passed in. - - The complete Uri. - The existing blob client. - True to use path style Uris. - - Any snapshot information will be saved. - Any SAS information will be recorded as corresponding credentials instance. - If existingClient is passed in, any SAS information found will not be supported. - Otherwise a new client is created based on SAS information or as anonymous credentials. - - - - - Gets the value that uniquely identifies the snapshot, if this blob is a snapshot. - - A value that uniquely identfies the snapshot. - - If the blob is not a snapshot, this property returns null. - - - - - Gets the object that represents the Blob service. - - A client object that specifies the Blob service endpoint. - - - - Gets the URI that identifies the blob. - - The address of the blob. - - - - Gets the object that represents the blob's attributes. - - The blob's attributes. - - - - Gets the blob's user-defined metadata. - - The blob's metadata. - - - - Gets the blob's system properties. - - The blob's system properties. - - - - Gets the blob's name. - - The blob's name. - - - - Gets a object representing the blob's container. - - The blob's container. - - - - Gets the object representing the - virtual parent directory for the blob. - - The blob's virtual parent directory. - - - - Gets a object based on this blob. - - A reference to a page blob. - - - - Gets a object based on this blob. - - A reference to a block blob. - - - - Gets the Uri after applying authentication transformation. - - The transformed address. - - - - Provides a client for accessing the Windows Azure Blob service. - - - - - Constant for the max value of ParallelOperationThreadCount. - - - - - Stores the default delimiter. - - - - - Stores the parallelism factor. - - - - - Default is 32 MB. - - - - - Default is 4 MB. - - - - - The default server and client timeout interval. - - - - - Initializes a new instance of the class to be used for anonymous access. - - The Blob service endpoint to use to create the client. - - - - Initializes a new instance of the class using the specified Blob service endpoint - and account credentials. - - The Blob service endpoint to use to create the client. - The account credentials. - - - - Initializes a new instance of the class using the specified Blob service endpoint - and account credentials. - - The Blob service endpoint to use to create the client. - The account credentials. - - - - Initializes a new instance of the class. - - True to use path style Uris. - The base Uri. - The credentials. - - - - Gets the properties of the blob service. - - The blob service properties. - - - - Begins an asynchronous operation to get the properties of the blob service. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user defined object to be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to get the properties of the blob service. - - The result returned from a prior call to . - The blob service properties. - - - - Sets the properties of the blob service. - - The blob service properties. - - - - Begins an asynchronous operation to set the properties of the blob service. - - The blob service properties. - The callback delegate that will receive notification when the asynchronous operation completes. - A user defined object to be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to set the properties of the blob service. - - The result returned from a prior call to . - - - - Returns a reference to a object with the specified address. - - The absolute URI to the blob, or a relative URI beginning with the container name. - A reference to a page blob. - - - - Returns a reference to a object with the specified address. - - The absolute URI to the blob, or a relative URI beginning with the container name. - A reference to a page blob. - - - - Returns a reference to a object with the specified address. - - The absolute URI to the blob, or a relative URI beginning with the container name. - The snapshot timestamp, if the blob is a snapshot. - A reference to a page blob. - - - - Returns a reference to a object with the specified address. - - The absolute URI to the blob, or a relative URI beginning with the container name. - A reference to a block blob. - - - - Returns a reference to a with the specified address. - - The absolute URI to the blob, or a relative URI beginning with the container name. - A reference to a block blob. - - - - Returns a reference to a with the specified address. - - The absolute URI to the blob, or a relative URI beginning with the container name. - The snapshot timestamp, if the blob is a snapshot. - A reference to a block blob. - - - - Returns a reference to a with the specified address. - - The absolute URI to the blob, or a relative URI beginning with the container name. - A reference to a blob. - - - - Returns a reference to a blob with the specified address. - - The absolute URI to the blob, or a relative URI beginning with the container name. - The snapshot timestamp, if the blob is a snapshot. - A reference to a blob. - - - - Returns a reference to a object with the specified address. - - The name of the container, or an absolute URI to the container. - A reference to a container. - - - - Returns a reference to a object with the specified address. - - The absolute URI to the virtual directory, - or a relative URI beginning with the container name. - A reference to a virtual directory. - - - - Returns an enumerable collection of containers. - - An enumerable collection of containers. - - - - Returns an enumerable collection of containers whose names begin with the specified prefix. - - The container name prefix. - An enumerable collection of containers. - - - - Returns an enumerable collection of containers whose names - begin with the specified prefix and that are retrieved lazily. - - The container name prefix. - A value that indicates whether to return container metadata with the listing. - An enumerable collection of containers that are retrieved lazily. - - - - Returns a result segment containing a collection of containers. - - A result segment of containers. - - - - Returns a result segment containing a collection of containers - whose names begin with the specified prefix. - - The container name prefix. - A result segment of containers. - - - - Returns a result segment containing a collection of containers - whose names begin with the specified prefix. - - The container name prefix. - A value that indicates whether to return container metadata with the listing. - A non-negative integer value that indicates the maximum number of results to be returned - in the result segment, up to the per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. - A continuation token returned by a previous listing operation. - A result segment of containers. - - - - Begins an asynchronous request to return a result segment containing a collection of containers. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous request to return a result segment containing a collection of containers - whose names begin with the specified prefix. - - The container name prefix. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous request to return a result segment containing a collection of containers - whose names begin with the specified prefix. - - The container name prefix. - A value that indicates whether to return container metadata with the listing. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous request to return a result segment containing a collection of containers - whose names begin with the specified prefix. - - The container name prefix. - A value that indicates whether to return container metadata with the listing. - A non-negative integer value that indicates the maximum number of results to be returned - in the result segment, up to the per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. - A continuation token returned by a previous listing operation. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to return a result segment containing a collection of containers. - - An that references the pending asynchronous operation. - A result segment of containers. - - - - Returns an enumerable collection of blob items whose names begin with the specified prefix. - - The blob name prefix. This value must be preceded either by the name of the container or by the absolute URI to the container. - An enumerable collection of objects that implement . - - - - Returns an enumerable collection of blob items whose names begin with the specified prefix and that are retrieved lazily. - - The blob name prefix. This value must be preceded either by the name of the container or by the absolute URI to the container. - An object that specifies any additional options for the request. - An enumerable collection of objects that implement and are retrieved lazily. - - - - Returns a result segment containing a collection of blob items whose names - begin with the specified prefix. - - The blob name prefix. This value must be preceded either by the name of the container or by the absolute path to the container. - A result segment containing objects that implement . - - - - Returns a result segment containing a collection of blob items whose names - begin with the specified prefix. - - The blob name prefix. This value must be preceded either by the name of the container or by the absolute path to the container. - An object that specifies any additional options for the request. - A result segment containing objects that implement . - - - - Returns a result segment containing a collection of blob items whose names - begin with the specified prefix. - - The blob name prefix. This value must be preceded either by the name of the container or by the absolute path to the container. - A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the per-operation limit of 5000. - If this value is zero, the maximum possible number of results will be returned, up to 5000. - A continuation token returned by a previous listing operation. - A result segment containing objects that implement . - - - - Returns a result segment containing a collection of blob items whose names - begin with the specified prefix. - - The blob name prefix. This value must be preceded either by the name of the container or by the absolute path to the container. - A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the per-operation limit of 5000. - If this value is zero, the maximum possible number of results will be returned, up to 5000. - A continuation token returned by a previous listing operation. - An object that specifies any additional options for the request. - A result segment containing objects that implement . - - - - Begins an asynchronous operation to return a result segment containing a collection - of blob items whose names begin with the specified prefix. - - The blob name prefix. This value must be preceded either by the name of the container or by the absolute path to the container. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to return a result segment containing a collection - of blob items whose names begin with the specified prefix. - - The blob name prefix. This value must be preceded either by the name of the container or by the absolute path to the container. - A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the - per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. - A continuation token returned by a previous listing operation. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to return a result segment containing a collection - of blob items whose names begin with the specified prefix. - - An that references the pending asynchronous operation. - A result segment containing objects that implement . - - - - Selects the protocol response. - - The protocol item. - The service. - The container. - The parsed . - - - - Ends the asynchronous GetResponse operation. - - An that references the asynchronous operation. - The request to end the operation on. - The from the asynchronous request. - - - - Gets the response for the operation. - - The request to end the operation on. - The from the request. - - - - Parses the user prefix. - - The prefix. - Name of the container. - The listing prefix. - - - - Converts the date time to snapshot string. - - The snapshot time to convert. - A string representing the snapshot time. - - - - Implementation for the ListContainers method. - - The container prefix. - The details included. - The continuation token. - The maximum results to return. - The result report delegate. - A that lists the containers. - - - - Core implementation for the ListContainers method. - - The container prefix. - The details included. - The continuation token. - The pagination. - The result report delegate. - A that lists the containers. - - - - Implementation for the ListBlobs method. - - The blob prefix. - The continuation token. - The max results. - An object that specifies any additional options for the request. - The result report delegate. - - A that lists the blobs. - - - - - Generates a task sequence for getting the properties of the blob service. - - A delegate to receive the service properties. - A task sequence that gets the properties of the blob service. - - - - Generates a task sequence for setting the properties of the blob service. - - The blob service properties to set. - A task sequence that sets the properties of the blob service. - - - - Occurs when a response is received from the server. - - - - - Gets the account credentials used to create the Blob service client. - - The account credentials. - - - - Gets the base URI for the Blob service client. - - The base URI used to construct the Blob service client. - - - - Gets or sets the default retry policy for requests made via the Blob service client. - - The retry policy. - - - - Gets or sets the default server and client timeout for requests made by the Blob service client. - - The server and client timeout interval. - - - - Gets or sets the default delimiter that may be used to create a virtual directory structure of blobs. - - The default delimiter. - - - - Gets or sets the maximum size of a blob in bytes that may be uploaded as a single blob. - - The maximum size of a blob, in bytes, that may be uploaded as a single blob, - ranging from between 1 and 64 MB inclusive. - - - - Gets or sets the maximum block size for writing to a block blob. - - The maximum size of a block, in bytes, ranging from between 1 and 4 MB inclusive. - - - - Gets or sets the number of bytes to pre-fetch when reading from a stream. - - The number of bytes to read ahead from a stream. - - - - Gets or sets a value indicating whether the integrity of each block should be verified when reading from a stream. - - True if using integrity control for stream reading; otherwise, false. The default value is true. - - - - Gets or sets the number of blocks that may be simultaneously uploaded when uploading a blob that is greater than - the value specified by the property. - in size. - - The number of parallel operations that may proceed. - - - - Gets a value indicating whether the service client is used with Path style or Host style. - - Is true if use path style uris; otherwise, false. - - - - Represents a container in the Windows Azure Blob service. - - - - - Stores the transformed address. - - - - - Initializes a new instance of the class. - - The absolute URI to the container. - - - - Initializes a new instance of the class. - - The absolute URI to the container. - The account credentials. - - - - Initializes a new instance of the class. - - Either the absolute URI to the container, or the container name. - A client object that specifies the endpoint for the Blob service. - - - - Initializes a new instance of the class with the given address and path style Uri preference. - - The container's address. - True to use path style Uris. - - - - Initializes a new instance of the class. - - The container address. - The credentials. - If set to true path style Uris are used. - - - - Initializes a new instance of the class. - - The attributes for the container (NOTE: Stored by reference). - The client to be used. - - - - Initializes a new instance of the class. - - True to use path style Uris. - The container's address. - - - - Gets a reference to a blob in this container. - - The name of the blob, or the absolute URI to the blob. - A reference to a blob. - - - - Gets a reference to a page blob in this container. - - The name of the blob, or the absolute URI to the blob. - A reference to a page blob. - - - - Gets a reference to a block blob in this container. - - The name of the blob, or the absolute URI to the blob. - A reference to a block blob. - - - - Gets a reference to a virtual blob directory beneath this container. - - The name of the virtual blob directory, or the absolute URI to the virtual blob directory. - A reference to a virtual blob directory. - - - - Returns an enumerable collection of the blobs in the container. - - An enumerable collection of objects that implement . - - - - Returns an enumerable collection of the blobs in the container that are retrieved lazily. - - An object that specifies any additional options for the request. - An enumerable collection of objects that implement and are retrieved lazily. - - - - Returns a result segment containing a collection of blob items - in the container. - - An object that specifies any additional options for the request. - A result segment containing objects that implement . - - - - Returns a result segment containing a collection of blob items - in the container. - - A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the - per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. - A continuation token returned by a previous listing operation. - An object that specifies any additional options for the request. - A result segment containing objects that implement . - - - - Begins an asynchronous operation to return a result segment containing a collection of blob items - in the container. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to return a result segment containing a collection of blob items - in the container. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to return a result segment containing a collection of blob items - in the container. - - A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the - per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. - A continuation token returned by a previous listing operation. - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to return a result segment containing a collection of blob items - in the container. - - An that references the pending asynchronous operation. - A result segment containing objects that implement . - - - - Creates the container. - - - - - Creates the container. - - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to create a container. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to create a container. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to create a container. - - An that references the pending asynchronous operation. - - - - Creates the container if it does not already exist. - - true if the container did not already exist and was created; otherwise, false. - - - - Creates the container if it does not already exist. - - An object that specifies any additional options for the request. - true if the container did not already exist and was created; otherwise false. - - - - Begins an asynchronous request to create the container if it does not already exist. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous request to create the container if it does not already exist. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Returns the result of an asynchronous request to create the container if it does not already exist. - - An that references the pending asynchronous operation. - true if the container did not already exist and was created; otherwise, false. - - - - Deletes the container. - - - - - Deletes the container. - - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to delete a container. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to delete a container. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to delete a container. - - An that references the pending asynchronous operation. - - - - Sets permissions for the container. - - The permissions to apply to the container. - - - - Sets permissions for the container. - - The permissions to apply to the container. - An object that specifies any additional options for the request. - - - - Begins an asynchronous request to set permissions for the container. - - The permissions to apply to the container. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous request to set permissions for the container. - - The permissions to apply to the container. - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Returns the result of an asynchronous request to set permissions for the container. - - An that references the pending asynchronous operation. - - - - Gets the permissions settings for the container. - - The container's permissions. - - - - Gets the permissions settings for the container. - - An object that specifies any additional options for the request. - The container's permissions. - - - - Begins an asynchronous request to get the permissions settings for the container. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous request to get the permissions settings for the container. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Returns the asynchronous result of the request to get the permissions settings for the container. - - An that references the pending asynchronous operation. - The container's permissions. - - - - Retrieves the container's attributes. - - - - - Retrieves the container's attributes. - - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to retrieve the container's attributes. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to retrieve the container's attributes. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to retrieve the container's attributes. - - An that references the pending asynchronous operation. - - - - Sets the container's user-defined metadata. - - - - - Sets the container's user-defined metadata. - - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to set user-defined metadata on the container. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to set user-defined metadata on the container. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous request operation to set user-defined metadata on the container. - - An that references the pending asynchronous operation. - - - - Returns a shared access signature for the container. - - The access policy for the shared access signature. - A shared access signature. - - - - Returns a shared access signature for the container. - - The access policy for the shared access signature. - A container-level access policy. - A shared access signature. - - - - Implementation for the ListBlobs method. - - The blob prefix. - An object that specifies any additional options for the request. - The continuation token. - The maximum result size. - The result report delegate. - A that lists the blobs. - - - - Retrieve ETag and LastModified date time from response. - - The response to parse. - - - - Converts the ACL string to a object. - - The string to convert. - The resulting object. - - - - Parse Uri for SAS (Shared access signature) information. - - The complete Uri. - The client to use. - If true, path style Uris are used. - - Validate that no other query parameters are passed in. - Any SAS information will be recorded as corresponding credentials instance. - If existingClient is passed in, any SAS information found will not be supported. - Otherwise a new client is created based on SAS information or as anonymous credentials. - - - - - Returns the canonical name for shared access. - - The canonical name. - - - - Gets the absolute Uri of the blob. - - Name of the blob. - The blob's absolute Uri. - - - - Core implementation of the ListBlobs method. - - The blob prefix. - An object that specifies any additional options for the request. - The continuation token. - The pagination. - The result report delegate. - A that lists the blobs. - - - - Implementation for the Create method. - - An object that specifies any additional options for the request. - A that creates the container. - - - - Implementation for the CreateIfNotExist method. - - An object that specifies any additional options for the request. - The set result. - A that creates the container if it does not exist. - - - - Implementation for the Delete method. - - An object that specifies any additional options for the request. - A that deletes the container. - - - - Implementation for the FetchAttributes method. - - An object that specifies any additional options for the request. - A that fetches the attributes. - - - - Implementation for the SetMetadata method. - - An object that specifies any additional options for the request. - A that sets the metadata. - - - - Implementation for the SetPermissions method. - - The permissions to set. - An object that specifies any additional options for the request. - A that sets the permissions. - - - - Implementation for the GetPermissions method. - - An object that specifies any additional options for the request. - The result report delegate. - A that gets the permissions. - - - - Gets the service client for the container. - - A client object that specifies the endpoint for the Blob service. - - - - Gets the container's URI. - - The absolute URI to the container. - - - - Gets the name of the container. - - The container's name. - - - - Gets the container's metadata. - - The container's metadata. - - - - Gets the container's attributes. - - The container's attributes. - - - - Gets the container's system properties. - - The container's properties. - - - - Gets the Uri after applying authentication transformation. - - - - - Represents a virtual directory of blobs, designated by a delimiter character. - - - - - Stores the parent directory. - - - - - Stores the parent container. - - - - - Stores the prefix this directory represents. - - - - - Initializes a new instance of the class given an address and a client. - - The blob directory's address. - The client to use. - - - - Returns a reference to a blob in this virtual directory. - - The name of the blob. - A reference to a blob. - - - - Returns a reference to a blob in this virtual directory. - - The name of the blob. - The snapshot timestamp, if the blob is a snapshot. - A reference to a blob. - - - - Returns a reference to a page blob in this virtual directory. - - The name of the page blob. - A reference to a page blob. - - - - Returns a reference to a page blob in this virtual directory. - - The name of the page blob. - The snapshot timestamp, if the blob is a snapshot. - A reference to a page blob. - - - - Returns a reference to a block blob in this virtual directory. - - The name of the block blob. - A reference to a block blob. - - - - Returns a reference to a block blob in this virtual directory. - - The name of the block blob. - The snapshot timestamp, if the blob is a snapshot. - A reference to a block blob. - - - - Returns a virtual subdirectory within this virtual directory. - - The name of the virtual subdirectory. - A object representing the virtual subdirectory. - - - - Returns an enumerable collection of blob items in this virtual directory that is lazily retrieved, either as a flat listing or by virtual subdirectory. - - An object that specifies any additional options for the request. - An enumerable collection of objects that implement and are retrieved lazily. - - - - Returns an enumerable collection of blob items in this virtual directory, either as a flat listing or by virtual subdirectory. - - An enumerable collection of objects that implement . - - - - Returns a result segment containing a collection of blob items. - - An object that specifies any additional options for the request. - A result segment containing objects that implement . - - - - Returns a result segment containing a collection of blob items. - - A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the - per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. - A continuation token returned by a previous listing operation. - An object that specifies any additional options for the request. - A result segment containing objects that implement . - - - - Begins an asynchronous request to return a result segment containing a collection of blob items. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous request to return a result segment containing a collection of blob items. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous request to return a result segment containing a collection of blob items. - - A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the - per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. - A continuation token returned by a previous listing operation. - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous request to return a result segment containing a collection of blob items. - - An that references the pending asynchronous operation. - A result segment containing objects that implement . - - - - Initializes the prefix. - - - - - Gets the service client for the virtual directory. - - A client object that specifies the endpoint for the Blob service. - - - - Gets the URI that identifies the virtual directory. - - The URI to the virtual directory. - - - - Gets the container for the virtual directory. - - The container for the virtual directory. - - - - Gets the parent directory for the virtual directory. - - The virtual directory's parent directory. - - - - Gets the prefix. - - The prefix. - - - - Represents a blob that is uploaded as a set of blocks. - - - - - Initializes a new instance of the class using an absolute URI to the blob. - - The absolute URI to the blob. - The account credentials. - - - - Initializes a new instance of the class using a relative URI to the blob. - - The relative URI to the blob, beginning with the container name. - A client object that specifies the endpoint for the Blob service. - - - - Initializes a new instance of the class using a relative URI to the blob. - - The relative URI to the blob, beginning with the container name. - The snapshot timestamp, if the blob is a snapshot. - A client object that specifies the endpoint for the Blob service. - - - - Initializes a new instance of the class using an absolute URI to the blob. - - The absolute URI to the blob. - - - - Initializes a new instance of the class using an absolute URI to the blob. - - The absolute URI to the blob. - The account credentials. - True to use path-style URIs; otherwise, false. - - - - Initializes a new instance of the class using an absolute URI to the blob. - - The absolute URI to the blob. - True to use path-style URIs; otherwise, false. - - - - Initializes a new instance of the class based on an existing blob. - - The blob to clone. - - - - Initializes a new instance of the class. - - The attributes. - The service client. - The snapshot time. - - - - Initializes a new instance of the class using the specified blob Uri. - Note that this is just a reference to a blob instance and no requests are issued to the service - yet to update the blob properties, attribute or metaddata. FetchAttributes is the API that - issues such request to the service. - - Relative Uri to the blob. - Existing Blob service client which provides the base address. - The reference to the parent container. - - - - Initializes a new instance of the class using the specified blob Uri. - If snapshotTime is not null, the blob instance represents a Snapshot. - Note that this is just a reference to a blob instance and no requests are issued to the service - yet to update the blob properties, attribute or metaddata. FetchAttributes is the API that - issues such request to the service. - - Relative Uri to the blob. - Snapshot time in case the blob is a snapshot. - Existing Blob service client which provides the base address. - The reference to the parent container. - - - - Returns an enumerable collection of the committed blocks comprising the blob. - - An enumerable collection of objects implementing . - - - - Returns an enumerable collection of the committed blocks comprising the blob. - - An object that specifies any additional options for the request. - An enumerable collection of objects implementing . - - - - Returns an enumerable collection of the blob's blocks, using the specified block list filter. - - One of the enumeration values that indicates whether to return - committed blocks, uncommitted blocks, or both. - An enumerable collection of objects implementing . - - - - Returns an enumerable collection of the blob's blocks, using the specified block list filter. - - One of the enumeration values that indicates whether to return - committed blocks, uncommitted blocks, or both. - An object that specifies any additional options for the request. - An enumerable collection of objects implementing . - - - - Begins an asynchronous operation to return an enumerable collection of the blob's blocks, - using the specified block list filter. - - One of the enumeration values that indicates whether to return - committed blocks, uncommitted blocks, or both. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to return an enumerable collection of the blob's blocks, - using the specified block list filter. - - One of the enumeration values that indicates whether to return - committed blocks, uncommitted blocks, or both. - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to return an enumerable collection of the blob's blocks, - using the specified block list filter. - - An that references the pending asynchronous operation. - An enumerable collection of objects implementing . - - - - Uploads a single block. - - A base64-encoded block ID that identifies the block. - A stream that provides the data for the block. - An optional hash value that will be used to set the property - on the blob. May be null or an empty string. - - - - Uploads a single block. - - A base64-encoded block ID that identifies the block. - A stream that provides the data for the block. - An optional hash value that will be used to set the property - on the blob. May be null or an empty string. - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to upload a single block. - - A base64-encoded block ID that identifies the block. - A stream that provides the data for the block. - An optional hash value that will be used to set the property - on the blob. May be null or an empty string. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to upload a single block. - - A base64-encoded block ID that identifies the block. - A stream that provides the data for the block. - An optional hash value that will be used to set the property - on the blob. May be null or an empty string. - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to upload a single block. - - An that references the pending asynchronous operation. - - - - Uploads a list of blocks to a new or existing blob. - - An enumerable collection of block IDs, as base64-encoded strings. - - - - Uploads a list of blocks to a new or existing blob. - - An enumerable collection of block IDs, as base64-encoded strings. - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to upload a list of blocks to a new or existing blob. - - An enumerable collection of block IDs, as base64-encoded strings. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to upload a list of blocks to a new or existing blob. - - An enumerable collection of block IDs, as base64-encoded strings. - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to upload a list of blocks to a new or existing blob. - - An that references the pending asynchronous operation. - - - - Uploads the block list. - - The blocks to upload. - An object that specifies any additional options for the request. - A that uploads the block list. - - - - Gets the download block list. - - The types of blocks. - An object that specifies any additional options for the request. - The result report delegate. - A that gets the download block list. - - - - Parses the response. - - The block list response. - An enumerable list of objects. - - - - Represents a blob made up of a collection of pages. - - - - - Initializes a new instance of the class using an absolute URI to the blob. - - The absolute URI to the blob. - The account credentials. - - - - Initializes a new instance of the class using an absolute URI to the blob. - - The absolute URI to the blob. - - - - Initializes a new instance of the class using a relative URI to the blob. - - The relative URI to the blob, beginning with the container name. - A client object that specifies the endpoint for the Blob service. - - - - Initializes a new instance of the class using a relative URI to the blob. - - The relative URI to the blob, beginning with the container name. - The snapshot timestamp, if the blob is a snapshot. - A client object that specifies the endpoint for the Blob service. - - - - Initializes a new instance of the class based on an existing object. - - An object of type . - - - - Initializes a new instance of the class. - - The attributes. - The service client. - The snapshot time. - - - - Initializes a new instance of the class. - - The blob address. - The credentials. - If set to true, use path style Uris. - - - - Initializes a new instance of the class. - - The blob address. - If set to true, use path style Uris. - - - - Initializes a new instance of the class using the specified blob Uri. - Note that this is just a reference to a blob instance and no requests are issued to the service - yet to update the blob properties, attribute or metaddata. FetchAttributes is the API that - issues such request to the service. - - The blob address. - The service client. - The reference to the parent container. - - - - Initializes a new instance of the class using the specified blob Uri. - If snapshotTime is not null, the blob instance represents a Snapshot. - Note that this is just a reference to a blob instance and no requests are issued to the service - yet to update the blob properties, attribute or metaddata. FetchAttributes is the API that - issues such request to the service. - - The blob address. - Snapshot time in case the blob is a snapshot. - The service client. - The reference to the parent container. - - - - Creates a page blob. - - The maximum size of the page blob, in bytes. - - - - Creates a page blob. - - The maximum size of the page blob, in bytes. - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to create a page blob. - - The maximum size of the page blob, in bytes. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to create a page blob. - - The maximum size of the blob, in bytes. - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to create a page blob. - - An that references the pending asynchronous operation. - - - - Writes pages to a page blob. - - A stream providing the page data. - The offset at which to begin writing, in bytes. The offset must be a multiple of 512. - - - - Writes pages to a page blob. - - A stream providing the page data. - The offset at which to begin writing, in bytes. The offset must be a multiple of 512. - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to write pages to a page blob. - - A stream providing the page data. - The offset at which to begin writing, in bytes. The offset must be a multiple of 512. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to write pages to a page blob. - - A stream providing the page data. - The offset at which to begin writing, in bytes. The offset must be a multiple of 512. - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to write pages to a page blob. - - An that references the pending asynchronous operation. - - - - Clears pages from a page blob. - - The offset at which to begin clearing pages, in bytes. The offset must be a multiple of 512. - The length of the data range to be cleared, in bytes. The length must be a multiple of 512. - - - - Clears pages from a page blob. - - The offset at which to begin clearing pages, in bytes. The offset must be a multiple of 512. - The length of the data range to be cleared, in bytes. The length must be a multiple of 512. - An object that specifies any additional options for the request. - - - - Begins an asynchronous operation to clear pages from a page blob. - - The offset at which to begin clearing pages, in bytes. The offset must be a multiple of 512. - The length of the data range to be cleared, in bytes. The length must be a multiple of 512. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to clear pages from a page blob. - - The offset at which to begin clearing pages, in bytes. The offset must be a multiple of 512. - The length of the data range to be cleared, in bytes. The length must be a multiple of 512. - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to clear pages from a page blob. - - An that references the pending asynchronous operation. - - - - Gets a collection of page ranges and their starting and ending bytes. - - An enumerable collection of page ranges. - - - - Gets a collection of page ranges and their starting and ending bytes. - - An object that specifies any additional options for the request. - An enumerable collection of page ranges. - - - - Begins an asynchronous operation to return a collection of page ranges and their starting and ending bytes. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to return a collection of page ranges and their starting and ending bytes. - - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to return a collection of page ranges and their starting and ending bytes. - - An that references the pending asynchronous operation. - An enumerable collection of page ranges. - - - - Opens a stream for writing to the blob. - - A stream for writing to the blob. - This operation is not supported on objects of type . - - - - Opens a stream for writing to the blob. - - An object that specifies any additional options for the request. - A stream for writing to the blob. - This operation is not supported on objects of type . - - - - Uploads a blob from a stream. - - A stream that provides the blob content. - This operation is not supported on objects of type . - - - - Uploads a blob from a stream. - - A stream that provides the blob content. - An object that specifies any additional options for the request. - This operation is not supported on objects of type . - - - - Begins an asynchronous operation to upload a blob from a stream. - - The data stream to upload. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - This operation is not supported on objects of type . - - - - Begins an asynchronous operation to upload a blob from a stream. - - The data stream to upload. - An object that specifies any additional options for the request. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - This operation is not supported on objects of type . - - - - Ends an asynchronous operation to upload a blob from a stream. - - An that references the pending asynchronous operation. - This operation is not supported on objects of type . - - - - Uploads a string of text to a blob. - - The text to upload, encoded as a UTF-8 string. - This operation is not supported on objects of type . - - - - Uploads a string of text to a blob. - - The text to upload. - An object indicating the text encoding to use. - An object that specifies any additional options for the request. - This operation is not supported on objects of type . - - - - Uploads a file from the file system to a blob. - - The path and file name of the file to upload. - This operation is not supported on objects of type . - - - - Uploads a file from the file system to a blob. - - The path and file name of the file to upload. - An object that specifies any additional options for the request. - This operation is not supported on objects of type . - - - - Uploads an array of bytes to a blob. - - The array of bytes to upload. - This operation is not supported on objects of type . - - - - Uploads an array of bytes to a blob. - - The array of bytes to upload. - An object that specifies any additional options for the request. - This operation is not supported on objects of type . - - - - Creates an exception reporting that the creation method is not supported. - - The created exception. - - - - Implements the Create method. - - An object that specifies any additional options for the request. - The size in bytes. - A that creates the blob. - - - - Gets the page ranges impl. - - An object that specifies any additional options for the request. - The set result. - A for getting the page ranges. - - - - Implementation method for the WritePage methods. - - The page data. - The start offset. - The beginning position of the source stream prior to execution, negative if stream is unseekable. - An object that specifies any additional options for the request. - A that writes the pages. - - - - Implementation method for the ClearPage methods. - - The start offset. Must be multiples of 512. - Length of the data range to be cleared. Must be multiples of 512. - An object that specifies any additional options for the request. - A that writes the pages. - - - - Represents a Windows Azure queue. - - - - - Stores the queue attributes. - - - - - Uri for the messages. - - - - - Initializes a new instance of the class. - - The absolute URI to the queue. - The account credentials. - - - - Initializes a new instance of the class. - - The relative address. - The storage account credentials. - If set to true, use path style Uris. - - - - Initializes a new instance of the class. - - True to use path style Uris. - The address. - The credentials. - - - - Initializes a new instance of the class. - - The queue address. - The client. - - - - Initializes a new instance of the class. - - The attributes of the queue. - The client. - - - - Creates a queue. - - - - - Begins an asynchronous operation to create a queue. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to create a queue. - - An that references the pending asynchronous operation. - - - - Creates the queue if it does not exist. - - true if the queue did not exist and was created; otherwise false. - - - - Begins an asynchronous operation to create the queue if it does not exist. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to create the queue if it does not exist. - - An that references the pending asynchronous operation. - Returns true if the creation succeeded; otherwise, false. - - - - Deletes the queue. - - - - - Begins an asynchronous operation to delete the queue. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to delete the queue. - - An that references the pending asynchronous operation. - - - - Determines if the queue exists. - - True if the queue exists; otherwise false. - - - - Begins an asynchronous operation to determine whether the queue exists. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to determine whether the queue exists. - - An that references the pending asynchronous operation. - Returns true if the queue exists; otherwise, false. - - - - Fetches the queue's attributes. - - - - - Begins an asynchronous operation to fetch the queue's attributes. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to fetch the queue's attributes. - - An that references the pending asynchronous operation. - - - - Sets the queue's metadata. - - - - - Begins an asynchronous operation to set the queue's metadata. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to set the queue's metadata. - - An that references the pending asynchronous operation. - - - - Retrieves the approximate message count for the queue. This method fetches - the value from the server and updates the - property as well. - - The approximate message count. - - - - Adds a message to the queue. - - The message to add. - - - - Adds a message to the queue. - - The message to add. - The maximum time to allow the message to be in the queue. - - - - Adds a message to the queue. - - The message to add. - The maximum time to allow the message to be in the queue, or null. - The length of time from now during which the message will be invisible. - If null then the message will be visible immediately. - - - - Begins an asynchronous operation to add a message to the queue. - - The message to add. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to add a message to the queue. - - The message to add. - The maximum time to allow the message to be in the queue. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to add a message to the queue. - - The message to add. - The maximum time to allow the message to be in the queue, or null. - The length of time from now during which the message will be invisible. - If null then the message will be visible immediately. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to add a message to the queue. - - An that references the pending asynchronous operation. - - - - Gets a list of messages from the queue. - - The number of messages to retrieve. - An enumerable collection of messages. - - - - Gets a list of messages from the queue. - - The number of messages to retrieve. - The visibility timeout interval. - An enumerable collection of messages. - - - - Begins an asynchronous operation to get messages from the queue. - - The number of messages to retrieve. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to get messages from the queue. - - The number of messages to retrieve. - The visibility timeout interval. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to get messages from the queue. - - An that references the pending asynchronous operation. - An enumerable collection of messages. - - - - Gets a single message from the queue. - - A message. - - - - Gets a single message from the queue. - - The visibility timeout interval. - A message. - - - - Begins an asynchronous operation to get a single message from the queue. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to get a single message from the queue. - - The visibility timeout interval. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to get a single message from the queue. - - An that references the pending asynchronous operation. - A message. - - - - Peeks a message from the queue. - - A message. - - - - Begins an asynchronous operation to peek a message from the queue. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to peek a message from the queue. - - An that references the pending asynchronous operation. - A message. - - - - Peeks a set of messages from the queue. - - The number of messages to retrieve. - A enumerable collection of messages. - - - - Begins an asynchronous operation to peek a set of messages from the queue. - - The number of messages to retrieve. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to peek a set of messages from the queue. - - An that references the pending asynchronous operation. - An enumerable collection of messages. - - - - Deletes a message. - - A message. - - - - Deletes a message. - - The message ID. - The pop receipt value. - - - - Begins an asynchronous operation to delete a message. - - A message. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to delete a message. - - The message ID. - The pop receipt value. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to delete a message. - - An that references the pending asynchronous operation. - - - - Updates the visibility timeout and optionally the content of a message. - - The message to update. - The length of time from now during which the message will be invisible. - Flags indicating which parts of the message are to be updated. This must include the Visibility flag. - - - - Begins an asynchronous operation to update the visibility timeout and optionally the content of a message. - - The message to update. - The length of time from now during which the message will be invisible. - Flags indicating which parts of the message are to be updated. This must include the Visibility flag. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to update the visibility timeout and possibly the contents of a message. - - The IAsyncResult returned from a prior call to . - - - - Clears all messages from the queue. - - - - - Begins an asynchronous operation to clear all messages from the queue. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to clear all messages from the queue. - - An that references the pending asynchronous operation. - - - - Gets the individual message address. - - The message id. - The Uri of the message. - - - - Materialize results so that we can close the response object. - - List of response objects from the Protocol layer. - Projection function. - A materialized list of messages. - - - - Selects the get message response. - - The protocol message. - The parsed message. - - - - Selects the peek message response. - - The protocol message. - The parsed message. - - - - Gets the message internal. - - The visibility timeout. - The retrieved message. - - - - Gets the messages internal. - - The number of messages. - The visibility timeout. - A list of retrieved messages. - - - - Begins the get messages internal. - - The number of mesages. - The visibility timeout. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An asynchronous result that represents the operation. - - - - Existses the impl. - - The set result. - A that detects whether the queue exists. - - - - Sets the metadata impl. - - A that sets the metadata. - - - - Fetches the metadata and properties impl. - - A that fetches the attributes. - - - - Creates the impl. - - A that creates the queue. - - - - Creates if not exist impl. - - The set result. - A that creates the queue if it doesn't exist. - - - - Deletes the impl. - - A that deletes the queue. - - - - Clears the messages impl. - - A that clears the messages in the queue. - - - - Generates a task sequence for adding a message to the queue. - - The message. - The time to live. - The initial visibility delay. - A that adds the message. - - - - Generates a suitable string for representing the content of a message in the body of a web request. - - The message. - A string appropriately encoded depending on the format of the message and the EncodeMessage property. - - - - Peeks the messages impl. - - The number of messages. - The set result. - A that returns the peeked messages. - - - - Deletes the message impl. - - The message id. - The pop receipt value. - A that deletes the message. - - - - Generates a task sequence for updating a message in the queue. - - The message. - The visibility timeout. - The flags controlling which parts of the message to update. Must include Visibility. - A that updates the message. - - - - Gets the messages impl. - - The number of messages. - The visibility timeout. - The set result. - A that gets the message. - - - - Gets the properties and metadata from response. - - The web response. - - - - Gets the object that represents the Queue service. - - A client object that specifies the Queue service endpoint. - - - - Gets the queue name. - - The queue name. - - - - Gets the URI that identifies the queue. - - The address of the queue. - - - - Gets the queue's attributes. - - The queue's attributes. - - - - Gets the queue's user-defined metadata. - - The queue's user-defined metadata. - - - - Gets the approximate message count for the queue. - - The approximate message count. - - - - Gets or sets a value indicating whether to apply base64 encoding when adding or retrieving messages. - - True to encode messages; otherwise, false. The default value is true. - - - - Gets the Uri for general message operations. - - - - - Provides a client for accessing the Windows Azure Queue service. - - - - - The default server and client timeout interval. - - - - - Initializes a new instance of the class using the specified - Queue service endpoint and account credentials. - - The Queue service endpoint to use to create the client. - The account credentials. - - - - Initializes a new instance of the class using the specified - Queue service endpoint and account credentials. - - The Queue service endpoint to use to create the client. - The account credentials. - - - - Initializes a new instance of the class. - - The base address. - The credentials. - If set to true [use path style Uris]. - - - - Initializes a new instance of the class. - - The base address Uri. - The credentials. - If set to true [use path style Uris]. - - - - Initializes a new instance of the class. - - True to use path style Uris. - The base address Uri. - The credentials. - - - - Gets a reference to the queue at the specified address. - - Either the name of the queue, or the absolute URI to the queue. - A reference to the queue. - - - - Returns an enumerable collection of the queues in the storage account. - - An enumerable collection of queues. - - - - Returns an enumerable collection of the queues in the storage account whose names begin with the specified prefix. - - The queue name prefix. - An enumerable collection of queues. - - - - Returns an enumerable collection of the queues in the storage account whose names begin with the specified prefix and that are retrieved lazily. - - The queue name prefix. - One of the enumeration values that indicates which details to include in the listing. - An enumerable collection of queues that are retrieved lazily. - - - - Returns a result segment containing a collection of queues - in the storage account. - - A result segment containing a collection of queues. - - - - Returns a result segment containing a collection of queues - in the storage account. - - The queue name prefix. - One of the enumeration values that indicates which details to include in the listing. - A result segment containing a collection of queues. - - - - Returns a result segment containing a collection of queues - whose names begin with the specified prefix. - - The queue name prefix. - One of the enumeration values that indicates which details to include in the listing. - A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the - per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. - A continuation token returned by a previous listing operation. - A result segment containing a collection of queues. - - - - Begins an asynchronous operation to return a result segment containing a collection of queues - in the storage account. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to return a result segment containing a collection of queues - whose names begin with the specified prefix. - - The queue name prefix. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to return a result segment containing a collection of queues - whose names begin with the specified prefix. - - The queue name prefix. - One of the enumeration values that indicates which details to include in the listing. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to return a result segment containing a collection of queues - whose names begin with the specified prefix. - - The queue name prefix. - One of the enumeration values that indicates which details to include in the listing. - A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the - per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. - A continuation token returned by a previous listing operation. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to return a result segment containing a collection of queues. - - An that references the pending asynchronous operation. - A result segment containing the results of the first request. - - - - Gets the properties of the queue service. - - The queue service properties. - - - - Begins an asynchronous operation to get the properties of the queue service. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user defined object to be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to get the properties of the queue service. - - The result returned from a prior call to . - The queue service properties. - - - - Sets the properties of the queue service. - - The queue service properties. - - - - Begins an asynchronous operation to set the properties of the queue service. - - The queue service properties. - The callback delegate that will receive notification when the asynchronous operation completes. - A user defined object to be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to set the properties of the queue service. - - The result returned from a prior call to . - - - - Ends the get response. - - The asynchronous result. - The request. - The web response. - - - - Lists the queues impl. - - The prefix. - The details included. - The continuation token. - The max results. - The set result. - A for listing the queues. - - - - Lists the queues impl core. - - The prefix. - The details included. - The continuation token. - The pagination. - The set result. - A for listing the queues. - - - - Selects the response. - - The item to parse. - A object representing the item. - - - - Generates a task sequence for getting the properties of the queue service. - - A delegate to receive the service properties. - A task sequence that gets the properties of the queue service. - - - - Generates a task sequence for setting the properties of the queue service. - - The queue service properties to set. - A task sequence that sets the properties of the queue service. - - - - Occurs when a response is received from the server. - - - - - Gets or sets the default retry policy for requests made via the Queue service client. - - The retry policy. - - - - Gets or sets the server timeout for requests made via the Queue service client. - - The server timeout interval. - - - - Gets or sets the lifetime of the approximate message count cache. Obsolete. - - The lifetime of the approximate message count cache. - The approximate message count is not cached. This is an obsolete property that has no effect. - - - - Gets a value indicating whether requests made via the Queue service client will employ path-style URIs. - - True to use path-style URIs; otherwise, false. - - - - Gets the account credentials used to create the Queue service client. - - An object of type . - - - - Gets the base URI for the Queue service client. - - The base URI used to construct the Queue service client. - - - - Enum for Queue message type. - - - - - Indicates the message object stores the raw text string. - - - - - Indicates the message object stores the Base64-Encoded representation of the raw data. - - - - - Represents a message in a queue. - - - - - The maximum message size in bytes. - - - - - The maximum amount of time a message is kept in the queue. - - - - - The maximum number of messages that can be peeked at a time. - - - - - Custom UTF8Encoder to throw exception in case of invalid bytes. - - - - - Initializes a new instance of the class with the given byte array. - - The content of the message as a byte array. - - - - Initializes a new instance of the class with the given string. - - The content of the message as a string of text. - - - - Initializes a new instance of the class with the given Base64 encoded string. - This method is only used internally. - - The text string. - Whether the string is Base64 encoded. - - - - Sets the content of this message. - - The new message content. - - - - Sets the content of this message. - - The new message content. - - - - Gets the content of the message as a byte array. - - The content of the message as a byte array. - - - - Gets or sets the message ID. - - The message ID. - - - - Gets or sets the message's pop receipt. - - The pop receipt value. - - - - Gets or sets the time that the message was added to the queue. - - The time that that message was added to the queue. - - - - Gets or sets the time that the message expires. - - The time that the message expires. - - - - Gets or sets the time that the message will next be visible. - - The time that the message will next be visible. - - - - Gets the content of the message, as a string. - - The message content. - - - - Gets or sets the number of times this message has been dequeued. - - The number of times this message has been dequeued. - - - - Gets message type that indicates if the RawString is the original message string or Base64 encoding of the original binary data. - - - - - Gets or sets the original message string or Base64 encoding of the original binary data. - - The original message string. - - - - Provides a set of extensions to the class that may be used to generate client objects for - the Windows Azure storage services. - - - - - Creates a new Blob service client. - - The storage account. - A client object that specifies the Blob service endpoint. - - - - Creates a new Queue service client. - - The storage account. - A client object that specifies the Queue service endpoint. - - - - Creates the Table service client. - - The storage account. - A client object that specifies the Table service endpoint. - - - - Provides a client for accessing the Windows Azure Table service. - - - - - The default server and client timeout interval. - - - - - Initializes a new instance of the class using the specified Table service endpoint - and account credentials. - - The Table service endpoint to use to create the client. - The account credentials. - - - - Initializes a new instance of the class using the specified Table service endpoint - and account credentials. - - The Table service endpoint to use to create the client. - The account credentials. - - - - Creates the tables needed for the specified service context. - - The type of service context. - The Table service endpoint to use to create the client. - The account credentials. - - - - Creates a new object for performing operations against the Table service. - - A service context to use for performing operations against the Table service. - - - - Attaches to the specified service context. - - The service context to attach to. - - - - Begins an asychronous operation to create a table. - - The table name. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asychronous operation to create a table. - - An that references the pending asynchronous operation. - - - - Creates a table with specified name. - - The table name. - - - - Begins an asynchronous operation to create a table with the specified name if it does not already exist. - - The table name. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to create a table with the specified name if it does not already exist. - - An that references the pending asynchronous operation. - true if table was created; otherwise, false. - - - - Creates the table if it does not already exist. - - The table name. - true if table was created; otherwise, false. - - - - Begins an asynchronous operation to determine whether a table exists. - - The table name. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to determine whether a table exists. - - An that references the pending asynchronous operation. - true if table exists; otherwise, false. - - - - Checks whether the table exists. - - The table name. - true if table exists; otherwise, false. - - - - Returns an enumerable collection of table names in the storage account. - - An enumerable collection of table names. - - - - Returns an enumerable collection of table names that begin with the specified prefix and that are retrieved lazily. - - The table name prefix. - An enumerable collection of table names that are retrieved lazily. - - - - Returns a result segment containing a collection of table names in the storage account. - - A result segment containing table names. - - - - Returns a result segment containing a collection of table names in the storage account. - - A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the - per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. - A continuation token returned by a previous listing operation. - A result segment containing table names. - - - - Returns a result segment containing a collection of table names beginning with the specified prefix. - - The table name prefix. - A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the - per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. - A continuation token returned by a previous listing operation. - A result segment containing table names. - - - - Begins an asynchronous operation to return a result segment containing a collection of table names - in the storage account. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to return a result segment containing a collection - of table names beginning with the specified prefix. - - The table name prefix. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to return a result segment containing a collection - of table names beginning with the specified prefix. - - The table name prefix. - A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the - per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. - A continuation token returned by a previous listing operation. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to return a result segment containing a collection - of table names. - - An that references the pending asynchronous operation. - A result segment containing table names. - - - - Begins an asynchronous operation to delete a table. - - The table name. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - - An that references the asynchronous request. - - - - - Ends an asynchronous operation to delete a table. - - An that references the pending asynchronous operation. - - - - Deletes the table. - - The table name. - - - - Begins an asynchronous operation to delete the tables if it exists. - - The table name. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to delete the tables if it exists. - - An that references the pending asynchronous operation. - true if the table was deleted; otherwise, false. - - - - Deletes the table if it exists. - - The table name. - true if the table was deleted; otherwise, false. - - - - Gets the properties of the table service. - - The table service properties. - - - - Begins an asynchronous operation to get the properties of the table service. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user defined object to be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to get the properties of the table service. - - The result returned from a prior call to . - The table service properties. - - - - Sets the properties of the table service. - - The table service properties. - - - - Begins an asynchronous operation to set the properties of the table service. - - The table service properties. - The callback delegate that will receive notification when the asynchronous operation completes. - A user defined object to be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to set the properties of the table service. - - The result returned from a prior call to . - - - - Ends the asynchronous GetResponse operation. - - An that references the asynchronous operation. - The request to end the operation on. - The from the asynchronous request. - - - - Gets the result or default. - - The type of the result. - The task to retrieve the result from. - Receives result of the task. - true if the result was returned; otherwise, false. - - - - Creates the table implementation. - - The table name. - The set result. - A sequence of tasks to do the operation. - - - - Creates the table if not exist implementation. - - The table name. - The set result. - A sequence of tasks to do the operation. - - - - Verifies whether the table exist implementation. - - The table name. - The set result. - A sequence of tasks to do the operation. - - - - Returns an enumerable collection of tables segmented impl. - - The prefix. - The max results. - The continuation token. - The set result. - A that lists the tables. - - - - Returns an enumerable collection of tables segmented implementation. - - The prefix. - The continuation token. - The pagination. - The last result. - The set result. - A sequence of tasks to do the operation. - - - - Delete table implementation. - - The table name. - A sequence of tasks to do the operation. - - - - Deletes table if exists implementation. - - The table name. - The set result. - A sequence of tasks to do the operation. - - - - Generates a task sequence for getting the properties of the table service. - - A delegate to receive the service properties. - A task sequence that gets the properties of the table service. - - - - Generates a task sequence for setting the properties of the table service. - - The table service properties to set. - A task sequence that sets the properties of the table service. - - - - Occurs when a response is received from the server. - - - - - Gets the minimum supported timestamp value for a table entity. - - The minimum supported timestamp value for a table entity. - - - - Gets the base URI for the Table service client. - - The base URI used to construct the Table service client. - - - - Gets or sets the default retry policy for requests made via the Table service client. - - The retry policy. - - - - Gets or sets the default server timeout for requests made by the Table service client. - - The server timeout interval. - - - - Gets the account credentials used to create the Table service client. - - The account credentials. - - - - Represents a query against the Windows Azure Table service. - - The type of the query result. - - - - Stores the header prefix for continuation information. - - - - - Stores the header suffix for the next partition key. - - - - - Stores the header suffix for the next row key. - - - - - Stores the table suffix for the next table name. - - - - - Stores the maximum results the table service can return. - - - - - Stores the pagination options. - - - - - Stores the wrapped . - - - - - Initializes a new instance of the class with the specified query. - - The base query. - - - - Initializes a new instance of the class with the specified query - and retry policy. - - The base query. - The retry policy for the query. - - - - Executes the query with the retry policy specified on the object. - - The results of the query, retrieved lazily. - - - - Executes the query with the retry policy specified on the object. - - A continuation token returned by a previous listing operation. - The results of the query, retrieved lazily. - - - - Begins an asynchronous operation to execute a query and return the results as a result segment. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to execute a query and return the results as a result segment. - - A continuation token returned by a previous listing operation. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to execute a query and return the results as a result segment. - - The reference to the pending asynchronous request to finish. - A result segment containing objects of type . - - - - Expands the specified path. - - The path to expand. - A new query with the expanded path. - - - - Returns an enumerator that iterates through the collection. - - A that can be used to iterate through the collection. - - - - Returns a that represents this instance. - - A that represents this instance. - - - - Returns an enumerator that can be used to iterate through a collection. - - - An that can be used to iterate through a collection. - - - - - Executes the segmented impl. - - The continuation token. - The set result. - A that executes the query and returns the first segment of results. - - - - Rewrites the query for take count. - - The local query. - The pagination. - The rewritten query. - - - - Applies the continuation to query. - - The continuation token. - The local query. - The modified query. - - - - Gets the query take count. - - The query. - The take count of the query, if any. - - - - Gets the table continuation from response. - - The response. - The continuation. - - - - Gets or sets the retry policy for the query. - - The retry policy. - - - - Gets the type of the element(s) that are returned when the expression tree associated with this - instance of is executed. - - - A that represents the type of the element(s) that are returned when the expression tree associated with this object is executed. - - - - - Gets the expression tree that is associated with the instance of . - - - The that is associated with this instance of . - - - - - Gets the query provider that is associated with this data source. - - - The that is associated with this data source. - - - - - A set of common utilities for use in verfication. - - - - - Throws an exception if the string is empty or null. - - The name of the parameter. - The value of the parameter. - Thrown if value is empty. - Thrown if value is null. - - - - Throw an exception if the value is null. - - The name of the parameter. - The value of the parameter. - Thrown if value is null. - - - - Throw an exception indicating argument is out of range. - - The name of the parameter. - The value of the parameter. - - - - Throw an exception if the argument is out of bounds. - - The type of the value. - The name of the parameter. - The value of the parameter. - The minimum value for the parameter. - The maximum value for the parameter. - - - - Combines AssertNotNullOrEmpty and AssertInBounds for convenience. - - The name of the parameter. - Turns on or off null/empty checking. - The value of the parameter. - The maximum size of value. - - - - Throws if the result segment does not have more results. - - The type of the batch context. - The result segment to check. - - - - Determines if a Uri requires path style addressing. - - The Uri to check. - Returns true if the Uri uses path style addressing; otherwise, false. - - - - Asserts the segment result not empty. - - The type of the result segment. - The result. - - - - Performs a 'magic enumerator' lazy segmented enumeration. - - The type of the result. - The task sequence generator that produces the first segment. - The retry policy to use. - A 'magic enumerator' that makes requests when needed and chains segments accordingly. - - - - Rounds up to seconds. - - The time span. - The time rounded to seconds. - - - - Rounds up to seconds. - - The time span. - The time rounded to seconds. - - - - Rounds up to milliseconds. - - The time span. - The time rounded to milliseconds. - - - - Rounds up to milliseconds. - - The time span. - The time rounded to milliseconds. - - - - When calling the Get() operation on a queue, the content of messages - returned in the REST protocol are represented as Base64-encoded strings. - This internal function transforms the Base64 representation into a byte array. - - The Base64-encoded string. - The decoded bytes. - - - - Applies the request optimizations such as disabling buffering and 100 continue. - - The request to be modified. - The length of the content, -1 if the content length is not settable. - - - - Look for an inner exception of type DataServiceClientException. Different versions of Sytem.Data.Services.Client - have different levels of wrapping of a DataServiceClientException. - - The exception. - The found exception or null. - - - - Asserts the type of the continuation. - - The continuation token. - Type of the continuation. - - - - Specifies which details to include when listing the containers in this storage account. - - - - - No additional details. - - - - - Retrieve container metadata. - - - - - Retrieve all available details. - - - - - The set of options describing delete operation. - - - - - Delete blobs but not snapshots. - - - - - Delete the blob and its snapshots. - - - - - Delete the blob's snapshots only. - - - - - Contains methods for dealing with events. - - - - - This sets the event handler with request and response data and - translates storage exceptions. - - The request. - The handler. - The sender. - The processed response. - - - - This sets the event handler with request and response data and - translates storage exceptions. - - The request. - The async result. - The handler. - The sender. - The processed response. - - - - Set the event handler. - - The request. - The web response. - The event handler. - The sender. - The exception. - - - - The lease status of the blob. - - - - - The lease status is not specified. - - - - - The blob is locked for exclusive-write access. - - - - - The blob is available to be locked for exclusive write access. - - - - - Represents a block retrieved from the blob's block list. - - - - - Gets the name of the block. - - The block name. - - - - Gets the size of block in bytes. - - The block size. - - - - Gets a value indicating whether or not the block has been committed. - - True if the block has been committed; otherwise, false. - - - - Enumeration controlling the options for updating queue messages. - - - - - Update the message visibility timeout. - This is required for calls to UpdateMessage in version 2011-08-18. - - - - - Update the message content. - - - - - Contains methods for dealing with navigation. - - - - - The name of the root container. - - - - - Used in address parsing. - - - - - Used in address parsing. - - - - - Used in address parsing. - - - - - Used to split string on slash. - - - - - Used to split hostname. - - - - - Retrieves the container part of a storage Uri, or "$root" if the container is implicit. - - The blob address. - If set to true use path style Uris. - Name of the container. - - The trailing slash is always removed. - - GetContainerName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob")) will return "mycontainer" - GetConatinerName(new Uri("http://test.blob.core.windows.net/mycontainer/")) will return "mycontainer" - GetConatinerName(new Uri("http://test.blob.core.windows.net/myblob")) will return "$root" - GetConatinerName(new Uri("http://test.blob.core.windows.net/")) will throw ArgumentException - - - - - - Retrieves the blob part of a storage Uri. - - The blob address. - If set to true use path style Uris. - The name of the blob. - - - - Retreives the complete container address from a storage Uri - Example GetContainerAddress(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob")) - will return http://test.blob.core.windows.net/mycontainer. - - The BLOB address. - True to use path style Uris. - Uri of the container. - - - - Retreives the parent name from a storage Uri. - - The BLOB address. - The delimiter. - If set to true use path style Uris. - The name of the parent. - - Adds the trailing delimiter as the prefix returned by the storage REST api always contains the delimiter. - - - GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob", "/")) will return "/mycontainer/myfolder/" - GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder|myblob", "|") will return "/mycontainer/myfolder|" - GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myblob", "/") will return "/mycontainer/" - GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/", "/") will return "/mycontainer/" - - - - - Retrieves the parent address for a blob Uri. - - The BLOB address. - The delimiter. - If set to true use path style Uris. - The address of the parent. - - GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob", null)) - will return "http://test.blob.core.windows.net/mycontainer/myfolder/" - - - - - Get service client address from a complete Uri. - - Complete address of the resource. - True to use path style Uris. - Uri of the service client. - - GetServiceClientBaseAddress("http://testaccount.blob.core.windows.net/testconatiner/blob1") - returns "http://testaccount.blob.core.windows.net" - - - - - Gets the service client base address. - - The address Uri. - The use path style Uris. - The base address of the client. - - - - Appends a path to a Uri correctly using "/" as separator. - - The base Uri. - The relative or absloute URI. - The appended Uri. - - AppendPathToUri(new Uri("http://test.blob.core.windows.net/test", "abc") - will return "http://test.blob.core.windows.net/test/abc" - AppendPathToUri(new Uri("http://test.blob.core.windows.net/test"), "http://test.blob.core.windows.net/test/abc") - will return "http://test.blob.core.windows.net/test/abc" - - - - - Append a relative path to a Uri, handling traling slashes appropiately. - - The base Uri. - The relative or absloute URI. - The seperator. - The appended Uri. - - - - Get container name from address for styles of paths - Eg: http://test.blob.core.windows.net/container/blob => container - http://127.0.0.1:10000/test/container/blob => container. - - The container Uri. - If set to true use path style Uris. - The container name. - - - - Gets the canonical path from creds. - - The credentials. - The absolute path. - The canonical path. - - - - Similar to getting container name from Uri. - - The queue Uri. - If set to true use path style Uris. - The queue name. - - - - Retrieve the container address and address. - - The BLOB address. - True to use path style Uris. - Name of the container. - The container URI. - - - - Retrieve the container name and the blob name from a blob address. - - The blob address. - If set to true use path style Uris. - The resulting container name. - The resulting blob name. - - - - Represents a range of pages in a page blob. - - - - - Initializes a new instance of the class. - - The starting offset. - The ending offset. - - - - Returns the content of the page range as a string. - - The content of the page range. - - - - Gets the starting offset of the page range. - - The starting offset. - - - - Gets the ending offset of the page range. - - The ending offset. - - - - Class used to upload blocks for a blob in parallel. - - The parallelism factor is configurable at the CloudBlobClient. - - - - Stores the block size. - - - - - Stores the blob we're uploading. - - - - - Stores the request options to use. - - - - - Stores the blob's hash. - - - - - Stores the source stream to upload from. - - - - - Stores the dispensized stream size. - - - - - Bound on number of parallel active tasks (threads). - - - - - The list of uploaded blocks. - - - - - Number of block creation tasks. - - - - - Number of block upload tasks created. - - - - - Number of dispenser calls. - - - - - Initializes a new instance of the class. - - The source stream. - The request options. - The block size to use. - The blob to upload to. - - - - Perform a parallel upload of blocks for a blob from a given stream. - - The upload func. - A that uploads the blob in parallel. - - The operation is done as a series of alternate producer and consumer tasks. The producer tasks dispense out - chunks of source stream as fixed size blocks. This is done in serial order on a thread using InvokeTaskSequence's - serial execution. The consumer tasks upload each block in parallel on multiple thread. The producer thread waits - for at least one consumer task to finish before adding more producer tasks. The producer thread quits when no - more data can be read from the stream and no other pending consumer tasks. - - - - - Completes the asyncresult. - - The async results. - The index. - - - - Gets the wait timeout. - - The options. - The wait timeout. - - - - Upload a single block. This can happen on parallel threads. - - The block sequence prefix value. - The set result. - A that dispenses a block stream. - - - - Gets the parallelism factor. - - The parallelism factor. - - - - As a final step upload the block list to commit the blob. - - A that commits the blob. - - - - Assists in protocol implementation. - - - - - Gets the web request. - - The service client. - The options. - The retrieve request. - The web request. - - - - Parses the response XML from an operation to set the access policy for a container. - - - - - Provides a base class that is used internally to parse XML streams from storage service operations. - - The type to be parsed. - - - - Indicates that all parsable objects have been consumed. This field is reserved and should not be used. - - - - - Stores any objects that have not yet been parsed. This field is reserved and should not be used. - - - - - The reader used for parsing. This field is reserved and should not be used. - - - - - The IEnumerator over the parsed content. - - - - - Used to make sure that parsing is only done once, since a stream is not re-entrant. - - - - - Initializes a new instance of the ResponseParsingBase class. - - The stream to be parsed. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Parses the XML response. This method is reserved and should not be used. - - A collection of enumerable objects. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources, and optional - managed resources. - - True to release both managed and unmanaged resources; otherwise, false. - - - - This method is reserved and should not be used. - - True when the object is consumable. - - - - Parses the XML and close. - - A list of parsed results. - - - - Gets the parsable objects. This method is reserved and should not be used. - - The objects to parse. - - - - Initializes a new instance of the class. - - The stream to be parsed. - - - - Parses the response XML from a Set Container ACL operation to retrieve container-level access policy data. - - A list of enumerable key-value pairs. - - - - Gets an enumerable collection of container-level access policy identifiers. - - An enumerable collection of container-level access policy identifiers. - - - - Represents a container item returned in the XML response for a container listing operation. - - - - - Initializes a new instance of the class. - - - - - Gets the attributes for this container item. - - The container item's attributes. - - - - Represents a blob item returned in the XML response for a blob listing operation. - - - - - Defines an interface for blob items that are returned in the XML response for a blob listing operation. - - - - - Initializes a new instance of the class. - - The name of the blob. - The blob's attributes. - - - - Gets the attributes for this blob item. - - The blob item's attributes. - - - - Gets the name of the blob item. - - The name of the blob item. - - - - Provides a set of parameters for a blob listing operation. - - - - - Represents the listing context for enumeration operations. - - - - - Initializes a new instance of the class. - - The resource name prefix. - The maximum number of resources to return in a single operation, up to the per-operation limit of 5000. - - - - Gets or sets the Prefix value. - - The Prefix value. - - - - Gets or sets the MaxResults value. - - The MaxResults value. - - - - Gets or sets the Marker value. - - The Marker value. - - - - Initializes a new instance of the class. - - The blob prefix. - The maximum number of results to return. - The blob delimiter. - The include parameter. - - - - Gets or sets the delimiter for a blob listing operation. - - The delimiter to use to traverse the virtual hierarchy of blobs. - - The delimiter parameter enables the caller to traverse the blob namespace by using a user-configured delimiter. - Using this parameter, it is possible to traverse a virtual hierarchy of blobs as though it were a file system. - - - - - Gets or sets the details for the listing operation, which indicates the types of data to include in the - response. - - The details to include in the listing operation. - - The include parameter specifies that the response should include one or more of the following subsets: snapshots, - metadata, uncommitted blobs. - - - - - Represents the blob name prefix that is returned in the XML response for a blob listing operation. - - - - - Gets the blob name prefix. - - The blob name prefix. - - - - Provides a set of methods for constructing requests for blob operations. - - - - - Constructs a web request to create a new block blob or page blob, or to update the content - of an existing block blob. - - The absolute URI to the blob. - The server timeout interval. - The properties to set for the blob. - The type of the blob. - The lease ID, if the blob has an active lease. - For a page blob, the size of the blob. This parameter is ignored - for block blobs. - A web request to use to perform the operation. - - - - Constructs a web request to delete a blob. - - The absolute URI to the blob. - The server timeout interval. - The snapshot timestamp, if the blob is a snapshot. - A set of options indicating whether to delete only blobs, only snapshots, or both. - The lease ID, if the blob has an active lease. - A web request to use to perform the operation. - - - - Constructs a web request to return the user-defined metadata for the blob. - - The absolute URI to the blob. - The server timeout interval. - The snapshot timestamp, if the blob is a snapshot. - The lease ID, if the blob has an active lease. - A web request for performing the operiaton. - - - - Constructs a web request to set user-defined metadata for the blob. - - The absolute URI to the blob. - The server timeout interval. - The lease ID, if the blob has an active lease. - A web request for performing the operation. - - - - Signs the request for Shared Key authentication. - - The web request. - The account credentials. - - - - Adds user-defined metadata to the request as one or more name-value pairs. - - The web request. - The user-defined metadata. - - - - Adds user-defined metadata to the request as a single name-value pair. - - The web request. - The metadata name. - The metadata value. - - - - Constructs a web request to return the blob's system properties. - - The absolute URI to the blob. - The server timeout interval. - The snapshot timestamp, if the blob is a snapshot. - The lease ID. - A web request for performing the operation. - - - - Signs the request for Shared Key Lite authentication. - - The web request. - The account credentials. - - - - Adds a conditional header to the request. - - The web request. - The type of conditional header to add. - The blob's ETag. - - - - Adds a conditional header to the request. - - The web request. - The type of conditional header to add. - The date and time specification for the request. - - - - Constructs a web request to return a listing of all blobs in the container. - - The absolute URI to the blob. - The server timeout interval. - A set of parameters for the listing operation. - A web request to use to perform the operation. - - - - Constructs a web request to copy a blob. - - The absolute URI to the destination blob. - The server timeout interval. - The canonical path to the source blob, in the form /<account-name>/<container-name>/<blob-name>. - The snapshot version, if the source blob is a snapshot. - A type of condition to check on the source blob. - The value of the condition to check on the source blob. - The lease ID for the source blob, if it has an active lease. - A web request to use to perform the operation. - - - - Constructs a web request to get the blob's content, properties, and metadata. - - The absolute URI to the blob. - The server timeout interval. - The snapshot version, if the blob is a snapshot. - The lease ID for the blob, if it has an active lease. - A web request for performing the operation. - - - - Constructs a web request to return a specified range of the blob's content, together with its properties and metadata. - - The absolute URI to the blob. - The server timeout interval, in seconds. - The snapshot version, if the blob is a snapshot. - The byte offset at which to begin returning content. - The number of bytes to return, or null to return all bytes through the end of the blob. - The lease ID for the blob if it has an active lease, or null if there is no lease. - A web request to use to perform the operation. - - - - Constructs a web request to return the list of blocks for a block blob. - - The absolute URI to the blob. - The server timeout interval. - The snapshot timestamp, if the blob is a snapshot. - The types of blocks to include in the list: committed, uncommitted, or both. - The lease ID for the blob, if it has an active lease. - A web request to use to perform the operation. - - - - Constructs a web request to return the list of active page ranges for a page blob. - - The absolute URI to the blob. - The server timeout interval. - The snapshot timestamp, if the blob is a snapshot. - The lease ID, if the blob has an active lease. - A web request to use to perform the operation. - - - - Constructs a web request to use to acquire, renew, release or break the lease for the blob. - - The absolute URI to the blob. - The server timeout interval. - The lease action to perform. - The lease ID. - A web request to use to perform the operation. - - - - Constructs a web request to write a block to a block blob. - - The absolute URI to the blob. - The server timeout interval. - The block ID for this block. - The lease ID for the blob, if it has an active lease. - A web request to use to perform the operation. - - - - Constructs a web request to create or update a blob by committing a block list. - - The absolute URI to the blob. - The server timeout interval. - The properties to set for the blob. - The lease ID, if the blob has an active lease. - A web request for performing the operation. - - - - Writes the body of the block list to the specified stream in XML format. - - An enumerable collection of objects. - The stream to which the block list is written. - - - - Constructs a web request to write or clear a range of pages in a page blob. - - The absolute URI to the blob. - The server timeout interval. - The blob's properties. - The lease ID, if the blob has an active lease. - A web request to use to perform the operation. - - - - Constructs a web request to set system properties for a blob. - - The absolute URI to the blob. - The server timeout interval. - The blob's properties. - The lease ID, if the blob has an active lease. - The new blob size, if the blob is a page blob. Set this parameter to null to keep the existing blob size. - A web request to use to perform the operation. - - - - Constructs a web request to create a snapshot of a blob. - - The absolute URI to the blob. - The server timeout interval. - A web request to use to perform the operation. - - - - Creates a web request to get the properties of the service. - - The absolute URI to the service. - The server timeout interval, in seconds. - A web request to get the service properties. - - - - Creates a web request to set the properties of the service. - - The absolute URI to the service. - The server timeout interval, in seconds. - A web request to set the service properties. - - - - Writes service properties to a stream, formatted in XML. - - The service properties to format and write to the stream. - The stream to which the formatted properties are to be written. - - - - Adds the snapshot. - - The builder. - The snapshot version, if the blob is a snapshot. - - - - Creates the web request. - - The Uri of the resource. - The timeout to apply. - The query builder to use. - The resulting . - - - - Provides a set of methods for parsing responses from blob operations. - - - - - Returns extended error information from the storage service, that is in addition to the HTTP status code returned with the response. - - The web response. - An object containing extended error information returned with the response. - - - - Gets a collection of user-defined metadata from the response. - - The web response. - A collection of user-defined metadata, as name-value pairs. - - - - Gets an array of values for a specified name-value pair from a response that includes user-defined metadata. - - The web response. - The name associated with the metadata values to return. - An array of metadata values. - - - - Gets the blob's attributes, including its metadata and properties, from the response. - - The web response. - The blob's attributes. - - - - Gets the request ID from the response. - - The web response. - A unique value associated with the request. - - - - Gets the snapshot timestamp from the response. - - The web response. - The snapshot timestamp. - - - - Parses the response for a blob listing operation. - - The response stream. - An object that may be used for parsing data from the results of a blob listing operation. - - - - Parses the response for a blob listing operation. - - The web response. - An object that may be used for parsing data from the results of a blob listing operation. - - - - Parses the response for an operation that returns a block list for the blob. - - The response stream. - An object that may be used for parsing data from the results of an operation to return a block list. - - - - Parses the response for an operation that returns a block list for the blob. - - The web response. - An object that may be used for parsing data from the results of an operation to return a block list. - - - - Parses the response for an operation that returns a range of pages. - - The response stream. - An object that may be used for parsing data from the results of an operation to return a range of pages. - - - - Parses the response for an operation that returns a range of pages. - - The web response. - An object that may be used for parsing data from the results of an operation to return a range of pages. - - - - Reads service properties from a stream. - - The stream from which to read the service properties. - The service properties stored in the stream. - - - - Indicates which block lists should be searched to find a specified block. - - - - - Search the committed block list only. - - - - - Search the uncommitted block list only. - - - - - Search the uncommitted block list first, and if the block is not found there, search - the committed block list. - - - - - Represents the base canonicalization strategy used to authenticate a request against the storage services. - - - - - Constructs a canonicalized string for signing a request. - - The web request. - The name of the storage account. - A canonicalized string. - - - - Constructs a canonicalized string from the request's headers that will be used to construct the signature - string for signing a Blob or Queue service request under the Shared Key Lite authentication scheme. - - The request URI. - The storage account name. - The verb to be used for the HTTP request. - The content type of the HTTP request. - The date/time specification for the HTTP request. - A collection of additional headers specified on the HTTP request. - A canonicalized string. - - - - Constructs a canonicalized string from the request's headers that will be used to construct the signature - string for signing a Blob or Queue service request under the Shared Key Lite authentication scheme. - - The request URI. - The storage account name. - The verb to be used for the HTTP request. - The content type of the HTTP request. - The length of the HTTP request, in bytes. - The date/time specification for the HTTP request. - A collection of additional headers specified on the HTTP request. - A canonicalized string. - - - - Gets the value of a standard HTTP header. - - The collection of headers. - The name of the header. - The header value. - - - - Returns an of HTTP header values for a named header. - - A collection of HTTP headers as name-values pairs. - The name of the header to return. - An of HTTP header values, stored in the same order as they appear in the collection. - - - - Appends a string to the canonicalized resource string. - - The canonicalized resource string. - The string to append. - The modified canonicalized resource string. - - - - Gets the canonicalized resource string for a Blob or Queue service request under the Shared Key Lite authentication scheme. - - The resource URI. - The name of the storage account. - The canonicalized resource string. - - - - Gets the canonicalized resource string for a Blob or Queue service request under the Shared Key authentication scheme. - - The resource URI. - The name of the storage account. - The canonicalized resource string. - - - - Adds the canonicalized resource for version 2. - - The address. - Name of the account. - The canonicalized string. - - - - Add the resource name. - - The address. - Name of the account. - The canonicalized string. - - - - Add x-ms- prefixed headers in a fixed order. - - The headers. - The canonicalized string. - - - - Retrieve appropriate version of CanonicalizationStrategy based on the webrequest - for Blob Queue and Table. - - - - - Stores the version 1 blob/queue full signing strategy. - - - - - Stores the version 1 table lite signing strategy. - - - - - Stores the version 2 blob/queue full signing strategy. - - - - - Stores the version 1 table full signing strategy. - - - - - Gets canonicalization strategy for Blob and Queue SharedKey Authentication. - - The request. - The canonicalization strategy. - - - - Get canonicalization strategy for Tables for SharedKeyLite Authentication. - - The request. - The canonicalization strategy. - - - - Gets the table full canonicalization strategy. - - The request. - The canonicalization strategy. - - - - Gets the BLOB queue lite canonicalization strategy. - - The request. - The canonicalization strategy. - - - - Determines whether [is target version2] [the specified request]. - - The request. - - Returns true if [is target version2] [the specified request]; otherwise, false. - - - - - Gets the BLOB queue full ver1. - - The BLOB queue full ver1. - - - - Gets the table lite ver1. - - The table lite ver1. - - - - Gets the table full ver1. - - The table full ver1. - - - - Gets the BLOB queue full ver2. - - The BLOB queue full ver2. - - - - An internal class that stores the canonicalized string version of an HTTP request. - - - - - Stores the internal that holds the canonicalized string. - - - - - Initializes a new instance of the class. - - The first canonicalized element to start the string with. - - - - Append additional canonicalized element to the string. - - An additional canonicalized element to append to the string. - - - - Gets the canonicalized string. - - - - - Specifies the kinds of conditional headers that may be set for a request. - - - - - Indicates that no conditional headers are set. - - - - - The If-Unmodified-Since header. - - - - - The If-Match header. - - - - - The If-Modified-Since header. - - - - - The If-None-Match header. - - - - - Contains storage constants. - - - - - Maximum number of shared access policy identifiers supported by server. - - - - - Default Write Block Size used by Blob stream. - - - - - Default Read Ahead Size used by Blob stream. - - - - - The maximum size of a blob before it must be separated into blocks. - - - - - The maximum size of a blob with blocks. - - - - - The maximum size of a single block. - - - - - The maximum number of blocks. - - - - - Default size of buffer for unknown sized requests. - - - - - This is used to create BlockIDs. The prefix must be Base64 compatible. - - - - - The size of a page in a PageBlob. - - - - - A constant representing a kilo-byte (Non-SI version). - - - - - A constant representing a megabyte (Non-SI version). - - - - - A constant representing a megabyte (Non-SI version). - - - - - XML element for committed blocks. - - - - - XML element for uncommitted blocks. - - - - - XML element for blocks. - - - - - XML element for names. - - - - - XML element for sizes. - - - - - XML element for block lists. - - - - - XML element for queue message lists. - - - - - XML element for queue messages. - - - - - XML element for message IDs. - - - - - XML element for insertion times. - - - - - XML element for expiration times. - - - - - XML element for pop receipts. - - - - - XML element for the time next visible fields. - - - - - XML element for message texts. - - - - - XML element for dequeue counts. - - - - - XML element for page ranges. - - - - - XML element for page list elements. - - - - - XML element for page range start elements. - - - - - XML element for page range end elements. - - - - - XML element for delimiters. - - - - - XML element for blob prefixes. - - - - - XML element for content type fields. - - - - - XML element for content encoding fields. - - - - - XML element for content language fields. - - - - - XML element for content length fields. - - - - - XML element for content MD5 fields. - - - - - XML element for blobs. - - - - - XML element for prefixes. - - - - - XML element for maximum results. - - - - - XML element for markers. - - - - - XML element for the next marker. - - - - - XML element for the ETag. - - - - - XML element for the last modified date. - - - - - XML element for the Url. - - - - - XML element for blobs. - - - - - Constant signalling a page blob. - - - - - Constant signalling a block blob. - - - - - Constant signalling the blob is locked. - - - - - Constant signalling the blob is unlocked. - - - - - XML element for blob types. - - - - - XML element for the lease status. - - - - - XML element for snapshots. - - - - - XML element for containers. - - - - - XML element for a container. - - - - - XML element for queues. - - - - - XML element for the queue name. - - - - - Version 2 of the XML element for the queue name. - - - - - XML element for the queue. - - - - - XML element for the metadata. - - - - - XML element for an invalid metadata name. - - - - - XPath query for error codes. - - - - - XPath query for error messages. - - - - - XML element for maximum results. - - - - - XML element for committed blocks. - - - - - XML element for uncommitted blocks. - - - - - XML element for the latest. - - - - - XML element for signed identifiers. - - - - - XML element for a signed identifier. - - - - - XML element for access policies. - - - - - XML attribute for IDs. - - - - - XML element for the start time of an access policy. - - - - - XML element for the end of an access policy. - - - - - XML element for the permissions of an access policy. - - - - - The maximum size of a string property for the table service in bytes. - - - - - The maximum size of a string property for the table service in chars. - - - - - The name of the special table used to store tables. - - - - - The Uri path component to access the messages in a queue. - - - - - XML root element for errors. - - - - - XML element for error codes. - - - - - XML element for error messages. - - - - - XML element for exception details. - - - - - XML element for exception messages. - - - - - XML element for stack traces. - - - - - XML element for the authentication error details. - - - - - XML namespace for the WCF Data Services metadata. - - - - - XML element for table error codes. - - - - - XML element for table error messages. - - - - - Default client side timeout for all service clients. - - - - - Maximum allowed timeout for any request. - - - - - This is used to create V1 BlockIDs. The prefix must be Base64 compatible. - - - - - This is the offset of the V2 MD5 string where the MD5/ tag resides. - - - - - This is used to create BlockIDs. The prefix must be Base64 compatible. - - - - - This is the offset of the V2 MD5 string where the hash value resides. - - - - - This is the expected length of a V2 MD5 Block ID string. - - - - - The minimum supported value for the table service. - - - - - The timeout after which the WCF Data Services bug workaround kicks in. This should be greater than the timeout we pass to DataServiceContext (90 seconds). - - - - - Constants for HTTP headers. - - - - - Master Windows Azure Storage header prefix. - - - - - Header prefix for properties. - - - - - Header prefix for metadata. - - - - - Header for data ranges. - - - - - Header for storage version. - - - - - Header for copy source. - - - - - Header for the If-Match condition. - - - - - Header for the If-Modified-Since condition. - - - - - Header for the If-None-Match condition. - - - - - Header for the If-Unmodified-Since condition. - - - - - Header for the blob content length. - - - - - Header for the blob type. - - - - - Header for snapshots. - - - - - Header to delete snapshots. - - - - - Header that specifies approximate message count of a queue. - - - - - Header that specifies a range. - - - - - Header that specifies blob caching control. - - - - - Header that specifies blob content encoding. - - - - - Header that specifies blob content language. - - - - - Header that specifies blob content MD5. - - - - - Header that specifies blob content type. - - - - - Header that specifies blob content length. - - - - - Header that specifies lease ID. - - - - - Header that specifies lease status. - - - - - Header that specifies page write mode. - - - - - Header that specifies the date. - - - - - Header indicating the request ID. - - - - - Header that specifies public access to blobs. - - - - - Format string for specifying ranges. - - - - - Current storage version header value. - - - - - Specifies the page blob type. - - - - - Specifies the block blob type. - - - - - Specifies only snapshots are to be included. - - - - - Specifies snapshots are to be included. - - - - - Specifies the value to use for UserAgent header. - - - - - Specifies the pop receipt for a message. - - - - - Specifies the next visible time for a message. - - - - - Constants for query strings. - - - - - Query component for snapshot time. - - - - - Query component for the signed SAS start time. - - - - - Query component for the signed SAS expiry time. - - - - - Query component for the signed SAS resource. - - - - - Query component for the signed SAS permissions. - - - - - Query component for the signed SAS identifier. - - - - - Query component for the signed SAS version. - - - - - Query component for SAS signature. - - - - - Query component for message time-to-live. - - - - - Query component for message visibility timeout. - - - - - Query component for message pop receipt. - - - - - Query component for resource type. - - - - - Query component for the operation (component) to access. - - - - - Provides a set of methods for constructing requests for container operations. - - - - - Constructs a web request to create a new container. - - The absolute URI to the container. - The server timeout interval. - A web request to use to perform the operation. - - - - Constructs a web request to delete the container and all of blobs within it. - - The absolute URI to the container. - The server timeout interval. - A web request to use to perform the operation. - - - - Constructs a web request to retrieve the container's metadata. - - The absolute URI to the container. - The server timeout interval. - A web request to use to perform the operation. - - - - Constructs a web request to return the user-defined metadata for this container. - - The absolute URI to the container. - The server timeout interval. - A web request to use to perform the operation. - - - - Constructs a web request to set user-defined metadata for the container. - - The absolute URI to the container. - The server timeout interval. - A web request to use to perform the operation. - - - - Signs the request for Shared Key authentication. - - The web request. - The account credentials. - - - - Adds user-defined metadata to the request as one or more name-value pairs. - - The web request. - The user-defined metadata. - - - - Adds user-defined metadata to the request as a single name-value pair. - - The web request. - The metadata name. - The metadata value. - - - - Signs the request for Shared Key Lite authentication. - - The web request. - The account credentials. - - - - Adds a conditional header to the request. - - The web request. - The type of conditional header to add. - The container's ETag. - - - - Adds a conditional header to the request. - - The web request. - The type of conditional header to add. - The date and time specification for the request. - - - - Constructs a web request to return a listing of all containers in this storage account. - - The absolute URI for the account. - The server timeout interval. - A set of parameters for the listing operation. - Additional details to return with the listing. - A web request for the specified operation. - - - - Constructs a web request to return the ACL for this container. - - The absolute URI to the container. - The server timeout interval. - A web request to use to perform the operation. - - - - Sets the ACL for the container. - - The absolute URI to the container. - The server timeout interval. - The type of public access to allow for the container. - A web request to use to perform the operation. - - - - Writes a collection of shared access policies to the specified stream in XML format. - - A collection of shared access policies. - An output stream. - - - - Gets the container Uri query builder. - - A for the container. - - - - Creates the web request. - - The absolute URI to the container. - The server timeout interval. - The query builder to use. - A web request to use to perform the operation. - - - - Provides a set of methods for parsing responses from container operations. - - - - - Returns extended error information from the storage service, that is in addition to the HTTP status code returned with the response. - - The web response. - An object containing extended error information returned with the response. - - - - Gets a collection of user-defined metadata from the response. - - The web response. - A collection of user-defined metadata, as name-value pairs. - - - - Gets an array of values for a specified name-value pair from the user-defined metadata included in the response. - - The web response. - The name associated with the metadata values to return. - An array of metadata values. - - - - Gets the container's attributes, including its metadata and properties, from the response. - - The web response. - The container's attributes. - - - - Gets the request ID from the response. - - The web response. - A unique value associated with the request. - - - - Gets the ACL for the container from the response. - - The web response. - A value indicating the public access level for the container. - - - - Parses the response for a container listing operation. - - The web response. - An object that may be used for parsing data from the results of a container listing operation. - - - - Represents the credentials used to sign a request against the storage services. - - - - - Initializes a new instance of the class. - - The storage account name. - The access key. - - - - Initializes a new instance of the class. - - The storage account name. - The access key, as a Base64-encoded string. - - - - Exports the value of the access key to an array of bytes. - - The account access key. - - - - Exports the value of the access key to a Base64-encoded string. - - The account access key. - - - - Gets the account name to be used in signing the request. - - The name of the account. - - - - Gets or sets the account name whose key is used to sign requests. - - The name of the account whose key is used to sign requests. - - - - Gets the access key to be used in signing the request. - - - - - Provides methods for parsing the response from an operation to return a block list. - - - - - Initializes a new instance of the class. - - The stream to be parsed. - - - - Parses the XML response returned by an operation to retrieve a list of blocks. - - An enumerable collection of objects. - - - - Gets an enumerable collection of objects from the response. - - An enumerable collection of objects. - - - - Provides methods for parsing the response from an operation to get messages from a queue. - - - - - Initializes a new instance of the class. - - The stream of messages to parse. - - - - Parses the XML response returned by an operation to get messages from a queue. - - An enumerable collection of objects. - - - - Gets an enumerable collection of objects from the response. - - An enumerable collection of objects. - - - - Provides methods for parsing the response from an operation to get a range of pages for a page blob. - - - - - Initializes a new instance of the class. - - The stream of page ranges to be parsed. - - - - Parses the XML response for an operation to get a range of pages for a page blob. - - An enumerable collection of objects. - - - - Gets an enumerable collection of objects from the response. - - An enumerable collection of objects. - - - - Describes actions that can be performed on a lease. - - - - - Acquire the lease. - - - - - Renew the lease. - - - - - Release the lease. - - - - - Break the lease. - - - - - Provides methods for parsing the response from a blob listing operation. - - - - - Stores the blob prefix. - - - - - Signals when the blob prefix can be consumed. - - - - - Stores the marker. - - - - - Signals when the marker can be consumed. - - - - - Stores the blob delimiter. - - - - - Signals when the blob delimiter can be consumed. - - - - - Stores the max results. - - - - - Signals when the max results can be consumed. - - - - - Stores the next marker. - - - - - Signals when the next marker can be consumed. - - - - - Initializes a new instance of the class. - - The stream to be parsed. - - - - Parses the response XML for a blob listing operation. - - An enumerable collection of objects that implement . - - - - Gets the listing context from the XML response. - - A set of parameters for the listing operation. - - - - Gets an enumerable collection of objects that implement from the response. - - An enumerable collection of objects that implement . - - - - Gets the Prefix value provided for the listing operation from the XML response. - - The Prefix value. - - - - Gets the Marker value provided for the listing operation from the XML response. - - The Marker value. - - - - Gets the Delimiter value provided for the listing operation from the XML response. - - The Delimiter value. - - - - Gets the MaxResults value provided for the listing operation from the XML response. - - The MaxResults value. - - - - Gets the NextMarker value from the XML response, if the listing was not complete. - - The NextMarker value. - - - - Provides methods for parsing the response from a container listing operation. - - - - - Stores the container prefix. - - - - - Signals when the container prefix can be consumed. - - - - - Stores the marker. - - - - - Signals when the marker can be consumed. - - - - - Stores the max results. - - - - - Signals when the max results can be consumed. - - - - - Stores the next marker. - - - - - Signals when the next marker can be consumed. - - - - - Initializes a new instance of the class. - - The stream to be parsed. - - - - Parses the response XML for a container listing operation. - - An enumerable collection of objects. - - - - Gets the listing context from the XML response. - - A set of parameters for the listing operation. - - - - Gets an enumerable collection of objects from the response. - - An enumerable collection of objects. - - - - Gets the Prefix value provided for the listing operation from the XML response. - - The Prefix value. - - - - Gets the Marker value provided for the listing operation from the XML response. - - The Marker value. - - - - Gets the MaxResults value provided for the listing operation from the XML response. - - The MaxResults value. - - - - Gets the NextMarker value from the XML response, if the listing was not complete. - - The NextMarker value. - - - - Provides methods for parsing the response from a queue listing operation. - - - - - Stores the prefix. - - - - - Signals when the prefix can be consumed. - - - - - Stores the marker. - - - - - Signals when the marker can be consumed. - - - - - Stores the max results. - - - - - Signals when the max results can be consumed. - - - - - Stores the next marker. - - - - - Signals when the next marker can be consumed. - - - - - Initializes a new instance of the class. - - The stream to be parsed. - - - - Parses the response XML for a queue listing operation. - - An enumerable collection of objects. - - - - Gets the listing context from the XML response. - - A set of parameters for the listing operation. - - - - Gets an enumerable collection of objects from the response. - - An enumerable collection of objects. - - - - Gets the Prefix value provided for the listing operation from the XML response. - - The Prefix value. - - - - Gets the Marker value provided for the listing operation from the XML response. - - The Marker value. - - - - Gets the MaxResults value provided for the listing operation from the XML response. - - The MaxResults value. - - - - Gets the NextMarker value from the XML response, if the listing was not complete. - - The NextMarker value. - - - - Enumeration representing the state of logging in a service. - - - - - Logging is disabled. - - - - - Log read operations. - - - - - Log write operations. - - - - - Log delete operations. - - - - - Log all operations. - - - - - Class representing the service properties pertaining to logging. - - - - - Gets or sets the version of the analytics service. - - A string identifying the version of the service. - - - - Gets or sets the state of logging. - - A combination of flags describing the operations that are logged. - - - - Gets or sets the logging retention policy. - - The number of days to retain the logs. - - - - Enumeration representing the state of metrics collection in a service. - - - - - Metrics collection is disabled. - - - - - Service-level metrics collection is enabled. - - - - - Service-level and API metrics collection are enabled. - - - - - Class representing the service properties pertaining to metrics. - - - - - Gets or sets the version of the analytics service. - - A string identifying the version of the service. - - - - Gets or sets the state of metrics collection. - - A value indicating which metrics to collect, if any. - - - - Gets or sets the logging retention policy. - - The number of days to retain the logs. - - - - Describes actions that may be used for writing to a page blob or clearing a set of pages. - - - - - Update the page with new data. - - - - - Clear the page. - - - - - A class to help with parsing. - - - - - Converts a string to UTC time. - - The string to convert. - A UTC representation of the string. - - - - Provides methods for parsing the response from an operation to peek messages from a queue. - - - - - Initializes a new instance of the class. - - The stream to be parsed. - - - - Parses the XML response returned by an operation to get messages from a queue. - - An enumerable collection of objects. - - - - Gets an enumerable collection of objects from the response. - - An enumerable collection of objects. - - - - Represents a block in a block list. - - - - - Initializes a new instance of the class. - - The block ID. - One of the enumeration values that specifies in which block lists to search for the block. - - - - Gets the block ID. - - The block ID. - - - - Gets a value that indicates which block lists to search for the block. - - One of the enumeration values that specifies in which block lists to search for the block. - - - - Represents properties for writing to a page blob. - - - - - Initializes a new instance of the class. - - - - - Gets or sets the range of bytes to write to. - - The page range. - - - - Gets or sets the type of write operation. - - The type of page write operation. - - - - Represents a queue item returned in the XML response for a queue listing operation. - - - - - Initializes a new instance of the class. - - The name of the queue. - The queue's attributes. - - - - Gets the name of the queue. - - The queue name. - - - - Gets the queue's attributes. - - The queue's attributes. - - - - Represents a message retrieved from a queue. - - - - - Initializes a new instance of the class. - - - - - Gets the message expiration time. - - The message expiration time. - - - - Gets the message ID. - - The message ID. - - - - Gets the time the message was added to the queue. - - The message insertion time. - - - - Gets the time the message is next visible. - - The time the message is next visible. - - - - Gets the pop receipt for the message. - - The message's pop receipt. - - - - Gets the text of the message. - - The message text. - - - - Gets the number of times this message has been dequeued. - - The dequeue count. - - - - Provides a set of methods for constructing requests for queue operations. - - - - - Constructs a web request to create a queue. - - The absolute URI to the queue. - The server timeout interval. - A web request for performing the operation. - - - - Constructs a web request to delete a queue. - - The absolute URI to the queue. - The server timeout interval. - A web request for performing the operation. - - - - Constructs a web request to return the user-defined metadata for the queue. - - The absolute URI to the queue. - The server timeout interval. - A web request for performing the operation. - - - - Constructs a web request to set user-defined metadata for the queue. - - The absolute URI to the queue. - The server timeout interval. - A web request for performing the operation. - - - - Signs the request for Shared Key authentication. - - The web request. - The account credentials. - - - - Adds user-defined metadata to the request as one or more name-value pairs. - - The web request. - The user-defined metadata. - - - - Adds user-defined metadata to the request as a single name-value pair. - - The web request. - The metadata name. - The metadata value. - - - - Signs the request for Shared Key Lite authentication. - - The web request. - The account credentials. - - - - Constructs a web request to return a listing of all queues in the storage account. - - The absolute URI to the queue. - The server timeout interval. - A set of parameters for the listing operation. - One of the enumeration values indicating which details to include in the listing. - A web request to use to perform the operation. - - - - Constructs a web request to clear all messages in the queue. - - The absolute URI to the queue. - The server timeout interval. - A web request for the specified operation. - - - - Constructs a web request to delete the specified message. - - The absolute URI to the queue. - The server timeout interval. - The pop receipt value for the message. - A web request for the specified operation. - - - - Constructs a web request to retrieve a specified number of messages. - - The absolute URI to the queue. - The server timeout interval. - The number of messages to retrieve. - The visibility timeout for the message or messages. - A web request for the specified operation. - - - - Constructs a web request to retrieve a specified number of messages without changing their visibility. - - The absolute URI to the queue. - The server timeout interval. - The number of messages to retrieve. - A web request for performing the specified operation. - - - - Generates a web request to add a message to a queue. - - The absolute URI to the queue's messages. - The server timeout interval. - The message time-to-live, or null if no time-to-live is specified. - A web request for the put operation. - - - - Generates a web request to add a message to a queue. - - The absolute URI to the queue's messages. - The server timeout interval, in seconds. - The message time-to-live in seconds. If null, the service default will be used. - The length of time from now during which the message will be invisible, in seconds. - If null, the message will be visible immediately. - A web request for the put operation. - - - - Generates a web request to update a message. - - The absolute URI to the message to update. - The server timeout interval, in seconds. - The pop receipt of the message. - The length of time from now during which the message will be invisible, in seconds. - A web request for the update operation. - - - - Creates a web request to get the properties of the service. - - The absolute URI to the service. - The server timeout interval, in seconds. - A web request to get the service properties. - - - - Creates a web request to set the properties of the service. - - The absolute URI to the service. - The server timeout interval, in seconds. - A web request to set the service properties. - - - - Writes service properties to a stream, formatted in XML. - - The service properties to format and write to the stream. - The stream to which the formatted properties are to be written. - - - - Generates the message request body from a string containing the message. - - The content of the message. - The message request body as an array of bytes. - - - - Creates the web request. - - The absolute URI to the queue. - The server timeout interval. - The query. - A web request for performing the operation. - - - - Provides a set of methods for parsing responses from queue operations. - - - - - Returns extended error information from the storage service, that is in addition to the HTTP status code returned with the response. - - The web response. - An object containing extended error information returned with the response. - - - - Gets a collection of user-defined metadata from the response. - - The web response. - A collection of user-defined metadata, as name-value pairs. - - - - Gets an array of values for a specified name-value pair from a response that includes user-defined metadata. - - The web response. - The name associated with the metadata values to return. - An array of metadata values. - - - - Gets the request ID from the response. - - The web response. - A unique value associated with the request. - - - - Extracts the pop receipt from a web response header. - - The web response. - The pop receipt stored in the header of the response. - - - - Extracts the next visibility time from a web response header. - - The web response. - The time of next visibility stored in the header of the response. - - - - Gets the approximate message count for the queue. - - The web response. - The approximate count for the queue. - - - - Parses the response from an operation to get messages from the queue. - - The stream to parse. - An object that may be used for parsing data from the results of a message retrieval operation. - - - - Parses the response from an operation to get messages from the queue. - - The web response. - An object that may be used for parsing data from the results of a message retrieval operation. - - - - Parses the response for a queue listing operation. - - The response stream. - An object that may be used for parsing data from the results of a queue listing operation. - - - - Parses the response for a queue listing operation. - - The web response. - An object that may be used for parsing data from the results of a queue listing operation. - - - - Parses the response from an operation to peek messages from the queue. - - The stream to parse. - An object that may be used for parsing data from the results of a message peeking operation. - - - - Parses the response from an operation to peek messages from the queue. - - The web response. - An object that may be used for parsing data from the results of a message peeking operation. - - - - Reads service properties from a stream. - - The stream from which to read the service properties. - The service properties stored in the stream. - - - - Factory class for creating requests internally. - - - - - Internal override for the storage version string. - - - - - Initializes static members of the Request class. - - - - - Creates the web request. - - The request Uri. - The timeout. - The builder. - A web request for performing the operation. - - - - Creates the specified Uri. - - The Uri to create. - The timeout. - The builder. - A web request for performing the operation. - - - - Deletes the specified Uri. - - The Uri to delete. - The timeout. - The builder. - A web request for performing the operation. - - - - Gets the metadata. - - The blob Uri. - The timeout. - The builder. - A web request for performing the operation. - - - - Gets the properties. - - The Uri to query. - The timeout. - The builder. - A web request for performing the operation. - - - - Sets the metadata. - - The blob Uri. - The timeout. - The builder. - A web request for performing the operation. - - - - Creates a web request to get the properties of the service. - - The absolute URI to the service. - The server timeout interval. - A web request to get the service properties. - - - - Creates a web request to set the properties of the service. - - The absolute URI to the service. - The server timeout interval. - A web request to set the service properties. - - - - Writes service properties to a stream, formatted in XML. - - The service properties to format and write to the stream. - The stream to which the formatted properties are to be written. - - - - Generates a query builder for building service requests. - - A for building service requests. - - - - Signs the request appropriately to make it an authenticated request for Blob and Queue. - - The request. - The credentials. - - - - Signs requests using the SharedKey authentication scheme for the table storage service. - - The request. - The credentials. - - - - Adds the metadata. - - The request. - The metadata. - - - - Adds the metadata. - - The request. - The metadata name. - The metadata value. - - - - Signs requests using the SharedKeyLite authentication scheme with is used for the table storage service. - - The request. - The credentials. - - - - Signs requests using the SharedKeyLite authentication scheme with is used for the table storage service. - Currently we only support for table. - - The request. - The credentials. - - - - Adds the lease id. - - The request. - The lease id. - - - - Adds the optional header. - - The web request. - The metadata name. - The metadata value. - - - - Adds the conditional. - - The request. - The header. - The resource ETag. - - - - Adds the conditional. - - The request. - The header. - The date time. - - - - Creates a standard datetime string for the shared key lite authentication scheme. - - DateTime value to convert to a string in the expected format. - The converted DateTime. - - - - Gets the target version. - - The target version. - - - - Converts the date time to snapshot string. - - The date time. - The converted string. - - - - This gets the file version, but fails under partial trust with a security exception. - The caller should catch the exception. - - File version of current assembly. - - Inlining of this fuction is explicitly disabled to support degrading gracefully under partial trust. - FileVersionInfo.GetVersionInfo has a link demand assoicated with it. Therefore, we must make - sure we never inline this function, otherwise the caller cannot catch the security - exception associated with the link demand. - - - - - Gets or sets the user agent to send over the wire to identify the client. - - - - - The exception that is thrown if the client attempts to parse the response a second time. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message that describes the exception. - - - - Initializes a new instance of the class. - - The message for the exception. - The exception that is the cause of the current 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. - - - - Implements the common parsing between all the responses. - - - - - Gets the error details from the response object. - - The response from server. - An extended error information parsed from the input. - - - - Gets the headers (metadata or properties). - - The response from sever. - A of all the headers. - - - - Gets the user-defined metadata. - - The response from server. - A of the metadata. - - - - Gets a specific user-defined metadata. - - The response from server. - The metadata header requested. - An array of the values for the metadata. - - - - Parses the metadata. - - The reader. - A of metadata. - - Precondition: reader at <Metadata> - Postcondition: reader after </Metadata> (<Metadata/> consumed) - - - - - Gets the storage properties. - - The response from server. - A of the properties. - - - - Gets a specific storage property. - - The response from server. - The property requested. - An array of the values for the property. - - - - Gets the request id. - - The response from server. - The request ID. - - - - Reads service properties from a stream. - - The stream from which to read the service properties. - The service properties stored in the stream. - - - - Gets the metadata or properties. - - The response from server. - The prefix for all the headers. - A of the headers with the prefix. - - - - Class representing a set of properties pertaining to a cloud storage service. - - - - - The name of the root XML element. - - - - - The name of the logging XML element. - - - - - The name of the metrics XML element. - - - - - The name of the version XML element. - - - - - The name of the delete operation XML element. - - - - - The name of the read operation XML element. - - - - - The name of the write operation XML element. - - - - - The name of the retention policy XML element. - - - - - The name of the enabled XML element. - - - - - The name of the days XML element. - - - - - The name of the include APIs XML element. - - - - - The name of the default service version XML element. - - - - - Initializes a new instance of the ServiceProperties class. - - - - - Constructs a ServiceProperties object from an XML document received from the service. - - The XML document. - A ServiceProperties object containing the properties in the XML document. - - - - Converts these properties into XML for communicating with the service. - - An XML document containing the service properties. - - - - Generates XML representing the given retention policy. - - The number of days to retain, or null if the policy is disabled. - An XML retention policy element. - - - - Generates XML representing the given metrics properties. - - The metrics properties. - An XML metrics element. - - - - Generates XML representing the given logging properties. - - The logging properties. - An XML logging element. - - - - Constructs a LoggingProperties object from an XML element. - - The XML element. - A LoggingProperties object containing the properties in the element. - - - - Constructs a MetricsProperties object from an XML element. - - The XML element. - A MetricsProperties object containing the properties in the element. - - - - Constructs a retention policy (number of days) from an XML element. - - The XML element. - The number of days to retain, or null if retention is disabled. - - - - Gets or sets the logging properties. - - The logging properties. - - - - Gets or sets the metrics properties. - - The metrics properties. - - - - Gets or sets the default service version. - - The default service version identifier. - - - - Provides an implementation of the class for requests against - the Table service under the Shared Key authentication scheme. - - - - - Canonicalizes the HTTP request. - - The web request. - The name of the storage account. - The canonicalized string for the request. - - - - Provides an implementation of the class for blobs and queues - for use with the Shared Key Lite authentication scheme. - - - - - Canonicalizes the HTTP request. - - A web request. - The name of the storage account. - The canonicalized string for the request. - - - - Provides an implementation of the class for tables - for the Shared Key Lite authentication scheme. - - - - - Canonicalizes the HTTP request. - - A web request. - The name of the storage account. - The canonicalized string for the request. - - - - Provides an implementation of the class for requests against - the Table service under the Shared Key authentication scheme. - - - - - Canonicalizes the HTTP request. - - A web request. - The name of the storage account. - The canonicalized string for the request. - - - - Container for storage key. - - - May eventually use native APIs to keep key pinned and not memory. - - - - - Initializes a new instance of the class. - - The storage key. - - - - Computes the mac sha256. - - The storage key. - The canonicalized string. - The computed hash. - - - - Computes the mac sha512. - - The storage key. - The canonicalized string. - The computed hash. - - - - Gets the base64 encoded key. - - The base64 encoded key. - - - - Gets the key. - - The storage key. - - - - Gets or sets the key. - - The storage key. - - - - Provides a set of methods for constructing requests for table operations. - - - - - Creates a web request to get the properties of the service. - - The absolute URI to the service. - The server timeout interval, in seconds. - A web request to get the service properties. - - - - Creates a web request to set the properties of the service. - - The absolute URI to the service. - The server timeout interval, in seconds. - A web request to set the service properties. - - - - Writes service properties to a stream, formatted in XML. - - The service properties to format and write to the stream. - The stream to which the formatted properties are to be written. - - - - Signs the request for Shared Key authentication. - - The web request. - The account credentials. - The table service usually expects requests to use Shared Key Lite authentication. - Use for those requests. - - - - Signs the request for Shared Key Lite authentication. - - The web request. - The account credentials. - - - - Provides a set of methods for parsing responses from table operations. - - - - - Returns extended error information from the storage service, that is in addition to the HTTP status code returned with the response. - - The web response. - An object containing extended error information returned with the response. - - - - Gets the request ID from the response. - - The web response. - A unique value associated with the request. - - - - Reads service properties from a stream. - - The stream from which to read the service properties. - The service properties stored in the stream. - - - - A style class for creating Uri query strings. - - - - - Stores the query parameters. - - - - - Add the value with Uri escaping. - - The query name. - The query value. - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Add query parameter to an existing Uri. This takes care of any existing query parameters in the Uri. - - Original Uri which may contain query parameters already. - The appended Uri. - - - - Represents a queue's attributes. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The attributes to clone. - - - - Gets the queue's user-defined metadata. - - The queue's user-defined metadata. - - - - Gets the URI for the queue. - - The queue's URI. - - - - Provides error code strings that are specific to the Queue service. - - - - - Error code that may be returned when the specified queue was not found. - - - - - Error code that may be returned when the specified queue is disabled. - - - - - Error code that may be returned when the specified queue already exists. - - - - - Error code that may be returned when the specified queue is not empty. - - - - - Error code that may be returned when the specified queue is being deleted. - - - - - Error code that may be returned when the specified pop receipt does not match. - - - - - Error code that may be returned when one or more request parameters are invalid. - - - - - Error code that may be returned when the specified message was not found. - - - - - Error code that may be returned when the specified message is too large. - - - - - Error code that may be returned when the specified marker is invalid. - - - - - Specifies which details to include when listing queues in this storage account. - - - - - No additional details. - - - - - Retrieve queue metadata. - - - - - Retrieve all available details. - - - - - Utility functions that does the heavy lifting of carrying out retries on a IRetrayableRequest. - - - Both synchrous and asynchrous request styles are supported. - They are used to implement the corresponding XXX, BeginXXX, EndXXX calls where XXX - is something like GetBlobInfo. - State passing for return value in the sync call (GetBlobInfo) and out parameters for the async calls - (EndBlobInfo) is achieved by member variables in the implementation class of IRetryableRequest. - - - - - Synchronouses the request with retry. - - The result type of the task. - The oracle to use. - The task implementation. - The result of the task. - - - - Begins the asynchronous request with retry. - - The result type of the task. - The oracle to use. - The task implementation. - The asynchronous callback. - The asynchronous state. - An that represents the asynchronous operation. - - - - Ends the asynchronous request with retry. - - The result type of the task. - The asynchronous result. - The result of the completed task. - - - - Implementation of the *RequestWithRetry methods. - - The result type of the task. - The retry oracle. - The task implementation. - The result report delegate. - A that performs the request with retries. - - - - Implementation of the *RequestWithRetry methods. - - The result type of the task. - The retry oracle. - The task implementation. - A that performs the request with retries. - - - - Provides the arguments for the ResponseReceived event. - - - - - Gets the request ID. - - The request ID. - - - - Gets the request headers. - - The collection of request headers. - Modifying the collection of request headers may result in unexpected behavior. - - - - Gets the request URI. - - The request URI. - - - - Gets the response headers. - - The collection of response headers. - Modifying the collection of response headers may result in unexpected behavior. - - - - Gets the HTTP status code for the request. - - The HTTP status code for the request. - - - - Gets the status description for the request. - - The status description for the request. - - - - Gets an exception returned by the service. - - The exception returned by the service. - - - - Manage continuation information for various listing operation. - Can be serialized using XmlSerialization. - - - - - XML element for the next marker. - - - - - XML element for the next partition key. - - - - - XML element for the next row key. - - - - - XML element for the next table name. - - - - - XML element for the token version. - - - - - Stores the current token version value. - - - - - XML element for the token type. - - - - - Initializes a new instance of the class. - - - - - Gets an XML representation of an object. - - - An that describes the XML representation of the object that is produced by the method and consumed by the method. - - - - - Generates a serializable continuation token from its XML representation. - - The stream from which the continuation token is deserialized. - - - - Converts a serializable continuation token into its XML representation. - - The stream to which the continuation token is serialized. - - - - Gets or sets the NextPartitionKey for TableServiceEntity enumeration operations. - - - - - Gets or sets the NextRowKey for TableServiceEntity enumeration operations. - - The next row key. - - - - Gets or sets the NextTableName for Table enumeration operations. - - The name of the next table. - - - - Gets or sets the NextMarker for continuing results for CloudBlob and CloudBlobContainer and CloudQueue enumeration operations. - - The next marker. - - - - Gets a value indicating whether there is continuation information present. - - - - - - Gets or sets the type. - - The continuation type. - - - - Specifies the type of a continuation token. - - - - - Default for no continuation. - - - - - The token is a blob listing continuation token. - - - - - The token is a queue listing continuation token. - - - - - The token is a container listing continuation token. - - - - - The token is a table query continuation token. - - - - - Represents a class which manages pagination of results. - - - - - Stores the results remaining in the current page. - - - - - Stores the page size. - - - - - Initializes a new instance of the class. - - Number of results to be returned as a page. - maxResults of 0 or less means no paging. - - - - Gets the size for next request to pass in parameter like MaxResults. - - Postive value indicating size of a result page if using paging. - Else null is returned. - - - - Update pagination paramters for new result set returned. - - The current result count. - - - - Gets the maxResults in use for the current Pagination instance - Returns zero if paging is not in use. - - The size of the effective page. - - - - Gets a value indicating whether paging is enabled with a valid postive page size. - An instance with a non positive page size will return false. - - - - - Gets a value indicating whether there are no more remaining results in the current page. - Will return false if paging is not enabled. - - - - - Represents a result segment that was retrieved from the total set of possible results. - - The type of the element. - - - - Stores the continuation token used to retrieve the next segment of results. - - - - - Stores the closure used to retrieve the next set of results. - - - - - Stores the used for requests. - - - - - Initializes a new instance of the ResultSegment class. - - The result. - If set to true there are more results. - The next result segment. - The retry policy. - - - - Begins an asynchronous operation to retrieve the next result segment. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to retrieve the next result segment. - - An that references the pending asynchronous operation. - The next result segment. - - - - Gets the next result segment. - - The next result segment. - - - - Implementation of GetNext (For symmetry with normal tasks. - - The action to set the results. - A representing the operation to get the next set of results. - - - - Gets an enumerable collection of results. - - An enumerable collection of results. - - - - Gets a value indicating whether there are additional results to retrieve. - - True if there are additional results; otherwise, false. - - - - Gets a continuation token to use to retrieve the next set of results with a subsequent call to the operation. - - The continuation token. - - - - Gets or sets the pagination information for Results. - - The pagination. - - - - Gets the retry policy. - - The retry policy. - - - - Represents a helper class to support additional operations on ResultSegments - such as grouping of results into pages. - - - - - Checks if the result segment has more results in the current page if pagination is used. - If pagination is not used, it checks if a valid continuation is present. - - The pagination. - The continuation token. - - Returns true if there are more results in the page; otherwise, false. - - - - - Create a result segment from the result result. - - The type of the result. - The set result. - The result list. - The continuation token. - The pagination. - The retry policy. - The continuation function. - - - - Checks if the result segment passed in has a valid continuation token. - - The continuation. - - Returns true if the specified continuation has continuation; otherwise, false. - - - - - Defines some standard retry policies. - - - - - Indicates the default minimum backoff value that will be used for a policy returned by . - - - - - Indicates the default maximum backoff value that will be used for a policy returned by . - - - - - Indicates the default client backoff value that will be used by a service client, if no other retry policy has been specified. - - - - - Indicates the default retry count that will be used by a service client, if no other retry policy has been specified. - - - - - Returns a retry policy that performs no retries. - - The retry policy. - - - - Returns a retry policy that retries a specified number of times, with a specified fixed time interval between retries. - - A non-negative number indicating the number of times to retry. - The time interval between retries. Use to specify that the operation - should be retried immediately. - The retry policy. - - - - Returns a policy that retries a specified number of times with a randomized exponential backoff scheme. - - A non-negative number indicating the number of times to retry. - The multiplier in the exponential backoff scheme. - The retry policy. - - - - Returns a policy that retries a specified number of times with a randomized exponential backoff scheme. - - A non-negative number indicating the number of times to retry. - The minimum backoff interval. - The maximum backoff interval. - The multiplier in the exponential backoff scheme. - The retry policy. - - - - Returns a delegate that implements a custom retry policy. - - A delegate that determines whether or not to retry an operation. - - - - Specifies the set of possible permissions for a shared access policy. - - - - - No shared access granted. - - - - - Read access granted. - - - - - Write access granted. - - - - - Delete access granted for blobs. - - - - - List access granted. - - - - - Represents the collection of shared access policies defined for a container. - - - - - Represents a shared access policy, which specifies the start time, expiry time, - and permissions for a shared access signature. - - - - - Initializes a new instance of the class. - - - - - Converts the permissions specified for the shared access policy to a string. - - The shared access permissions. - The shared access permissions in string format. - - - - Constructs a object from a permissions string. - - The shared access permissions in string format. - A set of shared access permissions. - - - - Gets or sets the start time for a shared access signature associated with this shared access policy. - - The shared access start time. - - - - Gets or sets the expiry time for a shared access signature associated with this shared access policy. - - The shared access expiry time. - - - - Gets or sets the permissions for a shared access signature associated with this shared access policy. - - The permissions. - - - - Determines whether a request should be retried. - - The number of times the request has been retried. - The exception raised by the most recent operation. - An optional delay that specifies how long to wait before retrying a request. - true if the request should be retried; otherwise, false. - - - - This class provides MemoryStream-like behavior but uses a list of blocks rather than a single piece of bufferBlocks. - - - - - The default block size. - - - - - The size of the block. - - - - - The underlying bufferBlocks for the stream. - - - - - The currently used length. - - - - - The total capacity of the stream. - - - - - The current position. - - - - - Initializes a new instance of the SmallBlockMemoryStream class with default 64KB block size and no reserved space. - - - - - Initializes a new instance of the SmallBlockMemoryStream class with provided block size and no reserved space. - - The size of blocks to use. - - - - Initializes a new instance of the SmallBlockMemoryStream class. - - The size of blocks to use. - The amount of memory to reserve. - Thrown if is zero or negative. - - - - Copies the specified amount of data from internal buffers to the buffer and advances the position. - - An array of bytes. When this method returns, the buffer contains the specified byte array with the values - between offset and (offset + count - 1) replaced by the bytes read from the current source. - The zero-based byte offset in buffer at which to begin storing the data read from the current stream. - The maximum number of bytes to be read from the current stream. - The total number of bytes read into the buffer. This can be less than the number of bytes requested - if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. - - The offset subtracted from the buffer length is less than count. - The buffer is null. - The offset or count is negative. - - - - Sets the position within the current stream. - - A byte offset relative to the origin parameter. - A value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position. - The new position within the current stream. - Thrown if is invalid for SeekOrigin. - - - - Sets the length of the current stream. (preallocating the bufferBlocks). - - The desired length of the current stream in bytes. - If the is negative. - - - - Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. - - An array of bytes. This method copies count bytes from buffer to the current stream. - The zero-based byte offset in buffer at which to begin copying bytes to the current stream. - The number of bytes to be written to the current stream. - Offset subtracted from the buffer length is less than count. - Thrown if is null - Thrown if or is negative - - - - Does not perform any operation as it's an in-memory stream. - - - - - Ensures that the amount of bufferBlocks is greater than or equal to the required size. - Does not trim the size. - - The required size. - If the is negative. - - - - Adds another block to the underlying bufferBlocks. - - - - - Copies the specified amount of data from internal buffers to the buffer and advances the position. - - An array of bytes. When this method returns, the buffer contains the specified byte array with the values - between offset and (offset + count - 1) replaced by the bytes read from the current source. - The zero-based byte offset in buffer at which to begin storing the data read from the current stream. - The maximum number of bytes to be read from the current stream. - The total number of bytes read into the buffer. This can be less than the number of bytes requested - if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. - - - - - Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. - (Requires the stream to be of sufficient size for writing). - - An array of bytes. This method copies count bytes from buffer to the current stream. - The zero-based byte offset in buffer at which to begin copying bytes to the current stream. - The number of bytes to be written to the current stream. - - - - Advances the current position of the stream and adjust the offset and remainder based on the amount completed. - - The current offset in the external buffer. - The amount of data left to process. - The amount of data processed. - - - - Calculate the block for the current position. - - The position within a block. - The block reference itself. - - - - Gets a value indicating whether the current stream supports reading. - - Is true if the stream supports reading; otherwise, false. - - - - Gets a value indicating whether the current stream supports seeking. - - Is true if the stream supports seeking; otherwise, false. - - - - Gets a value indicating whether the current stream supports writing. - - Is true if the stream supports writing; otherwise, false. - - - - Gets the currently written length. - - - - - Represents the current position in the stream. - - Thrown if position is outside the stream size - - - - Represents an exception thrown by the Windows Azure storage client library. - - - - - The base class for Windows Azure storage service exceptions. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The storage client error code. - The message that describes the exception. - The HTTP status code returned in the response. - The extended error information. - The instance that caused the current exception. - - - - Initializes a new instance of the class with - serialized data. - - The object that contains serialized object - data about the exception being thrown. - The object that contains contextual information - about the source or destionation. - - - - Sets the object with additional exception information. - - The object that contains serialized data about the exception being thrown. - The object that contains contextual information - about the source or destination. - - - - Gets the HTTP status code that was returned by the service. - - The HTTP status code. - - - - Gets the specific error code returned by the service. - - The storage error code. - - - - Gets the extended error information returned by the service. - - The extended error information. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The storage client error code. - The message that describes the exception. - The HTTP status code returned in the response. - The extended error information. - The instance that caused the current exception. - - - - Initializes a new instance of the class with - serialized data. - - The object that contains serialized data about the exception being thrown. - The object that contains contextual information - about the source or destination. - - - - Describes error codes that may be returned by the Windows Azure storage services or the storage client library. - - - - - No error specified. - - - - - An internal server occurred (server-side error). - - - - - The service timed out (server-side error). - - - - - A service integrity check failed (server-side error). - - - - - A transport error occurred (server-side error). - - - - - The service returned a bad response (server-side error). - - - - - The specified resource was not found (client-side error). - - - - - The specified account was not found (client-side error). - - - - - The specified container was not found (client-side error). - - - - - The specified blob was not found (client-side error). - - - - - An authentication error occurred (client-side error). - - - - - Access was denied (client-side error). - - - - - The specified resource already exists (client-side error). - - - - - The specified container already exists (client-side error). - - - - - The specified blob already exists (client-side error). - - - - - The request was incorrect or badly formed (client-side error). - - - - - The specified condition failed (client-side error). - - - - - There was an error with the gateway used for the request (client-side error). - - - - - The requested operation is not implemented on the specified resource (client-side error). - - - - - The request version header is not supported (client-side error). - - - - - Provides error code strings that are common to all storage services. - - - - - The specified HTTP verb is not supported. - - - - - The Content-Length header is required for this request. - - - - - A required header was missing. - - - - - A required XML node was missing. - - - - - One or more header values are not supported. - - - - - One or more XML nodes are not supported. - - - - - One or more header values are invalid. - - - - - One or more XML node values are invalid. - - - - - A required query parameter is missing. - - - - - One or more query parameters is not supported. - - - - - One or more query parameters are invalid. - - - - - One or more query parameters are out of range. - - - - - The URI is invalid. - - - - - The HTTP verb is invalid. - - - - - The metadata key is empty. - - - - - The request body is too large. - - - - - The specified XML document is invalid. - - - - - An internal error occurred. - - - - - Authentication failed. - - - - - The specified MD5 hash does not match the server value. - - - - - The specified MD5 hash is invalid. - - - - - The input is out of range. - - - - - The input is invalid. - - - - - The operation timed out. - - - - - The specified resource was not found. - - - - - The specified metadata is invalid. - - - - - The specified metadata is too large. - - - - - The specified condition was not met. - - - - - The specified range is invalid. - - - - - The specified container was not found. - - - - - The specified container already exists. - - - - - The specified container is disabled. - - - - - The specified container is being deleted. - - - - - The server is busy. - - - - - Provides a set of extensions for translating Exceptions into StorageExceptions. - - - - - Translates a WebException into the corresponding StorageException. - - The exception to translate. - The translated exception. - - - - Translates the data service client exception. - - The exception to translate. - The translated exception. - - - - Represents extended error information returned by the Windows Azure storage services. - - - - - Gets the storage service error code. - - The storage service error code. - - - - Gets the storage service error message. - - The storage service error message. - - - - Gets additional error details. - - The additional error details. - - - - Represents an exception thrown due to a server-side error. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The storage client error code. - The message that describes the exception. - The HTTP status code returned in the response. - The instance that caused the current exception. - - - - Initializes a new instance of the class. - - The storage client error code. - The message that describes the exception. - The HTTP status code returned in the response. - The extended error information. - The instance that caused the current exception. - - - - Initializes a new instance of the class with - serialized data. - - The object that contains serialized data about the exception being thrown. - The object that contains contextual information - about the source or destination. - - - - A class containing common functionality across the two blob streams. - - - - - Verifies the parameters to a read/write operation. - - An array of bytes. - The zero-based byte offset in . - The maximum number of bytes to be access in . /// The sum of offset and count is greater than the buffer length. - is null. - offset or count is negative. - - - - Calculates an ongoing hash. - - The data to calculate the hash on. - The offset in the input buffer to calculate from. - The number of bytes to use from input. - The hash algorithm to use. - - - - Retrieves the string representation of the hash. (Completes the creation of the hash). - - The hashing object. - A string that is the content of the hash. - - - - Provides error code strings that are specific to the Windows Azure Table service. - - - - - The request uses X-HTTP-Method with an HTTP verb other than POST. - - - - - The specified X-HTTP-Method is invalid. - - - - - More than one X-HTTP-Method is specified. - - - - - The specified table has no properties. - - - - - A property is specified more than once. - - - - - The specified table has no such property. - - - - - A duplicate key property was specified. - - - - - The specified table already exists. - - - - - The specified table was not found. - - - - - The specified entity was not found. - - - - - The specified entity already exists. - - - - - The partition key was not specified. - - - - - One or more specified operators are invalid. - - - - - The specified update condition was not satsified. - - - - - All properties must have values. - - - - - The partition key property cannot be updated. - - - - - The entity contains more properties than allowed. - - - - - The entity is larger than the maximum size permitted. - - - - - The property value is larger than the maximum size permitted. - - - - - One or more value types are invalid. - - - - - The specified table is being deleted. - - - - - The Table service server is out of memory. - - - - - The type of the primary key property is invalid. - - - - - The property name exceeds the maximum allowed length. - - - - - The property name is invalid. - - - - - Batch operations are not supported for this operation type. - - - - - JSON format is not supported. - - - - - The specified method is not allowed. - - - - - The specified operation is not yet implemented. - - - - - Represents a object for use with the Windows Azure Table service. - - - - - Initializes a new instance of the class. - - The Table service endpoint to use create the service context. - The account credentials. - - - - Begins an asynchronous operation to save changes, using the retry policy specified for the service context. - - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Begins an asynchronous operation to save changes, using the retry policy specified for the service context. - - Additional options for saving changes. - The callback delegate that will receive notification when the asynchronous operation completes. - A user-defined object that will be passed to the callback delegate. - An that references the asynchronous operation. - - - - Ends an asynchronous operation to save changes. - - An that references the pending asynchronous operation. - A that represents the result of the operation. - - - - Saves changes, using the retry policy specified for the service context. - - A that represents the result of the operation. - - - - Saves changes, using the retry policy specified for the service context. - - Additional options for saving changes. - A that represents the result of the operation. - - - - Saves the changes with retries implementation. - - The options for saving changes. - The action to set result. - A sequence of tasks to perform the operation. - - - - Callback on DataContext object sending request. - - The sender. - The instance containing the event data. - - - - Gets or sets the retry policy requests made via the service context. - - The retry policy. - - - - Gets the storage account credentials used by the service context. - - The account credentials. - - - - Represents an entity in the Windows Azure Table service. - - - - - Initializes a new instance of the class. - - The partition key. - The row key. - - - - Initializes a new instance of the class. - - - - - Gets or sets the timestamp for the entity. - - The entity's timestamp. - - - - Gets or sets the partition key of a table entity. - - The partition key. - - - - Gets or sets the row key of a table entity. - - The row key. - - - - Provides a set of extensions for the Table service. - - - - - Converts the query into a object that supports - additional operations like retries. - - The type of the element. - The query. - The converted query. - - - - Internal table service entity for creating tables. - - - - - Stores the table name. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified name. - - The name of the table. - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - Returns true if the specified is equal to this instance; otherwise, false. - - - The parameter is null. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Gets or sets the table name. - - The name of the table. - - - - Helper functions for table service. - - - - - Determines whether the type is an entity type. - - The type to check. - Type of the context. - - Returns true if the type is an entity type; otherwise, false. - - - - - Determines whether the specified property is a key column. - - The property. - - Returns true if the specified property is a key column; otherwise, false. - - - - - Enumerates the entity set properties. - - Type of the context. - A list of the entity set properties. - - - - Enumerates the entity set names. - - Type of the context. - A list of entity set names. - - - - Checks the name of the table. - - The table name. - Name of the arg. - - - - Implementation helper for task sequences. - - - - - Executes the impl. - - The result type. - The task implementation. - The result of the task. - - - - Begins the impl. - - The result type. - The task implementation. - The callback. - The state. - An asynchronous result representing the operation. - - - - Ends the impl. - - The result type. - The async result. - The task result. - - - - Executes the impl. - - The task implemenetaion. - - - - Begins the impl. - - The task implementation. - The callback. - The state. - An asynchronous result representing the operation. - - - - Ends the impl. - - The async result. - - - - Executes the impl with retry. - - The result type. - The task implementation. - The policy. - The task result. - - - - Begins the impl with retry. - - The result type. - The task implementation. - The policy. - The callback. - The state. - An asynchronous result representing the operation. - - - - Ends the impl with retry. - - The result type. - The async result. - The task result. - - - - Executes the impl with retry. - - The task implementation. - The policy. - - - - Executes the impl with retry. - - The result type. - The task implementation. - The task result. - - - - Executes the impl with retry. - - The result type. - The task implementation. - The policy. - The task result. - - - - Begins the impl with retry. - - The task implementation. - The policy. - The callback. - The state. - An asynchronous result representing the operation. - - - - Ends the impl with retry. - - The async result. - - - - Gets the retryable async task. - - The result type. - The task implementation. - The policy. - The retryable task. - - - - Gets the retryable async task. - - The task implementation. - The policy. - The retryable task. - - - - Gets the task from async result. - - The type of the result. - The async result. - The asynchronous result. - - - - A task that implements the conventional BeginXX(), EndXX() pattern. - - - - - A task that implements the conventional BeginXX(), EndXX() pattern. - - The return type of the task. - - - - Represents an asynchronous computation that yields a result of type T. - - The type of the result of the operation. - - By this contract we: - 1) guarantee that the completion routine is performed, regardless of the outcome of ExecuteStep. - 2) insist that the completion routine does not throw an exception. - 3) insists that the abort routine does not throw an exception. - - - - - An asynchronous computation. - - - - - Perform the next async step. - - The action to be performed on completion. - - - - Abort the task operation. - - - - - Gets a value indicating whether the task has completed synchronously. - - - Is true if completed synchronously; otherwise, false. - - - - - Gets exception raised by this task (if any). - - The exception. - - - - Provides information if the task completed synchronously and therefore on the main thread. - - - - - Contains any exceptions raised by the task. - - - - - The action to call once the operation is completed. - - - - - The result of the operation. - - - - - Executes the tasks and waits for the result. - - The result of the operation. - - - - Executes a task, will not wait on a sync task. - - The result of the operation. - - - - Executes a single step of the task. (Delegates to the concrete implemetation for specific step). - - The completion function to be called. - - - - Implements an abort routine that fulfills the contract. - - - - - The specific implementation of the task's step. - - - - - Implements a safe way to obtain the result. - - The function used to get the result value. - - - - The task-specific abort that should be called. - - - - - The completion return that needs to be called whenever operation completes. - - Whether the underlying operation completed synchrnously. - - - - Gets or sets the result of the operation and throws any exceptions raised by the operation. - - - - - Gets or sets a value indicating whether the operation was completed synchronously and therefore on main thread. - - - - - Gets or sets any exceptions raised during execution. - - - - - Gets or sets a value indicating whether the task is completed. - - - - - Initializes a new instance of the APMTask class for use with normal APM. - - The APM function to begin operation. - The APM functon to end the operation. - - - - Initializes a new instance of the APMTask class for use with normal APM. - - The APM function to begin operation. - The APM functon to end the operation. - The function used for aborting an operation. - - - - Implementation of the library execution. Performs the APM operation. - - - - - Implements the abort functionality. - - - - - Callback for the APM function. - - The async result for the APM model. - - - - Gets or sets the begin function. - - The begin func. - - - - Gets or sets the end function. - - The end func. - - - - Gets or sets the abort function. - - The abort func. - - - - Initializes a new instance of the APMTask class for sequence without any return value. - - The APM function to begin operation. - The APM functon to end the operation. - - - - A class to extend a normal task. - - - - - Converts a Task to an a TaskAsyncResult to allow for exposing Tasks as IAsyncResult. - - The return type of the task. - The task to be converted. - The callback to be called at the end of the task. - The callback's state. - A TaskAsyncResult that implements IAsyncResult. - - - - Converts a Task to an a TaskAsyncResult to allow for exposing Tasks as IAsyncResut. - - The task to be converted. - The callback to be called at the end of the task. - The callback's state. - A TaskAsyncResult that implements IAsyncResult. - - - - A task class that implements a fixed delay. - - - - - Indicates whether this object has been disposed. - - - - - Stores the length of the delay. - - - - - ObjectUsed to lock disposing methods and timer callbacks. - - - - - Stores the native timer used to trigger after the specified delay. - - - - - Initializes a new instance of the class. - - Should be between TimeSpan.Zero and TimeSpan.MaxValue. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources. - - Set to true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - The specific implementation of the task's step. - - - - - The task-specific abort that should be called. - - - - - Begins the delay. - - - - - Ends the delay. - - - - - Invokes a sequence with no return value. - - - - - Invokes a sequence of tasks. - - The type of the result of the operation. - - - - Contains the function that generates a squence of tasks to be invoked. - - - - - The current task that is being invoked. - - - - - Controls whether the abort was called. - - - - - Initializes a new instance of the InvokeTaskSequenceTask class with a task sequence that returns a value. - - The sequence of actions to be invoked. - - - - Implements the abort logic by aborting the current task. - - - - - The starting point for executing a task sequence. - - - - - Executes a task sequence by iterating over all of the items and executing them. - - The sequence of tasks to execute. - Whether the sequence so far has completed synchronously. - - - - Initializes a new instance of the InvokeTaskSequenceTask class for sequence without any return value. - - The sequence of actions to be invoked. - - - - A NullTaskReturn type. - - - - - Represents a no-return from a task. - - - - - Prevents a default instance of the class from being created. - - - - - Facilitates a scenario where numerous simultaneous tasks are active, and only the first to complete should continue. - - The type of the result of the operation. - - - - Stores the abort flag. - - - - - Stores the racing tasks. - - - - - Initializes a new instance of the class. - - The tasks. - - - - The specific implementation of the task's step. - - - - - The task-specific abort that should be called. - - - - - Called when complete. - - The winning task. - - - - Provides extensions for the stream object to support asynchronous operations. - - - - - Buffer size needs to be page-aligned. - - - - - Asynchronously reads data from a stream using BeginRead. - - The stream on which the method is called. - The buffer to read the data into. - Byte offset in the buffer. - Maximum number of bytes to read. - Returns non-zero if there are still some data to read. - - - - Reads asynchronously the entire content of the stream and returns it - as a string using StreamReader. - - The stream on which the method is called. - The text encoding used for converting bytes read into string. - The action to be performed with the resulting string. - Returns a task sequence that must be performed to get result string using the 'Result' callback. - - - - Asynchronously writes data from a stream using BeginWrite. - - The stream on which the method is called. - The buffer to write the data from. - Byte offset in the buffer. - Maximum number of bytes to write. - A task with no return value. - - - - Reads asynchronously the entire content of the stream and writes it to the given output stream. - - The origin stream. - The destination stream. - The sequence that when invoked results in an asynchronous copy. - - - - Compute the MD5 hash of the stream. - - The stream. - A delegate for setting the resulting MD5 hash as a string. - The sequence that when invoked results in an asynchronous MD5 computation. - - - - Reads synchronously the entire content of the stream and writes it to the given output stream. - - The origin stream. - The destination stream. - - - - Reads asynchronously the entire content of the stream and writes it to the given output stream. - Closes the output stream at the end. - - The origin stream. - The destination stream. - The sequence that when invoked results in an asynchronous copy. - - - - A task that obtains a result synchronously. - - - - - A task that obtains a result synchronously. - - The type of the result of the operation. - - - - The function to be executed. - - - - - Initializes a new instance of the SynchronousTask class. - - The function to execute. - - - - Performs the task and marks it as completed. - - - - - Implements abort as NoOp. - - - - - Initializes a new instance of the SynchronousTask class. - - The function to execute. - - - - A set of extension methods for table service classes. - - - - - Converts a DataServiceQuery execution into an APMTask. - - The result type of the query. - The query to convert. - The wrapped task. - - - - Converts the SaveChanges method into an APMTask. - - The target context. - The wrapped task. - - - - Converts the SaveChanges method to an APMTask. - - The target context. - The options to pass to SaveChanges. - A task that saves changes asynchronously. - - - - Gets the unexpected internal client error wrapped task. - - The result type. - The timeout. - The original task. - The wrapped task. - - - - Gets the unexpected internal client error task sequence. - - The result type. - The timeout. - The set result. - A for the unexpected error. - - - - An implementation of IAsyncResult that encapsulates a task. - - The type of the resulting value. - Refer to http://csdweb/sites/oslo/engsys/DesignGuidelines/Wiki%20Pages/IAsyncResult.aspx and - http://www.bluebytesoftware.com/blog/2006/05/31/ImplementingAHighperfIAsyncResultLockfreeLazyAllocation.aspx for IAsyncResult details - - - - The underlying task for the async operation. - - - - - The callback provided by the user. - - - - - The state for the callback. - - - - - Indicates whether a task is completed. - - - - - Indicates whether task completed synchronously. - - - - - The event for blocking on this task's completion. - - - - - Initializes a new instance of the TaskAsyncResult class. - - The task to be executed. - The callback method to be used on completion. - The state for the callback. - - - - Provides a convenient function for waiting for completion and getting the result. - - The result of the operation. - - - - We implement the dispose only to allow the explicit closing of the event. - - - - - Releases unmanaged and - optionally - managed resources. - - Set to true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Provides the lazy initialization of the WaitHandle (based on Joe Duffy's blog). - - The WaitHandle to use for waiting on completion. - - - - Called on completion of the async operation to notify the user - (Based on Joe Duffy's lockless design). - - - - - Gets A user-defined object that contains information about the asynchronous operation. - - - - - Gets a System.Threading.WaitHandle that is used to wait for an asynchronous operation to complete. - - - - - Gets a value indicating whether the asynchronous operation completed synchronously. - - - - - Gets a value indicating whether the asynchronous operation has completed. - - - - - Encapsulates methods for wrapping tasks in timeouts. - - - - - Gets a timeout wrapped task. - - The type of the result. - The timeout. - The original task. - A that has been wrapped with a timeout if specified. - - - - Creates a localized timeout exception object. - - The timeout. - A localized object. - - - - Gets a timeout task sequence. - - The type of the result. - The timeout. - The set result. - A that has been wrapped with a timeout if specified. - - - - A set of extension methods for a webrequest. - - - - - Gets an asynchronous response to a given Web request. - - The requested that is used for operation. - The service. - The timeout. - A task that yields the response. - - - - Gets an asynchronous response to a given Web request. - - The requested that is used for operation. - The service. - The timeout. - A task that yields the response. - - - - Gets an asynchronous response to a given Web request. - - The requested that is used for operation. - The service. - The timeout. - A task that yields the response. - - - - Gets an asynchronous request stream for a given Web request. - - The requested that is used for operation. - A task that yields a stream. - - - - Gets an asynchronous response to a given Web request. - - The requested that is used for operation. - The service. - A task that yields the response. - - - - Gets an asynchronous response to a given Web request. - - The requested that is used for operation. - The service. - A task that yields the response. - - - - Gets an asynchronous response to a given Web request. - - The requested that is used for operation. - The service. - A task that yields the response. - - - - Tracing helper class. - - - - - Internal format string for trace messages. - - - - - Internal flag for turning on tracing. - - - - - Writes the line. - - The format. - The arguments. - - - - Writes the line internal. - - The format. - The arguments. - - - - General purpose utility methods. - - - - - This is the limit where we allow for the error message returned by the server. - Messages longer than that will be truncated. - - - - - Processes the unexpected status code. - - The response. - - - - Translates the data service client exception. - - The exception. - The translated exception. - - - - Translates the web exception. - - The exception. - The translated exception. - - - - Gets the extended error details from response. - - The HTTP response stream. - Length of the content. - The extended error information. - - - - Gets the extended error from XML message. - - The XML error message. - The extended error information. - - - - Copies the stream to buffer. - - The source stream. - The buffer. - The bytes to read. - The number of bytes copied. - - - - Translates from HTTP status. - - The status code. - The status description. - The details. - The inner. - The translated exception. - - - - Extracts an MD5 value from either an v1 or v2 block id. - - The block id containing an MD5. - MD5 value, or null if invalid format. - - - - Generates an block id using the given MD5 hash value. The id must be Base64 compatible. - - The hash value to encode in the block id. - The sequence prefix value. - The block id. - - - - Checks that the given timeout in within allowed bounds. - - The timeout to check. - The timeout is not within allowed bounds. - - - - Translates the extended error. - - The details. - The status code. - The status description. - The inner exception. - The translated exception. - - - - Gets the error details from stream. - - The input stream. - The error details. - - - - Represents storage account credentials for accessing the Windows Azure storage services. - - - - - Initializes a new instance of the class, using the storage account name and - access key. - - The name of the storage account. - The account access key, as an array of bytes. - - - - Initializes a new instance of the class, using the storage account name and - access key. - - The name of the storage account. - The account access key, as a Base64-encoded string. - - - - Transforms a resource URI into a shared access signature URI, by appending a - shared access token. For objects of type , this operation - returns the resource URI that is passed to it.. - - The resource URI to be transformed. - The URI for a shared access signature, including the resource URI and the shared access token. - - - - Signs a request using the specified credentials under the Shared Key authentication scheme. - - The web request to be signed. - - - - Signs a request using the specified credentials under the Shared Key Lite authentication scheme. - - The web request to be signed. - - - - Encodes a Shared Key or Shared Key Lite signature string by using the HMAC-SHA256 algorithm over a UTF-8-encoded string-to-sign. - - A UTF-8-encoded string-to-sign. - An HMAC-encoded signature string. - - - - Gets the base64 encoded key. - - The base64 encoded key. - - - - Performs the computation of the signature based on the private key. - - The string that should be signed. - The signature for the string. - - - - Returns a that represents this instance. - - If set to true exports secrets. - - A that represents this instance. - - - - - Gets a object that references the storage account name and access key. - - An object containing a reference to the storage account name and access key. - - - - Gets the name of the storage account associated with the specified credentials. - - The name of the storage account. - - - - Gets a value indicating whether the method should be called - to transform a resource URI to a URI that includes a token for a shared access signature. - - False for objects of type . - - - - Gets a value indicating whether a request can be signed under the Shared Key authentication - scheme using the specified credentials. - - True for objects of type . - - - - Gets a value indicating whether a request can be signed under the Shared Key Lite authentication - scheme using the specified credentials. - - True for objects of type . - - - - Gets a value indicating whether the method will return a valid - HMAC-encoded signature string when called using the specified credentials. - - True for objects of type . - - - - Sets the account name that owns the key to use when signing requests. - - The name of the account that owns the key to use when signing requests. - - - - Class that represents credentials for anonymous access. Used by internal implementaion. - - - - - Stores the singleton instance of this class. - - - - - Prevents a default instance of the class from being created. - - - - - A potential transformation to the Uri for signing purposes. The transformation may append to the string. - - The resource Uri to be transformed. - The new resource Uri that includes any transformations required for signing. - Identity operation for anonymous access. - - - - An operation that may add any required authentication headers based for the credential type. (SharedKey algorithm). - - The request that needs to be signed. - No op for anonymous access. - - - - An operation that may add any required authentication headers based for the credential type. (SharedKeyLite algorithm used for LINQ for Tables). - - The request that needs to be signed. - No op for anonymous access. - - - - Performs the computation of the signature based on the private key. - - The string that should be signed. - The signature for the string. - Returns null representing no op. - - - - Performs the computation of the signature based on the private key. - - The string to be signed. - The signature for the string. - Need for D-SAS not public. - - - - Returns a that represents this instance. - - If set to true exports secrets. - - A that represents this instance. - - - - - Gets account name information if available. Else returns null. - - - - - Gets a value indicating whether the method must be called - before generating a signature string with the specified credentials. - - - Is true if needs transform Uri; otherwise, false. If false, - calling returns the original, unmodified Uri. - - - - - Gets a value indicating whether SignRequest will perform signing when using this credentials. - False means SignRequest will not do anything. - - - Is true if a request can be signed with these credentials; otherwise, false. - - - - - Returns whether SignRequestLite will perform signing when using this credentials. - False means SignRequestLite will not do anything. - - - - - Returns whether ComputeHMAC will return a valid HMAC when using this credentials. - False means ComputeHmac will return null. - - - Returns true if these credentials will yield a valid signature string; otherwise, false. - - - - - Represents storage credentials for delegated access to Blob service resources - via a shared access signature. - - - - - Stores the shared access signature token. - - - - - Stores the internal used to transform Uris. - - - - - Initializes a new instance of the class - with the specified shared access token. - - A string token representing a shared access signature. - - - - Transforms a resource URI into a shared access signature URI, by appending a - shared access token. - - The resource URI to be transformed. - The URI for a shared access signature, including the resource URI and the shared access token. - - - - Signs a request using the specified credentials under the Shared Key authentication scheme. - This is not a valid operation for objects of type . - - The web request to be signed. - - - - Signs a request using the specified credentials under the Shared Key Lite authentication scheme. - This is not a valid operation for objects of type . - - The web request object to be signed. - - - - Encodes a Shared Key or Shared Key Lite signature string by using the HMAC-SHA256 algorithm over a UTF-8-encoded string-to-sign. - This is not a valid operation for objects of type . - - A UTF-8-encoded string-to-sign. - Null for objects of type . - - - - Encodes the signature string by using the HMAC-SHA-512 algorithm over - the UTF-8-encoded string-to-sign. - - The UTF-8-encoded string-to-sign. - The HMAC-encoded signature string. - - - - Returns a that represents this instance. - - If set to true exports secrets. - - A that represents this instance. - - - - - Gets the name of the storage account associated with the specified credentials. - - The name of the account. - - - - Gets a value indicating whether the method should be called - to transform a resource URI to a URI that includes a token for a shared access signature. - - True for objects of type . - - - - Gets a value indicating whether a request can be signed under the Shared Key authentication - scheme using the specified credentials. - - False for objects of type . - - - - Gets a value indicating whether a request can be signed under the Shared Key Lite authentication - scheme using the specified credentials. - - False for objects of type . - - - - Gets a value indicating whether the method will return a valid - HMAC-encoded signature string when called using the specified credentials. - - False for objects of type . - - - - Gets the token. - - The token. - - - + + + + Microsoft.WindowsAzure.StorageClient + + + + + Represents a Windows Azure storage account. + + + + + The setting name for using the development storage. + + + + + The setting name for specifying a development storage proxy Uri. + + + + + The setting name for using the default storage endpoints with the specified protocol. + + + + + The setting name for the account name. + + + + + The setting name for the account key. + + + + + The setting name for a custom blob storage endpoint. + + + + + The setting name for a custom queue endpoint. + + + + + The setting name for a custom table storage endpoint. + + + + + The setting name for a shared access key. + + + + + The default account name for the development storage. + + + + + The default account key for the development storage. + + + + + The credentials string used to test for the development storage credentials. + + + + + The root blob storage DNS name. + + + + + The root queue DNS name. + + + + + The root table storage DNS name. + + + + + Validator for the UseDevelopmentStorage setting. Must be "true". + + + + + Validator for the DevelopmentStorageProxyUri setting. Must be a valid Uri. + + + + + Validator for the DefaultEndpointsProtocol setting. Must be either "http" or "https". + + + + + Validator for the AccountName setting. No restrictions. + + + + + Validator for the AccountKey setting. Must be a valid base64 string. + + + + + Validator for the BlobEndpoint setting. Must be a valid Uri. + + + + + Validator for the QueueEndpoint setting. Must be a valid Uri. + + + + + Validator for the TableEndpoint setting. Must be a valid Uri. + + + + + Validator for the SharedAccessSignature setting. No restrictions. + + + + + Stores the user-specified configuration setting publisher. + + + + + Singleton instance for the development storage account. + + + + + Initializes a new instance of the class using the specified + account credentials and service endpoints. + + The account credentials. + The Blob service endpoint. + The Queue service endpoint. + The Table service endpoint. + + + + Initializes a new instance of the class using the specified + account credentials and the default service endpoints. + + An object of type that + specifies the account name and account key for the storage account. + True to use HTTPS to connect to storage service endpoints; otherwise, false. + + + + Parses a connection string and returns a created + from the connection string. + + A valid connection string. + Thrown if is null or empty. + Thrown if is not a valid connection string. + Thrown if cannot be parsed. + A object constructed from the values provided in the connection string. + + + + Create a new instance of a object from a specified configuration + setting. This method may be called only after the + method has been called to configure the global configuration setting publisher. + + The name of the configuration setting. + Thrown if the global configuration setting + publisher has not been configured, or if the configuration setting cannot be found. + A constructed from the values in the configuration string. + + + + Indicates whether a connection string can be parsed to return a object. + + The connection string to parse. + A object to hold the instance returned if + the connection string can be parsed. + true if the connection string was successfully parsed; otherwise, false. + + + + Sets the global configuration setting publisher for the storage account, which will be called when + the account access keys are updated in the service configuration file. + + The configuration setting publisher for the storage account. + + + + Returns a connection string for this storage account, without sensitive data. + + A connection string. + + + + Returns a connection string for the storage account, optionally with sensitive data. + + True to include sensitive data in the string; otherwise, false. + A connection string. + + + + Returns a with development storage credentials using the specified proxy Uri. + + The proxy endpoint to use. + The new . + + + + Internal implementation of Parse/TryParse. + + The string to parse. + The to return. + A callback for reporting errors. + If true, the parse was successful. Otherwise, false. + + + + Tokenizes input and stores name/value pairs in a NameValueCollection. + + The string to parse. + Error reporting delegate. + Tokenized collection. + + + + Encapsulates a validation rule for an enumeration based account setting. + + The name of the setting. + A list of valid values for the setting. + An representing the enumeration constraint. + + + + Encapsulates a validation rule using a func. + + The name of the setting. + A func that determines if the value is valid. + An representing the constraint. + + + + Determines whether the specified setting value is a valid base64 string. + + The setting value. + true if the specified setting value is a valid base64 string; otherwise, false. + + + + Validation function that validates Uris. + + Value to validate. + true if the specified setting value is a valid Uri; otherwise, false. + + + + Settings filter that requires all specified settings be present and valid. + + A list of settings that must be present. + The remaining settings or null if the filter's requirement is not satisfied. + + + + Settings filter that removes optional values. + + A list of settings that are optional. + The remaining settings or null if the filter's requirement is not satisfied. + + + + Settings filter that ensures that at least one setting is present. + + A list of settings of which one must be present. + The remaining settings or null if the filter's requirement is not satisfied. + + + + Settings filter that ensures that a valid combination of credentials is present. + + The remaining settings or null if the filter's requirement is not satisfied. + + + + Tests to see if a given list of settings matches a set of filters exactly. + + The settings to check. + A list of filters to check. + + If any filter returns null, false. + If there are any settings left over after all filters are processed, false. + Otherwise true. + + + + + Gets a StorageCredentials object corresponding to whatever credentials are supplied in the given settings. + + The settings to check. + The StorageCredentials object specified in the settings. + + + + Gets the default blob endpoint using specified settings. + + The settings to use. + The default blob endpoint. + + + + Gets the default blob endpoint using the specified protocol and account name. + + The protocol to use. + The name of the storage account. + The default blob endpoint. + + + + Gets the default queue endpoint using the specified settings. + + The settings. + The default queue endpoint. + + + + Gets the default queue endpoint using the specified protocol and account name. + + The protocol to use. + The name of the storage account. + The default queue endpoint. + + + + Gets the default table endpoint using the specified settings. + + The settings. + The default table endpoint. + + + + Gets the default table endpoint using the specified protocol and account name. + + The protocol to use. + The name of the storage account. + The default table endpoint. + + + + Gets a object that references the development storage account. + + A reference to the development storage account. + + + + Gets the endpoint for the Blob service, as configured for the storage account. + + The Blob service endpoint. + + + + Gets the endpoint for the Queue service, as configured for the storage account. + + The Queue service endpoint. + + + + Gets the endpoint for the Table service, as configured for the storage account. + + The Table service endpoint. + + + + Gets the credentials used to create this object. + + The credentials used to create the object. + + + + Encapsulates a mutable storage credentials object. + + + + + Stores the mutable storage credentials. + + + + + Initializes a new instance of the class. + + Name of the configuration setting. + + + + Sets the configuration value. + + The value. + true if the value was set; otherwise, false. + + + + Gets or sets the name of the configuration setting from which we retrieve storage account information. + + + + + Gets or sets the cloud storage account. + + The cloud storage account. + + + + Represents a object that is mutable to support key rotation. + + + + + Represents a set of credentials used to authenticate access to a Windows Azure storage account. + + + + + Transforms a resource URI into a shared access signature URI, by appending a + shared access token. + + The resource URI to be transformed. + The URI for a shared access signature, including the resource URI and the shared access token. + + + + Signs a request using the specified credentials under the Shared Key authentication scheme. + + The web request to be signed. + + + + Signs a request using the specified credentials under the Shared Key Lite authentication scheme. + + The web request to be signed. + + + + Encodes a Shared Key or Shared Key Lite signature string by using the HMAC-SHA256 algorithm over a UTF-8-encoded string-to-sign. + + A UTF-8-encoded string-to-sign. + An HMAC-encoded signature string. + + + + Performs the computation of the signature based on the private key. + + The string to be signed. + The signature for the string. + Need for D-SAS not public. + + + + Returns a that represents this instance. + + If set to true exports secrets. + + A that represents this instance. + + + + + Gets the name of the storage account associated with the specified credentials. + + The name of the account. + + + + Gets a value indicating whether the method should be called + to transform a resource URI to a URI that includes a token for a shared access signature. + + True if the URI must be transformed; otherwise, false. + + + + Gets a value indicating whether a request can be signed under the Shared Key authentication + scheme using the specified credentials. + + True if a request can be signed with these credentials; otherwise, false. + + + + Gets a value indicating whether a request can be signed under the Shared Key Lite authentication + scheme using the specified credentials. + + True if a request can be signed with these credentials; otherwise, false. + + + + Gets a value indicating whether the method will return a valid + HMAC-encoded signature string when called using the specified credentials. + + True if these credentials will yield a valid signature string; otherwise, false. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The initial credentials. + + + + Updates the object with new credentials. + + The new credentials. + + + + Computes the HMAC signature of the specified string. + + The string to sign. + The computed signature. + + + + Signs a request using the specified credentials under the Shared Key authentication scheme. + + The request to be signed. + + + + Signs a request using the specified credentials under the Shared Key Lite authentication scheme. + + The request to be signed. + + + + Transforms the Uri. + + The resource Uri. + The transformed Uri. + + + + Computes the 512-bit HMAC signature of the specified string. + + The string to sign. + The computed signature. + + + + Returns a that represents this instance. + + If set to true the string exposes key information. + + A that represents this instance. + + + + + Gets the name of the storage account associated with the specified credentials. + + The account name. + + + + Gets a value indicating whether the method will return a valid + HMAC-encoded signature string when called with the specified credentials. + + + Returns true if these credentials will yield a valid signature string; otherwise, false. + + + + + Gets a value indicating whether a request can be signed under the Shared Key authentication + scheme using the specified credentials. + + + Returns true if a request can be signed with these credentials; otherwise, false. + + + + + Gets a value indicating whether a request can be signed under the Shared Key Lite authentication + scheme using the specified credentials. + + + Returns true if a request can be signed with these credentials; otherwise, false. + + + + + Gets a value indicating whether the method must be called + before generating a signature string with the specified credentials. + + + Returns true if [needs transform Uri]; otherwise, false. If false, + calling returns the original, unmodified Uri. + + + + + Gets or sets the current object that this instance represents. + + + + + Contains helper methods for implementing shared access signatures. + + + + + Get the signature hash embedded inside the Shared Access Signature. + + The shared access policy to hash. + An optional identifier for the policy. + The canonical resource string, unescaped. + The client whose credentials are to be used for signing. + The signed hash. + + + + Get the complete query builder for creating the Shared Access Signature query. + + The shared access policy to hash. + An optional identifier for the policy. + Either "b" for blobs or "c" for containers. + The signature to use. + The finished query builder. + + + + Converts the specified value to either a string representation or . + + The value to convert. + A string representing the specified value. + + + + Converts the specified value to either a string representation or null. + + The value to convert. + A string representing the specified value. + + + + Escapes and adds the specified name/value pair to the query builder if it is not null. + + The builder to add the value to. + The name of the pair. + The value to be escaped. + + + + Parses the query. + + The query parameters. + The credentials. + + + + 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 The argument must not be empty string.. + + + + + Looks up a localized string similar to The argument is out of range. + + + + + Looks up a localized string similar to The argument '{0}' is larger than maximum of '{1}'. + + + + + Looks up a localized string similar to The argument '{0}' is smaller than minimum of '{1}'. + + + + + Looks up a localized string similar to Cannot attach to a TableStorageDataServiceContext object. These objects already contain the functionality for accessing the table storage service.. + + + + + Looks up a localized string similar to EncodeMessage should be true for binary message.. + + + + + Looks up a localized string similar to "Versions before 2009-09-19 do not support Shared Key Lite for Blob And Queue, current target version '{0}'". + + + + + Looks up a localized string similar to Cannot change size below currently written size. + + + + + Looks up a localized string similar to A stream blob must have a blob size of 0.. + + + + + Looks up a localized string similar to The blob is larger than maximum supported size '{0}'. + + + + + Looks up a localized string similar to BlobType of the blob reference doesn't match BlobType of the blob.. + + + + + Looks up a localized string similar to Data already uploaded. + + + + + Looks up a localized string similar to The block size must be positive value. + + + + + Looks up a localized string similar to Block size can not be larger than '{0}'. + + + + + Looks up a localized string similar to Cannot create Shared Access Signature for snapshots. Perform the operation on the root blob instead.. + + + + + Looks up a localized string similar to Cannot create Shared Access Signature as the credentials does not have account name information. Please check that the credentials used support creating Shared Access Signature.. + + + + + Looks up a localized string similar to Cannot create Shared Access Signature unless the Account Key credentials are used by the BlobServiceClient.. + + + + + Looks up a localized string similar to Cannot perform this operation on a blob representing a snapshot.. + + + + + Looks up a localized string similar to Cannot retry operation using a source stream which does not support seek. To avoid this exception set the RetryPolicy to NoRetry or use a seekable stream.. + + + + + Looks up a localized string similar to Server operation did not finish within user specified timeout '{0}' seconds, check if operation is valid or try increasing the timeout.. + + + + + Looks up a localized string similar to If-Modified-Since and If-Unmodified-Since require a DateTime value.. + + + + + Looks up a localized string similar to If-Match and If-None-Match require an ETag value.. + + + + + Looks up a localized string similar to The conditionals specified for this operation did not match server.. + + + + + Looks up a localized string similar to SetConfigurationSettingPublisher needs to be called before FromConfigurationSetting can be used. + + + + + Looks up a localized string similar to The supplied credentials '{0'} cannot be used to sign request. + + + + + Looks up a localized string similar to The option '{0}' must be 'None' to delete a specific snapshot specified by '{1}'. + + + + + Looks up a localized string similar to Cannot combine incompatible absolute Uris base '{0}' relative '{1}'.When trying to combine 2 absolute Uris, the base uri should be a valid base of the relative Uri.. + + + + + Looks up a localized string similar to Invalid acl public access type returned '{0}'. Expected blob or container.. + + + + + Looks up a localized string similar to The continuation type passed in is unexpected. Please verify that the correct continuation type is passed in. Expected {0}, found {1}. + + + + + Looks up a localized string similar to Invalid query parameters inside Blob address '{0}'.. + + + + + Looks up a localized string similar to Listing snapshots is only supported in flat mode (no delimiter). Consider setting BlobRequestOptions.UseFlatBlobListing property to true.. + + + + + Looks up a localized string similar to Calculated MD5 does not match existing property. + + + + + Looks up a localized string similar to Messages cannot be larger than {0} bytes.. + + + + + Looks up a localized string similar to Cannot find account information inside Uri '{0}'. + + + + + Looks up a localized string similar to Invalid blob address '{0}', missing container information. + + + + + Looks up a localized string similar to Missing mandatory parameters for valid Shared Access Signature. + + + + + Looks up a localized string similar to Canonicalization did not find a non empty x-ms-date header in the WebRequest. Please use a WebRequest with a valid x-ms-date header in RFC 123 format (example request.Headers["x-ms-date"] = DateTime.UtcNow.ToString("R", CultureInfo.InvariantCulture)). + + + + + Looks up a localized string similar to Cannot provide credentials as part of the address and as constructor parameter. Either pass in the address or use a different constructor.. + + + + + Looks up a localized string similar to Multiple different snapshot times provided as part of query '{0}' and as constructor parameter '{1}'.. + + + + + Looks up a localized string similar to EndMoveNextSegment must be called before the Current property can be accessed.. + + + + + Looks up a localized string similar to The segment cursor has no more results.. + + + + + Looks up a localized string similar to This operation is not supported for creating a PageBlob. Use other operations to create a PageBlob.. + + + + + Looks up a localized string similar to Missing account name information inside path style uri. Path style uris should be of the form http://<IPAddressPlusPort>/<accountName>. + + + + + Looks up a localized string similar to Address '{0}' is not an absolute address. Relative addresses are not permitted in here.. + + + + + Looks up a localized string similar to Attempting to seek past the end of the stream. + + + + + Looks up a localized string similar to Attempting to seek before the start of the stream. + + + + + Looks up a localized string similar to Server returned more that MaxResults requested. + + + + + Looks up a localized string similar to Snapshot query parameter is already defined in the blobUri. Either pass in a snapshotTime parameter or use a full URL with a snapshot query parameter.. + + + + + Looks up a localized string similar to '{0}' is not a valid table name.. + + + + + Looks up a localized string similar to The number of blocks is larger than the maximum of '{0}'. + + + + + Looks up a localized string similar to Too many '{0}' shared access policy identifiers provided. Server does not support setting more than '{1}' on a single container.. + + + + + Looks up a localized string similar to The blob type cannot be undefined.. + + + + + Represents a set of access conditions to be used for operations against the storage services. + + + + + Indicates that no access condition is set. + + + + + Returns an access condition such that an operation will be performed only if the resource has been modified since the specified time. + + The last-modified time for the resource, expressed as a UTC value. + A structure specifying the if-modified-since condition. + + + + Returns an access condition such that an operation will be performed only if the resource has not been modified since the specified time. + + The last-modified time for the resource, expressed as a UTC value. + A structure specifying the if-not-modified-since condition. + + + + Returns an access condition such that an operation will be performed only if the resource's ETag value matches the ETag value provided. + + The quoted ETag value to check. + A structure specifying the if-match condition. + + + + Returns an access condition such that an operation will be performed only if the resource's ETag value does not match the ETag value provided. + + The quoted ETag value to check. + A structure specifying the if-none-match condition. + + + + Converts AccessCondition into a type for use as a source conditional to Copy. + + The original condition. + The resulting header for the condition. + The value for the condition. + + + + Applies the condition to the web request. + + The request to be modified. + + + + Verifies the condition is satisfied. + + The ETag to check. + The last modified time UTC. + true if the condition is satisfied, otherwise false. + + + + Gets or sets the header of the request to be set. + + The access condition header. + + + + Gets or sets the value of the access condition header. + + The access condition header value. + + + + Represents a blob's attributes. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class from an existing object. + + The set of blob attributes to clone. + + + + Gets the blob's system properties. + + The blob's properties. + + + + Gets the user-defined metadata for the blob. + + The blob's metadata, as a collection of name-value pairs. + + + + Gets the blob's URI. + + The absolute URI to the blob. + + + + Gets the date and time that the blob snapshot was taken, if this blob is a snapshot. + + The blob's snapshot time if the blob is a snapshot; otherwise, null. + + If the blob is not a snapshot, the value of this property is null. + + + + + Represents a container's attributes, including its properties and metadata. + + + + + Initializes a new instance of the class. + + + + + Gets the user-defined metadata for the container. + + The container's metadata, as a collection of name-value pairs. + + + + Gets the container's system properties. + + The container's properties. + + + + Gets the name of the container. + + The container's name. + + + + Gets the container's URI. + + The absolute URI to the container. + + + + Represents the permissions for a container. + + + + + Initializes a new instance of the class. + + + + + Gets or sets the public access setting for the container. + + The public access setting for the container. + + + + Gets the set of shared access policies for the container. + + The set of shared access policies for the container. + + + + Represents the system properties for a container. + + + + + Gets the ETag value for the container. + + The container's quoted ETag value. + + + + Gets the container's last-modified time, expressed as a UTC value. + + The container's last-modified time. + + + + Specifies the level of public access that is allowed on the container. + + + + + No public access. Only the account owner can read resources in this container. + + + + + Container-level public access. Anonymous clients can read container and blob data. + + + + + Blob-level public access. Anonymous clients can read only blob data within this container. + + + + + Provides error code strings that are specific to the Blob service. + + + + + Error code that may be returned when a block ID is invalid. + + + + + Error code that may be returned when a blob with the specified address cannot be found. + + + + + Error code that may be returned when a client attempts to create a blob that already exists. + + + + + Error code that may be returned when the specified block or blob is invalid. + + + + + Error code that may be returned when a block list is invalid. + + + + + Specifies which items to include when listing a set of blobs. + + + + + List only committed blobs, and do not return blob metadata. + + + + + List committed blobs and blob snapshots. + + + + + Retrieve blob metadata for each blob returned in the listing. + + + + + List committed and uncommitted blobs. + + + + + List all available committed blobs, uncommitted blobs, and snapshots, and return all metadata for those blobs. + + + + + Represents the system properties for a blob. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class based on an existing instance. + + The set of properties to clone. + + + + Gets or sets the cache-control value stored for the blob. + + The blob's cache-control value. + + + + Gets or sets the content-encoding value stored for the blob. + + The blob's content-encoding value. + + If this property has not been set for the blob, it returns null. + + + + + Gets or sets the content-language value stored for the blob. + + The blob's content-language value. + + If this property has not been set for the blob, it returns null. + + + + + Gets the size of the blob, in bytes. + + The blob's size in bytes. + + + + Gets or sets the content-MD5 value stored for the blob. + + The blob's content-MD5 hash. + + + + Gets or sets the content-type value stored for the blob. + + The blob's content-type value. + + If this property has not been set for the blob, it returns null. + + + + + Gets the blob's ETag value. + + The blob's quoted ETag value. + + + + Gets the the last-modified time for the blob, expressed as a UTC value. + + The blob's last-modified time, in UTC format. + + + + Gets the type of the blob. + + A object that indicates the type of the blob. + + + + Gets the blob's lease status. + + A object that indicates the blob's lease status. + + + + This class represents a seekable, read-only stream on a blob. + + + + + Represents a stream for reading and writing to a blob. + + + + + Aborts the operation to write to the blob. + + + + + Begins an asynchronous operation to commit a blob. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + This operation is not currently supported. + + + + + Ends an asynchronous operation to commit the blob. + + An that references the pending asynchronous operation. + asyncResult is null + + This operation is not currently supported. + + + + + Commits the blob. + + + This operation is not currently supported. + + + + + Gets a reference to the blob on which the stream is opened. + + The blob this stream accesses. + + + + Gets a value indicating whether the signature of each block should be verified. + + + Returns true if integrity control verification is enabled; otherwise, false. + + + + + Gets or sets the number of bytes to read ahead. + + The number of bytes to read ahead. + + This operation is not currently supported. + + + + + Gets or sets the block size. + + The size of the block. + + This operation is not currently supported. + + + + + The threshold beyond which we start a new read-Ahead. + + + + + The current position with the stream. + + + + + The number of bytes to read forward on every request. + + + + + The options applied to the stream. + + + + + True if the AccessCondition has been changed to match a single ETag. + + + + + The list of blocks for this blob. + + + + + The already available blocks for reading. This member is the only possible point of thread contention between the user's requests and ReadAhead async work. + At any particular time, the ReadAhead thread may be adding more items into the list. The second thread will never remove/modify an existing item within the list. + + + + + A handle to the parallel download of data for ReadAhead. + + + + + Initializes a new instance of the BlobReadStream class. + + The blob used for downloads. + Modifiers to be applied to the blob. After first request, the ETag is always applied. + The number of bytes to read ahead. + Controls whether block's signatures are verified. + + + + Setting the length of the blob is not supported. + + The desired length. + Always thrown. + + + + Write is not supported. + + An array of bytes. This method copies count bytes from buffer to the current stream. + The zero-based byte offset in buffer at which to begin copying bytes to the current stream. + The number of bytes to be written to the current stream. + + + + Flush is not supported on read-only stream. + + + + + Seeks to the desired position. Any seek outside of the buffered/read-ahead data will cancel read-ahead and clear the buffered data. + + A byte offset relative to the origin parameter. + A value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position. + The new position within the current stream. + Thrown if offset is invalid for SeekOrigin + + + + Copies the specified amount of data from internal buffers to the buffer and advances the position. + + An array of bytes. When this method returns, the buffer contains the specified byte array with the values + between offset and (offset + count - 1) replaced by the bytes read from the current source. + The zero-based byte offset in buffer at which to begin storing the data read from the current stream. + The maximum number of bytes to be read from the current stream. + The total number of bytes read into the buffer. This can be less than the number of bytes requested + if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. + + The sum of offset and count is larger than the buffer length. + The buffer parameter is null. + The offset or count parameters are negative. + An I/O error occurs. + + + + Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream. + + The unsigned byte cast to an Int32, or -1 if at the end of the stream. + + + + Begins an asynchronous read operation. + + The buffer to read the data into. + The byte offset in at which to begin writing data read from the stream. + The maximum number of bytes to read. + An optional asynchronous callback, to be called when the read is complete. + A user-provided object that distinguishes this particular asynchronous read request from other requests. + + An that represents the asynchronous read, which could still be pending. + + + Attempted an asynchronous read past the end of the stream, or a disk error occurs. + + + One or more of the arguments is invalid. + + + Methods were called after the stream was closed. + + + The current Stream implementation does not support the read operation. + + + + + Ends an asynchronous read operation. + + The reference to the pending asynchronous request to finish. + + The number of bytes read from the stream, between zero (0) and the number of bytes you requested. + Streams return zero (0) only at the end of the stream, otherwise, they should block until at least one byte is available. + + + is null. + + + did not originate from a method on the current stream. + + + The stream is closed or an internal error has occurred. + + + + + Wraps the Read operation to remap any exceptions into IOException. + + The buffer to read the data into. + The zero-based byte offset in buffer at which to begin storing the data read from the current stream. + The maximum number of bytes to be read from the current stream. + The action to be done upon completion to return the number of bytes read. + A task sequence representing the operation. + The sum of offset and count is larger than the buffer length. + The buffer parameter is null. + The offset or count parameters are negative + An I/O error occurs. + + + + Performs the read operation. + + The buffer to read the data into. + The zero-based byte offset in buffer at which to begin storing the data read from the current stream. + The maximum number of bytes to be read from the current stream. + The action to be done upon completion to return the number of bytes read. + A task sequence representing the operation. + + If verification is on, retrieve the blocklist. + If there are downloaded blocks, read from there. + Otherwise, if there's an outstanding request, wait for completion and read from there. + Otherwise perform a new request. + + + + + Locks download to a specific ETag. + + + + + Reads the data from the service starting at the specified location. Verifies the block's signature (if required) and adds it to the buffered data. + + The starting position of the read-ahead. + The number of bytes to read ahead. + An TaskSequence that represents the asynchronous read action. + + + + Ends an asynchronous read-ahead operation. + + An that references the pending asynchronous operation. + asyncResult is null + + + + Retrieves the size of the blob. + + If verification is on, it will retrieve the blocklist as well + + + + Verifies if the blocks are in expected format. Disables the integrity control if they are not appropriate for validation. + + + + + Calculates the ReadAhead bounds (start and count) as required by the existing data. + + The desired start position. + The end of the existing gap. + The desired number of bytes. + The start position rounded down to the nearest block start. + The number of bytes with readAheadSize included and rounded up to the end of the nearest block. + This calculates the bounds based on the blocklist, not any existing data. + + + + Reads from the verified blocks as much data as is available and needed. + + The buffer to read the data into. + The zero-based byte offset in buffer at which to begin storing the data read from the current stream. + The maximum number of bytes to be read from the current stream. + True if there was any data read. + + + + Calculates if the currently held data is less than percentage depleted. + + The start position for any ReadAhead based on the last block. + True if more data is needed. + + + + Verifies if the given offset is within the bounds of the stream. + + The offset to be checked. + This may do a server round-trip if the length is not known. + + + + Gets a value indicating whether the current stream supports reading. + + Returns true if the stream supports reading; otherwise, false. + + + + Gets a value indicating whether the current stream supports seeking. + + Returns true if the stream supports seeking; otherwise, false. + + + + Gets a value indicating whether the current stream supports writing. + + Returns true if the stream supports writing; otherwise, false. + + + + Gets a value indicating whether the current stream can time out. + + A value that determines whether the current stream can time out. + + + + Gets or sets a value, in miliseconds, that determines how long the stream will attempt to read before timing out. + + A value, in miliseconds, that determines how long the stream will attempt to read before timing out. + + + + Gets the length of the blob. + + May need to do a roundtrip to retrieve it. + + + + Gets or sets the position within the stream. + + + + + Gets or sets the number of bytes to read ahead. + + + + + Gets a value indicating whether the signature of each downloaded block should be verified. + + This requires having a blocklist, having blockIDs to be in the appropriate format. This causes all reads to be rounded to the nearest block. + + + + Gets the number of bytes that are cached locally but not yet read by user. + + + + + Gets a value indicating whether length is available. + + + + + Represents a single block of data that was downloaded. + + + + + Initializes a new instance of the class. + + The start offset. + The content. + + + + Gets the starting location of the block. + + + + + Gets the content of the block. + + + + + Encapsulates the collection of downloaded blocks and provides appropriate locking mechanism. + + + + + Holds the downloaded blocks. + + + + + Finds the block that contains the data for the . + + The position which is requested. + A block that contains the data for the or null. + + + + Removes any downloaded blocks that are outside the current bounds (position and readAheadSize). + + The position before which all blocks should be purged. + Size of the read-ahead beyond position for blocks to be kept. + + + + Calculates the length of the gap relative to . + + The position from which to find the gap. + Size of the desired. + The gap start. + The gap end. + + + + Tells if there are any blocks available. + + Returns true if there are any blocks; otherwise, false. + + + + Adds the specified downloaded block. + + The downloaded block. + + + + Removes the specified block based on the startOffset key. + + The key for the block. + + + + Represents a set of options that may be specified on a request. + + + + + The server and client timeout interval for the request. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class based on an + existing instance. + + The set of request options to clone. + + + + Initializes a new instance of the class. + + An object of type . + + + + Creates the full modifier. + + The type of the options. + The service. + An object that specifies any additional options for the request. + A full modifier of the requested type. + + + + Clones this instance. + + A clone of the instance. + + + + Applies the defaults. + + The service. + + + + Gets or sets the retry policy for the request. + + The retry policy delegate. + + + + Gets or sets the server and client timeout for the request. + + The server and client timeout interval for the request. + + + + Gets or sets the access condition for the request. + + A structure that specifies any conditional parameters on the request. + + + + Gets or sets the access condition on the source blob, when the request is to copy a blob. + + A structure that specifies any conditional parameters on the request. + + This property is applicable only to a request that will copy a blob. + + + + + Gets or sets options for deleting snapshots when a blob is to be deleted. + + One of the enumeration values that specifies whether to delete blobs and snapshots, delete blobs only, or delete snapshots only. + + This property is applicable only to a request that will delete a blob. + + + + + Gets or sets options for listing blobs. + + One of the enumeration values that indicates what items a listing operation will return. + + This property is applicable only to a request to list blobs. + + + + + Gets or sets a value indicating whether the blob listing operation will list all blobs in a container in a flat listing, + or whether it will list blobs hierarchically, by virtual directory. + + True if blobs will be listed in a flat listing; otherwise, false. The default value is false. + + This property is applicable only to a request to list blobs. + + + + + The type of a blob. + + + + + Not specified. + + + + + A page blob. + + + + + A block blob. + + + + + The class is an append-only stream for writing into storage. + + + + + Internal Block ID sequence number. Used in generating Block IDs. + + + + + The stream is writable until committed/close. + + + + + The current position within the blob. + + + + + The size of the blocks to use. + + + + + The list of uploaded blocks. + + + + + A memory stream holding the current block information. + + + + + The hash of the current block. + + + + + The ongoing blob hash. + + + + + The set of options applying to the current blob. + + + + + Initializes a new instance of the BlobWriteStream class. + + The blob used for uploads. + The options used for the stream. + The size of the blocks to use. + + + + The stream does not support reading. + + An array of bytes. When this method returns, the buffer contains the specified byte array with the values + between offset and (offset + count - 1) replaced by the bytes read from the current source. + The zero-based byte offset in buffer at which to begin storing the data read from the current stream. + The maximum number of bytes to be read from the current stream. + The total number of bytes read into the buffer. This can be less than the number of bytes requested + if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. + + Not supported operation as this is a write-only stream + + + + The stream does not support seeking. + + A byte offset relative to the origin parameter. + A value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position. + The new position within the current stream. + Not supported operation as this is a write-only stream + + + + The stream does not support setting of length. + + The desired length of the current stream in bytes. + Growing a stream is not possible without writing. + + + + Write the provided data into the underlying stream. + + An array of bytes. This method copies count bytes from buffer to the current stream. + The zero-based byte offset in buffer at which to begin copying bytes to the current stream. + The number of bytes to be written to the current stream. + is null. + offset or count is negative. + Thrown if blob is already committed/closed + + + + Copies a single byte into the stream. + + The byte of data to be written. + + + + Begins an asynchronous write operation. + + The buffer to write data from. + The byte offset in buffer from which to begin writing. + The number of bytes to write. + An optional asynchronous callback, to be called when the write is complete. + A user-provided object that distinguishes this particular asynchronous write request from other requests. + An IAsyncResult that represents the asynchronous write, which could still be pending. + is null. + offset or count is negative. + Thrown if blob is already committed/closed + The operation will be completed synchronously if the buffer is not filled + + + B + Ends an asynchronous write operation. + + An that references the pending asynchronous operation. + asyncResult is null + + + + Causes any buffered data to be written to the remote storage. If the blob is not using blocks, the blob is fully committed. + + An I/O error occurs while writing to storage. + + + + Aborts the upload of the blob. + + + + + Begins an asynchronous operation to commit the blob. + + An optional asynchronous callback, to be called when the commit is complete. + A user-provided object that distinguishes this particular asynchronous commit request from other requests. + An IAsyncResult that represents the asynchronous commit, which could still be pending. + + + + Ends an asynchronous operation to commit the blob. + + An that references the pending asynchronous operation. + asyncResult is null + + + + Commits the blob on the server. + + + + + Implements the disposing logic of committing the blob. + + True to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Generates a blockID using the block's hash and a prefix. + + The base64 encoded blockID. + + + + Implements the block writing task. + + The buffer to write data from. + The byte offset in buffer from which to begin writing. + The number of bytes to write. + The sequence representing the uploading of the blocks. + + + + Creates a task that writes data for a full blob. + + The buffer to write data from. + The byte offset in buffer from which to begin writing. + The number of bytes to write. + The (synchronous) sequence that copies the data into a buffer. + Thrown if the buffer is larger than maximum blob size. + Since a non-block based blob is always fully buffered before upload, this task is a synchronous copy. + + + + Implements the flushing sequence. + + The sequence of events for a flush. + + + + Commits the blob by uploading any remaining data and the blocklist asynchronously. + + A sequence of events required for commit. + + + + Implements a sequence of events to upload a full blob. + + The sequence of events required to upload the blob. + + + + Sets the MD5 of the blob. + + + + + Implements a sequence to upload a block. + + The sequence of events for upload. + + + + Verifies that the blob is in writable state. + + Thrown if stream is non-writable. + + + + Resets the block and the block hash. + + + + + Creates the new block and the block hash. + + + + + Gets a value indicating whether the current stream supports reading. + + Returns true if the stream supports reading; otherwise, false. + + + + Gets a value indicating whether the current stream supports seeking. + + Returns true if the stream supports seeking; otherwise, false. + + + + Gets a value indicating whether the current stream supports writing. + + Returns true if the stream supports writing; otherwise, false. + + + + Gets a value indicating whether the current stream can time out. + + A value that determines whether the current stream can time out. + + + + Gets or sets a value, in milliseconds, that determines how long the stream will attempt to write before timing out. + + + + + Gets the current length (equal to the position). + + + A long value representing the length of the stream in bytes. + + + A class derived from Stream does not support seeking. + + + Methods were called after the stream was closed. + + + + + Gets or sets the current position. + + + The current position within the stream. + + + An I/O error occurs. + + + The stream does not support seeking. + + + Methods were called after the stream was closed. + + + + + Gets or sets the block size. + + + + + Gets a value indicating whether the upload is done in blocks. + + Returns true if blocks are to be used; otherwise, false. + + + + Indicates whether to list only committed blocks, only uncommitted blocks, or all blocks. + + + + + Committed blocks. + + + + + Uncommitted blocks. + + + + + Both committed and uncommitted blocks. + + + + + Represents a Windows Azure blob. + + + + + Represents an item that may be returned by a blob listing operation. + + + + + Gets the URI to the blob item. + + The blob item's URI. + + + + Gets the blob item's parent. + + The blob item's parent. + + + + Gets the blob item's container. + + The blob item's container. + + + + Stores the blob's attributes. + + + + + Stores the that contains this blob. + + + + + Stores the name of this blob. + + + + + Stores the blob's parent . + + + + + Stores the blob's transformed address. + + + + + Initializes a new instance of the class using an absolute URI to the blob. + + The absolute URI to the blob. + + + + Initializes a new instance of the class using an absolute URI to the blob + and a set of credentials. + + The absolute URI to the blob. + The account credentials. + + + + Initializes a new instance of the class using an absolute URI to the blob, and the snapshot timestamp, + if the blob is a snapshot. + + The absolute URI to the blob. + The snapshot timestamp, if the blob is a snapshot. + The account credentials. + + + + Initializes a new instance of the class using a relative URI to the blob, and the snapshot timestamp, + if the blob is a snapshot. + + The relative URI to the blob, beginning with the container name. + The snapshot timestamp, if the blob is a snapshot. + A client object that specifies the endpoint for the Blob service. + + + + Initializes a new instance of the class using a relative URI to the blob. + + The relative URI to the blob, beginning with the container name. + A client object that specifies the endpoint for the Blob service. + + + + Initializes a new instance of the class based on an existing instance. + + An existing reference to a blob. + + + + Initializes a new instance of the class. + + Absolute Uri. + True to use path style Uri. + + Any authentication information inside the address will be used. + Otherwise a blob for anonymous access is created. + Any snapshot information as part of the address will be recorded + Explicity specify whether to use host style or path style Uri + + + + + Initializes a new instance of the class creating a new service client. + + Complete Uri. + Storage credentials. + True to use path style Uris. + + + + Initializes a new instance of the class with the given absolute Uri. + + True to use path style Uris. + The absolute blob Uri. + + + + Initializes a new instance of the class with existing attributes. + + The attributes (NOTE: Saved by reference, does not make a copy). + The service client. + The snapshot time. + + + + Initializes a new instance of the class using the specified blob Uri. + Note that this is just a reference to a blob instance and no requests are issued to the service + yet to update the blob properties, attribute or metaddata. FetchAttributes is the API that + issues such request to the service. + + A relative Uri to the blob. + A object that specifies the endpoint for the Blob service. + The reference to the parent container. + + + + Initializes a new instance of the class using the specified relative blob Uri. + If snapshotTime is not null, the blob instance represents a Snapshot. + Note that this is just a reference to a blob instance and no requests are issued to the service + yet to update the blob properties, attribute or metaddata. FetchAttributes is the API that + issues such request to the service. + + A relative Uri to the blob. + Snapshot time in case the blob is a snapshot. + A object that specifies the endpoint for the Blob service. + The reference to the parent container. + + + + Populates a blob's properties and metadata. + + + + + Populates a blob's properties and metadata. + + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to populate the blob's properties and metadata. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to populate the blob's properties and metadata. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to populate the blob's properties and metadata. + + An that references the pending asynchronous operation. + + + + Updates the blob's metadata. + + + + + Updates the blob's metadata. + + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to update the blob's metadata. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to update the blob's metadata. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to update the blob's metadata. + + An that references the pending asynchronous operation. + + + + Updates the blob's properties. + + + + + Updates the blob's properties. + + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to update the blob's properties. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to update the blob's properties. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to update the blob's properties. + + An that references the pending asynchronous operation. + + + + Copies an existing blob's contents, properties, and metadata to a new blob. + + The source blob. + + + + Copies a blob's contents, properties, and metadata to a new blob. + + The source blob. + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to copy a blob's contents, properties, and metadata to a new blob. + + The source blob. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to copy another blob's contents, properties, and metadata to the blob referenced by this object. + + The source blob. + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to copy a blob's contents, properties, and metadata to a new blob. + + An that references the pending asynchronous operation. + + + + Deletes the blob. + + + + + Deletes the blob. + + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to delete the blob. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to delete the blob. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to delete the blob. + + An that references the pending asynchronous operation. + + + + Deletes the blob if it exists. + + true if the blob was deleted; otherwise, false. + + + + Deletes the blob if it exists. + + An object that specifies any additional options for the request. + true if the blob was deleted; otherwise, false. + + + + Begins an asynchronous operation to delete the blob if it exists. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to delete the blob if it exists. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to delete the blob if it exists. + + An that references the pending asynchronous operation. + true if the blob was successfully deleted; otherwise, false. + + + + Opens a stream for writing to the blob. + + A stream to be used for writing to the blob. + + + + Opens a stream for writing to the blob. + + An object that specifies any additional options for the request. + A stream to be used for writing to the blob. + + + + Uploads a stream to a block blob. + + The stream providing the blob content. + + + + Uploads a stream to a block blob. + + The stream providing the blob content. + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to upload a stream to a block blob. + + The stream providing the blob content. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to upload a stream to a block blob. + + The stream providing the blob content. + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to upload a stream to a block blob. + + An that references the pending asynchronous operation. + + + + Uploads a string of text to a block blob. + + The text to upload, encoded as a UTF-8 string. + + + + Uploads a string of text to a block blob. + + The text to upload. + An object that indicates the text encoding to use. + An object that specifies any additional options for the request. + + + + Uploads a file from the file system to a block blob. + + The path and file name of the file to upload. + + + + Uploads a file from the file system to a block blob. + + The path and file name of the file to upload. + An object that specifies any additional options for the request. + + + + Uploads an array of bytes to a block blob. + + The array of bytes to upload. + + + + Uploads an array of bytes to a blob. + + The array of bytes to upload. + An object that specifies any additional options for the request. + + + + Opens a stream for reading the blob's contents. + + A stream to use for reading from the blob. + + + + Opens a stream for reading the blob's contents. + + An object that specifies any additional options for the request. + A stream to use for reading from the blob. + + + + Downloads the contents of a blob to a stream. + + The target stream. + + + + Downloads the contents of a blob to a stream. + + The target stream. + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to download the contents of a blob to a stream. + + The target stream. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to download the contents of a blob to a stream. + + The target stream. + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to download the contents of a blob to a stream. + + An that references the pending asynchronous operation. + + + + Downloads the blob's contents. + + The contents of the blob, as a string. + + + + Downloads the blob's contents. + + An object that specifies any additional options for the request. + The contents of the blob, as a string. + + + + Downloads the blob's contents to a file. + + The path and file name of the target file. + + + + Downloads the blob's contents to a file. + + The path and file name of the target file. + An object that specifies any additional options for the request. + + + + Downloads the blob's contents as an array of bytes. + + The contents of the blob, as an array of bytes. + + + + Downloads the blob's contents as an array of bytes. + + An object that specifies any additional options for the request. + The contents of the blob, as an array of bytes. + + + + Creates a snapshot of the blob. + + A blob snapshot. + + + + Creates a snapshot of the blob. + + An object that specifies any additional options for the request. + A blob snapshot. + + + + Creates a snapshot of the blob. + + A collection of name-value pairs defining the metadata of the snapshot. + An object that specifies any additional options for the request, or null. + A blob snapshot. + + + + Begins an asynchronous operation to create a snapshot of the blob. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to create a snapshot of the blob. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to create a snapshot of the blob. + + A collection of name-value pairs defining the metadata of the snapshot. + An object that specifies any additional options for the request, or null. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to create a snapshot of the blob. + + An that references the pending asynchronous operation. + A blob snapshot. + + + + Returns a shared access signature for the blob. + + The access policy for the shared access signature. + A shared access signature. + Thrown if the current credentials don't support creating a shared access signature. + Thrown if blob is a snapshot. + + + + Returns a shared access signature for the blob. + + The access policy for the shared access signature. + A container-level access policy. + A shared access signature. + Thrown if the current credentials don't support creating a shared access signature. + Thrown if blob is a snapshot. + + + + Dispatches the stream upload to a specific implementation method. + + The source stream. + An object that specifies any additional options for the request. + A that uploads the stream. + + + + Uploads the blob with buffering. + + The source stream. + An object that specifies any additional options for the request. + The size of the block. + A that uploads the blob. + + + + Uploads the full blob with retry. + + The source stream. + An object that specifies any additional options for the request. + A that uploads the blob. + + + + Uploads the full blob. + + The source stream. + An object that specifies any additional options for the request. + A that uploads the blob. + + + + Uploads the blob in parallel with blocks. + + The source stream. + The size of the block. + An object that specifies any additional options for the request. + A that uploads the blob. + + + + Uploads the block with retry. + + The source stream. + The block IS. + The content MD5. + An object that specifies any additional options for the request. + A that uploads the block. + + + + Uploads the block. + + The source stream. + The block ID. + The content MD5. + An object that specifies any additional options for the request. + A that uploads the block. + + + + Uploads the data into the web request. + + The request that is setup for a put. + The source of data. + The response from the server. + The sequence used for uploading data. + + + + Implements the FetchAttributes method. + + An object that specifies any additional options for the request. + A that fetches the attributes. + + + + Implements the DownloadToStream method. + + The target stream. + An object that specifies any additional options for the request. + A that downloads the blob to the stream. + + + + Implements the DownloadToStream method. + + The target stream. + An object that specifies any additional options for the request. + A that downloads the blob to the stream. + + + + Implements getting the stream. + + An object that specifies any additional options for the request. + The offset. + The count. + The set result. + A that gets the stream. + + + + Implements getting the stream without specifying a range. + + An object that specifies any additional options for the request. + A that gets the stream. + + + + Implements getting the stream without specifying a range. + + An object that specifies any additional options for the request. + The set result. + A that gets the stream. + + + + Retreive ETag and LastModified date time from response. + + The response to parse. + + + + Parses the blob address query and returns snapshot and SAS. + + The query to parse. + The snapshot value, if any. + The SAS credentials. + + + + Gets the default encoding for the blob, which is UTF-8. + + The default object. + + + + Gets the canonical name of the blob, formatted as /<account-name>/<container-name>/<blob-name>. + If ignoreSnapshotTime is false and this blob is a snapshot, the canonical name is augmented with a + query of the form ?snapshot=<snapshot-time>. + This is used by both Shared Access and Copy blob operations. + Used by both Shared Access and Copy blob operation. + + Indicates if the snapshot time is ignored. + The canonical name of the blob. + + + + Uploads a stream that doesn't have a known length. In this case we can't do any optimizations like creating a request before we read all of the data. + + The stream that is the source of data. + An object that specifies any additional options for the request. + The block size to be used (null - no blocks). + A sequence that represents uploading the blob. + This is implemented by creating a BlobStream and using that to buffer data until we have sufficient amount to be sent. + + + + Uploads the blob with blocks. + + The source stream. + An object that specifies any additional options for the request. + The size of the block. + A that uploads the blob. + + + + Uploads the full blob with a retry sequence. The stream must be seekable. + + The source stream, which must be seekable. + An object that specifies any additional options for the request. + A that uploads the blob. + + + + Implementation of the CopyFromBlob method. + + The source blob. + An object that specifies any additional options for the request. + A that copies the blob. + + + + Implements the DeleteBlob method. + + An object that specifies any additional options for the request. + A that deletes the blob. + + + + Implementation for the DeleteIfExists method. + + An object that specifies any additional options for the request. + The set result. + A that deletes the blob if it exists. + + + + Implementation for the CreateSnapshot method. + + A collection of name-value pairs defining the metadata of the snapshot, or null. + An object that specifies any additional options for the request. + The result report delegate. + A that creates the snapshot. + If the metadata parameter is null then no metadata is associated with the request. + + + + Implementation for the SetMetadata method. + + An object that specifies any additional options for the request. + A that sets the metadata. + + + + Implementation for the SetProperties method. + + An object that specifies any additional options for the request. + A that sets the properties. + + + + Verifies that write operation is not done for snapshot. + + + + + Parses the snapshot time. + + The snapshot time. + The parsed snapshot time. + + + + Parse Uri for any snapshot and SAS (Shared access signature) information. Validate that no other query parameters are passed in. + + The complete Uri. + The existing blob client. + True to use path style Uris. + + Any snapshot information will be saved. + Any SAS information will be recorded as corresponding credentials instance. + If existingClient is passed in, any SAS information found will not be supported. + Otherwise a new client is created based on SAS information or as anonymous credentials. + + + + + Gets the value that uniquely identifies the snapshot, if this blob is a snapshot. + + A value that uniquely identfies the snapshot. + + If the blob is not a snapshot, this property returns null. + + + + + Gets the object that represents the Blob service. + + A client object that specifies the Blob service endpoint. + + + + Gets the URI that identifies the blob. + + The address of the blob. + + + + Gets the object that represents the blob's attributes. + + The blob's attributes. + + + + Gets the blob's user-defined metadata. + + The blob's metadata. + + + + Gets the blob's system properties. + + The blob's system properties. + + + + Gets the blob's name. + + The blob's name. + + + + Gets a object representing the blob's container. + + The blob's container. + + + + Gets the object representing the + virtual parent directory for the blob. + + The blob's virtual parent directory. + + + + Gets a object based on this blob. + + A reference to a page blob. + + + + Gets a object based on this blob. + + A reference to a block blob. + + + + Gets the Uri after applying authentication transformation. + + The transformed address. + + + + Provides a client for accessing the Windows Azure Blob service. + + + + + Constant for the max value of ParallelOperationThreadCount. + + + + + Stores the default delimiter. + + + + + Stores the parallelism factor. + + + + + Default is 32 MB. + + + + + Default is 4 MB. + + + + + The default server and client timeout interval. + + + + + Initializes a new instance of the class to be used for anonymous access. + + The Blob service endpoint to use to create the client. + + + + Initializes a new instance of the class using the specified Blob service endpoint + and account credentials. + + The Blob service endpoint to use to create the client. + The account credentials. + + + + Initializes a new instance of the class using the specified Blob service endpoint + and account credentials. + + The Blob service endpoint to use to create the client. + The account credentials. + + + + Initializes a new instance of the class. + + True to use path style Uris. + The base Uri. + The credentials. + + + + Gets the properties of the blob service. + + The blob service properties. + + + + Begins an asynchronous operation to get the properties of the blob service. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to get the properties of the blob service. + + The result returned from a prior call to . + The blob service properties. + + + + Sets the properties of the blob service. + + The blob service properties. + + + + Begins an asynchronous operation to set the properties of the blob service. + + The blob service properties. + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to set the properties of the blob service. + + The result returned from a prior call to . + + + + Returns a reference to a object with the specified address. + + The absolute URI to the blob, or a relative URI beginning with the container name. + A reference to a page blob. + + + + Returns a reference to a object with the specified address. + + The absolute URI to the blob, or a relative URI beginning with the container name. + A reference to a page blob. + + + + Returns a reference to a object with the specified address. + + The absolute URI to the blob, or a relative URI beginning with the container name. + The snapshot timestamp, if the blob is a snapshot. + A reference to a page blob. + + + + Returns a reference to a object with the specified address. + + The absolute URI to the blob, or a relative URI beginning with the container name. + A reference to a block blob. + + + + Returns a reference to a with the specified address. + + The absolute URI to the blob, or a relative URI beginning with the container name. + A reference to a block blob. + + + + Returns a reference to a with the specified address. + + The absolute URI to the blob, or a relative URI beginning with the container name. + The snapshot timestamp, if the blob is a snapshot. + A reference to a block blob. + + + + Returns a reference to a with the specified address. + + The absolute URI to the blob, or a relative URI beginning with the container name. + A reference to a blob. + + + + Returns a reference to a blob with the specified address. + + The absolute URI to the blob, or a relative URI beginning with the container name. + The snapshot timestamp, if the blob is a snapshot. + A reference to a blob. + + + + Returns a reference to a object with the specified address. + + The name of the container, or an absolute URI to the container. + A reference to a container. + + + + Returns a reference to a object with the specified address. + + The absolute URI to the virtual directory, + or a relative URI beginning with the container name. + A reference to a virtual directory. + + + + Returns an enumerable collection of containers. + + An enumerable collection of containers. + + + + Returns an enumerable collection of containers whose names begin with the specified prefix. + + The container name prefix. + An enumerable collection of containers. + + + + Returns an enumerable collection of containers whose names + begin with the specified prefix and that are retrieved lazily. + + The container name prefix. + A value that indicates whether to return container metadata with the listing. + An enumerable collection of containers that are retrieved lazily. + + + + Returns a result segment containing a collection of containers. + + A result segment of containers. + + + + Returns a result segment containing a collection of containers + whose names begin with the specified prefix. + + The container name prefix. + A result segment of containers. + + + + Returns a result segment containing a collection of containers + whose names begin with the specified prefix. + + The container name prefix. + A value that indicates whether to return container metadata with the listing. + A non-negative integer value that indicates the maximum number of results to be returned + in the result segment, up to the per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + A result segment of containers. + + + + Begins an asynchronous request to return a result segment containing a collection of containers. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to return a result segment containing a collection of containers + whose names begin with the specified prefix. + + The container name prefix. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to return a result segment containing a collection of containers + whose names begin with the specified prefix. + + The container name prefix. + A value that indicates whether to return container metadata with the listing. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to return a result segment containing a collection of containers + whose names begin with the specified prefix. + + The container name prefix. + A value that indicates whether to return container metadata with the listing. + A non-negative integer value that indicates the maximum number of results to be returned + in the result segment, up to the per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return a result segment containing a collection of containers. + + An that references the pending asynchronous operation. + A result segment of containers. + + + + Returns an enumerable collection of blob items whose names begin with the specified prefix. + + The blob name prefix. This value must be preceded either by the name of the container or by the absolute URI to the container. + An enumerable collection of objects that implement . + + + + Returns an enumerable collection of blob items whose names begin with the specified prefix and that are retrieved lazily. + + The blob name prefix. This value must be preceded either by the name of the container or by the absolute URI to the container. + An object that specifies any additional options for the request. + An enumerable collection of objects that implement and are retrieved lazily. + + + + Returns a result segment containing a collection of blob items whose names + begin with the specified prefix. + + The blob name prefix. This value must be preceded either by the name of the container or by the absolute path to the container. + A result segment containing objects that implement . + + + + Returns a result segment containing a collection of blob items whose names + begin with the specified prefix. + + The blob name prefix. This value must be preceded either by the name of the container or by the absolute path to the container. + An object that specifies any additional options for the request. + A result segment containing objects that implement . + + + + Returns a result segment containing a collection of blob items whose names + begin with the specified prefix. + + The blob name prefix. This value must be preceded either by the name of the container or by the absolute path to the container. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the per-operation limit of 5000. + If this value is zero, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + A result segment containing objects that implement . + + + + Returns a result segment containing a collection of blob items whose names + begin with the specified prefix. + + The blob name prefix. This value must be preceded either by the name of the container or by the absolute path to the container. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the per-operation limit of 5000. + If this value is zero, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + An object that specifies any additional options for the request. + A result segment containing objects that implement . + + + + Begins an asynchronous operation to return a result segment containing a collection + of blob items whose names begin with the specified prefix. + + The blob name prefix. This value must be preceded either by the name of the container or by the absolute path to the container. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a result segment containing a collection + of blob items whose names begin with the specified prefix. + + The blob name prefix. This value must be preceded either by the name of the container or by the absolute path to the container. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return a result segment containing a collection + of blob items whose names begin with the specified prefix. + + An that references the pending asynchronous operation. + A result segment containing objects that implement . + + + + Selects the protocol response. + + The protocol item. + The service. + The container. + The parsed . + + + + Ends the asynchronous GetResponse operation. + + An that references the asynchronous operation. + The request to end the operation on. + The from the asynchronous request. + + + + Gets the response for the operation. + + The request to end the operation on. + The from the request. + + + + Parses the user prefix. + + The prefix. + Name of the container. + The listing prefix. + + + + Converts the date time to snapshot string. + + The snapshot time to convert. + A string representing the snapshot time. + + + + Implementation for the ListContainers method. + + The container prefix. + The details included. + The continuation token. + The maximum results to return. + The result report delegate. + A that lists the containers. + + + + Core implementation for the ListContainers method. + + The container prefix. + The details included. + The continuation token. + The pagination. + The result report delegate. + A that lists the containers. + + + + Implementation for the ListBlobs method. + + The blob prefix. + The continuation token. + The max results. + An object that specifies any additional options for the request. + The result report delegate. + + A that lists the blobs. + + + + + Generates a task sequence for getting the properties of the blob service. + + A delegate to receive the service properties. + A task sequence that gets the properties of the blob service. + + + + Generates a task sequence for setting the properties of the blob service. + + The blob service properties to set. + A task sequence that sets the properties of the blob service. + + + + Occurs when a response is received from the server. + + + + + Gets the account credentials used to create the Blob service client. + + The account credentials. + + + + Gets the base URI for the Blob service client. + + The base URI used to construct the Blob service client. + + + + Gets or sets the default retry policy for requests made via the Blob service client. + + The retry policy. + + + + Gets or sets the default server and client timeout for requests made by the Blob service client. + + The server and client timeout interval. + + + + Gets or sets the default delimiter that may be used to create a virtual directory structure of blobs. + + The default delimiter. + + + + Gets or sets the maximum size of a blob in bytes that may be uploaded as a single blob. + + The maximum size of a blob, in bytes, that may be uploaded as a single blob, + ranging from between 1 and 64 MB inclusive. + + + + Gets or sets the maximum block size for writing to a block blob. + + The maximum size of a block, in bytes, ranging from between 1 and 4 MB inclusive. + + + + Gets or sets the number of bytes to pre-fetch when reading from a stream. + + The number of bytes to read ahead from a stream. + + + + Gets or sets a value indicating whether the integrity of each block should be verified when reading from a stream. + + True if using integrity control for stream reading; otherwise, false. The default value is true. + + + + Gets or sets the number of blocks that may be simultaneously uploaded when uploading a blob that is greater than + the value specified by the property. + in size. + + The number of parallel operations that may proceed. + + + + Gets a value indicating whether the service client is used with Path style or Host style. + + Is true if use path style uris; otherwise, false. + + + + Represents a container in the Windows Azure Blob service. + + + + + Stores the transformed address. + + + + + Initializes a new instance of the class. + + The absolute URI to the container. + + + + Initializes a new instance of the class. + + The absolute URI to the container. + The account credentials. + + + + Initializes a new instance of the class. + + Either the absolute URI to the container, or the container name. + A client object that specifies the endpoint for the Blob service. + + + + Initializes a new instance of the class with the given address and path style Uri preference. + + The container's address. + True to use path style Uris. + + + + Initializes a new instance of the class. + + The container address. + The credentials. + If set to true path style Uris are used. + + + + Initializes a new instance of the class. + + The attributes for the container (NOTE: Stored by reference). + The client to be used. + + + + Initializes a new instance of the class. + + True to use path style Uris. + The container's address. + + + + Gets a reference to a blob in this container. + + The name of the blob, or the absolute URI to the blob. + A reference to a blob. + + + + Gets a reference to a page blob in this container. + + The name of the blob, or the absolute URI to the blob. + A reference to a page blob. + + + + Gets a reference to a block blob in this container. + + The name of the blob, or the absolute URI to the blob. + A reference to a block blob. + + + + Gets a reference to a virtual blob directory beneath this container. + + The name of the virtual blob directory, or the absolute URI to the virtual blob directory. + A reference to a virtual blob directory. + + + + Returns an enumerable collection of the blobs in the container. + + An enumerable collection of objects that implement . + + + + Returns an enumerable collection of the blobs in the container that are retrieved lazily. + + An object that specifies any additional options for the request. + An enumerable collection of objects that implement and are retrieved lazily. + + + + Returns a result segment containing a collection of blob items + in the container. + + An object that specifies any additional options for the request. + A result segment containing objects that implement . + + + + Returns a result segment containing a collection of blob items + in the container. + + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + An object that specifies any additional options for the request. + A result segment containing objects that implement . + + + + Begins an asynchronous operation to return a result segment containing a collection of blob items + in the container. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a result segment containing a collection of blob items + in the container. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a result segment containing a collection of blob items + in the container. + + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return a result segment containing a collection of blob items + in the container. + + An that references the pending asynchronous operation. + A result segment containing objects that implement . + + + + Creates the container. + + + + + Creates the container. + + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to create a container. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to create a container. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to create a container. + + An that references the pending asynchronous operation. + + + + Creates the container if it does not already exist. + + true if the container did not already exist and was created; otherwise, false. + + + + Creates the container if it does not already exist. + + An object that specifies any additional options for the request. + true if the container did not already exist and was created; otherwise false. + + + + Begins an asynchronous request to create the container if it does not already exist. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to create the container if it does not already exist. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the result of an asynchronous request to create the container if it does not already exist. + + An that references the pending asynchronous operation. + true if the container did not already exist and was created; otherwise, false. + + + + Deletes the container. + + + + + Deletes the container. + + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to delete a container. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to delete a container. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to delete a container. + + An that references the pending asynchronous operation. + + + + Sets permissions for the container. + + The permissions to apply to the container. + + + + Sets permissions for the container. + + The permissions to apply to the container. + An object that specifies any additional options for the request. + + + + Begins an asynchronous request to set permissions for the container. + + The permissions to apply to the container. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to set permissions for the container. + + The permissions to apply to the container. + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the result of an asynchronous request to set permissions for the container. + + An that references the pending asynchronous operation. + + + + Gets the permissions settings for the container. + + The container's permissions. + + + + Gets the permissions settings for the container. + + An object that specifies any additional options for the request. + The container's permissions. + + + + Begins an asynchronous request to get the permissions settings for the container. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to get the permissions settings for the container. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Returns the asynchronous result of the request to get the permissions settings for the container. + + An that references the pending asynchronous operation. + The container's permissions. + + + + Retrieves the container's attributes. + + + + + Retrieves the container's attributes. + + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to retrieve the container's attributes. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to retrieve the container's attributes. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to retrieve the container's attributes. + + An that references the pending asynchronous operation. + + + + Sets the container's user-defined metadata. + + + + + Sets the container's user-defined metadata. + + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to set user-defined metadata on the container. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to set user-defined metadata on the container. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous request operation to set user-defined metadata on the container. + + An that references the pending asynchronous operation. + + + + Returns a shared access signature for the container. + + The access policy for the shared access signature. + A shared access signature. + + + + Returns a shared access signature for the container. + + The access policy for the shared access signature. + A container-level access policy. + A shared access signature. + + + + Implementation for the ListBlobs method. + + The blob prefix. + An object that specifies any additional options for the request. + The continuation token. + The maximum result size. + The result report delegate. + A that lists the blobs. + + + + Retrieve ETag and LastModified date time from response. + + The response to parse. + + + + Converts the ACL string to a object. + + The string to convert. + The resulting object. + + + + Parse Uri for SAS (Shared access signature) information. + + The complete Uri. + The client to use. + If true, path style Uris are used. + + Validate that no other query parameters are passed in. + Any SAS information will be recorded as corresponding credentials instance. + If existingClient is passed in, any SAS information found will not be supported. + Otherwise a new client is created based on SAS information or as anonymous credentials. + + + + + Returns the canonical name for shared access. + + The canonical name. + + + + Gets the absolute Uri of the blob. + + Name of the blob. + The blob's absolute Uri. + + + + Core implementation of the ListBlobs method. + + The blob prefix. + An object that specifies any additional options for the request. + The continuation token. + The pagination. + The result report delegate. + A that lists the blobs. + + + + Implementation for the Create method. + + An object that specifies any additional options for the request. + A that creates the container. + + + + Implementation for the CreateIfNotExist method. + + An object that specifies any additional options for the request. + The set result. + A that creates the container if it does not exist. + + + + Implementation for the Delete method. + + An object that specifies any additional options for the request. + A that deletes the container. + + + + Implementation for the FetchAttributes method. + + An object that specifies any additional options for the request. + A that fetches the attributes. + + + + Implementation for the SetMetadata method. + + An object that specifies any additional options for the request. + A that sets the metadata. + + + + Implementation for the SetPermissions method. + + The permissions to set. + An object that specifies any additional options for the request. + A that sets the permissions. + + + + Implementation for the GetPermissions method. + + An object that specifies any additional options for the request. + The result report delegate. + A that gets the permissions. + + + + Gets the service client for the container. + + A client object that specifies the endpoint for the Blob service. + + + + Gets the container's URI. + + The absolute URI to the container. + + + + Gets the name of the container. + + The container's name. + + + + Gets the container's metadata. + + The container's metadata. + + + + Gets the container's attributes. + + The container's attributes. + + + + Gets the container's system properties. + + The container's properties. + + + + Gets the Uri after applying authentication transformation. + + + + + Represents a virtual directory of blobs, designated by a delimiter character. + + + + + Stores the parent directory. + + + + + Stores the parent container. + + + + + Stores the prefix this directory represents. + + + + + Initializes a new instance of the class given an address and a client. + + The blob directory's address. + The client to use. + + + + Returns a reference to a blob in this virtual directory. + + The name of the blob. + A reference to a blob. + + + + Returns a reference to a blob in this virtual directory. + + The name of the blob. + The snapshot timestamp, if the blob is a snapshot. + A reference to a blob. + + + + Returns a reference to a page blob in this virtual directory. + + The name of the page blob. + A reference to a page blob. + + + + Returns a reference to a page blob in this virtual directory. + + The name of the page blob. + The snapshot timestamp, if the blob is a snapshot. + A reference to a page blob. + + + + Returns a reference to a block blob in this virtual directory. + + The name of the block blob. + A reference to a block blob. + + + + Returns a reference to a block blob in this virtual directory. + + The name of the block blob. + The snapshot timestamp, if the blob is a snapshot. + A reference to a block blob. + + + + Returns a virtual subdirectory within this virtual directory. + + The name of the virtual subdirectory. + A object representing the virtual subdirectory. + + + + Returns an enumerable collection of blob items in this virtual directory that is lazily retrieved, either as a flat listing or by virtual subdirectory. + + An object that specifies any additional options for the request. + An enumerable collection of objects that implement and are retrieved lazily. + + + + Returns an enumerable collection of blob items in this virtual directory, either as a flat listing or by virtual subdirectory. + + An enumerable collection of objects that implement . + + + + Returns a result segment containing a collection of blob items. + + An object that specifies any additional options for the request. + A result segment containing objects that implement . + + + + Returns a result segment containing a collection of blob items. + + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + An object that specifies any additional options for the request. + A result segment containing objects that implement . + + + + Begins an asynchronous request to return a result segment containing a collection of blob items. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to return a result segment containing a collection of blob items. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous request to return a result segment containing a collection of blob items. + + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous request to return a result segment containing a collection of blob items. + + An that references the pending asynchronous operation. + A result segment containing objects that implement . + + + + Initializes the prefix. + + + + + Gets the service client for the virtual directory. + + A client object that specifies the endpoint for the Blob service. + + + + Gets the URI that identifies the virtual directory. + + The URI to the virtual directory. + + + + Gets the container for the virtual directory. + + The container for the virtual directory. + + + + Gets the parent directory for the virtual directory. + + The virtual directory's parent directory. + + + + Gets the prefix. + + The prefix. + + + + Represents a blob that is uploaded as a set of blocks. + + + + + Initializes a new instance of the class using an absolute URI to the blob. + + The absolute URI to the blob. + The account credentials. + + + + Initializes a new instance of the class using a relative URI to the blob. + + The relative URI to the blob, beginning with the container name. + A client object that specifies the endpoint for the Blob service. + + + + Initializes a new instance of the class using a relative URI to the blob. + + The relative URI to the blob, beginning with the container name. + The snapshot timestamp, if the blob is a snapshot. + A client object that specifies the endpoint for the Blob service. + + + + Initializes a new instance of the class using an absolute URI to the blob. + + The absolute URI to the blob. + + + + Initializes a new instance of the class using an absolute URI to the blob. + + The absolute URI to the blob. + The account credentials. + True to use path-style URIs; otherwise, false. + + + + Initializes a new instance of the class using an absolute URI to the blob. + + The absolute URI to the blob. + True to use path-style URIs; otherwise, false. + + + + Initializes a new instance of the class based on an existing blob. + + The blob to clone. + + + + Initializes a new instance of the class. + + The attributes. + The service client. + The snapshot time. + + + + Initializes a new instance of the class using the specified blob Uri. + Note that this is just a reference to a blob instance and no requests are issued to the service + yet to update the blob properties, attribute or metaddata. FetchAttributes is the API that + issues such request to the service. + + Relative Uri to the blob. + Existing Blob service client which provides the base address. + The reference to the parent container. + + + + Initializes a new instance of the class using the specified blob Uri. + If snapshotTime is not null, the blob instance represents a Snapshot. + Note that this is just a reference to a blob instance and no requests are issued to the service + yet to update the blob properties, attribute or metaddata. FetchAttributes is the API that + issues such request to the service. + + Relative Uri to the blob. + Snapshot time in case the blob is a snapshot. + Existing Blob service client which provides the base address. + The reference to the parent container. + + + + Returns an enumerable collection of the committed blocks comprising the blob. + + An enumerable collection of objects implementing . + + + + Returns an enumerable collection of the committed blocks comprising the blob. + + An object that specifies any additional options for the request. + An enumerable collection of objects implementing . + + + + Returns an enumerable collection of the blob's blocks, using the specified block list filter. + + One of the enumeration values that indicates whether to return + committed blocks, uncommitted blocks, or both. + An enumerable collection of objects implementing . + + + + Returns an enumerable collection of the blob's blocks, using the specified block list filter. + + One of the enumeration values that indicates whether to return + committed blocks, uncommitted blocks, or both. + An object that specifies any additional options for the request. + An enumerable collection of objects implementing . + + + + Begins an asynchronous operation to return an enumerable collection of the blob's blocks, + using the specified block list filter. + + One of the enumeration values that indicates whether to return + committed blocks, uncommitted blocks, or both. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return an enumerable collection of the blob's blocks, + using the specified block list filter. + + One of the enumeration values that indicates whether to return + committed blocks, uncommitted blocks, or both. + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return an enumerable collection of the blob's blocks, + using the specified block list filter. + + An that references the pending asynchronous operation. + An enumerable collection of objects implementing . + + + + Uploads a single block. + + A base64-encoded block ID that identifies the block. + A stream that provides the data for the block. + An optional hash value that will be used to set the property + on the blob. May be null or an empty string. + + + + Uploads a single block. + + A base64-encoded block ID that identifies the block. + A stream that provides the data for the block. + An optional hash value that will be used to set the property + on the blob. May be null or an empty string. + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to upload a single block. + + A base64-encoded block ID that identifies the block. + A stream that provides the data for the block. + An optional hash value that will be used to set the property + on the blob. May be null or an empty string. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to upload a single block. + + A base64-encoded block ID that identifies the block. + A stream that provides the data for the block. + An optional hash value that will be used to set the property + on the blob. May be null or an empty string. + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to upload a single block. + + An that references the pending asynchronous operation. + + + + Uploads a list of blocks to a new or existing blob. + + An enumerable collection of block IDs, as base64-encoded strings. + + + + Uploads a list of blocks to a new or existing blob. + + An enumerable collection of block IDs, as base64-encoded strings. + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to upload a list of blocks to a new or existing blob. + + An enumerable collection of block IDs, as base64-encoded strings. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to upload a list of blocks to a new or existing blob. + + An enumerable collection of block IDs, as base64-encoded strings. + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to upload a list of blocks to a new or existing blob. + + An that references the pending asynchronous operation. + + + + Uploads the block list. + + The blocks to upload. + An object that specifies any additional options for the request. + A that uploads the block list. + + + + Gets the download block list. + + The types of blocks. + An object that specifies any additional options for the request. + The result report delegate. + A that gets the download block list. + + + + Parses the response. + + The block list response. + An enumerable list of objects. + + + + Represents a blob made up of a collection of pages. + + + + + Initializes a new instance of the class using an absolute URI to the blob. + + The absolute URI to the blob. + The account credentials. + + + + Initializes a new instance of the class using an absolute URI to the blob. + + The absolute URI to the blob. + + + + Initializes a new instance of the class using a relative URI to the blob. + + The relative URI to the blob, beginning with the container name. + A client object that specifies the endpoint for the Blob service. + + + + Initializes a new instance of the class using a relative URI to the blob. + + The relative URI to the blob, beginning with the container name. + The snapshot timestamp, if the blob is a snapshot. + A client object that specifies the endpoint for the Blob service. + + + + Initializes a new instance of the class based on an existing object. + + An object of type . + + + + Initializes a new instance of the class. + + The attributes. + The service client. + The snapshot time. + + + + Initializes a new instance of the class. + + The blob address. + The credentials. + If set to true, use path style Uris. + + + + Initializes a new instance of the class. + + The blob address. + If set to true, use path style Uris. + + + + Initializes a new instance of the class using the specified blob Uri. + Note that this is just a reference to a blob instance and no requests are issued to the service + yet to update the blob properties, attribute or metaddata. FetchAttributes is the API that + issues such request to the service. + + The blob address. + The service client. + The reference to the parent container. + + + + Initializes a new instance of the class using the specified blob Uri. + If snapshotTime is not null, the blob instance represents a Snapshot. + Note that this is just a reference to a blob instance and no requests are issued to the service + yet to update the blob properties, attribute or metaddata. FetchAttributes is the API that + issues such request to the service. + + The blob address. + Snapshot time in case the blob is a snapshot. + The service client. + The reference to the parent container. + + + + Creates a page blob. + + The maximum size of the page blob, in bytes. + + + + Creates a page blob. + + The maximum size of the page blob, in bytes. + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to create a page blob. + + The maximum size of the page blob, in bytes. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to create a page blob. + + The maximum size of the blob, in bytes. + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to create a page blob. + + An that references the pending asynchronous operation. + + + + Writes pages to a page blob. + + A stream providing the page data. + The offset at which to begin writing, in bytes. The offset must be a multiple of 512. + + + + Writes pages to a page blob. + + A stream providing the page data. + The offset at which to begin writing, in bytes. The offset must be a multiple of 512. + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to write pages to a page blob. + + A stream providing the page data. + The offset at which to begin writing, in bytes. The offset must be a multiple of 512. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to write pages to a page blob. + + A stream providing the page data. + The offset at which to begin writing, in bytes. The offset must be a multiple of 512. + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to write pages to a page blob. + + An that references the pending asynchronous operation. + + + + Clears pages from a page blob. + + The offset at which to begin clearing pages, in bytes. The offset must be a multiple of 512. + The length of the data range to be cleared, in bytes. The length must be a multiple of 512. + + + + Clears pages from a page blob. + + The offset at which to begin clearing pages, in bytes. The offset must be a multiple of 512. + The length of the data range to be cleared, in bytes. The length must be a multiple of 512. + An object that specifies any additional options for the request. + + + + Begins an asynchronous operation to clear pages from a page blob. + + The offset at which to begin clearing pages, in bytes. The offset must be a multiple of 512. + The length of the data range to be cleared, in bytes. The length must be a multiple of 512. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to clear pages from a page blob. + + The offset at which to begin clearing pages, in bytes. The offset must be a multiple of 512. + The length of the data range to be cleared, in bytes. The length must be a multiple of 512. + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to clear pages from a page blob. + + An that references the pending asynchronous operation. + + + + Gets a collection of page ranges and their starting and ending bytes. + + An enumerable collection of page ranges. + + + + Gets a collection of page ranges and their starting and ending bytes. + + An object that specifies any additional options for the request. + An enumerable collection of page ranges. + + + + Begins an asynchronous operation to return a collection of page ranges and their starting and ending bytes. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a collection of page ranges and their starting and ending bytes. + + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return a collection of page ranges and their starting and ending bytes. + + An that references the pending asynchronous operation. + An enumerable collection of page ranges. + + + + Opens a stream for writing to the blob. + + A stream for writing to the blob. + This operation is not supported on objects of type . + + + + Opens a stream for writing to the blob. + + An object that specifies any additional options for the request. + A stream for writing to the blob. + This operation is not supported on objects of type . + + + + Uploads a blob from a stream. + + A stream that provides the blob content. + This operation is not supported on objects of type . + + + + Uploads a blob from a stream. + + A stream that provides the blob content. + An object that specifies any additional options for the request. + This operation is not supported on objects of type . + + + + Begins an asynchronous operation to upload a blob from a stream. + + The data stream to upload. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + This operation is not supported on objects of type . + + + + Begins an asynchronous operation to upload a blob from a stream. + + The data stream to upload. + An object that specifies any additional options for the request. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + This operation is not supported on objects of type . + + + + Ends an asynchronous operation to upload a blob from a stream. + + An that references the pending asynchronous operation. + This operation is not supported on objects of type . + + + + Uploads a string of text to a blob. + + The text to upload, encoded as a UTF-8 string. + This operation is not supported on objects of type . + + + + Uploads a string of text to a blob. + + The text to upload. + An object indicating the text encoding to use. + An object that specifies any additional options for the request. + This operation is not supported on objects of type . + + + + Uploads a file from the file system to a blob. + + The path and file name of the file to upload. + This operation is not supported on objects of type . + + + + Uploads a file from the file system to a blob. + + The path and file name of the file to upload. + An object that specifies any additional options for the request. + This operation is not supported on objects of type . + + + + Uploads an array of bytes to a blob. + + The array of bytes to upload. + This operation is not supported on objects of type . + + + + Uploads an array of bytes to a blob. + + The array of bytes to upload. + An object that specifies any additional options for the request. + This operation is not supported on objects of type . + + + + Creates an exception reporting that the creation method is not supported. + + The created exception. + + + + Implements the Create method. + + An object that specifies any additional options for the request. + The size in bytes. + A that creates the blob. + + + + Gets the page ranges impl. + + An object that specifies any additional options for the request. + The set result. + A for getting the page ranges. + + + + Implementation method for the WritePage methods. + + The page data. + The start offset. + The beginning position of the source stream prior to execution, negative if stream is unseekable. + An object that specifies any additional options for the request. + A that writes the pages. + + + + Implementation method for the ClearPage methods. + + The start offset. Must be multiples of 512. + Length of the data range to be cleared. Must be multiples of 512. + An object that specifies any additional options for the request. + A that writes the pages. + + + + Represents a Windows Azure queue. + + + + + Stores the queue attributes. + + + + + Uri for the messages. + + + + + Initializes a new instance of the class. + + The absolute URI to the queue. + The account credentials. + + + + Initializes a new instance of the class. + + The relative address. + The storage account credentials. + If set to true, use path style Uris. + + + + Initializes a new instance of the class. + + True to use path style Uris. + The address. + The credentials. + + + + Initializes a new instance of the class. + + The queue address. + The client. + + + + Initializes a new instance of the class. + + The attributes of the queue. + The client. + + + + Creates a queue. + + + + + Begins an asynchronous operation to create a queue. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to create a queue. + + An that references the pending asynchronous operation. + + + + Creates the queue if it does not exist. + + true if the queue did not exist and was created; otherwise false. + + + + Begins an asynchronous operation to create the queue if it does not exist. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to create the queue if it does not exist. + + An that references the pending asynchronous operation. + Returns true if the creation succeeded; otherwise, false. + + + + Deletes the queue. + + + + + Begins an asynchronous operation to delete the queue. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to delete the queue. + + An that references the pending asynchronous operation. + + + + Determines if the queue exists. + + True if the queue exists; otherwise false. + + + + Begins an asynchronous operation to determine whether the queue exists. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to determine whether the queue exists. + + An that references the pending asynchronous operation. + Returns true if the queue exists; otherwise, false. + + + + Fetches the queue's attributes. + + + + + Begins an asynchronous operation to fetch the queue's attributes. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to fetch the queue's attributes. + + An that references the pending asynchronous operation. + + + + Sets the queue's metadata. + + + + + Begins an asynchronous operation to set the queue's metadata. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to set the queue's metadata. + + An that references the pending asynchronous operation. + + + + Retrieves the approximate message count for the queue. This method fetches + the value from the server and updates the + property as well. + + The approximate message count. + + + + Adds a message to the queue. + + The message to add. + + + + Adds a message to the queue. + + The message to add. + The maximum time to allow the message to be in the queue. + + + + Adds a message to the queue. + + The message to add. + The maximum time to allow the message to be in the queue, or null. + The length of time from now during which the message will be invisible. + If null then the message will be visible immediately. + + + + Begins an asynchronous operation to add a message to the queue. + + The message to add. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to add a message to the queue. + + The message to add. + The maximum time to allow the message to be in the queue. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to add a message to the queue. + + The message to add. + The maximum time to allow the message to be in the queue, or null. + The length of time from now during which the message will be invisible. + If null then the message will be visible immediately. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to add a message to the queue. + + An that references the pending asynchronous operation. + + + + Gets a list of messages from the queue. + + The number of messages to retrieve. + An enumerable collection of messages. + + + + Gets a list of messages from the queue. + + The number of messages to retrieve. + The visibility timeout interval. + An enumerable collection of messages. + + + + Begins an asynchronous operation to get messages from the queue. + + The number of messages to retrieve. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to get messages from the queue. + + The number of messages to retrieve. + The visibility timeout interval. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to get messages from the queue. + + An that references the pending asynchronous operation. + An enumerable collection of messages. + + + + Gets a single message from the queue. + + A message. + + + + Gets a single message from the queue. + + The visibility timeout interval. + A message. + + + + Begins an asynchronous operation to get a single message from the queue. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to get a single message from the queue. + + The visibility timeout interval. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to get a single message from the queue. + + An that references the pending asynchronous operation. + A message. + + + + Peeks a message from the queue. + + A message. + + + + Begins an asynchronous operation to peek a message from the queue. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to peek a message from the queue. + + An that references the pending asynchronous operation. + A message. + + + + Peeks a set of messages from the queue. + + The number of messages to retrieve. + A enumerable collection of messages. + + + + Begins an asynchronous operation to peek a set of messages from the queue. + + The number of messages to retrieve. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to peek a set of messages from the queue. + + An that references the pending asynchronous operation. + An enumerable collection of messages. + + + + Deletes a message. + + A message. + + + + Deletes a message. + + The message ID. + The pop receipt value. + + + + Begins an asynchronous operation to delete a message. + + A message. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to delete a message. + + The message ID. + The pop receipt value. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to delete a message. + + An that references the pending asynchronous operation. + + + + Updates the visibility timeout and optionally the content of a message. + + The message to update. + The length of time from now during which the message will be invisible. + Flags indicating which parts of the message are to be updated. This must include the Visibility flag. + + + + Begins an asynchronous operation to update the visibility timeout and optionally the content of a message. + + The message to update. + The length of time from now during which the message will be invisible. + Flags indicating which parts of the message are to be updated. This must include the Visibility flag. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to update the visibility timeout and possibly the contents of a message. + + The IAsyncResult returned from a prior call to . + + + + Clears all messages from the queue. + + + + + Begins an asynchronous operation to clear all messages from the queue. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to clear all messages from the queue. + + An that references the pending asynchronous operation. + + + + Gets the individual message address. + + The message id. + The Uri of the message. + + + + Materialize results so that we can close the response object. + + List of response objects from the Protocol layer. + Projection function. + A materialized list of messages. + + + + Selects the get message response. + + The protocol message. + The parsed message. + + + + Selects the peek message response. + + The protocol message. + The parsed message. + + + + Gets the message internal. + + The visibility timeout. + The retrieved message. + + + + Gets the messages internal. + + The number of messages. + The visibility timeout. + A list of retrieved messages. + + + + Begins the get messages internal. + + The number of mesages. + The visibility timeout. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An asynchronous result that represents the operation. + + + + Existses the impl. + + The set result. + A that detects whether the queue exists. + + + + Sets the metadata impl. + + A that sets the metadata. + + + + Fetches the metadata and properties impl. + + A that fetches the attributes. + + + + Creates the impl. + + A that creates the queue. + + + + Creates if not exist impl. + + The set result. + A that creates the queue if it doesn't exist. + + + + Deletes the impl. + + A that deletes the queue. + + + + Clears the messages impl. + + A that clears the messages in the queue. + + + + Generates a task sequence for adding a message to the queue. + + The message. + The time to live. + The initial visibility delay. + A that adds the message. + + + + Generates a suitable string for representing the content of a message in the body of a web request. + + The message. + A string appropriately encoded depending on the format of the message and the EncodeMessage property. + + + + Peeks the messages impl. + + The number of messages. + The set result. + A that returns the peeked messages. + + + + Deletes the message impl. + + The message id. + The pop receipt value. + A that deletes the message. + + + + Generates a task sequence for updating a message in the queue. + + The message. + The visibility timeout. + The flags controlling which parts of the message to update. Must include Visibility. + A that updates the message. + + + + Gets the messages impl. + + The number of messages. + The visibility timeout. + The set result. + A that gets the message. + + + + Gets the properties and metadata from response. + + The web response. + + + + Gets the object that represents the Queue service. + + A client object that specifies the Queue service endpoint. + + + + Gets the queue name. + + The queue name. + + + + Gets the URI that identifies the queue. + + The address of the queue. + + + + Gets the queue's attributes. + + The queue's attributes. + + + + Gets the queue's user-defined metadata. + + The queue's user-defined metadata. + + + + Gets the approximate message count for the queue. + + The approximate message count. + + + + Gets or sets a value indicating whether to apply base64 encoding when adding or retrieving messages. + + True to encode messages; otherwise, false. The default value is true. + + + + Gets the Uri for general message operations. + + + + + Provides a client for accessing the Windows Azure Queue service. + + + + + The default server and client timeout interval. + + + + + Initializes a new instance of the class using the specified + Queue service endpoint and account credentials. + + The Queue service endpoint to use to create the client. + The account credentials. + + + + Initializes a new instance of the class using the specified + Queue service endpoint and account credentials. + + The Queue service endpoint to use to create the client. + The account credentials. + + + + Initializes a new instance of the class. + + The base address. + The credentials. + If set to true [use path style Uris]. + + + + Initializes a new instance of the class. + + The base address Uri. + The credentials. + If set to true [use path style Uris]. + + + + Initializes a new instance of the class. + + True to use path style Uris. + The base address Uri. + The credentials. + + + + Gets a reference to the queue at the specified address. + + Either the name of the queue, or the absolute URI to the queue. + A reference to the queue. + + + + Returns an enumerable collection of the queues in the storage account. + + An enumerable collection of queues. + + + + Returns an enumerable collection of the queues in the storage account whose names begin with the specified prefix. + + The queue name prefix. + An enumerable collection of queues. + + + + Returns an enumerable collection of the queues in the storage account whose names begin with the specified prefix and that are retrieved lazily. + + The queue name prefix. + One of the enumeration values that indicates which details to include in the listing. + An enumerable collection of queues that are retrieved lazily. + + + + Returns a result segment containing a collection of queues + in the storage account. + + A result segment containing a collection of queues. + + + + Returns a result segment containing a collection of queues + in the storage account. + + The queue name prefix. + One of the enumeration values that indicates which details to include in the listing. + A result segment containing a collection of queues. + + + + Returns a result segment containing a collection of queues + whose names begin with the specified prefix. + + The queue name prefix. + One of the enumeration values that indicates which details to include in the listing. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + A result segment containing a collection of queues. + + + + Begins an asynchronous operation to return a result segment containing a collection of queues + in the storage account. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a result segment containing a collection of queues + whose names begin with the specified prefix. + + The queue name prefix. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a result segment containing a collection of queues + whose names begin with the specified prefix. + + The queue name prefix. + One of the enumeration values that indicates which details to include in the listing. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a result segment containing a collection of queues + whose names begin with the specified prefix. + + The queue name prefix. + One of the enumeration values that indicates which details to include in the listing. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return a result segment containing a collection of queues. + + An that references the pending asynchronous operation. + A result segment containing the results of the first request. + + + + Gets the properties of the queue service. + + The queue service properties. + + + + Begins an asynchronous operation to get the properties of the queue service. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to get the properties of the queue service. + + The result returned from a prior call to . + The queue service properties. + + + + Sets the properties of the queue service. + + The queue service properties. + + + + Begins an asynchronous operation to set the properties of the queue service. + + The queue service properties. + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to set the properties of the queue service. + + The result returned from a prior call to . + + + + Ends the get response. + + The asynchronous result. + The request. + The web response. + + + + Lists the queues impl. + + The prefix. + The details included. + The continuation token. + The max results. + The set result. + A for listing the queues. + + + + Lists the queues impl core. + + The prefix. + The details included. + The continuation token. + The pagination. + The set result. + A for listing the queues. + + + + Selects the response. + + The item to parse. + A object representing the item. + + + + Generates a task sequence for getting the properties of the queue service. + + A delegate to receive the service properties. + A task sequence that gets the properties of the queue service. + + + + Generates a task sequence for setting the properties of the queue service. + + The queue service properties to set. + A task sequence that sets the properties of the queue service. + + + + Occurs when a response is received from the server. + + + + + Gets or sets the default retry policy for requests made via the Queue service client. + + The retry policy. + + + + Gets or sets the server timeout for requests made via the Queue service client. + + The server timeout interval. + + + + Gets or sets the lifetime of the approximate message count cache. Obsolete. + + The lifetime of the approximate message count cache. + The approximate message count is not cached. This is an obsolete property that has no effect. + + + + Gets a value indicating whether requests made via the Queue service client will employ path-style URIs. + + True to use path-style URIs; otherwise, false. + + + + Gets the account credentials used to create the Queue service client. + + An object of type . + + + + Gets the base URI for the Queue service client. + + The base URI used to construct the Queue service client. + + + + Enum for Queue message type. + + + + + Indicates the message object stores the raw text string. + + + + + Indicates the message object stores the Base64-Encoded representation of the raw data. + + + + + Represents a message in a queue. + + + + + The maximum message size in bytes. + + + + + The maximum amount of time a message is kept in the queue. + + + + + The maximum number of messages that can be peeked at a time. + + + + + Custom UTF8Encoder to throw exception in case of invalid bytes. + + + + + Initializes a new instance of the class with the given byte array. + + The content of the message as a byte array. + + + + Initializes a new instance of the class with the given string. + + The content of the message as a string of text. + + + + Initializes a new instance of the class with the given Base64 encoded string. + This method is only used internally. + + The text string. + Whether the string is Base64 encoded. + + + + Sets the content of this message. + + The new message content. + + + + Sets the content of this message. + + The new message content. + + + + Gets the content of the message as a byte array. + + The content of the message as a byte array. + + + + Gets or sets the message ID. + + The message ID. + + + + Gets or sets the message's pop receipt. + + The pop receipt value. + + + + Gets or sets the time that the message was added to the queue. + + The time that that message was added to the queue. + + + + Gets or sets the time that the message expires. + + The time that the message expires. + + + + Gets or sets the time that the message will next be visible. + + The time that the message will next be visible. + + + + Gets the content of the message, as a string. + + The message content. + + + + Gets or sets the number of times this message has been dequeued. + + The number of times this message has been dequeued. + + + + Gets message type that indicates if the RawString is the original message string or Base64 encoding of the original binary data. + + + + + Gets or sets the original message string or Base64 encoding of the original binary data. + + The original message string. + + + + Provides a set of extensions to the class that may be used to generate client objects for + the Windows Azure storage services. + + + + + Creates a new Blob service client. + + The storage account. + A client object that specifies the Blob service endpoint. + + + + Creates a new Queue service client. + + The storage account. + A client object that specifies the Queue service endpoint. + + + + Creates the Table service client. + + The storage account. + A client object that specifies the Table service endpoint. + + + + Provides a client for accessing the Windows Azure Table service. + + + + + The default server and client timeout interval. + + + + + Initializes a new instance of the class using the specified Table service endpoint + and account credentials. + + The Table service endpoint to use to create the client. + The account credentials. + + + + Initializes a new instance of the class using the specified Table service endpoint + and account credentials. + + The Table service endpoint to use to create the client. + The account credentials. + + + + Creates the tables needed for the specified service context. + + The type of service context. + The Table service endpoint to use to create the client. + The account credentials. + + + + Creates a new object for performing operations against the Table service. + + A service context to use for performing operations against the Table service. + + + + Attaches to the specified service context. + + The service context to attach to. + + + + Begins an asychronous operation to create a table. + + The table name. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asychronous operation to create a table. + + An that references the pending asynchronous operation. + + + + Creates a table with specified name. + + The table name. + + + + Begins an asynchronous operation to create a table with the specified name if it does not already exist. + + The table name. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to create a table with the specified name if it does not already exist. + + An that references the pending asynchronous operation. + true if table was created; otherwise, false. + + + + Creates the table if it does not already exist. + + The table name. + true if table was created; otherwise, false. + + + + Begins an asynchronous operation to determine whether a table exists. + + The table name. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to determine whether a table exists. + + An that references the pending asynchronous operation. + true if table exists; otherwise, false. + + + + Checks whether the table exists. + + The table name. + true if table exists; otherwise, false. + + + + Returns an enumerable collection of table names in the storage account. + + An enumerable collection of table names. + + + + Returns an enumerable collection of table names that begin with the specified prefix and that are retrieved lazily. + + The table name prefix. + An enumerable collection of table names that are retrieved lazily. + + + + Returns a result segment containing a collection of table names in the storage account. + + A result segment containing table names. + + + + Returns a result segment containing a collection of table names in the storage account. + + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + A result segment containing table names. + + + + Returns a result segment containing a collection of table names beginning with the specified prefix. + + The table name prefix. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + A result segment containing table names. + + + + Begins an asynchronous operation to return a result segment containing a collection of table names + in the storage account. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a result segment containing a collection + of table names beginning with the specified prefix. + + The table name prefix. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to return a result segment containing a collection + of table names beginning with the specified prefix. + + The table name prefix. + A non-negative integer value that indicates the maximum number of results to be returned at a time, up to the + per-operation limit of 5000. If this value is zero, the maximum possible number of results will be returned, up to 5000. + A continuation token returned by a previous listing operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to return a result segment containing a collection + of table names. + + An that references the pending asynchronous operation. + A result segment containing table names. + + + + Begins an asynchronous operation to delete a table. + + The table name. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + + An that references the asynchronous request. + + + + + Ends an asynchronous operation to delete a table. + + An that references the pending asynchronous operation. + + + + Deletes the table. + + The table name. + + + + Begins an asynchronous operation to delete the tables if it exists. + + The table name. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to delete the tables if it exists. + + An that references the pending asynchronous operation. + true if the table was deleted; otherwise, false. + + + + Deletes the table if it exists. + + The table name. + true if the table was deleted; otherwise, false. + + + + Gets the properties of the table service. + + The table service properties. + + + + Begins an asynchronous operation to get the properties of the table service. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to get the properties of the table service. + + The result returned from a prior call to . + The table service properties. + + + + Sets the properties of the table service. + + The table service properties. + + + + Begins an asynchronous operation to set the properties of the table service. + + The table service properties. + The callback delegate that will receive notification when the asynchronous operation completes. + A user defined object to be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to set the properties of the table service. + + The result returned from a prior call to . + + + + Ends the asynchronous GetResponse operation. + + An that references the asynchronous operation. + The request to end the operation on. + The from the asynchronous request. + + + + Gets the result or default. + + The type of the result. + The task to retrieve the result from. + Receives result of the task. + true if the result was returned; otherwise, false. + + + + Creates the table implementation. + + The table name. + The set result. + A sequence of tasks to do the operation. + + + + Creates the table if not exist implementation. + + The table name. + The set result. + A sequence of tasks to do the operation. + + + + Verifies whether the table exist implementation. + + The table name. + The set result. + A sequence of tasks to do the operation. + + + + Returns an enumerable collection of tables segmented impl. + + The prefix. + The max results. + The continuation token. + The set result. + A that lists the tables. + + + + Returns an enumerable collection of tables segmented implementation. + + The prefix. + The continuation token. + The pagination. + The last result. + The set result. + A sequence of tasks to do the operation. + + + + Delete table implementation. + + The table name. + A sequence of tasks to do the operation. + + + + Deletes table if exists implementation. + + The table name. + The set result. + A sequence of tasks to do the operation. + + + + Generates a task sequence for getting the properties of the table service. + + A delegate to receive the service properties. + A task sequence that gets the properties of the table service. + + + + Generates a task sequence for setting the properties of the table service. + + The table service properties to set. + A task sequence that sets the properties of the table service. + + + + Occurs when a response is received from the server. + + + + + Gets the minimum supported timestamp value for a table entity. + + The minimum supported timestamp value for a table entity. + + + + Gets the base URI for the Table service client. + + The base URI used to construct the Table service client. + + + + Gets or sets the default retry policy for requests made via the Table service client. + + The retry policy. + + + + Gets or sets the default server timeout for requests made by the Table service client. + + The server timeout interval. + + + + Gets the account credentials used to create the Table service client. + + The account credentials. + + + + Represents a query against the Windows Azure Table service. + + The type of the query result. + + + + Stores the header prefix for continuation information. + + + + + Stores the header suffix for the next partition key. + + + + + Stores the header suffix for the next row key. + + + + + Stores the table suffix for the next table name. + + + + + Stores the maximum results the table service can return. + + + + + Stores the pagination options. + + + + + Stores the wrapped . + + + + + Initializes a new instance of the class with the specified query. + + The base query. + + + + Initializes a new instance of the class with the specified query + and retry policy. + + The base query. + The retry policy for the query. + + + + Executes the query with the retry policy specified on the object. + + The results of the query, retrieved lazily. + + + + Executes the query with the retry policy specified on the object. + + A continuation token returned by a previous listing operation. + The results of the query, retrieved lazily. + + + + Begins an asynchronous operation to execute a query and return the results as a result segment. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to execute a query and return the results as a result segment. + + A continuation token returned by a previous listing operation. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to execute a query and return the results as a result segment. + + The reference to the pending asynchronous request to finish. + A result segment containing objects of type . + + + + Expands the specified path. + + The path to expand. + A new query with the expanded path. + + + + Returns an enumerator that iterates through the collection. + + A that can be used to iterate through the collection. + + + + Returns a that represents this instance. + + A that represents this instance. + + + + Returns an enumerator that can be used to iterate through a collection. + + + An that can be used to iterate through a collection. + + + + + Executes the segmented impl. + + The continuation token. + The set result. + A that executes the query and returns the first segment of results. + + + + Rewrites the query for take count. + + The local query. + The pagination. + The rewritten query. + + + + Applies the continuation to query. + + The continuation token. + The local query. + The modified query. + + + + Gets the query take count. + + The query. + The take count of the query, if any. + + + + Gets the table continuation from response. + + The response. + The continuation. + + + + Gets or sets the retry policy for the query. + + The retry policy. + + + + Gets the type of the element(s) that are returned when the expression tree associated with this + instance of is executed. + + + A that represents the type of the element(s) that are returned when the expression tree associated with this object is executed. + + + + + Gets the expression tree that is associated with the instance of . + + + The that is associated with this instance of . + + + + + Gets the query provider that is associated with this data source. + + + The that is associated with this data source. + + + + + A set of common utilities for use in verfication. + + + + + Throws an exception if the string is empty or null. + + The name of the parameter. + The value of the parameter. + Thrown if value is empty. + Thrown if value is null. + + + + Throw an exception if the value is null. + + The name of the parameter. + The value of the parameter. + Thrown if value is null. + + + + Throw an exception indicating argument is out of range. + + The name of the parameter. + The value of the parameter. + + + + Throw an exception if the argument is out of bounds. + + The type of the value. + The name of the parameter. + The value of the parameter. + The minimum value for the parameter. + The maximum value for the parameter. + + + + Combines AssertNotNullOrEmpty and AssertInBounds for convenience. + + The name of the parameter. + Turns on or off null/empty checking. + The value of the parameter. + The maximum size of value. + + + + Throws if the result segment does not have more results. + + The type of the batch context. + The result segment to check. + + + + Determines if a Uri requires path style addressing. + + The Uri to check. + Returns true if the Uri uses path style addressing; otherwise, false. + + + + Asserts the segment result not empty. + + The type of the result segment. + The result. + + + + Performs a 'magic enumerator' lazy segmented enumeration. + + The type of the result. + The task sequence generator that produces the first segment. + The retry policy to use. + A 'magic enumerator' that makes requests when needed and chains segments accordingly. + + + + Rounds up to seconds. + + The time span. + The time rounded to seconds. + + + + Rounds up to seconds. + + The time span. + The time rounded to seconds. + + + + Rounds up to milliseconds. + + The time span. + The time rounded to milliseconds. + + + + Rounds up to milliseconds. + + The time span. + The time rounded to milliseconds. + + + + When calling the Get() operation on a queue, the content of messages + returned in the REST protocol are represented as Base64-encoded strings. + This internal function transforms the Base64 representation into a byte array. + + The Base64-encoded string. + The decoded bytes. + + + + Applies the request optimizations such as disabling buffering and 100 continue. + + The request to be modified. + The length of the content, -1 if the content length is not settable. + + + + Look for an inner exception of type DataServiceClientException. Different versions of Sytem.Data.Services.Client + have different levels of wrapping of a DataServiceClientException. + + The exception. + The found exception or null. + + + + Asserts the type of the continuation. + + The continuation token. + Type of the continuation. + + + + Specifies which details to include when listing the containers in this storage account. + + + + + No additional details. + + + + + Retrieve container metadata. + + + + + Retrieve all available details. + + + + + The set of options describing delete operation. + + + + + Delete blobs but not snapshots. + + + + + Delete the blob and its snapshots. + + + + + Delete the blob's snapshots only. + + + + + Contains methods for dealing with events. + + + + + This sets the event handler with request and response data and + translates storage exceptions. + + The request. + The handler. + The sender. + The processed response. + + + + This sets the event handler with request and response data and + translates storage exceptions. + + The request. + The async result. + The handler. + The sender. + The processed response. + + + + Set the event handler. + + The request. + The web response. + The event handler. + The sender. + The exception. + + + + The lease status of the blob. + + + + + The lease status is not specified. + + + + + The blob is locked for exclusive-write access. + + + + + The blob is available to be locked for exclusive write access. + + + + + Represents a block retrieved from the blob's block list. + + + + + Gets the name of the block. + + The block name. + + + + Gets the size of block in bytes. + + The block size. + + + + Gets a value indicating whether or not the block has been committed. + + True if the block has been committed; otherwise, false. + + + + Enumeration controlling the options for updating queue messages. + + + + + Update the message visibility timeout. + This is required for calls to UpdateMessage in version 2011-08-18. + + + + + Update the message content. + + + + + Contains methods for dealing with navigation. + + + + + The name of the root container. + + + + + Used in address parsing. + + + + + Used in address parsing. + + + + + Used in address parsing. + + + + + Used to split string on slash. + + + + + Used to split hostname. + + + + + Retrieves the container part of a storage Uri, or "$root" if the container is implicit. + + The blob address. + If set to true use path style Uris. + Name of the container. + + The trailing slash is always removed. + + GetContainerName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob")) will return "mycontainer" + GetConatinerName(new Uri("http://test.blob.core.windows.net/mycontainer/")) will return "mycontainer" + GetConatinerName(new Uri("http://test.blob.core.windows.net/myblob")) will return "$root" + GetConatinerName(new Uri("http://test.blob.core.windows.net/")) will throw ArgumentException + + + + + + Retrieves the blob part of a storage Uri. + + The blob address. + If set to true use path style Uris. + The name of the blob. + + + + Retreives the complete container address from a storage Uri + Example GetContainerAddress(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob")) + will return http://test.blob.core.windows.net/mycontainer. + + The BLOB address. + True to use path style Uris. + Uri of the container. + + + + Retreives the parent name from a storage Uri. + + The BLOB address. + The delimiter. + If set to true use path style Uris. + The name of the parent. + + Adds the trailing delimiter as the prefix returned by the storage REST api always contains the delimiter. + + + GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob", "/")) will return "/mycontainer/myfolder/" + GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder|myblob", "|") will return "/mycontainer/myfolder|" + GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myblob", "/") will return "/mycontainer/" + GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/", "/") will return "/mycontainer/" + + + + + Retrieves the parent address for a blob Uri. + + The BLOB address. + The delimiter. + If set to true use path style Uris. + The address of the parent. + + GetParentName(new Uri("http://test.blob.core.windows.net/mycontainer/myfolder/myblob", null)) + will return "http://test.blob.core.windows.net/mycontainer/myfolder/" + + + + + Get service client address from a complete Uri. + + Complete address of the resource. + True to use path style Uris. + Uri of the service client. + + GetServiceClientBaseAddress("http://testaccount.blob.core.windows.net/testconatiner/blob1") + returns "http://testaccount.blob.core.windows.net" + + + + + Gets the service client base address. + + The address Uri. + The use path style Uris. + The base address of the client. + + + + Appends a path to a Uri correctly using "/" as separator. + + The base Uri. + The relative or absloute URI. + The appended Uri. + + AppendPathToUri(new Uri("http://test.blob.core.windows.net/test", "abc") + will return "http://test.blob.core.windows.net/test/abc" + AppendPathToUri(new Uri("http://test.blob.core.windows.net/test"), "http://test.blob.core.windows.net/test/abc") + will return "http://test.blob.core.windows.net/test/abc" + + + + + Append a relative path to a Uri, handling traling slashes appropiately. + + The base Uri. + The relative or absloute URI. + The seperator. + The appended Uri. + + + + Get container name from address for styles of paths + Eg: http://test.blob.core.windows.net/container/blob => container + http://127.0.0.1:10000/test/container/blob => container. + + The container Uri. + If set to true use path style Uris. + The container name. + + + + Gets the canonical path from creds. + + The credentials. + The absolute path. + The canonical path. + + + + Similar to getting container name from Uri. + + The queue Uri. + If set to true use path style Uris. + The queue name. + + + + Retrieve the container address and address. + + The BLOB address. + True to use path style Uris. + Name of the container. + The container URI. + + + + Retrieve the container name and the blob name from a blob address. + + The blob address. + If set to true use path style Uris. + The resulting container name. + The resulting blob name. + + + + Represents a range of pages in a page blob. + + + + + Initializes a new instance of the class. + + The starting offset. + The ending offset. + + + + Returns the content of the page range as a string. + + The content of the page range. + + + + Gets the starting offset of the page range. + + The starting offset. + + + + Gets the ending offset of the page range. + + The ending offset. + + + + Class used to upload blocks for a blob in parallel. + + The parallelism factor is configurable at the CloudBlobClient. + + + + Stores the block size. + + + + + Stores the blob we're uploading. + + + + + Stores the request options to use. + + + + + Stores the blob's hash. + + + + + Stores the source stream to upload from. + + + + + Stores the dispensized stream size. + + + + + Bound on number of parallel active tasks (threads). + + + + + The list of uploaded blocks. + + + + + Number of block creation tasks. + + + + + Number of block upload tasks created. + + + + + Number of dispenser calls. + + + + + Initializes a new instance of the class. + + The source stream. + The request options. + The block size to use. + The blob to upload to. + + + + Perform a parallel upload of blocks for a blob from a given stream. + + The upload func. + A that uploads the blob in parallel. + + The operation is done as a series of alternate producer and consumer tasks. The producer tasks dispense out + chunks of source stream as fixed size blocks. This is done in serial order on a thread using InvokeTaskSequence's + serial execution. The consumer tasks upload each block in parallel on multiple thread. The producer thread waits + for at least one consumer task to finish before adding more producer tasks. The producer thread quits when no + more data can be read from the stream and no other pending consumer tasks. + + + + + Completes the asyncresult. + + The async results. + The index. + + + + Gets the wait timeout. + + The options. + The wait timeout. + + + + Upload a single block. This can happen on parallel threads. + + The block sequence prefix value. + The set result. + A that dispenses a block stream. + + + + Gets the parallelism factor. + + The parallelism factor. + + + + As a final step upload the block list to commit the blob. + + A that commits the blob. + + + + Assists in protocol implementation. + + + + + Gets the web request. + + The service client. + The options. + The retrieve request. + The web request. + + + + Parses the response XML from an operation to set the access policy for a container. + + + + + Provides a base class that is used internally to parse XML streams from storage service operations. + + The type to be parsed. + + + + Indicates that all parsable objects have been consumed. This field is reserved and should not be used. + + + + + Stores any objects that have not yet been parsed. This field is reserved and should not be used. + + + + + The reader used for parsing. This field is reserved and should not be used. + + + + + The IEnumerator over the parsed content. + + + + + Used to make sure that parsing is only done once, since a stream is not re-entrant. + + + + + Initializes a new instance of the ResponseParsingBase class. + + The stream to be parsed. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Parses the XML response. This method is reserved and should not be used. + + A collection of enumerable objects. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources, and optional + managed resources. + + True to release both managed and unmanaged resources; otherwise, false. + + + + This method is reserved and should not be used. + + True when the object is consumable. + + + + Parses the XML and close. + + A list of parsed results. + + + + Gets the parsable objects. This method is reserved and should not be used. + + The objects to parse. + + + + Initializes a new instance of the class. + + The stream to be parsed. + + + + Parses the response XML from a Set Container ACL operation to retrieve container-level access policy data. + + A list of enumerable key-value pairs. + + + + Gets an enumerable collection of container-level access policy identifiers. + + An enumerable collection of container-level access policy identifiers. + + + + Represents a container item returned in the XML response for a container listing operation. + + + + + Initializes a new instance of the class. + + + + + Gets the attributes for this container item. + + The container item's attributes. + + + + Represents a blob item returned in the XML response for a blob listing operation. + + + + + Defines an interface for blob items that are returned in the XML response for a blob listing operation. + + + + + Initializes a new instance of the class. + + The name of the blob. + The blob's attributes. + + + + Gets the attributes for this blob item. + + The blob item's attributes. + + + + Gets the name of the blob item. + + The name of the blob item. + + + + Provides a set of parameters for a blob listing operation. + + + + + Represents the listing context for enumeration operations. + + + + + Initializes a new instance of the class. + + The resource name prefix. + The maximum number of resources to return in a single operation, up to the per-operation limit of 5000. + + + + Gets or sets the Prefix value. + + The Prefix value. + + + + Gets or sets the MaxResults value. + + The MaxResults value. + + + + Gets or sets the Marker value. + + The Marker value. + + + + Initializes a new instance of the class. + + The blob prefix. + The maximum number of results to return. + The blob delimiter. + The include parameter. + + + + Gets or sets the delimiter for a blob listing operation. + + The delimiter to use to traverse the virtual hierarchy of blobs. + + The delimiter parameter enables the caller to traverse the blob namespace by using a user-configured delimiter. + Using this parameter, it is possible to traverse a virtual hierarchy of blobs as though it were a file system. + + + + + Gets or sets the details for the listing operation, which indicates the types of data to include in the + response. + + The details to include in the listing operation. + + The include parameter specifies that the response should include one or more of the following subsets: snapshots, + metadata, uncommitted blobs. + + + + + Represents the blob name prefix that is returned in the XML response for a blob listing operation. + + + + + Gets the blob name prefix. + + The blob name prefix. + + + + Provides a set of methods for constructing requests for blob operations. + + + + + Constructs a web request to create a new block blob or page blob, or to update the content + of an existing block blob. + + The absolute URI to the blob. + The server timeout interval. + The properties to set for the blob. + The type of the blob. + The lease ID, if the blob has an active lease. + For a page blob, the size of the blob. This parameter is ignored + for block blobs. + A web request to use to perform the operation. + + + + Constructs a web request to delete a blob. + + The absolute URI to the blob. + The server timeout interval. + The snapshot timestamp, if the blob is a snapshot. + A set of options indicating whether to delete only blobs, only snapshots, or both. + The lease ID, if the blob has an active lease. + A web request to use to perform the operation. + + + + Constructs a web request to return the user-defined metadata for the blob. + + The absolute URI to the blob. + The server timeout interval. + The snapshot timestamp, if the blob is a snapshot. + The lease ID, if the blob has an active lease. + A web request for performing the operiaton. + + + + Constructs a web request to set user-defined metadata for the blob. + + The absolute URI to the blob. + The server timeout interval. + The lease ID, if the blob has an active lease. + A web request for performing the operation. + + + + Signs the request for Shared Key authentication. + + The web request. + The account credentials. + + + + Adds user-defined metadata to the request as one or more name-value pairs. + + The web request. + The user-defined metadata. + + + + Adds user-defined metadata to the request as a single name-value pair. + + The web request. + The metadata name. + The metadata value. + + + + Constructs a web request to return the blob's system properties. + + The absolute URI to the blob. + The server timeout interval. + The snapshot timestamp, if the blob is a snapshot. + The lease ID. + A web request for performing the operation. + + + + Signs the request for Shared Key Lite authentication. + + The web request. + The account credentials. + + + + Adds a conditional header to the request. + + The web request. + The type of conditional header to add. + The blob's ETag. + + + + Adds a conditional header to the request. + + The web request. + The type of conditional header to add. + The date and time specification for the request. + + + + Constructs a web request to return a listing of all blobs in the container. + + The absolute URI to the blob. + The server timeout interval. + A set of parameters for the listing operation. + A web request to use to perform the operation. + + + + Constructs a web request to copy a blob. + + The absolute URI to the destination blob. + The server timeout interval. + The canonical path to the source blob, in the form /<account-name>/<container-name>/<blob-name>. + The snapshot version, if the source blob is a snapshot. + A type of condition to check on the source blob. + The value of the condition to check on the source blob. + The lease ID for the source blob, if it has an active lease. + A web request to use to perform the operation. + + + + Constructs a web request to get the blob's content, properties, and metadata. + + The absolute URI to the blob. + The server timeout interval. + The snapshot version, if the blob is a snapshot. + The lease ID for the blob, if it has an active lease. + A web request for performing the operation. + + + + Constructs a web request to return a specified range of the blob's content, together with its properties and metadata. + + The absolute URI to the blob. + The server timeout interval, in seconds. + The snapshot version, if the blob is a snapshot. + The byte offset at which to begin returning content. + The number of bytes to return, or null to return all bytes through the end of the blob. + The lease ID for the blob if it has an active lease, or null if there is no lease. + A web request to use to perform the operation. + + + + Constructs a web request to return the list of blocks for a block blob. + + The absolute URI to the blob. + The server timeout interval. + The snapshot timestamp, if the blob is a snapshot. + The types of blocks to include in the list: committed, uncommitted, or both. + The lease ID for the blob, if it has an active lease. + A web request to use to perform the operation. + + + + Constructs a web request to return the list of active page ranges for a page blob. + + The absolute URI to the blob. + The server timeout interval. + The snapshot timestamp, if the blob is a snapshot. + The lease ID, if the blob has an active lease. + A web request to use to perform the operation. + + + + Constructs a web request to use to acquire, renew, release or break the lease for the blob. + + The absolute URI to the blob. + The server timeout interval. + The lease action to perform. + The lease ID. + A web request to use to perform the operation. + + + + Constructs a web request to write a block to a block blob. + + The absolute URI to the blob. + The server timeout interval. + The block ID for this block. + The lease ID for the blob, if it has an active lease. + A web request to use to perform the operation. + + + + Constructs a web request to create or update a blob by committing a block list. + + The absolute URI to the blob. + The server timeout interval. + The properties to set for the blob. + The lease ID, if the blob has an active lease. + A web request for performing the operation. + + + + Writes the body of the block list to the specified stream in XML format. + + An enumerable collection of objects. + The stream to which the block list is written. + + + + Constructs a web request to write or clear a range of pages in a page blob. + + The absolute URI to the blob. + The server timeout interval. + The blob's properties. + The lease ID, if the blob has an active lease. + A web request to use to perform the operation. + + + + Constructs a web request to set system properties for a blob. + + The absolute URI to the blob. + The server timeout interval. + The blob's properties. + The lease ID, if the blob has an active lease. + The new blob size, if the blob is a page blob. Set this parameter to null to keep the existing blob size. + A web request to use to perform the operation. + + + + Constructs a web request to create a snapshot of a blob. + + The absolute URI to the blob. + The server timeout interval. + A web request to use to perform the operation. + + + + Creates a web request to get the properties of the service. + + The absolute URI to the service. + The server timeout interval, in seconds. + A web request to get the service properties. + + + + Creates a web request to set the properties of the service. + + The absolute URI to the service. + The server timeout interval, in seconds. + A web request to set the service properties. + + + + Writes service properties to a stream, formatted in XML. + + The service properties to format and write to the stream. + The stream to which the formatted properties are to be written. + + + + Adds the snapshot. + + The builder. + The snapshot version, if the blob is a snapshot. + + + + Creates the web request. + + The Uri of the resource. + The timeout to apply. + The query builder to use. + The resulting . + + + + Provides a set of methods for parsing responses from blob operations. + + + + + Returns extended error information from the storage service, that is in addition to the HTTP status code returned with the response. + + The web response. + An object containing extended error information returned with the response. + + + + Gets a collection of user-defined metadata from the response. + + The web response. + A collection of user-defined metadata, as name-value pairs. + + + + Gets an array of values for a specified name-value pair from a response that includes user-defined metadata. + + The web response. + The name associated with the metadata values to return. + An array of metadata values. + + + + Gets the blob's attributes, including its metadata and properties, from the response. + + The web response. + The blob's attributes. + + + + Gets the request ID from the response. + + The web response. + A unique value associated with the request. + + + + Gets the snapshot timestamp from the response. + + The web response. + The snapshot timestamp. + + + + Parses the response for a blob listing operation. + + The response stream. + An object that may be used for parsing data from the results of a blob listing operation. + + + + Parses the response for a blob listing operation. + + The web response. + An object that may be used for parsing data from the results of a blob listing operation. + + + + Parses the response for an operation that returns a block list for the blob. + + The response stream. + An object that may be used for parsing data from the results of an operation to return a block list. + + + + Parses the response for an operation that returns a block list for the blob. + + The web response. + An object that may be used for parsing data from the results of an operation to return a block list. + + + + Parses the response for an operation that returns a range of pages. + + The response stream. + An object that may be used for parsing data from the results of an operation to return a range of pages. + + + + Parses the response for an operation that returns a range of pages. + + The web response. + An object that may be used for parsing data from the results of an operation to return a range of pages. + + + + Reads service properties from a stream. + + The stream from which to read the service properties. + The service properties stored in the stream. + + + + Indicates which block lists should be searched to find a specified block. + + + + + Search the committed block list only. + + + + + Search the uncommitted block list only. + + + + + Search the uncommitted block list first, and if the block is not found there, search + the committed block list. + + + + + Represents the base canonicalization strategy used to authenticate a request against the storage services. + + + + + Constructs a canonicalized string for signing a request. + + The web request. + The name of the storage account. + A canonicalized string. + + + + Constructs a canonicalized string from the request's headers that will be used to construct the signature + string for signing a Blob or Queue service request under the Shared Key Lite authentication scheme. + + The request URI. + The storage account name. + The verb to be used for the HTTP request. + The content type of the HTTP request. + The date/time specification for the HTTP request. + A collection of additional headers specified on the HTTP request. + A canonicalized string. + + + + Constructs a canonicalized string from the request's headers that will be used to construct the signature + string for signing a Blob or Queue service request under the Shared Key Lite authentication scheme. + + The request URI. + The storage account name. + The verb to be used for the HTTP request. + The content type of the HTTP request. + The length of the HTTP request, in bytes. + The date/time specification for the HTTP request. + A collection of additional headers specified on the HTTP request. + A canonicalized string. + + + + Gets the value of a standard HTTP header. + + The collection of headers. + The name of the header. + The header value. + + + + Returns an of HTTP header values for a named header. + + A collection of HTTP headers as name-values pairs. + The name of the header to return. + An of HTTP header values, stored in the same order as they appear in the collection. + + + + Appends a string to the canonicalized resource string. + + The canonicalized resource string. + The string to append. + The modified canonicalized resource string. + + + + Gets the canonicalized resource string for a Blob or Queue service request under the Shared Key Lite authentication scheme. + + The resource URI. + The name of the storage account. + The canonicalized resource string. + + + + Gets the canonicalized resource string for a Blob or Queue service request under the Shared Key authentication scheme. + + The resource URI. + The name of the storage account. + The canonicalized resource string. + + + + Adds the canonicalized resource for version 2. + + The address. + Name of the account. + The canonicalized string. + + + + Add the resource name. + + The address. + Name of the account. + The canonicalized string. + + + + Add x-ms- prefixed headers in a fixed order. + + The headers. + The canonicalized string. + + + + Retrieve appropriate version of CanonicalizationStrategy based on the webrequest + for Blob Queue and Table. + + + + + Stores the version 1 blob/queue full signing strategy. + + + + + Stores the version 1 table lite signing strategy. + + + + + Stores the version 2 blob/queue full signing strategy. + + + + + Stores the version 1 table full signing strategy. + + + + + Gets canonicalization strategy for Blob and Queue SharedKey Authentication. + + The request. + The canonicalization strategy. + + + + Get canonicalization strategy for Tables for SharedKeyLite Authentication. + + The request. + The canonicalization strategy. + + + + Gets the table full canonicalization strategy. + + The request. + The canonicalization strategy. + + + + Gets the BLOB queue lite canonicalization strategy. + + The request. + The canonicalization strategy. + + + + Determines whether [is target version2] [the specified request]. + + The request. + + Returns true if [is target version2] [the specified request]; otherwise, false. + + + + + Gets the BLOB queue full ver1. + + The BLOB queue full ver1. + + + + Gets the table lite ver1. + + The table lite ver1. + + + + Gets the table full ver1. + + The table full ver1. + + + + Gets the BLOB queue full ver2. + + The BLOB queue full ver2. + + + + An internal class that stores the canonicalized string version of an HTTP request. + + + + + Stores the internal that holds the canonicalized string. + + + + + Initializes a new instance of the class. + + The first canonicalized element to start the string with. + + + + Append additional canonicalized element to the string. + + An additional canonicalized element to append to the string. + + + + Gets the canonicalized string. + + + + + Specifies the kinds of conditional headers that may be set for a request. + + + + + Indicates that no conditional headers are set. + + + + + The If-Unmodified-Since header. + + + + + The If-Match header. + + + + + The If-Modified-Since header. + + + + + The If-None-Match header. + + + + + Contains storage constants. + + + + + Maximum number of shared access policy identifiers supported by server. + + + + + Default Write Block Size used by Blob stream. + + + + + Default Read Ahead Size used by Blob stream. + + + + + The maximum size of a blob before it must be separated into blocks. + + + + + The maximum size of a blob with blocks. + + + + + The maximum size of a single block. + + + + + The maximum number of blocks. + + + + + Default size of buffer for unknown sized requests. + + + + + This is used to create BlockIDs. The prefix must be Base64 compatible. + + + + + The size of a page in a PageBlob. + + + + + A constant representing a kilo-byte (Non-SI version). + + + + + A constant representing a megabyte (Non-SI version). + + + + + A constant representing a megabyte (Non-SI version). + + + + + XML element for committed blocks. + + + + + XML element for uncommitted blocks. + + + + + XML element for blocks. + + + + + XML element for names. + + + + + XML element for sizes. + + + + + XML element for block lists. + + + + + XML element for queue message lists. + + + + + XML element for queue messages. + + + + + XML element for message IDs. + + + + + XML element for insertion times. + + + + + XML element for expiration times. + + + + + XML element for pop receipts. + + + + + XML element for the time next visible fields. + + + + + XML element for message texts. + + + + + XML element for dequeue counts. + + + + + XML element for page ranges. + + + + + XML element for page list elements. + + + + + XML element for page range start elements. + + + + + XML element for page range end elements. + + + + + XML element for delimiters. + + + + + XML element for blob prefixes. + + + + + XML element for content type fields. + + + + + XML element for content encoding fields. + + + + + XML element for content language fields. + + + + + XML element for content length fields. + + + + + XML element for content MD5 fields. + + + + + XML element for blobs. + + + + + XML element for prefixes. + + + + + XML element for maximum results. + + + + + XML element for markers. + + + + + XML element for the next marker. + + + + + XML element for the ETag. + + + + + XML element for the last modified date. + + + + + XML element for the Url. + + + + + XML element for blobs. + + + + + Constant signalling a page blob. + + + + + Constant signalling a block blob. + + + + + Constant signalling the blob is locked. + + + + + Constant signalling the blob is unlocked. + + + + + XML element for blob types. + + + + + XML element for the lease status. + + + + + XML element for snapshots. + + + + + XML element for containers. + + + + + XML element for a container. + + + + + XML element for queues. + + + + + XML element for the queue name. + + + + + Version 2 of the XML element for the queue name. + + + + + XML element for the queue. + + + + + XML element for the metadata. + + + + + XML element for an invalid metadata name. + + + + + XPath query for error codes. + + + + + XPath query for error messages. + + + + + XML element for maximum results. + + + + + XML element for committed blocks. + + + + + XML element for uncommitted blocks. + + + + + XML element for the latest. + + + + + XML element for signed identifiers. + + + + + XML element for a signed identifier. + + + + + XML element for access policies. + + + + + XML attribute for IDs. + + + + + XML element for the start time of an access policy. + + + + + XML element for the end of an access policy. + + + + + XML element for the permissions of an access policy. + + + + + The maximum size of a string property for the table service in bytes. + + + + + The maximum size of a string property for the table service in chars. + + + + + The name of the special table used to store tables. + + + + + The Uri path component to access the messages in a queue. + + + + + XML root element for errors. + + + + + XML element for error codes. + + + + + XML element for error messages. + + + + + XML element for exception details. + + + + + XML element for exception messages. + + + + + XML element for stack traces. + + + + + XML element for the authentication error details. + + + + + XML namespace for the WCF Data Services metadata. + + + + + XML element for table error codes. + + + + + XML element for table error messages. + + + + + Default client side timeout for all service clients. + + + + + Maximum allowed timeout for any request. + + + + + This is used to create V1 BlockIDs. The prefix must be Base64 compatible. + + + + + This is the offset of the V2 MD5 string where the MD5/ tag resides. + + + + + This is used to create BlockIDs. The prefix must be Base64 compatible. + + + + + This is the offset of the V2 MD5 string where the hash value resides. + + + + + This is the expected length of a V2 MD5 Block ID string. + + + + + The minimum supported value for the table service. + + + + + The timeout after which the WCF Data Services bug workaround kicks in. This should be greater than the timeout we pass to DataServiceContext (90 seconds). + + + + + Constants for HTTP headers. + + + + + Master Windows Azure Storage header prefix. + + + + + Header prefix for properties. + + + + + Header prefix for metadata. + + + + + Header for data ranges. + + + + + Header for storage version. + + + + + Header for copy source. + + + + + Header for the If-Match condition. + + + + + Header for the If-Modified-Since condition. + + + + + Header for the If-None-Match condition. + + + + + Header for the If-Unmodified-Since condition. + + + + + Header for the blob content length. + + + + + Header for the blob type. + + + + + Header for snapshots. + + + + + Header to delete snapshots. + + + + + Header that specifies approximate message count of a queue. + + + + + Header that specifies a range. + + + + + Header that specifies blob caching control. + + + + + Header that specifies blob content encoding. + + + + + Header that specifies blob content language. + + + + + Header that specifies blob content MD5. + + + + + Header that specifies blob content type. + + + + + Header that specifies blob content length. + + + + + Header that specifies lease ID. + + + + + Header that specifies lease status. + + + + + Header that specifies page write mode. + + + + + Header that specifies the date. + + + + + Header indicating the request ID. + + + + + Header that specifies public access to blobs. + + + + + Format string for specifying ranges. + + + + + Current storage version header value. + + + + + Specifies the page blob type. + + + + + Specifies the block blob type. + + + + + Specifies only snapshots are to be included. + + + + + Specifies snapshots are to be included. + + + + + Specifies the value to use for UserAgent header. + + + + + Specifies the pop receipt for a message. + + + + + Specifies the next visible time for a message. + + + + + Constants for query strings. + + + + + Query component for snapshot time. + + + + + Query component for the signed SAS start time. + + + + + Query component for the signed SAS expiry time. + + + + + Query component for the signed SAS resource. + + + + + Query component for the signed SAS permissions. + + + + + Query component for the signed SAS identifier. + + + + + Query component for the signed SAS version. + + + + + Query component for SAS signature. + + + + + Query component for message time-to-live. + + + + + Query component for message visibility timeout. + + + + + Query component for message pop receipt. + + + + + Query component for resource type. + + + + + Query component for the operation (component) to access. + + + + + Provides a set of methods for constructing requests for container operations. + + + + + Constructs a web request to create a new container. + + The absolute URI to the container. + The server timeout interval. + A web request to use to perform the operation. + + + + Constructs a web request to delete the container and all of blobs within it. + + The absolute URI to the container. + The server timeout interval. + A web request to use to perform the operation. + + + + Constructs a web request to retrieve the container's metadata. + + The absolute URI to the container. + The server timeout interval. + A web request to use to perform the operation. + + + + Constructs a web request to return the user-defined metadata for this container. + + The absolute URI to the container. + The server timeout interval. + A web request to use to perform the operation. + + + + Constructs a web request to set user-defined metadata for the container. + + The absolute URI to the container. + The server timeout interval. + A web request to use to perform the operation. + + + + Signs the request for Shared Key authentication. + + The web request. + The account credentials. + + + + Adds user-defined metadata to the request as one or more name-value pairs. + + The web request. + The user-defined metadata. + + + + Adds user-defined metadata to the request as a single name-value pair. + + The web request. + The metadata name. + The metadata value. + + + + Signs the request for Shared Key Lite authentication. + + The web request. + The account credentials. + + + + Adds a conditional header to the request. + + The web request. + The type of conditional header to add. + The container's ETag. + + + + Adds a conditional header to the request. + + The web request. + The type of conditional header to add. + The date and time specification for the request. + + + + Constructs a web request to return a listing of all containers in this storage account. + + The absolute URI for the account. + The server timeout interval. + A set of parameters for the listing operation. + Additional details to return with the listing. + A web request for the specified operation. + + + + Constructs a web request to return the ACL for this container. + + The absolute URI to the container. + The server timeout interval. + A web request to use to perform the operation. + + + + Sets the ACL for the container. + + The absolute URI to the container. + The server timeout interval. + The type of public access to allow for the container. + A web request to use to perform the operation. + + + + Writes a collection of shared access policies to the specified stream in XML format. + + A collection of shared access policies. + An output stream. + + + + Gets the container Uri query builder. + + A for the container. + + + + Creates the web request. + + The absolute URI to the container. + The server timeout interval. + The query builder to use. + A web request to use to perform the operation. + + + + Provides a set of methods for parsing responses from container operations. + + + + + Returns extended error information from the storage service, that is in addition to the HTTP status code returned with the response. + + The web response. + An object containing extended error information returned with the response. + + + + Gets a collection of user-defined metadata from the response. + + The web response. + A collection of user-defined metadata, as name-value pairs. + + + + Gets an array of values for a specified name-value pair from the user-defined metadata included in the response. + + The web response. + The name associated with the metadata values to return. + An array of metadata values. + + + + Gets the container's attributes, including its metadata and properties, from the response. + + The web response. + The container's attributes. + + + + Gets the request ID from the response. + + The web response. + A unique value associated with the request. + + + + Gets the ACL for the container from the response. + + The web response. + A value indicating the public access level for the container. + + + + Parses the response for a container listing operation. + + The web response. + An object that may be used for parsing data from the results of a container listing operation. + + + + Represents the credentials used to sign a request against the storage services. + + + + + Initializes a new instance of the class. + + The storage account name. + The access key. + + + + Initializes a new instance of the class. + + The storage account name. + The access key, as a Base64-encoded string. + + + + Exports the value of the access key to an array of bytes. + + The account access key. + + + + Exports the value of the access key to a Base64-encoded string. + + The account access key. + + + + Gets the account name to be used in signing the request. + + The name of the account. + + + + Gets or sets the account name whose key is used to sign requests. + + The name of the account whose key is used to sign requests. + + + + Gets the access key to be used in signing the request. + + + + + Provides methods for parsing the response from an operation to return a block list. + + + + + Initializes a new instance of the class. + + The stream to be parsed. + + + + Parses the XML response returned by an operation to retrieve a list of blocks. + + An enumerable collection of objects. + + + + Gets an enumerable collection of objects from the response. + + An enumerable collection of objects. + + + + Provides methods for parsing the response from an operation to get messages from a queue. + + + + + Initializes a new instance of the class. + + The stream of messages to parse. + + + + Parses the XML response returned by an operation to get messages from a queue. + + An enumerable collection of objects. + + + + Gets an enumerable collection of objects from the response. + + An enumerable collection of objects. + + + + Provides methods for parsing the response from an operation to get a range of pages for a page blob. + + + + + Initializes a new instance of the class. + + The stream of page ranges to be parsed. + + + + Parses the XML response for an operation to get a range of pages for a page blob. + + An enumerable collection of objects. + + + + Gets an enumerable collection of objects from the response. + + An enumerable collection of objects. + + + + Describes actions that can be performed on a lease. + + + + + Acquire the lease. + + + + + Renew the lease. + + + + + Release the lease. + + + + + Break the lease. + + + + + Provides methods for parsing the response from a blob listing operation. + + + + + Stores the blob prefix. + + + + + Signals when the blob prefix can be consumed. + + + + + Stores the marker. + + + + + Signals when the marker can be consumed. + + + + + Stores the blob delimiter. + + + + + Signals when the blob delimiter can be consumed. + + + + + Stores the max results. + + + + + Signals when the max results can be consumed. + + + + + Stores the next marker. + + + + + Signals when the next marker can be consumed. + + + + + Initializes a new instance of the class. + + The stream to be parsed. + + + + Parses the response XML for a blob listing operation. + + An enumerable collection of objects that implement . + + + + Gets the listing context from the XML response. + + A set of parameters for the listing operation. + + + + Gets an enumerable collection of objects that implement from the response. + + An enumerable collection of objects that implement . + + + + Gets the Prefix value provided for the listing operation from the XML response. + + The Prefix value. + + + + Gets the Marker value provided for the listing operation from the XML response. + + The Marker value. + + + + Gets the Delimiter value provided for the listing operation from the XML response. + + The Delimiter value. + + + + Gets the MaxResults value provided for the listing operation from the XML response. + + The MaxResults value. + + + + Gets the NextMarker value from the XML response, if the listing was not complete. + + The NextMarker value. + + + + Provides methods for parsing the response from a container listing operation. + + + + + Stores the container prefix. + + + + + Signals when the container prefix can be consumed. + + + + + Stores the marker. + + + + + Signals when the marker can be consumed. + + + + + Stores the max results. + + + + + Signals when the max results can be consumed. + + + + + Stores the next marker. + + + + + Signals when the next marker can be consumed. + + + + + Initializes a new instance of the class. + + The stream to be parsed. + + + + Parses the response XML for a container listing operation. + + An enumerable collection of objects. + + + + Gets the listing context from the XML response. + + A set of parameters for the listing operation. + + + + Gets an enumerable collection of objects from the response. + + An enumerable collection of objects. + + + + Gets the Prefix value provided for the listing operation from the XML response. + + The Prefix value. + + + + Gets the Marker value provided for the listing operation from the XML response. + + The Marker value. + + + + Gets the MaxResults value provided for the listing operation from the XML response. + + The MaxResults value. + + + + Gets the NextMarker value from the XML response, if the listing was not complete. + + The NextMarker value. + + + + Provides methods for parsing the response from a queue listing operation. + + + + + Stores the prefix. + + + + + Signals when the prefix can be consumed. + + + + + Stores the marker. + + + + + Signals when the marker can be consumed. + + + + + Stores the max results. + + + + + Signals when the max results can be consumed. + + + + + Stores the next marker. + + + + + Signals when the next marker can be consumed. + + + + + Initializes a new instance of the class. + + The stream to be parsed. + + + + Parses the response XML for a queue listing operation. + + An enumerable collection of objects. + + + + Gets the listing context from the XML response. + + A set of parameters for the listing operation. + + + + Gets an enumerable collection of objects from the response. + + An enumerable collection of objects. + + + + Gets the Prefix value provided for the listing operation from the XML response. + + The Prefix value. + + + + Gets the Marker value provided for the listing operation from the XML response. + + The Marker value. + + + + Gets the MaxResults value provided for the listing operation from the XML response. + + The MaxResults value. + + + + Gets the NextMarker value from the XML response, if the listing was not complete. + + The NextMarker value. + + + + Enumeration representing the state of logging in a service. + + + + + Logging is disabled. + + + + + Log read operations. + + + + + Log write operations. + + + + + Log delete operations. + + + + + Log all operations. + + + + + Class representing the service properties pertaining to logging. + + + + + Gets or sets the version of the analytics service. + + A string identifying the version of the service. + + + + Gets or sets the state of logging. + + A combination of flags describing the operations that are logged. + + + + Gets or sets the logging retention policy. + + The number of days to retain the logs. + + + + Enumeration representing the state of metrics collection in a service. + + + + + Metrics collection is disabled. + + + + + Service-level metrics collection is enabled. + + + + + Service-level and API metrics collection are enabled. + + + + + Class representing the service properties pertaining to metrics. + + + + + Gets or sets the version of the analytics service. + + A string identifying the version of the service. + + + + Gets or sets the state of metrics collection. + + A value indicating which metrics to collect, if any. + + + + Gets or sets the logging retention policy. + + The number of days to retain the logs. + + + + Describes actions that may be used for writing to a page blob or clearing a set of pages. + + + + + Update the page with new data. + + + + + Clear the page. + + + + + A class to help with parsing. + + + + + Converts a string to UTC time. + + The string to convert. + A UTC representation of the string. + + + + Provides methods for parsing the response from an operation to peek messages from a queue. + + + + + Initializes a new instance of the class. + + The stream to be parsed. + + + + Parses the XML response returned by an operation to get messages from a queue. + + An enumerable collection of objects. + + + + Gets an enumerable collection of objects from the response. + + An enumerable collection of objects. + + + + Represents a block in a block list. + + + + + Initializes a new instance of the class. + + The block ID. + One of the enumeration values that specifies in which block lists to search for the block. + + + + Gets the block ID. + + The block ID. + + + + Gets a value that indicates which block lists to search for the block. + + One of the enumeration values that specifies in which block lists to search for the block. + + + + Represents properties for writing to a page blob. + + + + + Initializes a new instance of the class. + + + + + Gets or sets the range of bytes to write to. + + The page range. + + + + Gets or sets the type of write operation. + + The type of page write operation. + + + + Represents a queue item returned in the XML response for a queue listing operation. + + + + + Initializes a new instance of the class. + + The name of the queue. + The queue's attributes. + + + + Gets the name of the queue. + + The queue name. + + + + Gets the queue's attributes. + + The queue's attributes. + + + + Represents a message retrieved from a queue. + + + + + Initializes a new instance of the class. + + + + + Gets the message expiration time. + + The message expiration time. + + + + Gets the message ID. + + The message ID. + + + + Gets the time the message was added to the queue. + + The message insertion time. + + + + Gets the time the message is next visible. + + The time the message is next visible. + + + + Gets the pop receipt for the message. + + The message's pop receipt. + + + + Gets the text of the message. + + The message text. + + + + Gets the number of times this message has been dequeued. + + The dequeue count. + + + + Provides a set of methods for constructing requests for queue operations. + + + + + Constructs a web request to create a queue. + + The absolute URI to the queue. + The server timeout interval. + A web request for performing the operation. + + + + Constructs a web request to delete a queue. + + The absolute URI to the queue. + The server timeout interval. + A web request for performing the operation. + + + + Constructs a web request to return the user-defined metadata for the queue. + + The absolute URI to the queue. + The server timeout interval. + A web request for performing the operation. + + + + Constructs a web request to set user-defined metadata for the queue. + + The absolute URI to the queue. + The server timeout interval. + A web request for performing the operation. + + + + Signs the request for Shared Key authentication. + + The web request. + The account credentials. + + + + Adds user-defined metadata to the request as one or more name-value pairs. + + The web request. + The user-defined metadata. + + + + Adds user-defined metadata to the request as a single name-value pair. + + The web request. + The metadata name. + The metadata value. + + + + Signs the request for Shared Key Lite authentication. + + The web request. + The account credentials. + + + + Constructs a web request to return a listing of all queues in the storage account. + + The absolute URI to the queue. + The server timeout interval. + A set of parameters for the listing operation. + One of the enumeration values indicating which details to include in the listing. + A web request to use to perform the operation. + + + + Constructs a web request to clear all messages in the queue. + + The absolute URI to the queue. + The server timeout interval. + A web request for the specified operation. + + + + Constructs a web request to delete the specified message. + + The absolute URI to the queue. + The server timeout interval. + The pop receipt value for the message. + A web request for the specified operation. + + + + Constructs a web request to retrieve a specified number of messages. + + The absolute URI to the queue. + The server timeout interval. + The number of messages to retrieve. + The visibility timeout for the message or messages. + A web request for the specified operation. + + + + Constructs a web request to retrieve a specified number of messages without changing their visibility. + + The absolute URI to the queue. + The server timeout interval. + The number of messages to retrieve. + A web request for performing the specified operation. + + + + Generates a web request to add a message to a queue. + + The absolute URI to the queue's messages. + The server timeout interval. + The message time-to-live, or null if no time-to-live is specified. + A web request for the put operation. + + + + Generates a web request to add a message to a queue. + + The absolute URI to the queue's messages. + The server timeout interval, in seconds. + The message time-to-live in seconds. If null, the service default will be used. + The length of time from now during which the message will be invisible, in seconds. + If null, the message will be visible immediately. + A web request for the put operation. + + + + Generates a web request to update a message. + + The absolute URI to the message to update. + The server timeout interval, in seconds. + The pop receipt of the message. + The length of time from now during which the message will be invisible, in seconds. + A web request for the update operation. + + + + Creates a web request to get the properties of the service. + + The absolute URI to the service. + The server timeout interval, in seconds. + A web request to get the service properties. + + + + Creates a web request to set the properties of the service. + + The absolute URI to the service. + The server timeout interval, in seconds. + A web request to set the service properties. + + + + Writes service properties to a stream, formatted in XML. + + The service properties to format and write to the stream. + The stream to which the formatted properties are to be written. + + + + Generates the message request body from a string containing the message. + + The content of the message. + The message request body as an array of bytes. + + + + Creates the web request. + + The absolute URI to the queue. + The server timeout interval. + The query. + A web request for performing the operation. + + + + Provides a set of methods for parsing responses from queue operations. + + + + + Returns extended error information from the storage service, that is in addition to the HTTP status code returned with the response. + + The web response. + An object containing extended error information returned with the response. + + + + Gets a collection of user-defined metadata from the response. + + The web response. + A collection of user-defined metadata, as name-value pairs. + + + + Gets an array of values for a specified name-value pair from a response that includes user-defined metadata. + + The web response. + The name associated with the metadata values to return. + An array of metadata values. + + + + Gets the request ID from the response. + + The web response. + A unique value associated with the request. + + + + Extracts the pop receipt from a web response header. + + The web response. + The pop receipt stored in the header of the response. + + + + Extracts the next visibility time from a web response header. + + The web response. + The time of next visibility stored in the header of the response. + + + + Gets the approximate message count for the queue. + + The web response. + The approximate count for the queue. + + + + Parses the response from an operation to get messages from the queue. + + The stream to parse. + An object that may be used for parsing data from the results of a message retrieval operation. + + + + Parses the response from an operation to get messages from the queue. + + The web response. + An object that may be used for parsing data from the results of a message retrieval operation. + + + + Parses the response for a queue listing operation. + + The response stream. + An object that may be used for parsing data from the results of a queue listing operation. + + + + Parses the response for a queue listing operation. + + The web response. + An object that may be used for parsing data from the results of a queue listing operation. + + + + Parses the response from an operation to peek messages from the queue. + + The stream to parse. + An object that may be used for parsing data from the results of a message peeking operation. + + + + Parses the response from an operation to peek messages from the queue. + + The web response. + An object that may be used for parsing data from the results of a message peeking operation. + + + + Reads service properties from a stream. + + The stream from which to read the service properties. + The service properties stored in the stream. + + + + Factory class for creating requests internally. + + + + + Internal override for the storage version string. + + + + + Initializes static members of the Request class. + + + + + Creates the web request. + + The request Uri. + The timeout. + The builder. + A web request for performing the operation. + + + + Creates the specified Uri. + + The Uri to create. + The timeout. + The builder. + A web request for performing the operation. + + + + Deletes the specified Uri. + + The Uri to delete. + The timeout. + The builder. + A web request for performing the operation. + + + + Gets the metadata. + + The blob Uri. + The timeout. + The builder. + A web request for performing the operation. + + + + Gets the properties. + + The Uri to query. + The timeout. + The builder. + A web request for performing the operation. + + + + Sets the metadata. + + The blob Uri. + The timeout. + The builder. + A web request for performing the operation. + + + + Creates a web request to get the properties of the service. + + The absolute URI to the service. + The server timeout interval. + A web request to get the service properties. + + + + Creates a web request to set the properties of the service. + + The absolute URI to the service. + The server timeout interval. + A web request to set the service properties. + + + + Writes service properties to a stream, formatted in XML. + + The service properties to format and write to the stream. + The stream to which the formatted properties are to be written. + + + + Generates a query builder for building service requests. + + A for building service requests. + + + + Signs the request appropriately to make it an authenticated request for Blob and Queue. + + The request. + The credentials. + + + + Signs requests using the SharedKey authentication scheme for the table storage service. + + The request. + The credentials. + + + + Adds the metadata. + + The request. + The metadata. + + + + Adds the metadata. + + The request. + The metadata name. + The metadata value. + + + + Signs requests using the SharedKeyLite authentication scheme with is used for the table storage service. + + The request. + The credentials. + + + + Signs requests using the SharedKeyLite authentication scheme with is used for the table storage service. + Currently we only support for table. + + The request. + The credentials. + + + + Adds the lease id. + + The request. + The lease id. + + + + Adds the optional header. + + The web request. + The metadata name. + The metadata value. + + + + Adds the conditional. + + The request. + The header. + The resource ETag. + + + + Adds the conditional. + + The request. + The header. + The date time. + + + + Creates a standard datetime string for the shared key lite authentication scheme. + + DateTime value to convert to a string in the expected format. + The converted DateTime. + + + + Gets the target version. + + The target version. + + + + Converts the date time to snapshot string. + + The date time. + The converted string. + + + + This gets the file version, but fails under partial trust with a security exception. + The caller should catch the exception. + + File version of current assembly. + + Inlining of this fuction is explicitly disabled to support degrading gracefully under partial trust. + FileVersionInfo.GetVersionInfo has a link demand assoicated with it. Therefore, we must make + sure we never inline this function, otherwise the caller cannot catch the security + exception associated with the link demand. + + + + + Gets or sets the user agent to send over the wire to identify the client. + + + + + The exception that is thrown if the client attempts to parse the response a second time. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The message that describes the exception. + + + + Initializes a new instance of the class. + + The message for the exception. + The exception that is the cause of the current 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. + + + + Implements the common parsing between all the responses. + + + + + Gets the error details from the response object. + + The response from server. + An extended error information parsed from the input. + + + + Gets the headers (metadata or properties). + + The response from sever. + A of all the headers. + + + + Gets the user-defined metadata. + + The response from server. + A of the metadata. + + + + Gets a specific user-defined metadata. + + The response from server. + The metadata header requested. + An array of the values for the metadata. + + + + Parses the metadata. + + The reader. + A of metadata. + + Precondition: reader at <Metadata> + Postcondition: reader after </Metadata> (<Metadata/> consumed) + + + + + Gets the storage properties. + + The response from server. + A of the properties. + + + + Gets a specific storage property. + + The response from server. + The property requested. + An array of the values for the property. + + + + Gets the request id. + + The response from server. + The request ID. + + + + Reads service properties from a stream. + + The stream from which to read the service properties. + The service properties stored in the stream. + + + + Gets the metadata or properties. + + The response from server. + The prefix for all the headers. + A of the headers with the prefix. + + + + Class representing a set of properties pertaining to a cloud storage service. + + + + + The name of the root XML element. + + + + + The name of the logging XML element. + + + + + The name of the metrics XML element. + + + + + The name of the version XML element. + + + + + The name of the delete operation XML element. + + + + + The name of the read operation XML element. + + + + + The name of the write operation XML element. + + + + + The name of the retention policy XML element. + + + + + The name of the enabled XML element. + + + + + The name of the days XML element. + + + + + The name of the include APIs XML element. + + + + + The name of the default service version XML element. + + + + + Initializes a new instance of the ServiceProperties class. + + + + + Constructs a ServiceProperties object from an XML document received from the service. + + The XML document. + A ServiceProperties object containing the properties in the XML document. + + + + Converts these properties into XML for communicating with the service. + + An XML document containing the service properties. + + + + Generates XML representing the given retention policy. + + The number of days to retain, or null if the policy is disabled. + An XML retention policy element. + + + + Generates XML representing the given metrics properties. + + The metrics properties. + An XML metrics element. + + + + Generates XML representing the given logging properties. + + The logging properties. + An XML logging element. + + + + Constructs a LoggingProperties object from an XML element. + + The XML element. + A LoggingProperties object containing the properties in the element. + + + + Constructs a MetricsProperties object from an XML element. + + The XML element. + A MetricsProperties object containing the properties in the element. + + + + Constructs a retention policy (number of days) from an XML element. + + The XML element. + The number of days to retain, or null if retention is disabled. + + + + Gets or sets the logging properties. + + The logging properties. + + + + Gets or sets the metrics properties. + + The metrics properties. + + + + Gets or sets the default service version. + + The default service version identifier. + + + + Provides an implementation of the class for requests against + the Table service under the Shared Key authentication scheme. + + + + + Canonicalizes the HTTP request. + + The web request. + The name of the storage account. + The canonicalized string for the request. + + + + Provides an implementation of the class for blobs and queues + for use with the Shared Key Lite authentication scheme. + + + + + Canonicalizes the HTTP request. + + A web request. + The name of the storage account. + The canonicalized string for the request. + + + + Provides an implementation of the class for tables + for the Shared Key Lite authentication scheme. + + + + + Canonicalizes the HTTP request. + + A web request. + The name of the storage account. + The canonicalized string for the request. + + + + Provides an implementation of the class for requests against + the Table service under the Shared Key authentication scheme. + + + + + Canonicalizes the HTTP request. + + A web request. + The name of the storage account. + The canonicalized string for the request. + + + + Container for storage key. + + + May eventually use native APIs to keep key pinned and not memory. + + + + + Initializes a new instance of the class. + + The storage key. + + + + Computes the mac sha256. + + The storage key. + The canonicalized string. + The computed hash. + + + + Computes the mac sha512. + + The storage key. + The canonicalized string. + The computed hash. + + + + Gets the base64 encoded key. + + The base64 encoded key. + + + + Gets the key. + + The storage key. + + + + Gets or sets the key. + + The storage key. + + + + Provides a set of methods for constructing requests for table operations. + + + + + Creates a web request to get the properties of the service. + + The absolute URI to the service. + The server timeout interval, in seconds. + A web request to get the service properties. + + + + Creates a web request to set the properties of the service. + + The absolute URI to the service. + The server timeout interval, in seconds. + A web request to set the service properties. + + + + Writes service properties to a stream, formatted in XML. + + The service properties to format and write to the stream. + The stream to which the formatted properties are to be written. + + + + Signs the request for Shared Key authentication. + + The web request. + The account credentials. + The table service usually expects requests to use Shared Key Lite authentication. + Use for those requests. + + + + Signs the request for Shared Key Lite authentication. + + The web request. + The account credentials. + + + + Provides a set of methods for parsing responses from table operations. + + + + + Returns extended error information from the storage service, that is in addition to the HTTP status code returned with the response. + + The web response. + An object containing extended error information returned with the response. + + + + Gets the request ID from the response. + + The web response. + A unique value associated with the request. + + + + Reads service properties from a stream. + + The stream from which to read the service properties. + The service properties stored in the stream. + + + + A style class for creating Uri query strings. + + + + + Stores the query parameters. + + + + + Add the value with Uri escaping. + + The query name. + The query value. + + + + Returns a that represents this instance. + + + A that represents this instance. + + + + + Add query parameter to an existing Uri. This takes care of any existing query parameters in the Uri. + + Original Uri which may contain query parameters already. + The appended Uri. + + + + Represents a queue's attributes. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The attributes to clone. + + + + Gets the queue's user-defined metadata. + + The queue's user-defined metadata. + + + + Gets the URI for the queue. + + The queue's URI. + + + + Provides error code strings that are specific to the Queue service. + + + + + Error code that may be returned when the specified queue was not found. + + + + + Error code that may be returned when the specified queue is disabled. + + + + + Error code that may be returned when the specified queue already exists. + + + + + Error code that may be returned when the specified queue is not empty. + + + + + Error code that may be returned when the specified queue is being deleted. + + + + + Error code that may be returned when the specified pop receipt does not match. + + + + + Error code that may be returned when one or more request parameters are invalid. + + + + + Error code that may be returned when the specified message was not found. + + + + + Error code that may be returned when the specified message is too large. + + + + + Error code that may be returned when the specified marker is invalid. + + + + + Specifies which details to include when listing queues in this storage account. + + + + + No additional details. + + + + + Retrieve queue metadata. + + + + + Retrieve all available details. + + + + + Utility functions that does the heavy lifting of carrying out retries on a IRetrayableRequest. + + + Both synchrous and asynchrous request styles are supported. + They are used to implement the corresponding XXX, BeginXXX, EndXXX calls where XXX + is something like GetBlobInfo. + State passing for return value in the sync call (GetBlobInfo) and out parameters for the async calls + (EndBlobInfo) is achieved by member variables in the implementation class of IRetryableRequest. + + + + + Synchronouses the request with retry. + + The result type of the task. + The oracle to use. + The task implementation. + The result of the task. + + + + Begins the asynchronous request with retry. + + The result type of the task. + The oracle to use. + The task implementation. + The asynchronous callback. + The asynchronous state. + An that represents the asynchronous operation. + + + + Ends the asynchronous request with retry. + + The result type of the task. + The asynchronous result. + The result of the completed task. + + + + Implementation of the *RequestWithRetry methods. + + The result type of the task. + The retry oracle. + The task implementation. + The result report delegate. + A that performs the request with retries. + + + + Implementation of the *RequestWithRetry methods. + + The result type of the task. + The retry oracle. + The task implementation. + A that performs the request with retries. + + + + Provides the arguments for the ResponseReceived event. + + + + + Gets the request ID. + + The request ID. + + + + Gets the request headers. + + The collection of request headers. + Modifying the collection of request headers may result in unexpected behavior. + + + + Gets the request URI. + + The request URI. + + + + Gets the response headers. + + The collection of response headers. + Modifying the collection of response headers may result in unexpected behavior. + + + + Gets the HTTP status code for the request. + + The HTTP status code for the request. + + + + Gets the status description for the request. + + The status description for the request. + + + + Gets an exception returned by the service. + + The exception returned by the service. + + + + Manage continuation information for various listing operation. + Can be serialized using XmlSerialization. + + + + + XML element for the next marker. + + + + + XML element for the next partition key. + + + + + XML element for the next row key. + + + + + XML element for the next table name. + + + + + XML element for the token version. + + + + + Stores the current token version value. + + + + + XML element for the token type. + + + + + Initializes a new instance of the class. + + + + + Gets an XML representation of an object. + + + An that describes the XML representation of the object that is produced by the method and consumed by the method. + + + + + Generates a serializable continuation token from its XML representation. + + The stream from which the continuation token is deserialized. + + + + Converts a serializable continuation token into its XML representation. + + The stream to which the continuation token is serialized. + + + + Gets or sets the NextPartitionKey for TableServiceEntity enumeration operations. + + + + + Gets or sets the NextRowKey for TableServiceEntity enumeration operations. + + The next row key. + + + + Gets or sets the NextTableName for Table enumeration operations. + + The name of the next table. + + + + Gets or sets the NextMarker for continuing results for CloudBlob and CloudBlobContainer and CloudQueue enumeration operations. + + The next marker. + + + + Gets a value indicating whether there is continuation information present. + + + + + + Gets or sets the type. + + The continuation type. + + + + Specifies the type of a continuation token. + + + + + Default for no continuation. + + + + + The token is a blob listing continuation token. + + + + + The token is a queue listing continuation token. + + + + + The token is a container listing continuation token. + + + + + The token is a table query continuation token. + + + + + Represents a class which manages pagination of results. + + + + + Stores the results remaining in the current page. + + + + + Stores the page size. + + + + + Initializes a new instance of the class. + + Number of results to be returned as a page. + maxResults of 0 or less means no paging. + + + + Gets the size for next request to pass in parameter like MaxResults. + + Postive value indicating size of a result page if using paging. + Else null is returned. + + + + Update pagination paramters for new result set returned. + + The current result count. + + + + Gets the maxResults in use for the current Pagination instance + Returns zero if paging is not in use. + + The size of the effective page. + + + + Gets a value indicating whether paging is enabled with a valid postive page size. + An instance with a non positive page size will return false. + + + + + Gets a value indicating whether there are no more remaining results in the current page. + Will return false if paging is not enabled. + + + + + Represents a result segment that was retrieved from the total set of possible results. + + The type of the element. + + + + Stores the continuation token used to retrieve the next segment of results. + + + + + Stores the closure used to retrieve the next set of results. + + + + + Stores the used for requests. + + + + + Initializes a new instance of the ResultSegment class. + + The result. + If set to true there are more results. + The next result segment. + The retry policy. + + + + Begins an asynchronous operation to retrieve the next result segment. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to retrieve the next result segment. + + An that references the pending asynchronous operation. + The next result segment. + + + + Gets the next result segment. + + The next result segment. + + + + Implementation of GetNext (For symmetry with normal tasks. + + The action to set the results. + A representing the operation to get the next set of results. + + + + Gets an enumerable collection of results. + + An enumerable collection of results. + + + + Gets a value indicating whether there are additional results to retrieve. + + True if there are additional results; otherwise, false. + + + + Gets a continuation token to use to retrieve the next set of results with a subsequent call to the operation. + + The continuation token. + + + + Gets or sets the pagination information for Results. + + The pagination. + + + + Gets the retry policy. + + The retry policy. + + + + Represents a helper class to support additional operations on ResultSegments + such as grouping of results into pages. + + + + + Checks if the result segment has more results in the current page if pagination is used. + If pagination is not used, it checks if a valid continuation is present. + + The pagination. + The continuation token. + + Returns true if there are more results in the page; otherwise, false. + + + + + Create a result segment from the result result. + + The type of the result. + The set result. + The result list. + The continuation token. + The pagination. + The retry policy. + The continuation function. + + + + Checks if the result segment passed in has a valid continuation token. + + The continuation. + + Returns true if the specified continuation has continuation; otherwise, false. + + + + + Defines some standard retry policies. + + + + + Indicates the default minimum backoff value that will be used for a policy returned by . + + + + + Indicates the default maximum backoff value that will be used for a policy returned by . + + + + + Indicates the default client backoff value that will be used by a service client, if no other retry policy has been specified. + + + + + Indicates the default retry count that will be used by a service client, if no other retry policy has been specified. + + + + + Returns a retry policy that performs no retries. + + The retry policy. + + + + Returns a retry policy that retries a specified number of times, with a specified fixed time interval between retries. + + A non-negative number indicating the number of times to retry. + The time interval between retries. Use to specify that the operation + should be retried immediately. + The retry policy. + + + + Returns a policy that retries a specified number of times with a randomized exponential backoff scheme. + + A non-negative number indicating the number of times to retry. + The multiplier in the exponential backoff scheme. + The retry policy. + + + + Returns a policy that retries a specified number of times with a randomized exponential backoff scheme. + + A non-negative number indicating the number of times to retry. + The minimum backoff interval. + The maximum backoff interval. + The multiplier in the exponential backoff scheme. + The retry policy. + + + + Returns a delegate that implements a custom retry policy. + + A delegate that determines whether or not to retry an operation. + + + + Specifies the set of possible permissions for a shared access policy. + + + + + No shared access granted. + + + + + Read access granted. + + + + + Write access granted. + + + + + Delete access granted for blobs. + + + + + List access granted. + + + + + Represents the collection of shared access policies defined for a container. + + + + + Represents a shared access policy, which specifies the start time, expiry time, + and permissions for a shared access signature. + + + + + Initializes a new instance of the class. + + + + + Converts the permissions specified for the shared access policy to a string. + + The shared access permissions. + The shared access permissions in string format. + + + + Constructs a object from a permissions string. + + The shared access permissions in string format. + A set of shared access permissions. + + + + Gets or sets the start time for a shared access signature associated with this shared access policy. + + The shared access start time. + + + + Gets or sets the expiry time for a shared access signature associated with this shared access policy. + + The shared access expiry time. + + + + Gets or sets the permissions for a shared access signature associated with this shared access policy. + + The permissions. + + + + Determines whether a request should be retried. + + The number of times the request has been retried. + The exception raised by the most recent operation. + An optional delay that specifies how long to wait before retrying a request. + true if the request should be retried; otherwise, false. + + + + This class provides MemoryStream-like behavior but uses a list of blocks rather than a single piece of bufferBlocks. + + + + + The default block size. + + + + + The size of the block. + + + + + The underlying bufferBlocks for the stream. + + + + + The currently used length. + + + + + The total capacity of the stream. + + + + + The current position. + + + + + Initializes a new instance of the SmallBlockMemoryStream class with default 64KB block size and no reserved space. + + + + + Initializes a new instance of the SmallBlockMemoryStream class with provided block size and no reserved space. + + The size of blocks to use. + + + + Initializes a new instance of the SmallBlockMemoryStream class. + + The size of blocks to use. + The amount of memory to reserve. + Thrown if is zero or negative. + + + + Copies the specified amount of data from internal buffers to the buffer and advances the position. + + An array of bytes. When this method returns, the buffer contains the specified byte array with the values + between offset and (offset + count - 1) replaced by the bytes read from the current source. + The zero-based byte offset in buffer at which to begin storing the data read from the current stream. + The maximum number of bytes to be read from the current stream. + The total number of bytes read into the buffer. This can be less than the number of bytes requested + if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. + + The offset subtracted from the buffer length is less than count. + The buffer is null. + The offset or count is negative. + + + + Sets the position within the current stream. + + A byte offset relative to the origin parameter. + A value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position. + The new position within the current stream. + Thrown if is invalid for SeekOrigin. + + + + Sets the length of the current stream. (preallocating the bufferBlocks). + + The desired length of the current stream in bytes. + If the is negative. + + + + Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. + + An array of bytes. This method copies count bytes from buffer to the current stream. + The zero-based byte offset in buffer at which to begin copying bytes to the current stream. + The number of bytes to be written to the current stream. + Offset subtracted from the buffer length is less than count. + Thrown if is null + Thrown if or is negative + + + + Does not perform any operation as it's an in-memory stream. + + + + + Ensures that the amount of bufferBlocks is greater than or equal to the required size. + Does not trim the size. + + The required size. + If the is negative. + + + + Adds another block to the underlying bufferBlocks. + + + + + Copies the specified amount of data from internal buffers to the buffer and advances the position. + + An array of bytes. When this method returns, the buffer contains the specified byte array with the values + between offset and (offset + count - 1) replaced by the bytes read from the current source. + The zero-based byte offset in buffer at which to begin storing the data read from the current stream. + The maximum number of bytes to be read from the current stream. + The total number of bytes read into the buffer. This can be less than the number of bytes requested + if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. + + + + + Writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. + (Requires the stream to be of sufficient size for writing). + + An array of bytes. This method copies count bytes from buffer to the current stream. + The zero-based byte offset in buffer at which to begin copying bytes to the current stream. + The number of bytes to be written to the current stream. + + + + Advances the current position of the stream and adjust the offset and remainder based on the amount completed. + + The current offset in the external buffer. + The amount of data left to process. + The amount of data processed. + + + + Calculate the block for the current position. + + The position within a block. + The block reference itself. + + + + Gets a value indicating whether the current stream supports reading. + + Is true if the stream supports reading; otherwise, false. + + + + Gets a value indicating whether the current stream supports seeking. + + Is true if the stream supports seeking; otherwise, false. + + + + Gets a value indicating whether the current stream supports writing. + + Is true if the stream supports writing; otherwise, false. + + + + Gets the currently written length. + + + + + Represents the current position in the stream. + + Thrown if position is outside the stream size + + + + Represents an exception thrown by the Windows Azure storage client library. + + + + + The base class for Windows Azure storage service exceptions. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The storage client error code. + The message that describes the exception. + The HTTP status code returned in the response. + The extended error information. + The instance that caused the current exception. + + + + Initializes a new instance of the class with + serialized data. + + The object that contains serialized object + data about the exception being thrown. + The object that contains contextual information + about the source or destionation. + + + + Sets the object with additional exception information. + + The object that contains serialized data about the exception being thrown. + The object that contains contextual information + about the source or destination. + + + + Gets the HTTP status code that was returned by the service. + + The HTTP status code. + + + + Gets the specific error code returned by the service. + + The storage error code. + + + + Gets the extended error information returned by the service. + + The extended error information. + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The storage client error code. + The message that describes the exception. + The HTTP status code returned in the response. + The extended error information. + The instance that caused the current exception. + + + + Initializes a new instance of the class with + serialized data. + + The object that contains serialized data about the exception being thrown. + The object that contains contextual information + about the source or destination. + + + + Describes error codes that may be returned by the Windows Azure storage services or the storage client library. + + + + + No error specified. + + + + + An internal server occurred (server-side error). + + + + + The service timed out (server-side error). + + + + + A service integrity check failed (server-side error). + + + + + A transport error occurred (server-side error). + + + + + The service returned a bad response (server-side error). + + + + + The specified resource was not found (client-side error). + + + + + The specified account was not found (client-side error). + + + + + The specified container was not found (client-side error). + + + + + The specified blob was not found (client-side error). + + + + + An authentication error occurred (client-side error). + + + + + Access was denied (client-side error). + + + + + The specified resource already exists (client-side error). + + + + + The specified container already exists (client-side error). + + + + + The specified blob already exists (client-side error). + + + + + The request was incorrect or badly formed (client-side error). + + + + + The specified condition failed (client-side error). + + + + + There was an error with the gateway used for the request (client-side error). + + + + + The requested operation is not implemented on the specified resource (client-side error). + + + + + The request version header is not supported (client-side error). + + + + + Provides error code strings that are common to all storage services. + + + + + The specified HTTP verb is not supported. + + + + + The Content-Length header is required for this request. + + + + + A required header was missing. + + + + + A required XML node was missing. + + + + + One or more header values are not supported. + + + + + One or more XML nodes are not supported. + + + + + One or more header values are invalid. + + + + + One or more XML node values are invalid. + + + + + A required query parameter is missing. + + + + + One or more query parameters is not supported. + + + + + One or more query parameters are invalid. + + + + + One or more query parameters are out of range. + + + + + The URI is invalid. + + + + + The HTTP verb is invalid. + + + + + The metadata key is empty. + + + + + The request body is too large. + + + + + The specified XML document is invalid. + + + + + An internal error occurred. + + + + + Authentication failed. + + + + + The specified MD5 hash does not match the server value. + + + + + The specified MD5 hash is invalid. + + + + + The input is out of range. + + + + + The input is invalid. + + + + + The operation timed out. + + + + + The specified resource was not found. + + + + + The specified metadata is invalid. + + + + + The specified metadata is too large. + + + + + The specified condition was not met. + + + + + The specified range is invalid. + + + + + The specified container was not found. + + + + + The specified container already exists. + + + + + The specified container is disabled. + + + + + The specified container is being deleted. + + + + + The server is busy. + + + + + Provides a set of extensions for translating Exceptions into StorageExceptions. + + + + + Translates a WebException into the corresponding StorageException. + + The exception to translate. + The translated exception. + + + + Translates the data service client exception. + + The exception to translate. + The translated exception. + + + + Represents extended error information returned by the Windows Azure storage services. + + + + + Gets the storage service error code. + + The storage service error code. + + + + Gets the storage service error message. + + The storage service error message. + + + + Gets additional error details. + + The additional error details. + + + + Represents an exception thrown due to a server-side error. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + The storage client error code. + The message that describes the exception. + The HTTP status code returned in the response. + The instance that caused the current exception. + + + + Initializes a new instance of the class. + + The storage client error code. + The message that describes the exception. + The HTTP status code returned in the response. + The extended error information. + The instance that caused the current exception. + + + + Initializes a new instance of the class with + serialized data. + + The object that contains serialized data about the exception being thrown. + The object that contains contextual information + about the source or destination. + + + + A class containing common functionality across the two blob streams. + + + + + Verifies the parameters to a read/write operation. + + An array of bytes. + The zero-based byte offset in . + The maximum number of bytes to be access in . /// The sum of offset and count is greater than the buffer length. + is null. + offset or count is negative. + + + + Calculates an ongoing hash. + + The data to calculate the hash on. + The offset in the input buffer to calculate from. + The number of bytes to use from input. + The hash algorithm to use. + + + + Retrieves the string representation of the hash. (Completes the creation of the hash). + + The hashing object. + A string that is the content of the hash. + + + + Provides error code strings that are specific to the Windows Azure Table service. + + + + + The request uses X-HTTP-Method with an HTTP verb other than POST. + + + + + The specified X-HTTP-Method is invalid. + + + + + More than one X-HTTP-Method is specified. + + + + + The specified table has no properties. + + + + + A property is specified more than once. + + + + + The specified table has no such property. + + + + + A duplicate key property was specified. + + + + + The specified table already exists. + + + + + The specified table was not found. + + + + + The specified entity was not found. + + + + + The specified entity already exists. + + + + + The partition key was not specified. + + + + + One or more specified operators are invalid. + + + + + The specified update condition was not satsified. + + + + + All properties must have values. + + + + + The partition key property cannot be updated. + + + + + The entity contains more properties than allowed. + + + + + The entity is larger than the maximum size permitted. + + + + + The property value is larger than the maximum size permitted. + + + + + One or more value types are invalid. + + + + + The specified table is being deleted. + + + + + The Table service server is out of memory. + + + + + The type of the primary key property is invalid. + + + + + The property name exceeds the maximum allowed length. + + + + + The property name is invalid. + + + + + Batch operations are not supported for this operation type. + + + + + JSON format is not supported. + + + + + The specified method is not allowed. + + + + + The specified operation is not yet implemented. + + + + + Represents a object for use with the Windows Azure Table service. + + + + + Initializes a new instance of the class. + + The Table service endpoint to use create the service context. + The account credentials. + + + + Begins an asynchronous operation to save changes, using the retry policy specified for the service context. + + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Begins an asynchronous operation to save changes, using the retry policy specified for the service context. + + Additional options for saving changes. + The callback delegate that will receive notification when the asynchronous operation completes. + A user-defined object that will be passed to the callback delegate. + An that references the asynchronous operation. + + + + Ends an asynchronous operation to save changes. + + An that references the pending asynchronous operation. + A that represents the result of the operation. + + + + Saves changes, using the retry policy specified for the service context. + + A that represents the result of the operation. + + + + Saves changes, using the retry policy specified for the service context. + + Additional options for saving changes. + A that represents the result of the operation. + + + + Saves the changes with retries implementation. + + The options for saving changes. + The action to set result. + A sequence of tasks to perform the operation. + + + + Callback on DataContext object sending request. + + The sender. + The instance containing the event data. + + + + Gets or sets the retry policy requests made via the service context. + + The retry policy. + + + + Gets the storage account credentials used by the service context. + + The account credentials. + + + + Represents an entity in the Windows Azure Table service. + + + + + Initializes a new instance of the class. + + The partition key. + The row key. + + + + Initializes a new instance of the class. + + + + + Gets or sets the timestamp for the entity. + + The entity's timestamp. + + + + Gets or sets the partition key of a table entity. + + The partition key. + + + + Gets or sets the row key of a table entity. + + The row key. + + + + Provides a set of extensions for the Table service. + + + + + Converts the query into a object that supports + additional operations like retries. + + The type of the element. + The query. + The converted query. + + + + Internal table service entity for creating tables. + + + + + Stores the table name. + + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class with the specified name. + + The name of the table. + + + + Determines whether the specified is equal to this instance. + + The to compare with this instance. + + Returns true if the specified is equal to this instance; otherwise, false. + + + The parameter is null. + + + + + Returns a hash code for this instance. + + + A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. + + + + + Gets or sets the table name. + + The name of the table. + + + + Helper functions for table service. + + + + + Determines whether the type is an entity type. + + The type to check. + Type of the context. + + Returns true if the type is an entity type; otherwise, false. + + + + + Determines whether the specified property is a key column. + + The property. + + Returns true if the specified property is a key column; otherwise, false. + + + + + Enumerates the entity set properties. + + Type of the context. + A list of the entity set properties. + + + + Enumerates the entity set names. + + Type of the context. + A list of entity set names. + + + + Checks the name of the table. + + The table name. + Name of the arg. + + + + Implementation helper for task sequences. + + + + + Executes the impl. + + The result type. + The task implementation. + The result of the task. + + + + Begins the impl. + + The result type. + The task implementation. + The callback. + The state. + An asynchronous result representing the operation. + + + + Ends the impl. + + The result type. + The async result. + The task result. + + + + Executes the impl. + + The task implemenetaion. + + + + Begins the impl. + + The task implementation. + The callback. + The state. + An asynchronous result representing the operation. + + + + Ends the impl. + + The async result. + + + + Executes the impl with retry. + + The result type. + The task implementation. + The policy. + The task result. + + + + Begins the impl with retry. + + The result type. + The task implementation. + The policy. + The callback. + The state. + An asynchronous result representing the operation. + + + + Ends the impl with retry. + + The result type. + The async result. + The task result. + + + + Executes the impl with retry. + + The task implementation. + The policy. + + + + Executes the impl with retry. + + The result type. + The task implementation. + The task result. + + + + Executes the impl with retry. + + The result type. + The task implementation. + The policy. + The task result. + + + + Begins the impl with retry. + + The task implementation. + The policy. + The callback. + The state. + An asynchronous result representing the operation. + + + + Ends the impl with retry. + + The async result. + + + + Gets the retryable async task. + + The result type. + The task implementation. + The policy. + The retryable task. + + + + Gets the retryable async task. + + The task implementation. + The policy. + The retryable task. + + + + Gets the task from async result. + + The type of the result. + The async result. + The asynchronous result. + + + + A task that implements the conventional BeginXX(), EndXX() pattern. + + + + + A task that implements the conventional BeginXX(), EndXX() pattern. + + The return type of the task. + + + + Represents an asynchronous computation that yields a result of type T. + + The type of the result of the operation. + + By this contract we: + 1) guarantee that the completion routine is performed, regardless of the outcome of ExecuteStep. + 2) insist that the completion routine does not throw an exception. + 3) insists that the abort routine does not throw an exception. + + + + + An asynchronous computation. + + + + + Perform the next async step. + + The action to be performed on completion. + + + + Abort the task operation. + + + + + Gets a value indicating whether the task has completed synchronously. + + + Is true if completed synchronously; otherwise, false. + + + + + Gets exception raised by this task (if any). + + The exception. + + + + Provides information if the task completed synchronously and therefore on the main thread. + + + + + Contains any exceptions raised by the task. + + + + + The action to call once the operation is completed. + + + + + The result of the operation. + + + + + Executes the tasks and waits for the result. + + The result of the operation. + + + + Executes a task, will not wait on a sync task. + + The result of the operation. + + + + Executes a single step of the task. (Delegates to the concrete implemetation for specific step). + + The completion function to be called. + + + + Implements an abort routine that fulfills the contract. + + + + + The specific implementation of the task's step. + + + + + Implements a safe way to obtain the result. + + The function used to get the result value. + + + + The task-specific abort that should be called. + + + + + The completion return that needs to be called whenever operation completes. + + Whether the underlying operation completed synchrnously. + + + + Gets or sets the result of the operation and throws any exceptions raised by the operation. + + + + + Gets or sets a value indicating whether the operation was completed synchronously and therefore on main thread. + + + + + Gets or sets any exceptions raised during execution. + + + + + Gets or sets a value indicating whether the task is completed. + + + + + Initializes a new instance of the APMTask class for use with normal APM. + + The APM function to begin operation. + The APM functon to end the operation. + + + + Initializes a new instance of the APMTask class for use with normal APM. + + The APM function to begin operation. + The APM functon to end the operation. + The function used for aborting an operation. + + + + Implementation of the library execution. Performs the APM operation. + + + + + Implements the abort functionality. + + + + + Callback for the APM function. + + The async result for the APM model. + + + + Gets or sets the begin function. + + The begin func. + + + + Gets or sets the end function. + + The end func. + + + + Gets or sets the abort function. + + The abort func. + + + + Initializes a new instance of the APMTask class for sequence without any return value. + + The APM function to begin operation. + The APM functon to end the operation. + + + + A class to extend a normal task. + + + + + Converts a Task to an a TaskAsyncResult to allow for exposing Tasks as IAsyncResult. + + The return type of the task. + The task to be converted. + The callback to be called at the end of the task. + The callback's state. + A TaskAsyncResult that implements IAsyncResult. + + + + Converts a Task to an a TaskAsyncResult to allow for exposing Tasks as IAsyncResut. + + The task to be converted. + The callback to be called at the end of the task. + The callback's state. + A TaskAsyncResult that implements IAsyncResult. + + + + A task class that implements a fixed delay. + + + + + Indicates whether this object has been disposed. + + + + + Stores the length of the delay. + + + + + ObjectUsed to lock disposing methods and timer callbacks. + + + + + Stores the native timer used to trigger after the specified delay. + + + + + Initializes a new instance of the class. + + Should be between TimeSpan.Zero and TimeSpan.MaxValue. + + + + Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + + + + + Releases unmanaged and - optionally - managed resources. + + Set to true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + The specific implementation of the task's step. + + + + + The task-specific abort that should be called. + + + + + Begins the delay. + + + + + Ends the delay. + + + + + Invokes a sequence with no return value. + + + + + Invokes a sequence of tasks. + + The type of the result of the operation. + + + + Contains the function that generates a squence of tasks to be invoked. + + + + + The current task that is being invoked. + + + + + Controls whether the abort was called. + + + + + Initializes a new instance of the InvokeTaskSequenceTask class with a task sequence that returns a value. + + The sequence of actions to be invoked. + + + + Implements the abort logic by aborting the current task. + + + + + The starting point for executing a task sequence. + + + + + Executes a task sequence by iterating over all of the items and executing them. + + The sequence of tasks to execute. + Whether the sequence so far has completed synchronously. + + + + Initializes a new instance of the InvokeTaskSequenceTask class for sequence without any return value. + + The sequence of actions to be invoked. + + + + A NullTaskReturn type. + + + + + Represents a no-return from a task. + + + + + Prevents a default instance of the class from being created. + + + + + Facilitates a scenario where numerous simultaneous tasks are active, and only the first to complete should continue. + + The type of the result of the operation. + + + + Stores the abort flag. + + + + + Stores the racing tasks. + + + + + Initializes a new instance of the class. + + The tasks. + + + + The specific implementation of the task's step. + + + + + The task-specific abort that should be called. + + + + + Called when complete. + + The winning task. + + + + Provides extensions for the stream object to support asynchronous operations. + + + + + Buffer size needs to be page-aligned. + + + + + Asynchronously reads data from a stream using BeginRead. + + The stream on which the method is called. + The buffer to read the data into. + Byte offset in the buffer. + Maximum number of bytes to read. + Returns non-zero if there are still some data to read. + + + + Reads asynchronously the entire content of the stream and returns it + as a string using StreamReader. + + The stream on which the method is called. + The text encoding used for converting bytes read into string. + The action to be performed with the resulting string. + Returns a task sequence that must be performed to get result string using the 'Result' callback. + + + + Asynchronously writes data from a stream using BeginWrite. + + The stream on which the method is called. + The buffer to write the data from. + Byte offset in the buffer. + Maximum number of bytes to write. + A task with no return value. + + + + Reads asynchronously the entire content of the stream and writes it to the given output stream. + + The origin stream. + The destination stream. + The sequence that when invoked results in an asynchronous copy. + + + + Compute the MD5 hash of the stream. + + The stream. + A delegate for setting the resulting MD5 hash as a string. + The sequence that when invoked results in an asynchronous MD5 computation. + + + + Reads synchronously the entire content of the stream and writes it to the given output stream. + + The origin stream. + The destination stream. + + + + Reads asynchronously the entire content of the stream and writes it to the given output stream. + Closes the output stream at the end. + + The origin stream. + The destination stream. + The sequence that when invoked results in an asynchronous copy. + + + + A task that obtains a result synchronously. + + + + + A task that obtains a result synchronously. + + The type of the result of the operation. + + + + The function to be executed. + + + + + Initializes a new instance of the SynchronousTask class. + + The function to execute. + + + + Performs the task and marks it as completed. + + + + + Implements abort as NoOp. + + + + + Initializes a new instance of the SynchronousTask class. + + The function to execute. + + + + A set of extension methods for table service classes. + + + + + Converts a DataServiceQuery execution into an APMTask. + + The result type of the query. + The query to convert. + The wrapped task. + + + + Converts the SaveChanges method into an APMTask. + + The target context. + The wrapped task. + + + + Converts the SaveChanges method to an APMTask. + + The target context. + The options to pass to SaveChanges. + A task that saves changes asynchronously. + + + + Gets the unexpected internal client error wrapped task. + + The result type. + The timeout. + The original task. + The wrapped task. + + + + Gets the unexpected internal client error task sequence. + + The result type. + The timeout. + The set result. + A for the unexpected error. + + + + An implementation of IAsyncResult that encapsulates a task. + + The type of the resulting value. + Refer to http://csdweb/sites/oslo/engsys/DesignGuidelines/Wiki%20Pages/IAsyncResult.aspx and + http://www.bluebytesoftware.com/blog/2006/05/31/ImplementingAHighperfIAsyncResultLockfreeLazyAllocation.aspx for IAsyncResult details + + + + The underlying task for the async operation. + + + + + The callback provided by the user. + + + + + The state for the callback. + + + + + Indicates whether a task is completed. + + + + + Indicates whether task completed synchronously. + + + + + The event for blocking on this task's completion. + + + + + Initializes a new instance of the TaskAsyncResult class. + + The task to be executed. + The callback method to be used on completion. + The state for the callback. + + + + Provides a convenient function for waiting for completion and getting the result. + + The result of the operation. + + + + We implement the dispose only to allow the explicit closing of the event. + + + + + Releases unmanaged and - optionally - managed resources. + + Set to true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + + Provides the lazy initialization of the WaitHandle (based on Joe Duffy's blog). + + The WaitHandle to use for waiting on completion. + + + + Called on completion of the async operation to notify the user + (Based on Joe Duffy's lockless design). + + + + + Gets A user-defined object that contains information about the asynchronous operation. + + + + + Gets a System.Threading.WaitHandle that is used to wait for an asynchronous operation to complete. + + + + + Gets a value indicating whether the asynchronous operation completed synchronously. + + + + + Gets a value indicating whether the asynchronous operation has completed. + + + + + Encapsulates methods for wrapping tasks in timeouts. + + + + + Gets a timeout wrapped task. + + The type of the result. + The timeout. + The original task. + A that has been wrapped with a timeout if specified. + + + + Creates a localized timeout exception object. + + The timeout. + A localized object. + + + + Gets a timeout task sequence. + + The type of the result. + The timeout. + The set result. + A that has been wrapped with a timeout if specified. + + + + A set of extension methods for a webrequest. + + + + + Gets an asynchronous response to a given Web request. + + The requested that is used for operation. + The service. + The timeout. + A task that yields the response. + + + + Gets an asynchronous response to a given Web request. + + The requested that is used for operation. + The service. + The timeout. + A task that yields the response. + + + + Gets an asynchronous response to a given Web request. + + The requested that is used for operation. + The service. + The timeout. + A task that yields the response. + + + + Gets an asynchronous request stream for a given Web request. + + The requested that is used for operation. + A task that yields a stream. + + + + Gets an asynchronous response to a given Web request. + + The requested that is used for operation. + The service. + A task that yields the response. + + + + Gets an asynchronous response to a given Web request. + + The requested that is used for operation. + The service. + A task that yields the response. + + + + Gets an asynchronous response to a given Web request. + + The requested that is used for operation. + The service. + A task that yields the response. + + + + Tracing helper class. + + + + + Internal format string for trace messages. + + + + + Internal flag for turning on tracing. + + + + + Writes the line. + + The format. + The arguments. + + + + Writes the line internal. + + The format. + The arguments. + + + + General purpose utility methods. + + + + + This is the limit where we allow for the error message returned by the server. + Messages longer than that will be truncated. + + + + + Processes the unexpected status code. + + The response. + + + + Translates the data service client exception. + + The exception. + The translated exception. + + + + Translates the web exception. + + The exception. + The translated exception. + + + + Gets the extended error details from response. + + The HTTP response stream. + Length of the content. + The extended error information. + + + + Gets the extended error from XML message. + + The XML error message. + The extended error information. + + + + Copies the stream to buffer. + + The source stream. + The buffer. + The bytes to read. + The number of bytes copied. + + + + Translates from HTTP status. + + The status code. + The status description. + The details. + The inner. + The translated exception. + + + + Extracts an MD5 value from either an v1 or v2 block id. + + The block id containing an MD5. + MD5 value, or null if invalid format. + + + + Generates an block id using the given MD5 hash value. The id must be Base64 compatible. + + The hash value to encode in the block id. + The sequence prefix value. + The block id. + + + + Checks that the given timeout in within allowed bounds. + + The timeout to check. + The timeout is not within allowed bounds. + + + + Translates the extended error. + + The details. + The status code. + The status description. + The inner exception. + The translated exception. + + + + Gets the error details from stream. + + The input stream. + The error details. + + + + Represents storage account credentials for accessing the Windows Azure storage services. + + + + + Initializes a new instance of the class, using the storage account name and + access key. + + The name of the storage account. + The account access key, as an array of bytes. + + + + Initializes a new instance of the class, using the storage account name and + access key. + + The name of the storage account. + The account access key, as a Base64-encoded string. + + + + Transforms a resource URI into a shared access signature URI, by appending a + shared access token. For objects of type , this operation + returns the resource URI that is passed to it.. + + The resource URI to be transformed. + The URI for a shared access signature, including the resource URI and the shared access token. + + + + Signs a request using the specified credentials under the Shared Key authentication scheme. + + The web request to be signed. + + + + Signs a request using the specified credentials under the Shared Key Lite authentication scheme. + + The web request to be signed. + + + + Encodes a Shared Key or Shared Key Lite signature string by using the HMAC-SHA256 algorithm over a UTF-8-encoded string-to-sign. + + A UTF-8-encoded string-to-sign. + An HMAC-encoded signature string. + + + + Gets the base64 encoded key. + + The base64 encoded key. + + + + Performs the computation of the signature based on the private key. + + The string that should be signed. + The signature for the string. + + + + Returns a that represents this instance. + + If set to true exports secrets. + + A that represents this instance. + + + + + Gets a object that references the storage account name and access key. + + An object containing a reference to the storage account name and access key. + + + + Gets the name of the storage account associated with the specified credentials. + + The name of the storage account. + + + + Gets a value indicating whether the method should be called + to transform a resource URI to a URI that includes a token for a shared access signature. + + False for objects of type . + + + + Gets a value indicating whether a request can be signed under the Shared Key authentication + scheme using the specified credentials. + + True for objects of type . + + + + Gets a value indicating whether a request can be signed under the Shared Key Lite authentication + scheme using the specified credentials. + + True for objects of type . + + + + Gets a value indicating whether the method will return a valid + HMAC-encoded signature string when called using the specified credentials. + + True for objects of type . + + + + Sets the account name that owns the key to use when signing requests. + + The name of the account that owns the key to use when signing requests. + + + + Class that represents credentials for anonymous access. Used by internal implementaion. + + + + + Stores the singleton instance of this class. + + + + + Prevents a default instance of the class from being created. + + + + + A potential transformation to the Uri for signing purposes. The transformation may append to the string. + + The resource Uri to be transformed. + The new resource Uri that includes any transformations required for signing. + Identity operation for anonymous access. + + + + An operation that may add any required authentication headers based for the credential type. (SharedKey algorithm). + + The request that needs to be signed. + No op for anonymous access. + + + + An operation that may add any required authentication headers based for the credential type. (SharedKeyLite algorithm used for LINQ for Tables). + + The request that needs to be signed. + No op for anonymous access. + + + + Performs the computation of the signature based on the private key. + + The string that should be signed. + The signature for the string. + Returns null representing no op. + + + + Performs the computation of the signature based on the private key. + + The string to be signed. + The signature for the string. + Need for D-SAS not public. + + + + Returns a that represents this instance. + + If set to true exports secrets. + + A that represents this instance. + + + + + Gets account name information if available. Else returns null. + + + + + Gets a value indicating whether the method must be called + before generating a signature string with the specified credentials. + + + Is true if needs transform Uri; otherwise, false. If false, + calling returns the original, unmodified Uri. + + + + + Gets a value indicating whether SignRequest will perform signing when using this credentials. + False means SignRequest will not do anything. + + + Is true if a request can be signed with these credentials; otherwise, false. + + + + + Returns whether SignRequestLite will perform signing when using this credentials. + False means SignRequestLite will not do anything. + + + + + Returns whether ComputeHMAC will return a valid HMAC when using this credentials. + False means ComputeHmac will return null. + + + Returns true if these credentials will yield a valid signature string; otherwise, false. + + + + + Represents storage credentials for delegated access to Blob service resources + via a shared access signature. + + + + + Stores the shared access signature token. + + + + + Stores the internal used to transform Uris. + + + + + Initializes a new instance of the class + with the specified shared access token. + + A string token representing a shared access signature. + + + + Transforms a resource URI into a shared access signature URI, by appending a + shared access token. + + The resource URI to be transformed. + The URI for a shared access signature, including the resource URI and the shared access token. + + + + Signs a request using the specified credentials under the Shared Key authentication scheme. + This is not a valid operation for objects of type . + + The web request to be signed. + + + + Signs a request using the specified credentials under the Shared Key Lite authentication scheme. + This is not a valid operation for objects of type . + + The web request object to be signed. + + + + Encodes a Shared Key or Shared Key Lite signature string by using the HMAC-SHA256 algorithm over a UTF-8-encoded string-to-sign. + This is not a valid operation for objects of type . + + A UTF-8-encoded string-to-sign. + Null for objects of type . + + + + Encodes the signature string by using the HMAC-SHA-512 algorithm over + the UTF-8-encoded string-to-sign. + + The UTF-8-encoded string-to-sign. + The HMAC-encoded signature string. + + + + Returns a that represents this instance. + + If set to true exports secrets. + + A that represents this instance. + + + + + Gets the name of the storage account associated with the specified credentials. + + The name of the account. + + + + Gets a value indicating whether the method should be called + to transform a resource URI to a URI that includes a token for a shared access signature. + + True for objects of type . + + + + Gets a value indicating whether a request can be signed under the Shared Key authentication + scheme using the specified credentials. + + False for objects of type . + + + + Gets a value indicating whether a request can be signed under the Shared Key Lite authentication + scheme using the specified credentials. + + False for objects of type . + + + + Gets a value indicating whether the method will return a valid + HMAC-encoded signature string when called using the specified credentials. + + False for objects of type . + + + + Gets the token. + + The token. + + + diff --git a/lib/Common.Logging.Log4Net.dll b/lib/Common.Logging.Log4Net.dll deleted file mode 100644 index 519caa6eb3d..00000000000 Binary files a/lib/Common.Logging.Log4Net.dll and /dev/null differ diff --git a/lib/Common.Logging.Log4Net.pdb b/lib/Common.Logging.Log4Net.pdb deleted file mode 100644 index b515fe186af..00000000000 Binary files a/lib/Common.Logging.Log4Net.pdb and /dev/null differ diff --git a/lib/Common.Logging.Log4Net.xml b/lib/Common.Logging.Log4Net.xml deleted file mode 100644 index 561a8dbab47..00000000000 --- a/lib/Common.Logging.Log4Net.xml +++ /dev/null @@ -1,218 +0,0 @@ - - - - Common.Logging.Log4Net - - - - - Routes log events to Common.Logging infrastructure. - - - To route all events logged using log4net to Common.Logging, you need to configure this appender as shown below: - - <log4net> - <appender name="CommonLoggingAppender" - type="Common.Logging.Log4Net.CommonLoggingAppender, Common.Logging.Log4Net"> - <layout type="log4net.Layout.PatternLayout, log4net"> - <param name="ConversionPattern" value="%level - %class.%method: %message" /> - </layout> - </appender> - - <root> - <level value="ALL" /> - <appender-ref ref="CommonLoggingAppender" /> - </root> - </log4net> - - - Erich Eichinger - - - - Gets the closest level supported by Common.Logging of the given log4net level - - - - - Sends the given log event to Common.Logging - - - - - Get or set the layout for this appender - - - - - Wrapper class that prevents exceptions from being rendered in the message - - - - - Concrete implementation of interface specific to log4net 1.2.10. - - - Log4net is capable of outputting extended debug information about where the current - message was generated: class name, method name, file, line, etc. Log4net assumes that the location - information should be gathered relative to where Debug() was called. - When using Common.Logging, Debug() is called in Common.Logging.Log4Net.Log4NetLogger. This means that - the location information will indicate that Common.Logging.Log4Net.Log4NetLogger always made - the call to Debug(). We need to know where Common.Logging.ILog.Debug() - was called. To do this we need to use the log4net.ILog.Logger.Log method and pass in a Type telling - log4net where in the stack to begin looking for location information. - - Gilles Bayon - Erich Eichinger - - - - Constructor - - - - - - Sends the message to the underlying log4net system. - - the level of this log event. - the message to log - the exception to log (may be null) - - - - Checks if this logger is enabled for the level. - - - - - Checks if this logger is enabled for the level. - - - - - Checks if this logger is enabled for the level. - - - - - Checks if this logger is enabled for the level. - - - - - Checks if this logger is enabled for the level. - - - - - Checks if this logger is enabled for the level. - - - - - Concrete subclass of ILoggerFactoryAdapter specific to log4net 1.2.10. - - - The following configuration property values may be configured: - - configType: INLINE|FILE|FILE-WATCH|EXTERNAL - configFile: log4net configuration file path in case of FILE or FILE-WATCH - - The configType values have the following implications: - - INLINE: simply calls XmlConfigurator.Configure() - FILE: calls XmlConfigurator.Configure(System.IO.FileInfo) using configFile. - FILE-WATCH: calls XmlConfigurator.ConfigureAndWatch(System.IO.FileInfo) using configFile. - EXTERNAL: does nothing and expects log4net to be configured elsewhere. - <any>: calls BasicConfigurator.Configure() - - - - The following snippet shows how to configure EntLib logging for Common.Logging: - - <configuration> - <configSections> - <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" /> - </configSections> - <common> - <logging> - <factoryAdapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net"> - <arg key="configType" value="FILE" /> - <arg key="configFile" value="~/log4net.config" /> - </factoryAdapter> - </logging> - </common> - </configuration> - - - Gilles Bayon - Erich Eichinger - - - - Constructor - - configuration properties, see for more. - - - - Constructor accepting configuration properties and an arbitrary - instance. - - configuration properties, see for more. - a log4net runtime adapter - - - - Create a ILog instance by name - - - - - - - Abstract interface to the underlying log4net runtime - - - - Calls - - - Calls - - - Calls - - - Calls - - - Calls - - - - - This namespace contains the implementations to plug log4net 1.2.10 into Common.Logging. - - For an example on how to configure - - Common.Logging to render its output to log4net, see . - log4net to render its output to Common.Logging use . - - - - - - - This assembly contains the adapter to the log4net 1.2.10 library - For an example on how to configure - - Common.Logging to render its output to log4net, see . - log4net to render its output to Common.Logging use . - - - - - - diff --git a/lib/Common.Logging.dll b/lib/Common.Logging.dll deleted file mode 100644 index 5c1feac985f..00000000000 Binary files a/lib/Common.Logging.dll and /dev/null differ diff --git a/lib/Common.Logging.pdb b/lib/Common.Logging.pdb deleted file mode 100644 index 2bc8a369d96..00000000000 Binary files a/lib/Common.Logging.pdb and /dev/null differ diff --git a/lib/Common.Logging.xml b/lib/Common.Logging.xml deleted file mode 100644 index 556632dc4eb..00000000000 --- a/lib/Common.Logging.xml +++ /dev/null @@ -1,3094 +0,0 @@ - - - - Common.Logging - - - - - Various utility methods for using during factory and logger instance configuration - - Erich Eichinger - - - - Initialize all members before any of this class' methods can be accessed (avoids beforeFieldInit) - - - - - Adds the parser to the list of known type parsers. - - - .NET intrinsic types are pre-registerd: short, int, long, float, double, decimal, bool - - - - - Retrieves the named value from the specified . - - may be null - the value's key - if is not null, the value returned by values[name]. null otherwise. - - - - Retrieves the named value from the specified . - - may be null - the value's key - the default value, if not found - if is not null, the value returned by values[name]. null otherwise. - - - - Returns the first nonnull, nonempty value among its arguments. - - - Returns null, if the initial list was null or empty. - - - - - - Returns the first nonnull, nonempty value among its arguments. - - - Also - - - - - Tries parsing into an enum of the type of . - - the default value to return if parsing fails - the string value to parse - the successfully parsed value, otherwise. - - - - Tries parsing into the specified return type. - - the default value to return if parsing fails - the string value to parse - the successfully parsed value, otherwise. - - - - Throws a if is null. - - - - - Throws a if is null. - - - - - Throws a if an object of type is not - assignable to type . - - - - - Throws a if an object of type is not - assignable to type . - - - - - Ensures any exception thrown by the given is wrapped with an - . - - - If already throws a ConfigurationException, it will not be wrapped. - - the action to execute - the message to be set on the thrown - args to be passed to to format the message - - - - Ensures any exception thrown by the given is wrapped with an - . - - - If already throws a ConfigurationException, it will not be wrapped. - - the action to execute - the message to be set on the thrown - args to be passed to to format the message - - - - A delegate converting a string representation into the target type - - - - - An anonymous action delegate with no arguments and no return value. - - - - - - An anonymous action delegate with no arguments and no return value. - - - - - - Implementation of that uses the standard .NET - configuration APIs, ConfigurationSettings in 1.x and ConfigurationManager in 2.0 - - Mark Pollack - - - - Interface for basic operations to read .NET application configuration information. - - Provides a simple abstraction to handle BCL API differences between .NET 1.x and 2.0. Also - useful for testing scenarios. - Mark Pollack - - - - Parses the configuration section and returns the resulting object. - - -

    - Primary purpose of this method is to allow us to parse and - load configuration sections using the same API regardless - of the .NET framework version. -

    -
    - Name of the configuration section. - Object created by a corresponding . - -
    - - - Parses the configuration section and returns the resulting object. - - Name of the configuration section. - - Object created by a corresponding . - - -

    - Primary purpose of this method is to allow us to parse and - load configuration sections using the same API regardless - of the .NET framework version. -

    -
    - -
    - - - Container used to hold configuration information from config file. - - Gilles Bayon - - - - - - - The type - that will be used for creating - - - Additional user supplied properties that are passed to the - 's constructor. - - - - - The type that will be used for creating - instances. - - - - - Additional user supplied properties that are passed to the 's constructor. - - - - - This namespace contains various utility classes. - - - - - An implementation of that caches loggers handed out by this factory. - - - Implementors just need to override . - - Erich Eichinger - - - - LoggerFactoryAdapter interface is used internally by LogManager - Only developers wishing to write new Common.Logging adapters need to - worry about this interface. - - Gilles Bayon - - - - Get a ILog instance by type. - - The type to use for the logger - - - - - Get a ILog instance by name. - - The name of the logger - - - - - Creates a new - - - - - - Purges all loggers from cache - - - - - Create the specified named logger instance - - - Derived factories need to implement this method to create the - actual logger instance. - - - - - Get a ILog instance by . - - Usually the of the current class. - - An ILog instance either obtained from the internal cache or created by a call to . - - - - - Get a ILog instance by name. - - Usually a 's Name or FullName property. - - An ILog instance either obtained from the internal cache or created by a call to . - - - - - Get or create a ILog instance by name. - - Usually a 's Name or FullName property. - - An ILog instance either obtained from the internal cache or created by a call to . - - - - - Provides base implementation common for most logger adapters - - Erich Eichinger - - - - A simple logging interface abstracting logging APIs. - - - - Implementations should defer calling a message's until the message really needs - to be logged to avoid performance penalties. - - - Each log method offers to pass in a instead of the actual message. - Using this style has the advantage to defer possibly expensive message argument evaluation and formatting (and formatting arguments!) until the message gets - actually logged. If the message is not logged at all (e.g. due to settings), - you won't have to pay the peformance penalty of creating the message. - - - - The example below demonstrates using callback style for creating the message, where the call to the - and the underlying only happens, if level is enabled: - - Log.Debug( m=>m("result is {0}", random.NextDouble()) ); - Log.Debug(delegate(m) { m("result is {0}", random.NextDouble()); }); - - - - Mark Pollack - Bruno Baia - Erich Eichinger - - - - Log a message object with the level. - - The message object to log. - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack trace. - - - - Log a message with the level. - - The format of the message object to log. - the list of format arguments - - - - Log a message with the level. - - The format of the message object to log. - The exception to log. - the list of format arguments - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - The exception to log. - - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack trace. - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack trace. - - - - Log a message object with the level. - - The message object to log. - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack trace. - - - - Log a message with the level. - - The format of the message object to log. - the list of format arguments - - - - Log a message with the level. - - The format of the message object to log. - The exception to log. - the list of format arguments - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - The exception to log. - - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack trace. - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Debug. - - - - Log a message object with the level. - - The message object to log. - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack trace. - - - - Log a message with the level. - - The format of the message object to log. - the list of format arguments - - - - Log a message with the level. - - The format of the message object to log. - The exception to log. - the list of format arguments - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - The exception to log. - - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack trace. - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Info. - - - - Log a message object with the level. - - The message object to log. - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack trace. - - - - Log a message with the level. - - The format of the message object to log. - the list of format arguments - - - - Log a message with the level. - - The format of the message object to log. - The exception to log. - the list of format arguments - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - The exception to log. - - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack trace. - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Warn. - - - - Log a message object with the level. - - The message object to log. - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack trace. - - - - Log a message with the level. - - The format of the message object to log. - the list of format arguments - - - - Log a message with the level. - - The format of the message object to log. - The exception to log. - the list of format arguments - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - The exception to log. - - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack trace. - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Error. - - - - Log a message object with the level. - - The message object to log. - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack trace. - - - - Log a message with the level. - - The format of the message object to log. - the list of format arguments - - - - Log a message with the level. - - The format of the message object to log. - The exception to log. - the list of format arguments - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - The exception to log. - - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack trace. - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Fatal. - - - - Checks if this logger is enabled for the level. - - - - - Checks if this logger is enabled for the level. - - - - - Checks if this logger is enabled for the level. - - - - - Checks if this logger is enabled for the level. - - - - - Checks if this logger is enabled for the level. - - - - - Checks if this logger is enabled for the level. - - - - - Holds the method for writing a message to the log system. - - - - - Creates a new logger instance using for - writing log events to the underlying log system. - - - - - - Override this method to use a different method than - for writing log events to the underlying log system. - - - Usually you don't need to override thise method. The default implementation returns - null to indicate that the default handler should be - used. - - - - - Actually sends the message to the underlying log system. - - the level of this log event. - the message to log - the exception to log (may be null) - - - - Log a message object with the level. - - The message object to log. - - - - Log a message object with the level including - the stack trace of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack trace. - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - The exception to log. - - - - - Log a message with the level. - - The format of the message object to log. - the list of format arguments - - - - Log a message with the level. - - The format of the message object to log. - The exception to log. - the list of format arguments - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack trace. - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack trace. - - - - Log a message object with the level. - - The message object to log. - - - - Log a message object with the level including - the stack Debug of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack Debug. - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - The exception to log. - - - - - Log a message with the level. - - The format of the message object to log. - the list of format arguments - - - - Log a message with the level. - - The format of the message object to log. - The exception to log. - the list of format arguments - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Debug. - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Debug. - - - - Log a message object with the level. - - The message object to log. - - - - Log a message object with the level including - the stack Info of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack Info. - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - - - - - Log a message with the level. - - An that supplies culture-specific formatting information. - The format of the message object to log. - The exception to log. - - - - - Log a message with the level. - - The format of the message object to log. - the list of format arguments - - - - Log a message with the level. - - The format of the message object to log. - The exception to log. - the list of format arguments - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Info. - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Info. - - - - Log a message object with the level. - - The message object to log. - - - - Log a message object with the level including - the stack Warn of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack Warn. - - - - Log a message with the level. - - An that supplies culture-specific formatting Warnrmation. - The format of the message object to log. - - - - - Log a message with the level. - - An that supplies culture-specific formatting Warnrmation. - The format of the message object to log. - The exception to log. - - - - - Log a message with the level. - - The format of the message object to log. - the list of format arguments - - - - Log a message with the level. - - The format of the message object to log. - The exception to log. - the list of format arguments - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Warn. - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Warn. - - - - Log a message object with the level. - - The message object to log. - - - - Log a message object with the level including - the stack Error of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack Error. - - - - Log a message with the level. - - An that supplies culture-specific formatting Errorrmation. - The format of the message object to log. - - - - - Log a message with the level. - - An that supplies culture-specific formatting Errorrmation. - The format of the message object to log. - The exception to log. - - - - - Log a message with the level. - - The format of the message object to log. - the list of format arguments - - - - Log a message with the level. - - The format of the message object to log. - The exception to log. - the list of format arguments - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Error. - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Error. - - - - Log a message object with the level. - - The message object to log. - - - - Log a message object with the level including - the stack Fatal of the passed - as a parameter. - - The message object to log. - The exception to log, including its stack Fatal. - - - - Log a message with the level. - - An that supplies culture-specific formatting Fatalrmation. - The format of the message object to log. - - - - - Log a message with the level. - - An that supplies culture-specific formatting Fatalrmation. - The format of the message object to log. - The exception to log. - - - - - Log a message with the level. - - The format of the message object to log. - the list of format arguments - - - - Log a message with the level. - - The format of the message object to log. - The exception to log. - the list of format arguments - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Fatal. - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Log a message with the level using a callback to obtain the message - - - Using this method avoids the cost of creating a message and evaluating message arguments - that probably won't be logged due to loglevel settings. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Fatal. - - - - Checks if this logger is enabled for the level. - - - Override this in your derived class to comply with the underlying logging system - - - - - Checks if this logger is enabled for the level. - - - Override this in your derived class to comply with the underlying logging system - - - - - Checks if this logger is enabled for the level. - - - Override this in your derived class to comply with the underlying logging system - - - - - Checks if this logger is enabled for the level. - - - Override this in your derived class to comply with the underlying logging system - - - - - Checks if this logger is enabled for the level. - - - Override this in your derived class to comply with the underlying logging system - - - - - Checks if this logger is enabled for the level. - - - Override this in your derived class to comply with the underlying logging system - - - - - Represents a method responsible for writing a message to the log system. - - - - - This namespace contains convenience base classes for implementing your own s. - - - - - Abstract class providing a standard implementation of simple loggers. - - Erich Eichinger - - - - Creates and initializes a the simple logger. - - The name, usually type name of the calling class, of the logger. - The current logging threshold. Messages recieved that are beneath this threshold will not be logged. - Include level in the log message. - Include the current time in the log message. - Include the instance name in the log message. - The date and time format to use in the log message. - - - - Appends the formatted message to the specified . - - the that receíves the formatted message. - - - - - - - Determines if the given log level is currently enabled. - - - - - - - The name of the logger. - - - - - Include the current log level in the log message. - - - - - Include the current time in the log message. - - - - - Include the instance name in the log message. - - - - - The current logging threshold. Messages recieved that are beneath this threshold will not be logged. - - - - - The date and time format to use in the log message. - - - - - Determines Whether is set. - - - - - Returns if the current is greater than or - equal to . If it is, all messages will be sent to . - - - - - Returns if the current is greater than or - equal to . If it is, all messages will be sent to . - - - - - Returns if the current is greater than or - equal to . If it is, only messages with a of - , , , and - will be sent to . - - - - - Returns if the current is greater than or - equal to . If it is, only messages with a of - , , and - will be sent to . - - - - - Returns if the current is greater than or - equal to . If it is, only messages with a of - and will be sent to . - - - - - Returns if the current is greater than or - equal to . If it is, only messages with a of - will be sent to . - - - - - Base factory implementation for creating simple instances. - - Default settings are LogLevel.All, showDateTime = true, showLogName = true, and no DateTimeFormat. - The keys in the NameValueCollection to configure this adapter are the following - - level - showDateTime - showLogName - dateTimeFormat - - - - - Gilles Bayon - Mark Pollack - Erich Eichinger - - - - Initializes a new instance of the class. - - - Looks for level, showDateTime, showLogName, dateTimeFormat items from - for use when the GetLogger methods are called. - for more information on how to use the - standard .NET application configuraiton file (App.config/Web.config) - to configure this adapter. - - The name value collection, typically specified by the user in - a configuration section named common/logging. - - - - Create the specified logger instance - - - - - Derived factories need to implement this method to create the - actual logger instance. - - a new logger instance. Must never be null! - - - - The default to use when creating new instances. - - - - - The default setting to use when creating new instances. - - - - - The default setting to use when creating new instances. - - - - - The default setting to use when creating new instances. - - - - - The default setting to use when creating new instances. - - - - - A logger created by that - sends all log events to the owning adapter's - - Erich Eichinger - - - - The adapter that created this logger instance. - - - - - Allows to retrieve the last logged event instance captured by this logger - - - - - Create a new logger instance. - - - - - Create a new and send it to - - - - - - - - A logging event captured by - - Erich Eichinger - - - - The logger that logged this event - - - - - The level used to log this event - - - - - The raw message object - - - - - A logged exception - - - - - Create a new event instance - - - - - Retrieves the formatted message text - - - - - An adapter, who's loggers capture all log events and send them to . - Retrieve the list of log events from . - - - This logger factory is mainly for debugging and test purposes. - - This is an example how you might use this adapter for testing: - - // configure for capturing - CapturingLoggerFactoryAdapter adapter = new CapturingLoggerFactoryAdapter(); - LogManager.Adapter = adapter; - - // reset capture state - adapter.Clear(); - // log something - ILog log = LogManager.GetCurrentClassLogger(); - log.DebugFormat("Current Time:{0}", DateTime.Now); - - // check logged data - Assert.AreEqual(1, adapter.LoggerEvents.Count); - Assert.AreEqual(LogLevel.Debug, adapter.LastEvent.Level); - - - - Erich Eichinger - - - - Clears all captured events - - - - - Resets the to null. - - - - - Holds the list of logged events. - - - To access this collection in a multithreaded application, put a lock on the list instance. - - - - - instances send their captured log events to this method. - - - - - Get a instance for the given type. - - - - - Get a instance for the given name. - - - - - Holds the last log event received from any of this adapter's loggers. - - - - - A implementation sending all System.Diagnostics.Trace output to - the Common.Logging infrastructure. - - - This listener captures all output sent by calls to System.Diagnostics.Trace and - and and sends it to an instance.
    - The instance to be used is obtained by calling - . The name of the logger is created by passing - this listener's and any source or category passed - into this listener (see or for example). -
    - - The snippet below shows how to add and configure this listener to your app.config: - - <system.diagnostics> - <sharedListeners> - <add name="Diagnostics" - type="Common.Logging.Simple.CommonLoggingTraceListener, Common.Logging" - initializeData="DefaultTraceEventType=Information; LoggerNameFormat={listenerName}.{sourceName}"> - <filter type="System.Diagnostics.EventTypeFilter" initializeData="Information"/> - </add> - </sharedListeners> - <trace> - <listeners> - <add name="Diagnostics" /> - </listeners> - </trace> - </system.diagnostics> - - - Erich Eichinger -
    - - - Creates a new instance with the default name "Diagnostics" and "Trace". - - - - - Creates a new instance initialized with properties from the . string. - - - is a semicolon separated string of name/value pairs, where each pair has - the form key=value. E.g. - "Name=MyLoggerName;LogLevel=Debug" - - a semicolon separated list of name/value pairs. - - - - Creates a new instance initialized with the specified properties. - - name/value configuration properties. - - - - Logs the given message to the Common.Logging infrastructure. - - the eventType - the name or category name passed into e.g. . - the id of this event - the message format - the message arguments - - - - Writes message to logger provided by . - - - - - Writes message to logger provided by . - - - - - Writes message to logger provided by . - - - - - Writes message to logger provided by . - - - - - Writes message to logger provided by . - - - - - Writes message to logger provided by . - - - - - Writes message to logger provided by . - - - - - Writes message to logger provided by - - - - - Writes message to logger provided by - - - - - Writes message to logger provided by - - - - - Writes message to logger provided by - - - - - Writes message to logger provided by - - - - - Writes message to logger provided by - - - - - Sets the default to use for logging - all events emitted by .Write(...) and - .WriteLine(...) methods. - - - This listener captures all output sent by calls to and - sends it to an instance using the specified - on . - - - - - Format to use for creating the logger name. Defaults to "{listenerName}.{sourceName}". - - - Available placeholders are: - - {listenerName}: the configured name of this listener instance. - {sourceName}: the trace source name an event originates from (see e.g. . - - - - - - Sends log messages to . - - Gilles Bayon - - - - Creates and initializes a logger that writes messages to . - - The name, usually type name of the calling class, of the logger. - The current logging threshold. Messages recieved that are beneath this threshold will not be logged. - Include the current log level in the log message. - Include the current time in the log message. - Include the instance name in the log message. - The date and time format to use in the log message. - - - - Do the actual logging by constructing the log message using a then - sending the output to . - - The of the message. - The log message. - An optional associated with the message. - - - - Factory for creating instances that write data to . - - - - - Gilles Bayon - Mark Pollack - Erich Eichinger - - - - Initializes a new instance of the class using default - settings. - - - - - Initializes a new instance of the class. - - - Looks for level, showDateTime, showLogName, dateTimeFormat items from - for use when the GetLogger methods are called. - for more information on how to use the - standard .NET application configuraiton file (App.config/Web.config) - to configure this adapter. - - The name value collection, typically specified by the user in - a configuration section named common/logging. - - - - Creates a new instance. - - - - - This namespace contains out-of-the-box adapters to intrinsic systems, namely - and . - - - - - Silently ignores all log messages. - - Gilles Bayon - Erich Eichinger - - - - Ignores message. - - - - - - Ignores message. - - - - - - - Ignores message. - - The format of the message object to log. - - - - - Ignores message. - - The format of the message object to log. - The exception to log. - the list of message format arguments - - - - Ignores message. - - An that supplies culture-specific formatting information. - The format of the message object to log. - the list of message format arguments - - - - Ignores message. - - An that supplies culture-specific formatting information. - The format of the message object to log. - The exception to log. - the list of message format arguments - - - - Ignores message. - - A callback used by the logger to obtain the message if log level is matched - - - - Ignores message. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack trace. - - - - Ignores message. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Ignores message. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack trace. - - - - Ignores message. - - - - - - Ignores message. - - - - - - - Ignores message. - - The format of the message object to log. - - - - - Ignores message. - - The format of the message object to log. - The exception to log. - the list of message format arguments - - - - Ignores message. - - An that supplies culture-specific formatting information. - The format of the message object to log. - the list of message format arguments - - - - Ignores message. - - An that supplies culture-specific formatting information. - The format of the message object to log. - The exception to log. - the list of message format arguments - - - - Ignores message. - - A callback used by the logger to obtain the message if log level is matched - - - - Ignores message. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Debug. - - - - Ignores message. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Ignores message. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Debug. - - - - Ignores message. - - - - - - Ignores message. - - - - - - - Ignores message. - - The format of the message object to log. - - - - - Ignores message. - - The format of the message object to log. - The exception to log. - the list of message format arguments - - - - Ignores message. - - An that supplies culture-specific formatting information. - The format of the message object to log. - the list of message format arguments - - - - Ignores message. - - An that supplies culture-specific formatting information. - The format of the message object to log. - The exception to log. - the list of message format arguments - - - - Ignores message. - - A callback used by the logger to obtain the message if log level is matched - - - - Ignores message. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Info. - - - - Ignores message. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Ignores message. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Info. - - - - Ignores message. - - - - - - Ignores message. - - - - - - - Ignores message. - - The format of the message object to log. - - - - - Ignores message. - - The format of the message object to log. - The exception to log. - the list of message format arguments - - - - Ignores message. - - An that supplies culture-specific formatting Warnrmation. - The format of the message object to log. - the list of message format arguments - - - - Ignores message. - - An that supplies culture-specific formatting Warnrmation. - The format of the message object to log. - The exception to log. - the list of message format arguments - - - - Ignores message. - - A callback used by the logger to obtain the message if log level is matched - - - - Ignores message. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Warn. - - - - Ignores message. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Ignores message. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Warn. - - - - Ignores message. - - - - - - Ignores message. - - - - - - - Ignores message. - - The format of the message object to log. - - - - - Ignores message. - - The format of the message object to log. - The exception to log. - the list of message format arguments - - - - Ignores message. - - An that supplies culture-specific formatting Errorrmation. - The format of the message object to log. - the list of message format arguments - - - - Ignores message. - - An that supplies culture-specific formatting Errorrmation. - The format of the message object to log. - The exception to log. - the list of message format arguments - - - - Ignores message. - - A callback used by the logger to obtain the message if log level is matched - - - - Ignores message. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Error. - - - - Ignores message. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Ignores message. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Error. - - - - Ignores message. - - - - - - Ignores message. - - - - - - - Ignores message. - - The format of the message object to log. - - - - - Ignores message. - - The format of the message object to log. - The exception to log. - the list of message format arguments - - - - Ignores message. - - An that supplies culture-specific formatting Fatalrmation. - The format of the message object to log. - the list of message format arguments - - - - Ignores message. - - An that supplies culture-specific formatting Fatalrmation. - The format of the message object to log. - The exception to log. - the list of message format arguments - - - - Ignores message. - - A callback used by the logger to obtain the message if log level is matched - - - - Ignores message. - - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Fatal. - - - - Ignores message. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - - - - Ignores message. - - An that supplies culture-specific formatting information. - A callback used by the logger to obtain the message if log level is matched - The exception to log, including its stack Fatal. - - - - Always returns . - - - - - Always returns . - - - - - Always returns . - - - - - Always returns . - - - - - Always returns . - - - - - Always returns . - - - - - Factory for creating instances that silently ignores - logging requests. - - - - Gilles Bayon - - - - Constructor - - - - - Constructor - - - - - Get a ILog instance by type - - - - - - - Get a ILog instance by type name - - - - - - - Logger sending everything to the trace output stream using . - - - Beware not to use in combination with this logger as - this would result in an endless loop for obvious reasons! - - - - Gilles Bayon - Erich Eichinger - - - - Creates a new TraceLogger instance. - - whether to use or for logging. - the name of this logger - the default log level to use - Include the current log level in the log message. - Include the current time in the log message. - Include the instance name in the log message. - The date and time format to use in the log message. - - - - Determines if the given log level is currently enabled. - checks if is true. - - - - - Do the actual logging. - - - - - - - - Called after deserialization completed. - - - - - Used to defer message formatting until it is really needed. - - - This class also improves performance when multiple - s are configured. - - - - - Factory for creating instances that send - everything to the output stream. - - - Beware not to use in combination with this logger factory - as this would result in an endless loop for obvious reasons! - - - - - Gilles Bayon - Mark Pollack - Erich Eichinger - - - - Initializes a new instance of the class using default settings. - - - - - Initializes a new instance of the class. - - - Looks for level, showDateTime, showLogName, dateTimeFormat items from - for use when the GetLogger methods are called. - for more information on how to use the - standard .NET application configuraiton file (App.config/Web.config) - to configure this adapter. - - The name value collection, typically specified by the user in - a configuration section named common/logging. - - - - Creates a new instance. - - - - - Whether to use .TraceXXXX(string,object[]) methods for logging - or . - - - - - The exception that is thrown when a configuration system error has occurred with Common.Logging - - Mark Pollack - - - Creates a new instance of the ObjectsException class. - - - - Creates a new instance of the ConfigurationException class. with the specified message. - - - A message about the exception. - - - - - Creates a new instance of the ConfigurationException class with the specified message - and root cause. - - - A message about the exception. - - - The root exception that is being wrapped. - - - - - Creates a new instance of the ConfigurationException class. - - - The - that holds the serialized object data about the exception being thrown. - - - The - that contains contextual information about the source or destination. - - - - - Used in an application's configuration file (App.Config or Web.Config) to configure the logging subsystem. - - - An example configuration section that writes log messages to the Console using the - built-in Console Logger. - - <configuration> - <configSections> - <sectionGroup name="common"> - <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" /> - </sectionGroup> - </configSections> - <common> - <logging> - <factoryAdapter type="Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter, Common.Logging"> - <arg key="showLogName" value="true" /> - <arg key="showDataTime" value="true" /> - <arg key="level" value="ALL" /> - <arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:fff" /> - </factoryAdapter> - </logging> - </common> - </configuration> - - - - - - Ensure static fields get initialized before any class member - can be accessed (avoids beforeFieldInit) - - - - - Constructor - - - - - Retrieves the of the logger the use by looking at the logFactoryAdapter element - of the logging configuration element. - - - - A object containing the specified type that implements - along with zero or more properties that will be - passed to the logger factory adapter's constructor as an . - - - - - Verifies that the logFactoryAdapter element appears once in the configuration section. - - settings of a parent section - atm this must always be null - Additional information about the configuration process. - The configuration section to apply an XPath query too. - - A object containing the specified logFactoryAdapter type - along with user supplied configuration properties. - - - - - Verifies that the logFactoryAdapter element appears once in the configuration section. - - The parent of the current item. - Additional information about the configuration process. - The configuration section to apply an XPath query too. - - A object containing the specified logFactoryAdapter type - along with user supplied configuration properties. - - - - - The type of method that is passed into e.g. - and allows the callback method to "submit" it's message to the underlying output system. - - the format argument as in - the argument list as in - - Erich Eichinger - - - - The 7 possible logging levels - - Gilles Bayon - - - - All logging levels - - - - - A trace logging level - - - - - A debug logging level - - - - - A info logging level - - - - - A warn logging level - - - - - An error logging level - - - - - A fatal logging level - - - - - Do not log anything. - - - - - Use the LogManager's or - methods to obtain instances for logging. - - - For configuring the underlying log system using application configuration, see the example - at . - For configuring programmatically, see the example section below. - - - The example below shows the typical use of LogManager to obtain a reference to a logger - and log an exception: - - - ILog log = LogManager.GetLogger(this.GetType()); - ... - try - { - /* .... */ - } - catch(Exception ex) - { - log.ErrorFormat("Hi {0}", ex, "dude"); - } - - - The example below shows programmatic configuration of the underlying log system: - - - // create properties - NameValueCollection properties = new NameValueCollection(); - properties["showDateTime"] = "true"; - - // set Adapter - Common.Logging.LogManager.Adapter = new - Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter(properties); - - - - - - - - Gilles Bayon - - - - The name of the default configuration section to read settings from. - - - You can always change the source of your configuration settings by setting another instance - on . - - - - - Performs static 1-time init of LogManager by calling - - - - - Reset the infrastructure to its default settings. This means, that configuration settings - will be re-read from section <common/logging> of your app.config. - - - This is mainly used for unit testing, you wouldn't normally use this in your applications.
    - Note: instances already handed out from this LogManager are not(!) affected. - Resetting LogManager only affects new instances being handed out. -
    -
    - - - Reset the infrastructure to its default settings. This means, that configuration settings - will be re-read from section <common/logging> of your app.config. - - - This is mainly used for unit testing, you wouldn't normally use this in your applications.
    - Note: instances already handed out from this LogManager are not(!) affected. - Resetting LogManager only affects new instances being handed out. -
    - - the instance to obtain settings for - re-initializing the LogManager. - -
    - - - Gets the logger by calling - on the currently configured using the type of the calling class. - - - This method needs to inspect the in order to determine the calling - class. This of course comes with a performance penalty, thus you shouldn't call it too - often in your application. - - - the logger instance obtained from the current - - - - Gets the logger by calling - on the currently configured using the specified type. - - the logger instance obtained from the current - - - - Gets the logger by calling - on the currently configured using the specified type. - - The type. - the logger instance obtained from the current - - - - Gets the logger by calling - on the currently configured using the specified name. - - The name. - the logger instance obtained from the current - - - - Builds the logger factory adapter. - - a factory adapter instance. Is never null. - - - - Builds a instance from the given - using . - - - the instance. Is never null - - - - Gets the configuration reader used to initialize the LogManager. - - Primarily used for testing purposes but maybe useful to obtain configuration - information from some place other than the .NET application configuration file. - The configuration reader. - - - - Gets or sets the adapter. - - The adapter. - - - - This namespace contains all core classes making up the Common.Logging framework. - - - - - This assembly contains the core functionality of the Common.Logging framework. - In particular, checkout and for usage information. - - - - - Indicates classes or members to be ignored by NCover - - - Note, the name is chosen, because TestDriven.NET uses it as //ea argument to "Test With... Coverage" - - Erich Eichinger - - - -

    Overview

    - - There are a variety of logging implementations for .NET currently in use, log4net, Enterprise - Library Logging, NLog, to name the most popular. The downside of having differerent implementation - is that they do not share a common interface and therefore impose a particular logging - implementation on the users of your library. To solve this dependency problem the Common.Logging - library introduces a simple abstraction to allow you to select a specific logging implementation at - runtime. - - - The library is based on work done by the developers of IBatis.NET and it's usage is inspired by - log4net. Many thanks to the developers of those projects! - -

    Usage

    - - The core logging library Common.Logging provides the base logging interface as - well as the global that you use to instrument your code: - - - ILog log = LogManager.GetLogger(this.GetType()); - - log.DebugFormat("Hi {0}", "dude"); - - - To output the information logged, you need to tell Common.Logging, what underlying logging system - to use. Common.Logging already includes simple console and trace based logger implementations - usable out of the box. Adding the following configuration snippet to your app.config causes - Common.Logging to output all information to the console: - - - <configuration> - <configSections> - <sectionGroup name="common"> - <section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" /> - </sectionGroup> - </configSections> - - <common> - <logging> - <factoryAdapter type="Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter, Common.Logging"> - <arg key="level" value="DEBUG" /> - </factoryAdapter> - </logging> - </common> - </configuration> - -

    Customizing

    - - In the case you want to integrate your own logging system that is not supported by Common.Logging yet, it is easily - possible to implement your own plugin by implementing . - For convenience there is a base implementation available that usually - makes implementing your own adapter a breeze. - -

    <system.diagnostics> Integration

    - - If your code already uses the .NET framework's built-in System.Diagnostics.Trace - system, you can use to redirect all trace output to the - Common.Logging infrastructure. - -
    -
    -
    -
    diff --git a/lib/Interop.MSMQ.dll b/lib/Interop.MSMQ.dll index 0c99f76d4e3..43510978b7b 100644 Binary files a/lib/Interop.MSMQ.dll and b/lib/Interop.MSMQ.dll differ diff --git a/lib/Mvc3/System.Web.Mvc.xml b/lib/Mvc3/System.Web.Mvc.xml index af648fcbf71..b2b677d8bc6 100644 --- a/lib/Mvc3/System.Web.Mvc.xml +++ b/lib/Mvc3/System.Web.Mvc.xml @@ -1,9395 +1,9395 @@ - - - - System.Web.Mvc - - - - Represents an attribute that specifies which HTTP verbs an action method will respond to. - - - Initializes a new instance of the class by using a list of HTTP verbs that the action method will respond to. - The HTTP verbs that the action method will respond to. - The parameter is null or zero length. - - - Initializes a new instance of the class using the HTTP verbs that the action method will respond to. - The HTTP verbs that the action method will respond to. - - - Determines whether the specified method information is valid for the specified controller context. - true if the method information is valid; otherwise, false. - The controller context. - The method information. - The parameter is null. - - - Gets or sets the list of HTTP verbs that the action method will respond to. - The list of HTTP verbs that the action method will respond to. - - - Provides information about an action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - - - Gets the name of the action method. - The name of the action method. - - - Gets the controller descriptor. - The controller descriptor. - - - Executes the action method by using the specified parameters and controller context. - The result of executing the action method. - The controller context. - The parameters of the action method. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes of the specified type exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - The parameter is null. - - - Returns the filters that are associated with this action method. - The filters that are associated with this action method. - - - Returns the parameters of the action method. - The parameters of the action method. - - - Returns the action-method selectors. - The action-method selectors. - - - Determines whether one or more instances of the specified attribute type are defined for this member. - true if is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The parameter is null. - - - Gets the unique ID for the action descriptor using lazy initialization. - The unique ID. - - - Provides the context for the ActionExecuted method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The controller context. - The action method descriptor. - true if the action is canceled. - The exception object. - The parameter is null. - - - Gets or sets the action descriptor. - The action descriptor. - - - Gets or sets a value that indicates that this object is canceled. - true if the context canceled; otherwise, false. - - - Gets or sets the exception that occurred during the execution of the action method, if any. - The exception that occurred during the execution of the action method. - - - Gets or sets a value that indicates whether the exception is handled. - true if the exception is handled; otherwise, false. - - - Gets or sets the result returned by the action method. - The result returned by the action method. - - - Provides the context for the ActionExecuting method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified controller context, action descriptor, and action-method parameters. - The controller context. - The action descriptor. - The action-method parameters. - The or parameter is null. - - - Gets or sets the action descriptor. - The action descriptor. - - - Gets or sets the action-method parameters. - The action-method parameters. - - - Gets or sets the result that is returned by the action method. - The result that is returned by the action method. - - - Represents the base class for filter attributes. - - - Initializes a new instance of the class. - - - Called by the ASP.NET MVC framework after the action method executes. - The filter context. - - - Called by the ASP.NET MVC framework before the action method executes. - The filter context. - - - Called by the ASP.NET MVC framework after the action result executes. - The filter context. - - - Called by the ASP.NET MVC framework before the action result executes. - The filter context. - - - Represents an attribute that is used to influence the selection of an action method. - - - Initializes a new instance of the class. - - - Determines whether the action method selection is valid for the specified controller context. - true if the action method selection is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Represents an attribute that is used for the name of an action. - - - Initializes a new instance of the class. - Name of the action. - The parameter is null or empty. - - - Determines whether the action name is valid within the specified controller context. - true if the action name is valid within the specified controller context; otherwise, false. - The controller context. - The name of the action. - Information about the action method. - - - Gets or sets the name of the action. - The name of the action. - - - Represents an attribute that affects the selection of an action method. - - - Initializes a new instance of the class. - - - Determines whether the action name is valid in the specified controller context. - true if the action name is valid in the specified controller context; otherwise, false. - The controller context. - The name of the action. - Information about the action method. - - - Encapsulates the result of an action method and is used to perform a framework-level operation on behalf of the action method. - - - Initializes a new instance of the class. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - - - Represents a delegate that contains the logic for selecting an action method. - true if an action method was successfully selected; otherwise, false. - The current HTTP request context. - - - Provides a class that implements the interface in order to support additional metadata. - - - Initializes a new instance of the class. - The name of the model metadata. - The value of the model metadata. - - - Gets the name of the additional metadata attribute. - The name of the of the additional metadata attribute. - - - Provides metadata to the model metadata creation process. - - - Gets the type of the of the additional metadata attribute. - The type of the of the additional metadata attribute. - - - Gets the value of the of the additional metadata attribute. - The value of the of the additional metadata attribute. - - - Represents support for rendering HTML in AJAX scenarios within a view. - - - Initializes a new instance of the class using the specified view context and view data container. - The view context. - The view data container. - One or both of the parameters is null. - - - Initializes a new instance of the class by using the specified view context, view data container, and route collection. - The view context. - The view data container. - The URL route collection. - One or more of the parameters is null. - - - Gets or sets the root path for the location to use for globalization script files. - The location of the folder where globalization script files are stored. The default location is "~/Scripts/Globalization". - - - Serializes the specified message and returns the resulting JSON-formatted string. - The serialized message as a JSON-formatted string. - The message to serialize. - - - Gets the collection of URL routes for the application. - The collection of routes for the application. - - - Gets the context information about the view. - The context of the view. - - - Gets the current view data dictionary. - The view data dictionary. - - - Gets the view data container. - The view data container. - - - Represents support for rendering HTML in AJAX scenarios within a strongly typed view. - The type of the model. - - - Initializes a new instance of the class by using the specified view context and view data container. - The view context. - The view data container. - - - Initializes a new instance of the class by using the specified view context, view data container, and URL route collection. - The view context. - The view data container. - The URL route collection. - - - Gets the strongly typed version of the view data dictionary. - The strongly typed data dictionary of the view. - - - Represents a class that extends the class by adding the ability to determine whether an HTTP request is an AJAX request. - - - - Allows a request to include HTML markup during model binding by skipping request validation for the property. (It is strongly recommended that your application explicitly check all models where you disable request validation in order to prevent script exploits.) - - - Initializes a new instance of the class. - - - This method supports the ASP.NET MVC validation infrastructure and is not intended to be used directly from your code. - The model metadata. - - - Provides a way to register one or more areas in an ASP.NET MVC application. - - - Initializes a new instance of the class. - - - Gets the name of the area to register. - The name of the area to register. - - - Registers all areas in an ASP.NET MVC application. - - - Registers all areas in an ASP.NET MVC application by using the specified user-defined information. - An object that contains user-defined information to pass to the area. - - - Registers an area in an ASP.NET MVC application using the specified area's context information. - Encapsulates the information that is required in order to register the area. - - - Encapsulates the information that is required in order to register an area within an ASP.NET MVC application. - - - Initializes a new instance of the class using the specified area name and routes collection. - The name of the area to register. - The collection of routes for the application. - - - Initializes a new instance of the class using the specified area name, routes collection, and user-defined data. - The name of the area to register. - The collection of routes for the application. - An object that contains user-defined information to pass to the area. - - - Gets the name of the area to register. - The name of the area to register. - - - Maps the specified URL route and associates it with the area that is specified by the property. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values and constraint. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify valid values for a URL parameter. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values, constraints, and namespaces. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify valid values for a URL parameter. - An enumerable set of namespaces for the application. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values and namespaces. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - An enumerable set of namespaces for the application. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified namespaces. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An enumerable set of namespaces for the application. - The parameter is null. - - - Gets the namespaces for the application. - An enumerable set of namespaces for the application. - - - Gets a collection of defined routes for the application. - A collection of defined routes for the application. - - - Gets an object that contains user-defined information to pass to the area. - An object that contains user-defined information to pass to the area. - - - Provides an abstract class to implement a metadata provider. - - - Called from constructors in a derived class to initialize the class. - - - When overridden in a derived class, creates the model metadata for the property. - The model metadata for the property. - The set of attributes. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - - - Gets a list of attributes. - A list of attributes. - The type of the container. - The property descriptor. - The attribute container. - - - Returns a list of properties for the model. - A list of properties for the model. - The model container. - The type of the container. - - - Returns the metadata for the specified property using the container type and property descriptor. - The metadata for the specified property using the container type and property descriptor. - The model accessor. - The type of the container. - The property descriptor - - - Returns the metadata for the specified property using the container type and property name. - The metadata for the specified property using the container type and property name. - The model accessor. - The type of the container. - The name of the property. - - - Returns the metadata for the specified property using the type of the model. - The metadata for the specified property using the type of the model. - The model accessor. - The type of the model. - - - Returns the type descriptor from the specified type. - The type descriptor. - The type. - - - Provides an abstract class for classes that implement a validation provider. - - - Called from constructors in derived classes to initialize the class. - - - Gets a type descriptor for the specified type. - A type descriptor for the specified type. - The type of the validation provider. - - - Gets the validators for the model using the metadata and controller context. - The validators for the model. - The metadata. - The controller context. - - - Gets the validators for the model using the metadata, the controller context, and a list of attributes. - The validators for the model. - The metadata. - The controller context. - The list of attributes. - - - Provides the base class for asynchronous controllers. - - - Initializes a new instance of the class. - - - Gets the asynchronous manager instance. - The asynchronous manager instance. - - - Called by ASP.NET to initialize asynchronous request processing. - The status of the asynchronous operation. - The request context. - The asynchronous callback method. - The state object. - - - Called by ASP.NET during initialization of asynchronous request processing. - The status of the asynchronous operation. - The asynchronous callback method. - The state object. - - - Creates an action invoker. - An action invoker. - - - Cancels the execution of an asynchronous action method. - The status of the asynchronous result. - - - Called by ASP.NET when the current asynchronous action has completed. - The status of the asynchronous result. - - - Called by ASP.NET to begin the execution of an asynchronous action method. - The status of the asynchronous operation. - The request context. - The asynchronous callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Cancels the execution of an asynchronous action method by ASP.NET at the end of the execution of an asynchronous action method. - The status of the asynchronous result. - - - Represents an attribute that is used to set the timeout value, in milliseconds, for an asynchronous method. - - - Initializes a new instance of the class. - The timeout value, in milliseconds. - - - Gets the timeout duration, in milliseconds. - The timeout duration, in milliseconds. - - - Called by ASP.NET before the asynchronous action method executes. - The filter context. - - - Encapsulates the information that is required for using an attribute. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified controller context. - The context within which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - - - Initializes a new instance of the class using the specified controller context and action descriptor. - The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - An object that provides information about an action method, such as its name, controller, parameters, attributes, and filters. - - - Provides information about the action method that is marked by the attribute, such as its name, controller, parameters, attributes, and filters. - The action descriptor for the action method that is marked by the attribute. - - - Gets or sets the result that is returned by an action method. - The result that is returned by an action method. - - - Represents an attribute that is used to restrict access by callers to an action method. - - - Initializes a new instance of the class. - - - When overridden, provides an entry point for custom authorization checks. - true if the user is authorized; otherwise, false. - The HTTP context, which encapsulates all HTTP-specific information about an individual HTTP request. - The parameter is null. - - - Processes HTTP requests that fail authorization. - Encapsulates the information for using . The object contains the controller, HTTP context, request context, action result, and route data. - - - Called when a process requests authorization. - The filter context, which encapsulates information for using . - The parameter is null. - - - Called when the caching module requests authorization. - A reference to the validation status. - The HTTP context, which encapsulates all HTTP-specific information about an individual HTTP request. - The parameter is null. - - - Gets or sets the user roles. - The user roles. - - - Gets the unique identifier for this attribute. - The unique identifier for this attribute. - - - Gets or sets the authorized users. - The authorized users. - - - Represents an attribute that is used to provide details about how model binding to a parameter should occur. - - - Initializes a new instance of the class. - - - Gets or sets a comma-delimited list of property names for which binding is not allowed. - The exclude list. - - - Gets or sets a comma-delimited list of property names for which binding is allowed. - The include list. - - - Determines whether the specified property is allowed. - true if the specified property is allowed; otherwise, false. - The name of the property. - - - Gets or sets the prefix to use when markup is rendered for binding to an action argument or to a model property. - The prefix to use. - - - Represents the base class for views that are compiled by the BuildManager class before being rendered by a view engine. - - - Initializes a new instance of the class using the specified controller context and view path. - The controller context. - The view path. - - - Initializes a new instance of the class using the specified controller context, view path, and view page activator. - Context information for the current controller. This information includes the HTTP context, request context, route data, parent action view context, and more. - The path to the view that will be rendered. - The object responsible for dynamically constructing the view page at run time. - The parameter is null. - The parameter is null or empty. - - - Renders the specified view context by using the specified the writer object. - Information related to rendering a view, such as view data, temporary data, and form context. - The writer object. - The parameter is null. - An instance of the view type could not be created. - - - When overridden in a derived class, renders the specified view context by using the specified writer object and object instance. - Information related to rendering a view, such as view data, temporary data, and form context. - The writer object. - An object that contains additional information that can be used in the view. - - - Gets or sets the view path. - The view path. - - - Provides a base class for view engines. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified view page activator. - The view page activator. - - - Gets a value that indicates whether a file exists in the specified virtual file system (path). - true if the file exists in the virtual file system; otherwise, false. - The controller context. - The virtual path. - - - Gets the view page activator. - The view page activator. - - - Maps a browser request to a byte array. - - - Initializes a new instance of the class. - - - Binds the model by using the specified controller context and binding context. - The bound data object. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The parameter is null. - - - Represents an attribute that is used to indicate that an action method should be called only as a child action. - - - Initializes a new instance of the class. - - - Called when authorization is required. - An object that encapsulates the information that is required in order to authorize access to the child action. - - - Represents a value provider for values from child actions. - - - Initializes a new instance of the class. - The controller context. - - - Retrieves a value object using the specified key. - The value object for the specified key. - The key. - - - Represents a factory for creating value provider objects for child actions. - - - Initializes a new instance of the class. - - - Returns a object for the specified controller context. - A object. - The controller context. - - - Returns the client data-type model validators. - - - Initializes a new instance of the class. - - - Returns the client data-type model validators. - The client data-type model validators. - The metadata. - The context. - - - Provides an attribute that compares two properties of a model. - - - Initializes a new instance of the class. - The property to compare with the current property. - - - Applies formatting to an error message based on the data field where the compare error occurred. - The formatted error message. - The name of the field that caused the validation failure. - - - Formats the property for client validation by prepending an asterisk (*) and a dot. - The string "*." is prepended to the property. - The property. - - - Gets a list of compare-value client validation rules for the property using the specified model metadata and controller context. - A list of compare-value client validation rules. - The model metadata. - The controller context. - - - Determines whether the specified object is equal to the compared object. - null if the value of the compared property is equal to the value parameter; otherwise, a validation result that contains the error message that indicates that the comparison failed. - The value of the object to compare. - The validation context. - - - Gets the property to compare with the current property. - The property to compare with the current property. - - - Represents a user-defined content type that is the result of an action method. - - - Initializes a new instance of the class. - - - Gets or sets the content. - The content. - - - Gets or sets the content encoding. - The content encoding. - - - Gets or sets the type of the content. - The type of the content. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Provides methods that respond to HTTP requests that are made to an ASP.NET MVC Web site. - - - Initializes a new instance of the class. - - - Gets the action invoker for the controller. - The action invoker. - - - Gets or sets the binder. - The binder. - - - Creates a content result object by using a string. - The content result instance. - The content to write to the response. - - - Creates a content result object by using a string and the content type. - The content result instance. - The content to write to the response. - The content type (MIME type). - - - Creates a content result object by using a string, the content type, and content encoding. - The content result instance. - The content to write to the response. - The content type (MIME type). - The content encoding. - - - Creates an action invoker. - An action invoker. - - - Creates a temporary data provider. - A temporary data provider. - - - Releases all resources that are used by the current instance of the class. - - - Releases unmanaged resources and optionally releases managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Invokes the action in the current controller context. - - - Creates a object by using the file contents and file type. - The file-content result object. - The binary content to send to the response. - The content type (MIME type). - - - Creates a object by using the file contents, content type, and the destination file name. - The file-content result object. - The binary content to send to the response. - The content type (MIME type). - The file name to use in the file-download dialog box that is displayed in the browser. - - - Creates a object by using the object and content type. - The file-content result object. - The stream to send to the response. - The content type (MIME type). - - - Creates a object using the object, the content type, and the target file name. - The file-stream result object. - The stream to send to the response. - The content type (MIME type) - The file name to use in the file-download dialog box that is displayed in the browser. - - - Creates a object by using the file name and the content type. - The file-stream result object. - The path of the file to send to the response. - The content type (MIME type). - - - Creates a object by using the file name, the content type, and the file download name. - The file-stream result object. - The path of the file to send to the response. - The content type (MIME type). - The file name to use in the file-download dialog box that is displayed in the browser. - - - Called when a request matches this controller, but no method with the specified action name is found in the controller. - The name of the attempted action. - - - Gets HTTP-specific information about an individual HTTP request. - The HTTP context. - - - Returns an instance of the class. - An instance of the class. - - - Returns an instance of the class. - An instance of the class. - The status description. - - - Initializes data that might not be available when the constructor is called. - The HTTP context and route data. - - - Creates a object. - The object that writes the script to the response. - The JavaScript code to run on the client - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON). - The JSON result object that serializes the specified object to JSON format. The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed. - The JavaScript object graph to serialize. - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format. - The JSON result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format. - The JSON result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - The content encoding. - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the content type, content encoding, and the JSON request behavior. - The result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - The content encoding. - The JSON request behavior - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified content type and JSON request behavior. - The result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - The JSON request behavior - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified JSON request behavior. - The result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - - - Gets the model state dictionary object that contains the state of the model and of model-binding validation. - The model state dictionary. - - - Called after the action method is invoked. - Information about the current request and action. - - - Called before the action method is invoked. - Information about the current request and action. - - - Called when authorization occurs. - Information about the current request and action. - - - Called when an unhandled exception occurs in the action. - Information about the current request and action. - - - Called after the action result that is returned by an action method is executed. - Information about the current request and action result - - - Called before the action result that is returned by an action method is executed. - Information about the current request and action result - - - Creates a object that renders a partial view. - A partial-view result object. - - - Creates a object that renders a partial view, by using the specified model. - A partial-view result object. - The model that is rendered by the partial view - - - Creates a object that renders a partial view, by using the specified view name. - A partial-view result object. - The name of the view that is rendered to the response. - - - Creates a object that renders a partial view, by using the specified view name and model. - A partial-view result object. - The name of the view that is rendered to the response. - The model that is rendered by the partial view - - - Creates a object that redirects to the specified URL. - The redirect result object. - The URL to redirect to. - - - Returns an instance of the class with the property set to true. - An instance of the class with the property set to true. - The URL to redirect to. - - - Redirects to the specified action using the action name. - The redirect result object. - The name of the action. - - - Redirects to the specified action using the action name and route values. - The redirect result object. - The name of the action. - The parameters for a route. - - - Redirects to the specified action using the action name and controller name. - The redirect result object. - The name of the action. - The name of the controller - - - Redirects to the specified action using the action name, controller name, and route values. - The redirect result object. - The name of the action. - The name of the controller - The parameters for a route. - - - Redirects to the specified action using the action name, controller name, and route dictionary. - The redirect result object. - The name of the action. - The name of the controller - The parameters for a route. - - - Redirects to the specified action using the action name and route dictionary. - The redirect result object. - The name of the action. - The parameters for a route. - - - Returns an instance of the class with the property set to true using the specified action name. - An instance of the class with the property set to true using the specified action name, controller name, and route values. - The action name. - - - Returns an instance of the class with the property set to true using the specified action name, and route values. - An instance of the class with the property set to true using the specified action name, and route values. - The action name. - The route values. - - - Returns an instance of the class with the property set to true using the specified action name, and controller name. - An instance of the class with the property set to true using the specified action name, and controller name. - The action name. - The controller name. - - - Returns an instance of the class with the property set to true using the specified action name, controller name, and route values. - An instance of the class with the property set to true. - The action name. - The controller name. - The route values. - - - Returns an instance of the class with the property set to true using the specified action name, controller name, and route values. - An instance of the class with the property set to true using the specified action name, controller name, and route values. - The action name. - The controller name. - The route values. - - - Returns an instance of the class with the property set to true using the specified action name, and route values. - An instance of the class with the property set to true using the specified action name, and route values. - - - Redirects to the specified route using the specified route values. - The redirect-to-route result object. - The parameters for a route. - - - Redirects to the specified route using the route name. - The redirect-to-route result object. - The name of the route - - - Redirects to the specified route using the route name and route values. - The redirect-to-route result object. - The name of the route - The parameters for a route. - - - Redirects to the specified route using the route name and route dictionary. - The redirect-to-route result object. - The name of the route - The parameters for a route. - - - Redirects to the specified route using the route dictionary. - The redirect-to-route result object. - The parameters for a route. - - - Returns an instance of the class with the property set to true using the specified route values. - Returns . - The route name. - - - Returns an instance of the class with the property set to true using the specified route name. - Returns an instance of the class with the property set to true using the specified route name. - The route name. - - - Returns an instance of the class with the property set to true using the specified route name and route values. - An instance of the class with the property set to true. - The route name. - The route values. - - - Returns an instance of the class with the property set to true using the specified route name and route values. - An instance of the class with the property set to true using the specified route name and route values. - The route name. - The route values. - - - Returns an instance of the class with the property set to true using the specified route values. - An instance of the class with the property set to true using the specified route values. - The route values. - - - Gets the object for the current HTTP request. - The request object. - - - Gets the object for the current HTTP response. - The response object. - - - Gets the route data for the current request. - The route data. - - - Gets the object that provides methods that are used during Web request processing. - The HTTP server object. - - - Gets the object for the current HTTP request. - The HTTP session-state object for the current HTTP request. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The filter context. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The filter context. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The filter context. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The filter context. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The filter context. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The filter context. - - - Gets the temporary-data provider object that is used to store data for the next request. - The temporary-data provider. - - - Updates the specified model instance using values from the controller's current value provider. - true if the update is successful; otherwise, false. - The model instance to update. - The type of the model object. - The parameter or the property is null. - - - Updates the specified model instance using values from the controller's current value provider and a prefix. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - The type of the model object. - The parameter or the property is null. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - The type of the model object. - The parameter or the property is null. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, a list of properties to exclude, and a list of properties to include. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the parameter list. - The type of the model object. - The parameter or the property is null. - - - Updates the specified model instance using values from the value provider, a prefix, a list of properties to exclude , and a list of properties to include. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the parameter list. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, and included properties. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider and a prefix. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the controller's current value provider and included properties. - true if the update is successful; otherwise, false. - The model instance to update. - A list of properties of the model to update. - The type of the model object. - The parameter or the property is null. - - - Updates the specified model instance using values from the value provider and a list of properties to include. - true if the update is successful; otherwise, false. - The model instance to update. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider. - true if the update is successful; otherwise, false. - The model instance to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Validates the specified model instance. - true if the model validation is successful; otherwise, false. - The model instance to validate. - - - Validates the specified model instance using an HTML prefix. - true if the model validation is successful; otherwise, false. - The model to validate. - The prefix to use when looking up values in the model provider. - - - Updates the specified model instance using values from the controller's current value provider. - The model instance to update. - The type of the model object. - The model was not successfully updated. - - - Updates the specified model instance using values from the controller's current value provider and a prefix. - The model instance to update. - A prefix to use when looking up values in the value provider. - The type of the model object. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties. - The model instance to update. - A prefix to use when looking up values in the value provider. - A list of properties of the model to update. - The type of the model object. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, a list of properties to exclude, and a list of properties to include. - The model instance to update. - A prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the list. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, a list of properties to exclude, and a list of properties to include. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the parameter list. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider and a prefix. - The model instance to update. - The prefix to use when looking up values in the value provider. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the controller object's current value provider. - The model instance to update. - A list of properties of the model to update. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. - The model instance to update. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider. - The model instance to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Gets the URL helper object that is used to generate URLs by using routing. - The URL helper object. - - - Gets the user security information for the current HTTP request. - The user security information for the current HTTP request. - - - Validates the specified model instance. - The model to validate. - - - Validates the specified model instance using an HTML prefix. - The model to validate. - The prefix to use when looking up values in the model provider. - - - Creates a object that renders a view to the response. - The view result that renders a view to the response. - - - Creates a object by using the model that renders a view to the response. - The view result. - The model that is rendered by the view. - - - Creates a object by using the view name that renders a view. - The view result. - The name of the view that is rendered to the response. - - - Creates a object by using the view name and model that renders a view to the response. - The view result. - The name of the view that is rendered to the response. - The model that is rendered by the view. - - - Creates a object using the view name and master-page name that renders a view to the response. - The view result. - The name of the view that is rendered to the response. - The name of the master page or template to use when the view is rendered. - - - Creates a object using the view name, master-page name, and model that renders a view. - The view result. - The name of the view that is rendered to the response. - The name of the master page or template to use when the view is rendered. - The model that is rendered by the view. - - - Creates a object that renders the specified object. - The view result. - The view that is rendered to the response. - - - Creates a object that renders the specified object. - The view result. - The view that is rendered to the response. - The model that is rendered by the view. - - - Represents a class that is responsible for invoking the action methods of a controller. - - - Initializes a new instance of the class. - - - Gets or sets the model binders that are associated with the action. - The model binders that are associated with the action. - - - Creates the action result. - The action result object. - The controller context. - The action descriptor. - The action return value. - - - Finds the information about the action method. - Information about the action method. - The controller context. - The controller descriptor. - The name of the action. - - - Retrieves information about the controller by using the specified controller context. - Information about the controller. - The controller context. - - - Retrieves information about the action filters. - Information about the action filters. - The controller context. - The action descriptor. - - - Gets the value of the specified action-method parameter. - The value of the action-method parameter. - The controller context. - The parameter descriptor. - - - Gets the values of the action-method parameters. - The values of the action-method parameters. - The controller context. - The action descriptor. - - - Invokes the specified action by using the specified controller context. - The result of executing the action. - The controller context. - The name of the action to invoke. - The parameter is null. - The parameter is null or empty. - The thread was aborted during invocation of the action. - An unspecified error occurred during invocation of the action. - - - Invokes the specified action method by using the specified parameters and the controller context. - The result of executing the action method. - The controller context. - The action descriptor. - The parameters. - - - Invokes the specified action method by using the specified parameters, controller context, and action filters. - The context for the ActionExecuted method of the class. - The controller context. - The action filters. - The action descriptor. - The parameters. - - - Invokes the specified action result by using the specified controller context. - The controller context. - The action result. - - - Invokes the specified action result by using the specified action filters and the controller context. - The context for the ResultExecuted method of the class. - The controller context. - The action filters. - The action result. - - - Invokes the specified authorization filters by using the specified action descriptor and controller context. - The context for the object. - The controller context. - The authorization filters. - The action descriptor. - - - Invokes the specified exception filters by using the specified exception and controller context. - The context for the object. - The controller context. - The exception filters. - The exception. - - - Represents the base class for all MVC controllers. - - - Initializes a new instance of the class. - - - Gets or sets the controller context. - The controller context. - - - Executes the specified request context. - The request context. - The parameter is null. - - - Executes the request. - - - Initializes the specified request context. - The request context. - - - Executes the specified request context. - The request context. - - - Gets or sets the dictionary for temporary data. - The dictionary for temporary data. - - - Gets or sets a value that indicates whether request validation is enabled for this request. - true if request validation is enabled for this request; otherwise, false. The default is true. - - - Gets or sets the value provider for the controller. - The value provider for the controller. - - - Gets the dynamic view data dictionary. - The dynamic view data dictionary. - - - Gets or sets the dictionary for view data. - The dictionary for the view data. - - - Represents a class that is responsible for dynamically building a controller. - - - Initializes a new instance of the class. - - - Gets the current controller builder object. - The current controller builder. - - - Gets the default namespaces. - The default namespaces. - - - Gets the associated controller factory. - The controller factory. - - - Sets the controller factory by using the specified type. - The type of the controller factory. - The parameter is null. - The controller factory cannot be assigned from the type in the parameter. - An error occurred while the controller factory was being set. - - - Sets the specified controller factory. - The controller factory. - The parameter is null. - - - Encapsulates information about an HTTP request that matches specified and instances. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified HTTP context, URL route data, and controller. - The HTTP context. - The route data. - The controller. - - - Initializes a new instance of the class by using the specified controller context. - The controller context. - The parameter is null. - - - Initializes a new instance of the class by using the specified request context and controller. - The request context. - The controller. - One or both parameters are null. - - - Gets or sets the controller. - The controller. - - - Gets or sets the HTTP context. - The HTTP context. - - - Gets a value that indicates whether the associated action method is a child action. - true if the associated action method is a child action; otherwise, false. - - - Gets an object that contains the view context information for the parent action method. - An object that contains the view context information for the parent action method. - - - Gets or sets the request context. - The request context. - - - Gets or sets the URL route data. - The URL route data. - - - Encapsulates information that describes a controller, such as its name, type, and actions. - - - Initializes a new instance of the class. - - - Gets the name of the controller. - The name of the controller. - - - Gets the type of the controller. - The type of the controller. - - - Finds an action method by using the specified name and controller context. - The information about the action method. - The controller context. - The name of the action. - - - Retrieves a list of action-method descriptors in the controller. - A list of action-method descriptors in the controller. - - - Retrieves custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Retrieves custom attributes of a specified type that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - The parameter is null (Nothing in Visual Basic). - - - Retrieves a value that indicates whether one or more instance of the specified custom attribute are defined for this member. - true if the is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The parameter is null (Nothing in Visual Basic). - - - When implemented in a derived class, gets the unique ID for the controller descriptor using lazy initialization. - The unique ID. - - - Adds the controller to the instance. - - - Initializes a new instance of the class. - - - Returns the collection of controller instance filters. - The collection of controller instance filters. - The controller context. - The action descriptor. - - - Represents an attribute that invokes a custom model binder. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - A reference to an object that implements the interface. - - - Provides a container for common metadata, for the class, and for the class for a data model. - - - Initializes a new instance of the class. - The data-annotations model metadata provider. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - The display column attribute. - - - Returns simple text for the model data. - Simple text for the model data. - - - Implements the default model metadata provider for ASP.NET MVC. - - - Initializes a new instance of the class. - - - Gets the metadata for the specified property. - The metadata for the property. - The attributes. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - - - Represents the method that creates a instance. - - - Provides a model validator. - - - Initializes a new instance of the class. - The metadata for the model. - The controller context for the model. - The validation attribute for the model. - - - Gets the validation attribute for the model validator. - The validation attribute for the model validator. - - - Gets the error message for the validation failure. - The error message for the validation failure. - - - Retrieves a collection of client validation rules. - A collection of client validation rules. - - - Gets a value that indicates whether model validation is required. - true if model validation is required; otherwise, false. - - - Returns a list of validation error messages for the model. - A list of validation error messages for the model, or an empty list if no errors have occurred. - The container for the model. - - - Provides a model validator for a specified validation type. - - - - Initializes a new instance of the class. - The metadata for the model. - The controller context for the model. - The validation attribute for the model. - - - Gets the validation attribute from the model validator. - The validation attribute from the model validator. - - - Implements the default validation provider for ASP.NET MVC. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether non-nullable value types are required. - true if non-nullable value types are required; otherwise, false. - - - Gets a list of validators. - A list of validators. - The metadata. - The context. - The list of validation attributes. - - - Registers an adapter to provide client-side validation. - The type of the validation attribute. - The type of the adapter. - - - Registers an adapter factory for the validation provider. - The type of the attribute. - The factory that will be used to create the object for the specified attribute. - - - Registers the default adapter. - The type of the adapter. - - - Registers the default adapter factory. - The factory that will be used to create the object for the default adapter. - - - Registers an adapter to provide default object validation. - The type of the adapter. - - - Registers an adapter factory for the default object validation provider. - The factory. - - - Registers an adapter to provide object validation. - The type of the model. - The type of the adapter. - - - Registers an adapter factory for the object validation provider. - The type of the model. - The factory. - - - Provides a factory for validators that are based on . - - - Provides a container for the error-information model validator. - - - Initializes a new instance of the class. - - - Gets a list of error-information model validators. - A list of error-information model validators. - The model metadata. - The controller context. - - - Represents the controller factory that is registered by default. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a controller activator. - An object that implements the controller activator interface. - - - Creates the specified controller by using the specified request context. - The controller. - The context of the HTTP request, which includes the HTTP context and route data. - The name of the controller. - The parameter is null. - The parameter is null or empty. - - - Retrieves the controller instance for the specified request context and controller type. - The controller instance. - The context of the HTTP request, which includes the HTTP context and route data. - The type of the controller. - - is null. - - cannot be assigned. - An instance of cannot be created. - - - Returns the controller's session behavior. - The controller's session behavior. - The request context. - The type of the controller. - - - Retrieves the controller type for the specified name and request context. - The controller type. - The context of the HTTP request, which includes the HTTP context and route data. - The name of the controller. - - - Releases the specified controller. - The controller to release. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The controller's session behavior. - The request context. - The controller name. - - - Maps a browser request to a data object. This class provides a concrete implementation of a model binder. - - - Initializes a new instance of the class. - - - Gets or sets the model binders for the application. - The model binders for the application. - - - Binds the model by using the specified controller context and binding context. - The bound object. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The parameter is null. - - - Binds the specified property by using the specified controller context and binding context and the specified property descriptor. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property to be bound. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - - - Creates the specified model type by using the specified controller context and binding context. - A data object of the specified type. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The type of the model object to return. - - - Creates an index (a subindex) based on a category of components that make up a larger index, where the specified index value is an integer. - The name of the subindex. - The prefix for the subindex. - The index value. - - - Creates an index (a subindex) based on a category of components that make up a larger index, where the specified index value is a string. - The name of the subindex. - The prefix for the subindex. - The index value. - - - Creates the name of the subproperty by using the specified prefix and property name. - The name of the subproperty. - The prefix for the subproperty. - The name of the property. - - - Returns a set of properties that match the property filter restrictions that are established by the specified . - An enumerable set of property descriptors. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Returns the properties of the model by using the specified controller context and binding context. - A collection of property descriptors. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Returns the value of a property using the specified controller context, binding context, property descriptor, and property binder. - An object that represents the property value. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The descriptor for the property to access. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - An object that provides a way to bind the property. - - - Returns the descriptor object for a type that is specified by its controller context and binding context. - A custom type descriptor object. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Determines whether a data model is valid for the specified binding context. - true if the model is valid; otherwise, false. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The parameter is null. - - - Called when the model is updated. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Called when the model is updating. - true if the model is updating; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Called when the specified property is validated. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property to be validated. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - The value to set for the property. - - - Called when the specified property is validating. - true if the property is validating; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property being validated. The descriptor provides information such as component type, property type, and property value. It also provides methods to get or set the property value. - The value to set for the property. - - - Gets or sets the name of the resource file (class key) that contains localized string values. - The name of the resource file (class key). - - - Sets the specified property by using the specified controller context, binding context, and property value. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property to be set. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - The value to set for the property. - - - Represents a memory cache for view locations. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified cache time span. - The cache time span. - The Ticks attribute of the parameter is set to a negative number. - - - Retrieves the default view location by using the specified HTTP context and cache key. - The default view location. - The HTTP context. - The cache key - The parameter is null. - - - Inserts the view in the specified virtual path by using the specified HTTP context, cache key, and virtual path. - The HTTP context. - The cache key. - The virtual path - The parameter is null. - - - Creates an empty view location cache. - - - Gets or sets the cache time span. - The cache time span. - - - Provides a registration point for dependency resolvers that implement or the Common Service Locator IServiceLocator interface. - - - Initializes a new instance of the class. - - - Gets the implementation of the dependency resolver. - The implementation of the dependency resolver. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - The implementation of the dependency resolver. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - The function that provides the service. - The function that provides the services. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - The common service locator. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - The object that implements the dependency resolver. - - - Provides a registration point for dependency resolvers using the specified service delegate and specified service collection delegates. - The service delegate. - The services delegates. - - - Provides a registration point for dependency resolvers using the provided common service locator when using a service locator interface. - The common service locator. - - - Provides a registration point for dependency resolvers, using the specified dependency resolver interface. - The dependency resolver. - - - Provides a type-safe implementation of and . - - - Resolves singly registered services that support arbitrary object creation. - The requested service or object. - The dependency resolver instance that this method extends. - The type of the requested service or object. - - - Resolves multiply registered services. - The requested services. - The dependency resolver instance that this method extends. - The type of the requested services. - - - Represents the base class for value providers whose values come from a collection that implements the interface. - The type of the value. - - - Initializes a new instance of the class. - The name/value pairs that are used to initialize the value provider. - Information about a specific culture, such as the names of the culture, the writing system, and the calendar used. - The parameter is null. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - The parameter is null. - - - Returns a value object using the specified key and controller context. - The value object for the specified key. - The key of the value object to retrieve. - The parameter is null. - - - Provides an empty metadata provider for data models that do not require metadata. - - - Initializes a new instance of the class. - - - Creates a new instance of the class. - A new instance of the class. - The attributes. - The type of the container. - The model accessor. - The type of the model. - The name of the model. - - - Provides an empty validation provider for models that do not require a validator. - - - Initializes a new instance of the class. - - - Gets the empty model validator. - The empty model validator. - The metadata. - The context. - - - Represents a result that does nothing, such as a controller action method that returns nothing. - - - Initializes a new instance of the class. - - - Executes the specified result context. - The result context. - - - Provides the context for using the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class for the specified exception by using the specified controller context. - The controller context. - The exception. - The parameter is null. - - - Gets or sets the exception object. - The exception object. - - - Gets or sets a value that indicates whether the exception has been handled. - true if the exception has been handled; otherwise, false. - - - Gets or sets the action result. - The action result. - - - Provides a helper class to get the model name from an expression. - - - Gets the model name from a lambda expression. - The model name. - The expression. - - - Gets the model name from a string expression. - The model name. - The expression. - - - Provides a container for client-side field validation metadata. - - - Initializes a new instance of the class. - - - Gets or sets the name of the data field. - The name of the data field. - - - Gets or sets a value that indicates whether the validation message contents should be replaced with the client validation error. - true if the validation message contents should be replaced with the client validation error; otherwise, false. - - - Gets or sets the validator message ID. - The validator message ID. - - - Gets the client validation rules. - The client validation rules. - - - Sends the contents of a binary file to the response. - - - Initializes a new instance of the class by using the specified file contents and content type. - The byte array to send to the response. - The content type to use for the response. - The parameter is null. - - - The binary content to send to the response. - The file contents. - - - Writes the file content to the response. - The response. - - - Sends the contents of a file to the response. - - - Initializes a new instance of the class by using the specified file name and content type. - The name of the file to send to the response. - The content type of the response. - The parameter is null or empty. - - - Gets or sets the path of the file that is sent to the response. - The path of the file that is sent to the response. - - - Writes the file to the response. - The response. - - - Represents a base class that is used to send binary file content to the response. - - - Initializes a new instance of the class. - The type of the content. - The parameter is null or empty. - - - Gets the content type to use for the response. - The type of the content. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets or sets the content-disposition header so that a file-download dialog box is displayed in the browser with the specified file name. - The name of the file. - - - Writes the file to the response. - The response. - - - Sends binary content to the response by using a instance. - - - Initializes a new instance of the class. - The stream to send to the response. - The content type to use for the response. - The parameter is null. - - - Gets the stream that will be sent to the response. - The file stream. - - - Writes the file to the response. - The response. - - - Represents a metadata class that contains a reference to the implementation of one or more of the filter interfaces, the filter's order, and the filter's scope. - - - Initializes a new instance of the class. - The instance. - The scope. - The order. - - - Represents a constant that is used to specify the default ordering of filters. - - - Gets the instance of this class. - The instance of this class. - - - Gets the order in which the filter is applied. - The order in which the filter is applied. - - - Gets the scope ordering of the filter. - The scope ordering of the filter. - - - Represents the base class for action and result filter attributes. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether more than one instance of the filter attribute can be specified. - true if more than one instance of the filter attribute can be specified; otherwise, false. - - - Gets or sets the order in which the action filters are executed. - The order in which the action filters are executed. - - - Defines a filter provider for filter attributes. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and optionally caches attribute instances. - true to cache attribute instances; otherwise, false. - - - Gets a collection of custom action attributes. - A collection of custom action attributes. - The controller context. - The action descriptor. - - - Gets a collection of controller attributes. - A collection of controller attributes. - The controller context. - The action descriptor. - - - Aggregates the filters from all of the filter providers into one collection. - The collection filters from all of the filter providers. - The controller context. - The action descriptor. - - - Encapsulates information about the available action filters. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified filters collection. - The filters collection. - - - Gets all the action filters in the application. - The action filters. - - - Gets all the authorization filters in the application. - The authorization filters. - - - Gets all the exception filters in the application. - The exception filters. - - - Gets all the result filters in the application. - The result filters. - - - Represents the collection of filter providers for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the filter providers collection. - The filter providers collection. - - - Returns the collection of filter providers. - The collection of filter providers. - The controller context. - The action descriptor. - - - Provides a registration point for filters. - - - Provides a registration point for filters. - The collection of filters. - - - Defines values that specify the order in which ASP.NET MVC filters run within the same filter type and filter order. - - - Specifies first. - - - Specifies an order before and after . - - - Specifies an order before and after . - - - Specifies an order before and after . - - - Specifies last. - - - Contains the form value providers for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The collection. - The parameter is null. - - - Gets the specified value provider. - The value provider. - The name of the value provider to get. - The parameter is null or empty. - - - Gets a value that indicates whether the value provider contains an entry that has the specified prefix. - true if the value provider contains an entry that has the specified prefix; otherwise, false. - The prefix to look for. - - - Gets a value from a value provider using the specified key. - A value from a value provider. - The key. - - - Returns a dictionary that contains the value providers. - A dictionary of value providers. - - - Encapsulates information that is required in order to validate and process the input data from an HTML form. - - - Initializes a new instance of the class. - - - Gets the field validators for the form. - A dictionary of field validators for the form. - - - Gets or sets the form identifier. - The form identifier. - - - Returns a serialized object that contains the form identifier and field-validation values for the form. - A serialized object that contains the form identifier and field-validation values for the form. - - - Returns the validation value for the specified input field. - The value to validate the field input with. - The name of the field to retrieve the validation value for. - The parameter is either null or empty. - - - Returns the validation value for the specified input field and a value that indicates what to do if the validation value is not found. - The value to validate the field input with. - The name of the field to retrieve the validation value for. - true to create a validation value if one is not found; otherwise, false. - The parameter is either null or empty. - - - Returns a value that indicates whether the specified field has been rendered in the form. - true if the field has been rendered; otherwise, false. - The field name. - - - Sets a value that indicates whether the specified field has been rendered in the form. - The field name. - true to specify that the field has been rendered in the form; otherwise, false. - - - Determines whether client validation errors should be dynamically added to the validation summary. - true if client validation errors should be added to the validation summary; otherwise, false. - - - Gets or sets the identifier for the validation summary. - The identifier for the validation summary. - - - Enumerates the HTTP request types for a form. - - - Specifies a GET request. - - - Specifies a POST request. - - - Represents a value provider for form values that are contained in a object. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - - - Represents a class that is responsible for creating a new instance of a form-value provider object. - - - Initializes a new instance of the class. - - - Returns a form-value provider object for the specified controller context. - A form-value provider object. - An object that encapsulates information about the current HTTP request. - The parameter is null. - - - Represents a class that contains all the global filters. - - - Initializes a new instance of the class. - - - Adds the specified filter to the global filter collection. - The filter. - - - Adds the specified filter to the global filter collection using the specified filter run order. - The filter. - The filter run order. - - - Removes all filters from the global filter collection. - - - Determines whether a filter is in the global filter collection. - true if is found in the global filter collection; otherwise, false. - The filter. - - - Gets the number of filters in the global filter collection. - The number of filters in the global filter collection. - - - Returns an enumerator that iterates through the global filter collection. - An enumerator that iterates through the global filter collection. - - - Removes all the filters that match the specified filter. - The filter to remove. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - An enumerator that iterates through the global filter collection. - - - This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - An enumerator that iterates through the global filter collection. - The controller context. - The action descriptor. - - - Represents the global filter collection. - - - Gets or sets the global filter collection. - The global filter collection. - - - Represents an attribute that is used to handle an exception that is thrown by an action method. - - - Initializes a new instance of the class. - - - Gets or sets the type of the exception. - The type of the exception. - - - Gets or sets the master view for displaying exception information. - The master view. - - - Called when an exception occurs. - The action-filter context. - The parameter is null. - - - Gets the unique identifier for this attribute. - The unique identifier for this attribute. - - - Gets or sets the page view for displaying exception information. - The page view. - - - Encapsulates information for handling an error that was thrown by an action method. - - - Initializes a new instance of the class. - The exception. - The name of the controller. - The name of the action. - The parameter is null. - The or parameter is null or empty. - - - Gets or sets the name of the action that was executing when the exception was thrown. - The name of the action. - - - Gets or sets the name of the controller that contains the action method that threw the exception. - The name of the controller. - - - Gets or sets the exception object. - The exception object. - - - Represents an attribute that is used to indicate whether a property or field value should be rendered as a hidden input element. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether to display the value of the hidden input element. - true if the value should be displayed; otherwise, false. - - - Represents support for rendering HTML controls in a view. - - - Initializes a new instance of the class by using the specified view context and view data container. - The view context. - The view data container. - The or the parameter is null. - - - Initializes a new instance of the class by using the specified view context, view data container, and route collection. - The view context. - The view data container. - The route collection. - One or more parameters is null. - - - Replaces underscore characters (_) with hyphens (-) in the specified HTML attributes. - The HTML attributes with underscore characters replaced by hyphens. - The HTML attributes. - - - Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. - The generated form field (anti-forgery token). - - - Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. The field value is generated using the specified salt value. - The generated form field (anti-forgery token). - The salt value, which can be any non-empty string. - - - Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. The field value is generated using the specified salt value, domain, and path. - The generated form field (anti-forgery token). - The salt value, which can be any non-empty string. - The application domain. - The virtual path. - - - Converts the specified attribute object to an HTML-encoded string. - The HTML-encoded string. If the value parameter is null or empty, this method returns an empty string. - The object to encode. - - - Converts the specified attribute string to an HTML-encoded string. - The HTML-encoded string. If the value parameter is null or empty, this method returns an empty string. - The string to encode. - - - Gets or sets a value that indicates whether client validation is enabled. - true if enable client validation is enabled; otherwise, false. - - - Enables input validation that is performed by using client script in the browser. - - - Enables or disables client validation. - true to enable client validation; otherwise, false. - - - Enables unobtrusive JavaScript. - - - Enables or disables unobtrusive JavaScript. - true to enable unobtrusive JavaScript; otherwise, false. - - - Converts the value of the specified object to an HTML-encoded string. - The HTML-encoded string. - The object to encode. - - - Converts the specified string to an HTML-encoded string. - The HTML-encoded string. - The string to encode. - - - Creates an HTML element ID using the specified element name. - The ID of the HTML element. - The name of the HTML element. - The parameter is null. - - - Creates an HTML element ID using the specified element name and a string that replaces dots in the name. - The ID of the HTML element. - The name of the HTML element. - The string that replaces dots (.) in the parameter. - The parameter or the parameter is null. - - - Generates an HTML anchor element (a element) that links to the specified action method, and enables the user to specify the communication protocol, name of the host, and a URL fragment. - An HTML element that links to the specified action method. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - The name of the action method. - The name of the controller. - The communication protocol, such as HTTP or HTTPS. If this parameter is null, the protocol defaults to HTTP. - The name of the host. - The fragment identifier. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Generates an HTML anchor element (a element) that links to the specified action method. - An HTML element that links to the specified action method. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Generates an HTML anchor element (a element) that links to the specified URL route, and enables the user to specify the communication protocol, name of the host, and a URL fragment. - An HTML element that links to the specified URL route. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - The communication protocol, such as HTTP or HTTPS. If this parameter is null, the protocol defaults to HTTP. - The name of the host. - The fragment identifier. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Generates an HTML anchor element (a element) that links to the specified URL route. - An HTML element that links to the specified URL route. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Returns the HTTP method that handles form input (GET or POST) as a string. - The form method string, either "get" or "post". - The HTTP method that handles the form. - - - Returns the HTML input control type as a string. - The input type string ("checkbox", "hidden", "password", "radio", or "text"). - The enumerated input type. - - - Gets the collection of unobtrusive JavaScript validation attributes using the specified HTML name attribute. - The collection of unobtrusive JavaScript validation attributes. - The HTML name attribute. - - - Gets the collection of unobtrusive JavaScript validation attributes using the specified HTML name attribute and model metadata. - The collection of unobtrusive JavaScript validation attributes. - The HTML name attribute. - The model metadata. - - - Returns a hidden input element that identifies the override method for the specified HTTP data-transfer method that was used by the client. - The override method that uses the HTTP data-transfer method that was used by the client. - The HTTP data-transfer method that was used by the client (DELETE, HEAD, or PUT). - The parameter is not "PUT", "DELETE", or "HEAD". - - - Returns a hidden input element that identifies the override method for the specified verb that represents the HTTP data-transfer method used by the client. - The override method that uses the verb that represents the HTTP data-transfer method used by the client. - The verb that represents the HTTP data-transfer method used by the client. - The parameter is not "PUT", "DELETE", or "HEAD". - - - Gets or sets the character that replaces periods in the ID attribute of an element. - The character that replaces periods in the ID attribute of an element. - - - Returns markup that is not HTML encoded. - The HTML markup without encoding. - The HTML markup. - - - Gets or sets the collection of routes for the application. - The collection of routes for the application. - - - Gets or sets a value that indicates whether unobtrusive JavaScript is enabled. - true if unobtrusive JavaScript is enabled; otherwise, false. - - - The name of the CSS class that is used to style an input field when a validation error occurs. - - - The name of the CSS class that is used to style an input field when the input is valid. - - - The name of the CSS class that is used to style the error message when a validation error occurs. - - - The name of the CSS class that is used to style the validation message when the input is valid. - - - The name of the CSS class that is used to style validation summary error messages. - - - The name of the CSS class that is used to style the validation summary when the input is valid. - - - Gets or sets the context information about the view. - The context of the view. - - - Gets the current view data dictionary. - The view data dictionary. - - - Gets or sets the view data container. - The view data container. - - - Represents support for rendering HTML controls in a strongly typed view. - The type of the model. - - - Initializes a new instance of the class by using the specified view context and view data container. - The view context. - The view data container. - - - Initializes a new instance of the class by using the specified view context, view data container, and route collection. - The view context. - The view data container. - The route collection. - - - Gets the strongly typed view data dictionary. - The strongly typed view data dictionary. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP DELETE requests. - - - Initializes a new instance of the class. - - - Determines whether a request is a valid HTTP DELETE request. - true if the request is valid; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - Encapsulates information about a method, such as its type, return type, and arguments. - - - Represents a value provider to use with values that come from a collection of HTTP files. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - - - Represents a class that is responsible for creating a new instance of an HTTP file collection value provider object. - - - Initializes a new instance of the class. - - - Returns a value provider object for the specified controller context. - An HTTP file collection value provider. - An object that encapsulates information about the HTTP request. - The parameter is null. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP GET requests. - - - Initializes a new instance of the class. - - - Determines whether a request is a valid HTTP GET request. - true if the request is valid; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - Encapsulates information about a method, such as its type, return type, and arguments. - - - Defines an object that is used to indicate that the requested resource was not found. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a status description. - The status description. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP POST requests. - - - Initializes a new instance of the class. - - - Determines whether a request is a valid HTTP POST request. - true if the request is valid; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - Encapsulates information about a method, such as its type, return type, and arguments. - - - Binds a model to a posted file. - - - Initializes a new instance of the class. - - - Binds the model. - The bound value. - The controller context. - The binding context. - One or both parameters are null. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP PUT requests. - - - Initializes a new instance of the class. - - - Determines whether a request is a valid HTTP PUT request. - true if the request is valid; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - Encapsulates information about a method, such as its type, return type, and arguments. - - - Extends the class that contains the HTTP values that were sent by a client during a Web request. - - - Retrieves the HTTP data-transfer method override that was used by the client. - The HTTP data-transfer method override that was used by the client. - An object that contains the HTTP values that were sent by a client during a Web request. - The parameter is null. - The HTTP data-transfer method override was not implemented. - - - Provides a way to return an action result with a specific HTTP response status code and description. - - - Initializes a new instance of the class using a status code. - The status code. - - - Initializes a new instance of the class using a status code and status description. - The status code. - The status description. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - - - Gets the HTTP status code. - The HTTP status code. - - - Gets the HTTP status description. - the HTTP status description. - - - Represents the result of an unauthorized HTTP request. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the status description. - The status description. - - - Enumerates the HTTP verbs. - - - Retrieves the information or entity that is identified by the URI of the request. - - - Posts a new entity as an addition to a URI. - - - Replaces an entity that is identified by a URI. - - - Requests that a specified URI be deleted. - - - Retrieves the message headers for the information or entity that is identified by the URI of the request. - - - Defines the methods that are used in an action filter. - - - Called after the action method executes. - The filter context. - - - Called before an action method executes. - The filter context. - - - Defines the contract for an action invoker, which is used to invoke an action in response to an HTTP request. - - - Invokes the specified action by using the specified controller context. - true if the action was found; otherwise, false. - The controller context. - The name of the action. - - - Defines the methods that are required for an authorization filter. - - - Called when authorization is required. - The filter context. - - - Provides a way for the ASP.NET MVC validation framework to discover at run time whether a validator has support for client validation. - - - When implemented in a class, returns client validation rules for that class. - The client validation rules for this validator. - The model metadata. - The controller context. - - - Defines the methods that are required for a controller. - - - Executes the specified request context. - The request context. - - - Provides fine-grained control over how controllers are instantiated using dependency injection. - - - When implemented in a class, creates a controller. - The created controller. - The request context. - The controller type. - - - Defines the methods that are required for a controller factory. - - - Creates the specified controller by using the specified request context. - The controller. - The request context. - The name of the controller. - - - Gets the controller's session behavior. - The controller's session behavior. - The request context. - The name of the controller whose session behavior you want to get. - - - Releases the specified controller. - The controller. - - - Defines the methods that simplify service location and dependency resolution. - - - Resolves singly registered services that support arbitrary object creation. - The requested service or object. - The type of the requested service or object. - - - Resolves multiply registered services. - The requested services. - The type of the requested services. - - - Defines the methods that are required for an exception filter. - - - Called when an exception occurs. - The filter context. - - - Provides an interface for finding filters. - - - Returns an enumerator that contains all the instances in the service locator. - The enumerator that contains all the instances in the service locator. - The controller context. - The action descriptor. - - - Provides an interface for exposing attributes to the class. - - - When implemented in a class, provides metadata to the model metadata creation process. - The model metadata. - - - Defines the methods that are required for a model binder. - - - Binds the model to a value by using the specified controller context and binding context. - The bound value. - The controller context. - The binding context. - - - Defines methods that enable dynamic implementations of model binding for classes that implement the interface. - - - Returns the model binder for the specified type. - The model binder for the specified type. - The type of the model. - - - Defines members that specify the order of filters and whether multiple filters are allowed. - - - When implemented in a class, gets or sets a value that indicates whether multiple filters are allowed. - true if multiple filters are allowed; otherwise, false. - - - When implemented in a class, gets the filter order. - The filter order. - - - Enumerates the types of input controls. - - - A check box. - - - A hidden field. - - - A password box. - - - A radio button. - - - A text box. - - - Defines the methods that are required for a result filter. - - - Called after an action result executes. - The filter context. - - - Called before an action result executes. - The filter context. - - - Associates a route with an area in an ASP.NET MVC application. - - - Gets the name of the area to associate the route with. - The name of the area to associate the route with. - - - Defines the contract for temporary-data providers that store data that is viewed on the next request. - - - Loads the temporary data. - The temporary data. - The controller context. - - - Saves the temporary data. - The controller context. - The values. - - - Represents an interface that can skip request validation. - - - Retrieves the value of the object that is associated with the specified key. - The value of the object for the specified key. - The key. - true if validation should be skipped; otherwise, false. - - - Defines the methods that are required for a value provider in ASP.NET MVC. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Retrieves a value object using the specified key. - The value object for the specified key. - The key of the value object to retrieve. - - - Defines the methods that are required for a view. - - - Renders the specified view context by using the specified the writer object. - The view context. - The writer object. - - - Defines the methods that are required for a view data dictionary. - - - Gets or sets the view data dictionary. - The view data dictionary. - - - Defines the methods that are required for a view engine. - - - Finds the specified partial view by using the specified controller context. - The partial view. - The controller context. - The name of the partial view. - true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false. - - - Finds the specified view by using the specified controller context. - The page view. - The controller context. - The name of the view. - The name of the master. - true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false. - - - Releases the specified view by using the specified controller context. - The controller context. - The view. - - - Defines the methods that are required in order to cache view locations in memory. - - - Gets the view location by using the specified HTTP context and the cache key. - The view location. - The HTTP context. - The cache key. - - - Inserts the specified view location into the cache by using the specified HTTP context and the cache key. - The HTTP context. - The cache key. - The virtual path. - - - Provides fine-grained control over how view pages are instantiated using dependency injection. - - - The created view page. - The controller context. - The type of the controller. - - - Sends JavaScript content to the response. - - - Initializes a new instance of the class. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets or sets the script. - The script. - - - Specifies whether HTTP GET requests from the client are allowed. - - - HTTP GET requests from the client are allowed. - - - HTTP GET requests from the client are not allowed. - - - Represents a class that is used to send JSON-formatted content to the response. - - - Initializes a new instance of the class. - - - Gets or sets the content encoding. - The content encoding. - - - Gets or sets the type of the content. - The type of the content. - - - Gets or sets the data. - The data. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets or sets a value that indicates whether HTTP GET requests from the client are allowed. - A value that indicates whether HTTP GET requests from the client are allowed. - - - Enables action methods to send and receive JSON-formatted text and to model-bind the JSON text to parameters of action methods. - - - Initializes a new instance of the class. - - - Returns a JSON value-provider object for the specified controller context. - A JSON value-provider object for the specified controller context. - The controller context. - - - Maps a browser request to a LINQ object. - - - Initializes a new instance of the class. - - - Binds the model by using the specified controller context and binding context. - The bound data object. If the model cannot be bound, this method returns null. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Represents an attribute that is used to associate a model type to a model-builder type. - - - Initializes a new instance of the class. - The type of the binder. - The parameter is null. - - - Gets or sets the type of the binder. - The type of the binder. - - - Retrieves an instance of the model binder. - A reference to an object that implements the interface. - An error occurred while an instance of the model binder was being created. - - - Represents a class that contains all model binders for the application, listed by binder type. - - - Initializes a new instance of the class. - - - Adds the specified item to the model binder dictionary. - The object to add to the instance. - The object is read-only. - - - Adds the specified item to the model binder dictionary using the specified key. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the same key already exists in the object. - - - Removes all items from the model binder dictionary. - The object is read-only. - - - Determines whether the model binder dictionary contains a specified value. - true if is found in the model binder dictionary; otherwise, false. - The object to locate in the object. - - - Determines whether the model binder dictionary contains an element that has the specified key. - true if the model binder dictionary contains an element that has the specified key; otherwise, false. - The key to locate in the object. - - is null. - - - Copies the elements of the model binder dictionary to an array, starting at a specified index. - The one-dimensional array that is the destination of the elements copied from . The array must have zero-based indexing. - The zero-based index in at which copying starts. - - 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 object is greater than the available space from to the end of the destination array. -or- Type cannot be cast automatically to the type of the destination array. - - - Gets the number of elements in the model binder dictionary. - The number of elements in the model binder dictionary. - - - Gets or sets the default model binder. - The default model binder. - - - Retrieves the model binder for the specified type. - The model binder. - The type of the model to retrieve. - The parameter is null. - - - Retrieves the model binder for the specified type or retrieves the default model binder. - The model binder. - The type of the model to retrieve. - true to retrieve the default model binder. - The parameter is null. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the model binder dictionary is read-only. - true if the model binder dictionary is read-only; otherwise, false. - - - Gets or sets the specified key in an object that implements the interface. - The key for the specified item. - The item key. - - - Gets a collection that contains the keys in the model binder dictionary. - A collection that contains the keys in the model binder dictionary. - - - Removes the first occurrence of the specified element from the model binder dictionary. - true if was successfully removed from the model binder dictionary; otherwise, false. This method also returns false if is not found in the model binder dictionary. - The object to remove from the object. - The object is read-only. - - - Removes the element that has the specified key from the model binder dictionary. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the model binder dictionary. - The key of the element to remove. - The object is read-only. - - is null. - - - Returns an enumerator that can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - Gets the value that is associated with the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the 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. - - is null. - - - Gets a collection that contains the values in the model binder dictionary. - A collection that contains the values in the model binder dictionary. - - - Provides a container for model binder providers. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a list of model binder providers. - A list of model binder providers. - - - Returns a model binder of the specified type. - A model binder of the specified type. - The type of the model binder. - - - Inserts a model binder provider into the at the specified index. - The index. - The model binder provider. - - - Replaces the model binder provider element at the specified index. - The index. - The model binder provider. - - - Provides a container for model binder providers. - - - Provides a registration point for model binder providers for applications that do not use dependency injection. - The model binder provider collection. - - - Provides global access to the model binders for the application. - - - Gets the model binders for the application. - The model binders for the application. - - - Provides the context in which a model binder functions. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the binding context. - The binding context. - - - Gets or sets a value that indicates whether the binder should use an empty prefix. - true if the binder should use an empty prefix; otherwise, false. - - - Gets or sets the model. - The model. - - - Gets or sets the model metadata. - The model metadata. - - - Gets or sets the name of the model. - The name of the model. - - - Gets or sets the state of the model. - The state of the model. - - - Gets or sets the type of the model. - The type of the model. - - - Gets or sets the property filter. - The property filter. - - - Gets the property metadata. - The property metadata. - - - Gets or sets the value provider. - The value provider. - - - Provides a container for an equality validation rule that is sent to the browser. - - - Initializes a new instance of the class. - The error message. - The model value used for equality comparison. - - - Provides a container for a range-validation rule that is sent to the browser. - - - Initializes a new instance of the class. - The error message. - The minimum value. - The maximum value. - - - Provides a container for a regular-expression client validation rule that is sent to the browser. - - - Initializes a new instance of the class. - The error message to display when the regular expression validation fails. - The regular expression. - - - Provides a container for a remote validation rule that is sent to the browser. - - - Initializes a new instance of the class. - The error message. - The URL for the validation parameters. - The HTTP method for the validation parameters. - - - Provides a container for client validation for required field. - - - Initializes a new instance of the class. - The error message to display when a value for the required field is not provided. - - - Provides a base class container for a client validation rule that is sent to the browser. - - - Initializes a new instance of the class. - - - Gets or sets the error message for the client validation rule. - The error message for the client validation rule. - - - Gets the list of validation parameters. - A list of validation parameters. - - - Gets or sets the validation type. - The validation type. - - - Provides a container for a string-length validation rule that is sent to the browser. - - - Initializes a new instance of the class. - The validation error message. - The minimum length of the string. - The maximum length of the string. - - - Represents an error that occurs during model binding. - - - Initializes a new instance of the class by using the specified exception. - The exception. - The parameter is null. - - - Initializes a new instance of the class by using the specified exception and error message. - The exception. - The error message. - The parameter is null. - - - Initializes a new instance of the class by using the specified error message. - The error message. - - - Gets or sets the error message. - The error message. - - - Gets or sets the exception object. - The exception object. - - - A collection of instances. - - - Initializes a new instance of the class. - - - Adds the specified object to the model-error collection. - The exception. - - - Adds the specified error message to the model-error collection. - The error message. - - - Provides a container for common metadata, for the class, and for the class for a data model. - - - Initializes a new instance of the class. - The provider. - The type of the container. - The model accessor. - The type of the model. - The name of the model. - - - Gets a dictionary that contains additional metadata about the model. - A dictionary that contains additional metadata about the model. - - - Gets or sets the type of the container for the model. - The type of the container for the model. - - - Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. - true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true. - - - Gets or sets meta information about the data type. - Meta information about the data type. - - - The default order value, which is 10000. - - - Gets or sets the description of the model. - The description of the model. The default value is null. - - - Gets or sets the display format string for the model. - The display format string for the model. - - - Gets or sets the display name of the model. - The display name of the model. - - - Gets or sets the edit format string of the model. - The edit format string of the model. - - - Returns the metadata from the parameter for the model. - The metadata. - An expression that identifies the model. - The view data dictionary. - The type of the parameter. - The type of the value. - - - Gets the metadata from the expression parameter for the model. - The metadata for the model. - An expression that identifies the model. - The view data dictionary. - - - Gets the display name for the model. - The display name for the model. - - - Returns the simple description of the model. - The simple description of the model. - - - Gets a list of validators for the model. - A list of validators for the model. - The controller context. - - - Gets or sets a value that indicates whether the model object should be rendered using associated HTML elements. - true if the associated HTML elements that contains the model object should be included with the object; otherwise, false. - - - Gets or sets a value that indicates whether the model is a complex type. - A value that indicates whether the model is considered a complex type by the MVC framework. - - - Gets a value that indicates whether the type is nullable. - true if the type is nullable; otherwise, false. - - - Gets or sets a value that indicates whether the model is read-only. - true if the model is read-only; otherwise, false. - - - Gets or sets a value that indicates whether the model is required. - true if the model is required; otherwise, false. - - - Gets the value of the model. - The value of the model. For more information about , see the entry ASP.NET MVC 2 Templates, Part 2: ModelMetadata on Brad Wilson's blog - - - Gets the type of the model. - The type of the model. - - - Gets or sets the string to display for null values. - The string to display for null values. - - - Gets or sets a value that represents order of the current metadata. - The order value of the current metadata. - - - Gets a collection of model metadata objects that describe the properties of the model. - A collection of model metadata objects that describe the properties of the model. - - - Gets the property name. - The property name. - - - Gets or sets the provider. - The provider. - - - Gets or sets a value that indicates whether request validation is enabled. - true if request validation is enabled; otherwise, false. - - - Gets or sets a short display name. - The short display name. - - - Gets or sets a value that indicates whether the property should be displayed in read-only views such as list and detail views. - true if the model should be displayed in read-only views; otherwise, false. - - - Gets or sets a value that indicates whether the model should be displayed in editable views. - true if the model should be displayed in editable views; otherwise, false. - - - Gets or sets the simple display string for the model. - The simple display string for the model. - - - Gets or sets a hint that suggests what template to use for this model. - A hint that suggests what template to use for this model. - - - Gets or sets a value that can be used as a watermark. - The watermark. - - - Provides an abstract base class for a custom metadata provider. - - - When overridden in a derived class, initializes a new instance of the object that derives from the class. - - - Gets a object for each property of a model. - A object for each property of a model. - The container. - The type of the container. - - - Gets metadata for the specified property. - A object for the property. - The model accessor. - The type of the container. - The property to get the metadata model for. - - - Gets metadata for the specified model accessor and model type. - A object for the specified model accessor and model type. - The model accessor. - The type of the model. - - - Provides a container for the current instance. - - - Gets or sets the current object. - The current object. - - - Encapsulates the state of model binding to a property of an action-method argument, or to the argument itself. - - - Initializes a new instance of the class. - - - Returns a object that contains any errors that occurred during model binding. - The errors. - - - Returns a object that encapsulates the value that was being bound during model binding. - The value. - - - Represents the state of an attempt to bind a posted form to an action method, which includes validation information. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using values that are copied from the specified model-state dictionary. - The model-state dictionary. - The parameter is null. - - - Adds the specified item to the model-state dictionary. - The object to add to the model-state dictionary. - The model-state dictionary is read-only. - - - Adds an element that has the specified key and value to the model-state dictionary. - The key of the element to add. - The value of the element to add. - The model-state dictionary is read-only. - - is null. - An element that has the specified key already occurs in the model-state dictionary. - - - Adds the specified model error to the errors collection for the model-state dictionary that is associated with the specified key. - The key. - The exception. - - - Adds the specified error message to the errors collection for the model-state dictionary that is associated with the specified key. - The key. - The error message. - - - Removes all items from the model-state dictionary. - The model-state dictionary is read-only. - - - Determines whether the model-state dictionary contains a specific value. - true if is found in the model-state dictionary; otherwise, false. - The object to locate in the model-state dictionary. - - - Determines whether the model-state dictionary contains the specified key. - true if the model-state dictionary contains the specified key; otherwise, false. - The key to locate in the model-state dictionary. - - - Copies the elements of the model-state dictionary to an array, starting at a specified index. - The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. - The zero-based index in at which copying starts. - - 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 collection 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 . - - - Gets the number of key/value pairs in the collection. - The number of key/value pairs in the collection. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets a value that indicates whether this instance of the model-state dictionary is valid. - true if this instance is valid; otherwise, false. - - - Determines whether there are any objects that are associated with or prefixed with the specified key. - true if the model-state dictionary contains a value that is associated with the specified key; otherwise, false. - The key. - The parameter is null. - - - Gets or sets the value that is associated with the specified key. - The model state item. - The key. - - - Gets a collection that contains the keys in the dictionary. - A collection that contains the keys of the model-state dictionary. - - - Copies the values from the specified object into this dictionary, overwriting existing values if keys are the same. - The dictionary. - - - Removes the first occurrence of the specified object from the model-state dictionary. - true if was successfully removed the model-state dictionary; otherwise, false. This method also returns false if is not found in the model-state dictionary. - The object to remove from the model-state dictionary. - The model-state dictionary is read-only. - - - Removes the element that has the specified key from the model-state dictionary. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the model-state dictionary. - The key of the element to remove. - The model-state dictionary is read-only. - - is null. - - - Sets the value for the specified key by using the specified value provider dictionary. - The key. - The value. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Attempts to gets the value that is associated with the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the 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. - - is null. - - - Gets a collection that contains the values in the dictionary. - A collection that contains the values of the model-state dictionary. - - - Provides a container for a validation result. - - - Initializes a new instance of the class. - - - Gets or sets the name of the member. - The name of the member. - - - Gets or sets the validation result message. - The validation result message. - - - Provides a base class for implementing validation logic. - - - Called from constructors in derived classes to initialize the class. - The metadata. - The controller context. - - - Gets the controller context. - The controller context. - - - When implemented in a derived class, returns metadata for client validation. - The metadata for client validation. - - - Returns a composite model validator for the model. - A composite model validator for the model. - The metadata. - The controller context. - - - Gets or sets a value that indicates whether a model property is required. - true if the model property is required; otherwise, false. - - - Gets the metadata for the model validator. - The metadata for the model validator. - - - When implemented in a derived class, validates the object. - A list of validation results. - The container. - - - Provides a list of validators for a model. - - - When implemented in a derived class, initializes a new instance of the class. - - - Gets a list of validators. - A list of validators. - The metadata. - The context. - - - Provides a container for a list of validation providers. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a list of model-validation providers. - A list of model-validation providers. - - - Returns the list of model validators. - The list of model validators. - The model metadata. - The controller context. - - - Inserts a model-validator provider into the collection. - The zero-based index at which item should be inserted. - The model-validator provider object to insert. - - - Replaces the model-validator provider element at the specified index. - The zero-based index of the model-validator provider element to replace. - The new value for the model-validator provider element. - - - Provides a container for the current validation provider. - - - Gets the model validator provider collection. - The model validator provider collection. - - - Represents a list of items that users can select more than one item from. - - - Initializes a new instance of the class by using the specified items to include in the list. - The items. - The parameter is null. - - - Initializes a new instance of the class by using the specified items to include in the list and the selected values. - The items. - The selected values. - The parameter is null. - - - Initializes a new instance of the class by using the items to include in the list, the data value field, and the data text field. - The items. - The data value field. - The data text field. - The parameter is null. - - - Initializes a new instance of the class by using the items to include in the list, the data value field, the data text field, and the selected values. - The items. - The data value field. - The data text field. - The selected values. - The parameter is null. - - - Gets or sets the data text field. - The data text field. - - - Gets or sets the data value field. - The data value field. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets or sets the items in the list. - The items in the list. - - - Gets or sets the selected values. - The selected values. - - - Returns an enumerator can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - When implemented in a derived class, provides a metadata class that contains a reference to the implementation of one or more of the filter interfaces, the filter's order, and the filter's scope. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and specifies the order of filters and whether multiple filters are allowed. - true to specify that multiple filters of the same type are allowed; otherwise, false. - The filter order. - - - Gets a value that indicates whether more than one instance of the filter attribute can be specified. - true if more than one instance of the filter attribute is allowed; otherwise, false. - - - Gets a value that indicates the order in which a filter is applied. - A value that indicates the order in which a filter is applied. - - - Selects the controller that will handle an HTTP request. - - - Initializes a new instance of the class. - The request context. - The parameter is null. - - - Adds the version header by using the specified HTTP context. - The HTTP context. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The state of the asynchronous object. - - - Called by ASP.NET to begin asynchronous request processing using the base HTTP context. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The state of the asynchronous object. - - - Gets or sets a value that indicates whether the MVC response header is disabled. - true if the MVC response header is disabled; otherwise, false. - - - Called by ASP.NET when asynchronous request processing has ended. - The asynchronous result. - - - Gets a value that indicates whether another request can use the instance. - true if the instance is reusable; otherwise, false. - - - Contains the header name of the ASP.NET MVC version. - - - Processes the request by using the specified HTTP request context. - The HTTP context. - - - Processes the request by using the specified base HTTP request context. - The HTTP context. - - - Gets the request context. - The request context. - - - Called by ASP.NET to begin asynchronous request processing using the base HTTP context. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The data. - - - Called by ASP.NET when asynchronous request processing has ended. - The asynchronous result. - - - Gets a value that indicates whether another request can use the instance. - true if the instance is reusable; otherwise, false. - - - Enables processing of HTTP Web requests by a custom HTTP handler that implements the interface. - An object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) that are used to service HTTP requests. - - - Represents an HTML-encoded string that should not be encoded again. - - - Initializes a new instance of the class. - The string to create. If no value is assigned, the object is created using an empty-string value. - - - Creates an HTML-encoded string using the specified text value. - An HTML-encoded string. - The value of the string to create . - - - Contains an empty HTML string. - - - Determines whether the specified string contains content or is either null or empty. - true if the string is null or empty; otherwise, false. - The string. - - - Verifies and processes an HTTP request. - - - Initializes a new instance of the class. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The state. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The base HTTP context. - The asynchronous callback method. - The state. - - - Called by ASP.NET when asynchronous request processing has ended. - The asynchronous result. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The context. - The asynchronous callback method. - An object that contains data. - - - Called by ASP.NET when asynchronous request processing has ended. - The status of the asynchronous operations. - - - Verifies and processes an HTTP request. - The HTTP handler. - The HTTP context. - - - Creates an object that implements the IHttpHandler interface and passes the request context to it. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified factory controller object. - The controller factory. - - - Returns the HTTP handler by using the specified HTTP context. - The HTTP handler. - The request context. - - - Returns the session behavior. - The session behavior. - The request context. - - - Returns the HTTP handler by using the specified request context. - The HTTP handler. - The request context. - - - Creates instances of files. - - - Initializes a new instance of the class. - - - Creates a Razor host. - A Razor host. - The virtual path to the target file. - The physical path to the target file. - - - Extends a NameValueCollection object so that the collection can be copied to a specified dictionary. - - - Copies the specified collection to the specified destination. - The collection. - The destination. - - - Copies the specified collection to the specified destination, and optionally replaces previous entries. - The collection. - The destination. - true to replace previous entries; otherwise, false. - - - Represents the base class for value providers whose values come from a object. - - - Initializes a new instance of the class using the specified unvalidated collection. - A collection that contains the values that are used to initialize the provider. - A collection that contains the values that are used to initialize the provider. This collection will not be validated. - An object that contains information about the target culture. - - - Initializes a new instance of the class. - A collection that contains the values that are used to initialize the provider. - An object that contains information about the target culture. - The parameter is null. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - The parameter is null. - - - Returns a value object using the specified key. - The value object for the specified key. - The key of the value object to retrieve. - The parameter is null. - - - Returns a value object using the specified key and validation directive. - The value object for the specified key. - The key. - true if validation should be skipped; otherwise, false. - - - Provides a convenience wrapper for the attribute. - - - Initializes a new instance of the class. - - - Represents an attribute that is used to indicate that a controller method is not an action method. - - - Initializes a new instance of the class. - - - Determines whether the attribute marks a method that is not an action method by using the specified controller context. - true if the attribute marks a valid non-action method; otherwise, false. - The controller context. - The method information. - - - Represents an attribute that is used to mark an action method whose output will be cached. - - - Initializes a new instance of the class. - - - Gets or sets the cache profile name. - The cache profile name. - - - Gets or sets the child action cache. - The child action cache. - - - Gets or sets the cache duration, in seconds. - The cache duration. - - - Returns a value that indicates whether a child action cache is active. - true if the child action cache is active; otherwise, false. - The controller context. - - - Gets or sets the location. - The location. - - - Gets or sets a value that indicates whether to store the cache. - true if the cache should be stored; otherwise, false. - - - This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. - The filter context. - - - This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. - The filter context. - - - This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. - The filter context. - - - This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. - The filter context. - - - Called before the action result executes. - The filter context, which encapsulates information for using . - The parameter is null. - - - Gets or sets the SQL dependency. - The SQL dependency. - - - Gets or sets the vary-by-content encoding. - The vary-by-content encoding. - - - Gets or sets the vary-by-custom value. - The vary-by-custom value. - - - Gets or sets the vary-by-header value. - The vary-by-header value. - - - Gets or sets the vary-by-param value. - The vary-by-param value. - - - Encapsulates information for binding action-method parameters to a data model. - - - Initializes a new instance of the class. - - - Gets the model binder. - The model binder. - - - Gets a comma-delimited list of property names for which binding is disabled. - The exclude list. - - - Gets a comma-delimited list of property names for which binding is enabled. - The include list. - - - Gets the prefix to use when the MVC framework binds a value to an action parameter or to a model property. - The prefix. - - - Contains information that describes a parameter. - - - Initializes a new instance of the class. - - - Gets the action descriptor. - The action descriptor. - - - Gets the binding information. - The binding information. - - - Gets the default value of the parameter. - The default value of the parameter. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - The parameter is null. - - - Indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The parameter is null. - - - Gets the name of the parameter. - The name of the parameter. - - - Gets the type of the parameter. - The type of the parameter. - - - Represents a base class that is used to send a partial view to the response. - - - Initializes a new instance of the class. - - - Returns the object that is used to render the view. - The view engine result. - The controller context. - An error occurred while the method was attempting to find the view. - - - Provides a registration point for ASP.NET Razor pre-application start code. - - - Registers Razor pre-application start code. - - - Represents a value provider for query strings that are contained in a object. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - - - Represents a class that is responsible for creating a new instance of a query-string value-provider object. - - - Initializes a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A query-string value-provider object. - An object that encapsulates information about the current HTTP request. - The parameter is null. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The range attribute. - - - Gets a list of client validation rules for a range check. - A list of client validation rules for a range check. - - - Represents the class used to create views that have Razor syntax. - - - Initializes a new instance of the class. - The controller context. - The view path. - The layout or master page. - A value that indicates whether view start files should be executed before the view. - The set of extensions that will be used when looking up view start files. - - - Initializes a new instance of the class using the view page activator. - The controller context. - The view path. - The layout or master page. - A value that indicates whether view start files should be executed before the view. - The set of extensions that will be used when looking up view start files. - The view page activator. - - - Gets the layout or master page. - The layout or master page. - - - Renders the specified view context by using the specified writer and instance. - The view context. - The writer that is used to render the view to the response. - The instance. - - - Gets a value that indicates whether view start files should be executed before the view. - A value that indicates whether view start files should be executed before the view. - - - Gets or sets the set of file extensions that will be used when looking up view start files. - The set of file extensions that will be used when looking up view start files. - - - Represents a view engine that is used to render a Web page that uses the ASP.NET Razor syntax. - - - Initializes a new instance of the class. - - - - Creates a partial view using the specified controller context and partial path. - The partial view. - The controller context. - The path to the partial view. - - - Creates a view by using the specified controller context and the paths of the view and master view. - The view. - The controller context. - The path to the view. - The path to the master view. - - - Controls the processing of application actions by redirecting to a specified URI. - - - Initializes a new instance of the class. - The target URL. - The parameter is null. - - - Initializes a new instance of the class using the specified URL and permanent-redirection flag. - The URL. - A value that indicates whether the redirection should be permanent. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets a value that indicates whether the redirection should be permanent. - true if the redirection should be permanent; otherwise, false. - - - Gets or sets the target URL. - The target URL. - - - Represents a result that performs a redirection by using the specified route values dictionary. - - - Initializes a new instance of the class by using the specified route name and route values. - The name of the route. - The route values. - - - Initializes a new instance of the class by using the specified route name, route values, and permanent-redirection flag. - The name of the route. - The route values. - A value that indicates whether the redirection should be permanent. - - - Initializes a new instance of the class by using the specified route values. - The route values. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets a value that indicates whether the redirection should be permanent. - true if the redirection should be permanent; otherwise, false. - - - Gets or sets the name of the route. - The name of the route. - - - Gets or sets the route values. - The route values. - - - Contains information that describes a reflected action method. - - - Initializes a new instance of the class. - The action-method information. - The name of the action. - The controller descriptor. - Either the or parameter is null. - The parameter is null or empty. - - - Gets the name of the action. - The name of the action. - - - Gets the controller descriptor. - The controller descriptor. - - - Executes the specified controller context by using the specified action-method parameters. - The action return value. - The controller context. - The parameters. - The or parameter is null. - - - Returns an array of custom attributes defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Retrieves the parameters of the action method. - The parameters of the action method. - - - Retrieves the action selectors. - The action selectors. - - - Indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Gets or sets the action-method information. - The action-method information. - - - Gets the unique ID for the reflected action descriptor using lazy initialization. - The unique ID. - - - Contains information that describes a reflected controller. - - - Initializes a new instance of the class. - The type of the controller. - The parameter is null. - - - Gets the type of the controller. - The type of the controller. - - - Finds the specified action for the specified controller context. - The information about the action. - The controller context. - The name of the action. - The parameter is null. - The parameter is null or empty. - - - Returns the list of actions for the controller. - A list of action descriptors for the controller. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns a value that indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Contains information that describes a reflected action-method parameter. - - - Initializes a new instance of the class. - The parameter information. - The action descriptor. - The or parameter is null. - - - Gets the action descriptor. - The action descriptor. - - - Gets the binding information. - The binding information. - - - Gets the default value of the reflected parameter. - The default value of the reflected parameter. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns a value that indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Gets or sets the parameter information. - The parameter information. - - - Gets the name of the parameter. - The name of the parameter. - - - Gets the type of the parameter. - The type of the parameter. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The regular expression attribute. - - - Gets a list of regular-expression client validation rules. - A list of regular-expression client validation rules. - - - Provides an attribute that uses the jQuery validation plug-in remote validator. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified route name. - The route name. - - - Initializes a new instance of the class using the specified action-method name and controller name. - The name of the action method. - The name of the controller. - - - Initializes a new instance of the class using the specified action-method name, controller name, and area name. - The name of the action method. - The name of the controller. - The name of the area. - - - Gets or sets the additional fields that are required for validation. - The additional fields that are required for validation. - - - Returns a comma-delimited string of validation field names. - A comma-delimited string of validation field names. - The name of the validation property. - - - Formats the error message that is displayed when validation fails. - A formatted error message. - A name to display with the error message. - - - Formats the property for client validation by prepending an asterisk (*) and a dot. - The string "*." Is prepended to the property. - The property. - - - Gets a list of client validation rules for the property. - A list of remote client validation rules for the property. - The model metadata. - The controller context. - - - Gets the URL for the remote validation call. - The URL for the remote validation call. - The controller context. - - - Gets or sets the HTTP method used for remote validation. - The HTTP method used for remote validation. The default value is "Get". - - - This method always returns true. - true - The validation target. - - - Gets the route data dictionary. - The route data dictionary. - - - Gets or sets the route name. - The route name. - - - Gets the route collection from the route table. - The route collection from the route table. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The required attribute. - - - Gets a list of required-value client validation rules. - A list of required-value client validation rules. - - - Represents an attribute that forces an unsecured HTTP request to be re-sent over HTTPS. - - - Initializes a new instance of the class. - - - Handles unsecured HTTP requests that are sent to the action method. - An object that encapsulates information that is required in order to use the attribute. - The HTTP request contains an invalid transfer method override. All GET requests are considered invalid. - - - Determines whether a request is secured (HTTPS) and, if it is not, calls the method. - An object that encapsulates information that is required in order to use the attribute. - The parameter is null. - - - Provides the context for the method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The controller context. - The result object. - true to cancel execution; otherwise, false. - The exception object. - The parameter is null. - - - Gets or sets a value that indicates whether this instance is canceled. - true if the instance is canceled; otherwise, false. - - - Gets or sets the exception object. - The exception object. - - - Gets or sets a value that indicates whether the exception has been handled. - true if the exception has been handled; otherwise, false. - - - Gets or sets the action result. - The action result. - - - Provides the context for the method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified controller context and action result. - The controller context. - The action result. - The parameter is null. - - - Gets or sets a value that indicates whether this value is "cancel". - true if the value is "cancel"; otherwise, false. - - - Gets or sets the action result. - The action result. - - - Extends a object for MVC routing. - - - Returns an object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains the routes for the applications. - An object that encapsulates information about the requested route. - The name of the route to use when information about the URL path is retrieved. - An object that contains the parameters for a route. - - - Returns an object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains the routes for the applications. - An object that encapsulates information about the requested route. - An object that contains the parameters for a route. - - - Ignores the specified URL route for the given list of available routes. - A collection of routes for the application. - The URL pattern for the route to ignore. - The or parameter is null. - - - Ignores the specified URL route for the given list of the available routes and a list of constraints. - A collection of routes for the application. - The URL pattern for the route to ignore. - A set of expressions that specify values for the parameter. - The or parameter is null. - - - Maps the specified URL route. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - The or parameter is null. - - - Maps the specified URL route and sets default route values. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - The or parameter is null. - - - Maps the specified URL route and sets default route values and constraints. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify values for the parameter. - The or parameter is null. - - - Maps the specified URL route and sets default route values, constraints, and namespaces. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify values for the parameter. - A set of namespaces for the application. - The or parameter is null. - - - Maps the specified URL route and sets default route values and namespaces. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - A set of namespaces for the application. - The or parameter is null. - - - Maps the specified URL route and sets the namespaces. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - A set of namespaces for the application. - The or parameter is null. - - - Represents a value provider for route data that is contained in an object that implements the interface. - - - Initializes a new instance of the class. - An object that contain information about the HTTP request. - - - Represents a factory for creating route-data value provider objects. - - - Initialized a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A value-provider object. - An object that encapsulates information about the current HTTP request. - The parameter is null. - - - Represents a list that lets users select one item. - - - Initializes a new instance of the class by using the specified items for the list. - The items. - - - Initializes a new instance of the class by using the specified items for the list and a selected value. - The items. - The selected value. - - - Initializes a new instance of the class by using the specified items for the list, the data value field, and the data text field. - The items. - The data value field. - The data text field. - - - Initializes a new instance of the class by using the specified items for the list, the data value field, the data text field, and a selected value. - The items. - The data value field. - The data text field. - The selected value. - - - Gets the list value that was selected by the user. - The selected value. - - - Represents the selected item in an instance of the class. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether this is selected. - true if the item is selected; otherwise, false. - - - Gets or sets the text of the selected item. - The text. - - - Gets or sets the value of the selected item. - The value. - - - Specifies the session state of the controller. - - - Initializes a new instance of the class - The type of the session state. - - - Get the session state behavior for the controller. - The session state behavior for the controller. - - - Provides session-state data to the current object. - - - Initializes a new instance of the class. - - - Loads the temporary data by using the specified controller context. - The temporary data. - The controller context. - An error occurred when the session context was being retrieved. - - - Saves the specified values in the temporary data dictionary by using the specified controller context. - The controller context. - The values. - An error occurred the session context was being retrieved. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The string-length attribute. - - - Gets a list of string-length client validation rules. - A list of string-length client validation rules. - - - Represents a set of data that persists only from one request to the next. - - - Initializes a new instance of the class. - - - Adds an element that has the specified key and value to the object. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the same key already exists in the object. - - - Removes all items from the instance. - The object is read-only. - - - Determines whether the instance contains an element that has the specified key. - true if the instance contains an element that has the specified key; otherwise, false. - The key to locate in the instance. - - is null. - - - Determines whether the dictionary contains the specified value. - true if the dictionary contains the specified value; otherwise, false. - The value. - - - Gets the number of elements in the object. - The number of elements in the object. - - - Gets the enumerator. - The enumerator. - - - Gets or sets the object that has the specified key. - The object that has the specified key. - The key to access. - - - Marks all keys in the dictionary for retention. - - - Marks the specified key in the dictionary for retention. - The key to retain in the dictionary. - - - Gets an object that contains the keys of elements in the object. - The keys of the elements in the object. - - - Loads the specified controller context by using the specified data provider. - The controller context. - The temporary data provider. - - - Returns an object that contains the element that is associated with the specified key, without marking the key for deletion. - An object that contains the element that is associated with the specified key. - The key of the element to return. - - - Removes the element that has the specified key from the object. - true if the element was removed successfully; otherwise, false. This method also returns false if was not found in the . instance. - The key of the element to remove. - The object is read-only. - - is null. - - - Saves the specified controller context by using the specified data provider. - The controller context. - The temporary data provider. - - - Adds the specified key/value pair to the dictionary. - The key/value pair. - - - Determines whether a sequence contains a specified element by using the default equality comparer. - true if the dictionary contains the specified key/value pair; otherwise, false. - The key/value pair to search for. - - - Copies a key/value pair to the specified array at the specified index. - The target array. - The index. - - - Gets a value that indicates whether the dictionary is read-only. - true if the dictionary is read-only; otherwise, false. - - - Deletes the specified key/value pair from the dictionary. - true if the key/value pair was removed successfully; otherwise, false. - The key/value pair. - - - Returns an enumerator that can be used to iterate through a collection. - An object that can be used to iterate through the collection. - - - Gets the value of the element that has the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the value to get. - When this method returns, the value that is 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. - - is null. - - - Gets the object that contains the values in the object. - The values of the elements in the object that implements . - - - Encapsulates information about the current template context. - - - Initializes a new instance of the class. - - - Gets or sets the formatted model value. - The formatted model value. - - - Retrieves the full DOM ID of a field using the specified HTML name attribute. - The full DOM ID. - The value of the HTML name attribute. - - - Retrieves the fully qualified name (including a prefix) for a field using the specified HTML name attribute. - The prefixed name of the field. - The value of the HTML name attribute. - - - Gets or sets the HTML field prefix. - The HTML field prefix. - - - Contains the number of objects that were visited by the user. - The number of objects. - - - Determines whether the template has been visited by the user. - true if the template has been visited by the user; otherwise, false. - An object that encapsulates information that describes the model. - - - Contains methods to build URLs for ASP.NET MVC within an application. - - - Initializes a new instance of the class using the specified request context. - An object that contains information about the current request and about the route that it matched. - The parameter is null. - - - Initializes a new instance of the class by using the specified request context and route collection. - An object that contains information about the current request and about the route that it matched. - A collection of routes. - The or the parameter is null. - - - Generates a fully qualified URL to an action method by using the specified action name. - The fully qualified URL to an action method. - The name of the action method. - - - Generates a fully qualified URL to an action method by using the specified action name and route values. - The fully qualified URL to an action method. - The name of the action method. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL to an action method by using the specified action name and controller name. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - - - Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL to an action method by using the specified action name, controller name, route values, and protocol to use. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The protocol for the URL, such as "http" or "https". - - - Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - - - Generates a fully qualified URL for an action method by using the specified action name, controller name, route values, protocol to use, and host name. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - - - Generates a fully qualified URL to an action method for the specified action name and route values. - The fully qualified URL to an action method. - The name of the action method. - An object that contains the parameters for a route. - - - Converts a virtual (relative) path to an application absolute path. - The application absolute path. - The virtual path of the content. - - - Encodes special characters in a URL string into character-entity equivalents. - An encoded URL string. - The text to encode. - - - Returns a string that contains a content URL. - A string that contains a content URL. - The content path. - The HTTP context. - - - Returns a string that contains a URL. - A string that contains a URL. - The route name. - The action name. - The controller name. - The HTTP protocol. - The host name. - The fragment. - The route values. - The route collection. - The request context. - true to include implicit MVC values; otherwise false. - - - Returns a string that contains a URL. - A string that contains a URL. - The route name. - The action name. - The controller name. - The route values. - The route collection. - The request context. - true to include implicit MVC values; otherwise. false. - - - Returns a value that indicates whether the URL is local. - true if the URL is local; otherwise, false. - The URL. - - - Gets information about an HTTP request that matches a defined route. - The request context. - - - Gets a collection that contains the routes that are registered for the application. - The route collection. - - - Generates a fully qualified URL for the specified route values. - The fully qualified URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL for the specified route name. - The fully qualified URL. - The name of the route that is used to generate the URL. - - - Generates a fully qualified URL for the specified route values by using a route name. - The fully qualified URL. - The name of the route that is used to generate the URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL for the specified route values by using a route name and the protocol to use. - The fully qualified URL. - The name of the route that is used to generate the URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The protocol for the URL, such as "http" or "https". - - - Generates a fully qualified URL for the specified route values by using a route name. - The fully qualified URL. - The name of the route that is used to generate the URL. - An object that contains the parameters for a route. - - - Generates a fully qualified URL for the specified route values by using the specified route name, protocol to use, and host name. - The fully qualified URL. - The name of the route that is used to generate the URL. - An object that contains the parameters for a route. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - - - Generates a fully qualified URL for the specified route values. - The fully qualified URL. - An object that contains the parameters for a route. - - - Represents an optional parameter that is used by the class during routing. - - - Contains the read-only value for the optional parameter. - - - Returns an empty string. This method supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. - An empty string. - - - Provides an object adapter that can be validated. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - - - Validates the specified object. - A list of validation results. - The container. - - - Represents an attribute that is used to detect whether a server request has been tampered with. - - - Initializes a new instance of the class. - - - Called when authorization is required. - The filter context. - The parameter is null. - - - Gets or sets the salt string. - The salt string. - - - Represents an attribute that is used to mark action methods whose input must be validated. - - - Initializes a new instance of the class. - true to enable validation. - - - Gets or sets a value that indicates whether to enable validation. - true if validation is enabled; otherwise, false. - - - Called when authorization is required. - The filter context. - The parameter is null. - - - Represents the collection of value-provider objects for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and registers the specified value providers. - The list of value providers to register. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Returns a value object using the specified key. - The value object for the specified key. - The key of the value object to retrieve. - - - Returns a value object using the specified key and skip-validation parameter. - The value object for the specified key. - The key of the value object to retrieve. - true to specify that validation should be skipped; otherwise, false. - - - Inserts the specified value-provider object into the collection at the specified index location. - The zero-based index location at which to insert the value provider into the collection. - The value-provider object to insert. - The parameter is null. - - - Replaces the value provider at the specified index location with a new value provider. - The zero-based index of the element to replace. - The new value for the element at the specified index. - The parameter is null. - - - Represents a dictionary of value providers for the application. - - - Initializes a new instance of the class. - The controller context. - - - Adds the specified item to the collection of value providers. - The object to add to the object. - The object is read-only. - - - Adds an element that has the specified key and value to the collection of value providers. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the specified key already exists in the object. - - - Adds an element that has the specified key and value to the collection of value providers. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the specified key already exists in the object. - - - Removes all items from the collection of value providers. - The object is read-only. - - - Determines whether the collection of value providers contains the specified item. - true if is found in the collection of value providers; otherwise, false. - The object to locate in the instance. - - - Determines whether the collection of value providers contains an element that has the specified key. - true if the collection of value providers contains an element that has the key; otherwise, false. - The key of the element to find in the instance. - - is null. - - - Gets or sets the controller context. - The controller context. - - - Copies the elements of the collection to an array, starting at the specified index. - The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. - The zero-based index in at which copying starts. - - 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 collection 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 array. - - - Gets the number of elements in the collection. - The number of elements in the collection. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets or sets the object that has the specified key. - The object. - The key. - - - Gets a collection that contains the keys of the instance. - A collection that contains the keys of the object that implements the interface. - - - Removes the first occurrence of the specified item from the collection of value providers. - true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the collection. - The object to remove from the instance. - The object is read-only. - - - Removes the element that has the specified key from the collection of value providers. - true if the element was successfully removed; otherwise, false. This method also returns false if was not found in the collection. - The key of the element to remove. - The object is read-only. - - is null. - - - Returns an enumerator that can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Returns a value object using the specified key. - The value object for the specified key. - The key of the value object to return. - - - Gets the value of the element that has the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the element to get. - When this method returns, the value that is 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. - - is null. - - - Gets a collection that contains the values in the object. - A collection of the values in the object that implements the interface. - - - Represents a container for value-provider factory objects. - - - Gets the collection of value-provider factories for the application. - The collection of value-provider factory objects. - - - Represents a factory for creating value-provider objects. - - - Initializes a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A value-provider object. - An object that encapsulates information about the current HTTP request. - - - Represents the collection of value-provider factories for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified list of value-provider factories. - A list of value-provider factories to initialize the collection with. - - - Returns the value-provider factory for the specified controller context. - The value-provider factory object for the specified controller context. - An object that encapsulates information about the current HTTP request. - - - Inserts the specified value-provider factory object at the specified index location. - The zero-based index location at which to insert the value provider into the collection. - The value-provider factory object to insert. - The parameter is null. - - - Sets the specified value-provider factory object at the given index location. - The zero-based index location at which to insert the value provider into the collection. - The value-provider factory object to set. - The parameter is null. - - - Represents the result of binding a value (such as from a form post or query string) to an action-method argument property, or to the argument itself. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified raw value, attempted value, and culture information. - The raw value. - The attempted value. - The culture. - - - Gets or sets the raw value that is converted to a string for display. - The raw value. - - - Converts the value that is encapsulated by this result to the specified type. - The converted value. - The target type. - The parameter is null. - - - Converts the value that is encapsulated by this result to the specified type by using the specified culture information. - The converted value. - The target type. - The culture to use in the conversion. - The parameter is null. - - - Gets or sets the culture. - The culture. - - - Gets or set the raw value that is supplied by the value provider. - The raw value. - - - Encapsulates information that is related to rendering a view. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified controller context, view, view data dictionary, temporary data dictionary, and text writer. - Encapsulates information about the HTTP request. - The view to render. - The dictionary that contains the data that is required in order to render the view. - The dictionary that contains temporary data for the view. - The text writer object that is used to write HTML output. - One of the parameters is null. - - - Gets or sets a value that indicates whether client-side validation is enabled. - true if client-side validation is enabled; otherwise, false. - - - Gets or sets an object that encapsulates information that is required in order to validate and process the input data from an HTML form. - An object that encapsulates information that is required in order to validate and process the input data from an HTML form. - - - Writes the client validation information to the HTTP response. - - - Gets data that is associated with this request and that is available for only one request. - The temporary data. - - - Gets or sets a value that indicates whether unobtrusive JavaScript is enabled. - true if unobtrusive JavaScript is enabled; otherwise, false. - - - Gets an object that implements the interface to render in the browser. - The view. - - - Gets the view data that is passed to the view. - The view data. - - - Gets or sets the text writer object that is used to write HTML output. - The object that is used to write the HTML output. - - - Represents a container that is used to pass data between a controller and a view. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified model. - The model. - - - Initializes a new instance of the class by using the specified dictionary. - The dictionary. - The parameter is null. - - - Adds the specified item to the collection. - The object to add to the collection. - The collection is read-only. - - - Adds an element to the collection using the specified key and value . - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element with the same key already exists in the object. - - - Removes all items from the collection. - The object is read-only. - - - Determines whether the collection contains the specified item. - true if is found in the collection; otherwise, false. - The object to locate in the collection. - - - Determines whether the collection contains an element that has the specified key. - true if the collection contains an element that has the specified key; otherwise, false. - The key of the element to locate in the collection. - - is null. - - - Copies the elements of the collection to an array, starting at a particular index. - The one-dimensional array that is the destination of the elements copied from the collection. The array 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 collection 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 . - - - Gets the number of elements in the collection. - The number of elements in the collection. - - - Evaluates the specified expression. - The results of the evaluation. - The expression. - The parameter is null or empty. - - - Evaluates the specified expression by using the specified format. - The results of the evaluation. - The expression. - The format. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Returns information about the view data as defined by the parameter. - An object that contains the view data information that is defined by the parameter. - A set of key/value pairs that define the view-data information to return. - The parameter is either null or empty. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets or sets the item that is associated with the specified key. - The value of the selected item. - The key. - - - Gets a collection that contains the keys of this dictionary. - A collection that contains the keys of the object that implements . - - - Gets or sets the model that is associated with the view data. - The model that is associated with the view data. - - - Gets or sets information about the model. - Information about the model. - - - Gets the state of the model. - The state of the model. - - - Removes the first occurrence of a specified object from the collection. - true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the collection. - The object to remove from the collection. - The collection is read-only. - - - Removes the element from the collection using the specified key. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original collection. - The key of the element to remove. - The collection is read-only. - - is null. - - - Sets the data model to use for the view. - The data model to use for the view. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets or sets an object that encapsulates information about the current template context. - An object that contains information about the current template. - - - Attempts to retrieve the value that is associated with the specified key. - true if the collection contains an element with the specified key; otherwise, false. - The key of the value to get. - When this method returns, the value that is 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. - - is null. - - - Gets a collection that contains the values in this dictionary. - A collection that contains the values of the object that implements . - - - Represents a container that is used to pass strongly typed data between a controller and a view. - The type of the model. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified view data dictionary. - An existing view data dictionary to copy into this instance. - - - Initializes a new instance of the class by using the specified model. - The data model to use for the view. - - - Gets or sets the model. - A reference to the data model. - - - Gets or sets information about the model. - Information about the model. - - - Sets the data model to use for the view. - The data model to use for the view. - An error occurred while the model was being set. - - - Encapsulates information about the current template content that is used to develop templates and about HTML helpers that interact with templates. - - - Initializes a new instance of the class. - - - Initializes a new instance of the T:System.Web.Mvc.ViewDataInfo class and associates a delegate for accessing the view data information. - A delegate that defines how the view data information is accessed. - - - Gets or sets the object that contains the values to be displayed by the template. - The object that contains the values to be displayed by the template. - - - Gets or sets the description of the property to be displayed by the template. - The description of the property to be displayed by the template. - - - Gets or sets the current value to be displayed by the template. - The current value to be displayed by the template. - - - Represents a collection of view engines that are available to the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified list of view engines. - The list that is wrapped by the new collection. - - is null. - - - Finds the specified partial view by using the specified controller context. - The partial view. - The controller context. - The name of the partial view. - The parameter is null. - The parameter is null or empty. - - - Finds the specified view by using the specified controller context and master view. - The view. - The controller context. - The name of the view. - The name of the master view. - The parameter is null. - The parameter is null or empty. - - - Inserts an element into the collection at the specified index. - The zero-based index at which should be inserted. - The object to insert. - - is less than zero.-or- is greater than the number of items in the collection. - The parameter is null. - - - 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. - - is less than zero.-or- is greater than the number of items in the collection. - The parameter is null. - - - Represents the result of locating a view engine. - - - Initializes a new instance of the class by using the specified searched locations. - The searched locations. - The parameter is null. - - - Initializes a new instance of the class by using the specified view and view engine. - The view. - The view engine. - The or parameter is null. - - - Gets or sets the searched locations. - The searched locations. - - - Gets or sets the view. - The view. - - - Gets or sets the view engine. - The view engine. - - - Represents a collection of view engines that are available to the application. - - - Gets the view engines. - The view engines. - - - Represents the information that is needed to build a master view page. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the master page. - The AJAX script for the master page. - - - Gets the HTML for the master page. - The HTML for the master page. - - - Gets the model. - The model. - - - Gets the temporary data. - The temporary data. - - - Gets the URL. - The URL. - - - Gets the dynamic view-bag dictionary. - The dynamic view-bag dictionary. - - - Gets the view context. - The view context. - - - Gets the view data. - The view data. - - - Gets the writer that is used to render the master page. - The writer that is used to render the master page. - - - Represents the information that is required in order to build a strongly typed master view page. - The type of the model. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the master page. - The AJAX script for the master page. - - - Gets the HTML for the master page. - The HTML for the master page. - - - Gets the model. - A reference to the data model. - - - Gets the view data. - The view data. - - - Represents the properties and methods that are needed to render a view as a Web Forms page. - - - Initializes a new instance of the class. - - - Gets or sets the object that is used to render HTML in Ajax scenarios. - The Ajax helper object that is associated with the view. - - - Gets or sets the object that is used to render HTML elements. - The HTML helper object that is associated with the view. - - - Initializes the , , and properties. - - - Gets or sets the path of the master view. - The path of the master view. - - - Gets the Model property of the associated object. - The Model property of the associated object. - - - Raises the event at the beginning of page initialization. - The event data. - - - Enables processing of the specified HTTP request by the ASP.NET MVC framework. - An object that encapsulates HTTP-specific information about the current HTTP request. - - - Initializes the object that receives the page content to be rendered. - The object that receives the page content. - - - Renders the view page to the response using the specified view context. - An object that encapsulates the information that is required in order to render the view, which includes the controller context, form context, the temporary data, and the view data for the associated view. - - - Sets the text writer that is used to render the view to the response. - The writer that is used to render the view to the response. - - - Sets the view data dictionary for the associated view. - A dictionary of data to pass to the view. - - - Gets the temporary data to pass to the view. - The temporary data to pass to the view. - - - Gets or sets the URL of the rendered page. - The URL of the rendered page. - - - Gets the view bag. - The view bag. - - - Gets or sets the information that is used to render the view. - The information that is used to render the view, which includes the form context, the temporary data, and the view data of the associated view. - - - Gets or sets a dictionary that contains data to pass between the controller and the view. - A dictionary that contains data to pass between the controller and the view. - - - Gets the text writer that is used to render the view to the response. - The text writer that is used to render the view to the response. - - - Represents the information that is required in order to render a strongly typed view as a Web Forms page. - The type of the model. - - - Initializes a new instance of the class. - - - Gets or sets the object that supports rendering HTML in Ajax scenarios. - The Ajax helper object that is associated with the view. - - - Gets or sets the object that provides support for rendering elements. - The HTML helper object that is associated with the view. - - - Instantiates and initializes the and properties. - - - Gets the property of the associated object. - A reference to the data model. - - - Sets the view data dictionary for the associated view. - A dictionary of data to pass to the view. - - - Gets or sets a dictionary that contains data to pass between the controller and the view. - A dictionary that contains data to pass between the controller and the view. - - - Represents a class that is used to render a view by using an instance that is returned by an object. - - - Initializes a new instance of the class. - - - Searches the registered view engines and returns the object that is used to render the view. - The object that is used to render the view. - The controller context. - An error occurred while the method was searching for the view. - - - Gets the name of the master view (such as a master page or template) to use when the view is rendered. - The name of the master view. - - - Represents a base class that is used to provide the model to the view and then render the view to the response. - - - Initializes a new instance of the class. - - - When called by the action invoker, renders the view to the response. - The context that the result is executed in. - The parameter is null. - - - Returns the object that is used to render the view. - The view engine. - The context. - - - Gets the view data model. - The view data model. - - - Gets or sets the object for this result. - The temporary data. - - - Gets or sets the object that is rendered to the response. - The view. - - - Gets the view bag. - The view bag. - - - Gets or sets the view data object for this result. - The view data. - - - Gets or sets the collection of view engines that are associated with this result. - The collection of view engines. - - - Gets or sets the name of the view to render. - The name of the view. - - - Provides an abstract class that can be used to implement a view start (master) page. - - - When implemented in a derived class, initializes a new instance of the class. - - - When implemented in a derived class, gets the HTML markup for the view start page. - The HTML markup for the view start page. - - - When implemented in a derived class, gets the URL for the view start page. - The URL for the view start page. - - - When implemented in a derived class, gets the view context for the view start page. - The view context for the view start page. - - - Provides a container for objects. - - - Initializes a new instance of the class. - - - Provides a container for objects. - The type of the model. - - - Initializes a new instance of the class. - - - Gets the formatted value. - The formatted value. - - - Represents the type of a view. - - - Initializes a new instance of the class. - - - Gets or sets the name of the type. - The name of the type. - - - Represents the information that is needed to build a user control. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the view. - The AJAX script for the view. - - - Ensures that view data is added to the object of the user control if the view data exists. - - - Gets the HTML for the view. - The HTML for the view. - - - Gets the model. - The model. - - - Renders the view by using the specified view context. - The view context. - - - Sets the text writer that is used to render the view to the response. - The writer that is used to render the view to the response. - - - Sets the view-data dictionary by using the specified view data. - The view data. - - - Gets the temporary-data dictionary. - The temporary-data dictionary. - - - Gets the URL for the view. - The URL for the view. - - - Gets the view bag. - The view bag. - - - Gets or sets the view context. - The view context. - - - Gets or sets the view-data dictionary. - The view-data dictionary. - - - Gets or sets the view-data key. - The view-data key. - - - Gets the writer that is used to render the view to the response. - The writer that is used to render the view to the response. - - - Represents the information that is required in order to build a strongly typed user control. - The type of the model. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the view. - The AJAX script for the view. - - - Gets the HTML for the view. - The HTML for the view. - - - Gets the model. - A reference to the data model. - - - Sets the view data for the view. - The view data. - - - Gets or sets the view data. - The view data. - - - Represents an abstract base-class implementation of the interface. - - - Initializes a new instance of the class. - - - Gets or sets the area-enabled master location formats. - The area-enabled master location formats. - - - Gets or sets the area-enabled partial-view location formats. - The area-enabled partial-view location formats. - - - Gets or sets the area-enabled view location formats. - The area-enabled view location formats. - - - Creates the specified partial view by using the specified controller context. - A reference to the partial view. - The controller context. - The partial path for the new partial view. - - - Creates the specified view by using the controller context, path of the view, and path of the master view. - A reference to the view. - The controller context. - The path of the view. - The path of the master view. - - - Returns a value that indicates whether the file is in the specified path by using the specified controller context. - true if the file is in the specified path; otherwise, false. - The controller context. - The virtual path. - - - Gets or sets the file-name extensions that are used to locate a view. - The file-name extensions that are used to locate a view. - - - Finds the specified partial view by using the specified controller context. - The partial view. - The controller context. - The name of the partial view. - true to use the cached partial view. - The parameter is null (Nothing in Visual Basic). - The parameter is null or empty. - - - Finds the specified view by using the specified controller context and master view name. - The page view. - The controller context. - The name of the view. - The name of the master view. - true to use the cached view. - The parameter is null (Nothing in Visual Basic). - The parameter is null or empty. - - - Gets or sets the master location formats. - The master location formats. - - - Gets or sets the partial-view location formats. - The partial-view location formats. - - - Releases the specified view by using the specified controller context. - The controller context. - The view to release. - - - Gets or sets the view location cache. - The view location cache. - - - Gets or sets the view location formats. - The view location formats. - - - Gets or sets the virtual path provider. - The virtual path provider. - - - Represents the information that is needed to build a Web Forms page in ASP.NET MVC. - - - Initializes a new instance of the class using the controller context and view path. - The controller context. - The view path. - - - Initializes a new instance of the class using the controller context, view path, and the path to the master page. - The controller context. - The view path. - The path to the master page. - - - Initializes a new instance of the class using the controller context, view path, the path to the master page, and a instance. - The controller context. - The view path. - The path to the master page. - An instance of the view page activator interface. - - - Gets or sets the master path. - The master path. - - - Renders the view to the response. - An object that encapsulates the information that is required in order to render the view, which includes the controller context, form context, the temporary data, and the view data for the associated view. - The text writer object that is used to write HTML output. - The view page instance. - - - Represents a view engine that is used to render a Web Forms page to the response. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified view page activator. - An instance of a class that implements the interface. - - - Creates the specified partial view by using the specified controller context. - The partial view. - The controller context. - The partial path. - - - Creates the specified view by using the specified controller context and the paths of the view and master view. - The view. - The controller context. - The view path. - The master-view path. - - - Represents the properties and methods that are needed in order to render a view that uses ASP.NET Razor syntax. - - - Initializes a new instance of the class. - - - Gets or sets the object that is used to render HTML using Ajax. - The object that is used to render HTML using Ajax. - - - Sets the view context and view data for the page. - The parent page. - - - Gets the object that is associated with the page. - The object that is associated with the page. - - - Runs the page hierarchy for the ASP.NET Razor execution pipeline. - - - Gets or sets the object that is used to render HTML elements. - The object that is used to render HTML elements. - - - Initializes the , , and classes. - - - Gets the Model property of the associated object. - The Model property of the associated object. - - - Sets the view data. - The view data. - - - Gets the temporary data to pass to the view. - The temporary data to pass to the view. - - - Gets or sets the URL of the rendered page. - The URL of the rendered page. - - - Gets the view bag. - The view bag. - - - Gets or sets the information that is used to render the view. - The information that is used to render the view, which includes the form context, the temporary data, and the view data of the associated view. - - - Gets or sets a dictionary that contains data to pass between the controller and the view. - A dictionary that contains data to pass between the controller and the view. - - - Represents the properties and methods that are needed in order to render a view that uses ASP.NET Razor syntax. - The type of the view data model. - - - Initializes a new instance of the class. - - - Gets or sets the object that is used to render HTML markup using Ajax. - The object that is used to render HTML markup using Ajax. - - - Gets or sets the object that is used to render HTML elements. - The object that is used to render HTML elements. - - - Initializes the , , and classes. - - - Gets the Model property of the associated object. - The Model property of the associated object. - - - Sets the view data. - The view data. - - - Gets or sets a dictionary that contains data to pass between the controller and the view. - A dictionary that contains data to pass between the controller and the view. - - - Represents support for ASP.NET AJAX within an ASP.NET MVC application. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element.. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML script element that contains a reference to a globalization script that defines the culture information. - A script element whose src attribute is set to the globalization script, as in the following example: <script type="text/javascript" src="/MvcApplication1/Scripts/Globalization/en-US.js"></script> - The AJAX helper object that this method extends. - - - Returns an HTML script element that contains a reference to a globalization script that defines the specified culture information. - An HTML script element whose src attribute is set to the globalization script, as in the following example:<script type="text/javascript" src="/MvcApplication1/Scripts/Globalization/en-US.js"></script> - The AJAX helper object that this method extends. - Encapsulates information about the target culture, such as date formats. - The parameter is null. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Represents option settings for running Ajax scripts in an ASP.NET MVC application. - - - Initializes a new instance of the class. - - - Gets or sets the message to display in a confirmation window before a request is submitted. - The message to display in a confirmation window. - - - Gets or sets the HTTP request method ("Get" or "Post"). - The HTTP request method. The default value is "Post". - - - Gets or sets the mode that specifies how to insert the response into the target DOM element. - The insertion mode ("InsertAfter", "InsertBefore", or "Replace"). The default value is "Replace". - - - Gets or sets a value, in milliseconds, that controls the duration of the animation when showing or hiding the loading element. - A value, in milliseconds, that controls the duration of the animation when showing or hiding the loading element. - - - Gets or sets the id attribute of an HTML element that is displayed while the Ajax function is loading. - The ID of the element that is displayed while the Ajax function is loading. - - - Gets or sets the name of the JavaScript function to call immediately before the page is updated. - The name of the JavaScript function to call before the page is updated. - - - Gets or sets the JavaScript function to call when response data has been instantiated but before the page is updated. - The JavaScript function to call when the response data has been instantiated. - - - Gets or sets the JavaScript function to call if the page update fails. - The JavaScript function to call if the page update fails. - - - Gets or sets the JavaScript function to call after the page is successfully updated. - The JavaScript function to call after the page is successfully updated. - - - Returns the Ajax options as a collection of HTML attributes to support unobtrusive JavaScript. - The Ajax options as a collection of HTML attributes to support unobtrusive JavaScript. - - - Gets or sets the ID of the DOM element to update by using the response from the server. - The ID of the DOM element to update. - - - Gets or sets the URL to make the request to. - The URL to make the request to. - - - Enumerates the AJAX script insertion modes. - - - Replace the element. - - - Insert before the element. - - - Insert after the element. - - - Provides information about an asynchronous action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - - - Invokes the asynchronous action method by using the specified parameters and controller context. - An object that contains the result of an asynchronous call. - The controller context. - The parameters of the action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Returns the result of an asynchronous operation. - The result of an asynchronous operation. - An object that represents the status of an asynchronous operation. - - - Executes the asynchronous action method by using the specified parameters and controller context. - The result of executing the asynchronous action method. - The controller context. - The parameters of the action method. - - - Represents a class that is responsible for invoking the action methods of an asynchronous controller. - - - Initializes a new instance of the class. - - - Invokes the asynchronous action method by using the specified controller context, action name, callback method, and state. - An object that contains the result of an asynchronous operation. - The controller context. - The name of the action. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Invokes the asynchronous action method by using the specified controller context, action descriptor, parameters, callback method, and state. - An object that contains the result of an asynchronous operation. - The controller context. - The action descriptor. - The parameters for the asynchronous action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Invokes the asynchronous action method by using the specified controller context, filters, action descriptor, parameters, callback method, and state. - An object that contains the result of an asynchronous operation. - The controller context. - The filters. - The action descriptor. - The parameters for the asynchronous action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Cancels the action. - true if the action was canceled; otherwise, false. - The user-defined object that qualifies or contains information about an asynchronous operation. - - - Cancels the action. - true if the action was canceled; otherwise, false. - The user-defined object that qualifies or contains information about an asynchronous operation. - - - Cancels the action. - true if the action was canceled; otherwise, false. - The user-defined object that qualifies or contains information about an asynchronous operation. - - - Returns the controller descriptor. - The controller descriptor. - The controller context. - - - Provides asynchronous operations for the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the synchronization context. - The synchronization context. - - - Notifies ASP.NET that all asynchronous operations are complete. - - - Occurs when the method is called. - - - Gets the number of outstanding operations. - The number of outstanding operations. - - - Gets the parameters that were passed to the asynchronous completion method. - The parameters that were passed to the asynchronous completion method. - - - Executes a callback in the current synchronization context. - The asynchronous action. - - - Gets or sets the asynchronous timeout value, in milliseconds. - The asynchronous timeout value, in milliseconds. - - - Defines the interface for an action invoker, which is used to invoke an asynchronous action in response to an HTTP request. - - - Invokes the specified action. - The status of the asynchronous result. - The controller context. - The name of the asynchronous action. - The callback method. - The state. - - - Cancels the asynchronous action. - true if the asynchronous method could be canceled; otherwise, false. - The asynchronous result. - - - Defines the methods that are required for an asynchronous controller. - - - Executes the specified request context. - The status of the asynchronous operation. - The request context. - The asynchronous callback method. - The state. - - - Ends the asynchronous operation. - The asynchronous result. - - - Provides a container for the asynchronous manager object. - - - Gets the asynchronous manager object. - The asynchronous manager object. - - - Provides a container that maintains a count of pending asynchronous operations. - - - Initializes a new instance of the class. - - - Occurs when an asynchronous method completes. - - - Gets the operation count. - The operation count. - - - Reduces the operation count by 1. - The updated operation count. - - - Reduces the operation count by the specified value. - The updated operation count. - The number of operations to reduce the count by. - - - Increments the operation count by one. - The updated operation count. - - - Increments the operation count by the specified value. - The updated operation count. - The number of operations to increment the count by. - - - Provides information about an asynchronous action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - An object that contains information about the method that begins the asynchronous operation (the method whose name ends with "Asynch"). - An object that contains information about the completion method (method whose name ends with "Completed"). - The name of the action. - The controller descriptor. - - - Gets the name of the action method. - The name of the action method. - - - Gets the method information for the asynchronous action method. - The method information for the asynchronous action method. - - - Begins running the asynchronous action method by using the specified parameters and controller context. - An object that contains the result of an asynchronous call. - The controller context. - The parameters of the action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Gets the method information for the asynchronous completion method. - The method information for the asynchronous completion method. - - - Gets the controller descriptor for the asynchronous action method. - The controller descriptor for the asynchronous action method. - - - Returns the result of an asynchronous operation. - The result of an asynchronous operation. - An object that represents the status of an asynchronous operation. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes of the specified type exist. - The type of the custom attributes to return. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns the parameters of the action method. - The parameters of the action method. - - - Returns the action-method selectors. - The action-method selectors. - - - Determines whether one or more instances of the specified attribute type are defined for the action member. - true if an attribute of type that is represented by is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Gets the lazy initialized unique ID of the instance of this class. - The lazy initialized unique ID of the instance of this class. - - - Encapsulates information that describes an asynchronous controller, such as its name, type, and actions. - - - Initializes a new instance of the class. - The type of the controller. - - - Gets the type of the controller. - The type of the controller. - - - Finds an action method by using the specified name and controller context. - The information about the action method. - The controller context. - The name of the action. - - - Returns a list of action method descriptors in the controller. - A list of action method descriptors in the controller. - - - Returns custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns custom attributes of a specified type that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns a value that indicates whether one or more instances of the specified custom attribute are defined for this member. - true if an attribute of the type represented by is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Represents an exception that occurred during the synchronous processing of an HTTP request in an ASP.NET MVC application. - - - Initializes a new instance of the class using a system-supplied message. - - - Initializes a new instance of the class using the specified message. - The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. - - - Initializes a new instance of the class using a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents support for calling child action methods and rendering the result inline in a parent view. - - - Invokes the specified child action method and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method with the specified parameters and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified controller name and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The name of the controller that contains the action method. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The name of the controller that contains the action method. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The name of the controller that contains the action method. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified controller name and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The name of the controller that contains the action method. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The name of the controller that contains the action method. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The name of the controller that contains the action method. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Represents support for rendering object values as HTML. - - - Returns HTML markup for each property in the object that is represented by a string expression. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - - - Returns HTML markup for each property in the object that is represented by a string expression, using additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template and an HTML field ID. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template, HTML field ID, and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the object that is represented by the expression. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The type of the model. - The type of the value. - - - Returns a string that contains each property value in the object that is represented by the specified expression, using additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns a string that contains each property value in the object that is represented by the , using the specified template. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - The type of the model. - The type of the value. - - - Returns a string that contains each property value in the object that is represented by the specified expression, using the specified template and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns HTML markup for each property in the object that is represented by the , using the specified template and an HTML field ID. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - The type of the model. - The type of the value. - - - Returns HTML markup for each property in the object that is represented by the specified expression, using the template, an HTML field ID, and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns HTML markup for each property in the model. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - - - Returns HTML markup for each property in the model, using additional view data. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the model using the specified template. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - - - Returns HTML markup for each property in the model, using the specified template and additional view data. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the model using the specified template and HTML field ID. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns HTML markup for each property in the model, using the specified template, an HTML field ID, and additional view data. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Provides a way to render object values as HTML. - - - Returns HTML markup for each property in the object that is represented by the specified expression. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - - - Returns HTML markup for each property in the object that is represented by the specified expression. - The HTML markup for each property.zz 12/29/2010 1:25:49 PM - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The type of the model. - The type of the result. - - - Represents support for the HTML input element in an application. - - - Returns an HTML input element for each property in the object that is represented by the expression. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - - - Returns an HTML input element for each property in the object that is represented by the expression, using additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and HTML field name. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template, HTML field name, and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the object that is represented by the expression. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and HTML field name. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template, HTML field name, and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the model. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - - - Returns an HTML input element for each property in the model, using additional view data. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the model, using the specified template. - An HTML input element for each property in the model and in the specified template. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - - - Returns an HTML input element for each property in the model, using the specified template and additional view data. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the model, using the specified template name and HTML field name. - An HTML input element for each property in the model and in the named template. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns an HTML input element for each property in the model, using the template name, HTML field name, and additional view data. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Represents support for HTML in an application. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route - - - Renders the closing </form> tag to the response. - The HTML helper instance that this method extends. - - - Represents support for HTML input controls in an application.12/23/2010 12:04:24 PM zz - - - Returns a check box input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, and a value to indicate whether the check box is selected. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - true to select the check box; otherwise, false. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, a value to indicate whether the check box is selected, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - true to select the check box; otherwise, false. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, a value that indicates whether the check box is selected, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - true to select the check box; otherwise, false. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The parameter is null. - - - Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The parameter is null. - - - Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The parameter is null. - - - Returns a hidden input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - - - Returns a hidden input element by using the specified HTML helper, the name of the form field, and the value. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the hidden input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - - - Returns a hidden input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the hidden input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - An object that contains the HTML attributes to set for the element. - - - Returns a hidden input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the hidden input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML hidden input element for each property in the object that is represented by the specified expression. - An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the property. - - - Returns an HTML hidden input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - - - Returns an HTML hidden input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - - - Returns a password input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - - - Returns a password input element by using the specified HTML helper, the name of the form field, and the value. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the password input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - - - Returns a password input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the password input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - An object that contains the HTML attributes to set for the element. - - - Returns a password input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the password input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - An object that contains the HTML attributes to set for the element. - - - Returns a password input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a password input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a password input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - true to select the radio button; otherwise, false. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - true to select the radio button; otherwise, false. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - true to select the radio button; otherwise, false. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a text input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - - - Returns a text input element by using the specified HTML helper, the name of the form field, and the value. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - - - Returns a text input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - An object that contains the HTML attributes to set for the element. - - - Returns a text input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - An object that contains the HTML attributes to set for the element. - - - Returns a text input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element type attribute is set to "text" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Represents support for the HTML label element in an ASP.NET MVC view. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - - - Returns . - - - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The type of the model. - The type of the value. - - - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The label text. - The type of the model. - The type of the value. - - - Returns an HTML label element and the property name of the property that is represented by the model. - An HTML label element and the property name of the property that is represented by the model. - The HTML helper instance that this method extends. - - - Returns . - - - Represents support for HTML links in an application. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes for the element. The attributes are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Represents an HTML form element in an MVC view. - - - Initializes a new instance of the class using the specified HTTP response object. - The HTTP response object. - The parameter is null. - - - Initializes a new instance of the class using the specified view context. - An object that encapsulates the information that is required in order to render a view. - The parameter is null. - - - Releases all resources that are used by the current instance of the class. - - - Releases unmanaged and, optionally, managed resources used by the current instance of the class. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Ends the form and disposes of all form resources. - - - Represents the functionality to render a partial view as an HTML-encoded string. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view to render. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view to render. - The model for the partial view. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view. - The model for the partial view. - The view data dictionary for the partial view. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view to render. - The view data dictionary for the partial view. - - - Provides support for rendering a partial view. - - - Renders the specified partial view by using the specified HMTL helper. - The HTML helper. - The name of the partial view - - - Renders the specified partial view, passing it a copy of the current object, but with the Model property set to the specified model. - The HTML helper. - The name of the partial view. - The model. - - - Renders the specified partial view, replacing the partial view's ViewData property with the specified object and setting the Model property of the view data to the specified model. - The HTML helper. - The name of the partial view. - The model for the partial view. - The view data for the partial view. - - - Renders the specified partial view, replacing its ViewData property with the specified object. - The HTML helper. - The name of the partial view. - The view data. - - - Represents support for making selections in a list. - - - Returns a single-selection select element using the specified HTML helper and the name of the form field. - An HTML select element. - The HTML helper instance that this method extends. - The name of the form field to return. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, and the specified list items. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and an option label. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, and an option label. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - The text for a default empty item. This parameter can be null. - The parameter is null or empty. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and option label. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items, option label, and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items, option label, and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a multi-select select element using the specified HTML helper and the name of the form field. - An HTML select element. - The HTML helper instance that this method extends. - The name of the form field to return. - The parameter is null or empty. - - - Returns a multi-select select element using the specified HTML helper, the name of the form field, and the specified list items. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The parameter is null or empty. - - - Returns a multi-select select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HMTL attributes. - An HTML select element with an option subelement for each item in the list.. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a multi-select select element using the specified HTML helper, the name of the form field, and the specified list items. - An HTML select element with an option subelement for each item in the list.. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an HTML select element for each property in the object that is represented by the specified expression and using the specified list items. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - A collection of objects that are used to populate the drop-down list. - The type of the model. - The type of the property. - The parameter is null. - - - Represents support for HTML textarea controls. - - - Returns the specified textarea element by using the specified HTML helper and the name of the form field. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper and HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, and the text content. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, the number of rows and columns, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - The number of rows. - The number of columns. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, the number of rows and columns, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - The number of rows. - The number of columns. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes and the number of rows and columns. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The number of rows. - The number of columns. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes and the number of rows and columns. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The number of rows. - The number of columns. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the property. - The parameter is null. - - - Provides support for validating the input from an HTML form. - - - Gets or sets the name of the resource file (class key) that contains localized string values. - The name of the resource file (class key). - - - Retrieves the validation metadata for the specified model and applies each rule to the data field. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The parameter is null. - - - Retrieves the validation metadata for the specified model and applies each rule to the data field. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the property. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - An object that contains the HTML attributes for the element. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - An object that contains the HTML attributes for the element. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The message to display if the specified field contains an error. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The message to display if the specified field contains an error. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - The type of the model. - The type of the property. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - The type of the model. - The type of the property. - - - Returns an unordered list (ul element) of validation messages that are in the object. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - The message to display with the validation summary. - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - The message to display with the validation summary. - A dictionary that contains the HTML attributes for the element. - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - The message to display with the validation summary. - An object that contains the HTML attributes for the element. - - - Returns an unordered list (ul element) of validation messages that are in the object. - A string that contains an unordered list (ul element) of validation messages. - The HMTL helper instance that this method extends. - The message to display if the specified field contains an error. - - - Returns an unordered list (ul element) of validation messages that are in the object. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - The message to display if the specified field contains an error. - A dictionary that contains the HTML attributes for the element. - - - Returns an unordered list (ul element) of validation messages in the object. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - - - Provides a model-aware class for ASP.NET MVC. - - - Initializes a new instance of the class. - The start of the span. - The content. - The type name of the model. - - - Gets a value that indicates whether the current object is identical to the specified object. - true if the current object is identical to the specified object; otherwise, false. - The model span object. - - - Returns the hash code of the object. - The hash code of the object. - - - Gets the type name of the model. - The type name of the model. - - - Compiles ASP.NET Razor views into classes. - - - Initializes a new instance of the class. - The class name. - The root namespace. - The name of the source file. - The ASP.NET Razor engine host. - - - Returns a value that indicates whether the specified model span is an instance of . - true if the value of the parameter is an instance of ; otherwise, false. - The model span. - - - - - - Compiles ASP.NET Razor views into classes. - - - - - Extends the VBCodeParser class by adding support for the @model keyword. - - - Initializes a new instance of the class. - - - - Configures the ASP.NET Razor parser and code generator for a specified file. - - - Initializes a new instance of the class. - The virtual path of the ASP.NET Razor file. - The physical path of the ASP.NET Razor file. - - - - + + + + System.Web.Mvc + + + + Represents an attribute that specifies which HTTP verbs an action method will respond to. + + + Initializes a new instance of the class by using a list of HTTP verbs that the action method will respond to. + The HTTP verbs that the action method will respond to. + The parameter is null or zero length. + + + Initializes a new instance of the class using the HTTP verbs that the action method will respond to. + The HTTP verbs that the action method will respond to. + + + Determines whether the specified method information is valid for the specified controller context. + true if the method information is valid; otherwise, false. + The controller context. + The method information. + The parameter is null. + + + Gets or sets the list of HTTP verbs that the action method will respond to. + The list of HTTP verbs that the action method will respond to. + + + Provides information about an action method, such as its name, controller, parameters, attributes, and filters. + + + Initializes a new instance of the class. + + + Gets the name of the action method. + The name of the action method. + + + Gets the controller descriptor. + The controller descriptor. + + + Executes the action method by using the specified parameters and controller context. + The result of executing the action method. + The controller context. + The parameters of the action method. + + + Returns an array of custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Returns an array of custom attributes that are defined for this member, identified by type. + An array of custom attributes, or an empty array if no custom attributes of the specified type exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + The parameter is null. + + + Returns the filters that are associated with this action method. + The filters that are associated with this action method. + + + Returns the parameters of the action method. + The parameters of the action method. + + + Returns the action-method selectors. + The action-method selectors. + + + Determines whether one or more instances of the specified attribute type are defined for this member. + true if is defined for this member; otherwise, false. + The type of the custom attribute. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The parameter is null. + + + Gets the unique ID for the action descriptor using lazy initialization. + The unique ID. + + + Provides the context for the ActionExecuted method of the class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The controller context. + The action method descriptor. + true if the action is canceled. + The exception object. + The parameter is null. + + + Gets or sets the action descriptor. + The action descriptor. + + + Gets or sets a value that indicates that this object is canceled. + true if the context canceled; otherwise, false. + + + Gets or sets the exception that occurred during the execution of the action method, if any. + The exception that occurred during the execution of the action method. + + + Gets or sets a value that indicates whether the exception is handled. + true if the exception is handled; otherwise, false. + + + Gets or sets the result returned by the action method. + The result returned by the action method. + + + Provides the context for the ActionExecuting method of the class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified controller context, action descriptor, and action-method parameters. + The controller context. + The action descriptor. + The action-method parameters. + The or parameter is null. + + + Gets or sets the action descriptor. + The action descriptor. + + + Gets or sets the action-method parameters. + The action-method parameters. + + + Gets or sets the result that is returned by the action method. + The result that is returned by the action method. + + + Represents the base class for filter attributes. + + + Initializes a new instance of the class. + + + Called by the ASP.NET MVC framework after the action method executes. + The filter context. + + + Called by the ASP.NET MVC framework before the action method executes. + The filter context. + + + Called by the ASP.NET MVC framework after the action result executes. + The filter context. + + + Called by the ASP.NET MVC framework before the action result executes. + The filter context. + + + Represents an attribute that is used to influence the selection of an action method. + + + Initializes a new instance of the class. + + + Determines whether the action method selection is valid for the specified controller context. + true if the action method selection is valid for the specified controller context; otherwise, false. + The controller context. + Information about the action method. + + + Represents an attribute that is used for the name of an action. + + + Initializes a new instance of the class. + Name of the action. + The parameter is null or empty. + + + Determines whether the action name is valid within the specified controller context. + true if the action name is valid within the specified controller context; otherwise, false. + The controller context. + The name of the action. + Information about the action method. + + + Gets or sets the name of the action. + The name of the action. + + + Represents an attribute that affects the selection of an action method. + + + Initializes a new instance of the class. + + + Determines whether the action name is valid in the specified controller context. + true if the action name is valid in the specified controller context; otherwise, false. + The controller context. + The name of the action. + Information about the action method. + + + Encapsulates the result of an action method and is used to perform a framework-level operation on behalf of the action method. + + + Initializes a new instance of the class. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. + + + Represents a delegate that contains the logic for selecting an action method. + true if an action method was successfully selected; otherwise, false. + The current HTTP request context. + + + Provides a class that implements the interface in order to support additional metadata. + + + Initializes a new instance of the class. + The name of the model metadata. + The value of the model metadata. + + + Gets the name of the additional metadata attribute. + The name of the of the additional metadata attribute. + + + Provides metadata to the model metadata creation process. + + + Gets the type of the of the additional metadata attribute. + The type of the of the additional metadata attribute. + + + Gets the value of the of the additional metadata attribute. + The value of the of the additional metadata attribute. + + + Represents support for rendering HTML in AJAX scenarios within a view. + + + Initializes a new instance of the class using the specified view context and view data container. + The view context. + The view data container. + One or both of the parameters is null. + + + Initializes a new instance of the class by using the specified view context, view data container, and route collection. + The view context. + The view data container. + The URL route collection. + One or more of the parameters is null. + + + Gets or sets the root path for the location to use for globalization script files. + The location of the folder where globalization script files are stored. The default location is "~/Scripts/Globalization". + + + Serializes the specified message and returns the resulting JSON-formatted string. + The serialized message as a JSON-formatted string. + The message to serialize. + + + Gets the collection of URL routes for the application. + The collection of routes for the application. + + + Gets the context information about the view. + The context of the view. + + + Gets the current view data dictionary. + The view data dictionary. + + + Gets the view data container. + The view data container. + + + Represents support for rendering HTML in AJAX scenarios within a strongly typed view. + The type of the model. + + + Initializes a new instance of the class by using the specified view context and view data container. + The view context. + The view data container. + + + Initializes a new instance of the class by using the specified view context, view data container, and URL route collection. + The view context. + The view data container. + The URL route collection. + + + Gets the strongly typed version of the view data dictionary. + The strongly typed data dictionary of the view. + + + Represents a class that extends the class by adding the ability to determine whether an HTTP request is an AJAX request. + + + + Allows a request to include HTML markup during model binding by skipping request validation for the property. (It is strongly recommended that your application explicitly check all models where you disable request validation in order to prevent script exploits.) + + + Initializes a new instance of the class. + + + This method supports the ASP.NET MVC validation infrastructure and is not intended to be used directly from your code. + The model metadata. + + + Provides a way to register one or more areas in an ASP.NET MVC application. + + + Initializes a new instance of the class. + + + Gets the name of the area to register. + The name of the area to register. + + + Registers all areas in an ASP.NET MVC application. + + + Registers all areas in an ASP.NET MVC application by using the specified user-defined information. + An object that contains user-defined information to pass to the area. + + + Registers an area in an ASP.NET MVC application using the specified area's context information. + Encapsulates the information that is required in order to register the area. + + + Encapsulates the information that is required in order to register an area within an ASP.NET MVC application. + + + Initializes a new instance of the class using the specified area name and routes collection. + The name of the area to register. + The collection of routes for the application. + + + Initializes a new instance of the class using the specified area name, routes collection, and user-defined data. + The name of the area to register. + The collection of routes for the application. + An object that contains user-defined information to pass to the area. + + + Gets the name of the area to register. + The name of the area to register. + + + Maps the specified URL route and associates it with the area that is specified by the property. + A reference to the mapped route. + The name of the route. + The URL pattern for the route. + The parameter is null. + + + Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values. + A reference to the mapped route. + The name of the route. + The URL pattern for the route. + An object that contains default route values. + The parameter is null. + + + Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values and constraint. + A reference to the mapped route. + The name of the route. + The URL pattern for the route. + An object that contains default route values. + A set of expressions that specify valid values for a URL parameter. + The parameter is null. + + + Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values, constraints, and namespaces. + A reference to the mapped route. + The name of the route. + The URL pattern for the route. + An object that contains default route values. + A set of expressions that specify valid values for a URL parameter. + An enumerable set of namespaces for the application. + The parameter is null. + + + Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values and namespaces. + A reference to the mapped route. + The name of the route. + The URL pattern for the route. + An object that contains default route values. + An enumerable set of namespaces for the application. + The parameter is null. + + + Maps the specified URL route and associates it with the area that is specified by the property, using the specified namespaces. + A reference to the mapped route. + The name of the route. + The URL pattern for the route. + An enumerable set of namespaces for the application. + The parameter is null. + + + Gets the namespaces for the application. + An enumerable set of namespaces for the application. + + + Gets a collection of defined routes for the application. + A collection of defined routes for the application. + + + Gets an object that contains user-defined information to pass to the area. + An object that contains user-defined information to pass to the area. + + + Provides an abstract class to implement a metadata provider. + + + Called from constructors in a derived class to initialize the class. + + + When overridden in a derived class, creates the model metadata for the property. + The model metadata for the property. + The set of attributes. + The type of the container. + The model accessor. + The type of the model. + The name of the property. + + + Gets a list of attributes. + A list of attributes. + The type of the container. + The property descriptor. + The attribute container. + + + Returns a list of properties for the model. + A list of properties for the model. + The model container. + The type of the container. + + + Returns the metadata for the specified property using the container type and property descriptor. + The metadata for the specified property using the container type and property descriptor. + The model accessor. + The type of the container. + The property descriptor + + + Returns the metadata for the specified property using the container type and property name. + The metadata for the specified property using the container type and property name. + The model accessor. + The type of the container. + The name of the property. + + + Returns the metadata for the specified property using the type of the model. + The metadata for the specified property using the type of the model. + The model accessor. + The type of the model. + + + Returns the type descriptor from the specified type. + The type descriptor. + The type. + + + Provides an abstract class for classes that implement a validation provider. + + + Called from constructors in derived classes to initialize the class. + + + Gets a type descriptor for the specified type. + A type descriptor for the specified type. + The type of the validation provider. + + + Gets the validators for the model using the metadata and controller context. + The validators for the model. + The metadata. + The controller context. + + + Gets the validators for the model using the metadata, the controller context, and a list of attributes. + The validators for the model. + The metadata. + The controller context. + The list of attributes. + + + Provides the base class for asynchronous controllers. + + + Initializes a new instance of the class. + + + Gets the asynchronous manager instance. + The asynchronous manager instance. + + + Called by ASP.NET to initialize asynchronous request processing. + The status of the asynchronous operation. + The request context. + The asynchronous callback method. + The state object. + + + Called by ASP.NET during initialization of asynchronous request processing. + The status of the asynchronous operation. + The asynchronous callback method. + The state object. + + + Creates an action invoker. + An action invoker. + + + Cancels the execution of an asynchronous action method. + The status of the asynchronous result. + + + Called by ASP.NET when the current asynchronous action has completed. + The status of the asynchronous result. + + + Called by ASP.NET to begin the execution of an asynchronous action method. + The status of the asynchronous operation. + The request context. + The asynchronous callback method. + An object that contains information to be used by the callback method. This parameter can be null. + + + Cancels the execution of an asynchronous action method by ASP.NET at the end of the execution of an asynchronous action method. + The status of the asynchronous result. + + + Represents an attribute that is used to set the timeout value, in milliseconds, for an asynchronous method. + + + Initializes a new instance of the class. + The timeout value, in milliseconds. + + + Gets the timeout duration, in milliseconds. + The timeout duration, in milliseconds. + + + Called by ASP.NET before the asynchronous action method executes. + The filter context. + + + Encapsulates the information that is required for using an attribute. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified controller context. + The context within which the result is executed. The context information includes the controller, HTTP content, request context, and route data. + + + Initializes a new instance of the class using the specified controller context and action descriptor. + The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. + An object that provides information about an action method, such as its name, controller, parameters, attributes, and filters. + + + Provides information about the action method that is marked by the attribute, such as its name, controller, parameters, attributes, and filters. + The action descriptor for the action method that is marked by the attribute. + + + Gets or sets the result that is returned by an action method. + The result that is returned by an action method. + + + Represents an attribute that is used to restrict access by callers to an action method. + + + Initializes a new instance of the class. + + + When overridden, provides an entry point for custom authorization checks. + true if the user is authorized; otherwise, false. + The HTTP context, which encapsulates all HTTP-specific information about an individual HTTP request. + The parameter is null. + + + Processes HTTP requests that fail authorization. + Encapsulates the information for using . The object contains the controller, HTTP context, request context, action result, and route data. + + + Called when a process requests authorization. + The filter context, which encapsulates information for using . + The parameter is null. + + + Called when the caching module requests authorization. + A reference to the validation status. + The HTTP context, which encapsulates all HTTP-specific information about an individual HTTP request. + The parameter is null. + + + Gets or sets the user roles. + The user roles. + + + Gets the unique identifier for this attribute. + The unique identifier for this attribute. + + + Gets or sets the authorized users. + The authorized users. + + + Represents an attribute that is used to provide details about how model binding to a parameter should occur. + + + Initializes a new instance of the class. + + + Gets or sets a comma-delimited list of property names for which binding is not allowed. + The exclude list. + + + Gets or sets a comma-delimited list of property names for which binding is allowed. + The include list. + + + Determines whether the specified property is allowed. + true if the specified property is allowed; otherwise, false. + The name of the property. + + + Gets or sets the prefix to use when markup is rendered for binding to an action argument or to a model property. + The prefix to use. + + + Represents the base class for views that are compiled by the BuildManager class before being rendered by a view engine. + + + Initializes a new instance of the class using the specified controller context and view path. + The controller context. + The view path. + + + Initializes a new instance of the class using the specified controller context, view path, and view page activator. + Context information for the current controller. This information includes the HTTP context, request context, route data, parent action view context, and more. + The path to the view that will be rendered. + The object responsible for dynamically constructing the view page at run time. + The parameter is null. + The parameter is null or empty. + + + Renders the specified view context by using the specified the writer object. + Information related to rendering a view, such as view data, temporary data, and form context. + The writer object. + The parameter is null. + An instance of the view type could not be created. + + + When overridden in a derived class, renders the specified view context by using the specified writer object and object instance. + Information related to rendering a view, such as view data, temporary data, and form context. + The writer object. + An object that contains additional information that can be used in the view. + + + Gets or sets the view path. + The view path. + + + Provides a base class for view engines. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified view page activator. + The view page activator. + + + Gets a value that indicates whether a file exists in the specified virtual file system (path). + true if the file exists in the virtual file system; otherwise, false. + The controller context. + The virtual path. + + + Gets the view page activator. + The view page activator. + + + Maps a browser request to a byte array. + + + Initializes a new instance of the class. + + + Binds the model by using the specified controller context and binding context. + The bound data object. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + The parameter is null. + + + Represents an attribute that is used to indicate that an action method should be called only as a child action. + + + Initializes a new instance of the class. + + + Called when authorization is required. + An object that encapsulates the information that is required in order to authorize access to the child action. + + + Represents a value provider for values from child actions. + + + Initializes a new instance of the class. + The controller context. + + + Retrieves a value object using the specified key. + The value object for the specified key. + The key. + + + Represents a factory for creating value provider objects for child actions. + + + Initializes a new instance of the class. + + + Returns a object for the specified controller context. + A object. + The controller context. + + + Returns the client data-type model validators. + + + Initializes a new instance of the class. + + + Returns the client data-type model validators. + The client data-type model validators. + The metadata. + The context. + + + Provides an attribute that compares two properties of a model. + + + Initializes a new instance of the class. + The property to compare with the current property. + + + Applies formatting to an error message based on the data field where the compare error occurred. + The formatted error message. + The name of the field that caused the validation failure. + + + Formats the property for client validation by prepending an asterisk (*) and a dot. + The string "*." is prepended to the property. + The property. + + + Gets a list of compare-value client validation rules for the property using the specified model metadata and controller context. + A list of compare-value client validation rules. + The model metadata. + The controller context. + + + Determines whether the specified object is equal to the compared object. + null if the value of the compared property is equal to the value parameter; otherwise, a validation result that contains the error message that indicates that the comparison failed. + The value of the object to compare. + The validation context. + + + Gets the property to compare with the current property. + The property to compare with the current property. + + + Represents a user-defined content type that is the result of an action method. + + + Initializes a new instance of the class. + + + Gets or sets the content. + The content. + + + Gets or sets the content encoding. + The content encoding. + + + Gets or sets the type of the content. + The type of the content. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context within which the result is executed. + The parameter is null. + + + Provides methods that respond to HTTP requests that are made to an ASP.NET MVC Web site. + + + Initializes a new instance of the class. + + + Gets the action invoker for the controller. + The action invoker. + + + Gets or sets the binder. + The binder. + + + Creates a content result object by using a string. + The content result instance. + The content to write to the response. + + + Creates a content result object by using a string and the content type. + The content result instance. + The content to write to the response. + The content type (MIME type). + + + Creates a content result object by using a string, the content type, and content encoding. + The content result instance. + The content to write to the response. + The content type (MIME type). + The content encoding. + + + Creates an action invoker. + An action invoker. + + + Creates a temporary data provider. + A temporary data provider. + + + Releases all resources that are used by the current instance of the class. + + + Releases unmanaged resources and optionally releases managed resources. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + Invokes the action in the current controller context. + + + Creates a object by using the file contents and file type. + The file-content result object. + The binary content to send to the response. + The content type (MIME type). + + + Creates a object by using the file contents, content type, and the destination file name. + The file-content result object. + The binary content to send to the response. + The content type (MIME type). + The file name to use in the file-download dialog box that is displayed in the browser. + + + Creates a object by using the object and content type. + The file-content result object. + The stream to send to the response. + The content type (MIME type). + + + Creates a object using the object, the content type, and the target file name. + The file-stream result object. + The stream to send to the response. + The content type (MIME type) + The file name to use in the file-download dialog box that is displayed in the browser. + + + Creates a object by using the file name and the content type. + The file-stream result object. + The path of the file to send to the response. + The content type (MIME type). + + + Creates a object by using the file name, the content type, and the file download name. + The file-stream result object. + The path of the file to send to the response. + The content type (MIME type). + The file name to use in the file-download dialog box that is displayed in the browser. + + + Called when a request matches this controller, but no method with the specified action name is found in the controller. + The name of the attempted action. + + + Gets HTTP-specific information about an individual HTTP request. + The HTTP context. + + + Returns an instance of the class. + An instance of the class. + + + Returns an instance of the class. + An instance of the class. + The status description. + + + Initializes data that might not be available when the constructor is called. + The HTTP context and route data. + + + Creates a object. + The object that writes the script to the response. + The JavaScript code to run on the client + + + Creates a object that serializes the specified object to JavaScript Object Notation (JSON). + The JSON result object that serializes the specified object to JSON format. The result object that is prepared by this method is written to the response by the ASP.NET MVC framework when the object is executed. + The JavaScript object graph to serialize. + + + Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format. + The JSON result object that serializes the specified object to JSON format. + The JavaScript object graph to serialize. + The content type (MIME type). + + + Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format. + The JSON result object that serializes the specified object to JSON format. + The JavaScript object graph to serialize. + The content type (MIME type). + The content encoding. + + + Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the content type, content encoding, and the JSON request behavior. + The result object that serializes the specified object to JSON format. + The JavaScript object graph to serialize. + The content type (MIME type). + The content encoding. + The JSON request behavior + + + Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified content type and JSON request behavior. + The result object that serializes the specified object to JSON format. + The JavaScript object graph to serialize. + The content type (MIME type). + The JSON request behavior + + + Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified JSON request behavior. + The result object that serializes the specified object to JSON format. + The JavaScript object graph to serialize. + The content type (MIME type). + + + Gets the model state dictionary object that contains the state of the model and of model-binding validation. + The model state dictionary. + + + Called after the action method is invoked. + Information about the current request and action. + + + Called before the action method is invoked. + Information about the current request and action. + + + Called when authorization occurs. + Information about the current request and action. + + + Called when an unhandled exception occurs in the action. + Information about the current request and action. + + + Called after the action result that is returned by an action method is executed. + Information about the current request and action result + + + Called before the action result that is returned by an action method is executed. + Information about the current request and action result + + + Creates a object that renders a partial view. + A partial-view result object. + + + Creates a object that renders a partial view, by using the specified model. + A partial-view result object. + The model that is rendered by the partial view + + + Creates a object that renders a partial view, by using the specified view name. + A partial-view result object. + The name of the view that is rendered to the response. + + + Creates a object that renders a partial view, by using the specified view name and model. + A partial-view result object. + The name of the view that is rendered to the response. + The model that is rendered by the partial view + + + Creates a object that redirects to the specified URL. + The redirect result object. + The URL to redirect to. + + + Returns an instance of the class with the property set to true. + An instance of the class with the property set to true. + The URL to redirect to. + + + Redirects to the specified action using the action name. + The redirect result object. + The name of the action. + + + Redirects to the specified action using the action name and route values. + The redirect result object. + The name of the action. + The parameters for a route. + + + Redirects to the specified action using the action name and controller name. + The redirect result object. + The name of the action. + The name of the controller + + + Redirects to the specified action using the action name, controller name, and route values. + The redirect result object. + The name of the action. + The name of the controller + The parameters for a route. + + + Redirects to the specified action using the action name, controller name, and route dictionary. + The redirect result object. + The name of the action. + The name of the controller + The parameters for a route. + + + Redirects to the specified action using the action name and route dictionary. + The redirect result object. + The name of the action. + The parameters for a route. + + + Returns an instance of the class with the property set to true using the specified action name. + An instance of the class with the property set to true using the specified action name, controller name, and route values. + The action name. + + + Returns an instance of the class with the property set to true using the specified action name, and route values. + An instance of the class with the property set to true using the specified action name, and route values. + The action name. + The route values. + + + Returns an instance of the class with the property set to true using the specified action name, and controller name. + An instance of the class with the property set to true using the specified action name, and controller name. + The action name. + The controller name. + + + Returns an instance of the class with the property set to true using the specified action name, controller name, and route values. + An instance of the class with the property set to true. + The action name. + The controller name. + The route values. + + + Returns an instance of the class with the property set to true using the specified action name, controller name, and route values. + An instance of the class with the property set to true using the specified action name, controller name, and route values. + The action name. + The controller name. + The route values. + + + Returns an instance of the class with the property set to true using the specified action name, and route values. + An instance of the class with the property set to true using the specified action name, and route values. + + + Redirects to the specified route using the specified route values. + The redirect-to-route result object. + The parameters for a route. + + + Redirects to the specified route using the route name. + The redirect-to-route result object. + The name of the route + + + Redirects to the specified route using the route name and route values. + The redirect-to-route result object. + The name of the route + The parameters for a route. + + + Redirects to the specified route using the route name and route dictionary. + The redirect-to-route result object. + The name of the route + The parameters for a route. + + + Redirects to the specified route using the route dictionary. + The redirect-to-route result object. + The parameters for a route. + + + Returns an instance of the class with the property set to true using the specified route values. + Returns . + The route name. + + + Returns an instance of the class with the property set to true using the specified route name. + Returns an instance of the class with the property set to true using the specified route name. + The route name. + + + Returns an instance of the class with the property set to true using the specified route name and route values. + An instance of the class with the property set to true. + The route name. + The route values. + + + Returns an instance of the class with the property set to true using the specified route name and route values. + An instance of the class with the property set to true using the specified route name and route values. + The route name. + The route values. + + + Returns an instance of the class with the property set to true using the specified route values. + An instance of the class with the property set to true using the specified route values. + The route values. + + + Gets the object for the current HTTP request. + The request object. + + + Gets the object for the current HTTP response. + The response object. + + + Gets the route data for the current request. + The route data. + + + Gets the object that provides methods that are used during Web request processing. + The HTTP server object. + + + Gets the object for the current HTTP request. + The HTTP session-state object for the current HTTP request. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. + The filter context. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. + The filter context. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. + The filter context. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. + The filter context. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. + The filter context. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. + The filter context. + + + Gets the temporary-data provider object that is used to store data for the next request. + The temporary-data provider. + + + Updates the specified model instance using values from the controller's current value provider. + true if the update is successful; otherwise, false. + The model instance to update. + The type of the model object. + The parameter or the property is null. + + + Updates the specified model instance using values from the controller's current value provider and a prefix. + true if the update is successful; otherwise, false. + The model instance to update. + The prefix to use when looking up values in the value provider. + The type of the model object. + The parameter or the property is null. + + + Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties. + true if the update is successful; otherwise, false. + The model instance to update. + The prefix to use when looking up values in the value provider. + A list of properties of the model to update. + The type of the model object. + The parameter or the property is null. + + + Updates the specified model instance using values from the controller's current value provider, a prefix, a list of properties to exclude, and a list of properties to include. + true if the update is successful; otherwise, false. + The model instance to update. + The prefix to use when looking up values in the value provider + A list of properties of the model to update. + A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the parameter list. + The type of the model object. + The parameter or the property is null. + + + Updates the specified model instance using values from the value provider, a prefix, a list of properties to exclude , and a list of properties to include. + true if the update is successful; otherwise, false. + The model instance to update. + The prefix to use when looking up values in the value provider. + A list of properties of the model to update. + A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the parameter list. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the value provider, a prefix, and included properties. + true if the update is successful; otherwise, false. + The model instance to update. + The prefix to use when looking up values in the value provider. + A list of properties of the model to update. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the value provider and a prefix. + true if the update is successful; otherwise, false. + The model instance to update. + The prefix to use when looking up values in the value provider. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the controller's current value provider and included properties. + true if the update is successful; otherwise, false. + The model instance to update. + A list of properties of the model to update. + The type of the model object. + The parameter or the property is null. + + + Updates the specified model instance using values from the value provider and a list of properties to include. + true if the update is successful; otherwise, false. + The model instance to update. + A list of properties of the model to update. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the value provider. + true if the update is successful; otherwise, false. + The model instance to update. + A dictionary of values that is used to update the model. + The type of the model object. + + + Validates the specified model instance. + true if the model validation is successful; otherwise, false. + The model instance to validate. + + + Validates the specified model instance using an HTML prefix. + true if the model validation is successful; otherwise, false. + The model to validate. + The prefix to use when looking up values in the model provider. + + + Updates the specified model instance using values from the controller's current value provider. + The model instance to update. + The type of the model object. + The model was not successfully updated. + + + Updates the specified model instance using values from the controller's current value provider and a prefix. + The model instance to update. + A prefix to use when looking up values in the value provider. + The type of the model object. + + + Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties. + The model instance to update. + A prefix to use when looking up values in the value provider. + A list of properties of the model to update. + The type of the model object. + + + Updates the specified model instance using values from the controller's current value provider, a prefix, a list of properties to exclude, and a list of properties to include. + The model instance to update. + A prefix to use when looking up values in the value provider. + A list of properties of the model to update. + A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the list. + The type of the model object. + + + Updates the specified model instance using values from the value provider, a prefix, a list of properties to exclude, and a list of properties to include. + The model instance to update. + The prefix to use when looking up values in the value provider. + A list of properties of the model to update. + A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the parameter list. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. + The model instance to update. + The prefix to use when looking up values in the value provider. + A list of properties of the model to update. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the value provider and a prefix. + The model instance to update. + The prefix to use when looking up values in the value provider. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the controller object's current value provider. + The model instance to update. + A list of properties of the model to update. + The type of the model object. + + + Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. + The model instance to update. + A list of properties of the model to update. + A dictionary of values that is used to update the model. + The type of the model object. + + + Updates the specified model instance using values from the value provider. + The model instance to update. + A dictionary of values that is used to update the model. + The type of the model object. + + + Gets the URL helper object that is used to generate URLs by using routing. + The URL helper object. + + + Gets the user security information for the current HTTP request. + The user security information for the current HTTP request. + + + Validates the specified model instance. + The model to validate. + + + Validates the specified model instance using an HTML prefix. + The model to validate. + The prefix to use when looking up values in the model provider. + + + Creates a object that renders a view to the response. + The view result that renders a view to the response. + + + Creates a object by using the model that renders a view to the response. + The view result. + The model that is rendered by the view. + + + Creates a object by using the view name that renders a view. + The view result. + The name of the view that is rendered to the response. + + + Creates a object by using the view name and model that renders a view to the response. + The view result. + The name of the view that is rendered to the response. + The model that is rendered by the view. + + + Creates a object using the view name and master-page name that renders a view to the response. + The view result. + The name of the view that is rendered to the response. + The name of the master page or template to use when the view is rendered. + + + Creates a object using the view name, master-page name, and model that renders a view. + The view result. + The name of the view that is rendered to the response. + The name of the master page or template to use when the view is rendered. + The model that is rendered by the view. + + + Creates a object that renders the specified object. + The view result. + The view that is rendered to the response. + + + Creates a object that renders the specified object. + The view result. + The view that is rendered to the response. + The model that is rendered by the view. + + + Represents a class that is responsible for invoking the action methods of a controller. + + + Initializes a new instance of the class. + + + Gets or sets the model binders that are associated with the action. + The model binders that are associated with the action. + + + Creates the action result. + The action result object. + The controller context. + The action descriptor. + The action return value. + + + Finds the information about the action method. + Information about the action method. + The controller context. + The controller descriptor. + The name of the action. + + + Retrieves information about the controller by using the specified controller context. + Information about the controller. + The controller context. + + + Retrieves information about the action filters. + Information about the action filters. + The controller context. + The action descriptor. + + + Gets the value of the specified action-method parameter. + The value of the action-method parameter. + The controller context. + The parameter descriptor. + + + Gets the values of the action-method parameters. + The values of the action-method parameters. + The controller context. + The action descriptor. + + + Invokes the specified action by using the specified controller context. + The result of executing the action. + The controller context. + The name of the action to invoke. + The parameter is null. + The parameter is null or empty. + The thread was aborted during invocation of the action. + An unspecified error occurred during invocation of the action. + + + Invokes the specified action method by using the specified parameters and the controller context. + The result of executing the action method. + The controller context. + The action descriptor. + The parameters. + + + Invokes the specified action method by using the specified parameters, controller context, and action filters. + The context for the ActionExecuted method of the class. + The controller context. + The action filters. + The action descriptor. + The parameters. + + + Invokes the specified action result by using the specified controller context. + The controller context. + The action result. + + + Invokes the specified action result by using the specified action filters and the controller context. + The context for the ResultExecuted method of the class. + The controller context. + The action filters. + The action result. + + + Invokes the specified authorization filters by using the specified action descriptor and controller context. + The context for the object. + The controller context. + The authorization filters. + The action descriptor. + + + Invokes the specified exception filters by using the specified exception and controller context. + The context for the object. + The controller context. + The exception filters. + The exception. + + + Represents the base class for all MVC controllers. + + + Initializes a new instance of the class. + + + Gets or sets the controller context. + The controller context. + + + Executes the specified request context. + The request context. + The parameter is null. + + + Executes the request. + + + Initializes the specified request context. + The request context. + + + Executes the specified request context. + The request context. + + + Gets or sets the dictionary for temporary data. + The dictionary for temporary data. + + + Gets or sets a value that indicates whether request validation is enabled for this request. + true if request validation is enabled for this request; otherwise, false. The default is true. + + + Gets or sets the value provider for the controller. + The value provider for the controller. + + + Gets the dynamic view data dictionary. + The dynamic view data dictionary. + + + Gets or sets the dictionary for view data. + The dictionary for the view data. + + + Represents a class that is responsible for dynamically building a controller. + + + Initializes a new instance of the class. + + + Gets the current controller builder object. + The current controller builder. + + + Gets the default namespaces. + The default namespaces. + + + Gets the associated controller factory. + The controller factory. + + + Sets the controller factory by using the specified type. + The type of the controller factory. + The parameter is null. + The controller factory cannot be assigned from the type in the parameter. + An error occurred while the controller factory was being set. + + + Sets the specified controller factory. + The controller factory. + The parameter is null. + + + Encapsulates information about an HTTP request that matches specified and instances. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified HTTP context, URL route data, and controller. + The HTTP context. + The route data. + The controller. + + + Initializes a new instance of the class by using the specified controller context. + The controller context. + The parameter is null. + + + Initializes a new instance of the class by using the specified request context and controller. + The request context. + The controller. + One or both parameters are null. + + + Gets or sets the controller. + The controller. + + + Gets or sets the HTTP context. + The HTTP context. + + + Gets a value that indicates whether the associated action method is a child action. + true if the associated action method is a child action; otherwise, false. + + + Gets an object that contains the view context information for the parent action method. + An object that contains the view context information for the parent action method. + + + Gets or sets the request context. + The request context. + + + Gets or sets the URL route data. + The URL route data. + + + Encapsulates information that describes a controller, such as its name, type, and actions. + + + Initializes a new instance of the class. + + + Gets the name of the controller. + The name of the controller. + + + Gets the type of the controller. + The type of the controller. + + + Finds an action method by using the specified name and controller context. + The information about the action method. + The controller context. + The name of the action. + + + Retrieves a list of action-method descriptors in the controller. + A list of action-method descriptors in the controller. + + + Retrieves custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Retrieves custom attributes of a specified type that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + The parameter is null (Nothing in Visual Basic). + + + Retrieves a value that indicates whether one or more instance of the specified custom attribute are defined for this member. + true if the is defined for this member; otherwise, false. + The type of the custom attribute. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The parameter is null (Nothing in Visual Basic). + + + When implemented in a derived class, gets the unique ID for the controller descriptor using lazy initialization. + The unique ID. + + + Adds the controller to the instance. + + + Initializes a new instance of the class. + + + Returns the collection of controller instance filters. + The collection of controller instance filters. + The controller context. + The action descriptor. + + + Represents an attribute that invokes a custom model binder. + + + Initializes a new instance of the class. + + + Retrieves the associated model binder. + A reference to an object that implements the interface. + + + Provides a container for common metadata, for the class, and for the class for a data model. + + + Initializes a new instance of the class. + The data-annotations model metadata provider. + The type of the container. + The model accessor. + The type of the model. + The name of the property. + The display column attribute. + + + Returns simple text for the model data. + Simple text for the model data. + + + Implements the default model metadata provider for ASP.NET MVC. + + + Initializes a new instance of the class. + + + Gets the metadata for the specified property. + The metadata for the property. + The attributes. + The type of the container. + The model accessor. + The type of the model. + The name of the property. + + + Represents the method that creates a instance. + + + Provides a model validator. + + + Initializes a new instance of the class. + The metadata for the model. + The controller context for the model. + The validation attribute for the model. + + + Gets the validation attribute for the model validator. + The validation attribute for the model validator. + + + Gets the error message for the validation failure. + The error message for the validation failure. + + + Retrieves a collection of client validation rules. + A collection of client validation rules. + + + Gets a value that indicates whether model validation is required. + true if model validation is required; otherwise, false. + + + Returns a list of validation error messages for the model. + A list of validation error messages for the model, or an empty list if no errors have occurred. + The container for the model. + + + Provides a model validator for a specified validation type. + + + + Initializes a new instance of the class. + The metadata for the model. + The controller context for the model. + The validation attribute for the model. + + + Gets the validation attribute from the model validator. + The validation attribute from the model validator. + + + Implements the default validation provider for ASP.NET MVC. + + + Initializes a new instance of the class. + + + Gets or sets a value that indicates whether non-nullable value types are required. + true if non-nullable value types are required; otherwise, false. + + + Gets a list of validators. + A list of validators. + The metadata. + The context. + The list of validation attributes. + + + Registers an adapter to provide client-side validation. + The type of the validation attribute. + The type of the adapter. + + + Registers an adapter factory for the validation provider. + The type of the attribute. + The factory that will be used to create the object for the specified attribute. + + + Registers the default adapter. + The type of the adapter. + + + Registers the default adapter factory. + The factory that will be used to create the object for the default adapter. + + + Registers an adapter to provide default object validation. + The type of the adapter. + + + Registers an adapter factory for the default object validation provider. + The factory. + + + Registers an adapter to provide object validation. + The type of the model. + The type of the adapter. + + + Registers an adapter factory for the object validation provider. + The type of the model. + The factory. + + + Provides a factory for validators that are based on . + + + Provides a container for the error-information model validator. + + + Initializes a new instance of the class. + + + Gets a list of error-information model validators. + A list of error-information model validators. + The model metadata. + The controller context. + + + Represents the controller factory that is registered by default. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using a controller activator. + An object that implements the controller activator interface. + + + Creates the specified controller by using the specified request context. + The controller. + The context of the HTTP request, which includes the HTTP context and route data. + The name of the controller. + The parameter is null. + The parameter is null or empty. + + + Retrieves the controller instance for the specified request context and controller type. + The controller instance. + The context of the HTTP request, which includes the HTTP context and route data. + The type of the controller. + + is null. + + cannot be assigned. + An instance of cannot be created. + + + Returns the controller's session behavior. + The controller's session behavior. + The request context. + The type of the controller. + + + Retrieves the controller type for the specified name and request context. + The controller type. + The context of the HTTP request, which includes the HTTP context and route data. + The name of the controller. + + + Releases the specified controller. + The controller to release. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. This method calls the method. + The controller's session behavior. + The request context. + The controller name. + + + Maps a browser request to a data object. This class provides a concrete implementation of a model binder. + + + Initializes a new instance of the class. + + + Gets or sets the model binders for the application. + The model binders for the application. + + + Binds the model by using the specified controller context and binding context. + The bound object. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + The parameter is null. + + + Binds the specified property by using the specified controller context and binding context and the specified property descriptor. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + Describes a property to be bound. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. + + + Creates the specified model type by using the specified controller context and binding context. + A data object of the specified type. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + The type of the model object to return. + + + Creates an index (a subindex) based on a category of components that make up a larger index, where the specified index value is an integer. + The name of the subindex. + The prefix for the subindex. + The index value. + + + Creates an index (a subindex) based on a category of components that make up a larger index, where the specified index value is a string. + The name of the subindex. + The prefix for the subindex. + The index value. + + + Creates the name of the subproperty by using the specified prefix and property name. + The name of the subproperty. + The prefix for the subproperty. + The name of the property. + + + Returns a set of properties that match the property filter restrictions that are established by the specified . + An enumerable set of property descriptors. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + + + Returns the properties of the model by using the specified controller context and binding context. + A collection of property descriptors. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + + + Returns the value of a property using the specified controller context, binding context, property descriptor, and property binder. + An object that represents the property value. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + The descriptor for the property to access. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. + An object that provides a way to bind the property. + + + Returns the descriptor object for a type that is specified by its controller context and binding context. + A custom type descriptor object. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + + + Determines whether a data model is valid for the specified binding context. + true if the model is valid; otherwise, false. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + The parameter is null. + + + Called when the model is updated. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + + + Called when the model is updating. + true if the model is updating; otherwise, false. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + + + Called when the specified property is validated. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + Describes a property to be validated. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. + The value to set for the property. + + + Called when the specified property is validating. + true if the property is validating; otherwise, false. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + Describes a property being validated. The descriptor provides information such as component type, property type, and property value. It also provides methods to get or set the property value. + The value to set for the property. + + + Gets or sets the name of the resource file (class key) that contains localized string values. + The name of the resource file (class key). + + + Sets the specified property by using the specified controller context, binding context, and property value. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + Describes a property to be set. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. + The value to set for the property. + + + Represents a memory cache for view locations. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified cache time span. + The cache time span. + The Ticks attribute of the parameter is set to a negative number. + + + Retrieves the default view location by using the specified HTTP context and cache key. + The default view location. + The HTTP context. + The cache key + The parameter is null. + + + Inserts the view in the specified virtual path by using the specified HTTP context, cache key, and virtual path. + The HTTP context. + The cache key. + The virtual path + The parameter is null. + + + Creates an empty view location cache. + + + Gets or sets the cache time span. + The cache time span. + + + Provides a registration point for dependency resolvers that implement or the Common Service Locator IServiceLocator interface. + + + Initializes a new instance of the class. + + + Gets the implementation of the dependency resolver. + The implementation of the dependency resolver. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. + The implementation of the dependency resolver. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. + The function that provides the service. + The function that provides the services. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. + The common service locator. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. + The object that implements the dependency resolver. + + + Provides a registration point for dependency resolvers using the specified service delegate and specified service collection delegates. + The service delegate. + The services delegates. + + + Provides a registration point for dependency resolvers using the provided common service locator when using a service locator interface. + The common service locator. + + + Provides a registration point for dependency resolvers, using the specified dependency resolver interface. + The dependency resolver. + + + Provides a type-safe implementation of and . + + + Resolves singly registered services that support arbitrary object creation. + The requested service or object. + The dependency resolver instance that this method extends. + The type of the requested service or object. + + + Resolves multiply registered services. + The requested services. + The dependency resolver instance that this method extends. + The type of the requested services. + + + Represents the base class for value providers whose values come from a collection that implements the interface. + The type of the value. + + + Initializes a new instance of the class. + The name/value pairs that are used to initialize the value provider. + Information about a specific culture, such as the names of the culture, the writing system, and the calendar used. + The parameter is null. + + + Determines whether the collection contains the specified prefix. + true if the collection contains the specified prefix; otherwise, false. + The prefix to search for. + The parameter is null. + + + Returns a value object using the specified key and controller context. + The value object for the specified key. + The key of the value object to retrieve. + The parameter is null. + + + Provides an empty metadata provider for data models that do not require metadata. + + + Initializes a new instance of the class. + + + Creates a new instance of the class. + A new instance of the class. + The attributes. + The type of the container. + The model accessor. + The type of the model. + The name of the model. + + + Provides an empty validation provider for models that do not require a validator. + + + Initializes a new instance of the class. + + + Gets the empty model validator. + The empty model validator. + The metadata. + The context. + + + Represents a result that does nothing, such as a controller action method that returns nothing. + + + Initializes a new instance of the class. + + + Executes the specified result context. + The result context. + + + Provides the context for using the class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class for the specified exception by using the specified controller context. + The controller context. + The exception. + The parameter is null. + + + Gets or sets the exception object. + The exception object. + + + Gets or sets a value that indicates whether the exception has been handled. + true if the exception has been handled; otherwise, false. + + + Gets or sets the action result. + The action result. + + + Provides a helper class to get the model name from an expression. + + + Gets the model name from a lambda expression. + The model name. + The expression. + + + Gets the model name from a string expression. + The model name. + The expression. + + + Provides a container for client-side field validation metadata. + + + Initializes a new instance of the class. + + + Gets or sets the name of the data field. + The name of the data field. + + + Gets or sets a value that indicates whether the validation message contents should be replaced with the client validation error. + true if the validation message contents should be replaced with the client validation error; otherwise, false. + + + Gets or sets the validator message ID. + The validator message ID. + + + Gets the client validation rules. + The client validation rules. + + + Sends the contents of a binary file to the response. + + + Initializes a new instance of the class by using the specified file contents and content type. + The byte array to send to the response. + The content type to use for the response. + The parameter is null. + + + The binary content to send to the response. + The file contents. + + + Writes the file content to the response. + The response. + + + Sends the contents of a file to the response. + + + Initializes a new instance of the class by using the specified file name and content type. + The name of the file to send to the response. + The content type of the response. + The parameter is null or empty. + + + Gets or sets the path of the file that is sent to the response. + The path of the file that is sent to the response. + + + Writes the file to the response. + The response. + + + Represents a base class that is used to send binary file content to the response. + + + Initializes a new instance of the class. + The type of the content. + The parameter is null or empty. + + + Gets the content type to use for the response. + The type of the content. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context within which the result is executed. + The parameter is null. + + + Gets or sets the content-disposition header so that a file-download dialog box is displayed in the browser with the specified file name. + The name of the file. + + + Writes the file to the response. + The response. + + + Sends binary content to the response by using a instance. + + + Initializes a new instance of the class. + The stream to send to the response. + The content type to use for the response. + The parameter is null. + + + Gets the stream that will be sent to the response. + The file stream. + + + Writes the file to the response. + The response. + + + Represents a metadata class that contains a reference to the implementation of one or more of the filter interfaces, the filter's order, and the filter's scope. + + + Initializes a new instance of the class. + The instance. + The scope. + The order. + + + Represents a constant that is used to specify the default ordering of filters. + + + Gets the instance of this class. + The instance of this class. + + + Gets the order in which the filter is applied. + The order in which the filter is applied. + + + Gets the scope ordering of the filter. + The scope ordering of the filter. + + + Represents the base class for action and result filter attributes. + + + Initializes a new instance of the class. + + + Gets or sets a value that indicates whether more than one instance of the filter attribute can be specified. + true if more than one instance of the filter attribute can be specified; otherwise, false. + + + Gets or sets the order in which the action filters are executed. + The order in which the action filters are executed. + + + Defines a filter provider for filter attributes. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class and optionally caches attribute instances. + true to cache attribute instances; otherwise, false. + + + Gets a collection of custom action attributes. + A collection of custom action attributes. + The controller context. + The action descriptor. + + + Gets a collection of controller attributes. + A collection of controller attributes. + The controller context. + The action descriptor. + + + Aggregates the filters from all of the filter providers into one collection. + The collection filters from all of the filter providers. + The controller context. + The action descriptor. + + + Encapsulates information about the available action filters. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified filters collection. + The filters collection. + + + Gets all the action filters in the application. + The action filters. + + + Gets all the authorization filters in the application. + The authorization filters. + + + Gets all the exception filters in the application. + The exception filters. + + + Gets all the result filters in the application. + The result filters. + + + Represents the collection of filter providers for the application. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the filter providers collection. + The filter providers collection. + + + Returns the collection of filter providers. + The collection of filter providers. + The controller context. + The action descriptor. + + + Provides a registration point for filters. + + + Provides a registration point for filters. + The collection of filters. + + + Defines values that specify the order in which ASP.NET MVC filters run within the same filter type and filter order. + + + Specifies first. + + + Specifies an order before and after . + + + Specifies an order before and after . + + + Specifies an order before and after . + + + Specifies last. + + + Contains the form value providers for the application. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The collection. + The parameter is null. + + + Gets the specified value provider. + The value provider. + The name of the value provider to get. + The parameter is null or empty. + + + Gets a value that indicates whether the value provider contains an entry that has the specified prefix. + true if the value provider contains an entry that has the specified prefix; otherwise, false. + The prefix to look for. + + + Gets a value from a value provider using the specified key. + A value from a value provider. + The key. + + + Returns a dictionary that contains the value providers. + A dictionary of value providers. + + + Encapsulates information that is required in order to validate and process the input data from an HTML form. + + + Initializes a new instance of the class. + + + Gets the field validators for the form. + A dictionary of field validators for the form. + + + Gets or sets the form identifier. + The form identifier. + + + Returns a serialized object that contains the form identifier and field-validation values for the form. + A serialized object that contains the form identifier and field-validation values for the form. + + + Returns the validation value for the specified input field. + The value to validate the field input with. + The name of the field to retrieve the validation value for. + The parameter is either null or empty. + + + Returns the validation value for the specified input field and a value that indicates what to do if the validation value is not found. + The value to validate the field input with. + The name of the field to retrieve the validation value for. + true to create a validation value if one is not found; otherwise, false. + The parameter is either null or empty. + + + Returns a value that indicates whether the specified field has been rendered in the form. + true if the field has been rendered; otherwise, false. + The field name. + + + Sets a value that indicates whether the specified field has been rendered in the form. + The field name. + true to specify that the field has been rendered in the form; otherwise, false. + + + Determines whether client validation errors should be dynamically added to the validation summary. + true if client validation errors should be added to the validation summary; otherwise, false. + + + Gets or sets the identifier for the validation summary. + The identifier for the validation summary. + + + Enumerates the HTTP request types for a form. + + + Specifies a GET request. + + + Specifies a POST request. + + + Represents a value provider for form values that are contained in a object. + + + Initializes a new instance of the class. + An object that encapsulates information about the current HTTP request. + + + Represents a class that is responsible for creating a new instance of a form-value provider object. + + + Initializes a new instance of the class. + + + Returns a form-value provider object for the specified controller context. + A form-value provider object. + An object that encapsulates information about the current HTTP request. + The parameter is null. + + + Represents a class that contains all the global filters. + + + Initializes a new instance of the class. + + + Adds the specified filter to the global filter collection. + The filter. + + + Adds the specified filter to the global filter collection using the specified filter run order. + The filter. + The filter run order. + + + Removes all filters from the global filter collection. + + + Determines whether a filter is in the global filter collection. + true if is found in the global filter collection; otherwise, false. + The filter. + + + Gets the number of filters in the global filter collection. + The number of filters in the global filter collection. + + + Returns an enumerator that iterates through the global filter collection. + An enumerator that iterates through the global filter collection. + + + Removes all the filters that match the specified filter. + The filter to remove. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. + An enumerator that iterates through the global filter collection. + + + This API supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. + An enumerator that iterates through the global filter collection. + The controller context. + The action descriptor. + + + Represents the global filter collection. + + + Gets or sets the global filter collection. + The global filter collection. + + + Represents an attribute that is used to handle an exception that is thrown by an action method. + + + Initializes a new instance of the class. + + + Gets or sets the type of the exception. + The type of the exception. + + + Gets or sets the master view for displaying exception information. + The master view. + + + Called when an exception occurs. + The action-filter context. + The parameter is null. + + + Gets the unique identifier for this attribute. + The unique identifier for this attribute. + + + Gets or sets the page view for displaying exception information. + The page view. + + + Encapsulates information for handling an error that was thrown by an action method. + + + Initializes a new instance of the class. + The exception. + The name of the controller. + The name of the action. + The parameter is null. + The or parameter is null or empty. + + + Gets or sets the name of the action that was executing when the exception was thrown. + The name of the action. + + + Gets or sets the name of the controller that contains the action method that threw the exception. + The name of the controller. + + + Gets or sets the exception object. + The exception object. + + + Represents an attribute that is used to indicate whether a property or field value should be rendered as a hidden input element. + + + Initializes a new instance of the class. + + + Gets or sets a value that indicates whether to display the value of the hidden input element. + true if the value should be displayed; otherwise, false. + + + Represents support for rendering HTML controls in a view. + + + Initializes a new instance of the class by using the specified view context and view data container. + The view context. + The view data container. + The or the parameter is null. + + + Initializes a new instance of the class by using the specified view context, view data container, and route collection. + The view context. + The view data container. + The route collection. + One or more parameters is null. + + + Replaces underscore characters (_) with hyphens (-) in the specified HTML attributes. + The HTML attributes with underscore characters replaced by hyphens. + The HTML attributes. + + + Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. + The generated form field (anti-forgery token). + + + Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. The field value is generated using the specified salt value. + The generated form field (anti-forgery token). + The salt value, which can be any non-empty string. + + + Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. The field value is generated using the specified salt value, domain, and path. + The generated form field (anti-forgery token). + The salt value, which can be any non-empty string. + The application domain. + The virtual path. + + + Converts the specified attribute object to an HTML-encoded string. + The HTML-encoded string. If the value parameter is null or empty, this method returns an empty string. + The object to encode. + + + Converts the specified attribute string to an HTML-encoded string. + The HTML-encoded string. If the value parameter is null or empty, this method returns an empty string. + The string to encode. + + + Gets or sets a value that indicates whether client validation is enabled. + true if enable client validation is enabled; otherwise, false. + + + Enables input validation that is performed by using client script in the browser. + + + Enables or disables client validation. + true to enable client validation; otherwise, false. + + + Enables unobtrusive JavaScript. + + + Enables or disables unobtrusive JavaScript. + true to enable unobtrusive JavaScript; otherwise, false. + + + Converts the value of the specified object to an HTML-encoded string. + The HTML-encoded string. + The object to encode. + + + Converts the specified string to an HTML-encoded string. + The HTML-encoded string. + The string to encode. + + + Creates an HTML element ID using the specified element name. + The ID of the HTML element. + The name of the HTML element. + The parameter is null. + + + Creates an HTML element ID using the specified element name and a string that replaces dots in the name. + The ID of the HTML element. + The name of the HTML element. + The string that replaces dots (.) in the parameter. + The parameter or the parameter is null. + + + Generates an HTML anchor element (a element) that links to the specified action method, and enables the user to specify the communication protocol, name of the host, and a URL fragment. + An HTML element that links to the specified action method. + The context of the HTTP request. + The collection of URL routes. + The text caption to display for the link. + The name of the route that is used to return a virtual path. + The name of the action method. + The name of the controller. + The communication protocol, such as HTTP or HTTPS. If this parameter is null, the protocol defaults to HTTP. + The name of the host. + The fragment identifier. + An object that contains the parameters for a route. + An object that contains the HTML attributes for the element. + + + Generates an HTML anchor element (a element) that links to the specified action method. + An HTML element that links to the specified action method. + The context of the HTTP request. + The collection of URL routes. + The text caption to display for the link. + The name of the route that is used to return a virtual path. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + An object that contains the HTML attributes for the element. + + + Generates an HTML anchor element (a element) that links to the specified URL route, and enables the user to specify the communication protocol, name of the host, and a URL fragment. + An HTML element that links to the specified URL route. + The context of the HTTP request. + The collection of URL routes. + The text caption to display for the link. + The name of the route that is used to return a virtual path. + The communication protocol, such as HTTP or HTTPS. If this parameter is null, the protocol defaults to HTTP. + The name of the host. + The fragment identifier. + An object that contains the parameters for a route. + An object that contains the HTML attributes for the element. + + + Generates an HTML anchor element (a element) that links to the specified URL route. + An HTML element that links to the specified URL route. + The context of the HTTP request. + The collection of URL routes. + The text caption to display for the link. + The name of the route that is used to return a virtual path. + An object that contains the parameters for a route. + An object that contains the HTML attributes for the element. + + + Returns the HTTP method that handles form input (GET or POST) as a string. + The form method string, either "get" or "post". + The HTTP method that handles the form. + + + Returns the HTML input control type as a string. + The input type string ("checkbox", "hidden", "password", "radio", or "text"). + The enumerated input type. + + + Gets the collection of unobtrusive JavaScript validation attributes using the specified HTML name attribute. + The collection of unobtrusive JavaScript validation attributes. + The HTML name attribute. + + + Gets the collection of unobtrusive JavaScript validation attributes using the specified HTML name attribute and model metadata. + The collection of unobtrusive JavaScript validation attributes. + The HTML name attribute. + The model metadata. + + + Returns a hidden input element that identifies the override method for the specified HTTP data-transfer method that was used by the client. + The override method that uses the HTTP data-transfer method that was used by the client. + The HTTP data-transfer method that was used by the client (DELETE, HEAD, or PUT). + The parameter is not "PUT", "DELETE", or "HEAD". + + + Returns a hidden input element that identifies the override method for the specified verb that represents the HTTP data-transfer method used by the client. + The override method that uses the verb that represents the HTTP data-transfer method used by the client. + The verb that represents the HTTP data-transfer method used by the client. + The parameter is not "PUT", "DELETE", or "HEAD". + + + Gets or sets the character that replaces periods in the ID attribute of an element. + The character that replaces periods in the ID attribute of an element. + + + Returns markup that is not HTML encoded. + The HTML markup without encoding. + The HTML markup. + + + Gets or sets the collection of routes for the application. + The collection of routes for the application. + + + Gets or sets a value that indicates whether unobtrusive JavaScript is enabled. + true if unobtrusive JavaScript is enabled; otherwise, false. + + + The name of the CSS class that is used to style an input field when a validation error occurs. + + + The name of the CSS class that is used to style an input field when the input is valid. + + + The name of the CSS class that is used to style the error message when a validation error occurs. + + + The name of the CSS class that is used to style the validation message when the input is valid. + + + The name of the CSS class that is used to style validation summary error messages. + + + The name of the CSS class that is used to style the validation summary when the input is valid. + + + Gets or sets the context information about the view. + The context of the view. + + + Gets the current view data dictionary. + The view data dictionary. + + + Gets or sets the view data container. + The view data container. + + + Represents support for rendering HTML controls in a strongly typed view. + The type of the model. + + + Initializes a new instance of the class by using the specified view context and view data container. + The view context. + The view data container. + + + Initializes a new instance of the class by using the specified view context, view data container, and route collection. + The view context. + The view data container. + The route collection. + + + Gets the strongly typed view data dictionary. + The strongly typed view data dictionary. + + + Represents an attribute that is used to restrict an action method so that the method handles only HTTP DELETE requests. + + + Initializes a new instance of the class. + + + Determines whether a request is a valid HTTP DELETE request. + true if the request is valid; otherwise, false. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + Encapsulates information about a method, such as its type, return type, and arguments. + + + Represents a value provider to use with values that come from a collection of HTTP files. + + + Initializes a new instance of the class. + An object that encapsulates information about the current HTTP request. + + + Represents a class that is responsible for creating a new instance of an HTTP file collection value provider object. + + + Initializes a new instance of the class. + + + Returns a value provider object for the specified controller context. + An HTTP file collection value provider. + An object that encapsulates information about the HTTP request. + The parameter is null. + + + Represents an attribute that is used to restrict an action method so that the method handles only HTTP GET requests. + + + Initializes a new instance of the class. + + + Determines whether a request is a valid HTTP GET request. + true if the request is valid; otherwise, false. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + Encapsulates information about a method, such as its type, return type, and arguments. + + + Defines an object that is used to indicate that the requested resource was not found. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using a status description. + The status description. + + + Represents an attribute that is used to restrict an action method so that the method handles only HTTP POST requests. + + + Initializes a new instance of the class. + + + Determines whether a request is a valid HTTP POST request. + true if the request is valid; otherwise, false. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + Encapsulates information about a method, such as its type, return type, and arguments. + + + Binds a model to a posted file. + + + Initializes a new instance of the class. + + + Binds the model. + The bound value. + The controller context. + The binding context. + One or both parameters are null. + + + Represents an attribute that is used to restrict an action method so that the method handles only HTTP PUT requests. + + + Initializes a new instance of the class. + + + Determines whether a request is a valid HTTP PUT request. + true if the request is valid; otherwise, false. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + Encapsulates information about a method, such as its type, return type, and arguments. + + + Extends the class that contains the HTTP values that were sent by a client during a Web request. + + + Retrieves the HTTP data-transfer method override that was used by the client. + The HTTP data-transfer method override that was used by the client. + An object that contains the HTTP values that were sent by a client during a Web request. + The parameter is null. + The HTTP data-transfer method override was not implemented. + + + Provides a way to return an action result with a specific HTTP response status code and description. + + + Initializes a new instance of the class using a status code. + The status code. + + + Initializes a new instance of the class using a status code and status description. + The status code. + The status description. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. + + + Gets the HTTP status code. + The HTTP status code. + + + Gets the HTTP status description. + the HTTP status description. + + + Represents the result of an unauthorized HTTP request. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the status description. + The status description. + + + Enumerates the HTTP verbs. + + + Retrieves the information or entity that is identified by the URI of the request. + + + Posts a new entity as an addition to a URI. + + + Replaces an entity that is identified by a URI. + + + Requests that a specified URI be deleted. + + + Retrieves the message headers for the information or entity that is identified by the URI of the request. + + + Defines the methods that are used in an action filter. + + + Called after the action method executes. + The filter context. + + + Called before an action method executes. + The filter context. + + + Defines the contract for an action invoker, which is used to invoke an action in response to an HTTP request. + + + Invokes the specified action by using the specified controller context. + true if the action was found; otherwise, false. + The controller context. + The name of the action. + + + Defines the methods that are required for an authorization filter. + + + Called when authorization is required. + The filter context. + + + Provides a way for the ASP.NET MVC validation framework to discover at run time whether a validator has support for client validation. + + + When implemented in a class, returns client validation rules for that class. + The client validation rules for this validator. + The model metadata. + The controller context. + + + Defines the methods that are required for a controller. + + + Executes the specified request context. + The request context. + + + Provides fine-grained control over how controllers are instantiated using dependency injection. + + + When implemented in a class, creates a controller. + The created controller. + The request context. + The controller type. + + + Defines the methods that are required for a controller factory. + + + Creates the specified controller by using the specified request context. + The controller. + The request context. + The name of the controller. + + + Gets the controller's session behavior. + The controller's session behavior. + The request context. + The name of the controller whose session behavior you want to get. + + + Releases the specified controller. + The controller. + + + Defines the methods that simplify service location and dependency resolution. + + + Resolves singly registered services that support arbitrary object creation. + The requested service or object. + The type of the requested service or object. + + + Resolves multiply registered services. + The requested services. + The type of the requested services. + + + Defines the methods that are required for an exception filter. + + + Called when an exception occurs. + The filter context. + + + Provides an interface for finding filters. + + + Returns an enumerator that contains all the instances in the service locator. + The enumerator that contains all the instances in the service locator. + The controller context. + The action descriptor. + + + Provides an interface for exposing attributes to the class. + + + When implemented in a class, provides metadata to the model metadata creation process. + The model metadata. + + + Defines the methods that are required for a model binder. + + + Binds the model to a value by using the specified controller context and binding context. + The bound value. + The controller context. + The binding context. + + + Defines methods that enable dynamic implementations of model binding for classes that implement the interface. + + + Returns the model binder for the specified type. + The model binder for the specified type. + The type of the model. + + + Defines members that specify the order of filters and whether multiple filters are allowed. + + + When implemented in a class, gets or sets a value that indicates whether multiple filters are allowed. + true if multiple filters are allowed; otherwise, false. + + + When implemented in a class, gets the filter order. + The filter order. + + + Enumerates the types of input controls. + + + A check box. + + + A hidden field. + + + A password box. + + + A radio button. + + + A text box. + + + Defines the methods that are required for a result filter. + + + Called after an action result executes. + The filter context. + + + Called before an action result executes. + The filter context. + + + Associates a route with an area in an ASP.NET MVC application. + + + Gets the name of the area to associate the route with. + The name of the area to associate the route with. + + + Defines the contract for temporary-data providers that store data that is viewed on the next request. + + + Loads the temporary data. + The temporary data. + The controller context. + + + Saves the temporary data. + The controller context. + The values. + + + Represents an interface that can skip request validation. + + + Retrieves the value of the object that is associated with the specified key. + The value of the object for the specified key. + The key. + true if validation should be skipped; otherwise, false. + + + Defines the methods that are required for a value provider in ASP.NET MVC. + + + Determines whether the collection contains the specified prefix. + true if the collection contains the specified prefix; otherwise, false. + The prefix to search for. + + + Retrieves a value object using the specified key. + The value object for the specified key. + The key of the value object to retrieve. + + + Defines the methods that are required for a view. + + + Renders the specified view context by using the specified the writer object. + The view context. + The writer object. + + + Defines the methods that are required for a view data dictionary. + + + Gets or sets the view data dictionary. + The view data dictionary. + + + Defines the methods that are required for a view engine. + + + Finds the specified partial view by using the specified controller context. + The partial view. + The controller context. + The name of the partial view. + true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false. + + + Finds the specified view by using the specified controller context. + The page view. + The controller context. + The name of the view. + The name of the master. + true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false. + + + Releases the specified view by using the specified controller context. + The controller context. + The view. + + + Defines the methods that are required in order to cache view locations in memory. + + + Gets the view location by using the specified HTTP context and the cache key. + The view location. + The HTTP context. + The cache key. + + + Inserts the specified view location into the cache by using the specified HTTP context and the cache key. + The HTTP context. + The cache key. + The virtual path. + + + Provides fine-grained control over how view pages are instantiated using dependency injection. + + + The created view page. + The controller context. + The type of the controller. + + + Sends JavaScript content to the response. + + + Initializes a new instance of the class. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context within which the result is executed. + The parameter is null. + + + Gets or sets the script. + The script. + + + Specifies whether HTTP GET requests from the client are allowed. + + + HTTP GET requests from the client are allowed. + + + HTTP GET requests from the client are not allowed. + + + Represents a class that is used to send JSON-formatted content to the response. + + + Initializes a new instance of the class. + + + Gets or sets the content encoding. + The content encoding. + + + Gets or sets the type of the content. + The type of the content. + + + Gets or sets the data. + The data. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context within which the result is executed. + The parameter is null. + + + Gets or sets a value that indicates whether HTTP GET requests from the client are allowed. + A value that indicates whether HTTP GET requests from the client are allowed. + + + Enables action methods to send and receive JSON-formatted text and to model-bind the JSON text to parameters of action methods. + + + Initializes a new instance of the class. + + + Returns a JSON value-provider object for the specified controller context. + A JSON value-provider object for the specified controller context. + The controller context. + + + Maps a browser request to a LINQ object. + + + Initializes a new instance of the class. + + + Binds the model by using the specified controller context and binding context. + The bound data object. If the model cannot be bound, this method returns null. + The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. + The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. + + + Represents an attribute that is used to associate a model type to a model-builder type. + + + Initializes a new instance of the class. + The type of the binder. + The parameter is null. + + + Gets or sets the type of the binder. + The type of the binder. + + + Retrieves an instance of the model binder. + A reference to an object that implements the interface. + An error occurred while an instance of the model binder was being created. + + + Represents a class that contains all model binders for the application, listed by binder type. + + + Initializes a new instance of the class. + + + Adds the specified item to the model binder dictionary. + The object to add to the instance. + The object is read-only. + + + Adds the specified item to the model binder dictionary using the specified key. + The key of the element to add. + The value of the element to add. + The object is read-only. + + is null. + An element that has the same key already exists in the object. + + + Removes all items from the model binder dictionary. + The object is read-only. + + + Determines whether the model binder dictionary contains a specified value. + true if is found in the model binder dictionary; otherwise, false. + The object to locate in the object. + + + Determines whether the model binder dictionary contains an element that has the specified key. + true if the model binder dictionary contains an element that has the specified key; otherwise, false. + The key to locate in the object. + + is null. + + + Copies the elements of the model binder dictionary to an array, starting at a specified index. + The one-dimensional array that is the destination of the elements copied from . The array must have zero-based indexing. + The zero-based index in at which copying starts. + + 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 object is greater than the available space from to the end of the destination array. -or- Type cannot be cast automatically to the type of the destination array. + + + Gets the number of elements in the model binder dictionary. + The number of elements in the model binder dictionary. + + + Gets or sets the default model binder. + The default model binder. + + + Retrieves the model binder for the specified type. + The model binder. + The type of the model to retrieve. + The parameter is null. + + + Retrieves the model binder for the specified type or retrieves the default model binder. + The model binder. + The type of the model to retrieve. + true to retrieve the default model binder. + The parameter is null. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Gets a value that indicates whether the model binder dictionary is read-only. + true if the model binder dictionary is read-only; otherwise, false. + + + Gets or sets the specified key in an object that implements the interface. + The key for the specified item. + The item key. + + + Gets a collection that contains the keys in the model binder dictionary. + A collection that contains the keys in the model binder dictionary. + + + Removes the first occurrence of the specified element from the model binder dictionary. + true if was successfully removed from the model binder dictionary; otherwise, false. This method also returns false if is not found in the model binder dictionary. + The object to remove from the object. + The object is read-only. + + + Removes the element that has the specified key from the model binder dictionary. + true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the model binder dictionary. + The key of the element to remove. + The object is read-only. + + is null. + + + Returns an enumerator that can be used to iterate through a collection. + An enumerator that can be used to iterate through the collection. + + + Gets the value that is associated with the specified key. + true if the object that implements contains an element that has the specified key; otherwise, false. + The key of the 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. + + is null. + + + Gets a collection that contains the values in the model binder dictionary. + A collection that contains the values in the model binder dictionary. + + + Provides a container for model binder providers. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using a list of model binder providers. + A list of model binder providers. + + + Returns a model binder of the specified type. + A model binder of the specified type. + The type of the model binder. + + + Inserts a model binder provider into the at the specified index. + The index. + The model binder provider. + + + Replaces the model binder provider element at the specified index. + The index. + The model binder provider. + + + Provides a container for model binder providers. + + + Provides a registration point for model binder providers for applications that do not use dependency injection. + The model binder provider collection. + + + Provides global access to the model binders for the application. + + + Gets the model binders for the application. + The model binders for the application. + + + Provides the context in which a model binder functions. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the binding context. + The binding context. + + + Gets or sets a value that indicates whether the binder should use an empty prefix. + true if the binder should use an empty prefix; otherwise, false. + + + Gets or sets the model. + The model. + + + Gets or sets the model metadata. + The model metadata. + + + Gets or sets the name of the model. + The name of the model. + + + Gets or sets the state of the model. + The state of the model. + + + Gets or sets the type of the model. + The type of the model. + + + Gets or sets the property filter. + The property filter. + + + Gets the property metadata. + The property metadata. + + + Gets or sets the value provider. + The value provider. + + + Provides a container for an equality validation rule that is sent to the browser. + + + Initializes a new instance of the class. + The error message. + The model value used for equality comparison. + + + Provides a container for a range-validation rule that is sent to the browser. + + + Initializes a new instance of the class. + The error message. + The minimum value. + The maximum value. + + + Provides a container for a regular-expression client validation rule that is sent to the browser. + + + Initializes a new instance of the class. + The error message to display when the regular expression validation fails. + The regular expression. + + + Provides a container for a remote validation rule that is sent to the browser. + + + Initializes a new instance of the class. + The error message. + The URL for the validation parameters. + The HTTP method for the validation parameters. + + + Provides a container for client validation for required field. + + + Initializes a new instance of the class. + The error message to display when a value for the required field is not provided. + + + Provides a base class container for a client validation rule that is sent to the browser. + + + Initializes a new instance of the class. + + + Gets or sets the error message for the client validation rule. + The error message for the client validation rule. + + + Gets the list of validation parameters. + A list of validation parameters. + + + Gets or sets the validation type. + The validation type. + + + Provides a container for a string-length validation rule that is sent to the browser. + + + Initializes a new instance of the class. + The validation error message. + The minimum length of the string. + The maximum length of the string. + + + Represents an error that occurs during model binding. + + + Initializes a new instance of the class by using the specified exception. + The exception. + The parameter is null. + + + Initializes a new instance of the class by using the specified exception and error message. + The exception. + The error message. + The parameter is null. + + + Initializes a new instance of the class by using the specified error message. + The error message. + + + Gets or sets the error message. + The error message. + + + Gets or sets the exception object. + The exception object. + + + A collection of instances. + + + Initializes a new instance of the class. + + + Adds the specified object to the model-error collection. + The exception. + + + Adds the specified error message to the model-error collection. + The error message. + + + Provides a container for common metadata, for the class, and for the class for a data model. + + + Initializes a new instance of the class. + The provider. + The type of the container. + The model accessor. + The type of the model. + The name of the model. + + + Gets a dictionary that contains additional metadata about the model. + A dictionary that contains additional metadata about the model. + + + Gets or sets the type of the container for the model. + The type of the container for the model. + + + Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. + true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true. + + + Gets or sets meta information about the data type. + Meta information about the data type. + + + The default order value, which is 10000. + + + Gets or sets the description of the model. + The description of the model. The default value is null. + + + Gets or sets the display format string for the model. + The display format string for the model. + + + Gets or sets the display name of the model. + The display name of the model. + + + Gets or sets the edit format string of the model. + The edit format string of the model. + + + Returns the metadata from the parameter for the model. + The metadata. + An expression that identifies the model. + The view data dictionary. + The type of the parameter. + The type of the value. + + + Gets the metadata from the expression parameter for the model. + The metadata for the model. + An expression that identifies the model. + The view data dictionary. + + + Gets the display name for the model. + The display name for the model. + + + Returns the simple description of the model. + The simple description of the model. + + + Gets a list of validators for the model. + A list of validators for the model. + The controller context. + + + Gets or sets a value that indicates whether the model object should be rendered using associated HTML elements. + true if the associated HTML elements that contains the model object should be included with the object; otherwise, false. + + + Gets or sets a value that indicates whether the model is a complex type. + A value that indicates whether the model is considered a complex type by the MVC framework. + + + Gets a value that indicates whether the type is nullable. + true if the type is nullable; otherwise, false. + + + Gets or sets a value that indicates whether the model is read-only. + true if the model is read-only; otherwise, false. + + + Gets or sets a value that indicates whether the model is required. + true if the model is required; otherwise, false. + + + Gets the value of the model. + The value of the model. For more information about , see the entry ASP.NET MVC 2 Templates, Part 2: ModelMetadata on Brad Wilson's blog + + + Gets the type of the model. + The type of the model. + + + Gets or sets the string to display for null values. + The string to display for null values. + + + Gets or sets a value that represents order of the current metadata. + The order value of the current metadata. + + + Gets a collection of model metadata objects that describe the properties of the model. + A collection of model metadata objects that describe the properties of the model. + + + Gets the property name. + The property name. + + + Gets or sets the provider. + The provider. + + + Gets or sets a value that indicates whether request validation is enabled. + true if request validation is enabled; otherwise, false. + + + Gets or sets a short display name. + The short display name. + + + Gets or sets a value that indicates whether the property should be displayed in read-only views such as list and detail views. + true if the model should be displayed in read-only views; otherwise, false. + + + Gets or sets a value that indicates whether the model should be displayed in editable views. + true if the model should be displayed in editable views; otherwise, false. + + + Gets or sets the simple display string for the model. + The simple display string for the model. + + + Gets or sets a hint that suggests what template to use for this model. + A hint that suggests what template to use for this model. + + + Gets or sets a value that can be used as a watermark. + The watermark. + + + Provides an abstract base class for a custom metadata provider. + + + When overridden in a derived class, initializes a new instance of the object that derives from the class. + + + Gets a object for each property of a model. + A object for each property of a model. + The container. + The type of the container. + + + Gets metadata for the specified property. + A object for the property. + The model accessor. + The type of the container. + The property to get the metadata model for. + + + Gets metadata for the specified model accessor and model type. + A object for the specified model accessor and model type. + The model accessor. + The type of the model. + + + Provides a container for the current instance. + + + Gets or sets the current object. + The current object. + + + Encapsulates the state of model binding to a property of an action-method argument, or to the argument itself. + + + Initializes a new instance of the class. + + + Returns a object that contains any errors that occurred during model binding. + The errors. + + + Returns a object that encapsulates the value that was being bound during model binding. + The value. + + + Represents the state of an attempt to bind a posted form to an action method, which includes validation information. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using values that are copied from the specified model-state dictionary. + The model-state dictionary. + The parameter is null. + + + Adds the specified item to the model-state dictionary. + The object to add to the model-state dictionary. + The model-state dictionary is read-only. + + + Adds an element that has the specified key and value to the model-state dictionary. + The key of the element to add. + The value of the element to add. + The model-state dictionary is read-only. + + is null. + An element that has the specified key already occurs in the model-state dictionary. + + + Adds the specified model error to the errors collection for the model-state dictionary that is associated with the specified key. + The key. + The exception. + + + Adds the specified error message to the errors collection for the model-state dictionary that is associated with the specified key. + The key. + The error message. + + + Removes all items from the model-state dictionary. + The model-state dictionary is read-only. + + + Determines whether the model-state dictionary contains a specific value. + true if is found in the model-state dictionary; otherwise, false. + The object to locate in the model-state dictionary. + + + Determines whether the model-state dictionary contains the specified key. + true if the model-state dictionary contains the specified key; otherwise, false. + The key to locate in the model-state dictionary. + + + Copies the elements of the model-state dictionary to an array, starting at a specified index. + The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. + The zero-based index in at which copying starts. + + 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 collection 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 . + + + Gets the number of key/value pairs in the collection. + The number of key/value pairs in the collection. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Gets a value that indicates whether the collection is read-only. + true if the collection is read-only; otherwise, false. + + + Gets a value that indicates whether this instance of the model-state dictionary is valid. + true if this instance is valid; otherwise, false. + + + Determines whether there are any objects that are associated with or prefixed with the specified key. + true if the model-state dictionary contains a value that is associated with the specified key; otherwise, false. + The key. + The parameter is null. + + + Gets or sets the value that is associated with the specified key. + The model state item. + The key. + + + Gets a collection that contains the keys in the dictionary. + A collection that contains the keys of the model-state dictionary. + + + Copies the values from the specified object into this dictionary, overwriting existing values if keys are the same. + The dictionary. + + + Removes the first occurrence of the specified object from the model-state dictionary. + true if was successfully removed the model-state dictionary; otherwise, false. This method also returns false if is not found in the model-state dictionary. + The object to remove from the model-state dictionary. + The model-state dictionary is read-only. + + + Removes the element that has the specified key from the model-state dictionary. + true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the model-state dictionary. + The key of the element to remove. + The model-state dictionary is read-only. + + is null. + + + Sets the value for the specified key by using the specified value provider dictionary. + The key. + The value. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Attempts to gets the value that is associated with the specified key. + true if the object that implements contains an element that has the specified key; otherwise, false. + The key of the 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. + + is null. + + + Gets a collection that contains the values in the dictionary. + A collection that contains the values of the model-state dictionary. + + + Provides a container for a validation result. + + + Initializes a new instance of the class. + + + Gets or sets the name of the member. + The name of the member. + + + Gets or sets the validation result message. + The validation result message. + + + Provides a base class for implementing validation logic. + + + Called from constructors in derived classes to initialize the class. + The metadata. + The controller context. + + + Gets the controller context. + The controller context. + + + When implemented in a derived class, returns metadata for client validation. + The metadata for client validation. + + + Returns a composite model validator for the model. + A composite model validator for the model. + The metadata. + The controller context. + + + Gets or sets a value that indicates whether a model property is required. + true if the model property is required; otherwise, false. + + + Gets the metadata for the model validator. + The metadata for the model validator. + + + When implemented in a derived class, validates the object. + A list of validation results. + The container. + + + Provides a list of validators for a model. + + + When implemented in a derived class, initializes a new instance of the class. + + + Gets a list of validators. + A list of validators. + The metadata. + The context. + + + Provides a container for a list of validation providers. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using a list of model-validation providers. + A list of model-validation providers. + + + Returns the list of model validators. + The list of model validators. + The model metadata. + The controller context. + + + Inserts a model-validator provider into the collection. + The zero-based index at which item should be inserted. + The model-validator provider object to insert. + + + Replaces the model-validator provider element at the specified index. + The zero-based index of the model-validator provider element to replace. + The new value for the model-validator provider element. + + + Provides a container for the current validation provider. + + + Gets the model validator provider collection. + The model validator provider collection. + + + Represents a list of items that users can select more than one item from. + + + Initializes a new instance of the class by using the specified items to include in the list. + The items. + The parameter is null. + + + Initializes a new instance of the class by using the specified items to include in the list and the selected values. + The items. + The selected values. + The parameter is null. + + + Initializes a new instance of the class by using the items to include in the list, the data value field, and the data text field. + The items. + The data value field. + The data text field. + The parameter is null. + + + Initializes a new instance of the class by using the items to include in the list, the data value field, the data text field, and the selected values. + The items. + The data value field. + The data text field. + The selected values. + The parameter is null. + + + Gets or sets the data text field. + The data text field. + + + Gets or sets the data value field. + The data value field. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Gets or sets the items in the list. + The items in the list. + + + Gets or sets the selected values. + The selected values. + + + Returns an enumerator can be used to iterate through a collection. + An enumerator that can be used to iterate through the collection. + + + When implemented in a derived class, provides a metadata class that contains a reference to the implementation of one or more of the filter interfaces, the filter's order, and the filter's scope. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class and specifies the order of filters and whether multiple filters are allowed. + true to specify that multiple filters of the same type are allowed; otherwise, false. + The filter order. + + + Gets a value that indicates whether more than one instance of the filter attribute can be specified. + true if more than one instance of the filter attribute is allowed; otherwise, false. + + + Gets a value that indicates the order in which a filter is applied. + A value that indicates the order in which a filter is applied. + + + Selects the controller that will handle an HTTP request. + + + Initializes a new instance of the class. + The request context. + The parameter is null. + + + Adds the version header by using the specified HTTP context. + The HTTP context. + + + Called by ASP.NET to begin asynchronous request processing. + The status of the asynchronous call. + The HTTP context. + The asynchronous callback method. + The state of the asynchronous object. + + + Called by ASP.NET to begin asynchronous request processing using the base HTTP context. + The status of the asynchronous call. + The HTTP context. + The asynchronous callback method. + The state of the asynchronous object. + + + Gets or sets a value that indicates whether the MVC response header is disabled. + true if the MVC response header is disabled; otherwise, false. + + + Called by ASP.NET when asynchronous request processing has ended. + The asynchronous result. + + + Gets a value that indicates whether another request can use the instance. + true if the instance is reusable; otherwise, false. + + + Contains the header name of the ASP.NET MVC version. + + + Processes the request by using the specified HTTP request context. + The HTTP context. + + + Processes the request by using the specified base HTTP request context. + The HTTP context. + + + Gets the request context. + The request context. + + + Called by ASP.NET to begin asynchronous request processing using the base HTTP context. + The status of the asynchronous call. + The HTTP context. + The asynchronous callback method. + The data. + + + Called by ASP.NET when asynchronous request processing has ended. + The asynchronous result. + + + Gets a value that indicates whether another request can use the instance. + true if the instance is reusable; otherwise, false. + + + Enables processing of HTTP Web requests by a custom HTTP handler that implements the interface. + An object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) that are used to service HTTP requests. + + + Represents an HTML-encoded string that should not be encoded again. + + + Initializes a new instance of the class. + The string to create. If no value is assigned, the object is created using an empty-string value. + + + Creates an HTML-encoded string using the specified text value. + An HTML-encoded string. + The value of the string to create . + + + Contains an empty HTML string. + + + Determines whether the specified string contains content or is either null or empty. + true if the string is null or empty; otherwise, false. + The string. + + + Verifies and processes an HTTP request. + + + Initializes a new instance of the class. + + + Called by ASP.NET to begin asynchronous request processing. + The status of the asynchronous call. + The HTTP context. + The asynchronous callback method. + The state. + + + Called by ASP.NET to begin asynchronous request processing. + The status of the asynchronous call. + The base HTTP context. + The asynchronous callback method. + The state. + + + Called by ASP.NET when asynchronous request processing has ended. + The asynchronous result. + + + Called by ASP.NET to begin asynchronous request processing. + The status of the asynchronous call. + The context. + The asynchronous callback method. + An object that contains data. + + + Called by ASP.NET when asynchronous request processing has ended. + The status of the asynchronous operations. + + + Verifies and processes an HTTP request. + The HTTP handler. + The HTTP context. + + + Creates an object that implements the IHttpHandler interface and passes the request context to it. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified factory controller object. + The controller factory. + + + Returns the HTTP handler by using the specified HTTP context. + The HTTP handler. + The request context. + + + Returns the session behavior. + The session behavior. + The request context. + + + Returns the HTTP handler by using the specified request context. + The HTTP handler. + The request context. + + + Creates instances of files. + + + Initializes a new instance of the class. + + + Creates a Razor host. + A Razor host. + The virtual path to the target file. + The physical path to the target file. + + + Extends a NameValueCollection object so that the collection can be copied to a specified dictionary. + + + Copies the specified collection to the specified destination. + The collection. + The destination. + + + Copies the specified collection to the specified destination, and optionally replaces previous entries. + The collection. + The destination. + true to replace previous entries; otherwise, false. + + + Represents the base class for value providers whose values come from a object. + + + Initializes a new instance of the class using the specified unvalidated collection. + A collection that contains the values that are used to initialize the provider. + A collection that contains the values that are used to initialize the provider. This collection will not be validated. + An object that contains information about the target culture. + + + Initializes a new instance of the class. + A collection that contains the values that are used to initialize the provider. + An object that contains information about the target culture. + The parameter is null. + + + Determines whether the collection contains the specified prefix. + true if the collection contains the specified prefix; otherwise, false. + The prefix to search for. + The parameter is null. + + + Returns a value object using the specified key. + The value object for the specified key. + The key of the value object to retrieve. + The parameter is null. + + + Returns a value object using the specified key and validation directive. + The value object for the specified key. + The key. + true if validation should be skipped; otherwise, false. + + + Provides a convenience wrapper for the attribute. + + + Initializes a new instance of the class. + + + Represents an attribute that is used to indicate that a controller method is not an action method. + + + Initializes a new instance of the class. + + + Determines whether the attribute marks a method that is not an action method by using the specified controller context. + true if the attribute marks a valid non-action method; otherwise, false. + The controller context. + The method information. + + + Represents an attribute that is used to mark an action method whose output will be cached. + + + Initializes a new instance of the class. + + + Gets or sets the cache profile name. + The cache profile name. + + + Gets or sets the child action cache. + The child action cache. + + + Gets or sets the cache duration, in seconds. + The cache duration. + + + Returns a value that indicates whether a child action cache is active. + true if the child action cache is active; otherwise, false. + The controller context. + + + Gets or sets the location. + The location. + + + Gets or sets a value that indicates whether to store the cache. + true if the cache should be stored; otherwise, false. + + + This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. + The filter context. + + + This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. + The filter context. + + + This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. + The filter context. + + + This method is an implementation of and supports the ASP.NET MVC infrastructure. It is not intended to be used directly from your code. + The filter context. + + + Called before the action result executes. + The filter context, which encapsulates information for using . + The parameter is null. + + + Gets or sets the SQL dependency. + The SQL dependency. + + + Gets or sets the vary-by-content encoding. + The vary-by-content encoding. + + + Gets or sets the vary-by-custom value. + The vary-by-custom value. + + + Gets or sets the vary-by-header value. + The vary-by-header value. + + + Gets or sets the vary-by-param value. + The vary-by-param value. + + + Encapsulates information for binding action-method parameters to a data model. + + + Initializes a new instance of the class. + + + Gets the model binder. + The model binder. + + + Gets a comma-delimited list of property names for which binding is disabled. + The exclude list. + + + Gets a comma-delimited list of property names for which binding is enabled. + The include list. + + + Gets the prefix to use when the MVC framework binds a value to an action parameter or to a model property. + The prefix. + + + Contains information that describes a parameter. + + + Initializes a new instance of the class. + + + Gets the action descriptor. + The action descriptor. + + + Gets the binding information. + The binding information. + + + Gets the default value of the parameter. + The default value of the parameter. + + + Returns an array of custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Returns an array of custom attributes that are defined for this member, identified by type. + An array of custom attributes, or an empty array if no custom attributes exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + The parameter is null. + + + Indicates whether one or more instances of a custom attribute type are defined for this member. + true if the custom attribute type is defined for this member; otherwise, false. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The parameter is null. + + + Gets the name of the parameter. + The name of the parameter. + + + Gets the type of the parameter. + The type of the parameter. + + + Represents a base class that is used to send a partial view to the response. + + + Initializes a new instance of the class. + + + Returns the object that is used to render the view. + The view engine result. + The controller context. + An error occurred while the method was attempting to find the view. + + + Provides a registration point for ASP.NET Razor pre-application start code. + + + Registers Razor pre-application start code. + + + Represents a value provider for query strings that are contained in a object. + + + Initializes a new instance of the class. + An object that encapsulates information about the current HTTP request. + + + Represents a class that is responsible for creating a new instance of a query-string value-provider object. + + + Initializes a new instance of the class. + + + Returns a value-provider object for the specified controller context. + A query-string value-provider object. + An object that encapsulates information about the current HTTP request. + The parameter is null. + + + Provides an adapter for the attribute. + + + Initializes a new instance of the class. + The model metadata. + The controller context. + The range attribute. + + + Gets a list of client validation rules for a range check. + A list of client validation rules for a range check. + + + Represents the class used to create views that have Razor syntax. + + + Initializes a new instance of the class. + The controller context. + The view path. + The layout or master page. + A value that indicates whether view start files should be executed before the view. + The set of extensions that will be used when looking up view start files. + + + Initializes a new instance of the class using the view page activator. + The controller context. + The view path. + The layout or master page. + A value that indicates whether view start files should be executed before the view. + The set of extensions that will be used when looking up view start files. + The view page activator. + + + Gets the layout or master page. + The layout or master page. + + + Renders the specified view context by using the specified writer and instance. + The view context. + The writer that is used to render the view to the response. + The instance. + + + Gets a value that indicates whether view start files should be executed before the view. + A value that indicates whether view start files should be executed before the view. + + + Gets or sets the set of file extensions that will be used when looking up view start files. + The set of file extensions that will be used when looking up view start files. + + + Represents a view engine that is used to render a Web page that uses the ASP.NET Razor syntax. + + + Initializes a new instance of the class. + + + + Creates a partial view using the specified controller context and partial path. + The partial view. + The controller context. + The path to the partial view. + + + Creates a view by using the specified controller context and the paths of the view and master view. + The view. + The controller context. + The path to the view. + The path to the master view. + + + Controls the processing of application actions by redirecting to a specified URI. + + + Initializes a new instance of the class. + The target URL. + The parameter is null. + + + Initializes a new instance of the class using the specified URL and permanent-redirection flag. + The URL. + A value that indicates whether the redirection should be permanent. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context within which the result is executed. + The parameter is null. + + + Gets a value that indicates whether the redirection should be permanent. + true if the redirection should be permanent; otherwise, false. + + + Gets or sets the target URL. + The target URL. + + + Represents a result that performs a redirection by using the specified route values dictionary. + + + Initializes a new instance of the class by using the specified route name and route values. + The name of the route. + The route values. + + + Initializes a new instance of the class by using the specified route name, route values, and permanent-redirection flag. + The name of the route. + The route values. + A value that indicates whether the redirection should be permanent. + + + Initializes a new instance of the class by using the specified route values. + The route values. + + + Enables processing of the result of an action method by a custom type that inherits from the class. + The context within which the result is executed. + The parameter is null. + + + Gets a value that indicates whether the redirection should be permanent. + true if the redirection should be permanent; otherwise, false. + + + Gets or sets the name of the route. + The name of the route. + + + Gets or sets the route values. + The route values. + + + Contains information that describes a reflected action method. + + + Initializes a new instance of the class. + The action-method information. + The name of the action. + The controller descriptor. + Either the or parameter is null. + The parameter is null or empty. + + + Gets the name of the action. + The name of the action. + + + Gets the controller descriptor. + The controller descriptor. + + + Executes the specified controller context by using the specified action-method parameters. + The action return value. + The controller context. + The parameters. + The or parameter is null. + + + Returns an array of custom attributes defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Returns an array of custom attributes defined for this member, identified by type. + An array of custom attributes, or an empty array if no custom attributes exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Retrieves the parameters of the action method. + The parameters of the action method. + + + Retrieves the action selectors. + The action selectors. + + + Indicates whether one or more instances of a custom attribute type are defined for this member. + true if the custom attribute type is defined for this member; otherwise, false. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Gets or sets the action-method information. + The action-method information. + + + Gets the unique ID for the reflected action descriptor using lazy initialization. + The unique ID. + + + Contains information that describes a reflected controller. + + + Initializes a new instance of the class. + The type of the controller. + The parameter is null. + + + Gets the type of the controller. + The type of the controller. + + + Finds the specified action for the specified controller context. + The information about the action. + The controller context. + The name of the action. + The parameter is null. + The parameter is null or empty. + + + Returns the list of actions for the controller. + A list of action descriptors for the controller. + + + Returns an array of custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Returns an array of custom attributes that are defined for this member, identified by type. + An array of custom attributes, or an empty array if no custom attributes exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Returns a value that indicates whether one or more instances of a custom attribute type are defined for this member. + true if the custom attribute type is defined for this member; otherwise, false. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Contains information that describes a reflected action-method parameter. + + + Initializes a new instance of the class. + The parameter information. + The action descriptor. + The or parameter is null. + + + Gets the action descriptor. + The action descriptor. + + + Gets the binding information. + The binding information. + + + Gets the default value of the reflected parameter. + The default value of the reflected parameter. + + + Returns an array of custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Returns an array of custom attributes that are defined for this member, identified by type. + An array of custom attributes, or an empty array if no custom attributes exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + The custom attribute type cannot be loaded. + There is more than one attribute of type defined for this member. + + + Returns a value that indicates whether one or more instances of a custom attribute type are defined for this member. + true if the custom attribute type is defined for this member; otherwise, false. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Gets or sets the parameter information. + The parameter information. + + + Gets the name of the parameter. + The name of the parameter. + + + Gets the type of the parameter. + The type of the parameter. + + + Provides an adapter for the attribute. + + + Initializes a new instance of the class. + The model metadata. + The controller context. + The regular expression attribute. + + + Gets a list of regular-expression client validation rules. + A list of regular-expression client validation rules. + + + Provides an attribute that uses the jQuery validation plug-in remote validator. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified route name. + The route name. + + + Initializes a new instance of the class using the specified action-method name and controller name. + The name of the action method. + The name of the controller. + + + Initializes a new instance of the class using the specified action-method name, controller name, and area name. + The name of the action method. + The name of the controller. + The name of the area. + + + Gets or sets the additional fields that are required for validation. + The additional fields that are required for validation. + + + Returns a comma-delimited string of validation field names. + A comma-delimited string of validation field names. + The name of the validation property. + + + Formats the error message that is displayed when validation fails. + A formatted error message. + A name to display with the error message. + + + Formats the property for client validation by prepending an asterisk (*) and a dot. + The string "*." Is prepended to the property. + The property. + + + Gets a list of client validation rules for the property. + A list of remote client validation rules for the property. + The model metadata. + The controller context. + + + Gets the URL for the remote validation call. + The URL for the remote validation call. + The controller context. + + + Gets or sets the HTTP method used for remote validation. + The HTTP method used for remote validation. The default value is "Get". + + + This method always returns true. + true + The validation target. + + + Gets the route data dictionary. + The route data dictionary. + + + Gets or sets the route name. + The route name. + + + Gets the route collection from the route table. + The route collection from the route table. + + + Provides an adapter for the attribute. + + + Initializes a new instance of the class. + The model metadata. + The controller context. + The required attribute. + + + Gets a list of required-value client validation rules. + A list of required-value client validation rules. + + + Represents an attribute that forces an unsecured HTTP request to be re-sent over HTTPS. + + + Initializes a new instance of the class. + + + Handles unsecured HTTP requests that are sent to the action method. + An object that encapsulates information that is required in order to use the attribute. + The HTTP request contains an invalid transfer method override. All GET requests are considered invalid. + + + Determines whether a request is secured (HTTPS) and, if it is not, calls the method. + An object that encapsulates information that is required in order to use the attribute. + The parameter is null. + + + Provides the context for the method of the class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class. + The controller context. + The result object. + true to cancel execution; otherwise, false. + The exception object. + The parameter is null. + + + Gets or sets a value that indicates whether this instance is canceled. + true if the instance is canceled; otherwise, false. + + + Gets or sets the exception object. + The exception object. + + + Gets or sets a value that indicates whether the exception has been handled. + true if the exception has been handled; otherwise, false. + + + Gets or sets the action result. + The action result. + + + Provides the context for the method of the class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified controller context and action result. + The controller context. + The action result. + The parameter is null. + + + Gets or sets a value that indicates whether this value is "cancel". + true if the value is "cancel"; otherwise, false. + + + Gets or sets the action result. + The action result. + + + Extends a object for MVC routing. + + + Returns an object that contains information about the route and virtual path that are the result of generating a URL in the current area. + An object that contains information about the route and virtual path that are the result of generating a URL in the current area. + An object that contains the routes for the applications. + An object that encapsulates information about the requested route. + The name of the route to use when information about the URL path is retrieved. + An object that contains the parameters for a route. + + + Returns an object that contains information about the route and virtual path that are the result of generating a URL in the current area. + An object that contains information about the route and virtual path that are the result of generating a URL in the current area. + An object that contains the routes for the applications. + An object that encapsulates information about the requested route. + An object that contains the parameters for a route. + + + Ignores the specified URL route for the given list of available routes. + A collection of routes for the application. + The URL pattern for the route to ignore. + The or parameter is null. + + + Ignores the specified URL route for the given list of the available routes and a list of constraints. + A collection of routes for the application. + The URL pattern for the route to ignore. + A set of expressions that specify values for the parameter. + The or parameter is null. + + + Maps the specified URL route. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The URL pattern for the route. + The or parameter is null. + + + Maps the specified URL route and sets default route values. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The URL pattern for the route. + An object that contains default route values. + The or parameter is null. + + + Maps the specified URL route and sets default route values and constraints. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The URL pattern for the route. + An object that contains default route values. + A set of expressions that specify values for the parameter. + The or parameter is null. + + + Maps the specified URL route and sets default route values, constraints, and namespaces. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The URL pattern for the route. + An object that contains default route values. + A set of expressions that specify values for the parameter. + A set of namespaces for the application. + The or parameter is null. + + + Maps the specified URL route and sets default route values and namespaces. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The URL pattern for the route. + An object that contains default route values. + A set of namespaces for the application. + The or parameter is null. + + + Maps the specified URL route and sets the namespaces. + A reference to the mapped route. + A collection of routes for the application. + The name of the route to map. + The URL pattern for the route. + A set of namespaces for the application. + The or parameter is null. + + + Represents a value provider for route data that is contained in an object that implements the interface. + + + Initializes a new instance of the class. + An object that contain information about the HTTP request. + + + Represents a factory for creating route-data value provider objects. + + + Initialized a new instance of the class. + + + Returns a value-provider object for the specified controller context. + A value-provider object. + An object that encapsulates information about the current HTTP request. + The parameter is null. + + + Represents a list that lets users select one item. + + + Initializes a new instance of the class by using the specified items for the list. + The items. + + + Initializes a new instance of the class by using the specified items for the list and a selected value. + The items. + The selected value. + + + Initializes a new instance of the class by using the specified items for the list, the data value field, and the data text field. + The items. + The data value field. + The data text field. + + + Initializes a new instance of the class by using the specified items for the list, the data value field, the data text field, and a selected value. + The items. + The data value field. + The data text field. + The selected value. + + + Gets the list value that was selected by the user. + The selected value. + + + Represents the selected item in an instance of the class. + + + Initializes a new instance of the class. + + + Gets or sets a value that indicates whether this is selected. + true if the item is selected; otherwise, false. + + + Gets or sets the text of the selected item. + The text. + + + Gets or sets the value of the selected item. + The value. + + + Specifies the session state of the controller. + + + Initializes a new instance of the class + The type of the session state. + + + Get the session state behavior for the controller. + The session state behavior for the controller. + + + Provides session-state data to the current object. + + + Initializes a new instance of the class. + + + Loads the temporary data by using the specified controller context. + The temporary data. + The controller context. + An error occurred when the session context was being retrieved. + + + Saves the specified values in the temporary data dictionary by using the specified controller context. + The controller context. + The values. + An error occurred the session context was being retrieved. + + + Provides an adapter for the attribute. + + + Initializes a new instance of the class. + The model metadata. + The controller context. + The string-length attribute. + + + Gets a list of string-length client validation rules. + A list of string-length client validation rules. + + + Represents a set of data that persists only from one request to the next. + + + Initializes a new instance of the class. + + + Adds an element that has the specified key and value to the object. + The key of the element to add. + The value of the element to add. + The object is read-only. + + is null. + An element that has the same key already exists in the object. + + + Removes all items from the instance. + The object is read-only. + + + Determines whether the instance contains an element that has the specified key. + true if the instance contains an element that has the specified key; otherwise, false. + The key to locate in the instance. + + is null. + + + Determines whether the dictionary contains the specified value. + true if the dictionary contains the specified value; otherwise, false. + The value. + + + Gets the number of elements in the object. + The number of elements in the object. + + + Gets the enumerator. + The enumerator. + + + Gets or sets the object that has the specified key. + The object that has the specified key. + The key to access. + + + Marks all keys in the dictionary for retention. + + + Marks the specified key in the dictionary for retention. + The key to retain in the dictionary. + + + Gets an object that contains the keys of elements in the object. + The keys of the elements in the object. + + + Loads the specified controller context by using the specified data provider. + The controller context. + The temporary data provider. + + + Returns an object that contains the element that is associated with the specified key, without marking the key for deletion. + An object that contains the element that is associated with the specified key. + The key of the element to return. + + + Removes the element that has the specified key from the object. + true if the element was removed successfully; otherwise, false. This method also returns false if was not found in the . instance. + The key of the element to remove. + The object is read-only. + + is null. + + + Saves the specified controller context by using the specified data provider. + The controller context. + The temporary data provider. + + + Adds the specified key/value pair to the dictionary. + The key/value pair. + + + Determines whether a sequence contains a specified element by using the default equality comparer. + true if the dictionary contains the specified key/value pair; otherwise, false. + The key/value pair to search for. + + + Copies a key/value pair to the specified array at the specified index. + The target array. + The index. + + + Gets a value that indicates whether the dictionary is read-only. + true if the dictionary is read-only; otherwise, false. + + + Deletes the specified key/value pair from the dictionary. + true if the key/value pair was removed successfully; otherwise, false. + The key/value pair. + + + Returns an enumerator that can be used to iterate through a collection. + An object that can be used to iterate through the collection. + + + Gets the value of the element that has the specified key. + true if the object that implements contains an element that has the specified key; otherwise, false. + The key of the value to get. + When this method returns, the value that is 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. + + is null. + + + Gets the object that contains the values in the object. + The values of the elements in the object that implements . + + + Encapsulates information about the current template context. + + + Initializes a new instance of the class. + + + Gets or sets the formatted model value. + The formatted model value. + + + Retrieves the full DOM ID of a field using the specified HTML name attribute. + The full DOM ID. + The value of the HTML name attribute. + + + Retrieves the fully qualified name (including a prefix) for a field using the specified HTML name attribute. + The prefixed name of the field. + The value of the HTML name attribute. + + + Gets or sets the HTML field prefix. + The HTML field prefix. + + + Contains the number of objects that were visited by the user. + The number of objects. + + + Determines whether the template has been visited by the user. + true if the template has been visited by the user; otherwise, false. + An object that encapsulates information that describes the model. + + + Contains methods to build URLs for ASP.NET MVC within an application. + + + Initializes a new instance of the class using the specified request context. + An object that contains information about the current request and about the route that it matched. + The parameter is null. + + + Initializes a new instance of the class by using the specified request context and route collection. + An object that contains information about the current request and about the route that it matched. + A collection of routes. + The or the parameter is null. + + + Generates a fully qualified URL to an action method by using the specified action name. + The fully qualified URL to an action method. + The name of the action method. + + + Generates a fully qualified URL to an action method by using the specified action name and route values. + The fully qualified URL to an action method. + The name of the action method. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + + + Generates a fully qualified URL to an action method by using the specified action name and controller name. + The fully qualified URL to an action method. + The name of the action method. + The name of the controller. + + + Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values. + The fully qualified URL to an action method. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + + + Generates a fully qualified URL to an action method by using the specified action name, controller name, route values, and protocol to use. + The fully qualified URL to an action method. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + The protocol for the URL, such as "http" or "https". + + + Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values. + The fully qualified URL to an action method. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + + + Generates a fully qualified URL for an action method by using the specified action name, controller name, route values, protocol to use, and host name. + The fully qualified URL to an action method. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + + + Generates a fully qualified URL to an action method for the specified action name and route values. + The fully qualified URL to an action method. + The name of the action method. + An object that contains the parameters for a route. + + + Converts a virtual (relative) path to an application absolute path. + The application absolute path. + The virtual path of the content. + + + Encodes special characters in a URL string into character-entity equivalents. + An encoded URL string. + The text to encode. + + + Returns a string that contains a content URL. + A string that contains a content URL. + The content path. + The HTTP context. + + + Returns a string that contains a URL. + A string that contains a URL. + The route name. + The action name. + The controller name. + The HTTP protocol. + The host name. + The fragment. + The route values. + The route collection. + The request context. + true to include implicit MVC values; otherwise false. + + + Returns a string that contains a URL. + A string that contains a URL. + The route name. + The action name. + The controller name. + The route values. + The route collection. + The request context. + true to include implicit MVC values; otherwise. false. + + + Returns a value that indicates whether the URL is local. + true if the URL is local; otherwise, false. + The URL. + + + Gets information about an HTTP request that matches a defined route. + The request context. + + + Gets a collection that contains the routes that are registered for the application. + The route collection. + + + Generates a fully qualified URL for the specified route values. + The fully qualified URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + + + Generates a fully qualified URL for the specified route name. + The fully qualified URL. + The name of the route that is used to generate the URL. + + + Generates a fully qualified URL for the specified route values by using a route name. + The fully qualified URL. + The name of the route that is used to generate the URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + + + Generates a fully qualified URL for the specified route values by using a route name and the protocol to use. + The fully qualified URL. + The name of the route that is used to generate the URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + The protocol for the URL, such as "http" or "https". + + + Generates a fully qualified URL for the specified route values by using a route name. + The fully qualified URL. + The name of the route that is used to generate the URL. + An object that contains the parameters for a route. + + + Generates a fully qualified URL for the specified route values by using the specified route name, protocol to use, and host name. + The fully qualified URL. + The name of the route that is used to generate the URL. + An object that contains the parameters for a route. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + + + Generates a fully qualified URL for the specified route values. + The fully qualified URL. + An object that contains the parameters for a route. + + + Represents an optional parameter that is used by the class during routing. + + + Contains the read-only value for the optional parameter. + + + Returns an empty string. This method supports the ASP.NET MVC infrastructure and is not intended to be used directly from your code. + An empty string. + + + Provides an object adapter that can be validated. + + + Initializes a new instance of the class. + The model metadata. + The controller context. + + + Validates the specified object. + A list of validation results. + The container. + + + Represents an attribute that is used to detect whether a server request has been tampered with. + + + Initializes a new instance of the class. + + + Called when authorization is required. + The filter context. + The parameter is null. + + + Gets or sets the salt string. + The salt string. + + + Represents an attribute that is used to mark action methods whose input must be validated. + + + Initializes a new instance of the class. + true to enable validation. + + + Gets or sets a value that indicates whether to enable validation. + true if validation is enabled; otherwise, false. + + + Called when authorization is required. + The filter context. + The parameter is null. + + + Represents the collection of value-provider objects for the application. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class and registers the specified value providers. + The list of value providers to register. + + + Determines whether the collection contains the specified prefix. + true if the collection contains the specified prefix; otherwise, false. + The prefix to search for. + + + Returns a value object using the specified key. + The value object for the specified key. + The key of the value object to retrieve. + + + Returns a value object using the specified key and skip-validation parameter. + The value object for the specified key. + The key of the value object to retrieve. + true to specify that validation should be skipped; otherwise, false. + + + Inserts the specified value-provider object into the collection at the specified index location. + The zero-based index location at which to insert the value provider into the collection. + The value-provider object to insert. + The parameter is null. + + + Replaces the value provider at the specified index location with a new value provider. + The zero-based index of the element to replace. + The new value for the element at the specified index. + The parameter is null. + + + Represents a dictionary of value providers for the application. + + + Initializes a new instance of the class. + The controller context. + + + Adds the specified item to the collection of value providers. + The object to add to the object. + The object is read-only. + + + Adds an element that has the specified key and value to the collection of value providers. + The key of the element to add. + The value of the element to add. + The object is read-only. + + is null. + An element that has the specified key already exists in the object. + + + Adds an element that has the specified key and value to the collection of value providers. + The key of the element to add. + The value of the element to add. + The object is read-only. + + is null. + An element that has the specified key already exists in the object. + + + Removes all items from the collection of value providers. + The object is read-only. + + + Determines whether the collection of value providers contains the specified item. + true if is found in the collection of value providers; otherwise, false. + The object to locate in the instance. + + + Determines whether the collection of value providers contains an element that has the specified key. + true if the collection of value providers contains an element that has the key; otherwise, false. + The key of the element to find in the instance. + + is null. + + + Gets or sets the controller context. + The controller context. + + + Copies the elements of the collection to an array, starting at the specified index. + The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. + The zero-based index in at which copying starts. + + 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 collection 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 array. + + + Gets the number of elements in the collection. + The number of elements in the collection. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Gets a value that indicates whether the collection is read-only. + true if the collection is read-only; otherwise, false. + + + Gets or sets the object that has the specified key. + The object. + The key. + + + Gets a collection that contains the keys of the instance. + A collection that contains the keys of the object that implements the interface. + + + Removes the first occurrence of the specified item from the collection of value providers. + true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the collection. + The object to remove from the instance. + The object is read-only. + + + Removes the element that has the specified key from the collection of value providers. + true if the element was successfully removed; otherwise, false. This method also returns false if was not found in the collection. + The key of the element to remove. + The object is read-only. + + is null. + + + Returns an enumerator that can be used to iterate through a collection. + An enumerator that can be used to iterate through the collection. + + + Determines whether the collection contains the specified prefix. + true if the collection contains the specified prefix; otherwise, false. + The prefix to search for. + + + Returns a value object using the specified key. + The value object for the specified key. + The key of the value object to return. + + + Gets the value of the element that has the specified key. + true if the object that implements contains an element that has the specified key; otherwise, false. + The key of the element to get. + When this method returns, the value that is 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. + + is null. + + + Gets a collection that contains the values in the object. + A collection of the values in the object that implements the interface. + + + Represents a container for value-provider factory objects. + + + Gets the collection of value-provider factories for the application. + The collection of value-provider factory objects. + + + Represents a factory for creating value-provider objects. + + + Initializes a new instance of the class. + + + Returns a value-provider object for the specified controller context. + A value-provider object. + An object that encapsulates information about the current HTTP request. + + + Represents the collection of value-provider factories for the application. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified list of value-provider factories. + A list of value-provider factories to initialize the collection with. + + + Returns the value-provider factory for the specified controller context. + The value-provider factory object for the specified controller context. + An object that encapsulates information about the current HTTP request. + + + Inserts the specified value-provider factory object at the specified index location. + The zero-based index location at which to insert the value provider into the collection. + The value-provider factory object to insert. + The parameter is null. + + + Sets the specified value-provider factory object at the given index location. + The zero-based index location at which to insert the value provider into the collection. + The value-provider factory object to set. + The parameter is null. + + + Represents the result of binding a value (such as from a form post or query string) to an action-method argument property, or to the argument itself. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified raw value, attempted value, and culture information. + The raw value. + The attempted value. + The culture. + + + Gets or sets the raw value that is converted to a string for display. + The raw value. + + + Converts the value that is encapsulated by this result to the specified type. + The converted value. + The target type. + The parameter is null. + + + Converts the value that is encapsulated by this result to the specified type by using the specified culture information. + The converted value. + The target type. + The culture to use in the conversion. + The parameter is null. + + + Gets or sets the culture. + The culture. + + + Gets or set the raw value that is supplied by the value provider. + The raw value. + + + Encapsulates information that is related to rendering a view. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified controller context, view, view data dictionary, temporary data dictionary, and text writer. + Encapsulates information about the HTTP request. + The view to render. + The dictionary that contains the data that is required in order to render the view. + The dictionary that contains temporary data for the view. + The text writer object that is used to write HTML output. + One of the parameters is null. + + + Gets or sets a value that indicates whether client-side validation is enabled. + true if client-side validation is enabled; otherwise, false. + + + Gets or sets an object that encapsulates information that is required in order to validate and process the input data from an HTML form. + An object that encapsulates information that is required in order to validate and process the input data from an HTML form. + + + Writes the client validation information to the HTTP response. + + + Gets data that is associated with this request and that is available for only one request. + The temporary data. + + + Gets or sets a value that indicates whether unobtrusive JavaScript is enabled. + true if unobtrusive JavaScript is enabled; otherwise, false. + + + Gets an object that implements the interface to render in the browser. + The view. + + + Gets the view data that is passed to the view. + The view data. + + + Gets or sets the text writer object that is used to write HTML output. + The object that is used to write the HTML output. + + + Represents a container that is used to pass data between a controller and a view. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified model. + The model. + + + Initializes a new instance of the class by using the specified dictionary. + The dictionary. + The parameter is null. + + + Adds the specified item to the collection. + The object to add to the collection. + The collection is read-only. + + + Adds an element to the collection using the specified key and value . + The key of the element to add. + The value of the element to add. + The object is read-only. + + is null. + An element with the same key already exists in the object. + + + Removes all items from the collection. + The object is read-only. + + + Determines whether the collection contains the specified item. + true if is found in the collection; otherwise, false. + The object to locate in the collection. + + + Determines whether the collection contains an element that has the specified key. + true if the collection contains an element that has the specified key; otherwise, false. + The key of the element to locate in the collection. + + is null. + + + Copies the elements of the collection to an array, starting at a particular index. + The one-dimensional array that is the destination of the elements copied from the collection. The array 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 collection 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 . + + + Gets the number of elements in the collection. + The number of elements in the collection. + + + Evaluates the specified expression. + The results of the evaluation. + The expression. + The parameter is null or empty. + + + Evaluates the specified expression by using the specified format. + The results of the evaluation. + The expression. + The format. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Returns information about the view data as defined by the parameter. + An object that contains the view data information that is defined by the parameter. + A set of key/value pairs that define the view-data information to return. + The parameter is either null or empty. + + + Gets a value that indicates whether the collection is read-only. + true if the collection is read-only; otherwise, false. + + + Gets or sets the item that is associated with the specified key. + The value of the selected item. + The key. + + + Gets a collection that contains the keys of this dictionary. + A collection that contains the keys of the object that implements . + + + Gets or sets the model that is associated with the view data. + The model that is associated with the view data. + + + Gets or sets information about the model. + Information about the model. + + + Gets the state of the model. + The state of the model. + + + Removes the first occurrence of a specified object from the collection. + true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the collection. + The object to remove from the collection. + The collection is read-only. + + + Removes the element from the collection using the specified key. + true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original collection. + The key of the element to remove. + The collection is read-only. + + is null. + + + Sets the data model to use for the view. + The data model to use for the view. + + + Returns an enumerator that can be used to iterate through the collection. + An enumerator that can be used to iterate through the collection. + + + Gets or sets an object that encapsulates information about the current template context. + An object that contains information about the current template. + + + Attempts to retrieve the value that is associated with the specified key. + true if the collection contains an element with the specified key; otherwise, false. + The key of the value to get. + When this method returns, the value that is 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. + + is null. + + + Gets a collection that contains the values in this dictionary. + A collection that contains the values of the object that implements . + + + Represents a container that is used to pass strongly typed data between a controller and a view. + The type of the model. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified view data dictionary. + An existing view data dictionary to copy into this instance. + + + Initializes a new instance of the class by using the specified model. + The data model to use for the view. + + + Gets or sets the model. + A reference to the data model. + + + Gets or sets information about the model. + Information about the model. + + + Sets the data model to use for the view. + The data model to use for the view. + An error occurred while the model was being set. + + + Encapsulates information about the current template content that is used to develop templates and about HTML helpers that interact with templates. + + + Initializes a new instance of the class. + + + Initializes a new instance of the T:System.Web.Mvc.ViewDataInfo class and associates a delegate for accessing the view data information. + A delegate that defines how the view data information is accessed. + + + Gets or sets the object that contains the values to be displayed by the template. + The object that contains the values to be displayed by the template. + + + Gets or sets the description of the property to be displayed by the template. + The description of the property to be displayed by the template. + + + Gets or sets the current value to be displayed by the template. + The current value to be displayed by the template. + + + Represents a collection of view engines that are available to the application. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class by using the specified list of view engines. + The list that is wrapped by the new collection. + + is null. + + + Finds the specified partial view by using the specified controller context. + The partial view. + The controller context. + The name of the partial view. + The parameter is null. + The parameter is null or empty. + + + Finds the specified view by using the specified controller context and master view. + The view. + The controller context. + The name of the view. + The name of the master view. + The parameter is null. + The parameter is null or empty. + + + Inserts an element into the collection at the specified index. + The zero-based index at which should be inserted. + The object to insert. + + is less than zero.-or- is greater than the number of items in the collection. + The parameter is null. + + + 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. + + is less than zero.-or- is greater than the number of items in the collection. + The parameter is null. + + + Represents the result of locating a view engine. + + + Initializes a new instance of the class by using the specified searched locations. + The searched locations. + The parameter is null. + + + Initializes a new instance of the class by using the specified view and view engine. + The view. + The view engine. + The or parameter is null. + + + Gets or sets the searched locations. + The searched locations. + + + Gets or sets the view. + The view. + + + Gets or sets the view engine. + The view engine. + + + Represents a collection of view engines that are available to the application. + + + Gets the view engines. + The view engines. + + + Represents the information that is needed to build a master view page. + + + Initializes a new instance of the class. + + + Gets the AJAX script for the master page. + The AJAX script for the master page. + + + Gets the HTML for the master page. + The HTML for the master page. + + + Gets the model. + The model. + + + Gets the temporary data. + The temporary data. + + + Gets the URL. + The URL. + + + Gets the dynamic view-bag dictionary. + The dynamic view-bag dictionary. + + + Gets the view context. + The view context. + + + Gets the view data. + The view data. + + + Gets the writer that is used to render the master page. + The writer that is used to render the master page. + + + Represents the information that is required in order to build a strongly typed master view page. + The type of the model. + + + Initializes a new instance of the class. + + + Gets the AJAX script for the master page. + The AJAX script for the master page. + + + Gets the HTML for the master page. + The HTML for the master page. + + + Gets the model. + A reference to the data model. + + + Gets the view data. + The view data. + + + Represents the properties and methods that are needed to render a view as a Web Forms page. + + + Initializes a new instance of the class. + + + Gets or sets the object that is used to render HTML in Ajax scenarios. + The Ajax helper object that is associated with the view. + + + Gets or sets the object that is used to render HTML elements. + The HTML helper object that is associated with the view. + + + Initializes the , , and properties. + + + Gets or sets the path of the master view. + The path of the master view. + + + Gets the Model property of the associated object. + The Model property of the associated object. + + + Raises the event at the beginning of page initialization. + The event data. + + + Enables processing of the specified HTTP request by the ASP.NET MVC framework. + An object that encapsulates HTTP-specific information about the current HTTP request. + + + Initializes the object that receives the page content to be rendered. + The object that receives the page content. + + + Renders the view page to the response using the specified view context. + An object that encapsulates the information that is required in order to render the view, which includes the controller context, form context, the temporary data, and the view data for the associated view. + + + Sets the text writer that is used to render the view to the response. + The writer that is used to render the view to the response. + + + Sets the view data dictionary for the associated view. + A dictionary of data to pass to the view. + + + Gets the temporary data to pass to the view. + The temporary data to pass to the view. + + + Gets or sets the URL of the rendered page. + The URL of the rendered page. + + + Gets the view bag. + The view bag. + + + Gets or sets the information that is used to render the view. + The information that is used to render the view, which includes the form context, the temporary data, and the view data of the associated view. + + + Gets or sets a dictionary that contains data to pass between the controller and the view. + A dictionary that contains data to pass between the controller and the view. + + + Gets the text writer that is used to render the view to the response. + The text writer that is used to render the view to the response. + + + Represents the information that is required in order to render a strongly typed view as a Web Forms page. + The type of the model. + + + Initializes a new instance of the class. + + + Gets or sets the object that supports rendering HTML in Ajax scenarios. + The Ajax helper object that is associated with the view. + + + Gets or sets the object that provides support for rendering elements. + The HTML helper object that is associated with the view. + + + Instantiates and initializes the and properties. + + + Gets the property of the associated object. + A reference to the data model. + + + Sets the view data dictionary for the associated view. + A dictionary of data to pass to the view. + + + Gets or sets a dictionary that contains data to pass between the controller and the view. + A dictionary that contains data to pass between the controller and the view. + + + Represents a class that is used to render a view by using an instance that is returned by an object. + + + Initializes a new instance of the class. + + + Searches the registered view engines and returns the object that is used to render the view. + The object that is used to render the view. + The controller context. + An error occurred while the method was searching for the view. + + + Gets the name of the master view (such as a master page or template) to use when the view is rendered. + The name of the master view. + + + Represents a base class that is used to provide the model to the view and then render the view to the response. + + + Initializes a new instance of the class. + + + When called by the action invoker, renders the view to the response. + The context that the result is executed in. + The parameter is null. + + + Returns the object that is used to render the view. + The view engine. + The context. + + + Gets the view data model. + The view data model. + + + Gets or sets the object for this result. + The temporary data. + + + Gets or sets the object that is rendered to the response. + The view. + + + Gets the view bag. + The view bag. + + + Gets or sets the view data object for this result. + The view data. + + + Gets or sets the collection of view engines that are associated with this result. + The collection of view engines. + + + Gets or sets the name of the view to render. + The name of the view. + + + Provides an abstract class that can be used to implement a view start (master) page. + + + When implemented in a derived class, initializes a new instance of the class. + + + When implemented in a derived class, gets the HTML markup for the view start page. + The HTML markup for the view start page. + + + When implemented in a derived class, gets the URL for the view start page. + The URL for the view start page. + + + When implemented in a derived class, gets the view context for the view start page. + The view context for the view start page. + + + Provides a container for objects. + + + Initializes a new instance of the class. + + + Provides a container for objects. + The type of the model. + + + Initializes a new instance of the class. + + + Gets the formatted value. + The formatted value. + + + Represents the type of a view. + + + Initializes a new instance of the class. + + + Gets or sets the name of the type. + The name of the type. + + + Represents the information that is needed to build a user control. + + + Initializes a new instance of the class. + + + Gets the AJAX script for the view. + The AJAX script for the view. + + + Ensures that view data is added to the object of the user control if the view data exists. + + + Gets the HTML for the view. + The HTML for the view. + + + Gets the model. + The model. + + + Renders the view by using the specified view context. + The view context. + + + Sets the text writer that is used to render the view to the response. + The writer that is used to render the view to the response. + + + Sets the view-data dictionary by using the specified view data. + The view data. + + + Gets the temporary-data dictionary. + The temporary-data dictionary. + + + Gets the URL for the view. + The URL for the view. + + + Gets the view bag. + The view bag. + + + Gets or sets the view context. + The view context. + + + Gets or sets the view-data dictionary. + The view-data dictionary. + + + Gets or sets the view-data key. + The view-data key. + + + Gets the writer that is used to render the view to the response. + The writer that is used to render the view to the response. + + + Represents the information that is required in order to build a strongly typed user control. + The type of the model. + + + Initializes a new instance of the class. + + + Gets the AJAX script for the view. + The AJAX script for the view. + + + Gets the HTML for the view. + The HTML for the view. + + + Gets the model. + A reference to the data model. + + + Sets the view data for the view. + The view data. + + + Gets or sets the view data. + The view data. + + + Represents an abstract base-class implementation of the interface. + + + Initializes a new instance of the class. + + + Gets or sets the area-enabled master location formats. + The area-enabled master location formats. + + + Gets or sets the area-enabled partial-view location formats. + The area-enabled partial-view location formats. + + + Gets or sets the area-enabled view location formats. + The area-enabled view location formats. + + + Creates the specified partial view by using the specified controller context. + A reference to the partial view. + The controller context. + The partial path for the new partial view. + + + Creates the specified view by using the controller context, path of the view, and path of the master view. + A reference to the view. + The controller context. + The path of the view. + The path of the master view. + + + Returns a value that indicates whether the file is in the specified path by using the specified controller context. + true if the file is in the specified path; otherwise, false. + The controller context. + The virtual path. + + + Gets or sets the file-name extensions that are used to locate a view. + The file-name extensions that are used to locate a view. + + + Finds the specified partial view by using the specified controller context. + The partial view. + The controller context. + The name of the partial view. + true to use the cached partial view. + The parameter is null (Nothing in Visual Basic). + The parameter is null or empty. + + + Finds the specified view by using the specified controller context and master view name. + The page view. + The controller context. + The name of the view. + The name of the master view. + true to use the cached view. + The parameter is null (Nothing in Visual Basic). + The parameter is null or empty. + + + Gets or sets the master location formats. + The master location formats. + + + Gets or sets the partial-view location formats. + The partial-view location formats. + + + Releases the specified view by using the specified controller context. + The controller context. + The view to release. + + + Gets or sets the view location cache. + The view location cache. + + + Gets or sets the view location formats. + The view location formats. + + + Gets or sets the virtual path provider. + The virtual path provider. + + + Represents the information that is needed to build a Web Forms page in ASP.NET MVC. + + + Initializes a new instance of the class using the controller context and view path. + The controller context. + The view path. + + + Initializes a new instance of the class using the controller context, view path, and the path to the master page. + The controller context. + The view path. + The path to the master page. + + + Initializes a new instance of the class using the controller context, view path, the path to the master page, and a instance. + The controller context. + The view path. + The path to the master page. + An instance of the view page activator interface. + + + Gets or sets the master path. + The master path. + + + Renders the view to the response. + An object that encapsulates the information that is required in order to render the view, which includes the controller context, form context, the temporary data, and the view data for the associated view. + The text writer object that is used to write HTML output. + The view page instance. + + + Represents a view engine that is used to render a Web Forms page to the response. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the specified view page activator. + An instance of a class that implements the interface. + + + Creates the specified partial view by using the specified controller context. + The partial view. + The controller context. + The partial path. + + + Creates the specified view by using the specified controller context and the paths of the view and master view. + The view. + The controller context. + The view path. + The master-view path. + + + Represents the properties and methods that are needed in order to render a view that uses ASP.NET Razor syntax. + + + Initializes a new instance of the class. + + + Gets or sets the object that is used to render HTML using Ajax. + The object that is used to render HTML using Ajax. + + + Sets the view context and view data for the page. + The parent page. + + + Gets the object that is associated with the page. + The object that is associated with the page. + + + Runs the page hierarchy for the ASP.NET Razor execution pipeline. + + + Gets or sets the object that is used to render HTML elements. + The object that is used to render HTML elements. + + + Initializes the , , and classes. + + + Gets the Model property of the associated object. + The Model property of the associated object. + + + Sets the view data. + The view data. + + + Gets the temporary data to pass to the view. + The temporary data to pass to the view. + + + Gets or sets the URL of the rendered page. + The URL of the rendered page. + + + Gets the view bag. + The view bag. + + + Gets or sets the information that is used to render the view. + The information that is used to render the view, which includes the form context, the temporary data, and the view data of the associated view. + + + Gets or sets a dictionary that contains data to pass between the controller and the view. + A dictionary that contains data to pass between the controller and the view. + + + Represents the properties and methods that are needed in order to render a view that uses ASP.NET Razor syntax. + The type of the view data model. + + + Initializes a new instance of the class. + + + Gets or sets the object that is used to render HTML markup using Ajax. + The object that is used to render HTML markup using Ajax. + + + Gets or sets the object that is used to render HTML elements. + The object that is used to render HTML elements. + + + Initializes the , , and classes. + + + Gets the Model property of the associated object. + The Model property of the associated object. + + + Sets the view data. + The view data. + + + Gets or sets a dictionary that contains data to pass between the controller and the view. + A dictionary that contains data to pass between the controller and the view. + + + Represents support for ASP.NET AJAX within an ASP.NET MVC application. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + The name of the controller. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + The URL fragment name (the anchor name). + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + The name of the controller. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + The URL fragment name (the anchor name). + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + The name of the controller. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the action method. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + The name of the controller. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + The name of the controller. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + The name of the controller. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + The name of the action method that will handle the request. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element.. + + + Writes an opening <form> tag to the response. + An opening <form> tag. + The AJAX helper. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response using the specified routing information. + An opening <form> tag. + The AJAX helper. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response using the specified routing information. + An opening <form> tag. + The AJAX helper. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response using the specified routing information. + An opening <form> tag. + The AJAX helper. + The name of the route to use to obtain the form post URL. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response using the specified routing information. + An opening <form> tag. + The AJAX helper. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + + + Writes an opening <form> tag to the response using the specified routing information. + An opening <form> tag. + The AJAX helper. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + + + Returns an HTML script element that contains a reference to a globalization script that defines the culture information. + A script element whose src attribute is set to the globalization script, as in the following example: <script type="text/javascript" src="/MvcApplication1/Scripts/Globalization/en-US.js"></script> + The AJAX helper object that this method extends. + + + Returns an HTML script element that contains a reference to a globalization script that defines the specified culture information. + An HTML script element whose src attribute is set to the globalization script, as in the following example:<script type="text/javascript" src="/MvcApplication1/Scripts/Globalization/en-US.js"></script> + The AJAX helper object that this method extends. + Encapsulates information about the target culture, such as date formats. + The parameter is null. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + The URL fragment name (the anchor name). + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + The name of the route to use to obtain the form post URL. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + The parameter is null or empty. + + + Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. + An anchor element. + The AJAX helper. + The inner text of the anchor element. + An object that contains the parameters for a route. + An object that provides options for the asynchronous request. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Represents option settings for running Ajax scripts in an ASP.NET MVC application. + + + Initializes a new instance of the class. + + + Gets or sets the message to display in a confirmation window before a request is submitted. + The message to display in a confirmation window. + + + Gets or sets the HTTP request method ("Get" or "Post"). + The HTTP request method. The default value is "Post". + + + Gets or sets the mode that specifies how to insert the response into the target DOM element. + The insertion mode ("InsertAfter", "InsertBefore", or "Replace"). The default value is "Replace". + + + Gets or sets a value, in milliseconds, that controls the duration of the animation when showing or hiding the loading element. + A value, in milliseconds, that controls the duration of the animation when showing or hiding the loading element. + + + Gets or sets the id attribute of an HTML element that is displayed while the Ajax function is loading. + The ID of the element that is displayed while the Ajax function is loading. + + + Gets or sets the name of the JavaScript function to call immediately before the page is updated. + The name of the JavaScript function to call before the page is updated. + + + Gets or sets the JavaScript function to call when response data has been instantiated but before the page is updated. + The JavaScript function to call when the response data has been instantiated. + + + Gets or sets the JavaScript function to call if the page update fails. + The JavaScript function to call if the page update fails. + + + Gets or sets the JavaScript function to call after the page is successfully updated. + The JavaScript function to call after the page is successfully updated. + + + Returns the Ajax options as a collection of HTML attributes to support unobtrusive JavaScript. + The Ajax options as a collection of HTML attributes to support unobtrusive JavaScript. + + + Gets or sets the ID of the DOM element to update by using the response from the server. + The ID of the DOM element to update. + + + Gets or sets the URL to make the request to. + The URL to make the request to. + + + Enumerates the AJAX script insertion modes. + + + Replace the element. + + + Insert before the element. + + + Insert after the element. + + + Provides information about an asynchronous action method, such as its name, controller, parameters, attributes, and filters. + + + Initializes a new instance of the class. + + + Invokes the asynchronous action method by using the specified parameters and controller context. + An object that contains the result of an asynchronous call. + The controller context. + The parameters of the action method. + The callback method. + An object that contains information to be used by the callback method. This parameter can be null. + + + Returns the result of an asynchronous operation. + The result of an asynchronous operation. + An object that represents the status of an asynchronous operation. + + + Executes the asynchronous action method by using the specified parameters and controller context. + The result of executing the asynchronous action method. + The controller context. + The parameters of the action method. + + + Represents a class that is responsible for invoking the action methods of an asynchronous controller. + + + Initializes a new instance of the class. + + + Invokes the asynchronous action method by using the specified controller context, action name, callback method, and state. + An object that contains the result of an asynchronous operation. + The controller context. + The name of the action. + The callback method. + An object that contains information to be used by the callback method. This parameter can be null. + + + Invokes the asynchronous action method by using the specified controller context, action descriptor, parameters, callback method, and state. + An object that contains the result of an asynchronous operation. + The controller context. + The action descriptor. + The parameters for the asynchronous action method. + The callback method. + An object that contains information to be used by the callback method. This parameter can be null. + + + Invokes the asynchronous action method by using the specified controller context, filters, action descriptor, parameters, callback method, and state. + An object that contains the result of an asynchronous operation. + The controller context. + The filters. + The action descriptor. + The parameters for the asynchronous action method. + The callback method. + An object that contains information to be used by the callback method. This parameter can be null. + + + Cancels the action. + true if the action was canceled; otherwise, false. + The user-defined object that qualifies or contains information about an asynchronous operation. + + + Cancels the action. + true if the action was canceled; otherwise, false. + The user-defined object that qualifies or contains information about an asynchronous operation. + + + Cancels the action. + true if the action was canceled; otherwise, false. + The user-defined object that qualifies or contains information about an asynchronous operation. + + + Returns the controller descriptor. + The controller descriptor. + The controller context. + + + Provides asynchronous operations for the class. + + + Initializes a new instance of the class. + + + Initializes a new instance of the class using the synchronization context. + The synchronization context. + + + Notifies ASP.NET that all asynchronous operations are complete. + + + Occurs when the method is called. + + + Gets the number of outstanding operations. + The number of outstanding operations. + + + Gets the parameters that were passed to the asynchronous completion method. + The parameters that were passed to the asynchronous completion method. + + + Executes a callback in the current synchronization context. + The asynchronous action. + + + Gets or sets the asynchronous timeout value, in milliseconds. + The asynchronous timeout value, in milliseconds. + + + Defines the interface for an action invoker, which is used to invoke an asynchronous action in response to an HTTP request. + + + Invokes the specified action. + The status of the asynchronous result. + The controller context. + The name of the asynchronous action. + The callback method. + The state. + + + Cancels the asynchronous action. + true if the asynchronous method could be canceled; otherwise, false. + The asynchronous result. + + + Defines the methods that are required for an asynchronous controller. + + + Executes the specified request context. + The status of the asynchronous operation. + The request context. + The asynchronous callback method. + The state. + + + Ends the asynchronous operation. + The asynchronous result. + + + Provides a container for the asynchronous manager object. + + + Gets the asynchronous manager object. + The asynchronous manager object. + + + Provides a container that maintains a count of pending asynchronous operations. + + + Initializes a new instance of the class. + + + Occurs when an asynchronous method completes. + + + Gets the operation count. + The operation count. + + + Reduces the operation count by 1. + The updated operation count. + + + Reduces the operation count by the specified value. + The updated operation count. + The number of operations to reduce the count by. + + + Increments the operation count by one. + The updated operation count. + + + Increments the operation count by the specified value. + The updated operation count. + The number of operations to increment the count by. + + + Provides information about an asynchronous action method, such as its name, controller, parameters, attributes, and filters. + + + Initializes a new instance of the class. + An object that contains information about the method that begins the asynchronous operation (the method whose name ends with "Asynch"). + An object that contains information about the completion method (method whose name ends with "Completed"). + The name of the action. + The controller descriptor. + + + Gets the name of the action method. + The name of the action method. + + + Gets the method information for the asynchronous action method. + The method information for the asynchronous action method. + + + Begins running the asynchronous action method by using the specified parameters and controller context. + An object that contains the result of an asynchronous call. + The controller context. + The parameters of the action method. + The callback method. + An object that contains information to be used by the callback method. This parameter can be null. + + + Gets the method information for the asynchronous completion method. + The method information for the asynchronous completion method. + + + Gets the controller descriptor for the asynchronous action method. + The controller descriptor for the asynchronous action method. + + + Returns the result of an asynchronous operation. + The result of an asynchronous operation. + An object that represents the status of an asynchronous operation. + + + Returns an array of custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Returns an array of custom attributes that are defined for this member, identified by type. + An array of custom attributes, or an empty array if no custom attributes of the specified type exist. + The type of the custom attributes to return. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Returns the parameters of the action method. + The parameters of the action method. + + + Returns the action-method selectors. + The action-method selectors. + + + Determines whether one or more instances of the specified attribute type are defined for the action member. + true if an attribute of type that is represented by is defined for this member; otherwise, false. + The type of the custom attribute. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Gets the lazy initialized unique ID of the instance of this class. + The lazy initialized unique ID of the instance of this class. + + + Encapsulates information that describes an asynchronous controller, such as its name, type, and actions. + + + Initializes a new instance of the class. + The type of the controller. + + + Gets the type of the controller. + The type of the controller. + + + Finds an action method by using the specified name and controller context. + The information about the action method. + The controller context. + The name of the action. + + + Returns a list of action method descriptors in the controller. + A list of action method descriptors in the controller. + + + Returns custom attributes that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Returns custom attributes of a specified type that are defined for this member, excluding named attributes. + An array of custom attributes, or an empty array if no custom attributes exist. + The type of the custom attributes. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Returns a value that indicates whether one or more instances of the specified custom attribute are defined for this member. + true if an attribute of the type represented by is defined for this member; otherwise, false. + The type of the custom attribute. + true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. + + + Represents an exception that occurred during the synchronous processing of an HTTP request in an ASP.NET MVC application. + + + Initializes a new instance of the class using a system-supplied message. + + + Initializes a new instance of the class using the specified message. + The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. + + + Initializes a new instance of the class using a specified error message and a reference to the inner exception that is the cause of this exception. + The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. + The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception. + + + Represents support for calling child action methods and rendering the result inline in a parent view. + + + Invokes the specified child action method and returns the result as an HTML string. + The child action result as an HTML string. + The HTML helper instance that this method extends. + The name of the action method to invoke. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method with the specified parameters and returns the result as an HTML string. + The child action result as an HTML string. + The HTML helper instance that this method extends. + The name of the action method to invoke. + An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified controller name and returns the result as an HTML string. + The child action result as an HTML string. + The HTML helper instance that this method extends. + The name of the action method to invoke. + The name of the controller that contains the action method. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string. + The child action result as an HTML string. + The HTML helper instance that this method extends. + The name of the action method to invoke. + The name of the controller that contains the action method. + An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string. + The child action result as an HTML string. + The HTML helper instance that this method extends. + The name of the action method to invoke. + The name of the controller that contains the action method. + A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified parameters and returns the result as an HTML string. + The child action result as an HTML string. + The HTML helper instance that this method extends. + The name of the action method to invoke. + A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method and renders the result inline in the parent view. + The HTML helper instance that this method extends. + The name of the child action method to invoke. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified parameters and renders the result inline in the parent view. + The HTML helper instance that this method extends. + The name of the child action method to invoke. + An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified controller name and renders the result inline in the parent view. + The HTML helper instance that this method extends. + The name of the child action method to invoke. + The name of the controller that contains the action method. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view. + The HTML helper instance that this method extends. + The name of the child action method to invoke. + The name of the controller that contains the action method. + An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view. + The HTML helper instance that this method extends. + The name of the child action method to invoke. + The name of the controller that contains the action method. + A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Invokes the specified child action method using the specified parameters and renders the result inline in the parent view. + The HTML helper instance that this method extends. + The name of the child action method to invoke. + A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. + The parameter is null. + The parameter is null or empty. + The required virtual path data cannot be found. + + + Represents support for rendering object values as HTML. + + + Returns HTML markup for each property in the object that is represented by a string expression. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + + + Returns HTML markup for each property in the object that is represented by a string expression, using additional view data. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns HTML markup for each property in the object that is represented by the expression, using the specified template. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + + + Returns HTML markup for each property in the object that is represented by the expression, using the specified template and additional view data. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns HTML markup for each property in the object that is represented by the expression, using the specified template and an HTML field ID. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + + + Returns HTML markup for each property in the object that is represented by the expression, using the specified template, HTML field ID, and additional view data. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns HTML markup for each property in the object that is represented by the expression. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The type of the model. + The type of the value. + + + Returns a string that contains each property value in the object that is represented by the specified expression, using additional view data. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + The type of the model. + The type of the value. + + + Returns a string that contains each property value in the object that is represented by the , using the specified template. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + The type of the model. + The type of the value. + + + Returns a string that contains each property value in the object that is represented by the specified expression, using the specified template and additional view data. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + The type of the model. + The type of the value. + + + Returns HTML markup for each property in the object that is represented by the , using the specified template and an HTML field ID. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + The type of the model. + The type of the value. + + + Returns HTML markup for each property in the object that is represented by the specified expression, using the template, an HTML field ID, and additional view data. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template that is used to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + The type of the model. + The type of the value. + + + Returns HTML markup for each property in the model. + The HTML markup for each property in the model. + The HTML helper instance that this method extends. + + + Returns HTML markup for each property in the model, using additional view data. + The HTML markup for each property in the model. + The HTML helper instance that this method extends. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns HTML markup for each property in the model using the specified template. + The HTML markup for each property in the model. + The HTML helper instance that this method extends. + The name of the template that is used to render the object. + + + Returns HTML markup for each property in the model, using the specified template and additional view data. + The HTML markup for each property in the model. + The HTML helper instance that this method extends. + The name of the template that is used to render the object. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns HTML markup for each property in the model using the specified template and HTML field ID. + The HTML markup for each property in the model. + The HTML helper instance that this method extends. + The name of the template that is used to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + + + Returns HTML markup for each property in the model, using the specified template, an HTML field ID, and additional view data. + The HTML markup for each property in the model. + The HTML helper instance that this method extends. + The name of the template that is used to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Provides a way to render object values as HTML. + + + Returns HTML markup for each property in the object that is represented by the specified expression. + The HTML markup for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + + + Returns HTML markup for each property in the object that is represented by the specified expression. + The HTML markup for each property.zz 12/29/2010 1:25:49 PM + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The type of the model. + The type of the result. + + + Represents support for the HTML input element in an application. + + + Returns an HTML input element for each property in the object that is represented by the expression. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + + + Returns an HTML input element for each property in the object that is represented by the expression, using additional view data. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and additional view data. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and HTML field name. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template, HTML field name, and additional view data. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns an HTML input element for each property in the object that is represented by the expression. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The type of the model. + The type of the value. + + + Returns an HTML input element for each property in the object that is represented by the expression, using additional view data. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + The type of the model. + The type of the value. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + The type of the model. + The type of the value. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and additional view data. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + The type of the model. + The type of the value. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and HTML field name. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + The type of the model. + The type of the value. + + + Returns an HTML input element for each property in the object that is represented by the expression, using the specified template, HTML field name, and additional view data. + An HTML input element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + The name of the template to use to render the object. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + The type of the model. + The type of the value. + + + Returns an HTML input element for each property in the model. + An HTML input element for each property in the model. + The HTML helper instance that this method extends. + + + Returns an HTML input element for each property in the model, using additional view data. + An HTML input element for each property in the model. + The HTML helper instance that this method extends. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns an HTML input element for each property in the model, using the specified template. + An HTML input element for each property in the model and in the specified template. + The HTML helper instance that this method extends. + The name of the template to use to render the object. + + + Returns an HTML input element for each property in the model, using the specified template and additional view data. + An HTML input element for each property in the model. + The HTML helper instance that this method extends. + The name of the template to use to render the object. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Returns an HTML input element for each property in the model, using the specified template name and HTML field name. + An HTML input element for each property in the model and in the named template. + The HTML helper instance that this method extends. + The name of the template to use to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + + + Returns an HTML input element for each property in the model, using the template name, HTML field name, and additional view data. + An HTML input element for each property in the model. + The HTML helper instance that this method extends. + The name of the template to use to render the object. + A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. + An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. + + + Represents support for HTML in an application. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. + An opening <form> tag. + The HTML helper instance that this method extends. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. + An opening <form> tag. + The HTML helper instance that this method extends. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + The HTTP method for processing the form, either GET or POST. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + The HTTP method for processing the form, either GET or POST. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + The HTTP method for processing the form, either GET or POST. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the action method. + The name of the controller. + An object that contains the parameters for a route. + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. + An opening <form> tag. + The HTML helper instance that this method extends. + An object that contains the parameters for a route. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + The HTTP method for processing the form, either GET or POST. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + The HTTP method for processing the form, either GET or POST. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + An object that contains the parameters for a route + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + An object that contains the parameters for a route + The HTTP method for processing the form, either GET or POST. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + The name of the route to use to obtain the form-post URL. + An object that contains the parameters for a route + The HTTP method for processing the form, either GET or POST. + An object that contains the HTML attributes to set for the element. + + + Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. + An opening <form> tag. + The HTML helper instance that this method extends. + An object that contains the parameters for a route + + + Renders the closing </form> tag to the response. + The HTML helper instance that this method extends. + + + Represents support for HTML input controls in an application.12/23/2010 12:04:24 PM zz + + + Returns a check box input element by using the specified HTML helper and the name of the form field. + An input element whose type attribute is set to "checkbox". + The HTML helper instance that this method extends. + The name of the form field. + + + Returns a check box input element by using the specified HTML helper, the name of the form field, and a value to indicate whether the check box is selected. + An input element whose type attribute is set to "checkbox". + The HTML helper instance that this method extends. + The name of the form field. + true to select the check box; otherwise, false. + + + Returns a check box input element by using the specified HTML helper, the name of the form field, a value to indicate whether the check box is selected, and the HTML attributes. + An input element whose type attribute is set to "checkbox". + The HTML helper instance that this method extends. + The name of the form field. + true to select the check box; otherwise, false. + An object that contains the HTML attributes to set for the element. + + + Returns a check box input element by using the specified HTML helper, the name of the form field, a value that indicates whether the check box is selected, and the HTML attributes. + An input element whose type attribute is set to "checkbox". + The HTML helper instance that this method extends. + The name of the form field. + true to select the check box; otherwise, false. + An object that contains the HTML attributes to set for the element. + + + Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes. + An input element whose type attribute is set to "checkbox". + The HTML helper instance that this method extends. + The name of the form field. + An object that contains the HTML attributes to set for the element. + + + Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes. + An input element whose type attribute is set to "checkbox". + The HTML helper instance that this method extends. + The name of the form field. + An object that contains the HTML attributes to set for the element. + + + Returns a check box input element for each property in the object that is represented by the specified expression. + An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The type of the model. + The parameter is null. + + + Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The parameter is null. + + + Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + An object that contains the HTML attributes to set for the element. + The type of the model. + The parameter is null. + + + Returns a hidden input element by using the specified HTML helper and the name of the form field. + An input element whose type attribute is set to "hidden". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + + + Returns a hidden input element by using the specified HTML helper, the name of the form field, and the value. + An input element whose type attribute is set to "hidden". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the hidden input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. + + + Returns a hidden input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. + An input element whose type attribute is set to "hidden". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the hidden input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. + An object that contains the HTML attributes to set for the element. + + + Returns a hidden input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. + An input element whose type attribute is set to "hidden". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the hidden input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. + An object that contains the HTML attributes to set for the element. + + + Returns an HTML hidden input element for each property in the object that is represented by the specified expression. + An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The type of the model. + The type of the property. + + + Returns an HTML hidden input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the property. + + + Returns an HTML hidden input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the property. + + + Returns a password input element by using the specified HTML helper and the name of the form field. + An input element whose type attribute is set to "password". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + + + Returns a password input element by using the specified HTML helper, the name of the form field, and the value. + An input element whose type attribute is set to "password". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the password input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. + + + Returns a password input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. + An input element whose type attribute is set to "password". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the password input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. + An object that contains the HTML attributes to set for the element. + + + Returns a password input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. + An input element whose type attribute is set to "password". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the password input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. + An object that contains the HTML attributes to set for the element. + + + Returns a password input element for each property in the object that is represented by the specified expression. + An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The type of the model. + The type of the value. + The parameter is null. + + + Returns a password input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression, using the specified HTML attributes. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null. + + + Returns a password input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression, using the specified HTML attributes. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null. + + + Returns a radio button input element that is used to present mutually exclusive options. + An input element whose type attribute is set to "radio". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. + The parameter is null or empty. + The parameter is null. + + + Returns a radio button input element that is used to present mutually exclusive options. + An input element whose type attribute is set to "radio". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. + true to select the radio button; otherwise, false. + The parameter is null or empty. + The parameter is null. + + + Returns a radio button input element that is used to present mutually exclusive options. + An input element whose type attribute is set to "radio". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. + true to select the radio button; otherwise, false. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + The parameter is null. + + + Returns a radio button input element that is used to present mutually exclusive options. + An input element whose type attribute is set to "radio". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. + true to select the radio button; otherwise, false. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + The parameter is null. + + + Returns a radio button input element that is used to present mutually exclusive options. + An input element whose type attribute is set to "radio". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + The parameter is null. + + + Returns a radio button input element that is used to present mutually exclusive options. + An input element whose type attribute is set to "radio". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + The parameter is null. + + + Returns a radio button input element for each property in the object that is represented by the specified expression. + An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. + The type of the model. + The type of the value. + The parameter is null. + + + Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression, using the specified HTML attributes. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null. + + + Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression, using the specified HTML attributes. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null. + + + Returns a text input element by using the specified HTML helper and the name of the form field. + An input element whose type attribute is set to "text". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + + + Returns a text input element by using the specified HTML helper, the name of the form field, and the value. + An input element whose type attribute is set to "text". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the text input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. + + + Returns a text input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. + An input element whose type attribute is set to "text". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the text input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. + An object that contains the HTML attributes to set for the element. + + + Returns a text input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. + An input element whose type attribute is set to "text". + The HTML helper instance that this method extends. + The name of the form field and the key that is used to look up the value. + The value of the text input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. + An object that contains the HTML attributes to set for the element. + + + Returns a text input element for each property in the object that is represented by the specified expression. + An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The type of the model. + The type of the value. + The parameter is null or empty. + + + Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element type attribute is set to "text" for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null or empty. + + + Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. + An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + An object that contains the HTML attributes to set for the element. + The type of the model. + The type of the value. + The parameter is null or empty. + + + Represents support for the HTML label element in an ASP.NET MVC view. + + + Returns an HTML label element and the property name of the property that is represented by the specified expression. + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + + + Returns . + + + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + The type of the model. + The type of the value. + + + An HTML label element and the property name of the property that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the property to display. + The label text. + The type of the model. + The type of the value. + + + Returns an HTML label element and the property name of the property that is represented by the model. + An HTML label element and the property name of the property that is represented by the model. + The HTML helper instance that this method extends. + + + Returns . + + + Represents support for HTML links in an application. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + An object that contains the HTML attributes for the element. The attributes are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + The name of the controller. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + The name of the controller. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + The name of the controller. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + The URL fragment name (the anchor name). + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + The name of the controller. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + The URL fragment name (the anchor name). + An object that contains the parameters for a route. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + The name of the controller. + An object that contains the parameters for a route. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + An object that contains the parameters for a route. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the action. + An object that contains the parameters for a route. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the route that is used to return a virtual path. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the route that is used to return a virtual path. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the route that is used to return a virtual path. + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the route that is used to return a virtual path. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + The URL fragment name (the anchor name). + An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the route that is used to return a virtual path. + The protocol for the URL, such as "http" or "https". + The host name for the URL. + The URL fragment name (the anchor name). + An object that contains the parameters for a route. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the route that is used to return a virtual path. + An object that contains the parameters for a route. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + The name of the route that is used to return a virtual path. + An object that contains the parameters for a route. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + An object that contains the parameters for a route. + The parameter is null or empty. + + + Returns an anchor element (a element) that contains the virtual path of the specified action. + An anchor element (a element). + The HTML helper instance that this method extends. + The inner text of the anchor element. + An object that contains the parameters for a route. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Represents an HTML form element in an MVC view. + + + Initializes a new instance of the class using the specified HTTP response object. + The HTTP response object. + The parameter is null. + + + Initializes a new instance of the class using the specified view context. + An object that encapsulates the information that is required in order to render a view. + The parameter is null. + + + Releases all resources that are used by the current instance of the class. + + + Releases unmanaged and, optionally, managed resources used by the current instance of the class. + true to release both managed and unmanaged resources; false to release only unmanaged resources. + + + Ends the form and disposes of all form resources. + + + Represents the functionality to render a partial view as an HTML-encoded string. + + + Renders the specified partial view as an HTML-encoded string. + The partial view that is rendered as an HTML-encoded string. + The HTML helper instance that this method extends. + The name of the partial view to render. + + + Renders the specified partial view as an HTML-encoded string. + The partial view that is rendered as an HTML-encoded string. + The HTML helper instance that this method extends. + The name of the partial view to render. + The model for the partial view. + + + Renders the specified partial view as an HTML-encoded string. + The partial view that is rendered as an HTML-encoded string. + The HTML helper instance that this method extends. + The name of the partial view. + The model for the partial view. + The view data dictionary for the partial view. + + + Renders the specified partial view as an HTML-encoded string. + The partial view that is rendered as an HTML-encoded string. + The HTML helper instance that this method extends. + The name of the partial view to render. + The view data dictionary for the partial view. + + + Provides support for rendering a partial view. + + + Renders the specified partial view by using the specified HMTL helper. + The HTML helper. + The name of the partial view + + + Renders the specified partial view, passing it a copy of the current object, but with the Model property set to the specified model. + The HTML helper. + The name of the partial view. + The model. + + + Renders the specified partial view, replacing the partial view's ViewData property with the specified object and setting the Model property of the view data to the specified model. + The HTML helper. + The name of the partial view. + The model for the partial view. + The view data for the partial view. + + + Renders the specified partial view, replacing its ViewData property with the specified object. + The HTML helper. + The name of the partial view. + The view data. + + + Represents support for making selections in a list. + + + Returns a single-selection select element using the specified HTML helper and the name of the form field. + An HTML select element. + The HTML helper instance that this method extends. + The name of the form field to return. + The parameter is null or empty. + + + Returns a single-selection select element using the specified HTML helper, the name of the form field, and the specified list items. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + The parameter is null or empty. + + + Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and an option label. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + The text for a default empty item. This parameter can be null. + The parameter is null or empty. + + + Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + The text for a default empty item. This parameter can be null. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + The text for a default empty item. This parameter can be null. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns a single-selection select element using the specified HTML helper, the name of the form field, and an option label. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + The text for a default empty item. This parameter can be null. + The parameter is null or empty. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + The type of the model. + The type of the value. + The parameter is null. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + The type of the model. + The type of the value. + The parameter is null. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + The type of the model. + The type of the value. + The parameter is null. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and option label. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + The type of the model. + The type of the value. + The parameter is null. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items, option label, and HTML attributes. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + The type of the model. + The type of the value. + The parameter is null. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items, option label, and HTML attributes. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + The type of the model. + The type of the value. + The parameter is null. + + + Returns a multi-select select element using the specified HTML helper and the name of the form field. + An HTML select element. + The HTML helper instance that this method extends. + The name of the form field to return. + The parameter is null or empty. + + + Returns a multi-select select element using the specified HTML helper, the name of the form field, and the specified list items. + An HTML select element with an option subelement for each item in the list. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + The parameter is null or empty. + + + Returns a multi-select select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HMTL attributes. + An HTML select element with an option subelement for each item in the list.. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns a multi-select select element using the specified HTML helper, the name of the form field, and the specified list items. + An HTML select element with an option subelement for each item in the list.. + The HTML helper instance that this method extends. + The name of the form field to return. + A collection of objects that are used to populate the drop-down list. + An object that contains the HTML attributes to set for the element. + The parameter is null or empty. + + + Returns an HTML select element for each property in the object that is represented by the specified expression and using the specified list items. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + The type of the model. + The type of the property. + The parameter is null. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + The type of the model. + The type of the property. + The parameter is null. + + + Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. + An HTML select element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to display. + A collection of objects that are used to populate the drop-down list. + The type of the model. + The type of the property. + The parameter is null. + + + Represents support for HTML textarea controls. + + + Returns the specified textarea element by using the specified HTML helper and the name of the form field. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + + + Returns the specified textarea element by using the specified HTML helper, the name of the form field, and the specified HTML attributes. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + An object that contains the HTML attributes to set for the element. + + + Returns the specified textarea element by using the specified HTML helper and HTML attributes. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + An object that contains the HTML attributes to set for the element. + + + Returns the specified textarea element by using the specified HTML helper, the name of the form field, and the text content. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + The text content. + + + Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, and the specified HTML attributes. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + The text content. + An object that contains the HTML attributes to set for the element. + + + Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, the number of rows and columns, and the specified HTML attributes. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + The text content. + The number of rows. + The number of columns. + An object that contains the HTML attributes to set for the element. + + + Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, the number of rows and columns, and the specified HTML attributes. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + The text content. + The number of rows. + The number of columns. + An object that contains the HTML attributes to set for the element. + + + Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, and the specified HTML attributes. + The textarea element. + The HTML helper instance that this method extends. + The name of the form field to return. + The text content. + An object that contains the HTML attributes to set for the element. + + + Returns an HTML textarea element for each property in the object that is represented by the specified expression. + An HTML textarea element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The type of the model. + The type of the property. + The parameter is null. + + + Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes. + An HTML textarea element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The type of the property. + The parameter is null. + + + Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes and the number of rows and columns. + An HTML textarea element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The number of rows. + The number of columns. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The type of the property. + The parameter is null. + + + Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes and the number of rows and columns. + An HTML textarea element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The number of rows. + The number of columns. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The type of the property. + The parameter is null. + + + Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes. + An HTML textarea element for each property in the object that is represented by the expression. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + A dictionary that contains the HTML attributes to set for the element. + The type of the model. + The type of the property. + The parameter is null. + + + Provides support for validating the input from an HTML form. + + + Gets or sets the name of the resource file (class key) that contains localized string values. + The name of the resource file (class key). + + + Retrieves the validation metadata for the specified model and applies each rule to the data field. + The HTML helper instance that this method extends. + The name of the property or model object that is being validated. + The parameter is null. + + + Retrieves the validation metadata for the specified model and applies each rule to the data field. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The type of the model. + The type of the property. + + + Displays a validation message if an error exists for the specified field in the object. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + The name of the property or model object that is being validated. + + + Displays a validation message if an error exists for the specified field in the object. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + The name of the property or model object that is being validated. + An object that contains the HTML attributes for the element. + + + Displays a validation message if an error exists for the specified field in the object. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + The name of the property or model object that is being validated. + An object that contains the HTML attributes for the element. + + + Displays a validation message if an error exists for the specified field in the object. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + The name of the property or model object that is being validated. + The message to display if the specified field contains an error. + + + Displays a validation message if an error exists for the specified field in the object. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + The name of the property or model object that is being validated. + The message to display if the specified field contains an error. + An object that contains the HTML attributes for the element. + + + Displays a validation message if an error exists for the specified field in the object. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + The name of the property or model object that is being validated. + The message to display if the specified field contains an error. + An object that contains the HTML attributes for the element. + + + Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The type of the model. + The type of the property. + + + Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The message to display if the specified field contains an error. + The type of the model. + The type of the property. + + + Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The message to display if the specified field contains an error. + An object that contains the HTML attributes for the element. + The type of the model. + The type of the property. + + + Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes. + If the property or object is valid, an empty string; otherwise, a span element that contains an error message. + The HTML helper instance that this method extends. + An expression that identifies the object that contains the properties to render. + The message to display if the specified field contains an error. + An object that contains the HTML attributes for the element. + The type of the model. + The type of the property. + + + Returns an unordered list (ul element) of validation messages that are in the object. + A string that contains an unordered list (ul element) of validation messages. + The HTML helper instance that this method extends. + + + Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. + A string that contains an unordered list (ul element) of validation messages. + The HTML helper instance that this method extends. + true to have the summary display model-level errors only, or false to have the summary display all errors. + + + Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. + A string that contains an unordered list (ul element) of validation messages. + The HTML helper instance that this method extends. + true to have the summary display model-level errors only, or false to have the summary display all errors. + The message to display with the validation summary. + + + Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. + A string that contains an unordered list (ul element) of validation messages. + The HTML helper instance that this method extends. + true to have the summary display model-level errors only, or false to have the summary display all errors. + The message to display with the validation summary. + A dictionary that contains the HTML attributes for the element. + + + Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. + A string that contains an unordered list (ul element) of validation messages. + The HTML helper instance that this method extends. + true to have the summary display model-level errors only, or false to have the summary display all errors. + The message to display with the validation summary. + An object that contains the HTML attributes for the element. + + + Returns an unordered list (ul element) of validation messages that are in the object. + A string that contains an unordered list (ul element) of validation messages. + The HMTL helper instance that this method extends. + The message to display if the specified field contains an error. + + + Returns an unordered list (ul element) of validation messages that are in the object. + A string that contains an unordered list (ul element) of validation messages. + The HTML helper instance that this method extends. + The message to display if the specified field contains an error. + A dictionary that contains the HTML attributes for the element. + + + Returns an unordered list (ul element) of validation messages in the object. + A string that contains an unordered list (ul element) of validation messages. + The HTML helper instance that this method extends. + The message to display if the specified field contains an error. + An object that contains the HTML attributes for the element. + + + Provides a model-aware class for ASP.NET MVC. + + + Initializes a new instance of the class. + The start of the span. + The content. + The type name of the model. + + + Gets a value that indicates whether the current object is identical to the specified object. + true if the current object is identical to the specified object; otherwise, false. + The model span object. + + + Returns the hash code of the object. + The hash code of the object. + + + Gets the type name of the model. + The type name of the model. + + + Compiles ASP.NET Razor views into classes. + + + Initializes a new instance of the class. + The class name. + The root namespace. + The name of the source file. + The ASP.NET Razor engine host. + + + Returns a value that indicates whether the specified model span is an instance of . + true if the value of the parameter is an instance of ; otherwise, false. + The model span. + + + + + + Compiles ASP.NET Razor views into classes. + + + + + Extends the VBCodeParser class by adding support for the @model keyword. + + + Initializes a new instance of the class. + + + + Configures the ASP.NET Razor parser and code generator for a specified file. + + + Initializes a new instance of the class. + The virtual path of the ASP.NET Razor file. + The physical path of the ASP.NET Razor file. + + + + \ No newline at end of file diff --git a/lib/NHibernate.Drivers.Azure.TableStorage.dll b/lib/NHibernate.Drivers.Azure.TableStorage.dll index 8a3f5bbf740..636cad97c3b 100644 Binary files a/lib/NHibernate.Drivers.Azure.TableStorage.dll and b/lib/NHibernate.Drivers.Azure.TableStorage.dll differ diff --git a/lib/NHibernate.Drivers.Azure.TableStorage.pdb b/lib/NHibernate.Drivers.Azure.TableStorage.pdb index 711d1e22e2e..88902eba4a5 100644 Binary files a/lib/NHibernate.Drivers.Azure.TableStorage.pdb and b/lib/NHibernate.Drivers.Azure.TableStorage.pdb differ diff --git a/lib/Raven.SituationalAwareness.dll b/lib/Raven.SituationalAwareness.dll deleted file mode 100644 index c7f55939873..00000000000 Binary files a/lib/Raven.SituationalAwareness.dll and /dev/null differ diff --git a/lib/Raven.SituationalAwareness.pdb b/lib/Raven.SituationalAwareness.pdb deleted file mode 100644 index ebc38055ffa..00000000000 Binary files a/lib/Raven.SituationalAwareness.pdb and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Client.992/Raven.Abstractions.XML b/lib/RavenDB/RavenDB.Client.992/Raven.Abstractions.XML deleted file mode 100644 index 88d354ff321..00000000000 --- a/lib/RavenDB/RavenDB.Client.992/Raven.Abstractions.XML +++ /dev/null @@ -1,10532 +0,0 @@ - - - - Raven.Abstractions - - - - - A single batch operation for a document EVAL (using a Javascript) - - - - - A single operation inside a batch - - - - - Translate this instance to a Json object. - - - - - Gets the key. - - The key. - - - - Gets the method. - - The method. - - - - Gets the etag. - - The etag. - - - - Gets the transaction information. - - The transaction information. - - - - Gets the metadata. - - The metadata. - - - - Translate this instance to a Json object. - - - - - Gets or sets the ScriptedPatchRequest (using JavaScript) that is used to patch the document - - The Script. - - - - Gets the key. - - The key. - - - - Gets the method. - - The method. - - - - Gets or sets the etag. - - The etag. - - - - Represents a BSON Oid (object id). - - - - - Initializes a new instance of the class. - - The Oid value. - - - - Gets or sets the value of the Oid. - - The value of the Oid. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. - - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. - - - - - Initializes a new instance of the class with the specified . - - - - - Reads the next JSON token from the stream. - - true if the next token was read successfully; false if there are no more tokens to read. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Skips the children of the current token. - - - - - Sets the current token. - - The new token. - - - - Sets the current token and value. - - The new token. - The value. - - - - Sets the state based on current token type. - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Releases unmanaged and - optionally - managed resources - - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - - Changes the to Closed. - - - - - Gets the current reader state. - - The current reader state. - - - - Gets or sets a value indicating whether the underlying stream or - should be closed when the reader is closed. - - - true to close the underlying stream or when - the reader is closed; otherwise false. The default is true. - - - - - Gets the quotation mark character used to enclose the value of a string. - - - - - Get or set how time zones are handling when reading JSON. - - - - - Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Gets the type of the current JSON token. - - - - - Gets the text value of the current JSON token. - - - - - Gets The Common Language Runtime (CLR) type for the current JSON token. - - - - - Gets the depth of the current token in the JSON document. - - The depth of the current token in the JSON document. - - - - Gets the path of the current JSON token. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Specifies the state of the reader. - - - - - The Read method has not been called. - - - - - The end of the file has been reached successfully. - - - - - Reader is at a property. - - - - - Reader is at the start of an object. - - - - - Reader is in an object. - - - - - Reader is at the start of an array. - - - - - Reader is in an array. - - - - - The Close method has been called. - - - - - Reader has just read a value. - - - - - Reader is at the start of a constructor. - - - - - Reader in a constructor. - - - - - An error occurred that prevents the read operation from continuing. - - - - - The end of the file has been reached successfully. - - - - - Initializes a new instance of the class. - - The stream. - - - - Initializes a new instance of the class. - - The reader. - - - - Initializes a new instance of the class. - - The stream. - if set to true the root object will be read as a JSON array. - The used when reading values from BSON. - - - - Initializes a new instance of the class. - - The reader. - if set to true the root object will be read as a JSON array. - The used when reading values from BSON. - - - - Reads the next JSON token from the stream as a . - - - A or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - - A . This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Changes the to Closed. - - - - - Gets or sets a value indicating whether binary data reading should compatible with incorrect Json.NET 3.5 written binary. - - - true if binary data reading will be compatible with incorrect Json.NET 3.5 written binary; otherwise, false. - - - - - Gets or sets a value indicating whether the root object will be read as a JSON array. - - - true if the root object will be read as a JSON array; otherwise, false. - - - - - Gets or sets the used when reading values from BSON. - - The used when reading values from BSON. - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. - - - - - Creates an instance of the JsonWriter class. - - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Closes this stream and the underlying stream. - - - - - Writes the beginning of a Json object. - - - - - Writes the end of a Json object. - - - - - Writes the beginning of a Json array. - - - - - Writes the end of an array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the end constructor. - - - - - Writes the property name of a name/value pair on a Json object. - - The name of the property. - - - - Writes the end of the current Json object or array. - - - - - Writes the current token. - - The to read the token from. - - - - Writes the specified end token. - - The end token to write. - - - - Writes indent characters. - - - - - Writes the JSON value delimiter. - - - - - Writes an indent space. - - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON without changing the writer's state. - - The raw JSON to write. - - - - Writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - An error will raised if the value cannot be written as a single JSON token. - - The value to write. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes out the given white space. - - The string of white space characters. - - - - Gets or sets a value indicating whether the underlying stream or - should be closed when the writer is closed. - - - true to close the underlying stream or when - the writer is closed; otherwise false. The default is true. - - - - - Gets the top. - - The top. - - - - Gets the state of the writer. - - - - - Gets the path of the writer. - - - - - Indicates how JSON text output is formatted. - - - - - Get or set how dates are written to JSON text. - - - - - Get or set how time zones are handling when writing JSON. - - - - - Initializes a new instance of the class. - - The stream. - - - - Initializes a new instance of the class. - - The writer. - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Writes the end. - - The token. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes raw JSON where a value is expected and updates the writer's state. - - The raw JSON to write. - - - - Writes the beginning of a Json array. - - - - - Writes the beginning of a Json object. - - - - - Writes the property name of a name/value pair on a Json object. - - The name of the property. - - - - Closes this stream and the underlying stream. - - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value that represents a BSON object id. - - - - - - Writes a BSON regex. - - The regex pattern. - The regex options. - - - - Gets or sets the used when writing values to BSON. - When set to no conversion will occur. - - The used when writing values to BSON. - - - - Specifies how constructors are used when initializing objects during deserialization by the . - - - - - First attempt to use the public default constructor, then fall back to single paramatized constructor, then the non-public default constructor. - - - - - Json.NET will use a non-public default constructor before falling back to a paramatized constructor. - - - - - Converts a binary value to and from a base 64 string value. - - - - - Converts an object to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets the of the JSON produced by the JsonConverter. - - The of the JSON produced by the JsonConverter. - - - - Gets a value indicating whether this can read JSON. - - true if this can read JSON; otherwise, false. - - - - Gets a value indicating whether this can write JSON. - - true if this can write JSON; otherwise, false. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON and BSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Create a custom object - - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Creates an object which will then be populated by the serializer. - - Type of the object. - - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Provides a base class for converting a to and from JSON. - - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an Entity Framework EntityKey to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an ExpandoObject to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Converts a to and from the ISO 8601 date format (e.g. 2008-04-12T12:53Z). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Gets or sets the date time styles used when converting a date to and from JSON. - - The date time styles used when converting a date to and from JSON. - - - - Gets or sets the date time format used when converting a date to and from JSON. - - The date time format used when converting a date to and from JSON. - - - - Gets or sets the culture used when converting a date to and from JSON. - - The culture used when converting a date to and from JSON. - - - - Converts a to and from a JavaScript date constructor (e.g. new Date(52231943)). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Converts a to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts a to and from JSON and BSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts an to and from its name string value. - - - Converts an to and from its name string value. - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - A cached representation of the Enum string representation to respect per Enum field name. - - The type of the Enum. - A map of enum field name to either the field name, or the configured enum member name (). - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets or sets a value indicating whether the written enum text should be camel case. - - true if the written enum text will be camel case; otherwise, false. - - - - Converts a to and from a string (e.g. "1.2.3.4"). - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing property value of the JSON that is being converted. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Converts XML to and from JSON. - - - - - Writes the JSON representation of the object. - - The to write to. - The calling serializer. - The value. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Checks if the attributeName is a namespace attribute. - - Attribute name to test. - The attribute name prefix if it has one, otherwise an empty string. - True if attribute name is for a namespace attribute, otherwise false. - - - - Determines whether this instance can convert the specified value type. - - Type of the value. - - true if this instance can convert the specified value type; otherwise, false. - - - - - Gets or sets the name of the root element to insert when deserializing to XML if the JSON structure has produces multiple root elements. - - The name of the deserialize root element. - - - - Gets or sets a flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - true if the array attibute is written to the XML; otherwise, false. - - - - Gets or sets a value indicating whether to write the root JSON object. - - true if the JSON root object is omitted; otherwise, false. - - - - Specifies how dates are formatted when writing JSON text. - - - - - Dates are written in the ISO 8601 format, e.g. "2012-03-21T05:40Z". - - - - - Dates are written in the Microsoft JSON format, e.g. "\/Date(1198908717056)\/". - - - - - Specifies how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON text. - - - - - Date formatted strings are not parsed to a date type and are read as strings. - - - - - Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . - - - - - Date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed to . - - - - - Specifies how to treat the time value when converting between string and . - - - - - Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. - - - - - Treat as a UTC. If the object represents a local time, it is converted to a UTC. - - - - - Treat as a local time if a is being converted to a string. - If a string is being converted to , convert to a local time if a time zone is specified. - - - - - Time zone information should be preserved when converting. - - - - - Specifies default value handling options for the . - - - - - Include members where the member value is the same as the member's default value when serializing objects. - Included members are written to JSON. Has no effect when deserializing. - - - - - Ignore members where the member value is the same as the member's default value when serializing objects - so that is is not written to JSON, and ignores setting members when the JSON value equals the member's default value. - - - - - Members with a default value but no JSON will be set to their default value when deserializing. - - - - - Ignore members where the member value is the same as the member's default value when serializing objects - and sets members to their default value when deserializing. - - - - - Specifies formatting options for the . - - - - - No special formatting is applied. This is the default. - - - - - Causes child objects to be indented according to the and settings. - - - - - Provides an interface to enable a class to return line and position information. - - - - - Gets a value indicating whether the class can return line information. - - - true if LineNumber and LinePosition can be provided; otherwise, false. - - - - - Gets the current line number. - - The current line number or 0 if no line information is available (for example, HasLineInfo returns false). - - - - Gets the current line position. - - The current line position or 0 if no line information is available (for example, HasLineInfo returns false). - - - - Instructs the how to serialize the collection. - - - - - Instructs the how to serialize the object. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Gets or sets the id. - - The id. - - - - Gets or sets the title. - - The title. - - - - Gets or sets the description. - - The description. - - - - Gets the collection's items converter. - - The collection's items converter. - - - - Gets or sets a value that indicates whether to preserve object references. - - - true to keep object reference; otherwise, false. The default is false. - - - - - Gets or sets a value that indicates whether to preserve collection's items references. - - - true to keep collection's items object references; otherwise, false. The default is false. - - - - - Gets or sets the reference loop handling used when serializing the collection's items. - - The reference loop handling. - - - - Gets or sets the type name handling used when serializing the collection's items. - - The type name handling. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with a flag indicating whether the array can contain null items - - A flag indicating whether the array can contain null items. - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Gets or sets a value indicating whether null items are allowed in the collection. - - true if null items are allowed in the collection; otherwise, false. - - - - Instructs the to use the specified constructor when deserializing that object. - - - - - Provides methods for converting between common language runtime types and JSON types. - - - - - Represents JavaScript's boolean value true as a string. This field is read-only. - - - - - Represents JavaScript's boolean value false as a string. This field is read-only. - - - - - Represents JavaScript's null as a string. This field is read-only. - - - - - Represents JavaScript's undefined as a string. This field is read-only. - - - - - Represents JavaScript's positive infinity as a string. This field is read-only. - - - - - Represents JavaScript's negative infinity as a string. This field is read-only. - - - - - Represents JavaScript's NaN as a string. This field is read-only. - - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation using the specified. - - The value to convert. - The format the date will be converted to. - The time zone handling when the date is converted to a string. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation using the specified. - - The value to convert. - The format the date will be converted to. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - The string delimiter character. - A JSON string representation of the . - - - - Converts the to its JSON string representation. - - The value to convert. - A JSON string representation of the . - - - - Serializes the specified object to a JSON string. - - The object to serialize. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string. - - The object to serialize. - Indicates how the output is formatted. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a collection of . - - The object to serialize. - A collection converters used while serializing. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using a collection of . - - The object to serialize. - Indicates how the output is formatted. - A collection converters used while serializing. - A JSON string representation of the object. - - - - Serializes the specified object to a JSON string using a collection of . - - The object to serialize. - The used to serialize the object. - If this is null, default serialization settings will be is used. - - A JSON string representation of the object. - - - - - Serializes the specified object to a JSON string using a collection of . - - The object to serialize. - Indicates how the output is formatted. - The used to serialize the object. - If this is null, default serialization settings will be is used. - - A JSON string representation of the object. - - - - - Asynchronously serializes the specified object to a JSON string using a collection of . - - The object to serialize. - - A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. - - - - - Asynchronously serializes the specified object to a JSON string using a collection of . - - The object to serialize. - Indicates how the output is formatted. - - A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. - - - - - Asynchronously serializes the specified object to a JSON string using a collection of . - - The object to serialize. - Indicates how the output is formatted. - The used to serialize the object. - If this is null, default serialization settings will be is used. - - A task that represents the asynchronous serialize operation. The value of the TResult parameter contains a JSON string representation of the object. - - - - - Deserializes the JSON to a .NET object. - - The JSON to deserialize. - The deserialized object from the Json string. - - - - Deserializes the JSON to a .NET object. - - The JSON to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The JSON to deserialize. - The of object being deserialized. - The deserialized object from the Json string. - - - - Deserializes the JSON to the specified .NET type. - - The type of the object to deserialize to. - The JSON to deserialize. - The deserialized object from the Json string. - - - - Deserializes the JSON to the given anonymous type. - - - The anonymous type to deserialize to. This can't be specified - traditionally and must be infered from the anonymous type passed - as a parameter. - - The JSON to deserialize. - The anonymous type object. - The deserialized anonymous type from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The type of the object to deserialize to. - The JSON to deserialize. - Converters to use while deserializing. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The type of the object to deserialize to. - The object to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The JSON to deserialize. - The type of the object to deserialize. - Converters to use while deserializing. - The deserialized object from the JSON string. - - - - Deserializes the JSON to the specified .NET type. - - The JSON to deserialize. - The type of the object to deserialize to. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - The deserialized object from the JSON string. - - - - Asynchronously deserializes the JSON to the specified .NET type. - - The type of the object to deserialize to. - The JSON to deserialize. - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Asynchronously deserializes the JSON to the specified .NET type. - - The type of the object to deserialize to. - The JSON to deserialize. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Asynchronously deserializes the JSON to the specified .NET type. - - The JSON to deserialize. - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Asynchronously deserializes the JSON to the specified .NET type. - - The JSON to deserialize. - The type of the object to deserialize to. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - - A task that represents the asynchronous deserialize operation. The value of the TResult parameter contains the deserialized object from the JSON string. - - - - - Populates the object with values from the JSON string. - - The JSON to populate values from. - The target object to populate values onto. - - - - Populates the object with values from the JSON string. - - The JSON to populate values from. - The target object to populate values onto. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - - - - Asynchronously populates the object with values from the JSON string. - - The JSON to populate values from. - The target object to populate values onto. - - The used to deserialize the object. - If this is null, default serialization settings will be is used. - - - A task that represents the asynchronous populate operation. - - - - - Serializes the XML node to a JSON string. - - The node to serialize. - A JSON string of the XmlNode. - - - - Serializes the XML node to a JSON string. - - The node to serialize. - Indicates how the output is formatted. - A JSON string of the XmlNode. - - - - Serializes the XML node to a JSON string. - - The node to serialize. - Indicates how the output is formatted. - Omits writing the root object. - A JSON string of the XmlNode. - - - - Deserializes the XmlNode from a JSON string. - - The JSON string. - The deserialized XmlNode - - - - Deserializes the XmlNode from a JSON string nested in a root elment. - - The JSON string. - The name of the root element to append when deserializing. - The deserialized XmlNode - - - - Deserializes the XmlNode from a JSON string nested in a root elment. - - The JSON string. - The name of the root element to append when deserializing. - - A flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - The deserialized XmlNode - - - - Serializes the to a JSON string. - - The node to convert to JSON. - A JSON string of the XNode. - - - - Serializes the to a JSON string. - - The node to convert to JSON. - Indicates how the output is formatted. - A JSON string of the XNode. - - - - Serializes the to a JSON string. - - The node to serialize. - Indicates how the output is formatted. - Omits writing the root object. - A JSON string of the XNode. - - - - Deserializes the from a JSON string. - - The JSON string. - The deserialized XNode - - - - Deserializes the from a JSON string nested in a root elment. - - The JSON string. - The name of the root element to append when deserializing. - The deserialized XNode - - - - Deserializes the from a JSON string nested in a root elment. - - The JSON string. - The name of the root element to append when deserializing. - - A flag to indicate whether to write the Json.NET array attribute. - This attribute helps preserve arrays when converting the written XML back to JSON. - - The deserialized XNode - - - - Instructs the to use the specified when serializing the member or class. - - - - - Initializes a new instance of the class. - - Type of the converter. - - - - Gets the type of the converter. - - The type of the converter. - - - - Represents a collection of . - - - - - Instructs the how to serialize the collection. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - The exception thrown when an error occurs during Json serialization or deserialization. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - 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). - - - - Instructs the not to serialize the public field or public read/write property value. - - - - - Instructs the how to serialize the object. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified member serialization. - - The member serialization. - - - - Initializes a new instance of the class with the specified container Id. - - The container Id. - - - - Gets or sets the member serialization. - - The member serialization. - - - - Gets or sets a value that indicates whether the object's properties are required. - - - A value indicating whether the object's properties are required. - - - - - Instructs the to always serialize the member with the specified name. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified name. - - Name of the property. - - - - Gets or sets the converter used when serializing the property's collection items. - - The collection's items converter. - - - - Gets or sets the null value handling used when serializing this property. - - The null value handling. - - - - Gets or sets the default value handling used when serializing this property. - - The default value handling. - - - - Gets or sets the reference loop handling used when serializing this property. - - The reference loop handling. - - - - Gets or sets the object creation handling used when deserializing this property. - - The object creation handling. - - - - Gets or sets the type name handling used when serializing this property. - - The type name handling. - - - - Gets or sets whether this property's value is serialized as a reference. - - Whether this property's value is serialized as a reference. - - - - Gets or sets the order of serialization and deserialization of a member. - - The numeric order of serialization or deserialization. - - - - Gets or sets a value indicating whether this property is required. - - - A value indicating whether this property is required. - - - - - Gets or sets the name of the property. - - The name of the property. - - - - Gets or sets the the reference loop handling used when serializing the property's collection items. - - The collection's items reference loop handling. - - - - Gets or sets the the type name handling used when serializing the property's collection items. - - The collection's items type name handling. - - - - Gets or sets whether this property's collection items are serialized as a reference. - - Whether this property's collection items are serialized as a reference. - - - - The exception thrown when an error occurs while reading Json text. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - 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). - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - The exception thrown when an error occurs during Json serialization or deserialization. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - 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). - - - - Serializes and deserializes objects into and from the JSON format. - The enables you to control how objects are encoded into JSON. - - - - - Initializes a new instance of the class. - - - - - Creates a new instance using the specified . - - The settings to be applied to the . - A new instance using the specified . - - - - Populates the JSON values onto the target object. - - The that contains the JSON structure to reader values from. - The target object to populate values onto. - - - - Populates the JSON values onto the target object. - - The that contains the JSON structure to reader values from. - The target object to populate values onto. - - - - Deserializes the Json structure contained by the specified . - - The that contains the JSON structure to deserialize. - The being deserialized. - - - - Deserializes the Json structure contained by the specified - into an instance of the specified type. - - The containing the object. - The of object being deserialized. - The instance of being deserialized. - - - - Deserializes the Json structure contained by the specified - into an instance of the specified type. - - The containing the object. - The type of the object to deserialize. - The instance of being deserialized. - - - - Deserializes the Json structure contained by the specified - into an instance of the specified type. - - The containing the object. - The of object being deserialized. - The instance of being deserialized. - - - - Serializes the specified and writes the Json structure - to a Stream using the specified . - - The used to write the Json structure. - The to serialize. - - - - Serializes the specified and writes the Json structure - to a Stream using the specified . - - The used to write the Json structure. - The to serialize. - - - - Occurs when the errors during serialization and deserialization. - - - - - Gets or sets the used by the serializer when resolving references. - - - - - Gets or sets the used by the serializer when resolving type names. - - - - - Gets or sets how type name writing and reading is handled by the serializer. - - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - - The type name assembly format. - - - - Gets or sets how object references are preserved by the serializer. - - - - - Get or set how reference loops (e.g. a class referencing itself) is handled. - - - - - Get or set how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - - - - - Get or set how null values are handled during serialization and deserialization. - - - - - Get or set how null default are handled during serialization and deserialization. - - - - - Gets or sets how objects are created during deserialization. - - The object creation handling. - - - - Gets or sets how constructors are used during deserialization. - - The constructor handling. - - - - Gets a collection that will be used during serialization. - - Collection that will be used during serialization. - - - - Gets or sets the contract resolver used by the serializer when - serializing .NET objects to JSON and vice versa. - - - - - Gets or sets the used by the serializer when invoking serialization callback methods. - - The context. - - - - Indicates how JSON text output is formatted. - - - - - Get or set how dates are written to JSON text. - - - - - Get or set how time zones are handling during serialization and deserialization. - - - - - Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Gets a value indicating whether there will be a check for additional JSON content after deserializing an object. - - - true if there will be a check for additional JSON content after deserializing an object; otherwise, false. - - - - - Specifies the settings on a object. - - - - - Initializes a new instance of the class. - - - - - Gets or sets how reference loops (e.g. a class referencing itself) is handled. - - Reference loop handling. - - - - Gets or sets how missing members (e.g. JSON contains a property that isn't a member on the object) are handled during deserialization. - - Missing member handling. - - - - Gets or sets how objects are created during deserialization. - - The object creation handling. - - - - Gets or sets how null values are handled during serialization and deserialization. - - Null value handling. - - - - Gets or sets how null default are handled during serialization and deserialization. - - The default value handling. - - - - Gets or sets a collection that will be used during serialization. - - The converters. - - - - Gets or sets how object references are preserved by the serializer. - - The preserve references handling. - - - - Gets or sets how type name writing and reading is handled by the serializer. - - The type name handling. - - - - Gets or sets how a type name assembly is written and resolved by the serializer. - - The type name assembly format. - - - - Gets or sets how constructors are used during deserialization. - - The constructor handling. - - - - Gets or sets the contract resolver used by the serializer when - serializing .NET objects to JSON and vice versa. - - The contract resolver. - - - - Gets or sets the used by the serializer when resolving references. - - The reference resolver. - - - - Gets or sets the used by the serializer when resolving type names. - - The binder. - - - - Gets or sets the error handler called during serialization and deserialization. - - The error handler called during serialization and deserialization. - - - - Gets or sets the used by the serializer when invoking serialization callback methods. - - The context. - - - - Gets or sets the maximum depth allowed when reading JSON. Reading past this depth will throw a . - - - - - Indicates how JSON text output is formatted. - - - - - Get or set how dates are written to JSON text. - - - - - Get or set how time zones are handling during serialization and deserialization. - - - - - Get or set how date formatted strings, e.g. "\/Date(1198908717056)\/" and "2012-03-21T05:40Z", are parsed when reading JSON. - - - - - Gets or sets the culture used when reading JSON. Defaults to . - - - - - Gets a value indicating whether there will be a check for additional content after deserializing an object. - - - true if there will be a check for additional content after deserializing an object; otherwise, false. - - - - - Represents a reader that provides fast, non-cached, forward-only access to JSON text data. - - - - - Initializes a new instance of the class with the specified . - - The TextReader containing the XML data to read. - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Reads the next JSON token from the stream as a . - - - A or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Changes the state to closed. - - - - - Gets a value indicating whether the class can return line information. - - - true if LineNumber and LinePosition can be provided; otherwise, false. - - - - - Gets the current line number. - - - The current line number or 0 if no line information is available (for example, HasLineInfo returns false). - - - - - Gets the current line position. - - - The current line position or 0 if no line information is available (for example, HasLineInfo returns false). - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. - - - - - Creates an instance of the JsonWriter class using the specified . - - The TextWriter to write to. - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Closes this stream and the underlying stream. - - - - - Writes the beginning of a Json object. - - - - - Writes the beginning of a Json array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the specified end token. - - The end token to write. - - - - Writes the property name of a name/value pair on a Json object. - - The name of the property. - - - - Writes indent characters. - - - - - Writes the JSON value delimiter. - - - - - Writes an indent space. - - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes out the given white space. - - The string of white space characters. - - - - Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. - - - - - Gets or sets which character to use to quote attribute values. - - - - - Gets or sets which character to use for indenting when is set to Formatting.Indented. - - - - - Gets or sets a value indicating whether object names will be surrounded with quotes. - - - - - Specifies the type of Json token. - - - - - This is returned by the if a method has not been called. - - - - - An object start token. - - - - - An array start token. - - - - - A constructor start token. - - - - - An object property name. - - - - - A comment. - - - - - Raw JSON. - - - - - An integer. - - - - - A float. - - - - - A string. - - - - - A boolean. - - - - - A null token. - - - - - An undefined token. - - - - - An object end token. - - - - - An array end token. - - - - - A constructor end token. - - - - - A Date. - - - - - Byte data. - - - - - Represents a reader that provides validation. - - - - - Initializes a new instance of the class that - validates the content returned from the given . - - The to read from while validating. - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream as a . - - - A or a null reference if the next JSON token is null. - - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Sets an event handler for receiving schema validation errors. - - - - - Gets the text value of the current Json token. - - - - - - Gets the depth of the current token in the JSON document. - - The depth of the current token in the JSON document. - - - - Gets the path of the current JSON token. - - - - - Gets the quotation mark character used to enclose the value of a string. - - - - - - Gets the type of the current Json token. - - - - - - Gets the Common Language Runtime (CLR) type for the current Json token. - - - - - - Gets or sets the schema. - - The schema. - - - - Gets the used to construct this . - - The specified in the constructor. - - - - The exception thrown when an error occurs while reading Json text. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - 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). - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Contains the LINQ to JSON extension methods. - - - - - Returns a collection of tokens that contains the ancestors of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains the ancestors of every node in the source collection. - - - - Returns a collection of tokens that contains the descendants of every token in the source collection. - - The type of the objects in source, constrained to . - An of that contains the source collection. - An of that contains the descendants of every node in the source collection. - - - - Returns a collection of child properties of every object in the source collection. - - An of that contains the source collection. - An of that contains the properties of every object in the source collection. - - - - Returns a collection of child values of every object in the source collection with the given key. - - An of that contains the source collection. - The token key. - An of that contains the values of every node in the source collection with the given key. - - - - Returns a collection of child values of every object in the source collection. - - An of that contains the source collection. - An of that contains the values of every node in the source collection. - - - - Returns a collection of converted child values of every object in the source collection with the given key. - - The type to convert the values to. - An of that contains the source collection. - The token key. - An that contains the converted values of every node in the source collection with the given key. - - - - Returns a collection of converted child values of every object in the source collection. - - The type to convert the values to. - An of that contains the source collection. - An that contains the converted values of every node in the source collection. - - - - Converts the value. - - The type to convert the value to. - A cast as a of . - A converted value. - - - - Converts the value. - - The source collection type. - The type to convert the value to. - A cast as a of . - A converted value. - - - - Returns a collection of child tokens of every array in the source collection. - - The source collection type. - An of that contains the source collection. - An of that contains the values of every node in the source collection. - - - - Returns a collection of converted child tokens of every array in the source collection. - - An of that contains the source collection. - The type to convert the values to. - The source collection type. - An that contains the converted values of every node in the source collection. - - - - Returns the input typed as . - - An of that contains the source collection. - The input typed as . - - - - Returns the input typed as . - - The source collection type. - An of that contains the source collection. - The input typed as . - - - - Represents a collection of objects. - - The type of token - - - - Gets the with the specified key. - - - - - - Represents a JSON array. - - - - - Represents a token that can contain other tokens. - - - - - Represents an abstract JSON token. - - - - - Compares the values of two tokens, including the values of all descendant tokens. - - The first to compare. - The second to compare. - true if the tokens are equal; otherwise false. - - - - Adds the specified content immediately after this token. - - A content object that contains simple content or a collection of content objects to be added after this token. - - - - Adds the specified content immediately before this token. - - A content object that contains simple content or a collection of content objects to be added before this token. - - - - Returns a collection of the ancestor tokens of this token. - - A collection of the ancestor tokens of this token. - - - - Returns a collection of the sibling tokens after this token, in document order. - - A collection of the sibling tokens after this tokens, in document order. - - - - Returns a collection of the sibling tokens before this token, in document order. - - A collection of the sibling tokens before this token, in document order. - - - - Gets the with the specified key converted to the specified type. - - The type to convert the token to. - The token key. - The converted token value. - - - - Returns a collection of the child tokens of this token, in document order. - - An of containing the child tokens of this , in document order. - - - - Returns a collection of the child tokens of this token, in document order, filtered by the specified type. - - The type to filter the child tokens on. - A containing the child tokens of this , in document order. - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - A containing the child values of this , in document order. - - - - Removes this token from its parent. - - - - - Replaces this token with the specified token. - - The value. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Returns the indented JSON for this token. - - - The indented JSON for this token. - - - - - Returns the JSON for this token using the given formatting and converters. - - Indicates how the output is formatted. - A collection of which will be used when writing the token. - The JSON for this token using the given formatting and converters. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an explicit conversion from to . - - The value. - The result of the conversion. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Creates an for this token. - - An that can be used to read this token and its descendants. - - - - Creates a from an object. - - The object that will be used to create . - A with the value of the specified object - - - - Creates a from an object using the specified . - - The object that will be used to create . - The that will be used when reading the object. - A with the value of the specified object - - - - Creates the specified .NET type from the . - - The new object created from the JSON value. - - - - Creates the specified .NET type from the using the specified . - - The that will be used when creating the object. - The new object created from the JSON value. - - - - Creates a from a . - - An positioned at the token to read into this . - - An that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Creates a from a . - - An positioned at the token to read into this . - - An that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Selects the token that matches the object path. - - - The object path from the current to the - to be returned. This must be a string of property names or array indexes separated - by periods, such as Tables[0].DefaultView[0].Price in C# or - Tables(0).DefaultView(0).Price in Visual Basic. - - The that matches the object path or a null reference if no matching token is found. - - - - Selects the token that matches the object path. - - - The object path from the current to the - to be returned. This must be a string of property names or array indexes separated - by periods, such as Tables[0].DefaultView[0].Price in C# or - Tables(0).DefaultView(0).Price in Visual Basic. - - A flag to indicate whether an error should be thrown if no token is found. - The that matches the object path. - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Creates a new instance of the . All child tokens are recursively cloned. - - A new instance of the . - - - - Gets a comparer that can compare two tokens for value equality. - - A that can compare two nodes for value equality. - - - - Gets or sets the parent. - - The parent. - - - - Gets the root of this . - - The root of this . - - - - Gets the node type for this . - - The type. - - - - Gets a value indicating whether this token has childen tokens. - - - true if this token has child values; otherwise, false. - - - - - Gets the next sibling token of this node. - - The that contains the next sibling token. - - - - Gets the previous sibling token of this node. - - The that contains the previous sibling token. - - - - Gets the with the specified key. - - The with the specified key. - - - - Get the first child token of this token. - - A containing the first child token of the . - - - - Get the last child token of this token. - - A containing the last child token of the . - - - - Raises the event. - - The instance containing the event data. - - - - Raises the event. - - The instance containing the event data. - - - - Raises the event. - - The instance containing the event data. - - - - Returns a collection of the child tokens of this token, in document order. - - - An of containing the child tokens of this , in document order. - - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - - A containing the child values of this , in document order. - - - - - Returns a collection of the descendant tokens for this token in document order. - - An containing the descendant tokens of the . - - - - Adds the specified content as children of this . - - The content to be added. - - - - Adds the specified content as the first children of this . - - The content to be added. - - - - Creates an that can be used to add tokens to the . - - An that is ready to have content written to it. - - - - Replaces the children nodes of this token with the specified content. - - The content. - - - - Removes the child nodes from this token. - - - - - Occurs when the list changes or an item in the list changes. - - - - - Occurs before an item is added to the collection. - - - - - Occurs when the items list of the collection has changed, or the collection is reset. - - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets a value indicating whether this token has childen tokens. - - - true if this token has child values; otherwise, false. - - - - - Get the first child token of this token. - - - A containing the first child token of the . - - - - - Get the last child token of this token. - - - A containing the last child token of the . - - - - - Gets the count of child JSON tokens. - - The count of child JSON tokens - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - 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 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. - - - - 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. - - - - - 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. - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets the node type for this . - - The type. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets or sets the at the specified index. - - - - - - Represents a JSON constructor. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified name and content. - - The constructor name. - The contents of the constructor. - - - - Initializes a new instance of the class with the specified name and content. - - The constructor name. - The contents of the constructor. - - - - Initializes a new instance of the class with the specified name. - - The constructor name. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets or sets the name of this constructor. - - The constructor name. - - - - Gets the node type for this . - - The type. - - - - Gets the with the specified key. - - The with the specified key. - - - - Represents a collection of objects. - - The type of token - - - - An empty collection of objects. - - - - - Initializes a new instance of the struct. - - The enumerable. - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Gets the with the specified key. - - - - - - Represents a JSON object. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the specified content. - - The contents of the object. - - - - Initializes a new instance of the class with the specified content. - - The contents of the object. - - - - Gets an of this object's properties. - - An of this object's properties. - - - - Gets a the specified name. - - The property name. - A with the specified name or null. - - - - Gets an of this object's property values. - - An of this object's property values. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Adds the specified property name. - - Name of the property. - The value. - - - - Removes the property with the specified name. - - Name of the property. - true if item was successfully removed; otherwise, false. - - - - Tries the get value. - - Name of the property. - The value. - true if a value was successfully retrieved; otherwise, false. - - - - Returns an enumerator that iterates through the collection. - - - A that can be used to iterate through the collection. - - - - - Raises the event with the provided arguments. - - Name of the property. - - - - Raises the event with the provided arguments. - - Name of the property. - - - - Returns the properties for this instance of a component. - - - A that represents the properties for this component instance. - - - - - Returns the properties for this instance of a component using the attribute array as a filter. - - An array of type that is used as a filter. - - A that represents the filtered properties for this component instance. - - - - - Returns a collection of custom attributes for this instance of a component. - - - An containing the attributes for this object. - - - - - Returns the class name of this instance of a component. - - - The class name of the object, or null if the class does not have a name. - - - - - Returns the name of this instance of a component. - - - The name of the object, or null if the object does not have a name. - - - - - Returns a type converter for this instance of a component. - - - A that is the converter for this object, or null if there is no for this object. - - - - - Returns the default event for this instance of a component. - - - An that represents the default event for this object, or null if this object does not have events. - - - - - Returns the default property for this instance of a component. - - - A that represents the default property for this object, or null if this object does not have properties. - - - - - Returns an editor of the specified type for this instance of a component. - - A that represents the editor for this object. - - An of the specified type that is the editor for this object, or null if the editor cannot be found. - - - - - Returns the events for this instance of a component using the specified attribute array as a filter. - - An array of type that is used as a filter. - - An that represents the filtered events for this component instance. - - - - - Returns the events for this instance of a component. - - - An that represents the events for this component instance. - - - - - Returns an object that contains the property described by the specified property descriptor. - - A that represents the property whose owner is to be found. - - An that represents the owner of the specified property. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Occurs when a property value changes. - - - - - Occurs when a property value is changing. - - - - - Gets the node type for this . - - The type. - - - - Gets the with the specified key. - - The with the specified key. - - - - Gets or sets the with the specified property name. - - - - - - Represents a JSON property. - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class. - - The property name. - The property content. - - - - Initializes a new instance of the class. - - The property name. - The property content. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Gets the container's children tokens. - - The container's children tokens. - - - - Gets the property name. - - The property name. - - - - Gets or sets the property value. - - The property value. - - - - Gets the node type for this . - - The type. - - - - Represents a view of a . - - - - - Initializes a new instance of the class. - - The name. - Type of the property. - - - - When overridden in a derived class, returns whether resetting an object changes its value. - - - true if resetting the component changes its value; otherwise, false. - - The component to test for reset capability. - - - - - When overridden in a derived class, gets the current value of the property on a component. - - - The value of a property for a given component. - - The component with the property for which to retrieve the value. - - - - - When overridden in a derived class, resets the value for this property of the component to the default value. - - The component with the property value that is to be reset to the default value. - - - - - When overridden in a derived class, sets the value of the component to a different value. - - The component with the property value that is to be set. - The new value. - - - - - When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. - - - true if the property should be persisted; otherwise, false. - - The component with the property to be examined for persistence. - - - - - When overridden in a derived class, gets the type of the component this property is bound to. - - - A that represents the type of component this property is bound to. When the or methods are invoked, the object specified might be an instance of this type. - - - - - When overridden in a derived class, gets a value indicating whether this property is read-only. - - - true if the property is read-only; otherwise, false. - - - - - When overridden in a derived class, gets the type of the property. - - - A that represents the type of the property. - - - - - Gets the hash code for the name of the member. - - - - The hash code for the name of the member. - - - - - Represents a raw JSON string. - - - - - Represents a value in JSON (string, integer, date, etc). - - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Creates a comment with the given value. - - The value. - A comment with the given value. - - - - Creates a string with the given value. - - The value. - A string with the given value. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Indicates whether the current object is equal to another object of the same type. - - - true if the current object is equal to the parameter; otherwise, false. - - An object to compare with this object. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - - The parameter is null. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format provider. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - The format provider. - - A that represents this instance. - - - - - Returns the responsible for binding operations performed on this object. - - The expression tree representation of the runtime value. - - The to bind this object. - - - - - Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. - - An object to compare with this instance. - - A 32-bit signed integer that indicates the relative order of the objects being compared. The return value has these meanings: - Value - Meaning - Less than zero - This instance is less than . - Zero - This instance is equal to . - Greater than zero - This instance is greater than . - - - is not the same type as this instance. - - - - - Gets a value indicating whether this token has childen tokens. - - - true if this token has child values; otherwise, false. - - - - - Gets the node type for this . - - The type. - - - - Gets or sets the underlying token value. - - The underlying token value. - - - - Initializes a new instance of the class from another object. - - A object to copy from. - - - - Initializes a new instance of the class. - - The raw json. - - - - Creates an instance of with the content of the reader's current token. - - The reader. - An instance of with the content of the reader's current token. - - - - Compares tokens to determine whether they are equal. - - - - - Determines whether the specified objects are equal. - - The first object of type to compare. - The second object of type to compare. - - true if the specified objects are equal; otherwise, false. - - - - - Returns a hash code for the specified object. - - The for which a hash code is to be returned. - A hash code for the specified object. - The type of is a reference type and is null. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. - - - - - Initializes a new instance of the class. - - The token to read from. - - - - Reads the next JSON token from the stream as a . - - - A or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Specifies the type of token. - - - - - No token type has been set. - - - - - A JSON object. - - - - - A JSON array. - - - - - A JSON constructor. - - - - - A JSON object property. - - - - - A comment. - - - - - An integer value. - - - - - A float value. - - - - - A string value. - - - - - A boolean value. - - - - - A null value. - - - - - An undefined value. - - - - - A date value. - - - - - A raw JSON value. - - - - - A collection of bytes value. - - - - - A Guid value. - - - - - A Uri value. - - - - - A TimeSpan value. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. - - - - - Initializes a new instance of the class writing to the given . - - The container being written to. - - - - Initializes a new instance of the class. - - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Closes this stream and the underlying stream. - - - - - Writes the beginning of a Json object. - - - - - Writes the beginning of a Json array. - - - - - Writes the start of a constructor with the given name. - - The name of the constructor. - - - - Writes the end. - - The token. - - - - Writes the property name of a name/value pair on a Json object. - - The name of the property. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes raw JSON. - - The raw JSON to write. - - - - Writes out a comment /*...*/ containing the specified text. - - Text to place inside the comment. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Gets the token being writen. - - The token being writen. - - - - Specifies the member serialization options for the . - - - - - All public members are serialized by default. Members can be excluded using or NonSerializedAttribute. - This is the default member serialization mode. - - - - - Only members must be marked with or are serialized. - This member serialization mode can also be set by marking the class with . - - - - - All public and private fields are serialized. Members can be excluded using or NonSerializedAttribute. - This member serialization mode can also be set by marking the class with - and setting IgnoreSerializableAttribute on to false. - - - - - Specifies missing member handling options for the . - - - - - Ignore a missing member and do not attempt to deserialize it. - - - - - Throw a when a missing member is encountered during deserialization. - - - - - Specifies null value handling options for the . - - - - - Include null values when serializing and deserializing objects. - - - - - Ignore null values when serializing and deserializing objects. - - - - - Specifies how object creation is handled by the . - - - - - Reuse existing objects, create new objects when needed. - - - - - Only reuse existing objects. - - - - - Always create new objects. - - - - - Specifies reference handling options for the . - - - - - Do not preserve references when serializing types. - - - - - Preserve references when serializing into a JSON object structure. - - - - - Preserve references when serializing into a JSON array structure. - - - - - Preserve references when serializing. - - - - - Specifies reference loop handling options for the . - - - - - Throw a when a loop is encountered. - - - - - Ignore loop references and do not serialize. - - - - - Serialize loop references. - - - - - Indicating whether a property is required. - - - - - The property is not required. The default state. - - - - - The property must be defined in JSON but can be a null value. - - - - - The property must be defined in JSON and cannot be a null value. - - - - - Contains the JSON schema extension methods. - - - - - Determines whether the is valid. - - The source to test. - The schema to test with. - - true if the specified is valid; otherwise, false. - - - - - Determines whether the is valid. - - The source to test. - The schema to test with. - When this method returns, contains any error messages generated while validating. - - true if the specified is valid; otherwise, false. - - - - - Validates the specified . - - The source to test. - The schema to test with. - - - - Validates the specified . - - The source to test. - The schema to test with. - The validation event handler. - - - - An in-memory representation of a JSON Schema. - - - - - Initializes a new instance of the class. - - - - - Reads a from the specified . - - The containing the JSON Schema to read. - The object representing the JSON Schema. - - - - Reads a from the specified . - - The containing the JSON Schema to read. - The to use when resolving schema references. - The object representing the JSON Schema. - - - - Load a from a string that contains schema JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Parses the specified json. - - The json. - The resolver. - A populated from the string that contains JSON. - - - - Writes this schema to a . - - A into which this method will write. - - - - Writes this schema to a using the specified . - - A into which this method will write. - The resolver used. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets or sets the id. - - - - - Gets or sets the title. - - - - - Gets or sets whether the object is required. - - - - - Gets or sets whether the object is read only. - - - - - Gets or sets whether the object is visible to users. - - - - - Gets or sets whether the object is transient. - - - - - Gets or sets the description of the object. - - - - - Gets or sets the types of values allowed by the object. - - The type. - - - - Gets or sets the pattern. - - The pattern. - - - - Gets or sets the minimum length. - - The minimum length. - - - - Gets or sets the maximum length. - - The maximum length. - - - - Gets or sets a number that the value should be divisble by. - - A number that the value should be divisble by. - - - - Gets or sets the minimum. - - The minimum. - - - - Gets or sets the maximum. - - The maximum. - - - - Gets or sets a flag indicating whether the value can not equal the number defined by the "minimum" attribute. - - A flag indicating whether the value can not equal the number defined by the "minimum" attribute. - - - - Gets or sets a flag indicating whether the value can not equal the number defined by the "maximum" attribute. - - A flag indicating whether the value can not equal the number defined by the "maximum" attribute. - - - - Gets or sets the minimum number of items. - - The minimum number of items. - - - - Gets or sets the maximum number of items. - - The maximum number of items. - - - - Gets or sets the of items. - - The of items. - - - - Gets or sets the of properties. - - The of properties. - - - - Gets or sets the of additional properties. - - The of additional properties. - - - - Gets or sets the pattern properties. - - The pattern properties. - - - - Gets or sets a value indicating whether additional properties are allowed. - - - true if additional properties are allowed; otherwise, false. - - - - - Gets or sets the required property if this property is present. - - The required property if this property is present. - - - - Gets or sets the identity. - - The identity. - - - - Gets or sets the a collection of valid enum values allowed. - - A collection of valid enum values allowed. - - - - Gets or sets a collection of options. - - A collection of options. - - - - Gets or sets disallowed types. - - The disallow types. - - - - Gets or sets the default value. - - The default value. - - - - Gets or sets the extend . - - The extended . - - - - Gets or sets the format. - - The format. - - - - Returns detailed information about the schema exception. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class - with a specified error message. - - The error message that explains the reason for the exception. - - - - Initializes a new instance of the class - with a specified error message and a reference to the inner exception that is the cause of this exception. - - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - 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). - - - - Gets the line number indicating where the error occurred. - - The line number indicating where the error occurred. - - - - Gets the line position indicating where the error occurred. - - The line position indicating where the error occurred. - - - - Gets the path to the JSON where the error occurred. - - The path to the JSON where the error occurred. - - - - Generates a from a specified . - - - - - Generate a from the specified type. - - The type to generate a from. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - The used to resolve schema references. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - Specify whether the generated root will be nullable. - A generated from the specified type. - - - - Generate a from the specified type. - - The type to generate a from. - The used to resolve schema references. - Specify whether the generated root will be nullable. - A generated from the specified type. - - - - Gets or sets how undefined schemas are handled by the serializer. - - - - - Gets or sets the contract resolver. - - The contract resolver. - - - - Resolves from an id. - - - - - Initializes a new instance of the class. - - - - - Gets a for the specified id. - - The id. - A for the specified id. - - - - Gets or sets the loaded schemas. - - The loaded schemas. - - - - The value types allowed by the . - - - - - No type specified. - - - - - String type. - - - - - Float type. - - - - - Integer type. - - - - - Boolean type. - - - - - Object type. - - - - - Array type. - - - - - Null type. - - - - - Any type. - - - - - Specifies undefined schema Id handling options for the . - - - - - Do not infer a schema Id. - - - - - Use the .NET type name as the schema Id. - - - - - Use the assembly qualified .NET type name as the schema Id. - - - - - Returns detailed information related to the . - - - - - Gets the associated with the validation error. - - The JsonSchemaException associated with the validation error. - - - - Gets the path of the JSON location where the validation error occurred. - - The path of the JSON location where the validation error occurred. - - - - Gets the text description corresponding to the validation error. - - The text description. - - - - Represents the callback method that will handle JSON schema validation events and the . - - - - - Resolves member mappings for a type, camel casing property names. - - - - - Used by to resolves a for a given . - - - - - Used by to resolves a for a given . - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - If set to true the will use a cached shared with other resolvers of the same type. - Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected - behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly - recommended to reuse instances with the . - - - - - Resolves the contract for a given type. - - The type to resolve a contract for. - The contract for a given type. - - - - Gets the serializable members for the type. - - The type to get serializable members for. - The serializable members for the type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates the constructor parameters. - - The constructor to create properties for. - The type's member properties. - Properties for the given . - - - - Creates a for the given . - - The matching member property. - The constructor parameter. - A created for the given . - - - - Resolves the default for the contract. - - Type of the object. - - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Creates a for the given type. - - Type of the object. - A for the given type. - - - - Determines which contract type is created for the given type. - - Type of the object. - A for the given type. - - - - Creates properties for the given . - - The type to create properties for. - /// The member serialization mode for the type. - Properties for the given . - - - - Creates the used by the serializer to get and set values from a member. - - The member. - The used by the serializer to get and set values from a member. - - - - Creates a for the given . - - The member's parent . - The member to create a for. - A created for the given . - - - - Resolves the name of the property. - - Name of the property. - Name of the property. - - - - Gets the resolved name of the property. - - Name of the property. - Name of the property. - - - - Gets a value indicating whether members are being get and set using dynamic code generation. - This value is determined by the runtime permissions available. - - - true if using dynamic code generation; otherwise, false. - - - - - Gets or sets the default members search flags. - - The default members search flags. - - - - Gets or sets a value indicating whether compiler generated members should be serialized. - - - true if serialized compiler generated members; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore the interface when serializing and deserializing types. - - - true if the interface will be ignored when serializing and deserializing types; otherwise, false. - - - - - Gets or sets a value indicating whether to ignore the attribute when serializing and deserializing types. - - - true if the attribute will be ignored when serializing and deserializing types; otherwise, false. - - - - - Initializes a new instance of the class. - - - - - Resolves the name of the property. - - Name of the property. - The property name camel cased. - - - - Used to resolve references when serializing and deserializing JSON by the . - - - - - Resolves a reference to its object. - - The serialization context. - The reference to resolve. - The object that - - - - Gets the reference for the sepecified object. - - The serialization context. - The object to get a reference for. - The reference to the object. - - - - Determines whether the specified object is referenced. - - The serialization context. - The object to test for a reference. - - true if the specified object is referenced; otherwise, false. - - - - - Adds a reference to the specified object. - - The serialization context. - The reference. - The object to reference. - - - - The default serialization binder used when resolving and loading classes from type names. - - - - - When overridden in a derived class, controls the binding of a serialized object to a type. - - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - The type of the object the formatter creates a new instance of. - - - - - When overridden in a derived class, controls the binding of a serialized object to a type. - - The type of the object the formatter creates a new instance of. - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - - - Get and set values for a using dynamic methods. - - - - - Provides methods to get and set values. - - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Provides information surrounding an error. - - - - - Gets or sets the error. - - The error. - - - - Gets the original object that caused the error. - - The original object that caused the error. - - - - Gets the member that caused the error. - - The member that caused the error. - - - - Gets the path of the JSON location where the error occurred. - - The path of the JSON location where the error occurred. - - - - Gets or sets a value indicating whether this is handled. - - true if handled; otherwise, false. - - - - Provides data for the Error event. - - - - - Initializes a new instance of the class. - - The current object. - The error context. - - - - Gets the current object the error event is being raised against. - - The current object the error event is being raised against. - - - - Gets the error context. - - The error context. - - - - Contract details for a used by the . - - - - - Contract details for a used by the . - - - - - Contract details for a used by the . - - - - - Gets the underlying type for the contract. - - The underlying type for the contract. - - - - Gets or sets the type created during deserialization. - - The type created during deserialization. - - - - Gets or sets whether this type contract is serialized as a reference. - - Whether this type contract is serialized as a reference. - - - - Gets or sets the default for this contract. - - The converter. - - - - Gets or sets the method called immediately after deserialization of the object. - - The method called immediately after deserialization of the object. - - - - Gets or sets the method called during deserialization of the object. - - The method called during deserialization of the object. - - - - Gets or sets the method called after serialization of the object graph. - - The method called after serialization of the object graph. - - - - Gets or sets the method called before serialization of the object. - - The method called before serialization of the object. - - - - Gets or sets the default creator method used to create the object. - - The default creator method used to create the object. - - - - Gets or sets a value indicating whether the default creator is non public. - - true if the default object creator is non-public; otherwise, false. - - - - Gets or sets the method called when an error is thrown during the serialization of the object. - - The method called when an error is thrown during the serialization of the object. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the default collection items . - - The converter. - - - - Gets or sets a value indicating whether the collection items preserve object references. - - true if collection items preserve object references; otherwise, false. - - - - Gets or sets the collection item reference loop handling. - - The reference loop handling. - - - - Gets or sets the collection item type name handling. - - The type name handling. - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets the of the collection items. - - The of the collection items. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the property name resolver. - - The property name resolver. - - - - Gets the of the dictionary keys. - - The of the dictionary keys. - - - - Gets the of the dictionary values. - - The of the dictionary values. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets the object's properties. - - The object's properties. - - - - Gets or sets the property name resolver. - - The property name resolver. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the ISerializable object constructor. - - The ISerializable object constructor. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Gets or sets the object member serialization. - - The member object serialization. - - - - Gets or sets a value that indicates whether the object's properties are required. - - - A value indicating whether the object's properties are required. - - - - - Gets the object's properties. - - The object's properties. - - - - Gets the constructor parameters required for any non-default constructor - - - - - Gets or sets the override constructor used to create the object. - This is set when a constructor is marked up using the - JsonConstructor attribute. - - The override constructor. - - - - Gets or sets the parametrized constructor used to create the object. - - The parametrized constructor. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Maps a JSON property to a .NET member or constructor parameter. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets or sets the name of the property. - - The name of the property. - - - - Gets or sets the type that declared this property. - - The type that declared this property. - - - - Gets or sets the order of serialization and deserialization of a member. - - The numeric order of serialization or deserialization. - - - - Gets or sets the name of the underlying member or parameter. - - The name of the underlying member or parameter. - - - - Gets the that will get and set the during serialization. - - The that will get and set the during serialization. - - - - Gets or sets the type of the property. - - The type of the property. - - - - Gets or sets the for the property. - If set this converter takes presidence over the contract converter for the property type. - - The converter. - - - - Gets the member converter. - - The member converter. - - - - Gets a value indicating whether this is ignored. - - true if ignored; otherwise, false. - - - - Gets a value indicating whether this is readable. - - true if readable; otherwise, false. - - - - Gets a value indicating whether this is writable. - - true if writable; otherwise, false. - - - - Gets the default value. - - The default value. - - - - Gets a value indicating whether this is required. - - A value indicating whether this is required. - - - - Gets a value indicating whether this property preserves object references. - - - true if this instance is reference; otherwise, false. - - - - - Gets the property null value handling. - - The null value handling. - - - - Gets the property default value handling. - - The default value handling. - - - - Gets the property reference loop handling. - - The reference loop handling. - - - - Gets the property object creation handling. - - The object creation handling. - - - - Gets or sets the type name handling. - - The type name handling. - - - - Gets or sets a predicate used to determine whether the property should be serialize. - - A predicate used to determine whether the property should be serialize. - - - - Gets or sets a predicate used to determine whether the property should be serialized. - - A predicate used to determine whether the property should be serialized. - - - - Gets or sets an action used to set whether the property has been deserialized. - - An action used to set whether the property has been deserialized. - - - - Gets or sets the converter used when serializing the property's collection items. - - The collection's items converter. - - - - Gets or sets whether this property's collection items are serialized as a reference. - - Whether this property's collection items are serialized as a reference. - - - - Gets or sets the the type name handling used when serializing the property's collection items. - - The collection's items type name handling. - - - - Gets or sets the the reference loop handling used when serializing the property's collection items. - - The collection's items reference loop handling. - - - - A collection of objects. - - - - - Initializes a new instance of the class. - - The type. - - - - When implemented in a derived class, extracts the key from the specified element. - - The element from which to extract the key. - The key for the specified element. - - - - Adds a object. - - The property to add to the collection. - - - - Gets the closest matching object. - First attempts to get an exact case match of propertyName and then - a case insensitive match. - - Name of the property. - A matching property if found. - - - - Gets a property by property name. - - The name of the property to get. - Type property name string comparison. - A matching property if found. - - - - Contract details for a used by the . - - - - - Initializes a new instance of the class. - - The underlying type for the contract. - - - - Represents a method that constructs an object. - - - - - When applied to a method, specifies that the method is called when an error occurs serializing an object. - - - - - Get and set values for a using reflection. - - - - - Initializes a new instance of the class. - - The member info. - - - - Sets the value. - - The target to set the value on. - The value to set on the target. - - - - Gets the value. - - The target to get the value from. - The value. - - - - Specifies type name handling options for the . - - - - - Do not include the .NET type name when serializing types. - - - - - Include the .NET type name when serializing into a JSON object structure. - - - - - Include the .NET type name when serializing into a JSON array structure. - - - - - Always include the .NET type name when serializing. - - - - - Include the .NET type name when the type of the object being serialized is not the same as its declared type. - - - - - Determines whether the collection is null or empty. - - The collection. - - true if the collection is null or empty; otherwise, false. - - - - - Adds the elements of the specified collection to the specified generic IList. - - The list to add to. - The collection of elements to add. - - - - Returns the index of the first occurrence in a sequence by using a specified IEqualityComparer. - - The type of the elements of source. - A sequence in which to locate a value. - The object to locate in the sequence - An equality comparer to compare values. - The zero-based index of the first occurrence of value within the entire sequence, if found; otherwise, –1. - - - - Converts the value to the specified type. - - The value to convert. - The culture to use when converting. - The type to convert the value to. - The converted type. - - - - Converts the value to the specified type. - - The value to convert. - The culture to use when converting. - The type to convert the value to. - The converted value if the conversion was successful or the default value of T if it failed. - - true if initialValue was converted successfully; otherwise, false. - - - - - Converts the value to the specified type. If the value is unable to be converted, the - value is checked whether it assignable to the specified type. - - The value to convert. - The culture to use when converting. - The type to convert or cast the value to. - - The converted type. If conversion was unsuccessful, the initial value - is returned if assignable to the target type. - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic that returns a result - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic, but uses one of the arguments for - the result. - - - - - Helper method for generating a MetaObject which calls a - specific method on Dynamic, but uses one of the arguments for - the result. - - - - - Returns a Restrictions object which includes our current restrictions merged - with a restriction limiting our type - - - - - Gets a dictionary of the names and values of an Enum type. - - - - - - Gets a dictionary of the names and values of an Enum type. - - The enum type to get names and values for. - - - - - Gets the type of the typed collection's items. - - The type. - The type of the typed collection's items. - - - - Gets the member's underlying type. - - The member. - The underlying type of the member. - - - - Determines whether the member is an indexed property. - - The member. - - true if the member is an indexed property; otherwise, false. - - - - - Determines whether the property is an indexed property. - - The property. - - true if the property is an indexed property; otherwise, false. - - - - - Gets the member's value on the object. - - The member. - The target object. - The member's value on the object. - - - - Sets the member's value on the target object. - - The member. - The target. - The value. - - - - Determines whether the specified MemberInfo can be read. - - The MemberInfo to determine whether can be read. - /// if set to true then allow the member to be gotten non-publicly. - - true if the specified MemberInfo can be read; otherwise, false. - - - - - Determines whether the specified MemberInfo can be set. - - The MemberInfo to determine whether can be set. - if set to true then allow the member to be set non-publicly. - if set to true then allow the member to be set if read-only. - - true if the specified MemberInfo can be set; otherwise, false. - - - - - Builds a string. Unlike StringBuilder this class lets you reuse it's internal buffer. - - - - - Determines whether the string is all white space. Empty string will return false. - - The string to test whether it is all white space. - - true if the string is all white space; otherwise, false. - - - - - Nulls an empty string. - - The string. - Null if the string was null, otherwise the string unchanged. - - - - Specifies the state of the . - - - - - An exception has been thrown, which has left the in an invalid state. - You may call the method to put the in the Closed state. - Any other method calls results in an being thrown. - - - - - The method has been called. - - - - - An object is being written. - - - - - A array is being written. - - - - - A constructor is being written. - - - - - A property is being written. - - - - - A write method has not been called. - - - - - A single batch operation for a document DELETE - - - - - Translate this instance to a Json object. - - - - - Gets or sets the key. - - The key. - - - - Gets the method. - - The method. - - - - Gets or sets the etag. - - The etag. - - - - Gets or sets the transaction information. - - The transaction information. - - - - Gets or sets the metadata. - - The metadata. - - - - A single batch operation for a document PATCH - - - - - Translate this instance to a Json object. - - - - - Gets or sets the patches applied to this document - - The patches. - - - - Gets the key. - - The key. - - - - Gets the method. - - The method. - - - - Gets or sets the etag. - - The etag. - - - - Gets the transaction information. - - The transaction information. - - - - Gets or sets the metadata. - - The metadata. - - - - A single batch operation for a document PUT - - - - - Translate this instance to a Json object. - - - - - Gets or sets the key. - - The key. - - - - Gets the method. - - The method. - - - - Gets or sets the etag. - - The etag. - - - - Gets or sets the document. - - The document. - - - - Gets the transaction information. - - The transaction information. - - - - Gets or sets the metadata. - - The metadata. - - - - When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device. - - An I/O error occurs. 2 - - - - When overridden in a derived class, sets the position within the current stream. - - - The new position within the current stream. - - A byte offset relative to the parameter. A value of type indicating the reference point used to obtain the new position. An I/O error occurs. The stream does not support seeking, such as if the stream is constructed from a pipe or console output. Methods were called after the stream was closed. 1 - - - - When overridden in a derived class, sets the length of the current stream. - - The desired length of the current stream in bytes. An I/O error occurs. The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. Methods were called after the stream was closed. 2 - - - - When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. - - - The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. - - An array of bytes. When this method returns, the buffer contains the specified byte array with the values between and ( + - 1) replaced by the bytes read from the current source. The zero-based byte offset in at which to begin storing the data read from the current stream. The maximum number of bytes to be read from the current stream. The sum of and is larger than the buffer length. is null. or is negative. An I/O error occurs. The stream does not support reading. Methods were called after the stream was closed. 1 - - - - When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. - - An array of bytes. This method copies bytes from to the current stream. The zero-based byte offset in at which to begin copying bytes to the current stream. The number of bytes to be written to the current stream. The sum of and is greater than the buffer length. is null. or is negative. An I/O error occurs. The stream does not support writing. Methods were called after the stream was closed. 1 - - - - When overridden in a derived class, gets a value indicating whether the current stream supports reading. - - - true if the stream supports reading; otherwise, false. - - 1 - - - - When overridden in a derived class, gets a value indicating whether the current stream supports seeking. - - - true if the stream supports seeking; otherwise, false. - - 1 - - - - When overridden in a derived class, gets a value indicating whether the current stream supports writing. - - - true if the stream supports writing; otherwise, false. - - 1 - - - - When overridden in a derived class, gets the length in bytes of the stream. - - - A long value representing the length of the stream in bytes. - - A class derived from Stream does not support seeking. Methods were called after the stream was closed. 1 - - - - When overridden in a derived class, gets or sets the position within the current stream. - - - The current position within the stream. - - An I/O error occurs. The stream does not support seeking. Methods were called after the stream was closed. 1 - - - - Extensions for web requests - - - - - Gets the response stream with HTTP decompression. - - The response. - - - - - A Advanced patch request for a specified document (using JavaScript) - - - - - The JavaScript function to use the patch a document - - The type. - - - - Attachment data and metadata - - - - - Gets or sets the data. - - The data. - - - - The size of the attachment - - - - - Gets or sets the metadata. - - The metadata. - - - - Gets or sets the etag. - - The etag. - - - - The attachment name - - - - - The result of a single operation inside a batch - - - - - Gets or sets the etag generated by the etag (if applicable) - - The etag. - - - - Gets or sets the method used for the operation (PUT,DELETE,PATCH). - - The method. - - - - Gets or sets the key of the document - - The key. - - - - Gets or sets the updated metadata. - - The metadata. - - - - Parse the connection string option - - - - - A list of results for the facet. One entry for each term/range as specified in the facet setup document. - - - - - The facet terms and hits up to a limit of MaxResults items (as specified in the facet setup document), sorted - in TermSortMode order (as indiciated in the facet setup document). - - - - - A list of remaining terms in term sort order for terms that are outside of the MaxResults count. - - - - - The number of remaining terms outside of those covered by the Values terms. - - - - - The number of remaining hits outside of those covered by the Values terms. - - - - - Interface that is used purely internally - - - - - Gets or sets the metadata for the document - - The metadata. - - - - Gets or sets the key for the document - - The key. - - - - Gets or sets a value indicating whether this document is non authoritative (modified by uncommitted transaction). - - - - - Gets or sets the etag. - - The etag. - - - - Gets or sets the last modified date for the document - - The last modified. - - - - A document representation: - * Data / Projection - * Etag - * Metadata - - - - - Create a new instance of JsonDocument - - - - - How much space this document takes on disk - Only relevant during indexing phases, and not available on the client - - - - - Translate the json document to a - - - - - - Gets or sets the document data as json. - - The data as json. - - - - Gets or sets the metadata for the document - - The metadata. - - - - Gets or sets the key for the document - - The key. - - - - Gets or sets a value indicating whether this document is non authoritative (modified by uncommitted transaction). - - - - - Gets or sets the etag. - - The etag. - - - - Gets or sets the last modified date for the document - - The last modified. - - - - The ranking of this result in the current query - - - - - A document representation: - * Etag - * Metadata - - - - - Gets or sets the metadata for the document - - The metadata. - - - - Gets or sets the key for the document - - The key. - - - - Gets or sets a value indicating whether this document is non authoritative (modified by uncommitted transaction). - - - - - Gets or sets the etag. - - The etag. - - - - Gets or sets the last modified date for the document - - The last modified. - - - - Ignore terms with less than this frequency in the source doc. Default is 2. - - - - - Ignore words which do not occur in at least this many documents. Default is 5. - - - - - Boost terms in query based on score. Default is false. - - - - - Ignore words less than this length or if 0 then this has no effect. Default is 0. - - - - - Ignore words greater than this length or if 0 then this has no effect. Default is 0. - - - - - Return a Query with no more than this many terms. Default is 25. - - - - - The maximum number of tokens to parse in each example doc field that is not stored with TermVector support. Default is 5000. - - - - - The document id containing the custom stop words - - - - - The fields to compare - - - - - The document id to use as the basis for comparison - - - - - The name of the index to use for this operation - - - - - Values for the the mapping group fields to use as the basis for comparison - - - - - Represent a result which include both document results and included documents - - - - - Initializes a new instance of the class. - - - - - Gets or sets the document results. - - - - - Gets or sets the included documents - - - - - Patch command options - - - - - Set a property - - - - - Unset (remove) a property - - - - - Add an item to an array - - - - - Insert an item to an array at a specified position - - - - - Remove an item from an array at a specified position - - - - - Modify a property value by providing a nested set of patch operation - - - - - Increment a property by a specified value - - - - - Copy a property value to another property - - - - - Rename a property - - - - - A patch request for a specified document - - - - - Translate this instance to json - - - - - Create an instance from a json object - - The patch request json. - - - - Gets or sets the type of the operation - - The type. - - - - Gets or sets the previous value, which is compared against the current value to verify a - change isn't overwriting new values. - If the value is null, the operation is always successful - - The previous value. - - - - Gets or sets the value. - - The value. - - - - Gets or sets the nested operations to perform. This is only valid when the is . - - The nested. - - - - Gets or sets the name. - - The name. - - - - Gets or sets the position. - - The position. - - - - Get or sets AllPositions. Set this property to true if you want to modify all items in an collection. - - AllPositions true/false - - - - The result of a patch operation - - - - - The document does not exists, operation was a no-op - - - - - Document was properly patched - - - - - The result of a PUT operation - - - - - Gets or sets the key. - - The key. - - - - Gets or sets the generated Etag for the PUT operation - - The Etag. - - - - Represent a field sort options - - - - - Initializes a new instance of the class. - - The field with potential prefix. - - - - Gets or sets the field. - - The field. - - - - Gets or sets a value indicating whether this is descending. - - true if descending; otherwise, false. - - - - A query using spatial filtering - - - - - All the information required to query a Raven index - - - - - Initializes a new instance of the class. - - - - - Gets the index query URL. - - The operation URL. - The index. - Name of the operation. - - - - - Gets the custom query string variables. - - - - - - Gets or sets the query. - - The query. - - - - Gets or sets the total size. - - The total size. - - - - Gets or sets the start of records to read. - - The start. - - - - Gets or sets the size of the page. - - The size of the page. - - - - The aggregation operation for this query - - - - - The fields to group the query by - - - - - Gets or sets the fields to fetch. - - The fields to fetch. - - - - Gets or sets the fields to sort by - - The sorted fields. - - - - Gets or sets the cutoff date - - The cutoff. - - - - Gets or sets the cutoff etag - - - Cutoff etag is used to check if the index has already process a document with the given - etag. Unlike Cutoff, which uses dates and is susceptible to clock syncronization issues between - machines, cutoff etag doesn't rely on both the server and client having a syncronized clock and - can work without it. - However, when used to query map/reduce indexes, it does NOT guarantee that the document that this - etag belong to is actually considered for the results. - What it does it guarantee that the document has been mapped, but not that the mapped values has been reduce. - Since map/reduce queries, by their nature,tend to be far less susceptible to issues with staleness, this is - considered to be an acceptable tradeoff. - If you need absolute no staleness with a map/reduce index, you will need to ensure syncronized clocks and - use the Cutoff date option, instead. - - - - - The default field to use when querying directly on the Lucene query - - - - - Changes the default operator mode we use for queries. - When set to Or a query such as 'Name:John Age:18' will be interpreted as: - Name:John OR Age:18 - When set to And the queyr will be interpreted as: - Name:John AND Age:18 - - - - - If set to true, RavenDB won't execute the transform results function - returning just the raw results instead - - - - - Gets or sets the number of skipped results. - - The skipped results. - - - - Whatever we should get the raw index queries - - - - - Initializes a new instance of the class. - - The query. - - - - Initializes a new instance of the class. - - - - - Gets the custom query string variables. - - - - - - String distance algorithms used in suggestion query - - - - - Default, equivalent to Levenshtein - - - - - JaroWinkler distance algorithm - - - - - Levenshtein distance algorithm (default) - - - - - NGram distance algorithm - - - - - - - - - - Create a new instance of - - - - - Gets or sets the term. The term is what the user likely entered, and will used as the basis of the suggestions. - - The term. - - - - Gets or sets the field to be used in conjunction with the index. - - The field. - - - - Gets or sets the number of suggestions to return. - - The number of suggestions. - - - - Gets or sets the string distance algorithm. - - The distance. - - - - Gets or sets the accuracy. - - The accuracy. - - - - Whatever to return the terms in order of popularity - - - - - The result of the suggestion query - - - - - The suggestions based on the term and dictionary - - The suggestions. - - - - Transaction information that identify the transaction id and timeout - - - - - Gets or sets the id. - - The id. - - - - Gets or sets the timeout. - - The timeout. - - - - Extension methods to handle common scenarios - - - - - Recursively examines the inner exceptions of an and returns a single child exception. - - - If any of the aggregated exceptions have more than one inner exception, null is returned. - - - - - Extracts a portion of an exception for a user friendly display - - The exception. - The primary portion of the exception message. - - - - This exception is raised when a concurrency conflict is encountered - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Gets or sets the expected E tag. - - The expected E tag. - - - - Gets or sets the actual E tag. - - The actual E tag. - - - - A helper class that translate between Disposable and Action - - - - - Initializes a new instance of the class. - - The action. - - - - Execute the relevant actions - - - - - Extensions for Linq expressions - - - - - Turn an expression like x=< x.User.Name to "User.Name" - - - - - Json extensions - - - - - Convert a byte array to a RavenJObject - - - - - Convert a byte array to a RavenJObject - - - - - Convert a RavenJToken to a byte array - - - - - Deserialize a to an instance of - - - - - Deserialize a to an instance of - - - - - Deserialize a to an instance of - - - - - 'r' format is used on the in metadata, because it's delivered as http header. - - - - - Does not filter the query, merely sort by the distance - - - - - Converts the value. - - The type to convert the value to. - A cast as a of . - A converted value. - - - - Converts the value. - - The source collection type. - The type to convert the value to. - A cast as a of . - A converted value. - - - - Returns a collection of converted child values of every object in the source collection. - - The type to convert the values to. - An of that contains the source collection. - An that contains the converted values of every node in the source collection. - - - - Returns a collection of child values of every object in the source collection with the given key. - - An of that contains the source collection. - The token key. - An of that contains the values of every node in the source collection with the given key. - - - - Returns a collection of child values of every object in the source collection. - - An of that contains the source collection. - An of that contains the values of every node in the source collection. - - - - Represents a JSON array. - - - - - Represents an abstract JSON token. - - - - - Clones this object - - A cloned RavenJToken - - - - Creates a from an object. - - The object that will be used to create . - A with the value of the specified object - - - - Creates a from an object using the specified . - - The object that will be used to create . - The that will be used when reading the object. - A with the value of the specified object - - - - Returns the indented JSON for this token. - - - The indented JSON for this token. - - - - - Returns the JSON for this token using the given formatting and converters. - - Indicates how the output is formatted. - A collection of which will be used when writing the token. - The JSON for this token using the given formatting and converters. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Creates a from a . - - An positioned at the token to read into this . - - An that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Creates a from a . - - An positioned at the token to read into this . - - An that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Gets the with the specified key converted to the specified type. - - The type to convert the token to. - The token key. - The converted token value. - - - - Compares the values of two tokens, including the values of all descendant tokens. - - The first to compare. - The second to compare. - true if the tokens are equal; otherwise false. - - - - Selects the token that matches the object path. - - - The object path from the current to the - to be returned. This must be a string of property names or array indexes separated - by periods, such as Tables[0].DefaultView[0].Price in C# or - Tables(0).DefaultView(0).Price in Visual Basic. - - The that matches the object path or a null reference if no matching token is found. - - - - Selects the token that matches the object path. - - - The object path from the current to the - to be returned. This must be a string of property names or array indexes separated - by periods, such as Tables[0].DefaultView[0].Price in C# or - Tables(0).DefaultView(0).Price in Visual Basic. - - A flag to indicate whether an error should be thrown if no token is found. - The that matches the object path. - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - - A containing the child values of this , in document order. - - - - - Returns a collection of the child values of this token, in document order. - - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Gets the node type for this . - - The type. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - 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 . - - - - Gets the node type for this . - - The type. - - - - Gets or sets the at the specified index. - - - - - - Represents a JSON object. - - - - - Initializes a new instance of the class. - - - - - Gets the with the specified key converted to the specified type. - - The type to convert the token to. - The token key. - The converted token value. - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the node type for this . - - The type. - - - - Gets or sets the with the specified property name. - - - - - - Compares tokens to determine whether they are equal. - - - - - Determines whether the specified objects are equal. - - The first object of type to compare. - The second object of type to compare. - - true if the specified objects are equal; otherwise, false. - - - - - Returns a hash code for the specified object. - - The for which a hash code is to be returned. - A hash code for the specified object. - The type of is a reference type and is null. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. - - - - - Initializes a new instance of the class. - - The token to read from. - - - - Reads the next JSON token from the stream as a . - - A or a null reference if the next JSON token is null. This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream as a . - - A . This method will return null at the end of an array. - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. - - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Writes the beginning of a Json array. - - - - - Writes the end. - - The token. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Gets the token being writen. - - The token being writen. - - - - Represents a value in JSON (string, integer, date, etc). - - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - - The parameter is null. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format provider. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - The format provider. - - A that represents this instance. - - - - - Gets the node type for this . - - The type. - - - - Gets or sets the underlying token value. - - The underlying token value. - - - - Gets the length. - - The length. - - - - Writes the JSON representation of the object. - - The to write to.The value.The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from.Type of the object.The existing value of object being read.The calling serializer. - - The object value. - - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Convert a MultiDimensional Array to a json string - - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Read in all the values from the Json reader and populate a nested ArrayList - - JsonReader to use - JsonSerializer to use - The element type - - - - - Retrieve a list of lengths for each rank represented - - The list to process - - - - - Assign values from the ArrayList into their respective place in the multidimensional array - - Array that will be receiving the newValues - A list of the lengths of each rank - A list of the current index settings to be used for assignments - Rank currently being processed - New Values that will be used in the assignment - - - - Write a rank of an array in Json format - - JsonWriter in use - JsonSerializer in use - Array to be written - Current rank "depth" - List of indexes currently being used to read from the array - - - - Extensions for handling metadata - - - - - Filters the headers from unwanted headers - - The self. - public static RavenJObject FilterHeaders(this System.Collections.Specialized.NameValueCollection self, bool isServerDocument) - - - - Filters the headers from unwanted headers - - The self. - public static RavenJObject FilterHeaders(this System.Collections.Specialized.NameValueCollection self, bool isServerDocument) - - - - A reference that can be used with lambda expression - to pass a value out. - - - - - Gets or sets the value. - - The value. - - - - Extensions for working with streams - - - - - Reads the entire request buffer to memory and return it as a byte array. - - The stream to read. - The returned byte array. - - - - Allocates a byte array and reads an entire block from the stream - - - - - Reads an entire block from the stream - - - - - Options for indexing a field - - - - - Do not index the field value. This field can thus not be searched, but one can still access its contents provided it is stored. - - - - - Index the tokens produced by running the field's value through an Analyzer. This is useful for common text. - - - - - Index the field's value without using an Analyzer, so it can be searched. As no analyzer is used the - value will be stored as a single term. This is useful for unique Ids like product numbers. - - - - - Index this field using the default internal analyzer: LowerCaseKeywordAnalyzer - - - - - Specifies whether and how a field should be stored. - - - - - Store the original field value in the index. This is useful for short texts like a document's title which should be displayed with the results. - The value is stored in its original form, i.e. no analyzer is used before it is stored. - - - - - Do not store the field value in the index. - - - - - A definition of a RavenIndex - - - - - Initializes a new instance of the class. - - - - - Equals the specified other. - - The other. - - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Provide a cached version of the index hash code, which is used when generating - the index etag. - It isn't really useful for anything else, in particular, we cache that because - we want to avoid calculating the cost of doing this over and over again on each - query. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Remove the default values that we don't actually need - - - - - Get or set the name of the index - - - - - Gets or sets the map function, if there is only one - - - This property only exists for backward compatability purposes - - - - - All the map functions for this index - - - - - Gets or sets the reduce function - - The reduce. - - - - Gets or sets the translator function - - - - - Gets a value indicating whether this instance is map reduce index definition - - - true if this instance is map reduce; otherwise, false. - - - - - Returns a boolean value indicating whether this IndexDefinition is of a temporary index - - - - - Gets or sets the stores options - - The stores. - - - - Gets or sets the indexing options - - The indexes. - - - - Gets or sets the sort options. - - The sort options. - - - - Gets or sets the analyzers options - - The analyzers. - - - - The fields that are queryable in the index - - - - - Helper function for numeric to indexed string and vice versa - - - - - Translate a number to an indexable string - - - - - Translate a number to an indexable string - - - - - Translate a number to an indexable string - - - - - Translate a number to an indexable string - - - - - Translate an indexable string to a number - - - - - Helper class for working with dynamic values completely dynamically - - - - - Gets the value dynamically. - - The entity. - Name of the dynamic member. - - - - - Convert a dynamic variable to a json value and vice versa - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Convert an enum to a json string - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Extensions for RavenJToken - - - - Provides support for converting dates to strings and vice-versa. - The strings are structured so that lexicographic sorting orders - them by date, which makes them suitable for use as field values - and search terms. - -

    This class also helps you to limit the resolution of your dates. Do not - save dates with a finer resolution than you really need, as then - RangeQuery and PrefixQuery will require more memory and become slower. - -

    Compared to {@link DateField} the strings generated by the methods - in this class take slightly more space, unless your selected resolution - is set to Resolution.DAY or lower. - -

    - Another approach is {@link NumericUtils}, which provides - a sortable binary representation (prefix encoded) of numeric values, which - date/time are. - For indexing a {@link Date} or {@link Calendar}, just get the Unix timestamp as - long using {@link Date#getTime} or {@link Calendar#getTimeInMillis} and - index this as a numeric value with {@link NumericField} - and use {@link NumericRangeQuery} to query it. -

    -
    - - Converts a Date to a string suitable for indexing. - - - the date to be converted - - the desired resolution, see - {@link #Round(Date, DateTools.Resolution)} - - a string in format yyyyMMddHHmmssSSS or shorter, - depending on resolution; using GMT as timezone - - - - Converts a millisecond time to a string suitable for indexing. - - - the date expressed as milliseconds since January 1, 1970, 00:00:00 GMT - - the desired resolution, see - {@link #Round(long, DateTools.Resolution)} - - a string in format yyyyMMddHHmmssSSS or shorter, - depending on resolution; using GMT as timezone - - - - Converts a string produced by timeToString or - DateToString back to a time, represented as the - number of milliseconds since January 1, 1970, 00:00:00 GMT. - - - the date string to be converted - - the number of milliseconds since January 1, 1970, 00:00:00 GMT - - ParseException if dateString is not in the - expected format - - - - Converts a string produced by timeToString or - DateToString back to a time, represented as a - Date object. - - - the date string to be converted - - the parsed time as a Date object - - ParseException if dateString is not in the - expected format - - - - - Limit a date's resolution. For example, the date 2004-09-21 13:50:11 - will be changed to 2004-09-01 00:00:00 when using - Resolution.MONTH. - - The date. - The desired resolution of the date to be returned - - the date with all values more precise than resolution - set to 0 or 1 - - - - Limit a date's resolution. For example, the date 1095767411000 - (which represents 2004-09-21 13:50:11) will be changed to - 1093989600000 (2004-09-01 00:00:00) when using - Resolution.MONTH. - - - The time in milliseconds (not ticks). - The desired resolution of the date to be returned - - the date with all values more precise than resolution - set to 0 or 1, expressed as milliseconds since January 1, 1970, 00:00:00 GMT - - - - Specifies the time granularity. - - - - Resolution by year - - - - - Resolution by month - - - - - Resolution by day - - - - - Resolution by hour - - - - - Resolution by minute - - - - - Resolution by second - - - - - Resolution by millisecond - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets the inner json object - - The inner. - - - - A dynamic implementation on top of - - - - - Returns a that represents the current . - - - A that represents the current . - - 2 - - - - Determines whether the specified is equal to the current . - - - true if the specified is equal to the current ; otherwise, false. - - The to compare with the current . 2 - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - 2 - - - - Initializes a new instance of the class. - - The obj. - - - - Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. - - Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. - The result of the get operation. For example, if the method is called for a property, you can assign the property value to . - - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) - - - - - Provides the implementation for operations that get a value by index. Classes derived from the class can override this method to specify dynamic behavior for indexing operations. - - - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) - - - - - Gets the value for the specified name - - The name. - - - - - Gets the document id. - - - - - - Gets the inner json object - - The inner. - - - - The result of a query - - - - - Initializes a new instance of the class. - - - - - Ensures that the query results can be used in snapshots - - - - - Creates a snapshot of the query results - - - - - Gets or sets the document resulting from this query. - - The results. - - - - Gets or sets the document included in the result. - - The includes. - - - - Gets or sets a value indicating whether the index is stale. - - true if the index is stale; otherwise, false. - - - - The last time the index was updated. - This can be used to determine the freshness of the data. - - - - - Gets or sets the total results for this query - - The total results. - - - - Gets or sets the skipped results (duplicate documents); - - The skipped results. - - - - The index used to answer this query - - - - - The last etag indexed by the index. - This can be used to determine whatever the results can be cached. - - - - - The ETag value for this index current state, which include what we docs we indexed, - what document were deleted, etc. - - - - - Gets or sets a value indicating whether any of the documents returned by this query - are non authoritative (modified by uncommitted transaction). - - - - - The timestamp of the last time the index was queried - - - - - The sort options to use for a particular field - - - - - No sort options - - - - Sort using term values as Strings. Sort values are String and lower - values are at the front. - - - - Sort using term values as encoded Integers. Sort values are Integer and - lower values are at the front. - - - - Sort using term values as encoded Floats. Sort values are Float and - lower values are at the front. - - - - Sort using term values as encoded Longs. Sort values are Long and - lower values are at the front. - - - - Sort using term values as encoded Doubles. Sort values are Double and - lower values are at the front. - - - - Sort using term values as encoded Shorts. Sort values are Short and - lower values are at the front. - - - - Sort using a custom Comparator. Sort values are any Comparable and - sorting is done according to natural order. - - - - Sort using term values as encoded Bytes. Sort values are Byte and - lower values are at the front. - - - - Sort using term values as Strings, but comparing by - value (using String.compareTo) for all comparisons. - This is typically slower than {@link #STRING}, which - uses ordinals to do the sorting. - - - - - Data class for replication destination documents - - - - - The name of the connection string specified in the - server configuration file. - Override all other properties of the destination - - - - - Gets or sets the URL of the replication destination - - The URL. - - - - Gets or sets if the replication will use ConnectionString or Url - - - - - The replication server username to use - - - - - The replication server password to use - - - - - The replication server domain to use - - - - - The replication server api key to use - - - - - The database to use - - - - - How should the replication bundle behave with respect to replicated documents. - If a document was replicated to us from another node, should we replicate that to - this destination, or should we replicate only documents that were locally modified. - - - - - Options for how to replicate replicated documents - - - - - Don't replicate replicated documents - - - - - Replicate replicated documents - - - - - This class represent the list of replication destinations for the server - - - - - Initializes a new instance of the class. - - - - - Gets or sets the list of replication destinations. - - - - - Gets or sets the id. - - The id. - - - - A file to write to when doing an export or read from when doing an import. - - - - - Specify the types to operate on. You can specify more than one type by combining items with the OR parameter. - Default is all items. - Usage example: OperateOnTypes = ItemType.Indexes | ItemType.Documents | ItemType.Attachments. - - - - - The timeout for requests - - - - - The batch size for loading to ravendb - - - - - Helper class that provide a way to escape query terms - - - - - Escapes Lucene operators and quotes phrases - - - - - Escapes Lucene operators and quotes phrases - - escaped term - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Escaping%20Special%20Characters - - -
    -
    diff --git a/lib/RavenDB/RavenDB.Client.992/Raven.Abstractions.dll b/lib/RavenDB/RavenDB.Client.992/Raven.Abstractions.dll deleted file mode 100644 index 8e6f261bf4e..00000000000 Binary files a/lib/RavenDB/RavenDB.Client.992/Raven.Abstractions.dll and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Client.992/Raven.Abstractions.pdb b/lib/RavenDB/RavenDB.Client.992/Raven.Abstractions.pdb deleted file mode 100644 index babb7c7c75f..00000000000 Binary files a/lib/RavenDB/RavenDB.Client.992/Raven.Abstractions.pdb and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Client.992/Raven.Client.Lightweight.XML b/lib/RavenDB/RavenDB.Client.992/Raven.Client.Lightweight.XML deleted file mode 100644 index bf812ecde29..00000000000 --- a/lib/RavenDB/RavenDB.Client.992/Raven.Client.Lightweight.XML +++ /dev/null @@ -1,9546 +0,0 @@ - - - - Raven.Client.Lightweight - - - - - Access the database commands in async fashion - - - - - An async database command operations - - - - - Interface for getting profiling information about the actions of the system - within a given context, usually the context is database commands or async database commands - - - - - The profiling information - - - - - Begins an async get operation - - The key. - - - - Begins an async multi get operation - - - - - Begins an async get operation for documents - - Paging start - Size of the page. - Load just the document metadata - - This is primarily useful for administration of a database - - - - - Begins the async query. - - The index. - The query. - The include paths - Load just the document metadata - - - - Begins the async batch operation - - The command data. - - - - Returns a list of suggestions based on the specified suggestion query. - - The index to query for suggestions - The suggestion query. - - - - Gets the index names from the server asynchronously - - Paging start - Size of the page. - - - - Gets the indexes from the server asynchronously - - Paging start - Size of the page. - - - - Resets the specified index asynchronously - - The name. - - - - Gets the index definition for the specified name asynchronously - - The name. - - - - Puts the index definition for the specified name asynchronously - - The name. - The index def. - Should overwrite index - - - - Deletes the index definition for the specified name asynchronously - - The name. - - - - Perform a set based deletes using the specified index. - - Name of the index. - The query to delete. - if set to true allow the operation while the index is stale. - - - - Deletes the document for the specified id asynchronously - - The id. - - - - Puts the document with the specified key in the database - - The key. - The etag. - The document. - The metadata. - - - - Create a new instance of that will interacts - with the specified database - - - - - Create a new instance of that will interacts - with the default database - - - - - Returns a new using the specified credentials - - The credentials for session. - - - - Retrieve the statistics for the database asynchronously - - - - - Gets the list of databases from the server asynchronously - - - - - Puts the attachment with the specified key asynchronously - - The key. - The etag. - The data. - The metadata. - - - - Gets the attachment by the specified key asynchronously - - The key. - - - - - Deletes the attachment with the specified key asynchronously - - The key. - The etag. - - - - Get the possible terms for the specified field in the index asynchronously - You can page through the results by use fromValue parameter as the - starting point for the next query - - - - - - Ensures that the silverlight startup tasks have run - - - - - Disable all caching within the given scope - - - - - Perform a single POST request containing multiple nested GET requests - - - - - Using the given Index, calculate the facets as per the specified doc - - - - - Force the database commands to read directly from the master, unless there has been a failover. - - - - - Gets or sets the operations headers. - - The operations headers. - - - - Initializes a new instance of the class. - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Returns a new using the specified credentials - - The credentials for session. - - - - Gets the index names from the server asynchronously - - Paging start - Size of the page. - - - - Gets the indexes from the server asynchronously - - Paging start - Size of the page. - - - - Resets the specified index asynchronously - - The name. - - - - Gets the index definition for the specified name asynchronously - - The name. - - - - Puts the index definition for the specified name asynchronously - - The name. - The index def. - Should overwrite index - - - - Puts the index definition for the specified name asynchronously with url - - The name. - The index def. - Should overwrite index - The server's url - - - - Deletes the index definition for the specified name asynchronously - - The name. - - - - Deletes the document for the specified id asynchronously - - The id. - - - - Puts the document with the specified key in the database - - The key. - The etag. - The document. - The metadata. - - - - Create a new instance of that will interacts - with the specified database - - - - - Create a new instance of that will interact - with the root database. Useful if the database has works against a tenant database. - - - - - Begins an async get operation - - The key. - - - - - Begins an async multi get operation - - - - - Begins an async get operation for documents - - - This is primarily useful for administration of a database - - - - - Using the given Index, calculate the facets as per the specified doc - - - - - Perform a single POST request containing multiple nested GET requests - - - - - Begins the async query. - - The index. - The query. - The include paths - Load just the document metadata - - - - Returns a list of suggestions based on the specified suggestion query. - - The index to query for suggestions - The suggestion query. - - - - Begins the async batch operation - - The command data. - - - - - Begins retrieving the statistics for the database - - - - - - Gets the list of databases from the server asynchronously - - - - - Puts the attachment with the specified key asynchronously - - The key. - The etag. - The data. - The metadata. - - - - Gets the attachment by the specified key asynchronously - - The key. - - - - - Deletes the attachment with the specified key asynchronously - - The key. - The etag. - - - - Disable all caching within the given scope - - - - - Ensures that the silverlight startup tasks have run - - - - - Get the possible terms for the specified field in the index asynchronously - You can page through the results by use fromValue parameter as the - starting point for the next query - - - - - - Force the database commands to read directly from the master, unless there has been a failover. - - - - - Gets or sets the operations headers. - - The operations headers. - - - - The profiling information - - - - - Notify when the failover status changed - - - - - Adds the operation headers. - - The operations headers. - - - - Adds the operation headers. - - The operations headers. - - - - A representation of an HTTP json request to the RavenDB server - - - - - Begins the read response string. - - - - - Reads the response string. - - - - - - Adds the operation headers. - - The operations headers. - - - - The request duration - - - - - Writes the specified data. - - The data. - - - - Begins the write operation - - The byte array. - The callback. - The state. - - - - - Ends the write operation. - - The result. - - - - Gets or sets the response headers. - - The response headers. - - - - Gets or sets the response status code. - - The response status code. - - - - Whatever we can skip the server check and directly return the cached result - - - - - The underlying request content type - - - - - Create the HTTP Json Requests to the RavenDB Server - and manages the http cache - - - - - Invoke the LogRequest event - - - - - Creates the HTTP json request. - - - - - Reset the number of cached requests and clear the entire cache - Mostly used for testing - - - - - default ctor - - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - 2 - - - - Disable all caching within the given scope - - - - - Occurs when a json request is created - - - - - Occurs when a json request is completed - - - - - The number of requests that we got 304 for - and were able to handle purely from the cache - - - - - Determine whether to use compression or not - - - - - The aggressive cache duration - - - - - Disable the HTTP caching - - - - - Advanced: Don't set this unless you know what you are doing! - - Enable using basic authentication using http - By default, RavenDB only allows basic authentication over HTTPS, setting this property to true - will instruct RavenDB to make unsecure calls (usually only good for testing / internal networks). - - - - - Expose the set of operations by the RavenDB server - - - - - Retrieves documents for the specified key prefix - - - - - Retrieves the document for the specified key - - The key. - - - - - Retrieves documents with the specified ids, optionally specifying includes to fetch along - - The ids. - The includes. - Load just the document metadata - - - - - Puts the document in the database with the specified key - - The key. - The etag. - The document. - The metadata. - - - - - Deletes the document with the specified key - - The key. - The etag. - - - - Puts a byte array as attachment with the specified key - - The key. - The etag. - The data. - The metadata. - - - - Retrieves the attachment with the specified key - - The key. - - - - - Gets the attachments starting with the specified prefix - - - - - Retrieves the attachment metadata with the specified key, not the actual attachmet - - The key. - - - - - Deletes the attachment with the specified key - - The key. - The etag. - - - - Returns the names of all tenant databases on the RavenDB server - - List of tenant database names - - - - Returns the names of all indexes that exist on the server - - Paging start - Size of the page. - - - - - Resets the specified index - - The name. - - - - Gets the index definition for the specified name - - The name. - - - - Creates an index with the specified name, based on an index definition - - The name. - The index def. - - - - Creates an index with the specified name, based on an index definition - - The name. - The index def. - if set to true [overwrite]. - - - - Creates an index with the specified name, based on an index definition that is created by the supplied - IndexDefinitionBuilder - - The type of the document. - The type of the reduce result. - The name. - The index def. - - - - - Creates an index with the specified name, based on an index definition that is created by the supplied - IndexDefinitionBuilder - - The type of the document. - The type of the reduce result. - The name. - The index def. - if set to true [overwrite]. - - - - Queries the specified index in the Raven flavoured Lucene query syntax - - The index. - The query. - The includes. - - - - Deletes the specified index - - The name. - - - - Executed the specified commands as a single batch - - The command data. - - - - Commits the specified tx id - - The tx id. - - - - Rollbacks the specified tx id - - The tx id. - - - - Promotes the transaction - - From tx id. - - - - - Returns a new using the specified credentials - - The credentials for session. - - - - Perform a set based deletes using the specified index, not allowing the operation - if the index is stale - - Name of the index. - The query to delete. - - - - Perform a set based deletes using the specified index - - Name of the index. - The query to delete. - if set to true [allow stale]. - - - - Perform a set based update using the specified index, not allowing the operation - if the index is stale - - Name of the index. - The query to update. - The patch requests. - - - - Perform a set based update using the specified index, not allowing the operation - if the index is stale - - Name of the index. - The query to update. - The patch request to use (using JavaScript) - - - - Perform a set based update using the specified index - - Name of the index. - The query to update. - The patch requests. - if set to true [allow stale]. - - - - Perform a set based update using the specified index - - Name of the index. - The query to update. - The patch request to use (using JavaScript) - if set to true [allow stale]. - - - - Create a new instance of that will interacts - with the specified database - - - - - Create a new instance of that will interacts - with the default database - - - - - Returns a list of suggestions based on the specified suggestion query - - The index to query for suggestions - The suggestion query. - - - - Get the all terms stored in the index for the specified field - You can page through the results by use fromValue parameter as the - starting point for the next query - - - - - - Using the given Index, calculate the facets as per the specified doc - - - - - Sends a patch request for a specific document, ignoring the document's Etag - - Id of the document to patch - Array of patch requests - - - - Sends a patch request for a specific document, ignoring the document's Etag - - Id of the document to patch - The patch request to use (using JavaScript) - - - - Sends a patch request for a specific document - - Id of the document to patch - Array of patch requests - Require specific Etag [null to ignore] - - - - Sends a patch request for a specific document, ignoring the document's Etag - - Id of the document to patch - The patch request to use (using JavaScript) - Require specific Etag [null to ignore] - - - - Disable all caching within the given scope - - - - - Perform a single POST request containing multiple nested GET requests - - - - - Retrieve the statistics for the database - - - - - Retrieves the document metadata for the specified document key. - - The key. - The document metadata for the specified document, or null if the document does not exist - - - - Get the full URL for the given document key - - - - - Force the database commands to read directly from the master, unless there has been a failover. - - - - - Gets or sets the operations headers - - The operations headers. - - - - Gets a value indicating whether [supports promotable transactions]. - - - true if [supports promotable transactions]; otherwise, false. - - - - - Provide access to the underlying - - - - - The last term that we asked the query to use equals on - - - - - Get the name of the index being queried - - - - - Grant access to the database commands - - - - - Grant access to the async database commands - - - - - The query session - - - - - Extension to json objects - - - - - Deserializes the specified instance to an instance of using the specified - - - - - Deserializes the specified instance to an instance of using the specified - - - - - Convert a lucene data format to and from json values - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Gets a value indicating whether this can write JSON. - - - true if this can write JSON; otherwise, false. - - - - - Manages all profiling activities for a given item - - - - - Register the action as associated with the sender - - - - - Try to get a session matching the specified id. - - - - - The status of the request - - - - - The request was sent to the server - - - - - The request was served directly from the local cache - after checking with the server to see if it was still - up to date - - - - - The request was served from the local cache without - checking with the server and may be out of date - - - - - The server returned an error - - - - - The result of a request made to the server - - - - - Creates a new instance of - - - - - Any additional information that might be required - - - - - When the request completed - - - - - The request status - - - - - The request Url - - - - - How long this request took - - - - - The request method - - - - - The data posted to the server - - - - - The HTTP result for this request - - - - - The result of this request - - - - - Information about a particular session - - - - - Create a new instance of profiling information and provide additional context information - - - - - The requests made by this session - - - - - Uniquely identify the session - - - - - The time when the session was created - - - - - The duration this session was opened - - - - - Create a new instance of this class - - - - - A hook that allows extensions to provide additional information about the created context - - - - - Additional information that is added by extension - - - - - Provide access to the current transaction - - - - - Starts a transaction - - - - - - Starts a transaction with the specified timeout - - The timeout. - - - - - Gets the transaction information for the current transaction - - - - - - Replication and failover management on the client side - - - - - Create a new instance of this class - - - - - Updates the replication information if needed. - - The server client. - - - - Get the current failure count for the url - - - - - Should execute the operation using the specified operation URL - - - - - Determines whether this is the first failure on the specified operation URL. - - The operation URL. - - - - Increments the failure count for the specified operation URL - - The operation URL. - - - - Refreshes the replication information. - Expert use only. - - - - - Resets the failure count for the specified URL - - The operation URL. - - - - Notify when the failover status changed - - - - - Gets the replication destinations. - - The replication destinations. - - - - The event arguments for when the failover status changed - - - - - Whatever that url is now failing - - - - - The url whose failover status changed - - - - - Helper method to do serialization from RavenJObject to JsonDocument - - - - - Translate a collection of RavenJObject to JsonDocuments - - - - - Translate a collection of RavenJObject to JsonDocuments - - - - - Translate a collection of RavenJObject to JsonDocuments - - - - - Translate a result for a query - - - - - Deserialize a request to a JsonDocument - - - - - Deserialize a request to a JsonDocument - - - - - Access the RavenDB operations using HTTP - - - - - Initializes a new instance of the class. - - - - - Gets the document for the specified key. - - The key. - - - - - Gets documents for the specified key prefix - - - - - Execute a GET request against the provided url - and return the result as a json object - - The relative url to the server - - This method respects the replication semantics against the database. - - - - - Allow to query whatever we are in failover mode or not - - - - - - Perform a direct get for a document with the specified key on the specified server URL. - - The server URL. - The key. - - - - - Puts the document with the specified key in the database - - The key. - The etag. - The document. - The metadata. - - - - - Deletes the document with the specified key. - - The key. - The etag. - - - - Puts the attachment with the specified key - - The key. - The etag. - The data. - The metadata. - - - - Gets the attachments starting with the specified prefix - - - - - Gets the attachment by the specified key - - The key. - - - - - Retrieves the attachment metadata with the specified key, not the actual attachmet - - The key. - - - - - Deletes the attachment with the specified key - - The key. - The etag. - - - - Gets the index names from the server - - Paging start - Size of the page. - - - - - Resets the specified index - - The name. - - - - Gets the index definition for the specified name - - The name. - - - - - Puts the index. - - The name. - The definition. - - - - - Puts the index. - - The name. - The definition. - if set to true overwrite the index. - - - - - Puts the index definition for the specified name - - The type of the document. - The type of the reduce result. - The name. - The index def. - - - - - Puts the index for the specified name - - The type of the document. - The type of the reduce result. - The name. - The index def. - if set to true [overwrite]. - - - - - Queries the specified index. - - The index. - The query. - The includes. - - - - - Deletes the index. - - The name. - - - - Gets the results for the specified ids. - - The ids. - The includes. - Load just the document metadata - - - - - Perform a direct get for loading multiple ids in one request - - The ids. - The operation URL. - The includes. - - - - - Executed the specified commands as a single batch - - The command data. - - - - - Commits the specified tx id. - - The tx id. - - - - Rollbacks the specified tx id. - - The tx id. - - - - Promotes the transaction. - - From tx id. - - - - - Returns a new using the specified credentials - - The credentials for session. - - - - - Force the database commands to read directly from the master, unless there has been a failover. - - - - - Create a new instance of that will interacts - with the specified database - - - - - Perform a set based deletes using the specified index. - - Name of the index. - The query to delete. - if set to true [allow stale]. - - - - Perform a set based update using the specified index, not allowing the operation - if the index is stale - - Name of the index. - The query to update. - The patch requests. - - - - Perform a set based update using the specified index, not allowing the operation - if the index is stale - - Name of the index. - The query to update. - The patch request to use (using JavaScript) - - - - Perform a set based update using the specified index. - - Name of the index. - The query to update. - The patch requests. - if set to true [allow stale]. - - - - Perform a set based update using the specified index - - Name of the index. - The query to update. - The patch request to use (using JavaScript) - if set to true [allow stale]. - - - - Perform a set based deletes using the specified index, not allowing the operation - if the index is stale - - Name of the index. - The query to delete. - - - - Returns a list of suggestions based on the specified suggestion query. - - The index to query for suggestions - The suggestion query. - - - - - Retrieve the statistics for the database - - - - - Get the full URL for the given document key - - - - - Check if the document exists for the specified key - - The key. - - - - - Do a direct HEAD request against the server for the specified document - - - - - Perform a single POST request containing multiple nested GET requests - - - - - Get the possible terms for the specified field in the index - You can page through the results by use fromValue parameter as the - starting point for the next query - - - - - - Using the given Index, calculate the facets as per the specified doc - - - - - - - - - Sends a patch request for a specific document, ignoring the document's Etag - - Id of the document to patch - Array of patch requests - - - - Sends a patch request for a specific document, ignoring the document's Etag - - Id of the document to patch - The patch request to use (using JavaScript) - - - - Sends a patch request for a specific document - - Id of the document to patch - Array of patch requests - Require specific Etag [null to ignore] - - - - Sends a patch request for a specific document, ignoring the document's Etag - - Id of the document to patch - The patch request to use (using JavaScript) - Require specific Etag [null to ignore] - - - - Disable all caching within the given scope - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - 2 - - - - Allows an to attempt to free resources and perform other cleanup operations before the is reclaimed by garbage collection. - - - - - Notify when the failover status changed - - - - - Allow access to the replication informer used to determine how we replicate requests - - - - - Gets or sets the operations headers. - - The operations headers. - - - - Gets a value indicating whether [supports promotable transactions]. - - - true if [supports promotable transactions]; otherwise, false. - - - - - Gets the URL. - - The URL. - - - - The profiling information - - - - - Event arguments for the event of creating a - - - - - Gets or sets the web request. - - The request. - - - - Convert strings from / to guids - - - - - Interface for performing type conversions. - We couldn't use the built-in TypeConverter because it is too big an interface for people to build on. - - - - - Returns whether this converter can convert an object of the given type to the type of this converter. - - - true if this converter can perform the conversion; otherwise, false. - - A that represents the type you want to convert from. - - - - Converts the given object to the type of this converter. - - - An that represents the converted value. - - The tag prefix to use - The to convert. - Whatever null is a valid value - The conversion cannot be performed. - - - - Converts the given value object to the specified type, using the specified context and culture information. - - - An that represents the converted value. - - The to convert. - - - - Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context. - - - true if this converter can perform the conversion; otherwise, false. - - A that represents the type you want to convert from. - - - - Converts the given object to the type of this converter, using the specified context and culture information. - - - An that represents the converted value. - - The conversion cannot be performed. - - - - Converts the given value object to the specified type, using the specified context and culture information. - - - An that represents the converted value. - - The to convert. - - - - Convert strings from / to int32 - - - - - Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context. - - - true if this converter can perform the conversion; otherwise, false. - - A that represents the type you want to convert from. - - - - - Converts the given object to the type of this converter, using the specified context and culture information. - - - An that represents the converted value. - - The conversion cannot be performed. - - - - Converts the given value object to the specified type, using the specified context and culture information. - - - An that represents the converted value. - - The to convert. - - - - Convert strings from / to int64 - - - - - Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context. - - - true if this converter can perform the conversion; otherwise, false. - - A that represents the type you want to convert from. - - - - - Converts the given object to the type of this converter, using the specified context and culture information. - - - An that represents the converted value. - - The conversion cannot be performed. - - - - Converts the given value object to the specified type, using the specified context and culture information. - - - An that represents the converted value. - - The to convert. - - - - A query that is executed against sharded instances - - - - - A query against a Raven index - - - - - A query against a Raven index - - - - - Customize the document query - - - - - Instructs the query to wait for non stale results as of the last write made by any session belonging to the - current document store. - This ensures that you'll always get the most relevant results for your scenarios using simple indexes (map only or dynamic queries). - However, when used to query map/reduce indexes, it does NOT guarantee that the document that this etag belong to is actually considered for the results. - - - - - Instructs the query to wait for non stale results as of the last write made by any session belonging to the - current document store. - This ensures that you'll always get the most relevant results for your scenarios using simple indexes (map only or dynamic queries). - However, when used to query map/reduce indexes, it does NOT guarantee that the document that this etag belong to is actually considered for the results. - - - - - Instructs the query to wait for non stale results as of now. - - - - - - Instructs the query to wait for non stale results as of now for the specified timeout. - - The wait timeout. - - - - - Instructs the query to wait for non stale results as of the cutoff date. - - The cut off. - - - - - Instructs the query to wait for non stale results as of the cutoff date for the specified timeout - - The cut off. - The wait timeout. - - - - EXPERT ONLY: Instructs the query to wait for non stale results. - This shouldn't be used outside of unit tests unless you are well aware of the implications - - - - - Includes the specified path in the query, loading the document specified in that path - - The type of the object that holds the id that you want to include. - The path, which is name of the property that holds the id of the object to include. - - - - - Includes the specified path in the query, loading the document specified in that path - - The type of the object that holds the id that you want to include. - The type of the object that you want to include. - The path, which is name of the property that holds the id of the object to include. - - - - - Includes the specified path in the query, loading the document specified in that path - - The path. - - - - EXPERT ONLY: Instructs the query to wait for non stale results for the specified wait timeout. - This shouldn't be used outside of unit tests unless you are well aware of the implications - - The wait timeout. - - - - Filter matches to be inside the specified radius - - - - - Filter matches to be inside the specified radius - - - - - Filter matches based on a given shape - only documents with the shape defined in fieldName that - have a relation rel with the given shapeWKT will be returned - - The name of the field containing the shape to use for filtering - The query shape - Spatial relation to check - - - - - When using spatial queries, instruct the query to sort by the distance from the origin point - - - - - Order the search results randomly - - - - - Order the search results randomly using the specified seed - this is useful if you want to have repeatable random queries - - - - - Execute the transfromation function on the results of this query. - - - - - Mostly used by the linq provider - - - - - Instruct the query to wait for non stale result for the specified wait timeout. - - The wait timeout. - - - - - Gets the fields for projection - - - - - - Order the search results randomly - - - - - Order the search results randomly using the specified seed - this is useful if you want to have repeatable random queries - - - - - Adds an ordering for a specific field to the query - - Name of the field. - if set to true [descending]. - - - - Adds an ordering for a specific field to the query and specifies the type of field for sorting purposes - - Name of the field. - if set to true [descending]. - the type of the field to be sorted. - - - - Includes the specified path in the query, loading the document specified in that path - - The path. - - - - Includes the specified path in the query, loading the document specified in that path - - The path. - - - - Takes the specified count. - - The count. - - - - - Skips the specified count. - - The count. - - - - - Filter the results from the index using the specified where clause. - - The where clause. - - - - Matches exact value - - - Defaults to NotAnalyzed - - - - - Matches exact value - - - Defaults to allow wildcards only if analyzed - - - - - Simplified method for opening a new clause within the query - - - - - - Instruct the index to group by the specified fields using the specified aggregation operation - - - This is only valid on dynamic indexes queries - - - - - Simplified method for closing a clause within the query - - - - - - Matches exact value - - - - - Negate the next operation - - - - - Check that the field has one of the specified value - - - - - Matches fields which starts with the specified value. - - Name of the field. - The value. - - - - Matches fields which ends with the specified value. - - Name of the field. - The value. - - - - Matches fields where the value is between the specified start and end, exclusive - - Name of the field. - The start. - The end. - - - - - Matches fields where the value is between the specified start and end, inclusive - - Name of the field. - The start. - The end. - - - - - Matches fields where the value is greater than the specified value - - Name of the field. - The value. - - - - Matches fields where the value is greater than or equal to the specified value - - Name of the field. - The value. - - - - Matches fields where the value is less than the specified value - - Name of the field. - The value. - - - - Matches fields where the value is less than or equal to the specified value - - Name of the field. - The value. - - - - Add an AND to the query - - - - - Add an OR to the query - - - - - Specifies a boost weight to the last where clause. - The higher the boost factor, the more relevant the term will be. - - boosting factor where 1.0 is default, less than 1.0 is lower weight, greater than 1.0 is higher weight - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Boosting%20a%20Term - - - - - Specifies a fuzziness factor to the single word term in the last where clause - - 0.0 to 1.0 where 1.0 means closer match - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Fuzzy%20Searches - - - - - Specifies a proximity distance for the phrase in the last where clause - - number of words within - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Proximity%20Searches - - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by ascending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - The fields. - - - - Instructs the query to wait for non stale results as of now. - - - - - - Instructs the query to wait for non stale results as of now for the specified timeout. - - The wait timeout. - - - - - Instructs the query to wait for non stale results as of the cutoff date. - - The cut off. - - - - - Instructs the query to wait for non stale results as of the cutoff date for the specified timeout - - The cut off. - The wait timeout. - - - - EXPERT ONLY: Instructs the query to wait for non stale results. - This shouldn't be used outside of unit tests unless you are well aware of the implications - - - - - Perform a search for documents which fields that match the searchTerms. - If there is more than a single term, each of them will be checked independently. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - The last term that we asked the query to use equals on - - - - - Get the name of the index being queried - - - - - Gets the document convention from the query session - - - - - Whatever to negate the next operation - - - - - The database commands to use - - - - - Async database commands to use - - - - - The index to query - - - - - The list of fields to project directly from the results - - - - - The list of fields to project directly from the index on the server - - - - - The query listeners for this query - - - - - The session for this query - - - - - The cutoff date to use for detecting staleness in the index - - - - - The fields to order the results by - - - - - The types to sort the fields by (NULL if not specified) - - - - - The page size to use when querying the index - - - - - The query to use - - - - - which record to start reading from - - - - - Timeout for this query - - - - - Should we wait for non stale results - - - - - The paths to include when loading the query - - - - - What aggregated operation to execute - - - - - Fields to group on - - - - - Holds the query stats - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The other. - - - - Includes the specified path in the query, loading the document specified in that path - - The path. - - - - EXPERT ONLY: Instructs the query to wait for non stale results for the specified wait timeout. - This shouldn't be used outside of unit tests unless you are well aware of the implications - - The wait timeout. - - - - When using spatial queries, instruct the query to sort by the distance from the origin point - - - - - Filter matches to be inside the specified radius - - The radius. - The latitude. - The longitude. - - - - Filter matches to be inside the specified radius - - - - - EXPERT ONLY: Instructs the query to wait for non stale results. - This shouldn't be used outside of unit tests unless you are well aware of the implications - - - - - Includes the specified path in the query, loading the document specified in that path - - The path. - - - - Instruct the query to wait for non stale result for the specified wait timeout. - - The wait timeout. - - - - - Register the query as a lazy query in the session and return a lazy - instance that will evaluate the query only when needed - - - - - Register the query as a lazy query in the session and return a lazy - instance that will evaluate the query only when needed - - - - - Gets the fields for projection - - - - - - Order the search results randomly - - - - - Order the search results randomly using the specified seed - this is useful if you want to have repeatable random queries - - - - - Adds an ordering for a specific field to the query - - Name of the field. - if set to true [descending]. - - - - Adds an ordering for a specific field to the query and specifies the type of field for sorting purposes - - Name of the field. - if set to true [descending]. - the type of the field to be sorted. - - - - Gets the enumerator. - - - - - Includes the specified path in the query, loading the document specified in that path - - The path. - - - - This function exists solely to forbid in memory where clause on IDocumentQuery, because - that is nearly always a mistake. - - - - - This function exists solely to forbid in memory where clause on IDocumentQuery, because - that is nearly always a mistake. - - - - - This function exists solely to forbid in memory where clause on IDocumentQuery, because - that is nearly always a mistake. - - - - - Includes the specified path in the query, loading the document specified in that path - - The path. - - - - Takes the specified count. - - The count. - - - - - Skips the specified count. - - The count. - - - - - Filter the results from the index using the specified where clause. - - The where clause. - - - - Matches exact value - - - Defaults to NotAnalyzed - - - - - Matches exact value - - - Defaults to allow wildcards only if analyzed - - - - - Simplified method for opening a new clause within the query - - - - - - Instruct the index to group by the specified fields using the specified aggregation operation - - - This is only valid on dynamic indexes queries - - - - - Simplified method for closing a clause within the query - - - - - - Matches exact value - - - - - Negate the next operation - - - - - Check that the field has one of the specified value - - - - - Matches fields which starts with the specified value. - - Name of the field. - The value. - - - - Matches fields which ends with the specified value. - - Name of the field. - The value. - - - - Matches fields where the value is between the specified start and end, exclusive - - Name of the field. - The start. - The end. - - - - - Matches fields where the value is between the specified start and end, inclusive - - Name of the field. - The start. - The end. - - - - - Matches fields where the value is greater than the specified value - - Name of the field. - The value. - - - - Matches fields where the value is greater than or equal to the specified value - - Name of the field. - The value. - - - - Matches fields where the value is less than the specified value - - Name of the field. - The value. - - - - Matches fields where the value is less than or equal to the specified value - - Name of the field. - The value. - - - - Add an AND to the query - - - - - Add an OR to the query - - - - - Specifies a boost weight to the last where clause. - The higher the boost factor, the more relevant the term will be. - - boosting factor where 1.0 is default, less than 1.0 is lower weight, greater than 1.0 is higher weight - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Boosting%20a%20Term - - - - - Specifies a fuzziness factor to the single word term in the last where clause - - 0.0 to 1.0 where 1.0 means closer match - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Fuzzy%20Searches - - - - - Specifies a proximity distance for the phrase in the last where clause - - number of words within - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Proximity%20Searches - - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by ascending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - The fields. - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by descending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - The fields. - - - - Instructs the query to wait for non stale results as of now. - - - - - - Instructs the query to wait for non stale results as of now for the specified timeout. - - The wait timeout. - - - - - Instructs the query to wait for non stale results as of the last write made by any session belonging to the - current document store. - This ensures that you'll always get the most relevant results for your scenarios using simple indexes (map only or dynamic queries). - However, when used to query map/reduce indexes, it does NOT guarantee that the document that this etag belong to is actually considered for the results. - - - - - Instructs the query to wait for non stale results as of the last write made by any session belonging to the - current document store. - This ensures that you'll always get the most relevant results for your scenarios using simple indexes (map only or dynamic queries). - However, when used to query map/reduce indexes, it does NOT guarantee that the document that this etag belong to is actually considered for the results. - - - - - Instructs the query to wait for non stale results as of the cutoff date. - - The cut off. - - - - - Instructs the query to wait for non stale results as of the cutoff date for the specified timeout - - The cut off. - The wait timeout. - - - - Instructs the query to wait for non stale results as of now. - - - - - - Instructs the query to wait for non stale results as of now for the specified timeout. - - The wait timeout. - - - - - Instructs the query to wait for non stale results as of the cutoff date. - - The cut off. - - - - - Instructs the query to wait for non stale results as of the cutoff date for the specified timeout - - The cut off. - The wait timeout. - - - - Instructs the query to wait for non stale results as of the last write made by any session belonging to the - current document store. - This ensures that you'll always get the most relevant results for your scenarios using simple indexes (map only or dynamic queries). - However, when used to query map/reduce indexes, it does NOT guarantee that the document that this etag belong to is actually considered for the results. - - - - - Instructs the query to wait for non stale results as of the last write made by any session belonging to the - current document store. - This ensures that you'll always get the most relevant results for your scenarios using simple indexes (map only or dynamic queries). - However, when used to query map/reduce indexes, it does NOT guarantee that the document that this etag belong to is actually considered for the results. - - - - - EXPERT ONLY: Instructs the query to wait for non stale results. - This shouldn't be used outside of unit tests unless you are well aware of the implications - - - - - Provide statistics about the query, such as total count of matching records - - - - - Callback to get the results of the query - - - - - Called externally to raise the after query executed callback - - - - - Generates the index query. - - The query. - - - - - Perform a search for documents which fields that match the searchTerms. - If there is more than a single term, each of them will be checked independently. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - The last term that we asked the query to use equals on - - - - - Order the search results randomly - - - - - Order the search results randomly using the specified seed - this is useful if you want to have repeatable random queries - - - - - Returns a list of results for a query asynchronously. - - - - - Gets the total count of records for this query - - - - - Get the name of the index being queried - - - - - Grant access to the database commands - - - - - Grant access to the async database commands - - - - - Gets the document convention from the query session - - - - - Gets the session associated with this document query - - - - - Gets the query text built so far - - - - - Gets the query result - Execute the query the first time that this is called. - - The query result. - - - - Gets the query result - Execute the query the first time that this is called. - - The query result. - - - - Asynchronous query against a raven index - - - - - A query against a Raven index - - - - - Negate the next operation - - - - - Includes the specified path in the query, loading the document specified in that path - - The path. - - - - This function exists solely to forbid in memory where clause on IDocumentQuery, because - that is nearly always a mistake. - - - - - This function exists solely to forbid in memory where clause on IDocumentQuery, because - that is nearly always a mistake. - - - - - This function exists solely to forbid in memory where clause on IDocumentQuery, because - that is nearly always a mistake. - - - - - Includes the specified path in the query, loading the document specified in that path - - The path. - - - - Takes the specified count. - - The count. - - - - - Skips the specified count. - - The count. - - - - - Filter the results from the index using the specified where clause. - - The where clause. - - - - Matches exact value - - - Defaults to NotAnalyzed - - - - - Matches exact value - - - Defaults to NotAnalyzed - - - - - Matches exact value - - - Defaults to allow wildcards only if analyzed - - - - - Matches exact value - - - Defaults to allow wildcards only if analyzed - - - - - Matches exact value - - - - - Check that the field has one of the specified value - - - - - Check that the field has one of the specified value - - - - - Matches fields which starts with the specified value. - - Name of the field. - The value. - - - - Matches fields which starts with the specified value. - - Property selector for the field. - The value. - - - - Matches fields which ends with the specified value. - - Name of the field. - The value. - - - - Matches fields which ends with the specified value. - - Property selector for the field. - The value. - - - - Matches fields where the value is between the specified start and end, exclusive - - Name of the field. - The start. - The end. - - - - Matches fields where the value is between the specified start and end, exclusive - - Property selector for the field. - The start. - The end. - - - - Matches fields where the value is between the specified start and end, inclusive - - Name of the field. - The start. - The end. - - - - Matches fields where the value is between the specified start and end, inclusive - - Property selector for the field. - The start. - The end. - - - - Matches fields where the value is greater than the specified value - - Name of the field. - The value. - - - - Matches fields where the value is greater than the specified value - - Property selector for the field. - The value. - - - - Matches fields where the value is greater than or equal to the specified value - - Name of the field. - The value. - - - - Matches fields where the value is greater than or equal to the specified value - - Property selector for the field. - The value. - - - - Matches fields where the value is less than the specified value - - Name of the field. - The value. - - - - Matches fields where the value is less than the specified value - - Property selector for the field. - The value. - - - - Matches fields where the value is less than or equal to the specified value - - Name of the field. - The value. - - - - Matches fields where the value is less than or equal to the specified value - - Property selector for the field. - The value. - - - - Add an AND to the query - - - - - Add an OR to the query - - - - - Specifies a boost weight to the last where clause. - The higher the boost factor, the more relevant the term will be. - - boosting factor where 1.0 is default, less than 1.0 is lower weight, greater than 1.0 is higher weight - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Boosting%20a%20Term - - - - - Specifies a fuzziness factor to the single word term in the last where clause - - 0.0 to 1.0 where 1.0 means closer match - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Fuzzy%20Searches - - - - - Specifies a proximity distance for the phrase in the last where clause - - number of words within - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Proximity%20Searches - - - - - Filter matches to be inside the specified radius - - The radius in KM. - The latitude. - The longitude. - - - - Filter matches to be inside the specified radius - - The field name for the radius - The radius in KM. - The latitude. - The longitude. - - - - Filter matches based on a given shape - only documents with the shape defined in fieldName that - have a relation rel with the given shapeWKT will be returned - - The name of the field containing the shape to use for filtering - The query shape - Spatial relation to check - The allowed error precentage - - - - - Sorts the query results by distance. - - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by ascending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - The fields. - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by ascending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - Property selectors for the fields. - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by descending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - The fields. - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by descending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - Property selectors for the fields. - - - - Instructs the query to wait for non stale results as of now. - - - - - - Instructs the query to wait for non stale results as of the last write made by any session belonging to the - current document store. - This ensures that you'll always get the most relevant results for your scenarios using simple indexes (map only or dynamic queries). - However, when used to query map/reduce indexes, it does NOT guarantee that the document that this etag belong to is actually considered for the results. - - - - - Instructs the query to wait for non stale results as of the last write made by any session belonging to the - current document store. - This ensures that you'll always get the most relevant results for your scenarios using simple indexes (map only or dynamic queries). - However, when used to query map/reduce indexes, it does NOT guarantee that the document that this etag belong to is actually considered for the results. - - - - - Instructs the query to wait for non stale results as of now for the specified timeout. - - The wait timeout. - - - - - Instructs the query to wait for non stale results as of the cutoff date. - - The cut off. - - - - - Instructs the query to wait for non stale results as of the cutoff date for the specified timeout - - The cut off. - The wait timeout. - - - - EXPERT ONLY: Instructs the query to wait for non stale results. - This shouldn't be used outside of unit tests unless you are well aware of the implications - - - - - EXPERT ONLY: Instructs the query to wait for non stale results for the specified wait timeout. - This shouldn't be used outside of unit tests unless you are well aware of the implications - - The wait timeout. - - - - Order the search results randomly - - - - - Order the search results randomly using the specified seed - this is useful if you want to have repeatable random queries - - - - - Adds an ordering for a specific field to the query - - Name of the field. - if set to true [descending]. - - - - Adds an ordering for a specific field to the query - - Property selector for the field. - if set to true [descending]. - - - - Adds an ordering for a specific field to the query and specifies the type of field for sorting purposes - - Name of the field. - if set to true [descending]. - the type of the field to be sorted. - - - - Simplified method for opening a new clause within the query - - - - - - Simplified method for closing a clause within the query - - - - - - Perform a search for documents which fields that match the searchTerms. - If there is more than a single term, each of them will be checked independently. - - - - - Perform a search for documents which fields that match the searchTerms. - If there is more than a single term, each of them will be checked independently. - - - - - Instruct the index to group by the specified fields using the specified aggregation operation - - - This is only valid on dynamic indexes queries - - - - - Instruct the index to group by the specified fields using the specified aggregation operation - - - This is only valid on dynamic indexes queries - - - - - Partition the query so we can intersect different parts of the query - across different index entries. - - - - - Callback to get the results of the query - - - - - Called externally to raise the after query executed callback - - - - - Provide statistics about the query, such as total count of matching records - - - - - Select the default field to use for this query - - - - - Select the default operator to use for this query - - - - - Gets the document convention from the query session - - - - - Negate the next operation - - - - - Selects the specified fields directly from the index - - The type of the projection. - The fields. - - - - Selects all the projection fields directly from the index - - The type of the projection. - - - - Gets the query result - - The query result. - - - - Gets the query result - Execute the query the first time that this is called. - - The query result. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Includes the specified path in the query, loading the document specified in that path - - The path. - - - - Includes the specified path in the query, loading the document specified in that path - - The path. - - - - Takes the specified count. - - The count. - - - - - Skips the specified count. - - The count. - - - - - Filter the results from the index using the specified where clause. - - The where clause. - - - - Matches exact value - - - Defaults to NotAnalyzed - - - - - Matches exact value - - - Defaults to NotAnalyzed - - - - - Matches exact value - - - Defaults to allow wildcards only if analyzed - - - - - Matches exact value - - - Defaults to allow wildcards only if analyzed - - - - - Matches exact value - - - - - Check that the field has one of the specified value - - - - - Check that the field has one of the specified value - - - - - Matches fields which starts with the specified value. - - Name of the field. - The value. - - - - Matches fields which starts with the specified value. - - Property selector for the field. - The value. - - - - Matches fields which ends with the specified value. - - Name of the field. - The value. - - - - Matches fields which ends with the specified value. - - Property selector for the field. - The value. - - - - Matches fields where the value is between the specified start and end, exclusive - - Name of the field. - The start. - The end. - - - - Matches fields where the value is between the specified start and end, exclusive - - Property selector for the field. - The start. - The end. - - - - Matches fields where the value is between the specified start and end, inclusive - - Name of the field. - The start. - The end. - - - - Matches fields where the value is between the specified start and end, inclusive - - Property selector for the field. - The start. - The end. - - - - Matches fields where the value is greater than the specified value - - Name of the field. - The value. - - - - Matches fields where the value is greater than the specified value - - Property selector for the field. - The value. - - - - Matches fields where the value is greater than or equal to the specified value - - Name of the field. - The value. - - - - Matches fields where the value is greater than or equal to the specified value - - Property selector for the field. - The value. - - - - Matches fields where the value is less than the specified value - - Name of the field. - The value. - - - - Matches fields where the value is less than the specified value - - Property selector for the field. - The value. - - - - Matches fields where the value is less than or equal to the specified value - - Name of the field. - The value. - - - - Matches fields where the value is less than or equal to the specified value - - Property selector for the field. - The value. - - - - Add an AND to the query - - - - - Add an OR to the query - - - - - Specifies a boost weight to the last where clause. - The higher the boost factor, the more relevant the term will be. - - boosting factor where 1.0 is default, less than 1.0 is lower weight, greater than 1.0 is higher weight - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Boosting%20a%20Term - - - - - Specifies a fuzziness factor to the single word term in the last where clause - - 0.0 to 1.0 where 1.0 means closer match - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Fuzzy%20Searches - - - - - Specifies a proximity distance for the phrase in the last where clause - - number of words within - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Proximity%20Searches - - - - - Filter matches to be inside the specified radius - - The radius. - The latitude. - The longitude. - - - - Filter matches to be inside the specified radius - - - - - Sorts the query results by distance. - - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by ascending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - The fields. - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by ascending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - Property selectors for the fields. - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by descending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - The fields. - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by descending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - Property selectors for the fields. - - - - Instructs the query to wait for non stale results as of now. - - - - - - Instructs the query to wait for non stale results as of now for the specified timeout. - - The wait timeout. - - - - - Instructs the query to wait for non stale results as of the cutoff date. - - The cut off. - - - - - Instructs the query to wait for non stale results as of the last write made by any session belonging to the - current document store. - This ensures that you'll always get the most relevant results for your scenarios using simple indexes (map only or dynamic queries). - However, when used to query map/reduce indexes, it does NOT guarantee that the document that this etag belong to is actually considered for the results. - - - - - Instructs the query to wait for non stale results as of the last write made by any session belonging to the - current document store. - This ensures that you'll always get the most relevant results for your scenarios using simple indexes (map only or dynamic queries). - However, when used to query map/reduce indexes, it does NOT guarantee that the document that this etag belong to is actually considered for the results. - - - - - Instructs the query to wait for non stale results as of the cutoff date for the specified timeout - - The cut off. - The wait timeout. - - - - EXPERT ONLY: Instructs the query to wait for non stale results. - This shouldn't be used outside of unit tests unless you are well aware of the implications - - - - - EXPERT ONLY: Instructs the query to wait for non stale results for the specified wait timeout. - This shouldn't be used outside of unit tests unless you are well aware of the implications - - The wait timeout. - - - - Selects all the projection fields directly from the index - - The type of the projection. - - - - Selects the specified fields directly from the index - - The type of the projection. - - - - Selects the specified fields directly from the index - - The type of the projection. - - - - Adds an ordering for a specific field to the query - - Name of the field. - if set to true [descending]. - - - - Adds an ordering for a specific field to the query - - Property selector for the field. - if set to true [descending]. - - - - Order the search results randomly - - - - - Order the search results randomly using the specified seed - this is useful if you want to have repeatable random queries - - - - - Adds an ordering for a specific field to the query and specifies the type of field for sorting purposes - - Name of the field. - if set to true [descending]. - the type of the field to be sorted. - - - - Simplified method for opening a new clause within the query - - - - - - Perform a search for documents which fields that match the searchTerms. - If there is more than a single term, each of them will be checked independently. - - - - - Perform a search for documents which fields that match the searchTerms. - If there is more than a single term, each of them will be checked independently. - - - - - Simplified method for closing a clause within the query - - - - - - Instruct the index to group by the specified fields using the specified aggregation operation - - - This is only valid on dynamic indexes queries - - - - - Partition the query so we can intersect different parts of the query - across different index entries. - - - - - Instruct the index to group by the specified fields using the specified aggregation operation - - - This is only valid on dynamic indexes queries - - - - - Provide statistics about the query, such as total count of matching records - - - - - Negate the next operation - - - - - Initializes a new instance of the class. - - - - - Generate a hilo key for each given type - - - - - Generate hilo numbers against a RavenDB document - - - - - Initializes a new instance of the class. - - - - - Generates the document key. - - The convention. - The entity. - - - - - Create the next id (numeric) - - - - - Interface for document session using async approaches - - - - - Interface for document session using async approaches - - - - - Begin a load while including the specified path - - The path. - - - - Begin a load while including the specified path - - The path. - - - - Stores the specified entity with the specified etag. - The entity will be saved when is called. - - - - - Stores the specified entity in the session. The entity will be saved when is called. - - The entity. - - - - Stores the specified entity with the specified etag, under the specified id - - - - - Stores the specified dynamic entity, under the specified id - - The entity. - The id to store this entity under. If other entity exists with the same id it will be overridden. - - - - Marks the specified entity for deletion. The entity will be deleted when is called. - - - The entity. - - - - Begins the async load operation - - The id. - - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Begins the async multi load operation - - The ids. - - - - - Begins the async save changes operation - - - - - - Queries the specified index using Linq. - - The result of the query - Name of the index. - - - - Dynamically queries RavenDB using LINQ - - The result of the query - - - - Queries the index specified by using Linq. - - The result of the query - The type of the index creator. - - - - - Get the accessor for advanced operations - - - Those operations are rarely needed, and have been moved to a separate - property to avoid cluttering the API - - - - - Contains implementation of some IDocumentStore operations shared by DocumentStore implementations - - - - - Interface for managing access to RavenDB and open sessions. - - - - - Provide a way for interested party to tell whatever implementers have been disposed - - - - - Called after dispose is completed - - - - - Whatever the instance has been disposed - - - - - Subscribe to change notifications from the server - - - - - Setup the context for aggressive caching. - - Specify the aggressive cache duration - - Aggressive caching means that we will not check the server to see whatever the response - we provide is current or not, but will serve the information directly from the local cache - without touching the server. - - - - - Setup the context for no aggressive caching - - - This is mainly useful for internal use inside RavenDB, when we are executing - queries that has been marked with WaitForNonStaleResults, we temporarily disable - aggressive caching. - - - - - Initializes this instance. - - - - - - Opens the async session. - - - - - - Opens the async session. - - - - - - Opens the session. - - - - - - Opens the session for a particular database - - - - - Opens the session with the specified options. - - - - - Executes the index creation. - - - - - Gets the etag of the last document written by any session belonging to this - document store - - - - - Gets the shared operations headers. - - The shared operations headers. - - - - Get the for this store - - - - - Gets or sets the identifier for this store. - - The identifier. - - - - Gets the async database commands. - - The async database commands. - - - - Gets the database commands. - - The database commands. - - - - Gets the conventions. - - The conventions. - - - - Gets the URL. - - - - - Subscribe to change notifications from the server - - - - - Executes the index creation. - - - - - Gets the etag of the last document written by any session belonging to this - document store - - - - - Registers the delete listener. - - The delete listener. - - - - - Registers the query listener. - - - - - Registers the convertion listener. - - - - - Registers the store listener. - - The document store listener. - - - - - Get the profiling information for the given id - - - - - - - - - - Whatever the instance has been disposed - - - - - Gets the shared operations headers. - - The shared operations headers. - - - - Gets the conventions. - - The conventions. - - - - Gets or sets the URL. - - - - - Whatever or not we will automatically enlist in distributed transactions - - - - - The resource manager id for the document store. - IMPORTANT: Using Guid.NewGuid() to set this value is almost certainly a mistake, you should set - it to a value that remains consistent between restart of the system. - - - - - Internal notification for integration tools, mainly - - - - - Implementation for async document session - - - - - Abstract implementation for in memory session operations - - - - - The entities waiting to be deleted - - - - - Entities whose id we already know do not exists, because they are a missing include, or a missing load, etc. - - - - - hold the data required to manage the data for RavenDB's Unit of Work - - - - - Translate between a key and its associated entity - - - - - all the listeners for this session - - - - - Initializes a new instance of the class. - - - - - Gets the ETag for the specified entity. - If the entity is transient, it will load the etag from the store - and associate the current state of the entity with the etag from the server. - - The instance. - - - - - Gets the metadata for the specified entity. - - - The instance. - - - - - Get the json document by key from the store - - - - - Returns whatever a document with the specified id is loaded in the - current session - - - - - Returns whatever a document with the specified id is deleted - or known to be missing - - - - - Gets the document id. - - The instance. - - - - - Determines whether the specified entity has changed. - - The entity. - - true if the specified entity has changed; otherwise, false. - - - - - Tracks the entity inside the unit of work - - - The document found. - - - - - Tracks the entity. - - - The key. - The document. - The metadata. - - - - - Marks the specified entity for deletion. The entity will be deleted when SaveChanges is called. - - - The entity. - - - - Converts the json document to an entity. - - - The id. - The document found. - The metadata. - - - - - Tries to set the identity property - - - The entity. - The id. - - - - Stores the specified entity in the session. The entity will be saved when SaveChanges is called. - - - - - Stores the specified entity in the session. The entity will be saved when SaveChanges is called. - - - - - Stores the specified entity in the session, explicitly specifying its Id. The entity will be saved when SaveChanges is called. - - - - - Stores the specified entity in the session, explicitly specifying its Id. The entity will be saved when SaveChanges is called. - - - - - Tries to get the identity. - - The entity. - - - - - Attempts to get the document key from an instance - - - - - Creates the put entity command. - - The entity. - The document metadata. - - - - - Updates the batch results. - - - - - Prepares for save changes. - - - - - - Mark the entity as read only, change tracking won't apply - to such an entity. This can be done as an optimization step, so - we don't need to check the entity for changes. - - - - - Determines if the entity have changed. - - The entity. - The document metadata. - - - - - All calls to convert an entity to a json object would be cache - This is used inside the SaveChanges() action, where we need to access the entities json - in several disparate places. - - Note: This assumes that no modifications can happen during the SaveChanges. This is naturally true - Note: for SaveChanges (and multi threaded access will cause undefined behavior anyway). - Note: For SaveChangesAsync, the same holds true as well. - - - - - Evicts the specified entity from the session. - Remove the entity from the delete queue and stops tracking changes for this entity. - - - The entity. - - - - Clears this instance. - Remove all entities from the delete queue and stops tracking changes for all entities. - - - - - Defer commands to be executed on SaveChanges() - - The commands to be executed - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Commits the specified tx id. - - The tx id. - - - - Rollbacks the specified tx id. - - The tx id. - - - - Promotes the transaction. - - From tx id. - - - - - Clears the enlistment. - - - - - The session id - - - - - The document store associated with this session - - - - - Gets the number of requests for this session - - - - - - Gets or sets the timeout to wait for authoritative information if encountered non authoritative document. - - - - - - Gets the store identifier for this session. - The store identifier is the identifier for the particular RavenDB instance. - - The store identifier. - - - - Gets the conventions used by this session - - The conventions. - - This instance is shared among all sessions, changes to the should be done - via the instance, not on a single session. - - - - - The transaction resource manager identifier - - - - - Gets or sets the max number of requests per session. - If the rise above , an exception will be thrown. - - The max number of requests per session. - - - - Gets or sets a value indicating whether the session should use optimistic concurrency. - When set to true, a check is made so that a change made behind the session back would fail - and raise . - - - - - - Gets a value indicating whether any of the entities tracked by the session has changes. - - - - - - Gets or sets a value indicating whether non authoritative information is allowed. - Non authoritative information is document that has been modified by a transaction that hasn't been committed. - The server provides the latest committed version, but it is known that attempting to write to a non authoritative document - will fail, because it is already modified. - If set to false, the session will wait for the transaction to commit to get an - authoritative information. If the wait is longer than , is thrown. - - - true if non authoritative information is allowed; otherwise, false. - - - - - Metadata held about an entity by the session - - - - - Gets or sets the original value. - - The original value. - - - - Gets or sets the metadata. - - The metadata. - - - - Gets or sets the ETag. - - The ETag. - - - - Gets or sets the key. - - The key. - - - - Gets or sets the original metadata. - - The original metadata. - - - - A concurrency check will be forced on this entity - even if UseOptimisticConcurrency is set to false - - - - - Data for a batch command to the server - - - - - Gets or sets the commands. - - The commands. - - - - Gets or sets the entities. - - The entities. - - - - Advanced async session operations - - - - - Advanced session operations - - - - - Returns whatever a document with the specified id is loaded in the - current session - - - - - Evicts the specified entity from the session. - Remove the entity from the delete queue and stops tracking changes for this entity. - - The entity. - - - - Clears this instance. - Remove all entities from the delete queue and stops tracking changes for all entities. - - - - - Mark the entity as read only, change tracking won't apply - to such an entity. This can be done as an optimization step, so - we don't need to check the entity for changes. - - - - - Gets the metadata for the specified entity. - If the entity is transient, it will load the metadata from the store - and associate the current state of the entity with the metadata from the server. - - The instance. - - - - - Gets the ETag for the specified entity. - If the entity is transient, it will load the etag from the store - and associate the current state of the entity with the etag from the server. - - The instance. - - - - - Gets the document id for the specified entity. - - - This function may return null if the entity isn't tracked by the session, or if the entity is - a new entity with a key that should be generated on the server. - - The entity. - - - - Determines whether the specified entity has changed. - - The entity. - - true if the specified entity has changed; otherwise, false. - - - - - Defer commands to be executed on SaveChanges() - - The commands to be executed - - - - The document store associated with this session - - - - - Gets the store identifier for this session. - The store identifier is the identifier for the particular RavenDB instance. - - The store identifier. - - - - Gets or sets a value indicating whether the session should use optimistic concurrency. - When set to true, a check is made so that a change made behind the session back would fail - and raise . - - - - - Gets or sets a value indicating whether non authoritative information is allowed. - Non authoritative information is document that has been modified by a transaction that hasn't been committed. - The server provides the latest committed version, but it is known that attempting to write to a non authoritative document - will fail, because it is already modified. - If set to false, the session will wait for the transaction to commit to get an - authoritative information. If the wait is longer than , is thrown. - - - true if non authoritative information is allowed; otherwise, false. - - - - - Gets or sets the timeout to wait for authoritative information if encountered non authoritative document. - - - - - Gets or sets the max number of requests per session. - If the rise above , an exception will be thrown. - - The max number of requests per session. - - - - Gets the number of requests for this session - - - - - Gets a value indicating whether any of the entities tracked by the session has changes. - - - - - Load documents with the specified key prefix - - - - - Query the specified index using Lucene syntax - - - - - Dynamically query RavenDB using Lucene syntax - - - - - Generate a new document query - - - - - Create a new query for - - - - - Create a new query for - - - - - Gets the conventions associated with this query - - - - - Initializes a new instance of the class. - - - - - Load documents with the specified key prefix - - - - - Query the specified index using Lucene syntax - - - - - Dynamically query RavenDB using Lucene syntax - - - - - Begin a load while including the specified path - - The path. - - - - Begin a load while including the specified path - - The path. - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Begins the async load operation - - The id. - - - - - Begins the async multi load operation - - The ids. - - - - - Begins the async multi load operation - - - - - Begins the async save changes operation - - - - - - Get the json document by key from the store - - - - - Commits the specified tx id. - - The tx id. - - - - Rollbacks the specified tx id. - - The tx id. - - - - Promotes the transaction. - - From tx id. - - - - - Dynamically queries RavenDB using LINQ - - The result of the query - - - - Create a new query for - - - - - Create a new query for - - - - - Gets the async database commands. - - The async database commands. - - - - Get the accessor for advanced operations - - - Those operations are rarely needed, and have been moved to a separate - property to avoid cluttering the API - - - - - Fluent implementation for specifying include paths - for loading documents - - - - - Fluent interface for specifying include paths - for loading documents - - - - - Includes the specified path. - - The path. - - - - - Includes the specified path. - - The path. - - - - - Loads the specified ids. - - The ids. - - - - - Loads the specified id. - - The id. - - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Loads the specified ids. - - The ids. - - - - - Loads the specified id. - - - The id. - - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Includes the specified path. - - The path. - - - - Includes the specified path. - - The path. - - - - Loads the specified ids. - - The ids. - - - - Loads the specified id. - - The id. - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Initializes a new instance of the class. - - The session. - - - - Loads the specified ids. - - - The ids. - - - - Loads the specified id. - - - The id. - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Fluent interface for specifying include paths - for loading documents lazily - - - - - Includes the specified path. - - The path. - - - - - Includes the specified path. - - The path. - - - - - Loads the specified ids. - - The ids. - - - - - Loads the specified id. - - The id. - - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Loads the specified ids. - - The ids. - - - - - Loads the specified id. - - - The id. - - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Specify interface for lazy operation for the session - - - - - Begin a load while including the specified path - - The path. - - - - Begin a load while including the specified path - - The path. - - - - Loads the specified ids. - - The ids. - - - - Loads the specified ids and a function to call when it is evaluated - - - - - Loads the specified id. - - - - - Loads the specified id and a function to call when it is evaluated - - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Allow to perform eager operations on the session - - - - - Execute all the lazy requests pending within this session - - - - - Initializes a new instance of the class. - - The session. - - - - Includes the specified path. - - The path. - - - - Includes the specified path. - - The path. - - - - Loads the specified ids. - - The ids. - - - - Loads the specified id. - - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Loads the specified ids. - - - The ids. - - - - Loads the specified id. - - - The id. - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - The default json contract will serialize all properties and all public fields - - - - - Initializes a new instance of the class. - - If set to true the will use a cached shared with other resolvers of the same type. - Sharing the cache will significantly performance because expensive reflection will only happen once but could cause unexpected - behavior if different instances of the resolver are suppose to produce different results. When set to false it is highly - recommended to reuse instances with the . - - - - Gets the serializable members for the type. - - The type to get serializable members for. - The serializable members for the type. - - - - The set of conventions used by the which allow the users to customize - the way the Raven client API behaves - - - - - Initializes a new instance of the class. - - - - - Find the full document name assuming that we are using the standard conventions - for generating a document key - - - - - - Generates the document key using identity. - - The conventions. - The entity. - - - - - Get the default tag name for the specified type. - - - - - Gets the name of the type tag. - - The type. - - - - - Generates the document key. - - The entity. - - - - - Gets the identity property. - - The type. - - - - - Register an id convention for a single type (and all of its derived types. - Note that you can still fall back to the DocumentKeyGenerator if you want. - - - - - Register an async id convention for a single type (and all of its derived types. - Note that you can still fall back to the DocumentKeyGenerator if you want. - - - - - Creates the serializer. - - - - - - Get the CLR type (if exists) from the document - - - - - Get the CLR type name to be stored in the entity metadata - - - - - Clone the current conventions to a new instance - - - - - How should we behave in a replicated environment when we can't - reach the primary node and need to failover to secondary node(s). - - - - - Register an action to customize the json serializer used by the - - - - - Disable all profiling support - - - - - A list of type converters that can be used to translate the document key (string) - to whatever type it is that is used on the entity, if the type isn't already a string - - - - - Gets or sets the identity parts separator used by the HiLo generators - - The identity parts separator. - - - - Gets or sets the default max number of requests per session. - - The max number of requests per session. - - - - Whatever to allow queries on document id. - By default, queries on id are disabled, because it is far more efficent - to do a Load() than a Query() if you alred know the id. - This is NOT recommended and provided for backward compatability purposes only. - - - - - The consistency options used when querying the database by default - Note that this option impact only queries, since we have Strong Consistency model for the documents - - - - - Gets or sets the function to find the clr type of a document. - - - - - Gets or sets the function to find the clr type name from a clr type - - - - - Gets or sets the function to find the full document key based on the type of a document - and the value type identifier (just the numeric part of the id). - - - - - Gets or sets the json contract resolver. - - The json contract resolver. - - - - Gets or sets the function to find the type tag. - - The name of the find type tag. - - - - Gets or sets the function to find the indexed property name - given the indexed document type, the index name, the current path and the property path. - - - - - Gets or sets the function to find the indexed property name - given the indexed document type, the index name, the current path and the property path. - - - - - Whatever or not RavenDB should cache the request to the specified url. - - - - - Gets or sets the function to find the identity property. - - The find identity property. - - - - Get or sets the function to get the identity property name from the entity name - - - - - Gets or sets the document key generator. - - The document key generator. - - - - Gets or sets the document key generator. - - The document key generator. - - - - Instruct RavenDB to parallel Multi Get processing - when handling lazy requests - - - - - Handles unauthenticated responses, usually by authenticating against the oauth server - - - - - Begins handling of unauthenticated responses, usually by authenticating against the oauth server - in async manner - - - - - When RavenDB needs to convert between a string id to a value type like int or guid, it calls - this to perform the actual work - - - - - Saves Enums as integers and instruct the Linq provider to query enums as integer values. - - - - - Translate the type tag name to the document key prefix - - - - - Whatever or not RavenDB will automatically enlist in distributed transactions - - - - - This is called in order to ensure that reduce function in a sharded environment is run - over the merged results - - - - - This is called to provide replication behavior for the client. You can customize - this to inject your own replication / failover logic. - - - - - The maximum amount of time that we will wait before checking - that a failed node is still up or not. - Default: 5 minutes - - - - - The consistency options for all queries, fore more details about the consistency options, see: - http://www.allthingsdistributed.com/2008/12/eventually_consistent.html - - Note that this option impact only queries, since we have Strong Consistency model for the documents - - - - - Ensures that after querying an index at time T, you will never see the results - of the index at a time prior to T. - This is ensured by the server, and require no action from the client - - - - - After updating a documents, will only accept queries which already indexed the updated value. - - - - - A query against a Raven index - - - - - A query against a Raven index - - - - - Selects the specified fields directly from the index - - The type of the projection. - The fields. - - - - Selects the specified fields directly from the index - - The type of the projection. - - - - Selects the projection fields directly from the index - - The type of the projection. - - - - Register the query as a lazy query in the session and return a lazy - instance that will evaluate the query only when needed - - - - - Register the query as a lazy query in the session and return a lazy - instance that will evaluate the query only when needed. - Also provide a function to execute when the value is evaluated - - - - - Gets the query result - Execute the query the first time that this is called. - - The query result. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - - - Selects the projection fields directly from the index - - The type of the projection. - - - - Selects the specified fields directly from the index - - The type of the projection. - - - - Selects the specified fields directly from the index - - The type of the projection. - - - - EXPERT ONLY: Instructs the query to wait for non stale results for the specified wait timeout. - This shouldn't be used outside of unit tests unless you are well aware of the implications - - The wait timeout. - - - - Adds an ordering for a specific field to the query - - Name of the field. - if set to true [descending]. - - - - Adds an ordering for a specific field to the query - - Property selector for the field. - if set to true [descending]. - - - - Order the search results randomly - - - - - Order the search results randomly using the specified seed - this is useful if you want to have repeatable random queries - - - - - Adds an ordering for a specific field to the query and specifies the type of field for sorting purposes - - Name of the field. - if set to true [descending]. - the type of the field to be sorted. - - - - Simplified method for opening a new clause within the query - - - - - - Simplified method for closing a clause within the query - - - - - - Perform a search for documents which fields that match the searchTerms. - If there is more than a single term, each of them will be checked independently. - - - - - Perform a search for documents which fields that match the searchTerms. - If there is more than a single term, each of them will be checked independently. - - - - - Instruct the index to group by the specified fields using the specified aggregation operation - - - This is only valid on dynamic indexes queries - - - - - Instruct the index to group by the specified fields using the specified aggregation operation - - - This is only valid on dynamic indexes queries - - - - - Partition the query so we can intersect different parts of the query - across different index entries. - - - - - Provide statistics about the query, such as total count of matching records - - - - - Includes the specified path in the query, loading the document specified in that path - - The path. - - - - Includes the specified path in the query, loading the document specified in that path - - The path. - - - - Takes the specified count. - - The count. - - - - - Skips the specified count. - - The count. - - - - - Filter the results from the index using the specified where clause. - - The where clause. - - - - Matches exact value - - - Defaults to NotAnalyzed - - - - - Matches exact value - - - Defaults to NotAnalyzed - - - - - Matches exact value - - - Defaults to allow wildcards only if analyzed - - - - - Matches exact value - - - Defaults to allow wildcards only if analyzed - - - - - Matches exact value - - - - - Check that the field has one of the specified value - - - - - Check that the field has one of the specified value - - - - - Matches fields which starts with the specified value. - - Name of the field. - The value. - - - - Matches fields which starts with the specified value. - - Property selector for the field. - The value. - - - - Matches fields which ends with the specified value. - - Name of the field. - The value. - - - - Matches fields which ends with the specified value. - - Property selector for the field. - The value. - - - - Matches fields where the value is between the specified start and end, exclusive - - Name of the field. - The start. - The end. - - - - Matches fields where the value is between the specified start and end, exclusive - - Property selector for the field. - The start. - The end. - - - - Matches fields where the value is between the specified start and end, inclusive - - Name of the field. - The start. - The end. - - - - Matches fields where the value is between the specified start and end, inclusive - - Property selector for the field. - The start. - The end. - - - - Matches fields where the value is greater than the specified value - - Name of the field. - The value. - - - - Matches fields where the value is greater than the specified value - - Property selector for the field. - The value. - - - - Matches fields where the value is greater than or equal to the specified value - - Name of the field. - The value. - - - - Matches fields where the value is greater than or equal to the specified value - - Property selector for the field. - The value. - - - - Matches fields where the value is less than the specified value - - Name of the field. - The value. - - - - Matches fields where the value is less than the specified value - - Property selector for the field. - The value. - - - - Matches fields where the value is less than or equal to the specified value - - Name of the field. - The value. - - - - Matches fields where the value is less than or equal to the specified value - - Property selector for the field. - The value. - - - - Add an AND to the query - - - - - Add an OR to the query - - - - - Specifies a boost weight to the last where clause. - The higher the boost factor, the more relevant the term will be. - - boosting factor where 1.0 is default, less than 1.0 is lower weight, greater than 1.0 is higher weight - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Boosting%20a%20Term - - - - - Specifies a fuzziness factor to the single word term in the last where clause - - 0.0 to 1.0 where 1.0 means closer match - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Fuzzy%20Searches - - - - - Specifies a proximity distance for the phrase in the last where clause - - number of words within - - - http://lucene.apache.org/java/2_4_0/queryparsersyntax.html#Proximity%20Searches - - - - - Filter matches to be inside the specified radius - - The radius. - The latitude. - The longitude. - - - - Filter matches to be inside the specified radius - - The radius. - The latitude. - The longitude. - - - - Sorts the query results by distance. - - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by ascending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - The fields. - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by ascending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - Property selectors for the fields. - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by descending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - The fields. - - - - Order the results by the specified fields - The fields are the names of the fields to sort, defaulting to sorting by descending. - You can prefix a field name with '-' to indicate sorting by descending or '+' to sort by ascending - - Property selectors for the fields. - - - - Instructs the query to wait for non stale results as of now. - - - - - - Instructs the query to wait for non stale results as of the last write made by any session belonging to the - current document store. - This ensures that you'll always get the most relevant results for your scenarios using simple indexes (map only or dynamic queries). - However, when used to query map/reduce indexes, it does NOT guarantee that the document that this etag belong to is actually considered for the results. - - - - - Instructs the query to wait for non stale results as of the last write made by any session belonging to the - current document store. - This ensures that you'll always get the most relevant results for your scenarios using simple indexes (map only or dynamic queries). - However, when used to query map/reduce indexes, it does NOT guarantee that the document that this etag belong to is actually considered for the results. - - - - - Instructs the query to wait for non stale results as of now for the specified timeout. - - The wait timeout. - - - - - Instructs the query to wait for non stale results as of the cutoff date. - - The cut off. - - - - - Instructs the query to wait for non stale results as of the cutoff date for the specified timeout - - The cut off. - The wait timeout. - - - - EXPERT ONLY: Instructs the query to wait for non stale results. - This shouldn't be used outside of unit tests unless you are well aware of the implications - - - - - Returns an enumerator that iterates through a collection. - - - An object that can be used to iterate through the collection. - - 2 - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Negate the next operation - - - - - Implements Unit of Work for accessing the RavenDB server - - - - - Interface for document session which holds the internal operations - - - - - Interface for document session - - - - - Marks the specified entity for deletion. The entity will be deleted when is called. - - - The entity. - - - - Loads the specified entity with the specified id. - - The id. - - - - Loads the specified entities with the specified ids. - - The ids. - - - - Loads the specified entities with the specified ids. - - The ids. - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Queries the specified index using Linq. - - The result of the query - Name of the index. - - - - Dynamically queries RavenDB using LINQ - - The result of the query - - - - Queries the index specified by using Linq. - - The result of the query - The type of the index creator. - - - - - Begin a load while including the specified path - - The path. - - - - Begin a load while including the specified path - - The path. - - - - Begin a load while including the specified path - - The path. - - - - Saves all the changes to the Raven server. - - - - - Stores the specified entity with the specified etag - - - - - Stores the specified entity with the specified etag, under the specified id - - - - - Stores the specified dynamic entity. - - The entity. - - - - Stores the specified dynamic entity, under the specified id - - The entity. - The id to store this entity under. If other entity exists with the same id it will be overridden. - - - - Get the accessor for advanced operations - - - Those operations are rarely needed, and have been moved to a separate - property to avoid cluttering the API - - - - - Implementers of this interface provide transactional operations - Note that this interface is mostly useful only for expert usage - - - - - Commits the transaction specified. - - The tx id. - - - - Rollbacks the transaction specified. - - The tx id. - - - - Promotes a transaction specified to a distributed transaction - - From tx id. - The token representing the distributed transaction - - - - The transaction resource manager identifier - - - - - Advanced synchronous session operations - - - - - Refreshes the specified entity from Raven server. - - The entity. - - - - Load documents with the specified key prefix - - - - - Queries the index specified by using lucene syntax. - - The result of the query - The type of the index creator. - - - - - Query the specified index using Lucene syntax - - Name of the index. - - - - Dynamically query RavenDB using Lucene syntax - - - - - Gets the document URL for the specified entity. - - The entity. - - - - - Access the lazy operations - - - - - Access the eager operations - - - - - Initializes a new instance of the class. - - - - - Begin a load while including the specified path - - The path. - - - - Loads the specified ids. - - The ids. - - - - - Loads the specified id. - - - The id. - - - - - Loads the specified ids and a function to call when it is evaluated - - - - - Loads the specified id and a function to call when it is evaluated - - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Begin a load while including the specified path - - The path. - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Loads the specified entity with the specified id. - - - The id. - - - - - Loads the specified entities with the specified ids. - - - The ids. - - - - - Loads the specified entities with the specified ids. - - The ids. - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Queries the specified index using Linq. - - The result of the query - Name of the index. - - - - - Queries the index specified by using Linq. - - The result of the query - The type of the index creator. - - - - - Refreshes the specified entity from Raven server. - - - The entity. - - - - Get the json document by key from the store - - - - - Begin a load while including the specified path - - The path. - - - - - Begin a load while including the specified path - - The path. - - - - - Gets the document URL for the specified entity. - - The entity. - - - - - Saves all the changes to the Raven server. - - - - - Queries the index specified by using lucene syntax. - - The result of the query - The type of the index creator. - - - - - Query the specified index using Lucene syntax - - - Name of the index. - - - - - Commits the specified tx id. - - The tx id. - - - - Rollbacks the specified tx id. - - The tx id. - - - - Promotes a transaction specified to a distributed transaction - - From tx id. - The token representing the distributed transaction - - - - Query RavenDB dynamically using LINQ - - The result of the query - - - - Dynamically query RavenDB using Lucene syntax - - - - - Create a new query for - - - - - Create a new query for - - - - - Register to lazily load documents and include - - - - - Gets the database commands. - - The database commands. - - - - Gets the async database commands. - - The async database commands. - - - - Access the lazy operations - - - - - Access the eager operations - - - - - Get the accessor for advanced operations - - - Those operations are rarely needed, and have been moved to a separate - property to avoid cluttering the API - - - - - Manages access to RavenDB and open sessions to work with RavenDB. - - - - - The current session id - only used during construction - - - - - Generate new instance of database commands - - - - - Initializes a new instance of the class. - - - - - Set document store settings based on a given connection string. - - The connection string to parse - - - - Copy the relevant connection string settings - - - - - Create the connection string parser - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Opens the session. - - - - - - Opens the session for a particular database - - - - - Initializes this instance. - - - - - - validate the configuration for the document store - - - - - Initialize the document store access method to RavenDB - - - - - Setup the context for no aggressive caching - - - This is mainly useful for internal use inside RavenDB, when we are executing - queries that have been marked with WaitForNonStaleResults, we temporarily disable - aggressive caching. - - - - - Subscribe to change notifications from the server - - - - - Setup the context for aggressive caching. - - Specify the aggressive cache duration - - Aggressive caching means that we will not check the server to see whatever the response - we provide is current or not, but will serve the information directly from the local cache - without touching the server. - - - - - Opens the async session. - - - - - - Opens the async session. - - - - - - Get the for the stores - - - - - Gets the database commands. - - The database commands. - - - - Gets the async database commands. - - The async database commands. - - - - Gets or sets the credentials. - - The credentials. - - - - Gets or sets the identifier for this store. - - The identifier. - - - - The API Key to use when authenticating against a RavenDB server that - supports API Key authentication - - - - - Gets or sets the name of the connection string name. - - - - - Gets or sets the default database name. - - The default database name. - - - - Called after dispose is completed - - - - - Max number of cached requests (default: 2048) - - - - - Options for handling failover scenarios in replication environment - - - - - Allow to read from the secondary server(s), but immediately fail writes - to the secondary server(s). - - - This is usually the safest approach, because it means that you can still serve - read requests when the primary node is down, but don't have to deal with replication - conflicts if there are writes to the secondary when the primary node is down. - - - - - Allow to read from the secondary server(s), but immediately fail writes - to the secondary server(s). - - - Choosing this option requires that you'll have some way of propogating changes - made to the secondary server(s) to the primary node when the primary goes back - up. - A typical strategy to handle this is to make sure that the replication is setup - in a master/master relationship, so any writes to the secondary server will be - replicated to the master server. - Please note, however, that this means that your code must be prepared to handle - conflicts in case of different writes to the same document across nodes. - - - - - Immediately fail the request, without attempting any failover. This is true for both - reads and writes. The RavenDB client will not even check that you are using replication. - - - This is mostly useful when your replication setup is meant to be used for backups / external - needs, and is not meant to be a failover storage. - - - - - Read requests will be spread across all the servers, instead of doing all the work against the master. - Write requests will always go to the master. - - - This is useful for striping, spreading the read load among multiple servers. The idea is that this will give us better read performance overall. - A single session will always use the same server, we don't do read striping within a single session. - Note that using this means that you cannot set UserOptimisticConcurrency to true, because that would generate concurrency exceptions. - If you want to use that, you have to open the session with ForceReadFromMaster set to true. - - - - - Generate hilo numbers against a RavenDB document - - - - - Initializes a new instance of the class. - - - - - Generates the document key. - - The convention. - The entity. - - - - - Create the next id (numeric) - - - - - Fluent interface for specifying include paths - for loading documents - - - - - Includes the specified path. - - The path. - - - - - Includes the specified path. - - The path. - - - - - Includes the specified path. - - The path. - - - - - Loads the specified ids. - - The ids. - - - - - Loads the specified id. - - The id. - - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Loads the specified ids. - - The ids. - - - - - Loads the specified id. - - - The id. - - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Holder for all the listeners for the session - - - - - Create a new instance of this class - - - - - The conversion listeners - - - - - The query listeners allow to modify queries before it is executed - - - - - The store listeners - - - - - The delete listeners - - - - - Fluent implementation for specifying include paths - for loading documents - - - - - Includes the specified path. - - The path. - - - - Includes the specified path. - - The path. - - - - Loads the specified ids. - - The ids. - - - - Loads the specified id. - - The id. - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Initializes a new instance of the class. - - The session. - - - - Loads the specified ids. - - - The ids. - - - - Loads the specified id. - - - The id. - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Generate a hilo key for each given type - - - - - Initializes a new instance of the class. - - - - - Generates the document key. - - The conventions. - The entity. - - - - - An implementation of for RavenDB Client API - - - - - Initializes a new instance of the class. - - - - - Notifies an enlisted object that an escalation of the delegated transaction has been requested. - - - A transmitter/receiver propagation token that marshals a distributed transaction. For more information, see . - - - - - Notifies a transaction participant that enlistment has completed successfully. - - An attempt to enlist or serialize a transaction. - - - - Notifies an enlisted object that the transaction is being committed. - - A interface used to send a response to the transaction manager. - - - - Notifies an enlisted object that the transaction is being rolled back. - - A object used to send a response to the transaction manager. - - - - Gets the local or distributed transaction id. - - The transaction information. - - - - - An implementation of for the Raven Client API, allowing Raven - Client API to participate in Distributed Transactions - - - - - Initializes a new instance of the class. - - - - - Notifies an enlisted object that a transaction is being prepared for commitment. - - A object used to send a response to the transaction manager. - - - - Notifies an enlisted object that a transaction is being committed. - - An object used to send a response to the transaction manager. - - - - Notifies an enlisted object that a transaction is being rolled back (aborted). - - A object used to send a response to the transaction manager. - - - - Notifies an enlisted object that the status of a transaction is in doubt. - - An object used to send a response to the transaction manager. - - - - Initializes this instance. - - - - - Rollbacks the specified single phase enlistment. - - The single phase enlistment. - - - - Helper class for reflection operations - - - - - Gets the full name without version information. - - Type of the entity. - - - - - A query that is executed against sharded instances - - - - - Initializes a new instance of the class. - - - - - Register the query as a lazy query in the session and return a lazy - instance that will evaluate the query only when needed - - - - - Grant access to the database commands - - - - - Grant access to the async database commands - - - - - Delegate definition when an entity is stored in the session - - - - - Delegate definition for converting an entity to a document and metadata - - - - - Delegate definition for converting a document and metadata to an entity - - - - - This exception occurs when a (replication) conflict is encountered. - Usually this required a user to manually resolve the conflict. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - 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). - - - - Gets or sets the conflicted version ids. - - The conflicted version ids. - - - - Gets or sets the conflicted document etag - - - - - This exception is raised when a non authoritative information is encountered - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - 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). - - - - This exception is thrown when a separate instance of an entity is added to the session - when a different entity with the same key already exists within the session. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - 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). - - - - This exception is raised whenever a trigger vetoes the read by the session - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - 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). - - - - Extension methods that make certain database command operations more convenient to use - - - - - Asynchronously creates an index - - The type that defines the index to be create. - The hook to the database commands. - Should the index be overwritten if it already exists. - - - - - Methods to create mutli tenants databases - - - - - Extension methods to create mutli tenants databases - - - - - Ensures that the database exists, creating it if needed - - - This operation happens _outside_ of any transaction - - - - - Ensures that the database exists, creating it if needed - - - - - Abstract class used to provide infrastructure service for actual creation tasks - - - - - Base class for creating indexes - - - The naming convention is that underscores in the inherited class names are replaced by slashed - For example: Posts_ByName will be saved to Posts/ByName - - - - - Creates the index definition. - - - - - - Provide a way to dynamically index values with runtime known values - - - - - Provide a way to dynamically index values with runtime known values - - - - - Generates a spatial field in the index, generating a Point from the provided lat/lng coordiates - - Latitude - Longitude - - - - - Generates a spatial field in the index, generating a Point from the provided lat/lng coordiates - - The field name, will be used for querying - Latitude - Longitude - - - - - Generates a spatial field in the index, generating a Point from the provided lat/lng coordiates - - The field name, will be uased for querying - The shape representatio in the WKT format - - - - - Generates a spatial field in the index, generating a Point from the provided lat/lng coordiates - - The field name, will be uased for querying - The shape representatio in the WKT format - The spatial strategy to use - - - - - Generates a spatial field in the index, generating a Point from the provided lat/lng coordiates - - The field name, will be uased for querying - The shape representatio in the WKT format - The spatial strategy to use - Maximum number of levels to be used in the PrefixTree, controls the precision of shape representation. - - - - - Allows to use lambdas recursively - - - - - Allows to use lambdas recursively - - - - - Allow to get to the metadata of the document - - - - - Allow to get to the metadata of the document - - - - - Executes the index creation against the specified document store. - - - - - Executes the index creation against the specified document database using the specified conventions - - - - - Executes the index creation against the specified document store. - - - - - Gets the name of the index. - - The name of the index. - - - - Gets or sets the document store. - - The document store. - - - - Generates a spatial field in the index, generating a Point from the provided lat/lng coordiates - - The field name, will be used for querying - Latitude - Longitude - - - - Generates a spatial field in the index, generating a Point from the provided lat/lng coordiates - - Latitude - Longitude - - - - Create a new instance - - - - - Register a field to be indexed - - - - - Register a field to be indexed - - - - - Register a field to be stored - - - - - Register a field to be stored - - - - - Register a field to be analyzed - - - - - Register a field to be analyzed - - - - - Register a field to be sorted - - - - - The result translator definition - - - - - The reduce definition - - - - - Index storage options - - - - - Index storage options - - - - - Index sort options - - - - - Index sort options - - - - - Index sort options - - - - - Indexing options - - - - - Indexing options - - - - - Allow to create indexes with multiple maps - - - - - Uses reflection to call for the base type and all available subclasses. - - This is taken from Oren's code in this thread https://groups.google.com/d/msg/ravendb/eFUlQG-spzE/Ac0PrvsFyJYJ - The base class type whose descendant types are to be included in the index. - - - - - Creates the index definition. - - - - - - Allow to create indexes with multiple maps - - - - - Extension methods that adds additional behavior during indexing operations - - - - - Marker method for allowing complex (multi entity) queries on the server. - - - - - Boost the value with the given amount - - - - - Marker method for allowing complex (multi entity) queries on the server. - - - - - Get the path from the expression, including considering dictionary calls - - - - - Get the actual value from the expression - - - - - Get the member expression from the expression - - - - - Filters a sequence of values based on a predicate. - - - - - Filters a sequence of values based on a predicate. - - - - - Sorts the elements of a sequence in ascending order according to a key. - - - - - Sorts the elements of a sequence in ascending order according to a key. - - - - - Sorts the elements of a sequence in descending order according to a key. - - - - - Sorts the elements of a sequence in descending order according to a key. - - - - - Projects each element of a sequence into a new form. - - - - - Projects each element of a sequence into a new form. - - - - - implementation of In operator - - - - - implementation of In operator - - - - - Bypasses a specified number of elements in a sequence and then returns the remaining elements. - - Summary: - - - - This allows queries such as Name:*term*, which tend to be much - more expensive and less performant than any other queries. - Consider carefully whatever you really need this, as there are other - alternative for searching without doing extremely expensive leading - wildcard matches. - - - - - Hook for users to provide additional logic for converting to / from - entities to document/metadata pairs. - - - - - Called when converting an entity to a document and metadata - - - - - Called when converting a document and metadata to an entity - - - - - Hook for users to provide additional logic on delete operations - - - - - Invoked before the delete request is sent to the server. - - The key. - The entity instance. - The metadata. - - - - Hook for users to modify all queries globally - - - - - Allow to customize a query globally - - - - - Hook for users to provide additional logic on store operations - - - - - Invoked before the store request is sent to the server. - - The key. - The entity instance. - The metadata. - The original document that was loaded from the server - - Whatever the entity instance was modified and requires us re-serialize it. - Returning true would force re-serialization of the entity, returning false would - mean that any changes to the entityInstance would be ignored in the current SaveChanges call. - - - - - Invoked after the store request is sent to the server. - - The key. - The entity instance. - The metadata. - - - - Base class for creating indexes - - - - - Base class for creating indexes - - - - - Creates the index definition. - - - - - - The map definition - - - - - Precedence values for operations - - - - - x.y f(x) a[x] x++ x-- new - - - - - + - ! ~ ++x --x (T)x - - - - - * / % - - - - - + - - - - - - << >> - - - - - < > <= >= is as - - - - - == != - - - - - & - - - - - ^ - - - - - | - - - - - && (AndAlso in VB) - - - - - || - - - - - ?? - - - - - ?: - - - - - = *= /= %= += -= <<= >>= &= ^= |= - - - - - pseudo operator for comparisons - - - - - Methods on the enum - - - - - Needs parenthesis for the expression - - - - - Based off of System.Linq.Expressions.ExpressionStringBuilder - - - - - Convert the expression to a string - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the element init. - - The initializer. - - - - - Visits the children of the extension expression. - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the lambda. - - - The node. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the member assignment. - - The assignment. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the member list binding. - - The binding. - - - - - Visits the member member binding. - - The binding. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - Visits the children of the . - - The expression to visit. - - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - - - DatabaseAccessor for loading documents in the translator - - - - - Loading a document during result transformers - - - - - Loading documents during result transformers - - - - - Will ask RavenDB to include this document in the query results - - - - - Will ask RavenDB to include these documents in the query results - - - - - Helper class for creating indexes from implementations of . - - - - - Creates the indexes found in the specified assembly. - - The assembly to scan for indexing tasks. - The document store. - - - - Creates the indexes found in the specified catalog - - The catalog to get indexing tasks from. - - - - Creates the indexes found in the specified catalog - - The catalog to get indexing tasks from. - The document store. - - - - Creates the indexes found in the specified assembly. - - The assembly to scan for indexing tasks. - The document store. - - - - Creates the indexes found in the specified catalog - - The catalog to get indexing tasks from. - The document store. - - - - Creates the indexes found in the specified catalog - - - - - This class provides a way to define a strongly typed index on the client. - - - - - Initializes a new instance of the class. - - - - - Toes the index definition. - - - - - Gets or sets the map function - - The map. - - - - Gets or sets the reduce function - - The reduce. - - - - Gets or sets the reduce function - - The reduce. - - - - Gets or sets the stores options - - The stores. - - - - Gets or sets the stores options - - The stores. - - - - Gets or sets the indexing options - - The indexes. - - - - Gets or sets the indexing options - - The indexes. - - - - Gets or sets the sort options. - - The sort options. - - - - Get os set the analyzers - - - - - Get os set the analyzers - - - - - This class provides a way to define a strongly typed index on the client. - - - - - Generate index defintion from linq expressions - - - - - Perform the actual generation - - - - - Create an index that allows to tag entities by their entity name - - - - - Creates the Raven/DocumentsByEntityName index - - - - - Return the actual index name - - - - - This class represents a node in an expression, usually a member - but in the case of dynamic queries the path to a member - - - - - Creates an ExpressionMemberInfo - - - - - Gets the full path of the member being referred to by this node - - - - - Gets the actual type being referred to - - - - - Whatever the expression is of a nested path - - - - - An implementation of with Raven specific operation - - - - - Provide statistics about the query, such as total count of matching records - - - - - Customizes the query using the specified action - - The action. - - - - - Extension for the built-in allowing for Raven specific operations - - - - - Callback to get the results of the query - - - - - Customizes the query using the specified action - - - - - Change the result type for the query provider - - - - - Convert the Linq query to a Lucene query - - - - - - Convert the Linq query to a lazy Lucene query and provide a function to execute when it is being evaluate - - - - - Move the registered after query actions - - - - - Gets the name of the index. - - The name of the index. - - - - Get the query generator - - - - - The action to execute on the customize query - - - - - Set the fields to fetch - - - - - Extensions to the linq syntax - - - Extensions to the linq syntax - - - - - Includes the specified path in the query, loading the document specified in that path - - The type of the object that holds the id that you want to include. - The source for querying - The path, which is name of the property that holds the id of the object to include. - - - - - Includes the specified path in the query, loading the document specified in that path - - The type of the object that holds the id that you want to include. - The type of the object that you want to include. - The source for querying - The path, which is name of the property that holds the id of the object to include. - - - - - Query the facets results for this query using the specified facet document - - - - - Query the facets results for this query using the specified facet document - - - - - Project using a different type - - - - - Partition the query so we can intersect different parts of the query - across different index entries. - - - - - Project using a different type - - - - - Suggest alternative values for the queried term - - - - - Suggest alternative values for the queried term - - - - - Lazy Suggest alternative values for the queried term - - - - - Lazy Suggest alternative values for the queried term - - - - - Suggest alternative values for the queried term - - - - - Suggest alternative values for the queried term - - - - - Register the query as a lazy query in the session and return a lazy - instance that will evaluate the query only when needed - - - - - Register the query as a lazy query in the session and return a lazy - instance that will evaluate the query only when needed - As well as a function to execute when the value is evaluated - - - - - Returns a list of results for a query asynchronously. - - - - - Returns the total count of results for a query asynchronously. - - - - - Perform a search for documents which fields that match the searchTerms. - If there is more than a single term, each of them will be checked independently. - - - - - Implements - - - - - Initializes a new instance of the class. - - - - - Gets the enumerator. - - - - - - Provide statistics about the query, such as total count of matching records - - - - - Customizes the query using the specified action - - The action. - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Get the last equality term for the query - - - - - Set the fields to fetch - - - - - Get the name of the index being queried - - - - - Grant access to the database commands - - - - - Grant access to the async database commands - - - - - An implementation of - - - - - Initializes a new instance of the class. - - - - - Change the result type for the query provider - - - - - Executes the query represented by a specified expression tree. - - An expression tree that represents a LINQ query. - - The value that results from executing the specified query. - - - - - Executes the specified expression. - - - The expression. - - - - - Executes the query represented by a specified expression tree. - - An expression tree that represents a LINQ query. - - The value that results from executing the specified query. - - - - - Callback to get the results of the query - - - - - Customizes the query using the specified action - - The action. - - - - Move the registered after query actions - - - - - Convert the expression to a Lucene query - - - - - Register the query as a lazy query in the session and return a lazy - instance that will evaluate the query only when needed - - - - - Convert the expression to a Lucene query - - - - - Gets the actions for customizing the generated lucene query - - - - - Gets the name of the index. - - The name of the index. - - - - Get the query generator - - - - - Set the fields to fetch - - - - - Set the fields to rename - - - - - Process a Linq expression to a Lucene query - - - - - The query generator - - - - - The index name - - - - - Initializes a new instance of the class. - - The document query generator. - The customize query. - Executed after the query run, allow access to the query results - The name of the index the query is executed against. - The fields to fetch in this query - The fields to rename for the results of this query - - - - Visits the expression and generate the lucene query - - The expression. - - - - Gets member info for the specified expression and the path to that expression - - - - - - - Gets the lucene query. - - The lucene query. - - - - Gets the lucene query. - - The lucene query. - - - - Executes the specified expression. - - The expression. - - - - - Gets the current path in the case of expressions within collections - - - - - Gets or sets the fields to fetch. - - The fields to fetch. - - - - Rename the fields from one name to another - - - - - Different query types - - - - - - - - - - - - - - - - - - - - Get count of items for the query - - - - - Get count of items for the query as an Int64 - - - - - Get only the first item - - - - - Get only the first item (or null) - - - - - Get only the first item (or throw if there are more than one) - - - - - Get only the first item (or throw if there are more than one) or null if empty - - - - - Statistics about a raven query. - Such as how many records match the query - - - - - Update the query stats from the query results - - - - - Whatever the query returned potentially stale results - - - - - What was the total count of the results that matched the query - - - - - Gets or sets the skipped results (duplicate documents); - - - - - The time when the query results were unstale. - - - - - The name of the index queried - - - - - The timestamp of the queried index - - - - - The etag of the queried index - - - - - Gets or sets a value indicating whether any of the documents returned by this query - are non authoritative (modified by uncommitted transaction). - - - - - The timestamp of the last time the index was queried - - - - - Promotes a transaction specified to a distributed transaction - - From tx id. - The token representing the distributed transaction - - - - Stores the recovery information for the specified transaction - - The resource manager Id for this transaction - The tx id. - The recovery information. - - - - Queries the specified index using Linq. - - The result of the query - Name of the index. - - - - - Query RavenDB dynamically using LINQ - - The result of the query - - - - Queries the index specified by using Linq. - - The result of the query - The type of the index creator. - - - - - Implements IDocumentQueryGenerator.Query - - - - - Implements IDocumentQueryGenerator.AsyncQuery - - - - - Implements Unit of Work for accessing a set of sharded RavenDB servers - - - - - Saves all the changes to the Raven server. - - - - - Implementers of this interface provide a way to decide which shards will be queried - for a specified operation - - - - - Generate a shard id for the specified entity - - - - - The shard id for the server that contains the metadata (such as the HiLo documents) - for the given entity - - - - - Selects the shard ids appropriate for the specified data. - Return a list of shards ids that will be search. Returning null means search all shards. - - - - Implements Unit of Work for accessing a set of sharded RavenDB servers - - - - - Initializes a new instance of the class. - - The shard strategy. - The shard IDatabaseCommands. - - - - - - - Loads the specified ids and a function to call when it is evaluated - - - - - Loads the specified id. - - - - - Loads the specified id and a function to call when it is evaluated - - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Loads the specified entities with the specified id after applying - conventions on the provided id to get the real document id. - - - This method allows you to call: - Load{Post}(1) - And that call will internally be translated to - Load{Post}("posts/1"); - - Or whatever your conventions specify. - - - - - Begin a load while including the specified path - - The path. - - - - Begin a load while including the specified path - - The path. - - - - Loads the specified ids. - - The ids. - - - - Register to lazily load documents and include - - - - - Saves all the changes to the Raven server. - - - - - Access the lazy operations - - - - - Access the eager operations - - - - - Implements a sharded document store - Hiding most sharding details behind this and the gives you the ability to use - sharding without really thinking about this too much - - - - - Initializes a new instance of the class. - - The shard strategy. - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Opens the async session. - - - - - - Opens the async session. - - - - - - Setup the context for aggressive caching. - - Specify the aggressive cache duration - - aggressive caching means that we will not check the server to see whatever the response - we provide is current or not, but will serve the information directly from the local cache - without touching the server. - - - - - Setup the context for no aggressive caching - - - This is mainly useful for internal use inside RavenDB, when we are executing - queries that has been marked with WaitForNonStaleResults, we temporarily disable - aggressive caching. - - - - - Opens the session. - - - - - - Opens the session for a particular database - - - - - Opens the session with the specified options. - - - - - Gets the etag of the last document written by any session belonging to this - document store - - - - - Initializes this instance. - - - - - - Executes the index creation against each of the shards. - - - - - Gets the shared operations headers. - - The shared operations headers. - - - - - Get the for this store - - - - - Gets or sets the identifier for this store. - - The identifier. - - - - Called after dispose is completed - - - - - Gets the async database commands. - - The async database commands. - - - - Gets the database commands. - - The database commands. - - - - Gets or sets the URL. - - - - - Apply an operation to all the shard session - - - - - Applies the specified action to all shard sessions. - - - - - Applies the specified action to all shard sessions. - - - - - Occurs on error, allows to handle an error one (or more) of the nodes - is failing - - - - - Occurs on error, allows to handle an error one (or more) of the nodes - is failing - - - - - Apply an operation to all the shard session in parallel - - - - - Applies the specified action to all shard sessions in parallel - - - - - Applies the specified action to all shard sessions in parallel - - - - - Apply an operation to all the shard session in sequence - - - - - Applies the specified action for all shard sessions. - - - The shard sessions. - The operation. - - - - - Generate a shard id for the specified entity - - - - - The shard id for the server that contains the metadata (such as the HiLo documents) - for the given entity - - - - - Selects the shard ids appropriate for the specified data. - Return a list of shards ids that will be search. Returning null means search all shards. - - - - Information required to resolve the appropriate shard for an entity / entity and key - - - - - Gets or sets the key. - - The key. - - - - Gets or sets the type of the entity. - - The type of the entity. - - - - Gets or sets the query being executed - - - - - Default shard strategy for the sharding document store - - - - - Merge the query results from all the shards into a single query results object by simply - concatenating all of the values - - - - - Instructs the sharding strategy to shard the instances based on - round robin strategy. - - - - - Instructs the sharding strategy to shard the instances based on - the property specified in , with an optional translation to - the shard id. - - - - - Instructs the sharding strategy to shard the instances based on - the property specified in , with an optional translation of the value - from a non string representation to a string and from a string to the shard id. - - - - - Merge the query results from all the shards into a single query results object - - - - - Gets or sets the shard resolution strategy. - - - - - Gets or sets the shard access strategy. - - - - - Get or sets the modification for the document id for sharding - - - - - The event arguments raised when an entity is stored - - - - - Gets or sets the session identifier. - - The session identifier. - - - - Gets or sets the entity instance. - - The entity instance. - - - - Original code taken from: - https://raw.github.com/einars/js-beautify/master/attic/unmaintained/c-sharp/JSBeautify.cs - Used under the BSD license: https://github.com/einars/js-beautify/blob/master/license.txt - - - - - The Inflector class transforms words from one - form to another. For example, from singular to plural. - - - - - Return the plural of a word. - - The singular form - The plural form of - - - - Return the singular of a word. - - The plural form - The singular form of - - - - Capitalizes a word. - - The word to be capitalized. - capitalized. - - - - A generic object comparerer that would only use object's reference, - ignoring any or overrides. - - - - - The default ObjectReferenceEqualityComparerer instance - - - - - When overridden in a derived class, determines whether two objects of type are equal. - - - true if the specified objects are equal; otherwise, false. - - The first object to compare.The second object to compare. - - - - When overridden in a derived class, serves as a hash function for the specified object for hashing algorithms and data structures, such as a hash table. - - - A hash code for the specified object. - - The object for which to get a hash code.The type of is a reference type and is null. - - - - Parameters for the Where Equals call - - - - - Create a new instance - - - - - The field name - - - - - The field value - - - - - Should the field be analyzed - - - - - Should the field allow wildcards - - - - - Is this a root property or not? - - - - diff --git a/lib/RavenDB/RavenDB.Client.992/Raven.Client.Lightweight.dll b/lib/RavenDB/RavenDB.Client.992/Raven.Client.Lightweight.dll deleted file mode 100644 index d92971ccd5e..00000000000 Binary files a/lib/RavenDB/RavenDB.Client.992/Raven.Client.Lightweight.dll and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Client.992/Raven.Client.Lightweight.pdb b/lib/RavenDB/RavenDB.Client.992/Raven.Client.Lightweight.pdb deleted file mode 100644 index baccdd9c3aa..00000000000 Binary files a/lib/RavenDB/RavenDB.Client.992/Raven.Client.Lightweight.pdb and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/BouncyCastle.Crypto.dll b/lib/RavenDB/RavenDB.Database.992/BouncyCastle.Crypto.dll deleted file mode 100644 index a078d27b4c9..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/BouncyCastle.Crypto.dll and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/BouncyCastle.Crypto.pdb b/lib/RavenDB/RavenDB.Database.992/BouncyCastle.Crypto.pdb deleted file mode 100644 index 0d4d0d7fdcb..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/BouncyCastle.Crypto.pdb and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Esent.Interop.pdb b/lib/RavenDB/RavenDB.Database.992/Esent.Interop.pdb deleted file mode 100644 index e0d30f67be8..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Esent.Interop.pdb and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Esent.Interop.xml b/lib/RavenDB/RavenDB.Database.992/Esent.Interop.xml deleted file mode 100644 index fe015f385ec..00000000000 --- a/lib/RavenDB/RavenDB.Database.992/Esent.Interop.xml +++ /dev/null @@ -1,30180 +0,0 @@ - - - - Esent.Interop - - - - - Managed versions of the ESENT Api. This class contains static methods corresponding - with the unmanaged ESENT Api. These methods throw exceptions when errors are returned. - - - Helper methods for the ESENT API. These aren't interop versions - of the API, but encapsulate very common uses of the functions. - - - Helper methods for the ESENT API. These wrap JetMakeKey. - - - Helper methods for the ESENT API. These do data conversion for - setting columns. - - - Helper methods for the ESENT API. These methods deal with database - meta-data. - - - Helper methods for the ESENT API. These do data conversion for - JetMakeKey. - - - Internal-only methods of the Api. - - - API members that are marked as obsolete. - - - Helper methods for the ESENT API. These aren't interop versions - of the API, but encapsulate very common uses of the functions. - - - - - Initializes static members of the Api class. - - - - - Allocates a new instance of the database engine. - - Returns the new instance. - The name of the instance. Names must be unique. - - - - Allocate a new instance of the database engine for use in a single - process, with a display name specified. - - Returns the newly create instance. - - Specifies a unique string identifier for the instance to be created. - This string must be unique within a given process hosting the - database engine. - - - A display name for the instance to be created. This will be used - in eventlog entries. - - Creation options. - - - - Initialize the ESENT database engine. - - - The instance to initialize. If an instance hasn't been - allocated then a new one is created and the engine - will operate in single-instance mode. - - - - - Initialize the ESENT database engine. - - - The instance to initialize. If an instance hasn't been - allocated then a new one is created and the engine - will operate in single-instance mode. - - - Initialization options. - - - A warning code. - - - - - Retrieves information about the instances that are running. - - - Returns the number of instances. - - - Returns an array of instance info objects, one for each running - instance. - - - - - Prevents streaming backup-related activity from continuing on a - specific running instance, thus ending the streaming backup in - a predictable way. - - The instance to use. - - - - Prepares an instance for termination. - - The (running) instance to use. - - - - Terminate an instance that was created with or - . - - The instance to terminate. - - - - Terminate an instance that was created with or - . - - The instance to terminate. - Termination options. - - - - Sets database configuration options. - - - The instance to set the option on or - to set the option on all instances. - - The session to use. - The parameter to set. - The value of the parameter to set, if the parameter is an integer type. - The value of the parameter to set, if the parameter is a string type. - An ESENT warning code. - - - - Sets database configuration options. - - - The instance to set the option on or - to set the option on all instances. - - The session to use. - The parameter to set. - The value of the parameter to set, if the parameter is a JET_CALLBACK. - The value of the parameter to set, if the parameter is a string type. - An ESENT warning code. - - - - Gets database configuration options. - - The instance to retrieve the options from. - The session to use. - The parameter to get. - Returns the value of the parameter, if the value is an integer. - Returns the value of the parameter, if the value is a string. - The maximum size of the parameter string. - An ESENT warning code. - - passes in the error number in the paramValue, which is why it is - a ref parameter and not an out parameter. - - - - - Retrieves the version of the database engine. - - The session to use. - Returns the version number of the database engine. - - - - Creates and attaches a database file. - - The session to use. - The path to the database file to create. - The parameter is not used. - Returns the dbid of the new database. - Database creation options. - - - - Creates and attaches a database file with a maximum database size specified. - . - - The session to use. - The path to the database file to create. - - The maximum size, in database pages, of the database. Passing 0 means there is - no enforced maximum. - - Returns the dbid of the new database. - Database creation options. - - - - Attaches a database file for use with a database instance. In order to use the - database, it will need to be subsequently opened with . - - The session to use. - The database to attach. - Attach options. - An ESENT warning code. - - - - Attaches a database file for use with a database instance. In order to use the - database, it will need to be subsequently opened with . - - The session to use. - The database to attach. - - The maximum size, in database pages, of the database. Passing 0 means there is - no enforced maximum. - - Attach options. - An ESENT warning code. - - - - Opens a database previously attached with , - for use with a database session. This function can be called multiple times - for the same database. - - The session that is opening the database. - The database to open. - Reserved for future use. - Returns the dbid of the attached database. - Open database options. - An ESENT warning code. - - - - Closes a database file that was previously opened with or - created with . - - The session to use. - The database to close. - Close options. - - - - Releases a database file that was previously attached to a database session. - - The database session to use. - The database to detach. - - - - Makes a copy of an existing database. The copy is compacted to a - state optimal for usage. Data in the copied data will be packed - according to the measures chosen for the indexes at index create. - In this way, compacted data may be stored as densely as possible. - Alternatively, compacted data may reserve space for subsequent - record growth or index insertions. - - The session to use for the call. - The source database that will be compacted. - The name to use for the compacted database. - - A callback function that can be called periodically through the - database compact operation to report progress. - - - This parameter is ignored and should be null. - - Compact options. - - - - Extends the size of a database that is currently open. - - The session to use. - The database to grow. - The desired size of the database, in pages. - - The size of the database, in pages, after the call. - - - - - Sets the size of an unopened database file. - - The session to use. - The name of the database. - The desired size of the database, in pages. - - The size of the database, in pages, after the call. - - - - - Retrieves certain information about the given database. - - The session to use. - The database identifier. - The value to be retrieved. - The specific data to retrieve. - - - - Retrieves certain information about the given database. - - The session to use. - The database identifier. - The value to be retrieved. - The specific data to retrieve. - - - - Retrieves certain information about the given database. - - The session to use. - The database identifier. - The value to be retrieved. - The specific data to retrieve. - - - - Retrieves certain information about the given database. - - The file name of the database. - The value to be retrieved. - The specific data to retrieve. - - - - Retrieves certain information about the given database. - - The file name of the database. - The value to be retrieved. - The specific data to retrieve. - - - - Retrieves certain information about the given database. - - The file name of the database. - The value to be retrieved. - The specific data to retrieve. - - - - Performs a streaming backup of an instance, including all the attached - databases, to a directory. With multiple backup methods supported by - the engine, this is the simplest and most encapsulated function. - - The instance to backup. - - The directory where the backup is to be stored. If the backup path is - null to use the function will truncate the logs, if possible. - - Backup options. - - Optional status notification callback. - - - - - Restores and recovers a streaming backup of an instance including all - the attached databases. It is designed to work with a backup created - with the function. This is the - simplest and most encapsulated restore function. - - - The instance to use. The instance should not be initialized. - Restoring the files will initialize the instance. - - - Location of the backup. The backup should have been created with - . - - - Name of the folder where the database files from the backup set will - be copied and recovered. If this is set to null, the database files - will be copied and recovered to their original location. - - - Optional status notification callback. - - - - - Starts a snapshot. While the snapshot is in progress, no - write-to-disk activity by the engine can take place. - - The snapshot session. - - Returns the number of instances that are part of the snapshot session. - - - Returns information about the instances that are part of the snapshot session. - - - Snapshot freeze options. - - - - - Begins the preparations for a snapshot session. A snapshot session - is a short time interval in which the engine does not issue any - write IOs to disk, so that the engine can participate in a volume - snapshot session (when driven by a snapshot writer). - - Returns the ID of the snapshot session. - Snapshot options. - - - - Notifies the engine that it can resume normal IO operations after a - freeze period and a successful snapshot. - - The ID of the snapshot. - Thaw options. - - - - Initiates an external backup while the engine and database are online and active. - - The instance prepare for backup. - Backup options. - - - - Closes a file that was opened with JetOpenFileInstance after the - data from that file has been extracted using JetReadFileInstance. - - The instance to use. - The handle to close. - - - - Ends an external backup session. This API is the last API in a series - of APIs that must be called to execute a successful online - (non-VSS based) backup. - - The instance to end the backup for. - - - - Ends an external backup session. This API is the last API in a series - of APIs that must be called to execute a successful online - (non-VSS based) backup. - - The instance to end the backup for. - Options that specify how the backup ended. - - - - Used during a backup initiated by - to query an instance for the names of database files that should become part of - the backup file set. Only databases that are currently attached to the instance - using will be considered. These files may - subsequently be opened using and read - using . - - - It is important to note that this API does not return an error or warning if - the output buffer is too small to accept the full list of files that should be - part of the backup file set. - - The instance to get the information for. - - Returns a list of null terminated strings describing the set of database files - that should be a part of the backup file set. The list of strings returned in - this buffer is in the same format as a multi-string used by the registry. Each - null-terminated string is returned in sequence followed by a final null terminator. - - - Maximum number of characters to retrieve. - - - Actual size of the file list. If this is greater than maxChars - then the list has been truncated. - - - - - Used during a backup initiated by - to query an instance for the names of database patch files and logfiles that - should become part of the backup file set. These files may subsequently be - opened using and read using . - - - It is important to note that this API does not return an error or warning if - the output buffer is too small to accept the full list of files that should be - part of the backup file set. - - The instance to get the information for. - - Returns a list of null terminated strings describing the set of database patch files - and log files that should be a part of the backup file set. The list of strings returned in - this buffer is in the same format as a multi-string used by the registry. Each - null-terminated string is returned in sequence followed by a final null terminator. - - - Maximum number of characters to retrieve. - - - Actual size of the file list. If this is greater than maxChars - then the list has been truncated. - - - - - Used during a backup initiated by - to query an instance for the names of the transaction log files that can be safely - deleted after the backup has successfully completed. - - - It is important to note that this API does not return an error or warning if - the output buffer is too small to accept the full list of files that should be - part of the backup file set. - - The instance to get the information for. - - Returns a list of null terminated strings describing the set of database log files - that can be safely deleted after the backup completes. The list of strings returned in - this buffer is in the same format as a multi-string used by the registry. Each - null-terminated string is returned in sequence followed by a final null terminator. - - - Maximum number of characters to retrieve. - - - Actual size of the file list. If this is greater than maxChars - then the list has been truncated. - - - - - Opens an attached database, database patch file, or transaction log - file of an active instance for the purpose of performing a streaming - fuzzy backup. The data from these files can subsequently be read - through the returned handle using JetReadFileInstance. The returned - handle must be closed using JetCloseFileInstance. An external backup - of the instance must have been previously initiated using - JetBeginExternalBackupInstance. - - The instance to use. - The file to open. - Returns a handle to the file. - Returns the least significant 32 bits of the file size. - Returns the most significant 32 bits of the file size. - - - - Retrieves the contents of a file opened with . - - The instance to use. - The file to read from. - The buffer to read into. - The size of the buffer. - Returns the amount of data read into the buffer. - - - - Used during a backup initiated by JetBeginExternalBackup to delete - any transaction log files that will no longer be needed once the - current backup completes successfully. - - The instance to truncate. - - - - Initialize a new ESENT session. - - The initialized instance to create the session in. - Returns the created session. - The parameter is not used. - The parameter is not used. - - - - Associates a session with the current thread using the given context - handle. This association overrides the default engine requirement - that a transaction for a given session must occur entirely on the - same thread. Use to remove the - association. - - The session to set the context on. - The context to set. - - - - Disassociates a session from the current thread. This should be - used in conjunction with . - - The session to use. - - - - Ends a session. - - The session to end. - This parameter is not used. - - - - Initialize a new ESE session in the same instance as the given sesid. - - The session to duplicate. - Returns the new session. - - - - Opens a cursor on a previously created table. - - The database session to use. - The database to open the table in. - The name of the table to open. - The parameter is not used. - The parameter is not used. - Table open options. - Returns the opened table. - - - - Close an open table. - - The session which opened the table. - The table to close. - - - - Duplicates an open cursor and returns a handle to the duplicated cursor. - If the cursor that was duplicated was a read-only cursor then the - duplicated cursor is also a read-only cursor. - Any state related to constructing a search key or updating a record is - not copied into the duplicated cursor. In addition, the location of the - original cursor is not duplicated into the duplicated cursor. The - duplicated cursor is always opened on the clustered index and its - location is always on the first row of the table. - - The session to use. - The cursor to duplicate. - The duplicated cursor. - Reserved for future use. - - - - Walks each index of a table to exactly compute the number of entries - in an index, and the number of distinct keys in an index. This - information, together with the number of database pages allocated - for an index and the current time of the computation is stored in - index metadata in the database. This data can be subsequently retrieved - with information operations. - - The session to use. - The table that the statistics will be computed on. - - - - Enables the application to associate a context handle known as - Local Storage with a cursor or the table associated with that - cursor. This context handle can be used by the application to - store auxiliary data that is associated with a cursor or table. - The application is later notified using a runtime callback when - the context handle must be released. This makes it possible to - associate dynamically allocated state with a cursor or table. - - The session to use. - The cursor to use. - The context handle to be associated with the session or cursor. - Set options. - - - - Enables the application to retrieve the context handle known - as Local Storage that is associated with a cursor or the table - associated with that cursor. This context handle must have been - previously set using . JetGetLS can also - be used to simultaneously fetch the current context handle for - a cursor or table and reset that context handle. - - The session to use. - The cursor to use. - Returns the retrieved context handle. - Retrieve options. - - - - Determine whether an update of the current record of a cursor - will result in a write conflict, based on the current update - status of the record. It is possible that a write conflict will - ultimately be returned even if JetGetCursorInfo returns successfully. - because another session may update the record before the current - session is able to update the same record. - - The session to use. - The cursor to check. - - - - Causes a session to enter a transaction or create a new save point in an existing - transaction. - - The session to begin the transaction for. - - - - Causes a session to enter a transaction or create a new save point in an existing - transaction. - - The session to begin the transaction for. - Transaction options. - - - - Commits the changes made to the state of the database during the current save point - and migrates them to the previous save point. If the outermost save point is committed - then the changes made during that save point will be committed to the state of the - database and the session will exit the transaction. - - The session to commit the transaction for. - Commit options. - - - - Undoes the changes made to the state of the database - and returns to the last save point. JetRollback will also close any cursors - opened during the save point. If the outermost save point is undone, the - session will exit the transaction. - - The session to rollback the transaction for. - Rollback options. - - - - Create an empty table. The newly created table is opened exclusively. - - The session to use. - The database to create the table in. - The name of the table to create. - Initial number of pages in the table. - - The default density of the table. This is used when doing sequential inserts. - - Returns the tableid of the new table. - - - - Add a new column to an existing table. - - The session to use. - The table to add the column to. - The name of the column. - The definition of the column. - The default value of the column. - The size of the default value. - Returns the columnid of the new column. - - - - Deletes a column from a database table. - - The session to use. - A cursor on the table to delete the column from. - The name of the column to be deleted. - - - - Deletes a column from a database table. - - The session to use. - A cursor on the table to delete the column from. - The name of the column to be deleted. - Column deletion options. - - - - Deletes an index from a database table. - - The session to use. - A cursor on the table to delete the index from. - The name of the index to be deleted. - - - - Deletes a table from a database. - - The session to use. - The database to delete the table from. - The name of the table to delete. - - - - Creates an index over data in an ESE database. An index can be used to locate - specific data quickly. - - The session to use. - The table to create the index on. - - Pointer to a null-terminated string that specifies the name of the index to create. - - Index creation options. - - Pointer to a double null-terminated string of null-delimited tokens. - - - The length, in characters, of szKey including the two terminating nulls. - - Initial B+ tree density. - - - - Creates indexes over data in an ESE database. - - - When creating multiple indexes (i.e. with numIndexCreates - greater than 1) this method MUST be called - outside of any transactions and with exclusive access to the - table. The JET_TABLEID returned by - will have exlusive access or the table can be opened for - exclusive access by passing - to . - - The session to use. - The table to create the index on. - Array of objects describing the indexes to be created. - Number of index description objects. - - - - Creates a temporary table with a single index. A temporary table - stores and retrieves records just like an ordinary table created - using JetCreateTableColumnIndex. However, temporary tables are - much faster than ordinary tables due to their volatile nature. - They can also be used to very quickly sort and perform duplicate - removal on record sets when accessed in a purely sequential manner. - Also see - , - . - . - - The session to use. - - Column definitions for the columns created in the temporary table. - - Number of column definitions. - Table creation options. - - Returns the tableid of the temporary table. Closing this tableid - with frees the resources associated - with the temporary table. - - - The output buffer that receives the array of column IDs generated - during the creation of the temporary table. The column IDs in this - array will exactly correspond to the input array of column definitions. - As a result, the size of this buffer must correspond to the size of - the input array. - - - - - Creates a temporary table with a single index. A temporary table - stores and retrieves records just like an ordinary table created - using JetCreateTableColumnIndex. However, temporary tables are - much faster than ordinary tables due to their volatile nature. - They can also be used to very quickly sort and perform duplicate - removal on record sets when accessed in a purely sequential manner. - Also see - , - . - . - - The session to use. - - Column definitions for the columns created in the temporary table. - - Number of column definitions. - - The locale ID to use to compare any Unicode key column data in the temporary table. - Any locale may be used as long as the appropriate language pack has been installed - on the machine. - - Table creation options. - - Returns the tableid of the temporary table. Closing this tableid - with frees the resources associated - with the temporary table. - - - The output buffer that receives the array of column IDs generated - during the creation of the temporary table. The column IDs in this - array will exactly correspond to the input array of column definitions. - As a result, the size of this buffer must correspond to the size of - the input array. - - - - - Creates a temporary table with a single index. A temporary table - stores and retrieves records just like an ordinary table created - using JetCreateTableColumnIndex. However, temporary tables are - much faster than ordinary tables due to their volatile nature. - They can also be used to very quickly sort and perform duplicate - removal on record sets when accessed in a purely sequential manner. - Also see - , - , - . - - The session to use. - - Column definitions for the columns created in the temporary table. - - Number of column definitions. - - The Locale ID and normalization flags that will be used to compare - any Unicode key column data in the temporary table. When this - is not present then the default options are used. - - Table creation options. - - Returns the tableid of the temporary table. Closing this tableid - with frees the resources associated - with the temporary table. - - - The output buffer that receives the array of column IDs generated - during the creation of the temporary table. The column IDs in this - array will exactly correspond to the input array of column definitions. - As a result, the size of this buffer must correspond to the size of - the input array. - - - - - Creates a table, adds columns, and indices on that table. - - The session to use. - The database to which to add the new table. - Object describing the table to create. - - - - Retrieves information about a table column. - - The session to use. - The table containing the column. - The name of the column. - Filled in with information about the column. - - - - Retrieves information about a table column. - - The session to use. - The table containing the column. - The columnid of the column. - Filled in with information about the column. - - - - Retrieves information about all columns in the table. - - The session to use. - The table containing the column. - The parameter is ignored. - Filled in with information about the columns in the table. - - - - Retrieves information about a table column. - - The session to use. - The database that contains the table. - The name of the table containing the column. - The name of the column. - Filled in with information about the column. - - - - Retrieves information about all columns in a table. - - The session to use. - The database that contains the table. - The name of the table containing the column. - This parameter is ignored. - Filled in with information about the columns in the table. - - - - Retrieves information about a column in a table. - - The session to use. - The database that contains the table. - The name of the table containing the column. - The name of the column. - Filled in with information about the columns in the table. - - - - Retrieves information about database objects. - - The session to use. - The database to use. - Filled in with information about the objects in the database. - - - - Retrieves information about database objects. - - The session to use. - The database to use. - The type of the object. - The object name about which to retrieve information. - Filled in with information about the objects in the database. - - - - Ddetermines the name of the current - index of a given cursor. This name is also used to later re-select - that index as the current index using . - It can also be used to discover the properties of that index using - JetGetTableIndexInfo. - - The session to use. - The cursor to get the index name for. - Returns the name of the index. - - The maximum length of the index name. Index names are no more than - characters. - - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with and - . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with and - . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with and - . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - - - - Retrieves information about indexes on a table. - - The session to use. - The database to use. - The name of the table to retrieve index information about. - The name of the index to retrieve information about. - Filled in with information about indexes on the table. - The type of information to retrieve. - - - - Retrieves information about indexes on a table. - - The session to use. - The database to use. - The name of the table to retrieve index information about. - The name of the index to retrieve information about. - Filled in with information about indexes on the table. - The type of information to retrieve. - - - - Retrieves information about indexes on a table. - - The session to use. - The database to use. - The name of the table to retrieve index information about. - The name of the index to retrieve information about. - Filled in with information about indexes on the table. - The type of information to retrieve. - - - - Retrieves information about indexes on a table. - - The session to use. - The database to use. - The name of the table to retrieve index information about. - The name of the index to retrieve information about. - Filled in with information about indexes on the table. - The type of information to retrieve. - - - - Retrieves information about indexes on a table. - - The session to use. - The table to retrieve index information about. - The name of the index. - Filled in with information about indexes on the table. - The type of information to retrieve. - - - - Retrieves information about indexes on a table. - - The session to use. - The table to retrieve index information about. - The name of the index. - Filled in with information about indexes on the table. - The type of information to retrieve. - - - - Retrieves information about indexes on a table. - - The session to use. - The table to retrieve index information about. - The name of the index. - Filled in with information about indexes on the table. - The type of information to retrieve. - - - - Retrieves information about indexes on a table. - - The session to use. - The table to retrieve index information about. - The name of the index. - Filled in with information about indexes on the table. - The type of information to retrieve. - - - - Changes the name of an existing table. - - The session to use. - The database containing the table. - The name of the table. - The new name of the table. - - - - Changes the name of an existing column. - - The session to use. - The table containing the column. - The name of the column. - The new name of the column. - Column rename options. - - - - Changes the default value of an existing column. - - The session to use. - The database containing the column. - The name of the table containing the column. - The name of the column. - The new default value. - Size of the new default value. - Column default value options. - - - - Positions a cursor to an index entry for the record that is associated with - the specified bookmark. The bookmark can be used with any index defined over - a table. The bookmark for a record can be retrieved using . - - The session to use. - The cursor to position. - The bookmark used to position the cursor. - The size of the bookmark. - - - - Positions a cursor to an index entry that is associated with the - specified secondary index bookmark. The secondary index bookmark - must be used with the same index over the same table from which it - was originally retrieved. The secondary index bookmark for an index - entry can be retrieved using . - - The session to use. - The table cursor to position. - The buffer that contains the secondary key. - The size of the secondary key. - The buffer that contains the primary key. - The size of the primary key. - Options for positioning the bookmark. - - - - Navigate through an index. The cursor can be positioned at the start or - end of the index and moved backwards and forwards by a specified number - of index entries. Also see - , , - , . - - The session to use for the call. - The cursor to position. - An offset which indicates how far to move the cursor. - Move options. - - - - Navigate through an index. The cursor can be positioned at the start or - end of the index and moved backwards and forwards by a specified number - of index entries. Also see - , , - , . - - The session to use for the call. - The cursor to position. - An offset which indicates how far to move the cursor. - Move options. - - - - Constructs search keys that may then be used by and . - - - The MakeKey functions provide datatype-specific make key functionality. - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Size of the data. - Key options. - - - - Efficiently positions a cursor to an index entry that matches the search - criteria specified by the search key in that cursor and the specified - inequality. A search key must have been previously constructed using - . - Also see . - - The session to use. - The cursor to position. - Seek options. - An ESENT warning. - - - - Temporarily limits the set of index entries that the cursor can walk using - to those starting - from the current index entry and ending at the index entry that matches the - search criteria specified by the search key in that cursor and the specified - bound criteria. A search key must have been previously constructed using - . - Also see . - - The session to use. - The cursor to set the index range on. - Index range options. - - - - Computes the intersection between multiple sets of index entries from different secondary - indices over the same table. This operation is useful for finding the set of records in a - table that match two or more criteria that can be expressed using index ranges. Also see - . - - The session to use. - - An the index ranges to intersect. The tableids in the ranges - must have index ranges set on them. Use - to create an index range. - - - The number of index ranges. - - - Returns information about the temporary table containing the intersection results. - - Intersection options. - - - - Set the current index of a cursor. - - The session to use. - The cursor to set the index on. - - The name of the index to be selected. If this is null or empty the primary - index will be selected. - - - - - Set the current index of a cursor. - - The session to use. - The cursor to set the index on. - - The name of the index to be selected. If this is null or empty the primary - index will be selected. - - - Set index options. - - - - - Set the current index of a cursor. - - The session to use. - The cursor to set the index on. - - The name of the index to be selected. If this is null or empty the primary - index will be selected. - - - Set index options. - - - Sequence number of the multi-valued column value which will be used - to position the cursor on the new index. This parameter is only used - in conjunction with . When - this parameter is not present or is set to zero, its value is presumed - to be 1. - - - - - Set the current index of a cursor. - - The session to use. - The cursor to set the index on. - - The name of the index to be selected. If this is null or empty the primary - index will be selected. - - - The id of the index to select. This id can be obtained using JetGetIndexInfo - or JetGetTableIndexInfo with the option. - - - Set index options. - - - Sequence number of the multi-valued column value which will be used - to position the cursor on the new index. This parameter is only used - in conjunction with . When - this parameter is not present or is set to zero, its value is presumed - to be 1. - - - - - Counts the number of entries in the current index from the current position forward. - The current position is included in the count. The count can be greater than the - total number of records in the table if the current index is over a multi-valued - column and instances of the column have multiple-values. If the table is empty, - then 0 will be returned for the count. - - The session to use. - The cursor to count the records in. - Returns the number of records. - - The maximum number of records to count. A value of 0 indicates that the count - is unlimited. - - - - - Notifies the database engine that the application is scanning the entire - index that the cursor is positioned on. Consequently, the methods that - are used to access the index data will be tuned to make this scenario as - fast as possible. - Also see . - - The session to use. - The cursor that will be accessing the data. - Reserved for future use. - - - - Notifies the database engine that the application is no longer scanning the - entire index the cursor is positioned on. This call reverses a notification - sent by . - - The session to use. - The cursor that was accessing the data. - Reserved for future use. - - - - Returns the fractional position of the current record in the current index - in the form of a structure. - Also see . - - The session to use. - The cursor positioned on the record. - Returns the approximate fractional position of the record. - - - - Moves a cursor to a new location that is a fraction of the way through - the current index. - Also see . - - The session to use. - The cursor to position. - The approximate position to move to. - - - - Retrieves the bookmark for the record that is associated with the index entry - at the current position of a cursor. This bookmark can then be used to - reposition that cursor back to the same record using . - The bookmark will be no longer than - bytes. - Also see . - - The session to use. - The cursor to retrieve the bookmark from. - Buffer to contain the bookmark. - Size of the bookmark buffer. - Returns the actual size of the bookmark. - - - - Retrieves a special bookmark for the secondary index entry at the - current position of a cursor. This bookmark can then be used to - efficiently reposition that cursor back to the same index entry - using JetGotoSecondaryIndexBookmark. This is most useful when - repositioning on a secondary index that contains duplicate keys or - that contains multiple index entries for the same record. - - The session to use. - The cursor to retrieve the bookmark from. - Output buffer for the secondary key. - Size of the secondary key buffer. - Returns the size of the secondary key. - Output buffer for the primary key. - Size of the primary key buffer. - Returns the size of the primary key. - Options for the call. - - - - Retrieves the key for the index entry at the current position of a cursor. - Also see . - - The session to use. - The cursor to retrieve the key from. - The buffer to retrieve the key into. - The size of the buffer. - Returns the actual size of the data. - Retrieve key options. - - - - Retrieves a single column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - Alternatively, this function can retrieve a column from a record being created - in the cursor copy buffer. This function can also retrieve column data from an - index entry that references the current record. In addition to retrieving the - actual column value, JetRetrieveColumn can also be used to retrieve the size - of a column, before retrieving the column data itself so that application - buffers can be sized appropriately. - - - The RetrieveColumnAs functions provide datatype-specific retrieval functions. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data buffer to be retrieved into. - The size of the data buffer. - Returns the actual size of the data buffer. - Retrieve column options. - - If pretinfo is give as NULL then the function behaves as though an itagSequence - of 1 and an ibLongValue of 0 (zero) were given. This causes column retrieval to - retrieve the first value of a multi-valued column, and to retrieve long data at - offset 0 (zero). - - An ESENT warning code. - - - - Retrieves multiple column values from the current record in a - single operation. An array of JET_RETRIEVECOLUMN structures is - used to describe the set of column values to be retrieved, and - to describe output buffers for each column value to be retrieved. - - The session to use. - The cursor to retrieve the data from. - - An array of one or more objects - describing the data to be retrieved. - - - The number of entries in the columns array. - - - If any column retrieved is truncated due to an insufficient - length buffer, then the API will return - . However other errors - JET_wrnColumnNull are returned only in the error field of - the object. - - - - - Efficiently retrieves a set of columns and their values from the - current record of a cursor or the copy buffer of that cursor. The - columns and values retrieved can be restricted by a list of - column IDs, itagSequence numbers, and other characteristics. This - column retrieval API is unique in that it returns information in - dynamically allocated memory that is obtained using a - user-provided realloc compatible callback. This new flexibility - permits the efficient retrieval of column data with specific - characteristics (such as size and multiplicity) that are unknown - to the caller. This eliminates the need for the use of the discovery - modes of JetRetrieveColumn to determine those - characteristics in order to setup a final call to - JetRetrieveColumn that will successfully retrieve - the desired data. - - The session to use. - The cursor to retrieve data from. - The numbers of JET_ENUMCOLUMNIDS. - - An optional array of column IDs, each with an optional array of itagSequence - numbers to enumerate. - - - Returns the number of column values retrieved. - - - Returns the enumerated column values. - - - Callback used to allocate memory. - - - Context for the allocation callback. - - - Sets a cap on the amount of data to return from a long text or long - binary column. This parameter can be used to prevent the enumeration - of an extremely large column value. - - Retrieve options. - A warning or success. - - - - Deletes the current record in a database table. - - The session that opened the cursor. - The cursor on a database table. The current row will be deleted. - - - - Prepare a cursor for update. - - The session which is starting the update. - The cursor to start the update for. - The type of update to prepare. - - - - The JetUpdate function performs an update operation including inserting a new row into - a table or updating an existing row. Deleting a table row is performed by calling - . - - The session which started the update. - The cursor to update. An update should be prepared. - Returns the bookmark of the updated record. This can be null. - The size of the bookmark buffer. - Returns the actual size of the bookmark. - - JetUpdate is the final step in performing an insert or an update. The update is begun by - calling and then by calling - - one or more times to set the record state. Finally, - is called to complete the update operation. Indexes are updated only by JetUpdate or and not during JetSetColumn. - - - - - The JetUpdate function performs an update operation including inserting a new row into - a table or updating an existing row. Deleting a table row is performed by calling - . - - The session which started the update. - The cursor to update. An update should be prepared. - - JetUpdate is the final step in performing an insert or an update. The update is begun by - calling and then by calling - - one or more times to set the record state. Finally, - is called to complete the update operation. Indexes are updated only by JetUpdate or and not during JetSetColumn. - - - - - The JetSetColumn function modifies a single column value in a modified record to be inserted or to - update the current record. It can overwrite an existing value, add a new value to a sequence of - values in a multi-valued column, remove a value from a sequence of values in a multi-valued column, - or update all or part of a long value (a column of type - or ). - - - The SetColumn methods provide datatype-specific overrides which may be more efficient. - - The session which is performing the update. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - The size of data to set. - SetColumn options. - Used to specify itag or long-value offset. - A warning code. - - - - Allows an application to set multiple column values in a single - operation. An array of structures is - used to describe the set of column values to be set, and to describe - input buffers for each column value to be set. - - The session to use. - The cursor to set the columns on. - - An array of structures describing the - data to set. - - - Number of entries in the setcolumns parameter. - - - A warning. If the last column set has a warning, then - this warning will be returned from JetSetColumns itself. - - - - - Explicitly reserve the ability to update a row, write lock, or to explicitly prevent a row from - being updated by any other session, read lock. Normally, row write locks are acquired implicitly as a - result of updating rows. Read locks are usually not required because of record versioning. However, - in some cases a transaction may desire to explicitly lock a row to enforce serialization, or to ensure - that a subsequent operation will succeed. - - The session to use. - The cursor to use. A lock will be acquired on the current record. - Lock options, use this to specify which type of lock to obtain. - - - - Performs an atomic addition operation on one column. This function allows - multiple sessions to update the same record concurrently without conflicts. - Also see . - - - The session to use. The session must be in a transaction. - - The cursor to update. - - The column to update. This must be an escrow updatable column. - - The buffer containing the addend. - The size of the addend. - - An output buffer that will recieve the current value of the column. This buffer - can be null. - - The size of the previousValue buffer. - Returns the actual size of the previousValue. - Escrow update options. - - - - Allows the application to configure the database engine to issue - notifications to the application for specific events. These - notifications are associated with a specific table and remain in - effect only until the instance containing the table is shut down - using . - - The session to use. - - A cursor opened on the table that the callback should be - registered on. - - - The callback reasons for which the application wishes to receive notifications. - - The callback function. - A context that will be given to the callback. - - A handle that can later be used to cancel the registration of the given - callback function using . - - - - - Configures the database engine to stop issuing notifications to the - application as previously requested through - . - - The session to use. - - A cursor opened on the table that the callback should be - registered on. - - - The callback reasons for which the application no longer wishes to receive notifications. - - - The handle of the registered callback that was returned by . - - - - - Starts and stops database defragmentation tasks that improves data - organization within a database. - - The session to use for the call. - The database to be defragmented. - - Unused parameter. Defragmentation is performed for the entire database described by the given database ID. - - - When starting an online defragmentation task, this parameter sets the maximum number of defragmentation - passes. When stopping an online defragmentation task, this parameter is set to the number of passes - performed. - - - When starting an online defragmentation task, this parameter sets - the maximum time for defragmentation. When stopping an online - defragmentation task, this output buffer is set to the length of - time used for defragmentation. - - Defragmentation options. - A warning code. - - - - Starts and stops database defragmentation tasks that improves data - organization within a database. - - - The callback passed to JetDefragment2 can be executed asynchronously. - The GC doesn't know that the unmanaged code has a reference to the callback - so it is important to make sure the callback isn't collected. - - The session to use for the call. - The database to be defragmented. - - Unused parameter. Defragmentation is performed for the entire database described by the given database ID. - - - When starting an online defragmentation task, this parameter sets the maximum number of defragmentation - passes. When stopping an online defragmentation task, this parameter is set to the number of passes - performed. - - - When starting an online defragmentation task, this parameter sets - the maximum time for defragmentation. When stopping an online - defragmentation task, this output buffer is set to the length of - time used for defragmentation. - - Callback function that defrag uses to report progress. - Defragmentation options. - A warning code. - - - - Performs idle cleanup tasks or checks the version store status in ESE. - - The session to use. - A combination of JetIdleGrbit flags. - An error code if the operation fails. - - - - Frees memory that was allocated by a database engine call. - - - This method is internal because we never expose the memory - allocated by ESENT to our callers. - - - The buffer allocated by a call to the database engine. - is acceptable, and will be ignored. - - - - - Throw an exception if the parameter is an ESE error, - returns a otherwise. - - The error code to check. - An ESENT warning code (possibly success). - - - - Create an error exception that should be thrown for a failure. - - The error code. - A failure exception. - - - - Encoding to use to decode ASCII text. We use this because - UTF8.GetString is faster than ASCII.GetString. - - - - - Retrieves the bookmark for the record that is associated with the index entry - at the current position of a cursor. This bookmark can then be used to - reposition that cursor back to the same record using JetGotoBookmark. - - The session to use. - The cursor to retrieve the bookmark from. - The bookmark of the record. - - - - Retrieves the key for the index entry at the current position of a cursor. - - The session to use. - The cursor to retrieve the key from. - Retrieve key options. - The retrieved key. - - - - Retrieves the size of a single column value from the current record. - The record is that record associated with the index entry at the - current position of the cursor. Alternatively, this function can - retrieve a column from a record being created in the cursor copy - buffer. This function can also retrieve column data from an index - entry that references the current record. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The size of the column. 0 if the column is null. - - - - Retrieves the size of a single column value from the current record. - The record is that record associated with the index entry at the - current position of the cursor. Alternatively, this function can - retrieve a column from a record being created in the cursor copy - buffer. This function can also retrieve column data from an index - entry that references the current record. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - - The sequence number of value in a multi-valued column. - The array of values is one-based. The first value is - sequence 1, not 0. If the record column has only one value then - 1 should be passed as the itagSequence. - - Retrieve column options. - The size of the column. 0 if the column is null. - - - - Retrieves a single column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - Alternatively, this function can retrieve a column from a record being created - in the cursor copy buffer. This function can also retrieve column data from an - index entry that references the current record. In addition to retrieving the - actual column value, JetRetrieveColumn can also be used to retrieve the size - of a column, before retrieving the column data itself so that application - buffers can be sized appropriately. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - Retrieve column options. - - If pretinfo is give as NULL then the function behaves as though an itagSequence - of 1 and an ibLongValue of 0 (zero) were given. This causes column retrieval to - retrieve the first value of a multi-valued column, and to retrieve long data at - offset 0 (zero). - - The data retrieved from the column. Null if the column is null. - - - - Retrieves a single column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data retrieved from the column. Null if the column is null. - - - - Retrieves a single column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - The Unicode encoding is used. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data retrieved from the column as a string. Null if the column is null. - - - - Retrieves a string column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The string encoding to use when converting data. - The data retrieved from the column as a string. Null if the column is null. - - - - Retrieves a string column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The string encoding to use when converting data. - Retrieval options. - The data retrieved from the column as a string. Null if the column is null. - - - - Retrieves a single column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data retrieved from the column as a short. Null if the column is null. - - - - Retrieves an int16 column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - Retrieval options. - The data retrieved from the column as a short. Null if the column is null. - - - - Retrieves a single column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data retrieved from the column as an int. Null if the column is null. - - - - Retrieves an int32 column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - Retrieval options. - The data retrieved from the column as an int. Null if the column is null. - - - - Retrieves a single column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data retrieved from the column as a long. Null if the column is null. - - - - Retrieves a single column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - Retrieval options. - The data retrieved from the column as a long. Null if the column is null. - - - - Retrieves a float column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data retrieved from the column as a float. Null if the column is null. - - - - Retrieves a float column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - Retrieval options. - The data retrieved from the column as a float. Null if the column is null. - - - - Retrieves a double column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data retrieved from the column as a double. Null if the column is null. - - - - Retrieves a double column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - Retrieval options. - The data retrieved from the column as a double. Null if the column is null. - - - - Retrieves a boolean column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data retrieved from the column as a boolean. Null if the column is null. - - - - Retrieves a boolean column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - Retrieval options. - The data retrieved from the column as a boolean. Null if the column is null. - - - - Retrieves a byte column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data retrieved from the column as a byte. Null if the column is null. - - - - Retrieves a byte column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - Retrieval options. - The data retrieved from the column as a byte. Null if the column is null. - - - - Retrieves a guid column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data retrieved from the column as a guid. Null if the column is null. - - - - Retrieves a guid column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - Retrieval options. - The data retrieved from the column as a guid. Null if the column is null. - - - - Retrieves a datetime column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data retrieved from the column as a datetime. Null if the column is null. - - - - Retrieves a datetime column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - Retrieval options. - The data retrieved from the column as a datetime. Null if the column is null. - - - - Retrieves a uint16 column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data retrieved from the column as an UInt16. Null if the column is null. - - - - Retrieves a uint16 column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - Retrieval options. - The data retrieved from the column as an UInt16. Null if the column is null. - - - - Retrieves a uint32 column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data retrieved from the column as an UInt32. Null if the column is null. - - - - Retrieves a uint32 column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - Retrieval options. - The data retrieved from the column as an UInt32. Null if the column is null. - - - - Retrieves a uint64 column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data retrieved from the column as an UInt64. Null if the column is null. - - - - Retrieves a uint64 column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - Retrieval options. - The data retrieved from the column as an UInt64. Null if the column is null. - - - - Deserialize an object from a column. - - The session to use. - The table to read from. - The column to read from. - The deserialized object. Null if the column was null. - - - - Deserialize an object from a column. - - The session to use. - The table to read from. - The column to read from. - The retrieval options to use. - The deserialized object. Null if the column was null. - - - - Retrieves columns into ColumnValue objects. - - The session to use. - The cursor retrieve the data from. The cursor should be positioned on a record. - The values to retrieve. - - - - Create the nullable return value. - - The (struct) type to return. - The data retrieved from the column. - The size of the data. - The warning code from esent. - The actual size of the data retireved fomr esent. - A nullable struct of type T. - - - - Make sure the retrieved data size is at least as long as the expected size. - An exception is thrown if the data isn't long enough. - - The expected data size. - The size of the retrieved data. - - - - Recursively pin the retrieve buffers in the JET_RETRIEVECOLUMN - structures and then retrieve the columns. This is done to avoid - creating GCHandles, which are expensive. This function pins - the current retrievecolumn structure (indicated by i) and then - recursively calls itself until all structures are pinned. This - is done because it isn't possible to create an arbitrary number - of pinned variables in a method. - - - The session to use. - - - The table to retrieve from. - - - The nativeretrievecolumns structure. - - The managed retrieve columns structure. - - The number of columns. - The column currently being processed. - An error code from JetRetrieveColumns. - - - - Retrieve a Unicode (UTF16) string. This is optimized to take advantage of the fact - that no conversion is needed. - - The session to use. - The table to retrieve from. - The column to retrieve. - Retrieve options. - The string retrieved from the column. - - - - Explicitly reserve the ability to update a row, write lock, or to explicitly prevent a row from - being updated by any other session, read lock. Normally, row write locks are acquired implicitly as a - result of updating rows. Read locks are usually not required because of record versioning. However, - in some cases a transaction may desire to explicitly lock a row to enforce serialization, or to ensure - that a subsequent operation will succeed. - - The session to use. - The cursor to use. A lock will be acquired on the current record. - Lock options, use this to specify which type of lock to obtain. - - True if the lock was obtained, false otherwise. An exception is thrown if an unexpected - error is encountered. - - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - The encoding used to convert the string. - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - The encoding used to convert the string. - SetColumn options. - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - SetColumn options. - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - - - - Perform atomic addition on one column. The column must be of type - . This function allows multiple sessions to update the - same record concurrently without conflicts. - - - This method wraps . - - The session to use. - The cursor to update. - The column to update. This must be an escrow-updatable column. - The delta to apply to the column. - The current value of the column as stored in the database (versioning is ignored). - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - - - - Modifies a single column value in a modified record to be inserted or to - update the current record. - - The session to use. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - - - - Write a serialized form of an object to a column. - - The session to use. - The table to write to. An update should be prepared. - The column to write to. - The object to write. The object must be serializable. - - - - Sets columns from ColumnValue objects. - - The session to use. - The cursor to update. An update should be prepared. - The values to set. - - - - Verifies that the given encoding is valid for setting/retrieving data. Only - the ASCII and Unicode encodings are allowed. An - is thrown if the encoding isn't valid. - - The encoding to check. - - - - Try to open a table. - - The session to use. - The database to look for the table in. - The name of the table. - Table open options. - Returns the opened tableid. - True if the table was opened, false if the table doesn't exist. - - - - Creates a dictionary which maps column names to their column IDs. - - The sesid to use. - The table to retrieve the information for. - A dictionary mapping column names to column IDs. - - - - Get the columnid of the specified column. - - The session to use. - The table containing the column. - The name of the column. - The id of the column. - - - - Iterates over all the columns in the table, returning information about each one. - - The session to use. - The table to retrieve column information for. - An iterator over ColumnInfo for each column in the table. - - - - Iterates over all the columns in the table, returning information about each one. - - The session to use. - The database containing the table. - The name of the table. - An iterator over ColumnInfo for each column in the table. - - - - Iterates over all the indexes in the table, returning information about each one. - - The session to use. - The table to retrieve index information for. - An iterator over an IndexInfo for each index in the table. - - - - Iterates over all the indexs in the table, returning information about each one. - - The session to use. - The database containing the table. - The name of the table. - An iterator over an IndexInfo for each index in the table. - - - - Returns the names of the tables in the database. - - The session to use. - The database containing the table. - An iterator over the names of the tables in the database. - - - - Constructs a search key that may then be used by - and . - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Key options. - - - - Constructs a search key that may then be used by - and . - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - The encoding used to convert the string. - Key options. - - - - Constructs a search key that may then be used by - and . - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Key options. - - - - Constructs a search key that may then be used by - and . - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Key options. - - - - Constructs a search key that may then be used by - and . - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Key options. - - - - Constructs a search key that may then be used by - and . - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Key options. - - - - Constructs a search key that may then be used by - and . - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Key options. - - - - Constructs a search key that may then be used by - and . - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Key options. - - - - Constructs a search key that may then be used by - and . - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Key options. - - - - Constructs a search key that may then be used by - and . - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Key options. - - - - Constructs a search key that may then be used by - and . - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Key options. - - - - Constructs a search key that may then be used by - and . - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Key options. - - - - Constructs a search key that may then be used by - and . - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Key options. - - - - Constructs a search key that may then be used by - and . - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Key options. - - - - The JetSetColumn function modifies a single column value in a modified record to be inserted or to - update the current record. It can overwrite an existing value, add a new value to a sequence of - values in a multi-valued column, remove a value from a sequence of values in a multi-valued column, - or update all or part of a long value (a column of type - or ). - - - This is an internal-only version of the API that takes a data buffer and an offset into the buffer. - - The session which is performing the update. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - The size of data to set. - The offset in the data buffer to set data from. - SetColumn options. - Used to specify itag or long-value offset. - A warning value. - - - - Retrieves a single column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - Alternatively, this function can retrieve a column from a record being created - in the cursor copy buffer. This function can also retrieve column data from an - index entry that references the current record. In addition to retrieving the - actual column value, JetRetrieveColumn can also be used to retrieve the size - of a column, before retrieving the column data itself so that application - buffers can be sized appropriately. - - - This is an internal method that takes a buffer offset as well as size. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data buffer to be retrieved into. - The size of the data buffer. - Offset into the data buffer to read data into. - Returns the actual size of the data buffer. - Retrieve column options. - - If pretinfo is give as NULL then the function behaves as though an itagSequence - of 1 and an ibLongValue of 0 (zero) were given. This causes column retrieval to - retrieve the first value of a multi-valued column, and to retrieve long data at - offset 0 (zero). - - An ESENT warning code. - - - - Retrieves a single column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - Alternatively, this function can retrieve a column from a record being created - in the cursor copy buffer. This function can also retrieve column data from an - index entry that references the current record. In addition to retrieving the - actual column value, JetRetrieveColumn can also be used to retrieve the size - of a column, before retrieving the column data itself so that application - buffers can be sized appropriately. - - - This is an internal-use version that takes an IntPtr. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data buffer to be retrieved into. - The size of the data buffer. - Returns the actual size of the data buffer. - Retrieve column options. - - If pretinfo is give as NULL then the function behaves as though an itagSequence - of 1 and an ibLongValue of 0 (zero) were given. This causes column retrieval to - retrieve the first value of a multi-valued column, and to retrieve long data at - offset 0 (zero). - - An ESENT warning code. - - - - Constructs search keys that may then be used by JetSeek and JetSetIndexRange. - - - This is an internal (unsafe) version that takes an IntPtr. - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Size of the data. - Key options. - - - - The JetSetColumn function modifies a single column value in a modified record to be inserted or to - update the current record. It can overwrite an existing value, add a new value to a sequence of - values in a multi-valued column, remove a value from a sequence of values in a multi-valued column, - or update all or part of a long value, a column of type JET_coltyp.LongText or JET_coltyp.LongBinary. - - - This method takes an IntPtr and is intended for internal use only. - - The session which is performing the update. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - The size of data to set. - SetColumn options. - Used to specify itag or long-value offset. - A warning value. - - - - Retrieves information about indexes on a table. - - The session to use. - The database to use. - The name of the table to retrieve index information about. - This parameter is ignored. - Filled in with information about indexes on the table. - - - - Retrieves information about indexes on a table. - - The session to use. - The table to retrieve index information about. - This parameter is ignored. - Filled in with information about indexes on the table. - - - - Position the cursor before the first record in the table. A - subsequent move next will position the cursor on the first - record. - - The session to use. - The table to position. - - - - Position the cursor after the last record in the table. A - subsequent move previous will position the cursor on the - last record. - - The session to use. - The table to position. - - - - Try to navigate through an index. If the navigation succeeds this - method returns true. If there is no record to navigate to this - method returns false; an exception will be thrown for other errors. - - The session to use. - The cursor to position. - The direction to move in. - Move options. - True if the move was successful. - - - - Try to move to the first record in the table. If the table is empty this - returns false, if a different error is encountered an exception is thrown. - - The session to use. - The cursor to position. - True if the move was successful. - - - - Try to move to the last record in the table. If the table is empty this - returns false, if a different error is encountered an exception is thrown. - - The session to use. - The cursor to position. - True if the move was successful. - - - - Try to move to the next record in the table. If there is not a next record - this returns false, if a different error is encountered an exception is thrown. - - The session to use. - The cursor to position. - True if the move was successful. - - - - Try to move to the previous record in the table. If there is not a previous record - this returns false, if a different error is encountered an exception is thrown. - - The session to use. - The cursor to position. - True if the move was successful. - - - - Efficiently positions a cursor to an index entry that matches the search - criteria specified by the search key in that cursor and the specified - inequality. A search key must have been previously constructed using JetMakeKey. - - The session to use. - The cursor to position. - Seek option. - True if a record matching the criteria was found. - - - - Temporarily limits the set of index entries that the cursor can walk using - JetMove to those starting from the current index entry and ending at the index - entry that matches the search criteria specified by the search key in that cursor - and the specified bound criteria. A search key must have been previously constructed - using JetMakeKey. Returns true if the index range is non-empty, false otherwise. - - The session to use. - The cursor to position. - Seek option. - True if the seek was successful. - - - - Removes an index range created with or - . If no index range is present this - method does nothing. - - The session to use. - The cursor to remove the index range on. - - - - Intersect a group of index ranges and return the bookmarks of the records which are found - in all the index ranges. - Also see . - - The session to use. - - The tableids to use. Each tableid must be from a different index on the same table and - have an active index range. Use - to create an index range. - - - The bookmarks of the records which are found in all the index ranges. The bookmarks - are returned in primary key order. - - - - - Gets or sets the ErrorHandler for all errors. This can - be used for logging or to throw an exception. - - - - - Gets or sets the IJetApi this is called for all functions. - - - - - Delegate for error handling code. - - The error that has been encountered. - - - - Info levels for retrieving column info. - - - - - Default option. Retrieves a JET_COLUMNDEF. - - - - - Retrieves a JET_COLUMNLIST structure, containing all the columns - in the table. - - - - - Retrieves a JET_COLUMNBASE structure. - - - - - Retrieves a JET_COLUMNDEF, the szColumnName argument is interpreted - as a pointer to a columnid. - - - - - Static utility methods. - - - - - Compare two byte arrays to see if they have the same content. - - The first array. - The second array. - The offset to start comparing at. - The number of bytes to compare. - True if the arrays are equal, false otherwise. - - - - Return a string containing (some of) the bytes. - - The data to dump. - The starting offset. - The count. - A string version of the data. - - - - Compares two objects with ContentEquals. - If both are null, there are considered equal. - - A type that implements IContentEquatable. - First object to compare. - Second object to compare. - Whether the two objects are equal. - - - - Compares two objects with ContentEquals. - If both are null, there are considered equal. - - A type that implements IContentEquatable. - First object to compare. - Second object to compare. - The number of entries to compare. - Whether the two objects are equal. - - - - Compares items in two arrays using Equals. - If both arrays are null, there are considered equal. - - A value type. - First array to compare. - Second array to compare. - The number of entries to compare. - Whether the two arrays are equal. - - - - Clone an array of objects. - - The type of object in the array. - The values to clone. - A clone of the values. - - - - Given a list of hash codes calculate a hash of the hashes. - - The sub hash codes. - A hash of the hash codes. - - - - Add a trailing directory separator character to the string. - - The directory. - The directory with a separator character added (if necesary). - - - - The type of operation that progress is being reported for. - - - - - Callback is for a repair option. - - - - - Callback is for database defragmentation. - - - - - Callback is for a restore options. - - - - - Callback is for a backup options. - - - - - Callback is for database zeroing. - - - - - Callback is for the process of upgrading the record format of - all database pages. - - - - - Describes an offset in the log sequence. - - - - - Interface for Jet structures that are nullable (can have null values). - - - - - Gets a value indicating whether the structure has a null value. - - - - - Byte offset inside the sector. - - - - - Sector number. - - - - - Generation number. - - - - - Determines whether two specified instances of JET_LGPOS - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_LGPOS - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Determine whether one log position is before another log position. - - The first log position to compare. - The second log position to compare. - True if lhs comes before rhs. - - - - Determine whether one log position is after another log position. - - The first log position to compare. - The second log position to compare. - True if lhs comes after rhs. - - - - Determine whether one log position is before or equal to - another log position. - - The first log position to compare. - The second log position to compare. - True if lhs comes before or is equal to rhs. - - - - Determine whether one log position is after or equal to - another log position. - - The first log position to compare. - The second log position to compare. - True if lhs comes after or is equal to rhs. - - - - Generate a string representation of the structure. - - The structure as a string. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Compares this log position to another log position and determines - whether this instance is before, the same as or after the other - instance. - - The log position to compare to the current instance. - - A signed number indicating the relative positions of this instance and the value parameter. - - - - - Gets the byte offset represented by this log position. This - offset is inside of the sector. - - - - - Gets the sector number represented by this log position. - - - - - Gets the generation of this log position. - - - - - Gets a value indicating whether this log position is null. - - - - - A column value. - - - - - Set a column of a struct type (e.g. Int32/Guid). - - Type to set. - - - - Base class for objects that represent a column value to be set. - - - - - Initializes a new instance of the ColumnValue class. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Recursive RetrieveColumns method for data pinning. This should pin a buffer and - call the inherited RetrieveColumns method. - - The session to use. - - The table to retrieve the columns from. - - - Column values to retrieve. - - - - - Recursive SetColumns method for data pinning. This should populate the buffer and - call the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Recursive SetColumns function used to pin data. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - The buffer for this object. - Size of the buffer for ths object. - True if this object is non null. - An error code. - - This is marked as internal because it uses the NATIVE_SETCOLUMN type - which is also marked as internal. It should be treated as a protected - method though. - - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Retrieve the value for columns whose buffers were truncated. - - The session to use. - The table to use. - The column values. - - The native retrieve columns that match the column values. - - - - - Create a native SetColumn from this object. - - The native setcolumn structure to fill in. - - - - Create a native RetrieveColumn from this object. - - - The retrieve column structure to fill in. - - - - - Gets or sets the columnid to be set or retrieved. - - - - - Gets the last set or retrieved value of the column. The - value is returned as a generic object. - - - - - Gets or sets column update options. - - - - - Gets or sets column retrieval options. - - - - - Gets or sets the column itag sequence. - - - - - Gets the warning generated by retrieving or setting this column. - - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - Gets a string representation of this object. - - A string representation of this object. - - - - Make sure the retrieved data is exactly the size needed for - the structure. An exception is thrown if there is a mismatch. - - The size of the retrieved data. - - - - Gets the last set or retrieved value of the column. The - value is returned as a generic object. - - - - - Gets or sets the value in the struct. - - - - - Recursive SetColumns method for data pinning. This populates the buffer and - calls the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - Information about one Esent column. This is not an interop - class, but is used by the meta-data helper methods. - - - - - The default value of the column. - - - - - Initializes a new instance of the ColumnInfo class. - - Name of the column. - ID of the column. - Type of the column. - Codepage of the column. - Maximum length of the column. - Column default value. - Column option. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets the name of the column. - - - - - Gets the ID of the column. - - - - - Gets the type of the column. - - - - - Gets the code page of the column. - - - - - Gets the maximum length of the column. - - - - - Gets the default value of the column. - - - - - Gets the column options. - - - - - The native version of the JET_OBJECTINFO structure. - - - - - Size of the structure. - - - - - Holds the JET_OBJTYP of the structure. Currently only tables will be - returned (that is, ). - - - - - Obsolete. Do not use. - - - - - Obsolete. Do not use. - - - - - A group of bits that contain table options. - - - - - Table type flags. - - - - - Number of records in the table. - - - - - Number of pages used by the table. - - - - - The JET_OBJECTINFO structure holds information about an object. - Tables are the only object types that are currently supported. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Sets the fields of the object from a native JET_OBJECTINFO struct. - - - The native objectlist to set the values from. - - - - - Gets the JET_OBJTYP of the table. Currently only tables will be - returned (that is, ). - - - - - Gets the table options. - - - - - Gets the table type flags. - - - - - Gets the number of records in the table. - - - - - Gets the number of pages used by the table. - - - - - Information about one esent index. This is not an interop - class, but is used by the meta-data helper methods. - - - - - The name of the index. - - - - - The culture info of the index. - - - - - Index comparison options. - - - - - Index segments. - - - - - Index options. - - - - - Number of unique keys in the index. - - - - - Number of entries in the index. - - - - - Number of pages in the index. - - - - - Initializes a new instance of the IndexInfo class. - - Name of the index. - CultureInfo for string sorting. - String comparison options. - Array of index segment descriptions. - Index options. - Number of unique keys in the index. - Number of entries in the index. - Number of pages in the index. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Gets the name of the index. - - - - - Gets the CultureInfo the index is sorted by. - - - - - Gets the CompareOptions for the index. - - - - - Gets the segments of the index. - - - - - Gets the index options. - - - - - Gets the number of unique keys in the index. - This value is not current and is only is updated by . - - - - - Gets the number of entries in the index. - This value is not current and is only is updated by . - - - - - Gets the number of pages in the index. - This value is not current and is only is updated by . - - - - - ESENT APIs that were first supported in Windows Vista. - - - - - Retrieves information about a column in a table. - - The session to use. - The database that contains the table. - The name of the table containing the column. - The ID of the column. - Filled in with information about the columns in the table. - - - - Creates a temporary table with a single index. A temporary table - stores and retrieves records just like an ordinary table created - using JetCreateTableColumnIndex. However, temporary tables are - much faster than ordinary tables due to their volatile nature. - They can also be used to very quickly sort and perform duplicate - removal on record sets when accessed in a purely sequential manner. - Also see - , - , - . - - - Introduced in Windows Vista. Use - for earlier versions of Esent. - - The session to use. - - Description of the temporary table to create on input. After a - successful call, the structure contains the handle to the temporary - table and column identifications. Use - to free the temporary table when finished. - - - - - Retrieves performance information from the database engine for the - current thread. Multiple calls can be used to collect statistics - that reflect the activity of the database engine on this thread - between those calls. - - Returns the thread statistics data. - - - - Selects a specific instance to be part of the snapshot session. - - The snapshot identifier. - The instance to add to the snapshot. - Options for this call. - - - - Enables log truncation for all instances that are part of the snapshot session. - - - This function should be called only if the snapshot was created with the - option. Otherwise, the snapshot - session ends after the call to . - - The snapshot identifier. - Options for this call. - - - - Truncates the log for a specified instance during a snapshot session. - - - This function should be called only if the snapshot was created with the - option. Otherwise, the snapshot - session ends after the call to . - - The snapshot identifier. - The instance to truncat the log for. - Options for this call. - - - - Retrieves the list of instances and databases that are part of the - snapshot session at any given moment. - - The identifier of the snapshot session. - Returns the number of instances. - Returns information about the instances. - Options for this call. - - - - Notifies the engine that the snapshot session finished. - - The identifier of the snapshot session. - Snapshot end options. - - - - Retrieves information about an instance. - - The instance to get information about. - Retrieved information. - The type of information to retrieve. - - - - Initialize the ESENT database engine. - - - The instance to initialize. If an instance hasn't been - allocated then a new one is created and the engine - will operate in single-instance mode. - - - Additional recovery parameters for remapping databases during - recovery, position where to stop recovery at, or recovery status. - - - Initialization options. - - - A warning code. - - - - - Retrieves record size information from the desired location. - - The session to use. - - The cursor that will be used for the API call. The cursor must be - positioned on a record, or have an update prepared. - - Returns the size of the record. - Call options. - - - - A column value. - - - - - Recursive SetColumns method for data pinning. This populates the buffer and - calls the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - Type of progress being reported. - - - - - This callback is reserved and always considered invalid. - - - - - A finalizable column has gone to zero. - - - - - This callback will occur just before a new record is inserted into - a table by a call to JetUpdate. - - - - - This callback will occur just after a new record has been inserted - into a table by a call to JetUpdate but before JetUpdate returns. - - - - - This callback will occur just prior to an existing record in a table - being changed by a call to JetUpdate. - - - - - This callback will occur just after an existing record in a table - has been changed by a call to JetUpdate but prior to JetUpdate returning. - - - - - This callback will occur just before an existing record in a table - is deleted by a call to JetDelete. - - - - - This callback will occur just after an existing record in a table - is deleted by a call to JetDelete. - - - - - This callback will occur when the engine needs to retrieve the - user defined default value of a column from the application. - This callback is essentially a limited implementation of - JetRetrieveColumn that is evaluated by the application. A maximum - of one column value can be returned for a user defined default value. - - - - - This callback will occur when the online defragmentation of a - database as initiated by JetDefragment has stopped due to either the - process being completed or the time limit being reached. - - - - - This callback will occur when the application needs to clean up - the context handle for the Local Storage associated with a cursor - that is being released by the database engine. For more information, - see JetSetLS. The delegate for this callback reason is - configured by means of JetSetSystemParameter with JET_paramRuntimeCallback. - - - - - This callback will occur as the result of the need for the application - to cleanup the context handle for the Local Storage associated with - a table that is being released by the database engine. For more information, - see JetSetLS. The delegate for this callback reason is configured - by means of JetSetSystemParameter with JET_paramRuntimeCallback. - - - - - Info levels for retrieving database info. - - - - - Returns the path to the database file (string). - - - - - Returns the locale identifier (LCID) associated with this database (Int32). - - - - - Returns a . This indicates whether the - database is opened in exclusive mode. If the database is in exclusive mode then - will be returned, otherwise zero is - returned. Other database grbit options for JetAttachDatabase and JetOpenDatabase - are not returned. - - - - - Returns a number one greater than the maximum level to which transactions can be - nested. If is called (in a nesting fashion, that is, on the - same session, without a commit or rollback) as many times as this value, on the - last call will be returned (Int32). - - - - - Returns the major version of the database engine (Int32). - - - - - Returns the filesize of the database, in pages (Int32). - - - - - Returns the owned space of the database, in pages (Int32). - - - - - Returns the available space in the database, in pages (Int32). - - - - - Returns a object. - - - - - Returns a boolean indicating whether the database is attached (boolean). - - - - - Returns the page size of the database (Int32). - - - - - Returns the type of the database (). - - - - - ESENT warning codes. - - - - - Successful operation. - - - - - The version store is still active - - - - - seek on non-unique index yielded a unique key - - - - - Column is a separated long-value - - - - - Existing log file has bad signature - - - - - Existing log file is not contiguous - - - - - INTERNAL ERROR - - - - - TargetInstance specified for restore is running - - - - - One or more logs that were committed to this database, were not recovered. The database is still clean/consistent, as though the lost log's transactions were committed lazily (and lost). - - - - - One or more logs that were committed to this database, were no recovered. The database is still clean/consistent, as though the corrupted log's transactions were committed lazily (and lost). - - - - - Signal used by clients to indicate JetInit() finished with undo - - - - - Database corruption has been repaired - - - - - Column is NULL-valued - - - - - Buffer too small for data - - - - - Database is already attached - - - - - Sort does not fit in memory - - - - - Exact match not found during seek - - - - - No extended error information - - - - - No idle activity occured - - - - - No write lock at transaction level 0 - - - - - Column set to NULL-value - - - - - Warning code DTC callback should return if the specified transaction is to be committed - - - - - Warning code DTC callback should return if the specified transaction is to be rolled back - - - - - Opened an empty table - - - - - System cleanup has a cursor open on the table - - - - - Out of date index removed - - - - - Max length too big, truncated - - - - - Single instance column bursted - - - - - RetrieveTaggedColumnList ran out of copy buffer before retrieving all tagged columns - - - - - Column value(s) not returned because the corresponding column id or itagSequence requested for enumeration was null - - - - - Column value(s) not returned because they could not be reconstructed from the data at hand - - - - - Column values exist that were not requested for enumeration - - - - - Column value truncated at the requested size limit during enumeration - - - - - Column values exist but were not returned by request - - - - - Column value returned in JET_COLUMNENUM as a result of JET_bitEnumerateCompressOutput - - - - - Column value(s) not returned because they were set to their default value(s) and JET_bitEnumerateIgnoreDefault was specified - - - - - Column value(s) not returned because they could not be reconstructed from the data in the record - - - - - Data has changed - - - - - Moved to new key - - - - - Database file is read only - - - - - Idle registry full - - - - - Online defrag already running on specified database - - - - - Online defrag not running on specified database - - - - - JetDatabaseScan already running on specified database - - - - - JetDatabaseScan not running on specified database - - - - - Unregistered a non-existant callback function - - - - - The log data provided jumped to the next log suddenly, we have deleted the incomplete log file as a precautionary measure - - - - - Flags for ESENT objects (tables). Used in . - - - - - Default options. - - - - - Object is for internal use only. - - - - - Table's DDL is fixed. - - - - - Table's DDL is inheritable. - - - - - Table's DDL is inherited from a template table. - - - - - Fixed or variable columns in derived tables (so that fixed or variable - columns can be added to the template in the future). - Used in conjunction with . - - - - - A class that encapsulates an update on a JET_TABLEID. - - - - - This is the base class for all esent resource objects. - Subclasses of this class can allocate and release unmanaged - resources. - - - - - True if a resource has been allocated. - - - - - True if this object has been disposed. - - - - - Finalizes an instance of the EsentResource class. - - - - - Dispose of this object, releasing the underlying - Esent resource. - - - - - Called by Dispose and the finalizer. - - - True if called from Dispose. - - - - - Throw an exception if this object has been disposed. - - - - - Called by a subclass when a resource is allocated. - - - - - Called by a subclass when a resource is freed. - - - - - Implemented by the subclass to release a resource. - - - - - Gets a value indicating whether the underlying resource - is currently allocated. - - - - - The underlying JET_SESID. - - - - - The underlying JET_TABLEID. - - - - - The type of update. - - - - - Initializes a new instance of the Update class. This automatically - begins an update. The update will be cancelled if - not explicitly saved. - - The session to start the transaction for. - The tableid to prepare the update for. - The type of update. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Update the tableid. - - Returns the bookmark of the updated record. This can be null. - The size of the bookmark buffer. - Returns the actual size of the bookmark. - - Save is the final step in performing an insert or an update. The update is begun by - calling creating an Update object and then by calling JetSetColumn or JetSetColumns one or more times - to set the record state. Finally, Update is called to complete the update operation. - Indexes are updated only by Update or and not during JetSetColumn or JetSetColumns - - - - - Update the tableid. - - - Save is the final step in performing an insert or an update. The update is begun by - calling creating an Update object and then by calling JetSetColumn or JetSetColumns one or more times - to set the record state. Finally, Update is called to complete the update operation. - Indexes are updated only by Update or and not during JetSetColumn or JetSetColumns - - - - - Update the tableid and position the tableid on the record that was modified. - This can be useful when inserting a record because by default the tableid - remains in its old location. - - - Save is the final step in performing an insert or an update. The update is begun by - calling creating an Update object and then by calling JetSetColumn or JetSetColumns one or more times - to set the record state. Finally, Update is called to complete the update operation. - Indexes are updated only by Update or and not during JetSetColumn or JetSetColumns - - - - - Cancel the update. - - - - - Called when the transaction is being disposed while active. - This should rollback the transaction. - - - - - Base class for ESENT exceptions. - - - - - Initializes a new instance of the EsentException class. - - - - - Initializes a new instance of the EsentException class with a specified error message. - - The message that describes the error. - - - - Initializes a new instance of the EsentException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Describes the functionality exposed by an object which implements IJetApi. - - - - - Gets or sets a value indicating whether Windows Server 2003 features - (in the Interop.Server2003 namespace) are supported. - - - - - Gets or sets a value indicating whether Vista features (in the - Interop.Vista namespace) are supported. - - - - - Gets or sets a value indicating whether Win7 features (in the - Interop.Windows7 namespace) are supported. - - - - - Gets or sets a value indicating whether unicode file paths are supported. - - - - - Gets or sets a value indicating whether large (> 255 byte) keys are supported. - The key size for an index can be specified in the - object. - - - - - Gets or sets the maximum number of components in a sort or index key. - - - - - APIs that have been added to the Windows Server 2003 version of ESENT. - - - - - Notifies the engine that it can resume normal IO operations after a - freeze period ended with a failed snapshot. - - Identifier of the snapshot session. - Options for this call. - - - - The JetUpdate function performs an update operation including inserting a new row into - a table or updating an existing row. Deleting a table row is performed by calling - . - - The session which started the update. - The cursor to update. An update should be prepared. - Returns the bookmark of the updated record. This can be null. - The size of the bookmark buffer. - Returns the actual size of the bookmark. - Update options. - - JetUpdate is the final step in performing an insert or an update. The update is begun by - calling and then by calling - - one or more times to set the record state. Finally, - is called to complete the update operation. Indexes are updated only by JetUpdate or and not during JetSetColumn. - - - - - An column value. - - - - - Recursive SetColumns method for data pinning. This populates the buffer and - calls the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - A column value. - - - - - Recursive SetColumns method for data pinning. This populates the buffer and - calls the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - Database states (used in ). - - - - - The database was just created. - - - - - Dirty shutdown (inconsistent) database. - - - - - Clean shutdown (consistent) database. - - - - - Database is being converted. - - - - - Database was force-detached. - - - - - This class provides static properties to set and get - global ESENT system parameters. - - - Constants for the ESENT API. These don't have to be looked up via - system parameters. - - - - - The length of the prefix used to name files used by the database - engine. - - - - - Maximum size of a table/column/index name. - - - - - Maximum size for columns which are not JET_coltyp.LongBinary - or JET_coltyp.LongText. - - - - - Maximum number of columns allowed in a table. - - - - - Maximum number of fixed columns allowed in a table. - - - - - Maximum number of variable-length columns allowed - in a table. - - - - - Maximum number of tagged columns allowed in a table. - - - - - The number of pages that gives the smallest possible - temporary database. - - - - - Set a system parameter which is an integer. - - The parameter to set. - The value to set. - - - - Get a system parameter which is an integer. - - The parameter to get. - The value of the parameter. - - - - Set a system parameter which is a boolean. - - The parameter to set. - The value to set. - - - - Get a system parameter which is a boolean. - - The parameter to get. - The value of the parameter. - - - - Gets or sets the maximum size of the database page cache. The size - is in database pages. If this parameter is left to its default value, then the - maximum size of the cache will be set to the size of physical memory when JetInit - is called. - - - - - Gets or sets the size of the database cache in pages. By default the - database cache will automatically tune its size, setting this property - to a non-zero value will cause the cache to adjust itself to the target - size. - - - - - Gets or sets the size of the database pages, in bytes. - - - - - Gets or sets the minimum size of the database page cache, in database pages. - - - - - Gets or sets the threshold at which the database page cache begins evicting pages from the - cache to make room for pages that are not cached. When the number of page buffers in the cache - drops below this threshold then a background process will be started to replenish that pool - of available buffers. This threshold is always relative to the maximum cache size as set by - JET_paramCacheSizeMax. This threshold must also always be less than the stop threshold as - set by JET_paramStopFlushThreshold. - - The distance height of the start threshold will determine the response time that the database - page cache must have to produce available buffers before the application needs them. A high - start threshold will give the background process more time to react. However, a high start - threshold implies a higher stop threshold and that will reduce the effective size of the - database page cache. - - - - - - Gets or sets the threshold at which the database page cache ends evicting pages from the cache to make - room for pages that are not cached. When the number of page buffers in the cache rises above - this threshold then the background process that was started to replenish that pool of available - buffers is stopped. This threshold is always relative to the maximum cache size as set by - JET_paramCacheSizeMax. This threshold must also always be greater than the start threshold - as set by JET_paramStartFlushThreshold. - - The distance between the start threshold and the stop threshold affects the efficiency with - which database pages are flushed by the background process. A larger gap will make it - more likely that writes to neighboring pages may be combined. However, a high stop - threshold will reduce the effective size of the database page cache. - - - - - - Gets or sets the maximum number of instances that can be created. - - - - - Gets or sets the detail level of eventlog messages that are emitted - to the eventlog by the database engine. Higher numbers will result - in more detailed eventlog messages. - - - - - Gets the maximum key size. This depends on the Esent version and database - page size. - - - - - Gets the maximum number of components in a sort or index key. - - - - - Gets the maximum size of a bookmark. . - - - - - Gets the lv chunks size. This depends on the database page size. - - - - - Gets or sets a value specifying the default values for the - entire set of system parameters. When this parameter is set to - a specific configuration, all system parameter values are reset - to their default values for that configuration. If the - configuration is set for a specific instance then global system - parameters will not be reset to their default values. - Small Configuration (0): The database engine is optimized for memory use. - Legacy Configuration (1): The database engine has its traditional defaults. - - Supported on Windows Vista and up. Ignored on Windows XP and - Windows Server 2003. - - - - - - Gets or sets a value indicating whether the database engine accepts - or rejects changes to a subset of the system parameters. This - parameter is used in conjunction with to - prevent some system parameters from being set away from the selected - configuration's defaults. - - Supported on Windows Vista and up. Ignored on Windows XP and - Windows Server 2003. - - - - - - Cache allocated chunks of memory that are needed for very short periods - of time. The memory is not zeroed on allocation. - - - - - A zero-length array that should be used whenever we want to return one. - - - - - Default size for newly allocated buffers. - - - - - Currently cached buffers. - - - - - Initializes a new instance of the class. - - - The size of the buffers to cache. - - - The maximum number of buffers to cache. - - - - - Creates a new array containing a copy of 'length' bytes of data. - - The data to copy. - The length of data to copy. - An array containing the first length bytes of data. - - - - Allocates a chunk of memory. If memory is cached it is returned. If no memory - is cached then it is allocated. Check the size of the returned buffer to determine - how much memory was allocated. - - A new memory buffer. - - - - Frees an unused buffer. This may be added to the cache. - - The memory to free. - - - - Get the offset in the cached buffers array to start allocating or freeing - buffers to. This is done so that all threads don't start operating on - slot zero, which would increase contention. - - The starting offset for Allocate/Free operations. - - - - Gets the size of the buffers that this cache returns. - - - - - Exception thrown when a column conversion fails. - - - - - Initializes a new instance of the EsentInvalidColumnException class. - - - - - Initializes a new instance of the EsentInvalidColumnException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Gets a text message describing the exception. - - - - - Enumerate the names of tables in a database. - - - - - Base class for enumerators that walk a table. - - The type returned by the enumerator. - - - - True if we are at the end of the table. - - - - - True if we need to move to the first record in the table. - - - - - Initializes a new instance of the class. - - - The session to use. - - - - - Resets the enumerator. The next call to MoveNext will move - to the first entry. - - - - - Disposes of any resources the enumerator is using. - - - - - Move to the next entry. - - - True if an entry was found, false otherwise. - - - - - Open the table to be enumerated. This should set . - - - - - Gets the entry the cursor is currently positioned on. - - The entry the cursor is currently positioned on. - - - - Determine if the current entry in the table being enumerated should - be skipped (not returned). By default this is false. - - True if the current entry should be skipped. - - - - Closes the table being enumerated. - - - - - Gets the current entry. - - - - - Gets the current entry. - - - - - Gets the session used for the enumeration. - - - - - Gets or sets the table being enumerated. - - - - - The database containing the tables. - - - - - Object list containing information about tables. - - - - - Initializes a new instance of the class. - - - The session to use. - - - The database to get the table names from. - - - - - Open the table to be enumerated. This should set . - - - - - Determine if the current entry in the table being enumerated should - be skipped (not returned). Here we are skipping system tables. - - True if the current entry should be skipped. - - - - Gets the entry the cursor is currently positioned on. - - The entry the cursor is currently positioned on. - - - - Receives information about the progress of long-running operations, - such as defragmentation, backup, or restore operations. During such - operations, the database engine calls this callback function to give - an update on the progress of the operation. - - - The session with which the long running operation was called. - - The type of operation. - The status of the operation. - Optional data. May be a . - An error code. - - - - Receives information about the progress of long-running operations, - such as defragmentation, backup, or restore operations. During such - operations, the database engine calls this callback function to give - an update on the progress of the operation. - - - This is the internal version of the callback. The final parameter is - a void* pointer, which may point to a NATIVE_SNPROG. - - - The session with which the long running operation was called. - - The type of operation. - The status of the operation. - Optional . - An error code. - - - - Wraps a NATIVE_PFNSTATUS callback around a JET_PFNSTATUS. This is - used to convert the snprog argument to a managed snprog. - - - - - API call tracing. - - - - - The wrapped status callback. - - - - - The native version of the callback. This will be a closure (because we are wrapping - a non-static method) so keep track of it here to make sure it isn't garbage collected. - - - - - Initializes static members of the class. - - - - - Initializes a new instance of the StatusCallbackWrapper class. - - - The managed callback to use. - - - - - If an exception was generated during a callback throw it. - - - - - Callback function for native code. We don't want to throw an exception through - unmanaged ESENT because that will corrupt ESENT's internal state. Instead we - catch all exceptions and return an error instead. We use a CER to make catching - the exceptions as reliable as possible. - - - The session with which the long running operation was called. - - The type of operation. - The status of the operation. - Optional . - An error code. - - - - Gets a NATIVE_PFNSTATUS callback that wraps the managed callback. - - - - - Gets or sets the saved exception. If the callback throws an exception - it is saved here and should be rethrown when the API call finishes. - - - - - Gets or sets a value indicating whether the thread was aborted during - the callback. - - - - - A column value. - - - - - Recursive SetColumns method for data pinning. This populates the buffer and - calls the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - A column value. - - - - - Recursive SetColumns method for data pinning. This populates the buffer and - calls the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - Enumerator that can intersect indexes and return the intersected bookmarks. - - - - - The ranges to intersect. - - - - - The recordlist containing the result of the intersection. - - - - - Initializes a new instance of the class. - - - The session to use. - - - The ranges to intersect. - - - - - Open the table to be enumerated. This should set . - - - - - Gets the entry the cursor is currently positioned on. - - The entry the cursor is currently positioned on. - - - - The native version of the JET_RETINFO structure. - - - - - Size of NATIVE_RECPOS structures. - - - - - Size of this structure. - - - - - Approximate number of index entries less than the key. - - - - - Approximate number of entries in the index range. - - - - - Approximate number of entries in the index. - - - - - Represents a fractional position within an index. This is used by JetGotoPosition - and JetGetRecordPosition. - - - - - Interface for objects that can have their contents compared against - each other. This should be used for equality comparisons on mutable - reference objects where overriding Equals() and GetHashCode() isn't a - good idea. - - The type of objects to comapre. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Interface for objects that can be cloned. This creates a deep copy of - the object. It is used for cloning meta-data objects. - - The type of object. - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - The number of entries before the key. - - - - - Total number of entries. - - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - Generate a string representation of the instance. - - The structure as a string. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Get a NATIVE_RECPOS structure representing the object. - - A NATIVE_RECPOS whose members match the class. - - - - Sets the fields of the object from a NATIVE_RECPOS structure. - - The NATIVE_RECPOS which will be used to set the fields. - - - - Gets or sets the approximate number of index entries less than the key. - - - - - Gets or sets the approximate number of entries in the index. - - - - - A class that encapsulates a transaction on a JET_SESID. - - - - - The underlying JET_SESID. - - - - - Initializes a new instance of the Transaction class. This automatically - begins a transaction. The transaction will be rolled back if - not explicitly committed. - - The session to start the transaction for. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Begin a transaction. This object should not currently be - in a transaction. - - - - - Commit a transaction. This object should be in a transaction. - - JetCommitTransaction options. - - - - Rollback a transaction. This object should be in a transaction. - - - - - Called when the transaction is being disposed while active. - This should rollback the transaction. - - - - - Gets a value indicating whether this object is currently in a - transaction. - - - - - The native version of the JET_RECORDLIST structure. - - - - - Size of the structure. - - - - - Temporary table containing the bookmarks. - - - - - Number of records in the table. - - - - - Column id of the column containing the record bookmarks. - - - - - Information about a temporary table containing information - about all indexes for a given table. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Sets the fields of the object from a native JET_RECORDLIST struct. - - - The native recordlist to set the values from. - - - - - Gets tableid of the temporary table. This should be closed - when the table is no longer needed. - - - - - Gets the number of records in the temporary table. - - - - - Gets the columnid of the column in the temporary table which - stores the bookmark of the record. - The column is of type JET_coltyp.Text. - - - - - The native (unmanaged) version of the - class. - - - - - Column ID to enumerate. - - - - - Count of column values to enumerate. - - - - - Column values to enumerate. - - - - - Enumerates a specific set of columns and, optionally, a specific set - of multiple values for those columns when the JetEnumerateColumns - function is used. JetEnumerateColumns optionally takes an array of - JET_ENUMCOLUMNID structures. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Check to see if ctagSequence is negative or greater than the length - of rgtagSequence. - - - - - Gets the native (interop) version of this object. - - A NATIVE_ENUMCOLUMNID representing this object. - - - - Gets or sets the columnid ID to enumerate. - - - If the column ID is 0 (zero) then the enumeration of this column is - skipped and a corresponding slot in the output array of JET_ENUMCOLUMN - structures will be generated with a column state of JET_wrnColumnSkipped. - - - - - Gets or sets the count of column values (by one-based index) to - enumerate for the specified column ID. If ctagSequence is 0 (zero) then - rgtagSequence is ignored and all column values for the specified column - ID will be enumerated. - - - - - Gets or sets the array of one-based indices into the array of column values for a - given column. A single element is an itagSequence which is defined in - JET_RETRIEVECOLUMN. An itagSequence of 0 (zero) means "skip". An - itagSequence of 1 means return the first column value of the column, - 2 means the second, and so on. - - - - - Native (unmanaged) version of the JET_ENUMCOLUMN structure. - - - - - The columnid that was enumerated. - - - - - The column status code from the enumeration of the column. - - - - - The size of the value that was enumerated for the column. - This member is only used if is equal to - . - - - The unmanaged JET_ENUMCOLUMN structure is a union so this - is aliased with cEnumColumnValue. - - - - - The the value that was enumerated for the column. - This member is only used if is equal to - . - - - The unmanaged JET_ENUMCOLUMN structure is a union so this - is aliased with rgEnumColumnValue. - - - - - Gets or sets the number of entries in rgEnumColumnValue. - This member is only used if is not - . - - - The unmanaged JET_ENUMCOLUMN structure is a union so this - property uses cbData as its backing storage. - - - - - Gets or sets an array of column values. - This member is only used if is not - . - - - The unmanaged JET_ENUMCOLUMN structure is a union so this - property uses pvData as its backing storage. - - - - - Enumerates the column values of a record using the JetEnumerateColumns - function. JetEnumerateColumns returns an array of JET_ENUMCOLUMNVALUE - structures. The array is returned in memory that was allocated using - the callback that was supplied to that function. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Sets the fields of the object from a native JET_ENUMCOLUMN struct. - - - The native enumcolumn to set the values from. - - - - - Gets the columnid ID that was enumerated. - - - - - Gets the column status code that results from the enumeration. - - - - - - Gets the number of column values enumerated for the column. - This member is only used if is not - . - - - - - Gets the enumerated column values for the column. - This member is only used if is not - . - - - - - Gets the size of the value that was enumerated for the column. - This member is only used if is equal to - . - - - - - Gets the the value that was enumerated for the column. - This member is only used if is equal to - . - This points to memory allocated with the - allocator callback passed to - . Remember to - release the memory when finished. - - - - - Conversion options for . This feature - was discontinued in Windows Server 2003. - - - - - Esent file types. - - - - - Unknown file. - - - - - Database file. - - - - - Transaction log. - - - - - Checkpoint file. - - - - - Temporary database. - - - - - Static class containing MemoryCaches for different ESENT buffers. - Use these to avoid memory allocations when the memory will be - used for a brief time. - - - - - The maximum key size that any version of ESENT can have for - any page size. This is also the maximum bookmark size. - - - - - The maximum number of buffers we want in a cache. - - - - - Cached buffers for columns. - - - - - Cached buffers for keys and bookmarks. - - - - - Gets the cached buffers for columns. - - - - - Gets the cached buffers for keys and bookmarks. - - - - - System parameters that have been added to the Windows 7 version of ESENT. - - - - - This parameter sets the number of logs that esent will defer database - flushes for. This can be used to increase database recoverability if - failures cause logfiles to be lost. - - - - - This parameter is used to retrieve the chunk size of long-value - (blob) data. Setting and retrieving data in multiples of this - size increases efficiency. - - - - - Throttling of the database scan, in milliseconds. - - - - - Minimum interval to repeat the database scan, in seconds. - - - - - Maximum interval to allow the database scan to finish, in seconds. - - - - - The native version of the JET_RETINFO structure. - - - - - The size of a NATIVE_RETINFO structure. - - - - - Size of this structure. - - - - - Offset of the long value to retrieve. - - - - - Itag sequence to retrieve. - - - - - Returns the columnid of the next tagged column. - - - - - Contains optional input and output parameters for JetRetrieveColumn. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - Get a NATIVE_RETINFO structure representing the object. - - A NATIVE_RETINFO whose members match the class. - - - - Sets the fields of the object from a NATIVE_RETINFO structure. - - The NATIVE_RETINFO which will be used to set the fields. - - - - Gets or sets the offset to the first byte to be retrieved from a column of - type , or . - - - - - Gets or sets the sequence number of value in a multi-valued column. - The array of values is one-based. The first value is - sequence 1, not 0. If the record column has only one value then - 1 should be passed as the itagSequence. - - - - - Gets the columnid of the retrieved tagged, multi-valued or - sparse, column when all tagged columns are retrieved by passing - 0 as the columnid to JetRetrieveColumn. - - - - - Offsets for JetMove. - - - - - Move the cursor to the first index entry. - - - - - Move to the previous index entry. - - - - - Move to the next index entry. - - - - - Move to the last index entry. - - - - - Options for JetCreateInstance2. - - - - - Default options. - - - - - Options for JetInit2. - - - - - - Default options. - - - - - Options for JetTerm2. - - - - - - Default options. - - - - - Requests that the instance be shut down cleanly. Any optional - cleanup work that would ordinarily be done in the background at - run time is completed immediately. - - - - - Requests that the instance be shut down as quickly as possible. - Any optional work that would ordinarily be done in the - background at run time is abandoned. - - - - - Options for JetCreateDatabase. - - - - - Default options. - - - - - By default, if JetCreateDatabase is called and the database already exists, - the Api call will fail and the original database will not be overwritten. - OverwriteExisting changes this behavior, and the old database - will be overwritten with a new one. - - - - - Turns off logging. Setting this bit loses the ability to replay log files - and recover the database to a consistent usable state after a crash. - - - - - Options for JetAttachDatabase. - - - - - Default options. - - - - - Prevents modifications to the database. - - - - - If JET_paramEnableIndexChecking has been set, all indexes over Unicode - data will be deleted. - - - - - Options for JetOpenDatabase. - - - - - Default options. - - - - - Prevents modifications to the database. - - - - - Allows only a single session to attach a database. - Normally, several sessions can open a database. - - - - - Options for JetCloseDatabase. - - - - - Default options. - - - - - Options for . - - - - - Default options. - - - - - Causes JetCompact to dump statistics on the source database to a file - named DFRGINFO.TXT. Statistics include the name of each table in - source database, number of rows in each table, total size in bytes of - all rows in each table, total size in bytes of all columns of type - or - that were large enough to be stored separate from the record, number - of clustered index leaf pages, and the number of long value leaf pages. - In addition, summary statistics including the size of the source database, - destination database, time required for database compaction, temporary - database space are all dumped as well. - - - - - Used when the source database is known to be corrupt. It enables a - whole set of new behaviors intended to salvage as much data as - possible from the source database. JetCompact with this option set - may return but not copy all of the data - created in the source database. Data that was in damaged portions of - the source database will be skipped. - - - - - Options for . - - - - - Default options. - - - - - Options for . - - - - - Default options. - - - - - Only logfiles will be taken. - - - - - A copy snapshot (normal or incremental) with no log truncation. - - - - - Options for . - - - - - Default options. - - - - - Options for . - - - - - Default options. - - - - - Creates an incremental backup as opposed to a full backup. This - means that only the log files created since the last full or - incremental backup will be backed up. - - - - - Creates a full backup of the database. This allows the preservation - of an existing backup in the same directory if the new backup fails. - - - - - Options for . - - - - - Default options. - - - - - Creates an incremental backup as opposed to a full backup. This - means that only the log files since the last full or incremental - backup will be backed up. - - - - - Options for . - - - - - Default options. - - - - - The client application finished the backup completely, and is ending normally. - - - - - The client application is aborting the backup. - - - - - Options for . - - - - - Default options. - - - - - The transaction will not modify the database. If an update is attempted, - that operation will fail with . This - option is ignored unless it is requested when the given session is not - already in a transaction. - - - - - Options for JetCommitTransaction. - - - - - Default options. - - - - - The transaction is committed normally but this Api does not wait for - the transaction to be flushed to the transaction log file before returning - to the caller. This drastically reduces the duration of a commit operation - at the cost of durability. Any transaction that is not flushed to the log - before a crash will be automatically aborted during crash recovery during - the next call to JetInit. If WaitLastLevel0Commit or WaitAllLevel0Commit - are specified, this option is ignored. - - - - - If the session has previously committed any transactions and they have not yet - been flushed to the transaction log file, they should be flushed immediately. - This Api will wait until the transactions have been flushed before returning - to the caller. This is useful if the application has previously committed several - transactions using JET_bitCommitLazyFlush and now wants to flush all of them to disk. - - - This option may be used even if the session is not currently in a transaction. - This option cannot be used in combination with any other option. - - - - - Options for JetRollbackTransaction. - - - - - Default options. - - - - - This option requests that all changes made to the state of the - database during all save points be undone. As a result, the - session will exit the transaction. - - - - - Options for JetEndSession. - - - - - Default options. - - - - - Options for JetOpenTable. - - - - - Default options. - - - - - This table cannot be opened for write access by another session. - - - - - This table cannot be opened for read access by another session. - - - - - Request read-only access to the table. - - - - - Request write access to the table. - - - - - Allow DDL modifications to a table flagged as FixedDDL. This option - must be used with DenyRead. - - - - - Do not cache pages for this table. - - - - - Provides a hint that the table is probably not in the buffer cache, and - that pre-reading may be beneficial to performance. - - - - - Assume a sequential access pattern and prefetch database pages. - - - - - Table belongs to stats class 1. - - - - - Table belongs to stats class 2. - - - - - Table belongs to stats class 3. - - - - - Table belongs to stats class 4. - - - - - Table belongs to stats class 5. - - - - - Table belongs to stats class 6. - - - - - Table belongs to stats class 7. - - - - - Table belongs to stats class 8. - - - - - Table belongs to stats class 9. - - - - - Table belongs to stats class 10. - - - - - Table belongs to stats class 11. - - - - - Table belongs to stats class 12. - - - - - Table belongs to stats class 13. - - - - - Table belongs to stats class 14. - - - - - Table belongs to stats class 15. - - - - - Options for . - - - - - Default options. - - - - - Options for and . - - - - - Default options. - - - - - The context handle for the chosen object should be reset to JET_LSNil. - - - - - Specifies the context handle should be associated with the given cursor. - - - - - Specifies that the context handle should be associated with the - table associated with the given cursor. It is illegal to use this - option with . - - - - - Options for JetSetColumn. - - - - - - - Default options. - - - - - This option is used to append data to a column of type JET_coltypLongText - or JET_coltypLongBinary. The same behavior can be achieved by determining - the size of the existing long value and specifying ibLongValue in psetinfo. - However, its simpler to use this grbit since knowing the size of the existing - column value is not necessary. - - - - - This option is used replace the existing long value with the newly provided - data. When this option is used, it is as though the existing long value has - been set to 0 (zero) length prior to setting the new data. - - - - - This option is only applicable for tagged, sparse or multi-valued columns. - It causes the column to return the default column value on subsequent retrieve - column operations. All existing column values are removed. - - - - - This option is used to force a long value, columns of type JET_coltyp.LongText - or JET_coltyp.LongBinary, to be stored separately from the remainder of record - data. This occurs normally when the size of the long value prevents it from being - stored with remaining record data. However, this option can be used to force the - long value to be stored separately. Note that long values four bytes in size - of smaller cannot be forced to be separate. In such cases, the option is ignored. - - - - - This option is used to interpret the input buffer as a integer number of bytes - to set as the length of the long value described by the given columnid and if - provided, the sequence number in psetinfo->itagSequence. If the size given is - larger than the existing column value, the column will be extended with 0s. - If the size is smaller than the existing column value then the value will be - truncated. - - - - - This option is used to enforce that all values in a multi-valued column are - distinct. This option compares the source column data, without any - transformations, to other existing column values and an error is returned - if a duplicate is found. If this option is given, then AppendLV, OverwriteLV - and SizeLV cannot also be given. - - - - - This option is used to enforce that all values in a multi-valued column are - distinct. This option compares the key normalized transformation of column - data, to other similarly transformed existing column values and an error is - returned if a duplicate is found. If this option is given, then AppendLV, - OverwriteLV and SizeLV cannot also be given. - - - - - This option is used to set a value to zero length. Normally, a column value - is set to NULL by passing a cbMax of 0 (zero). However, for some types, like - JET_coltyp.Text, a column value can be 0 (zero) length instead of NULL, and - this option is used to differentiate between NULL and 0 (zero) length. - - - - - Try to store long-value columns in the record, even if they exceed the default - separation size. - - - - - Options for JetRetrieveColumn. - - - - - Default options. - - - - - This flag causes retrieve column to retrieve the modified value instead of - the original value. If the value has not been modified, then the original - value is retrieved. In this way, a value that has not yet been inserted or - updated may be retrieved during the operation of inserting or updating a record. - - - - - This option is used to retrieve column values from the index, if possible, - without accessing the record. In this way, unnecessary loading of records - can be avoided when needed data is available from index entries themselves. - - - - - This option is used to retrieve column values from the index bookmark, - and may differ from the index value when a column appears both in the - primary index and the current index. This option should not be specified - if the current index is the clustered, or primary, index. This bit cannot - be set if RetrieveFromIndex is also set. - - - - - This option is used to retrieve the sequence number of a multi-valued - column value in JET_RETINFO.itagSequence. Retrieving the sequence number - can be a costly operation and should only be done if necessary. - - - - - This option is used to retrieve multi-valued column NULL values. If - this option is not specified, multi-valued column NULL values will - automatically be skipped. - - - - - This option affects only multi-valued columns and causes a NULL - value to be returned when the requested sequence number is 1 and - there are no set values for the column in the record. - - - - - Options for JetEnumerateColumns. - - - - - - - Default options. - - - - - When enumerating column values, all columns for which we are retrieving - all values and that have only one non-NULL column value may be returned - in a compressed format. The status for such columns will be set to - and the size of the column value - and the memory containing the column value will be returned directly in - the structure. It is not guaranteed that - all eligible columns are compressed in this manner. See - for more information. - - - - - This option indicates that the modified column values of the record - should be enumerated rather than the original column values. If a - column value has not been modified, the original column value is - enumerated. In this way, a column value that has not yet been inserted - or updated may be enumerated when inserting or updating a record. - - - This option is identical to . - - - - - If a given column is not present in the record then no column value - will be returned. Ordinarily, the default value for the column, - if any, would be returned in this case. It is guaranteed that if the - column is set to a value different than the default value then that - different value will be returned (that is, if a column with a - default value is explicitly set to NULL then a NULL will be returned - as the value for that column). Even if this option is requested, it - is still possible to see a column value that happens to be equal to - the default value. No effort is made to remove column values that - match their default values. - It is important to remember that this option affects the output of - when used with - or - . - - - - - If a non-NULL value exists for the requested column or column value - then the associated data is not returned. Instead, the associated - status for that column or column value will be set to - . If the column or column value - is NULL then will be returned as usual. - - - - - When enumerating all column values in the record (for example,that is - when numColumnids is zero), only tagged column values will be returned. - This option is not allowed when enumerating a specific array of column IDs. - - - - - Options for . - - - - - Default options. - - - - - Retrieve the size of the record that is in the copy buffer prepared - or update. Otherwise, the tableid must be positioned on a record, - and that record will be used. - - - - - The JET_RECSIZE is not zeroed before filling the contents, effectively - acting as an accumulation of the statistics for multiple records visited - or updated. - - - - - Ignore non-intrinsic Long Values. Only the local record on the page - will be used. - - - - - Options for . - - - - - Default options. - - - - - Options for . - - - - - Default options. - - - - - In the event that the index entry can no longer be found, the cursor - will be left positioned where that index entry was previously found. - The operation will still fail with JET_errRecordDeleted; however, - it will be possible to move to the next or previous index entry - relative to the index entry that is now missing. - - - - - Options for JetMove. - - - - - Default options. - - - - - Moves the cursor forward or backward by the number of index entries - required to skip the requested number of index key values encountered - in the index. This has the effect of collapsing index entries with - duplicate key values into a single index entry. - - - - - Options for JetMakeKey. - - - - - Default options. - - - - - A new search key should be constructed. Any previously existing search - key is discarded. - - - - - When this option is specified, all other options are ignored, any - previously existing search key is discarded, and the contents of the - input buffer are loaded as the new search key. - - - - - If the size of the input buffer is zero and the current key column - is a variable length column, this option indicates that the input - buffer contains a zero length value. Otherwise, an input buffer size - of zero would indicate a NULL value. - - - - - This option indicates that the search key should be constructed - such that any key columns that come after the current key column - should be considered to be wildcards. - - - - - This option indicates that the search key should be constructed - such that the current key column is considered to be a prefix - wildcard and that any key columns that come after the current - key column should be considered to be wildcards. - - - - - The search key should be constructed such that any key columns - that come after the current key column should be considered to - be wildcards. - - - - - The search key should be constructed in such a way that any key - columns that come after the current key column are considered to - be wildcards. - - - - - The search key should be constructed such that the current key - column is considered to be a prefix wildcard and that any key - columns that come after the current key column should be considered - to be wildcards. - - - - - The search key should be constructed such that the current key - column is considered to be a prefix wildcard and that any key - columns that come after the current key column should be considered - to be wildcards. - - - - - Options for JetRetrieveKey. - - - - - Default options. - - - - - Retrieve the currently constructed key. - - - - - Options for JetSeek. - - - - - The cursor will be positioned at the index entry closest to the - start of the index that exactly matches the search key. - - - - - The cursor will be positioned at the index entry closest to the - end of the index that is less than an index entry that would - exactly match the search criteria. - - - - - The cursor will be positioned at the index entry closest to the - end of the index that is less than or equal to an index entry - that would exactly match the search criteria. - - - - - The cursor will be positioned at the index entry closest to the - start of the index that is greater than or equal to an index - entry that would exactly match the search criteria. - - - - - The cursor will be positioned at the index entry closest to the - start of the index that is greater than an index entry that - would exactly match the search criteria. - - - - - An index range will automatically be setup for all keys that - exactly match the search key. - - - - - Options for JetSetIndexRange. - - - - - Default options. - - - - - This option indicates that the limit of the index range is inclusive. - - - - - The search key in the cursor represents the search criteria for the - index entry closest to the end of the index that will match the index - range. - - - - - The index range should be removed as soon as it has been established. - This is useful for testing for the existence of index entries that - match the search criteria. - - - - - Cancel and existing index range. - - - - - Options for the JET_INDEXRANGE object. - - - - - Records in the cursors indexrange should be included in the output. - - - - - Options for JetIntersectIndexes. - - - - - Default options. - - - - - Options for and - . - - - - - Default options. This is the same as . - - - - - Indicates that the cursor should be positioned on the first entry of - the specified index. If the current index is being selected then this - option is ignored. - - - - - Indicates that the cursor should be positioned on the index entry - of the new index that corresponds to the record associated with the - index entry at the current position of the cursor on the old index. - - - - - Options for JetSetTableSequential. - - - - - Default options. - - - - - Options for JetResetTableSequential. - - - - - Default options. - - - - - Options for JetGetLock. - - - - - Acquire a read lock on the current record. Read locks are incompatible with - write locks already held by other sessions but are compatible with read locks - held by other sessions. - - - - - Acquire a write lock on the current record. Write locks are not compatible - with write or read locks held by other sessions but are compatible with - read locks held by the same session. - - - - - Options for JetEscrowUpdate. - - - - - Default options. - - - - - Even if the session performing the escrow update has its transaction rollback - this update will not be undone. As the log records may not be flushed to disk, - recent escrow updates done with this flag may be lost if there is a crash. - - - - - Options for the JET_COLUMNDEF structure. - - - - - - Default options. - - - - - The column will be fixed. It will always use the same amount of space in a row, - regardless of how much data is being stored in the column. ColumnFixed - cannot be used with ColumnTagged. This bit cannot be used with long values - (that is JET_coltyp.LongText and JET_coltyp.LongBinary). - - - - - The column will be tagged. Tagged columns do not take up any space in the database - if they do not contain data. This bit cannot be used with ColumnFixed. - - - - - The column must never be set to a NULL value. On Windows XP this can only be applied to - fixed columns (bit, byte, integer, etc). - - - - - The column is a version column that specifies the version of the row. The value of - this column starts at zero and will be automatically incremented for each update on - the row. This option can only be applied to JET_coltyp.Long columns. This option cannot - be used with ColumnAutoincrement, ColumnEscrowUpdate, or ColumnTagged. - - - - - The column will automatically be incremented. The number is an increasing number, and - is guaranteed to be unique within a table. The numbers, however, might not be continuous. - For example, if five rows are inserted into a table, the "autoincrement" column could - contain the values { 1, 2, 6, 7, 8 }. This bit can only be used on columns of type - JET_coltyp.Long or JET_coltyp.Currency. - - - - - The column can be multi-valued. - A multi-valued column can have zero, one, or more values - associated with it. The various values in a multi-valued column are identified by a number - called the itagSequence member, which belongs to various structures, including: - JET_RETINFO, JET_SETINFO, JET_SETCOLUMN, JET_RETRIEVECOLUMN, and JET_ENUMCOLUMNVALUE. - Multi-valued columns must be tagged columns; that is, they cannot be fixed-length or - variable-length columns. - - - - - Specifies that a column is an escrow update column. An escrow update column can be - updated concurrently by different sessions with JetEscrowUpdate and will maintain - transactional consistency. An escrow update column must also meet the following conditions: - An escrow update column can be created only when the table is empty. - An escrow update column must be of type JET_coltypLong. - An escrow update column must have a default value. - JET_bitColumnEscrowUpdate cannot be used in conjunction with ColumnTagged, - ColumnVersion, or ColumnAutoincrement. - - - - - The column will be created in an without version information. This means that other - transactions that attempt to add a column with the same name will fail. This bit - is only useful with JetAddColumn. It cannot be used within a transaction. - - - - - In doing an outer join, the retrieve column operation might not have a match - from the inner table. - - - - - The default value for a column will be provided by a callback function. A column that - has a user-defined default must be a tagged column. Specifying JET_bitColumnUserDefinedDefault - means that pvDefault must point to a JET_USERDEFINEDDEFAULT structure, and cbDefault must be - set to sizeof( JET_USERDEFINEDDEFAULT ). - - - - - The column will be a key column for the temporary table. The order - of the column definitions with this option specified in the input - array will determine the precedence of each key column for the - temporary table. The first column definition in the array that - has this option set will be the most significant key column and - so on. If more key columns are requested than can be supported - by the database engine then this option is ignored for the - unsupportable key columns. - - - - - The sort order of the key column for the temporary table should - be descending rather than ascending. If this option is specified - without then this option is ignored. - - - - - Options for JetCreateTableColumnIndex. - - - - - Default options. - - - - - The DDL is fixed. - - - - - The DDL is inheritable. Implies FixedDDL. - - - - - Used in conjunction with TemplateTable. - - - - - Options for JetCreateIndex. - - - - - Default options. - - - - - Duplicate index entries (keys) are disallowed. This is enforced when JetUpdate is called, - not when JetSetColumn is called. - - - - - The index is a primary (clustered) index. Every table must have exactly one primary index. - If no primary index is explicitly defined over a table, then the database engine will - create its own primary index. - - - - - None of the columns over which the index is created may contain a NULL value. - - - - - Do not add an index entry for a row if all of the columns being indexed are NULL. - - - - - Do not add an index entry for a row if any of the columns being indexed are NULL. - - - - - Do not add an index entry for a row if the first column being indexed is NULL. - - - - - Specifies that the index operations will be logged lazily. JET_bitIndexLazyFlush does not - affect the laziness of data updates. If the indexing operations is interrupted by process - termination, Soft Recovery will still be able to able to get the database to a consistent - state, but the index may not be present. - - - - - Do not attempt to build the index, because all entries would evaluate to NULL. grbit MUST - also specify JET_bitIgnoreAnyNull when JET_bitIndexEmpty is passed. This is a performance - enhancement. For example if a new column is added to a table, then an index is created over - this newly added column, all of the records in the table would be scanned even though they - would never get added to the index anyway. Specifying JET_bitIndexEmpty skips the scanning - of the table, which could potentially take a long time. - - - - - Causes index creation to be visible to other transactions. Normally a session in a - transaction will not be able to see an index creation operation in another session. This - flag can be useful if another transaction is likely to create the same index, so that the - second index-create will simply fail instead of potentially causing many unnecessary database - operations. The second transaction may not be able to use the index immediately. The index - creation operation needs to complete before it is usable. The session must not currently be in - a transaction to create an index without version information. - - - - - Specifying this flag causes NULL values to be sorted after data for all columns in the index. - - - - - Key definition grbits. Used when retrieving information about an index. - - - - - Key segment is ascending. - - - - - Key segment is descending. - - - - - Options for the JET_CONDITIONALCOLUMN structure. - - - - - The column must be null for an index entry to appear in the index. - - - - - The column must be non-null for an index entry to appear in the index. - - - - - Options for temporary table creation. - - - - - - - Default options. - - - - - This option requests that the temporary table be flexible enough to - permit the use of JetSeek to lookup records by index key. If this - functionality it not required then it is best to not request it. If this - functionality is not requested then the temporary table manager may be - able to choose a strategy for managing the temporary table that will - result in improved performance. - - - - - This option requests that records with duplicate index keys be removed - from the final set of records in the temporary table. - Prior to Windows Server 2003, the database engine always assumed this - option to be in effect due to the fact that all clustered indexes must - also be a primary key and thus must be unique. As of Windows Server - 2003, it is now possible to create a temporary table that does NOT - remove duplicates when the - option is also specified. - It is not possible to know which duplicate will win and which duplicates - will be discarded in general. However, when the - option is requested then the first - record with a given index key to be inserted into the temporary table - will always win. - - - - - This option requests that the temporary table be flexible enough to - allow records that have previously been inserted to be subsequently - changed. If this functionality it not required then it is best to not - request it. If this functionality is not requested then the temporary - table manager may be able to choose a strategy for managing the - temporary table that will result in improved performance. - - - - - This option requests that the temporary table be flexible enough to - allow records to be scanned in arbitrary order and direction using - . - If this functionality it not required then it is best to not - request it. If this functionality is not requested then the temporary - table manager may be able to choose a strategy for managing the - temporary table that will result in improved performance. - - - - - This option requests that NULL key column values sort closer - to the end of the index than non-NULL key column values. - - - - - This option forces the temporary table manager to abandon - any attempt to choose a clever strategy for managing the - temporary table that will result in enhanced performance. - - - - - This option requests that any attempt to insert a record with the same - index key as a previously inserted record will immediately fail with - . If this option is not requested then a duplicate - may be detected immediately and fail or may be silently removed later - depending on the strategy chosen by the database engine to implement the - temporary table based on the requested functionality. If this - functionality it not required then it is best to not request it. If this - functionality is not requested then the temporary table manager may be - able to choose a strategy for managing the temporary table that will - result in improved performance. - - - - - Options for . - - - - - Default options. - - - - - The API should only attempt to delete columns in the derived table. - If a column of that name exists in the base table it will be ignored. - - - - - Options for . - - - - - Default options. - - - - - Options for . - - - - - Default options. - - - - - Options for . - - - - - Default options. - - - - Triggers cleanup of the version store. - - - - Reserved for future use. If this flag is specified, the API will return . - - - - - Returns if version store is more than half full. - - - - - Options for . - - - - - Defragments the available space portion of ESE database space - allocation. Database space is divided into two types, owned - space and available space. Owned space is allocated to a table - or index while available space is ready for use within the table - or index, respectively. Available space is much more dynamic in - behavior and requires on-line defragmentation more so than owned - space or table or index data. - - - - - Starts a new defragmentation task. - - - - - Stops a defragmentation task. - - - - - Options for . - - - - - Default options. - - - - - This changes the internal allocation policy to get space hierarchically - from a B-Tree's immediate parent. - - - - - This bit will enable Append split behavior to grow according to the - growth dynamics of the table (set by cbMinExtent, ulGrowth, cbMaxExtent). - - - - - This bit will enable Hotpoint split behavior to grow according to the - growth dynamics of the table (set by cbMinExtent, ulGrowth, cbMaxExtent). - - - - - Reserved and ignored. - - - - - By setting this the client indicates that forward sequential scan is - the predominant usage pattern of this table. - - - - - By setting this the client indicates that backwards sequential scan - is the predominant usage pattern of this table. - - - - - Reserved and ignored. - - - - - Reserved and ignored. - - - - - The application expects this table to be cleaned up in-order - sequentially (from lowest key to highest key). - - - - - Info levels for retrieve index information with JetGetIndexInfo - and JetGetTableIndexInfo. - - - - - Returns a structure with information about the index. - - - - - Returns a structure with information about the index. - - - - - SysTabCursor is obsolete. - - - - - OLC is obsolete. - - - - - Reset OLC is obsolete. - - - - - Returns an integer with the space usage of the index. - - - - - Returns an integer with the LCID of the index. - - - - - Langid is obsolete. Use instead. - - - - - Returns an integer with the count of indexes in the table. - - - - - Returns a ushort with the value of cbVarSegMac the index was created with. - - - - - Returns a identifying the index. - - - - - Introduced in Windows Vista. Returns a ushort with the value of cbKeyMost the - index was created with. - - - - - Introduced in Windows 7. Returns a JET_INDEXCREATE structure suitable - for use by JetCreateIndex2(). - - - - - Introduced in Windows 7. Returns a JET_INDEXCREATE2 structure suitable - for use by JetCreateIndex2(). - - - - - Gives information about the version of esent being used. - - - - - Gets a value indicating whether the current version of esent - supports features available in the Windows Server 2003 version of - esent. - - - - - Gets a value indicating whether the current version of esent - supports features available in the Windows Vista version of - esent. - - - - - Gets a value indicating whether the current version of esent - supports features available in the Windows 7 version of - esent. - - - - - Gets a value indicating whether the current version of esent - can use non-ASCII paths to access databases. - - - - - Gets a value indicating whether large (> 255 byte) keys are supported. - The key size for an index can be specified in the - object. - - - - - Gets a description of the current Esent capabilities. - - - We allow this to be set separately so that capabilities can - be downgraded for testing. - - - - - Enumerate columns in a table specified by dbid and name. - - - - - Base class for enumerators that return ColumnInfo objects. Subclasses differ - by how they open the table. - - - - - Initializes a new instance of the class. - - - The session to use. - - - - - Gets the entry the cursor is currently positioned on. - - The entry the cursor is currently positioned on. - - - - Create a ColumnInfo object from the data in the current JET_COLUMNLIST entry. - - The session to use. - The columnlist to take the data from. - A ColumnInfo object containing the information from that record. - - - - Gets or sets the columnlist used to retrieve data. - - - - - The database containing the table. - - - - - The name of the table. - - - - - Initializes a new instance of the class. - - - The session to use. - - - The database containing the table. - - - The name of the table. - - - - - Open the table to be enumerated. This should set . - - - - - Class that helps cache strings. - - - - - Don't cache strings whose length is longer than this. - - - - - Number of converted strings to hash. - - - - - Cached string values. - - - - - Return the interned version of a string, or the original - string if it isn't interned. - - The string to try to intern. - An interned copy of the string or the original string. - - - - Convert a byte array to a string. - - The bytes to convert. - The starting index of the data to convert. - The number of bytes to convert. - A string converted from the data. - - - - Convert a char array to a string, using a cached value if possible. - - The characters to convert. - The starting index of the data to convert. - The number of characters to convert. - A string converted from the data. - - - - Calculate the hash of a string. - - The characters to hash. - The starting index of the data to hash. - The number of characters to hash. - The hash value of the data. - - - - Determine if a string matches a char array.. - - The string to compare against. - The characters. - The starting index of the data. - The number of characters. - True if the string matches the char array. - - - - Convert a char array to a string. - - The characters to convert. - The starting index of the data to convert. - The number of characters to convert. - A string converted from the data. - - - - Callback used by JetEnumerateColumns to allocate memory for its output buffers. - - Context given to JetEnumerateColumns. - - If non-zero, a pointer to a memory block previously allocated by this callback. - - - The new size of the memory block (in bytes). If this is 0 and a memory block is - specified, that memory block will be freed. - - - A pointer to newly allocated memory. If memory could not be allocated then - should be returned. - - - - - An column value. - - - - - Recursive SetColumns method for data pinning. This populates the buffer and - calls the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - IEnumerable class that takes a delegate to create the enumerator it returns. - - The type returned by the enumerator. - - - - The delegate used to create the enumerator. - - - - - Initializes a new instance of the class. - - - The enumerator creator. - - - - - Returns an enumerator that iterates through the collection. - - - A - that can be used to iterate through the collection. - - - - - Returns an enumerator that iterates through a collection. - - - A - object that can be used to iterate through the collection. - - - - - IEnumerator creating delegate. - - A new enumerator. - - - - Base class for Operation exceptions. - - - - - Base class for ESENT error exceptions. - - - - - Initializes a new instance of the EsentErrorException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentErrorException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Gets the underlying Esent error for this exception. - - - - - Initializes a new instance of the EsentOperationException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentOperationException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for Data exceptions. - - - - - Initializes a new instance of the EsentDataException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentDataException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for Api exceptions. - - - - - Initializes a new instance of the EsentApiException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentApiException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for Fatal exceptions. - - - - - Initializes a new instance of the EsentFatalException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentFatalException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for IO exceptions. - - - - - Initializes a new instance of the EsentIOException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentIOException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for Resource exceptions. - - - - - Initializes a new instance of the EsentResourceException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentResourceException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for Memory exceptions. - - - - - Initializes a new instance of the EsentMemoryException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentMemoryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for Quota exceptions. - - - - - Initializes a new instance of the EsentQuotaException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentQuotaException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for Disk exceptions. - - - - - Initializes a new instance of the EsentDiskException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentDiskException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for Corruption exceptions. - - - - - Initializes a new instance of the EsentCorruptionException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentCorruptionException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for Inconsistent exceptions. - - - - - Initializes a new instance of the EsentInconsistentException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentInconsistentException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for Fragmentation exceptions. - - - - - Initializes a new instance of the EsentFragmentationException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentFragmentationException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for Usage exceptions. - - - - - Initializes a new instance of the EsentUsageException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentUsageException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for State exceptions. - - - - - Initializes a new instance of the EsentStateException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentStateException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for Obsolete exceptions. - - - - - Initializes a new instance of the EsentObsoleteException class. - - The description of the error. - The error code of the exception. - - - - Initializes a new instance of the EsentObsoleteException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RfsFailure exceptions. - - - - - Initializes a new instance of the EsentRfsFailureException class. - - - - - Initializes a new instance of the EsentRfsFailureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RfsNotArmed exceptions. - - - - - Initializes a new instance of the EsentRfsNotArmedException class. - - - - - Initializes a new instance of the EsentRfsNotArmedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.FileClose exceptions. - - - - - Initializes a new instance of the EsentFileCloseException class. - - - - - Initializes a new instance of the EsentFileCloseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OutOfThreads exceptions. - - - - - Initializes a new instance of the EsentOutOfThreadsException class. - - - - - Initializes a new instance of the EsentOutOfThreadsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManyIO exceptions. - - - - - Initializes a new instance of the EsentTooManyIOException class. - - - - - Initializes a new instance of the EsentTooManyIOException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TaskDropped exceptions. - - - - - Initializes a new instance of the EsentTaskDroppedException class. - - - - - Initializes a new instance of the EsentTaskDroppedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InternalError exceptions. - - - - - Initializes a new instance of the EsentInternalErrorException class. - - - - - Initializes a new instance of the EsentInternalErrorException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DisabledFunctionality exceptions. - - - - - Initializes a new instance of the EsentDisabledFunctionalityException class. - - - - - Initializes a new instance of the EsentDisabledFunctionalityException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseBufferDependenciesCorrupted exceptions. - - - - - Initializes a new instance of the EsentDatabaseBufferDependenciesCorruptedException class. - - - - - Initializes a new instance of the EsentDatabaseBufferDependenciesCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.PreviousVersion exceptions. - - - - - Initializes a new instance of the EsentPreviousVersionException class. - - - - - Initializes a new instance of the EsentPreviousVersionException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.PageBoundary exceptions. - - - - - Initializes a new instance of the EsentPageBoundaryException class. - - - - - Initializes a new instance of the EsentPageBoundaryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.KeyBoundary exceptions. - - - - - Initializes a new instance of the EsentKeyBoundaryException class. - - - - - Initializes a new instance of the EsentKeyBoundaryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BadPageLink exceptions. - - - - - Initializes a new instance of the EsentBadPageLinkException class. - - - - - Initializes a new instance of the EsentBadPageLinkException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BadBookmark exceptions. - - - - - Initializes a new instance of the EsentBadBookmarkException class. - - - - - Initializes a new instance of the EsentBadBookmarkException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.NTSystemCallFailed exceptions. - - - - - Initializes a new instance of the EsentNTSystemCallFailedException class. - - - - - Initializes a new instance of the EsentNTSystemCallFailedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BadParentPageLink exceptions. - - - - - Initializes a new instance of the EsentBadParentPageLinkException class. - - - - - Initializes a new instance of the EsentBadParentPageLinkException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SPAvailExtCacheOutOfSync exceptions. - - - - - Initializes a new instance of the EsentSPAvailExtCacheOutOfSyncException class. - - - - - Initializes a new instance of the EsentSPAvailExtCacheOutOfSyncException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SPAvailExtCorrupted exceptions. - - - - - Initializes a new instance of the EsentSPAvailExtCorruptedException class. - - - - - Initializes a new instance of the EsentSPAvailExtCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SPAvailExtCacheOutOfMemory exceptions. - - - - - Initializes a new instance of the EsentSPAvailExtCacheOutOfMemoryException class. - - - - - Initializes a new instance of the EsentSPAvailExtCacheOutOfMemoryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SPOwnExtCorrupted exceptions. - - - - - Initializes a new instance of the EsentSPOwnExtCorruptedException class. - - - - - Initializes a new instance of the EsentSPOwnExtCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DbTimeCorrupted exceptions. - - - - - Initializes a new instance of the EsentDbTimeCorruptedException class. - - - - - Initializes a new instance of the EsentDbTimeCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.KeyTruncated exceptions. - - - - - Initializes a new instance of the EsentKeyTruncatedException class. - - - - - Initializes a new instance of the EsentKeyTruncatedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseLeakInSpace exceptions. - - - - - Initializes a new instance of the EsentDatabaseLeakInSpaceException class. - - - - - Initializes a new instance of the EsentDatabaseLeakInSpaceException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.KeyTooBig exceptions. - - - - - Initializes a new instance of the EsentKeyTooBigException class. - - - - - Initializes a new instance of the EsentKeyTooBigException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CannotSeparateIntrinsicLV exceptions. - - - - - Initializes a new instance of the EsentCannotSeparateIntrinsicLVException class. - - - - - Initializes a new instance of the EsentCannotSeparateIntrinsicLVException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SeparatedLongValue exceptions. - - - - - Initializes a new instance of the EsentSeparatedLongValueException class. - - - - - Initializes a new instance of the EsentSeparatedLongValueException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidLoggedOperation exceptions. - - - - - Initializes a new instance of the EsentInvalidLoggedOperationException class. - - - - - Initializes a new instance of the EsentInvalidLoggedOperationException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogFileCorrupt exceptions. - - - - - Initializes a new instance of the EsentLogFileCorruptException class. - - - - - Initializes a new instance of the EsentLogFileCorruptException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.NoBackupDirectory exceptions. - - - - - Initializes a new instance of the EsentNoBackupDirectoryException class. - - - - - Initializes a new instance of the EsentNoBackupDirectoryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BackupDirectoryNotEmpty exceptions. - - - - - Initializes a new instance of the EsentBackupDirectoryNotEmptyException class. - - - - - Initializes a new instance of the EsentBackupDirectoryNotEmptyException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BackupInProgress exceptions. - - - - - Initializes a new instance of the EsentBackupInProgressException class. - - - - - Initializes a new instance of the EsentBackupInProgressException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RestoreInProgress exceptions. - - - - - Initializes a new instance of the EsentRestoreInProgressException class. - - - - - Initializes a new instance of the EsentRestoreInProgressException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MissingPreviousLogFile exceptions. - - - - - Initializes a new instance of the EsentMissingPreviousLogFileException class. - - - - - Initializes a new instance of the EsentMissingPreviousLogFileException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogWriteFail exceptions. - - - - - Initializes a new instance of the EsentLogWriteFailException class. - - - - - Initializes a new instance of the EsentLogWriteFailException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogDisabledDueToRecoveryFailure exceptions. - - - - - Initializes a new instance of the EsentLogDisabledDueToRecoveryFailureException class. - - - - - Initializes a new instance of the EsentLogDisabledDueToRecoveryFailureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CannotLogDuringRecoveryRedo exceptions. - - - - - Initializes a new instance of the EsentCannotLogDuringRecoveryRedoException class. - - - - - Initializes a new instance of the EsentCannotLogDuringRecoveryRedoException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogGenerationMismatch exceptions. - - - - - Initializes a new instance of the EsentLogGenerationMismatchException class. - - - - - Initializes a new instance of the EsentLogGenerationMismatchException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BadLogVersion exceptions. - - - - - Initializes a new instance of the EsentBadLogVersionException class. - - - - - Initializes a new instance of the EsentBadLogVersionException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidLogSequence exceptions. - - - - - Initializes a new instance of the EsentInvalidLogSequenceException class. - - - - - Initializes a new instance of the EsentInvalidLogSequenceException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LoggingDisabled exceptions. - - - - - Initializes a new instance of the EsentLoggingDisabledException class. - - - - - Initializes a new instance of the EsentLoggingDisabledException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogBufferTooSmall exceptions. - - - - - Initializes a new instance of the EsentLogBufferTooSmallException class. - - - - - Initializes a new instance of the EsentLogBufferTooSmallException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogSequenceEnd exceptions. - - - - - Initializes a new instance of the EsentLogSequenceEndException class. - - - - - Initializes a new instance of the EsentLogSequenceEndException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.NoBackup exceptions. - - - - - Initializes a new instance of the EsentNoBackupException class. - - - - - Initializes a new instance of the EsentNoBackupException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidBackupSequence exceptions. - - - - - Initializes a new instance of the EsentInvalidBackupSequenceException class. - - - - - Initializes a new instance of the EsentInvalidBackupSequenceException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BackupNotAllowedYet exceptions. - - - - - Initializes a new instance of the EsentBackupNotAllowedYetException class. - - - - - Initializes a new instance of the EsentBackupNotAllowedYetException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DeleteBackupFileFail exceptions. - - - - - Initializes a new instance of the EsentDeleteBackupFileFailException class. - - - - - Initializes a new instance of the EsentDeleteBackupFileFailException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MakeBackupDirectoryFail exceptions. - - - - - Initializes a new instance of the EsentMakeBackupDirectoryFailException class. - - - - - Initializes a new instance of the EsentMakeBackupDirectoryFailException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidBackup exceptions. - - - - - Initializes a new instance of the EsentInvalidBackupException class. - - - - - Initializes a new instance of the EsentInvalidBackupException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RecoveredWithErrors exceptions. - - - - - Initializes a new instance of the EsentRecoveredWithErrorsException class. - - - - - Initializes a new instance of the EsentRecoveredWithErrorsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MissingLogFile exceptions. - - - - - Initializes a new instance of the EsentMissingLogFileException class. - - - - - Initializes a new instance of the EsentMissingLogFileException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogDiskFull exceptions. - - - - - Initializes a new instance of the EsentLogDiskFullException class. - - - - - Initializes a new instance of the EsentLogDiskFullException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BadLogSignature exceptions. - - - - - Initializes a new instance of the EsentBadLogSignatureException class. - - - - - Initializes a new instance of the EsentBadLogSignatureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BadDbSignature exceptions. - - - - - Initializes a new instance of the EsentBadDbSignatureException class. - - - - - Initializes a new instance of the EsentBadDbSignatureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BadCheckpointSignature exceptions. - - - - - Initializes a new instance of the EsentBadCheckpointSignatureException class. - - - - - Initializes a new instance of the EsentBadCheckpointSignatureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CheckpointCorrupt exceptions. - - - - - Initializes a new instance of the EsentCheckpointCorruptException class. - - - - - Initializes a new instance of the EsentCheckpointCorruptException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MissingPatchPage exceptions. - - - - - Initializes a new instance of the EsentMissingPatchPageException class. - - - - - Initializes a new instance of the EsentMissingPatchPageException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BadPatchPage exceptions. - - - - - Initializes a new instance of the EsentBadPatchPageException class. - - - - - Initializes a new instance of the EsentBadPatchPageException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RedoAbruptEnded exceptions. - - - - - Initializes a new instance of the EsentRedoAbruptEndedException class. - - - - - Initializes a new instance of the EsentRedoAbruptEndedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BadSLVSignature exceptions. - - - - - Initializes a new instance of the EsentBadSLVSignatureException class. - - - - - Initializes a new instance of the EsentBadSLVSignatureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.PatchFileMissing exceptions. - - - - - Initializes a new instance of the EsentPatchFileMissingException class. - - - - - Initializes a new instance of the EsentPatchFileMissingException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseLogSetMismatch exceptions. - - - - - Initializes a new instance of the EsentDatabaseLogSetMismatchException class. - - - - - Initializes a new instance of the EsentDatabaseLogSetMismatchException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseStreamingFileMismatch exceptions. - - - - - Initializes a new instance of the EsentDatabaseStreamingFileMismatchException class. - - - - - Initializes a new instance of the EsentDatabaseStreamingFileMismatchException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogFileSizeMismatch exceptions. - - - - - Initializes a new instance of the EsentLogFileSizeMismatchException class. - - - - - Initializes a new instance of the EsentLogFileSizeMismatchException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CheckpointFileNotFound exceptions. - - - - - Initializes a new instance of the EsentCheckpointFileNotFoundException class. - - - - - Initializes a new instance of the EsentCheckpointFileNotFoundException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RequiredLogFilesMissing exceptions. - - - - - Initializes a new instance of the EsentRequiredLogFilesMissingException class. - - - - - Initializes a new instance of the EsentRequiredLogFilesMissingException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SoftRecoveryOnBackupDatabase exceptions. - - - - - Initializes a new instance of the EsentSoftRecoveryOnBackupDatabaseException class. - - - - - Initializes a new instance of the EsentSoftRecoveryOnBackupDatabaseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogFileSizeMismatchDatabasesConsistent exceptions. - - - - - Initializes a new instance of the EsentLogFileSizeMismatchDatabasesConsistentException class. - - - - - Initializes a new instance of the EsentLogFileSizeMismatchDatabasesConsistentException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogSectorSizeMismatch exceptions. - - - - - Initializes a new instance of the EsentLogSectorSizeMismatchException class. - - - - - Initializes a new instance of the EsentLogSectorSizeMismatchException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogSectorSizeMismatchDatabasesConsistent exceptions. - - - - - Initializes a new instance of the EsentLogSectorSizeMismatchDatabasesConsistentException class. - - - - - Initializes a new instance of the EsentLogSectorSizeMismatchDatabasesConsistentException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogSequenceEndDatabasesConsistent exceptions. - - - - - Initializes a new instance of the EsentLogSequenceEndDatabasesConsistentException class. - - - - - Initializes a new instance of the EsentLogSequenceEndDatabasesConsistentException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.StreamingDataNotLogged exceptions. - - - - - Initializes a new instance of the EsentStreamingDataNotLoggedException class. - - - - - Initializes a new instance of the EsentStreamingDataNotLoggedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseDirtyShutdown exceptions. - - - - - Initializes a new instance of the EsentDatabaseDirtyShutdownException class. - - - - - Initializes a new instance of the EsentDatabaseDirtyShutdownException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ConsistentTimeMismatch exceptions. - - - - - Initializes a new instance of the EsentConsistentTimeMismatchException class. - - - - - Initializes a new instance of the EsentConsistentTimeMismatchException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabasePatchFileMismatch exceptions. - - - - - Initializes a new instance of the EsentDatabasePatchFileMismatchException class. - - - - - Initializes a new instance of the EsentDatabasePatchFileMismatchException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.EndingRestoreLogTooLow exceptions. - - - - - Initializes a new instance of the EsentEndingRestoreLogTooLowException class. - - - - - Initializes a new instance of the EsentEndingRestoreLogTooLowException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.StartingRestoreLogTooHigh exceptions. - - - - - Initializes a new instance of the EsentStartingRestoreLogTooHighException class. - - - - - Initializes a new instance of the EsentStartingRestoreLogTooHighException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.GivenLogFileHasBadSignature exceptions. - - - - - Initializes a new instance of the EsentGivenLogFileHasBadSignatureException class. - - - - - Initializes a new instance of the EsentGivenLogFileHasBadSignatureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.GivenLogFileIsNotContiguous exceptions. - - - - - Initializes a new instance of the EsentGivenLogFileIsNotContiguousException class. - - - - - Initializes a new instance of the EsentGivenLogFileIsNotContiguousException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MissingRestoreLogFiles exceptions. - - - - - Initializes a new instance of the EsentMissingRestoreLogFilesException class. - - - - - Initializes a new instance of the EsentMissingRestoreLogFilesException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MissingFullBackup exceptions. - - - - - Initializes a new instance of the EsentMissingFullBackupException class. - - - - - Initializes a new instance of the EsentMissingFullBackupException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BadBackupDatabaseSize exceptions. - - - - - Initializes a new instance of the EsentBadBackupDatabaseSizeException class. - - - - - Initializes a new instance of the EsentBadBackupDatabaseSizeException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseAlreadyUpgraded exceptions. - - - - - Initializes a new instance of the EsentDatabaseAlreadyUpgradedException class. - - - - - Initializes a new instance of the EsentDatabaseAlreadyUpgradedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseIncompleteUpgrade exceptions. - - - - - Initializes a new instance of the EsentDatabaseIncompleteUpgradeException class. - - - - - Initializes a new instance of the EsentDatabaseIncompleteUpgradeException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MissingCurrentLogFiles exceptions. - - - - - Initializes a new instance of the EsentMissingCurrentLogFilesException class. - - - - - Initializes a new instance of the EsentMissingCurrentLogFilesException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DbTimeTooOld exceptions. - - - - - Initializes a new instance of the EsentDbTimeTooOldException class. - - - - - Initializes a new instance of the EsentDbTimeTooOldException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DbTimeTooNew exceptions. - - - - - Initializes a new instance of the EsentDbTimeTooNewException class. - - - - - Initializes a new instance of the EsentDbTimeTooNewException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MissingFileToBackup exceptions. - - - - - Initializes a new instance of the EsentMissingFileToBackupException class. - - - - - Initializes a new instance of the EsentMissingFileToBackupException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogTornWriteDuringHardRestore exceptions. - - - - - Initializes a new instance of the EsentLogTornWriteDuringHardRestoreException class. - - - - - Initializes a new instance of the EsentLogTornWriteDuringHardRestoreException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogTornWriteDuringHardRecovery exceptions. - - - - - Initializes a new instance of the EsentLogTornWriteDuringHardRecoveryException class. - - - - - Initializes a new instance of the EsentLogTornWriteDuringHardRecoveryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogCorruptDuringHardRestore exceptions. - - - - - Initializes a new instance of the EsentLogCorruptDuringHardRestoreException class. - - - - - Initializes a new instance of the EsentLogCorruptDuringHardRestoreException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogCorruptDuringHardRecovery exceptions. - - - - - Initializes a new instance of the EsentLogCorruptDuringHardRecoveryException class. - - - - - Initializes a new instance of the EsentLogCorruptDuringHardRecoveryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MustDisableLoggingForDbUpgrade exceptions. - - - - - Initializes a new instance of the EsentMustDisableLoggingForDbUpgradeException class. - - - - - Initializes a new instance of the EsentMustDisableLoggingForDbUpgradeException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BadRestoreTargetInstance exceptions. - - - - - Initializes a new instance of the EsentBadRestoreTargetInstanceException class. - - - - - Initializes a new instance of the EsentBadRestoreTargetInstanceException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RecoveredWithoutUndo exceptions. - - - - - Initializes a new instance of the EsentRecoveredWithoutUndoException class. - - - - - Initializes a new instance of the EsentRecoveredWithoutUndoException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabasesNotFromSameSnapshot exceptions. - - - - - Initializes a new instance of the EsentDatabasesNotFromSameSnapshotException class. - - - - - Initializes a new instance of the EsentDatabasesNotFromSameSnapshotException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SoftRecoveryOnSnapshot exceptions. - - - - - Initializes a new instance of the EsentSoftRecoveryOnSnapshotException class. - - - - - Initializes a new instance of the EsentSoftRecoveryOnSnapshotException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CommittedLogFilesMissing exceptions. - - - - - Initializes a new instance of the EsentCommittedLogFilesMissingException class. - - - - - Initializes a new instance of the EsentCommittedLogFilesMissingException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SectorSizeNotSupported exceptions. - - - - - Initializes a new instance of the EsentSectorSizeNotSupportedException class. - - - - - Initializes a new instance of the EsentSectorSizeNotSupportedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RecoveredWithoutUndoDatabasesConsistent exceptions. - - - - - Initializes a new instance of the EsentRecoveredWithoutUndoDatabasesConsistentException class. - - - - - Initializes a new instance of the EsentRecoveredWithoutUndoDatabasesConsistentException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CommittedLogFileCorrupt exceptions. - - - - - Initializes a new instance of the EsentCommittedLogFileCorruptException class. - - - - - Initializes a new instance of the EsentCommittedLogFileCorruptException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.UnicodeTranslationBufferTooSmall exceptions. - - - - - Initializes a new instance of the EsentUnicodeTranslationBufferTooSmallException class. - - - - - Initializes a new instance of the EsentUnicodeTranslationBufferTooSmallException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.UnicodeTranslationFail exceptions. - - - - - Initializes a new instance of the EsentUnicodeTranslationFailException class. - - - - - Initializes a new instance of the EsentUnicodeTranslationFailException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.UnicodeNormalizationNotSupported exceptions. - - - - - Initializes a new instance of the EsentUnicodeNormalizationNotSupportedException class. - - - - - Initializes a new instance of the EsentUnicodeNormalizationNotSupportedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.UnicodeLanguageValidationFailure exceptions. - - - - - Initializes a new instance of the EsentUnicodeLanguageValidationFailureException class. - - - - - Initializes a new instance of the EsentUnicodeLanguageValidationFailureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ExistingLogFileHasBadSignature exceptions. - - - - - Initializes a new instance of the EsentExistingLogFileHasBadSignatureException class. - - - - - Initializes a new instance of the EsentExistingLogFileHasBadSignatureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ExistingLogFileIsNotContiguous exceptions. - - - - - Initializes a new instance of the EsentExistingLogFileIsNotContiguousException class. - - - - - Initializes a new instance of the EsentExistingLogFileIsNotContiguousException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogReadVerifyFailure exceptions. - - - - - Initializes a new instance of the EsentLogReadVerifyFailureException class. - - - - - Initializes a new instance of the EsentLogReadVerifyFailureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVReadVerifyFailure exceptions. - - - - - Initializes a new instance of the EsentSLVReadVerifyFailureException class. - - - - - Initializes a new instance of the EsentSLVReadVerifyFailureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CheckpointDepthTooDeep exceptions. - - - - - Initializes a new instance of the EsentCheckpointDepthTooDeepException class. - - - - - Initializes a new instance of the EsentCheckpointDepthTooDeepException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RestoreOfNonBackupDatabase exceptions. - - - - - Initializes a new instance of the EsentRestoreOfNonBackupDatabaseException class. - - - - - Initializes a new instance of the EsentRestoreOfNonBackupDatabaseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogFileNotCopied exceptions. - - - - - Initializes a new instance of the EsentLogFileNotCopiedException class. - - - - - Initializes a new instance of the EsentLogFileNotCopiedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SurrogateBackupInProgress exceptions. - - - - - Initializes a new instance of the EsentSurrogateBackupInProgressException class. - - - - - Initializes a new instance of the EsentSurrogateBackupInProgressException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BackupAbortByServer exceptions. - - - - - Initializes a new instance of the EsentBackupAbortByServerException class. - - - - - Initializes a new instance of the EsentBackupAbortByServerException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidGrbit exceptions. - - - - - Initializes a new instance of the EsentInvalidGrbitException class. - - - - - Initializes a new instance of the EsentInvalidGrbitException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TermInProgress exceptions. - - - - - Initializes a new instance of the EsentTermInProgressException class. - - - - - Initializes a new instance of the EsentTermInProgressException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.FeatureNotAvailable exceptions. - - - - - Initializes a new instance of the EsentFeatureNotAvailableException class. - - - - - Initializes a new instance of the EsentFeatureNotAvailableException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidName exceptions. - - - - - Initializes a new instance of the EsentInvalidNameException class. - - - - - Initializes a new instance of the EsentInvalidNameException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidParameter exceptions. - - - - - Initializes a new instance of the EsentInvalidParameterException class. - - - - - Initializes a new instance of the EsentInvalidParameterException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseFileReadOnly exceptions. - - - - - Initializes a new instance of the EsentDatabaseFileReadOnlyException class. - - - - - Initializes a new instance of the EsentDatabaseFileReadOnlyException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidDatabaseId exceptions. - - - - - Initializes a new instance of the EsentInvalidDatabaseIdException class. - - - - - Initializes a new instance of the EsentInvalidDatabaseIdException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OutOfMemory exceptions. - - - - - Initializes a new instance of the EsentOutOfMemoryException class. - - - - - Initializes a new instance of the EsentOutOfMemoryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OutOfDatabaseSpace exceptions. - - - - - Initializes a new instance of the EsentOutOfDatabaseSpaceException class. - - - - - Initializes a new instance of the EsentOutOfDatabaseSpaceException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OutOfCursors exceptions. - - - - - Initializes a new instance of the EsentOutOfCursorsException class. - - - - - Initializes a new instance of the EsentOutOfCursorsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OutOfBuffers exceptions. - - - - - Initializes a new instance of the EsentOutOfBuffersException class. - - - - - Initializes a new instance of the EsentOutOfBuffersException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManyIndexes exceptions. - - - - - Initializes a new instance of the EsentTooManyIndexesException class. - - - - - Initializes a new instance of the EsentTooManyIndexesException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManyKeys exceptions. - - - - - Initializes a new instance of the EsentTooManyKeysException class. - - - - - Initializes a new instance of the EsentTooManyKeysException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RecordDeleted exceptions. - - - - - Initializes a new instance of the EsentRecordDeletedException class. - - - - - Initializes a new instance of the EsentRecordDeletedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ReadVerifyFailure exceptions. - - - - - Initializes a new instance of the EsentReadVerifyFailureException class. - - - - - Initializes a new instance of the EsentReadVerifyFailureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.PageNotInitialized exceptions. - - - - - Initializes a new instance of the EsentPageNotInitializedException class. - - - - - Initializes a new instance of the EsentPageNotInitializedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OutOfFileHandles exceptions. - - - - - Initializes a new instance of the EsentOutOfFileHandlesException class. - - - - - Initializes a new instance of the EsentOutOfFileHandlesException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DiskReadVerificationFailure exceptions. - - - - - Initializes a new instance of the EsentDiskReadVerificationFailureException class. - - - - - Initializes a new instance of the EsentDiskReadVerificationFailureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DiskIO exceptions. - - - - - Initializes a new instance of the EsentDiskIOException class. - - - - - Initializes a new instance of the EsentDiskIOException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidPath exceptions. - - - - - Initializes a new instance of the EsentInvalidPathException class. - - - - - Initializes a new instance of the EsentInvalidPathException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidSystemPath exceptions. - - - - - Initializes a new instance of the EsentInvalidSystemPathException class. - - - - - Initializes a new instance of the EsentInvalidSystemPathException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidLogDirectory exceptions. - - - - - Initializes a new instance of the EsentInvalidLogDirectoryException class. - - - - - Initializes a new instance of the EsentInvalidLogDirectoryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RecordTooBig exceptions. - - - - - Initializes a new instance of the EsentRecordTooBigException class. - - - - - Initializes a new instance of the EsentRecordTooBigException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManyOpenDatabases exceptions. - - - - - Initializes a new instance of the EsentTooManyOpenDatabasesException class. - - - - - Initializes a new instance of the EsentTooManyOpenDatabasesException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidDatabase exceptions. - - - - - Initializes a new instance of the EsentInvalidDatabaseException class. - - - - - Initializes a new instance of the EsentInvalidDatabaseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.NotInitialized exceptions. - - - - - Initializes a new instance of the EsentNotInitializedException class. - - - - - Initializes a new instance of the EsentNotInitializedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.AlreadyInitialized exceptions. - - - - - Initializes a new instance of the EsentAlreadyInitializedException class. - - - - - Initializes a new instance of the EsentAlreadyInitializedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InitInProgress exceptions. - - - - - Initializes a new instance of the EsentInitInProgressException class. - - - - - Initializes a new instance of the EsentInitInProgressException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.FileAccessDenied exceptions. - - - - - Initializes a new instance of the EsentFileAccessDeniedException class. - - - - - Initializes a new instance of the EsentFileAccessDeniedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.QueryNotSupported exceptions. - - - - - Initializes a new instance of the EsentQueryNotSupportedException class. - - - - - Initializes a new instance of the EsentQueryNotSupportedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SQLLinkNotSupported exceptions. - - - - - Initializes a new instance of the EsentSQLLinkNotSupportedException class. - - - - - Initializes a new instance of the EsentSQLLinkNotSupportedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BufferTooSmall exceptions. - - - - - Initializes a new instance of the EsentBufferTooSmallException class. - - - - - Initializes a new instance of the EsentBufferTooSmallException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManyColumns exceptions. - - - - - Initializes a new instance of the EsentTooManyColumnsException class. - - - - - Initializes a new instance of the EsentTooManyColumnsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ContainerNotEmpty exceptions. - - - - - Initializes a new instance of the EsentContainerNotEmptyException class. - - - - - Initializes a new instance of the EsentContainerNotEmptyException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidFilename exceptions. - - - - - Initializes a new instance of the EsentInvalidFilenameException class. - - - - - Initializes a new instance of the EsentInvalidFilenameException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidBookmark exceptions. - - - - - Initializes a new instance of the EsentInvalidBookmarkException class. - - - - - Initializes a new instance of the EsentInvalidBookmarkException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ColumnInUse exceptions. - - - - - Initializes a new instance of the EsentColumnInUseException class. - - - - - Initializes a new instance of the EsentColumnInUseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidBufferSize exceptions. - - - - - Initializes a new instance of the EsentInvalidBufferSizeException class. - - - - - Initializes a new instance of the EsentInvalidBufferSizeException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ColumnNotUpdatable exceptions. - - - - - Initializes a new instance of the EsentColumnNotUpdatableException class. - - - - - Initializes a new instance of the EsentColumnNotUpdatableException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexInUse exceptions. - - - - - Initializes a new instance of the EsentIndexInUseException class. - - - - - Initializes a new instance of the EsentIndexInUseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LinkNotSupported exceptions. - - - - - Initializes a new instance of the EsentLinkNotSupportedException class. - - - - - Initializes a new instance of the EsentLinkNotSupportedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.NullKeyDisallowed exceptions. - - - - - Initializes a new instance of the EsentNullKeyDisallowedException class. - - - - - Initializes a new instance of the EsentNullKeyDisallowedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.NotInTransaction exceptions. - - - - - Initializes a new instance of the EsentNotInTransactionException class. - - - - - Initializes a new instance of the EsentNotInTransactionException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MustRollback exceptions. - - - - - Initializes a new instance of the EsentMustRollbackException class. - - - - - Initializes a new instance of the EsentMustRollbackException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManyActiveUsers exceptions. - - - - - Initializes a new instance of the EsentTooManyActiveUsersException class. - - - - - Initializes a new instance of the EsentTooManyActiveUsersException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidCountry exceptions. - - - - - Initializes a new instance of the EsentInvalidCountryException class. - - - - - Initializes a new instance of the EsentInvalidCountryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidLanguageId exceptions. - - - - - Initializes a new instance of the EsentInvalidLanguageIdException class. - - - - - Initializes a new instance of the EsentInvalidLanguageIdException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidCodePage exceptions. - - - - - Initializes a new instance of the EsentInvalidCodePageException class. - - - - - Initializes a new instance of the EsentInvalidCodePageException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidLCMapStringFlags exceptions. - - - - - Initializes a new instance of the EsentInvalidLCMapStringFlagsException class. - - - - - Initializes a new instance of the EsentInvalidLCMapStringFlagsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.VersionStoreEntryTooBig exceptions. - - - - - Initializes a new instance of the EsentVersionStoreEntryTooBigException class. - - - - - Initializes a new instance of the EsentVersionStoreEntryTooBigException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.VersionStoreOutOfMemoryAndCleanupTimedOut exceptions. - - - - - Initializes a new instance of the EsentVersionStoreOutOfMemoryAndCleanupTimedOutException class. - - - - - Initializes a new instance of the EsentVersionStoreOutOfMemoryAndCleanupTimedOutException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.VersionStoreOutOfMemory exceptions. - - - - - Initializes a new instance of the EsentVersionStoreOutOfMemoryException class. - - - - - Initializes a new instance of the EsentVersionStoreOutOfMemoryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CurrencyStackOutOfMemory exceptions. - - - - - Initializes a new instance of the EsentCurrencyStackOutOfMemoryException class. - - - - - Initializes a new instance of the EsentCurrencyStackOutOfMemoryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CannotIndex exceptions. - - - - - Initializes a new instance of the EsentCannotIndexException class. - - - - - Initializes a new instance of the EsentCannotIndexException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RecordNotDeleted exceptions. - - - - - Initializes a new instance of the EsentRecordNotDeletedException class. - - - - - Initializes a new instance of the EsentRecordNotDeletedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManyMempoolEntries exceptions. - - - - - Initializes a new instance of the EsentTooManyMempoolEntriesException class. - - - - - Initializes a new instance of the EsentTooManyMempoolEntriesException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OutOfObjectIDs exceptions. - - - - - Initializes a new instance of the EsentOutOfObjectIDsException class. - - - - - Initializes a new instance of the EsentOutOfObjectIDsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OutOfLongValueIDs exceptions. - - - - - Initializes a new instance of the EsentOutOfLongValueIDsException class. - - - - - Initializes a new instance of the EsentOutOfLongValueIDsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OutOfAutoincrementValues exceptions. - - - - - Initializes a new instance of the EsentOutOfAutoincrementValuesException class. - - - - - Initializes a new instance of the EsentOutOfAutoincrementValuesException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OutOfDbtimeValues exceptions. - - - - - Initializes a new instance of the EsentOutOfDbtimeValuesException class. - - - - - Initializes a new instance of the EsentOutOfDbtimeValuesException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OutOfSequentialIndexValues exceptions. - - - - - Initializes a new instance of the EsentOutOfSequentialIndexValuesException class. - - - - - Initializes a new instance of the EsentOutOfSequentialIndexValuesException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RunningInOneInstanceMode exceptions. - - - - - Initializes a new instance of the EsentRunningInOneInstanceModeException class. - - - - - Initializes a new instance of the EsentRunningInOneInstanceModeException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RunningInMultiInstanceMode exceptions. - - - - - Initializes a new instance of the EsentRunningInMultiInstanceModeException class. - - - - - Initializes a new instance of the EsentRunningInMultiInstanceModeException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SystemParamsAlreadySet exceptions. - - - - - Initializes a new instance of the EsentSystemParamsAlreadySetException class. - - - - - Initializes a new instance of the EsentSystemParamsAlreadySetException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SystemPathInUse exceptions. - - - - - Initializes a new instance of the EsentSystemPathInUseException class. - - - - - Initializes a new instance of the EsentSystemPathInUseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogFilePathInUse exceptions. - - - - - Initializes a new instance of the EsentLogFilePathInUseException class. - - - - - Initializes a new instance of the EsentLogFilePathInUseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TempPathInUse exceptions. - - - - - Initializes a new instance of the EsentTempPathInUseException class. - - - - - Initializes a new instance of the EsentTempPathInUseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InstanceNameInUse exceptions. - - - - - Initializes a new instance of the EsentInstanceNameInUseException class. - - - - - Initializes a new instance of the EsentInstanceNameInUseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InstanceUnavailable exceptions. - - - - - Initializes a new instance of the EsentInstanceUnavailableException class. - - - - - Initializes a new instance of the EsentInstanceUnavailableException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseUnavailable exceptions. - - - - - Initializes a new instance of the EsentDatabaseUnavailableException class. - - - - - Initializes a new instance of the EsentDatabaseUnavailableException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InstanceUnavailableDueToFatalLogDiskFull exceptions. - - - - - Initializes a new instance of the EsentInstanceUnavailableDueToFatalLogDiskFullException class. - - - - - Initializes a new instance of the EsentInstanceUnavailableDueToFatalLogDiskFullException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OutOfSessions exceptions. - - - - - Initializes a new instance of the EsentOutOfSessionsException class. - - - - - Initializes a new instance of the EsentOutOfSessionsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.WriteConflict exceptions. - - - - - Initializes a new instance of the EsentWriteConflictException class. - - - - - Initializes a new instance of the EsentWriteConflictException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TransTooDeep exceptions. - - - - - Initializes a new instance of the EsentTransTooDeepException class. - - - - - Initializes a new instance of the EsentTransTooDeepException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidSesid exceptions. - - - - - Initializes a new instance of the EsentInvalidSesidException class. - - - - - Initializes a new instance of the EsentInvalidSesidException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.WriteConflictPrimaryIndex exceptions. - - - - - Initializes a new instance of the EsentWriteConflictPrimaryIndexException class. - - - - - Initializes a new instance of the EsentWriteConflictPrimaryIndexException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InTransaction exceptions. - - - - - Initializes a new instance of the EsentInTransactionException class. - - - - - Initializes a new instance of the EsentInTransactionException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RollbackRequired exceptions. - - - - - Initializes a new instance of the EsentRollbackRequiredException class. - - - - - Initializes a new instance of the EsentRollbackRequiredException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TransReadOnly exceptions. - - - - - Initializes a new instance of the EsentTransReadOnlyException class. - - - - - Initializes a new instance of the EsentTransReadOnlyException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SessionWriteConflict exceptions. - - - - - Initializes a new instance of the EsentSessionWriteConflictException class. - - - - - Initializes a new instance of the EsentSessionWriteConflictException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RecordTooBigForBackwardCompatibility exceptions. - - - - - Initializes a new instance of the EsentRecordTooBigForBackwardCompatibilityException class. - - - - - Initializes a new instance of the EsentRecordTooBigForBackwardCompatibilityException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CannotMaterializeForwardOnlySort exceptions. - - - - - Initializes a new instance of the EsentCannotMaterializeForwardOnlySortException class. - - - - - Initializes a new instance of the EsentCannotMaterializeForwardOnlySortException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SesidTableIdMismatch exceptions. - - - - - Initializes a new instance of the EsentSesidTableIdMismatchException class. - - - - - Initializes a new instance of the EsentSesidTableIdMismatchException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidInstance exceptions. - - - - - Initializes a new instance of the EsentInvalidInstanceException class. - - - - - Initializes a new instance of the EsentInvalidInstanceException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DirtyShutdown exceptions. - - - - - Initializes a new instance of the EsentDirtyShutdownException class. - - - - - Initializes a new instance of the EsentDirtyShutdownException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ReadPgnoVerifyFailure exceptions. - - - - - Initializes a new instance of the EsentReadPgnoVerifyFailureException class. - - - - - Initializes a new instance of the EsentReadPgnoVerifyFailureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ReadLostFlushVerifyFailure exceptions. - - - - - Initializes a new instance of the EsentReadLostFlushVerifyFailureException class. - - - - - Initializes a new instance of the EsentReadLostFlushVerifyFailureException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MustCommitDistributedTransactionToLevel0 exceptions. - - - - - Initializes a new instance of the EsentMustCommitDistributedTransactionToLevel0Exception class. - - - - - Initializes a new instance of the EsentMustCommitDistributedTransactionToLevel0Exception class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DistributedTransactionAlreadyPreparedToCommit exceptions. - - - - - Initializes a new instance of the EsentDistributedTransactionAlreadyPreparedToCommitException class. - - - - - Initializes a new instance of the EsentDistributedTransactionAlreadyPreparedToCommitException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.NotInDistributedTransaction exceptions. - - - - - Initializes a new instance of the EsentNotInDistributedTransactionException class. - - - - - Initializes a new instance of the EsentNotInDistributedTransactionException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DistributedTransactionNotYetPreparedToCommit exceptions. - - - - - Initializes a new instance of the EsentDistributedTransactionNotYetPreparedToCommitException class. - - - - - Initializes a new instance of the EsentDistributedTransactionNotYetPreparedToCommitException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CannotNestDistributedTransactions exceptions. - - - - - Initializes a new instance of the EsentCannotNestDistributedTransactionsException class. - - - - - Initializes a new instance of the EsentCannotNestDistributedTransactionsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DTCMissingCallback exceptions. - - - - - Initializes a new instance of the EsentDTCMissingCallbackException class. - - - - - Initializes a new instance of the EsentDTCMissingCallbackException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DTCMissingCallbackOnRecovery exceptions. - - - - - Initializes a new instance of the EsentDTCMissingCallbackOnRecoveryException class. - - - - - Initializes a new instance of the EsentDTCMissingCallbackOnRecoveryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DTCCallbackUnexpectedError exceptions. - - - - - Initializes a new instance of the EsentDTCCallbackUnexpectedErrorException class. - - - - - Initializes a new instance of the EsentDTCCallbackUnexpectedErrorException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseDuplicate exceptions. - - - - - Initializes a new instance of the EsentDatabaseDuplicateException class. - - - - - Initializes a new instance of the EsentDatabaseDuplicateException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseInUse exceptions. - - - - - Initializes a new instance of the EsentDatabaseInUseException class. - - - - - Initializes a new instance of the EsentDatabaseInUseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseNotFound exceptions. - - - - - Initializes a new instance of the EsentDatabaseNotFoundException class. - - - - - Initializes a new instance of the EsentDatabaseNotFoundException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseInvalidName exceptions. - - - - - Initializes a new instance of the EsentDatabaseInvalidNameException class. - - - - - Initializes a new instance of the EsentDatabaseInvalidNameException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseInvalidPages exceptions. - - - - - Initializes a new instance of the EsentDatabaseInvalidPagesException class. - - - - - Initializes a new instance of the EsentDatabaseInvalidPagesException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseCorrupted exceptions. - - - - - Initializes a new instance of the EsentDatabaseCorruptedException class. - - - - - Initializes a new instance of the EsentDatabaseCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseLocked exceptions. - - - - - Initializes a new instance of the EsentDatabaseLockedException class. - - - - - Initializes a new instance of the EsentDatabaseLockedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CannotDisableVersioning exceptions. - - - - - Initializes a new instance of the EsentCannotDisableVersioningException class. - - - - - Initializes a new instance of the EsentCannotDisableVersioningException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidDatabaseVersion exceptions. - - - - - Initializes a new instance of the EsentInvalidDatabaseVersionException class. - - - - - Initializes a new instance of the EsentInvalidDatabaseVersionException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.Database200Format exceptions. - - - - - Initializes a new instance of the EsentDatabase200FormatException class. - - - - - Initializes a new instance of the EsentDatabase200FormatException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.Database400Format exceptions. - - - - - Initializes a new instance of the EsentDatabase400FormatException class. - - - - - Initializes a new instance of the EsentDatabase400FormatException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.Database500Format exceptions. - - - - - Initializes a new instance of the EsentDatabase500FormatException class. - - - - - Initializes a new instance of the EsentDatabase500FormatException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.PageSizeMismatch exceptions. - - - - - Initializes a new instance of the EsentPageSizeMismatchException class. - - - - - Initializes a new instance of the EsentPageSizeMismatchException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManyInstances exceptions. - - - - - Initializes a new instance of the EsentTooManyInstancesException class. - - - - - Initializes a new instance of the EsentTooManyInstancesException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseSharingViolation exceptions. - - - - - Initializes a new instance of the EsentDatabaseSharingViolationException class. - - - - - Initializes a new instance of the EsentDatabaseSharingViolationException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.AttachedDatabaseMismatch exceptions. - - - - - Initializes a new instance of the EsentAttachedDatabaseMismatchException class. - - - - - Initializes a new instance of the EsentAttachedDatabaseMismatchException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseInvalidPath exceptions. - - - - - Initializes a new instance of the EsentDatabaseInvalidPathException class. - - - - - Initializes a new instance of the EsentDatabaseInvalidPathException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseIdInUse exceptions. - - - - - Initializes a new instance of the EsentDatabaseIdInUseException class. - - - - - Initializes a new instance of the EsentDatabaseIdInUseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ForceDetachNotAllowed exceptions. - - - - - Initializes a new instance of the EsentForceDetachNotAllowedException class. - - - - - Initializes a new instance of the EsentForceDetachNotAllowedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CatalogCorrupted exceptions. - - - - - Initializes a new instance of the EsentCatalogCorruptedException class. - - - - - Initializes a new instance of the EsentCatalogCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.PartiallyAttachedDB exceptions. - - - - - Initializes a new instance of the EsentPartiallyAttachedDBException class. - - - - - Initializes a new instance of the EsentPartiallyAttachedDBException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseSignInUse exceptions. - - - - - Initializes a new instance of the EsentDatabaseSignInUseException class. - - - - - Initializes a new instance of the EsentDatabaseSignInUseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseCorruptedNoRepair exceptions. - - - - - Initializes a new instance of the EsentDatabaseCorruptedNoRepairException class. - - - - - Initializes a new instance of the EsentDatabaseCorruptedNoRepairException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidCreateDbVersion exceptions. - - - - - Initializes a new instance of the EsentInvalidCreateDbVersionException class. - - - - - Initializes a new instance of the EsentInvalidCreateDbVersionException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseIncompleteIncrementalReseed exceptions. - - - - - Initializes a new instance of the EsentDatabaseIncompleteIncrementalReseedException class. - - - - - Initializes a new instance of the EsentDatabaseIncompleteIncrementalReseedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseInvalidIncrementalReseed exceptions. - - - - - Initializes a new instance of the EsentDatabaseInvalidIncrementalReseedException class. - - - - - Initializes a new instance of the EsentDatabaseInvalidIncrementalReseedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseFailedIncrementalReseed exceptions. - - - - - Initializes a new instance of the EsentDatabaseFailedIncrementalReseedException class. - - - - - Initializes a new instance of the EsentDatabaseFailedIncrementalReseedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.NoAttachmentsFailedIncrementalReseed exceptions. - - - - - Initializes a new instance of the EsentNoAttachmentsFailedIncrementalReseedException class. - - - - - Initializes a new instance of the EsentNoAttachmentsFailedIncrementalReseedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TableLocked exceptions. - - - - - Initializes a new instance of the EsentTableLockedException class. - - - - - Initializes a new instance of the EsentTableLockedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TableDuplicate exceptions. - - - - - Initializes a new instance of the EsentTableDuplicateException class. - - - - - Initializes a new instance of the EsentTableDuplicateException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TableInUse exceptions. - - - - - Initializes a new instance of the EsentTableInUseException class. - - - - - Initializes a new instance of the EsentTableInUseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ObjectNotFound exceptions. - - - - - Initializes a new instance of the EsentObjectNotFoundException class. - - - - - Initializes a new instance of the EsentObjectNotFoundException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DensityInvalid exceptions. - - - - - Initializes a new instance of the EsentDensityInvalidException class. - - - - - Initializes a new instance of the EsentDensityInvalidException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TableNotEmpty exceptions. - - - - - Initializes a new instance of the EsentTableNotEmptyException class. - - - - - Initializes a new instance of the EsentTableNotEmptyException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidTableId exceptions. - - - - - Initializes a new instance of the EsentInvalidTableIdException class. - - - - - Initializes a new instance of the EsentInvalidTableIdException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManyOpenTables exceptions. - - - - - Initializes a new instance of the EsentTooManyOpenTablesException class. - - - - - Initializes a new instance of the EsentTooManyOpenTablesException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IllegalOperation exceptions. - - - - - Initializes a new instance of the EsentIllegalOperationException class. - - - - - Initializes a new instance of the EsentIllegalOperationException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManyOpenTablesAndCleanupTimedOut exceptions. - - - - - Initializes a new instance of the EsentTooManyOpenTablesAndCleanupTimedOutException class. - - - - - Initializes a new instance of the EsentTooManyOpenTablesAndCleanupTimedOutException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ObjectDuplicate exceptions. - - - - - Initializes a new instance of the EsentObjectDuplicateException class. - - - - - Initializes a new instance of the EsentObjectDuplicateException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidObject exceptions. - - - - - Initializes a new instance of the EsentInvalidObjectException class. - - - - - Initializes a new instance of the EsentInvalidObjectException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CannotDeleteTempTable exceptions. - - - - - Initializes a new instance of the EsentCannotDeleteTempTableException class. - - - - - Initializes a new instance of the EsentCannotDeleteTempTableException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CannotDeleteSystemTable exceptions. - - - - - Initializes a new instance of the EsentCannotDeleteSystemTableException class. - - - - - Initializes a new instance of the EsentCannotDeleteSystemTableException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CannotDeleteTemplateTable exceptions. - - - - - Initializes a new instance of the EsentCannotDeleteTemplateTableException class. - - - - - Initializes a new instance of the EsentCannotDeleteTemplateTableException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ExclusiveTableLockRequired exceptions. - - - - - Initializes a new instance of the EsentExclusiveTableLockRequiredException class. - - - - - Initializes a new instance of the EsentExclusiveTableLockRequiredException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.FixedDDL exceptions. - - - - - Initializes a new instance of the EsentFixedDDLException class. - - - - - Initializes a new instance of the EsentFixedDDLException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.FixedInheritedDDL exceptions. - - - - - Initializes a new instance of the EsentFixedInheritedDDLException class. - - - - - Initializes a new instance of the EsentFixedInheritedDDLException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CannotNestDDL exceptions. - - - - - Initializes a new instance of the EsentCannotNestDDLException class. - - - - - Initializes a new instance of the EsentCannotNestDDLException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DDLNotInheritable exceptions. - - - - - Initializes a new instance of the EsentDDLNotInheritableException class. - - - - - Initializes a new instance of the EsentDDLNotInheritableException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidSettings exceptions. - - - - - Initializes a new instance of the EsentInvalidSettingsException class. - - - - - Initializes a new instance of the EsentInvalidSettingsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ClientRequestToStopJetService exceptions. - - - - - Initializes a new instance of the EsentClientRequestToStopJetServiceException class. - - - - - Initializes a new instance of the EsentClientRequestToStopJetServiceException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CannotAddFixedVarColumnToDerivedTable exceptions. - - - - - Initializes a new instance of the EsentCannotAddFixedVarColumnToDerivedTableException class. - - - - - Initializes a new instance of the EsentCannotAddFixedVarColumnToDerivedTableException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexCantBuild exceptions. - - - - - Initializes a new instance of the EsentIndexCantBuildException class. - - - - - Initializes a new instance of the EsentIndexCantBuildException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexHasPrimary exceptions. - - - - - Initializes a new instance of the EsentIndexHasPrimaryException class. - - - - - Initializes a new instance of the EsentIndexHasPrimaryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexDuplicate exceptions. - - - - - Initializes a new instance of the EsentIndexDuplicateException class. - - - - - Initializes a new instance of the EsentIndexDuplicateException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexNotFound exceptions. - - - - - Initializes a new instance of the EsentIndexNotFoundException class. - - - - - Initializes a new instance of the EsentIndexNotFoundException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexMustStay exceptions. - - - - - Initializes a new instance of the EsentIndexMustStayException class. - - - - - Initializes a new instance of the EsentIndexMustStayException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexInvalidDef exceptions. - - - - - Initializes a new instance of the EsentIndexInvalidDefException class. - - - - - Initializes a new instance of the EsentIndexInvalidDefException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidCreateIndex exceptions. - - - - - Initializes a new instance of the EsentInvalidCreateIndexException class. - - - - - Initializes a new instance of the EsentInvalidCreateIndexException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManyOpenIndexes exceptions. - - - - - Initializes a new instance of the EsentTooManyOpenIndexesException class. - - - - - Initializes a new instance of the EsentTooManyOpenIndexesException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MultiValuedIndexViolation exceptions. - - - - - Initializes a new instance of the EsentMultiValuedIndexViolationException class. - - - - - Initializes a new instance of the EsentMultiValuedIndexViolationException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexBuildCorrupted exceptions. - - - - - Initializes a new instance of the EsentIndexBuildCorruptedException class. - - - - - Initializes a new instance of the EsentIndexBuildCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.PrimaryIndexCorrupted exceptions. - - - - - Initializes a new instance of the EsentPrimaryIndexCorruptedException class. - - - - - Initializes a new instance of the EsentPrimaryIndexCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SecondaryIndexCorrupted exceptions. - - - - - Initializes a new instance of the EsentSecondaryIndexCorruptedException class. - - - - - Initializes a new instance of the EsentSecondaryIndexCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidIndexId exceptions. - - - - - Initializes a new instance of the EsentInvalidIndexIdException class. - - - - - Initializes a new instance of the EsentInvalidIndexIdException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexTuplesSecondaryIndexOnly exceptions. - - - - - Initializes a new instance of the EsentIndexTuplesSecondaryIndexOnlyException class. - - - - - Initializes a new instance of the EsentIndexTuplesSecondaryIndexOnlyException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexTuplesTooManyColumns exceptions. - - - - - Initializes a new instance of the EsentIndexTuplesTooManyColumnsException class. - - - - - Initializes a new instance of the EsentIndexTuplesTooManyColumnsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexTuplesNonUniqueOnly exceptions. - - - - - Initializes a new instance of the EsentIndexTuplesNonUniqueOnlyException class. - - - - - Initializes a new instance of the EsentIndexTuplesNonUniqueOnlyException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexTuplesTextBinaryColumnsOnly exceptions. - - - - - Initializes a new instance of the EsentIndexTuplesTextBinaryColumnsOnlyException class. - - - - - Initializes a new instance of the EsentIndexTuplesTextBinaryColumnsOnlyException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexTuplesVarSegMacNotAllowed exceptions. - - - - - Initializes a new instance of the EsentIndexTuplesVarSegMacNotAllowedException class. - - - - - Initializes a new instance of the EsentIndexTuplesVarSegMacNotAllowedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexTuplesInvalidLimits exceptions. - - - - - Initializes a new instance of the EsentIndexTuplesInvalidLimitsException class. - - - - - Initializes a new instance of the EsentIndexTuplesInvalidLimitsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexTuplesCannotRetrieveFromIndex exceptions. - - - - - Initializes a new instance of the EsentIndexTuplesCannotRetrieveFromIndexException class. - - - - - Initializes a new instance of the EsentIndexTuplesCannotRetrieveFromIndexException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.IndexTuplesKeyTooSmall exceptions. - - - - - Initializes a new instance of the EsentIndexTuplesKeyTooSmallException class. - - - - - Initializes a new instance of the EsentIndexTuplesKeyTooSmallException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ColumnLong exceptions. - - - - - Initializes a new instance of the EsentColumnLongException class. - - - - - Initializes a new instance of the EsentColumnLongException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ColumnNoChunk exceptions. - - - - - Initializes a new instance of the EsentColumnNoChunkException class. - - - - - Initializes a new instance of the EsentColumnNoChunkException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ColumnDoesNotFit exceptions. - - - - - Initializes a new instance of the EsentColumnDoesNotFitException class. - - - - - Initializes a new instance of the EsentColumnDoesNotFitException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.NullInvalid exceptions. - - - - - Initializes a new instance of the EsentNullInvalidException class. - - - - - Initializes a new instance of the EsentNullInvalidException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ColumnIndexed exceptions. - - - - - Initializes a new instance of the EsentColumnIndexedException class. - - - - - Initializes a new instance of the EsentColumnIndexedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ColumnTooBig exceptions. - - - - - Initializes a new instance of the EsentColumnTooBigException class. - - - - - Initializes a new instance of the EsentColumnTooBigException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ColumnNotFound exceptions. - - - - - Initializes a new instance of the EsentColumnNotFoundException class. - - - - - Initializes a new instance of the EsentColumnNotFoundException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ColumnDuplicate exceptions. - - - - - Initializes a new instance of the EsentColumnDuplicateException class. - - - - - Initializes a new instance of the EsentColumnDuplicateException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MultiValuedColumnMustBeTagged exceptions. - - - - - Initializes a new instance of the EsentMultiValuedColumnMustBeTaggedException class. - - - - - Initializes a new instance of the EsentMultiValuedColumnMustBeTaggedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ColumnRedundant exceptions. - - - - - Initializes a new instance of the EsentColumnRedundantException class. - - - - - Initializes a new instance of the EsentColumnRedundantException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidColumnType exceptions. - - - - - Initializes a new instance of the EsentInvalidColumnTypeException class. - - - - - Initializes a new instance of the EsentInvalidColumnTypeException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TaggedNotNULL exceptions. - - - - - Initializes a new instance of the EsentTaggedNotNULLException class. - - - - - Initializes a new instance of the EsentTaggedNotNULLException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.NoCurrentIndex exceptions. - - - - - Initializes a new instance of the EsentNoCurrentIndexException class. - - - - - Initializes a new instance of the EsentNoCurrentIndexException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.KeyIsMade exceptions. - - - - - Initializes a new instance of the EsentKeyIsMadeException class. - - - - - Initializes a new instance of the EsentKeyIsMadeException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BadColumnId exceptions. - - - - - Initializes a new instance of the EsentBadColumnIdException class. - - - - - Initializes a new instance of the EsentBadColumnIdException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.BadItagSequence exceptions. - - - - - Initializes a new instance of the EsentBadItagSequenceException class. - - - - - Initializes a new instance of the EsentBadItagSequenceException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ColumnInRelationship exceptions. - - - - - Initializes a new instance of the EsentColumnInRelationshipException class. - - - - - Initializes a new instance of the EsentColumnInRelationshipException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CannotBeTagged exceptions. - - - - - Initializes a new instance of the EsentCannotBeTaggedException class. - - - - - Initializes a new instance of the EsentCannotBeTaggedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DefaultValueTooBig exceptions. - - - - - Initializes a new instance of the EsentDefaultValueTooBigException class. - - - - - Initializes a new instance of the EsentDefaultValueTooBigException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MultiValuedDuplicate exceptions. - - - - - Initializes a new instance of the EsentMultiValuedDuplicateException class. - - - - - Initializes a new instance of the EsentMultiValuedDuplicateException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LVCorrupted exceptions. - - - - - Initializes a new instance of the EsentLVCorruptedException class. - - - - - Initializes a new instance of the EsentLVCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.MultiValuedDuplicateAfterTruncation exceptions. - - - - - Initializes a new instance of the EsentMultiValuedDuplicateAfterTruncationException class. - - - - - Initializes a new instance of the EsentMultiValuedDuplicateAfterTruncationException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DerivedColumnCorruption exceptions. - - - - - Initializes a new instance of the EsentDerivedColumnCorruptionException class. - - - - - Initializes a new instance of the EsentDerivedColumnCorruptionException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidPlaceholderColumn exceptions. - - - - - Initializes a new instance of the EsentInvalidPlaceholderColumnException class. - - - - - Initializes a new instance of the EsentInvalidPlaceholderColumnException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.ColumnCannotBeCompressed exceptions. - - - - - Initializes a new instance of the EsentColumnCannotBeCompressedException class. - - - - - Initializes a new instance of the EsentColumnCannotBeCompressedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RecordNotFound exceptions. - - - - - Initializes a new instance of the EsentRecordNotFoundException class. - - - - - Initializes a new instance of the EsentRecordNotFoundException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RecordNoCopy exceptions. - - - - - Initializes a new instance of the EsentRecordNoCopyException class. - - - - - Initializes a new instance of the EsentRecordNoCopyException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.NoCurrentRecord exceptions. - - - - - Initializes a new instance of the EsentNoCurrentRecordException class. - - - - - Initializes a new instance of the EsentNoCurrentRecordException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RecordPrimaryChanged exceptions. - - - - - Initializes a new instance of the EsentRecordPrimaryChangedException class. - - - - - Initializes a new instance of the EsentRecordPrimaryChangedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.KeyDuplicate exceptions. - - - - - Initializes a new instance of the EsentKeyDuplicateException class. - - - - - Initializes a new instance of the EsentKeyDuplicateException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.AlreadyPrepared exceptions. - - - - - Initializes a new instance of the EsentAlreadyPreparedException class. - - - - - Initializes a new instance of the EsentAlreadyPreparedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.KeyNotMade exceptions. - - - - - Initializes a new instance of the EsentKeyNotMadeException class. - - - - - Initializes a new instance of the EsentKeyNotMadeException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.UpdateNotPrepared exceptions. - - - - - Initializes a new instance of the EsentUpdateNotPreparedException class. - - - - - Initializes a new instance of the EsentUpdateNotPreparedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DataHasChanged exceptions. - - - - - Initializes a new instance of the EsentDataHasChangedException class. - - - - - Initializes a new instance of the EsentDataHasChangedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LanguageNotSupported exceptions. - - - - - Initializes a new instance of the EsentLanguageNotSupportedException class. - - - - - Initializes a new instance of the EsentLanguageNotSupportedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DecompressionFailed exceptions. - - - - - Initializes a new instance of the EsentDecompressionFailedException class. - - - - - Initializes a new instance of the EsentDecompressionFailedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.UpdateMustVersion exceptions. - - - - - Initializes a new instance of the EsentUpdateMustVersionException class. - - - - - Initializes a new instance of the EsentUpdateMustVersionException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManySorts exceptions. - - - - - Initializes a new instance of the EsentTooManySortsException class. - - - - - Initializes a new instance of the EsentTooManySortsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidOnSort exceptions. - - - - - Initializes a new instance of the EsentInvalidOnSortException class. - - - - - Initializes a new instance of the EsentInvalidOnSortException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TempFileOpenError exceptions. - - - - - Initializes a new instance of the EsentTempFileOpenErrorException class. - - - - - Initializes a new instance of the EsentTempFileOpenErrorException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManyAttachedDatabases exceptions. - - - - - Initializes a new instance of the EsentTooManyAttachedDatabasesException class. - - - - - Initializes a new instance of the EsentTooManyAttachedDatabasesException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DiskFull exceptions. - - - - - Initializes a new instance of the EsentDiskFullException class. - - - - - Initializes a new instance of the EsentDiskFullException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.PermissionDenied exceptions. - - - - - Initializes a new instance of the EsentPermissionDeniedException class. - - - - - Initializes a new instance of the EsentPermissionDeniedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.FileNotFound exceptions. - - - - - Initializes a new instance of the EsentFileNotFoundException class. - - - - - Initializes a new instance of the EsentFileNotFoundException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.FileInvalidType exceptions. - - - - - Initializes a new instance of the EsentFileInvalidTypeException class. - - - - - Initializes a new instance of the EsentFileInvalidTypeException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.AfterInitialization exceptions. - - - - - Initializes a new instance of the EsentAfterInitializationException class. - - - - - Initializes a new instance of the EsentAfterInitializationException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LogCorrupted exceptions. - - - - - Initializes a new instance of the EsentLogCorruptedException class. - - - - - Initializes a new instance of the EsentLogCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidOperation exceptions. - - - - - Initializes a new instance of the EsentInvalidOperationException class. - - - - - Initializes a new instance of the EsentInvalidOperationException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.AccessDenied exceptions. - - - - - Initializes a new instance of the EsentAccessDeniedException class. - - - - - Initializes a new instance of the EsentAccessDeniedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManySplits exceptions. - - - - - Initializes a new instance of the EsentTooManySplitsException class. - - - - - Initializes a new instance of the EsentTooManySplitsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SessionSharingViolation exceptions. - - - - - Initializes a new instance of the EsentSessionSharingViolationException class. - - - - - Initializes a new instance of the EsentSessionSharingViolationException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.EntryPointNotFound exceptions. - - - - - Initializes a new instance of the EsentEntryPointNotFoundException class. - - - - - Initializes a new instance of the EsentEntryPointNotFoundException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SessionContextAlreadySet exceptions. - - - - - Initializes a new instance of the EsentSessionContextAlreadySetException class. - - - - - Initializes a new instance of the EsentSessionContextAlreadySetException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SessionContextNotSetByThisThread exceptions. - - - - - Initializes a new instance of the EsentSessionContextNotSetByThisThreadException class. - - - - - Initializes a new instance of the EsentSessionContextNotSetByThisThreadException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SessionInUse exceptions. - - - - - Initializes a new instance of the EsentSessionInUseException class. - - - - - Initializes a new instance of the EsentSessionInUseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RecordFormatConversionFailed exceptions. - - - - - Initializes a new instance of the EsentRecordFormatConversionFailedException class. - - - - - Initializes a new instance of the EsentRecordFormatConversionFailedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OneDatabasePerSession exceptions. - - - - - Initializes a new instance of the EsentOneDatabasePerSessionException class. - - - - - Initializes a new instance of the EsentOneDatabasePerSessionException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.RollbackError exceptions. - - - - - Initializes a new instance of the EsentRollbackErrorException class. - - - - - Initializes a new instance of the EsentRollbackErrorException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.DatabaseAlreadyRunningMaintenance exceptions. - - - - - Initializes a new instance of the EsentDatabaseAlreadyRunningMaintenanceException class. - - - - - Initializes a new instance of the EsentDatabaseAlreadyRunningMaintenanceException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CallbackFailed exceptions. - - - - - Initializes a new instance of the EsentCallbackFailedException class. - - - - - Initializes a new instance of the EsentCallbackFailedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.CallbackNotResolved exceptions. - - - - - Initializes a new instance of the EsentCallbackNotResolvedException class. - - - - - Initializes a new instance of the EsentCallbackNotResolvedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SpaceHintsInvalid exceptions. - - - - - Initializes a new instance of the EsentSpaceHintsInvalidException class. - - - - - Initializes a new instance of the EsentSpaceHintsInvalidException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVSpaceCorrupted exceptions. - - - - - Initializes a new instance of the EsentSLVSpaceCorruptedException class. - - - - - Initializes a new instance of the EsentSLVSpaceCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVCorrupted exceptions. - - - - - Initializes a new instance of the EsentSLVCorruptedException class. - - - - - Initializes a new instance of the EsentSLVCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVColumnDefaultValueNotAllowed exceptions. - - - - - Initializes a new instance of the EsentSLVColumnDefaultValueNotAllowedException class. - - - - - Initializes a new instance of the EsentSLVColumnDefaultValueNotAllowedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVStreamingFileMissing exceptions. - - - - - Initializes a new instance of the EsentSLVStreamingFileMissingException class. - - - - - Initializes a new instance of the EsentSLVStreamingFileMissingException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVDatabaseMissing exceptions. - - - - - Initializes a new instance of the EsentSLVDatabaseMissingException class. - - - - - Initializes a new instance of the EsentSLVDatabaseMissingException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVStreamingFileAlreadyExists exceptions. - - - - - Initializes a new instance of the EsentSLVStreamingFileAlreadyExistsException class. - - - - - Initializes a new instance of the EsentSLVStreamingFileAlreadyExistsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVInvalidPath exceptions. - - - - - Initializes a new instance of the EsentSLVInvalidPathException class. - - - - - Initializes a new instance of the EsentSLVInvalidPathException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVStreamingFileNotCreated exceptions. - - - - - Initializes a new instance of the EsentSLVStreamingFileNotCreatedException class. - - - - - Initializes a new instance of the EsentSLVStreamingFileNotCreatedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVStreamingFileReadOnly exceptions. - - - - - Initializes a new instance of the EsentSLVStreamingFileReadOnlyException class. - - - - - Initializes a new instance of the EsentSLVStreamingFileReadOnlyException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVHeaderBadChecksum exceptions. - - - - - Initializes a new instance of the EsentSLVHeaderBadChecksumException class. - - - - - Initializes a new instance of the EsentSLVHeaderBadChecksumException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVHeaderCorrupted exceptions. - - - - - Initializes a new instance of the EsentSLVHeaderCorruptedException class. - - - - - Initializes a new instance of the EsentSLVHeaderCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVPagesNotFree exceptions. - - - - - Initializes a new instance of the EsentSLVPagesNotFreeException class. - - - - - Initializes a new instance of the EsentSLVPagesNotFreeException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVPagesNotReserved exceptions. - - - - - Initializes a new instance of the EsentSLVPagesNotReservedException class. - - - - - Initializes a new instance of the EsentSLVPagesNotReservedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVPagesNotCommitted exceptions. - - - - - Initializes a new instance of the EsentSLVPagesNotCommittedException class. - - - - - Initializes a new instance of the EsentSLVPagesNotCommittedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVPagesNotDeleted exceptions. - - - - - Initializes a new instance of the EsentSLVPagesNotDeletedException class. - - - - - Initializes a new instance of the EsentSLVPagesNotDeletedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVSpaceWriteConflict exceptions. - - - - - Initializes a new instance of the EsentSLVSpaceWriteConflictException class. - - - - - Initializes a new instance of the EsentSLVSpaceWriteConflictException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVRootStillOpen exceptions. - - - - - Initializes a new instance of the EsentSLVRootStillOpenException class. - - - - - Initializes a new instance of the EsentSLVRootStillOpenException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVProviderNotLoaded exceptions. - - - - - Initializes a new instance of the EsentSLVProviderNotLoadedException class. - - - - - Initializes a new instance of the EsentSLVProviderNotLoadedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVEAListCorrupt exceptions. - - - - - Initializes a new instance of the EsentSLVEAListCorruptException class. - - - - - Initializes a new instance of the EsentSLVEAListCorruptException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVRootNotSpecified exceptions. - - - - - Initializes a new instance of the EsentSLVRootNotSpecifiedException class. - - - - - Initializes a new instance of the EsentSLVRootNotSpecifiedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVRootPathInvalid exceptions. - - - - - Initializes a new instance of the EsentSLVRootPathInvalidException class. - - - - - Initializes a new instance of the EsentSLVRootPathInvalidException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVEAListZeroAllocation exceptions. - - - - - Initializes a new instance of the EsentSLVEAListZeroAllocationException class. - - - - - Initializes a new instance of the EsentSLVEAListZeroAllocationException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVColumnCannotDelete exceptions. - - - - - Initializes a new instance of the EsentSLVColumnCannotDeleteException class. - - - - - Initializes a new instance of the EsentSLVColumnCannotDeleteException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVOwnerMapAlreadyExists exceptions. - - - - - Initializes a new instance of the EsentSLVOwnerMapAlreadyExistsException class. - - - - - Initializes a new instance of the EsentSLVOwnerMapAlreadyExistsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVOwnerMapCorrupted exceptions. - - - - - Initializes a new instance of the EsentSLVOwnerMapCorruptedException class. - - - - - Initializes a new instance of the EsentSLVOwnerMapCorruptedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVOwnerMapPageNotFound exceptions. - - - - - Initializes a new instance of the EsentSLVOwnerMapPageNotFoundException class. - - - - - Initializes a new instance of the EsentSLVOwnerMapPageNotFoundException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVFileStale exceptions. - - - - - Initializes a new instance of the EsentSLVFileStaleException class. - - - - - Initializes a new instance of the EsentSLVFileStaleException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVFileInUse exceptions. - - - - - Initializes a new instance of the EsentSLVFileInUseException class. - - - - - Initializes a new instance of the EsentSLVFileInUseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVStreamingFileInUse exceptions. - - - - - Initializes a new instance of the EsentSLVStreamingFileInUseException class. - - - - - Initializes a new instance of the EsentSLVStreamingFileInUseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVFileIO exceptions. - - - - - Initializes a new instance of the EsentSLVFileIOException class. - - - - - Initializes a new instance of the EsentSLVFileIOException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVStreamingFileFull exceptions. - - - - - Initializes a new instance of the EsentSLVStreamingFileFullException class. - - - - - Initializes a new instance of the EsentSLVStreamingFileFullException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVFileInvalidPath exceptions. - - - - - Initializes a new instance of the EsentSLVFileInvalidPathException class. - - - - - Initializes a new instance of the EsentSLVFileInvalidPathException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVFileAccessDenied exceptions. - - - - - Initializes a new instance of the EsentSLVFileAccessDeniedException class. - - - - - Initializes a new instance of the EsentSLVFileAccessDeniedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVFileNotFound exceptions. - - - - - Initializes a new instance of the EsentSLVFileNotFoundException class. - - - - - Initializes a new instance of the EsentSLVFileNotFoundException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVFileUnknown exceptions. - - - - - Initializes a new instance of the EsentSLVFileUnknownException class. - - - - - Initializes a new instance of the EsentSLVFileUnknownException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVEAListTooBig exceptions. - - - - - Initializes a new instance of the EsentSLVEAListTooBigException class. - - - - - Initializes a new instance of the EsentSLVEAListTooBigException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVProviderVersionMismatch exceptions. - - - - - Initializes a new instance of the EsentSLVProviderVersionMismatchException class. - - - - - Initializes a new instance of the EsentSLVProviderVersionMismatchException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.SLVBufferTooSmall exceptions. - - - - - Initializes a new instance of the EsentSLVBufferTooSmallException class. - - - - - Initializes a new instance of the EsentSLVBufferTooSmallException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OSSnapshotInvalidSequence exceptions. - - - - - Initializes a new instance of the EsentOSSnapshotInvalidSequenceException class. - - - - - Initializes a new instance of the EsentOSSnapshotInvalidSequenceException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OSSnapshotTimeOut exceptions. - - - - - Initializes a new instance of the EsentOSSnapshotTimeOutException class. - - - - - Initializes a new instance of the EsentOSSnapshotTimeOutException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OSSnapshotNotAllowed exceptions. - - - - - Initializes a new instance of the EsentOSSnapshotNotAllowedException class. - - - - - Initializes a new instance of the EsentOSSnapshotNotAllowedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.OSSnapshotInvalidSnapId exceptions. - - - - - Initializes a new instance of the EsentOSSnapshotInvalidSnapIdException class. - - - - - Initializes a new instance of the EsentOSSnapshotInvalidSnapIdException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TooManyTestInjections exceptions. - - - - - Initializes a new instance of the EsentTooManyTestInjectionsException class. - - - - - Initializes a new instance of the EsentTooManyTestInjectionsException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.TestInjectionNotSupported exceptions. - - - - - Initializes a new instance of the EsentTestInjectionNotSupportedException class. - - - - - Initializes a new instance of the EsentTestInjectionNotSupportedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.InvalidLogDataSequence exceptions. - - - - - Initializes a new instance of the EsentInvalidLogDataSequenceException class. - - - - - Initializes a new instance of the EsentInvalidLogDataSequenceException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LSCallbackNotSpecified exceptions. - - - - - Initializes a new instance of the EsentLSCallbackNotSpecifiedException class. - - - - - Initializes a new instance of the EsentLSCallbackNotSpecifiedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LSAlreadySet exceptions. - - - - - Initializes a new instance of the EsentLSAlreadySetException class. - - - - - Initializes a new instance of the EsentLSAlreadySetException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.LSNotSet exceptions. - - - - - Initializes a new instance of the EsentLSNotSetException class. - - - - - Initializes a new instance of the EsentLSNotSetException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.FileIOSparse exceptions. - - - - - Initializes a new instance of the EsentFileIOSparseException class. - - - - - Initializes a new instance of the EsentFileIOSparseException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.FileIOBeyondEOF exceptions. - - - - - Initializes a new instance of the EsentFileIOBeyondEOFException class. - - - - - Initializes a new instance of the EsentFileIOBeyondEOFException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.FileIOAbort exceptions. - - - - - Initializes a new instance of the EsentFileIOAbortException class. - - - - - Initializes a new instance of the EsentFileIOAbortException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.FileIORetry exceptions. - - - - - Initializes a new instance of the EsentFileIORetryException class. - - - - - Initializes a new instance of the EsentFileIORetryException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.FileIOFail exceptions. - - - - - Initializes a new instance of the EsentFileIOFailException class. - - - - - Initializes a new instance of the EsentFileIOFailException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Base class for JET_err.FileCompressed exceptions. - - - - - Initializes a new instance of the EsentFileCompressedException class. - - - - - Initializes a new instance of the EsentFileCompressedException class. This constructor - is used to deserialize a serialized exception. - - The data needed to deserialize the object. - The deserialization context. - - - - Method to generate an EsentErrorException from an error code. - - - - - Create an EsentErrorException from an error code. - - The error code. - An EsentErrorException for the error code. - - - - A Unicode string column value. - - - - - Gets a string representation of this object. - - A string representation of this object. - - - - Recursive SetColumns method for data pinning. This populates the buffer and - calls the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Gets the last set or retrieved value of the column. The - value is returned as a generic object. - - - - - Gets or sets the value of the column. Use to update a - record with the column value. - - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - Provides a set of methods and properties that you can use to measure - ESENT work statistics for a thread. If the current version of ESENT - doesn't support then all - ESENT statistics will be 0. - - - - - Used to measure how long statistics are collected for. - - - - - The stats at the start of our collection. - - - - - Initializes a new EsentStopwatch instance and starts - measuring elapsed time. - - A new, running EsentStopwatch. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Starts measuring ESENT work. - - - - - Stops measuring ESENT work. - - - - - Stops time interval measurement and resets the thread statistics. - - - - - Gets a value indicating whether the EsentStopwatch timer is running. - - - - - Gets the total ESENT work stats measured by the current instance. - - - - - Gets the total elapsed time measured by the current instance. - - - - - Contains cumulative statistics on the work performed by the database - engine on the current thread. This information is returned via - JetGetThreadStats. - - - - - The size of a JET_THREADSTATS structure. - - - - - Size of the structure. This is used for interop. - - - - - Number of pages visited. - - - - - Number of pages read from disk. - - - - - Number of pages preread. - - - - - Number of pages dirtied. - - - - - Pages redirtied. - - - - - Number of log records generated. - - - - - Number of bytes logged. - - - - - Create a new struct with the specified - valued. - - - Number of pages visited. - - - Number of pages read. - - - Number of pages preread. - - - TNumber of pages dirtied. - - - Number of pages redirtied. - - - Number of log records generated. - - - Bytes of log records written. - - - A new struct with the specified values. - - - - - Add the stats in two JET_THREADSTATS structures. - - The first JET_THREADSTATS. - The second JET_THREADSTATS. - A JET_THREADSTATS containing the result of adding the stats in t1 and t2. - - - - Add the stats in two JET_THREADSTATS structures. - - The first JET_THREADSTATS. - The second JET_THREADSTATS. - A JET_THREADSTATS containing the result of adding the stats in t1 and t2. - - - - Calculate the difference in stats between two JET_THREADSTATS structures. - - The first JET_THREADSTATS. - The second JET_THREADSTATS. - A JET_THREADSTATS containing the difference in stats between t1 and t2. - - - - Calculate the difference in stats between two JET_THREADSTATS structures. - - The first JET_THREADSTATS. - The second JET_THREADSTATS. - A JET_THREADSTATS containing the difference in stats between t1 and t2. - - - - Determines whether two specified instances of JET_THREADSTATS - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_THREADSTATS - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Gets a string representation of this object. - - A string representation of this object. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Get the plural suffix ('s') for the given number. - - The number. - The letter 's' if n is greater than 1. - - - - Gets the total number of database pages visited by the database - engine on the current thread. - - - - - Gets the total number of database pages fetched from disk by the - database engine on the current thread. - - - - - Gets the total number of database pages prefetched from disk by - the database engine on the current thread. - - - - - Gets the total number of database pages, with no unwritten changes, - that have been modified by the database engine on the current thread. - - - - - Gets the total number of database pages, with unwritten changes, that - have been modified by the database engine on the current thread. - - - - - Gets the total number of transaction log records that have been - generated by the database engine on the current thread. - - - - - Gets the total size, in bytes, of transaction log records that - have been generated by the database engine on the current thread. - - - - - The native version of the JET_SNPROG structure. - - - - - Size of this structure. - - - - - Size of the structure. - - - - - The number of work units that are already completed during the long - running operation. - - - - - The number of work units that need to be completed. This value will - always be bigger than or equal to cunitDone. - - - - - Contains information about the progress of a long-running operation. - - - - - Number of units of work that have completed. - - - - - Total number of units of work to be done. - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Generate a string representation of the instance. - - The structure as a string. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Set the members of this class from a . - - The native struct. - - - - Gets the number of work units that are already completed during the long - running operation. - - - - - Gets the number of work units that need to be completed. This value will - always be bigger than or equal to cunitDone. - - - - - The native version of the JET_COLUMNDEF structure. - - - - - Size of the structure. - - - - - Column ID. - - - - - Type of the column. - - - - - Reserved. Should be 0. - - - - - Obsolete. Should be 0. - - - - - Code page for text columns. - - - - - Reserved. Should be 0. - - - - - Maximum length of the column. - - - - - Column options. - - - - - Describes a column in a table of an ESENT database. - - - - - The type of the column. - - - - - The code page. Only valid for text columns. - - - - - Maximum size of the column. - - - - - Id of the column. Not serialized because it is an internal - value and shouldn't be persisted. - - - - - Column options. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - Returns the unmanaged columndef that represents this managed class. - - A native (interop) version of the JET_COLUMNDEF. - - - - Sets the fields of the object from a native JET_COLUMNDEF struct. - - - The native columndef to set the values from. - - - - - Gets or sets type of the column. - - - - - Gets or sets code page of the column. This is only meaningful for columns of type - and . - - - - - Gets or sets the maximum length of the column. This is only meaningful for columns of - type , , and - . - - - - - Gets or sets the column options. - - - - - Gets the columnid of the column. - - - - - A class that encapsulates a in a disposable object. The - instance must be closed last and closing the instance releases all other - resources for the instance. - - - - - Parameters for the instance. - - - - - The name of the instance. - - - - - The display name of the instance. - - - - - Initializes a new instance of the Instance class. The underlying - JET_INSTANCE is allocated, but not initialized. - - - The name of the instance. This string must be unique within a - given process hosting the database engine. - - - - - Initializes a new instance of the Instance class. The underlying - JET_INSTANCE is allocated, but not initialized. - - - The name of the instance. This string must be unique within a - given process hosting the database engine. - - - A display name for the instance. This will be used in eventlog - entries. - - - - - Provide implicit conversion of an Instance object to a JET_INSTANCE - structure. This is done so that an Instance can be used anywhere a - JET_INSTANCE is required. - - The instance to convert. - The JET_INSTANCE wrapped by the instance. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Initialize the JET_INSTANCE. - - - - - Initialize the JET_INSTANCE. - - - Initialization options. - - - - - Initialize the JET_INSTANCE. This API requires at least the - Vista version of ESENT. - - - Additional recovery parameters for remapping databases during - recovery, position where to stop recovery at, or recovery status. - - - Initialization options. - - - - - Terminate the JET_INSTANCE. - - - - - Release the handle for this instance. - - True if the handle could be released. - - - - Create a JET_INSTANCE from the internal handle value. - - A JET_INSTANCE containing the internal handle. - - - - Check to see if this instance is invalid or closed. - - - - - Gets the JET_INSTANCE that this instance contains. - - - - - Gets the InstanceParameters for this instance. - - - - - A collection of GCHandles for pinned objects. The handles - are freed when this object is disposed. - - - - - The handles of the objects being pinned. - - - - - Disposes of the object. - - - - - Add an object to the handle collection. This automatically - pins the object. - - The object to pin. - - The address of the pinned object. This is valid until the - GCHandleCollection is disposed. - - - - - The native version of the JET_COLUMNBASE structure. - - - - - Max size of the table/column name string. - - - - - Size of the structure. - - - - - Column ID. - - - - - Type of the column. - - - - - Reserved. Should be 0. - - - - - Obsolete. Should be . - - - - - Code page for text columns. - - - - - Reserved. Should be 0. - - - - - Maximum length of the column. - - - - - Column options. - - - - - The table from which the current table inherits its DDL. - - - - - The name of the column in the template table. - - - - - Describes a column in a table of an ESENT database. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - The value. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets type of the column. - - - - - Gets code page of the column. This is only meaningful for columns of type - and . - - - - - Gets the maximum length of the column. This is only meaningful for columns of - type , , and - . - - - - - Gets the column options. - - - - - Gets the columnid of the column. - - - - - Gets the table from which the current table inherits its DDL. - - - - - Gets the name of the column in the template table. - - - - - The native version of the JET_COLUMNLIST structure. - - - - - Size of the structure. - - - - - Tableid of the temporary table. - - - - - Number of records in the temporary table. - - - - - Columnid of the presentation order column. - - - - - Columnid of the name column. - - - - - Columnid of the columnid column. - - - - - Columnid of the coltyp column. - - - - - Columnid of the country column. - - - - - Columnid of the langid column. - - - - - Columnid of the codepage column. - - - - - Columnid of the collation column. - - - - - Columnid of the cbMax column. - - - - - Columnid of the grbit column. - - - - - Columnid of the default value column. - - - - - Columnid of the base table name column. - - - - - Columnid of the base column name column. - - - - - The column identifier of the name of the column definition. - - - - - Information about a temporary table containing information - about all columns for a given table. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Sets the fields of the object from a native JET_COLUMNLIST struct. - - - The native columnlist to set the values from. - - - - - Gets tableid of the temporary table. This should be closed - when the table is no longer needed. - - - - - Gets the number of records in the temporary table. - - - - - Gets the columnid of the column in the temporary table which - stores the name of the column. - - - - - Gets the columnid of the column in the temporary table which - stores the id of the column. - - - - - Gets the columnid of the column in the temporary table which - stores the type of the column. - - - - - Gets the columnid of the column in the temporary table which - stores the code page of the column. - - - - - Gets the columnid of the column in the temporary table which - stores the maximum length of the column. - - - - - Gets the columnid of the column in the temporary table which - stores the grbit of the column. - - - - - Gets the columnid of the column in the temporary table which - stores the default value of the column. - - - - - Info levels for retrieving object info. - - - - - Retrieve a JET_OBJINFOLIST containing information - about all object in the table. - - - - - Retrieve a JET_OBJINFO containing information - about all object in the table. - - - - - The native version of the structure. This includes callbacks, - space hints, and uses NATIVE_INDEXCREATE. - - - - - Size of the structure. - - - - - Name of the table to create. - - - - - Name of the table from which to inherit base DDL. - - - - - Initial pages to allocate for table. - - - - - Table density. - - - - - Array of column creation info. - - - - - Number of columns to create. - - - - - Array of indices to create, pointer to . - - - - - Number of indices to create. - - - - - Callback function to use for the table. - - - - - Type of the callback function. - - - - - Table options. - - - - - Returned tabledid. - - - - - Count of objects created (columns+table+indexes+callbacks). - - - - - The native version of the structure. This includes callbacks, - space hints, and uses NATIvE_INDEXCREATE2. - - - - - Size of the structure. - - - - - Name of the table to create. - - - - - Name of the table from which to inherit base DDL. - - - - - Initial pages to allocate for table. - - - - - Table density. - - - - - Array of column creation info. - - - - - Number of columns to create. - - - - - Array of indices to create, pointer to . - - - - - Number of indices to create. - - - - - Callback function to use for the table. - - - - - Type of the callback function. - - - - - Table options. - - - - - Space allocation, maintenance, and usage hints for default sequential index. - - - - - Space allocation, maintenance, and usage hints for Separated LV tree. - - - - - Heuristic size to separate a intrinsic LV from the primary record. - - - - - Returned tabledid. - - - - - Count of objects created (columns+table+indexes+callbacks). - - - - - Contains the information needed to create a table in an ESE database. - - - - - Name of the table to create. - - - - - Name of the table from which to inherit base DDL. - - - - - Initial pages to allocate for table. - - - - - Table density. - - - - - Array of column creation info. - - - - - Number of columns to create. - - - - - Array of indices to create, pointer to . - - - - - Number of indices to create. - - - - - Callback function to use for the table. - - - - - Type of the callback function. - - - - - Table options. - - - - - Space allocation, maintenance, and usage hints for default sequential index. - - - - - Space allocation, maintenance, and usage hints for Separated LV tree. - - - - - Heuristic size to separate a intrinsic LV from the primary record. - - - - - Returned tabledid. - - - - - Count of objects created (columns+table+indexes+callbacks). - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - Generate a string representation of the instance. - - The structure as a string. - - - - Check this object to make sure its parameters are valid. - - - - - Gets the native (interop) version of this object. The following members are - NOT converted: , , - , and . - - The native (interop) version of this object. - - - - Gets the native (interop) version of this object. The following members are - NOT converted: , , - , and . - - The native (interop) version of this object. - - - - Gets or sets the name of the table to create. - - - - - Gets or sets the name of the table from which to inherit base DDL. - - - - - Gets or sets the initial pages to allocate for table. - - - - - Gets or sets the table density. - - - - - Gets or sets an array of column creation info, of type . - - - - - Gets or sets the number of columns to create. - - - - - Gets or sets an array of indices to create, of type . - - - - - Gets or sets the number of indices to create. - - - - - Gets or sets a callback function to use for the table. This is in the form "module!functionName", - and assumes unmanaged code. See for an alternative. - - - - - Gets or sets a type of the callback function. - - - - - Gets or sets the table options. - - - - - Gets or sets space allocation, maintenance, and usage hints for default sequential index. - - - - - Gets or sets space allocation, maintenance, and usage hints for Separated LV tree, of type . - - - - - Gets or sets the heuristic size to separate a intrinsic LV from the primary record. - - - - - Gets or sets the returned tabledid. - - - - - Gets or sets the count of objects created (columns+table+indexes+callbacks). - - - - - A column value. - - - - - Recursive SetColumns method for data pinning. This populates the buffer and - calls the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - The native version of the JET_RSTMAP structure. - - - - - The old name/path of the database. Can be null if it is unchanged. - - - - - The current name/path of the database. Must not be null. - - - - - Free the string memory. - - - - - Enables the remapping of database file paths that are stored in the transaction logs during recovery. - - - - - The old name/path of the database. Can be null if it is unchanged. - - - - - The current name/path of the database. Must not be null. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - Get a native version of this managed structure. - - A native version of this object. - - - - Gets or sets the old name/path of the database. Can be null if it is unchanged. - - - - - Gets or sets the current name/path of the database. Must not be null. - - - - - The native version of the JET_RSTINFO structure. - - - - - The size of a NATIVE_RSTINFO structure. - - - - - Size of the structure. - - - - - The array of structures. - - - - - The number of elements in the restore-map array. - - - - - The log position at which it stopped. - - - - - The time at which it stopped. - - - - - The callback to the status function. - - - - - Contains optional input and output parameters for JetRetrieveColumn. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - Check this object to make sure its parameters are valid. - - - - - Get a native version of this managed structure. - - A native version of this object. - - - - Gets or sets the array of structures. - - - - - Gets or sets the number of elements in the restore-map array. - - - - - Gets or sets the log position to stop recovery at. - - - - - Gets or sets the time at which it stopped. - - - - - Gets or sets the callback to Gets or sets the status function. - - - - - Methods to convert data objects used in callbacks. - - - - - Get the managed data object from the unmanaged data. - - The native data. - The SNP (used to determine the type of object). - The SNT (used to determine the type of object). - The managed data object. - - - - A byte array column value. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Recursive SetColumns method for data pinning. This populates the buffer and - calls the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Gets the last set or retrieved value of the column. The - value is returned as a generic object. - - - - - Gets or sets the value of the column. Use to update a - record with the column value. - - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - Column types that have been added to the Vista version of ESENT. - - - - - Unsigned 32-bit number. - - - - - Signed 64-bit number. - - - - - 16-byte GUID. - - - - - Unsigned 16-bit number. - - - - - Codepage for an ESENT column. - - - - - Code page for non-text columns. - - - - - Unicode encoding. - - - - - ASCII encoding. - - - - - The native version of the JET_UNICODEINDEX structure. - - - - - The LCID to be used when normalizing unicode data. - - - - - The flags for LCMapString. - - - - - Customizes how Unicode data gets normalized when an index is created over a Unicode column. - - - - - The LCID to be used when normalizing unicode data. - - - - - Sets the flags to be used with LCMapString when normalizing unicode data. - - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - Generate a string representation of the instance. - - The structure as a string. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets the native version of this object. - - The native version of this object. - - - - Gets or sets the LCID to be used when normalizing unicode data. - - - - - Gets or sets the flags to be used with LCMapString when normalizing unicode data. - - - - - A column value. - - - - - Recursive SetColumns method for data pinning. This populates the buffer and - calls the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - A multi-purpose callback function used by the database engine to inform - the application of an event involving online defragmentation and cursor - state notifications. - - The session for which the callback is being made. - The database for which the callback is being made. - The cursor for which the callback is being made. - The operation for which the callback is being made. - First callback-specific argument. - Second callback-specific argument. - Callback context. - This parameter is not used. - An ESENT error code. - - - - Wraps a NATIVE_CALLBACK callback around a JET_CALLBACK. This is - used to catch exceptions and provide argument conversion. - - - - - API call tracing. - - - - - The wrapped status callback. - - - - - The native version of the callback. This will actually be a closure - because we are calling a non-static method. Keep track of it here - to make sure that it isn't garbage collected. - - - - - Initializes static members of the class. - - - - - Initializes a new instance of the JetCallbackWrapper class. - - - The managed callback to use. - - - - - Determine if the callback is wrapping the specified JET_CALLBACK. - - The callback. - True if this wrapper is wrapping the callback. - - - - Callback function for native code. We don't want to throw an exception through - unmanaged ESENT because that will corrupt ESENT's internal state. Instead we - catch all exceptions and return an error instead. We use a CER to make catching - the exceptions as reliable as possible. - - The session for which the callback is being made. - The database for which the callback is being made. - The cursor for which the callback is being made. - The operation for which the callback is being made. - First callback-specific argument. - Second callback-specific argument. - Callback context. - This parameter is not used. - An ESENT error code. - - - - Gets a value indicating whether the wrapped callback has been garbage - collected. - - - - - Gets a NATIVE_CALLBACK callback that wraps the managed callback. - - - - - Provide methods to convert data and flags between - Win32 and the .NET Framework. - - - - - Maps a CompareOption enumeration to the corresponding LCMapString flag. - - - - - Maps an LCMapString flag to the corresponding CompareOption enumeration. - - - - - Initializes static members of the Conversions class. This sets up the - conversion mapping dictionaries. - - - - - Convert a double (OA date time format) to a DateTime. Unlike DateTime.FromOADate - this doesn't throw exceptions. - - The double value. - A DateTime. - - - - Given flags for LCMapFlags, turn them into compare options. Unknown options - are ignored. - - LCMapString flags. - CompareOptions describing the (known) flags. - - - - Give CompareOptions, turn them into flags from LCMapString. Unknown options are ignored. - - The options to convert. - The LCMapString flags that match the compare options. Unsupported options are ignored. - - - - Given a Key=>Value dictionary create an inverted dictionary that maps Value=>Key. - - The new value type (the key of the current dictionary). - The new key type (the value if the current dictionary). - The dictionary to invert. - An inverted dictionary. - - - - This class contains the unmanaged constants used in the conversion. - - - - - Ignore case. - - - - - Ignore nonspacing chars. - - - - - Ignore symbols. - - - - - Inore kanatype. - - - - - Ignore width. - - - - - Treat punctuation the same as symbols. - - - - - Produce a normalized wide-character sort key. - - - - - Options for JetConfigureProcessForCrashDump. - - - - - Default options. - - - - - Dump minimum includes . - - - - - Dump maximum includes . - - - - - CacheMinimum includes pages that are latched. - CacheMinimum includes pages that are used for memory. - CacheMinimum includes pages that are flagged with errors. - - - - - Cache maximum includes cache minimum. - Cache maximum includes the entire cache image. - - - - - Dump includes pages that are modified. - - - - - Dump includes pages that contain valid data. - - - - - Dump includes pages that are corrupted (expensive to compute). - - - - - Options for JetPrereadKeys. - - - - - Preread forward. - - - - - Preread backwards. - - - - - Grbits that have been added to the Windows 7 version of ESENT. - - - - - Compress data in the column, if possible. - - - - - Try to compress the data when storing it. - - - - - Don't compress the data when storing it. - - - - - Recover without error even if uncommitted logs have been lost. Set - the recovery waypoint with Windows7Param.WaypointLatency to enable - this type of recovery. - - - - - Terminate without flushing the database cache. - - - - - Permit only intrinsic LV's (so materialisation is not required simply - because a TT has an LV column). - - - - - When enumerating column values only retrieve data that is present in - the record. This means that BLOB columns will not always be retrieved. - - - - - Force a new logfile to be created. This option may be used even if - the session is not currently in a transaction. This option cannot - be used in combination with any other option. - - - - - No instances will be prepared by default. Instances must be added explicitly. - - - - - Calls to the ESENT interop layer. These calls take the managed types (e.g. JET_SESID) and - return errors. - - - JetApi code that is specific to ESENT. - - - - - This interface describes all the methods which have a P/Invoke implementation. - Concrete instances of this interface provide methods that call ESENT. - - - - - Allocates a new instance of the database engine. - - Returns the new instance. - The name of the instance. Names must be unique. - An error if the call fails. - - - - Allocate a new instance of the database engine for use in a single - process, with a display name specified. - - Returns the newly create instance. - - Specifies a unique string identifier for the instance to be created. - This string must be unique within a given process hosting the - database engine. - - - A display name for the instance to be created. This will be used - in eventlog entries. - - Creation options. - An error if the call fails. - - - - Initialize the ESENT database engine. - - - The instance to initialize. If an instance hasn't been - allocated then a new one is created and the engine - will operate in single-instance mode. - - An error if the call fails. - - - - Initialize the ESENT database engine. - - - The instance to initialize. If an instance hasn't been - allocated then a new one is created and the engine - will operate in single-instance mode. - - - Initialization options. - - An error or warning. - - - - Initialize the ESENT database engine. - - - The instance to initialize. If an instance hasn't been - allocated then a new one is created and the engine - will operate in single-instance mode. - - - Additional recovery parameters for remapping databases during - recovery, position where to stop recovery at, or recovery status. - - - Initialization options. - - An error code or warning. - - - - Retrieves information about the instances that are running. - - - Returns the number of instances. - - - Returns an array of instance info objects, one for each running - instance. - - An error code if the call fails. - - - - Retrieves information about an instance. - - The instance to get information about. - Retrieved information. - The type of information to retrieve. - An error code if the call fails. - - - - Prevents streaming backup-related activity from continuing on a - specific running instance, thus ending the streaming backup in - a predictable way. - - The instance to use. - An error code. - - - - Prepares an instance for termination. - - The (running) instance to use. - An error code. - - - - Terminate an instance that was created with or - . - - The instance to terminate. - An error or warning. - - - - Terminate an instance that was created with or - . - - The instance to terminate. - Termination options. - An error or warning. - - - - Sets database configuration options. - - - The instance to set the option on or - to set the option on all instances. - - The session to use. - The parameter to set. - The value of the parameter to set, if the parameter is an integer type. - The value of the parameter to set, if the parameter is a string type. - An error or warning. - - - - Sets database configuration options. This overload is used when the - parameter being set is of type JET_CALLBACK. - - - The instance to set the option on or - to set the option on all instances. - - The session to use. - The parameter to set. - The value of the parameter to set. - The value of the string parameter to set. - An error or warning. - - - - Gets database configuration options. - - The instance to retrieve the options from. - The session to use. - The parameter to get. - Returns the value of the parameter, if the value is an integer. - Returns the value of the parameter, if the value is a string. - The maximum size of the parameter string. - - passes in the error number in the paramValue, which is why it is - a ref parameter and not an out parameter. - - An error or warning. - - - - Retrieves the version of the database engine. - - The session to use. - Returns the version number of the database engine. - An error code if the call fails. - - - - Creates and attaches a database file. - - The session to use. - The path to the database file to create. - The parameter is not used. - Returns the dbid of the new database. - Database creation options. - An error or warning. - - - - Creates and attaches a database file with a maximum database size specified. - . - - The session to use. - The path to the database file to create. - - The maximum size, in database pages, of the database. Passing 0 means there is - no enforced maximum. - - Returns the dbid of the new database. - Database creation options. - An error or warning. - - - - Attaches a database file for use with a database instance. In order to use the - database, it will need to be subsequently opened with . - - The session to use. - The database to attach. - Attach options. - An error or warning. - - - - Attaches a database file for use with a database instance. In order to use the - database, it will need to be subsequently opened with . - - The session to use. - The database to attach. - - The maximum size, in database pages, of the database. Passing 0 means there is - no enforced maximum. - - Attach options. - An error or warning. - - - - Opens a database previously attached with , - for use with a database session. This function can be called multiple times - for the same database. - - The session that is opening the database. - The database to open. - Reserved for future use. - Returns the dbid of the attached database. - Open database options. - An error or warning. - - - - Closes a database file that was previously opened with or - created with . - - The session to use. - The database to close. - Close options. - An error or warning. - - - - Releases a database file that was previously attached to a database session. - - The database session to use. - The database to detach. - An error or warning. - - - - Makes a copy of an existing database. The copy is compacted to a - state optimal for usage. Data in the copied data will be packed - according to the measures chosen for the indexes at index create. - In this way, compacted data may be stored as densely as possible. - Alternatively, compacted data may reserve space for subsequent - record growth or index insertions. - - The session to use for the call. - The source database that will be compacted. - The name to use for the compacted database. - - A callback function that can be called periodically through the - database compact operation to report progress. - - - This parameter is ignored and should be null. - - Compact options. - An error code. - - - - Extends the size of a database that is currently open. - - The session to use. - The database to grow. - The desired size of the database, in pages. - - The size of the database, in pages, after the call. - - An error if the call fails. - - - - Extends the size of a database that is currently open. - - The session to use. - The name of the database to grow. - The desired size of the database, in pages. - - The size of the database, in pages, after the call. - - An error if the call fails. - - - - Retrieves certain information about the given database. - - The session to use. - The database identifier. - The value to be retrieved. - The specific data to retrieve. - An error if the call fails. - - - - Retrieves certain information about the given database. - - The session to use. - The database identifier. - The value to be retrieved. - The specific data to retrieve. - An error if the call fails. - - - - Retrieves certain information about the given database. - - The session to use. - The database identifier. - The value to be retrieved. - The specific data to retrieve. - An error if the call fails. - - - - Retrieves certain information about the given database. - - The file name of the database. - The value to be retrieved. - The specific data to retrieve. - An error if the call fails. - - - - Retrieves certain information about the given database. - - The file name of the database. - The value to be retrieved. - The specific data to retrieve. - An error if the call fails. - - - - Retrieves certain information about the given database. - - The file name of the database. - The value to be retrieved. - The specific data to retrieve. - An error if the call fails. - - - - Performs a streaming backup of an instance, including all the attached - databases, to a directory. With multiple backup methods supported by - the engine, this is the simplest and most encapsulated function. - - The instance to backup. - - The directory where the backup is to be stored. If the backup path is - null to use the function will truncate the logs, if possible. - - Backup options. - - Optional status notification callback. - - An error code. - - - - Restores and recovers a streaming backup of an instance including all - the attached databases. It is designed to work with a backup created - with the function. This is the - simplest and most encapsulated restore function. - - The instance to use. - - Location of the backup. The backup should have been created with - . - - - Name of the folder where the database files from the backup set will - be copied and recovered. If this is set to null, the database files - will be copied and recovered to their original location. - - - Optional status notification callback. - - An error code. - - - - Begins the preparations for a snapshot session. A snapshot session - is a short time interval in which the engine does not issue any - write IOs to disk, so that the engine can participate in a volume - snapshot session (when driven by a snapshot writer). - - Returns the ID of the snapshot session. - Snapshot options. - An error code if the call fails. - - - - Selects a specific instance to be part of the snapshot session. - - The snapshot identifier. - The instance to add to the snapshot. - Options for this call. - An error code if the call fails. - - - - Starts a snapshot. While the snapshot is in progress, no - write-to-disk activity by the engine can take place. - - The snapshot session. - - Returns the number of instances that are part of the snapshot session. - - - Returns information about the instances that are part of the snapshot session. - - - Snapshot freeze options. - - An error code if the call fails. - - - - Retrieves the list of instances and databases that are part of the - snapshot session at any given moment. - - The identifier of the snapshot session. - Returns the number of instances. - Returns information about the instances. - Options for this call. - An error code if the call fails. - - - - Notifies the engine that it can resume normal IO operations after a - freeze period and a successful snapshot. - - The ID of the snapshot. - Thaw options. - An error code if the call fails. - - - - Enables log truncation for all instances that are part of the snapshot session. - - - This function should be called only if the snapshot was created with the - option. Otherwise, the snapshot - session ends after the call to . - - The snapshot identifier. - Options for this call. - An error code if the call fails. - - - - Truncates the log for a specified instance during a snapshot session. - - - This function should be called only if the snapshot was created with the - option. Otherwise, the snapshot - session ends after the call to . - - The snapshot identifier. - The instance to truncat the log for. - Options for this call. - An error code if the call fails. - - - - Notifies the engine that the snapshot session finished. - - The identifier of the snapshot session. - Snapshot end options. - An error code if the call fails. - - - - Notifies the engine that it can resume normal IO operations after a - freeze period ended with a failed snapshot. - - Identifier of the snapshot session. - Options for this call. - An error code if the call fails. - - - - Initiates an external backup while the engine and database are online and active. - - The instance prepare for backup. - Backup options. - An error code if the call fails. - - - - Closes a file that was opened with JetOpenFileInstance after the - data from that file has been extracted using JetReadFileInstance. - - The instance to use. - The handle to close. - An error code if the call fails. - - - - Ends an external backup session. This API is the last API in a series - of APIs that must be called to execute a successful online - (non-VSS based) backup. - - The instance to end the backup for. - An error code if the call fails. - - - - Ends an external backup session. This API is the last API in a series - of APIs that must be called to execute a successful online - (non-VSS based) backup. - - The instance to end the backup for. - Options that specify how the backup ended. - An error code if the call fails. - - - - Used during a backup initiated by - to query an instance for the names of database files that should become part of - the backup file set. Only databases that are currently attached to the instance - using will be considered. These files may - subsequently be opened using and read - using . - - - It is important to note that this API does not return an error or warning if - the output buffer is too small to accept the full list of files that should be - part of the backup file set. - - The instance to get the information for. - - Returns a list of null terminated strings describing the set of database files - that should be a part of the backup file set. The list of strings returned in - this buffer is in the same format as a multi-string used by the registry. Each - null-terminated string is returned in sequence followed by a final null terminator. - - - Maximum number of characters to retrieve. - - - Actual size of the file list. If this is greater than maxChars - then the list has been truncated. - - An error code if the call fails. - - - - Used during a backup initiated by - to query an instance for the names of database patch files and logfiles that - should become part of the backup file set. These files may subsequently be - opened using and read using . - - - It is important to note that this API does not return an error or warning if - the output buffer is too small to accept the full list of files that should be - part of the backup file set. - - The instance to get the information for. - - Returns a list of null terminated strings describing the set of database patch files - and log files that should be a part of the backup file set. The list of strings returned in - this buffer is in the same format as a multi-string used by the registry. Each - null-terminated string is returned in sequence followed by a final null terminator. - - - Maximum number of characters to retrieve. - - - Actual size of the file list. If this is greater than maxChars - then the list has been truncated. - - An error code if the call fails. - - - - Used during a backup initiated by - to query an instance for the names of the transaction log files that can be safely - deleted after the backup has successfully completed. - - - It is important to note that this API does not return an error or warning if - the output buffer is too small to accept the full list of files that should be - part of the backup file set. - - The instance to get the information for. - - Returns a list of null terminated strings describing the set of database log files - that can be safely deleted after the backup completes. The list of strings returned in - this buffer is in the same format as a multi-string used by the registry. Each - null-terminated string is returned in sequence followed by a final null terminator. - - - Maximum number of characters to retrieve. - - - Actual size of the file list. If this is greater than maxChars - then the list has been truncated. - - An error code if the call fails. - - - - Opens an attached database, database patch file, or transaction log - file of an active instance for the purpose of performing a streaming - fuzzy backup. The data from these files can subsequently be read - through the returned handle using JetReadFileInstance. The returned - handle must be closed using JetCloseFileInstance. An external backup - of the instance must have been previously initiated using - JetBeginExternalBackupInstance. - - The instance to use. - The file to open. - Returns a handle to the file. - Returns the least significant 32 bits of the file size. - Returns the most significant 32 bits of the file size. - An error code if the call fails. - - - - Retrieves the contents of a file opened with . - - The instance to use. - The file to read from. - The buffer to read into. - The size of the buffer. - Returns the amount of data read into the buffer. - An error code if the call fails. - - - - Used during a backup initiated by JetBeginExternalBackup to delete - any transaction log files that will no longer be needed once the - current backup completes successfully. - - The instance to truncate. - An error code if the call fails. - - - - Initialize a new ESENT session. - - The initialized instance to create the session in. - Returns the created session. - The parameter is not used. - The parameter is not used. - An error if the call fails. - - - - Associates a session with the current thread using the given context - handle. This association overrides the default engine requirement - that a transaction for a given session must occur entirely on the - same thread. - - The session to set the context on. - The context to set. - An error if the call fails. - - - - Disassociates a session from the current thread. This should be - used in conjunction with JetSetSessionContext. - - The session to use. - An error if the call fails. - - - - Ends a session. - - The session to end. - This parameter is not used. - An error if the call fails. - - - - Initialize a new ESE session in the same instance as the given sesid. - - The session to duplicate. - Returns the new session. - An error if the call fails. - - - - Retrieves performance information from the database engine for the - current thread. Multiple calls can be used to collect statistics - that reflect the activity of the database engine on this thread - between those calls. - - - Returns the thread statistics.. - - An error code if the operation fails. - - - - Opens a cursor on a previously created table. - - The database session to use. - The database to open the table in. - The name of the table to open. - The parameter is not used. - The parameter is not used. - Table open options. - Returns the opened table. - An error if the call fails. - - - - Close an open table. - - The session which opened the table. - The table to close. - An error if the call fails. - - - - Duplicates an open cursor and returns a handle to the duplicated cursor. - If the cursor that was duplicated was a read-only cursor then the - duplicated cursor is also a read-only cursor. - Any state related to constructing a search key or updating a record is - not copied into the duplicated cursor. In addition, the location of the - original cursor is not duplicated into the duplicated cursor. The - duplicated cursor is always opened on the clustered index and its - location is always on the first row of the table. - - The session to use. - The cursor to duplicate. - The duplicated cursor. - Reserved for future use. - An error if the call fails. - - - - Walks each index of a table to exactly compute the number of entries - in an index, and the number of distinct keys in an index. This - information, together with the number of database pages allocated - for an index and the current time of the computation is stored in - index metadata in the database. This data can be subsequently retrieved - with information operations. - - The session to use. - The table that the statistics will be computed on. - An error if the call fails. - - - - Enables the application to associate a context handle known as - Local Storage with a cursor or the table associated with that - cursor. This context handle can be used by the application to - store auxiliary data that is associated with a cursor or table. - The application is later notified using a runtime callback when - the context handle must be released. This makes it possible to - associate dynamically allocated state with a cursor or table. - - The session to use. - The cursor to use. - The context handle to be associated with the session or cursor. - Set options. - An error if the call fails. - - - - Enables the application to retrieve the context handle known - as Local Storage that is associated with a cursor or the table - associated with that cursor. This context handle must have been - previously set using . JetGetLS can also - be used to simultaneously fetch the current context handle for - a cursor or table and reset that context handle. - - The session to use. - The cursor to use. - Returns the retrieved context handle. - Retrieve options. - An error if the call fails. - - - - Determine whether an update of the current record of a cursor - will result in a write conflict, based on the current update - status of the record. It is possible that a write conflict will - ultimately be returned even if JetGetCursorInfo returns successfully. - because another session may update the record before the current - session is able to update the same record. - - The session to use. - The cursor to check. - An error if the call fails. - - - - Causes a session to enter a transaction or create a new save point in an existing - transaction. - - The session to begin the transaction for. - An error if the call fails. - - - - Causes a session to enter a transaction or create a new save point in an existing - transaction. - - The session to begin the transaction for. - Transaction options. - An error if the call fails. - - - - Commits the changes made to the state of the database during the current save point - and migrates them to the previous save point. If the outermost save point is committed - then the changes made during that save point will be committed to the state of the - database and the session will exit the transaction. - - The session to commit the transaction for. - Commit options. - An error if the call fails. - - - - Undoes the changes made to the state of the database - and returns to the last save point. JetRollback will also close any cursors - opened during the save point. If the outermost save point is undone, the - session will exit the transaction. - - The session to rollback the transaction for. - Rollback options. - An error if the call fails. - - - - Create an empty table. The newly created table is opened exclusively. - - The session to use. - The database to create the table in. - The name of the table to create. - Initial number of pages in the table. - - The default density of the table. This is used when doing sequential inserts. - - Returns the tableid of the new table. - An error if the call fails. - - - - Add a new column to an existing table. - - The session to use. - The table to add the column to. - The name of the column. - The definition of the column. - The default value of the column. - The size of the default value. - Returns the columnid of the new column. - An error if the call fails. - - - - Deletes a column from a database table. - - The session to use. - A cursor on the table to delete the column from. - The name of the column to be deleted. - An error if the call fails. - - - - Deletes a column from a database table. - - The session to use. - A cursor on the table to delete the column from. - The name of the column to be deleted. - Column deletion options. - An error if the call fails. - - - - Deletes an index from a database table. - - The session to use. - A cursor on the table to delete the index from. - The name of the index to be deleted. - An error if the call fails. - - - - Deletes a table from a database. - - The session to use. - The database to delete the table from. - The name of the table to delete. - An error if the call fails. - - - - Creates an index over data in an ESE database. An index can be used to locate - specific data quickly. - - The session to use. - The table to create the index on. - - Pointer to a null-terminated string that specifies the name of the index to create. - - Index creation options. - - Pointer to a double null-terminated string of null-delimited tokens. - - - The length, in characters, of szKey including the two terminating nulls. - - Initial B+ tree density. - An error if the call fails. - - - - Creates indexes over data in an ESE database. - - The session to use. - The table to create the index on. - Array of objects describing the indexes to be created. - Number of index description objects. - An error code. - - - - Creates a temporary table with a single index. A temporary table - stores and retrieves records just like an ordinary table created - using JetCreateTableColumnIndex. However, temporary tables are - much faster than ordinary tables due to their volatile nature. - They can also be used to very quickly sort and perform duplicate - removal on record sets when accessed in a purely sequential manner. - - The session to use. - - Column definitions for the columns created in the temporary table. - - Number of column definitions. - Table creation options. - - Returns the tableid of the temporary table. Closing this tableid - frees the resources associated with the temporary table. - - - The output buffer that receives the array of column IDs generated - during the creation of the temporary table. The column IDs in this - array will exactly correspond to the input array of column definitions. - As a result, the size of this buffer must correspond to the size of the input array. - - An error code. - - - - Creates a temporary table with a single index. A temporary table - stores and retrieves records just like an ordinary table created - using JetCreateTableColumnIndex. However, temporary tables are - much faster than ordinary tables due to their volatile nature. - They can also be used to very quickly sort and perform duplicate - removal on record sets when accessed in a purely sequential manner. - - The session to use. - - Column definitions for the columns created in the temporary table. - - Number of column definitions. - - The locale ID to use to compare any Unicode key column data in the temporary table. - Any locale may be used as long as the appropriate language pack has been installed - on the machine. - - Table creation options. - - Returns the tableid of the temporary table. Closing this tableid - frees the resources associated with the temporary table. - - - The output buffer that receives the array of column IDs generated - during the creation of the temporary table. The column IDs in this - array will exactly correspond to the input array of column definitions. - As a result, the size of this buffer must correspond to the size of the input array. - - An error code. - - - - Creates a temporary table with a single index. A temporary table - stores and retrieves records just like an ordinary table created - using JetCreateTableColumnIndex. However, temporary tables are - much faster than ordinary tables due to their volatile nature. - They can also be used to very quickly sort and perform duplicate - removal on record sets when accessed in a purely sequential manner. - - The session to use. - - Column definitions for the columns created in the temporary table. - - Number of column definitions. - - The Locale ID and normalization flags that will be used to compare - any Unicode key column data in the temporary table. When this - is not present then the default options are used. - - Table creation options. - - Returns the tableid of the temporary table. Closing this tableid - frees the resources associated with the temporary table. - - - The output buffer that receives the array of column IDs generated - during the creation of the temporary table. The column IDs in this - array will exactly correspond to the input array of column definitions. - As a result, the size of this buffer must correspond to the size of the input array. - - An error code. - - - - Creates a temporary table with a single index. A temporary table - stores and retrieves records just like an ordinary table created - using JetCreateTableColumnIndex. However, temporary tables are - much faster than ordinary tables due to their volatile nature. - They can also be used to very quickly sort and perform duplicate - removal on record sets when accessed in a purely sequential manner. - - - Introduced in Windows Vista; - - The session to use. - - Description of the temporary table to create on input. After a - successful call, the structure contains the handle to the temporary - table and column identifications. - - An error code. - - - - Creates a table, adds columns, and indices on that table. - - The session to use. - The database to which to add the new table. - Object describing the table to create. - An error if the call fails. - - - - Retrieves information about a table column. - - The session to use. - The table containing the column. - The name of the column. - Filled in with information about the column. - An error if the call fails. - - - - Retrieves information about a table column. - - The session to use. - The table containing the column. - The columnid of the column. - Filled in with information about the column. - An error if the call fails. - - - - Retrieves information about all columns in the table. - - The session to use. - The table containing the column. - The parameter is ignored. - Filled in with information about the columns in the table. - An error if the call fails. - - - - Retrieves information about a table column. - - The session to use. - The database that contains the table. - The name of the table containing the column. - The name of the column. - Filled in with information about the column. - An error if the call fails. - - - - Retrieves information about all columns in a table. - - The session to use. - The database that contains the table. - The name of the table containing the column. - This parameter is ignored. - Filled in with information about the columns in the table. - An error if the call fails. - - - - Retrieves information about a column in a table. - - The session to use. - The database that contains the table. - The name of the table containing the column. - The name of the column. - Filled in with information about the columns in the table. - An error if the call fails. - - - - Retrieves information about a column in a table. - - The session to use. - The database that contains the table. - The name of the column. - The ID of the column. - Filled in with information about the columns in the table. - An error if the call fails. - - - - Retrieves information about database objects. - - The session to use. - The database to use. - Filled in with information about the objects in the database. - An error if the call fails. - - - - Retrieves information about database objects. - - The session to use. - The database to use. - The type of the object. - The object name about which to retrieve information. - Filled in with information about the objects in the database. - An error if the call fails. - - - - JetGetCurrentIndex function determines the name of the current - index of a given cursor. This name is also used to later re-select - that index as the current index using JetSetCurrentIndex. It can - also be used to discover the properties of that index using - JetGetTableIndexInfo. - - The session to use. - The cursor to get the index name for. - Returns the name of the index. - - The maximum length of the index name. Index names are no more than - Api.MaxNameLength characters. - - An error if the call fails. - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with and - . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with and - . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with and - . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The database to use. - The name of the table to retrieve index information about. - The name of the index to retrieve information about. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The database to use. - The name of the table to retrieve index information about. - The name of the index to retrieve information about. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The database to use. - The name of the table to retrieve index information about. - The name of the index to retrieve information about. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The database to use. - The name of the table to retrieve index information about. - The name of the index to retrieve information about. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The table to retrieve index information about. - The name of the index. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The table to retrieve index information about. - The name of the index. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The table to retrieve index information about. - The name of the index. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The table to retrieve index information about. - The name of the index. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Changes the name of an existing table. - - The session to use. - The database containing the table. - The name of the table. - The new name of the table. - An error if the call fails. - - - - Changes the name of an existing column. - - The session to use. - The table containing the column. - The name of the column. - The new name of the column. - Column rename options. - An error if the call fails. - - - - Changes the default value of an existing column. - - The session to use. - The database containing the column. - The name of the table containing the column. - The name of the column. - The new default value. - Size of the new default value. - Column default value options. - An error if the call fails. - - - - Positions a cursor to an index entry for the record that is associated with - the specified bookmark. The bookmark can be used with any index defined over - a table. The bookmark for a record can be retrieved using . - - The session to use. - The cursor to position. - The bookmark used to position the cursor. - The size of the bookmark. - An error if the call fails. - - - - Positions a cursor to an index entry that is associated with the - specified secondary index bookmark. The secondary index bookmark - must be used with the same index over the same table from which it - was originally retrieved. The secondary index bookmark for an index - entry can be retrieved using . - - The session to use. - The table cursor to position. - The buffer that contains the secondary key. - The size of the secondary key. - The buffer that contains the primary key. - The size of the primary key. - Options for positioning the bookmark. - An error if the call fails. - - - - Navigate through an index. The cursor can be positioned at the start or - end of the index and moved backwards and forwards by a specified number - of index entries. - - The session to use for the call. - The cursor to position. - An offset which indicates how far to move the cursor. - Move options. - An error if the call fails. - - - - Constructs search keys that may then be used by and . - - - The MakeKey functions provide datatype-specific make key functionality. - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Size of the data. - Key options. - An error if the call fails. - - - - Efficiently positions a cursor to an index entry that matches the search - criteria specified by the search key in that cursor and the specified - inequality. A search key must have been previously constructed using - JetMakeKey. - - The session to use. - The cursor to position. - Seek options. - An error or warning.. - - - - Temporarily limits the set of index entries that the cursor can walk using - to those starting - from the current index entry and ending at the index entry that matches the - search criteria specified by the search key in that cursor and the specified - bound criteria. A search key must have been previously constructed using - JetMakeKey. - - The session to use. - The cursor to set the index range on. - Index range options. - An error if the call fails. - - - - Computes the intersection between multiple sets of index entries from different secondary - indices over the same table. This operation is useful for finding the set of records in a - table that match two or more criteria that can be expressed using index ranges. - - The session to use. - - An the index ranges to intersect. The tableids in the ranges - must have index ranges set on them. - - - The number of index ranges. - - - Returns information about the temporary table containing the intersection results. - - Intersection options. - An error if the call fails. - - - - Set the current index of a cursor. - - The session to use. - The cursor to set the index on. - - The name of the index to be selected. If this is null or empty the primary - index will be selected. - - An error if the call fails. - - - - Set the current index of a cursor. - - The session to use. - The cursor to set the index on. - - The name of the index to be selected. If this is null or empty the primary - index will be selected. - - - Set index options. - - An error if the call fails. - - - - Set the current index of a cursor. - - The session to use. - The cursor to set the index on. - - The name of the index to be selected. If this is null or empty the primary - index will be selected. - - - Set index options. - - - Sequence number of the multi-valued column value which will be used - to position the cursor on the new index. This parameter is only used - in conjunction with . When - this parameter is not present or is set to zero, its value is presumed - to be 1. - - An error if the call fails. - - - - Set the current index of a cursor. - - The session to use. - The cursor to set the index on. - - The name of the index to be selected. If this is null or empty the primary - index will be selected. - - - The id of the index to select. This id can be obtained using JetGetIndexInfo - or JetGetTableIndexInfo with the option. - - - Set index options. - - - Sequence number of the multi-valued column value which will be used - to position the cursor on the new index. This parameter is only used - in conjunction with . When - this parameter is not present or is set to zero, its value is presumed - to be 1. - - An error if the call fails. - - - - Counts the number of entries in the current index from the current position forward. - The current position is included in the count. The count can be greater than the - total number of records in the table if the current index is over a multi-valued - column and instances of the column have multiple-values. If the table is empty, - then 0 will be returned for the count. - - The session to use. - The cursor to count the records in. - Returns the number of records. - - The maximum number of records to count. - - An error if the call fails. - - - - Notifies the database engine that the application is scanning the entire - index that the cursor is positioned on. Consequently, the methods that - are used to access the index data will be tuned to make this scenario as - fast as possible. - - The session to use. - The cursor that will be accessing the data. - Reserved for future use. - An error if the call fails. - - - - Notifies the database engine that the application is no longer scanning the - entire index the cursor is positioned on. This call reverses a notification - sent by JetSetTableSequential. - - The session to use. - The cursor that was accessing the data. - Reserved for future use. - An error if the call fails. - - - - Returns the fractional position of the current record in the current index - in the form of a JET_RECPOS structure. - - The session to use. - The cursor positioned on the record. - Returns the approximate fractional position of the record. - An error if the call fails. - - - - Moves a cursor to a new location that is a fraction of the way through - the current index. - - The session to use. - The cursor to position. - The approximate position to move to. - An error if the call fails. - - - - If the records with the specified keys are not in the buffer cache - then start asynchronous reads to bring the records into the database - buffer cache. - - The session to use. - The table to issue the prereads against. - - The keys to preread. The keys must be sorted. - - The lengths of the keys to preread. - - The index of the first key in the keys array to read. - - - The maximum number of keys to preread. - - - Returns the number of keys to actually preread. - - - Preread options. Used to specify the direction of the preread. - - An error or warning. - - - - Retrieves the bookmark for the record that is associated with the index entry - at the current position of a cursor. This bookmark can then be used to - reposition that cursor back to the same record using . - The bookmark will be no longer than - bytes. - - The session to use. - The cursor to retrieve the bookmark from. - Buffer to contain the bookmark. - Size of the bookmark buffer. - Returns the actual size of the bookmark. - An error if the call fails. - - - - Retrieves a special bookmark for the secondary index entry at the - current position of a cursor. This bookmark can then be used to - efficiently reposition that cursor back to the same index entry - using JetGotoSecondaryIndexBookmark. This is most useful when - repositioning on a secondary index that contains duplicate keys or - that contains multiple index entries for the same record. - - The session to use. - The cursor to retrieve the bookmark from. - Output buffer for the secondary key. - Size of the secondary key buffer. - Returns the size of the secondary key. - Output buffer for the primary key. - Size of the primary key buffer. - Returns the size of the primary key. - Options for the call. - An error if the call fails. - - - - Retrieves the key for the index entry at the current position of a cursor. - - The session to use. - The cursor to retrieve the key from. - The buffer to retrieve the key into. - The size of the buffer. - Returns the actual size of the data. - Retrieve key options. - An error if the call fails. - - - - Retrieves a single column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - Alternatively, this function can retrieve a column from a record being created - in the cursor copy buffer. This function can also retrieve column data from an - index entry that references the current record. In addition to retrieving the - actual column value, JetRetrieveColumn can also be used to retrieve the size - of a column, before retrieving the column data itself so that application - buffers can be sized appropriately. - - - The RetrieveColumnAs functions provide datatype-specific retrieval functions. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data buffer to be retrieved into. - The size of the data buffer. - Returns the actual size of the data buffer. - Retrieve column options. - - If pretinfo is give as NULL then the function behaves as though an itagSequence - of 1 and an ibLongValue of 0 (zero) were given. This causes column retrieval to - retrieve the first value of a multi-valued column, and to retrieve long data at - offset 0 (zero). - - An error or warning. - - - - The JetRetrieveColumns function retrieves multiple column values - from the current record in a single operation. An array of - structures is used to - describe the set of column values to be retrieved, and to describe - output buffers for each column value to be retrieved. - - The session to use. - The cursor to retrieve columns from. - - An array of one or more JET_RETRIEVECOLUMN structures. Each - structure includes descriptions of which column value to retrieve - and where to store returned data. - - - Number of structures in the array given by retrievecolumns. - - - An error or warning. - - - - - Efficiently retrieves a set of columns and their values from the - current record of a cursor or the copy buffer of that cursor. The - columns and values retrieved can be restricted by a list of - column IDs, itagSequence numbers, and other characteristics. This - column retrieval API is unique in that it returns information in - dynamically allocated memory that is obtained using a - user-provided realloc compatible callback. This new flexibility - permits the efficient retrieval of column data with specific - characteristics (such as size and multiplicity) that are unknown - to the caller. This eliminates the need for the use of the discovery - modes of JetRetrieveColumn to determine those - characteristics in order to setup a final call to - JetRetrieveColumn that will successfully retrieve - the desired data. - - The session to use. - The cursor to retrieve data from. - The numbers of JET_ENUMCOLUMNIDS. - - An optional array of column IDs, each with an optional array of itagSequence - numbers to enumerate. - - - Returns the number of column values retrieved. - - - Returns the enumerated column values. - - - Callback used to allocate memory. - - - Context for the allocation callback. - - - Sets a cap on the amount of data to return from a long text or long - binary column. This parameter can be used to prevent the enumeration - of an extremely large column value. - - Retrieve options. - A warning, error or success. - - - - Retrieves record size information from the desired location. - - The session to use. - - The cursor that will be used for the API call. The cursor must be - positioned on a record, or have an update prepared. - - Returns the size of the record. - Call options. - A warning, error or success. - - - - Deletes the current record in a database table. - - The session that opened the cursor. - The cursor on a database table. The current row will be deleted. - An error if the call fails. - - - - Prepare a cursor for update. - - The session which is starting the update. - The cursor to start the update for. - The type of update to prepare. - An error if the call fails. - - - - The JetUpdate function performs an update operation including inserting a new row into - a table or updating an existing row. Deleting a table row is performed by calling - . - - The session which started the update. - The cursor to update. An update should be prepared. - Returns the bookmark of the updated record. This can be null. - The size of the bookmark buffer. - Returns the actual size of the bookmark. - - JetUpdate is the final step in performing an insert or an update. The update is begun by - calling and then by calling - JetSetColumn one or more times to set the record state. Finally, JetUpdate - is called to complete the update operation. Indexes are updated only by JetUpdate or and not during JetSetColumn. - - An error if the call fails. - - - - The JetUpdate2 function performs an update operation including inserting a new row into - a table or updating an existing row. Deleting a table row is performed by calling - . - - The session which started the update. - The cursor to update. An update should be prepared. - Returns the bookmark of the updated record. This can be null. - The size of the bookmark buffer. - Returns the actual size of the bookmark. - Update options. - - JetUpdate is the final step in performing an insert or an update. The update is begun by - calling and then by calling - JetSetColumn one or more times to set the record state. Finally, JetUpdate - is called to complete the update operation. Indexes are updated only by JetUpdate or and not during JetSetColumn. - - An error if the call fails. - - - - The JetSetColumn function modifies a single column value in a modified record to be inserted or to - update the current record. It can overwrite an existing value, add a new value to a sequence of - values in a multi-valued column, remove a value from a sequence of values in a multi-valued column, - or update all or part of a long value (a column of type - or ). - - - The SetColumn methods provide datatype-specific overrides which may be more efficient. - - The session which is performing the update. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - The size of data to set. - SetColumn options. - Used to specify itag or long-value offset. - An error if the call fails. - - - - Allows an application to set multiple column values in a single - operation. An array of structures is - used to describe the set of column values to be set, and to describe - input buffers for each column value to be set. - - The session to use. - The cursor to set the columns on. - - An array of structures describing the - data to set. - - - Number of entries in the setcolumns parameter. - - An error code or warning. - - - - Explicitly reserve the ability to update a row, write lock, or to explicitly prevent a row from - being updated by any other session, read lock. Normally, row write locks are acquired implicitly as a - result of updating rows. Read locks are usually not required because of record versioning. However, - in some cases a transaction may desire to explicitly lock a row to enforce serialization, or to ensure - that a subsequent operation will succeed. - - The session to use. - The cursor to use. A lock will be acquired on the current record. - Lock options, use this to specify which type of lock to obtain. - An error if the call fails. - - - - Performs an atomic addition operation on one column. This function allows - multiple sessions to update the same record concurrently without conflicts. - - The session to use. - The cursor to update. - - The column to update. This must be an escrow updatable column. - - The buffer containing the addend. - The size of the addend. - - An output buffer that will recieve the current value of the column. This buffer - can be null. - - The size of the previousValue buffer. - Returns the actual size of the previousValue. - Escrow update options. - An error code if the operation fails. - - - - Allows the application to configure the database engine to issue - notifications to the application for specific events. These - notifications are associated with a specific table and remain in - effect only until the instance containing the table is shut down - using . - - The session to use. - - A cursor opened on the table that the callback should be - registered on. - - - The callback reasons for which the application wishes to receive notifications. - - The callback function. - A context that will be given to the callback. - - A handle that can later be used to cancel the registration of the given - callback function using . - - An error if the call fails. - - - - Configures the database engine to stop issuing notifications to the - application as previously requested through - . - - The session to use. - - A cursor opened on the table that the callback should be - registered on. - - - The callback reasons for which the application no longer wishes to receive notifications. - - - The handle of the registered callback that was returned by . - - An error if the call fails. - - - - Starts and stops database defragmentation tasks that improves data - organization within a database. - - The session to use for the call. - The database to be defragmented. - - Unused parameter. Defragmentation is performed for the entire database described by the given database ID. - - - When starting an online defragmentation task, this parameter sets the maximum number of defragmentation - passes. When stopping an online defragmentation task, this parameter is set to the number of passes - performed. - - - When starting an online defragmentation task, this parameter sets - the maximum time for defragmentation. When stopping an online - defragmentation task, this output buffer is set to the length of - time used for defragmentation. - - Defragmentation options. - An error code or warning. - - - - Starts and stops database defragmentation tasks that improves data - organization within a database. - - The session to use for the call. - The database to be defragmented. - - Unused parameter. Defragmentation is performed for the entire database described by the given database ID. - - - When starting an online defragmentation task, this parameter sets the maximum number of defragmentation - passes. When stopping an online defragmentation task, this parameter is set to the number of passes - performed. - - - When starting an online defragmentation task, this parameter sets - the maximum time for defragmentation. When stopping an online - defragmentation task, this output buffer is set to the length of - time used for defragmentation. - - Callback function that defrag uses to report progress. - Defragmentation options. - An error code or warning. - - - - Performs idle cleanup tasks or checks the version store status in ESE. - - The session to use. - A combination of JetIdleGrbit flags. - An error code if the operation fails. - - - - Crash dump options for Watson. - - Crash dump options. - An error code. - - - - Frees memory that was allocated by a database engine call. - - - The buffer allocated by a call to the database engine. - is acceptable, and will be ignored. - - An error code. - - - - Gets a description of the capabilities of the current version of ESENT. - - - - - API call tracing. - - - - - The version of esent. If this is zero then it is looked up - with . - - - - - Callback wrapper collection. This is used for long-running callbacks - (callbacks which can be called after the API call returns). Create a - wrapper here and occasionally clean them up. - - - - - Initializes static members of the JetApi class. - - - - - Initializes a new instance of the JetApi class. This allows the version - to be set. - - - The version of Esent. This is used to override the results of - . - - - - - Initializes a new instance of the JetApi class. - - - - - Allocates a new instance of the database engine. - - Returns the new instance. - The name of the instance. Names must be unique. - An error if the call fails. - - - - Allocate a new instance of the database engine for use in a single - process, with a display name specified. - - Returns the newly create instance. - - Specifies a unique string identifier for the instance to be created. - This string must be unique within a given process hosting the - database engine. - - - A display name for the instance to be created. This will be used - in eventlog entries. - - Creation options. - An error if the call fails. - - - - Initialize the ESENT database engine. - - - The instance to initialize. If an instance hasn't been - allocated then a new one is created and the engine - will operate in single-instance mode. - - An error if the call fails. - - - - Initialize the ESENT database engine. - - - The instance to initialize. If an instance hasn't been - allocated then a new one is created and the engine - will operate in single-instance mode. - - - Initialization options. - - An error or a warning. - - - - Initialize the ESENT database engine. - - - The instance to initialize. If an instance hasn't been - allocated then a new one is created and the engine - will operate in single-instance mode. - - - Additional recovery parameters for remapping databases during - recovery, position where to stop recovery at, or recovery status. - - - Initialization options. - - An error code or warning. - - - - Retrieves information about the instances that are running. - - - Returns the number of instances. - - - Returns an array of instance info objects, one for each running - instance. - - An error code if the call fails. - - - - Retrieves information about an instance. - - The instance to get information about. - Retrieved information. - The type of information to retrieve. - An error code if the call fails. - - - - Prevents streaming backup-related activity from continuing on a - specific running instance, thus ending the streaming backup in - a predictable way. - - The instance to use. - An error code. - - - - Prepares an instance for termination. - - The (running) instance to use. - An error code. - - - - Terminate an instance that was created with or - . - - The instance to terminate. - An error or warning. - - - - Terminate an instance that was created with or - . - - The instance to terminate. - Termination options. - An error or warning. - - - - Sets database configuration options. - - - The instance to set the option on or - to set the option on all instances. - - The session to use. - The parameter to set. - The value of the parameter to set, if the parameter is an integer type. - The value of the parameter to set, if the parameter is a string type. - An error or warning. - - - - Sets database configuration options. This overload is used when the - parameter being set is of type JET_CALLBACK. - - - The instance to set the option on or - to set the option on all instances. - - The session to use. - The parameter to set. - The value of the parameter to set. - The value of the string parameter to set. - An error or warning. - - - - Gets database configuration options. - - The instance to retrieve the options from. - The session to use. - The parameter to get. - Returns the value of the parameter, if the value is an integer. - Returns the value of the parameter, if the value is a string. - The maximum size of the parameter string. - An ESENT warning code. - - passes in the error number in the paramValue, which is why it is - a ref parameter and not an out parameter. - - An error or warning. - - - - Retrieves the version of the database engine. - - The session to use. - Returns the version number of the database engine. - An error code if the call fails. - - - - Creates and attaches a database file. - - The session to use. - The path to the database file to create. - The parameter is not used. - Returns the dbid of the new database. - Database creation options. - An error or warning. - - - - Creates and attaches a database file with a maximum database size specified. - . - - The session to use. - The path to the database file to create. - - The maximum size, in database pages, of the database. Passing 0 means there is - no enforced maximum. - - Returns the dbid of the new database. - Database creation options. - An error or warning. - - - - Attaches a database file for use with a database instance. In order to use the - database, it will need to be subsequently opened with . - - The session to use. - The database to attach. - Attach options. - An error or warning. - - - - Attaches a database file for use with a database instance. In order to use the - database, it will need to be subsequently opened with . - . - - The session to use. - The database to attach. - - The maximum size, in database pages, of the database. Passing 0 means there is - no enforced maximum. - - Attach options. - An error or warning. - - - - Opens a database previously attached with , - for use with a database session. This function can be called multiple times - for the same database. - - The session that is opening the database. - The database to open. - Reserved for future use. - Returns the dbid of the attached database. - Open database options. - An error or warning. - - - - Closes a database file that was previously opened with or - created with . - - The session to use. - The database to close. - Close options. - An error or warning. - - - - Releases a database file that was previously attached to a database session. - - The database session to use. - The database to detach. - An error or warning. - - - - Makes a copy of an existing database. The copy is compacted to a - state optimal for usage. Data in the copied data will be packed - according to the measures chosen for the indexes at index create. - In this way, compacted data may be stored as densely as possible. - Alternatively, compacted data may reserve space for subsequent - record growth or index insertions. - - The session to use for the call. - The source database that will be compacted. - The name to use for the compacted database. - - A callback function that can be called periodically through the - database compact operation to report progress. - - - This parameter is ignored and should be null. - - Compact options. - An error code. - - - - Extends the size of a database that is currently open. - - The session to use. - The database to grow. - The desired size of the database, in pages. - - The size of the database, in pages, after the call. - - An error if the call fails. - - - - Extends the size of a database that is currently open. - - The session to use. - The name of the database to grow. - The desired size of the database, in pages. - - The size of the database, in pages, after the call. - - An error if the call fails. - - - - Retrieves certain information about the given database. - - The session to use. - The database identifier. - The value to be retrieved. - The specific data to retrieve. - An error if the call fails. - - - - Retrieves certain information about the given database. - - The session to use. - The database identifier. - The value to be retrieved. - The specific data to retrieve. - An error if the call fails. - - - - Retrieves certain information about the given database. - - The session to use. - The database identifier. - The value to be retrieved. - The specific data to retrieve. - An error if the call fails. - - - - Retrieves certain information about the given database. - - The file name of the database. - The value to be retrieved. - The specific data to retrieve. - An error if the call fails. - - - - Retrieves certain information about the given database. - - The file name of the database. - The value to be retrieved. - The specific data to retrieve. - An error if the call fails. - - - - Retrieves certain information about the given database. - - The file name of the database. - The value to be retrieved. - The specific data to retrieve. - An error if the call fails. - - - - Performs a streaming backup of an instance, including all the attached - databases, to a directory. With multiple backup methods supported by - the engine, this is the simplest and most encapsulated function. - - The instance to backup. - - The directory where the backup is to be stored. If the backup path is - null to use the function will truncate the logs, if possible. - - Backup options. - - Optional status notification callback. - - An error code. - - - - Restores and recovers a streaming backup of an instance including all - the attached databases. It is designed to work with a backup created - with the function. This is the - simplest and most encapsulated restore function. - - The instance to use. - - Location of the backup. The backup should have been created with - . - - - Name of the folder where the database files from the backup set will - be copied and recovered. If this is set to null, the database files - will be copied and recovered to their original location. - - - Optional status notification callback. - - An error code. - - - - Begins the preparations for a snapshot session. A snapshot session - is a short time interval in which the engine does not issue any - write IOs to disk, so that the engine can participate in a volume - snapshot session (when driven by a snapshot writer). - - Returns the ID of the snapshot session. - Snapshot options. - An error code if the call fails. - - - - Selects a specific instance to be part of the snapshot session. - - The snapshot identifier. - The instance to add to the snapshot. - Options for this call. - An error code if the call fails. - - - - Starts a snapshot. While the snapshot is in progress, no - write-to-disk activity by the engine can take place. - - The snapshot session. - - Returns the number of instances that are part of the snapshot session. - - - Returns information about the instances that are part of the snapshot session. - - - Snapshot freeze options. - - An error code if the call fails. - - - - Retrieves the list of instances and databases that are part of the - snapshot session at any given moment. - - The identifier of the snapshot session. - Returns the number of instances. - Returns information about the instances. - Options for this call. - An error code if the call fails. - - - - Notifies the engine that it can resume normal IO operations after a - freeze period and a successful snapshot. - - The ID of the snapshot. - Thaw options. - An error code if the call fails. - - - - Enables log truncation for all instances that are part of the snapshot session. - - - This function should be called only if the snapshot was created with the - option. Otherwise, the snapshot - session ends after the call to . - - The snapshot identifier. - Options for this call. - An error code if the call fails. - - - - Truncates the log for a specified instance during a snapshot session. - - - This function should be called only if the snapshot was created with the - option. Otherwise, the snapshot - session ends after the call to . - - The snapshot identifier. - The instance to truncat the log for. - Options for this call. - An error code if the call fails. - - - - Notifies the engine that the snapshot session finished. - - The identifier of the snapshot session. - Snapshot end options. - An error code. - - - - Notifies the engine that it can resume normal IO operations after a - freeze period ended with a failed snapshot. - - Identifier of the snapshot session. - Options for this call. - An error code. - - - - Initiates an external backup while the engine and database are online and active. - - The instance prepare for backup. - Backup options. - An error code if the call fails. - - - - Closes a file that was opened with JetOpenFileInstance after the - data from that file has been extracted using JetReadFileInstance. - - The instance to use. - The handle to close. - An error code if the call fails. - - - - Ends an external backup session. This API is the last API in a series - of APIs that must be called to execute a successful online - (non-VSS based) backup. - - The instance to end the backup for. - An error code if the call fails. - - - - Ends an external backup session. This API is the last API in a series - of APIs that must be called to execute a successful online - (non-VSS based) backup. - - The instance to end the backup for. - Options that specify how the backup ended. - An error code if the call fails. - - - - Used during a backup initiated by - to query an instance for the names of database files that should become part of - the backup file set. Only databases that are currently attached to the instance - using will be considered. These files may - subsequently be opened using and read - using . - - - It is important to note that this API does not return an error or warning if - the output buffer is too small to accept the full list of files that should be - part of the backup file set. - - The instance to get the information for. - - Returns a list of null terminated strings describing the set of database files - that should be a part of the backup file set. The list of strings returned in - this buffer is in the same format as a multi-string used by the registry. Each - null-terminated string is returned in sequence followed by a final null terminator. - - - Maximum number of characters to retrieve. - - - Actual size of the file list. If this is greater than maxChars - then the list has been truncated. - - An error code if the call fails. - - - - Used during a backup initiated by - to query an instance for the names of database patch files and logfiles that - should become part of the backup file set. These files may subsequently be - opened using and read using . - - - It is important to note that this API does not return an error or warning if - the output buffer is too small to accept the full list of files that should be - part of the backup file set. - - The instance to get the information for. - - Returns a list of null terminated strings describing the set of database patch files - and log files that should be a part of the backup file set. The list of strings returned in - this buffer is in the same format as a multi-string used by the registry. Each - null-terminated string is returned in sequence followed by a final null terminator. - - - Maximum number of characters to retrieve. - - - Actual size of the file list. If this is greater than maxChars - then the list has been truncated. - - An error code if the call fails. - - - - Used during a backup initiated by - to query an instance for the names of the transaction log files that can be safely - deleted after the backup has successfully completed. - - - It is important to note that this API does not return an error or warning if - the output buffer is too small to accept the full list of files that should be - part of the backup file set. - - The instance to get the information for. - - Returns a list of null terminated strings describing the set of database log files - that can be safely deleted after the backup completes. The list of strings returned in - this buffer is in the same format as a multi-string used by the registry. Each - null-terminated string is returned in sequence followed by a final null terminator. - - - Maximum number of characters to retrieve. - - - Actual size of the file list. If this is greater than maxChars - then the list has been truncated. - - An error code if the call fails. - - - - Opens an attached database, database patch file, or transaction log - file of an active instance for the purpose of performing a streaming - fuzzy backup. The data from these files can subsequently be read - through the returned handle using JetReadFileInstance. The returned - handle must be closed using JetCloseFileInstance. An external backup - of the instance must have been previously initiated using - JetBeginExternalBackupInstance. - - The instance to use. - The file to open. - Returns a handle to the file. - Returns the least significant 32 bits of the file size. - Returns the most significant 32 bits of the file size. - An error code if the call fails. - - - - Retrieves the contents of a file opened with . - - The instance to use. - The file to read from. - The buffer to read into. - The size of the buffer. - Returns the amount of data read into the buffer. - An error code if the call fails. - - - - Used during a backup initiated by JetBeginExternalBackup to delete - any transaction log files that will no longer be needed once the - current backup completes successfully. - - The instance to truncate. - An error code if the call fails. - - - - Initialize a new ESENT session. - - The initialized instance to create the session in. - Returns the created session. - The parameter is not used. - The parameter is not used. - An error if the call fails. - - - - Associates a session with the current thread using the given context - handle. This association overrides the default engine requirement - that a transaction for a given session must occur entirely on the - same thread. - - The session to set the context on. - The context to set. - An error if the call fails. - - - - Disassociates a session from the current thread. This should be - used in conjunction with JetSetSessionContext. - - The session to use. - An error if the call fails. - - - - Ends a session. - - The session to end. - This parameter is not used. - An error if the call fails. - - - - Initialize a new ESE session in the same instance as the given sesid. - - The session to duplicate. - Returns the new session. - An error if the call fails. - - - - Retrieves performance information from the database engine for the - current thread. Multiple calls can be used to collect statistics - that reflect the activity of the database engine on this thread - between those calls. - - - Returns the thread statistics.. - - An error code if the operation fails. - - - - Opens a cursor on a previously created table. - - The database session to use. - The database to open the table in. - The name of the table to open. - The parameter is not used. - The parameter is not used. - Table open options. - Returns the opened table. - An error if the call fails. - - - - Close an open table. - - The session which opened the table. - The table to close. - An error if the call fails. - - - - Duplicates an open cursor and returns a handle to the duplicated cursor. - If the cursor that was duplicated was a read-only cursor then the - duplicated cursor is also a read-only cursor. - Any state related to constructing a search key or updating a record is - not copied into the duplicated cursor. In addition, the location of the - original cursor is not duplicated into the duplicated cursor. The - duplicated cursor is always opened on the clustered index and its - location is always on the first row of the table. - - The session to use. - The cursor to duplicate. - The duplicated cursor. - Reserved for future use. - An error if the call fails. - - - - Walks each index of a table to exactly compute the number of entries - in an index, and the number of distinct keys in an index. This - information, together with the number of database pages allocated - for an index and the current time of the computation is stored in - index metadata in the database. This data can be subsequently retrieved - with information operations. - - The session to use. - The table that the statistics will be computed on. - An error if the call fails. - - - - Enables the application to associate a context handle known as - Local Storage with a cursor or the table associated with that - cursor. This context handle can be used by the application to - store auxiliary data that is associated with a cursor or table. - The application is later notified using a runtime callback when - the context handle must be released. This makes it possible to - associate dynamically allocated state with a cursor or table. - - The session to use. - The cursor to use. - The context handle to be associated with the session or cursor. - Set options. - An error if the call fails. - - - - Enables the application to retrieve the context handle known - as Local Storage that is associated with a cursor or the table - associated with that cursor. This context handle must have been - previously set using . JetGetLS can also - be used to simultaneously fetch the current context handle for - a cursor or table and reset that context handle. - - The session to use. - The cursor to use. - Returns the retrieved context handle. - Retrieve options. - An error if the call fails. - - - - Determine whether an update of the current record of a cursor - will result in a write conflict, based on the current update - status of the record. It is possible that a write conflict will - ultimately be returned even if JetGetCursorInfo returns successfully. - because another session may update the record before the current - session is able to update the same record. - - The session to use. - The cursor to check. - An error if the call fails. - - - - Causes a session to enter a transaction or create a new save point in an existing - transaction. - - The session to begin the transaction for. - An error if the call fails. - - - - Causes a session to enter a transaction or create a new save point in an existing - transaction. - - The session to begin the transaction for. - Transaction options. - An error if the call fails. - - - - Commits the changes made to the state of the database during the current save point - and migrates them to the previous save point. If the outermost save point is committed - then the changes made during that save point will be committed to the state of the - database and the session will exit the transaction. - - The session to commit the transaction for. - Commit options. - An error if the call fails. - - - - Undoes the changes made to the state of the database - and returns to the last save point. JetRollback will also close any cursors - opened during the save point. If the outermost save point is undone, the - session will exit the transaction. - - The session to rollback the transaction for. - Rollback options. - An error if the call fails. - - - - Create an empty table. The newly created table is opened exclusively. - - The session to use. - The database to create the table in. - The name of the table to create. - Initial number of pages in the table. - - The default density of the table. This is used when doing sequential inserts. - - Returns the tableid of the new table. - An error if the call fails. - - - - Deletes a table from a database. - - The session to use. - The database to delete the table from. - The name of the table to delete. - An error if the call fails. - - - - Add a new column to an existing table. - - The session to use. - The table to add the column to. - The name of the column. - The definition of the column. - The default value of the column. - The size of the default value. - Returns the columnid of the new column. - An error if the call fails. - - - - Deletes a column from a database table. - - The session to use. - A cursor on the table to delete the column from. - The name of the column to be deleted. - An error if the call fails. - - - - Deletes a column from a database table. - - The session to use. - A cursor on the table to delete the column from. - The name of the column to be deleted. - Column deletion options. - An error if the call fails. - - - - Creates an index over data in an ESE database. An index can be used to locate - specific data quickly. - - The session to use. - The table to create the index on. - - Pointer to a null-terminated string that specifies the name of the index to create. - - Index creation options. - - Pointer to a double null-terminated string of null-delimited tokens. - - - The length, in characters, of szKey including the two terminating nulls. - - Initial B+ tree density. - An error if the call fails. - - - - Creates indexes over data in an ESE database. - - The session to use. - The table to create the index on. - Array of objects describing the indexes to be created. - Number of index description objects. - An error code. - - - - Deletes an index from a database table. - - The session to use. - A cursor on the table to delete the index from. - The name of the index to be deleted. - An error if the call fails. - - - - Creates a temporary table with a single index. A temporary table - stores and retrieves records just like an ordinary table created - using JetCreateTableColumnIndex. However, temporary tables are - much faster than ordinary tables due to their volatile nature. - They can also be used to very quickly sort and perform duplicate - removal on record sets when accessed in a purely sequential manner. - - The session to use. - - Column definitions for the columns created in the temporary table. - - Number of column definitions. - Table creation options. - - Returns the tableid of the temporary table. Closing this tableid - frees the resources associated with the temporary table. - - - The output buffer that receives the array of column IDs generated - during the creation of the temporary table. The column IDs in this - array will exactly correspond to the input array of column definitions. - As a result, the size of this buffer must correspond to the size of the input array. - - An error code. - - - - Creates a temporary table with a single index. A temporary table - stores and retrieves records just like an ordinary table created - using JetCreateTableColumnIndex. However, temporary tables are - much faster than ordinary tables due to their volatile nature. - They can also be used to very quickly sort and perform duplicate - removal on record sets when accessed in a purely sequential manner. - - The session to use. - - Column definitions for the columns created in the temporary table. - - Number of column definitions. - - The locale ID to use to compare any Unicode key column data in the temporary table. - Any locale may be used as long as the appropriate language pack has been installed - on the machine. - - Table creation options. - - Returns the tableid of the temporary table. Closing this tableid - frees the resources associated with the temporary table. - - - The output buffer that receives the array of column IDs generated - during the creation of the temporary table. The column IDs in this - array will exactly correspond to the input array of column definitions. - As a result, the size of this buffer must correspond to the size of the input array. - - An error code. - - - - Creates a temporary table with a single index. A temporary table - stores and retrieves records just like an ordinary table created - using JetCreateTableColumnIndex. However, temporary tables are - much faster than ordinary tables due to their volatile nature. - They can also be used to very quickly sort and perform duplicate - removal on record sets when accessed in a purely sequential manner. - - The session to use. - - Column definitions for the columns created in the temporary table. - - Number of column definitions. - - The Locale ID and normalization flags that will be used to compare - any Unicode key column data in the temporary table. When this - is not present then the default options are used. - - Table creation options. - - Returns the tableid of the temporary table. Closing this tableid - frees the resources associated with the temporary table. - - - The output buffer that receives the array of column IDs generated - during the creation of the temporary table. The column IDs in this - array will exactly correspond to the input array of column definitions. - As a result, the size of this buffer must correspond to the size of the input array. - - An error code. - - - - Creates a temporary table with a single index. A temporary table - stores and retrieves records just like an ordinary table created - using JetCreateTableColumnIndex. However, temporary tables are - much faster than ordinary tables due to their volatile nature. - They can also be used to very quickly sort and perform duplicate - removal on record sets when accessed in a purely sequential manner. - - - Introduced in Windows Vista; - - The session to use. - - Description of the temporary table to create on input. After a - successful call, the structure contains the handle to the temporary - table and column identifications. - - An error code. - - - - Creates a table, adds columns, and indices on that table. - - The session to use. - The database to which to add the new table. - Object describing the table to create. - An error if the call fails. - - - - Retrieves information about a table column. - - The session to use. - The table containing the column. - The name of the column. - Filled in with information about the column. - An error if the call fails. - - - - Retrieves information about a table column. - - The session to use. - The table containing the column. - The columnid of the column. - Filled in with information about the column. - An error if the call fails. - - - - Retrieves information about all columns in the table. - - The session to use. - The table containing the column. - The parameter is ignored. - Filled in with information about the columns in the table. - An error if the call fails. - - - - Retrieves information about a table column. - - The session to use. - The database that contains the table. - The name of the table containing the column. - The name of the column. - Filled in with information about the column. - An error if the call fails. - - - - Retrieves information about all columns in a table. - - The session to use. - The database that contains the table. - The name of the table containing the column. - This parameter is ignored. - Filled in with information about the columns in the table. - An error if the call fails. - - - - Retrieves information about a column in a table. - - The session to use. - The database that contains the table. - The name of the table containing the column. - The name of the column. - Filled in with information about the columns in the table. - An error if the call fails. - - - - Retrieves information about a column. - - The session to use. - The database that contains the table. - The name of the table containing the column. - The columnid of the column. - Filled in with information about the columns in the table. - An error if the call fails. - - - - Retrieves information about database objects. - - The session to use. - The database to use. - Filled in with information about the objects in the database. - An error if the call fails. - - - - Retrieves information about database objects. - - The session to use. - The database to use. - The type of the object. - The object name about which to retrieve information. - Filled in with information about the objects in the database. - An error if the call fails. - - - - JetGetCurrentIndex function determines the name of the current - index of a given cursor. This name is also used to later re-select - that index as the current index using JetSetCurrentIndex. It can - also be used to discover the properties of that index using - JetGetTableIndexInfo. - - The session to use. - The cursor to get the index name for. - Returns the name of the index. - - The maximum length of the index name. Index names are no more than - Api.MaxNameLength characters. - - An error if the call fails. - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with and - . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with and - . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves various pieces of information about a table in a database. - - - This overload is used with and - . - - The session to use. - The table to retrieve information about. - Retrieved information. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The database to use. - The name of the table to retrieve index information about. - The name of the index to retrieve information about. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The database to use. - The name of the table to retrieve index information about. - The name of the index to retrieve information about. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The database to use. - The name of the table to retrieve index information about. - The name of the index to retrieve information about. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The database to use. - The name of the table to retrieve index information about. - The name of the index to retrieve information about. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The table to retrieve index information about. - The name of the index. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The table to retrieve index information about. - The name of the index. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The table to retrieve index information about. - The name of the index. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Retrieves information about indexes on a table. - - The session to use. - The table to retrieve index information about. - The name of the index. - Filled in with information about indexes on the table. - The type of information to retrieve. - An error if the call fails. - - - - Changes the name of an existing table. - - The session to use. - The database containing the table. - The name of the table. - The new name of the table. - An error if the call fails. - - - - Changes the name of an existing column. - - The session to use. - The table containing the column. - The name of the column. - The new name of the column. - Column rename options. - An error if the call fails. - - - - Changes the default value of an existing column. - - The session to use. - The database containing the column. - The name of the table containing the column. - The name of the column. - The new default value. - Size of the new default value. - Column default value options. - An error if the call fails. - - - - Positions a cursor to an index entry for the record that is associated with - the specified bookmark. The bookmark can be used with any index defined over - a table. The bookmark for a record can be retrieved using . - - The session to use. - The cursor to position. - The bookmark used to position the cursor. - The size of the bookmark. /// An error if the call fails. - - - - Positions a cursor to an index entry that is associated with the - specified secondary index bookmark. The secondary index bookmark - must be used with the same index over the same table from which it - was originally retrieved. The secondary index bookmark for an index - entry can be retrieved using . - - The session to use. - The table cursor to position. - The buffer that contains the secondary key. - The size of the secondary key. - The buffer that contains the primary key. - The size of the primary key. - Options for positioning the bookmark. - An error if the call fails. - - - - Constructs search keys that may then be used by and . - - - The MakeKey functions provide datatype-specific make key functionality. - - The session to use. - The cursor to create the key on. - Column data for the current key column of the current index. - Size of the data. - Key options. - An error if the call fails. - - - - Efficiently positions a cursor to an index entry that matches the search - criteria specified by the search key in that cursor and the specified - inequality. A search key must have been previously constructed using - JetMakeKey. - - The session to use. - The cursor to position. - Seek options. - An error or warning.. - - - - Navigate through an index. The cursor can be positioned at the start or - end of the index and moved backwards and forwards by a specified number - of index entries. - - The session to use for the call. - The cursor to position. - An offset which indicates how far to move the cursor. - Move options. - An error if the call fails. - - - - Temporarily limits the set of index entries that the cursor can walk using - to those starting - from the current index entry and ending at the index entry that matches the - search criteria specified by the search key in that cursor and the specified - bound criteria. A search key must have been previously constructed using - JetMakeKey. - - The session to use. - The cursor to set the index range on. - Index range options. - An error if the call fails. - - - - Computes the intersection between multiple sets of index entries from different secondary - indices over the same table. This operation is useful for finding the set of records in a - table that match two or more criteria that can be expressed using index ranges. - - The session to use. - - An the index ranges to intersect. The tableids in the ranges - must have index ranges set on them. - - - The number of index ranges. - - - Returns information about the temporary table containing the intersection results. - - Intersection options. - An error if the call fails. - - - - Set the current index of a cursor. - - The session to use. - The cursor to set the index on. - - The name of the index to be selected. If this is null or empty the primary - index will be selected. - - An error if the call fails. - - - - Set the current index of a cursor. - - The session to use. - The cursor to set the index on. - - The name of the index to be selected. If this is null or empty the primary - index will be selected. - - - Set index options. - - An error if the call fails. - - - - Set the current index of a cursor. - - The session to use. - The cursor to set the index on. - - The name of the index to be selected. If this is null or empty the primary - index will be selected. - - - Set index options. - - - Sequence number of the multi-valued column value which will be used - to position the cursor on the new index. This parameter is only used - in conjunction with . When - this parameter is not present or is set to zero, its value is presumed - to be 1. - - An error if the call fails. - - - - Set the current index of a cursor. - - The session to use. - The cursor to set the index on. - - The name of the index to be selected. If this is null or empty the primary - index will be selected. - - - The id of the index to select. This id can be obtained using JetGetIndexInfo - or JetGetTableIndexInfo with the option. - - - Set index options. - - - Sequence number of the multi-valued column value which will be used - to position the cursor on the new index. This parameter is only used - in conjunction with . When - this parameter is not present or is set to zero, its value is presumed - to be 1. - - An error if the call fails. - - - - Counts the number of entries in the current index from the current position forward. - The current position is included in the count. The count can be greater than the - total number of records in the table if the current index is over a multi-valued - column and instances of the column have multiple-values. If the table is empty, - then 0 will be returned for the count. - - The session to use. - The cursor to count the records in. - Returns the number of records. - - The maximum number of records to count. - - An error if the call fails. - - - - Notifies the database engine that the application is scanning the entire - index that the cursor is positioned on. Consequently, the methods that - are used to access the index data will be tuned to make this scenario as - fast as possible. - - The session to use. - The cursor that will be accessing the data. - Reserved for future use. - An error if the call fails. - - - - Notifies the database engine that the application is no longer scanning the - entire index the cursor is positioned on. This call reverses a notification - sent by JetSetTableSequential. - - The session to use. - The cursor that was accessing the data. - Reserved for future use. - An error if the call fails. - - - - Returns the fractional position of the current record in the current index - in the form of a JET_RECPOS structure. - - The session to use. - The cursor positioned on the record. - Returns the approximate fractional position of the record. - An error if the call fails. - - - - Moves a cursor to a new location that is a fraction of the way through - the current index. - - The session to use. - The cursor to position. - The approximate position to move to. - An error if the call fails. - - - - If the records with the specified keys are not in the buffer cache - then start asynchronous reads to bring the records into the database - buffer cache. - - The session to use. - The table to issue the prereads against. - - The keys to preread. The keys must be sorted. - - The lengths of the keys to preread. - - The index of the first key in the keys array to read. - - - The maximum number of keys to preread. - - - Returns the number of keys to actually preread. - - - Preread options. Used to specify the direction of the preread. - - An error or warning. - - - - Retrieves the bookmark for the record that is associated with the index entry - at the current position of a cursor. This bookmark can then be used to - reposition that cursor back to the same record using . - The bookmark will be no longer than - bytes. - - The session to use. - The cursor to retrieve the bookmark from. - Buffer to contain the bookmark. - Size of the bookmark buffer. - Returns the actual size of the bookmark. - An error if the call fails. - - - - Retrieves a special bookmark for the secondary index entry at the - current position of a cursor. This bookmark can then be used to - efficiently reposition that cursor back to the same index entry - using JetGotoSecondaryIndexBookmark. This is most useful when - repositioning on a secondary index that contains duplicate keys or - that contains multiple index entries for the same record. - - The session to use. - The cursor to retrieve the bookmark from. - Output buffer for the secondary key. - Size of the secondary key buffer. - Returns the size of the secondary key. - Output buffer for the primary key. - Size of the primary key buffer. - Returns the size of the primary key. - Options for the call. - An error if the call fails. - - - - Retrieves the key for the index entry at the current position of a cursor. - - The session to use. - The cursor to retrieve the key from. - The buffer to retrieve the key into. - The size of the buffer. - Returns the actual size of the data. - Retrieve key options. - An error if the call fails. - - - - Retrieves a single column value from the current record. The record is that - record associated with the index entry at the current position of the cursor. - Alternatively, this function can retrieve a column from a record being created - in the cursor copy buffer. This function can also retrieve column data from an - index entry that references the current record. In addition to retrieving the - actual column value, JetRetrieveColumn can also be used to retrieve the size - of a column, before retrieving the column data itself so that application - buffers can be sized appropriately. - - - The RetrieveColumnAs functions provide datatype-specific retrieval functions. - - The session to use. - The cursor to retrieve the column from. - The columnid to retrieve. - The data buffer to be retrieved into. - The size of the data buffer. - Returns the actual size of the data buffer. - Retrieve column options. - - If pretinfo is give as NULL then the function behaves as though an itagSequence - of 1 and an ibLongValue of 0 (zero) were given. This causes column retrieval to - retrieve the first value of a multi-valued column, and to retrieve long data at - offset 0 (zero). - - An error or warning. - - - - The JetRetrieveColumns function retrieves multiple column values - from the current record in a single operation. An array of - structures is used to - describe the set of column values to be retrieved, and to describe - output buffers for each column value to be retrieved. - - The session to use. - The cursor to retrieve columns from. - - An array of one or more JET_RETRIEVECOLUMN structures. Each - structure includes descriptions of which column value to retrieve - and where to store returned data. - - - Number of structures in the array given by retrievecolumns. - - - An error or warning. - - - - - Efficiently retrieves a set of columns and their values from the - current record of a cursor or the copy buffer of that cursor. The - columns and values retrieved can be restricted by a list of - column IDs, itagSequence numbers, and other characteristics. This - column retrieval API is unique in that it returns information in - dynamically allocated memory that is obtained using a - user-provided realloc compatible callback. This new flexibility - permits the efficient retrieval of column data with specific - characteristics (such as size and multiplicity) that are unknown - to the caller. This eliminates the need for the use of the discovery - modes of JetRetrieveColumn to determine those - characteristics in order to setup a final call to - JetRetrieveColumn that will successfully retrieve - the desired data. - - The session to use. - The cursor to retrieve data from. - The numbers of JET_ENUMCOLUMNIDS. - - An optional array of column IDs, each with an optional array of itagSequence - numbers to enumerate. - - - Returns the number of column values retrieved. - - - Returns the enumerated column values. - - - Callback used to allocate memory. - - - Context for the allocation callback. - - - Sets a cap on the amount of data to return from a long text or long - binary column. This parameter can be used to prevent the enumeration - of an extremely large column value. - - Retrieve options. - A warning, error or success. - - - - Retrieves record size information from the desired location. - - The session to use. - - The cursor that will be used for the API call. The cursor must be - positioned on a record, or have an update prepared. - - Returns the size of the record. - Call options. - A warning, error or success. - - - - Deletes the current record in a database table. - - The session that opened the cursor. - The cursor on a database table. The current row will be deleted. - An error if the call fails. - - - - Prepare a cursor for update. - - The session which is starting the update. - The cursor to start the update for. - The type of update to prepare. - An error if the call fails. - - - - The JetUpdate function performs an update operation including inserting a new row into - a table or updating an existing row. Deleting a table row is performed by calling - . - - The session which started the update. - The cursor to update. An update should be prepared. - Returns the bookmark of the updated record. This can be null. - The size of the bookmark buffer. - Returns the actual size of the bookmark. - - JetUpdate is the final step in performing an insert or an update. The update is begun by - calling and then by calling - JetSetColumn - one or more times to set the record state. Finally, JetUpdate - is called to complete the update operation. Indexes are updated only by JetUpdate or and not during JetSetColumn. - - An error if the call fails. - - - - The JetUpdate2 function performs an update operation including inserting a new row into - a table or updating an existing row. Deleting a table row is performed by calling - . - - The session which started the update. - The cursor to update. An update should be prepared. - Returns the bookmark of the updated record. This can be null. - The size of the bookmark buffer. - Returns the actual size of the bookmark. - Update options. - - JetUpdate is the final step in performing an insert or an update. The update is begun by - calling and then by calling - JetSetColumn one or more times to set the record state. Finally, JetUpdate - is called to complete the update operation. Indexes are updated only by JetUpdate or and not during JetSetColumn. - - An error if the call fails. - - - - The JetSetColumn function modifies a single column value in a modified record to be inserted or to - update the current record. It can overwrite an existing value, add a new value to a sequence of - values in a multi-valued column, remove a value from a sequence of values in a multi-valued column, - or update all or part of a long value (a column of type - or ). - - - The SetColumn methods provide datatype-specific overrides which may be more efficient. - - The session which is performing the update. - The cursor to update. An update should be prepared. - The columnid to set. - The data to set. - The size of data to set. - SetColumn options. - Used to specify itag or long-value offset. - An error if the call fails. - - - - Allows an application to set multiple column values in a single - operation. An array of structures is - used to describe the set of column values to be set, and to describe - input buffers for each column value to be set. - - The session to use. - The cursor to set the columns on. - - An array of structures describing the - data to set. - - - Number of entries in the setcolumns parameter. - - An error code or warning. - - - - Explicitly reserve the ability to update a row, write lock, or to explicitly prevent a row from - being updated by any other session, read lock. Normally, row write locks are acquired implicitly as a - result of updating rows. Read locks are usually not required because of record versioning. However, - in some cases a transaction may desire to explicitly lock a row to enforce serialization, or to ensure - that a subsequent operation will succeed. - - The session to use. - The cursor to use. A lock will be acquired on the current record. - Lock options, use this to specify which type of lock to obtain. - An error if the call fails. - - - - Performs an atomic addition operation on one column. This function allows - multiple sessions to update the same record concurrently without conflicts. - - The session to use. - The cursor to update. - - The column to update. This must be an escrow updatable column. - - The buffer containing the addend. - The size of the addend. - - An output buffer that will recieve the current value of the column. This buffer - can be null. - - The size of the previousValue buffer. - Returns the actual size of the previousValue. - Escrow update options. - An error code if the operation fails. - - - - Allows the application to configure the database engine to issue - notifications to the application for specific events. These - notifications are associated with a specific table and remain in - effect only until the instance containing the table is shut down - using . - - The session to use. - - A cursor opened on the table that the callback should be - registered on. - - - The callback reasons for which the application wishes to receive notifications. - - The callback function. - A context that will be given to the callback. - - A handle that can later be used to cancel the registration of the given - callback function using . - - An error if the call fails. - - - - Configures the database engine to stop issuing notifications to the - application as previously requested through - . - - The session to use. - - A cursor opened on the table that the callback should be - registered on. - - - The callback reasons for which the application no longer wishes to receive notifications. - - - The handle of the registered callback that was returned by . - - An error if the call fails. - - - - Starts and stops database defragmentation tasks that improves data - organization within a database. - - The session to use for the call. - The database to be defragmented. - - Unused parameter. Defragmentation is performed for the entire database described by the given database ID. - - - When starting an online defragmentation task, this parameter sets the maximum number of defragmentation - passes. When stopping an online defragmentation task, this parameter is set to the number of passes - performed. - - - When starting an online defragmentation task, this parameter sets - the maximum time for defragmentation. When stopping an online - defragmentation task, this output buffer is set to the length of - time used for defragmentation. - - Defragmentation options. - An error code. - - - - Starts and stops database defragmentation tasks that improves data - organization within a database. - - The session to use for the call. - The database to be defragmented. - - Unused parameter. Defragmentation is performed for the entire database described by the given database ID. - - - When starting an online defragmentation task, this parameter sets the maximum number of defragmentation - passes. When stopping an online defragmentation task, this parameter is set to the number of passes - performed. - - - When starting an online defragmentation task, this parameter sets - the maximum time for defragmentation. When stopping an online - defragmentation task, this output buffer is set to the length of - time used for defragmentation. - - Callback function that defrag uses to report progress. - Defragmentation options. - An error code or warning. - - - - Performs idle cleanup tasks or checks the version store status in ESE. - - The session to use. - A combination of JetIdleGrbit flags. - An error code if the operation fails. - - - - Crash dump options for Watson. - - Crash dump options. - An error code. - - - - Frees memory that was allocated by a database engine call. - - - The buffer allocated by a call to the database engine. - is acceptable, and will be ignored. - - An error code. - - - - Given the bookmark size returned by ESENT, get the bookmark size - to return to the user. - - The bookmark size returned by ESENT. - The bookmark size to return to the user. - - - - Make sure the data, dataOffset and dataSize arguments match. - - The data buffer. - The offset into the data. - The name of the offset argument. - The size of the data. - The name of the size argument. - The type of the data. - - - - Make sure the data and dataSize arguments match. - - The data buffer. - The size of the data. - The name of the size argument. - The type of the data. - - - - Make sure the given object isn't null. If it is - then throw an ArgumentNullException. - - The object to check. - The name of the parameter. - - - - Make sure the given integer isn't negative. If it is - then throw an ArgumentOutOfRangeException. - - The integer to check. - The name of the parameter. - - - - Used when an unsupported API method is called. This - logs an error and returns an InvalidOperationException. - - The name of the method. - The exception to throw. - - - - Trace a call to an ESENT function. - - The name of the function being called. - - - - Can be used to trap ESENT errors. - - The error being returned. - The error. - - - - Trace an error generated by a call to ESENT. - - The error to trace. - - - - Convert managed JET_ENUMCOLUMNID objects to NATIVE_ENUMCOLUMNID - structures. - - The columnids to convert. - The number of columnids to convert. - The array to store the converted columnids. - The total number of tag entries in the converted structures. - - - - Convert managed rgtagSequence to unmanaged rgtagSequence. - - The columnids to convert. - The number of columnids to covert. - The unmanaged columnids to add the tags to. - - Memory to use for converted rgtagSequence. This should be large enough to - hold all columnids. - - - - - Convert the native (unmanaged) results of JetEnumerateColumns to - managed objects. This uses the allocator callback to free some - memory as the data is converted. - - The allocator callback used. - The allocator callback context. - Number of NATIVE_ENUMCOLUMN structures returned. - NATIVE_ENUMCOLUMN structures. - Returns the number of converted JET_ENUMCOLUMN objects. - Returns the convertd column values. - - - - Make an array of native columndefs from JET_COLUMNDEFs. - - Columndefs to convert. - Number of columndefs to convert. - An array of native columndefs. - - - - Make native conditionalcolumn structures from the managed ones. - - The conditional columns to convert. - The handle collection used to pin the data. - Pinned native versions of the conditional columns. - - - - Make native columncreate structures from the managed ones. - - Column create structures to convert. - The handle collection used to pin the data. - Pinned native versions of the column creates. - - - - Make native indexcreate structures from the managed ones. - - Index create structures to convert. - The handle collection used to pin the data. - Pinned native versions of the index creates. - - - - Make native indexcreate structures from the managed ones. - - Index create structures to convert. - The handle collection used to pin the data. - Pinned native versions of the index creates. - - - - Make native indexcreate structures from the managed ones. - - Index create structures to convert. - The handle collection used to pin the data. - Pinned native versions of the index creates. - - - - Set managed columnids from unmanaged columnids. This also sets the columnids - in the columndefs. - - The column definitions. - The columnids to set. - The native columnids. - The number of columnids to set. - - - - Creates indexes over data in an ESE database. - - The session to use. - The table to create the index on. - Array of objects describing the indexes to be created. - Number of index description objects. - An error code. - - - - Creates indexes over data in an ESE database. - - The session to use. - The table to create the index on. - Array of objects describing the indexes to be created. - Number of index description objects. - An error code. - - - - Creates indexes over data in an ESE database. - - The session to use. - The table to create the index on. - Array of objects describing the indexes to be created. - Number of index description objects. - An error code. - - - - Creates a table, adds columns, and indices on that table. - - The session to use. - The database to which to add the new table. - Object describing the table to create. - An error if the call fails. - - - - Convert native instance info structures to managed, treating the - unmanaged strings as Unicode. - - The number of native structures. - - A pointer to the native structures. This pointer will be freed with JetFreeBuffer. - - - An array of JET_INSTANCE_INFO structures created from the unmanaged. - - - - - Convert native instance info structures to managed, treating the - unmanaged string as Unicode. - - The number of native structures. - - A pointer to the native structures. This pointer will be freed with JetFreeBuffer. - - - An array of JET_INSTANCE_INFO structures created from the unmanaged. - - - - - Check that ESENT supports Server 2003 features. Throws an exception if Server 2003 features - aren't supported. - - The API that is being called. - - - - Check that ESENT supports Vista features. Throws an exception if Vista features - aren't supported. - - The API that is being called. - - - - Check that ESENT supports Windows7 features. Throws an exception if Windows7 features - aren't supported. - - The API that is being called. - - - - Creates a table, adds columns, and indices on that table. - - The session to use. - The database to which to add the new table. - Object describing the table to create. - An error if the call fails. - - - - Calculates the capabilities of the current Esent version. - - - - - Create an instance and get the current version of Esent. - - The current version of Esent. - - - - Gets the capabilities of this implementation of ESENT. - - - - - The native version of the JET_SETINFO structure. - - - - - The size of a NATIVE_SETINFO structure. - - - - - Size of the structure. - - - - - Offset to the first byte to be set in a column of type JET_coltypLongBinary or JET_coltypLongText. - - - - - The sequence number of value in a multi-valued column to be set. - - - - - Settings for JetSetColumn. - - - - - Offset to the first byte to be set in a column of type or . - - - - - The sequence number of value in a multi-valued column to be set. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - Gets the NATIVE_SETINFO structure that represents the object. - - A NATIVE_SETINFO structure whose fields match the class. - - - - Gets or sets offset to the first byte to be set in a column of type or . - - - - - Gets or sets the sequence number of value in a multi-valued column to be set. The array of values is one-based. - The first value is sequence 1, not 0 (zero). If the record column has only one value then 1 should be passed - as the itagSequence if that value is being replaced. A value of 0 (zero) means to add a new column value instance - to the end of the sequence of column values. - - - - - Update types for JetPrepareUpdate. - - - - - This flag causes the cursor to prepare for an insert of a new record. - All the data is initialized to the default state for the record. - If the table has an auto-increment column, then a new value is - assigned to this record regardless of whether the update ultimately - succeeds, fails or is cancelled. - - - - - This flag causes the cursor to prepare for a replace of the current - record. If the table has a version column, then the version column - is set to the next value in its sequence. If this update does not - complete, then the version value in the record will be unaffected. - An update lock is taken on the record to prevent other sessions - from updating this record before this session completes. - - - - - This flag causes JetPrepareUpdate to cancel the update for this cursor. - - - - - This flag is similar to JET_prepReplace, but no lock is taken to prevent - other sessions from updating this record. Instead, this session may receive - JET_errWriteConflict when it calls JetUpdate to complete the update. - - - - - This flag causes the cursor to prepare for an insert of a copy of the - existing record. There must be a current record if this option is used. - The initial state of the new record is copied from the current record. - Long values that are stored off-record are virtually copied. - - - - - This flag causes the cursor to prepare for an insert of the same record, - and a delete or the original record. It is used in cases in which the - primary key has changed. - - - - - ESENT system parameters. - - - - - This parameter indicates the relative or absolute file system path of the - folder that will contain the checkpoint file for the instance. The path - must be terminated with a backslash character, which indicates that the - target path is a folder. - - - - - This parameter indicates the relative or absolute file system path of - the folder or file that will contain the temporary database for the instance. - If the path is to a folder that will contain the temporary database then it - must be terminated with a backslash character. - - - - - This parameter indicates the relative or absolute file system path of the - folder that will contain the transaction logs for the instance. The path must - be terminated with a backslash character, which indicates that the target path - is a folder. - - - - - This parameter sets the three letter prefix used for many of the files used by - the database engine. For example, the checkpoint file is called EDB.CHK by - default because EDB is the default base name. - - - - - This parameter supplies an application specific string that will be added to - any event log messages that are emitted by the database engine. This allows - easy correlation of event log messages with the source application. By default - the host application executable name will be used. - - - - - This parameter reserves the requested number of session resources for use by an - instance. A session resource directly corresponds to a JET_SESID data type. - This setting will affect how many sessions can be used at the same time. - - - - - This parameter reserves the requested number of B+ Tree resources for use by - an instance. This setting will affect how many tables can be used at the same time. - - - - - This parameter reserves the requested number of cursor resources for use by an - instance. A cursor resource directly corresponds to a JET_TABLEID data type. - This setting will affect how many cursors can be used at the same time. A cursor - resource cannot be shared by different sessions so this parameter must be set to - a large enough value so that each session can use as many cursors as are required. - - - - - This parameter reserves the requested number of version store pages for use by an instance. - - - - - This parameter reserves the requested number of temporary table resources for use - by an instance. This setting will affect how many temporary tables can be used at - the same time. If this system parameter is set to zero then no temporary database - will be created and any activity that requires use of the temporary database will - fail. This setting can be useful to avoid the I/O required to create the temporary - database if it is known that it will not be used. - - - The use of a temporary table also requires a cursor resource. - - - - - This parameter will configure the size of the transaction log files. Each - transaction log file is a fixed size. The size is equal to the setting of - this system parameter in units of 1024 bytes. - - - - - This parameter will configure the amount of memory used to cache log records - before they are written to the transaction log file. The unit for this - parameter is the sector size of the volume that holds the transaction log files. - The sector size is almost always 512 bytes, so it is safe to assume that size - for the unit. This parameter has an impact on performance. When the database - engine is under heavy update load, this buffer can become full very rapidly. - A larger cache size for the transaction log file is critical for good update - performance under such a high load condition. The default is known to be too small - for this case. - Do not set this parameter to a number of buffers that is larger (in bytes) than - half the size of a transaction log file. - - - - - This parameter configures how transaction log files are managed by the database - engine. When circular logging is off, all transaction log files that are generated - are retained on disk until they are no longer needed because a full backup of the - database has been performed. When circular logging is on, only transaction log files - that are younger than the current checkpoint are retained on disk. The benefit of - this mode is that backups are not required to retire old transaction log files. - - - - - This parameter controls the amount of space that is added to a database file each - time it needs to grow to accommodate more data. The size is in database pages. - - - - - This parameter controls the initial size of the temporary database. The size is in - database pages. A size of zero indicates that the default size of an ordinary - database should be used. It is often desirable for small applications to configure - the temporary database to be as small as possible. Setting this parameter to - SystemParameters.PageTempDBSmallest will achieve the smallest temporary database possible. - - - - - This parameter configures the maximum size of the database page cache. The size - is in database pages. If this parameter is left to its default value, then the - maximum size of the cache will be set to the size of physical memory when JetInit - is called. - - - - - This parameter controls how aggressively database pages are flushed from the - database page cache to minimize the amount of time it will take to recover from a - crash. The parameter is a threshold in bytes for about how many transaction log - files will need to be replayed after a crash. If circular logging is enabled using - JET_param.CircularLog then this parameter will also control the approximate amount - of transaction log files that will be retained on disk. - - - - - This parameter controls when the database page cache begins evicting pages from the - cache to make room for pages that are not cached. When the number of page buffers in the cache - drops below this threshold then a background process will be started to replenish that pool - of available buffers. This threshold is always relative to the maximum cache size as set by - JET_paramCacheSizeMax. This threshold must also always be less than the stop threshold as - set by JET_paramStopFlushThreshold. - - The distance height of the start threshold will determine the response time that the database - page cache must have to produce available buffers before the application needs them. A high - start threshold will give the background process more time to react. However, a high start - threshold implies a higher stop threshold and that will reduce the effective size of the - database page cache for modified pages (Windows 2000) or for all pages (Windows XP and later). - - - - - - This parameter controls when the database page cache ends evicting pages from the cache to make - room for pages that are not cached. When the number of page buffers in the cache rises above - this threshold then the background process that was started to replenish that pool of available - buffers is stopped. This threshold is always relative to the maximum cache size as set by - JET_paramCacheSizeMax. This threshold must also always be greater than the start threshold - as set by JET_paramStartFlushThreshold. - - The distance between the start threshold and the stop threshold affects the efficiency with - which database pages are flushed by the background process. A larger gap will make it - more likely that writes to neighboring pages may be combined. However, a high stop - threshold will reduce the effective size of the database page cache for modified - pages (Windows 2000) or for all pages (Windows XP and later). - - - - - - This parameter is the master switch that controls crash recovery for an instance. - If this parameter is set to "On" then ARIES style recovery will be used to bring all - databases in the instance to a consistent state in the event of a process or machine - crash. If this parameter is set to "Off" then all databases in the instance will be - managed without the benefit of crash recovery. That is to say, that if the instance - is not shut down cleanly using JetTerm prior to the process exiting or machine shutdown - then the contents of all databases in that instance will be corrupted. - - - - - This parameter can be used to control the size of the database page cache at run time. - Ordinarily, the cache will automatically tune its size as a function of database and - machine activity levels. If the application sets this parameter to zero, then the cache - will tune its own size in this manner. However, if the application sets this parameter - to a non-zero value then the cache will adjust itself to that target size. - - - - - When this parameter is true, every database is checked at JetAttachDatabase time for - indexes over Unicode key columns that were built using an older version of the NLS - library in the operating system. This must be done because the database engine persists - the sort keys generated by LCMapStringW and the value of these sort keys change from release to release. - If a primary index is detected to be in this state then JetAttachDatabase will always fail with - JET_err.PrimaryIndexCorrupted. - If any secondary indexes are detected to be in this state then there are two possible outcomes. - If AttachDatabaseGrbit.DeleteCorruptIndexes was passed to JetAttachDatabase then these indexes - will be deleted and JET_wrnCorruptIndexDeleted will be returned from JetAttachDatabase. These - indexes will need to be recreated by your application. If AttachDatabaseGrbit.DeleteCorruptIndexes - was not passed to JetAttachDatabase then the call will fail with JET_errSecondaryIndexCorrupted. - - - - - This parameter can be used to control which event log the database engine uses for its event log - messages. By default, all event log messages will go to the Application event log. If the registry - key name for another event log is configured then the event log messages will go there instead. - - - - - When this parameter is true, informational event log messages that would ordinarily be generated by - the database engine will be suppressed. - - - - - Configures the detail level of eventlog messages that are emitted - to the eventlog by the database engine. Higher numbers will result - in more detailed eventlog messages. - - - - - This parameter configures the minimum size of the database page cache. The size is in database pages. - - - - - This parameter represents a threshold relative to that controls - the discretionary use of version pages by the database engine. If the size of the version store exceeds - this threshold then any information that is only used for optional background tasks, such as reclaiming - deleted space in the database, is instead sacrificed to preserve room for transactional information. - - - - - This parameter configures the page size for the database. The page - size is the smallest unit of space allocation possible for a database - file. The database page size is also very important because it sets - the upper limit on the size of an individual record in the database. - - - Only one database page size is supported per process at this time. - This means that if you are in a single process that contains different - applications that use the database engine then they must all agree on - a database page size. - - - - - This parameter can be used to convert a JET_ERR into a string. - This should only be used with JetGetSystemParameter. - - - - - Configures the engine with a delegate. - This callback may be called for the following reasons: - , - or . See - for more information. This parameter cannot currently be retrieved. - - - - - This parameter controls the outcome of JetInit when the database - engine is configured to start using transaction log files on disk - that are of a different size than what is configured. Normally, - will successfully recover the databases - but will fail with - to indicate that the log file size is misconfigured. However, when - this parameter is set to true then the database engine will silently - delete all the old log files, start a new set of transaction log files - using the configured log file size. This parameter is useful when the - application wishes to transparently change its transaction log file - size yet still work transparently in upgrade and restore scenarios. - - - - - When this parameter is set to true then any folder that is missing in a file system path in use by - the database engine will be silently created. Otherwise, the operation that uses the missing file system - path will fail with JET_err.InvalidPath. - - - - - When this parameter is true then only one database is allowed to - be opened using JetOpenDatabase by a given session at one time. - The temporary database is excluded from this restriction. - - - - - This parameter controls the maximum number of instances that can be created in a single process. - - - - - This parameter controls the number of background cleanup work items that - can be queued to the database engine thread pool at any one time. - - - - - Type of an ESENT object. - - - - - Invalid object type. - - - - - Object is a table. - - - - - System parameters that have been added to the Vista version of ESENT. - - - - - This parameter controls the number of B+ Tree resources cached by - the instance after the tables they represent have been closed by - the application. Large values for this parameter will cause the - database engine to use more memory but will increase the speed - with which a large number of tables can be opened randomly by - the application. This is useful for applications that have a - schema with a very large number of tables. - - - - - This parameter exposes multiple sets of default values for the - entire set of system parameters. When this parameter is set to - a specific configuration, all system parameter values are reset - to their default values for that configuration. If the - configuration is set for a specific instance then global system - parameters will not be reset to their default values. - Small Configuration (0): The database engine is optimized for memory use. - Legacy Configuration (1): The database engine has its traditional defaults. - - - - - This parameter is used to control when the database engine accepts - or rejects changes to a subset of the system parameters. This - parameter is used in conjunction with to - prevent some system parameters from being set away from the selected - configuration's defaults. - - - - - This read-only parameter indicates the maximum allowable index key - length that can be selected for the current database page size - (as configured by ). - - - - - Set the name associated with table class 1. - - - - - Set the name associated with table class 2. - - - - - Set the name associated with table class 3. - - - - - Set the name associated with table class 4. - - - - - Set the name associated with table class 5. - - - - - Set the name associated with table class 6. - - - - - Set the name associated with table class 7. - - - - - Set the name associated with table class 8. - - - - - Set the name associated with table class 9. - - - - - Set the name associated with table class 10. - - - - - Set the name associated with table class 11. - - - - - Set the name associated with table class 12. - - - - - Set the name associated with table class 13. - - - - - Set the name associated with table class 14. - - - - - Set the name associated with table class 15. - - - - - Options for . - - - - - Default options. - - - - - The snapshot session aborted. - - - - - Options for . - - - - - Default options. - - - - - Options for - and . - - - - - No truncation will occur. - - - - - All the databases are attached so the storage engine can compute - and do the log truncation. - - - - - Options for . - - - - - Default options. - - - - - Information levels for . - - - - - Get the signature of the transaction log associated with this sequence. - - - - - Grbits that have been added to the Vista version of ESENT. - - - - - Specifying this flag for an index that has more than one key column - that is a multi-valued column will result in an index entry being - created for each result of a cross product of all the values in - those key columns. Otherwise, the index would only have one entry - for each multi-value in the most significant key column that is a - multi-valued column and each of those index entries would use the - first multi-value from any other key columns that are multi-valued columns. - - For example, if you specified this flag for an index over column - A that has the values "red" and "blue" and over column B that has - the values "1" and "2" then the following index entries would be - created: "red", "1"; "red", "2"; "blue", "1"; "blue", "2". Otherwise, - the following index entries would be created: "red", "1"; "blue", "1". - - - - - - Specifying this flag will cause any update to the index that would - result in a truncated key to fail with . - Otherwise, keys will be silently truncated. - - - - - Index over multiple multi-valued columns but only with values of same itagSequence. - - - - - The engine can mark the database headers as appropriate (for example, - a full backup completed), even though the call to truncate was not completed. - - - - - Perform recovery, but halt at the Undo phase. Allows whatever logs are present to - be replayed, then later additional logs can be copied and replayed. - - - - - On successful soft recovery, truncate log files. - - - - - Missing database map entry default to same location. - - - - - Transaction logs must exist in the log file directory - (i.e. can't auto-start a new stream). - - - - - The snapshot session continues after JetOSSnapshotThaw and will - require a JetOSSnapshotEnd function call. - - - - - Specifying this flag will cause the index to use the maximum key size - specified in the cbKeyMost field in the structure. Otherwise, the - index will use JET_cbKeyMost (255) as its maximum key size. - - - Set internally when the NATIVE_INDEXCREATE structure is generated. - - - - - LCID field of JET_INDEXCREATE actually points to a JET_UNICODEINDEX - struct to allow user-defined LCMapString() flags. - - - - - Enumerate columns in a table specified by dbid and name. - - - - - Base class for enumerators that return IndexInfo objects. Subclasses differ - by how they open the table. - - - - - Initializes a new instance of the class. - - - The session to use. - - - - - Gets the entry the cursor is currently positioned on. - - The entry the cursor is currently positioned on. - - - - Create an IndexInfo object from the data in the current JET_INDEXLIST entry. - - The session to use. - The indexlist to take the data from. - An IndexInfo object containing the information from that record. - - - - Create an array of IndexSegment objects from the data in the current JET_INDEXLIST entry. - - The session to use. - The indexlist to take the data from. - An array of IndexSegment objects containing the information for the current index. - - - - Gets or sets the indexlist used to retrieve data. - - - - - The database containing the table. - - - - - The name of the table. - - - - - Initializes a new instance of the class. - - - The session to use. - - - The database containing the table. - - - The name of the table. - - - - - Open the table to be enumerated. This should set . - - - - - System parameters that have been added to the Windows Server 2003 version of ESENT. - - - - - The full path to each database is persisted in the transaction logs - at run time. Ordinarily, these databases must remain at the original - location for transaction replay to function correctly. This - parameter can be used to force crash recovery or a restore operation - to look for the databases referenced in the transaction log in the - specified folder. - - - - - The native version of the JET_SPACEHINTS structure. - - - - - Size of the structure. - - - - - Density at (append) layout. - - - - - Initial size (in bytes). - - - - - Space hints options. - - - - - Density to maintain at. - - - - - Percent growth from last growth or initial size (possibly rounded to nearest native JET allocation size). - - - - - Overrides ulGrowth if too small. - - - - - Cap of ulGrowth. - - - - - Describes a column in a table of an ESENT database. - - - - - Density at (append) layout. - - - - - Initial size (in bytes). - - - - - Space hints options. - - - - - Density to maintain at. - - - - - Percent growth from last growth or initial size (possibly rounded to nearest native JET allocation size). - - - - - Overrides ulGrowth if too small. - - - - - Cap of ulGrowth. - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - Generate a string representation of the instance. - - The structure as a string. - - - - Returns the unmanaged columncreate that represents this managed class. - - A native (interop) version of the JET_SPACEHINTS. - - - - Sets the fields of the object from a native JET_SPACEHINTS struct. - - - The native columncreate to set the values from. - - - - - Gets or sets the density at (append) layout. - - - - - Gets or sets the initial size (in bytes). - - - - - Gets or sets the space hints options. - - - - - Gets or sets the density at which to maintain. - - - - - Gets or sets the percent growth from last growth or initial size (possibly rounded - to nearest native JET allocation size). - Valid values are 0, and [100, 50000). - - - - - Gets or sets the value that overrides ulGrowth if too small. This value is in bytes. - - - - - Gets or sets the value that sets the ceiling of ulGrowth. This value is in bytes. - - - - - An column value. - - - - - Recursive SetColumns method for data pinning. This populates the buffer and - calls the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - The JET_SIGNATURE structure contains information that uniquely - identifies a database or logfile sequence. - - - - - A randomly assigned number. - - - - - The time that the database or first logfile in the sequence was - created. - - - - - NetBIOS name of the computer. This may be null. - - - - - Initializes a new instance of the struct. - - A random number. - The time for the creation time. - The optional computer name. - - - - Initializes a new instance of the struct. - - A native signature to initialize the members with. - - - - Determines whether two specified instances of JET_SIGNATURE - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_SIGNATURE - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Generate a string representation of the structure. - - The structure as a string. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Convrts the structure to the native representation. - - The native representation of the signature. - - - - Native (interop) version of the JET_SIGNATURE structure. - - - - - Size of the szComputerName array. - - - - - The size of a NATIVE_SIGNATURE structure. - - - - - A random number. - - - - - Time the database or log sequence was created. - - - - - NetBIOS name of the computer. - - - - - A cache for boxed values. - - The type of object to cache. - - - - Number of boxed values to cache. - - - - - Cached boxed values. - - - - - Gets a boxed version of the value. A cached copy is used if possible. - - The value to box. - A boxed version of the value. - - - - A column value. - - - - - A boxed true value that can be used by ValueAsObject. - - - - - A boxed false value that can be used by ValueAsObject. - - - - - Recursive SetColumns method for data pinning. This populates the buffer and - calls the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Gets the last set or retrieved value of the column. The - value is returned as a generic object. - - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - Native interop for functions in esent.dll. - - - Configuration for functions in esent.dll. - - - - - The CharSet for the methods in the DLL. - - - - - The name of the DLL that the methods should be loaded from. - - - - - Initializes static members of the NativeMethods class. - - - - - Gets encoding to be used when converting data to/from byte arrays. - This should match the CharSet above. - - - - - Describes one segment of an index. - - - - - The name of the column. - - - - - The type of the column. - - - - - True if the column is sorted in ascending order. - - - - - True if the column is an ASCII column. - - - - - Initializes a new instance of the IndexSegment class. - - The name of the indexed column. - The type of the column. - True if the column is ascending. - True if the column is over an ASCII column. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Generate a string representation of the instance. - - The structure as a string. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets name of the column being indexed. - - - - - Gets the type of the column being indexed. - - - - - Gets a value indicating whether the index segment is ascending. - - - - - Gets a value indicating whether the index segment is over an ASCII text - column. This value is only meaningful for text column segments. - - - - - The native version of the JET_CONDITIONALCOLUMN structure. - - - - - Size of the structure. - - - - - Name of the column. - - - - - Conditional column option. - - - - - Defines how conditional indexing is performed for a given index. A - conditional index contains an index entry for only those rows that - match the specified condition. However, the conditional column is not - part of the index's key, it only controls the presence of the index entry. - - - - - Column name. - - - - - Conditional column option. - - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - Generate a string representation of the instance. - - The structure as a string. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets the NATIVE_CONDITIONALCOLUMN version of this object. - - A NATIVE_CONDITIONALCOLUMN for this object. - - - - Gets or sets the name of the conditional column. - - - - - Gets or sets the options for the conditional index. - - - - - Enumerate columns in a table specified by a tableid. - - - - - The table to get the column information from. - - - - - Initializes a new instance of the class. - - - The session to use. - - - The table to get column information from. - - - - - Open the table to be enumerated. This should set . - - - - - Info levels for retrieving table info with JetGetTableInfo. - - - - - Default option. Retrieves a containing - information about the table. Use this option with - . - - - - - Retrieves the name of the table. Use this option with - . - - - - - Retrieves the of the database containing the - table. Use this option with - . - - - - - The behavior of the method depends on how large the array that is passed - to the method is. The array must have at least two entries. - The first entry will contain the number of Owned Extents in the table. - The second entry will contain the number of Available Extents in the table. - If the array has more than two entries then the remaining bytes of - the buffer will consist of an array of structures that represent a list of - extents. This structure contains two members: the last page number in the - extent and the number of pages in the extent. Use this option with - . - - - - - The array passed to JetGetTableInfo must have two entries. - The first entry will be set to the number of pages in the table. - The second entry will be set to the target density of pages for the table. - Use this option with - . - - - - - Gets the number of owned pages in the table. Use this option with - . - - - - - Gets the number of available pages in the table. Use this option with - . - - - - - If the table is a derived table, the result will be filled in with the - name of the table from which the derived table inherited its DDL. If - the table is not a derived table, the buffer will an empty string. - Use this option with - . - - - - - Describes a date/time. - - - - - Interface for common methods between JET_LOGTIME and JET_BKLOGTIME. - - - - - Generate a DateTime representation of this IJET_LOGTIME. - - - A DateTime representing the IJET_LOGTIME. If the IJET_LOGTIME - is null then null is returned. - - - - - The time in seconds. This value can be 0 to 59. - - - - - The time in minutes. This value can be 0 to 59. - - - - - The time in hours. This value can be 0 to 23. - - - - - The day of the month. This value can be 0 to 31. 0 is - used when the structure is null. - - - - - The month. This value can be 0 to 12. 0 is - used when the structure is null. - - - - - The year of the event, offset by 1900. - - - - - This field is ignored. - - - - - This field is ignored. - - - - - Initializes a new instance of the struct. - - - The DateTime to intialize the structure with. - - - - - Determines whether two specified instances of JET_LOGTIME - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_LOGTIME - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Generate a DateTime representation of this JET_LOGTIME. - - - A DateTime representing the JET_LOGTIME. If the JET_LOGTIME - is null then null is returned. - - - - - Generate a string representation of the structure. - - The structure as a string. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets a value indicating whether the JET_LOGTIME has a null value. - - - - - Gets a value indicating whether the JET_LOGTIME is in UTC. - - - - - ESENT APIs that were first supported in Windows 7 (Windows Server 2008 R2). - - - - - Crash dump options for Watson. - - Crash dump options. - - - - If the records with the specified keys are not in the buffer cache - then start asynchronous reads to bring the records into the database - buffer cache. - - The session to use. - The table to issue the prereads against. - - The keys to preread. The keys must be sorted. - - The lengths of the keys to preread. - - The index of the first key in the keys array to read. - - - The maximum number of keys to preread. - - - Returns the number of keys to actually preread. - - - Preread options. Used to specify the direction of the preread. - - - - - If the records with the specified keys are not in the buffer cache - then start asynchronous reads to bring the records into the database - buffer cache. - - The session to use. - The table to issue the prereads against. - - The keys to preread. The keys must be sorted. - - The lengths of the keys to preread. - - The maximum number of keys to preread. - - - Returns the number of keys to actually preread. - - - Preread options. Used to specify the direction of the preread. - - - - - This class provides a streaming interface to a long-value column - (i.e. a column of type or - ). - - - - - The size of the biggest long-value column ESENT supports. - - - - - Session to use. - - - - - Cursor to use. - - - - - Columnid to use. - - - - - Current LV offset. - - - - - Initializes a new instance of the ColumnStream class. - - The session to use. - The cursor to use. - The columnid of the column to set/retrieve data from. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Flush the stream. - - - - - Writes a sequence of bytes to the current stream and advances the current - position within this stream by the number of bytes written. - - The buffer to write from. - The offset in the buffer to write. - The number of bytes to write. - - - - Reads a sequence of bytes from the current stream and advances the - position within the stream by the number of bytes read. - - The buffer to read into. - The offset in the buffer to read into. - The number of bytes to read. - The number of bytes read into the buffer. - - - - Sets the length of the stream. - - The desired length, in bytes. - - - - Sets the position in the current stream. - - Byte offset relative to the origin parameter. - A SeekOrigin indicating the reference point for the new position. - The new position in the current stream. - - - - Check the buffer arguments given to Read/Write . - - The buffer. - The offset in the buffer to read/write to. - The number of bytes to read/write. - - - - Gets or sets the itag of the column. - - - - - Gets a value indicating whether the stream supports reading. - - - - - Gets a value indicating whether the stream supports writing. - - - - - Gets a value indicating whether the stream supports seeking. - - - - - Gets or sets the current position in the stream. - - - - - Gets the current length of the stream. - - - - - Gets the options that should be used with JetRetrieveColumn. - - - - - This class provides properties to set and get system parameters - on an ESENT instance. - - - - - The instance to set parameters on. - - - - - The session to set parameters with. - - - - - Initializes a new instance of the InstanceParameters class. - - - The instance to set parameters on. If this is JET_INSTANCE.Nil, - then the settings affect the default settings of future instances. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Set a system parameter which is a string. - - The parameter to set. - The value to set. - - - - Get a system parameter which is a string. - - The parameter to get. - The value of the parameter. - - - - Set a system parameter which is an integer. - - The parameter to set. - The value to set. - - - - Get a system parameter which is an integer. - - The parameter to get. - The value of the parameter. - - - - Set a system parameter which is a boolean. - - The parameter to set. - The value to set. - - - - Get a system parameter which is a boolean. - - The parameter to get. - The value of the parameter. - - - - Gets or sets the relative or absolute file system path of the - folder that will contain the checkpoint file for the instance. - - - - - Gets or sets the relative or absolute file system path of - the folder that will contain the temporary database for the instance. - - - - - Gets or sets the relative or absolute file system path of the - folder that will contain the transaction logs for the instance. - - - - - Gets or sets the relative or absolute file system path of the - a folder where crash recovery or a restore operation can find - the databases referenced in the transaction log in the - specified folder. - - - This parameter is ignored on Windows XP. - - - - - Gets or sets the three letter prefix used for many of the files used by - the database engine. For example, the checkpoint file is called EDB.CHK by - default because EDB is the default base name. - - - - - Gets or sets an application specific string that will be added to - any event log messages that are emitted by the database engine. This allows - easy correlation of event log messages with the source application. By default - the host application executable name will be used. - - - - - Gets or sets the number of sessions resources reserved for this instance. - A session resource directly corresponds to a JET_SESID. - - - - - Gets or sets the number of B+ Tree resources reserved for this instance. - - - - - Gets or sets the number of cursor resources reserved for this instance. - A cursor resource directly corresponds to a JET_TABLEID. - - - - - Gets or sets the maximum number of version store pages reserved - for this instance. - - - - - Gets or sets the preferred number of version store pages reserved - for this instance. If the size of the version store exceeds this - threshold then any information that is only used for optional - background tasks, such as reclaiming deleted space in the database, - is instead sacrificed to preserve room for transactional information. - - - - - Gets or sets the the number of background cleanup work items that - can be queued to the database engine thread pool at any one time. - - - - - Gets or sets the number of temporary table resources for use - by an instance. This setting will affect how many temporary tables can be used at - the same time. If this system parameter is set to zero then no temporary database - will be created and any activity that requires use of the temporary database will - fail. This setting can be useful to avoid the I/O required to create the temporary - database if it is known that it will not be used. - - - The use of a temporary table also requires a cursor resource. - - - - - Gets or sets the size of the transaction log files. This parameter - should be set in units of 1024 bytes (e.g. a setting of 2048 will - give 2MB logfiles). - - - - - Gets or sets the amount of memory used to cache log records - before they are written to the transaction log file. The unit for this - parameter is the sector size of the volume that holds the transaction log files. - The sector size is almost always 512 bytes, so it is safe to assume that size - for the unit. This parameter has an impact on performance. When the database - engine is under heavy update load, this buffer can become full very rapidly. - A larger cache size for the transaction log file is critical for good update - performance under such a high load condition. The default is known to be too small - for this case. - Do not set this parameter to a number of buffers that is larger (in bytes) than - half the size of a transaction log file. - - - - - Gets or sets a value indicating whether circular logging is on. - When circular logging is off, all transaction log files that are generated - are retained on disk until they are no longer needed because a full backup of the - database has been performed. When circular logging is on, only transaction log files - that are younger than the current checkpoint are retained on disk. The benefit of - this mode is that backups are not required to retire old transaction log files. - - - - - Gets or sets a value indicating whether JetInit fails when the database - engine is configured to start using transaction log files on disk - that are of a different size than what is configured. Normally, - will successfully recover the databases - but will fail with - to indicate that the log file size is misconfigured. However, when - this parameter is set to true then the database engine will silently - delete all the old log files, start a new set of transaction log files - using the configured log file size. This parameter is useful when the - application wishes to transparently change its transaction log file - size yet still work transparently in upgrade and restore scenarios. - - - - - Gets or sets the initial size of the temporary database. The size is in - database pages. A size of zero indicates that the default size of an ordinary - database should be used. It is often desirable for small applications to configure - the temporary database to be as small as possible. Setting this parameter to - will achieve the smallest - temporary database possible. - - - - - Gets or sets the threshold in bytes for about how many transaction log - files will need to be replayed after a crash. If circular logging is enabled using - CircularLog then this parameter will also control the approximate amount - of transaction log files that will be retained on disk. - - - - - Gets or sets the number of pages that are added to a database file each - time it needs to grow to accommodate more data. - - - - - Gets or sets a value indicating whether crash recovery is on. - - - - - Gets or sets a value indicating whether JetAttachDatabase will check for - indexes that were build using an older version of the NLS library in the - operating system. - - - - - Gets or sets the name of the event log the database engine uses for its event log - messages. By default, all event log messages will go to the Application event log. If the registry - key name for another event log is configured then the event log messages will go there instead. - - - - - Gets or sets a value indicating whether informational event - log messages that would ordinarily be generated by the - database engine will be suppressed. - - - - - Gets or sets a value indicating whether only one database is allowed to - be opened using JetOpenDatabase by a given session at one time. - The temporary database is excluded from this restriction. - - - - - Gets or sets a value indicating whether ESENT will silently create folders - that are missing in its filesystem paths. - - - - - Gets or sets a value giving the number of B+ Tree resources cached by - the instance after the tables they represent have been closed by - the application. Large values for this parameter will cause the - database engine to use more memory but will increase the speed - with which a large number of tables can be opened randomly by - the application. This is useful for applications that have a - schema with a very large number of tables. - - Supported on Windows Vista and up. Ignored on Windows XP and - Windows Server 2003. - - - - - - Gets or sets a the number of logs that esent will defer database - flushes for. This can be used to increase database recoverability if - failures cause logfiles to be lost. - - Supported on Windows 7 and up. Ignored on Windows XP, - Windows Server 2003, Windows Vista and Windows Server 2008. - - - - - - The native version of the JET_INDEXRANGE structure. - - - - - Size of the structure. - - - - - Cursor containing the index range. - - - - - Index range options. - - - - - Create a NATIVE_INDEXRANGE from a cursor. - - The cursor containing the index range. - A new NATIVE_INDEXRANGE on the cursor. - - - - Identifies an index range when it is used with the JetIntersectIndexes function. - - - - - Initializes a new instance of the JET_INDEXRANGE class. - - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Get a NATIVE_INDEXRANGE structure representing the object. - - A NATIVE_INDEXRANGE whose members match the class. - - - - Gets or sets the cursor containing the index range. The cursor should have an - index range set with JetSetIndexRange. - - - - - Gets or sets the indexrange option. - - - - - The native version of the JET_INDEXCREATE structure. - - - - - Size of the structure. - - - - - Name of the index. - - - - - Index key description. - - - - - Size of index key description. - - - - - Index options. - - - - - Index density. - - - - - Pointer to unicode sort options. - - - - - Maximum size of column data to index. This can also be - a pointer to a JET_TUPLELIMITS structure. - - - - - Pointer to array of conditional columns. - - - - - Count of conditional columns. - - - - - Returned error from index creation. - - - - - The native version of the JET_INDEXCREATE structure. This version includes the cbKeyMost - member, which is only valid on Windows Vista and above, but the name of the structure - was not changed for Vista. - - - - - Nested NATIVE_INDEXCREATE structure. - - - - - Maximum size of the key. - - - - - The native version of the JET_INDEXCREATE2 structure. Introduced in Windows 7, - this includes a member. - - - - - Nested NATIVE_INDEXCREATE1 structure. - - - - - A pointer. - - - - - Contains the information needed to create an index over data in an ESE database. - - - - - Name of the index. - - - - - Index key. - - - - - Length of the index key. - - - - - Index options. - - - - - Index density. - - - - - Unicode comparison options. - - - - - Maximum length of a column to store in the index. - - - - - Conditional columns. - - - - - Number of conditional columns. - - - - - Error code from index creation. - - - - - Maximum length of index keys. - - - - - Space allocation, maintenance, and usage hints. - - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - Generate a string representation of the instance. - - The structure as a string. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Check this object to make sure its parameters are valid. - - - - - Gets the native (interop) version of this object, except for - and . - - The native (interop) version of this object. - - - - Gets the native (interop) version of this object, except for - and . - - The native (interop) version of this object. - - - - Gets the native (interop) version of this object. The following members - are not converted: - , , . - - The native (interop) version of this object. - - - - Returns a value indicating whether the pidxUnicode member of this - instance is equal to another instance. - - An instance to compare with this instance. - True if the pidxUnicode members of two instances are equal. - - - - Returns a value indicating whether the conditional column members of this - instance is equal to another instance. - - An instance to compare with this instance. - True if the conditional column members of two instances are equal. - - - - Gets or sets the error code from creating this index. - - - - - Gets or sets the name of the index to create. - - - - - Gets or sets the description of the index key. This is a double - null-terminated string of null-delimited tokens. Each token is - of the form [direction-specifier][column-name], where - direction-specification is either "+" or "-". for example, a - szKey of "+abc\0-def\0+ghi\0" will index over the three columns - "abc" (in ascending order), "def" (in descending order), and "ghi" - (in ascending order). - - - - - Gets or sets the length, in characters, of szKey including the two terminating nulls. - - - - - Gets or sets index creation options. - - - - - Gets or sets the density of the index. - - - - - Gets or sets the optional unicode comparison options. - - - - - Gets or sets the maximum length, in bytes, of each column to store in the index. - - - - - Gets or sets the optional conditional columns. - - - - - Gets or sets the number of conditional columns. - - - - - Gets or sets the maximum allowable size, in bytes, for keys in the index. - The minimum supported maximum key size is JET_cbKeyMostMin (255) which - is the legacy maximum key size. The maximum key size is dependent on - the database page size . The - maximum key size can be retrieved with . - - This parameter is ignored on Windows XP and Windows Server 2003. - - - Unlike the unmanaged API, - (JET_bitIndexKeyMost) is not needed, it will be added automatically. - - - - - - Gets or sets space allocation, maintenance, and usage hints. - - - - - Column info levels that have been added to the Vista version of ESENT. - - - - - Retrieve the JET_COLBASE using the column id. - - - - - For lists, only return non-derived columns (if the table is derived from a template). - - - - - For lists, only return the column name and columnid of each column. - - - - - For lists, sort returned column list by columnid (default is to sort list by column name). - - - - - A column value. - - - - - Recursive SetColumns method for data pinning. This populates the buffer and - calls the inherited SetColumns method. - - The session to use. - - The table to set the columns in. An update should be prepared. - - - Column values to set. - - - Structures to put the pinned data in. - - Offset of this object in the array. - An error code. - - - - Given data retrieved from ESENT, decode the data and set the value in the ColumnValue object. - - An array of bytes. - The starting position within the bytes. - The number of bytes to decode. - The error returned from ESENT. - - - - Gets the size of the value in the column. This returns 0 for - variable sized columns (i.e. binary and string). - - - - - Used by to return information about a record's usage - requirements in user data space, number of set columns, number of - values, and ESENT record structure overhead space. - - - - - User data in the record. - - - - - User data associated with the record, but in the LV tree. - - - - - Record overhead, including key size. - - - - - Overhead of storing the long-value data. - - - - - Number of fixed and variable columns. - - - - - Number of tagged columns in the record. - - - - - Number of extrinsic (separated) long values. - - - - - Number of multi-values (itag > 1) in the record. - - - - - Number of compressed columns in the record. - - - - - Size of user data after being compressed. - - - - - Size of the long value data after compression. - - - - - Add the sizes in two JET_RECSIZE structures. - - The first JET_RECSIZE. - The second JET_RECSIZE. - A JET_RECSIZE containing the result of adding the sizes in s1 and s2. - - - - Add the sizes in two JET_RECSIZE structures. - - The first JET_RECSIZE. - The second JET_RECSIZE. - A JET_RECSIZE containing the result of adding the sizes in left and right. - - - - Calculate the difference in sizes between two JET_RECSIZE structures. - - The first JET_RECSIZE. - The second JET_RECSIZE. - A JET_RECSIZE containing the difference in sizes between s1 and s2. - - - - Calculate the difference in sizes between two JET_RECSIZE structures. - - The first JET_RECSIZE. - The second JET_RECSIZE. - A JET_RECSIZE containing the difference in sizes between left and right. - - - - Determines whether two specified instances of JET_RECSIZE - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_RECSIZE - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Sets the fields of the object from a NATIVE_RECSIZE struct. - - - The native recsize to set the values from. - - - - - Sets the fields of the object from a NATIVE_RECSIZE2 struct. - - - The native recsize to set the values from. - - - - - Gets a NATIVE_RECSIZE containing the values in this object. - - - A NATIVE_RECSIZE initialized with the values in the object. - - - - - Gets a NATIVE_RECSIZE2 containing the values in this object. - - - A NATIVE_RECSIZE2 initialized with the values in the object. - - - - - Gets the user data set in the record. - - - - - Gets the user data set in the record, but stored in the long-value tree. - - - - - Gets the overhead of the ESENT record structure for this record. - This includes the record's key size. - - - - - Gets the overhead of the long-value data. - - - - - Gets the total number of fixed and variable columns set in this record. - - - - - Gets the total number of tagged columns set in this record. - - - - - Gets the total number of long values stored in the long-value tree - for this record. This does not include intrinsic long values. - - - - - Gets the accumulation of the total number of values beyond the first - for all columns in the record. - - - - - Gets the total number of columns in the record which are compressed. - - - - - Gets the compressed size of user data in record. This is the same - as if no intrinsic long-values are compressed). - - - - - Gets the compressed size of user data in the long-value tree. This is - the same as if no separated long values - are compressed. - - - - - The native version of the JET_RECSIZE structure. - - - - - User data in record. - - - - - User data associated with the record but stored in the long-value - tree. Does NOT count intrinsic long-values. - - - - - Record overhead. - - - - - Overhead of long-value data. Does not count intrinsic long-values. - - - - - Total number of fixed/variable columns. - - - - - Total number of tagged columns. - - - - - Total number of values stored in the long-value tree for this record. - Does NOT count intrinsic long-values. - - - - - Total number of values beyond the first for each column in the record. - - - - - The native version of the JET_RECSIZE2 structure. - - - - - User data in record. - - - - - User data associated with the record but stored in the long-value - tree. Does NOT count intrinsic long-values. - - - - - Record overhead. - - - - - Overhead of long-value data. Does not count intrinsic long-values. - - - - - Total number of fixed/variable columns. - - - - - Total number of tagged columns. - - - - - Total number of values stored in the long-value tree for this record. - Does NOT count intrinsic long-values. - - - - - Total number of values beyond the first for each column in the record. - - - - - Total number of columns which are compressed. - - - - - Compressed size of user data in record. Same as cbData if no intrinsic - long-values are compressed. - - - - - Compressed size of user data in the long-value tree. Same as - cbLongValue data if no separated long values are compressed. - - - - - Holds a collection of data about a specific backup event. - - - - - Current log position. - - - - - Time the backup was made. - - - - - Low log generation when the backup was made. - - - - - High log generation when the backup was made. - - - - - Determines whether two specified instances of JET_BKINFO - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_BKINFO - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Generate a string representation of the structure. - - The structure as a string. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets the log position of the backup. - - - - - Gets the time of the backup. - - - - - Gets the low generation of the backup. - - - - - Gets or sets the high generation of the backup. - - - - - Gets a value indicating whether this backup info is null. - - - - - ESENT column types. - - - - - Null column type. Invalid for column creation. - - - - - True, False or NULL. - - - - - 1-byte integer, unsigned. - - - - - 2-byte integer, signed. - - - - - 4-byte integer, signed. - - - - - 8-byte integer, signed. - - - - - 4-byte IEEE single-precisions. - - - - - 8-byte IEEE double-precision. - - - - - Integral date, fractional time. - - - - - Binary data, up to 255 bytes. - - - - - Text data, up to 255 bytes. - - - - - Binary data, up to 2GB. - - - - - Text data, up to 2GB. - - - - - Type of progress being reported. - - - - - Callback for the beginning of an operation. - - - - - Callback for operation progress. - - - - - Callback for the completion of an operation. - - - - - Callback for failure during the operation. - - - - - Callback for recovery control. - - - - - Table options, used in . - - - - - The table can have bookmarks. - - - - - The table can be rolled back. - - - - - The table can be updated. - - - - - Allocation type options for . - - - - - Commit the memory. - - - - - Reserve the memory. - - - - - Memory protection options for . - - - - - Read/write access to the pages. - - - - - Options for . - - - - - Release the memory. The pages will be in the free state. - - - - - P/Invoke methods for Win32 functions. - - - - - Throw an exception if the given pointer is null (IntPtr.Zero). - - The pointer to check. - The message for the exception. - - - - Throw an exception if the success code is not true. - - The success code. - The message for the exception. - - - - The native version of the structure. - - - - - Columnid to set. - - - - - Data to set. - - - - - Size of data to set. - - - - - SetColumns options. - - - - - Long-value offset to set. - - - - - Itag sequence to set. - - - - - Returns the error from setting the column. - - - - - Contains input and output parameters for . - Fields in the structure describe what column value to set, how to set it, - and where to get the column set data. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - Check to see if cbData is negative or greater than the length of pvData. - Check to see if ibData is negative or greater than the length of pvData. - - - - - Gets the NATIVE_SETCOLUMN structure that represents the object. - - A NATIVE_SETCOLUMN structure whose fields match the class. - - - - Gets or sets the column identifier for a column to set. - - - - - Gets or sets a pointer to the data to set. - - - - - Gets or sets the offset of the data to set. - - - - - Gets or sets the size of the data to set. - - - - - Gets or sets options for the set column operation. - - - - - Gets or sets offset to the first byte to be set in a column of type - or . - - - - - Gets or sets the sequence number of value in a multi-valued column to be set. The array of values is one-based. - The first value is sequence 1, not 0 (zero). If the record column has only one value then 1 should be passed - as the itagSequence if that value is being replaced. A value of 0 (zero) means to add a new column value instance - to the end of the sequence of column values. - - - - - Gets the error code or warning returned from the set column operation. - - - - - The native version of the JET_DBINFOMISC structure. - - - - - Version of Esent that created the database. - - - - - Incremental version of Esent that created the database. - - - - - Database signature. - - - - - Consistent/inconsistent state. - - - - - Null if in inconsistent state. - - - - - Null if in inconsistent state. - - - - - Last attach time. - - - - - Lgpos at last attach. - - - - - Last detach time. - - - - - Lgpos at last detach. - - - - - Logfile signature. - - - - - Last successful full backup. - - - - - Last successful incremental backup. Reset when - is set. - - - - - Current backup. - - - - - Internal use only. - - - - - Internal use only. - - - - - OS major version. - - - - - OS minor version. - - - - - OS build number. - - - - - OS Service Pack number. - - - - - Database page size (0 = 4Kb page). - - - - - Native version of the JET_DBINFOMISC structure. - Adds support for fields that we added in Windows 7. - - - - - The core dbinfo structure. - - - - - The minimum log generation required for replaying the logs. - Typically the checkpoint generation. - - - - - The maximum log generation required for replaying the logs. - - - - - Creation time of the logfile. - - - - - Number of times repair has been called on this database. - - - - - The last time that repair was run against this database. - - - - - Number of times this database was repaired before the last defrag. - - - - - Number of times a one bit error was successfully fixed. - - - - - The last time a one bit error was successfully fixed. - - - - - The number of times a one bit error was successfully fixed before the last repair. - - - - - Number of times an uncorrectable one bit error was encountered. - - - - - The last time an uncorrectable one bit error was encountered. - - - - - The number of times an uncorrectable one bit error was encountered. - - - - - Number of times a non-correctable checksum error was found. - - - - - The last time a non-correctable checksum error was found. - - - - - The number of times a non-correctable checksum error was found before the last repair. - - - - - The maximum log generation committed to the database. Typically the current log generation. - - - - - Last successful copy backup. - - - - - Last successful differential backup. Reset when - bkinfoFullPrev is set. - - - - - Holds miscellaneous information about a database. This is - the information that is contained in the database header. - - - - - Version of Esent that created the database. - - - - - Incremental version of Esent that created the database. - - - - - Database signature. - - - - - Consistent/inconsistent state. - - - - - Null if in inconsistent state. - - - - - Null if in inconsistent state. - - - - - Last attach time. - - - - - Lgpos at last attach. - - - - - Last detach time. - - - - - Lgpos at last detach. - - - - - Logfile signature. - - - - - Last successful full backup. - - - - - Last successful incremental backup. Reset when - is set. - - - - - Current backup. - - - - - Internal use only. - - - - - Internal use only. - - - - - OS major version. - - - - - OS minor version. - - - - - OS build number. - - - - - OS Service Pack number. - - - - - Database page size (0 = 4Kb page). - - - - - The minimum log generation required for replaying the logs. - Typically the checkpoint generation. - - - - - The maximum log generation required for replaying the logs. - - - - - Creation time of the logfile. - - - - - Number of times repair has been called on this database. - - - - - The last time that repair was run against this database. - - - - - Number of times this database was repaired before the last defrag. - - - - - Number of times a one bit error was successfully fixed. - - - - - The last time a one bit error was successfully fixed. - - - - - The number of times a one bit error was successfully fixed before the last repair. - - - - - Number of times an uncorrectable one bit error was encountered. - - - - - The last time an uncorrectable one bit error was encountered. - - - - - The number of times an uncorrectable one bit error was encountered. - - - - - Number of times a non-correctable checksum error was found. - - - - - The last time a non-correctable checksum error was found. - - - - - The number of times a non-correctable checksum error was found before the last repair. - - - - - The maximum log generation committed to the database. Typically the current log generation. - - - - - Last successful copy backup. - - - - - Last successful differential backup. Reset when - is set. - - - - - Gets a string representation of this object. - - A string representation of this object. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - True if the specified is equal to the current ; otherwise, false. - - - - - Indicates whether the current object is equal to another object of the same type. - - An object to compare with this object. - - True if the current object is equal to the parameter; otherwise, false. - - - - - Sets the members of this object from a native object. - - The native object. - - - - Sets the members of this object from a native object. - - The native object. - - - - Calculates the native version of the structure. - - The native version of the structure. - - - - Calculates the native version of the structure. - - The native version of the structure. - - - - Gets the version of Esent that created the database. - - - - - Gets the incremental version of Esent that created the database. - - - - - Gets the database signature. - - - - - Gets the consistent/inconsistent state of the database. - - - - - Gets the lgpos when the database was made consistent. - This value is null if the database is inconsistent. - - - - - Gets the time when the database was made consistent. - This value is null if the database is inconsistent. - - - - - Gets the time when the database was attached. - - - - - Gets the lgpos of the last attach. - - - - - Gets the time of the last detach. - - - - - Gets the lgpos of the last detach. - - - - - Gets the logfile signature of logs used to modify the database. - - - - - Gets information about the last successful full backup. - - - - - Gets information about the last successful incremental backup. - This value is reset when is set. - - - - - Gets information about the current backup. - - - - - Gets a value indicating whether catalog shadowing is enabled. - This value is for internal use only. - - - - - Gets a value indicating whether the database is being upgraded. - This value is for internal use only. - - - - - Gets the OS major version from the last attach. - - - - - Gets the OS minor version from the last attach. - - - - - Gets the OS build number from the last attach. - - - - - Gets the OS Service Pack number from the last attach. - - - - - Gets the database page size. A value of 0 means 4Kb pages. - - - - - Gets the minimum log generation required for replaying the logs. - Typically the checkpoint generation. - - - - - Gets the maximum log generation required for replaying the logs. - - - - - Gets the creation time of the logfile. - - - - - Gets the number of times repair has been called on this database. - - - - - Gets the last time that repair was run against this database. - - - - - Gets the number of times this database was repaired before the last defrag. - - - - - Gets the number of times a one bit error was successfully fixed. - - - - - Gets the last time a one bit error was successfully fixed. - - - - - Gets the number of times a one bit error was successfully fixed before the last repair. - - - - - Gets the number of times an uncorrectable one bit error was encountered. - - - - - Gets the last time an uncorrectable one bit error was encountered. - - - - - Gets the number of times an uncorrectable one bit error was encountered. - - - - - Gets the number of times a non-correctable checksum error was found. - - - - - Gets the last time a non-correctable checksum error was found. - - - - - Gets the number of times a non-correctable checksum error was found before the last repair. - - - - - Gets the maximum log generation committed to the database. Typically the current log generation. - - - - - Gets information about the last successful copy backup. - - - - - Gets information about the last successful differential backup. Reset when - is set. - - - - - The native version of the JET_COLUMNCREATE structure. - - - - - Size of the structure. - - - - - Name of the column. - - - - - Type of the columnn. - - - - - The maximum length of this column (only relevant for binary and text columns). - - - - - Column options. - - - - - Default value (NULL if none). - - - - - Size of the default value. - - - - - Code page (for text columns only). - - - - - The returned column id. - - - - - The returned error code. - - - - - Describes a column in a table of an ESENT database. - - - - - Name of the column. - - - - - The type of the column. - - - - - Maximum size of the column. - - - - - Column options. - - - - - Default value (NULL if none). - - - - - Size of the default value. - - - - - The code page. Only valid for text columns. - - - - - Id of the column. Not serialized because it is an internal - value and shouldn't be persisted. - - - - - The returned error code. - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Returns a deep copy of the object. - - A deep copy of the object. - - - - Generate a string representation of the instance. - - The structure as a string. - - - - Check this object to make sure its parameters are valid. - - - - - Returns the unmanaged columncreate that represents this managed class. - , , , - and are not converted. - - A native (interop) version of the JET_COLUMNCREATE. - - - - Sets only the output fields of the object from a native JET_COLUMNCREATE struct, - specifically and . - - - The native columncreate to set the values from. - - - - - Gets or sets the name of the column to create. - - - - - Gets or sets type of the column. - - - - - Gets or sets the maximum length of the column. This is only meaningful for columns of - type , , and - . - - - - - Gets or sets the column options. - - - - - Gets or sets the default value (NULL if none). - - - - - Gets or sets the size of the default value. - - - - - Gets or sets code page of the column. This is only meaningful for columns of type - and . - - - - - Gets the columnid of the column. - - - - - Gets or sets the error code from creating this column. - - - - - Options for . - - - - - Default options. - - - - - Options for . - - - - - Default options. - - - - - This flag causes the update to return an error if the update would - not have been possible in the Windows 2000 version of ESE, which - enforced a smaller maximum number of multi-valued column instances - in each record than later versions of ESE. This is important only - for applications that wish to replicate data between applications - hosted on Windows 2000 and applications hosted on Windows - 2003, or later versions of ESE. It should not be necessary for most - applications. - - - - - Grbits that have been added to the Windows Server 2003 version of ESENT. - - - - - This option requests that the temporary table only be created if the - temporary table manager can use the implementation optimized for - intermediate query results. If any characteristic of the temporary - table would prevent the use of this optimization then the operation - will fail with JET_errCannotMaterializeForwardOnlySort. A side effect - of this option is to allow the temporary table to contain records - with duplicate index keys. See - for more information. - - - - - If a given column is not present in the record and it has a user - defined default value then no column value will be returned. - This option will prevent the callback that computes the user defined - default value for the column from being called when enumerating - the values for that column. - - - This option is only available for Windows Server 2003 SP1 and later - operating systems. - - - - - All transactions previously committed by any session that have not - yet been flushed to the transaction log file will be flushed immediately. - This API will wait until the transactions have been flushed before - returning to the caller. This option may be used even if the session - is not currently in a transaction. This option cannot be used in - combination with any other option. - - - - - A JET_INSTANCE contains a handle to the instance of the database to use for calls to the JET Api. - - - - - The native value. - - - - - Determines whether two specified instances of JET_INSTANCE - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_INSTANCE - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Generate a string representation of the structure. - - The structure as a string. - - - - Formats the value of the current instance using the specified format. - - - A containing the value of the current instance in the specified format. - - The specifying the format to use. - -or- - null to use the default format defined for the type of the implementation. - - The to use to format the value. - -or- - null to obtain the numeric format information from the current locale setting of the operating system. - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets a null JET_INSTANCE. - - - - - A JET_SESID contains a handle to the session to use for calls to the JET Api. - - - - - The native value. - - - - - Determines whether two specified instances of JET_SESID - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_SESID - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Generate a string representation of the structure. - - The structure as a string. - - - - Formats the value of the current instance using the specified format. - - - A containing the value of the current instance in the specified format. - - The specifying the format to use. - -or- - null to use the default format defined for the type of the implementation. - - The to use to format the value. - -or- - null to obtain the numeric format information from the current locale setting of the operating system. - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets a null JET_SESID. - - - - - A JET_TABLEID contains a handle to the database cursor to use for a call to the JET Api. - A cursor can only be used with the session that was used to open that cursor. - - - - - The native value. - - - - - Determines whether two specified instances of JET_TABLEID - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_TABLEID - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Generate a string representation of the structure. - - The structure as a string. - - - - Formats the value of the current instance using the specified format. - - - A containing the value of the current instance in the specified format. - - The specifying the format to use. - -or- - null to use the default format defined for the type of the implementation. - - The to use to format the value. - -or- - null to obtain the numeric format information from the current locale setting of the operating system. - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets a null JET_TABLEID. - - - - - A JET_DBID contains the handle to the database. A database handle is used to manage the - schema of a database. It can also be used to manage the tables inside of that database. - - - - - The native value. - - - - - Determines whether two specified instances of JET_DBID - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_DBID - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Generate a string representation of the structure. - - The structure as a string. - - - - Formats the value of the current instance using the specified format. - - - A containing the value of the current instance in the specified format. - - The specifying the format to use. - -or- - null to use the default format defined for the type of the implementation. - - The to use to format the value. - -or- - null to obtain the numeric format information from the current locale setting of the operating system. - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets a null JET_DBID. - - - - - A JET_COLUMNID identifies a column within a table. - - - - - The native value. - - - - - Determines whether two specified instances of JET_COLUMNID - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_COLUMNID - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Determine whether one columnid is before another columnid. - - The first columnid to compare. - The second columnid to compare. - True if lhs comes before rhs. - - - - Determine whether one columnid is after another columnid. - - The first columnid to compare. - The second columnid to compare. - True if lhs comes after rhs. - - - - Determine whether one columnid is before or equal to - another columnid. - - The first columnid to compare. - The second columnid to compare. - True if lhs comes before or is equal to rhs. - - - - Determine whether one columnid is after or equal to - another columnid. - - The first columnid to compare. - The second columnid to compare. - True if lhs comes after or is equal to rhs. - - - - Generate a string representation of the structure. - - The structure as a string. - - - - Formats the value of the current instance using the specified format. - - - A containing the value of the current instance in the specified format. - - The specifying the format to use. - -or- - null to use the default format defined for the type of the implementation. - - The to use to format the value. - -or- - null to obtain the numeric format information from the current locale setting of the operating system. - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Compares this columnid to another columnid and determines - whether this instance is before, the same as or after the other - instance. - - The columnid to compare to the current instance. - - A signed number indicating the relative positions of this instance and the value parameter. - - - - - Gets a null JET_COLUMNID. - - - - - A JET_OSSNAPID contains a handle to a snapshot of a database. - - - - - The native value. - - - - - Determines whether two specified instances of JET_OSSNAPID - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_OSSNAPID - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Generate a string representation of the structure. - - The structure as a string. - - - - Formats the value of the current instance using the specified format. - - - A containing the value of the current instance in the specified format. - - The specifying the format to use. - -or- - null to use the default format defined for the type of the implementation. - - The to use to format the value. - -or- - null to obtain the numeric format information from the current locale setting of the operating system. - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets a null JET_OSSNAPID. - - - - - A JET_HANDLE contains a generic handle. - - - - - The native value. - - - - - Determines whether two specified instances of JET_HANDLE - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_HANDLE - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Generate a string representation of the structure. - - The structure as a string. - - - - Formats the value of the current instance using the specified format. - - - A containing the value of the current instance in the specified format. - - The specifying the format to use. - -or- - null to use the default format defined for the type of the implementation. - - The to use to format the value. - -or- - null to obtain the numeric format information from the current locale setting of the operating system. - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets a null JET_HANDLE. - - - - - Local storage for an ESENT handle. Used by - and . - - - - - The null handle. - - - - - Determines whether two specified instances of JET_LS - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_LS - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Generate a string representation of the structure. - - The structure as a string. - - - - Formats the value of the current instance using the specified format. - - - A containing the value of the current instance in the specified format. - - The specifying the format to use. - -or- - null to use the default format defined for the type of the implementation. - - The to use to format the value. - -or- - null to obtain the numeric format information from the current locale setting of the operating system. - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets or sets the value of the handle. - - - - - Holds an index ID. An index ID is a hint that is used to accelerate the - selection of the current index using JetSetCurrentIndex. It is most - useful when there is a very large number of indexes over a table. The - index ID can be retrieved using JetGetIndexInfo or JetGetTableIndexInfo. - - - The Pack attribute is necessary because the C++ version is defined as - a byte array. If the C# compiler inserts the usual padding between the IntPtr - and uint, then the structure ends up too large. - - - - - Size of the structure. - - - - - Internal use only. - - - - - Internal use only. - - - - - Internal use only. - - - - - The size of a JET_INDEXID structure. - - - - - Determines whether two specified instances of JET_INDEXID - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_INDEXID - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Generate a string representation of the structure. - - The structure as a string. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets the size of a JET_INDEXINDEXID structure. - - - - - A class that encapsulates a JET_SESID in a disposable object. - - - - - The underlying JET_SESID. - - - - - Initializes a new instance of the Session class. A new - JET_SESSION is allocated from the given instance. - - The instance to start the session in. - - - - Implicit conversion operator from a Session to a JET_SESID. This - allows a Session to be used with APIs which expect a JET_SESID. - - The session to convert. - The JET_SESID of the session. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Terminate the session. - - - - - Free the underlying JET_SESID. - - - - - Gets the JET_SESID that this session contains. - - - - - The native version of the JET_INDEXLIST structure. - - - - - Size of the structure. - - - - - Tableid of the temporary table. - - - - - Number of records in the table. - - - - - Id of the column containing the name of the index. - - - - - Id of the column containing index options. - - - - - Id of the column containing the number of unique keys in the index. - This is updated by . - - - - - Id of the column containing the number of entries in the index. - This is updated by . - - - - - Id of the column containing the number of pages in the index. - This is updated by . - - - - - Id of the column containing the number of columns in the index - definition. - - - - - Id of the column storing the index of this column in the index key. - - - - - Id of the column containing the columnid. - - - - - Id of the column containing the column type. - - - - - Id of the column containing the country code (obsolete). - - - - - Id of the column containing the LCID of the index. - - - - - Id of the column containing the code page of the index. - - - - - Obsolete. Ignored. - - - - - Id of the column giving the column options. - - - - - Id of the column giving the column name. - - - - - Id of the column giving the LCMapString options. - - - - - Information about a temporary table containing information - about all indexes for a given table. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Sets the fields of the object from a native JET_INDEXLIST struct. - - - The native indexlist to set the values from. - - - - - Gets tableid of the temporary table. This should be closed - when the table is no longer needed. - - - - - Gets the number of records in the temporary table. - - - - - Gets the columnid of the column in the temporary table which - stores the name of the index. - The column is of type JET_coltyp.Text. - - - - - Gets the columnid of the column in the temporary table which - stores the the grbits used on the index. See . - The column is of type JET_coltyp.Long. - - - - - Gets the columnid of the column in the temporary table which - stores the number of unique keys in the index. - This value is not current and is only is updated by . - The column is of type JET_coltyp.Long. - - - - - Gets the columnid of the column in the temporary table which - stores the number of entries in the index. - This value is not current and is only is updated by . - The column is of type JET_coltyp.Long. - - - - - Gets the columnid of the column in the temporary table which - stores the number of pages in the index. - This value is not current and is only is updated by . - The column is of type JET_coltyp.Long. - - - - - Gets the columnid of the column in the temporary table which - stores the number of columns in the index key. - The column is of type JET_coltyp.Long. - - - - - Gets the columnid of the column in the temporary table which - stores the index of of this column in the index key. - The column is of type JET_coltyp.Long. - - - - - Gets the columnid of the column in the temporary table which - stores the columnid of the column being indexed. - The column is of type JET_coltyp.Long. - - - - - Gets the columnid of the column in the temporary table which - stores the column type of the column being indexed. - The column is of type JET_coltyp.Long. - - - - - Gets the columnid of the column in the temporary table which - stores the language id (LCID) of the index. - The column is of type JET_coltyp.Short. - - - - - Gets the columnid of the column in the temporary table which - stores the code page of the indexed column. - The column is of type JET_coltyp.Short. - - - - - Gets the columnid of the column in the temporary table which - stores the grbit that apply to the indexed column. See . - The column is of type JET_coltyp.Long. - - - - - Gets the columnid of the column in the temporary table which - stores the grbit that apply to the indexed column. See . - The column is of type JET_coltyp.Text. - - - - - Gets the columnid of the column in the temporary table which - stores the unicode normalization flags for the index. - The column is of type JET_coltyp.Long. - - - - - Native (unmanaged) version of the JET_ENUMCOLUMNVALUE class. - - - - - The column value that was enumerated. - - - - - Error or warning from the enumeration. - - - - - Size of returned data. - - - - - Pointer to returned data. - - - - - Enumerates the column values of a record using the JetEnumerateColumns - function. returns an array of JET_ENUMCOLUMNVALUE - structures. The array is returned in memory that was allocated using - the callback that was supplied to that function. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Sets the fields of the object from a native JET_ENUMCOLUMN struct. - - - The native enumcolumn to set the values from. - - - - - Gets the column value (by one-based index) that was enumerated. - - - - - Gets the column status code resulting from the enumeration of the - column value. - - - - - - - - Gets the size of the column value for the column. - - - - - Gets the value that was enumerated for the column. - - - - - - A collection of wrapped callbacks. This is used when the wrapped callback - can be garbage collected. The wrappers should be removed from the collection - when the callback is collected. - - - Removing the wrappers can lead to crashes. In this case we trust - the client code to keep its callback alive until ESENT doesn't need it any - more. Once the wrapped callback is garbage collected we allow the wrapper - to be collected as well. If ESENT subsequently uses the callback there will - be a crash. - - - The reason this is hard to deal with is that the lifetime of a JET_CALLBACK - isn't very clear. Table callbacks can stick around until the table meta-data - is purged, while a JetDefragment callback can be used until defrag ends. On - the other hand, keeping the callback wrapper alive indefinitely would lead - to unbounded memory use. - - - - - - Used to synchronize access to this object. - - - - - A list of the wrapped callbacks. - - - - - Wrap a callback and returns its wrapper. If the callback is - already wrapped then the existing wrapper is returned. - - The callback to add. - The callback wrapper for the callback. - - - - Go through the collection of callback wrappers and remove any dead callbacks. - - - - - Look in the list of callback wrappers to see if there is already an entry for - this callback. - - The callback to look for. - Returns the wrapper, if found. - True if a wrapper was found, false otherwise. - - - - ESENT error codes. - - - - - Successful operation. - - - - - Resource Failure Simulator failure - - - - - Resource Failure Simulator not initialized - - - - - Could not close file - - - - - Could not start thread - - - - - System busy due to too many IOs - - - - - A requested async task could not be executed - - - - - Fatal internal error - - - - - You are running MinESE, that does not have all features compiled in. This functionality is only supported in a full version of ESE. - - - - - Buffer dependencies improperly set. Recovery failure - - - - - Version already existed. Recovery failure - - - - - Reached Page Boundary - - - - - Reached Key Boundary - - - - - Database corrupted - - - - - Bookmark has no corresponding address in database - - - - - A call to the operating system failed - - - - - Database corrupted - - - - - AvailExt cache doesn't match btree - - - - - AvailExt space tree is corrupt - - - - - Out of memory allocating an AvailExt cache node - - - - - OwnExt space tree is corrupt - - - - - Dbtime on current page is greater than global database dbtime - - - - - key truncated on index that disallows key truncation - - - - - Some database pages have become unreachable even from the avail tree, only an offline defragmentation can return the lost space. - - - - - Key is too large - - - - - illegal attempt to separate an LV which must be intrinsic - - - - - Operation not supported on separated long-value - - - - - Logged operation cannot be redone - - - - - Log file is corrupt - - - - - No backup directory given - - - - - The backup directory is not emtpy - - - - - Backup is active already - - - - - Restore in progress - - - - - Missing the log file for check point - - - - - Failure writing to log file - - - - - Try to log something after recovery faild - - - - - Try to log something during recovery redo - - - - - Name of logfile does not match internal generation number - - - - - Version of log file is not compatible with Jet version - - - - - Timestamp in next log does not match expected - - - - - Log is not active - - - - - Log buffer is too small for recovery - - - - - Maximum log file number exceeded - - - - - No backup in progress - - - - - Backup call out of sequence - - - - - Cannot do backup now - - - - - Could not delete backup file - - - - - Could not make backup temp directory - - - - - Cannot perform incremental backup when circular logging enabled - - - - - Restored with errors - - - - - Current log file missing - - - - - Log disk full - - - - - Bad signature for a log file - - - - - Bad signature for a db file - - - - - Bad signature for a checkpoint file - - - - - Checkpoint file not found or corrupt - - - - - Patch file page not found during recovery - - - - - Patch file page is not valid - - - - - Redo abruptly ended due to sudden failure in reading logs from log file - - - - - Signature in SLV file does not agree with database - - - - - Hard restore detected that patch file is missing from backup set - - - - - Database does not belong with the current set of log files - - - - - Database and streaming file do not match each other - - - - - actual log file size does not match JET_paramLogFileSize - - - - - Could not locate checkpoint file - - - - - The required log files for recovery is missing. - - - - - Soft recovery is intended on a backup database. Restore should be used instead - - - - - databases have been recovered, but the log file size used during recovery does not match JET_paramLogFileSize - - - - - the log file sector size does not match the current volume's sector size - - - - - databases have been recovered, but the log file sector size (used during recovery) does not match the current volume's sector size - - - - - databases have been recovered, but all possible log generations in the current sequence are used; delete all log files and the checkpoint file and backup the databases before continuing - - - - - Illegal attempt to replay a streaming file operation where the data wasn't logged. Probably caused by an attempt to roll-forward with circular logging enabled - - - - - Database was not shutdown cleanly. Recovery must first be run to properly complete database operations for the previous shutdown. - - - - - Database last consistent time unmatched - - - - - Patch file is not generated from this backup - - - - - The starting log number too low for the restore - - - - - The starting log number too high for the restore - - - - - Restore log file has bad signature - - - - - Restore log file is not contiguous - - - - - Some restore log files are missing - - - - - The database missed a previous full backup before incremental backup - - - - - The backup database size is not in 4k - - - - - Attempted to upgrade a database that is already current - - - - - Attempted to use a database which was only partially converted to the current format -- must restore from backup - - - - - Some current log files are missing for continuous restore - - - - - dbtime on page smaller than dbtimeBefore in record - - - - - dbtime on page in advance of the dbtimeBefore in record - - - - - Some log or patch files are missing during backup - - - - - torn-write was detected in a backup set during hard restore - - - - - torn-write was detected during hard recovery (log was not part of a backup set) - - - - - corruption was detected in a backup set during hard restore - - - - - corruption was detected during hard recovery (log was not part of a backup set) - - - - - Cannot have logging enabled while attempting to upgrade db - - - - - TargetInstance specified for restore is not found or log files don't match - - - - - Soft recovery successfully replayed all operations, but the Undo phase of recovery was skipped - - - - - Databases to be restored are not from the same shadow copy backup - - - - - Soft recovery on a database from a shadow copy backup set - - - - - One or more logs that were committed to this database, are missing. These log files are required to maintain durable ACID semantics, but not required to maintain consistency if the JET_bitReplayIgnoreLostLogs bit is specified during recovery. - - - - - The physical sector size reported by the disk subsystem, is unsupported by ESE for a specific file type. - - - - - Soft recovery successfully replayed all operations and intended to skip the Undo phase of recovery, but the Undo phase was not required - - - - - One or more logs were found to be corrupt during recovery. These log files are required to maintain durable ACID semantics, but not required to maintain consistency if the JET_bitIgnoreLostLogs bit and JET_paramDeleteOutOfRangeLogs is specified during recovery. - - - - - Unicode translation buffer too small - - - - - Unicode normalization failed - - - - - OS does not provide support for Unicode normalisation (and no normalisation callback was specified) - - - - - Can not validate the language - - - - - Existing log file has bad signature - - - - - Existing log file is not contiguous - - - - - Checksum error in log file during backup - - - - - Checksum error in SLV file during backup - - - - - too many outstanding generations between checkpoint and current generation - - - - - hard recovery attempted on a database that wasn't a backup database - - - - - log truncation attempted but not all required logs were copied - - - - - A surrogate backup is in progress. - - - - - Backup was aborted by server by calling JetTerm with JET_bitTermStopBackup or by calling JetStopBackup - - - - - Invalid flags parameter - - - - - Termination in progress - - - - - API not supported - - - - - Invalid name - - - - - Invalid API parameter - - - - - Tried to attach a read-only database file for read/write operations - - - - - Invalid database id - - - - - Out of Memory - - - - - Maximum database size reached - - - - - Out of table cursors - - - - - Out of database page buffers - - - - - Too many indexes - - - - - Too many columns in an index - - - - - Record has been deleted - - - - - Checksum error on a database page - - - - - Blank database page - - - - - Out of file handles - - - - - The OS returned ERROR_CRC from file IO - - - - - Disk IO error - - - - - Invalid file path - - - - - Invalid system path - - - - - Invalid log directory - - - - - Record larger than maximum size - - - - - Too many open databases - - - - - Not a database file - - - - - Database engine not initialized - - - - - Database engine already initialized - - - - - Database engine is being initialized - - - - - Cannot access file, the file is locked or in use - - - - - Query support unavailable - - - - - SQL Link support unavailable - - - - - Buffer is too small - - - - - Too many columns defined - - - - - Container is not empty - - - - - Filename is invalid - - - - - Invalid bookmark - - - - - Column used in an index - - - - - Data buffer doesn't match column size - - - - - Cannot set column value - - - - - Index is in use - - - - - Link support unavailable - - - - - Null keys are disallowed on index - - - - - Operation must be within a transaction - - - - - Transaction must rollback because failure of unversioned update - - - - - Too many active database users - - - - - Invalid or unknown country/region code - - - - - Invalid or unknown language id - - - - - Invalid or unknown code page - - - - - Invalid flags for LCMapString() - - - - - Attempted to create a version store entry (RCE) larger than a version bucket - - - - - Version store out of memory (and cleanup attempt failed to complete) - - - - - Version store out of memory (cleanup already attempted) - - - - - UNUSED: lCSRPerfFUCB * g_lCursorsMax exceeded (XJET only) - - - - - Cannot index escrow column or SLV column - - - - - Record has not been deleted - - - - - Too many mempool entries requested - - - - - Out of btree ObjectIDs (perform offline defrag to reclaim freed/unused ObjectIds) - - - - - Long-value ID counter has reached maximum value. (perform offline defrag to reclaim free/unused LongValueIDs) - - - - - Auto-increment counter has reached maximum value (offline defrag WILL NOT be able to reclaim free/unused Auto-increment values). - - - - - Dbtime counter has reached maximum value (perform offline defrag to reclaim free/unused Dbtime values) - - - - - Sequential index counter has reached maximum value (perform offline defrag to reclaim free/unused SequentialIndex values) - - - - - Multi-instance call with single-instance mode enabled - - - - - Single-instance call with multi-instance mode enabled - - - - - Global system parameters have already been set - - - - - System path already used by another database instance - - - - - Logfile path already used by another database instance - - - - - Temp path already used by another database instance - - - - - Instance Name already in use - - - - - This instance cannot be used because it encountered a fatal error - - - - - This database cannot be used because it encountered a fatal error - - - - - This instance cannot be used because it encountered a log-disk-full error performing an operation (likely transaction rollback) that could not tolerate failure - - - - - Out of sessions - - - - - Write lock failed due to outstanding write lock - - - - - Transactions nested too deeply - - - - - Invalid session handle - - - - - Update attempted on uncommitted primary index - - - - - Operation not allowed within a transaction - - - - - Must rollback current transaction -- cannot commit or begin a new one - - - - - Read-only transaction tried to modify the database - - - - - Attempt to replace the same record by two diffrerent cursors in the same session - - - - - record would be too big if represented in a database format from a previous version of Jet - - - - - The temp table could not be created due to parameters that conflict with JET_bitTTForwardOnly - - - - - This session handle can't be used with this table id - - - - - Invalid instance handle - - - - - The instance was shutdown successfully but all the attached databases were left in a dirty state by request via JET_bitTermDirty - - - - - The database page read from disk had the wrong page number. - - - - - The database page read from disk had a previous write not represented on the page. - - - - - Attempted to PrepareToCommit a distributed transaction to non-zero level - - - - - Attempted a write-operation after a distributed transaction has called PrepareToCommit - - - - - Attempted to PrepareToCommit a non-distributed transaction - - - - - Attempted to commit a distributed transaction, but PrepareToCommit has not yet been called - - - - - Attempted to begin a distributed transaction when not at level 0 - - - - - Attempted to begin a distributed transaction but no callback for DTC coordination was specified on initialisation - - - - - Attempted to recover a distributed transaction but no callback for DTC coordination was specified on initialisation - - - - - Unexpected error code returned from DTC callback - - - - - Database already exists - - - - - Database in use - - - - - No such database - - - - - Invalid database name - - - - - Invalid number of pages - - - - - Non database file or corrupted db - - - - - Database exclusively locked - - - - - Cannot disable versioning for this database - - - - - Database engine is incompatible with database - - - - - The database is in an older (200) format - - - - - The database is in an older (400) format - - - - - The database is in an older (500) format - - - - - The database page size does not match the engine - - - - - Cannot start any more database instances - - - - - A different database instance is using this database - - - - - An outstanding database attachment has been detected at the start or end of recovery, but database is missing or does not match attachment info - - - - - Specified path to database file is illegal - - - - - A database is being assigned an id already in use - - - - - Force Detach allowed only after normal detach errored out - - - - - Corruption detected in catalog - - - - - Database is partially attached. Cannot complete attach operation - - - - - Database with same signature in use - - - - - Corrupted db but repair not allowed - - - - - recovery tried to replay a database creation, but the database was originally created with an incompatible (likely older) version of the database engine - - - - - The database cannot be attached because it is currently being rebuilt as part of an incremental reseed. - - - - - The database is not a valid state to perform an incremental reseed. - - - - - The incremental reseed being performed on the specified database cannot be completed due to a fatal error. A full reseed is required to recover this database. - - - - - The incremental reseed being performed on the specified database cannot be completed because the min required log contains no attachment info. A full reseed is required to recover this database. - - - - - Table is exclusively locked - - - - - Table already exists - - - - - Table is in use, cannot lock - - - - - No such table or object - - - - - Bad file/index density - - - - - Table is not empty - - - - - Invalid table id - - - - - Cannot open any more tables (cleanup already attempted) - - - - - Oper. not supported on table - - - - - Cannot open any more tables (cleanup attempt failed to complete) - - - - - Table or object name in use - - - - - Object is invalid for operation - - - - - Use CloseTable instead of DeleteTable to delete temp table - - - - - Illegal attempt to delete a system table - - - - - Illegal attempt to delete a template table - - - - - Must have exclusive lock on table. - - - - - DDL operations prohibited on this table - - - - - On a derived table, DDL operations are prohibited on inherited portion of DDL - - - - - Nesting of hierarchical DDL is not currently supported. - - - - - Tried to inherit DDL from a table not marked as a template table. - - - - - System parameters were set improperly - - - - - Client has requested stop service - - - - - Template table was created with NoFixedVarColumnsInDerivedTables - - - - - Index build failed - - - - - Primary index already defined - - - - - Index is already defined - - - - - No such index - - - - - Cannot delete clustered index - - - - - Illegal index definition - - - - - Invalid create index description - - - - - Out of index description blocks - - - - - Non-unique inter-record index keys generated for a multivalued index - - - - - Failed to build a secondary index that properly reflects primary index - - - - - Primary index is corrupt. The database must be defragmented - - - - - Secondary index is corrupt. The database must be defragmented - - - - - Illegal index id - - - - - tuple index can only be on a secondary index - - - - - tuple index may only have eleven columns in the index - - - - - tuple index must be a non-unique index - - - - - tuple index must be on a text/binary column - - - - - tuple index does not allow setting cbVarSegMac - - - - - invalid min/max tuple length or max characters to index specified - - - - - cannot call RetrieveColumn() with RetrieveFromIndex on a tuple index - - - - - specified key does not meet minimum tuple length - - - - - Column value is long - - - - - No such chunk in long value - - - - - Field will not fit in record - - - - - Null not valid - - - - - Column indexed, cannot delete - - - - - Field length is greater than maximum - - - - - No such column - - - - - Field is already defined - - - - - Attempted to create a multi-valued column, but column was not Tagged - - - - - Second autoincrement or version column - - - - - Invalid column data type - - - - - No non-NULL tagged columns - - - - - Invalid w/o a current index - - - - - The key is completely made - - - - - Column Id Incorrect - - - - - Bad itagSequence for tagged column - - - - - Cannot delete, column participates in relationship - - - - - AutoIncrement and Version cannot be tagged - - - - - Default value exceeds maximum size - - - - - Duplicate detected on a unique multi-valued column - - - - - Corruption encountered in long-value tree - - - - - Duplicate detected on a unique multi-valued column after data was normalized, and normalizing truncated the data before comparison - - - - - Invalid column in derived table - - - - - Tried to convert column to a primary index placeholder, but column doesn't meet necessary criteria - - - - - Only JET_coltypLongText and JET_coltypLongBinary columns can be compressed - - - - - The key was not found - - - - - No working buffer - - - - - Currency not on a record - - - - - Primary key may not change - - - - - Illegal duplicate key - - - - - Attempted to update record when record update was already in progress - - - - - No call to JetMakeKey - - - - - No call to JetPrepareUpdate - - - - - Data has changed, operation aborted - - - - - Windows installation does not support language - - - - - Internal error: data could not be decompressed - - - - - No version updates only for uncommitted tables - - - - - Too many sort processes - - - - - Invalid operation on Sort - - - - - Temp file could not be opened - - - - - Too many open databases - - - - - No space left on disk - - - - - Permission denied - - - - - File not found - - - - - Invalid file type - - - - - Cannot Restore after init. - - - - - Logs could not be interpreted - - - - - Invalid operation - - - - - Access denied - - - - - Infinite split - - - - - Multiple threads are using the same session - - - - - An entry point in a DLL we require could not be found - - - - - Specified session already has a session context set - - - - - Tried to reset session context, but current thread did not orignally set the session context - - - - - Tried to terminate session in use - - - - - Internal error during dynamic record format conversion - - - - - Just one open user database per session is allowed (JET_paramOneDatabasePerSession) - - - - - error during rollback - - - - - The operation did not complete successfully because the database is already running maintenance on specified database - - - - - A callback failed - - - - - A callback function could not be found - - - - - An element of the JET space hints structure was not correct or actionable. - - - - - Corruption encountered in space manager of streaming file - - - - - Corruption encountered in streaming file - - - - - SLV columns cannot have a default value - - - - - Cannot find streaming file associated with this database - - - - - Streaming file exists, but database to which it belongs is missing - - - - - Tried to create a streaming file when one already exists or is already recorded in the catalog - - - - - Specified path to a streaming file is invalid - - - - - Tried to perform an SLV operation but streaming file was never created - - - - - Attach a readonly streaming file for read/write operations - - - - - SLV file header failed checksum verification - - - - - SLV file header contains invalid information - - - - - Tried to move pages from the Free state when they were not in that state - - - - - Tried to move pages from the Reserved state when they were not in that state - - - - - Tried to move pages from the Committed state when they were not in that state - - - - - Tried to move pages from the Deleted state when they were not in that state - - - - - Unexpected conflict detected trying to write-latch SLV space pages - - - - - The database can not be created/attached because its corresponding SLV Root is still open by another process. - - - - - The database can not be created/attached because the SLV Provider has not been loaded. - - - - - The specified SLV EA List is corrupted. - - - - - The database cannot be created/attached because the SLV Root Name was omitted - - - - - The specified SLV Root path was invalid. - - - - - The specified SLV EA List has no allocated space. - - - - - Deletion of SLV columns is not currently supported. - - - - - Tried to create a new catalog entry for SLV Ownership Map when one already exists - - - - - Corruption encountered in SLV Ownership Map - - - - - Corruption encountered in SLV Ownership Map - - - - - The specified SLV File handle belongs to a SLV Root that no longer exists. - - - - - The specified SLV File is currently in use - - - - - The specified streaming file is currently in use - - - - - An I/O error occurred while accessing an SLV File (general read / write failure) - - - - - No space left in the streaming file - - - - - Specified path to a SLV File was invalid - - - - - Cannot access SLV File, the SLV File is locked or is in use - - - - - The specified SLV File was not found - - - - - An unknown error occurred while accessing an SLV File - - - - - The specified SLV EA List could not be returned because it is too large to fit in the standard EA format. Retrieve the SLV File as a file handle instead. - - - - - The loaded SLV Provider's version does not match the database engine's version. - - - - - Buffer allocated for SLV data or meta-data was too small - - - - - OS Shadow copy API used in an invalid sequence - - - - - OS Shadow copy ended with time-out - - - - - OS Shadow copy not allowed (backup or recovery in progress) - - - - - invalid JET_OSSNAPID - - - - - Internal test injection limit hit - - - - - Test injection not supported - - - - - Some how the log data provided got out of sequence with the current state of the instance - - - - - Attempted to use Local Storage without a callback function being specified - - - - - Attempted to set Local Storage for an object which already had it set - - - - - Attempted to retrieve Local Storage from an object which didn't have it set - - - - - an I/O was issued to a location that was sparse - - - - - a read was issued to a location beyond EOF (writes will expand the file) - - - - - instructs the JET_ABORTRETRYFAILCALLBACK caller to abort the specified I/O - - - - - instructs the JET_ABORTRETRYFAILCALLBACK caller to retry the specified I/O - - - - - instructs the JET_ABORTRETRYFAILCALLBACK caller to fail the specified I/O - - - - - read/write access is not supported on compressed files - - - - - The native version of the JET_OBJECTLIST structure. - - - - - Size of the structure. - - - - - Tableid of the temporary table. - - - - - Number of records in the temporary table. - - - - - The id of column containing the name of the container type. - - - - - The id of the column containing the name of the object. - - - - - The id of the column containing the type of the object. - - - - - Obsolete. Do not use. - - - - - Obsolete. Do not use. - - - - - The id of the column containing object grbits. - - - - - The id of the column containing object flags. - - - - - The id of the column containing the number of records in the table. - - - - - The id of the column containing the number of pages the object uses. - - - - - Information about a temporary table containing information - about all tables for a given database. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Sets the fields of the object from a native JET_OBJECTLIST struct. - - - The native objectlist to set the values from. - - - - - Gets tableid of the temporary table. This should be closed - when the table is no longer needed. - - - - - Gets the number of records in the temporary table. - - - - - Gets the columnid of the column in the temporary table which - stores the name of the table. - - - - - Gets the columnid of the column in the temporary table which - stores the type of the table. - - - - - Gets the columnid of the column in the temporary table which - stores the grbits used when the table was created. - - - - - Gets the columnid of the column in the temporary table which - stores the table flags (e.g. the system table flag). - - - - - Gets the columnid of the column in the temporary table which - stores the number of records in the table. - - - - - Gets the columnid of the column in the temporary table which - stores the number of pages used by the table. - - - - - A class that encapsulates a JET_TABLEID in a disposable object. - This opens an existing table. To create a table use the - JetCreateTable method. - - - - - The session used to open the table. - - - - - The underlying JET_TABLEID. - - - - - The name of the table. - - - - - Initializes a new instance of the Table class. The table is - opened from the given database. - - The session to use. - The database to open the table in. - The name of the table. - JetOpenTable options. - - - - Implicit conversion operator from a Table to a JET_TABLEID. This - allows a Table to be used with APIs which expect a JET_TABLEID. - - The table to convert. - The JET_TABLEID of the table. - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Close the table. - - - - - Free the underlying JET_TABLEID. - - - - - Gets the name of this table. - - - - - Gets the JET_TABLEID that this table contains. - - - - - Enumerate columns in a table specified by a tableid. - - - - - The table to get the column information from. - - - - - Initializes a new instance of the class. - - - The session to use. - - - The table to get column information from. - - - - - Open the table to be enumerated. This should set . - - - - - The native version of the JET_OPENTEMPORARYTABLE structure. - - - - - Size of the structure. - - - - - Columns to create. - - - - - Number of entries in prgcolumndef. - - - - - Optional pointer to unicode index information. - - - - - Table options. - - - - - Pointer to array of returned columnids. This - should have at least ccolumn entries. - - - - - Maximum key size. - - - - - Maximum amount of data used to construct a key. - - - - - Returns the tableid of the new table. - - - - - A collection of parameters for the JetOpenTemporaryTable method. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Returns the unmanaged opentemporarytable that represents this managed class. - - - A native (interop) version of the JET_OPENTEMPORARYTABLE. - - - - - Make sure the data and count members are the correct size. - - - - - Gets or sets the column definitions for the columns created in - the temporary table. - - - - - Gets or sets the number of columns in . - - - - - - Gets or sets the locale ID and normalization flags to use to compare any Unicode - key column data in the temporary table. When this parameter is - null, then the default LCID will be used to compare any Unicode key - columns in the temporary table. The default LCID is the U.S. English - locale. When this parameter is null, then the default normalization - flags will be used to compare any Unicode key column data in the temp - table. The default normalization flags are: NORM_IGNORECASE, - NORM_IGNOREKANATYPE, and NORM_IGNOREWIDTH. - - - - - Gets or sets options for the temp table. - - - - - Gets or sets the output buffer that receives the array of column - IDs generated during the creation of the temporary table. The - column IDs in this array will exactly correspond to the input array - of column definitions. As a result, the size of this buffer must - correspond to the size of . - - - - - Gets or sets the maximum size for a key representing a given row. The maximum - key size may be set to control how keys are truncated. Key - truncation is important because it can affect when rows are - considered to be distinct. If this parameter is set to 0 or - 255 then the maximum key size and its semantics will remain - identical to the maximum key size supported by Windows Server 2003 - and previous releases. This parameter may also be set to a larger - value as a function of the database page size for the instance - . See - for more information. - - - - - Gets or sets maximum amount of data that will be used from any - variable lengthcolumn to construct a key for a given row. This - parameter may be used to control the amount of key space consumed - by any given key column. This limit is in bytes. If this parameter - is zero or is the same as the property - then no limit is in effect. - - - - - Gets the table handle for the temporary table created as a result - of a successful call to JetOpenTemporaryTable. - - - - - The native version of the structure. - - - - - The column identifier for the column to retrieve. - - - - - A pointer to begin storing data that is retrieved from the - column value. - - - - - The size of allocation beginning at pvData, in bytes. The - retrieve column operation will not store more data at pvData - than cbData. - - - - - The size, in bytes, of data that is retrieved by a retrieve - column operation. - - - - - A group of bits that contain the options for column retrieval. - - - - - The offset to the first byte to be retrieved from a column of - type or - . - - - - - The sequence number of the values that are contained in a - multi-valued column. If the itagSequence is 0 then the number - of instances of a multi-valued column are returned instead of - any column data. - - - - - The columnid of the tagged, multi-valued, or sparse column - when all tagged columns are retrieved by passing 0 as the - columnid. - - - - - Error codes and warnings returned from the retrieval of the column. - - - - - Contains input and output parameters for . - Fields in the structure describe what column value to retrieve, how to - retrieve it, and where to save results. - - - - - Returns a that represents the current . - - - A that represents the current . - - - - - Check to see if cbData is negative or greater than cbData. - - - - - Gets the NATIVE_RETRIEVECOLUMN structure that represents the object. - - The NATIVE_RETRIEVECOLUMN structure to fill in. - - This takes a reference because a NATIVE_RETRIEVECOLUMN is quite large (40 bytes) - so copying it around can be expensive. - - - - - Update the output members of the class from a NATIVE_RETRIEVECOLUMN - structure. This should be done after the columns are retrieved. - - - The structure containing the updated output fields. - - - This takes a reference because a NATIVE_RETRIEVECOLUMN is quite large (40 bytes) - so copying it around can be expensive. - - - - - Gets or sets the column identifier for the column to retrieve. - - - - - Gets or sets the buffer that will store data that is retrieved from the - column. - - - - - Gets or sets the offset in the buffer that data will be stored in. - - - - - Gets or sets the size of the buffer, in bytes. The - retrieve column operation will not store more data in pvData - than cbData. - - - - - Gets the size, in bytes, of data that is retrieved by a retrieve - column operation. - - - - - Gets or sets the options for column retrieval. - - - - - Gets or sets the offset to the first byte to be retrieved from a column of - type or - . - - - - - Gets or sets the sequence number of the values that are contained in a - multi-valued column. If the itagSequence is 0 then the number - of instances of a multi-valued column are returned instead of - any column data. - - - - - Gets the columnid of the tagged, multi-valued, or sparse column - when all tagged columns are retrieved by passing 0 as the - columnid. - - - - - Gets the warning returned from the retrieval of the column. - - - - - The native version of the JET_INSTANCE_INFO structure. - - - - - The JET_INSTANCE of the given instance. - - - - - The name of the database instance. This value can be NULL if the - instance does not have a name. - - - - - The number of databases that are attached to the database instance. - cDatabases also holds the size of the arrays of strings that are - returned in szDatabaseFileName, szDatabaseDisplayName, and - szDatabaseSLVFileName. - - - - - An array of strings, each holding the file name of a database that - is attached to the database instance. The array has cDatabases - elements. - - - - - An array of strings, each holding the display name of a database. - This string is always null. The array has cDatabases elements. - - - - - An array of strings, each holding the file name of the SLV file that - is attached to the database instance. The array has cDatabases - elements. SLV files are not supported, so this field should be ignored. - - - - - Receives information about running database instances when used with the - JetGetInstanceInfo and JetOSSnapshotFreeze functions. - - - - - Collection of database file names. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - - The instance. - - - The name of the instance. - - - The databases in the instance. - - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Generate a string representation of the instance. - - The structure as a string. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Set the properties of the object from a native instance info where the - strings in the NATIVE_INSTANCE_INFO are ASCII. - - The native instance info. - - - - Set the properties of the object from a native instance info where the - strings in the NATIVE_INSTANCE_INFO are Unicode. - - The native instance info. - - - - Gets the JET_INSTANCE of the given instance. - - - - - Gets the name of the database instance. This value can be null if - the instance does not have a name. - - - - - Gets the number of databases that are attached to the database instance. - - - - - Gets a collection of strings, each holding the file name of a database - that is attached to the database instance. The array has cDatabases - elements. - - - - - A multi-purpose callback function used by the database engine to inform - the application of an event involving online defragmentation and cursor - state notifications. - - The session for which the callback is being made. - The database for which the callback is being made. - The cursor for which the callback is being made. - The operation for which the callback is being made. - First callback-specific argument. - Second callback-specific argument. - Callback context. - This parameter is not used. - An ESENT error code. - - - - Describes a date/time when a backup occured. - - - - - The time in seconds. This value can be 0 to 59. - - - - - The time in minutes. This value can be 0 to 59. - - - - - The time in hours. This value can be 0 to 23. - - - - - The day of the month. This value can be 0 to 31. 0 is - used when the structure is null. - - - - - The month. This value can be 0 to 12. 0 is - used when the structure is null. - - - - - The year of the event, offset by 1900. - - - - - This field is ignored. - - - - - This field is ignored. - - - - - Initializes a new instance of the struct. - - - The DateTime to intialize the structure with. - - - True if this time is for a snapshot backup. - - - - - Determines whether two specified instances of JET_BKLOGTIME - are equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are equal. - - - - Determines whether two specified instances of JET_BKLOGTIME - are not equal. - - The first instance to compare. - The second instance to compare. - True if the two instances are not equal. - - - - Generate a DateTime representation of this JET_BKLOGTIME. - - - A DateTime representing the JET_BKLOGTIME. If the JET_BKLOGTIME - is null then null is returned. - - - - - Generate a string representation of the structure. - - The structure as a string. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An object to compare with this instance. - True if the two instances are equal. - - - - Returns the hash code for this instance. - - The hash code for this instance. - - - - Returns a value indicating whether this instance is equal - to another instance. - - An instance to compare with this instance. - True if the two instances are equal. - - - - Gets a value indicating whether the JET_BKLOGTIME has a null value. - - - - - Gets a value indicating whether the JET_BKLOGTIME is in UTC. - - - - - Gets a value indicating whether the JET_BKLOGTIME is for a snapshot backup. - - - - diff --git a/lib/RavenDB/RavenDB.Database.992/ICSharpCode.NRefactory.dll b/lib/RavenDB/RavenDB.Database.992/ICSharpCode.NRefactory.dll deleted file mode 100644 index 1c97b850b98..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/ICSharpCode.NRefactory.dll and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.Spatial.dll b/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.Spatial.dll deleted file mode 100644 index 45e8f325e39..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.Spatial.dll and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.Spatial.pdb b/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.Spatial.pdb deleted file mode 100644 index 8ed98636a2b..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.Spatial.pdb and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.Spatial.xml b/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.Spatial.xml deleted file mode 100644 index 59a70fa35e8..00000000000 --- a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.Spatial.xml +++ /dev/null @@ -1,373 +0,0 @@ - - - - Lucene.Net.Contrib.Spatial - - - - - An implementation of the Lucene ValueSource model to support spatial relevance ranking. - - - - - A Spatial Prefix Tree, or Trie, which decomposes shapes into prefixed strings at variable lengths corresponding to - variable precision. Each string corresponds to a spatial region. - - Implementations of this class should be thread-safe and immutable once initialized. - - - - See {@link com.spatial4j.core.query.SpatialArgs#getDistPrecision()}. - A grid level looked up via {@link #getLevelForDistance(double)} is returned. - - @param shape - @param precision 0-0.5 - @return 1-maxLevels - - - Returns the level of the smallest grid size with a side length that is greater or equal to the provided - distance. - - @param dist >= 0 - @return level [1-maxLevels] - - - Returns the level 0 cell which encompasses all spatial data. Equivalent to {@link #getNode(String)} with "". - This cell is threadsafe, just like a spatial prefix grid is, although cells aren't - generally threadsafe. - TODO rename to getTopCell or is this fine? - - - The cell for the specified token. The empty string should be equal to {@link #getWorldNode()}. - Precondition: Never called when token length > maxLevel. - - - - Subclasses might override {@link #getNodes(com.spatial4j.core.shape.Shape, int, boolean)} - and check if the argument is a shape and if so, delegate - to this implementation, which calls {@link #getNode(com.spatial4j.core.shape.Point, int)} and - then calls {@link #getNode(String)} repeatedly if inclParents is true. - - - Will add the trailing leaf byte for leaves. This isn't particularly efficient. - - - - The factory is looked up via "prefixTree" in args, expecting "geohash" or "quad". - If its neither of these, then "geohash" is chosen for a geo context, otherwise "quad" is chosen. - - - - - - - Calls {@link SpatialPrefixTree#getLevelForDistance(double)}. - - - Note: doesn't contain a trailing leaf byte. - - - Like {@link #getSubCells()} but with the results filtered by a shape. If that shape is a {@link com.spatial4j.core.shape.Point} then it - must call {@link #getSubCell(com.spatial4j.core.shape.Point)}; - Precondition: Never called when getLevel() == maxLevel. - - @param shapeFilter an optional filter for the returned cells. - @return A set of cells (no dups), sorted. Not Modifiable. - - - Performant implementations are expected to implement this efficiently by considering the current - cell's boundary. - Precondition: Never called when getLevel() == maxLevel. - Precondition: this.getShape().relate(p) != DISJOINT. - - - Gets the cells at the next grid cell level that cover this cell. - Precondition: Never called when getLevel() == maxLevel. - - @return A set of cells (no dups), sorted. Not Modifiable. - - - {@link #getSubCells()}.size() -- usually a constant. Should be >=2 - - - Corresponds with Solr's FieldType.isPolyField(). - - - Corresponds with Solr's FieldType.createField(). - - This may return a null field if it does not want to make anything. - This is reasonable behavior if 'ignoreIncompatibleGeometry=true' and the - geometry is incompatible - - - Corresponds with Solr's FieldType.createFields(). - - - - Make a query - - - - - - - - Make a Filter - - - - - - - Used in the in-memory ValueSource as a default ArrayList length for this field's array of values, per doc. - - - See {@link SpatialPrefixTree#getMaxLevelForPrecision(com.spatial4j.core.shape.Shape, double)}. - - - - Outputs the tokenString of a cell, and if its a leaf, outputs it again with the leaf byte. - - - - - Port of Solr's FunctionQuery (v1.4) - - Returns a score for each document based on a ValueSource, - often some function of the value of a field. - - Note: This API is experimental and may change in non backward-compatible ways in the future - - - - - - - The associated ValueSource - - - - Wraps Lucene 3 TermEnum to make it look like a Lucene 4 TermsEnum - SOLR-2155 - @author dsmiley - - - - - Seeks to the specified term, if it exists, or to the - next (ceiling) term. Returns SeekStatus to - indicate whether exact term was found, a different - term was found, or EOF was hit. The target term may - be before or after the current term. If this returns - SeekStatus.END, the enum is unpositioned. - - - - - - - Returns the number of documents that have at least one - term for this field, or -1 if this measure isn't - stored by the codec. Note that, just like other term - measures, this measure does not take deleted documents - into account. - - - - - - Information the strategy needs for the lucene fields - - - - - Interface for Bitset-like structures. - - - - - Bits impl of the specified length with all bits set. - - - - - Bits impl of the specified length with no bits set. - - - - - Constructs a query to retrieve documents that fully contain the input envelope. - - - - The spatial query - - - - Constructs a query to retrieve documents that fully contain the input envelope. - - - - The spatial query - - - - Performs a spatial intersection filter against a field indexed with {@link SpatialPrefixTree}, a Trie. - SPT yields terms (grids) at length 1 and at greater lengths corresponding to greater precisions. - This filter recursively traverses each grid length and uses methods on {@link Shape} to efficiently know - that all points at a prefix fit in the shape or not to either short-circuit unnecessary traversals or to efficiently - load all enclosed points. - - - - - Hold some of the parameters used by solr... - - - - - Put a list of strings directly into the token stream - - - - An iterator to iterate over set bits in an OpenBitSet. - This is faster than nextSetBit() for iterating over the complete set of bits, - especially when the density of the bits set is high. - - - $Id$ - - - - ** the python code that generated bitlist - def bits2int(val): - arr=0 - for shift in range(8,0,-1): - if val & 0x80: - arr = (arr << 4) | shift - val = val << 1 - return arr - def int_table(): - tbl = [ hex(bits2int(val)).strip('L') for val in range(256) ] - return ','.join(tbl) - **** - - - - use instead. - - - - use instead. - - - - use instead. - - - - - An implementation of the Lucene ValueSource model to support spatial relevance ranking. - - - - - A SpatialPrefixGrid based on Geohashes. Uses {@link GeohashUtils} to do all the geohash work. - - - - - table of number of leading zeros in a byte - - - - Returns the number of leading zero bits. - - - - - - - Expert: Every composite-key in the internal cache is of this type. - - - - Creates one of these objects for a custom comparator/parser. - - - Two of these are equal iff they reference the same field and type. - - - Composes a hashcode based on the field and type. - - - BitSet of fixed length (numBits), backed by accessible - ({@link #getBits}) long[], accessed with an int index, - implementing Bits and DocIdSet. Unlike {@link - OpenBitSet} this bit set does not auto-expand, cannot - handle long index, and does not have fastXX/XX variants - (just X). - - @lucene.internal - - - - - returns the number of 64 bit words it would take to hold numBits - - - - - - - Makes full copy. - - - - - - Returns number of set bits. NOTE: this visits every - long in the backing bits array, and the result is not - internally cached! - - - - - - Returns the index of the first set bit starting at the index specified. - -1 is returned if there are no more set bits. - - - - - - Returns the index of the last set bit before or on the index specified. - -1 is returned if there are no more set bits. - - - this = this OR other - - - this = this AND other - - - this = this AND NOT other - - - Sets a range of bits - - @param startIndex lower index - @param endIndex one-past the last bit to set - - - Clears a range of bits. - - @param startIndex lower index - @param endIndex one-past the last bit to clear - - - returns true if both sets have the same bits set - - - diff --git a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.SpellChecker.dll b/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.SpellChecker.dll deleted file mode 100644 index b4ce631fbb4..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.SpellChecker.dll and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.SpellChecker.pdb b/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.SpellChecker.pdb deleted file mode 100644 index aac2d3c3fe6..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.SpellChecker.pdb and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.SpellChecker.xml b/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.SpellChecker.xml deleted file mode 100644 index 8f0fb9d6708..00000000000 --- a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.Contrib.SpellChecker.xml +++ /dev/null @@ -1,254 +0,0 @@ - - - - Lucene.Net.Contrib.SpellChecker - - - - - A simple interface representing a Dictionary - - - return all the words present in the dictionary - Iterator - - - - Lucene Dictionary - - - - - SuggestWord Class, used in suggestSimilar method in SpellChecker class. - - - Nicolas Maisonneuve - - - - the score of the word - - - The freq of the word - - - the suggested word - - - - Interface for string distances. - - - - - Returns a float between 0 and 1 based on how similar the specified strings are to one another. - Returning a value of 1 means the specified strings are identical and 0 means the - string are maximally different. - - The first string. - The second string. - a float between 0 and 1 based on how similar the specified strings are to one another. - - - Edit distance class - - - Optimized to run a bit faster than the static getDistance(). - In one benchmark times were 5.3sec using ctr vs 8.5sec w/ static method, thus 37% faster. - - - - - - - - Sets the threshold used to deterMine when Winkler bonus should be used. - Set to a negative value to get the Jaro distance. - - the new value of the threshold - - - - Returns the current value of the threshold used for adding the Winkler bonus. - The default value is 0.7. - - the current value of the threshold - - - - Creates an N-Gram distance measure using n-grams of the specified size. - - The size of the n-gram to be used to compute the string distance. - - - - Creates an N-Gram distance measure using n-grams of size 2. - - - - - Field name for each word in the ngram index. - - - the spell index - - - Boost value for start and end grams - - - - this locks all modifications to the current searcher. - - - - - Use the given directory as a spell checker index. The directory - is created if it doesn't exist yet. - - the spell index directory - the {@link StringDistance} measurement to use - - - - Use the given directory as a spell checker index with a - {@link LevensteinDistance} as the default {@link StringDistance}. The - directory is created if it doesn't exist yet. - - the spell index directory - - - - Use a different index as the spell checker index or re-open - the existing index if spellIndex is the same value - as given in the constructor. - - spellIndexDir the spell directory to use - AlreadyClosedException if the Spellchecker is already closed - IOException if spellchecker can not open the directory - - - - Sets the {@link StringDistance} implementation for this - {@link SpellChecker} instance. - - the {@link StringDistance} implementation for this - {@link SpellChecker} instance. - - - - Returns the {@link StringDistance} instance used by this - {@link SpellChecker} instance. - - - Returns the {@link StringDistance} instance used by this - {@link SpellChecker} instance. - - - - Set the accuracy 0 < min < 1; default 0.5 - - - Suggest similar words - String the word you want a spell check done on - - int the number of suggest words - - IOException - String[] - - - - Suggest similar words (restricted or not to a field of a user index) - String the word you want a spell check done on - - int the number of suggest words - - the indexReader of the user index (can be null see field param) - - String the field of the user index: if field is not null, the suggested - words are restricted to the words present in this field. - - boolean return only the suggest words that are more frequent than the searched word - (only if restricted mode = (indexReader!=null and field!=null) - - IOException - String[] the sorted list of the suggest words with this 2 criteria: - first criteria: the edit distance, second criteria (only if restricted mode): the popularity - of the suggest words in the field of the user index - - - - Add a clause to a boolean query. - - - Add a clause to a boolean query. - - - Form all ngrams for a given word. - the word to parse - - the ngram length e.g. 3 - - an array of all ngrams in the word and note that duplicates are not removed - - - - - Removes all terms from the spell check index. - - - - Check whether the word exists in the index. - String - - IOException - true iff the word exists in the index - - - - Index a Dictionary - the dictionary to index - mergeFactor to use when indexing - the max amount or memory in MB to use - IOException - AlreadyClosedException if the Spellchecker is already closed - - - - Indexes the data from the given {@link Dictionary}. - - dict the dictionary to index - - - - Creates a new read-only IndexSearcher (for testing purposes) - - dir the directory used to open the searcher - a new read-only IndexSearcher. (throws IOException f there is a low-level IO error) - - - - Returns true if and only if the {@link SpellChecker} is - closed, otherwise false. - - true if and only if the {@link SpellChecker} is - closed, otherwise false. - - - - - Levenshtein edit distance - - - - - Returns a float between 0 and 1 based on how similar the specified strings are to one another. - Returning a value of 1 means the specified strings are identical and 0 means the - string are maximally different. - - The first string. - The second string. - a float between 0 and 1 based on how similar the specified strings are to one another. - - - diff --git a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.dll b/lib/RavenDB/RavenDB.Database.992/Lucene.Net.dll deleted file mode 100644 index 3ca1517f5f0..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.dll and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.pdb b/lib/RavenDB/RavenDB.Database.992/Lucene.Net.pdb deleted file mode 100644 index 16ff15a7147..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.pdb and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.xml b/lib/RavenDB/RavenDB.Database.992/Lucene.Net.xml deleted file mode 100644 index 00e347715dc..00000000000 --- a/lib/RavenDB/RavenDB.Database.992/Lucene.Net.xml +++ /dev/null @@ -1,27355 +0,0 @@ - - - - Lucene.Net - - - - Simple cache implementation that uses a HashMap to store (key, value) pairs. - This cache is not synchronized, use {@link Cache#SynchronizedCache(Cache)} - if needed. - - - - Base class for cache implementations. - - - Returns a thread-safe cache backed by the specified cache. - In order to guarantee thread-safety, all access to the backed cache must - be accomplished through the returned cache. - - - - Called by {@link #SynchronizedCache(Cache)}. This method - returns a {@link SynchronizedCache} instance that wraps - this instance by default and can be overridden to return - e. g. subclasses of {@link SynchronizedCache} or this - in case this cache is already synchronized. - - - - Puts a (key, value)-pair into the cache. - - - Returns the value for the given key. - - - Returns whether the given key is in this cache. - - - Closes the cache. - - - Simple Cache wrapper that synchronizes all - calls that access the cache. - - - - Returns a Set containing all keys in this cache. - - - - The maximum number of items to cache. - - - - - The list to efficiently maintain the LRU state. - - - - - The dictionary to hash into any location in the list. - - - - - The node instance to use/re-use when adding an item to the cache. - - - - - Container to hold the key and value to aid in removal from - the dictionary when an item is removed from cache. - - - - Methods for manipulating arrays. - - - Parses the string argument as if it was an int value and returns the - result. Throws NumberFormatException if the string does not represent an - int quantity. - - - a string representation of an int quantity. - - int the value represented by the argument - - NumberFormatException if the argument could not be parsed as an int quantity. - - - Parses a char array into an int. - the character array - - The offset into the array - - The length - - the int - - NumberFormatException if it can't parse - - - Parses the string argument as if it was an int value and returns the - result. Throws NumberFormatException if the string does not represent an - int quantity. The second argument specifies the radix to use when parsing - the value. - - - a string representation of an int quantity. - - the base to use for conversion. - - int the value represented by the argument - - NumberFormatException if the argument could not be parsed as an int quantity. - - - Returns hash of chars in range start (inclusive) to - end (inclusive) - - - - Returns hash of chars in range start (inclusive) to - end (inclusive) - - - - A {@link Collector} implementation that collects the top-scoring hits, - returning them as a {@link TopDocs}. This is used by {@link IndexSearcher} to - implement {@link TopDocs}-based search. Hits are sorted by score descending - and then (when the scores are tied) docID ascending. When you create an - instance of this collector you should know in advance whether documents are - going to be collected in doc Id order or not. - -

    NOTE: The values {@link Float#NaN} and - {Float#NEGATIVE_INFINITY} are not valid scores. This - collector will not properly collect hits with such - scores. -

    -
    - - A base class for all collectors that return a {@link TopDocs} output. This - collector allows easy extension by providing a single constructor which - accepts a {@link PriorityQueue} as well as protected members for that - priority queue and a counter of the number of total hits.
    - Extending classes can override {@link #TopDocs(int, int)} and - {@link #GetTotalHits()} in order to provide their own implementation. -
    -
    - -

    Expert: Collectors are primarily meant to be used to - gather raw results from a search, and implement sorting - or custom result filtering, collation, etc.

    - -

    As of 2.9, this class replaces the deprecated - HitCollector, and offers an API for efficient collection - of hits across sequential {@link IndexReader}s. {@link - IndexSearcher} advances the collector through each of the - sub readers, in an arbitrary order. This results in a - higher performance means of collection.

    - -

    Lucene's core collectors are derived from Collector. - Likely your application can use one of these classes, or - subclass {@link TopDocsCollector}, instead of - implementing Collector directly: - -

      - -
    • {@link TopDocsCollector} is an abstract base class - that assumes you will retrieve the top N docs, - according to some criteria, after collection is - done.
    • - -
    • {@link TopScoreDocCollector} is a concrete subclass - {@link TopDocsCollector} and sorts according to score + - docID. This is used internally by the {@link - IndexSearcher} search methods that do not take an - explicit {@link Sort}. It is likely the most frequently - used collector.
    • - -
    • {@link TopFieldCollector} subclasses {@link - TopDocsCollector} and sorts according to a specified - {@link Sort} object (sort by field). This is used - internally by the {@link IndexSearcher} search methods - that take an explicit {@link Sort}.
    • - -
    • {@link TimeLimitingCollector}, which wraps any other - Collector and aborts the search if it's taken too much - time, will subclass Collector in 3.0 (presently it - subclasses the deprecated HitCollector).
    • - -
    • {@link PositiveScoresOnlyCollector} wraps any other - Collector and prevents collection of hits whose score - is <= 0.0
    • - -
    - -

    Collector decouples the score from the collected doc: - the score computation is skipped entirely if it's not - needed. Collectors that do need the score should - implement the {@link #setScorer} method, to hold onto the - passed {@link Scorer} instance, and call {@link - Scorer#Score()} within the collect method to compute the - current hit's score. If your collector may request the - score for a single hit multiple times, you should use - {@link ScoreCachingWrappingScorer}.

    - -

    NOTE: The doc that is passed to the collect - method is relative to the current reader. If your - collector needs to resolve this to the docID space of the - Multi*Reader, you must re-base it by recording the - docBase from the most recent setNextReader call. Here's - a simple example showing how to collect docIDs into a - BitSet:

    - -

    -            Searcher searcher = new IndexSearcher(indexReader);
    -            final BitSet bits = new BitSet(indexReader.maxDoc());
    -            searcher.search(query, new Collector() {
    -            private int docBase;
    -            
    -            // ignore scorer
    -            public void setScorer(Scorer scorer) {
    -            }
    -            
    -            // accept docs out of order (for a BitSet it doesn't matter)
    -            public boolean acceptsDocsOutOfOrder() {
    -            return true;
    -            }
    -            
    -            public void collect(int doc) {
    -            bits.set(doc + docBase);
    -            }
    -            
    -            public void setNextReader(IndexReader reader, int docBase) {
    -            this.docBase = docBase;
    -            }
    -            });
    -            
    - -

    Not all collectors will need to rebase the docID. For - example, a collector that simply counts the total number - of hits would skip it.

    - -

    NOTE: Prior to 2.9, Lucene silently filtered - out hits with score <= 0. As of 2.9, the core Collectors - no longer do that. It's very unusual to have such hits - (a negative query boost, or function query returning - negative custom scores, could cause it to happen). If - you need that behavior, use {@link - PositiveScoresOnlyCollector}.

    - -

    NOTE: This API is experimental and might change - in incompatible ways in the next release.

    - -

    - 2.9 - -
    - - Called before successive calls to {@link #Collect(int)}. Implementations - that need the score of the current document (passed-in to - {@link #Collect(int)}), should save the passed-in Scorer and call - scorer.score() when needed. - - - - Called once for every document matching a query, with the unbased document - number. - -

    - Note: This is called in an inner search loop. For good search performance, - implementations of this method should not call {@link Searcher#Doc(int)} or - {@link Lucene.Net.Index.IndexReader#Document(int)} on every hit. - Doing so can slow searches by an order of magnitude or more. -

    -
    - - Called before collecting from each IndexReader. All doc ids in - {@link #Collect(int)} will correspond to reader. - - Add docBase to the current IndexReaders internal document id to re-base ids - in {@link #Collect(int)}. - - - next IndexReader - - - - - - - * Return true if this collector does not - * require the matching docIDs to be delivered in int sort - * order (smallest to largest) to {@link #collect}. - * - *

    Most Lucene Query implementations will visit - * matching docIDs in order. However, some queries - * (currently limited to certain cases of {@link - * BooleanQuery}) can achieve faster searching if the - * Collector allows them to deliver the - * docIDs out of order. - * - *

    Many collectors don't mind getting docIDs out of - * order, so it's important to return true - * here. - * -

    - -
    - - The priority queue which holds the top documents. Note that different - implementations of PriorityQueue give different meaning to 'top documents'. - HitQueue for example aggregates the top scoring documents, while other PQ - implementations may hold documents sorted by other criteria. - - - - The total number of documents that the collector encountered. - - - Populates the results array with the ScoreDoc instaces. This can be - overridden in case a different ScoreDoc type should be returned. - - - - Returns a {@link TopDocs} instance containing the given results. If - results is null it means there are no results to return, - either because there were 0 calls to collect() or because the arguments to - topDocs were invalid. - - - - The total number of documents that matched this query. - - - Returns the top docs that were collected by this collector. - - - Returns the documents in the rage [start .. pq.size()) that were collected - by this collector. Note that if start >= pq.size(), an empty TopDocs is - returned.
    - This method is convenient to call if the application allways asks for the - last results, starting from the last 'page'.
    - NOTE: you cannot call this method more than once for each search - execution. If you need to call it more than once, passing each time a - different start, you should call {@link #TopDocs()} and work - with the returned {@link TopDocs} object, which will contain all the - results this search execution collected. -
    -
    - - Returns the documents in the rage [start .. start+howMany) that were - collected by this collector. Note that if start >= pq.size(), an empty - TopDocs is returned, and if pq.size() - start < howMany, then only the - available documents in [start .. pq.size()) are returned.
    - This method is useful to call in case pagination of search results is - allowed by the search application, as well as it attempts to optimize the - memory used by allocating only as much as requested by howMany.
    - NOTE: you cannot call this method more than once for each search - execution. If you need to call it more than once, passing each time a - different range, you should call {@link #TopDocs()} and work with the - returned {@link TopDocs} object, which will contain all the results this - search execution collected. -
    -
    - - Creates a new {@link TopScoreDocCollector} given the number of hits to - collect and whether documents are scored in order by the input - {@link Scorer} to {@link #SetScorer(Scorer)}. - -

    NOTE: The instances returned by this method - pre-allocate a full array of length - numHits, and fill the array with sentinel - objects. -

    -
    - - Public for extension only. - - - Expert: Common scoring functionality for different types of queries. - -

    - A Scorer iterates over documents matching a - query in increasing order of doc Id. -

    -

    - Document scores are computed using a given Similarity - implementation. -

    - -

    NOTE: The values Float.Nan, - Float.NEGATIVE_INFINITY and Float.POSITIVE_INFINITY are - not valid scores. Certain collectors (eg {@link - TopScoreDocCollector}) will not properly collect hits - with these scores. - -

    - - -
    - - This abstract class defines methods to iterate over a set of non-decreasing - doc ids. Note that this class assumes it iterates on doc Ids, and therefore - {@link #NO_MORE_DOCS} is set to {@value #NO_MORE_DOCS} in order to be used as - a sentinel object. Implementations of this class are expected to consider - {@link Integer#MAX_VALUE} as an invalid value. - - - - When returned by {@link #NextDoc()}, {@link #Advance(int)} and - {@link #Doc()} it means there are no more docs in the iterator. - - - - Unsupported anymore. Call {@link #DocID()} instead. This method throws - {@link UnsupportedOperationException} if called. - - - use {@link #DocID()} instead. - - - - Returns the following: -
      -
    • -1 or {@link #NO_MORE_DOCS} if {@link #NextDoc()} or - {@link #Advance(int)} were not called yet.
    • -
    • {@link #NO_MORE_DOCS} if the iterator has exhausted.
    • -
    • Otherwise it should return the doc ID it is currently on.
    • -
    -

    - NOTE: in 3.0, this method will become abstract. - -

    - 2.9 - -
    - - Unsupported anymore. Call {@link #NextDoc()} instead. This method throws - {@link UnsupportedOperationException} if called. - - - use {@link #NextDoc()} instead. This will be removed in 3.0 - - - - Unsupported anymore. Call {@link #Advance(int)} instead. This method throws - {@link UnsupportedOperationException} if called. - - - use {@link #Advance(int)} instead. This will be removed in 3.0 - - - - Advances to the next document in the set and returns the doc it is - currently on, or {@link #NO_MORE_DOCS} if there are no more docs in the - set.
    - - NOTE: in 3.0 this method will become abstract, following the removal - of {@link #Next()}. For backward compatibility it is implemented as: - -
    -            public int nextDoc() throws IOException {
    -            return next() ? doc() : NO_MORE_DOCS;
    -            }
    -            
    - - NOTE: after the iterator has exhausted you should not call this - method, as it may result in unpredicted behavior. - -
    - 2.9 - -
    - - Advances to the first beyond the current whose document number is greater - than or equal to target. Returns the current document number or - {@link #NO_MORE_DOCS} if there are no more docs in the set. -

    - Behaves as if written: - -

    -            int advance(int target) {
    -            int doc;
    -            while ((doc = nextDoc()) < target) {
    -            }
    -            return doc;
    -            }
    -            
    - - Some implementations are considerably more efficient than that. -

    - NOTE: certain implemenations may return a different value (each - time) if called several times in a row with the same target. -

    - NOTE: this method may be called with {@value #NO_MORE_DOCS} for - efficiency by some Scorers. If your implementation cannot efficiently - determine that it should exhaust, it is recommended that you check for that - value in each call to this method. -

    - NOTE: after the iterator has exhausted you should not call this - method, as it may result in unpredicted behavior. -

    - NOTE: in 3.0 this method will become abstract, following the removal - of {@link #SkipTo(int)}. - -

    - 2.9 - -
    - - Constructs a Scorer. - The Similarity implementation used by this scorer. - - - - Returns the Similarity implementation used by this scorer. - - - Scores and collects all matching documents. - The collector to which all matching documents are passed through - {@link HitCollector#Collect(int, float)}. -
    When this method is used the {@link #Explain(int)} method should not be used. - - use {@link #Score(Collector)} instead. - -
    - - Scores and collects all matching documents. - The collector to which all matching documents are passed. -
    When this method is used the {@link #Explain(int)} method should not be used. - -
    - - Expert: Collects matching documents in a range. Hook for optimization. - Note that {@link #Next()} must be called once before this method is called - for the first time. - - The collector to which all matching documents are passed through - {@link HitCollector#Collect(int, float)}. - - Do not score documents past this. - - true if more matching documents may remain. - - use {@link #Score(Collector, int, int)} instead. - - - - Expert: Collects matching documents in a range. Hook for optimization. - Note, firstDocID is added to ensure that {@link #NextDoc()} - was called before this method. - - - The collector to which all matching documents are passed. - - Do not score documents past this. - - - The first document ID (ensures {@link #NextDoc()} is called before - this method. - - true if more matching documents may remain. - - - - Returns the score of the current document matching the query. - Initially invalid, until {@link #Next()} or {@link #SkipTo(int)} - is called the first time, or when called from within - {@link Collector#collect}. - - - - Returns an explanation of the score for a document. -
    When this method is used, the {@link #Next()}, {@link #SkipTo(int)} and - {@link #Score(HitCollector)} methods should not be used. -
    - The document number for the explanation. - - - Please use {@link IndexSearcher#explain} - or {@link Weight#explain} instead. - -
    - - not needed anymore - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - use {@link #DocID()} instead. - - - - Expert: an enumeration of span matches. Used to implement span searching. - Each span represents a range of term positions within a document. Matches - are enumerated in order, by increasing document number, within that by - increasing start position and finally by increasing end position. - - - - Move to the next match, returning true iff any such exists. - - - Skips to the first match beyond the current, whose document number is - greater than or equal to target.

    Returns true iff there is such - a match.

    Behaves as if written:

    -            boolean skipTo(int target) {
    -            do {
    -            if (!next())
    -            return false;
    -            } while (target > doc());
    -            return true;
    -            }
    -            
    - Most implementations are considerably more efficient than that. -
    -
    - - Returns the document number of the current match. Initially invalid. - - - Returns the start position of the current match. Initially invalid. - - - Returns the end position of the current match. Initially invalid. - - - Returns the payload data for the current span. - This is invalid until {@link #Next()} is called for - the first time. - This method must not be called more than once after each call - of {@link #Next()}. However, most payloads are loaded lazily, - so if the payload data for the current position is not needed, - this method may not be called at all for performance reasons. An ordered - SpanQuery does not lazy load, so if you have payloads in your index and - you do not want ordered SpanNearQuerys to collect payloads, you can - disable collection with a constructor option.
    - - Note that the return type is a collection, thus the ordering should not be relied upon. -
    -

    - WARNING: The status of the Payloads feature is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case.

    - -

    - a List of byte arrays containing the data of this payload, otherwise null if isPayloadAvailable is false - - java.io.IOException -
    - - Checks if a payload can be loaded at this position. -

    - Payloads can only be loaded once per call to - {@link #Next()}. - -

    - true if there is a payload available at this position that can be loaded - -
    - - Removes matches which overlap with another SpanQuery. - - - Base class for span-based queries. - - - The abstract base class for queries. -

    Instantiable subclasses are: -

      -
    • {@link TermQuery}
    • -
    • {@link MultiTermQuery}
    • -
    • {@link BooleanQuery}
    • -
    • {@link WildcardQuery}
    • -
    • {@link PhraseQuery}
    • -
    • {@link PrefixQuery}
    • -
    • {@link MultiPhraseQuery}
    • -
    • {@link FuzzyQuery}
    • -
    • {@link TermRangeQuery}
    • -
    • {@link NumericRangeQuery}
    • -
    • {@link Lucene.Net.Search.Spans.SpanQuery}
    • -
    -

    A parser for queries is contained in: -

      -
    • {@link Lucene.Net.QueryParsers.QueryParser QueryParser}
    • -
    -
    -
    - - Sets the boost for this query clause to b. Documents - matching this clause will (in addition to the normal weightings) have - their score multiplied by b. - - - - Gets the boost for this clause. Documents matching - this clause will (in addition to the normal weightings) have their score - multiplied by b. The boost is 1.0 by default. - - - - Prints a query to a string, with field assumed to be the - default field and omitted. -

    The representation used is one that is supposed to be readable - by {@link Lucene.Net.QueryParsers.QueryParser QueryParser}. However, - there are the following limitations: -

      -
    • If the query was created by the parser, the printed - representation may not be exactly what was parsed. For example, - characters that need to be escaped will be represented without - the required backslash.
    • -
    • Some of the more complicated queries (e.g. span queries) - don't have a representation that can be parsed by QueryParser.
    • -
    -
    -
    - - Prints a query to a string. - - - Expert: Constructs an appropriate Weight implementation for this query. - -

    - Only implemented by primitive queries, which re-write to themselves. -

    -
    - - Expert: Constructs and initializes a Weight for a top-level query. - - - Expert: called to re-write queries into primitive queries. For example, - a PrefixQuery will be rewritten into a BooleanQuery that consists - of TermQuerys. - - - - Expert: called when re-writing queries under MultiSearcher. - - Create a single query suitable for use by all subsearchers (in 1-1 - correspondence with queries). This is an optimization of the OR of - all queries. We handle the common optimization cases of equal - queries and overlapping clauses of boolean OR queries (as generated - by MultiTermQuery.rewrite()). - Be careful overriding this method as queries[0] determines which - method will be called and is not necessarily of the same type as - the other queries. - - - - Expert: adds all terms occuring in this query to the terms set. Only - works if this query is in its {@link #rewrite rewritten} form. - - - UnsupportedOperationException if this query is not yet rewritten - - - Expert: merges the clauses of a set of BooleanQuery's into a single - BooleanQuery. - -

    A utility for use by {@link #Combine(Query[])} implementations. -

    -
    - - Expert: Returns the Similarity implementation to be used for this query. - Subclasses may override this method to specify their own Similarity - implementation, perhaps one that delegates through that of the Searcher. - By default the Searcher's Similarity implementation is returned. - - - - Returns a clone of this query. - - - Expert: Returns the matches for this query in an index. Used internally - to search for spans. - - - - Returns the name of the field matched by this query. - - - Returns a collection of all terms matched by this query. - use extractTerms instead - - - - - - Construct a SpanNotQuery matching spans from include which - have no overlap with spans from exclude. - - - - Return the SpanQuery whose matches are filtered. - - - Return the SpanQuery whose matches must not overlap those returned. - - - Returns a collection of all terms matched by this query. - use extractTerms instead - - - - - - Returns true iff o is equal to this. - - - A Filter that restricts search results to values that have a matching prefix in a given - field. - - - - A wrapper for {@link MultiTermQuery}, that exposes its - functionality as a {@link Filter}. -

    - MultiTermQueryWrapperFilter is not designed to - be used by itself. Normally you subclass it to provide a Filter - counterpart for a {@link MultiTermQuery} subclass. -

    - For example, {@link TermRangeFilter} and {@link PrefixFilter} extend - MultiTermQueryWrapperFilter. - This class also provides the functionality behind - {@link MultiTermQuery#CONSTANT_SCORE_FILTER_REWRITE}; - this is why it is not abstract. -

    -
    - - Abstract base class for restricting which documents may be returned during searching. -

    - Note: In Lucene 3.0 {@link #Bits(IndexReader)} will be removed - and {@link #GetDocIdSet(IndexReader)} will be defined as abstract. - All implementing classes must therefore implement {@link #GetDocIdSet(IndexReader)} - in order to work with Lucene 3.0. -

    -
    - - - - Creates a {@link DocIdSet} enumerating the documents that should be - permitted in search results. NOTE: null can be - returned if no documents are accepted by this Filter. -

    - Note: This method will be called once per segment in - the index during searching. The returned {@link DocIdSet} - must refer to document IDs for that segment, not for - the top-level reader. - - @param reader a {@link IndexReader} instance opened on the index currently - searched on. Note, it is likely that the provided reader does not - represent the whole underlying index i.e. if the index has more than - one segment the given reader only represents a single segment. - -

    - a DocIdSet that provides the documents which should be permitted or - prohibited in search results. NOTE: null can be returned if - no documents will be accepted by this Filter. - - - -
    - - Wrap a {@link MultiTermQuery} as a Filter. - - - Expert: Return the number of unique terms visited during execution of the filter. - If there are many of them, you may consider using another filter type - or optimize your total term count in index. -

    This method is not thread safe, be sure to only call it when no filter is running! - If you re-use the same filter instance for another - search, be sure to first reset the term counter - with {@link #clearTotalNumberOfTerms}. -

    - - -
    - - Expert: Resets the counting of unique terms. - Do this before executing the filter. - - - - - - Returns a BitSet with true for documents which should be - permitted in search results, and false for those that should - not. - - Use {@link #GetDocIdSet(IndexReader)} instead. - - - - Returns a DocIdSet with documents that should be - permitted in search results. - - - - Prints a user-readable version of this query. - - - A PriorityQueue maintains a partial ordering of its elements such that the - least element can always be found in constant time. Put()'s and pop()'s - require log(size) time. - -

    NOTE: This class pre-allocates a full array of - length maxSize+1, in {@link #initialize}. - -

    -
    - - Determines the ordering of objects in this priority queue. Subclasses - must define this one method. - - - - This method can be overridden by extending classes to return a sentinel - object which will be used by {@link #Initialize(int)} to fill the queue, so - that the code which uses that queue can always assume it's full and only - change the top without attempting to insert any new object.
    - - Those sentinel values should always compare worse than any non-sentinel - value (i.e., {@link #LessThan(Object, Object)} should always favor the - non-sentinel values).
    - - By default, this method returns false, which means the queue will not be - filled with sentinel values. Otherwise, the value returned will be used to - pre-populate the queue. Adds sentinel values to the queue.
    - - If this method is extended to return a non-null value, then the following - usage pattern is recommended: - -
    -            // extends getSentinelObject() to return a non-null value.
    -            PriorityQueue pq = new MyQueue(numHits);
    -            // save the 'top' element, which is guaranteed to not be null.
    -            MyObject pqTop = (MyObject) pq.top();
    -            <...>
    -            // now in order to add a new element, which is 'better' than top (after 
    -            // you've verified it is better), it is as simple as:
    -            pqTop.change().
    -            pqTop = pq.updateTop();
    -            
    - - NOTE: if this method returns a non-null value, it will be called by - {@link #Initialize(int)} {@link #Size()} times, relying on a new object to - be returned and will not check if it's null again. Therefore you should - ensure any call to this method creates a new instance and behaves - consistently, e.g., it cannot return null if it previously returned - non-null. - -
    - the sentinel object to use to pre-populate the queue, or null if - sentinel objects are not supported. - -
    - - Subclass constructors must call this. - - - Adds an Object to a PriorityQueue in log(size) time. If one tries to add - more objects than maxSize from initialize a RuntimeException - (ArrayIndexOutOfBound) is thrown. - - - use {@link #Add(Object)} which returns the new top object, - saving an additional call to {@link #Top()}. - - - - Adds an Object to a PriorityQueue in log(size) time. If one tries to add - more objects than maxSize from initialize an - {@link ArrayIndexOutOfBoundsException} is thrown. - - - the new 'top' element in the queue. - - - - Adds element to the PriorityQueue in log(size) time if either the - PriorityQueue is not full, or not lessThan(element, top()). - - - - - true if element is added, false otherwise. - - use {@link #InsertWithOverflow(Object)} instead, which - encourages objects reuse. - - - - insertWithOverflow() is the same as insert() except its - return value: it returns the object (if any) that was - dropped off the heap because it was full. This can be - the given parameter (in case it is smaller than the - full heap's minimum, and couldn't be added), or another - object that was previously the smallest value in the - heap and now has been replaced by a larger one, or null - if the queue wasn't yet full with maxSize elements. - - - - Returns the least element of the PriorityQueue in constant time. - - - Removes and returns the least element of the PriorityQueue in log(size) - time. - - - - Should be called when the Object at top changes values. Still log(n) worst - case, but it's at least twice as fast to - -
    -            pq.top().change();
    -            pq.adjustTop();
    -            
    - - instead of - -
    -            o = pq.pop();
    -            o.change();
    -            pq.push(o);
    -            
    - -
    - use {@link #UpdateTop()} which returns the new top element and - saves an additional call to {@link #Top()}. - -
    - - Should be called when the Object at top changes values. Still log(n) worst - case, but it's at least twice as fast to - -
    -            pq.top().change();
    -            pq.updateTop();
    -            
    - - instead of - -
    -            o = pq.pop();
    -            o.change();
    -            pq.push(o);
    -            
    - -
    - the new 'top' element. - -
    - - Returns the number of elements currently stored in the PriorityQueue. - - - Removes all entries from the PriorityQueue. - - - Creates a new instance with size elements. If - prePopulate is set to true, the queue will pre-populate itself - with sentinel objects and set its {@link #Size()} to size. In - that case, you should not rely on {@link #Size()} to get the number of - actual elements that were added to the queue, but keep track yourself.
    - NOTE: in case prePopulate is true, you should pop - elements from the queue using the following code example: - -
    -            PriorityQueue pq = new HitQueue(10, true); // pre-populate.
    -            ScoreDoc top = pq.top();
    -            
    -            // Add/Update one element.
    -            top.score = 1.0f;
    -            top.doc = 0;
    -            top = (ScoreDoc) pq.updateTop();
    -            int totalHits = 1;
    -            
    -            // Now pop only the elements that were *truly* inserted.
    -            // First, pop all the sentinel elements (there are pq.size() - totalHits).
    -            for (int i = pq.size() - totalHits; i > 0; i--) pq.pop();
    -            
    -            // Now pop the truly added elements.
    -            ScoreDoc[] results = new ScoreDoc[totalHits];
    -            for (int i = totalHits - 1; i >= 0; i--) {
    -            results[i] = (ScoreDoc) pq.pop();
    -            }
    -            
    - -

    NOTE: This class pre-allocate a full array of - length size. - -

    - the requested size of this queue. - - specifies whether to pre-populate the queue with sentinel values. - - - -
    - - Subclass of FilteredTermEnum for enumerating all terms that are similiar - to the specified filter term. - -

    Term enumerations are always ordered by Term.compareTo(). Each term in - the enumeration is greater than all that precede it. -

    -
    - - Abstract class for enumerating a subset of all terms. -

    Term enumerations are always ordered by Term.compareTo(). Each term in - the enumeration is greater than all that precede it. -

    -
    - - Abstract class for enumerating terms. -

    Term enumerations are always ordered by Term.compareTo(). Each term in - the enumeration is greater than all that precede it. -

    -
    - - Increments the enumeration to the next element. True if one exists. - - - Returns the current Term in the enumeration. - - - Returns the docFreq of the current Term in the enumeration. - - - Closes the enumeration to further activity, freeing resources. - - - Skips terms to the first beyond the current whose value is - greater or equal to target.

    Returns true iff there is such - an entry.

    Behaves as if written:

    -            public boolean skipTo(Term target) {
    -            do {
    -            if (!next())
    -            return false;
    -            } while (target > term());
    -            return true;
    -            }
    -            
    - Some implementations *could* be considerably more efficient than a linear scan. - Check the implementation to be sure. -
    - This method is not performant and will be removed in Lucene 3.0. - Use {@link IndexReader#Terms(Term)} to create a new TermEnum positioned at a - given term. - -
    - - the current term - - - the delegate enum - to set this member use {@link #setEnum} - - - Equality compare on the term - - - Equality measure on the term - - - Indicates the end of the enumeration has been reached - - - use this method to set the actual TermEnum (e.g. in ctor), - it will be automatically positioned on the first matching term. - - - - Returns the docFreq of the current Term in the enumeration. - Returns -1 if no Term matches or all terms have been enumerated. - - - - Increments the enumeration to the next element. True if one exists. - - - Returns the current Term in the enumeration. - Returns null if no Term matches or all terms have been enumerated. - - - - Closes the enumeration to further activity, freeing resources. - - - Creates a FuzzyTermEnum with an empty prefix and a minSimilarity of 0.5f. -

    - After calling the constructor the enumeration is already pointing to the first - valid term if such a term exists. - -

    - - - - - IOException - - -
    - - Creates a FuzzyTermEnum with an empty prefix. -

    - After calling the constructor the enumeration is already pointing to the first - valid term if such a term exists. - -

    - - - - - - - IOException - - -
    - - Constructor for enumeration of all terms from specified reader which share a prefix of - length prefixLength with term and which have a fuzzy similarity > - minSimilarity. -

    - After calling the constructor the enumeration is already pointing to the first - valid term if such a term exists. - -

    - Delivers terms. - - Pattern term. - - Minimum required similarity for terms from the reader. Default value is 0.5f. - - Length of required common prefix. Default value is 0. - - IOException -
    - - The termCompare method in FuzzyTermEnum uses Levenshtein distance to - calculate the distance between the given term and the comparing term. - - - - Finds and returns the smallest of three integers - - -

    Similarity returns a number that is 1.0f or less (including negative numbers) - based on how similar the Term is compared to a target term. It returns - exactly 0.0f when -

    -            editDistance < maximumEditDistance
    - Otherwise it returns: -
    -            1 - (editDistance / length)
    - where length is the length of the shortest term (text or target) including a - prefix that are identical and editDistance is the Levenshtein distance for - the two words.

    - -

    Embedded within this algorithm is a fail-fast Levenshtein distance - algorithm. The fail-fast algorithm differs from the standard Levenshtein - distance algorithm in that it is aborted if it is discovered that the - mimimum distance between the words is greater than some threshold. - -

    To calculate the maximum distance threshold we use the following formula: -

    -            (1 - minimumSimilarity) * length
    - where length is the shortest term including any prefix that is not part of the - similarity comparision. This formula was derived by solving for what maximum value - of distance returns false for the following statements: -
    -            similarity = 1 - ((float)distance / (float) (prefixLength + Math.min(textlen, targetlen)));
    -            return (similarity > minimumSimilarity);
    - where distance is the Levenshtein distance for the two words. -

    -

    Levenshtein distance (also known as edit distance) is a measure of similiarity - between two strings where the distance is measured as the number of character - deletions, insertions or substitutions required to transform one string to - the other string. -

    - the target word or phrase - - the similarity, 0.0 or less indicates that it matches less than the required - threshold and 1.0 indicates that the text and target are identical - -
    - - Grow the second dimension of the array, so that we can calculate the - Levenshtein difference. - - - - The max Distance is the maximum Levenshtein distance for the text - compared to some other value that results in score that is - better than the minimum similarity. - - the length of the "other value" - - the maximum levenshtein distance that we care about - - - - Expert: obtains float field values from the - {@link Lucene.Net.Search.FieldCache FieldCache} - using getFloats() and makes those values - available as other numeric types, casting as needed. - -

    - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

    - for requirements" - on the field. - -

    NOTE: with the switch in 2.9 to segment-based - searching, if {@link #getValues} is invoked with a - composite (multi-segment) reader, this can easily cause - double RAM usage for the values in the FieldCache. It's - best to switch your application to pass only atomic - (single segment) readers to this API. Alternatively, for - a short-term fix, you could wrap your ValueSource using - {@link MultiValueSource}, which costs more CPU per lookup - but will not consume double the FieldCache RAM.

    - - - -

    Expert: A base class for ValueSource implementations that retrieve values for - a single field from the {@link Lucene.Net.Search.FieldCache FieldCache}. -

    - Fields used herein nust be indexed (doesn't matter if these fields are stored or not). -

    - It is assumed that each such indexed field is untokenized, or at least has a single token in a document. - For documents with multiple tokens of the same field, behavior is undefined (It is likely that current - code would use the value of one of these tokens, but this is not guaranteed). -

    - Document with no tokens in this field are assigned the Zero value. - -

    - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

    NOTE: with the switch in 2.9 to segment-based - searching, if {@link #getValues} is invoked with a - composite (multi-segment) reader, this can easily cause - double RAM usage for the values in the FieldCache. It's - best to switch your application to pass only atomic - (single segment) readers to this API. Alternatively, for - a short-term fix, you could wrap your ValueSource using - {@link MultiValueSource}, which costs more CPU per lookup - but will not consume double the FieldCache RAM.

    -

    -
    - - Expert: source of values for basic function queries. -

    At its default/simplest form, values - one per doc - are used as the score of that doc. -

    Values are instantiated as - {@link Lucene.Net.Search.Function.DocValues DocValues} for a particular reader. -

    ValueSource implementations differ in RAM requirements: it would always be a factor - of the number of documents, but for each document the number of bytes can be 1, 2, 4, or 8. - -

    - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - - -

    -
    - - Return the DocValues used by the function query. - the IndexReader used to read these values. - If any caching is involved, that caching would also be IndexReader based. - - IOException for any error. - - - description of field, used in explain() - - - Needed for possible caching of query results - used by {@link ValueSourceQuery#equals(Object)}. - - - - - Needed for possible caching of query results - used by {@link ValueSourceQuery#hashCode()}. - - - - - Create a cached field source for the input field. - - - Return cached DocValues for input field and reader. - FieldCache so that values of a field are loaded once per reader (RAM allowing) - - Field for which values are required. - - - - - - Check if equals to another {@link FieldCacheSource}, already knowing that cache and field are equal. - - - - - Return a hash code of a {@link FieldCacheSource}, without the hash-codes of the field - and the cache (those are taken care of elsewhere). - - - - - - Create a cached float field source with default string-to-float parser. - - - Create a cached float field source with a specific string-to-float parser. - - - Expert: represents field values as different types. - Normally created via a - {@link Lucene.Net.Search.Function.ValueSource ValueSuorce} - for a particular field and reader. - -

    - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - - -

    -
    - - Return doc value as a float. -

    Mandatory: every DocValues implementation must implement at least this method. -

    - document whose float value is requested. - -
    - - Return doc value as an int. -

    Optional: DocValues implementation can (but don't have to) override this method. -

    - document whose int value is requested. - -
    - - Return doc value as a long. -

    Optional: DocValues implementation can (but don't have to) override this method. -

    - document whose long value is requested. - -
    - - Return doc value as a double. -

    Optional: DocValues implementation can (but don't have to) override this method. -

    - document whose double value is requested. - -
    - - Return doc value as a string. -

    Optional: DocValues implementation can (but don't have to) override this method. -

    - document whose string value is requested. - -
    - - Return a string representation of a doc value, as reuired for Explanations. - - - Explain the scoring value for the input doc. - - - Expert: for test purposes only, return the inner array of values, or null if not applicable. -

    - Allows tests to verify that loaded values are: -

      -
    1. indeed cached/reused.
    2. -
    3. stored in the expected size/type (byte/short/int/float).
    4. -
    - Note: implementations of DocValues must override this method for - these test elements to be tested, Otherwise the test would not fail, just - print a warning. -
    -
    - - Returns the minimum of all values or Float.NaN if this - DocValues instance does not contain any value. -

    - This operation is optional -

    - -

    - the minimum of all values or Float.NaN if this - DocValues instance does not contain any value. - -
    - - Returns the maximum of all values or Float.NaN if this - DocValues instance does not contain any value. -

    - This operation is optional -

    - -

    - the maximum of all values or Float.NaN if this - DocValues instance does not contain any value. - -
    - - Returns the average of all values or Float.NaN if this - DocValues instance does not contain any value. * -

    - This operation is optional -

    - -

    - the average of all values or Float.NaN if this - DocValues instance does not contain any value - -
    - - TermPositions provides an interface for enumerating the <document, - frequency, <position>* > tuples for a term.

    The document and - frequency are the same as for a TermDocs. The positions portion lists the ordinal - positions of each occurrence of a term in a document. - -

    - - -
    - - TermDocs provides an interface for enumerating <document, frequency> - pairs for a term.

    The document portion names each document containing - the term. Documents are indicated by number. The frequency portion gives - the number of times the term occurred in each document.

    The pairs are - ordered by document number. -

    - - -
    - - Sets this to the data for a term. - The enumeration is reset to the start of the data for this term. - - - - Sets this to the data for the current term in a {@link TermEnum}. - This may be optimized in some implementations. - - - - Returns the current document number.

    This is invalid until {@link - #Next()} is called for the first time. -

    -
    - - Returns the frequency of the term within the current document.

    This - is invalid until {@link #Next()} is called for the first time. -

    -
    - - Moves to the next pair in the enumeration.

    Returns true iff there is - such a next pair in the enumeration. -

    -
    - - Attempts to read multiple entries from the enumeration, up to length of - docs. Document numbers are stored in docs, and term - frequencies are stored in freqs. The freqs array must be as - long as the docs array. - -

    Returns the number of entries read. Zero is only returned when the - stream has been exhausted. -

    -
    - - Skips entries to the first beyond the current whose document number is - greater than or equal to target.

    Returns true iff there is such - an entry.

    Behaves as if written:

    -            boolean skipTo(int target) {
    -            do {
    -            if (!next())
    -            return false;
    -            } while (target > doc());
    -            return true;
    -            }
    -            
    - Some implementations are considerably more efficient than that. -
    -
    - - Frees associated resources. - - - Returns next position in the current document. It is an error to call - this more than {@link #Freq()} times - without calling {@link #Next()}

    This is - invalid until {@link #Next()} is called for - the first time. -

    -
    - - Returns the length of the payload at the current term position. - This is invalid until {@link #NextPosition()} is called for - the first time.
    -
    - length of the current payload in number of bytes - -
    - - Returns the payload data at the current term position. - This is invalid until {@link #NextPosition()} is called for - the first time. - This method must not be called more than once after each call - of {@link #NextPosition()}. However, payloads are loaded lazily, - so if the payload data for the current position is not needed, - this method may not be called at all for performance reasons.
    - -
    - the array into which the data of this payload is to be - stored, if it is big enough; otherwise, a new byte[] array - is allocated for this purpose. - - the offset in the array into which the data of this payload - is to be stored. - - a byte[] array containing the data of this payload - - IOException -
    - - Checks if a payload can be loaded at this position. -

    - Payloads can only be loaded once per call to - {@link #NextPosition()}. - -

    - true if there is a payload available at this position that can be loaded - -
    - - A TermInfo is the record of information stored for a term. - - - The number of documents which contain the term. - - - A Term represents a word from text. This is the unit of search. It is - composed of two elements, the text of the word, as a string, and the name of - the field that the text occured in, an interned string. - Note that terms may represent more than words from text fields, but also - things like dates, email addresses, urls, etc. - - - - Constructs a Term with the given field and text. -

    Note that a null field or null text value results in undefined - behavior for most Lucene APIs that accept a Term parameter. -

    -
    - - Constructs a Term with the given field and empty text. - This serves two purposes: 1) reuse of a Term with the same field. - 2) pattern for a query. - - - - - - - Returns the field of this term, an interned string. The field indicates - the part of a document which this term came from. - - - - Returns the text of this term. In the case of words, this is simply the - text of the word. In the case of dates and other types, this is an - encoding of the object as a string. - - - - Optimized construction of new Terms by reusing same field as this Term - - avoids field.intern() overhead - - The text of the new term (field is implicitly same as this Term instance) - - A new Term - - - - Compares two terms, returning a negative integer if this - term belongs before the argument, zero if this term is equal to the - argument, and a positive integer if this term belongs after the argument. - The ordering of terms is first by field, then by text. - - - - Resets the field and text of a Term. - - - An IndexReader which reads multiple, parallel indexes. Each index added - must have the same number of documents, but typically each contains - different fields. Each document contains the union of the fields of all - documents with the same document number. When searching, matches for a - query term are from the first index added that has the field. - -

    This is useful, e.g., with collections that have large fields which - change rarely and small fields that change more frequently. The smaller - fields may be re-indexed in a new index and both indexes may be searched - together. - -

    Warning: It is up to you to make sure all indexes - are created and modified the same way. For example, if you add - documents to one index, you need to add the same documents in the - same order to the other indexes. Failure to do so will result in - undefined behavior. -

    -
    - - IndexReader is an abstract class, providing an interface for accessing an - index. Search of an index is done entirely through this abstract interface, - so that any subclass which implements it is searchable. -

    Concrete subclasses of IndexReader are usually constructed with a call to - one of the static open() methods, e.g. {@link - #Open(String, boolean)}. -

    For efficiency, in this API documents are often referred to via - document numbers, non-negative integers which each name a unique - document in the index. These document numbers are ephemeral--they may change - as documents are added to and deleted from an index. Clients should thus not - rely on a given document having the same number between sessions. -

    An IndexReader can be opened on a directory for which an IndexWriter is - opened already, but it cannot be used to delete documents from the index then. -

    - NOTE: for backwards API compatibility, several methods are not listed - as abstract, but have no useful implementations in this base class and - instead always throw UnsupportedOperationException. Subclasses are - strongly encouraged to override these methods, but in many cases may not - need to. -

    -

    - NOTE: as of 2.4, it's possible to open a read-only - IndexReader using one of the static open methods that - accepts the boolean readOnly parameter. Such a reader has - better concurrency as it's not necessary to synchronize on - the isDeleted method. Currently the default for readOnly - is false, meaning if not specified you will get a - read/write IndexReader. But in 3.0 this default will - change to true, meaning you must explicitly specify false - if you want to make changes with the resulting IndexReader. -

    -

    NOTE: {@link - IndexReader} instances are completely thread - safe, meaning multiple threads can call any of its methods, - concurrently. If your application requires external - synchronization, you should not synchronize on the - IndexReader instance; use your own - (non-Lucene) objects instead. -

    - $Id: IndexReader.java 826049 2009-10-16 19:28:55Z mikemccand $ - -
    - - Expert: returns the current refCount for this reader - - - Expert: increments the refCount of this IndexReader - instance. RefCounts are used to determine when a - reader can be closed safely, i.e. as soon as there are - no more references. Be sure to always call a - corresponding {@link #decRef}, in a finally clause; - otherwise the reader may never be closed. Note that - {@link #close} simply calls decRef(), which means that - the IndexReader will not really be closed until {@link - #decRef} has been called for all outstanding - references. - - - - - - - Expert: decreases the refCount of this IndexReader - instance. If the refCount drops to 0, then pending - changes (if any) are committed to the index and this - reader is closed. - - - IOException in case an IOException occurs in commit() or doClose() - - - - - - - will be deleted when IndexReader(Directory) is deleted - - - - - - Legacy Constructor for backwards compatibility. - -

    - This Constructor should not be used, it exists for backwards - compatibility only to support legacy subclasses that did not "own" - a specific directory, but needed to specify something to be returned - by the directory() method. Future subclasses should delegate to the - no arg constructor and implement the directory() method as appropriate. - -

    - Directory to be returned by the directory() method - - - - - use IndexReader() - -
    - - AlreadyClosedException if this IndexReader is closed - - - Returns a read/write IndexReader reading the index in an FSDirectory in the named - path. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use {@link #Open(Directory, boolean)} instead. - This method will be removed in the 3.0 release. - - - the path to the index directory - - - - Returns an IndexReader reading the index in an - FSDirectory in the named path. You should pass - readOnly=true, since it gives much better concurrent - performance, unless you intend to do write operations - (delete documents or change norms) with the reader. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - the path to the index directory - - true if this should be a readOnly - reader - - Use {@link #Open(Directory, boolean)} instead. - This method will be removed in the 3.0 release. - - - - - Returns a read/write IndexReader reading the index in an FSDirectory in the named - path. - - the path to the index directory - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use {@link #Open(Directory, boolean)} instead. - This method will be removed in the 3.0 release. - - - - - Returns an IndexReader reading the index in an - FSDirectory in the named path. You should pass - readOnly=true, since it gives much better concurrent - performance, unless you intend to do write operations - (delete documents or change norms) with the reader. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - the path to the index directory - - true if this should be a readOnly - reader - - Use {@link #Open(Directory, boolean)} instead. - This method will be removed in the 3.0 release. - - - - - Returns a read/write IndexReader reading the index in - the given Directory. - - the index directory - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use {@link #Open(Directory, boolean)} instead - This method will be removed in the 3.0 release. - - - - - Returns an IndexReader reading the index in the given - Directory. You should pass readOnly=true, since it - gives much better concurrent performance, unless you - intend to do write operations (delete documents or - change norms) with the reader. - - the index directory - - true if no changes (deletions, norms) will be made with this IndexReader - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Expert: returns a read/write IndexReader reading the index in the given - {@link IndexCommit}. - - the commit point to open - - CorruptIndexException if the index is corrupt - Use {@link #Open(IndexCommit, boolean)} instead. - This method will be removed in the 3.0 release. - - - IOException if there is a low-level IO error - - - Expert: returns an IndexReader reading the index in the given - {@link IndexCommit}. You should pass readOnly=true, since it - gives much better concurrent performance, unless you - intend to do write operations (delete documents or - change norms) with the reader. - - the commit point to open - - true if no changes (deletions, norms) will be made with this IndexReader - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Expert: returns a read/write IndexReader reading the index in the given - Directory, with a custom {@link IndexDeletionPolicy}. - - the index directory - - a custom deletion policy (only used - if you use this reader to perform deletes or to set - norms); see {@link IndexWriter} for details. - - Use {@link #Open(Directory, IndexDeletionPolicy, boolean)} instead. - This method will be removed in the 3.0 release. - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Expert: returns an IndexReader reading the index in - the given Directory, with a custom {@link - IndexDeletionPolicy}. You should pass readOnly=true, - since it gives much better concurrent performance, - unless you intend to do write operations (delete - documents or change norms) with the reader. - - the index directory - - a custom deletion policy (only used - if you use this reader to perform deletes or to set - norms); see {@link IndexWriter} for details. - - true if no changes (deletions, norms) will be made with this IndexReader - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Expert: returns an IndexReader reading the index in - the given Directory, with a custom {@link - IndexDeletionPolicy}. You should pass readOnly=true, - since it gives much better concurrent performance, - unless you intend to do write operations (delete - documents or change norms) with the reader. - - the index directory - - a custom deletion policy (only used - if you use this reader to perform deletes or to set - norms); see {@link IndexWriter} for details. - - true if no changes (deletions, norms) will be made with this IndexReader - - Subsamples which indexed - terms are loaded into RAM. This has the same effect as {@link - IndexWriter#setTermIndexInterval} except that setting - must be done at indexing time while this setting can be - set per reader. When set to N, then one in every - N*termIndexInterval terms in the index is loaded into - memory. By setting this to a value > 1 you can reduce - memory usage, at the expense of higher latency when - loading a TermInfo. The default value is 1. Set this - to -1 to skip loading the terms index entirely. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Expert: returns a read/write IndexReader reading the index in the given - Directory, using a specific commit and with a custom - {@link IndexDeletionPolicy}. - - the specific {@link IndexCommit} to open; - see {@link IndexReader#listCommits} to list all commits - in a directory - - a custom deletion policy (only used - if you use this reader to perform deletes or to set - norms); see {@link IndexWriter} for details. - - Use {@link #Open(IndexCommit, IndexDeletionPolicy, boolean)} instead. - This method will be removed in the 3.0 release. - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Expert: returns an IndexReader reading the index in - the given Directory, using a specific commit and with - a custom {@link IndexDeletionPolicy}. You should pass - readOnly=true, since it gives much better concurrent - performance, unless you intend to do write operations - (delete documents or change norms) with the reader. - - the specific {@link IndexCommit} to open; - see {@link IndexReader#listCommits} to list all commits - in a directory - - a custom deletion policy (only used - if you use this reader to perform deletes or to set - norms); see {@link IndexWriter} for details. - - true if no changes (deletions, norms) will be made with this IndexReader - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Expert: returns an IndexReader reading the index in - the given Directory, using a specific commit and with - a custom {@link IndexDeletionPolicy}. You should pass - readOnly=true, since it gives much better concurrent - performance, unless you intend to do write operations - (delete documents or change norms) with the reader. - - the specific {@link IndexCommit} to open; - see {@link IndexReader#listCommits} to list all commits - in a directory - - a custom deletion policy (only used - if you use this reader to perform deletes or to set - norms); see {@link IndexWriter} for details. - - true if no changes (deletions, norms) will be made with this IndexReader - - Subsambles which indexed - terms are loaded into RAM. This has the same effect as {@link - IndexWriter#setTermIndexInterval} except that setting - must be done at indexing time while this setting can be - set per reader. When set to N, then one in every - N*termIndexInterval terms in the index is loaded into - memory. By setting this to a value > 1 you can reduce - memory usage, at the expense of higher latency when - loading a TermInfo. The default value is 1. Set this - to -1 to skip loading the terms index entirely. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Refreshes an IndexReader if the index has changed since this instance - was (re)opened. -

    - Opening an IndexReader is an expensive operation. This method can be used - to refresh an existing IndexReader to reduce these costs. This method - tries to only load segments that have changed or were created after the - IndexReader was (re)opened. -

    - If the index has not changed since this instance was (re)opened, then this - call is a NOOP and returns this instance. Otherwise, a new instance is - returned. The old instance is not closed and remains usable.
    -

    - If the reader is reopened, even though they share - resources internally, it's safe to make changes - (deletions, norms) with the new reader. All shared - mutable state obeys "copy on write" semantics to ensure - the changes are not seen by other readers. -

    - You can determine whether a reader was actually reopened by comparing the - old instance with the instance returned by this method: -

    -            IndexReader reader = ... 
    -            ...
    -            IndexReader newReader = r.reopen();
    -            if (newReader != reader) {
    -            ...     // reader was reopened
    -            reader.close(); 
    -            }
    -            reader = newReader;
    -            ...
    -            
    - - Be sure to synchronize that code so that other threads, - if present, can never use reader after it has been - closed and before it's switched to newReader. - -

    NOTE: If this reader is a near real-time - reader (obtained from {@link IndexWriter#GetReader()}, - reopen() will simply call writer.getReader() again for - you, though this may change in the future. - -

    - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Just like {@link #Reopen()}, except you can change the - readOnly of the original reader. If the index is - unchanged but readOnly is different then a new reader - will be returned. - - - - Expert: reopen this reader on a specific commit point. - This always returns a readOnly reader. If the - specified commit point matches what this reader is - already on, and this reader is already readOnly, then - this same instance is returned; if it is not already - readOnly, a readOnly clone is returned. - - - - Efficiently clones the IndexReader (sharing most - internal state). -

    - On cloning a reader with pending changes (deletions, - norms), the original reader transfers its write lock to - the cloned reader. This means only the cloned reader - may make further changes to the index, and commit the - changes to the index on close, but the old reader still - reflects all changes made up until it was cloned. -

    - Like {@link #Reopen()}, it's safe to make changes to - either the original or the cloned reader: all shared - mutable state obeys "copy on write" semantics to ensure - the changes are not seen by other readers. -

    -

    - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Clones the IndexReader and optionally changes readOnly. A readOnly - reader cannot open a writeable reader. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Returns the directory associated with this index. The Default - implementation returns the directory specified by subclasses when - delegating to the IndexReader(Directory) constructor, or throws an - UnsupportedOperationException if one was not specified. - - UnsupportedOperationException if no directory - - - Returns the time the index in the named directory was last modified. - Do not use this to check whether the reader is still up-to-date, use - {@link #IsCurrent()} instead. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use {@link #LastModified(Directory)} instead. - This method will be removed in the 3.0 release. - - - - Returns the time the index in the named directory was last modified. - Do not use this to check whether the reader is still up-to-date, use - {@link #IsCurrent()} instead. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use {@link #LastModified(Directory)} instead. - This method will be removed in the 3.0 release. - - - - - Returns the time the index in the named directory was last modified. - Do not use this to check whether the reader is still up-to-date, use - {@link #IsCurrent()} instead. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Reads version number from segments files. The version number is - initialized with a timestamp and then increased by one for each change of - the index. - - - where the index resides. - - version number. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use {@link #GetCurrentVersion(Directory)} instead. - This method will be removed in the 3.0 release. - - - - Reads version number from segments files. The version number is - initialized with a timestamp and then increased by one for each change of - the index. - - - where the index resides. - - version number. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use {@link #GetCurrentVersion(Directory)} instead. - This method will be removed in the 3.0 release. - - - - Reads version number from segments files. The version number is - initialized with a timestamp and then increased by one for each change of - the index. - - - where the index resides. - - version number. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Reads commitUserData, previously passed to {@link - IndexWriter#Commit(Map)}, from current index - segments file. This will return null if {@link - IndexWriter#Commit(Map)} has never been called for - this index. - - - where the index resides. - - commit userData. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - - - - - Version number when this IndexReader was opened. Not implemented in the - IndexReader base class. - -

    - If this reader is based on a Directory (ie, was created by calling - {@link #Open}, or {@link #Reopen} on a reader based on a Directory), then - this method returns the version recorded in the commit that the reader - opened. This version is advanced every time {@link IndexWriter#Commit} is - called. -

    - -

    - If instead this reader is a near real-time reader (ie, obtained by a call - to {@link IndexWriter#GetReader}, or by calling {@link #Reopen} on a near - real-time reader), then this method returns the version of the last - commit done by the writer. Note that even as further changes are made - with the writer, the version will not changed until a commit is - completed. Thus, you should not rely on this method to determine when a - near real-time reader should be opened. Use {@link #IsCurrent} instead. -

    - -

    - UnsupportedOperationException - unless overridden in subclass - -
    - - Retrieve the String userData optionally passed to - IndexWriter#commit. This will return null if {@link - IndexWriter#Commit(Map)} has never been called for - this index. - - - - - - -

    For IndexReader implementations that use - TermInfosReader to read terms, this sets the - indexDivisor to subsample the number of indexed terms - loaded into memory. This has the same effect as {@link - IndexWriter#setTermIndexInterval} except that setting - must be done at indexing time while this setting can be - set per reader. When set to N, then one in every - N*termIndexInterval terms in the index is loaded into - memory. By setting this to a value > 1 you can reduce - memory usage, at the expense of higher latency when - loading a TermInfo. The default value is 1.

    - - NOTE: you must call this before the term - index is loaded. If the index is already loaded, - an IllegalStateException is thrown. -

    - IllegalStateException if the term index has already been loaded into memory - Please use {@link IndexReader#Open(Directory, IndexDeletionPolicy, boolean, int)} to specify the required TermInfos index divisor instead. - -
    - -

    For IndexReader implementations that use - TermInfosReader to read terms, this returns the - current indexDivisor as specified when the reader was - opened. -

    -
    - - Check whether any new changes have occurred to the index since this - reader was opened. - -

    - If this reader is based on a Directory (ie, was created by calling - {@link #open}, or {@link #reopen} on a reader based on a Directory), then - this method checks if any further commits (see {@link IndexWriter#commit} - have occurred in that directory). -

    - -

    - If instead this reader is a near real-time reader (ie, obtained by a call - to {@link IndexWriter#getReader}, or by calling {@link #reopen} on a near - real-time reader), then this method checks if either a new commmit has - occurred, or any new uncommitted changes have taken place via the writer. - Note that even if the writer has only performed merging, this method will - still return false. -

    - -

    - In any event, if this returns false, you should call {@link #reopen} to - get a new reader that sees the changes. -

    - -

    - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - UnsupportedOperationException unless overridden in subclass -
    - - Checks is the index is optimized (if it has a single segment and - no deletions). Not implemented in the IndexReader base class. - - true if the index is optimized; false otherwise - - UnsupportedOperationException unless overridden in subclass - - - Return an array of term frequency vectors for the specified document. - The array contains a vector for each vectorized field in the document. - Each vector contains terms and frequencies for all terms in a given vectorized field. - If no such fields existed, the method returns null. The term vectors that are - returned may either be of type {@link TermFreqVector} - or of type {@link TermPositionVector} if - positions or offsets have been stored. - - - document for which term frequency vectors are returned - - array of term frequency vectors. May be null if no term vectors have been - stored for the specified document. - - IOException if index cannot be accessed - - - - - Return a term frequency vector for the specified document and field. The - returned vector contains terms and frequencies for the terms in - the specified field of this document, if the field had the storeTermVector - flag set. If termvectors had been stored with positions or offsets, a - {@link TermPositionVector} is returned. - - - document for which the term frequency vector is returned - - field for which the term frequency vector is returned. - - term frequency vector May be null if field does not exist in the specified - document or term vector was not stored. - - IOException if index cannot be accessed - - - - - Load the Term Vector into a user-defined data structure instead of relying on the parallel arrays of - the {@link TermFreqVector}. - - The number of the document to load the vector for - - The name of the field to load - - The {@link TermVectorMapper} to process the vector. Must not be null - - IOException if term vectors cannot be accessed or if they do not exist on the field and doc. specified. - - - - - Map all the term vectors for all fields in a Document - The number of the document to load the vector for - - The {@link TermVectorMapper} to process the vector. Must not be null - - IOException if term vectors cannot be accessed or if they do not exist on the field and doc. specified. - - - Returns true if an index exists at the specified directory. - If the directory does not exist or if there is no index in it. - false is returned. - - the directory to check for an index - - true if an index exists; false otherwise - - Use {@link #IndexExists(Directory)} instead - This method will be removed in the 3.0 release. - - - - - Returns true if an index exists at the specified directory. - If the directory does not exist or if there is no index in it. - - the directory to check for an index - - true if an index exists; false otherwise - - Use {@link #IndexExists(Directory)} instead. - This method will be removed in the 3.0 release. - - - - - Returns true if an index exists at the specified directory. - If the directory does not exist or if there is no index in it. - - the directory to check for an index - - true if an index exists; false otherwise - - IOException if there is a problem with accessing the index - - - Returns the number of documents in this index. - - - Returns one greater than the largest possible document number. - This may be used to, e.g., determine how big to allocate an array which - will have an element for every document number in an index. - - - - Returns the number of deleted documents. - - - Returns the stored fields of the nth - Document in this index. -

    - NOTE: for performance reasons, this method does not check if the - requested document is deleted, and therefore asking for a deleted document - may yield unspecified results. Usually this is not required, however you - can call {@link #IsDeleted(int)} with the requested document ID to verify - the document is not deleted. - -

    - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Get the {@link Lucene.Net.Documents.Document} at the n - th position. The {@link FieldSelector} may be used to determine - what {@link Lucene.Net.Documents.Field}s to load and how they should - be loaded. NOTE: If this Reader (more specifically, the underlying - FieldsReader) is closed before the lazy - {@link Lucene.Net.Documents.Field} is loaded an exception may be - thrown. If you want the value of a lazy - {@link Lucene.Net.Documents.Field} to be available after closing you - must explicitly load it or fetch the Document again with a new loader. -

    - NOTE: for performance reasons, this method does not check if the - requested document is deleted, and therefore asking for a deleted document - may yield unspecified results. Usually this is not required, however you - can call {@link #IsDeleted(int)} with the requested document ID to verify - the document is not deleted. - -

    - Get the document at the nth position - - The {@link FieldSelector} to use to determine what - Fields should be loaded on the Document. May be null, in which case - all Fields will be loaded. - - The stored fields of the - {@link Lucene.Net.Documents.Document} at the nth position - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - - - - - - -
    - - Returns true if document n has been deleted - - - Returns true if any documents have been deleted - - - Returns true if there are norms stored for this field. - - - Returns the byte-encoded normalization factor for the named field of - every document. This is used by the search code to score documents. - - - - - - - Reads the byte-encoded normalization factor for the named field of every - document. This is used by the search code to score documents. - - - - - - - Expert: Resets the normalization factor for the named field of the named - document. The norm represents the product of the field's {@link - Lucene.Net.Documents.Fieldable#SetBoost(float) boost} and its {@link Similarity#LengthNorm(String, - int) length normalization}. Thus, to preserve the length normalization - values when resetting this, one should base the new value upon the old. - - NOTE: If this field does not store norms, then - this method call will silently do nothing. - - - - - - - StaleReaderException if the index has changed - since this reader was opened - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Implements setNorm in subclass. - - - Expert: Resets the normalization factor for the named field of the named - document. - - - - - - - - StaleReaderException if the index has changed - since this reader was opened - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Returns an enumeration of all the terms in the index. The - enumeration is ordered by Term.compareTo(). Each term is greater - than all that precede it in the enumeration. Note that after - calling terms(), {@link TermEnum#Next()} must be called - on the resulting enumeration before calling other methods such as - {@link TermEnum#Term()}. - - IOException if there is a low-level IO error - - - Returns an enumeration of all terms starting at a given term. If - the given term does not exist, the enumeration is positioned at the - first term greater than the supplied term. The enumeration is - ordered by Term.compareTo(). Each term is greater than all that - precede it in the enumeration. - - IOException if there is a low-level IO error - - - Returns the number of documents containing the term t. - IOException if there is a low-level IO error - - - Returns an enumeration of all the documents which contain - term. For each document, the document number, the frequency of - the term in that document is also provided, for use in - search scoring. If term is null, then all non-deleted - docs are returned with freq=1. - Thus, this method implements the mapping: -

      - Term    =>    <docNum, freq>* -
    -

    The enumeration is ordered by document number. Each document number - is greater than all that precede it in the enumeration. -

    - IOException if there is a low-level IO error -
    - - Returns an unpositioned {@link TermDocs} enumerator. - IOException if there is a low-level IO error - - - Returns an enumeration of all the documents which contain - term. For each document, in addition to the document number - and frequency of the term in that document, a list of all of the ordinal - positions of the term in the document is available. Thus, this method - implements the mapping: - -

      - Term    =>    <docNum, freq, - <pos1, pos2, ... - posfreq-1> - >* -
    -

    This positional information facilitates phrase and proximity searching. -

    The enumeration is ordered by document number. Each document number is - greater than all that precede it in the enumeration. -

    - IOException if there is a low-level IO error -
    - - Returns an unpositioned {@link TermPositions} enumerator. - IOException if there is a low-level IO error - - - Deletes the document numbered docNum. Once a document is - deleted it will not appear in TermDocs or TermPostitions enumerations. - Attempts to read its field with the {@link #document} - method will result in an error. The presence of this document may still be - reflected in the {@link #docFreq} statistic, though - this will be corrected eventually as the index is further modified. - - - StaleReaderException if the index has changed - since this reader was opened - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Implements deletion of the document numbered docNum. - Applications should call {@link #DeleteDocument(int)} or {@link #DeleteDocuments(Term)}. - - - - Deletes all documents that have a given term indexed. - This is useful if one uses a document field to hold a unique ID string for - the document. Then to delete such a document, one merely constructs a - term with the appropriate field and the unique ID string as its text and - passes it to this method. - See {@link #DeleteDocument(int)} for information about when this deletion will - become effective. - - - the number of documents deleted - - StaleReaderException if the index has changed - since this reader was opened - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Undeletes all documents currently marked as deleted in this index. - - - StaleReaderException if the index has changed - since this reader was opened - - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Implements actual undeleteAll() in subclass. - - - Does nothing by default. Subclasses that require a write lock for - index modifications must implement this method. - - - - - IOException - - - Opaque Map (String -> String) - that's recorded into the segments file in the index, - and retrievable by {@link - IndexReader#getCommitUserData}. - - IOException - - - Commit changes resulting from delete, undeleteAll, or - setNorm operations - - If an exception is hit, then either no changes or all - changes will have been committed to the index - (transactional semantics). - - IOException if there is a low-level IO error - - - Commit changes resulting from delete, undeleteAll, or - setNorm operations - - If an exception is hit, then either no changes or all - changes will have been committed to the index - (transactional semantics). - - IOException if there is a low-level IO error - - - Implements commit. - Please implement {@link #DoCommit(Map) - instead}. - - - - Implements commit. NOTE: subclasses should override - this. In 3.0 this will become an abstract method. - - - - Closes files associated with this index. - Also saves any new deletions to disk. - No other methods should be called after this has been called. - - IOException if there is a low-level IO error - - - - .NET - - - - Implements close. - - - Get a list of unique field names that exist in this index and have the specified - field option information. - - specifies which field option should be available for the returned fields - - Collection of Strings indicating the names of the fields. - - - - - - Returns true iff the index in the named directory is - currently locked. - - the directory to check for a lock - - IOException if there is a low-level IO error - Please use {@link IndexWriter#IsLocked(Directory)} instead. - This method will be removed in the 3.0 release. - - - - - Returns true iff the index in the named directory is - currently locked. - - the directory to check for a lock - - IOException if there is a low-level IO error - Use {@link #IsLocked(Directory)} instead. - This method will be removed in the 3.0 release. - - - - - Forcibly unlocks the index in the named directory. -

    - Caution: this should only be used by failure recovery code, - when it is known that no other process nor thread is in fact - currently accessing this index. -

    - Please use {@link IndexWriter#Unlock(Directory)} instead. - This method will be removed in the 3.0 release. - - -
    - - Expert: return the IndexCommit that this reader has - opened. This method is only implemented by those - readers that correspond to a Directory with its own - segments_N file. - -

    WARNING: this API is new and experimental and - may suddenly change.

    -

    -
    - - Prints the filename and size of each file within a given compound file. - Add the -extract flag to extract files to the current working directory. - In order to make the extracted version of the index work, you have to copy - the segments file from the compound index into the directory where the extracted files are stored. - - Usage: Lucene.Net.Index.IndexReader [-extract] <cfsfile> - - - - Returns all commit points that exist in the Directory. - Normally, because the default is {@link - KeepOnlyLastCommitDeletionPolicy}, there would be only - one commit point. But if you're using a custom {@link - IndexDeletionPolicy} then there could be many commits. - Once you have a given commit, you can open a reader on - it by calling {@link IndexReader#Open(IndexCommit)} - There must be at least one commit in - the Directory, else this method throws {@link - java.io.IOException}. Note that if a commit is in - progress while this method is running, that commit - may or may not be returned array. - - - - Expert: returns the sequential sub readers that this - reader is logically composed of. For example, - IndexSearcher uses this API to drive searching by one - sub reader at a time. If this reader is not composed - of sequential child readers, it should return null. - If this method returns an empty array, that means this - reader is a null reader (for example a MultiReader - that has no sub readers). -

    - NOTE: You should not try using sub-readers returned by - this method to make any changes (setNorm, deleteDocument, - etc.). While this might succeed for one composite reader - (like MultiReader), it will most likely lead to index - corruption for other readers (like DirectoryReader obtained - through {@link #open}. Use the parent reader directly. -

    -
    - - Expert - - - - - Expert. Warning: this returns null if the reader has - no deletions - - - Returns the number of unique terms (across all fields) - in this reader. - - This method returns long, even though internally - Lucene cannot handle more than 2^31 unique terms, for - a possible future when this limitation is removed. - - - UnsupportedOperationException if this count - cannot be easily determined (eg Multi*Readers). - Instead, you should call {@link - #getSequentialSubReaders} and ask each sub reader for - its unique term count. - - - - Expert: Return the state of the flag that disables fakes norms in favor of representing the absence of field norms with null. - true if fake norms are disabled - - This currently defaults to false (to remain - back-compatible), but in 3.0 it will be hardwired to - true, meaning the norms() methods will return null for - fields that had disabled norms. - - - - Expert: Set the state of the flag that disables fakes norms in favor of representing the absence of field norms with null. - true to disable fake norms, false to preserve the legacy behavior - - This currently defaults to false (to remain - back-compatible), but in 3.0 it will be hardwired to - true, meaning the norms() methods will return null for - fields that had disabled norms. - - - - Utility class for executing code that needs to do - something with the current segments file. This is - necessary with lock-less commits because from the time - you locate the current segments file name, until you - actually open it, read its contents, or check modified - time, etc., it could have been deleted due to a writer - commit finishing. - - - - A collection of segmentInfo objects with methods for operating on - those segments in relation to the file system. - -

    NOTE: This API is new and still experimental - (subject to change suddenly in the next release)

    -

    -
    - - The file format version, a negative number. - - - This format adds details used for lockless commits. It differs - slightly from the previous format in that file names - are never re-used (write once). Instead, each file is - written to the next generation. For example, - segments_1, segments_2, etc. This allows us to not use - a commit lock. See file - formats for details. - - - - This format adds a "hasSingleNormFile" flag into each segment info. - See LUCENE-756 - for details. - - - - This format allows multiple segments to share a single - vectors and stored fields file. - - - - This format adds a checksum at the end of the file to - ensure all bytes were successfully written. - - - - This format adds the deletion count for each segment. - This way IndexWriter can efficiently report numDocs(). - - - - This format adds the boolean hasProx to record if any - fields in the segment store prox information (ie, have - omitTermFreqAndPositions==false) - - - - This format adds optional commit userData (String) storage. - - - This format adds optional per-segment String - dianostics storage, and switches userData to Map - - - - counts how often the index has been changed by adding or deleting docs. - starting with the current time in milliseconds forces to create unique version numbers. - - - - If non-null, information about loading segments_N files - - - - - Get the generation (N) of the current segments_N file - from a list of files. - - - -- array of file names to check - - - - Get the generation (N) of the current segments_N file - in the directory. - - - -- directory to search for the latest segments_N file - - - - Get the filename of the current segments_N file - from a list of files. - - - -- array of file names to check - - - - Get the filename of the current segments_N file - in the directory. - - - -- directory to search for the latest segments_N file - - - - Get the segments_N filename in use by this segment infos. - - - Parse the generation off the segments file name and - return it. - - - - Get the next segments_N filename that will be written. - - - Read a particular segmentFileName. Note that this may - throw an IOException if a commit is in process. - - - -- directory containing the segments file - - -- segment file to load - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - This version of read uses the retry logic (for lock-less - commits) to find the right segments file to load. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Returns a copy of this instance, also copying each - SegmentInfo. - - - - version number when this SegmentInfos was generated. - - - Current version number from segments file. - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Returns userData from latest segments file - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - If non-null, information about retries when loading - the segments file will be printed to this. - - - - Advanced: set how many times to try loading the - segments.gen file contents to determine current segment - generation. This file is only referenced when the - primary method (listing the directory) fails. - - - - - - - - Advanced: set how many milliseconds to pause in between - attempts to load the segments.gen file. - - - - - - - - Advanced: set how many times to try incrementing the - gen when loading the segments file. This only runs if - the primary (listing directory) and secondary (opening - segments.gen file) methods fail to find the segments - file. - - - - - - - - - - - - Returns a new SegmentInfos containg the SegmentInfo - instances in the specified range first (inclusive) to - last (exclusive), so total number of segments returned - is last-first. - - - - Call this to start a commit. This writes the new - segments file, but writes an invalid checksum at the - end, so that it is not visible to readers. Once this - is called you must call {@link #finishCommit} to complete - the commit or {@link #rollbackCommit} to abort it. - - - - Returns all file names referenced by SegmentInfo - instances matching the provided Directory (ie files - associated with any "external" segments are skipped). - The returned collection is recomputed on each - invocation. - - - - Writes & syncs to the Directory dir, taking care to - remove the segments file on exception - - - - Replaces all segments in this instance, but keeps - generation, version, counter so that future commits - remain write once. - - - - - Simple brute force implementation. - If size is equal, compare items one by one. - - SegmentInfos object to check equality for - true if lists are equal, false otherwise - - - - Calculate hash code of SegmentInfos - - hash code as in java version of ArrayList - - - Utility class for executing code that needs to do - something with the current segments file. This is - necessary with lock-less commits because from the time - you locate the current segments file name, until you - actually open it, read its contents, or check modified - time, etc., it could have been deleted due to a writer - commit finishing. - - - - Subclass must implement this. The assumption is an - IOException will be thrown if something goes wrong - during the processing that could have been caused by - a writer committing. - - - - Constants describing field properties, for example used for - {@link IndexReader#GetFieldNames(FieldOption)}. - - - - All fields - - - All indexed fields - - - All fields that store payloads - - - All fields that omit tf - - - Renamed to {@link #OMIT_TERM_FREQ_AND_POSITIONS} - - - - All fields which are not indexed - - - All fields which are indexed with termvectors enabled - - - All fields which are indexed but don't have termvectors enabled - - - All fields with termvectors enabled. Please note that only standard termvector fields are returned - - - All fields with termvectors with position values enabled - - - All fields with termvectors with offset values enabled - - - All fields with termvectors with offset values and position values enabled - - - Construct a ParallelReader. -

    Note that all subreaders are closed if this ParallelReader is closed.

    -

    -
    - - Construct a ParallelReader. - indicates whether the subreaders should be closed - when this ParallelReader is closed - - - - Add an IndexReader. - IOException if there is a low-level IO error - - - Add an IndexReader whose stored fields will not be returned. This can - accellerate search when stored fields are only needed from a subset of - the IndexReaders. - - - IllegalArgumentException if not all indexes contain the same number - of documents - - IllegalArgumentException if not all indexes have the same value - of {@link IndexReader#MaxDoc()} - - IOException if there is a low-level IO error - - - Tries to reopen the subreaders. -
    - If one or more subreaders could be re-opened (i. e. subReader.reopen() - returned a new instance != subReader), then a new ParallelReader instance - is returned, otherwise this instance is returned. -

    - A re-opened instance might share one or more subreaders with the old - instance. Index modification operations result in undefined behavior - when performed before the old instance is closed. - (see {@link IndexReader#Reopen()}). -

    - If subreaders are shared, then the reference count of those - readers is increased to ensure that the subreaders remain open - until the last referring reader is closed. - -

    - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Checks recursively if all subreaders are up to date. - - - Checks recursively if all subindexes are optimized - - - Not implemented. - UnsupportedOperationException - - - - - - - Remaps docIDs after a merge has completed, where the - merged segments had at least one deletion. This is used - to renumber the buffered deletes in IndexWriter when a - merge of segments with deletions commits. - - - - Change to true to see details of reference counts when - infoStream != null - - - - Initialize the deleter: find all previous commits in - the Directory, incref the files they reference, call - the policy to let it delete commits. This will remove - any files not referenced by any of the commits. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Remove the CommitPoints in the commitsToDelete List by - DecRef'ing all files from each SegmentInfos. - - - - Writer calls this when it has hit an error and had to - roll back, to tell us that there may now be - unreferenced files in the filesystem. So we re-list - the filesystem and delete such files. If segmentName - is non-null, we will only delete files corresponding to - that segment. - - - - For definition of "check point" see IndexWriter comments: - "Clarification: Check Points (and commits)". - - Writer calls this when it has made a "consistent - change" to the index, meaning new files are written to - the index and the in-memory SegmentInfos have been - modified to point to those files. - - This may or may not be a commit (segments_N may or may - not have been written). - - We simply incref the files referenced by the new - SegmentInfos and decref the files we had previously - seen (if any). - - If this is a commit, we also call the policy to give it - a chance to remove other commits. If any commits are - removed, we decref their files as well. - - - - Deletes the specified files, but only if they are new - (have not yet been incref'd). - - - - Tracks the reference count for a single index file: - - - Holds details for each commit point. This class is - also passed to the deletion policy. Note: this class - has a natural ordering that is inconsistent with - equals. - - - -

    Expert: represents a single commit into an index as seen by the - {@link IndexDeletionPolicy} or {@link IndexReader}.

    - -

    Changes to the content of an index are made visible - only after the writer who made that change commits by - writing a new segments file - (segments_N). This point in time, when the - action of writing of a new segments file to the directory - is completed, is an index commit.

    - -

    Each index commit point has a unique segments file - associated with it. The segments file associated with a - later index commit point would have a larger N.

    - -

    WARNING: This API is a new and experimental and - may suddenly change.

    -

    -
    - - Please subclass IndexCommit class instead - - - - Get the segments file (segments_N) associated - with this commit point. - - - - Returns all index files referenced by this commit point. - - - Delete this commit point. -

    - Upon calling this, the writer is notified that this commit - point should be deleted. -

    - Decision that a commit-point should be deleted is taken by the {@link IndexDeletionPolicy} in effect - and therefore this should only be called by its {@link IndexDeletionPolicy#onInit onInit()} or - {@link IndexDeletionPolicy#onCommit onCommit()} methods. -

    -
    - - Get the segments file (segments_N) associated - with this commit point. - - - - Returns all index files referenced by this commit point. - - - Returns the {@link Directory} for the index. - - - Delete this commit point. This only applies when using - the commit point in the context of IndexWriter's - IndexDeletionPolicy. -

    - Upon calling this, the writer is notified that this commit - point should be deleted. -

    - Decision that a commit-point should be deleted is taken by the {@link IndexDeletionPolicy} in effect - and therefore this should only be called by its {@link IndexDeletionPolicy#onInit onInit()} or - {@link IndexDeletionPolicy#onCommit onCommit()} methods. -

    -
    - - Returns true if this commit is an optimized index. - - - Two IndexCommits are equal if both their Directory and versions are equal. - - - Returns the version for this IndexCommit. This is the - same value that {@link IndexReader#getVersion} would - return if it were opened on this commit. - - - - Returns the generation (the _N in segments_N) for this - IndexCommit - - - - Convenience method that returns the last modified time - of the segments_N file corresponding to this index - commit, equivalent to - getDirectory().fileModified(getSegmentsFileName()). - - - - Returns userData, previously passed to {@link - IndexWriter#Commit(Map)} for this commit. Map is - String -> String. - - - - Called only be the deletion policy, to remove this - commit point from the index. - - - - Processes all occurrences of a single field - - - This is just a "splitter" class: it lets you wrap two - DocFieldConsumer instances as a single consumer. - - - - Called when DocumentsWriter decides to create a new - segment - - - - Called when DocumentsWriter decides to close the doc - stores - - - - Called when an aborting exception is hit - - - Add a new thread - - - Called when DocumentsWriter is using too much RAM. - The consumer should free RAM, if possible, returning - true if any RAM was in fact freed. - - - - Consumer returns this on each doc. This holds any - state that must be flushed synchronized "in docID - order". We gather these and flush them in order. - - - - This class accepts multiple added documents and directly - writes a single segment file. It does this more - efficiently than creating a single segment per document - (with DocumentWriter) and doing standard merges on those - segments. - - Each added document is passed to the {@link DocConsumer}, - which in turn processes the document and interacts with - other consumers in the indexing chain. Certain - consumers, like {@link StoredFieldsWriter} and {@link - TermVectorsTermsWriter}, digest a document and - immediately write bytes to the "doc store" files (ie, - they do not consume RAM per document, except while they - are processing the document). - - Other consumers, eg {@link FreqProxTermsWriter} and - {@link NormsWriter}, buffer bytes in RAM and flush only - when a new segment is produced. - Once we have used our allowed RAM buffer, or the number - of added docs is large enough (in the case we are - flushing by doc count instead of RAM usage), we create a - real segment and flush it to the Directory. - - Threads: - - Multiple threads are allowed into addDocument at once. - There is an initial synchronized call to getThreadState - which allocates a ThreadState for this thread. The same - thread will get the same ThreadState over time (thread - affinity) so that if there are consistent patterns (for - example each thread is indexing a different content - source) then we make better use of RAM. Then - processDocument is called on that ThreadState without - synchronization (most of the "heavy lifting" is in this - call). Finally the synchronized "finishDocument" is - called to flush changes to the directory. - - When flush is called by IndexWriter, or, we flush - internally when autoCommit=false, we forcefully idle all - threads and flush only once they are all idle. This - means you can call flush with a given thread even while - other threads are actively adding/deleting documents. - - - Exceptions: - - Because this class directly updates in-memory posting - lists, and flushes stored fields and term vectors - directly to files in the directory, there are certain - limited times when an exception can corrupt this state. - For example, a disk full while flushing stored fields - leaves this file in a corrupt state. Or, an OOM - exception while appending to the in-memory posting lists - can corrupt that posting list. We call such exceptions - "aborting exceptions". In these cases we must call - abort() to discard all docs added since the last flush. - - All other exceptions ("non-aborting exceptions") can - still partially update the index structures. These - updates are consistent, but, they represent only a part - of the document seen up until the exception was hit. - When this happens, we immediately mark the document as - deleted so that the document is always atomically ("all - or none") added to the index. - - - - Create and return a new DocWriterBuffer. - - - Returns true if any of the fields in the current - buffered docs have omitTermFreqAndPositions==false - - - - If non-null, various details of indexing are printed - here. - - - - Set how much RAM we can use before flushing. - - - Set max buffered docs, which means we will flush by - doc count instead of by RAM usage. - - - - Get current segment name we are writing. - - - Returns how many docs are currently buffered in RAM. - - - Returns the current doc store segment we are writing - to. This will be the same as segment when autoCommit - * is true. - - - - Returns the doc offset into the shared doc store for - the current buffered docs. - - - - Closes the current open doc stores an returns the doc - store segment name. This returns null if there are * - no buffered documents. - - - - Called if we hit an exception at a bad time (when - updating the index files) and must discard all - currently buffered docs. This resets our state, - discarding any docs added since last flush. - - - - Reset after a flush - - - Flush all pending docs to a new segment - - - Build compound file for the segment we just flushed - - - Set flushPending if it is not already set and returns - whether it was set. This is used by IndexWriter to - trigger a single flush even when multiple threads are - trying to do so. - - - - Returns a free (idle) ThreadState that may be used for - indexing this one document. This call also pauses if a - flush is pending. If delTerm is non-null then we - buffer this deleted term after the thread state has - been acquired. - - - - Returns true if the caller (IndexWriter) should now - flush. - - - - Called whenever a merge has completed and the merged segments had deletions - - - Does the synchronized work to finish/flush the - inverted document. - - - - The IndexingChain must define the {@link #GetChain(DocumentsWriter)} method - which returns the DocConsumer that the DocumentsWriter calls to process the - documents. - - - - Consumer returns this on each doc. This holds any - state that must be flushed synchronized "in docID - order". We gather these and flush them in order. - - - - RAMFile buffer for DocWriters. - - - Expert: allocate a new buffer. - Subclasses can allocate differently. - - size of allocated buffer. - - allocated buffer. - - - - Allocate bytes used from shared pool. - - - Recycle the bytes used. - - - This class keeps track of closing the underlying directory. It is used to wrap - DirectoryReaders, that are created using a String/File parameter - in IndexReader.open() with FSDirectory.getDirectory(). - - This helper class is removed with all String/File - IndexReader.open() methods in Lucene 3.0 - - - - A FilterIndexReader contains another IndexReader, which it - uses as its basic source of data, possibly transforming the data along the - way or providing additional functionality. The class - FilterIndexReader itself simply implements all abstract methods - of IndexReader with versions that pass all requests to the - contained index reader. Subclasses of FilterIndexReader may - further override some of these methods and may also provide additional - methods and fields. - - - -

    Construct a FilterIndexReader based on the specified base reader. - Directory locking for delete, undeleteAll, and setNorm operations is - left to the base reader.

    -

    Note that base reader is closed if this FilterIndexReader is closed.

    -

    - specified base reader. - -
    - - - - - - - If the subclass of FilteredIndexReader modifies the - contents of the FieldCache, you must override this - method to provide a different key */ - - - - - If the subclass of FilteredIndexReader modifies the - deleted docs, you must override this method to provide - a different key */ - - - - Base class for filtering {@link TermDocs} implementations. - - - Base class for filtering {@link TermPositions} implementations. - - - Base class for filtering {@link TermEnum} implementations. - - - This member contains the ref counter, that is passed to each instance after cloning/reopening, - and is global to all DirectoryOwningReader derived from the original one. - This reuses the class {@link SegmentReader.Ref} - - - - Provides support for converting dates to strings and vice-versa. - The strings are structured so that lexicographic sorting orders - them by date, which makes them suitable for use as field values - and search terms. - -

    This class also helps you to limit the resolution of your dates. Do not - save dates with a finer resolution than you really need, as then - RangeQuery and PrefixQuery will require more memory and become slower. - -

    Compared to {@link DateField} the strings generated by the methods - in this class take slightly more space, unless your selected resolution - is set to Resolution.DAY or lower. - -

    - Another approach is {@link NumericUtils}, which provides - a sortable binary representation (prefix encoded) of numeric values, which - date/time are. - For indexing a {@link Date} or {@link Calendar}, just get the unix timestamp as - long using {@link Date#getTime} or {@link Calendar#getTimeInMillis} and - index this as a numeric value with {@link NumericField} - and use {@link NumericRangeQuery} to query it. -

    -
    - - Converts a Date to a string suitable for indexing. - - - the date to be converted - - the desired resolution, see - {@link #Round(Date, DateTools.Resolution)} - - a string in format yyyyMMddHHmmssSSS or shorter, - depending on resolution; using GMT as timezone - - - - Converts a millisecond time to a string suitable for indexing. - - - the date expressed as milliseconds since January 1, 1970, 00:00:00 GMT - - the desired resolution, see - {@link #Round(long, DateTools.Resolution)} - - a string in format yyyyMMddHHmmssSSS or shorter, - depending on resolution; using GMT as timezone - - - - Converts a string produced by timeToString or - DateToString back to a time, represented as the - number of milliseconds since January 1, 1970, 00:00:00 GMT. - - - the date string to be converted - - the number of milliseconds since January 1, 1970, 00:00:00 GMT - - ParseException if dateString is not in the - expected format - - - - Converts a string produced by timeToString or - DateToString back to a time, represented as a - Date object. - - - the date string to be converted - - the parsed time as a Date object - - ParseException if dateString is not in the - expected format - - - - Limit a date's resolution. For example, the date 2004-09-21 13:50:11 - will be changed to 2004-09-01 00:00:00 when using - Resolution.MONTH. - - - The desired resolution of the date to be returned - - the date with all values more precise than resolution - set to 0 or 1 - - - - Limit a date's resolution. For example, the date 1095767411000 - (which represents 2004-09-21 13:50:11) will be changed to - 1093989600000 (2004-09-01 00:00:00) when using - Resolution.MONTH. - - - The time in milliseconds (not ticks). - The desired resolution of the date to be returned - - the date with all values more precise than resolution - set to 0 or 1, expressed as milliseconds since January 1, 1970, 00:00:00 GMT - - - - Specifies the time granularity. - - - A Token's lexical type. The Default value is "word". - - - Base class for Attributes that can be added to a - {@link Lucene.Net.Util.AttributeSource}. -

    - Attributes are used to add data in a dynamic, yet type-safe way to a source - of usually streamed objects, e. g. a {@link Lucene.Net.Analysis.TokenStream}. -

    -
    - - Base interface for attributes. - - - Clears the values in this AttributeImpl and resets it to its - default value. If this implementation implements more than one Attribute interface - it clears all. - - - - The default implementation of this method accesses all declared - fields of this object and prints the values in the following syntax: - -
    -            public String toString() {
    -            return "start=" + startOffset + ",end=" + endOffset;
    -            }
    -            
    - - This method may be overridden by subclasses. -
    -
    - - Subclasses must implement this method and should compute - a hashCode similar to this: -
    -            public int hashCode() {
    -            int code = startOffset;
    -            code = code * 31 + endOffset;
    -            return code;
    -            }
    -            
    - - see also {@link #equals(Object)} -
    -
    - - All values used for computation of {@link #hashCode()} - should be checked here for equality. - - see also {@link Object#equals(Object)} - - - - Copies the values from this Attribute into the passed-in - target attribute. The target implementation must support all the - Attributes this implementation supports. - - - - Shallow clone. Subclasses must override this if they - need to clone any members deeply, - - - - A Token's lexical type. The Default value is "word". - - - Returns this Token's lexical type. Defaults to "word". - - - Set the lexical type. - - - - - Returns this Token's lexical type. Defaults to "word". - - - Set the lexical type. - - - - - Removes stop words from a token stream. - - - A TokenFilter is a TokenStream whose input is another TokenStream. -

    - This is an abstract class; subclasses must override {@link #IncrementToken()}. - -

    - - -
    - - A TokenStream enumerates the sequence of tokens, either from - {@link Field}s of a {@link Document} or from query text. -

    - This is an abstract class. Concrete subclasses are: -

      -
    • {@link Tokenizer}, a TokenStream whose input is a Reader; and
    • -
    • {@link TokenFilter}, a TokenStream whose input is another - TokenStream.
    • -
    - A new TokenStream API has been introduced with Lucene 2.9. This API - has moved from being {@link Token} based to {@link Attribute} based. While - {@link Token} still exists in 2.9 as a convenience class, the preferred way - to store the information of a {@link Token} is to use {@link AttributeImpl}s. -

    - TokenStream now extends {@link AttributeSource}, which provides - access to all of the token {@link Attribute}s for the TokenStream. - Note that only one instance per {@link AttributeImpl} is created and reused - for every token. This approach reduces object creation and allows local - caching of references to the {@link AttributeImpl}s. See - {@link #IncrementToken()} for further details. -

    - The workflow of the new TokenStream API is as follows: -

      -
    1. Instantiation of TokenStream/{@link TokenFilter}s which add/get - attributes to/from the {@link AttributeSource}.
    2. -
    3. The consumer calls {@link TokenStream#Reset()}.
    4. -
    5. The consumer retrieves attributes from the stream and stores local - references to all attributes it wants to access
    6. -
    7. The consumer calls {@link #IncrementToken()} until it returns false and - consumes the attributes after each call.
    8. -
    9. The consumer calls {@link #End()} so that any end-of-stream operations - can be performed.
    10. -
    11. The consumer calls {@link #Close()} to release any resource when finished - using the TokenStream
    12. -
    - To make sure that filters and consumers know which attributes are available, - the attributes must be added during instantiation. Filters and consumers are - not required to check for availability of attributes in - {@link #IncrementToken()}. -

    - You can find some example code for the new API in the analysis package level - Javadoc. -

    - Sometimes it is desirable to capture a current state of a TokenStream - , e. g. for buffering purposes (see {@link CachingTokenFilter}, - {@link TeeSinkTokenFilter}). For this usecase - {@link AttributeSource#CaptureState} and {@link AttributeSource#RestoreState} - can be used. -

    -
    - - An AttributeSource contains a list of different {@link AttributeImpl}s, - and methods to add and get them. There can only be a single instance - of an attribute in the same AttributeSource instance. This is ensured - by passing in the actual type of the Attribute (Class<Attribute>) to - the {@link #AddAttribute(Class)}, which then checks if an instance of - that type is already present. If yes, it returns the instance, otherwise - it creates a new instance and returns it. - - - - An AttributeSource using the default attribute factory {@link AttributeSource.AttributeFactory#DEFAULT_ATTRIBUTE_FACTORY}. - - - An AttributeSource that uses the same attributes as the supplied one. - - - An AttributeSource using the supplied {@link AttributeFactory} for creating new {@link Attribute} instances. - - - returns the used AttributeFactory. - - - Returns a new iterator that iterates the attribute classes - in the same order they were added in. - Signature for Java 1.5: public Iterator<Class<? extends Attribute>> getAttributeClassesIterator() - - Note that this return value is different from Java in that it enumerates over the values - and not the keys - - - - Returns a new iterator that iterates all unique Attribute implementations. - This iterator may contain less entries that {@link #getAttributeClassesIterator}, - if one instance implements more than one Attribute interface. - Signature for Java 1.5: public Iterator<AttributeImpl> getAttributeImplsIterator() - - - - a cache that stores all interfaces for known implementation classes for performance (slow reflection) - - - Adds a custom AttributeImpl instance with one or more Attribute interfaces. - - - The caller must pass in a Class<? extends Attribute> value. - This method first checks if an instance of that class is - already in this AttributeSource and returns it. Otherwise a - new instance is created, added to this AttributeSource and returned. - Signature for Java 1.5: public <T extends Attribute> T addAttribute(Class<T>) - - - - Returns true, iff this AttributeSource has any attributes - - - The caller must pass in a Class<? extends Attribute> value. - Returns true, iff this AttributeSource contains the passed-in Attribute. - Signature for Java 1.5: public boolean hasAttribute(Class<? extends Attribute>) - - - - The caller must pass in a Class<? extends Attribute> value. - Returns the instance of the passed in Attribute contained in this AttributeSource - Signature for Java 1.5: public <T extends Attribute> T getAttribute(Class<T>) - - - IllegalArgumentException if this AttributeSource does not contain the - Attribute. It is recommended to always use {@link #addAttribute} even in consumers - of TokenStreams, because you cannot know if a specific TokenStream really uses - a specific Attribute. {@link #addAttribute} will automatically make the attribute - available. If you want to only use the attribute, if it is available (to optimize - consuming), use {@link #hasAttribute}. - - - - Resets all Attributes in this AttributeSource by calling - {@link AttributeImpl#Clear()} on each Attribute implementation. - - - - Captures the state of all Attributes. The return value can be passed to - {@link #restoreState} to restore the state of this or another AttributeSource. - - - - Restores this state by copying the values of all attribute implementations - that this state contains into the attributes implementations of the targetStream. - The targetStream must contain a corresponding instance for each argument - contained in this state (e.g. it is not possible to restore the state of - an AttributeSource containing a TermAttribute into a AttributeSource using - a Token instance as implementation). - - Note that this method does not affect attributes of the targetStream - that are not contained in this state. In other words, if for example - the targetStream contains an OffsetAttribute, but this state doesn't, then - the value of the OffsetAttribute remains unchanged. It might be desirable to - reset its value to the default, in which case the caller should first - call {@link TokenStream#ClearAttributes()} on the targetStream. - - - - Performs a clone of all {@link AttributeImpl} instances returned in a new - AttributeSource instance. This method can be used to e.g. create another TokenStream - with exactly the same attributes (using {@link #AttributeSource(AttributeSource)}) - - - - An AttributeFactory creates instances of {@link AttributeImpl}s. - - - returns an {@link AttributeImpl} for the supplied {@link Attribute} interface class. -

    Signature for Java 1.5: public AttributeImpl createAttributeInstance(Class%lt;? extends Attribute> attClass) -

    -
    - - This is the default factory that creates {@link AttributeImpl}s using the - class name of the supplied {@link Attribute} interface class by appending Impl to it. - - - - This class holds the state of an AttributeSource. - - - - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - A TokenStream using the default attribute factory. - - - A TokenStream that uses the same attributes as the supplied one. - - - A TokenStream using the supplied AttributeFactory for creating new {@link Attribute} instances. - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - For extra performance you can globally enable the new - {@link #IncrementToken} API using {@link Attribute}s. There will be a - small, but in most cases negligible performance increase by enabling this, - but it only works if all TokenStreams use the new API and - implement {@link #IncrementToken}. This setting can only be enabled - globally. -

    - This setting only affects TokenStreams instantiated after this - call. All TokenStreams already created use the other setting. -

    - All core {@link Analyzer}s are compatible with this setting, if you have - your own TokenStreams that are also compatible, you should enable - this. -

    - When enabled, tokenization may throw {@link UnsupportedOperationException} - s, if the whole tokenizer chain is not compatible eg one of the - TokenStreams does not implement the new TokenStream API. -

    - The default is false, so there is the fallback to the old API - available. - -

    - This setting will no longer be needed in Lucene 3.0 as the old - API will be removed. - -
    - - Returns if only the new API is used. - - - - - This setting will no longer be needed in Lucene 3.0 as - the old API will be removed. - - - - Consumers (i.e., {@link IndexWriter}) use this method to advance the stream to - the next token. Implementing classes must implement this method and update - the appropriate {@link AttributeImpl}s with the attributes of the next - token. - - The producer must make no assumptions about the attributes after the - method has been returned: the caller may arbitrarily change it. If the - producer needs to preserve the state for subsequent calls, it can use - {@link #captureState} to create a copy of the current attribute state. - - This method is called for every token of a document, so an efficient - implementation is crucial for good performance. To avoid calls to - {@link #AddAttribute(Class)} and {@link #GetAttribute(Class)} or downcasts, - references to all {@link AttributeImpl}s that this stream uses should be - retrieved during instantiation. - - To ensure that filters and consumers know which attributes are available, - the attributes must be added during instantiation. Filters and consumers - are not required to check for availability of attributes in - {@link #IncrementToken()}. - - - false for end of stream; true otherwise - - Note that this method will be defined abstract in Lucene - 3.0. - - - - This method is called by the consumer after the last token has been - consumed, after {@link #IncrementToken()} returned false - (using the new TokenStream API). Streams implementing the old API - should upgrade to use this feature. -

    - This method can be used to perform any end-of-stream operations, such as - setting the final offset of a stream. The final offset of a stream might - differ from the offset of the last token eg in case one or more whitespaces - followed after the last token, but a {@link WhitespaceTokenizer} was used. - -

    - IOException -
    - - Returns the next token in the stream, or null at EOS. When possible, the - input Token should be used as the returned Token (this gives fastest - tokenization performance), but this is not required and a new Token may be - returned. Callers may re-use a single Token instance for successive calls - to this method. - - This implicitly defines a "contract" between consumers (callers of this - method) and producers (implementations of this method that are the source - for tokens): -
      -
    • A consumer must fully consume the previously returned {@link Token} - before calling this method again.
    • -
    • A producer must call {@link Token#Clear()} before setting the fields in - it and returning it
    • -
    - Also, the producer must make no assumptions about a {@link Token} after it - has been returned: the caller may arbitrarily change it. If the producer - needs to hold onto the {@link Token} for subsequent calls, it must clone() - it before storing it. Note that a {@link TokenFilter} is considered a - consumer. - -
    - a {@link Token} that may or may not be used to return; - this parameter should never be null (the callee is not required to - check for null before using it, but it is a good idea to assert that - it is not null.) - - next {@link Token} in the stream or null if end-of-stream was hit - - The new {@link #IncrementToken()} and {@link AttributeSource} - APIs should be used instead. - -
    - - Returns the next {@link Token} in the stream, or null at EOS. - - - The returned Token is a "full private copy" (not re-used across - calls to {@link #Next()}) but will be slower than calling - {@link #Next(Token)} or using the new {@link #IncrementToken()} - method with the new {@link AttributeSource} API. - - - - Resets this stream to the beginning. This is an optional operation, so - subclasses may or may not implement this method. {@link #Reset()} is not needed for - the standard indexing process. However, if the tokens of a - TokenStream are intended to be consumed more than once, it is - necessary to implement {@link #Reset()}. Note that if your TokenStream - caches tokens and feeds them back again after a reset, it is imperative - that you clone the tokens when you store them away (on the first pass) as - well as when you return them (on future passes after {@link #Reset()}). - - - - Releases resources associated with this stream. - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - The source of tokens for this filter. - - - Construct a token stream filtering the given input. - - - Performs end-of-stream operations, if any, and calls then end() on the - input TokenStream.

    - NOTE: Be sure to call super.end() first when overriding this method. -

    -
    - - Close the input TokenStream. - - - Reset the filter as well as the input TokenStream. - - - Construct a token stream filtering the given input. - Use {@link #StopFilter(boolean, TokenStream, String[])} instead - - - - Construct a token stream filtering the given input. - true if token positions should record the removed stop words - - input TokenStream - - array of stop words - - Use {@link #StopFilter(boolean, TokenStream, Set)} instead. - - - - Constructs a filter which removes words from the input - TokenStream that are named in the array of words. - - Use {@link #StopFilter(boolean, TokenStream, String[], boolean)} instead - - - - Constructs a filter which removes words from the input - TokenStream that are named in the array of words. - - true if token positions should record the removed stop words - - input TokenStream - - array of stop words - - true if case is ignored - - Use {@link #StopFilter(boolean, TokenStream, Set, boolean)} instead. - - - - Construct a token stream filtering the given input. - If stopWords is an instance of {@link CharArraySet} (true if - makeStopSet() was used to construct the set) it will be directly used - and ignoreCase will be ignored since CharArraySet - directly controls case sensitivity. -

    - If stopWords is not an instance of {@link CharArraySet}, - a new CharArraySet will be constructed and ignoreCase will be - used to specify the case sensitivity of that set. - -

    - - - The set of Stop Words. - - -Ignore case when stopping. - - Use {@link #StopFilter(boolean, TokenStream, Set, boolean)} instead - -
    - - Construct a token stream filtering the given input. - If stopWords is an instance of {@link CharArraySet} (true if - makeStopSet() was used to construct the set) it will be directly used - and ignoreCase will be ignored since CharArraySet - directly controls case sensitivity. -

    - If stopWords is not an instance of {@link CharArraySet}, - a new CharArraySet will be constructed and ignoreCase will be - used to specify the case sensitivity of that set. - -

    - true if token positions should record the removed stop words - - Input TokenStream - - The set of Stop Words. - - -Ignore case when stopping. - -
    - - Constructs a filter which removes words from the input - TokenStream that are named in the Set. - - - - - Use {@link #StopFilter(boolean, TokenStream, Set)} instead - - - - Constructs a filter which removes words from the input - TokenStream that are named in the Set. - - - true if token positions should record the removed stop words - - Input stream - - The set of Stop Words. - - - - - - Builds a Set from an array of stop words, - appropriate for passing into the StopFilter constructor. - This permits this stopWords construction to be cached once when - an Analyzer is constructed. - - - passing false to ignoreCase - - - - Builds a Set from an array of stop words, - appropriate for passing into the StopFilter constructor. - This permits this stopWords construction to be cached once when - an Analyzer is constructed. - - - passing false to ignoreCase - - - - - An array of stopwords - - If true, all words are lower cased first. - - a Set containing the words - - - - - A List of Strings representing the stopwords - - if true, all words are lower cased first - - A Set containing the words - - - - Returns the next input Token whose term() is not a stop word. - - - - - Please specify this when you create the StopFilter - - - - Returns version-dependent default for enablePositionIncrements. Analyzers - that embed StopFilter use this method when creating the StopFilter. Prior - to 2.9, this returns {@link #getEnablePositionIncrementsDefault}. On 2.9 - or later, it returns true. - - - - Set the default position increments behavior of every StopFilter created - from now on. -

    - Note: behavior of a single StopFilter instance can be modified with - {@link #SetEnablePositionIncrements(boolean)}. This static method allows - control over behavior of classes using StopFilters internally, for - example {@link Lucene.Net.Analysis.Standard.StandardAnalyzer - StandardAnalyzer} if used with the no-arg ctor. -

    - Default : false. - -

    - - - Please specify this when you create the StopFilter - -
    - - - - - - If true, this StopFilter will preserve - positions of the incoming tokens (ie, accumulate and - set position increments of the removed stop tokens). - Generally, true is best as it does not - lose information (positions of the original tokens) - during indexing. - -

    When set, when a token is stopped - (omitted), the position increment of the following - token is incremented. - -

    NOTE: be sure to also - set {@link QueryParser#setEnablePositionIncrements} if - you use QueryParser to create queries. -

    -
    - - This class is a scanner generated by - JFlex 1.4.1 - on 9/4/08 6:49 PM from the specification file - /tango/mike/src/lucene.standarddigit/src/java/org/apache/lucene/analysis/standard/StandardTokenizerImpl.jflex - - - - This character denotes the end of file - - - initial size of the lookahead buffer - - - lexical states - - - Translates characters to character classes - - - Translates characters to character classes - - - Translates DFA states to action switch labels. - - - Translates a state to a row index in the transition table - - - The transition table of the DFA - - - ZZ_ATTRIBUTE[aState] contains the attributes of state aState - - - the input device - - - the current state of the DFA - - - the current lexical state - - - this buffer contains the current text to be matched and is - the source of the yytext() string - - - - the textposition at the last accepting state - - - the textposition at the last state to be included in yytext - - - the current text position in the buffer - - - startRead marks the beginning of the yytext() string in the buffer - - - endRead marks the last character in the buffer, that has been read - from input - - - - number of newlines encountered up to the start of the matched text - - - the number of characters up to the start of the matched text - - - the number of characters from the last newline up to the start of the - matched text - - - - zzAtBOL == true <=> the scanner is currently at the beginning of a line - - - zzAtEOF == true <=> the scanner is at the EOF - - - this solves a bug where HOSTs that end with '.' are identified - as ACRONYMs. It is deprecated and will be removed in the next - release. - - - - Resets the Tokenizer to a new Reader. - - - Fills Lucene token with the current token text. - - - Fills TermAttribute with the current token text. - - - Creates a new scanner - There is also a java.io.InputStream version of this constructor. - - - the java.io.Reader to read input from. - - - - Creates a new scanner. - There is also java.io.Reader version of this constructor. - - - the java.io.Inputstream to read input from. - - - - Unpacks the compressed character translation table. - - - the packed character translation table - - the unpacked character translation table - - - - Refills the input buffer. - - - false, iff there was new input. - - - if any I/O-Error occurs - - - - Closes the input stream. - - - Resets the scanner to read from a new input stream. - Does not close the old reader. - - All internal variables are reset, the old input stream - cannot be reused (internal buffer is discarded and lost). - Lexical state is set to ZZ_INITIAL. - - - the new input stream - - - - Returns the current lexical state. - - - Enters a new lexical state - - - the new lexical state - - - - Returns the text matched by the current regular expression. - - - Returns the character at position pos from the - matched text. - - It is equivalent to yytext().charAt(pos), but faster - - - the position of the character to fetch. - A value from 0 to yylength()-1. - - - the character at position pos - - - - Returns the length of the matched text region. - - - Reports an error that occured while scanning. - - In a wellformed scanner (no or only correct usage of - yypushback(int) and a match-all fallback rule) this method - will only be called with things that "Can't Possibly Happen". - If this method is called, something is seriously wrong - (e.g. a JFlex bug producing a faulty scanner etc.). - - Usual syntax/scanner level error handling should be done - in error fallback rules. - - - the code of the errormessage to display - - - - Pushes the specified amount of characters back into the input stream. - - They will be read again by then next call of the scanning method - - - the number of characters to be read again. - This number must not be greater than yylength()! - - - - Resumes scanning until the next regular expression is matched, - the end of input is encountered or an I/O-Error occurs. - - - the next token - - if any I/O-Error occurs - - - - Filters {@link StandardTokenizer} with {@link StandardFilter}, - {@link LowerCaseFilter} and {@link StopFilter}, using a list of English stop - words. - - -

    - You must specify the required {@link Version} compatibility when creating - StandardAnalyzer: -

    - -
    - $Id: StandardAnalyzer.java 829134 2009-10-23 17:18:53Z mikemccand $ - -
    - - An Analyzer builds TokenStreams, which analyze text. It thus represents a - policy for extracting index terms from text. -

    - Typical implementations first build a Tokenizer, which breaks the stream of - characters from the Reader into raw Tokens. One or more TokenFilters may - then be applied to the output of the Tokenizer. -

    -
    - - Creates a TokenStream which tokenizes all the text in the provided - Reader. Must be able to handle null field name for - backward compatibility. - - - - Creates a TokenStream that is allowed to be re-used - from the previous time that the same thread called - this method. Callers that do not need to use more - than one TokenStream at the same time from this - analyzer should use this method for better - performance. - - - - Used by Analyzers that implement reusableTokenStream - to retrieve previously saved TokenStreams for re-use - by the same thread. - - - - Used by Analyzers that implement reusableTokenStream - to save a TokenStream for later re-use by the same - thread. - - - - This is only present to preserve - back-compat of classes that subclass a core analyzer - and override tokenStream but not reusableTokenStream - - - - Invoked before indexing a Fieldable instance if - terms have already been added to that field. This allows custom - analyzers to place an automatic position increment gap between - Fieldable instances using the same field name. The default value - position increment gap is 0. With a 0 position increment gap and - the typical default token position increment of 1, all terms in a field, - including across Fieldable instances, are in successive positions, allowing - exact PhraseQuery matches, for instance, across Fieldable instance boundaries. - - - Fieldable name being indexed. - - position increment gap, added to the next token emitted from {@link #TokenStream(String,Reader)} - - - - Just like {@link #getPositionIncrementGap}, except for - Token offsets instead. By default this returns 1 for - tokenized fields and, as if the fields were joined - with an extra space character, and 0 for un-tokenized - fields. This method is only called if the field - produced at least one token for indexing. - - - the field just indexed - - offset gap, added to the next token emitted from {@link #TokenStream(String,Reader)} - - - - Frees persistent resources used by this Analyzer - - - Default maximum allowed token length - - - Specifies whether deprecated acronyms should be replaced with HOST type. - This is false by default to support backward compatibility. - - - this should be removed in the next release (3.0). - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - - - - true if new instances of StandardTokenizer will - replace mischaracterized acronyms - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - This will be removed (hardwired to true) in 3.0 - - - - - Set to true to have new - instances of StandardTokenizer replace mischaracterized - acronyms by default. Set to false to preserve the - previous (before 2.4) buggy behavior. Alternatively, - set the system property - Lucene.Net.Analysis.Standard.StandardAnalyzer.replaceInvalidAcronym - to false. - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - This will be removed (hardwired to true) in 3.0 - - - - An array containing some common English words that are usually not - useful for searching. - - Use {@link #STOP_WORDS_SET} instead - - - - An unmodifiable set containing some common English words that are usually not - useful for searching. - - - - Builds an analyzer with the default stop words ({@link - #STOP_WORDS_SET}). - - Use {@link #StandardAnalyzer(Version)} instead. - - - - Builds an analyzer with the default stop words ({@link - #STOP_WORDS}). - - Lucene version to match See {@link - above} - - - - Builds an analyzer with the given stop words. - Use {@link #StandardAnalyzer(Version, Set)} - instead - - - - Builds an analyzer with the given stop words. - Lucene version to match See {@link - above} - - stop words - - - - Builds an analyzer with the given stop words. - Use {@link #StandardAnalyzer(Version, Set)} instead - - - - Builds an analyzer with the stop words from the given file. - - - Use {@link #StandardAnalyzer(Version, File)} - instead - - - - Builds an analyzer with the stop words from the given file. - - - Lucene version to match See {@link - above} - - File to read stop words from - - - - Builds an analyzer with the stop words from the given reader. - - - Use {@link #StandardAnalyzer(Version, Reader)} - instead - - - - Builds an analyzer with the stop words from the given reader. - - - Lucene version to match See {@link - above} - - Reader to read stop words from - - - - - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - - Remove in 3.X and make true the only valid value - - - - The stopwords to use - - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - - Remove in 3.X and make true the only valid value - - - - The stopwords to use - - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - - Remove in 3.X and make true the only valid value - - - - - The stopwords to use - - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - - Remove in 3.X and make true the only valid value - - - - The stopwords to use - - Set to true if this analyzer should replace mischaracterized acronyms in the StandardTokenizer - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - - Remove in 3.X and make true the only valid value - - - - Constructs a {@link StandardTokenizer} filtered by a {@link - StandardFilter}, a {@link LowerCaseFilter} and a {@link StopFilter}. - - - - Set maximum allowed token length. If a token is seen - that exceeds this length then it is discarded. This - setting only takes effect the next time tokenStream or - reusableTokenStream is called. - - - - - - - - Use {@link #tokenStream} instead - - - - - true if this Analyzer is replacing mischaracterized acronyms in the StandardTokenizer - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - This will be removed (hardwired to true) in 3.0 - - - - - Set to true if this Analyzer is replacing mischaracterized acronyms in the StandardTokenizer - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - This will be removed (hardwired to true) in 3.0 - - - - An {@link Analyzer} that filters {@link LetterTokenizer} - with {@link LowerCaseFilter} - - - - Simplistic {@link CharFilter} that applies the mappings - contained in a {@link NormalizeCharMap} to the character - stream, and correcting the resulting changes to the - offsets. - - - - - * Base utility class for implementing a {@link CharFilter}. - * You subclass this, and then record mappings by calling - * {@link #addOffCorrectMap}, and then invoke the correct - * method to correct an offset. - - - - Subclasses of CharFilter can be chained to filter CharStream. - They can be used as {@link java.io.Reader} with additional offset - correction. {@link Tokenizer}s will automatically use {@link #CorrectOffset} - if a CharFilter/CharStream subclass is used. - - - $Id$ - - - - - CharStream adds {@link #CorrectOffset} - functionality over {@link Reader}. All Tokenizers accept a - CharStream instead of {@link Reader} as input, which enables - arbitrary character based filtering before tokenization. - The {@link #CorrectOffset} method fixed offsets to account for - removal or insertion of characters, so that the offsets - reported in the tokens match the character offsets of the - original Reader. - - - - Called by CharFilter(s) and Tokenizer to correct token offset. - - - offset as seen in the output - - corrected offset based on the input - - - - Subclass may want to override to correct the current offset. - - - current offset - - corrected offset - - - - Chains the corrected offset through the input - CharFilter. - - - - Retrieve the corrected offset. - - - Default constructor that takes a {@link CharStream}. - - - Easy-use constructor that takes a {@link Reader}. - - - CharReader is a Reader wrapper. It reads chars from - Reader and outputs {@link CharStream}, defining an - identify function {@link #CorrectOffset} method that - simply returns the provided offset. - - - - Stores and iterate on sorted integers in compressed form in RAM.
    - The code for compressing the differences between ascending integers was - borrowed from {@link Lucene.Net.Store.IndexInput} and - {@link Lucene.Net.Store.IndexOutput}. -

    - NOTE: this class assumes the stored integers are doc Ids (hence why it - extends {@link DocIdSet}). Therefore its {@link #Iterator()} assumes {@link - DocIdSetIterator#NO_MORE_DOCS} can be used as sentinel. If you intent to use - this value, then make sure it's not used during search flow. -

    -
    - - A DocIdSet contains a set of doc ids. Implementing classes must - only implement {@link #iterator} to provide access to the set. - - - - An empty {@code DocIdSet} instance for easy use, e.g. in Filters that hit no documents. - - - Provides a {@link DocIdSetIterator} to access the set. - This implementation can return null or - {@linkplain #EMPTY_DOCIDSET}.iterator() if there - are no docs that match. - - - - This method is a hint for {@link CachingWrapperFilter}, if this DocIdSet - should be cached without copying it into a BitSet. The default is to return - false. If you have an own DocIdSet implementation - that does its iteration very effective and fast without doing disk I/O, - override this method and return true. - - - - When a BitSet has fewer than 1 in BITS2VINTLIST_SIZE bits set, - a SortedVIntList representing the index numbers of the set bits - will be smaller than that BitSet. - - - - Create a SortedVIntList from all elements of an array of integers. - - - A sorted array of non negative integers. - - - - Create a SortedVIntList from an array of integers. - An array of sorted non negative integers. - - The number of integers to be used from the array. - - - - Create a SortedVIntList from a BitSet. - A bit set representing a set of integers. - - - - Create a SortedVIntList from an OpenBitSet. - A bit set representing a set of integers. - - - - Create a SortedVIntList. - An iterator providing document numbers as a set of integers. - This DocIdSetIterator is iterated completely when this constructor - is called and it must provide the integers in non - decreasing order. - - - - The total number of sorted integers. - - - - The size of the byte array storing the compressed sorted integers. - - - - This DocIdSet implementation is cacheable. - - - An iterator over the sorted integers. - - - - use {@link #DocID()} instead. - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - A ScorerDocQueue maintains a partial ordering of its Scorers such that the - least Scorer can always be found in constant time. Put()'s and pop()'s - require log(size) time. The ordering is by Scorer.doc(). - - - - Create a ScorerDocQueue with a maximum size. - - - Adds a Scorer to a ScorerDocQueue in log(size) time. - If one tries to add more Scorers than maxSize - a RuntimeException (ArrayIndexOutOfBound) is thrown. - - - - Adds a Scorer to the ScorerDocQueue in log(size) time if either - the ScorerDocQueue is not full, or not lessThan(scorer, top()). - - - - true if scorer is added, false otherwise. - - - - Returns the least Scorer of the ScorerDocQueue in constant time. - Should not be used when the queue is empty. - - - - Returns document number of the least Scorer of the ScorerDocQueue - in constant time. - Should not be used when the queue is empty. - - - - Removes and returns the least scorer of the ScorerDocQueue in log(size) - time. - Should not be used when the queue is empty. - - - - Removes the least scorer of the ScorerDocQueue in log(size) time. - Should not be used when the queue is empty. - - - - Should be called when the scorer at top changes doc() value. - Still log(n) worst case, but it's at least twice as fast to
    -            { pq.top().change(); pq.adjustTop(); }
    -            
    instead of
    -            { o = pq.pop(); o.change(); pq.push(o); }
    -            
    -
    -
    - - Returns the number of scorers currently stored in the ScorerDocQueue. - - - Removes all entries from the ScorerDocQueue. - - - An "open" BitSet implementation that allows direct access to the array of words - storing the bits. -

    - Unlike java.util.bitset, the fact that bits are packed into an array of longs - is part of the interface. This allows efficient implementation of other algorithms - by someone other than the author. It also allows one to efficiently implement - alternate serialization or interchange formats. -

    - OpenBitSet is faster than java.util.BitSet in most operations - and *much* faster at calculating cardinality of sets and results of set operations. - It can also handle sets of larger cardinality (up to 64 * 2**32-1) -

    - The goals of OpenBitSet are the fastest implementation possible, and - maximum code reuse. Extra safety and encapsulation - may always be built on top, but if that's built in, the cost can never be removed (and - hence people re-implement their own version in order to get better performance). - If you want a "safe", totally encapsulated (and slower and limited) BitSet - class, use java.util.BitSet. -

    -

    Performance Results

    - - Test system: Pentium 4, Sun Java 1.5_06 -server -Xbatch -Xmx64M -
    BitSet size = 1,000,000 -
    Results are java.util.BitSet time divided by OpenBitSet time. - - - - - - - - - - -
    cardinality intersect_count union nextSetBit get iterator
    50% full 3.36 3.96 1.44 1.46 1.99 1.58
    1% full 3.31 3.90   1.04   0.99
    -
    - Test system: AMD Opteron, 64 bit linux, Sun Java 1.5_06 -server -Xbatch -Xmx64M -
    BitSet size = 1,000,000 -
    Results are java.util.BitSet time divided by OpenBitSet time. - - - - - - - - - - -
    cardinality intersect_count union nextSetBit get iterator
    50% full 2.50 3.50 1.00 1.03 1.12 1.25
    1% full 2.51 3.49   1.00   1.02
    -
    - $Id$ - -
    - - Constructs an OpenBitSet large enough to hold numBits. - - - - - - - Constructs an OpenBitSet from an existing long[]. -
    - The first 64 bits are in long[0], - with bit index 0 at the least significant bit, and bit index 63 at the most significant. - Given a bit index, - the word containing it is long[index/64], and it is at bit number index%64 within that word. -

    - numWords are the number of elements in the array that contain - set bits (non-zero longs). - numWords should be <= bits.length, and - any existing words in the array at position >= numWords should be zero. - -

    -
    - - This DocIdSet implementation is cacheable. - - - Returns the current capacity in bits (1 greater than the index of the last bit) - - - Returns the current capacity of this set. Included for - compatibility. This is *not* equal to {@link #cardinality} - - - - Returns true if there are no set bits - - - Expert: returns the long[] storing the bits - - - Expert: sets a new long[] to use as the bit storage - - - Expert: gets the number of longs in the array that are in use - - - Expert: sets the number of longs in the array that are in use - - - Returns true or false for the specified bit index. - - - Returns true or false for the specified bit index. - The index should be less than the OpenBitSet size - - - - Returns true or false for the specified bit index - - - Returns true or false for the specified bit index. - The index should be less than the OpenBitSet size. - - - - returns 1 if the bit is set, 0 if not. - The index should be less than the OpenBitSet size - - - - sets a bit, expanding the set size if necessary - - - Sets the bit at the specified index. - The index should be less than the OpenBitSet size. - - - - Sets the bit at the specified index. - The index should be less than the OpenBitSet size. - - - - Sets a range of bits, expanding the set size if necessary - - - lower index - - one-past the last bit to set - - - - clears a bit. - The index should be less than the OpenBitSet size. - - - - clears a bit. - The index should be less than the OpenBitSet size. - - - - clears a bit, allowing access beyond the current set size without changing the size. - - - Clears a range of bits. Clearing past the end does not change the size of the set. - - - lower index - - one-past the last bit to clear - - - - Clears a range of bits. Clearing past the end does not change the size of the set. - - - lower index - - one-past the last bit to clear - - - - Sets a bit and returns the previous value. - The index should be less than the OpenBitSet size. - - - - Sets a bit and returns the previous value. - The index should be less than the OpenBitSet size. - - - - flips a bit. - The index should be less than the OpenBitSet size. - - - - flips a bit. - The index should be less than the OpenBitSet size. - - - - flips a bit, expanding the set size if necessary - - - flips a bit and returns the resulting bit value. - The index should be less than the OpenBitSet size. - - - - flips a bit and returns the resulting bit value. - The index should be less than the OpenBitSet size. - - - - Flips a range of bits, expanding the set size if necessary - - - lower index - - one-past the last bit to flip - - - - the number of set bits - - - - Returns the popcount or cardinality of the intersection of the two sets. - Neither set is modified. - - - - Returns the popcount or cardinality of the union of the two sets. - Neither set is modified. - - - - Returns the popcount or cardinality of "a and not b" - or "intersection(a, not(b))". - Neither set is modified. - - - - Returns the popcount or cardinality of the exclusive-or of the two sets. - Neither set is modified. - - - - Returns the index of the first set bit starting at the index specified. - -1 is returned if there are no more set bits. - - - - Returns the index of the first set bit starting at the index specified. - -1 is returned if there are no more set bits. - - - - this = this AND other - - - this = this OR other - - - Remove all elements set in other. this = this AND_NOT other - - - this = this XOR other - - - returns true if the sets have any elements in common - - - Expand the long[] with the size given as a number of words (64 bit longs). - getNumWords() is unchanged by this call. - - - - Ensure that the long[] is big enough to hold numBits, expanding it if necessary. - getNumWords() is unchanged by this call. - - - - Lowers numWords, the number of words in use, - by checking for trailing zero words. - - - - returns the number of 64 bit words it would take to hold numBits - - - returns true if both sets have the same bits set - - - Construct an OpenBitSetDISI with its bits set - from the doc ids of the given DocIdSetIterator. - Also give a maximum size one larger than the largest doc id for which a - bit may ever be set on this OpenBitSetDISI. - - - - Construct an OpenBitSetDISI with no bits set, and a given maximum size - one larger than the largest doc id for which a bit may ever be set - on this OpenBitSetDISI. - - - - Perform an inplace OR with the doc ids from a given DocIdSetIterator, - setting the bit for each such doc id. - These doc ids should be smaller than the maximum size passed to the - constructor. - - - - Perform an inplace AND with the doc ids from a given DocIdSetIterator, - leaving only the bits set for which the doc ids are in common. - These doc ids should be smaller than the maximum size passed to the - constructor. - - - - Perform an inplace NOT with the doc ids from a given DocIdSetIterator, - clearing all the bits for each such doc id. - These doc ids should be smaller than the maximum size passed to the - constructor. - - - - Perform an inplace XOR with the doc ids from a given DocIdSetIterator, - flipping all the bits for each such doc id. - These doc ids should be smaller than the maximum size passed to the - constructor. - - - -

    Implements {@link LockFactory} using {@link - File#createNewFile()}.

    - -

    NOTE: the javadocs - for File.createNewFile contain a vague - yet spooky warning about not using the API for file - locking. This warning was added due to this - bug, and in fact the only known problem with using - this API for locking is that the Lucene write lock may - not be released when the JVM exits abnormally.

    -

    When this happens, a {@link LockObtainFailedException} - is hit when trying to create a writer, in which case you - need to explicitly clear the lock file first. You can - either manually remove the file, or use the {@link - org.apache.lucene.index.IndexReader#unlock(Directory)} - API. But, first be certain that no writer is in fact - writing to the index otherwise you can easily corrupt - your index.

    - -

    If you suspect that this or any other LockFactory is - not working properly in your environment, you can easily - test it by using {@link VerifyingLockFactory}, {@link - LockVerifyServer} and {@link LockStressTest}.

    - -

    - - -
    - - Base class for file system based locking implementation. - - -

    Base class for Locking implementation. {@link Directory} uses - instances of this class to implement locking.

    - -

    Note that there are some useful tools to verify that - your LockFactory is working correctly: {@link - VerifyingLockFactory}, {@link LockStressTest}, {@link - LockVerifyServer}.

    - -

    - - - - - - -
    - - Set the prefix in use for all locks created in this - LockFactory. This is normally called once, when a - Directory gets this LockFactory instance. However, you - can also call this (after this instance is assigned to - a Directory) to override the prefix in use. This - is helpful if you're running Lucene on machines that - have different mount points for the same shared - directory. - - - - Get the prefix in use for all locks created in this LockFactory. - - - Return a new Lock instance identified by lockName. - name of the lock to be created. - - - - Attempt to clear (forcefully unlock and remove) the - specified lock. Only call this at a time when you are - certain this lock is no longer in use. - - name of the lock to be cleared. - - - - Directory for the lock files. - - - Set the lock directory. This method can be only called - once to initialize the lock directory. It is used by {@link FSDirectory} - to set the lock directory to itsself. - Subclasses can also use this method to set the directory - in the constructor. - - - - Retrieve the lock directory. - - - Create a SimpleFSLockFactory instance, with null (unset) - lock directory. When you pass this factory to a {@link FSDirectory} - subclass, the lock directory is automatically set to the - directory itsself. Be sure to create one instance for each directory - your create! - - - - Instantiate using the provided directory (as a File instance). - where lock files should be created. - - - - Instantiate using the provided directory (as a File instance). - where lock files should be created. - - - - Instantiate using the provided directory name (String). - where lock files should be created. - - - - An interprocess mutex lock. -

    Typical use might look like:

    -            new Lock.With(directory.makeLock("my.lock")) {
    -            public Object doBody() {
    -            ... code to execute while locked ...
    -            }
    -            }.run();
    -            
    - - -
    - $Id: Lock.java 769409 2009-04-28 14:05:43Z mikemccand $ - - - -
    - - Pass this value to {@link #Obtain(long)} to try - forever to obtain the lock. - - - - How long {@link #Obtain(long)} waits, in milliseconds, - in between attempts to acquire the lock. - - - - Attempts to obtain exclusive access and immediately return - upon success or failure. - - true iff exclusive access is obtained - - - - If a lock obtain called, this failureReason may be set - with the "root cause" Exception as to why the lock was - not obtained. - - - - Attempts to obtain an exclusive lock within amount of - time given. Polls once per {@link #LOCK_POLL_INTERVAL} - (currently 1000) milliseconds until lockWaitTimeout is - passed. - - length of time to wait in - milliseconds or {@link - #LOCK_OBTAIN_WAIT_FOREVER} to retry forever - - true if lock was obtained - - LockObtainFailedException if lock wait times out - IllegalArgumentException if lockWaitTimeout is - out of bounds - - IOException if obtain() throws IOException - - - Releases exclusive access. - - - Returns true if the resource is currently locked. Note that one must - still call {@link #Obtain()} before using the resource. - - - - Utility class for executing code with exclusive access. - - - Constructs an executor that will grab the named lock. - - - Code to execute with exclusive access. - - - Calls {@link #doBody} while lock is obtained. Blocks if lock - cannot be obtained immediately. Retries to obtain lock once per second - until it is obtained, or until it has tried ten times. Lock is released when - {@link #doBody} exits. - - LockObtainFailedException if lock could not - be obtained - - IOException if {@link Lock#obtain} throws IOException - - - A straightforward implementation of {@link FSDirectory} - using java.io.RandomAccessFile. However, this class has - poor concurrent performance (multiple threads will - bottleneck) as it synchronizes when multiple threads - read from the same file. It's usually better to use - {@link NIOFSDirectory} or {@link MMapDirectory} instead. - - - - - A Directory is a flat list of files. Files may be written once, when they - are created. Once a file is created it may only be opened for read, or - deleted. Random access is permitted both when reading and writing. - -

    Java's i/o APIs not used directly, but rather all i/o is - through this API. This permits things such as:

      -
    • implementation of RAM-based indices;
    • -
    • implementation indices stored in a database, via JDBC;
    • -
    • implementation of an index as a single file;
    • -
    - - Directory locking is implemented by an instance of {@link - LockFactory}, and can be changed for each Directory - instance using {@link #setLockFactory}. - -
    -
    - - Holds the LockFactory instance (implements locking for - this Directory instance). - - - - For some Directory implementations ({@link - FSDirectory}, and its subclasses), this method - silently filters its results to include only index - files. Please use {@link #listAll} instead, which - does no filtering. - - - - Returns an array of strings, one for each file in the - directory. Unlike {@link #list} this method does no - filtering of the contents in a directory, and it will - never return null (throws IOException instead). - - Currently this method simply fallsback to {@link - #list} for Directory impls outside of Lucene's core & - contrib, but in 3.0 that method will be removed and - this method will become abstract. - - - - Returns true iff a file with the given name exists. - - - Returns the time the named file was last modified. - - - Set the modified time of an existing file to now. - - - Removes an existing file in the directory. - - - Renames an existing file in the directory. - If a file already exists with the new name, then it is replaced. - This replacement is not guaranteed to be atomic. - - - - - - Returns the length of a file in the directory. - - - Creates a new, empty file in the directory with the given name. - Returns a stream writing this file. - - - - Ensure that any writes to this file are moved to - stable storage. Lucene uses this to properly commit - changes to the index, to prevent a machine/OS crash - from corrupting the index. - - - - Returns a stream reading an existing file. - - - Returns a stream reading an existing file, with the - specified read buffer size. The particular Directory - implementation may ignore the buffer size. Currently - the only Directory implementations that respect this - parameter are {@link FSDirectory} and {@link - Lucene.Net.Index.CompoundFileReader}. - - - - Construct a {@link Lock}. - the name of the lock file - - - - Attempt to clear (forcefully unlock and remove) the - specified lock. Only call this at a time when you are - certain this lock is no longer in use. - - name of the lock to be cleared. - - - - Closes the store. - - - Set the LockFactory that this Directory instance should - use for its locking implementation. Each * instance of - LockFactory should only be used for one directory (ie, - do not share a single instance across multiple - Directories). - - - instance of {@link LockFactory}. - - - - Get the LockFactory that this Directory instance is - using for its locking implementation. Note that this - may be null for Directory implementations that provide - their own locking implementation. - - - - Return a string identifier that uniquely differentiates - this Directory instance from other Directory instances. - This ID should be the same if two Directory instances - (even in different JVMs and/or on different machines) - are considered "the same index". This is how locking - "scopes" to the right index. - - - - Copy contents of a directory src to a directory dest. - If a file in src already exists in dest then the - one in dest will be blindly overwritten. - -

    NOTE: the source directory cannot change - while this method is running. Otherwise the results - are undefined and you could easily hit a - FileNotFoundException. - -

    NOTE: this method only copies files that look - like index files (ie, have extensions matching the - known extensions of index files). - -

    - source directory - - destination directory - - if true, call {@link #Close()} method on source directory - - IOException -
    - - AlreadyClosedException if this Directory is closed - - - This cache of directories ensures that there is a unique Directory - instance per path, so that synchronization on the Directory can be used to - synchronize access between readers and writers. We use - refcounts to ensure when the last use of an FSDirectory - instance for a given canonical path is closed, we remove the - instance from the cache. See LUCENE-776 - for some relevant discussion. - - Not used by any non-deprecated methods anymore - - - - Set whether Lucene's use of lock files is disabled. By default, - lock files are enabled. They should only be disabled if the index - is on a read-only medium like a CD-ROM. - - Use a {@link #open(File, LockFactory)} or a constructor - that takes a {@link LockFactory} and supply - {@link NoLockFactory#getNoLockFactory}. This setting does not work - with {@link #open(File)} only the deprecated getDirectory - respect this setting. - - - - Returns whether Lucene's use of lock files is disabled. - true if locks are disabled, false if locks are enabled. - - - - Use a constructor that takes a {@link LockFactory} and - supply {@link NoLockFactory#getNoLockFactory}. - - - - The default class which implements filesystem-based directories. - - - A buffer optionally used in renameTo method - - - Returns the directory instance for the named location. - - - Use {@link #Open(File)} - - - the path to the directory. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use {@link #Open(File, LockFactory)} - - - the path to the directory. - - instance of {@link LockFactory} providing the - locking implementation. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use {@link #Open(File)} - - - the path to the directory. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use {@link #Open(File)} - - - the path to the directory. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use {@link #Open(File, LockFactory)} - - - the path to the directory. - - instance of {@link LockFactory} providing the - locking implementation. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use {@link #Open(File, LockFactory)} - - - the path to the directory. - - instance of {@link LockFactory} providing the - locking implementation. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use IndexWriter's create flag, instead, to - create a new index. - - - the path to the directory. - - if true, create, or erase any existing contents. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use IndexWriter's create flag, instead, to - create a new index. - - - the path to the directory. - - if true, create, or erase any existing contents. - - the FSDirectory for the named file. - - - - Returns the directory instance for the named location. - - - Use IndexWriter's create flag, instead, to - create a new index. - - - the path to the directory. - - if true, create, or erase any existing contents. - - the FSDirectory for the named file. - - - - - - - - Initializes the directory to create a new file with the given name. - This method should be used in {@link #createOutput}. - - - - The underlying filesystem directory - - - - - - - - - - - Create a new FSDirectory for the named location (ctor for subclasses). - the path of the directory - - the lock factory to use, or null for the default - ({@link NativeFSLockFactory}); - - IOException - - - Creates an FSDirectory instance, trying to pick the - best implementation given the current environment. - The directory returned uses the {@link NativeFSLockFactory}. - -

    Currently this returns {@link SimpleFSDirectory} as - NIOFSDirectory is currently not supported. - -

    Currently this returns {@link SimpleFSDirectory} as - NIOFSDirectory is currently not supported. - -

    NOTE: this method may suddenly change which - implementation is returned from release to release, in - the event that higher performance defaults become - possible; if the precise implementation is important to - your application, please instantiate it directly, - instead. On 64 bit systems, it may also good to - return {@link MMapDirectory}, but this is disabled - because of officially missing unmap support in Java. - For optimal performance you should consider using - this implementation on 64 bit JVMs. - -

    See above -

    -
    - - Creates an FSDirectory instance, trying to pick the - best implementation given the current environment. - The directory returned uses the {@link NativeFSLockFactory}. - -

    Currently this returns {@link SimpleFSDirectory} as - NIOFSDirectory is currently not supported. - -

    NOTE: this method may suddenly change which - implementation is returned from release to release, in - the event that higher performance defaults become - possible; if the precise implementation is important to - your application, please instantiate it directly, - instead. On 64 bit systems, it may also good to - return {@link MMapDirectory}, but this is disabled - because of officially missing unmap support in Java. - For optimal performance you should consider using - this implementation on 64 bit JVMs. - -

    See above -

    -
    - - Just like {@link #Open(File)}, but allows you to - also specify a custom {@link LockFactory}. - - - - Lists all files (not subdirectories) in the - directory. This method never returns null (throws - {@link IOException} instead). - - - NoSuchDirectoryException if the directory - does not exist, or does exist but is not a - directory. - - IOException if list() returns null - - - Lists all files (not subdirectories) in the - directory. This method never returns null (throws - {@link IOException} instead). - - - NoSuchDirectoryException if the directory - does not exist, or does exist but is not a - directory. - - IOException if list() returns null - - - Lists all files (not subdirectories) in the - directory. - - - - - - Returns true iff a file with the given name exists. - - - Returns the time the named file was last modified. - - - Returns the time the named file was last modified. - - - Set the modified time of an existing file to now. - - - Returns the length in bytes of a file in the directory. - - - Removes an existing file in the directory. - - - Renames an existing file in the directory. - Warning: This is not atomic. - - - - - - Creates an IndexOutput for the file with the given name. - In 3.0 this method will become abstract. - - - - Creates an IndexInput for the file with the given name. - In 3.0 this method will become abstract. - - - - So we can do some byte-to-hexchar conversion below - - - Closes the store to future operations. - - - - .NET - - - - For debug output. - - - Default read chunk size. This is a conditional - default: on 32bit JVMs, it defaults to 100 MB. On - 64bit JVMs, it's Integer.MAX_VALUE. - - - - - - Sets the maximum number of bytes read at once from the - underlying file during {@link IndexInput#readBytes}. - The default value is {@link #DEFAULT_READ_CHUNK_SIZE}; - -

    This was introduced due to Sun - JVM Bug 6478546, which throws an incorrect - OutOfMemoryError when attempting to read too many bytes - at once. It only happens on 32bit JVMs with a large - maximum heap size.

    - -

    Changes to this value will not impact any - already-opened {@link IndexInput}s. You should call - this before attempting to open an index on the - directory.

    - -

    NOTE: This value should be as large as - possible to reduce any possible performance impact. If - you still encounter an incorrect OutOfMemoryError, - trying lowering the chunk size.

    -

    -
    - - The maximum number of bytes to read at once from the - underlying file during {@link IndexInput#readBytes}. - - - - - - Use SimpleFSDirectory.SimpleFSIndexInput instead - - - - Base implementation class for buffered {@link IndexInput}. - - - Abstract base class for input from a file in a {@link Directory}. A - random-access input stream. Used for all Lucene index input operations. - - - - - - Reads and returns a single byte. - - - - - Reads a specified number of bytes into an array at the specified offset. - the array to read bytes into - - the offset in the array to start storing bytes - - the number of bytes to read - - - - - - Reads a specified number of bytes into an array at the - specified offset with control over whether the read - should be buffered (callers who have their own buffer - should pass in "false" for useBuffer). Currently only - {@link BufferedIndexInput} respects this parameter. - - the array to read bytes into - - the offset in the array to start storing bytes - - the number of bytes to read - - set to false if the caller will handle - buffering. - - - - - - Reads four bytes and returns an int. - - - - - Reads an int stored in variable-length format. Reads between one and - five bytes. Smaller values take fewer bytes. Negative numbers are not - supported. - - - - - - Reads eight bytes and returns a long. - - - - - Reads a long stored in variable-length format. Reads between one and - nine bytes. Smaller values take fewer bytes. Negative numbers are not - supported. - - - - Call this if readString should read characters stored - in the old modified UTF8 format (length in java chars - and java's modified UTF8 encoding). This is used for - indices written pre-2.4 See LUCENE-510 for details. - - - - Reads a string. - - - - - Reads Lucene's old "modified UTF-8" encoded - characters into an array. - - the array to read characters into - - the offset in the array to start storing characters - - the number of characters to read - - - - -- please use readString or readBytes - instead, and construct the string - from those utf8 bytes - - - - Expert - - Similar to {@link #ReadChars(char[], int, int)} but does not do any conversion operations on the bytes it is reading in. It still - has to invoke {@link #ReadByte()} just as {@link #ReadChars(char[], int, int)} does, but it does not need a buffer to store anything - and it does not have to do any of the bitwise operations, since we don't actually care what is in the byte except to determine - how many more bytes to read - - The number of chars to read - - this method operates on old "modified utf8" encoded - strings - - - - Closes the stream to futher operations. - - - Returns the current position in this file, where the next read will - occur. - - - - - - Sets current position in this file, where the next read will occur. - - - - - The number of bytes in the file. - - - Returns a clone of this stream. - -

    Clones of a stream access the same data, and are positioned at the same - point as the stream they were cloned from. - -

    Expert: Subclasses must ensure that clones may be positioned at - different points in the input from each other and from the stream they - were cloned from. -

    -
    - - Default buffer size - - - Inits BufferedIndexInput with a specific bufferSize - - - Change the buffer size used by this IndexInput - - - - - - - Expert: implements buffer refill. Reads bytes from the current position - in the input. - - the array to read bytes into - - the offset in the array to start storing bytes - - the number of bytes to read - - - - Expert: implements seek. Sets current position in this file, where the - next {@link #ReadInternal(byte[],int,int)} will occur. - - - - - - A straightforward implementation of {@link FSDirectory} - using java.io.RandomAccessFile. However, this class has - poor concurrent performance (multiple threads will - bottleneck) as it synchronizes when multiple threads - read from the same file. It's usually better to use - {@link NIOFSDirectory} or {@link MMapDirectory} instead. - - - - Create a new SimpleFSDirectory for the named location. - - - the path of the directory - - the lock factory to use, or null for the default. - - IOException - - - Create a new SimpleFSDirectory for the named location. - - - the path of the directory - - the lock factory to use, or null for the default. - - IOException - - - Create a new SimpleFSDirectory for the named location and the default lock factory. - - - the path of the directory - - IOException - - - - - - - Create a new SimpleFSDirectory for the named location and the default lock factory. - - - the path of the directory - - IOException - - - Creates an IndexOutput for the file with the given name. - - - Creates an IndexInput for the file with the given name. - - - Please use ctor taking chunkSize - - - - Please use ctor taking chunkSize - - - - IndexInput methods - - - Method used for testing. Returns true if the underlying - file descriptor is valid. - - - - Base implementation class for buffered {@link IndexOutput}. - - - Abstract base class for output to a file in a Directory. A random-access - output stream. Used for all Lucene index output operations. - - - - - - - - Writes a single byte. - - - - - Writes an array of bytes. - the bytes to write - - the number of bytes to write - - - - - - Writes an array of bytes. - the bytes to write - - the offset in the byte array - - the number of bytes to write - - - - - - Writes an int as four bytes. - - - - - Writes an int in a variable-length format. Writes between one and - five bytes. Smaller values take fewer bytes. Negative numbers are not - supported. - - - - - - Writes a long as eight bytes. - - - - - Writes an long in a variable-length format. Writes between one and five - bytes. Smaller values take fewer bytes. Negative numbers are not - supported. - - - - - - Writes a string. - - - - - Writes a sub sequence of characters from s as the old - format (modified UTF-8 encoded bytes). - - the source of the characters - - the first character in the sequence - - the number of characters in the sequence - - -- please pre-convert to utf8 bytes - instead or use {@link #writeString} - - - - Writes a sub sequence of characters from char[] as - the old format (modified UTF-8 encoded bytes). - - the source of the characters - - the first character in the sequence - - the number of characters in the sequence - - -- please pre-convert to utf8 bytes instead or use {@link #writeString} - - - - Copy numBytes bytes from input to ourself. - - - Forces any buffered output to be written. - - - Closes this stream to further operations. - - - Returns the current position in this file, where the next write will - occur. - - - - - - Sets current position in this file, where the next write will occur. - - - - - The number of bytes in the file. - - - Set the file length. By default, this method does - nothing (it's optional for a Directory to implement - it). But, certain Directory implementations (for - - can use this to inform the - underlying IO system to pre-allocate the file to the - specified size. If the length is longer than the - current file length, the bytes added to the file are - undefined. Otherwise the file is truncated. - - file length - - - - Writes a single byte. - - - - - Writes an array of bytes. - the bytes to write - - the number of bytes to write - - - - - - Forces any buffered output to be written. - - - Expert: implements buffer write. Writes bytes at the current position in - the output. - - the bytes to write - - the number of bytes to write - - - - Expert: implements buffer write. Writes bytes at the current position in - the output. - - the bytes to write - - the offset in the byte array - - the number of bytes to write - - - - Closes this stream to further operations. - - - Returns the current position in this file, where the next write will - occur. - - - - - - Sets current position in this file, where the next write will occur. - - - - - The number of bytes in the file. - - - output methods: - - - Random-access methods - - - - - - - - - - - - - - - - - - - Use SimpleFSDirectory.SimpleFSIndexOutput instead - - - - - - - - Simple standalone server that must be running when you - use {@link VerifyingLockFactory}. This server simply - verifies at most one process holds the lock at a time. - Run without any args to see usage. - - - - - - - - - The results of a SpanQueryFilter. Wraps the BitSet and the position information from the SpanQuery - -

    - NOTE: This API is still experimental and subject to change. - - -

    -
    - - - - - - - The bits for the Filter - - A List of {@link Lucene.Net.Search.SpanFilterResult.PositionInfo} objects - - Use {@link #SpanFilterResult(DocIdSet, List)} instead - - - - - The DocIdSet for the Filter - - A List of {@link Lucene.Net.Search.SpanFilterResult.PositionInfo} objects - - - - The first entry in the array corresponds to the first "on" bit. - Entries are increasing by document order - - A List of PositionInfo objects - - - - Use {@link #GetDocIdSet()} - - - - Returns the docIdSet - - - - A List of {@link Lucene.Net.Search.SpanFilterResult.StartEnd} objects - - - - - The end position of this match - - - - The Start position - The start position of this match - - - - Implements search over a set of Searchables. - -

    Applications usually need only call the inherited {@link #Search(Query)} - or {@link #Search(Query,Filter)} methods. -

    -
    - - An abstract base class for search implementations. Implements the main search - methods. - -

    - Note that you can only access hits from a Searcher as long as it is not yet - closed, otherwise an IOException will be thrown. -

    -
    - - The interface for search implementations. - -

    - Searchable is the abstract network protocol for searching. Implementations - provide search over a single index, over multiple indices, and over indices - on remote servers. - -

    - Queries, filters and sort criteria are designed to be compact so that they - may be efficiently passed to a remote index, with only the top-scoring hits - being returned, rather than every matching hit. - - NOTE: this interface is kept public for convenience. Since it is not - expected to be implemented directly, it may be changed unexpectedly between - releases. -

    -
    - - Lower-level search API. - -

    {@link HitCollector#Collect(int,float)} is called for every non-zero - scoring document. -
    HitCollector-based access to remote indexes is discouraged. - -

    Applications should only use this if they need all of the - matching documents. The high-level search API ({@link - Searcher#Search(Query)}) is usually more efficient, as it skips - non-high-scoring hits. - -

    - to match documents - - if non-null, used to permit documents to be collected. - - to receive hits - - BooleanQuery.TooManyClauses - use {@link #Search(Weight, Filter, Collector)} instead. - -
    - - Lower-level search API. - -

    - {@link Collector#Collect(int)} is called for every document.
    - Collector-based access to remote indexes is discouraged. - -

    - Applications should only use this if they need all of the matching - documents. The high-level search API ({@link Searcher#Search(Query)}) is - usually more efficient, as it skips non-high-scoring hits. - -

    - to match documents - - if non-null, used to permit documents to be collected. - - to receive hits - - BooleanQuery.TooManyClauses -
    - - Frees resources associated with this Searcher. - Be careful not to call this method while you are still using objects - like {@link Hits}. - - - - Expert: Returns the number of documents containing term. - Called by search code to compute term weights. - - - - - - Expert: For each term in the terms array, calculates the number of - documents containing term. Returns an array with these - document frequencies. Used to minimize number of remote calls. - - - - Expert: Returns one greater than the largest possible document number. - Called by search code to compute term weights. - - - - - - Expert: Low-level search implementation. Finds the top n - hits for query, applying filter if non-null. - -

    Called by {@link Hits}. - -

    Applications should usually call {@link Searcher#Search(Query)} or - {@link Searcher#Search(Query,Filter)} instead. -

    - BooleanQuery.TooManyClauses -
    - - Expert: Returns the stored fields of document i. - Called by {@link HitCollector} implementations. - - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Get the {@link Lucene.Net.Documents.Document} at the nth position. The {@link Lucene.Net.Documents.FieldSelector} - may be used to determine what {@link Lucene.Net.Documents.Field}s to load and how they should be loaded. - - NOTE: If the underlying Reader (more specifically, the underlying FieldsReader) is closed before the lazy {@link Lucene.Net.Documents.Field} is - loaded an exception may be thrown. If you want the value of a lazy {@link Lucene.Net.Documents.Field} to be available after closing you must - explicitly load it or fetch the Document again with a new loader. - - - - Get the document at the nth position - - The {@link Lucene.Net.Documents.FieldSelector} to use to determine what Fields should be loaded on the Document. May be null, in which case all Fields will be loaded. - - The stored fields of the {@link Lucene.Net.Documents.Document} at the nth position - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - - - - - - - - - - - - - Expert: called to re-write queries into primitive queries. - BooleanQuery.TooManyClauses - - - Expert: low-level implementation method - Returns an Explanation that describes how doc scored against - weight. - -

    This is intended to be used in developing Similarity implementations, - and, for good performance, should not be displayed with every hit. - Computing an explanation is as expensive as executing the query over the - entire index. -

    Applications should call {@link Searcher#Explain(Query, int)}. -

    - BooleanQuery.TooManyClauses -
    - - Expert: Low-level search implementation with arbitrary sorting. Finds - the top n hits for query, applying - filter if non-null, and sorting the hits by the criteria in - sort. - -

    Applications should usually call - {@link Searcher#Search(Query,Filter,int,Sort)} instead. - -

    - BooleanQuery.TooManyClauses -
    - - Returns the documents matching query. - BooleanQuery.TooManyClauses - Hits will be removed in Lucene 3.0. Use - {@link #Search(Query, Filter, int)} instead. - - - - Returns the documents matching query and - filter. - - BooleanQuery.TooManyClauses - Hits will be removed in Lucene 3.0. Use - {@link #Search(Query, Filter, int)} instead. - - - - Returns documents matching query sorted by - sort. - - BooleanQuery.TooManyClauses - Hits will be removed in Lucene 3.0. Use - {@link #Search(Query, Filter, int, Sort)} instead. - - - - Returns documents matching query and filter, - sorted by sort. - - BooleanQuery.TooManyClauses - Hits will be removed in Lucene 3.0. Use - {@link #Search(Query, Filter, int, Sort)} instead. - - - - Search implementation with arbitrary sorting. Finds - the top n hits for query, applying - filter if non-null, and sorting the hits by the criteria in - sort. - -

    NOTE: this does not compute scores by default; use - {@link IndexSearcher#setDefaultFieldSortScoring} to enable scoring. - -

    - BooleanQuery.TooManyClauses -
    - - Lower-level search API. - -

    {@link HitCollector#Collect(int,float)} is called for every matching - document. - -

    Applications should only use this if they need all of the - matching documents. The high-level search API ({@link - Searcher#Search(Query)}) is usually more efficient, as it skips - non-high-scoring hits. -

    Note: The score passed to this method is a raw score. - In other words, the score will not necessarily be a float whose value is - between 0 and 1. -

    - BooleanQuery.TooManyClauses - use {@link #Search(Query, Collector)} instead. - -
    - - Lower-level search API. - -

    {@link Collector#Collect(int)} is called for every matching document. - -

    Applications should only use this if they need all of the matching - documents. The high-level search API ({@link Searcher#Search(Query, int)} - ) is usually more efficient, as it skips non-high-scoring hits. -

    Note: The score passed to this method is a raw score. - In other words, the score will not necessarily be a float whose value is - between 0 and 1. -

    - BooleanQuery.TooManyClauses -
    - - Lower-level search API. - -

    {@link HitCollector#Collect(int,float)} is called for every matching - document. -
    HitCollector-based access to remote indexes is discouraged. - -

    Applications should only use this if they need all of the - matching documents. The high-level search API ({@link - Searcher#Search(Query, Filter, int)}) is usually more efficient, as it skips - non-high-scoring hits. - -

    - to match documents - - if non-null, used to permit documents to be collected. - - to receive hits - - BooleanQuery.TooManyClauses - use {@link #Search(Query, Filter, Collector)} instead. - -
    - - Lower-level search API. - -

    {@link Collector#Collect(int)} is called for every matching - document. -
    Collector-based access to remote indexes is discouraged. - -

    Applications should only use this if they need all of the - matching documents. The high-level search API ({@link - Searcher#Search(Query, Filter, int)}) is usually more efficient, as it skips - non-high-scoring hits. - -

    - to match documents - - if non-null, used to permit documents to be collected. - - to receive hits - - BooleanQuery.TooManyClauses -
    - - Finds the top n - hits for query, applying filter if non-null. - - - BooleanQuery.TooManyClauses - - - Finds the top n - hits for query. - - - BooleanQuery.TooManyClauses - - - Returns an Explanation that describes how doc scored against - query. - -

    This is intended to be used in developing Similarity implementations, - and, for good performance, should not be displayed with every hit. - Computing an explanation is as expensive as executing the query over the - entire index. -

    -
    - - The Similarity implementation used by this searcher. - - - Expert: Set the Similarity implementation used by this Searcher. - - - - - - - Expert: Return the Similarity implementation used by this Searcher. - -

    This defaults to the current value of {@link Similarity#GetDefault()}. -

    -
    - - creates a weight for query - new weight - - - - use {@link #Search(Weight, Filter, Collector)} instead. - - - - Creates a searcher which searches searchers. - - - Return the array of {@link Searchable}s this searches. - - - - .NET - - - - Returns index of the searcher for document n in the array - used to construct this searcher. - - - - Returns the document number of document n within its - sub-index. - - - - Create weight in multiple index scenario. - - Distributed query processing is done in the following steps: - 1. rewrite query - 2. extract necessary terms - 3. collect dfs for these terms from the Searchables - 4. create query weight using aggregate dfs. - 5. distribute that weight to Searchables - 6. merge results - - Steps 1-4 are done here, 5+6 in the search() methods - - - rewritten queries - - - - Document Frequency cache acting as a Dummy-Searcher. This class is no - full-fledged Searcher, but only supports the methods necessary to - initialize Weights. - - - - - .NET - - - - Wrapper used by {@link HitIterator} to provide a lazily loaded hit - from {@link Hits}. - - - Use {@link TopScoreDocCollector} and {@link TopDocs} instead. Hits will be removed in Lucene 3.0. - - - - Constructed from {@link HitIterator} - Hits returned from a search - - Hit index in Hits - - - - Returns document for this hit. - - - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Returns score for this hit. - - - - - - - Returns id for this hit. - - - - - - - Returns the boost factor for this hit on any field of the underlying document. - - - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Returns the string value of the field with the given name if any exist in - this document, or null. If multiple fields exist with this name, this - method returns the first value added. If only binary fields with this name - exist, returns null. - - - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Prints the parameters to be used to discover the promised result. - - - - - Creates a new instance of the provider class for the given IndexReader. - - - - - * Compute a custom score by the subQuery score and a number of - ValueSourceQuery scores. -

    - Subclasses can override this method to modify the custom score. -

    - If your custom scoring is different than the default herein you - should override at least one of the two customScore() methods. - If the number of ValueSourceQueries is always < 2 it is - sufficient to override the other - {@link #customScore(int, float, float) customScore()} - method, which is simpler. -

    - The default computation herein is a multiplication of given scores: -

    -                ModifiedScore = valSrcScore * valSrcScores[0] * valSrcScores[1] * ...
    -            
    -
    - id of scored doc - score of that doc by the subQuery - scores of that doc by the ValueSourceQuery - custom score -
    - - - - Explain the custom score. - Whenever overriding {@link #customScore(int, float, float[])}, - this method should also be overridden to provide the correct explanation - for the part of the custom scoring. - - doc being explained - explanation for the sub-query part - explanation for the value source part - an explanation for the custom score - - - - Explain the custom score. - Whenever overriding {@link #customScore(int, float, float)}, - this method should also be overridden to provide the correct explanation - for the part of the custom scoring. - - - doc being explained - explanation for the sub-query part - explanation for the value source part - an explanation for the custom score - - - A query that applies a filter to the results of another query. - -

    Note: the bits are retrieved from the filter each time this - query is used in a search - use a CachingWrapperFilter to avoid - regenerating the bits every time. - -

    Created: Apr 20, 2004 8:58:29 AM - -

    - 1.4 - - $Id: FilteredQuery.java 807821 2009-08-25 21:55:49Z mikemccand $ - - - -
    - - Constructs a new query which applies a filter to the results of the original query. - Filter.getDocIdSet() will be called every time this query is used in a search. - - Query to be filtered, cannot be null. - - Filter to apply to query results, cannot be null. - - - - Returns a Weight that applies the filter to the enclosed query's Weight. - This is accomplished by overriding the Scorer returned by the Weight. - - - - Rewrites the wrapped query. - - - Prints a user-readable version of this query. - - - Returns true iff o is equal to this. - - - Returns a hash code value for this object. - - - Expert: Calculate query weights and build query scorers. -

    - The purpose of {@link Weight} is to ensure searching does not - modify a {@link Query}, so that a {@link Query} instance can be reused.
    - {@link Searcher} dependent state of the query should reside in the - {@link Weight}.
    - {@link IndexReader} dependent state should reside in the {@link Scorer}. -

    - A Weight is used in the following way: -

      -
    1. A Weight is constructed by a top-level query, given a - Searcher ({@link Query#CreateWeight(Searcher)}).
    2. -
    3. The {@link #SumOfSquaredWeights()} method is called on the - Weight to compute the query normalization factor - {@link Similarity#QueryNorm(float)} of the query clauses contained in the - query.
    4. -
    5. The query normalization factor is passed to {@link #Normalize(float)}. At - this point the weighting is complete.
    6. -
    7. A Scorer is constructed by {@link #Scorer(IndexReader,boolean,boolean)}.
    8. -
    - -
    - 2.9 - -
    - - An explanation of the score computation for the named document. - - - sub-reader containing the give doc - - - - an Explanation for the score - - IOException - - - The query that this concerns. - - - The weight for this query. - - - Assigns the query normalization factor to this. - - - Returns a {@link Scorer} which scores documents in/out-of order according - to scoreDocsInOrder. -

    - NOTE: even if scoreDocsInOrder is false, it is - recommended to check whether the returned Scorer indeed scores - documents out of order (i.e., call {@link #ScoresDocsOutOfOrder()}), as - some Scorer implementations will always return documents - in-order.
    - NOTE: null can be returned if no documents will be scored by this - query. - -

    - - the {@link IndexReader} for which to return the {@link Scorer}. - - specifies whether in-order scoring of documents is required. Note - that if set to false (i.e., out-of-order scoring is required), - this method can return whatever scoring mode it supports, as every - in-order scorer is also an out-of-order one. However, an - out-of-order scorer may not support {@link Scorer#NextDoc()} - and/or {@link Scorer#Advance(int)}, therefore it is recommended to - request an in-order scorer if use of these methods is required. - - - if true, {@link Scorer#Score(Collector)} will be called; if false, - {@link Scorer#NextDoc()} and/or {@link Scorer#Advance(int)} will - be called. - - a {@link Scorer} which scores documents in/out-of order. - - IOException -
    - - The sum of squared weights of contained query clauses. - - - Returns true iff this implementation scores docs only out of order. This - method is used in conjunction with {@link Collector}'s - {@link Collector#AcceptsDocsOutOfOrder() acceptsDocsOutOfOrder} and - {@link #Scorer(Lucene.Net.Index.IndexReader, boolean, boolean)} to - create a matching {@link Scorer} instance for a given {@link Collector}, or - vice versa. -

    - NOTE: the default implementation returns false, i.e. - the Scorer scores documents in-order. -

    -
    - - use {@link #NextDoc()} instead. - - - - use {@link #DocID()} instead. - - - - use {@link #Advance(int)} instead. - - - - Expert: A ScoreDoc which also contains information about - how to sort the referenced document. In addition to the - document number and score, this object contains an array - of values for the document from the field(s) used to sort. - For example, if the sort criteria was to sort by fields - "a", "b" then "c", the fields object array - will have three elements, corresponding respectively to - the term values for the document in fields "a", "b" and "c". - The class of each element in the array will be either - Integer, Float or String depending on the type of values - in the terms of each field. - -

    Created: Feb 11, 2004 1:23:38 PM - -

    - lucene 1.4 - - $Id: FieldDoc.java 773194 2009-05-09 10:36:41Z mikemccand $ - - - - - -
    - - Expert: Returned by low-level search implementations. - - - - - Expert: The score of this document for the query. - - - Expert: A hit document's number. - - - - - Expert: Constructs a ScoreDoc. - - - Expert: The values which are used to sort the referenced document. - The order of these will match the original sort criteria given by a - Sort object. Each Object will be either an Integer, Float or String, - depending on the type of values in the terms of the original field. - - - - - - - - Expert: Creates one of these objects with empty sort information. - - - Expert: Creates one of these objects with the given sort information. - - - A range filter built on top of a cached single term field (in {@link FieldCache}). - -

    FieldCacheRangeFilter builds a single cache for the field the first time it is used. - Each subsequent FieldCacheRangeFilter on the same field then reuses this cache, - even if the range itself changes. - -

    This means that FieldCacheRangeFilter is much faster (sometimes more than 100x as fast) - as building a {@link TermRangeFilter} (or {@link ConstantScoreRangeQuery} on a {@link TermRangeFilter}) - for each query, if using a {@link #newStringRange}. However, if the range never changes it - is slower (around 2x as slow) than building a CachingWrapperFilter on top of a single TermRangeFilter. - - For numeric data types, this filter may be significantly faster than {@link NumericRangeFilter}. - Furthermore, it does not need the numeric values encoded by {@link NumericField}. But - it has the problem that it only works with exact one value/document (see below). - -

    As with all {@link FieldCache} based functionality, FieldCacheRangeFilter is only valid for - fields which exact one term for each document (except for {@link #newStringRange} - where 0 terms are also allowed). Due to a restriction of {@link FieldCache}, for numeric ranges - all terms that do not have a numeric value, 0 is assumed. - -

    Thus it works on dates, prices and other single value fields but will not work on - regular text fields. It is preferable to use a NOT_ANALYZED field to ensure that - there is only a single term. - -

    This class does not have an constructor, use one of the static factory methods available, - that create a correct instance for different data types supported by {@link FieldCache}. -

    -
    - - This method is implemented for each data type - - - Creates a string range query using {@link FieldCache#getStringIndex}. This works with all - fields containing zero or one term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using {@link FieldCache#GetBytes(IndexReader,String)}. This works with all - byte fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using {@link FieldCache#GetBytes(IndexReader,String,FieldCache.ByteParser)}. This works with all - byte fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using {@link FieldCache#GetShorts(IndexReader,String)}. This works with all - short fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using {@link FieldCache#GetShorts(IndexReader,String,FieldCache.ShortParser)}. This works with all - short fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using {@link FieldCache#GetInts(IndexReader,String)}. This works with all - int fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using {@link FieldCache#GetInts(IndexReader,String,FieldCache.IntParser)}. This works with all - int fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using {@link FieldCache#GetLongs(IndexReader,String)}. This works with all - long fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using {@link FieldCache#GetLongs(IndexReader,String,FieldCache.LongParser)}. This works with all - long fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using {@link FieldCache#GetFloats(IndexReader,String)}. This works with all - float fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using {@link FieldCache#GetFloats(IndexReader,String,FieldCache.FloatParser)}. This works with all - float fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using {@link FieldCache#GetDoubles(IndexReader,String)}. This works with all - double fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - Creates a numeric range query using {@link FieldCache#GetDoubles(IndexReader,String,FieldCache.DoubleParser)}. This works with all - double fields containing exactly one numeric term in the field. The range can be half-open by setting one - of the values to null. - - - - this method checks, if a doc is a hit, should throw AIOBE, when position invalid - - - this DocIdSet is cacheable, if it works solely with FieldCache and no TermDocs - - - @deprecated use {@link #NextDoc()} instead. - - - use {@link #Advance(int)} instead. - - - - use {@link #DocID()} instead. - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - use {@link #DocID()} instead. - - - - Wraps another SpanFilter's result and caches it. The purpose is to allow - filters to simply filter, and then wrap with this class to add caching. - - - - Abstract base class providing a mechanism to restrict searches to a subset - of an index and also maintains and returns position information. - This is useful if you want to compare the positions from a SpanQuery with the positions of items in - a filter. For instance, if you had a SpanFilter that marked all the occurrences of the word "foo" in documents, - and then you entered a new SpanQuery containing bar, you could not only filter by the word foo, but you could - then compare position information for post processing. - - - - Returns a SpanFilterResult with true for documents which should be permitted in - search results, and false for those that should not and Spans for where the true docs match. - - The {@link Lucene.Net.Index.IndexReader} to load position and DocIdSet information from - - A {@link SpanFilterResult} - - java.io.IOException if there was an issue accessing the necessary information - - - - - A transient Filter cache. - - - - New deletions always result in a cache miss, by default - ({@link CachingWrapperFilter.DeletesMode#RECACHE}. - Filter to cache results of - - - - - @param filter Filter to cache results of - @param deletesMode See {@link CachingWrapperFilter.DeletesMode} - - - Use {@link #GetDocIdSet(IndexReader)} instead. - - - - Wraps another filter's result and caches it. The purpose is to allow - filters to simply filter, and then wrap with this class to add caching. - - - - New deletes are ignored by default, which gives higher - cache hit rate on reopened readers. Most of the time - this is safe, because the filter will be AND'd with a - Query that fully enforces deletions. If instead you - need this filter to always enforce deletions, pass - either {@link DeletesMode#RECACHE} or {@link - DeletesMode#DYNAMIC}. - @param filter Filter to cache results of - - - Expert: by default, the cached filter will be shared - across reopened segments that only had changes to their - deletions. - - @param filter Filter to cache results of - @param deletesMode See {@link DeletesMode} - - - Use {@link #GetDocIdSet(IndexReader)} instead. - - - - Provide the DocIdSet to be cached, using the DocIdSet provided - by the wrapped Filter. - This implementation returns the given DocIdSet. - - - - Expert: Specifies how new deletions against a reopened - reader should be handled. - -

    The default is IGNORE, which means the cache entry - will be re-used for a given segment, even when that - segment has been reopened due to changes in deletions. - This is a big performance gain, especially with - near-real-timer readers, since you don't hit a cache - miss on every reopened reader for prior segments.

    - -

    However, in some cases this can cause invalid query - results, allowing deleted documents to be returned. - This only happens if the main query does not rule out - deleted documents on its own, such as a toplevel - ConstantScoreQuery. To fix this, use RECACHE to - re-create the cached filter (at a higher per-reopen - cost, but at faster subsequent search performance), or - use DYNAMIC to dynamically intersect deleted docs (fast - reopen time but some hit to search performance).

    -
    - - A serializable Enum class. - - - Resolves the deserialized instance to the local reference for accurate - equals() and == comparisons. - - - a reference to Parameter as resolved in the local VM - - ObjectStreamException - - - A transient Filter cache (package private because of test) - - - Abstract decorator class for a DocIdSet implementation - that provides on-demand filtering/validation - mechanism on a given DocIdSet. - -

    - - Technically, this same functionality could be achieved - with ChainedFilter (under contrib/misc), however the - benefit of this class is it never materializes the full - bitset for the filter. Instead, the {@link #match} - method is invoked on-demand, per docID visited during - searching. If you know few docIDs will be visited, and - the logic behind {@link #match} is relatively costly, - this may be a better way to filter than ChainedFilter. - -

    - - -
    - - Constructor. - Underlying DocIdSet - - - - This DocIdSet implementation is cacheable if the inner set is cacheable. - - - Validation method to determine whether a docid should be in the result set. - docid to be tested - - true if input docid should be in the result set, false otherwise. - - - - Implementation of the contract to build a DocIdSetIterator. - - - - - - - Abstract decorator class of a DocIdSetIterator - implementation that provides on-demand filter/validation - mechanism on an underlying DocIdSetIterator. See {@link - FilteredDocIdSet}. - - - - Constructor. - Underlying DocIdSetIterator. - - - - Validation method to determine whether a docid should be in the result set. - docid to be tested - - true if input docid should be in the result set, false otherwise. - - - - - - use {@link #DocID()} instead. - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - This exception is thrown when parse errors are encountered. - You can explicitly create objects of this exception type by - calling the method generateParseException in the generated - parser. - - You can modify this class to customize your error reporting - mechanisms so long as you retain the public fields. - - - - This constructor is used by the method "generateParseException" - in the generated parser. Calling this constructor generates - a new object of this type with the fields "currentToken", - "expectedTokenSequences", and "tokenImage" set. The boolean - flag "specialConstructor" is also set to true to indicate that - this constructor was used to create this object. - This constructor calls its super class with the empty string - to force the "toString" method of parent class "Throwable" to - print the error message in the form: - ParseException: <result of getMessage> - - - - The following constructors are for use by you for whatever - purpose you can think of. Constructing the exception in this - manner makes the exception behave in the normal way - i.e., as - documented in the class "Throwable". The fields "errorToken", - "expectedTokenSequences", and "tokenImage" do not contain - relevant information. The JavaCC generated code does not use - these constructors. - - - - Constructor with message. - - - Constructor with message. - - - This variable determines which constructor was used to create - this object and thereby affects the semantics of the - "getMessage" method (see below). - - - - This is the last token that has been consumed successfully. If - this object has been created due to a parse error, the token - followng this token will (therefore) be the first error token. - - - - Each entry in this array is an array of integers. Each array - of integers represents a sequence of tokens (by their ordinal - values) that is expected at this point of the parse. - - - - This is a reference to the "tokenImage" array of the generated - parser within which the parse error occurred. This array is - defined in the generated ...Constants interface. - - - - The end of line string for this machine. - - - Used to convert raw characters to their escaped version - when these raw version cannot be used as part of an ASCII - string literal. - - - - This method has the standard behavior when this object has been - created using the standard constructors. Otherwise, it uses - "currentToken" and "expectedTokenSequences" to generate a parse - error message and returns it. If this object has been created - due to a parse error, and you do not catch it (it gets thrown - from the parser), then this method is called during the printing - of the final stack trace, and hence the correct error message - gets displayed. - - - - This interface describes a character stream that maintains line and - column number positions of the characters. It also has the capability - to backup the stream to some extent. An implementation of this - interface is used in the TokenManager implementation generated by - JavaCCParser. - - All the methods except backup can be implemented in any fashion. backup - needs to be implemented correctly for the correct operation of the lexer. - Rest of the methods are all used to get information like line number, - column number and the String that constitutes a token and are not used - by the lexer. Hence their implementation won't affect the generated lexer's - operation. - - - - Returns the next character from the selected input. The method - of selecting the input is the responsibility of the class - implementing this interface. Can throw any java.io.IOException. - - - - Returns the column position of the character last read. - - - - - - - Returns the line number of the character last read. - - - - - - - Returns the column number of the last character for current token (being - matched after the last call to BeginTOken). - - - - Returns the line number of the last character for current token (being - matched after the last call to BeginTOken). - - - - Returns the column number of the first character for current token (being - matched after the last call to BeginTOken). - - - - Returns the line number of the first character for current token (being - matched after the last call to BeginTOken). - - - - Backs up the input stream by amount steps. Lexer calls this method if it - had already read some characters, but could not use them to match a - (longer) token. So, they will be used again as the prefix of the next - token and it is the implemetation's responsibility to do this right. - - - - Returns the next character that marks the beginning of the next token. - All characters must remain in the buffer between two successive calls - to this method to implement backup correctly. - - - - Returns a string made up of characters from the marked token beginning - to the current buffer position. Implementations have the choice of returning - anything that they want to. For example, for efficiency, one might decide - to just return null, which is a valid implementation. - - - - Returns an array of characters that make up the suffix of length 'len' for - the currently matched token. This is used to build up the matched string - for use in actions in the case of MORE. A simple and inefficient - implementation of this is as follows : - - { - String t = GetImage(); - return t.substring(t.length() - len, t.length()).toCharArray(); - } - - - - The lexer calls this function to indicate that it is done with the stream - and hence implementations can free any resources held by this class. - Again, the body of this function can be just empty and it will not - affect the lexer's operation. - - - - Default implementation of Message interface. - For Native Language Support (NLS), system of software internationalization. - - - - Message Interface for a lazy loading. - For Native Language Support (NLS), system of software internationalization. - - - - This {@link IndexDeletionPolicy} implementation that - keeps only the most recent commit and immediately removes - all prior commits after a new commit is done. This is - the default deletion policy. - - - -

    Expert: policy for deletion of stale {@link IndexCommit index commits}. - -

    Implement this interface, and pass it to one - of the {@link IndexWriter} or {@link IndexReader} - constructors, to customize when older - {@link IndexCommit point-in-time commits} - are deleted from the index directory. The default deletion policy - is {@link KeepOnlyLastCommitDeletionPolicy}, which always - removes old commits as soon as a new commit is done (this - matches the behavior before 2.2).

    - -

    One expected use case for this (and the reason why it - was first created) is to work around problems with an - index directory accessed via filesystems like NFS because - NFS does not provide the "delete on last close" semantics - that Lucene's "point in time" search normally relies on. - By implementing a custom deletion policy, such as "a - commit is only removed once it has been stale for more - than X minutes", you can give your readers time to - refresh to the new commit before {@link IndexWriter} - removes the old commits. Note that doing so will - increase the storage requirements of the index. See LUCENE-710 - for details.

    -

    -
    - -

    This is called once when a writer is first - instantiated to give the policy a chance to remove old - commit points.

    - -

    The writer locates all index commits present in the - index directory and calls this method. The policy may - choose to delete some of the commit points, doing so by - calling method {@link IndexCommit#delete delete()} - of {@link IndexCommit}.

    - -

    Note: the last CommitPoint is the most recent one, - i.e. the "front index state". Be careful not to delete it, - unless you know for sure what you are doing, and unless - you can afford to lose the index content while doing that. - -

    - List of current - {@link IndexCommit point-in-time commits}, - sorted by age (the 0th one is the oldest commit). - -
    - -

    This is called each time the writer completed a commit. - This gives the policy a chance to remove old commit points - with each commit.

    - -

    The policy may now choose to delete old commit points - by calling method {@link IndexCommit#delete delete()} - of {@link IndexCommit}.

    - -

    If writer has autoCommit = true then - this method will in general be called many times during - one instance of {@link IndexWriter}. If - autoCommit = false then this method is - only called once when {@link IndexWriter#close} is - called, or not at all if the {@link IndexWriter#abort} - is called. - -

    Note: the last CommitPoint is the most recent one, - i.e. the "front index state". Be careful not to delete it, - unless you know for sure what you are doing, and unless - you can afford to lose the index content while doing that. - -

    - List of {@link IndexCommit}, - sorted by age (the 0th one is the oldest commit). - -
    - - Deletes all commits except the most recent one. - - - Deletes all commits except the most recent one. - - - For each Field, store a sorted collection of {@link TermVectorEntry}s -

    - This is not thread-safe. -

    -
    - - The TermVectorMapper can be used to map Term Vectors into your own - structure instead of the parallel array structure used by - {@link Lucene.Net.Index.IndexReader#GetTermFreqVector(int,String)}. -

    - It is up to the implementation to make sure it is thread-safe. - - - -

    -
    - - - true if this mapper should tell Lucene to ignore positions even if they are stored - - similar to ignoringPositions - - - - Tell the mapper what to expect in regards to field, number of terms, offset and position storage. - This method will be called once before retrieving the vector for a field. - - This method will be called before {@link #Map(String,int,TermVectorOffsetInfo[],int[])}. - - The field the vector is for - - The number of terms that need to be mapped - - true if the mapper should expect offset information - - true if the mapper should expect positions info - - - - Map the Term Vector information into your own structure - The term to add to the vector - - The frequency of the term in the document - - null if the offset is not specified, otherwise the offset into the field of the term - - null if the position is not specified, otherwise the position in the field of the term - - - - Indicate to Lucene that even if there are positions stored, this mapper is not interested in them and they - can be skipped over. Derived classes should set this to true if they want to ignore positions. The default - is false, meaning positions will be loaded if they are stored. - - false - - - - - Same principal as {@link #IsIgnoringPositions()}, but applied to offsets. false by default. - - false - - - - Passes down the index of the document whose term vector is currently being mapped, - once for each top level call to a term vector reader. -

    - Default implementation IGNORES the document number. Override if your implementation needs the document number. -

    - NOTE: Document numbers are internal to Lucene and subject to change depending on indexing operations. - -

    - index of document currently being mapped - -
    - - - A Comparator for sorting {@link TermVectorEntry}s - - - - Get the mapping between fields and terms, sorted by the comparator - - - A map between field names and {@link java.util.SortedSet}s per field. SortedSet entries are {@link TermVectorEntry} - - - - Combines multiple files into a single compound file. - The file format:
    -
      -
    • VInt fileCount
    • -
    • {Directory} - fileCount entries with the following structure:
    • -
        -
      • long dataOffset
      • -
      • String fileName
      • -
      -
    • {File Data} - fileCount entries with the raw data of the corresponding file
    • -
    - - The fileCount integer indicates how many files are contained in this compound - file. The {directory} that follows has that many entries. Each directory entry - contains a long pointer to the start of this file's data section, and a String - with that file's name. - - -
    - $Id: CompoundFileWriter.java 690539 2008-08-30 17:33:06Z mikemccand $ - -
    - - Create the compound stream in the specified file. The file name is the - entire name (no extensions are added). - - NullPointerException if dir or name is null - - - Returns the directory of the compound file. - - - Returns the name of the compound file. - - - Add a source stream. file is the string by which the - sub-stream will be known in the compound stream. - - - IllegalStateException if this writer is closed - NullPointerException if file is null - IllegalArgumentException if a file with the same name - has been added already - - - - Merge files with the extensions added up to now. - All files with these extensions are combined sequentially into the - compound stream. After successful merge, the source files - are deleted. - - IllegalStateException if close() had been called before or - if no file has been added to this object - - - - Copy the contents of the file with specified extension into the - provided output stream. Use the provided buffer for moving data - to reduce memory allocation. - - - - source file - - - temporary holder for the start of directory entry for this file - - - temporary holder for the start of this file's data section - - - Class for accessing a compound stream. - This class implements a directory, but is limited to only read operations. - Directory methods that would normally modify data throw an exception. - - - - $Id: CompoundFileReader.java 673371 2008-07-02 11:57:27Z mikemccand $ - - - - - .NET - - - - Returns an array of strings, one for each file in the directory. - - - Returns true iff a file with the given name exists. - - - Returns the time the compound file was last modified. - - - Set the modified time of the compound file to now. - - - Not implemented - UnsupportedOperationException - - - Not implemented - UnsupportedOperationException - - - Returns the length of a file in the directory. - IOException if the file does not exist - - - Not implemented - UnsupportedOperationException - - - Not implemented - UnsupportedOperationException - - - Implementation of an IndexInput that reads from a portion of the - compound file. The visibility is left as "package" *only* because - this helps with testing since JUnit test cases in a different class - can then access package fields of this class. - - - - Expert: implements buffer refill. Reads bytes from the current - position in the input. - - the array to read bytes into - - the offset in the array to start storing bytes - - the number of bytes to read - - - - Expert: implements seek. Sets current position in this file, where - the next {@link #ReadInternal(byte[],int,int)} will occur. - - - - - - Closes the stream to further operations. - - - The payload of a Token. See also {@link Payload}. - - - The payload of a Token. See also {@link Payload}. - - - Returns this Token's payload. - - - Sets this Token's payload. - - - Initialize this attribute with no payload. - - - Initialize this attribute with the given payload. - - - Returns this Token's payload. - - - Sets this Token's payload. - - - The start and end character offset of a Token. - - - Returns this Token's starting offset, the position of the first character - corresponding to this token in the source text. - Note that the difference between endOffset() and startOffset() may not be - equal to termText.length(), as the term text may have been altered by a - stemmer or some other filter. - - - - Set the starting and ending offset. - See StartOffset() and EndOffset() - - - - Returns this Token's ending offset, one greater than the position of the - last character corresponding to this token in the source text. The length - of the token in the source text is (endOffset - startOffset). - - - - This attribute can be used to pass different flags down the tokenizer chain, - eg from one TokenFilter to another one. - - - - This attribute can be used to pass different flags down the {@link Tokenizer} chain, - eg from one TokenFilter to another one. - - - - EXPERIMENTAL: While we think this is here to stay, we may want to change it to be a long. -

    - - Get the bitset for any bits that have been set. This is completely distinct from {@link TypeAttribute#Type()}, although they do share similar purposes. - The flags can be used to encode information about the token for use by other {@link Lucene.Net.Analysis.TokenFilter}s. - - -

    - The bits - -
    - - - - - - EXPERIMENTAL: While we think this is here to stay, we may want to change it to be a long. -

    - - Get the bitset for any bits that have been set. This is completely distinct from {@link TypeAttribute#Type()}, although they do share similar purposes. - The flags can be used to encode information about the token for use by other {@link Lucene.Net.Analysis.TokenFilter}s. - - -

    - The bits - -
    - - - - - - Common util methods for dealing with {@link IndexReader}s. - - - - - Gathers sub-readers from reader into a List. - - - - - - - - - Returns sub IndexReader that contains the given document id. - - - id of document - - parent reader - - sub reader of parent which contains the specified doc id - - - - Returns sub-reader subIndex from reader. - - - parent reader - - index of desired sub reader - - the subreader at subINdex - - - - Returns index of the searcher/reader for document n in the - array used to construct this searcher/reader. - - - - A {@link HitCollector} implementation that collects the top-sorting - documents, returning them as a {@link TopFieldDocs}. This is used by {@link - IndexSearcher} to implement {@link TopFieldDocs}-based search. - -

    This may be extended, overriding the collect method to, e.g., - conditionally invoke super() in order to filter which - documents are collected. - -

    - Please use {@link TopFieldCollector} instead. - -
    - - A {@link HitCollector} implementation that collects the top-scoring - documents, returning them as a {@link TopDocs}. This is used by {@link - IndexSearcher} to implement {@link TopDocs}-based search. - -

    This may be extended, overriding the collect method to, e.g., - conditionally invoke super() in order to filter which - documents are collected. - -

    - Please use {@link TopScoreDocCollector} - instead, which has better performance. - - -
    - - Lower-level search API.
    - HitCollectors are primarily meant to be used to implement queries, sorting - and filtering. See {@link Collector} for a lower level and higher performance - (on a multi-segment index) API. - -
    - - - $Id: HitCollector.java 764551 2009-04-13 18:33:56Z mikemccand $ - - Please use {@link Collector} instead. - -
    - - Called once for every document matching a query, with the document - number and its raw score. - -

    If, for example, an application wished to collect all of the hits for a - query in a BitSet, then it might:

    -            Searcher searcher = new IndexSearcher(indexReader);
    -            final BitSet bits = new BitSet(indexReader.maxDoc());
    -            searcher.search(query, new HitCollector() {
    -            public void collect(int doc, float score) {
    -            bits.set(doc);
    -            }
    -            });
    -            
    - -

    Note: This is called in an inner search loop. For good search - performance, implementations of this method should not call - {@link Searcher#Doc(int)} or - {@link Lucene.Net.Index.IndexReader#Document(int)} on every - document number encountered. Doing so can slow searches by an order - of magnitude or more. -

    Note: The score passed to this method is a raw score. - In other words, the score will not necessarily be a float whose value is - between 0 and 1. -

    -
    - - The total number of hits the collector encountered. - - - The priority queue which holds the top-scoring documents. - - - Construct to collect a given number of hits. - the maximum number of hits to collect - - - - use TopDocCollector(hq) instead. numHits is not used by this - constructor. It will be removed in a future release. - - - - Constructor to collect the top-scoring documents by using the given PQ. - the PQ to use by this instance. - - - - The total number of documents that matched this query. - - - The top-scoring hits. - - - Construct to collect a given number of hits. - the index to be searched - - the sort criteria - - the maximum number of hits to collect - - - - Matches spans near the beginning of a field. - - - Construct a SpanFirstQuery matching spans in match whose end - position is less than or equal to end. - - - - Return the SpanQuery whose matches are filtered. - - - Return the maximum end position permitted in a match. - - - Returns a collection of all terms matched by this query. - use extractTerms instead - - - - - - Expert: Scoring functionality for phrase queries. -
    A document is considered matching if it contains the phrase-query terms - at "valid" positons. What "valid positions" are - depends on the type of the phrase query: for an exact phrase query terms are required - to appear in adjacent locations, while for a sloppy phrase query some distance between - the terms is allowed. The abstract method {@link #PhraseFreq()} of extending classes - is invoked for each document containing all the phrase query terms, in order to - compute the frequency of the phrase query in that document. A non zero frequency - means a match. -
    -
    - - use {@link #DocID()} instead. - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - For a document containing all the phrase query terms, compute the - frequency of the phrase in that document. - A non zero frequency means a match. -
    Note, that containing all phrase terms does not guarantee a match - they have to be found in matching locations. -
    - frequency of the phrase in current doc, 0 if not found. - -
    - - Returns the maximum payload score seen, else 1 if there are no payloads on the doc. -

    - Is thread safe and completely reusable. - - -

    -
    - - An abstract class that defines a way for Payload*Query instances - to transform the cumulative effects of payload scores for a document. - - - for more information - -

    - This class and its derivations are experimental and subject to change - - - - - -

    Calculate the score up to this point for this doc and field - The current doc - - The field - - The start position of the matching Span - - The end position of the matching Span - - The number of payloads seen so far - - The current score so far - - The score for the current payload - - The new current Score - - - - -
    - - Calculate the final score for all the payloads seen so far for this doc/field - The current doc - - The current field - - The total number of payloads seen on this document - - The raw score for those payloads - - The final score for the payloads - - - - Expert: obtains single byte field values from the - {@link Lucene.Net.Search.FieldCache FieldCache} - using getBytes() and makes those values - available as other numeric types, casting as needed. - -

    - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

    - for requirements" - on the field. - -

    NOTE: with the switch in 2.9 to segment-based - searching, if {@link #getValues} is invoked with a - composite (multi-segment) reader, this can easily cause - double RAM usage for the values in the FieldCache. It's - best to switch your application to pass only atomic - (single segment) readers to this API. Alternatively, for - a short-term fix, you could wrap your ValueSource using - {@link MultiValueSource}, which costs more CPU per lookup - but will not consume double the FieldCache RAM.

    - - - -

    Create a cached byte field source with default string-to-byte parser. -
    - - Create a cached byte field source with a specific string-to-byte parser. - - - Expert: Maintains caches of term values. - -

    Created: May 19, 2004 11:13:14 AM - -

    - lucene 1.4 - - $Id: FieldCache.java 807841 2009-08-25 22:27:31Z markrmiller $ - - - -
    - - Expert: Stores term text values and document ordering data. - - - All the term values, in natural order. - - - For each document, an index into the lookup array. - - - Creates one of these objects - - - EXPERT: A unique Identifier/Description for each item in the FieldCache. - Can be useful for logging/debugging. -

    - EXPERIMENTAL API: This API is considered extremely advanced - and experimental. It may be removed or altered w/o warning in future - releases - of Lucene. -

    -

    -
    - - - - - - Computes (and stores) the estimated size of the cache Value - - - - - The most recently estimated size of the value, null unless - estimateSize has been called. - - - - Indicator for StringIndex values in the cache. - - - Expert: The cache used internally by sorting and range query classes. - - - The default parser for byte values, which are encoded by {@link Byte#toString(byte)} - - - The default parser for short values, which are encoded by {@link Short#toString(short)} - - - The default parser for int values, which are encoded by {@link Integer#toString(int)} - - - The default parser for float values, which are encoded by {@link Float#toString(float)} - - - The default parser for long values, which are encoded by {@link Long#toString(long)} - - - The default parser for double values, which are encoded by {@link Double#toString(double)} - - - A parser instance for int values encoded by {@link NumericUtils#IntToPrefixCoded(int)}, e.g. when indexed - via {@link NumericField}/{@link NumericTokenStream}. - - - - A parser instance for float values encoded with {@link NumericUtils}, e.g. when indexed - via {@link NumericField}/{@link NumericTokenStream}. - - - - A parser instance for long values encoded by {@link NumericUtils#LongToPrefixCoded(long)}, e.g. when indexed - via {@link NumericField}/{@link NumericTokenStream}. - - - - A parser instance for double values encoded with {@link NumericUtils}, e.g. when indexed - via {@link NumericField}/{@link NumericTokenStream}. - - - - Interface to parse bytes from document fields. - - - - - Marker interface as super-interface to all parsers. It - is used to specify a custom parser to {@link - SortField#SortField(String, FieldCache.Parser)}. - - - - Return a single Byte representation of this field's value. - - - Interface to parse shorts from document fields. - - - - - Return a short representation of this field's value. - - - Interface to parse ints from document fields. - - - - - Return an integer representation of this field's value. - - - Interface to parse floats from document fields. - - - - - Return an float representation of this field's value. - - - Interface to parse long from document fields. - - - Use {@link FieldCache.LongParser}, this will be removed in Lucene 3.0 - - - - Return an long representation of this field's value. - - - Interface to parse doubles from document fields. - - - Use {@link FieldCache.DoubleParser}, this will be removed in Lucene 3.0 - - - - Return an long representation of this field's value. - - - Checks the internal cache for an appropriate entry, and if none is - found, reads the terms in field as a single byte and returns an array - of size reader.maxDoc() of the value each document - has in the given field. - - Used to get field values. - - Which field contains the single byte values. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is found, - reads the terms in field as bytes and returns an array of - size reader.maxDoc() of the value each document has in the - given field. - - Used to get field values. - - Which field contains the bytes. - - Computes byte for string values. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is - found, reads the terms in field as shorts and returns an array - of size reader.maxDoc() of the value each document - has in the given field. - - Used to get field values. - - Which field contains the shorts. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is found, - reads the terms in field as shorts and returns an array of - size reader.maxDoc() of the value each document has in the - given field. - - Used to get field values. - - Which field contains the shorts. - - Computes short for string values. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is - found, reads the terms in field as integers and returns an array - of size reader.maxDoc() of the value each document - has in the given field. - - Used to get field values. - - Which field contains the integers. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is found, - reads the terms in field as integers and returns an array of - size reader.maxDoc() of the value each document has in the - given field. - - Used to get field values. - - Which field contains the integers. - - Computes integer for string values. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if - none is found, reads the terms in field as floats and returns an array - of size reader.maxDoc() of the value each document - has in the given field. - - Used to get field values. - - Which field contains the floats. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if - none is found, reads the terms in field as floats and returns an array - of size reader.maxDoc() of the value each document - has in the given field. - - Used to get field values. - - Which field contains the floats. - - Computes float for string values. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is - found, reads the terms in field as longs and returns an array - of size reader.maxDoc() of the value each document - has in the given field. - - - Used to get field values. - - Which field contains the longs. - - The values in the given field for each document. - - java.io.IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is found, - reads the terms in field as longs and returns an array of - size reader.maxDoc() of the value each document has in the - given field. - - - Used to get field values. - - Which field contains the longs. - - Computes integer for string values. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is - found, reads the terms in field as integers and returns an array - of size reader.maxDoc() of the value each document - has in the given field. - - - Used to get field values. - - Which field contains the doubles. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none is found, - reads the terms in field as doubles and returns an array of - size reader.maxDoc() of the value each document has in the - given field. - - - Used to get field values. - - Which field contains the doubles. - - Computes integer for string values. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none - is found, reads the term values in field and returns an array - of size reader.maxDoc() containing the value each document - has in the given field. - - Used to get field values. - - Which field contains the strings. - - The values in the given field for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if none - is found reads the term values in field and returns - an array of them in natural order, along with an array telling - which element in the term array each document uses. - - Used to get field values. - - Which field contains the strings. - - Array of terms and index into the array for each document. - - IOException If any error occurs. - - - Checks the internal cache for an appropriate entry, and if - none is found reads field to see if it contains integers, longs, floats - or strings, and then calls one of the other methods in this class to get the - values. For string values, a StringIndex is returned. After - calling this method, there is an entry in the cache for both - type AUTO and the actual found type. - - Used to get field values. - - Which field contains the values. - - int[], long[], float[] or StringIndex. - - IOException If any error occurs. - Please specify the exact type, instead. - Especially, guessing does not work with the new - {@link NumericField} type. - - - - Checks the internal cache for an appropriate entry, and if none - is found reads the terms out of field and calls the given SortComparator - to get the sort values. A hit in the cache will happen if reader, - field, and comparator are the same (using equals()) - as a previous call to this method. - - Used to get field values. - - Which field contains the values. - - Used to convert terms into something to sort by. - - Array of sort objects, one for each document. - - IOException If any error occurs. - Please implement {@link - FieldComparatorSource} directly, instead. - - - - EXPERT: Generates an array of CacheEntry objects representing all items - currently in the FieldCache. -

    - NOTE: These CacheEntry objects maintain a strong refrence to the - Cached Values. Maintaining refrences to a CacheEntry the IndexReader - associated with it has garbage collected will prevent the Value itself - from being garbage collected when the Cache drops the WeakRefrence. -

    -

    - EXPERIMENTAL API: This API is considered extremely advanced - and experimental. It may be removed or altered w/o warning in future - releases - of Lucene. -

    -

    -
    - -

    - EXPERT: Instructs the FieldCache to forcibly expunge all entries - from the underlying caches. This is intended only to be used for - test methods as a way to ensure a known base state of the Cache - (with out needing to rely on GC to free WeakReferences). - It should not be relied on for "Cache maintenance" in general - application code. -

    -

    - EXPERIMENTAL API: This API is considered extremely advanced - and experimental. It may be removed or altered w/o warning in future - releases - of Lucene. -

    -

    -
    - - - Expert: drops all cache entries associated with this - reader. NOTE: this reader must precisely match the - reader that the cache entry is keyed on. If you pass a - top-level reader, it usually will have no effect as - Lucene now caches at the segment reader level. - - - - If non-null, FieldCacheImpl will warn whenever - entries are created that are not sane according to - {@link Lucene.Net.Util.FieldCacheSanityChecker}. - - - - counterpart of {@link #SetInfoStream(PrintStream)} - - - Expert: Describes the score computation for document and query, and - can distinguish a match independent of a positive value. - - - - Expert: Describes the score computation for document and query. - - - Indicates whether or not this Explanation models a good match. - -

    - By default, an Explanation represents a "match" if the value is positive. -

    -

    - - -
    - - The value assigned to this explanation node. - - - Sets the value assigned to this explanation node. - - - A description of this explanation node. - - - Sets the description of this explanation node. - - - A short one line summary which should contain all high level - information about this Explanation, without the "Details" - - - - The sub-nodes of this explanation node. - - - Adds a sub-node to this explanation node. - - - Render an explanation as text. - - - Render an explanation as HTML. - - - Small Util class used to pass both an idf factor as well as an - explanation for that factor. - - This class will likely be held on a {@link Weight}, so be aware - before storing any large or un-serializable fields. - - - - - the idf factor - - - - This should be calculated lazily if possible. - - - the explanation for the idf factor. - - - - The match status of this explanation node. - May be null if match status is unknown - - - - Sets the match status assigned to this explanation node. - May be null if match status is unknown - - - - Indicates whether or not this Explanation models a good match. - -

    - If the match status is explicitly set (i.e.: not null) this method - uses it; otherwise it defers to the superclass. -

    -

    - - -
    - - Optimized implementation. - - - Overridden by SegmentTermPositions to skip in prox stream. - - - Optimized implementation. - - - Called by super.skipTo(). - - - This is the base class for an in-memory posting list, - keyed by a Token. {@link TermsHash} maintains a hash - table holding one instance of this per unique Token. - Consumers of TermsHash ({@link TermsHashConsumer}) must - subclass this class with its own concrete class. - FreqProxTermsWriter.PostingList is a private inner class used - for the freq/prox postings, and - TermVectorsTermsWriter.PostingList is a private inner class - used to hold TermVectors postings. - - - -

    [Note that as of 2.1, all but one of the - methods in this class are available via {@link - IndexWriter}. The one method that is not available is - {@link #DeleteDocument(int)}.]

    - - A class to modify an index, i.e. to delete and add documents. This - class hides {@link IndexReader} and {@link IndexWriter} so that you - do not need to care about implementation details such as that adding - documents is done via IndexWriter and deletion is done via IndexReader. - -

    Note that you cannot create more than one IndexModifier object - on the same directory at the same time. - -

    Example usage: - - - - - -

    - - - - - - -
    - -     Analyzer analyzer = new StandardAnalyzer();
    -     // create an index in /tmp/index, overwriting an existing one:
    -     IndexModifier indexModifier = new IndexModifier("/tmp/index", analyzer, true);
    -     Document doc = new Document();
    -     doc.add(new Field("id""1", Field.Store.YES, Field.Index.NOT_ANALYZED));
    -     doc.add(new Field("body""a simple test", Field.Store.YES, Field.Index.ANALYZED));
    -     indexModifier.addDocument(doc);
    -     int deleted = indexModifier.delete(new Term("id""1"));
    -     System.out.println("Deleted " + deleted + " document");
    -     indexModifier.flush();
    -     System.out.println(indexModifier.docCount() " docs in index");
    -     indexModifier.close();
    -
    -
    - - - -

    Not all methods of IndexReader and IndexWriter are offered by this - class. If you need access to additional methods, either use those classes - directly or implement your own class that extends IndexModifier. - -

    Although an instance of this class can be used from more than one - thread, you will not get the best performance. You might want to use - IndexReader and IndexWriter directly for that (but you will need to - care about synchronization yourself then). - -

    While you can freely mix calls to add() and delete() using this class, - you should batch you calls for best performance. For example, if you - want to update 20 documents, you should first delete all those documents, - then add all the new documents. - -

    - Please use {@link IndexWriter} instead. - -
    - - Open an index with write access. - - - the index directory - - the analyzer to use for adding new documents - - true to create the index or overwrite the existing one; - false to append to the existing index - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Open an index with write access. - - - the index directory - - the analyzer to use for adding new documents - - true to create the index or overwrite the existing one; - false to append to the existing index - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Open an index with write access. - - - the index directory - - the analyzer to use for adding new documents - - true to create the index or overwrite the existing one; - false to append to the existing index - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Initialize an IndexWriter. - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Throw an IllegalStateException if the index is closed. - IllegalStateException - - - Close the IndexReader and open an IndexWriter. - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Close the IndexWriter and open an IndexReader. - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Make sure all changes are written to disk. - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Adds a document to this index, using the provided analyzer instead of the - one specific in the constructor. If the document contains more than - {@link #SetMaxFieldLength(int)} terms for a given field, the remainder are - discarded. - - - - IllegalStateException if the index is closed - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Adds a document to this index. If the document contains more than - {@link #SetMaxFieldLength(int)} terms for a given field, the remainder are - discarded. - - - - IllegalStateException if the index is closed - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Deletes all documents containing term. - This is useful if one uses a document field to hold a unique ID string for - the document. Then to delete such a document, one merely constructs a - term with the appropriate field and the unique ID string as its text and - passes it to this method. Returns the number of documents deleted. - - the number of documents deleted - - - - IllegalStateException if the index is closed - StaleReaderException if the index has changed - since this reader was opened - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Deletes the document numbered docNum. - - - StaleReaderException if the index has changed - since this reader was opened - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IllegalStateException if the index is closed - - - Returns the number of documents currently in this - index. If the writer is currently open, this returns - {@link IndexWriter#DocCount()}, else {@link - IndexReader#NumDocs()}. But, note that {@link - IndexWriter#DocCount()} does not take deletions into - account, unlike {@link IndexReader#numDocs}. - - IllegalStateException if the index is closed - - - Merges all segments together into a single segment, optimizing an index - for search. - - - - IllegalStateException if the index is closed - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - If non-null, information about merges and a message when - {@link #GetMaxFieldLength()} is reached will be printed to this. -

    Example: index.setInfoStream(System.err); -

    - - - IllegalStateException if the index is closed -
    - - - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Setting to turn on usage of a compound file. When on, multiple files - for each segment are merged into a single file once the segment creation - is finished. This is done regardless of what directory is in use. - - - - IllegalStateException if the index is closed - - - - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - The maximum number of terms that will be indexed for a single field in a - document. This limits the amount of memory required for indexing, so that - collections with very large files will not crash the indexing process by - running out of memory.

    - Note that this effectively truncates large documents, excluding from the - index terms that occur further in the document. If you know your source - documents are large, be sure to set this value high enough to accommodate - the expected size. If you set it to Integer.MAX_VALUE, then the only limit - is your memory, but you should anticipate an OutOfMemoryError.

    - By default, no more than 10,000 terms will be indexed for a field. -

    - - - IllegalStateException if the index is closed -
    - - - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Determines the minimal number of documents required before the buffered - in-memory documents are merging and a new Segment is created. - Since Documents are merged in a {@link Lucene.Net.Store.RAMDirectory}, - large value gives faster indexing. At the same time, mergeFactor limits - the number of files open in a FSDirectory. - -

    The default value is 10. - -

    - - - IllegalStateException if the index is closed - IllegalArgumentException if maxBufferedDocs is smaller than 2 -
    - - - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Determines how often segment indices are merged by addDocument(). With - smaller values, less RAM is used while indexing, and searches on - unoptimized indices are faster, but indexing speed is slower. With larger - values, more RAM is used during indexing, and while searches on unoptimized - indices are slower, indexing is faster. Thus larger values (> 10) are best - for batch index creation, and smaller values (< 10) for indices that are - interactively maintained. -

    This must never be less than 2. The default value is 10. - -

    - - - IllegalStateException if the index is closed -
    - - - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if there is a low-level IO error - - - Close this index, writing all pending changes to disk. - - - IllegalStateException if the index has been closed before already - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Used by DocumentsWriter to maintain per-thread state. - We keep a separate Posting hash and other state for each - thread and then merge postings hashes from all threads - when writing the segment. - - - - Works in conjunction with the SinkTokenizer to provide the ability to set aside tokens - that have already been analyzed. This is useful in situations where multiple fields share - many common analysis steps and then go their separate ways. -

    - It is also useful for doing things like entity extraction or proper noun analysis as - part of the analysis workflow and saving off those tokens for use in another field. - -

    -            SinkTokenizer sink1 = new SinkTokenizer();
    -            SinkTokenizer sink2 = new SinkTokenizer();
    -            TokenStream source1 = new TeeTokenFilter(new TeeTokenFilter(new WhitespaceTokenizer(reader1), sink1), sink2);
    -            TokenStream source2 = new TeeTokenFilter(new TeeTokenFilter(new WhitespaceTokenizer(reader2), sink1), sink2);
    -            TokenStream final1 = new LowerCaseFilter(source1);
    -            TokenStream final2 = source2;
    -            TokenStream final3 = new EntityDetect(sink1);
    -            TokenStream final4 = new URLDetect(sink2);
    -            d.add(new Field("f1", final1));
    -            d.add(new Field("f2", final2));
    -            d.add(new Field("f3", final3));
    -            d.add(new Field("f4", final4));
    -            
    - In this example, sink1 and sink2 will both get tokens from both - reader1 and reader2 after whitespace tokenizer - and now we can further wrap any of these in extra analysis, and more "sources" can be inserted if desired. - It is important, that tees are consumed before sinks (in the above example, the field names must be - less the sink's field names). - Note, the EntityDetect and URLDetect TokenStreams are for the example and do not currently exist in Lucene -

    - - See LUCENE-1058. -

    - WARNING: {@link TeeTokenFilter} and {@link SinkTokenizer} only work with the old TokenStream API. - If you switch to the new API, you need to use {@link TeeSinkTokenFilter} instead, which offers - the same functionality. -

    - - - Use {@link TeeSinkTokenFilter} instead - - -
    - - LowerCaseTokenizer performs the function of LetterTokenizer - and LowerCaseFilter together. It divides text at non-letters and converts - them to lower case. While it is functionally equivalent to the combination - of LetterTokenizer and LowerCaseFilter, there is a performance advantage - to doing the two tasks at once, hence this (redundant) implementation. -

    - Note: this does a decent job for most European languages, but does a terrible - job for some Asian languages, where words are not separated by spaces. -

    -
    - - A LetterTokenizer is a tokenizer that divides text at non-letters. That's - to say, it defines tokens as maximal strings of adjacent letters, as defined - by java.lang.Character.isLetter() predicate. - Note: this does a decent job for most European languages, but does a terrible - job for some Asian languages, where words are not separated by spaces. - - - - An abstract base class for simple, character-oriented tokenizers. - - - A Tokenizer is a TokenStream whose input is a Reader. -

    - This is an abstract class; subclasses must override {@link #IncrementToken()} -

    - NOTE: Subclasses overriding {@link #next(Token)} must call - {@link AttributeSource#ClearAttributes()} before setting attributes. - Subclasses overriding {@link #IncrementToken()} must call - {@link Token#Clear()} before setting Token attributes. -

    -
    - - The text source for this Tokenizer. - - - Construct a tokenizer with null input. - - - Construct a token stream processing the given input. - - - Construct a tokenizer with null input using the given AttributeFactory. - - - Construct a token stream processing the given input using the given AttributeFactory. - - - Construct a token stream processing the given input using the given AttributeSource. - - - Construct a token stream processing the given input using the given AttributeSource. - - - By default, closes the input Reader. - - - Return the corrected offset. If {@link #input} is a {@link CharStream} subclass - this method calls {@link CharStream#CorrectOffset}, else returns currentOff. - - offset as seen in the output - - corrected offset based on the input - - - - - - Expert: Reset the tokenizer to a new reader. Typically, an - analyzer (in its reusableTokenStream method) will use - this to re-use a previously created tokenizer. - - - - Returns true iff a character should be included in a token. This - tokenizer generates as tokens adjacent sequences of characters which - satisfy this predicate. Characters for which this is false are used to - define token boundaries and are not included in tokens. - - - - Called on each token character to normalize it before it is added to the - token. The default implementation does nothing. Subclasses may use this - to, e.g., lowercase tokens. - - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Construct a new LetterTokenizer. - - - Construct a new LetterTokenizer using a given {@link AttributeSource}. - - - Construct a new LetterTokenizer using a given {@link Lucene.Net.Util.AttributeSource.AttributeFactory}. - - - Collects only characters which satisfy - {@link Character#isLetter(char)}. - - - - Construct a new LowerCaseTokenizer. - - - Construct a new LowerCaseTokenizer using a given {@link AttributeSource}. - - - Construct a new LowerCaseTokenizer using a given {@link Lucene.Net.Util.AttributeSource.AttributeFactory}. - - - Converts char to lower case - {@link Character#toLowerCase(char)}. - - - - A memory-resident {@link IndexInput} implementation. - - - $Id: RAMInputStream.java 632120 2008-02-28 21:13:59Z mikemccand $ - - - - Abstract base class for sorting hits returned by a Query. - -

    - This class should only be used if the other SortField types (SCORE, DOC, - STRING, INT, FLOAT) do not provide an adequate sorting. It maintains an - internal cache of values which could be quite large. The cache is an array of - Comparable, one for each document in the index. There is a distinct - Comparable for each unique term in the field - if some documents have the - same term in the field, the cache array will have entries which reference the - same Comparable. - - This class will be used as part of a key to a FieldCache value. You must - implement hashCode and equals to avoid an explosion in RAM usage if you use - instances that are not the same instance. If you are searching using the - Remote contrib, the same instance of this class on the client will be a new - instance on every call to the server, so hashCode/equals is very important in - that situation. - -

    - Created: Apr 21, 2004 5:08:38 PM - - -

    - $Id: SortComparator.java 800119 2009-08-02 17:59:21Z markrmiller $ - - 1.4 - - Please use {@link FieldComparatorSource} instead. - -
    - - Expert: returns a comparator for sorting ScoreDocs. - -

    - Created: Apr 21, 2004 3:49:28 PM - - This class will be used as part of a key to a FieldCache value. You must - implement hashCode and equals to avoid an explosion in RAM usage if you use - instances that are not the same instance. If you are searching using the - Remote contrib, the same instance of this class on the client will be a new - instance on every call to the server, so hashCode/equals is very important in - that situation. - -

    - $Id: SortComparatorSource.java 747019 2009-02-23 13:59:50Z - mikemccand $ - - 1.4 - - Please use {@link FieldComparatorSource} instead. - -
    - - Creates a comparator for the field in the given index. - Index to create comparator for. - - Name of the field to create comparator for. - - Comparator of ScoreDoc objects. - - IOException If an error occurs reading the index. - - - Returns an object which, when sorted according to natural order, - will order the Term values in the correct order. -

    For example, if the Terms contained integer values, this method - would return new Integer(termtext). Note that this - might not always be the most efficient implementation - for this - particular example, a better implementation might be to make a - ScoreDocLookupComparator that uses an internal lookup table of int. -

    - The textual value of the term. - - An object representing termtext that sorts according to the natural order of termtext. - - - - - -
    - - Compares two ScoreDoc objects and returns a result indicating their - sort order. - - First ScoreDoc - - Second ScoreDoc - - a negative integer if i should come before j
    - a positive integer if i should come after j
    - 0 if they are equal -
    - - -
    - - Returns the value used to sort the given document. The - object returned must implement the java.io.Serializable - interface. This is used by multisearchers to determine how - to collate results from their searchers. - - - - Document - - Serializable object - - - - Returns the type of sort. Should return SortField.SCORE, - SortField.DOC, SortField.STRING, - SortField.INTEGER, SortField.FLOAT or - SortField.CUSTOM. It is not valid to return - SortField.AUTO. - This is used by multisearchers to determine how to collate results - from their searchers. - - One of the constants in SortField. - - - - - - A {@link Scorer} which wraps another scorer and caches the score of the - current document. Successive calls to {@link #Score()} will return the same - result and will not invoke the wrapped Scorer's score() method, unless the - current document has changed.
    - This class might be useful due to the changes done to the {@link Collector} - interface, in which the score is not computed for a document by default, only - if the collector requests it. Some collectors may need to use the score in - several places, however all they have in hand is a {@link Scorer} object, and - might end up computing the score of a document more than once. -
    -
    - - Creates a new instance by wrapping the given scorer. - - - use {@link #DocID()} instead. - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - Wrapper for ({@link HitCollector}) implementations, which simply re-bases the - incoming docID before calling {@link HitCollector#collect}. - - - Please migrate custom HitCollectors to the new {@link Collector} - class. This class will be removed when {@link HitCollector} is - removed. - - - - Expert: obtains int field values from the - {@link Lucene.Net.Search.FieldCache FieldCache} - using getInts() and makes those values - available as other numeric types, casting as needed. - -

    - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

    - for requirements - on the field. - -

    NOTE: with the switch in 2.9 to segment-based - searching, if {@link #getValues} is invoked with a - composite (multi-segment) reader, this can easily cause - double RAM usage for the values in the FieldCache. It's - best to switch your application to pass only atomic - (single segment) readers to this API. Alternatively, for - a short-term fix, you could wrap your ValueSource using - {@link MultiValueSource}, which costs more CPU per lookup - but will not consume double the FieldCache RAM.

    - - - -

    Create a cached int field source with default string-to-int parser. -
    - - Create a cached int field source with a specific string-to-int parser. - - - Expert: A hit queue for sorting by hits by terms in more than one field. - Uses FieldCache.DEFAULT for maintaining internal term lookup tables. - -

    Created: Dec 8, 2003 12:56:03 PM - -

    - lucene 1.4 - - $Id: FieldSortedHitQueue.java 803676 2009-08-12 19:31:38Z hossman $ - - - - - - see {@link FieldValueHitQueue} - -
    - - Creates a hit queue sorted by the given list of fields. - Index to use. - - Fieldable names, in priority order (highest priority first). Cannot be null or empty. - - The number of hits to retain. Must be greater than zero. - - IOException - - - Stores a comparator corresponding to each field being sorted by - - - Stores the sort criteria being used. - - - Stores the maximum score value encountered, needed for normalizing. - - - returns the maximum score encountered by elements inserted via insert() - - - Returns whether a is less relevant than b. - ScoreDoc - - ScoreDoc - - true if document a should be sorted after document b. - - - - Given a FieldDoc object, stores the values used - to sort the given document. These values are not the raw - values out of the index, but the internal representation - of them. This is so the given search hit can be collated - by a MultiSearcher with other search hits. - - The FieldDoc to store sort values into. - - The same FieldDoc passed in. - - - - - - Returns the SortFields being used by this hit queue. - - - Internal cache of comparators. Similar to FieldCache, only - caches comparators instead of term values. - - - - Returns a comparator for sorting hits according to a field containing bytes. - Index to use. - - Fieldable containing integer values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to a field containing shorts. - Index to use. - - Fieldable containing integer values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to a field containing integers. - Index to use. - - Fieldable containing integer values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to a field containing integers. - Index to use. - - Fieldable containing integer values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to a field containing floats. - Index to use. - - Fieldable containing float values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to a field containing doubles. - Index to use. - - Fieldable containing float values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to a field containing strings. - Index to use. - - Fieldable containing string values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to a field containing strings. - Index to use. - - Fieldable containing string values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Returns a comparator for sorting hits according to values in the given field. - The terms in the field are looked at to determine whether they contain integers, - floats or strings. Once the type is determined, one of the other static methods - in this class is called to get the comparator. - - Index to use. - - Fieldable containing values. - - Comparator for sorting hits. - - IOException If an error occurs reading the index. - - - Expert: Internal cache. - - - Expert: The default cache implementation, storing all values in memory. - A WeakHashMap is used for storage. - -

    Created: May 19, 2004 4:40:36 PM - -

    - lucene 1.4 - - $Id: FieldCacheImpl.java 807572 2009-08-25 11:44:45Z mikemccand $ - -
    - - Will be removed in 3.0, this is for binary compatibility only - - - - Will be removed in 3.0, this is for binary compatibility only - - - - Will be removed in 3.0, this is for binary compatibility only - - - - Will be removed in 3.0, this is for binary compatibility only - - - - The pattern used to detect float values in a field - removed for java 1.3 compatibility - protected static final Object pFloats = Pattern.compile ("[0-9+\\-\\.eEfFdD]+"); - - - - - - - - Only needed because of Entry (ab)use by - FieldSortedHitQueue, remove when FieldSortedHitQueue - is removed - - - - Only needed because of Entry (ab)use by - FieldSortedHitQueue, remove when FieldSortedHitQueue - is removed - - - - Adds warning to super.toString if Local or sortFieldType were specified - Only needed because of Entry (ab)use by - FieldSortedHitQueue, remove when FieldSortedHitQueue - is removed - - - - Hack: When thrown from a Parser (NUMERIC_UTILS_* ones), this stops - processing terms and returns the current FieldCache - array. - - - - Expert: Internal cache. - - - Remove this reader from the cache, if present. - - - Expert: Every composite-key in the internal cache is of this type. - - - Only (ab)used by FieldSortedHitQueue, - remove when FieldSortedHitQueue is removed - - - - Only (ab)used by FieldSortedHitQueue, - remove when FieldSortedHitQueue is removed - - - - Only (ab)used by FieldSortedHitQueue, - remove when FieldSortedHitQueue is removed - - - - Creates one of these objects for a custom comparator/parser. - - - Only (ab)used by FieldSortedHitQueue, - remove when FieldSortedHitQueue is removed - - - - Two of these are equal iff they reference the same field and type. - - - Composes a hashcode based on the field and type. - - - Please specify the exact type, instead. - Especially, guessing does not work with the new - {@link NumericField} type. - - - - - - - - Expert: a FieldComparator compares hits so as to determine their - sort order when collecting the top results with {@link - TopFieldCollector}. The concrete public FieldComparator - classes here correspond to the SortField types. - -

    This API is designed to achieve high performance - sorting, by exposing a tight interaction with {@link - FieldValueHitQueue} as it visits hits. Whenever a hit is - competitive, it's enrolled into a virtual slot, which is - an int ranging from 0 to numHits-1. The {@link - FieldComparator} is made aware of segment transitions - during searching in case any internal state it's tracking - needs to be recomputed during these transitions.

    - -

    A comparator must define these functions:

    - -

      - -
    • {@link #compare} Compare a hit at 'slot a' - with hit 'slot b'.
    • - -
    • {@link #setBottom} This method is called by - {@link FieldValueHitQueue} to notify the - FieldComparator of the current weakest ("bottom") - slot. Note that this slot may not hold the weakest - value according to your comparator, in cases where - your comparator is not the primary one (ie, is only - used to break ties from the comparators before it).
    • - -
    • {@link #compareBottom} Compare a new hit (docID) - against the "weakest" (bottom) entry in the queue.
    • - -
    • {@link #copy} Installs a new hit into the - priority queue. The {@link FieldValueHitQueue} - calls this method when a new hit is competitive.
    • - -
    • {@link #setNextReader} Invoked - when the search is switching to the next segment. - You may need to update internal state of the - comparator, for example retrieving new values from - the {@link FieldCache}.
    • - -
    • {@link #value} Return the sort value stored in - the specified slot. This is only called at the end - of the search, in order to populate {@link - FieldDoc#fields} when returning the top results.
    • -
    - - NOTE: This API is experimental and might change in - incompatible ways in the next release. -
    -
    - - Compare hit at slot1 with hit at slot2. - - - first slot to compare - - second slot to compare - - any N < 0 if slot2's value is sorted after - slot1, any N > 0 if the slot2's value is sorted before - slot1 and 0 if they are equal - - - - Set the bottom slot, ie the "weakest" (sorted last) - entry in the queue. When {@link #compareBottom} is - called, you should compare against this slot. This - will always be called before {@link #compareBottom}. - - - the currently weakest (sorted last) slot in the queue - - - - Compare the bottom of the queue with doc. This will - only invoked after setBottom has been called. This - should return the same result as {@link - #Compare(int,int)}} as if bottom were slot1 and the new - document were slot 2. - -

    For a search that hits many results, this method - will be the hotspot (invoked by far the most - frequently).

    - -

    - that was hit - - any N < 0 if the doc's value is sorted after - the bottom entry (not competitive), any N > 0 if the - doc's value is sorted before the bottom entry and 0 if - they are equal. - -
    - - This method is called when a new hit is competitive. - You should copy any state associated with this document - that will be required for future comparisons, into the - specified slot. - - - which slot to copy the hit to - - docID relative to current reader - - - - Set a new Reader. All doc correspond to the current Reader. - - - current reader - - docBase of this reader - - IOException - IOException - - - Sets the Scorer to use in case a document's score is - needed. - - - Scorer instance that you should use to - obtain the current hit's score, if necessary. - - - - Return the actual value in the slot. - - - the value - - value in this slot upgraded to Comparable - - - - Parses field's values as byte (using {@link - FieldCache#getBytes} and sorts by ascending value - - - - Sorts by ascending docID - - - Parses field's values as double (using {@link - FieldCache#getDoubles} and sorts by ascending value - - - - Parses field's values as float (using {@link - FieldCache#getFloats} and sorts by ascending value - - - - Parses field's values as int (using {@link - FieldCache#getInts} and sorts by ascending value - - - - Parses field's values as long (using {@link - FieldCache#getLongs} and sorts by ascending value - - - - Sorts by descending relevance. NOTE: if you are - sorting only by descending relevance and then - secondarily by ascending docID, peformance is faster - using {@link TopScoreDocCollector} directly (which {@link - IndexSearcher#search} uses when no {@link Sort} is - specified). - - - - Parses field's values as short (using {@link - FieldCache#getShorts} and sorts by ascending value - - - - Sorts by a field's value using the Collator for a - given Locale. - - - - Sorts by field's natural String sort order, using - ordinals. This is functionally equivalent to {@link - StringValComparator}, but it first resolves the string - to their relative ordinal positions (using the index - returned by {@link FieldCache#getStringIndex}), and - does most comparisons using the ordinals. For medium - to large results, this comparator will be much faster - than {@link StringValComparator}. For very small - result sets it may be slower. - - - - Sorts by field's natural String sort order. All - comparisons are done using String.compareTo, which is - slow for medium to large result sets but possibly - very fast for very small results sets. - - - - Called once per field per document if term vectors - are enabled, to write the vectors to - RAMOutputStream, which is then quickly flushed to - the real term vectors files in the Directory. - - - - A {@link IndexDeletionPolicy} that wraps around any other - {@link IndexDeletionPolicy} and adds the ability to hold and - later release a single "snapshot" of an index. While - the snapshot is held, the {@link IndexWriter} will not - remove any files associated with it even if the index is - otherwise being actively, arbitrarily changed. Because - we wrap another arbitrary {@link IndexDeletionPolicy}, this - gives you the freedom to continue using whatever {@link - IndexDeletionPolicy} you would normally want to use with your - index. Note that you can re-use a single instance of - SnapshotDeletionPolicy across multiple writers as long - as they are against the same index Directory. Any - snapshot held when a writer is closed will "survive" - when the next writer is opened. - -

    WARNING: This API is a new and experimental and - may suddenly change.

    -

    -
    - - Take a snapshot of the most recent commit to the - index. You must call release() to free this snapshot. - Note that while the snapshot is held, the files it - references will not be deleted, which will consume - additional disk space in your index. If you take a - snapshot at a particularly bad time (say just before - you call optimize()) then in the worst case this could - consume an extra 1X of your total index size, until - you release the snapshot. - - - - Release the currently held snapshot. - - - An IndexReader which reads indexes with multiple segments. - - - Construct reading the named set of readers. - - - This constructor is only used for {@link #Reopen()} - - - Version number when this IndexReader was opened. - - - Checks is the index is optimized (if it has a single segment and no deletions) - true if the index is optimized; false otherwise - - - - Tries to acquire the WriteLock on this directory. this method is only valid if this IndexReader is directory - owner. - - - StaleReaderException if the index has changed since this reader was opened - CorruptIndexException if the index is corrupt - Lucene.Net.Store.LockObtainFailedException - if another writer has this index open (write.lock could not be - obtained) - - IOException if there is a low-level IO error - - - - - - - Commit changes resulting from delete, undeleteAll, or setNorm operations -

    - If an exception is hit, then either no changes or all changes will have been committed to the index (transactional - semantics). - -

    - IOException if there is a low-level IO error -
    - - Returns the directory this index resides in. - - - Expert: return the IndexCommit that this reader has opened. -

    -

    WARNING: this API is new and experimental and may suddenly change.

    -

    -
    - - - - - - Optimized implementation. - - - For each Field, store position by position information. It ignores frequency information -

    - This is not thread-safe. -

    -
    - - A Map of Integer and TVPositionInfo - - - - - - - - Never ignores positions. This mapper doesn't make much sense unless there are positions - false - - - - Callback for the TermVectorReader. - - - - - - - - - - - Callback mechanism used by the TermVectorReader - The field being read - - The number of terms in the vector - - Whether offsets are available - - Whether positions are available - - - - Get the mapping between fields and terms, sorted by the comparator - - - A map between field names and a Map. The sub-Map key is the position as the integer, the value is {@link Lucene.Net.Index.PositionBasedTermVectorMapper.TVPositionInfo}. - - - - Container for a term at a position - - - - The position of the term - - - - Note, there may be multiple terms at the same position - A List of Strings - - - - Parallel list (to {@link #getTerms()}) of TermVectorOffsetInfo objects. There may be multiple entries since there may be multiple terms at a position - A List of TermVectorOffsetInfo objects, if offsets are store. - - - - NOTE: this API is experimental and will likely change - - - Adds a new doc in this term. If this returns null - then we just skip consuming positions/payloads. - - - - Called when we are done adding docs to this term - - - Holds state for inverting all occurrences of a single - field in the document. This class doesn't do anything - itself; instead, it forwards the tokens produced by - analysis to its own consumer - (InvertedDocConsumerPerField). It also interacts with an - endConsumer (InvertedDocEndConsumerPerField). - - - - Process the document. If there is - something for this document to be done in docID order, - you should encapsulate that as a - DocumentsWriter.DocWriter and return it. - DocumentsWriter then calls finish() on this object - when it's its turn. - - - - - Base class for enumerating all but deleted docs. - -

    NOTE: this class is meant only to be used internally - by Lucene; it's only public so it can be shared across - packages. This means the API is freely subject to - change, and, the class could be removed entirely, in any - Lucene release. Use directly at your own risk! */ -

    -
    - - Load the First field and break. -

    - See {@link FieldSelectorResult#LOAD_AND_BREAK} -

    -
    - - Similar to a {@link java.io.FileFilter}, the FieldSelector allows one to make decisions about - what Fields get loaded on a {@link Document} by {@link Lucene.Net.Index.IndexReader#Document(int,Lucene.Net.Documents.FieldSelector)} - - - - - - - the field to accept or reject - - an instance of {@link FieldSelectorResult} - if the {@link Field} named fieldName should be loaded. - - - - Loader for text files that represent a list of stopwords. - - - - $Id: WordlistLoader.java 706342 2008-10-20 17:19:29Z gsingers $ - - - - Loads a text file and adds every line as an entry to a HashSet (omitting - leading and trailing whitespace). Every line of the file should contain only - one word. The words need to be in lowercase if you make use of an - Analyzer which uses LowerCaseFilter (like StandardAnalyzer). - - - File containing the wordlist - - A HashSet with the file's words - - - - Loads a text file and adds every non-comment line as an entry to a HashSet (omitting - leading and trailing whitespace). Every line of the file should contain only - one word. The words need to be in lowercase if you make use of an - Analyzer which uses LowerCaseFilter (like StandardAnalyzer). - - - File containing the wordlist - - The comment string to ignore - - A HashSet with the file's words - - - - Reads lines from a Reader and adds every line as an entry to a HashSet (omitting - leading and trailing whitespace). Every line of the Reader should contain only - one word. The words need to be in lowercase if you make use of an - Analyzer which uses LowerCaseFilter (like StandardAnalyzer). - - - Reader containing the wordlist - - A HashSet with the reader's words - - - - Reads lines from a Reader and adds every non-comment line as an entry to a HashSet (omitting - leading and trailing whitespace). Every line of the Reader should contain only - one word. The words need to be in lowercase if you make use of an - Analyzer which uses LowerCaseFilter (like StandardAnalyzer). - - - Reader containing the wordlist - - The string representing a comment. - - A HashSet with the reader's words - - - - Reads a stem dictionary. Each line contains: -
    word\tstem
    - (i.e. two tab seperated words) - -
    - stem dictionary that overrules the stemming algorithm - - IOException -
    - - Expert: A Directory instance that switches files between - two other Directory instances. -

    Files with the specified extensions are placed in the - primary directory; others are placed in the secondary - directory. The provided Set must not change once passed - to this class, and must allow multiple threads to call - contains at once.

    - -

    NOTE: this API is new and experimental and is - subject to suddenly change in the next release. -

    -
    - - Return the primary directory - - - Return the secondary directory - - - - .NET - - - - Utility method to return a file's extension. - - - A {@link Collector} that sorts by {@link SortField} using - {@link FieldComparator}s. -

    - See the {@link #create(Lucene.Net.Search.Sort, int, boolean, boolean, boolean, boolean)} method - for instantiating a TopFieldCollector. - -

    NOTE: This API is experimental and might change in - incompatible ways in the next release.

    -

    -
    - - Creates a new {@link TopFieldCollector} from the given - arguments. - -

    NOTE: The instances returned by this method - pre-allocate a full array of length - numHits. - -

    - the sort criteria (SortFields). - - the number of results to collect. - - specifies whether the actual field values should be returned on - the results (FieldDoc). - - specifies whether document scores should be tracked and set on the - results. Note that if set to false, then the results' scores will - be set to Float.NaN. Setting this to true affects performance, as - it incurs the score computation on each competitive result. - Therefore if document scores are not required by the application, - it is recommended to set it to false. - - specifies whether the query's maxScore should be tracked and set - on the resulting {@link TopDocs}. Note that if set to false, - {@link TopDocs#GetMaxScore()} returns Float.NaN. Setting this to - true affects performance as it incurs the score computation on - each result. Also, setting this true automatically sets - trackDocScores to true as well. - - specifies whether documents are scored in doc Id order or not by - the given {@link Scorer} in {@link #SetScorer(Scorer)}. - - a {@link TopFieldCollector} instance which will sort the results by - the sort criteria. - - IOException -
    - - Constrains search results to only match those which also match a provided - query. - -

    This could be used, for example, with a {@link TermRangeQuery} on a suitably - formatted date field to implement date filtering. One could re-use a single - QueryFilter that matches, e.g., only documents modified within the last - week. The QueryFilter and TermRangeQuery would only need to be reconstructed - once per day. - -

    - $Id:$ - -
    - - Constructs a filter which only matches documents matching - query. - - - - Use {@link #GetDocIdSet(IndexReader)} instead. - - - - A Scorer for OR like queries, counterpart of ConjunctionScorer. - This Scorer implements {@link Scorer#SkipTo(int)} and uses skipTo() on the given Scorers. - TODO: Implement score(HitCollector, int). - - - - The number of subscorers. - - - The subscorers. - - - The minimum number of scorers that should match. - - - The scorerDocQueue contains all subscorers ordered by their current doc(), - with the minimum at the top. -
    The scorerDocQueue is initialized the first time next() or skipTo() is called. -
    An exhausted scorer is immediately removed from the scorerDocQueue. -
    If less than the minimumNrMatchers scorers - remain in the scorerDocQueue next() and skipTo() return false. -

    - After each to call to next() or skipTo() - currentSumScore is the total score of the current matching doc, - nrMatchers is the number of matching scorers, - and all scorers are after the matching doc, or are exhausted. -

    -
    - - The document number of the current match. - - - The number of subscorers that provide the current match. - - - Construct a DisjunctionScorer. - A collection of at least two subscorers. - - The positive minimum number of subscorers that should - match to match this query. -
    When minimumNrMatchers is bigger than - the number of subScorers, - no matches will be produced. -
    When minimumNrMatchers equals the number of subScorers, - it more efficient to use ConjunctionScorer. - -
    - - Construct a DisjunctionScorer, using one as the minimum number - of matching subscorers. - - - - Called the first time next() or skipTo() is called to - initialize scorerDocQueue. - - - - Scores and collects all matching documents. - The collector to which all matching documents are passed through - {@link HitCollector#Collect(int, float)}. -
    When this method is used the {@link #Explain(int)} method should not be used. - - use {@link #Score(Collector)} instead. - -
    - - Scores and collects all matching documents. - The collector to which all matching documents are passed through. -
    When this method is used the {@link #Explain(int)} method should not be used. - -
    - - Expert: Collects matching documents in a range. Hook for optimization. - Note that {@link #Next()} must be called once before this method is called - for the first time. - - The collector to which all matching documents are passed through - {@link HitCollector#Collect(int, float)}. - - Do not score documents past this. - - true if more matching documents may remain. - - use {@link #Score(Collector, int, int)} instead. - - - - Expert: Collects matching documents in a range. Hook for optimization. - Note that {@link #Next()} must be called once before this method is called - for the first time. - - The collector to which all matching documents are passed through. - - Do not score documents past this. - - true if more matching documents may remain. - - - - use {@link #NextDoc()} instead. - - - - Advance all subscorers after the current document determined by the - top of the scorerDocQueue. - Repeat until at least the minimum number of subscorers match on the same - document and all subscorers are after that document or are exhausted. -
    On entry the scorerDocQueue has at least minimumNrMatchers - available. At least the scorer with the minimum document number will be advanced. -
    - true iff there is a match. -
    In case there is a match, currentDoc, currentSumScore, - and nrMatchers describe the match. - - TODO: Investigate whether it is possible to use skipTo() when - the minimum number of matchers is bigger than one, ie. try and use the - character of ConjunctionScorer for the minimum number of matchers. - Also delay calling score() on the sub scorers until the minimum number of - matchers is reached. -
    For this, a Scorer array with minimumNrMatchers elements might - hold Scorers at currentDoc that are temporarily popped from scorerQueue. -
    -
    - - Returns the score of the current document matching the query. - Initially invalid, until {@link #Next()} is called the first time. - - - - use {@link #DocID()} instead. - - - - Returns the number of subscorers matching the current document. - Initially invalid, until {@link #Next()} is called the first time. - - - - Skips to the first match beyond the current whose document number is - greater than or equal to a given target.
    - When this method is used the {@link #Explain(int)} method should not be - used.
    - The implementation uses the skipTo() method on the subscorers. - -
    - The target document number. - - true iff there is such a match. - - use {@link #Advance(int)} instead. - -
    - - Advances to the first match beyond the current whose document number is - greater than or equal to a given target.
    - When this method is used the {@link #Explain(int)} method should not be - used.
    - The implementation uses the skipTo() method on the subscorers. - -
    - The target document number. - - the document whose number is greater than or equal to the given - target, or -1 if none exist. - -
    - - An explanation for the score of a given document. - - - - An alternative to BooleanScorer that also allows a minimum number - of optional scorers that should match. -
    Implements skipTo(), and has no limitations on the numbers of added scorers. -
    Uses ConjunctionScorer, DisjunctionScorer, ReqOptScorer and ReqExclScorer. -
    -
    - - The scorer to which all scoring will be delegated, - except for computing and using the coordination factor. - - - - The number of optionalScorers that need to match (if there are any) - - - Creates a {@link Scorer} with the given similarity and lists of required, - prohibited and optional scorers. In no required scorers are added, at least - one of the optional scorers will have to match during the search. - - - The similarity to be used. - - The minimum number of optional added scorers that should match - during the search. In case no required scorers are added, at least - one of the optional scorers will have to match during the search. - - the list of required scorers. - - the list of prohibited scorers. - - the list of optional scorers. - - - - Returns the scorer to be used for match counting and score summing. - Uses requiredScorers, optionalScorers and prohibitedScorers. - - - - Returns the scorer to be used for match counting and score summing. - Uses the given required scorer and the prohibitedScorers. - - A required scorer already built. - - - - Scores and collects all matching documents. - The collector to which all matching documents are passed through - {@link HitCollector#Collect(int, float)}. -
    When this method is used the {@link #Explain(int)} method should not be used. - - use {@link #Score(Collector)} instead. - -
    - - Scores and collects all matching documents. - The collector to which all matching documents are passed through. -
    When this method is used the {@link #Explain(int)} method should not be used. - -
    - - Expert: Collects matching documents in a range. -
    Note that {@link #Next()} must be called once before this method is - called for the first time. -
    - The collector to which all matching documents are passed through - {@link HitCollector#Collect(int, float)}. - - Do not score documents past this. - - true if more matching documents may remain. - - use {@link #Score(Collector, int, int)} instead. - -
    - - use {@link #DocID()} instead. - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - Throws an UnsupportedOperationException. - TODO: Implement an explanation of the coordination factor. - - The document number for the explanation. - - UnsupportedOperationException - - - Scorer for conjunctions, sets of queries, all of which are required. - - - use {@link #DocID()} instead. - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - Count a scorer as a single match. - - - use {@link #DocID()} instead. - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - This class is generated by JavaCC. The most important method is - {@link #Parse(String)}. - - The syntax for query strings is as follows: - A Query is a series of clauses. - A clause may be prefixed by: -
      -
    • a plus (+) or a minus (-) sign, indicating - that the clause is required or prohibited respectively; or
    • -
    • a term followed by a colon, indicating the field to be searched. - This enables one to construct queries which search multiple fields.
    • -
    - - A clause may be either: -
      -
    • a term, indicating all the documents that contain this term; or
    • -
    • a nested query, enclosed in parentheses. Note that this may be used - with a +/- prefix to require any of a set of - terms.
    • -
    - - Thus, in BNF, the query grammar is: -
    -            Query  ::= ( Clause )*
    -            Clause ::= ["+", "-"] [<TERM> ":"] ( <TERM> | "(" Query ")" )
    -            
    - -

    - Examples of appropriately formatted queries can be found in the query syntax - documentation. -

    - -

    - In {@link TermRangeQuery}s, QueryParser tries to detect date values, e.g. - date:[6/1/2005 TO 6/4/2005] produces a range query that searches - for "date" fields between 2005-06-01 and 2005-06-04. Note that the format - of the accepted input depends on {@link #SetLocale(Locale) the locale}. - By default a date is converted into a search term using the deprecated - {@link DateField} for compatibility reasons. - To use the new {@link DateTools} to convert dates, a - {@link Lucene.Net.Documents.DateTools.Resolution} has to be set. -

    -

    - The date resolution that shall be used for RangeQueries can be set - using {@link #SetDateResolution(DateTools.Resolution)} - or {@link #SetDateResolution(String, DateTools.Resolution)}. The former - sets the default date resolution for all fields, whereas the latter can - be used to set field specific date resolutions. Field specific date - resolutions take, if set, precedence over the default date resolution. -

    -

    - If you use neither {@link DateField} nor {@link DateTools} in your - index, you can create your own - query parser that inherits QueryParser and overwrites - {@link #GetRangeQuery(String, String, String, boolean)} to - use a different method for date conversion. -

    - -

    Note that QueryParser is not thread-safe.

    - -

    NOTE: there is a new QueryParser in contrib, which matches - the same syntax as this class, but is more modular, - enabling substantial customization to how a query is created. - -

    NOTE: there is a new QueryParser in contrib, which matches - the same syntax as this class, but is more modular, - enabling substantial customization to how a query is created. - NOTE: You must specify the required {@link Version} compatibility when - creating QueryParser: -

      -
    • As of 2.9, {@link #SetEnablePositionIncrements} is true by default.
    • -
    -
    -
    - - Token literal values and constants. - Generated by org.javacc.parser.OtherFilesGen#start() - - - - End of File. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - RegularExpression Id. - - - Lexical state. - - - Lexical state. - - - Lexical state. - - - Lexical state. - - - Literal token values. - - - Alternative form of QueryParser.Operator.AND - - - Alternative form of QueryParser.Operator.OR - - - The actual operator that parser uses to combine query terms - - - Constructs a query parser. - the default field for query terms. - - used to find terms in the query text. - - Use {@link #QueryParser(Version, String, Analyzer)} instead - - - - Constructs a query parser. - - - Lucene version to match. See above) - - the default field for query terms. - - used to find terms in the query text. - - - - Parses a query string, returning a {@link Lucene.Net.Search.Query}. - the query string to be parsed. - - ParseException if the parsing fails - - - Returns the analyzer. - - - - Returns the field. - - - - Get the minimal similarity for fuzzy queries. - - - Set the minimum similarity for fuzzy queries. - Default is 0.5f. - - - - Get the prefix length for fuzzy queries. - Returns the fuzzyPrefixLength. - - - - Set the prefix length for fuzzy queries. Default is 0. - The fuzzyPrefixLength to set. - - - - Sets the default slop for phrases. If zero, then exact phrase matches - are required. Default value is zero. - - - - Gets the default slop for phrases. - - - Set to true to allow leading wildcard characters. -

    - When set, * or ? are allowed as - the first character of a PrefixQuery and WildcardQuery. - Note that this can produce very slow - queries on big indexes. -

    - Default: false. -

    -
    - - - - - - Set to true to enable position increments in result query. -

    - When set, result phrase and multi-phrase queries will - be aware of position increments. - Useful when e.g. a StopFilter increases the position increment of - the token that follows an omitted token. -

    - Default: false. -

    -
    - - - - - - Sets the boolean operator of the QueryParser. - In default mode (OR_OPERATOR) terms without any modifiers - are considered optional: for example capital of Hungary is equal to - capital OR of OR Hungary.
    - In AND_OPERATOR mode terms are considered to be in conjunction: the - above mentioned query is parsed as capital AND of AND Hungary -
    -
    - - Gets implicit operator setting, which will be either AND_OPERATOR - or OR_OPERATOR. - - - - Whether terms of wildcard, prefix, fuzzy and range queries are to be automatically - lower-cased or not. Default is true. - - - - - - - - Please use {@link #setMultiTermRewriteMethod} instead. - - - - Please use {@link #getMultiTermRewriteMethod} instead. - - - - By default QueryParser uses {@link MultiTermQuery#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT} - when creating a PrefixQuery, WildcardQuery or RangeQuery. This implementation is generally preferable because it - a) Runs faster b) Does not have the scarcity of terms unduly influence score - c) avoids any "TooManyBooleanClauses" exception. - However, if your application really needs to use the - old-fashioned BooleanQuery expansion rewriting and the above - points are not relevant then use this to change - the rewrite method. - - - - - - - - Set locale used by date range parsing. - - - Returns current locale, allowing access by subclasses. - - - Sets the default date resolution used by RangeQueries for fields for which no - specific date resolutions has been set. Field specific resolutions can be set - with {@link #SetDateResolution(String, DateTools.Resolution)}. - - - the default date resolution to set - - - - Sets the date resolution used by RangeQueries for a specific field. - - - field for which the date resolution is to be set - - date resolution to set - - - - Returns the date resolution that is used by RangeQueries for the given field. - Returns null, if no default or field specific date resolution has been set - for the given field. - - - - - Sets the collator used to determine index term inclusion in ranges - for RangeQuerys. -

    - WARNING: Setting the rangeCollator to a non-null - collator using this method will cause every single index Term in the - Field referenced by lowerTerm and/or upperTerm to be examined. - Depending on the number of index Terms in this Field, the operation could - be very slow. - -

    - the collator to use when constructing RangeQuerys - -
    - - the collator used to determine index term inclusion in ranges - for RangeQuerys. - - - - use {@link #AddClause(List, int, int, Query)} instead. - - - - throw in overridden method to disallow - - - - Base implementation delegates to {@link #GetFieldQuery(String,String)}. - This method may be overridden, for example, to return - a SpanNearQuery instead of a PhraseQuery. - - - throw in overridden method to disallow - - - - throw in overridden method to disallow - - - - Builds a new BooleanQuery instance - disable coord - - new BooleanQuery instance - - - - Builds a new BooleanClause instance - sub query - - how this clause should occur when matching documents - - new BooleanClause instance - - - - Builds a new TermQuery instance - term - - new TermQuery instance - - - - Builds a new PhraseQuery instance - new PhraseQuery instance - - - - Builds a new MultiPhraseQuery instance - new MultiPhraseQuery instance - - - - Builds a new PrefixQuery instance - Prefix term - - new PrefixQuery instance - - - - Builds a new FuzzyQuery instance - Term - - minimum similarity - - prefix length - - new FuzzyQuery Instance - - - - Builds a new TermRangeQuery instance - Field - - min - - max - - true if range is inclusive - - new TermRangeQuery instance - - - - Builds a new MatchAllDocsQuery instance - new MatchAllDocsQuery instance - - - - Builds a new WildcardQuery instance - wildcard term - - new WildcardQuery instance - - - - Factory method for generating query, given a set of clauses. - By default creates a boolean query composed of clauses passed in. - - Can be overridden by extending classes, to modify query being - returned. - - - List that contains {@link BooleanClause} instances - to join. - - - Resulting {@link Query} object. - - throw in overridden method to disallow - - use {@link #GetBooleanQuery(List)} instead - - - - Factory method for generating query, given a set of clauses. - By default creates a boolean query composed of clauses passed in. - - Can be overridden by extending classes, to modify query being - returned. - - - List that contains {@link BooleanClause} instances - to join. - - - Resulting {@link Query} object. - - throw in overridden method to disallow - - - - Factory method for generating query, given a set of clauses. - By default creates a boolean query composed of clauses passed in. - - Can be overridden by extending classes, to modify query being - returned. - - - List that contains {@link BooleanClause} instances - to join. - - true if coord scoring should be disabled. - - - Resulting {@link Query} object. - - throw in overridden method to disallow - - use {@link #GetBooleanQuery(List, boolean)} instead - - - - Factory method for generating query, given a set of clauses. - By default creates a boolean query composed of clauses passed in. - - Can be overridden by extending classes, to modify query being - returned. - - - List that contains {@link BooleanClause} instances - to join. - - true if coord scoring should be disabled. - - - Resulting {@link Query} object. - - throw in overridden method to disallow - - - - Factory method for generating a query. Called when parser - parses an input term token that contains one or more wildcard - characters (? and *), but is not a prefix term token (one - that has just a single * character at the end) -

    - Depending on settings, prefix term may be lower-cased - automatically. It will not go through the default Analyzer, - however, since normal Analyzers are unlikely to work properly - with wildcard templates. -

    - Can be overridden by extending classes, to provide custom handling for - wildcard queries, which may be necessary due to missing analyzer calls. - -

    - Name of the field query will use. - - Term token that contains one or more wild card - characters (? or *), but is not simple prefix term - - - Resulting {@link Query} built for the term - - throw in overridden method to disallow - -
    - - Factory method for generating a query (similar to - {@link #getWildcardQuery}). Called when parser parses an input term - token that uses prefix notation; that is, contains a single '*' wildcard - character as its last character. Since this is a special case - of generic wildcard term, and such a query can be optimized easily, - this usually results in a different query object. -

    - Depending on settings, a prefix term may be lower-cased - automatically. It will not go through the default Analyzer, - however, since normal Analyzers are unlikely to work properly - with wildcard templates. -

    - Can be overridden by extending classes, to provide custom handling for - wild card queries, which may be necessary due to missing analyzer calls. - -

    - Name of the field query will use. - - Term token to use for building term for the query - (without trailing '*' character!) - - - Resulting {@link Query} built for the term - - throw in overridden method to disallow - -
    - - Factory method for generating a query (similar to - {@link #getWildcardQuery}). Called when parser parses - an input term token that has the fuzzy suffix (~) appended. - - - Name of the field query will use. - - Term token to use for building term for the query - - - Resulting {@link Query} built for the term - - throw in overridden method to disallow - - - - Returns a String where the escape char has been - removed, or kept only once if there was a double escape. - - Supports escaped unicode characters, e. g. translates - \\u0041 to A. - - - - - Returns the numeric value of the hexadecimal character - - - Returns a String where those characters that QueryParser - expects to be escaped are escaped by a preceding \. - - - - Command line tool to test QueryParser, using {@link Lucene.Net.Analysis.SimpleAnalyzer}. - Usage:
    - java Lucene.Net.QueryParsers.QueryParser <input> -
    -
    - - Generated Token Manager. - - - Current token. - - - Next token. - - - Constructor with user supplied CharStream. - - - Reinitialise. - - - Constructor with generated Token Manager. - - - Reinitialise. - - - Get the next Token. - - - Get the specific Token. - - - Generate ParseException. - - - Enable tracing. - - - Disable tracing. - - - The default operator for parsing queries. - Use {@link QueryParser#setDefaultOperator} to change it. - - - - Interface that exceptions should implement to support lazy loading of messages. - - For Native Language Support (NLS), system of software internationalization. - - This Interface should be implemented by all exceptions that require - translation - - - - - a instance of a class that implements the Message interface - - - - Compares {@link Lucene.Net.Index.TermVectorEntry}s first by frequency and then by - the term (case-sensitive) - - - - - - Provides access to stored term vector of - a document field. The vector consists of the name of the field, an array of the terms tha occur in the field of the - {@link Lucene.Net.Documents.Document} and a parallel array of frequencies. Thus, getTermFrequencies()[5] corresponds with the - frequency of getTerms()[5], assuming there are at least 5 terms in the Document. - - - - The {@link Lucene.Net.Documents.Fieldable} name. - The name of the field this vector is associated with. - - - - - The number of terms in the term vector. - - - - An Array of term texts in ascending order. - - - - Array of term frequencies. Locations of the array correspond one to one - to the terms in the array obtained from getTerms - method. Each location in the array contains the number of times this - term occurs in the document or the document field. - - - - Return an index in the term numbers array returned from - getTerms at which the term with the specified - term appears. If this term does not appear in the array, - return -1. - - - - Just like indexOf(int) but searches for a number of terms - at the same time. Returns an array that has the same size as the number - of terms searched for, each slot containing the result of searching for - that term number. - - - array containing terms to look for - - index in the array where the list of terms starts - - the number of terms in the list - - - - Taps into DocInverter, as an InvertedDocEndConsumer, - which is called at the end of inverting each field. We - just look at the length for the field (docState.length) - and record the norm. - - - - An IndexWriter creates and maintains an index. -

    The create argument to the {@link - #IndexWriter(Directory, Analyzer, boolean) constructor} determines - whether a new index is created, or whether an existing index is - opened. Note that you can open an index with create=true - even while readers are using the index. The old readers will - continue to search the "point in time" snapshot they had opened, - and won't see the newly created index until they re-open. There are - also {@link #IndexWriter(Directory, Analyzer) constructors} - with no create argument which will create a new index - if there is not already an index at the provided path and otherwise - open the existing index.

    -

    In either case, documents are added with {@link #AddDocument(Document) - addDocument} and removed with {@link #DeleteDocuments(Term)} or {@link - #DeleteDocuments(Query)}. A document can be updated with {@link - #UpdateDocument(Term, Document) updateDocument} (which just deletes - and then adds the entire document). When finished adding, deleting - and updating documents, {@link #Close() close} should be called.

    - -

    These changes are buffered in memory and periodically - flushed to the {@link Directory} (during the above method - calls). A flush is triggered when there are enough - buffered deletes (see {@link #setMaxBufferedDeleteTerms}) - or enough added documents since the last flush, whichever - is sooner. For the added documents, flushing is triggered - either by RAM usage of the documents (see {@link - #setRAMBufferSizeMB}) or the number of added documents. - The default is to flush when RAM usage hits 16 MB. For - best indexing speed you should flush by RAM usage with a - large RAM buffer. Note that flushing just moves the - internal buffered state in IndexWriter into the index, but - these changes are not visible to IndexReader until either - {@link #Commit()} or {@link #close} is called. A flush may - also trigger one or more segment merges which by default - run with a background thread so as not to block the - addDocument calls (see below - for changing the {@link MergeScheduler}).

    - -

    The optional autoCommit argument to the {@link - #IndexWriter(Directory, boolean, Analyzer) constructors} - controls visibility of the changes to {@link IndexReader} - instances reading the same index. When this is - false, changes are not visible until {@link - #Close()} or {@link #Commit()} is called. Note that changes will still be - flushed to the {@link Directory} as new files, but are - not committed (no new segments_N file is written - referencing the new files, nor are the files sync'd to stable storage) - until {@link #Close()} or {@link #Commit()} is called. If something - goes terribly wrong (for example the JVM crashes), then - the index will reflect none of the changes made since the - last commit, or the starting state if commit was not called. - You can also call {@link #Rollback()}, which closes the writer - without committing any changes, and removes any index - files that had been flushed but are now unreferenced. - This mode is useful for preventing readers from refreshing - at a bad time (for example after you've done all your - deletes but before you've done your adds). It can also be - used to implement simple single-writer transactional - semantics ("all or none"). You can do a two-phase commit - by calling {@link #PrepareCommit()} - followed by {@link #Commit()}. This is necessary when - Lucene is working with an external resource (for example, - a database) and both must either commit or rollback the - transaction.

    -

    When autoCommit is true then - the writer will periodically commit on its own. [Deprecated: Note that in 3.0, IndexWriter will - no longer accept autoCommit=true (it will be hardwired to - false). You can always call {@link #Commit()} yourself - when needed]. There is - no guarantee when exactly an auto commit will occur (it - used to be after every flush, but it is now after every - completed merge, as of 2.4). If you want to force a - commit, call {@link #Commit()}, or, close the writer. Once - a commit has finished, newly opened {@link IndexReader} instances will - see the changes to the index as of that commit. When - running in this mode, be careful not to refresh your - readers while optimize or segment merges are taking place - as this can tie up substantial disk space.

    -

    -

    Regardless of autoCommit, an {@link - IndexReader} or {@link Lucene.Net.Search.IndexSearcher} will only see the - index as of the "point in time" that it was opened. Any - changes committed to the index after the reader was opened - are not visible until the reader is re-opened.

    -

    If an index will not have more documents added for a while and optimal search - performance is desired, then either the full {@link #Optimize() optimize} - method or partial {@link #Optimize(int)} method should be - called before the index is closed.

    -

    Opening an IndexWriter creates a lock file for the directory in use. Trying to open - another IndexWriter on the same directory will lead to a - {@link LockObtainFailedException}. The {@link LockObtainFailedException} - is also thrown if an IndexReader on the same directory is used to delete documents - from the index.

    -

    - -

    Expert: IndexWriter allows an optional - {@link IndexDeletionPolicy} implementation to be - specified. You can use this to control when prior commits - are deleted from the index. The default policy is {@link - KeepOnlyLastCommitDeletionPolicy} which removes all prior - commits as soon as a new commit is done (this matches - behavior before 2.2). Creating your own policy can allow - you to explicitly keep previous "point in time" commits - alive in the index for some time, to allow readers to - refresh to the new commit without having the old commit - deleted out from under them. This is necessary on - filesystems like NFS that do not support "delete on last - close" semantics, which Lucene's "point in time" search - normally relies on.

    -

    Expert: - IndexWriter allows you to separately change - the {@link MergePolicy} and the {@link MergeScheduler}. - The {@link MergePolicy} is invoked whenever there are - changes to the segments in the index. Its role is to - select which merges to do, if any, and return a {@link - MergePolicy.MergeSpecification} describing the merges. It - also selects merges to do for optimize(). (The default is - {@link LogByteSizeMergePolicy}. Then, the {@link - MergeScheduler} is invoked with the requested merges and - it decides when and how to run the merges. The default is - {@link ConcurrentMergeScheduler}.

    -

    NOTE: if you hit an - OutOfMemoryError then IndexWriter will quietly record this - fact and block all future segment commits. This is a - defensive measure in case any internal state (buffered - documents and deletions) were corrupted. Any subsequent - calls to {@link #Commit()} will throw an - IllegalStateException. The only course of action is to - call {@link #Close()}, which internally will call {@link - #Rollback()}, to undo any changes to the index since the - last commit. If you opened the writer with autoCommit - false you can also just call {@link #Rollback()} - directly.

    -

    NOTE: {@link - IndexWriter} instances are completely thread - safe, meaning multiple threads can call any of its - methods, concurrently. If your application requires - external synchronization, you should not - synchronize on the IndexWriter instance as - this may cause deadlock; use your own (non-Lucene) objects - instead.

    -

    -
    - - Name of the write lock in the index. - - - Value to denote a flush trigger is disabled - - - Default value is 16 MB (which means flush when buffered - docs consume 16 MB RAM). Change using {@link #setRAMBufferSizeMB}. - - - - Default value is 10,000. Change using {@link #SetMaxFieldLength(int)}. - - - Default value is 128. Change using {@link #SetTermIndexInterval(int)}. - - - Default value for the write lock timeout (1,000). - - - - - - - - - - - Disabled by default (because IndexWriter flushes by RAM usage - by default). Change using {@link #SetMaxBufferedDocs(int)}. - - - - Disabled by default (because IndexWriter flushes by RAM usage - by default). Change using {@link #SetMaxBufferedDeleteTerms(int)}. - - - - - - - - - - Absolute hard maximum length for a term. If a term - arrives from the analyzer longer than this length, it - is skipped and a message is printed to infoStream, if - set (see {@link #setInfoStream}). - - - - Default for {@link #getMaxSyncPauseSeconds}. On - Windows this defaults to 10.0 seconds; elsewhere it's - 0. - - - - Expert: returns a readonly reader, covering all committed as well as - un-committed changes to the index. This provides "near real-time" - searching, in that changes made during an IndexWriter session can be - quickly made available for searching without closing the writer nor - calling {@link #commit}. - -

    - Note that this is functionally equivalent to calling {#commit} and then - using {@link IndexReader#open} to open a new reader. But the turarnound - time of this method should be faster since it avoids the potentially - costly {@link #commit}. -

    - - You must close the {@link IndexReader} returned by this method once you are done using it. - -

    - It's near real-time because there is no hard - guarantee on how quickly you can get a new reader after - making changes with IndexWriter. You'll have to - experiment in your situation to determine if it's - faster enough. As this is a new and experimental - feature, please report back on your findings so we can - learn, improve and iterate.

    - -

    The resulting reader suppports {@link - IndexReader#reopen}, but that call will simply forward - back to this method (though this may change in the - future).

    - -

    The very first time this method is called, this - writer instance will make every effort to pool the - readers that it opens for doing merges, applying - deletes, etc. This means additional resources (RAM, - file descriptors, CPU time) will be consumed.

    - -

    For lower latency on reopening a reader, you should call {@link #setMergedSegmentWarmer} - to call {@link #setMergedSegmentWarmer} to - pre-warm a newly merged segment before it's committed - to the index. This is important for minimizing index-to-search - delay after a large merge. - -

    If an addIndexes* call is running in another thread, - then this reader will only search those segments from - the foreign index that have been successfully copied - over, so far

    . - -

    NOTE: Once the writer is closed, any - outstanding readers may continue to be used. However, - if you attempt to reopen any of those readers, you'll - hit an {@link AlreadyClosedException}.

    - -

    NOTE: This API is experimental and might - change in incompatible ways in the next release.

    - -

    - IndexReader that covers entire index plus all - changes made so far by this IndexWriter instance - - - IOException -
    - - Expert: like {@link #getReader}, except you can - specify which termInfosIndexDivisor should be used for - any newly opened readers. - - Subsambles which indexed - terms are loaded into RAM. This has the same effect as {@link - IndexWriter#setTermIndexInterval} except that setting - must be done at indexing time while this setting can be - set per reader. When set to N, then one in every - N*termIndexInterval terms in the index is loaded into - memory. By setting this to a value > 1 you can reduce - memory usage, at the expense of higher latency when - loading a TermInfo. The default value is 1. Set this - to -1 to skip loading the terms index entirely. - - - - Obtain the number of deleted docs for a pooled reader. - If the reader isn't being pooled, the segmentInfo's - delCount is returned. - - - - Used internally to throw an {@link - AlreadyClosedException} if this IndexWriter has been - closed. - - AlreadyClosedException if this IndexWriter is - - - Prints a message to the infoStream (if non-null), - prefixed with the identifying information for this - writer and the thread that's calling it. - - - - Casts current mergePolicy to LogMergePolicy, and throws - an exception if the mergePolicy is not a LogMergePolicy. - - - -

    Get the current setting of whether newly flushed - segments will use the compound file format. Note that - this just returns the value previously set with - setUseCompoundFile(boolean), or the default value - (true). You cannot use this to query the status of - previously flushed segments.

    - -

    Note that this method is a convenience method: it - just calls mergePolicy.getUseCompoundFile as long as - mergePolicy is an instance of {@link LogMergePolicy}. - Otherwise an IllegalArgumentException is thrown.

    - -

    - - -
    - -

    Setting to turn on usage of a compound file. When on, - multiple files for each segment are merged into a - single file when a new segment is flushed.

    - -

    Note that this method is a convenience method: it - just calls mergePolicy.setUseCompoundFile as long as - mergePolicy is an instance of {@link LogMergePolicy}. - Otherwise an IllegalArgumentException is thrown.

    -

    -
    - - Expert: Set the Similarity implementation used by this IndexWriter. - - - - - - - Expert: Return the Similarity implementation used by this IndexWriter. - -

    This defaults to the current value of {@link Similarity#GetDefault()}. -

    -
    - - Expert: Set the interval between indexed terms. Large values cause less - memory to be used by IndexReader, but slow random-access to terms. Small - values cause more memory to be used by an IndexReader, and speed - random-access to terms. - - This parameter determines the amount of computation required per query - term, regardless of the number of documents that contain that term. In - particular, it is the maximum number of other terms that must be - scanned before a term is located and its frequency and position information - may be processed. In a large index with user-entered query terms, query - processing time is likely to be dominated not by term lookup but rather - by the processing of frequency and positional data. In a small index - or when many uncommon query terms are generated (e.g., by wildcard - queries) term lookup may become a dominant cost. - - In particular, numUniqueTerms/interval terms are read into - memory by an IndexReader, and, on average, interval/2 terms - must be scanned for each random term access. - - - - - - - Expert: Return the interval between indexed terms. - - - - - - - Constructs an IndexWriter for the index in path. - Text will be analyzed with a. If create - is true, then a new, empty index will be created in - path, replacing the index already there, - if any. - -

    NOTE: autoCommit (see above) is set to false with this - constructor. - -

    - the path to the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - Maximum field length in number of tokens/terms: LIMITED, UNLIMITED, or user-specified - via the MaxFieldLength constructor. - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - - Use {@link #IndexWriter(Directory, Analyzer, - boolean, MaxFieldLength)} - -
    - - Constructs an IndexWriter for the index in path. - Text will be analyzed with a. If create - is true, then a new, empty index will be created in - path, replacing the index already there, if any. - - - the path to the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use {@link - #IndexWriter(Directory,Analyzer,boolean,MaxFieldLength)} - instead, and call {@link #Commit()} when needed. - - - - Constructs an IndexWriter for the index in path. - Text will be analyzed with a. If create - is true, then a new, empty index will be created in - path, replacing the index already there, if any. - -

    NOTE: autoCommit (see above) is set to false with this - constructor. - -

    - the path to the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified - via the MaxFieldLength constructor. - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - - Use {@link #IndexWriter(Directory, - Analyzer, boolean, MaxFieldLength)} - -
    - - Constructs an IndexWriter for the index in path. - Text will be analyzed with a. If create - is true, then a new, empty index will be created in - path, replacing the index already there, if any. - - - the path to the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use {@link - #IndexWriter(Directory,Analyzer,boolean,MaxFieldLength)} - instead, and call {@link #Commit()} when needed. - - - - Constructs an IndexWriter for the index in d. - Text will be analyzed with a. If create - is true, then a new, empty index will be created in - d, replacing the index already there, if any. - -

    NOTE: autoCommit (see above) is set to false with this - constructor. - -

    - the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified - via the MaxFieldLength constructor. - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - -
    - - Constructs an IndexWriter for the index in d. - Text will be analyzed with a. If create - is true, then a new, empty index will be created in - d, replacing the index already there, if any. - - - the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 - release, and call {@link #Commit()} when needed. - Use {@link #IndexWriter(Directory,Analyzer,boolean,MaxFieldLength)} instead. - - - - Constructs an IndexWriter for the index in - path, first creating it if it does not - already exist. Text will be analyzed with - a. - -

    NOTE: autoCommit (see above) is set to false with this - constructor. - -

    - the path to the index directory - - the analyzer to use - - Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified - via the MaxFieldLength constructor. - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - - Use {@link #IndexWriter(Directory, Analyzer, MaxFieldLength)} - -
    - - Constructs an IndexWriter for the index in - path, first creating it if it does not - already exist. Text will be analyzed with - a. - - - the path to the index directory - - the analyzer to use - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 - release, and call {@link #Commit()} when needed. - Use {@link #IndexWriter(Directory,Analyzer,MaxFieldLength)} instead. - - - - Constructs an IndexWriter for the index in - path, first creating it if it does not - already exist. Text will be analyzed with - a. - -

    NOTE: autoCommit (see above) is set to false with this - constructor. - -

    - the path to the index directory - - the analyzer to use - - Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified - via the MaxFieldLength constructor. - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - - Use {@link #IndexWriter(Directory, - Analyzer, MaxFieldLength)} - -
    - - Constructs an IndexWriter for the index in - path, first creating it if it does not - already exist. Text will be analyzed with - a. - - - the path to the index directory - - the analyzer to use - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use {@link #IndexWriter(Directory,Analyzer,MaxFieldLength)} - instead, and call {@link #Commit()} when needed. - - - - Constructs an IndexWriter for the index in - d, first creating it if it does not - already exist. Text will be analyzed with - a. - -

    NOTE: autoCommit (see above) is set to false with this - constructor. - -

    - the index directory - - the analyzer to use - - Maximum field length in number of terms/tokens: LIMITED, UNLIMITED, or user-specified - via the MaxFieldLength constructor. - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - -
    - - Constructs an IndexWriter for the index in - d, first creating it if it does not - already exist. Text will be analyzed with - a. - - - the index directory - - the analyzer to use - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use {@link - #IndexWriter(Directory,Analyzer,MaxFieldLength)} - instead, and call {@link #Commit()} when needed. - - - - Constructs an IndexWriter for the index in - d, first creating it if it does not - already exist. Text will be analyzed with - a. - - - the index directory - - see above - - the analyzer to use - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use {@link - #IndexWriter(Directory,Analyzer,MaxFieldLength)} - instead, and call {@link #Commit()} when needed. - - - - Constructs an IndexWriter for the index in d. - Text will be analyzed with a. If create - is true, then a new, empty index will be created in - d, replacing the index already there, if any. - - - the index directory - - see above - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use {@link - #IndexWriter(Directory,Analyzer,boolean,MaxFieldLength)} - instead, and call {@link #Commit()} when needed. - - - - Expert: constructs an IndexWriter with a custom {@link - IndexDeletionPolicy}, for the index in d, - first creating it if it does not already exist. Text - will be analyzed with a. - -

    NOTE: autoCommit (see above) is set to false with this - constructor. - -

    - the index directory - - the analyzer to use - - see above - - whether or not to limit field lengths - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - -
    - - Expert: constructs an IndexWriter with a custom {@link - IndexDeletionPolicy}, for the index in d, - first creating it if it does not already exist. Text - will be analyzed with a. - - - the index directory - - see above - - the analyzer to use - - see above - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be - read/written to or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use {@link - #IndexWriter(Directory,Analyzer,IndexDeletionPolicy,MaxFieldLength)} - instead, and call {@link #Commit()} when needed. - - - - Expert: constructs an IndexWriter with a custom {@link - IndexDeletionPolicy}, for the index in d. - Text will be analyzed with a. If - create is true, then a new, empty index - will be created in d, replacing the index - already there, if any. - -

    NOTE: autoCommit (see above) is set to false with this - constructor. - -

    - the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - see above - - {@link Lucene.Net.Index.IndexWriter.MaxFieldLength}, whether or not to limit field lengths. Value is in number of terms/tokens - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - -
    - - Expert: constructs an IndexWriter with a custom {@link - IndexDeletionPolicy} and {@link IndexingChain}, - for the index in d. - Text will be analyzed with a. If - create is true, then a new, empty index - will be created in d, replacing the index - already there, if any. - -

    NOTE: autoCommit (see above) is set to false with this - constructor. - -

    - the index directory - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - see above - - whether or not to limit field lengths, value is in number of terms/tokens. See {@link Lucene.Net.Index.IndexWriter.MaxFieldLength}. - - the {@link DocConsumer} chain to be used to - process documents - - which commit to open - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - -
    - - Expert: constructs an IndexWriter with a custom {@link - IndexDeletionPolicy}, for the index in d. - Text will be analyzed with a. If - create is true, then a new, empty index - will be created in d, replacing the index - already there, if any. - - - the index directory - - see above - - the analyzer to use - - true to create the index or overwrite - the existing one; false to append to the existing - index - - see above - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - - This constructor will be removed in the 3.0 release. - Use {@link - #IndexWriter(Directory,Analyzer,boolean,IndexDeletionPolicy,MaxFieldLength)} - instead, and call {@link #Commit()} when needed. - - - - Expert: constructs an IndexWriter on specific commit - point, with a custom {@link IndexDeletionPolicy}, for - the index in d. Text will be analyzed - with a. - -

    This is only meaningful if you've used a {@link - IndexDeletionPolicy} in that past that keeps more than - just the last commit. - -

    This operation is similar to {@link #Rollback()}, - except that method can only rollback what's been done - with the current instance of IndexWriter since its last - commit, whereas this method can rollback to an - arbitrary commit point from the past, assuming the - {@link IndexDeletionPolicy} has preserved past - commits. - -

    NOTE: autoCommit (see above) is set to false with this - constructor. - -

    - the index directory - - the analyzer to use - - see above - - whether or not to limit field lengths, value is in number of terms/tokens. See {@link Lucene.Net.Index.IndexWriter.MaxFieldLength}. - - which commit to open - - CorruptIndexException if the index is corrupt - LockObtainFailedException if another writer - has this index open (write.lock could not - be obtained) - - IOException if the directory cannot be read/written to, or - if it does not exist and create is - false or if there is any other low-level - IO error - -
    - - Expert: set the merge policy used by this writer. - - - Expert: returns the current MergePolicy in use by this writer. - - - - - Expert: set the merge scheduler used by this writer. - - - Expert: returns the current MergePolicy in use by this - writer. - - - - - -

    Determines the largest segment (measured by - document count) that may be merged with other segments. - Small values (e.g., less than 10,000) are best for - interactive indexing, as this limits the length of - pauses while indexing to a few seconds. Larger values - are best for batched indexing and speedier - searches.

    - -

    The default value is {@link Integer#MAX_VALUE}.

    - -

    Note that this method is a convenience method: it - just calls mergePolicy.setMaxMergeDocs as long as - mergePolicy is an instance of {@link LogMergePolicy}. - Otherwise an IllegalArgumentException is thrown.

    - -

    The default merge policy ({@link - LogByteSizeMergePolicy}) also allows you to set this - limit by net size (in MB) of the segment, using {@link - LogByteSizeMergePolicy#setMaxMergeMB}.

    -

    -
    - -

    Returns the largest segment (measured by document - count) that may be merged with other segments.

    - -

    Note that this method is a convenience method: it - just calls mergePolicy.getMaxMergeDocs as long as - mergePolicy is an instance of {@link LogMergePolicy}. - Otherwise an IllegalArgumentException is thrown.

    - -

    - - -
    - - The maximum number of terms that will be indexed for a single field in a - document. This limits the amount of memory required for indexing, so that - collections with very large files will not crash the indexing process by - running out of memory. This setting refers to the number of running terms, - not to the number of different terms.

    - Note: this silently truncates large documents, excluding from the - index all terms that occur further in the document. If you know your source - documents are large, be sure to set this value high enough to accomodate - the expected size. If you set it to Integer.MAX_VALUE, then the only limit - is your memory, but you should anticipate an OutOfMemoryError.

    - By default, no more than {@link #DEFAULT_MAX_FIELD_LENGTH} terms - will be indexed for a field. -

    -
    - - Returns the maximum number of terms that will be - indexed for a single field in a document. - - - - - - Sets the termsIndexDivisor passed to any readers that - IndexWriter opens, for example when applying deletes - or creating a near-real-time reader in {@link - IndexWriter#getReader}. Default value is {@link - IndexReader#DEFAULT_TERMS_INDEX_DIVISOR}. - - - @see #setReaderTermsIndexDivisor - - - Determines the minimal number of documents required - before the buffered in-memory documents are flushed as - a new Segment. Large values generally gives faster - indexing. - -

    When this is set, the writer will flush every - maxBufferedDocs added documents. Pass in {@link - #DISABLE_AUTO_FLUSH} to prevent triggering a flush due - to number of buffered documents. Note that if flushing - by RAM usage is also enabled, then the flush will be - triggered by whichever comes first.

    - -

    Disabled by default (writer flushes by RAM usage).

    - -

    - IllegalArgumentException if maxBufferedDocs is - enabled but smaller than 2, or it disables maxBufferedDocs - when ramBufferSize is already disabled - - - -
    - - If we are flushing by doc count (not by RAM usage), and - using LogDocMergePolicy then push maxBufferedDocs down - as its minMergeDocs, to keep backwards compatibility. - - - - Returns the number of buffered added documents that will - trigger a flush if enabled. - - - - - - Determines the amount of RAM that may be used for - buffering added documents and deletions before they are - flushed to the Directory. Generally for faster - indexing performance it's best to flush by RAM usage - instead of document count and use as large a RAM buffer - as you can. - -

    When this is set, the writer will flush whenever - buffered documents and deletions use this much RAM. - Pass in {@link #DISABLE_AUTO_FLUSH} to prevent - triggering a flush due to RAM usage. Note that if - flushing by document count is also enabled, then the - flush will be triggered by whichever comes first.

    - -

    NOTE: the account of RAM usage for pending - deletions is only approximate. Specifically, if you - delete by Query, Lucene currently has no way to measure - the RAM usage if individual Queries so the accounting - will under-estimate and you should compensate by either - calling commit() periodically yourself, or by using - {@link #setMaxBufferedDeleteTerms} to flush by count - instead of RAM usage (each buffered delete Query counts - as one). - -

    - NOTE: because IndexWriter uses ints when managing its - internal storage, the absolute maximum value for this setting is somewhat - less than 2048 MB. The precise limit depends on various factors, such as - how large your documents are, how many fields have norms, etc., so it's - best to set this value comfortably under 2048. -

    - -

    The default value is {@link #DEFAULT_RAM_BUFFER_SIZE_MB}.

    - -

    - IllegalArgumentException if ramBufferSize is - enabled but non-positive, or it disables ramBufferSize - when maxBufferedDocs is already disabled - -
    - - Returns the value set by {@link #setRAMBufferSizeMB} if enabled. - - -

    Determines the minimal number of delete terms required before the buffered - in-memory delete terms are applied and flushed. If there are documents - buffered in memory at the time, they are merged and a new segment is - created.

    -

    Disabled by default (writer flushes by RAM usage).

    - -

    - IllegalArgumentException if maxBufferedDeleteTerms - is enabled but smaller than 1 - - - -
    - - Returns the number of buffered deleted terms that will - trigger a flush if enabled. - - - - - - Determines how often segment indices are merged by addDocument(). With - smaller values, less RAM is used while indexing, and searches on - unoptimized indices are faster, but indexing speed is slower. With larger - values, more RAM is used during indexing, and while searches on unoptimized - indices are slower, indexing is faster. Thus larger values (> 10) are best - for batch index creation, and smaller values (< 10) for indices that are - interactively maintained. - -

    Note that this method is a convenience method: it - just calls mergePolicy.setMergeFactor as long as - mergePolicy is an instance of {@link LogMergePolicy}. - Otherwise an IllegalArgumentException is thrown.

    - -

    This must never be less than 2. The default value is 10. -

    -
    - -

    Returns the number of segments that are merged at - once and also controls the total number of segments - allowed to accumulate in the index.

    - -

    Note that this method is a convenience method: it - just calls mergePolicy.getMergeFactor as long as - mergePolicy is an instance of {@link LogMergePolicy}. - Otherwise an IllegalArgumentException is thrown.

    - -

    - - -
    - - Expert: returns max delay inserted before syncing a - commit point. On Windows, at least, pausing before - syncing can increase net indexing throughput. The - delay is variable based on size of the segment's files, - and is only inserted when using - ConcurrentMergeScheduler for merges. - - This will be removed in 3.0, when - autoCommit=true is removed from IndexWriter. - - - - Expert: sets the max delay before syncing a commit - point. - - - - This will be removed in 3.0, when - autoCommit=true is removed from IndexWriter. - - - - If non-null, this will be the default infoStream used - by a newly instantiated IndexWriter. - - - - - - Returns the current default infoStream for newly - instantiated IndexWriters. - - - - - - If non-null, information about merges, deletes and a - message when maxFieldLength is reached will be printed - to this. - - - - Returns the current infoStream in use by this writer. - - - - - Returns true if verbosing is enabled (i.e., infoStream != null). - - - to change the default value for all instances of IndexWriter. - - - - Returns allowed timeout when acquiring the write lock. - - - - - Sets the default (for any instance of IndexWriter) maximum time to wait for a write lock (in - milliseconds). - - - - Returns default write lock timeout for newly - instantiated IndexWriters. - - - - - - Commits all changes to an index and closes all - associated files. Note that this may be a costly - operation, so, try to re-use a single writer instead of - closing and opening a new one. See {@link #Commit()} for - caveats about write caching done by some IO devices. - -

    If an Exception is hit during close, eg due to disk - full or some other reason, then both the on-disk index - and the internal state of the IndexWriter instance will - be consistent. However, the close will not be complete - even though part of it (flushing buffered documents) - may have succeeded, so the write lock will still be - held.

    - -

    If you can correct the underlying cause (eg free up - some disk space) then you can call close() again. - Failing that, if you want to force the write lock to be - released (dangerous, because you may then lose buffered - docs in the IndexWriter instance) then you can do - something like this:

    - -

    -            try {
    -            writer.close();
    -            } finally {
    -            if (IndexWriter.isLocked(directory)) {
    -            IndexWriter.unlock(directory);
    -            }
    -            }
    -            
    - - after which, you must be certain not to use the writer - instance anymore.

    - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer, again. See above for details.

    - -

    - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - - .NET - - - - Closes the index with or without waiting for currently - running merges to finish. This is only meaningful when - using a MergeScheduler that runs merges in background - threads. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer, again. See above for details.

    - -

    NOTE: it is dangerous to always call - close(false), especially when IndexWriter is not open - for very long, because this can result in "merge - starvation" whereby long merges will never have a - chance to finish. This will cause too many segments in - your index over time.

    - -

    - if true, this call will block - until all merges complete; else, it will ask all - running merges to abort, wait until those merges have - finished (which should be at most a few seconds), and - then return. - -
    - - Tells the docWriter to close its currently open shared - doc stores (stored fields & vectors files). - Return value specifices whether new doc store files are compound or not. - - - - Returns the Directory used by this index. - - - Returns the analyzer used by this index. - - - Returns the number of documents currently in this - index, not counting deletions. - - Please use {@link #MaxDoc()} (same as this - method) or {@link #NumDocs()} (also takes deletions - into account), instead. - - - - Returns total number of docs in this index, including - docs not yet flushed (still in the RAM buffer), - not counting deletions. - - - - - - Returns total number of docs in this index, including - docs not yet flushed (still in the RAM buffer), and - including deletions. NOTE: buffered deletions - are not counted. If you really need these to be - counted you should call {@link #Commit()} first. - - - - - - The maximum number of terms that will be indexed for a single field in a - document. This limits the amount of memory required for indexing, so that - collections with very large files will not crash the indexing process by - running out of memory.

    - Note that this effectively truncates large documents, excluding from the - index terms that occur further in the document. If you know your source - documents are large, be sure to set this value high enough to accomodate - the expected size. If you set it to Integer.MAX_VALUE, then the only limit - is your memory, but you should anticipate an OutOfMemoryError.

    - By default, no more than 10,000 terms will be indexed for a field. - -

    - - -
    - - Adds a document to this index. If the document contains more than - {@link #SetMaxFieldLength(int)} terms for a given field, the remainder are - discarded. - -

    Note that if an Exception is hit (for example disk full) - then the index will be consistent, but this document - may not have been added. Furthermore, it's possible - the index will have one segment in non-compound format - even when using compound files (when a merge has - partially succeeded).

    - -

    This method periodically flushes pending documents - to the Directory (see above), and - also periodically triggers segment merges in the index - according to the {@link MergePolicy} in use.

    - -

    Merges temporarily consume space in the - directory. The amount of space required is up to 1X the - size of all segments being merged, when no - readers/searchers are open against the index, and up to - 2X the size of all segments being merged when - readers/searchers are open against the index (see - {@link #Optimize()} for details). The sequence of - primitive merge operations performed is governed by the - merge policy. - -

    Note that each term in the document can be no longer - than 16383 characters, otherwise an - IllegalArgumentException will be thrown.

    - -

    Note that it's possible to create an invalid Unicode - string in java if a UTF16 surrogate pair is malformed. - In this case, the invalid characters are silently - replaced with the Unicode replacement character - U+FFFD.

    - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Adds a document to this index, using the provided analyzer instead of the - value of {@link #GetAnalyzer()}. If the document contains more than - {@link #SetMaxFieldLength(int)} terms for a given field, the remainder are - discarded. - -

    See {@link #AddDocument(Document)} for details on - index and IndexWriter state after an Exception, and - flushing/merging temporary free space requirements.

    - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Deletes the document(s) containing term. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - the term to identify the documents to be deleted - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Deletes the document(s) containing any of the - terms. All deletes are flushed at the same time. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - array of terms to identify the documents - to be deleted - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Deletes the document(s) matching the provided query. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - the query to identify the documents to be deleted - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Deletes the document(s) matching any of the provided queries. - All deletes are flushed at the same time. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - array of queries to identify the documents - to be deleted - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Updates a document by first deleting the document(s) - containing term and then adding the new - document. The delete and then add are atomic as seen - by a reader on the same index (flush may happen only after - the add). - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - the term to identify the document(s) to be - deleted - - the document to be added - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Updates a document by first deleting the document(s) - containing term and then adding the new - document. The delete and then add are atomic as seen - by a reader on the same index (flush may happen only after - the add). - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - the term to identify the document(s) to be - deleted - - the document to be added - - the analyzer to use when analyzing the document - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - If non-null, information about merges will be printed to this. - - - Requests an "optimize" operation on an index, priming the index - for the fastest available search. Traditionally this has meant - merging all segments into a single segment as is done in the - default merge policy, but individaul merge policies may implement - optimize in different ways. - -

    It is recommended that this method be called upon completion of indexing. In - environments with frequent updates, optimize is best done during low volume times, if at all. - -

    -

    See http://www.gossamer-threads.com/lists/lucene/java-dev/47895 for more discussion.

    - -

    Note that optimize requires 2X the index size free - space in your Directory (3X if you're using compound - file format). For example, if your index - size is 10 MB then you need 20 MB free for optimize to - complete (30 MB if you're using compound fiel format).

    - -

    If some but not all readers re-open while an - optimize is underway, this will cause > 2X temporary - space to be consumed as those new readers will then - hold open the partially optimized segments at that - time. It is best not to re-open readers while optimize - is running.

    - -

    The actual temporary usage could be much less than - these figures (it depends on many factors).

    - -

    In general, once the optimize completes, the total size of the - index will be less than the size of the starting index. - It could be quite a bit smaller (if there were many - pending deletes) or just slightly smaller.

    - -

    If an Exception is hit during optimize(), for example - due to disk full, the index will not be corrupt and no - documents will have been lost. However, it may have - been partially optimized (some segments were merged but - not all), and it's possible that one of the segments in - the index will be in non-compound format even when - using compound file format. This will occur when the - Exception is hit during conversion of the segment into - compound format.

    - -

    This call will optimize those segments present in - the index when the call started. If other threads are - still adding documents and flushing segments, those - newly created segments will not be optimized unless you - call optimize again.

    - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - -
    - - Optimize the index down to <= maxNumSegments. If - maxNumSegments==1 then this is the same as {@link - #Optimize()}. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - maximum number of segments left - in the index after optimization finishes - -
    - - Just like {@link #Optimize()}, except you can specify - whether the call should block until the optimize - completes. This is only meaningful with a - {@link MergeScheduler} that is able to run merges in - background threads. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    -

    -
    - - Just like {@link #Optimize(int)}, except you can - specify whether the call should block until the - optimize completes. This is only meaningful with a - {@link MergeScheduler} that is able to run merges in - background threads. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    -

    -
    - - Returns true if any merges in pendingMerges or - runningMerges are optimization merges. - - - - Just like {@link #ExpungeDeletes()}, except you can - specify whether the call should block until the - operation completes. This is only meaningful with a - {@link MergeScheduler} that is able to run merges in - background threads. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    -

    -
    - - Expunges all deletes from the index. When an index - has many document deletions (or updates to existing - documents), it's best to either call optimize or - expungeDeletes to remove all unused data in the index - associated with the deleted documents. To see how - many deletions you have pending in your index, call - {@link IndexReader#numDeletedDocs} - This saves disk space and memory usage while - searching. expungeDeletes should be somewhat faster - than optimize since it does not insist on reducing the - index to a single segment (though, this depends on the - {@link MergePolicy}; see {@link - MergePolicy#findMergesToExpungeDeletes}.). Note that - this call does not first commit any buffered - documents, so you must do so yourself if necessary. - See also {@link #ExpungeDeletes(boolean)} - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    -

    -
    - - Expert: asks the mergePolicy whether any merges are - necessary now and if so, runs the requested merges and - then iterate (test again if merges are needed) until no - more merges are returned by the mergePolicy. - - Explicit calls to maybeMerge() are usually not - necessary. The most common case is when merge policy - parameters have changed. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    -

    -
    - - Expert: the {@link MergeScheduler} calls this method - to retrieve the next merge requested by the - MergePolicy - - - - Like getNextMerge() except only returns a merge if it's - external. - - - - Please use {@link #rollback} instead. - - - - Close the IndexWriter without committing - any changes that have occurred since the last commit - (or since it was opened, if commit hasn't been called). - This removes any temporary files that had been created, - after which the state of the index will be the same as - it was when commit() was last called or when this - writer was first opened. This can only be called when - this IndexWriter was opened with - autoCommit=false. This also clears a - previous call to {@link #prepareCommit}. - - IllegalStateException if this is called when - the writer was opened with autoCommit=true. - - IOException if there is a low-level IO error - - - Delete all documents in the index. - -

    This method will drop all buffered documents and will - remove all segments from the index. This change will not be - visible until a {@link #Commit()} has been called. This method - can be rolled back using {@link #Rollback()}.

    - -

    NOTE: this method is much faster than using deleteDocuments( new MatchAllDocsQuery() ).

    - -

    NOTE: this method will forcefully abort all merges - in progress. If other threads are running {@link - #Optimize()} or any of the addIndexes methods, they - will receive {@link MergePolicy.MergeAbortedException}s. -

    -
    - - Wait for any currently outstanding merges to finish. - -

    It is guaranteed that any merges started prior to calling this method - will have completed once this method completes.

    -

    -
    - - Merges all segments from an array of indexes into this index. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - Use {@link #addIndexesNoOptimize} instead, - then separately call {@link #optimize} afterwards if - you need to. - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Merges all segments from an array of indexes into this - index. - -

    This may be used to parallelize batch indexing. A large document - collection can be broken into sub-collections. Each sub-collection can be - indexed in parallel, on a different thread, process or machine. The - complete index can then be created by merging sub-collection indexes - with this method. - -

    NOTE: the index in each Directory must not be - changed (opened by a writer) while this method is - running. This method does not acquire a write lock in - each input Directory, so it is up to the caller to - enforce this. - -

    NOTE: while this is running, any attempts to - add or delete documents (with another thread) will be - paused until this method completes. - -

    This method is transactional in how Exceptions are - handled: it does not commit a new segments_N file until - all indexes are added. This means if an Exception - occurs (for example disk full), then either no indexes - will have been added or they all will have been.

    - -

    Note that this requires temporary free space in the - Directory up to 2X the sum of all input indexes - (including the starting index). If readers/searchers - are open against the starting index, then temporary - free space required will be higher by the size of the - starting index (see {@link #Optimize()} for details). -

    - -

    Once this completes, the final size of the index - will be less than the sum of all input index sizes - (including the starting index). It could be quite a - bit smaller (if there were many pending deletes) or - just slightly smaller.

    - -

    - This requires this index not be among those to be added. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Merges the provided indexes into this index. -

    After this completes, the index is optimized.

    -

    The provided IndexReaders are not closed.

    - -

    NOTE: while this is running, any attempts to - add or delete documents (with another thread) will be - paused until this method completes. - -

    See {@link #AddIndexesNoOptimize(Directory[])} for - details on transactional semantics, temporary free - space required in the Directory, and non-CFS segments - on an Exception.

    - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - - A hook for extending classes to execute operations after pending added and - deleted documents have been flushed to the Directory but before the change - is committed (new segments_N file written). - - - - Flush all in-memory buffered updates (adds and deletes) - to the Directory. -

    Note: while this will force buffered docs to be - pushed into the index, it will not make these docs - visible to a reader. Use {@link #Commit()} instead - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - please call {@link #Commit()}) instead - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - - A hook for extending classes to execute operations before pending added and - deleted documents are flushed to the Directory. - - - - Expert: prepare for commit. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - - -
    - -

    Expert: prepare for commit, specifying - commitUserData Map (String -> String). This does the - first phase of 2-phase commit. You can only call this - when autoCommit is false. This method does all steps - necessary to commit changes since this writer was - opened: flushes pending added and deleted docs, syncs - the index files, writes most of next segments_N file. - After calling this you must call either {@link - #Commit()} to finish the commit, or {@link - #Rollback()} to revert the commit and undo all changes - done since the writer was opened.

    - - You can also just call {@link #Commit(Map)} directly - without prepareCommit first in which case that method - will internally call prepareCommit. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - Opaque Map (String->String) - that's recorded into the segments file in the index, - and retrievable by {@link - IndexReader#getCommitUserData}. Note that when - IndexWriter commits itself, for example if open with - autoCommit=true, or, during {@link #close}, the - commitUserData is unchanged (just carried over from - the prior commit). If this is null then the previous - commitUserData is kept. Also, the commitUserData will - only "stick" if there are actually changes in the - index to commit. Therefore it's best to use this - feature only when autoCommit is false. - -
    - -

    Commits all pending changes (added & deleted - documents, optimizations, segment merges, added - indexes, etc.) to the index, and syncs all referenced - index files, such that a reader will see the changes - and the index updates will survive an OS or machine - crash or power loss. Note that this does not wait for - any running background merges to finish. This may be a - costly operation, so you should test the cost in your - application and do it only when really necessary.

    - -

    Note that this operation calls Directory.sync on - the index files. That call should not return until the - file contents & metadata are on stable storage. For - FSDirectory, this calls the OS's fsync. But, beware: - some hardware devices may in fact cache writes even - during fsync, and return before the bits are actually - on stable storage, to give the appearance of faster - performance. If you have such a device, and it does - not have a battery backup (for example) then on power - loss it may still lose data. Lucene cannot guarantee - consistency on such devices.

    - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    - -

    - - - - -
    - - Commits all changes to the index, specifying a - commitUserData Map (String -> String). This just - calls {@link #PrepareCommit(Map)} (if you didn't - already call it) and then {@link #finishCommit}. - -

    NOTE: if this method hits an OutOfMemoryError - you should immediately close the writer. See above for details.

    -

    -
    - - Flush all in-memory buffered udpates (adds and deletes) - to the Directory. - - if true, we may merge segments (if - deletes or docs were flushed) if necessary - - if false we are allowed to keep - doc stores open to share with the next segment - - whether pending deletes should also - be flushed - - - - Expert: Return the total size of all index files currently cached in memory. - Useful for size management with flushRamDocs() - - - - Expert: Return the number of documents currently - buffered in RAM. - - - - Carefully merges deletes for the segments we just - merged. This is tricky because, although merging will - clear all deletes (compacts the documents), new - deletes may have been flushed to the segments since - the merge was started. This method "carries over" - such new deletes onto the newly merged segment, and - saves the resulting deletes file (incrementing the - delete generation for merge.info). If no deletes were - flushed, no new deletes file is saved. - - - - Merges the indicated segments, replacing them in the stack with a - single segment. - - - - Hook that's called when the specified merge is complete. - - - Checks whether this merge involves any segments - already participating in a merge. If not, this merge - is "registered", meaning we record that its segments - are now participating in a merge, and true is - returned. Else (the merge conflicts) false is - returned. - - - - Does initial setup for a merge, which is fast but holds - the synchronized lock on IndexWriter instance. - - - - This is called after merging a segment and before - building its CFS. Return true if the files should be - sync'd. If you return false, then the source segment - files that were merged cannot be deleted until the CFS - file is built & sync'd. So, returning false consumes - more transient disk space, but saves performance of - not having to sync files which will shortly be deleted - anyway. - - -- this will be removed in 3.0 when - autoCommit is hardwired to false - - - - Does fininishing for a merge, which is fast but holds - the synchronized lock on IndexWriter instance. - - - - Does the actual (time-consuming) work of the merge, - but without holding synchronized lock on IndexWriter - instance - - - - Blocks until all files in syncing are sync'd - - - Pauses before syncing. On Windows, at least, it's - best (performance-wise) to pause in order to let OS - flush writes to disk on its own, before forcing a - sync. - - -- this will be removed in 3.0 when - autoCommit is hardwired to false - - - - Walk through all files referenced by the current - segmentInfos and ask the Directory to sync each file, - if it wasn't already. If that succeeds, then we - prepare a new segments_N file but do not fully commit - it. - - - - Returns true iff the index in the named directory is - currently locked. - - the directory to check for a lock - - IOException if there is a low-level IO error - - - Returns true iff the index in the named directory is - currently locked. - - the directory to check for a lock - - IOException if there is a low-level IO error - Use {@link #IsLocked(Directory)} - - - - Forcibly unlocks the index in the named directory. -

    - Caution: this should only be used by failure recovery code, - when it is known that no other process nor thread is in fact - currently accessing this index. -

    -
    - - Set the merged segment warmer. See {@link - IndexReaderWarmer}. - - - - Returns the current merged segment warmer. See {@link - IndexReaderWarmer}. - - - - Deprecated: emulates IndexWriter's buggy behavior when - first token(s) have positionIncrement==0 (ie, prior to - fixing LUCENE-1542) - - - - Holds shared SegmentReader instances. IndexWriter uses - SegmentReaders for 1) applying deletes, 2) doing - merges, 3) handing out a real-time reader. This pool - reuses instances of the SegmentReaders in all these - places if it is in "near real-time mode" (getReader() - has been called on this instance). - - - - Forcefully clear changes for the specifed segments, - and remove from the pool. This is called on succesful merge. - - - - Release the segment reader (i.e. decRef it and close if there - are no more references. - - - - IOException - - - Release the segment reader (i.e. decRef it and close if there - are no more references. - - - - IOException - - - Remove all our references to readers, and commits - any pending changes. - - - - Commit all segment reader in the pool. - IOException - - - Returns a ref to a clone. NOTE: this clone is not - enrolled in the pool, so you should simply close() - it when you're done (ie, do not call release()). - - - - Obtain a SegmentReader from the readerPool. The reader - must be returned by calling {@link #Release(SegmentReader)} - - - - - - - - IOException - - - Obtain a SegmentReader from the readerPool. The reader - must be returned by calling {@link #Release(SegmentReader)} - - - - - - - - - - - - - IOException - - - Specifies maximum field length (in number of tokens/terms) in {@link IndexWriter} constructors. - {@link #SetMaxFieldLength(int)} overrides the value set by - the constructor. - - - - Private type-safe-enum-pattern constructor. - - - instance name - - maximum field length - - - - Public constructor to allow users to specify the maximum field size limit. - - - The maximum field length - - - - Sets the maximum field length to {@link Integer#MAX_VALUE}. - - - Sets the maximum field length to - {@link #DEFAULT_MAX_FIELD_LENGTH} - - - - - If {@link #getReader} has been called (ie, this writer - is in near real-time mode), then after a merge - completes, this class can be invoked to warm the - reader on the newly merged segment, before the merge - commits. This is not required for near real-time - search, but will reduce search latency on opening a - new near real-time reader after a merge completes. - -

    NOTE: This API is experimental and might - change in incompatible ways in the next release.

    - -

    NOTE: warm is called before any deletes have - been carried over to the merged segment. -

    -
    - - Adds a new doc in this term. If this returns null - then we just skip consuming positions/payloads. - - - - Called when we are done adding docs to this term - - - This class tracks the number and position / offset parameters of terms - being added to the index. The information collected in this class is - also used to calculate the normalization factor for a field. - -

    WARNING: This API is new and experimental, and may suddenly - change.

    -

    -
    - - Re-initialize the state, using this boost value. - boost value to use. - - - - Get the last processed term position. - the position - - - - Get total number of terms in this field. - the length - - - - Get the number of terms with positionIncrement == 0. - the numOverlap - - - - Get end offset of the last processed term. - the offset - - - - Get boost value. This is the cumulative product of - document boost and field boost for all field instances - sharing the same field name. - - the boost - - - - Provides support for converting dates to strings and vice-versa. - The strings are structured so that lexicographic sorting orders by date, - which makes them suitable for use as field values and search terms. - -

    Note that this class saves dates with millisecond granularity, - which is bad for {@link TermRangeQuery} and {@link PrefixQuery}, as those - queries are expanded to a BooleanQuery with a potentially large number - of terms when searching. Thus you might want to use - {@link DateTools} instead. - -

    - Note: dates before 1970 cannot be used, and therefore cannot be - indexed when using this class. See {@link DateTools} for an - alternative without such a limitation. - -

    - Another approach is {@link NumericUtils}, which provides - a sortable binary representation (prefix encoded) of numeric values, which - date/time are. - For indexing a {@link Date} or {@link Calendar}, just get the unix timestamp as - long using {@link Date#getTime} or {@link Calendar#getTimeInMillis} and - index this as a numeric value with {@link NumericField} - and use {@link NumericRangeQuery} to query it. - -

    - If you build a new index, use {@link DateTools} or - {@link NumericField} instead. - This class is included for use with existing - indices and will be removed in a future release. - -
    - - Converts a Date to a string suitable for indexing. - RuntimeException if the date specified in the - method argument is before 1970 - - - - Converts a millisecond time to a string suitable for indexing. - RuntimeException if the time specified in the - method argument is negative, that is, before 1970 - - - - Converts a string-encoded date into a millisecond time. - - - Converts a string-encoded date into a Date object. - - - Simple utility class providing static methods to - compress and decompress binary data for stored fields. - This class uses java.util.zip.Deflater and Inflater - classes to compress and decompress, which is the same - format previously used by the now deprecated - Field.Store.COMPRESS. - - - - Compresses the specified byte range using the - specified compressionLevel (constants are defined in - java.util.zip.Deflater). - - - - Compresses the specified byte range, with default BEST_COMPRESSION level - - - Compresses all bytes in the array, with default BEST_COMPRESSION level - - - Compresses the String value, with default BEST_COMPRESSION level - - - Compresses the String value using the specified - compressionLevel (constants are defined in - java.util.zip.Deflater). - - - - Decompress the byte array previously returned by - compress - - - - Decompress the byte array previously returned by - compressString back into a String - - - - The start and end character offset of a Token. - - - Returns this Token's starting offset, the position of the first character - corresponding to this token in the source text. - Note that the difference between endOffset() and startOffset() may not be - equal to termText.length(), as the term text may have been altered by a - stemmer or some other filter. - - - - Set the starting and ending offset. - See StartOffset() and EndOffset() - - - - Returns this Token's ending offset, one greater than the position of the - last character corresponding to this token in the source text. The length - of the token in the source text is (endOffset - startOffset). - - - - This is a helper class to generate prefix-encoded representations for numerical values - and supplies converters to represent float/double values as sortable integers/longs. - -

    To quickly execute range queries in Apache Lucene, a range is divided recursively - into multiple intervals for searching: The center of the range is searched only with - the lowest possible precision in the trie, while the boundaries are matched - more exactly. This reduces the number of terms dramatically. - -

    This class generates terms to achive this: First the numerical integer values need to - be converted to strings. For that integer values (32 bit or 64 bit) are made unsigned - and the bits are converted to ASCII chars with each 7 bit. The resulting string is - sortable like the original integer value. Each value is also prefixed - (in the first char) by the shift value (number of bits removed) used - during encoding. - -

    To also index floating point numbers, this class supplies two methods to convert them - to integer values by changing their bit layout: {@link #doubleToSortableLong}, - {@link #floatToSortableInt}. You will have no precision loss by - converting floating point numbers to integers and back (only that the integer form - is not usable). Other data types like dates can easily converted to longs or ints (e.g. - date to long: {@link java.util.Date#getTime}). - -

    For easy usage, the trie algorithm is implemented for indexing inside - {@link NumericTokenStream} that can index int, long, - float, and double. For querying, - {@link NumericRangeQuery} and {@link NumericRangeFilter} implement the query part - for the same data types. - -

    This class can also be used, to generate lexicographically sortable (according - {@link String#compareTo(String)}) representations of numeric data types for other - usages (e.g. sorting). - -

    NOTE: This API is experimental and - might change in incompatible ways in the next release. - -

    - 2.9 - -
    - - The default precision step used by {@link NumericField}, {@link NumericTokenStream}, - {@link NumericRangeQuery}, and {@link NumericRangeFilter} as default - - - - Expert: The maximum term length (used for char[] buffer size) - for encoding long values. - - - - - - Expert: The maximum term length (used for char[] buffer size) - for encoding int values. - - - - - - Expert: Longs are stored at lower precision by shifting off lower bits. The shift count is - stored as SHIFT_START_LONG+shift in the first character - - - - Expert: Integers are stored at lower precision by shifting off lower bits. The shift count is - stored as SHIFT_START_INT+shift in the first character - - - - Expert: Returns prefix coded bits after reducing the precision by shift bits. - This is method is used by {@link NumericTokenStream}. - - the numeric value - - how many bits to strip from the right - - that will contain the encoded chars, must be at least of {@link #BUF_SIZE_LONG} - length - - number of chars written to buffer - - - - Expert: Returns prefix coded bits after reducing the precision by shift bits. - This is method is used by {@link LongRangeBuilder}. - - the numeric value - - how many bits to strip from the right - - - - This is a convenience method, that returns prefix coded bits of a long without - reducing the precision. It can be used to store the full precision value as a - stored field in index. -

    To decode, use {@link #prefixCodedToLong}. -

    -
    - - Expert: Returns prefix coded bits after reducing the precision by shift bits. - This is method is used by {@link NumericTokenStream}. - - the numeric value - - how many bits to strip from the right - - that will contain the encoded chars, must be at least of {@link #BUF_SIZE_INT} - length - - number of chars written to buffer - - - - Expert: Returns prefix coded bits after reducing the precision by shift bits. - This is method is used by {@link IntRangeBuilder}. - - the numeric value - - how many bits to strip from the right - - - - This is a convenience method, that returns prefix coded bits of an int without - reducing the precision. It can be used to store the full precision value as a - stored field in index. -

    To decode, use {@link #prefixCodedToInt}. -

    -
    - - Returns a long from prefixCoded characters. - Rightmost bits will be zero for lower precision codes. - This method can be used to decode e.g. a stored field. - - NumberFormatException if the supplied string is - not correctly prefix encoded. - - - - - - Returns an int from prefixCoded characters. - Rightmost bits will be zero for lower precision codes. - This method can be used to decode e.g. a stored field. - - NumberFormatException if the supplied string is - not correctly prefix encoded. - - - - - - Converts a double value to a sortable signed long. - The value is converted by getting their IEEE 754 floating-point "double format" - bit layout and then some bits are swapped, to be able to compare the result as long. - By this the precision is not reduced, but the value can easily used as a long. - - - - - - Convenience method: this just returns: - longToPrefixCoded(doubleToSortableLong(val)) - - - - Converts a sortable long back to a double. - - - - - Convenience method: this just returns: - sortableLongToDouble(prefixCodedToLong(val)) - - - - Converts a float value to a sortable signed int. - The value is converted by getting their IEEE 754 floating-point "float format" - bit layout and then some bits are swapped, to be able to compare the result as int. - By this the precision is not reduced, but the value can easily used as an int. - - - - - - Convenience method: this just returns: - intToPrefixCoded(floatToSortableInt(val)) - - - - Converts a sortable int back to a float. - - - - - Convenience method: this just returns: - sortableIntToFloat(prefixCodedToInt(val)) - - - - Expert: Splits a long range recursively. - You may implement a builder that adds clauses to a - {@link Lucene.Net.Search.BooleanQuery} for each call to its - {@link LongRangeBuilder#AddRange(String,String)} - method. -

    This method is used by {@link NumericRangeQuery}. -

    -
    - - Expert: Splits an int range recursively. - You may implement a builder that adds clauses to a - {@link Lucene.Net.Search.BooleanQuery} for each call to its - {@link IntRangeBuilder#AddRange(String,String)} - method. -

    This method is used by {@link NumericRangeQuery}. -

    -
    - - This helper does the splitting for both 32 and 64 bit. - - - Helper that delegates to correct range builder - - - Expert: Callback for {@link #splitLongRange}. - You need to overwrite only one of the methods. -

    NOTE: This is a very low-level interface, - the method signatures may change in later versions. -

    -
    - - Overwrite this method, if you like to receive the already prefix encoded range bounds. - You can directly build classical (inclusive) range queries from them. - - - - Overwrite this method, if you like to receive the raw long range bounds. - You can use this for e.g. debugging purposes (print out range bounds). - - - - Expert: Callback for {@link #splitIntRange}. - You need to overwrite only one of the methods. -

    NOTE: This is a very low-level interface, - the method signatures may change in later versions. -

    -
    - - Overwrite this method, if you like to receive the already prefix encoded range bounds. - You can directly build classical range (inclusive) queries from them. - - - - Overwrite this method, if you like to receive the raw int range bounds. - You can use this for e.g. debugging purposes (print out range bounds). - - - - - Not implemented. Waiting for volunteers. - - - - - Not implemented. Waiting for volunteers. - - - - Simple standalone tool that forever acquires & releases a - lock using a specific LockFactory. Run without any args - to see usage. - - - - - - - - - Subclass of FilteredTermEnum for enumerating all terms that match the - specified wildcard filter term. -

    - Term enumerations are always ordered by Term.compareTo(). Each term in - the enumeration is greater than all that precede it. - -

    - $Id: WildcardTermEnum.java 783371 2009-06-10 14:39:56Z mikemccand $ - -
    - - ***************************************** - String equality with support for wildcards - ****************************************** - - - - Creates a new WildcardTermEnum. -

    - After calling the constructor the enumeration is already pointing to the first - valid term if such a term exists. -

    -
    - - Determines if a word matches a wildcard pattern. - Work released by Granta Design Ltd after originally being done on - company time. - - - - Represents hits returned by {@link - * Searcher#search(Query,Filter,int)} and {@link - * Searcher#search(Query,int) - - - - The total number of hits for the query. - - - - - The top hits for the query. - - - Stores the maximum score value encountered, needed for normalizing. - - - Returns the maximum score value encountered. Note that in case - scores are not tracked, this returns {@link Float#NaN}. - - - - Sets the maximum score value encountered. - - - Constructs a TopDocs with a default maxScore=Float.NaN. - - - - - - Matches spans containing a term. - - - Construct a SpanTermQuery matching the named term's spans. - - - Return the term whose spans are matched. - - - Returns a collection of all terms matched by this query. - use extractTerms instead - - - - - - Similar to {@link NearSpansOrdered}, but for the unordered case. - - Expert: - Only public for subclassing. Most implementations should not need this class - - - - WARNING: The List is not necessarily in order of the the positions - Collection of byte[] payloads - - IOException - - - Wraps a Spans, and can be used to form a linked list. - - - Score a candidate doc for all slop-valid position-combinations (matches) - encountered while traversing/hopping the PhrasePositions. -
    The score contribution of a match depends on the distance: -
    - highest score for distance=0 (exact match). -
    - score gets lower as distance gets higher. -
    Example: for query "a b"~2, a document "x a b a y" can be scored twice: - once for "a b" (distance=0), and once for "b a" (distance=2). -
    Possibly not all valid combinations are encountered, because for efficiency - we always propagate the least PhrasePosition. This allows to base on - PriorityQueue and move forward faster. - As result, for example, document "a b c b a" - would score differently for queries "a b c"~4 and "c b a"~4, although - they really are equivalent. - Similarly, for doc "a b c b a f g", query "c b"~2 - would get same score as "g f"~2, although "c b"~2 could be matched twice. - We may want to fix this in the future (currently not, for performance reasons). -
    -
    - - Init PhrasePositions in place. - There is a one time initialization for this scorer: -
    - Put in repeats[] each pp that has another pp with same position in the doc. -
    - Also mark each such pp by pp.repeats = true. -
    Later can consult with repeats[] in termPositionsDiffer(pp), making that check efficient. - In particular, this allows to score queries with no repetitions with no overhead due to this computation. -
    - Example 1 - query with no repetitions: "ho my"~2 -
    - Example 2 - query with repetitions: "ho my my"~2 -
    - Example 3 - query with repetitions: "my ho my"~2 -
    Init per doc w/repeats in query, includes propagating some repeating pp's to avoid false phrase detection. -
    - end (max position), or -1 if any term ran out (i.e. done) - - IOException -
    - - We disallow two pp's to have the same TermPosition, thereby verifying multiple occurrences - in the query of the same word would go elsewhere in the matched doc. - - null if differ (i.e. valid) otherwise return the higher offset PhrasePositions - out of the first two PPs found to not differ. - - - - A query that matches all documents. - - - - - Field used for normalization factor (document boost). Null if nothing. - - - - use {@link #DocID()} instead. - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - Expert: obtains the ordinal of the field value from the default Lucene - {@link Lucene.Net.Search.FieldCache Fieldcache} using getStringIndex(). -

    - The native lucene index order is used to assign an ordinal value for each field value. -

    - Field values (terms) are lexicographically ordered by unicode value, and numbered starting at 1. -

    - Example: -
    If there were only three field values: "apple","banana","pear" -
    then ord("apple")=1, ord("banana")=2, ord("pear")=3 -

    - WARNING: - ord() depends on the position in an index and can thus change - when other documents are inserted or deleted, - or if a MultiSearcher is used. - -

    - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

    NOTE: with the switch in 2.9 to segment-based - searching, if {@link #getValues} is invoked with a - composite (multi-segment) reader, this can easily cause - double RAM usage for the values in the FieldCache. It's - best to switch your application to pass only atomic - (single segment) readers to this API. Alternatively, for - a short-term fix, you could wrap your ValueSource using - {@link MultiValueSource}, which costs more CPU per lookup - but will not consume double the FieldCache RAM.

    -

    -
    - - Constructor for a certain field. - field whose values order is used. - - - - The Scorer for DisjunctionMaxQuery's. The union of all documents generated by the the subquery scorers - is generated in document number order. The score for each document is the maximum of the scores computed - by the subquery scorers that generate that document, plus tieBreakerMultiplier times the sum of the scores - for the other subqueries that generate the document. - - - - Creates a new instance of DisjunctionMaxScorer - - - Multiplier applied to non-maximum-scoring subqueries for a - document as they are summed into the result. - - -- not used since our definition involves neither coord nor terms - directly - - The sub scorers this Scorer should iterate on - - The actual number of scorers to iterate on. Note that the array's - length may be larger than the actual number of scorers. - - - - Generate the next document matching our associated DisjunctionMaxQuery. - - - true iff there is a next document - - use {@link #NextDoc()} instead. - - - - use {@link #DocID()} instead. - - - - Determine the current document score. Initially invalid, until {@link #Next()} is called the first time. - the score of the current generated document - - - - Advance to the first document beyond the current whose number is greater - than or equal to target. - - - the minimum number of the next desired document - - true iff there is a document to be generated whose number is at - least target - - use {@link #Advance(int)} instead. - - - - Explain a score that we computed. UNSUPPORTED -- see explanation capability in DisjunctionMaxQuery. - the number of a document we scored - - the Explanation for our score - - - - A range query that returns a constant score equal to its boost for - all documents in the exclusive range of terms. - -

    It does not have an upper bound on the number of clauses covered in the range. - -

    This query matches the documents looking for terms that fall into the - supplied range according to {@link String#compareTo(String)}. It is not intended - for numerical ranges, use {@link NumericRangeQuery} instead. - -

    This query is hardwired to {@link MultiTermQuery#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT}. - If you want to change this, use {@link TermRangeQuery} instead. - -

    - Use {@link TermRangeQuery} for term ranges or - {@link NumericRangeQuery} for numeric ranges instead. - This class will be removed in Lucene 3.0. - - $Id: ConstantScoreRangeQuery.java 797694 2009-07-25 00:03:33Z mikemccand $ - -
    - - A Query that matches documents within an exclusive range of terms. - -

    This query matches the documents looking for terms that fall into the - supplied range according to {@link String#compareTo(String)}. It is not intended - for numerical ranges, use {@link NumericRangeQuery} instead. - -

    This query uses the {@link - MultiTermQuery#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT} - rewrite method. -

    - 2.9 - -
    - - An abstract {@link Query} that matches documents - containing a subset of terms provided by a {@link - FilteredTermEnum} enumeration. - -

    This query cannot be used directly; you must subclass - it and define {@link #getEnum} to provide a {@link - FilteredTermEnum} that iterates through the terms to be - matched. - -

    NOTE: if {@link #setRewriteMethod} is either - {@link #CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE} or {@link - #SCORING_BOOLEAN_QUERY_REWRITE}, you may encounter a - {@link BooleanQuery.TooManyClauses} exception during - searching, which happens when the number of terms to be - searched exceeds {@link - BooleanQuery#GetMaxClauseCount()}. Setting {@link - #setRewriteMethod} to {@link #CONSTANT_SCORE_FILTER_REWRITE} - prevents this. - -

    The recommended rewrite method is {@link - #CONSTANT_SCORE_AUTO_REWRITE_DEFAULT}: it doesn't spend CPU - computing unhelpful scores, and it tries to pick the most - performant rewrite method given the query. - - Note that {@link QueryParser} produces - MultiTermQueries using {@link - #CONSTANT_SCORE_AUTO_REWRITE_DEFAULT} by default. -

    -
    - - A rewrite method that first creates a private Filter, - by visiting each term in sequence and marking all docs - for that term. Matching documents are assigned a - constant score equal to the query's boost. - -

    This method is faster than the BooleanQuery - rewrite methods when the number of matched terms or - matched documents is non-trivial. Also, it will never - hit an errant {@link BooleanQuery.TooManyClauses} - exception. - -

    - - -
    - - A rewrite method that first translates each term into - {@link BooleanClause.Occur#SHOULD} clause in a - BooleanQuery, and keeps the scores as computed by the - query. Note that typically such scores are - meaningless to the user, and require non-trivial CPU - to compute, so it's almost always better to use {@link - #CONSTANT_SCORE_AUTO_REWRITE_DEFAULT} instead. - -

    NOTE: This rewrite method will hit {@link - BooleanQuery.TooManyClauses} if the number of terms - exceeds {@link BooleanQuery#getMaxClauseCount}. - -

    - - -
    - - Like {@link #SCORING_BOOLEAN_QUERY_REWRITE} except - scores are not computed. Instead, each matching - document receives a constant score equal to the - query's boost. - -

    NOTE: This rewrite method will hit {@link - BooleanQuery.TooManyClauses} if the number of terms - exceeds {@link BooleanQuery#getMaxClauseCount}. - -

    - - -
    - - Read-only default instance of {@link - ConstantScoreAutoRewrite}, with {@link - ConstantScoreAutoRewrite#setTermCountCutoff} set to - {@link - ConstantScoreAutoRewrite#DEFAULT_TERM_COUNT_CUTOFF} - and {@link - ConstantScoreAutoRewrite#setDocCountPercent} set to - {@link - ConstantScoreAutoRewrite#DEFAULT_DOC_COUNT_PERCENT}. - Note that you cannot alter the configuration of this - instance; you'll need to create a private instance - instead. - - - - Constructs a query for terms matching term. - check sub class for possible term access - the Term does not - make sense for all MultiTermQuerys and will be removed. - - - - Constructs a query matching terms that cannot be represented with a single - Term. - - - - Returns the pattern term. - check sub class for possible term access - getTerm does not - make sense for all MultiTermQuerys and will be removed. - - - - Construct the enumeration to be used, expanding the pattern term. - - - Expert: Return the number of unique terms visited during execution of the query. - If there are many of them, you may consider using another query type - or optimize your total term count in index. -

    This method is not thread safe, be sure to only call it when no query is running! - If you re-use the same query instance for another - search, be sure to first reset the term counter - with {@link #clearTotalNumberOfTerms}. -

    On optimized indexes / no MultiReaders, you get the correct number of - unique terms for the whole index. Use this number to compare different queries. - For non-optimized indexes this number can also be achived in - non-constant-score mode. In constant-score mode you get the total number of - terms seeked for all segments / sub-readers. -

    - - -
    - - Expert: Resets the counting of unique terms. - Do this before executing the query/filter. - - - - - - - - - - Sets the rewrite method to be used when executing the - query. You can use one of the four core methods, or - implement your own subclass of {@link RewriteMethod}. - - - - A rewrite method that tries to pick the best - constant-score rewrite method based on term and - document counts from the query. If both the number of - terms and documents is small enough, then {@link - #CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE} is used. - Otherwise, {@link #CONSTANT_SCORE_FILTER_REWRITE} is - used. - - - - Abstract class that defines how the query is rewritten. - - - If the number of terms in this query is equal to or - larger than this setting then {@link - #CONSTANT_SCORE_FILTER_REWRITE} is used. - - - - - - - - If the number of documents to be visited in the - postings exceeds this specified percentage of the - maxDoc() for the index, then {@link - #CONSTANT_SCORE_FILTER_REWRITE} is used. - - 0.0 to 100.0 - - - - - - - - Constructs a query selecting all terms greater/equal than lowerTerm - but less/equal than upperTerm. - -

    - If an endpoint is null, it is said - to be "open". Either or both endpoints may be open. Open endpoints may not - be exclusive (you can't select all but the first or last term without - explicitly specifying the term to exclude.) - -

    - The field that holds both lower and upper terms. - - The term text at the lower end of the range - - The term text at the upper end of the range - - If true, the lowerTerm is - included in the range. - - If true, the upperTerm is - included in the range. - -
    - - Constructs a query selecting all terms greater/equal than - lowerTerm but less/equal than upperTerm. -

    - If an endpoint is null, it is said - to be "open". Either or both endpoints may be open. Open endpoints may not - be exclusive (you can't select all but the first or last term without - explicitly specifying the term to exclude.) -

    - If collator is not null, it will be used to decide whether - index terms are within the given range, rather than using the Unicode code - point order in which index terms are stored. -

    - WARNING: Using this constructor and supplying a non-null - value in the collator parameter will cause every single - index Term in the Field referenced by lowerTerm and/or upperTerm to be - examined. Depending on the number of index Terms in this Field, the - operation could be very slow. - -

    - The Term text at the lower end of the range - - The Term text at the upper end of the range - - If true, the lowerTerm is - included in the range. - - If true, the upperTerm is - included in the range. - - The collator to use to collate index Terms, to determine - their membership in the range bounded by lowerTerm and - upperTerm. - -
    - - Returns the field name for this query - - - Returns the lower value of this range query - - - Returns the upper value of this range query - - - Returns true if the lower endpoint is inclusive - - - Returns true if the upper endpoint is inclusive - - - Returns the collator used to determine range inclusion, if any. - - - Prints a user-readable version of this query. - - - Changes of mode are not supported by this class (fixed to constant score rewrite mode) - - - use {@link #Score(Collector, int, int)} instead. - - - - use {@link #DocID()} instead. - - - - use {@link #NextDoc()} instead. - - - - use {@link #Score(Collector)} instead. - - - - use {@link #Advance(int)} instead. - - - - use {@link #DocID()} instead. - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - A simple hash table of document scores within a range. - - - A {@link MergeScheduler} that simply does each merge - sequentially, using the current thread. - - - -

    Expert: {@link IndexWriter} uses an instance - implementing this interface to execute the merges - selected by a {@link MergePolicy}. The default - MergeScheduler is {@link ConcurrentMergeScheduler}.

    - -

    NOTE: This API is new and still experimental - (subject to change suddenly in the next release)

    - -

    NOTE: This class typically requires access to - package-private APIs (eg, SegmentInfos) to do its job; - if you implement your own MergePolicy, you'll need to put - it in package Lucene.Net.Index in order to use - these APIs. -

    -
    - - Run the merges provided by {@link IndexWriter#GetNextMerge()}. - - - Close this MergeScheduler. - - - Just do the merges in sequence. We do this - "synchronized" so that even if the application is using - multiple threads, only one merge may run at a time. - - - - Used by DocumentsWriter to implemented a StringReader - that can be reset to a new string; we use this when - tokenizing the string value from a Field. - - - - Gathers all Fieldables for a document under the same - name, updates FieldInfos, and calls per-field consumers - to process field by field. - - Currently, only a single thread visits the fields, - sequentially, for processing. - - - - If there are fields we've seen but did not see again - in the last run, then free them up. - - - - A {@link FieldSelector} based on a Map of field names to {@link FieldSelectorResult}s - - - - - Create a a MapFieldSelector - maps from field names (String) to {@link FieldSelectorResult}s - - - - Create a a MapFieldSelector - fields to LOAD. List of Strings. All other fields are NO_LOAD. - - - - Create a a MapFieldSelector - fields to LOAD. All other fields are NO_LOAD. - - - - Load field according to its associated value in fieldSelections - a field name - - the fieldSelections value that field maps to or NO_LOAD if none. - - - - Expert: This class provides a {@link TokenStream} - for indexing numeric values that can be used by {@link - NumericRangeQuery} or {@link NumericRangeFilter}. - -

    Note that for simple usage, {@link NumericField} is - recommended. {@link NumericField} disables norms and - term freqs, as they are not usually needed during - searching. If you need to change these settings, you - should use this class. - -

    See {@link NumericField} for capabilities of fields - indexed numerically.

    - -

    Here's an example usage, for an int field: - -

    -             Field field = new Field(name, new NumericTokenStream(precisionStep).setIntValue(value));
    -             field.setOmitNorms(true);
    -             field.setOmitTermFreqAndPositions(true);
    -             document.add(field);
    -            
    - -

    For optimal performance, re-use the TokenStream and Field instance - for more than one document: - -

    -             NumericTokenStream stream = new NumericTokenStream(precisionStep);
    -             Field field = new Field(name, stream);
    -             field.setOmitNorms(true);
    -             field.setOmitTermFreqAndPositions(true);
    -             Document document = new Document();
    -             document.add(field);
    -            
    -             for(all documents) {
    -               stream.setIntValue(value)
    -               writer.addDocument(document);
    -             }
    -            
    - -

    This stream is not intended to be used in analyzers; - it's more for iterating the different precisions during - indexing a specific numeric value.

    - -

    NOTE: as token streams are only consumed once - the document is added to the index, if you index more - than one numeric field, use a separate NumericTokenStream - instance for each.

    - -

    See {@link NumericRangeQuery} for more details on the - precisionStep - parameter as well as how numeric fields work under the hood.

    - -

    NOTE: This API is experimental and - might change in incompatible ways in the next release. - -

    - 2.9 - -
    - - The full precision token gets this token type assigned. - - - The lower precision tokens gets this token type assigned. - - - Creates a token stream for numeric values using the default precisionStep - {@link NumericUtils#PRECISION_STEP_DEFAULT} (4). The stream is not yet initialized, - before using set a value using the various set???Value() methods. - - - - Creates a token stream for numeric values with the specified - precisionStep. The stream is not yet initialized, - before using set a value using the various set???Value() methods. - - - - Expert: Creates a token stream for numeric values with the specified - precisionStep using the given {@link AttributeSource}. - The stream is not yet initialized, - before using set a value using the various set???Value() methods. - - - - Expert: Creates a token stream for numeric values with the specified - precisionStep using the given - {@link org.apache.lucene.util.AttributeSource.AttributeFactory}. - The stream is not yet initialized, - before using set a value using the various set???Value() methods. - - - - Initializes the token stream with the supplied long value. - the value, for which this TokenStream should enumerate tokens. - - this instance, because of this you can use it the following way: - new Field(name, new NumericTokenStream(precisionStep).SetLongValue(value)) - - - - Initializes the token stream with the supplied int value. - the value, for which this TokenStream should enumerate tokens. - - this instance, because of this you can use it the following way: - new Field(name, new NumericTokenStream(precisionStep).SetIntValue(value)) - - - - Initializes the token stream with the supplied double value. - the value, for which this TokenStream should enumerate tokens. - - this instance, because of this you can use it the following way: - new Field(name, new NumericTokenStream(precisionStep).SetDoubleValue(value)) - - - - Initializes the token stream with the supplied float value. - the value, for which this TokenStream should enumerate tokens. - - this instance, because of this you can use it the following way: - new Field(name, new NumericTokenStream(precisionStep).SetFloatValue(value)) - - - - Holds a map of String input to String output, to be used - with {@link MappingCharFilter}. - - - - Records a replacement to be applied to the inputs - stream. Whenever singleMatch occurs in - the input, it will be replaced with - replacement. - - - input String to be replaced - - output String - - - - Floating point numbers smaller than 32 bits. - - - $Id$ - - - - Converts a 32 bit float to an 8 bit float. -
    Values less than zero are all mapped to zero. -
    Values are truncated (rounded down) to the nearest 8 bit value. -
    Values between zero and the smallest representable value - are rounded up. - -
    - the 32 bit float to be converted to an 8 bit float (byte) - - the number of mantissa bits to use in the byte, with the remainder to be used in the exponent - - the zero-point in the range of exponent values - - the 8 bit float representation - -
    - - Converts an 8 bit float to a 32 bit float. - - - floatToByte(b, mantissaBits=3, zeroExponent=15) -
    smallest non-zero value = 5.820766E-10 -
    largest value = 7.5161928E9 -
    epsilon = 0.125 -
    -
    - - byteToFloat(b, mantissaBits=3, zeroExponent=15) - - - floatToByte(b, mantissaBits=5, zeroExponent=2) -
    smallest nonzero value = 0.033203125 -
    largest value = 1984.0 -
    epsilon = 0.03125 -
    -
    - - byteToFloat(b, mantissaBits=5, zeroExponent=2) - - - Provides methods for sanity checking that entries in the FieldCache - are not wasteful or inconsistent. -

    -

    - Lucene 2.9 Introduced numerous enhancements into how the FieldCache - is used by the low levels of Lucene searching (for Sorting and - ValueSourceQueries) to improve both the speed for Sorting, as well - as reopening of IndexReaders. But these changes have shifted the - usage of FieldCache from "top level" IndexReaders (frequently a - MultiReader or DirectoryReader) down to the leaf level SegmentReaders. - As a result, existing applications that directly access the FieldCache - may find RAM usage increase significantly when upgrading to 2.9 or - Later. This class provides an API for these applications (or their - Unit tests) to check at run time if the FieldCache contains "insane" - usages of the FieldCache. -

    -

    - EXPERIMENTAL API: This API is considered extremely advanced and - experimental. It may be removed or altered w/o warning in future releases - of Lucene. -

    -

    - - - - - - -
    - - If set, will be used to estimate size for all CacheEntry objects - dealt with. - - - - Quick and dirty convenience method - - - - - Quick and dirty convenience method that instantiates an instance with - "good defaults" and uses it to test the CacheEntry[] - - - - - - Tests a CacheEntry[] for indication of "insane" cache usage. -

    - NOTE:FieldCache CreationPlaceholder objects are ignored. - (:TODO: is this a bad idea? are we masking a real problem?) -

    -

    -
    - - Internal helper method used by check that iterates over - valMismatchKeys and generates a Collection of Insanity - instances accordingly. The MapOfSets are used to populate - the Insantiy objects. - - - - - - Internal helper method used by check that iterates over - the keys of readerFieldToValIds and generates a Collection - of Insanity instances whenever two (or more) ReaderField instances are - found that have an ancestery relationships. - - - - - - - Checks if the seed is an IndexReader, and if so will walk - the hierarchy of subReaders building up a list of the objects - returned by obj.getFieldCacheKey() - - - - Simple pair object for using "readerKey + fieldName" a Map key - - - Simple container for a collection of related CacheEntry objects that - in conjunction with eachother represent some "insane" usage of the - FieldCache. - - - - Type of insane behavior this object represents - - - Description of hte insane behavior - - - CacheEntry objects which suggest a problem - - - Multi-Line representation of this Insanity object, starting with - the Type and Msg, followed by each CacheEntry.toString() on it's - own line prefaced by a tab character - - - - An Enumaration of the differnet types of "insane" behavior that - may be detected in a FieldCache. - - - - - - - - - - - Indicates an overlap in cache usage on a given field - in sub/super readers. - - - -

    - Indicates entries have the same reader+fieldname but - different cached values. This can happen if different datatypes, - or parsers are used -- and while it's not necessarily a bug - it's typically an indication of a possible problem. -

    -

    - PNOTE: Only the reader, fieldname, and cached value are actually - tested -- if two cache entries have different parsers or datatypes but - the cached values are the same Object (== not just equal()) this method - does not consider that a red flag. This allows for subtle variations - in the way a Parser is specified (null vs DEFAULT_LONG_PARSER, etc...) -

    -

    -
    - - Indicates an expected bit of "insanity". This may be useful for - clients that wish to preserve/log information about insane usage - but indicate that it was expected. - - - - - This interface should be implemented by any class whose instances are intended - to be executed by a thread. - - - - - This method has to be implemented in order that starting of the thread causes the object's - run method to be called in that separately executing thread. - - - - - Contains conversion support elements such as classes, interfaces and static methods. - - - - - Copies an array of chars obtained from a String into a specified array of chars - - The String to get the chars from - Position of the String to start getting the chars - Position of the String to end getting the chars - Array to return the chars - Position of the destination array of chars to start storing the chars - An array of chars - - - - Support class used to handle threads - - - - - The instance of System.Threading.Thread - - - - - Initializes a new instance of the ThreadClass class - - - - - Initializes a new instance of the Thread class. - - The name of the thread - - - - Initializes a new instance of the Thread class. - - A ThreadStart delegate that references the methods to be invoked when this thread begins executing - - - - Initializes a new instance of the Thread class. - - A ThreadStart delegate that references the methods to be invoked when this thread begins executing - The name of the thread - - - - This method has no functionality unless the method is overridden - - - - - Causes the operating system to change the state of the current thread instance to ThreadState.Running - - - - - Interrupts a thread that is in the WaitSleepJoin thread state - - - - - Blocks the calling thread until a thread terminates - - - - - Blocks the calling thread until a thread terminates or the specified time elapses - - Time of wait in milliseconds - - - - Blocks the calling thread until a thread terminates or the specified time elapses - - Time of wait in milliseconds - Time of wait in nanoseconds - - - - Resumes a thread that has been suspended - - - - - Raises a ThreadAbortException in the thread on which it is invoked, - to begin the process of terminating the thread. Calling this method - usually terminates the thread - - - - - Raises a ThreadAbortException in the thread on which it is invoked, - to begin the process of terminating the thread while also providing - exception information about the thread termination. - Calling this method usually terminates the thread. - - An object that contains application-specific information, such as state, which can be used by the thread being aborted - - - - Suspends the thread, if the thread is already suspended it has no effect - - - - - Obtain a String that represents the current object - - A String that represents the current object - - - - Gets the currently running thread - - The currently running thread - - - - Gets the current thread instance - - - - - Gets or sets the name of the thread - - - - - Gets or sets a value indicating the scheduling priority of a thread - - - - - Gets a value indicating the execution status of the current thread - - - - - Gets or sets a value indicating whether or not a thread is a background thread. - - - - - Represents the methods to support some operations over files. - - - - - Returns an array of abstract pathnames representing the files and directories of the specified path. - - The abstract pathname to list it childs. - An array of abstract pathnames childs of the path specified or null if the path is not a directory - - - - Returns a list of files in a give directory. - - The full path name to the directory. - - An array containing the files. - - - - Flushes the specified file stream. Ensures that all buffered - data is actually written to the file system. - - The file stream. - - - - A simple class for number conversions. - - - - - Min radix value. - - - - - Max radix value. - - - - - Converts a number to System.String. - - - - - - - Converts a number to System.String. - - - - - - - Converts a number to System.String in the specified radix. - - A number to be converted. - A radix. - A System.String representation of the number in the specified redix. - - - - Parses a number in the specified radix. - - An input System.String. - A radix. - The parsed number in the specified radix. - - - - Performs an unsigned bitwise right shift with the specified number - - Number to operate on - Ammount of bits to shift - The resulting number from the shift operation - - - - Performs an unsigned bitwise right shift with the specified number - - Number to operate on - Ammount of bits to shift - The resulting number from the shift operation - - - - Returns the index of the first bit that is set to true that occurs - on or after the specified starting index. If no such bit exists - then -1 is returned. - - The BitArray object. - The index to start checking from (inclusive). - The index of the next set bit. - - - - Converts a System.String number to long. - - - - - - - Mimics Java's Character class. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This class provides supporting methods of java.util.BitSet - that are not present in System.Collections.BitArray. - - - - - Returns the next set bit at or after index, or -1 if no such bit exists. - - - the index of bit array at which to start checking - the next set bit or -1 - - - - Returns the next un-set bit at or after index, or -1 if no such bit exists. - - - the index of bit array at which to start checking - the next set bit or -1 - - - - Returns the number of bits set to true in this BitSet. - - The BitArray object. - The number of bits set to true in this BitSet. - - - - Summary description for TestSupportClass. - - - - - Compares two Term arrays for equality. - - First Term array to compare - Second Term array to compare - true if the Terms are equal in both arrays, false otherwise - - - - A Hashtable which holds weak references to its keys so they - can be collected during GC. - - - - - Serves as a simple "GC Monitor" that indicates whether cleanup is needed. - If collectableObject.IsAlive is false, GC has occurred and we should perform cleanup - - - - - Customize the hashtable lookup process by overriding KeyEquals. KeyEquals - will compare both WeakKey to WeakKey and WeakKey to real keys - - - - - Perform cleanup if GC occurred - - - - - Iterate over all keys and remove keys that were collected - - - - - Wrap each key with a WeakKey and add it to the hashtable - - - - - Create a temporary copy of the real keys and return that - - - - - A weak referene wrapper for the hashtable keys. Whenever a key\value pair - is added to the hashtable, the key is wrapped using a WeakKey. WeakKey saves the - value of the original object hashcode for fast comparison. - - - - - A Dictionary enumerator which wraps the original hashtable enumerator - and performs 2 tasks: Extract the real key from a WeakKey and skip keys - that were already collected. - - - - - Support class used to handle Hashtable addition, which does a check - first to make sure the added item is unique in the hash. - - - - - Converts the specified collection to its string representation. - - The collection to convert to string. - A string representation of the specified collection. - - - - Compares two string arrays for equality. - - First string array list to compare - Second string array list to compare - true if the strings are equal in both arrays, false otherwise - - - - Sorts an IList collections - - The System.Collections.IList instance that will be sorted - The Comparator criteria, null to use natural comparator. - - - - Fills the array with an specific value from an specific index to an specific index. - - The array to be filled. - The first index to be filled. - The last index to be filled. - The value to fill the array with. - - - - Fills the array with an specific value. - - The array to be filled. - The value to fill the array with. - - - - Compares the entire members of one array whith the other one. - - The array to be compared. - The array to be compared with. - Returns true if the two specified arrays of Objects are equal - to one another. The two arrays are considered equal if both arrays - contain the same number of elements, and all corresponding pairs of - elements in the two arrays are equal. Two objects e1 and e2 are - considered equal if (e1==null ? e2==null : e1.equals(e2)). In other - words, the two arrays are equal if they contain the same elements in - the same order. Also, two array references are considered equal if - both are null. - - - A collection of which can be - looked up by instances of . - The type of the items contains in this - collection. - The type of the keys that can be used to look - up the items. - - - Creates a new instance of the - class. - The which will convert - instances of to - when the override of is called. - - - The which will convert - instances of to - when the override of is called. - - - Converts an item that is added to the collection to - a key. - The instance of - to convert into an instance of . - The instance of which is the - key for this item. - - - Determines if a key for an item exists in this - collection. - The instance of - to see if it exists in this collection. - True if the key exists in the collection, false otherwise. - - - Represents a strongly typed list of objects that can be accessed by index. - Provides methods to search, sort, and manipulate lists. Also provides functionality - to compare lists against each other through an implementations of - . - The type of elements in the list. - - - Initializes a new instance of the - class that is empty and has the - default initial capacity. - - - Initializes a new instance of the - class that contains elements copied from the specified collection and has - sufficient capacity to accommodate the number of elements copied. - The collection whose elements are copied to the new list. - - - Initializes a new instance of the - class that is empty and has the specified initial capacity. - The number of elements that the new list can initially store. - - - Adds a range of objects represented by the - implementation. - The - implementation to add to this list. - - - Compares the counts of two - implementations. - This uses a trick in LINQ, sniffing types for implementations - of interfaces that might supply shortcuts when trying to make comparisons. - In this case, that is the and - interfaces, either of which can provide a count - which can be used in determining the equality of sequences (if they don't have - the same count, then they can't be equal). - The from the left hand side of the - comparison to check the count of. - The from the right hand side of the - comparison to check the count of. - Null if the result is indeterminate. This occurs when either - or doesn't implement or . - Otherwise, it will get the count from each and return true if they are equal, false otherwise. - - - Compares the contents of a - implementation to another one to determine equality. - Thinking of the implementation as - a string with any number of characters, the algorithm checks - each item in each list. If any item of the list is not equal (or - one list contains all the elements of another list), then that list - element is compared to the other list element to see which - list is greater. - The implementation - that is considered the left hand side. - The implementation - that is considered the right hand side. - True if the items are equal, false otherwise. - - - Compares this sequence to another - implementation, returning true if they are equal, false otherwise. - The other implementation - to compare against. - True if the sequence in - is the same as this one. - - - Compares this object for equality against other. - The other object to compare this object against. - True if this object and are equal, false - otherwise. - - - Gets the hash code for the list. - The hash code value. - - - - Clones the . - This is a shallow clone. - A new shallow clone of this - . - - - - A simple wrapper to allow for the use of the GeneralKeyedCollection. The - wrapper is required as there can be several keys for an object depending - on how many interfaces it implements. - - - - - Provides platform infos. - - - - - Whether we run under a Unix platform. - - - - - Whether we run under a supported Windows platform. - - - - - For Debuging purposes. - - - - Writes bytes through to a primary IndexOutput, computing - checksum as it goes. Note that you cannot use seek(). - - - - Expert-only. Public for use by other weight implementations - - - A Spans that is formed from the ordered subspans of a SpanNearQuery - where the subspans do not overlap and have a maximum slop between them. -

    - The formed spans only contains minimum slop matches.
    - The matching slop is computed from the distance(s) between - the non overlapping matching Spans.
    - Successive matches are always formed from the successive Spans - of the SpanNearQuery. -

    - The formed spans may contain overlaps when the slop is at least 1. - For example, when querying using -

    t1 t2 t3
    - with slop at least 1, the fragment: -
    t1 t2 t1 t3 t2 t3
    - matches twice: -
    t1 t2 .. t3      
    -
          t1 .. t2 t3
    - - - Expert: - Only public for subclassing. Most implementations should not need this class -
    -
    - - The spans in the same order as the SpanNearQuery - - - Indicates that all subSpans have same doc() - - - Advances the subSpans to just after an ordered match with a minimum slop - that is smaller than the slop allowed by the SpanNearQuery. - - true iff there is such a match. - - - - Advance the subSpans to the same document - - - Check whether two Spans in the same document are ordered. - - - - - true iff spans1 starts before spans2 - or the spans start at the same position, - and spans1 ends before spans2. - - - - Like {@link #DocSpansOrdered(Spans,Spans)}, but use the spans - starts and ends as parameters. - - - - Order the subSpans within the same document by advancing all later spans - after the previous one. - - - - The subSpans are ordered in the same doc, so there is a possible match. - Compute the slop while making the match as short as possible by advancing - all subSpans except the last one in reverse order. - - - - Position of a term in a document that takes into account the term offset within the phrase. - - - Go to next location of this term current document, and set - position as location - offset, so that a - matching exact phrase is easily identified when all PhrasePositions - have exactly the same position. - - - - Lucene's package information, including version. * - - - The TermVectorOffsetInfo class holds information pertaining to a Term in a {@link Lucene.Net.Index.TermPositionVector}'s - offset information. This offset information is the character offset as set during the Analysis phase (and thus may not be the actual offset in the - original content). - - - - Convenience declaration when creating a {@link Lucene.Net.Index.TermPositionVector} that stores only position information. - - - The accessor for the ending offset for the term - The offset - - - - The accessor for the starting offset of the term. - - - The offset - - - - Two TermVectorOffsetInfos are equals if both the start and end offsets are the same - The comparison Object - - true if both {@link #GetStartOffset()} and {@link #GetEndOffset()} are the same for both objects. - - - - Collapse the hash table & sort in-place. - - - Compares term text for two Posting instance and - returns -1 if p1 < p2; 1 if p1 > p2; else 0. - - - - Test whether the text for current RawPostingList p equals - current tokenText. - - - - Called when postings hash is too small (> 50% - occupied) or too large (< 20% occupied). - - - - Filename filter that accept filenames and extensions only created by Lucene. - - - $rcs = ' $Id: Exp $ ' ; - - - - Returns true if this is a file that would be contained - in a CFS file. This function should only be called on - files that pass the above "accept" (ie, are already - known to be a Lucene index file). - - - - NOTE: this API is experimental and will likely change - - - Adds a new term in this field; term ends with U+FFFF - char - - - - Called when we are done adding terms to this field - - - Abstract API that consumes terms, doc, freq, prox and - payloads postings. Concrete implementations of this - actually do "something" with the postings (write it into - the index in a specific format). - - NOTE: this API is experimental and will likely change - - - - Add a new field - - - Called when we are done adding everything. - - - Add a new field - - - Called when we are done adding everything. - - - Implements the skip list reader for the default posting list format - that stores positions and payloads. - - - - - This abstract class reads skip lists with multiple levels. - - See {@link MultiLevelSkipListWriter} for the information about the encoding - of the multi level skip lists. - - Subclasses must implement the abstract method {@link #ReadSkipData(int, IndexInput)} - which defines the actual format of the skip data. - - - - Returns the id of the doc to which the last call of {@link #SkipTo(int)} - has skipped. - - - - Skips entries to the first beyond the current whose document number is - greater than or equal to target. Returns the current doc count. - - - - Seeks the skip entry on the given level - - - initializes the reader - - - Loads the skip levels - - - Subclasses must implement the actual skip data encoding in this method. - - - the level skip data shall be read from - - the skip stream to read from - - - - Copies the values of the last read skip entry on this level - - - used to buffer the top skip levels - - - Returns the freq pointer of the doc to which the last call of - {@link MultiLevelSkipListReader#SkipTo(int)} has skipped. - - - - Returns the prox pointer of the doc to which the last call of - {@link MultiLevelSkipListReader#SkipTo(int)} has skipped. - - - - Returns the payload length of the payload stored just before - the doc to which the last call of {@link MultiLevelSkipListReader#SkipTo(int)} - has skipped. - - - - A SinkTokenizer can be used to cache Tokens for use in an Analyzer -

    - WARNING: {@link TeeTokenFilter} and {@link SinkTokenizer} only work with the old TokenStream API. - If you switch to the new API, you need to use {@link TeeSinkTokenFilter} instead, which offers - the same functionality. -

    - - - Use {@link TeeSinkTokenFilter} instead - - - -
    - - Get the tokens in the internal List. -

    - WARNING: Adding tokens to this list requires the {@link #Reset()} method to be called in order for them - to be made available. Also, this Tokenizer does nothing to protect against {@link java.util.ConcurrentModificationException}s - in the case of adds happening while {@link #Next(Lucene.Net.Analysis.Token)} is being called. -

    - WARNING: Since this SinkTokenizer can be reset and the cached tokens made available again, do not modify them. Modify clones instead. - -

    - A List of {@link Lucene.Net.Analysis.Token}s - -
    - - Returns the next token out of the list of cached tokens - The next {@link Lucene.Net.Analysis.Token} in the Sink. - - IOException - - - Override this method to cache only certain tokens, or new tokens based - on the old tokens. - - - The {@link Lucene.Net.Analysis.Token} to add to the sink - - - - Reset the internal data structures to the start at the front of the list of tokens. Should be called - if tokens were added to the list after an invocation of {@link #Next(Token)} - - IOException - - - Methods for manipulating strings. - - $Id: StringHelper.java 801344 2009-08-05 18:05:06Z yonik $ - - - - Expert: - The StringInterner implementation used by Lucene. - This shouldn't be changed to an incompatible implementation after other Lucene APIs have been used. - - - - Return the same string object for all equal strings - - - Compares two byte[] arrays, element by element, and returns the - number of elements common to both arrays. - - - The first byte[] to compare - - The second byte[] to compare - - The number of common elements. - - - - Compares two strings, character by character, and returns the - first position where the two strings differ from one another. - - - The first string to compare - - The second string to compare - - The first position where the two strings differ. - - - - Implements the wildcard search query. Supported wildcards are *, which - matches any character sequence (including the empty one), and ?, - which matches any single character. Note this query can be slow, as it - needs to iterate over many terms. In order to prevent extremely slow WildcardQueries, - a Wildcard term should not start with one of the wildcards * or - ?. - -

    This query uses the {@link - MultiTermQuery#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT} - rewrite method. - -

    - - -
    - - Returns the pattern term. - - - Prints a user-readable version of this query. - - - A Query that matches documents containing a term. - This may be combined with other terms with a {@link BooleanQuery}. - - - - Constructs a query for the term t. - - - Returns the term of this query. - - - Prints a user-readable version of this query. - - - Returns true iff o is equal to this. - - - Returns a hash code value for this object. - - - Expert: Delegating scoring implementation. Useful in {@link - Query#GetSimilarity(Searcher)} implementations, to override only certain - methods of a Searcher's Similiarty implementation.. - - - - Expert: Scoring API. -

    Subclasses implement search scoring. - -

    The score of query q for document d correlates to the - cosine-distance or dot-product between document and query vectors in a - - Vector Space Model (VSM) of Information Retrieval. - A document whose vector is closer to the query vector in that model is scored higher. - - The score is computed as follows: - -

    - - -
    - - - - - - - - - - - -
    - score(q,d)   =   - coord(q,d)  ·  - queryNorm(q)  ·  - - - - ( - tf(t in d)  ·  - idf(t)2  ·  - t.getBoost() ·  - norm(t,d) - ) -
    t in q
    -
    - -

    where -

      -
    1. - - tf(t in d) - correlates to the term's frequency, - defined as the number of times term t appears in the currently scored document d. - Documents that have more occurrences of a given term receive a higher score. - The default computation for tf(t in d) in - {@link Lucene.Net.Search.DefaultSimilarity#Tf(float) DefaultSimilarity} is: - -
       
      - - - - - -
      - {@link Lucene.Net.Search.DefaultSimilarity#Tf(float) tf(t in d)}   =   - - frequency½ -
      -
       
      -
    2. - -
    3. - - idf(t) stands for Inverse Document Frequency. This value - correlates to the inverse of docFreq - (the number of documents in which the term t appears). - This means rarer terms give higher contribution to the total score. - The default computation for idf(t) in - {@link Lucene.Net.Search.DefaultSimilarity#Idf(int, int) DefaultSimilarity} is: - -
       
      - - - - - - - -
      - {@link Lucene.Net.Search.DefaultSimilarity#Idf(int, int) idf(t)}  =   - - 1 + log ( - - - - - -
      numDocs
      –––––––––
      docFreq+1
      -
      - ) -
      -
       
      -
    4. - -
    5. - - coord(q,d) - is a score factor based on how many of the query terms are found in the specified document. - Typically, a document that contains more of the query's terms will receive a higher score - than another document with fewer query terms. - This is a search time factor computed in - {@link #Coord(int, int) coord(q,d)} - by the Similarity in effect at search time. -
       
      -
    6. - -
    7. - - queryNorm(q) - - is a normalizing factor used to make scores between queries comparable. - This factor does not affect document ranking (since all ranked documents are multiplied by the same factor), - but rather just attempts to make scores from different queries (or even different indexes) comparable. - This is a search time factor computed by the Similarity in effect at search time. - - The default computation in - {@link Lucene.Net.Search.DefaultSimilarity#QueryNorm(float) DefaultSimilarity} - is: -
       
      - - - - - -
      - queryNorm(q)   =   - {@link Lucene.Net.Search.DefaultSimilarity#QueryNorm(float) queryNorm(sumOfSquaredWeights)} -   =   - - - - - -
      1
      - –––––––––––––– -
      sumOfSquaredWeights½
      -
      -
       
      - - The sum of squared weights (of the query terms) is - computed by the query {@link Lucene.Net.Search.Weight} object. - For example, a {@link Lucene.Net.Search.BooleanQuery boolean query} - computes this value as: - -
       
      - - - - - - - - - - - -
      - {@link Lucene.Net.Search.Weight#SumOfSquaredWeights() sumOfSquaredWeights}   =   - {@link Lucene.Net.Search.Query#GetBoost() q.getBoost()} 2 -  ·  - - - - ( - idf(t)  ·  - t.getBoost() - ) 2 -
      t in q
      -
       
      - -
    8. - -
    9. - - t.getBoost() - is a search time boost of term t in the query q as - specified in the query text - (see query syntax), - or as set by application calls to - {@link Lucene.Net.Search.Query#SetBoost(float) setBoost()}. - Notice that there is really no direct API for accessing a boost of one term in a multi term query, - but rather multi terms are represented in a query as multi - {@link Lucene.Net.Search.TermQuery TermQuery} objects, - and so the boost of a term in the query is accessible by calling the sub-query - {@link Lucene.Net.Search.Query#GetBoost() getBoost()}. -
       
      -
    10. - -
    11. - - norm(t,d) encapsulates a few (indexing time) boost and length factors: - -
        -
      • Document boost - set by calling - {@link Lucene.Net.Documents.Document#SetBoost(float) doc.setBoost()} - before adding the document to the index. -
      • -
      • Field boost - set by calling - {@link Lucene.Net.Documents.Fieldable#SetBoost(float) field.setBoost()} - before adding the field to a document. -
      • -
      • {@link #LengthNorm(String, int) lengthNorm(field)} - computed - when the document is added to the index in accordance with the number of tokens - of this field in the document, so that shorter fields contribute more to the score. - LengthNorm is computed by the Similarity class in effect at indexing. -
      • -
      - -

      - When a document is added to the index, all the above factors are multiplied. - If the document has multiple fields with the same name, all their boosts are multiplied together: - -
       
      - - - - - - - - - - - -
      - norm(t,d)   =   - {@link Lucene.Net.Documents.Document#GetBoost() doc.getBoost()} -  ·  - {@link #LengthNorm(String, int) lengthNorm(field)} -  ·  - - - - {@link Lucene.Net.Documents.Fieldable#GetBoost() f.getBoost}() -
      field f in d named as t
      -
       
      - However the resulted norm value is {@link #EncodeNorm(float) encoded} as a single byte - before being stored. - At search time, the norm byte value is read from the index - {@link Lucene.Net.Store.Directory directory} and - {@link #DecodeNorm(byte) decoded} back to a float norm value. - This encoding/decoding, while reducing index size, comes with the price of - precision loss - it is not guaranteed that decode(encode(x)) = x. - For instance, decode(encode(0.89)) = 0.75. - Also notice that search time is too late to modify this norm part of scoring, e.g. by - using a different {@link Similarity} for search. -
       
      -

    12. -
    - -
    - - - - - - -
    - - Set the default Similarity implementation used by indexing and search - code. - - - - - - - - - Return the default Similarity implementation used by indexing and search - code. - -

    This is initially an instance of {@link DefaultSimilarity}. - -

    - - - - -
    - - Cache of decoded bytes. - - - Decodes a normalization factor stored in an index. - - - - - Returns a table for decoding normalization bytes. - - - - - Compute the normalization value for a field, given the accumulated - state of term processing for this field (see {@link FieldInvertState}). - -

    Implementations should calculate a float value based on the field - state and then return that value. - -

    For backward compatibility this method by default calls - {@link #LengthNorm(String, int)} passing - {@link FieldInvertState#GetLength()} as the second argument, and - then multiplies this value by {@link FieldInvertState#GetBoost()}.

    - -

    WARNING: This API is new and experimental and may - suddenly change.

    - -

    - field name - - current processing state for this field - - the calculated float norm - -
    - - Computes the normalization value for a field given the total number of - terms contained in a field. These values, together with field boosts, are - stored in an index and multipled into scores for hits on each field by the - search code. - -

    Matches in longer fields are less precise, so implementations of this - method usually return smaller values when numTokens is large, - and larger values when numTokens is small. - -

    Note that the return values are computed under - {@link Lucene.Net.Index.IndexWriter#AddDocument(Lucene.Net.Documents.Document)} - and then stored using - {@link #EncodeNorm(float)}. - Thus they have limited precision, and documents - must be re-indexed if this method is altered. - -

    - the name of the field - - the total number of tokens contained in fields named - fieldName of doc. - - a normalization factor for hits on this field of this document - - - - -
    - - Computes the normalization value for a query given the sum of the squared - weights of each of the query terms. This value is then multipled into the - weight of each query term. - -

    This does not affect ranking, but rather just attempts to make scores - from different queries comparable. - -

    - the sum of the squares of query term weights - - a normalization factor for query weights - -
    - - Encodes a normalization factor for storage in an index. - -

    The encoding uses a three-bit mantissa, a five-bit exponent, and - the zero-exponent point at 15, thus - representing values from around 7x10^9 to 2x10^-9 with about one - significant decimal digit of accuracy. Zero is also represented. - Negative numbers are rounded up to zero. Values too large to represent - are rounded down to the largest representable value. Positive values too - small to represent are rounded up to the smallest positive representable - value. - -

    - - - - -
    - - Computes a score factor based on a term or phrase's frequency in a - document. This value is multiplied by the {@link #Idf(Term, Searcher)} - factor for each term in the query and these products are then summed to - form the initial score for a document. - -

    Terms and phrases repeated in a document indicate the topic of the - document, so implementations of this method usually return larger values - when freq is large, and smaller values when freq - is small. - -

    The default implementation calls {@link #Tf(float)}. - -

    - the frequency of a term within a document - - a score factor based on a term's within-document frequency - -
    - - Computes the amount of a sloppy phrase match, based on an edit distance. - This value is summed for each sloppy phrase match in a document to form - the frequency that is passed to {@link #Tf(float)}. - -

    A phrase match with a small edit distance to a document passage more - closely matches the document, so implementations of this method usually - return larger values when the edit distance is small and smaller values - when it is large. - -

    - - - the edit distance of this sloppy phrase match - - the frequency increment for this match - -
    - - Computes a score factor based on a term or phrase's frequency in a - document. This value is multiplied by the {@link #Idf(Term, Searcher)} - factor for each term in the query and these products are then summed to - form the initial score for a document. - -

    Terms and phrases repeated in a document indicate the topic of the - document, so implementations of this method usually return larger values - when freq is large, and smaller values when freq - is small. - -

    - the frequency of a term within a document - - a score factor based on a term's within-document frequency - -
    - - Computes a score factor for a simple term. - -

    The default implementation is:

    -            return idf(searcher.docFreq(term), searcher.maxDoc());
    -            
    - - Note that {@link Searcher#MaxDoc()} is used instead of - {@link Lucene.Net.Index.IndexReader#NumDocs()} because it is proportional to - {@link Searcher#DocFreq(Term)} , i.e., when one is inaccurate, - so is the other, and in the same direction. - -
    - the term in question - - the document collection being searched - - a score factor for the term - - see {@link #IdfExplain(Term, Searcher)} - -
    - - Computes a score factor for a simple term and returns an explanation - for that score factor. - -

    - The default implementation uses: - -

    -            idf(searcher.docFreq(term), searcher.maxDoc());
    -            
    - - Note that {@link Searcher#MaxDoc()} is used instead of - {@link Lucene.Net.Index.IndexReader#NumDocs()} because it is - proportional to {@link Searcher#DocFreq(Term)} , i.e., when one is - inaccurate, so is the other, and in the same direction. - -
    - the term in question - - the document collection being searched - - an IDFExplain object that includes both an idf score factor - and an explanation for the term. - - IOException -
    - - Computes a score factor for a phrase. - -

    The default implementation sums the {@link #Idf(Term,Searcher)} factor - for each term in the phrase. - -

    - the terms in the phrase - - the document collection being searched - - idf score factor - - see {@link #idfExplain(Collection, Searcher)} - -
    - - Computes a score factor for a phrase. - -

    - The default implementation sums the idf factor for - each term in the phrase. - -

    - the terms in the phrase - - the document collection being searched - - an IDFExplain object that includes both an idf - score factor for the phrase and an explanation - for each term. - - IOException -
    - - Computes a score factor based on a term's document frequency (the number - of documents which contain the term). This value is multiplied by the - {@link #Tf(int)} factor for each term in the query and these products are - then summed to form the initial score for a document. - -

    Terms that occur in fewer documents are better indicators of topic, so - implementations of this method usually return larger values for rare terms, - and smaller values for common terms. - -

    - the number of documents which contain the term - - the total number of documents in the collection - - a score factor based on the term's document frequency - -
    - - Computes a score factor based on the fraction of all query terms that a - document contains. This value is multiplied into scores. - -

    The presence of a large portion of the query terms indicates a better - match with the query, so implementations of this method usually return - larger values when the ratio between these parameters is large and smaller - values when the ratio between them is small. - -

    - the number of query terms matched in the document - - the total number of terms in the query - - a score factor based on term overlap with the query - -
    - - Calculate a scoring factor based on the data in the payload. Overriding implementations - are responsible for interpreting what is in the payload. Lucene makes no assumptions about - what is in the byte array. -

    - The default implementation returns 1. - -

    - The fieldName of the term this payload belongs to - - The payload byte array to be scored - - The offset into the payload array - - The length in the array - - An implementation dependent float to be used as a scoring factor - - - See {@link #ScorePayload(int, String, int, int, byte[], int, int)} - -
    - - Calculate a scoring factor based on the data in the payload. Overriding implementations - are responsible for interpreting what is in the payload. Lucene makes no assumptions about - what is in the byte array. -

    - The default implementation returns 1. - -

    - The docId currently being scored. If this value is {@link #NO_DOC_ID_PROVIDED}, then it should be assumed that the PayloadQuery implementation does not provide document information - - The fieldName of the term this payload belongs to - - The start position of the payload - - The end position of the payload - - The payload byte array to be scored - - The offset into the payload array - - The length in the array - - An implementation dependent float to be used as a scoring factor - - -
    - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - The Similarity implementation used by default. - TODO: move back to top when old API is removed! - - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - Remove this when old API is removed! - - - - Construct a {@link Similarity} that delegates all methods to another. - - - the Similarity implementation to delegate to - - - - A Query that matches documents within an exclusive range of terms. - -

    This query matches the documents looking for terms that fall into the - supplied range according to {@link Term#CompareTo(Term)}. It is not intended - for numerical ranges, use {@link NumericRangeQuery} instead. - -

    This query uses {@linkplain - MultiTermQuery#SCORING_BOOLEAN_QUERY_REWRITE}. If you - want to change this, use the new {@link TermRangeQuery} - instead. - -

    - Use {@link TermRangeQuery} for term ranges or - {@link NumericRangeQuery} for numeric ranges instead. - This class will be removed in Lucene 3.0. - -
    - - Constructs a query selecting all terms greater than - lowerTerm but less than upperTerm. - There must be at least one term and either term may be null, - in which case there is no bound on that side, but if there are - two terms, both terms must be for the same field. - - - The Term at the lower end of the range - - The Term at the upper end of the range - - If true, both lowerTerm and - upperTerm will themselves be included in the range. - - - - Constructs a query selecting all terms greater than - lowerTerm but less than upperTerm. - There must be at least one term and either term may be null, - in which case there is no bound on that side, but if there are - two terms, both terms must be for the same field. -

    - If collator is not null, it will be used to decide whether - index terms are within the given range, rather than using the Unicode code - point order in which index terms are stored. -

    - WARNING: Using this constructor and supplying a non-null - value in the collator parameter will cause every single - index Term in the Field referenced by lowerTerm and/or upperTerm to be - examined. Depending on the number of index Terms in this Field, the - operation could be very slow. - -

    - The Term at the lower end of the range - - The Term at the upper end of the range - - If true, both lowerTerm and - upperTerm will themselves be included in the range. - - The collator to use to collate index Terms, to determine - their membership in the range bounded by lowerTerm and - upperTerm. - -
    - - Returns the field name for this query - - - Returns the lower term of this range query. - - - Returns the upper term of this range query. - - - Returns true if the range query is inclusive - - - Returns the collator used to determine range inclusion, if any. - - - Prints a user-readable version of this query. - - - Returns true iff o is equal to this. - - - Returns a hash code value for this object. - - - A Filter that restricts search results to a range of values in a given - field. - -

    This filter matches the documents looking for terms that fall into the - supplied range according to {@link String#compareTo(String)}. It is not intended - for numerical ranges, use {@link NumericRangeFilter} instead. - -

    If you construct a large number of range filters with different ranges but on the - same field, {@link FieldCacheRangeFilter} may have significantly better performance. - -

    - Use {@link TermRangeFilter} for term ranges or - {@link NumericRangeFilter} for numeric ranges instead. - This class will be removed in Lucene 3.0. - -
    - - The field this range applies to - - The lower bound on this range - - The upper bound on this range - - Does this range include the lower bound? - - Does this range include the upper bound? - - IllegalArgumentException if both terms are null or if - lowerTerm is null and includeLower is true (similar for upperTerm - and includeUpper) - - - - WARNING: Using this constructor and supplying a non-null - value in the collator parameter will cause every single - index Term in the Field referenced by lowerTerm and/or upperTerm to be - examined. Depending on the number of index Terms in this Field, the - operation could be very slow. - - - The lower bound on this range - - The upper bound on this range - - Does this range include the lower bound? - - Does this range include the upper bound? - - The collator to use when determining range inclusion; set - to null to use Unicode code point ordering instead of collation. - - IllegalArgumentException if both terms are null or if - lowerTerm is null and includeLower is true (similar for upperTerm - and includeUpper) - - - - Constructs a filter for field fieldName matching - less than or equal to upperTerm. - - - - Constructs a filter for field fieldName matching - greater than or equal to lowerTerm. - - - - A {@link Collector} implementation which wraps another - {@link Collector} and makes sure only documents with - scores > 0 are collected. - - - - This class is very similar to - {@link Lucene.Net.Search.Spans.SpanTermQuery} except that it factors - in the value of the payload located at each of the positions where the - {@link Lucene.Net.Index.Term} occurs. -

    - In order to take advantage of this, you must override - {@link Lucene.Net.Search.Similarity#ScorePayload(String, byte[],int,int)} - which returns 1 by default. -

    - Payload scores are aggregated using a pluggable {@link PayloadFunction}. - -

    -
    - - - {@link #GetSpanScore()} * {@link #GetPayloadScore()} - - IOException - - - Returns the SpanScorer score only. -

    - Should not be overriden without good cause! - -

    - the score for just the Span part w/o the payload - - IOException - - - - -
    - - The score for the payload - - - The score, as calculated by - {@link PayloadFunction#DocScore(int, String, int, float)} - - - - Calculate the final score as the average score of all payloads seen. -

    - Is thread safe and completely reusable. - - -

    -
    - - Expert: Collects sorted results from Searchable's and collates them. - The elements put into this queue must be of type FieldDoc. - -

    Created: Feb 11, 2004 2:04:21 PM - -

    - lucene 1.4 - - $Id: FieldDocSortedHitQueue.java 695514 2008-09-15 15:42:11Z otis $ - -
    - - Creates a hit queue sorted by the given list of fields. - Fieldable names, in priority order (highest priority first). - - The number of hits to retain. Must be greater than zero. - - - - Allows redefinition of sort fields if they are null. - This is to handle the case using ParallelMultiSearcher where the - original list contains AUTO and we don't know the actual sort - type until the values come back. The fields can only be set once. - This method is thread safe. - - - - - - Returns the fields being used to sort. - - - Returns an array of collators, possibly null. The collators - correspond to any SortFields which were given a specific locale. - - Array of sort fields. - - Array, possibly null. - - - - Returns whether a is less relevant than b. - ScoreDoc - - ScoreDoc - - true if document a should be sorted after document b. - - - - A Query that matches documents matching boolean combinations of other - queries, e.g. {@link TermQuery}s, {@link PhraseQuery}s or other - BooleanQuerys. - - - - Return the maximum number of clauses permitted, 1024 by default. - Attempts to add more than the permitted number of clauses cause {@link - TooManyClauses} to be thrown. - - - - - - Set the maximum number of clauses permitted per BooleanQuery. - Default value is 1024. - - - - Constructs an empty boolean query. - - - Constructs an empty boolean query. - - {@link Similarity#Coord(int,int)} may be disabled in scoring, as - appropriate. For example, this score factor does not make sense for most - automatically generated queries, like {@link WildcardQuery} and {@link - FuzzyQuery}. - - - disables {@link Similarity#Coord(int,int)} in scoring. - - - - Returns true iff {@link Similarity#Coord(int,int)} is disabled in - scoring for this query instance. - - - - - - Specifies a minimum number of the optional BooleanClauses - which must be satisfied. - -

    - By default no optional clauses are necessary for a match - (unless there are no required clauses). If this method is used, - then the specified number of clauses is required. -

    -

    - Use of this method is totally independent of specifying that - any specific clauses are required (or prohibited). This number will - only be compared against the number of matching optional clauses. -

    -

    - EXPERT NOTE: Using this method may force collecting docs in order, - regardless of whether setAllowDocsOutOfOrder(true) has been called. -

    - -

    - the number of optional clauses that must match - - - -
    - - Gets the minimum number of the optional BooleanClauses - which must be satisifed. - - - - Adds a clause to a boolean query. - - - TooManyClauses if the new number of clauses exceeds the maximum clause number - - - - - Adds a clause to a boolean query. - TooManyClauses if the new number of clauses exceeds the maximum clause number - - - - - Returns the set of clauses in this query. - - - Returns the list of clauses in this query. - - - Whether hit docs may be collected out of docid order. - - - this will not be needed anymore, as - {@link Weight#ScoresDocsOutOfOrder()} is used. - - - - Expert: Indicates whether hit docs may be collected out of docid order. - -

    - Background: although the contract of the Scorer class requires that - documents be iterated in order of doc id, this was not true in early - versions of Lucene. Many pieces of functionality in the current Lucene code - base have undefined behavior if this contract is not upheld, but in some - specific simple cases may be faster. (For example: disjunction queries with - less than 32 prohibited clauses; This setting has no effect for other - queries.) -

    - -

    - Specifics: By setting this option to true, docid N might be scored for a - single segment before docid N-1. Across multiple segments, docs may be - scored out of order regardless of this setting - it only applies to scoring - a single segment. - - Being static, this setting is system wide. -

    - -

    - this is not needed anymore, as - {@link Weight#ScoresDocsOutOfOrder()} is used. - -
    - - Whether hit docs may be collected out of docid order. - - - - - this is not needed anymore, as - {@link Weight#ScoresDocsOutOfOrder()} is used. - - - - Use {@link #SetAllowDocsOutOfOrder(boolean)} instead. - - - - Use {@link #GetAllowDocsOutOfOrder()} instead. - - - - Prints a user-readable version of this query. - - - Returns true iff o is equal to this. - - - Returns a hash code value for this object. - - - Thrown when an attempt is made to add more than {@link - #GetMaxClauseCount()} clauses. This typically happens if - a PrefixQuery, FuzzyQuery, WildcardQuery, or TermRangeQuery - is expanded to many terms during search. - - - - Expert: the Weight for BooleanQuery, used to - normalize, score and explain these queries. - -

    NOTE: this API and implementation is subject to - change suddenly in the next release.

    -

    -
    - - The Similarity implementation. - - - This class implements {@link InvertedDocConsumer}, which - is passed each token produced by the analyzer on each - field. It stores these tokens in a hash table, and - allocates separate byte streams per token. Consumers of - this class, eg {@link FreqProxTermsWriter} and {@link - TermVectorsTermsWriter}, write their own byte streams - under each term. - - - - Add a new thread - - - Abort (called after hitting AbortException) - - - Flush a new segment - - - Close doc stores - - - Attempt to free RAM, returning true if any RAM was - freed - - - - This is a DocFieldConsumer that writes stored fields. - - - Fills in any hole in the docIDs - - - $Id - -

    NOTE: This API is new and still experimental - (subject to change suddenly in the next release)

    -

    -
    - - The class which implements SegmentReader. - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Clones the norm bytes. May be overridden by subclasses. New and experimental. - Byte array to clone - - New BitVector - - - - Clones the deleteDocs BitVector. May be overridden by subclasses. New and experimental. - BitVector to clone - - New BitVector - - - - - - - - - - - - Read norms into a pre-allocated array. - - - Create a clone from the initial TermVectorsReader and store it in the ThreadLocal. - TermVectorsReader - - - - Return a term frequency vector for the specified document and field. The - vector returned contains term numbers and frequencies for all terms in - the specified field of this document, if the field had storeTermVector - flag set. If the flag was not set, the method returns null. - - IOException - - - Return an array of term frequency vectors for the specified document. - The array contains a vector for each vectorized field in the document. - Each vector vector contains term numbers and frequencies for all terms - in a given vectorized field. - If no such fields existed, the method returns null. - - IOException - - - Return the name of the segment this reader is reading. - - - Return the SegmentInfo of the segment this reader is reading. - - - Returns the directory this index resides in. - - - Lotsa tests did hacks like:
    - SegmentReader reader = (SegmentReader) IndexReader.open(dir);
    - They broke. This method serves as a hack to keep hacks working -
    -
    - - Sets the initial value - - - Java's builtin ThreadLocal has a serious flaw: - it can take an arbitrarily long amount of time to - dereference the things you had stored in it, even once the - ThreadLocal instance itself is no longer referenced. - This is because there is single, master map stored for - each thread, which all ThreadLocals share, and that - master map only periodically purges "stale" entries. - - While not technically a memory leak, because eventually - the memory will be reclaimed, it can take a long time - and you can easily hit OutOfMemoryError because from the - GC's standpoint the stale entries are not reclaimaible. - - This class works around that, by only enrolling - WeakReference values into the ThreadLocal, and - separately holding a hard reference to each stored - value. When you call {@link #close}, these hard - references are cleared and then GC is freely able to - reclaim space by objects stored in it. - - - - - Byte[] referencing is used because a new norm object needs - to be created for each clone, and the byte array is all - that is needed for sharing between cloned readers. The - current norm referencing is for sharing between readers - whereas the byte[] referencing is for copy on write which - is independent of reader references (i.e. incRef, decRef). - - - - Used by DocumentsWriter to merge the postings from - multiple ThreadStates when creating a segment - - - - Implements the skip list writer for the default posting list format - that stores positions and payloads. - - - - - This abstract class writes skip lists with multiple levels. - - Example for skipInterval = 3: - c (skip level 2) - c c c (skip level 1) - x x x x x x x x x x (skip level 0) - d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d d (posting list) - 3 6 9 12 15 18 21 24 27 30 (df) - - d - document - x - skip data - c - skip data with child pointer - - Skip level i contains every skipInterval-th entry from skip level i-1. - Therefore the number of entries on level i is: floor(df / ((skipInterval ^ (i + 1))). - - Each skip entry on a level i>0 contains a pointer to the corresponding skip entry in list i-1. - This guarantess a logarithmic amount of skips to find the target document. - - While this class takes care of writing the different skip levels, - subclasses must define the actual format of the skip data. - - - - - Subclasses must implement the actual skip data encoding in this method. - - - the level skip data shall be writting for - - the skip buffer to write to - - - - Writes the current skip data to the buffers. The current document frequency determines - the max level is skip data is to be written to. - - - the current document frequency - - IOException - - - Writes the buffered skip lists to the given output. - - - the IndexOutput the skip lists shall be written to - - the pointer the skip list starts - - - - Sets the values for the current skip data. - - - This exception is thrown when Lucene detects - an inconsistency in the index. - - - - Basic tool and API to check the health of an index and - write a new segments file that removes reference to - problematic segments. - -

    As this tool checks every byte in the index, on a large - index it can take quite a long time to run. - -

    WARNING: this tool and API is new and - experimental and is subject to suddenly change in the - next release. Please make a complete backup of your - index before using this to fix your index! -

    -
    - - Default PrintStream for all CheckIndex instances. - Use {@link #setInfoStream} per instance, - instead. - - - - Create a new CheckIndex on the directory. - - - Set infoStream where messages should go. If null, no - messages are printed - - - - Returns true if index is clean, else false. - Please instantiate a CheckIndex and then use {@link #CheckIndex()} instead - - - - Returns true if index is clean, else false. - Please instantiate a CheckIndex and then use {@link #CheckIndex(List)} instead - - - - Returns a {@link Status} instance detailing - the state of the index. - -

    As this method checks every byte in the index, on a large - index it can take quite a long time to run. - -

    WARNING: make sure - you only call this when the index is not opened by any - writer. -

    -
    - - Returns a {@link Status} instance detailing - the state of the index. - - - list of specific segment names to check - -

    As this method checks every byte in the specified - segments, on a large index it can take quite a long - time to run. - -

    WARNING: make sure - you only call this when the index is not opened by any - writer. - - - -

    Test field norms. -
    - - Test the term index. - - - Test stored fields for a segment. - - - Test term vectors for a segment. - - - Repairs the index using previously returned result - from {@link #checkIndex}. Note that this does not - remove any of the unreferenced files after it's done; - you must separately open an {@link IndexWriter}, which - deletes unreferenced files when it's created. - -

    WARNING: this writes a - new segments file into the index, effectively removing - all documents in broken segments from the index. - BE CAREFUL. - -

    WARNING: Make sure you only call this when the - index is not opened by any writer. -

    -
    - - Command-line interface to check and fix an index. -

    - Run it like this: -

    -            java -ea:Lucene.Net... Lucene.Net.Index.CheckIndex pathToIndex [-fix] [-segment X] [-segment Y]
    -            
    -
      -
    • -fix: actually write a new segments_N file, removing any problematic segments
    • -
    • -segment X: only check the specified - segment(s). This can be specified multiple times, - to check more than one segment, eg -segment _2 - -segment _a. You can't use this with the -fix - option.
    • -
    -

    WARNING: -fix should only be used on an emergency basis as it will cause - documents (perhaps many) to be permanently removed from the index. Always make - a backup copy of your index before running this! Do not run this tool on an index - that is actively being written to. You have been warned! -

    Run without -fix, this tool will open the index, report version information - and report any exceptions it hits and what action it would take if -fix were - specified. With -fix, this tool will remove any segments that have issues and - write a new segments_N file. This means all documents contained in the affected - segments will be removed. -

    - This tool exits with exit code 1 if the index cannot be opened or has any - corruption, else 0. -

    -
    - - Returned from {@link #CheckIndex()} detailing the health and status of the index. - -

    WARNING: this API is new and experimental and is - subject to suddenly change in the next release. - -

    -
    - - True if no problems were found with the index. - - - True if we were unable to locate and load the segments_N file. - - - True if we were unable to open the segments_N file. - - - True if we were unable to read the version number from segments_N file. - - - Name of latest segments_N file in the index. - - - Number of segments in the index. - - - String description of the version of the index. - - - Empty unless you passed specific segments list to check as optional 3rd argument. - - - - - True if the index was created with a newer version of Lucene than the CheckIndex tool. - - - List of {@link SegmentInfoStatus} instances, detailing status of each segment. - - - Directory index is in. - - - SegmentInfos instance containing only segments that - had no problems (this is used with the {@link CheckIndex#fixIndex} - method to repair the index. - - - - How many documents will be lost to bad segments. - - - How many bad segments were found. - - - True if we checked only specific segments ({@link - #CheckIndex(List)}) was called with non-null - argument). - - - - Holds the userData of the last commit in the index - - - Holds the status of each segment in the index. - See {@link #segmentInfos}. - -

    WARNING: this API is new and experimental and is - subject to suddenly change in the next release. -

    -
    - - Name of the segment. - - - Document count (does not take deletions into account). - - - True if segment is compound file format. - - - Number of files referenced by this segment. - - - Net size (MB) of the files referenced by this - segment. - - - - Doc store offset, if this segment shares the doc - store files (stored fields and term vectors) with - other segments. This is -1 if it does not share. - - - - String of the shared doc store segment, or null if - this segment does not share the doc store files. - - - - True if the shared doc store files are compound file - format. - - - - True if this segment has pending deletions. - - - Name of the current deletions file name. - - - Number of deleted documents. - - - True if we were able to open a SegmentReader on this - segment. - - - - Number of fields in this segment. - - - True if at least one of the fields in this segment - does not omitTermFreqAndPositions. - - - - - - Map<String, String> that includes certain - debugging details that IndexWriter records into - each segment it creates - - - - Status for testing of field norms (null if field norms could not be tested). - - - Status for testing of indexed terms (null if indexed terms could not be tested). - - - Status for testing of stored fields (null if stored fields could not be tested). - - - Status for testing of term vectors (null if term vectors could not be tested). - - - Status from testing field norms. - - - Number of fields successfully tested - - - Exception thrown during term index test (null on success) - - - Status from testing term index. - - - Total term count - - - Total frequency across all terms. - - - Total number of positions. - - - Exception thrown during term index test (null on success) - - - Status from testing stored fields. - - - Number of documents tested. - - - Total number of stored fields tested. - - - Exception thrown during stored fields test (null on success) - - - Status from testing stored fields. - - - Number of documents tested. - - - Total number of term vectors tested. - - - Exception thrown during term vector test (null on success) - - - Holds buffered deletes, by docID, term or query. We - hold two instances of this class: one for the deletes - prior to the last flush, the other for deletes after - the last flush. This is so if we need to abort - (discard all buffered docs) we can also discard the - buffered deletes yet keep the deletes done during - previously flushed segments. - - - - Synonymous with {@link Field}. - -

    WARNING: This interface may change within minor versions, despite Lucene's backward compatibility requirements. - This means new methods may be added from version to version. This change only affects the Fieldable API; other backwards - compatibility promises remain intact. For example, Lucene can still - read and write indices created within the same major version. -

    - - -

    -
    - - Sets the boost factor hits on this field. This value will be - multiplied into the score of all hits on this this field of this - document. - -

    The boost is multiplied by {@link Lucene.Net.Documents.Document#GetBoost()} of the document - containing this field. If a document has multiple fields with the same - name, all such values are multiplied together. This product is then - used to compute the norm factor for the field. By - default, in the {@link - Lucene.Net.Search.Similarity#ComputeNorm(String, - FieldInvertState)} method, the boost value is multiplied - by the {@link - Lucene.Net.Search.Similarity#LengthNorm(String, - int)} and then rounded by {@link Lucene.Net.Search.Similarity#EncodeNorm(float)} before it is stored in the - index. One should attempt to ensure that this product does not overflow - the range of that encoding. - -

    - - - - - - -
    - - Returns the boost factor for hits for this field. - -

    The default value is 1.0. - -

    Note: this value is not stored directly with the document in the index. - Documents returned from {@link Lucene.Net.Index.IndexReader#Document(int)} and - {@link Lucene.Net.Search.Hits#Doc(int)} may thus not have the same value present as when - this field was indexed. - -

    - - -
    - - Returns the name of the field as an interned string. - For example "date", "title", "body", ... - - - - The value of the field as a String, or null. -

    - For indexing, if isStored()==true, the stringValue() will be used as the stored field value - unless isBinary()==true, in which case binaryValue() will be used. - - If isIndexed()==true and isTokenized()==false, this String value will be indexed as a single token. - If isIndexed()==true and isTokenized()==true, then tokenStreamValue() will be used to generate indexed tokens if not null, - else readerValue() will be used to generate indexed tokens if not null, else stringValue() will be used to generate tokens. -

    -
    - - The value of the field as a Reader, which can be used at index time to generate indexed tokens. - - - - - The value of the field in Binary, or null. - - - - - The TokenStream for this field to be used when indexing, or null. - - - - - True if the value of the field is to be stored in the index for return - with search hits. - - - - True if the value of the field is to be indexed, so that it may be - searched on. - - - - True if the value of the field should be tokenized as text prior to - indexing. Un-tokenized fields are indexed as a single word and may not be - Reader-valued. - - - - True if the value of the field is stored and compressed within the index - - - True if the term or terms used to index this field are stored as a term - vector, available from {@link Lucene.Net.Index.IndexReader#GetTermFreqVector(int,String)}. - These methods do not provide access to the original content of the field, - only to terms used to index it. If the original content must be - preserved, use the stored attribute instead. - - - - - - - True if terms are stored as term vector together with their offsets - (start and end positon in source text). - - - - True if terms are stored as term vector together with their token positions. - - - True if the value of the field is stored as binary - - - True if norms are omitted for this indexed field - - - Expert: - - If set, omit normalization factors associated with this indexed field. - This effectively disables indexing boosts and length normalization for this field. - - - - Renamed to {@link AbstractField#setOmitTermFreqAndPositions} - - - - Renamed to {@link AbstractField#getOmitTermFreqAndPositions} - - - - Indicates whether a Field is Lazy or not. The semantics of Lazy loading are such that if a Field is lazily loaded, retrieving - it's values via {@link #StringValue()} or {@link #BinaryValue()} is only valid as long as the {@link Lucene.Net.Index.IndexReader} that - retrieved the {@link Document} is still open. - - - true if this field can be loaded lazily - - - - Returns offset into byte[] segment that is used as value, if Field is not binary - returned value is undefined - - index of the first character in byte[] segment that represents this Field value - - - - Returns length of byte[] segment that is used as value, if Field is not binary - returned value is undefined - - length of byte[] segment that represents this Field value - - - - Return the raw byte[] for the binary field. Note that - you must also call {@link #getBinaryLength} and {@link - #getBinaryOffset} to know which range of bytes in this - returned array belong to the field. - - reference to the Field value as byte[]. - - - - Return the raw byte[] for the binary field. Note that - you must also call {@link #getBinaryLength} and {@link - #getBinaryOffset} to know which range of bytes in this - returned array belong to the field.

    - About reuse: if you pass in the result byte[] and it is - used, likely the underlying implementation will hold - onto this byte[] and return it in future calls to - {@link #BinaryValue()} or {@link #GetBinaryValue()}. - So if you subsequently re-use the same byte[] elsewhere - it will alter this Fieldable's value. -

    - User defined buffer that will be used if - possible. If this is null or not large enough, a new - buffer is allocated - - reference to the Field value as byte[]. - -
    - - A Token is an occurrence of a term from the text of a field. It consists of - a term's text, the start and end offset of the term in the text of the field, - and a type string. -

    - The start and end offsets permit applications to re-associate a token with - its source text, e.g., to display highlighted query terms in a document - browser, or to show matching text fragments in a KWIC display, etc. -

    - The type is a string, assigned by a lexical analyzer - (a.k.a. tokenizer), naming the lexical or syntactic class that the token - belongs to. For example an end of sentence marker token might be implemented - with type "eos". The default token type is "word". -

    - A Token can optionally have metadata (a.k.a. Payload) in the form of a variable - length byte array. Use {@link TermPositions#GetPayloadLength()} and - {@link TermPositions#GetPayload(byte[], int)} to retrieve the payloads from the index. -

    -

    -
    -

    NOTE: As of 2.9, Token implements all {@link Attribute} interfaces - that are part of core Lucene and can be found in the {@code tokenattributes} subpackage. - Even though it is not necessary to use Token anymore, with the new TokenStream API it can - be used as convenience class that implements all {@link Attribute}s, which is especially useful - to easily switch from the old to the new TokenStream API. -

    -

    -

    NOTE: As of 2.3, Token stores the term text - internally as a malleable char[] termBuffer instead of - String termText. The indexing code and core tokenizers - have been changed to re-use a single Token instance, changing - its buffer and other fields in-place as the Token is - processed. This provides substantially better indexing - performance as it saves the GC cost of new'ing a Token and - String for every term. The APIs that accept String - termText are still available but a warning about the - associated performance cost has been added (below). The - {@link #TermText()} method has been deprecated.

    -

    -

    Tokenizers and TokenFilters should try to re-use a Token instance when - possible for best performance, by implementing the - {@link TokenStream#IncrementToken()} API. - Failing that, to create a new Token you should first use - one of the constructors that starts with null text. To load - the token from a char[] use {@link #SetTermBuffer(char[], int, int)}. - To load from a String use {@link #SetTermBuffer(String)} or {@link #SetTermBuffer(String, int, int)}. - Alternatively you can get the Token's termBuffer by calling either {@link #TermBuffer()}, - if you know that your text is shorter than the capacity of the termBuffer - or {@link #ResizeTermBuffer(int)}, if there is any possibility - that you may need to grow the buffer. Fill in the characters of your term into this - buffer, with {@link String#getChars(int, int, char[], int)} if loading from a string, - or with {@link System#arraycopy(Object, int, Object, int, int)}, and finally call {@link #SetTermLength(int)} to - set the length of the term text. See LUCENE-969 - for details.

    -

    Typical Token reuse patterns: -

      -
    • Copying text from a string (type is reset to {@link #DEFAULT_TYPE} if not - specified):
      -
      -            return reusableToken.reinit(string, startOffset, endOffset[, type]);
      -            
      -
    • -
    • Copying some text from a string (type is reset to {@link #DEFAULT_TYPE} - if not specified):
      -
      -            return reusableToken.reinit(string, 0, string.length(), startOffset, endOffset[, type]);
      -            
      -
    • -
    • Copying text from char[] buffer (type is reset to {@link #DEFAULT_TYPE} - if not specified):
      -
      -            return reusableToken.reinit(buffer, 0, buffer.length, startOffset, endOffset[, type]);
      -            
      -
    • -
    • Copying some text from a char[] buffer (type is reset to - {@link #DEFAULT_TYPE} if not specified):
      -
      -            return reusableToken.reinit(buffer, start, end - start, startOffset, endOffset[, type]);
      -            
      -
    • -
    • Copying from one one Token to another (type is reset to - {@link #DEFAULT_TYPE} if not specified):
      -
      -            return reusableToken.reinit(source.termBuffer(), 0, source.termLength(), source.startOffset(), source.endOffset()[, source.type()]);
      -            
      -
    • -
    - A few things to note: -
      -
    • clear() initializes all of the fields to default values. This was changed in contrast to Lucene 2.4, but should affect no one.
    • -
    • Because TokenStreams can be chained, one cannot assume that the Token's current type is correct.
    • -
    • The startOffset and endOffset represent the start and offset in the - source text, so be careful in adjusting them.
    • -
    • When caching a reusable token, clone it. When injecting a cached token into a stream that can be reset, clone it again.
    • -
    -

    -

    - - -
    - - The term text of a Token. - - - Returns the Token's term text. - - This method has a performance penalty - because the text is stored internally in a char[]. If - possible, use {@link #TermBuffer()} and {@link - #TermLength()} directly instead. If you really need a - String, use this method, which is nothing more than - a convenience call to new String(token.termBuffer(), 0, token.termLength()) - - - - Copies the contents of buffer, starting at offset for - length characters, into the termBuffer array. - - the buffer to copy - - the index in the buffer of the first character to copy - - the number of characters to copy - - - - Copies the contents of buffer into the termBuffer array. - the buffer to copy - - - - Copies the contents of buffer, starting at offset and continuing - for length characters, into the termBuffer array. - - the buffer to copy - - the index in the buffer of the first character to copy - - the number of characters to copy - - - - Returns the internal termBuffer character array which - you can then directly alter. If the array is too - small for your token, use {@link - #ResizeTermBuffer(int)} to increase it. After - altering the buffer be sure to call {@link - #setTermLength} to record the number of valid - characters that were placed into the termBuffer. - - - - Grows the termBuffer to at least size newSize, preserving the - existing content. Note: If the next operation is to change - the contents of the term buffer use - {@link #SetTermBuffer(char[], int, int)}, - {@link #SetTermBuffer(String)}, or - {@link #SetTermBuffer(String, int, int)} - to optimally combine the resize with the setting of the termBuffer. - - minimum size of the new termBuffer - - newly created termBuffer with length >= newSize - - - - Return number of valid characters (length of the term) - in the termBuffer array. - - - - Set number of valid characters (length of the term) in - the termBuffer array. Use this to truncate the termBuffer - or to synchronize with external manipulation of the termBuffer. - Note: to grow the size of the array, - use {@link #ResizeTermBuffer(int)} first. - - the truncated length - - - - The positionIncrement determines the position of this token - relative to the previous Token in a TokenStream, used in phrase - searching. - -

    The default value is one. - -

    Some common uses for this are:

      - -
    • Set it to zero to put multiple terms in the same position. This is - useful if, e.g., a word has multiple stems. Searches for phrases - including either stem will match. In this case, all but the first stem's - increment should be set to zero: the increment of the first instance - should be one. Repeating a token with an increment of zero can also be - used to boost the scores of matches on that token.
    • - -
    • Set it to values greater than one to inhibit exact phrase matches. - If, for example, one does not want phrases to match across removed stop - words, then one could build a stop word filter that removes stop words and - also sets the increment to the number of stop words removed before each - non-stop word. Then exact phrase queries will only match when the terms - occur with no intervening stop words.
    • - -
    - -
    - - -
    - - Set the position increment. The default value is one. - - - the distance from the prior term - - - - Returns the position increment of this Token. - - - - - We will remove this when we remove the - deprecated APIs - - - - Characters for the term text. - This will be made private. Instead, use: - {@link #TermBuffer()}, - {@link #SetTermBuffer(char[], int, int)}, - {@link #SetTermBuffer(String)}, or - {@link #SetTermBuffer(String, int, int)} - - - - Length of term text in the buffer. - This will be made private. Instead, use: - {@link #TermLength()}, or @{link setTermLength(int)}. - - - - Start in source text. - This will be made private. Instead, use: - {@link #StartOffset()}, or @{link setStartOffset(int)}. - - - - End in source text. - This will be made private. Instead, use: - {@link #EndOffset()}, or @{link setEndOffset(int)}. - - - - The lexical type of the token. - This will be made private. Instead, use: - {@link #Type()}, or @{link setType(String)}. - - - - This will be made private. Instead, use: - {@link #GetPayload()}, or @{link setPayload(Payload)}. - - - - This will be made private. Instead, use: - {@link #GetPositionIncrement()}, or @{link setPositionIncrement(String)}. - - - - Constructs a Token will null text. - - - Constructs a Token with null text and start & end - offsets. - - start offset in the source text - - end offset in the source text - - - - Constructs a Token with null text and start & end - offsets plus the Token type. - - start offset in the source text - - end offset in the source text - - the lexical type of this Token - - - - Constructs a Token with null text and start & end - offsets plus flags. NOTE: flags is EXPERIMENTAL. - - start offset in the source text - - end offset in the source text - - The bits to set for this token - - - - Constructs a Token with the given term text, and start - & end offsets. The type defaults to "word." - NOTE: for better indexing speed you should - instead use the char[] termBuffer methods to set the - term text. - - term text - - start offset - - end offset - - - - Constructs a Token with the given text, start and end - offsets, & type. NOTE: for better indexing - speed you should instead use the char[] termBuffer - methods to set the term text. - - term text - - start offset - - end offset - - token type - - - - Constructs a Token with the given text, start and end - offsets, & type. NOTE: for better indexing - speed you should instead use the char[] termBuffer - methods to set the term text. - - - - - - - - token type bits - - - - Constructs a Token with the given term buffer (offset - & length), start and end - offsets - - - - - - - - - - - - - - Set the position increment. This determines the position of this token - relative to the previous Token in a {@link TokenStream}, used in phrase - searching. - -

    The default value is one. - -

    Some common uses for this are:

      - -
    • Set it to zero to put multiple terms in the same position. This is - useful if, e.g., a word has multiple stems. Searches for phrases - including either stem will match. In this case, all but the first stem's - increment should be set to zero: the increment of the first instance - should be one. Repeating a token with an increment of zero can also be - used to boost the scores of matches on that token.
    • - -
    • Set it to values greater than one to inhibit exact phrase matches. - If, for example, one does not want phrases to match across removed stop - words, then one could build a stop word filter that removes stop words and - also sets the increment to the number of stop words removed before each - non-stop word. Then exact phrase queries will only match when the terms - occur with no intervening stop words.
    • - -
    -
    - the distance from the prior term - - - -
    - - Returns the position increment of this Token. - - - - - Sets the Token's term text. NOTE: for better - indexing speed you should instead use the char[] - termBuffer methods to set the term text. - - use {@link #SetTermBuffer(char[], int, int)} or - {@link #SetTermBuffer(String)} or - {@link #SetTermBuffer(String, int, int)}. - - - - Returns the Token's term text. - - - This method now has a performance penalty - because the text is stored internally in a char[]. If - possible, use {@link #TermBuffer()} and {@link - #TermLength()} directly instead. If you really need a - String, use {@link #Term()} - - - - Returns the Token's term text. - - This method has a performance penalty - because the text is stored internally in a char[]. If - possible, use {@link #TermBuffer()} and {@link - #TermLength()} directly instead. If you really need a - String, use this method, which is nothing more than - a convenience call to new String(token.termBuffer(), 0, token.termLength()) - - - - Copies the contents of buffer, starting at offset for - length characters, into the termBuffer array. - - the buffer to copy - - the index in the buffer of the first character to copy - - the number of characters to copy - - - - Copies the contents of buffer into the termBuffer array. - the buffer to copy - - - - Copies the contents of buffer, starting at offset and continuing - for length characters, into the termBuffer array. - - the buffer to copy - - the index in the buffer of the first character to copy - - the number of characters to copy - - - - Returns the internal termBuffer character array which - you can then directly alter. If the array is too - small for your token, use {@link - #ResizeTermBuffer(int)} to increase it. After - altering the buffer be sure to call {@link - #setTermLength} to record the number of valid - characters that were placed into the termBuffer. - - - - Grows the termBuffer to at least size newSize, preserving the - existing content. Note: If the next operation is to change - the contents of the term buffer use - {@link #SetTermBuffer(char[], int, int)}, - {@link #SetTermBuffer(String)}, or - {@link #SetTermBuffer(String, int, int)} - to optimally combine the resize with the setting of the termBuffer. - - minimum size of the new termBuffer - - newly created termBuffer with length >= newSize - - - - Allocates a buffer char[] of at least newSize, without preserving the existing content. - its always used in places that set the content - - minimum size of the buffer - - - - Return number of valid characters (length of the term) - in the termBuffer array. - - - - Set number of valid characters (length of the term) in - the termBuffer array. Use this to truncate the termBuffer - or to synchronize with external manipulation of the termBuffer. - Note: to grow the size of the array, - use {@link #ResizeTermBuffer(int)} first. - - the truncated length - - - - Returns this Token's starting offset, the position of the first character - corresponding to this token in the source text. - Note that the difference between endOffset() and startOffset() may not be - equal to termText.length(), as the term text may have been altered by a - stemmer or some other filter. - - - - Set the starting offset. - - - - - Returns this Token's ending offset, one greater than the position of the - last character corresponding to this token in the source text. The length - of the token in the source text is (endOffset - startOffset). - - - - Set the ending offset. - - - - - Set the starting and ending offset. - See StartOffset() and EndOffset() - - - - Returns this Token's lexical type. Defaults to "word". - - - Set the lexical type. - - - - - EXPERIMENTAL: While we think this is here to stay, we may want to change it to be a long. -

    - - Get the bitset for any bits that have been set. This is completely distinct from {@link #Type()}, although they do share similar purposes. - The flags can be used to encode information about the token for use by other {@link Lucene.Net.Analysis.TokenFilter}s. - - -

    - The bits - -
    - - - - - - Returns this Token's payload. - - - Sets this Token's payload. - - - Resets the term text, payload, flags, and positionIncrement, - startOffset, endOffset and token type to default. - - - - Makes a clone, but replaces the term buffer & - start/end offset in the process. This is more - efficient than doing a full clone (and then calling - setTermBuffer) because it saves a wasted copy of the old - termBuffer. - - - - Shorthand for calling {@link #clear}, - {@link #SetTermBuffer(char[], int, int)}, - {@link #setStartOffset}, - {@link #setEndOffset}, - {@link #setType} - - this Token instance - - - - Shorthand for calling {@link #clear}, - {@link #SetTermBuffer(char[], int, int)}, - {@link #setStartOffset}, - {@link #setEndOffset} - {@link #setType} on Token.DEFAULT_TYPE - - this Token instance - - - - Shorthand for calling {@link #clear}, - {@link #SetTermBuffer(String)}, - {@link #setStartOffset}, - {@link #setEndOffset} - {@link #setType} - - this Token instance - - - - Shorthand for calling {@link #clear}, - {@link #SetTermBuffer(String, int, int)}, - {@link #setStartOffset}, - {@link #setEndOffset} - {@link #setType} - - this Token instance - - - - Shorthand for calling {@link #clear}, - {@link #SetTermBuffer(String)}, - {@link #setStartOffset}, - {@link #setEndOffset} - {@link #setType} on Token.DEFAULT_TYPE - - this Token instance - - - - Shorthand for calling {@link #clear}, - {@link #SetTermBuffer(String, int, int)}, - {@link #setStartOffset}, - {@link #setEndOffset} - {@link #setType} on Token.DEFAULT_TYPE - - this Token instance - - - - Copy the prototype token's fields into this one. Note: Payloads are shared. - - - - - Copy the prototype token's fields into this one, with a different term. Note: Payloads are shared. - - - - - - - Copy the prototype token's fields into this one, with a different term. Note: Payloads are shared. - - - - - - - - - - - Transforms the token stream as per the Porter stemming algorithm. - Note: the input to the stemming filter must already be in lower case, - so you will need to use LowerCaseFilter or LowerCaseTokenizer farther - down the Tokenizer chain in order for this to work properly! -

    - To use this filter with other analyzers, you'll want to write an - Analyzer class that sets up the TokenStream chain as you want it. - To use this with LowerCaseTokenizer, for example, you'd write an - analyzer like this: -

    -

    -            class MyAnalyzer extends Analyzer {
    -            public final TokenStream tokenStream(String fieldName, Reader reader) {
    -            return new PorterStemFilter(new LowerCaseTokenizer(reader));
    -            }
    -            }
    -            
    -
    -
    - - "Tokenizes" the entire stream as a single token. This is useful - for data like zip codes, ids, and some product names. - - - - A filter that replaces accented characters in the ISO Latin 1 character set - (ISO-8859-1) by their unaccented equivalent. The case will not be altered. -

    - For instance, 'À' will be replaced by 'a'. -

    - -

    - in favor of {@link ASCIIFoldingFilter} which covers a superset - of Latin 1. This class will be removed in Lucene 3.0. - -
    - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - To replace accented characters in a String by unaccented equivalents. - - - A simple class that stores Strings as char[]'s in a - hash table. Note that this is not a general purpose - class. For example, it cannot remove items from the - set, nor does it resize its hash table to be smaller, - etc. It is designed to be quick to test if a char[] - is in the set without the necessity of converting it - to a String first. - - - - Create set with enough capacity to hold startSize - terms - - - - Create set from a Collection of char[] or String - - - Create set from entries - - - true if the len chars of text starting at off - are in the set - - - - true if the System.String is in the set - - - Returns true if the String is in the set - - - Add this String into the set - - - Add this char[] directly to the set. - If ignoreCase is true for this Set, the text array will be directly modified. - The user should never modify this text array after calling this method. - - - - Returns an unmodifiable {@link CharArraySet}. This allows to provide - unmodifiable views of internal sets for "read-only" use. - - - a set for which the unmodifiable set is returned. - - an new unmodifiable {@link CharArraySet}. - - NullPointerException - if the given set is null. - - - - Adds all of the elements in the specified collection to this collection - - - Removes all elements from the set - - - Removes from this set all of its elements that are contained in the specified collection - - - Retains only the elements in this set that are contained in the specified collection - - - The Iterator<String> for this set. Strings are constructed on the fly, so - use nextCharArray for more efficient access. - - - - do not modify the returned char[] - - - Returns the next String, as a Set<String> would... - use nextCharArray() for better efficiency. - - - - Efficient unmodifiable {@link CharArraySet}. This implementation does not - delegate calls to a give {@link CharArraySet} like - {@link Collections#UnmodifiableSet(java.util.Set)} does. Instead is passes - the internal representation of a {@link CharArraySet} to a super - constructor and overrides all mutators. - - - - Use by certain classes to match version compatibility - across releases of Lucene. -

    - WARNING: When changing the version parameter - that you supply to components in Lucene, do not simply - change the version at search-time, but instead also adjust - your indexing code to match, and re-index. -

    -
    - - -

    WARNING: if you use this setting, and then - upgrade to a newer release of Lucene, sizable changes - may happen. If precise back compatibility is important - then you should instead explicitly specify an actual - version. - If you use this constant then you may need to - re-index all of your documents when upgrading - Lucene, as the way text is indexed may have changed. - Additionally, you may need to re-test your entire - application to ensure it behaves as expected, as - some defaults may have changed and may break functionality - in your application. -

    -
    - - Match settings and bugs in Lucene's 2.0 release. - - - Match settings and bugs in Lucene's 2.1 release. - - - Match settings and bugs in Lucene's 2.2 release. - - - Match settings and bugs in Lucene's 2.3 release. - - - Match settings and bugs in Lucene's 2.3 release. - - - - An average, best guess, MemoryModel that should work okay on most systems. - - - - - Returns primitive memory sizes for estimating RAM usage. - - - - - size of array beyond contents - - - - Class size overhead - - - - a primitive Class - bool, byte, char, short, long, float, - short, double, int - - the size in bytes of given primitive Class - - - - size of reference - - - - Writes bytes through to a primary IndexOutput, computing - checksum. Note that you cannot use seek(). - - - - Starts but does not complete the commit of this file (= - writing of the final checksum at the end). After this - is called must call {@link #finishCommit} and the - {@link #close} to complete the commit. - - - - See {@link #prepareCommit} - - - Expert: A Scorer for documents matching a Term. - - - Construct a TermScorer. - - - The weight of the Term in the query. - - An iterator over the documents matching the Term. - - The Similarity implementation to be used for score - computations. - - The field norms of the document fields for the Term. - - - - use {@link #Score(Collector)} instead. - - - - use {@link #Score(Collector, int, int)} instead. - - - - use {@link #DocID()} instead. - - - - Advances to the next document matching the query.
    - The iterator over the matching documents is buffered using - {@link TermDocs#Read(int[],int[])}. - -
    - true iff there is another document matching the query. - - use {@link #NextDoc()} instead. - -
    - - Advances to the next document matching the query.
    - The iterator over the matching documents is buffered using - {@link TermDocs#Read(int[],int[])}. - -
    - the document matching the query or -1 if there are no more documents. - -
    - - Skips to the first match beyond the current whose document number is - greater than or equal to a given target.
    - The implementation uses {@link TermDocs#SkipTo(int)}. - -
    - The target document number. - - true iff there is such a match. - - use {@link #Advance(int)} instead. - -
    - - Advances to the first match beyond the current whose document number is - greater than or equal to a given target.
    - The implementation uses {@link TermDocs#SkipTo(int)}. - -
    - The target document number. - - the matching document or -1 if none exist. - -
    - - Returns an explanation of the score for a document. -
    When this method is used, the {@link #Next()} method - and the {@link #Score(HitCollector)} method should not be used. -
    - The document number for the explanation. - -
    - - Returns a string representation of this TermScorer. - - -

    Wrapper to allow {@link SpanQuery} objects participate in composite - single-field SpanQueries by 'lying' about their search field. That is, - the masked SpanQuery will function as normal, - but {@link SpanQuery#GetField()} simply hands back the value supplied - in this class's constructor.

    - -

    This can be used to support Queries like {@link SpanNearQuery} or - {@link SpanOrQuery} across different fields, which is not ordinarily - permitted.

    - -

    This can be useful for denormalized relational data: for example, when - indexing a document with conceptually many 'children':

    - -

    -            teacherid: 1
    -            studentfirstname: james
    -            studentsurname: jones
    -            
    -            teacherid: 2
    -            studenfirstname: james
    -            studentsurname: smith
    -            studentfirstname: sally
    -            studentsurname: jones
    -            
    - -

    a SpanNearQuery with a slop of 0 can be applied across two - {@link SpanTermQuery} objects as follows: -

    -            SpanQuery q1  = new SpanTermQuery(new Term("studentfirstname", "james"));
    -            SpanQuery q2  = new SpanTermQuery(new Term("studentsurname", "jones"));
    -            SpanQuery q2m new FieldMaskingSpanQuery(q2, "studentfirstname");
    -            Query q = new SpanNearQuery(new SpanQuery[]{q1, q2m}, -1, false);
    -            
    - to search for 'studentfirstname:james studentsurname:jones' and find - teacherid 1 without matching teacherid 2 (which has a 'james' in position 0 - and 'jones' in position 1).

    - -

    Note: as {@link #GetField()} returns the masked field, scoring will be - done using the norms of the field name supplied. This may lead to unexpected - scoring behaviour.

    -

    -
    - - use {@link #ExtractTerms(Set)} instead. - - - - The BoostingTermQuery is very similar to the {@link Lucene.Net.Search.Spans.SpanTermQuery} except - that it factors in the value of the payload located at each of the positions where the - {@link Lucene.Net.Index.Term} occurs. -

    - In order to take advantage of this, you must override {@link Lucene.Net.Search.Similarity#ScorePayload(String, byte[],int,int)} - which returns 1 by default. -

    - Payload scores are averaged across term occurrences in the document. - -

    - - - - See {@link Lucene.Net.Search.Payloads.PayloadTermQuery} - -
    - - MultiPhraseQuery is a generalized version of PhraseQuery, with an added - method {@link #Add(Term[])}. - To use this class, to search for the phrase "Microsoft app*" first use - add(Term) on the term "Microsoft", then find all terms that have "app" as - prefix using IndexReader.terms(Term), and use MultiPhraseQuery.add(Term[] - terms) to add them to the query. - - - 1.0 - - - - Sets the phrase slop for this query. - - - - - Sets the phrase slop for this query. - - - - - Add a single term at the next position in the phrase. - - - - - Add multiple terms at the next position in the phrase. Any of the terms - may match. - - - - - - - Allows to specify the relative position of terms within the phrase. - - - - - - - - - - - Returns a List<Term[]> of the terms in the multiphrase. - Do not modify the List or its contents. - - - - Returns the relative positions of terms in this phrase. - - - Prints a user-readable version of this query. - - - Returns true if o is equal to this. - - - Returns a hash code value for this object. - - - Store a sorted collection of {@link Lucene.Net.Index.TermVectorEntry}s. Collects all term information - into a single, SortedSet. -
    - NOTE: This Mapper ignores all Field information for the Document. This means that if you are using offset/positions you will not - know what Fields they correlate with. -
    - This is not thread-safe -
    -
    - - Stand-in name for the field in {@link TermVectorEntry}. - - - - A Comparator for sorting {@link TermVectorEntry}s - - - - - The term to map - - The frequency of the term - - Offset information, may be null - - Position information, may be null - - - - The TermVectorEntrySet. A SortedSet of {@link TermVectorEntry} objects. Sort is by the comparator passed into the constructor. -
    - This set will be empty until after the mapping process takes place. - -
    - The SortedSet of {@link TermVectorEntry}. - -
    - - - The number of the field this vector is associated with - - - - Extends TermFreqVector to provide additional information about - positions in which each of the terms is found. A TermPositionVector not necessarily - contains both positions and offsets, but at least one of these arrays exists. - - - - Returns an array of positions in which the term is found. - Terms are identified by the index at which its number appears in the - term String array obtained from the indexOf method. - May return null if positions have not been stored. - - - - Returns an array of TermVectorOffsetInfo in which the term is found. - May return null if offsets have not been stored. - - - - - - The position in the array to get the offsets from - - An array of TermVectorOffsetInfo objects or the empty list - - - - Returns an array of TermVectorOffsetInfo in which the term is found. - - - The position in the array to get the offsets from - - An array of TermVectorOffsetInfo objects or the empty list - - - - - - Returns an array of positions in which the term is found. - Terms are identified by the index at which its number appears in the - term String array obtained from the indexOf method. - - - - Information about a segment such as it's name, directory, and files related - to the segment. - - *

    NOTE: This API is new and still experimental - (subject to change suddenly in the next release)

    -

    -
    - - Copy everything from src SegmentInfo into our instance. - - - Construct a new SegmentInfo instance by reading a - previously saved SegmentInfo from input. - - - directory to load from - - format of the segments info file - - input handle to read segment info from - - - - Returns total size in bytes of all of files used by - this segment. - - - - Returns true if this field for this segment has saved a separate norms file (_<segment>_N.sX). - - - the field index to check - - - - Returns true if any fields in this segment have separate norms. - - - Increment the generation count for the norms file for - this field. - - - field whose norm file will be rewritten - - - - Get the file name for the norms file for this field. - - - field index - - - - Mark whether this segment is stored as a compound file. - - - true if this is a compound file; - else, false - - - - Returns true if this segment is stored as a compound - file; else, false. - - - - Save this segment's info. - - - Used for debugging - - - We consider another SegmentInfo instance equal if it - has the same dir and same name. - - - - Access to the Fieldable Info file that describes document fields and whether or - not they are indexed. Each segment has a separate Fieldable Info file. Objects - of this class are thread-safe for multiple readers, but only one thread can - be adding documents at a time, with no other reader or writer threads - accessing this object. - - - - Construct a FieldInfos object using the directory and the name of the file - IndexInput - - The directory to open the IndexInput from - - The name of the file to open the IndexInput from in the Directory - - IOException - - - Returns a deep clone of this FieldInfos instance. - - - Adds field info for a Document. - - - Returns true if any fields do not omitTermFreqAndPositions - - - Add fields that are indexed. Whether they have termvectors has to be specified. - - - The names of the fields - - Whether the fields store term vectors or not - - true if positions should be stored. - - true if offsets should be stored - - - - Assumes the fields are not storing term vectors. - - - The names of the fields - - Whether the fields are indexed or not - - - - - - - Calls 5 parameter add with false for all TermVector parameters. - - - The name of the Fieldable - - true if the field is indexed - - - - - - Calls 5 parameter add with false for term vector positions and offsets. - - - The name of the field - - true if the field is indexed - - true if the term vector should be stored - - - - If the field is not yet known, adds it. If it is known, checks to make - sure that the isIndexed flag is the same as was given previously for this - field. If not - marks it as being indexed. Same goes for the TermVector - parameters. - - - The name of the field - - true if the field is indexed - - true if the term vector should be stored - - true if the term vector with positions should be stored - - true if the term vector with offsets should be stored - - - - If the field is not yet known, adds it. If it is known, checks to make - sure that the isIndexed flag is the same as was given previously for this - field. If not - marks it as being indexed. Same goes for the TermVector - parameters. - - - The name of the field - - true if the field is indexed - - true if the term vector should be stored - - true if the term vector with positions should be stored - - true if the term vector with offsets should be stored - - true if the norms for the indexed field should be omitted - - - - If the field is not yet known, adds it. If it is known, checks to make - sure that the isIndexed flag is the same as was given previously for this - field. If not - marks it as being indexed. Same goes for the TermVector - parameters. - - - The name of the field - - true if the field is indexed - - true if the term vector should be stored - - true if the term vector with positions should be stored - - true if the term vector with offsets should be stored - - true if the norms for the indexed field should be omitted - - true if payloads should be stored for this field - - true if term freqs should be omitted for this field - - - - Return the fieldName identified by its number. - - - - - the fieldName or an empty string when the field - with the given number doesn't exist. - - - - Return the fieldinfo object referenced by the fieldNumber. - - - the FieldInfo object or null when the given fieldNumber - doesn't exist. - - - - Holds all per thread, per field state. - - - This analyzer is used to facilitate scenarios where different - fields require different analysis techniques. Use {@link #addAnalyzer} - to add a non-default analyzer on a field name basis. - -

    Example usage: - -

    -            PerFieldAnalyzerWrapper aWrapper =
    -            new PerFieldAnalyzerWrapper(new StandardAnalyzer());
    -            aWrapper.addAnalyzer("firstname", new KeywordAnalyzer());
    -            aWrapper.addAnalyzer("lastname", new KeywordAnalyzer());
    -            
    - -

    In this example, StandardAnalyzer will be used for all fields except "firstname" - and "lastname", for which KeywordAnalyzer will be used. - -

    A PerFieldAnalyzerWrapper can be used like any other analyzer, for both indexing - and query parsing. -

    -
    - - Constructs with default analyzer. - - - Any fields not specifically - defined to use a different analyzer will use the one provided here. - - - - Constructs with default analyzer and a map of analyzers to use for - specific fields. - - - Any fields not specifically - defined to use a different analyzer will use the one provided here. - - a Map (String field name to the Analyzer) to be - used for those fields - - - - Defines an analyzer to use for the specified field. - - - field name requiring a non-default analyzer - - non-default analyzer to use for field - - - - Return the positionIncrementGap from the analyzer assigned to fieldName - - - Return the offsetGap from the analyzer assigned to field - - - This class can be used if the token attributes of a TokenStream - are intended to be consumed more than once. It caches - all token attribute states locally in a List. - -

    CachingTokenFilter implements the optional method - {@link TokenStream#Reset()}, which repositions the - stream to the first Token. -

    -
    - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Simple lockless and memory barrier free String intern cache that is guaranteed - to return the same String instance as String.intern() does. - - - - Subclasses of StringInterner are required to - return the same single String object for all equal strings. - Depending on the implementation, this may not be - the same object returned as String.intern(). - - This StringInterner base class simply delegates to String.intern(). - - - - Returns a single object instance for each equal string. - - - Returns a single object instance for each equal string. - - - Size of the hash table, should be a power of two. - - Maximum length of each bucket, after which the oldest item inserted is dropped. - - - - Subclass of FilteredTermEnum for enumerating all terms that match the - specified range parameters. -

    - Term enumerations are always ordered by Term.compareTo(). Each term in - the enumeration is greater than all that precede it. -

    - 2.9 - -
    - - Enumerates all terms greater/equal than lowerTerm - but less/equal than upperTerm. - - If an endpoint is null, it is said to be "open". Either or both - endpoints may be open. Open endpoints may not be exclusive - (you can't select all but the first or last term without - explicitly specifying the term to exclude.) - - - - - An interned field that holds both lower and upper terms. - - The term text at the lower end of the range - - The term text at the upper end of the range - - If true, the lowerTerm is included in the range. - - If true, the upperTerm is included in the range. - - The collator to use to collate index Terms, to determine their - membership in the range bounded by lowerTerm and - upperTerm. - - - IOException - - - A Filter that restricts search results to a range of values in a given - field. - -

    This filter matches the documents looking for terms that fall into the - supplied range according to {@link String#compareTo(String)}. It is not intended - for numerical ranges, use {@link NumericRangeFilter} instead. - -

    If you construct a large number of range filters with different ranges but on the - same field, {@link FieldCacheRangeFilter} may have significantly better performance. -

    - 2.9 - -
    - - The field this range applies to - - The lower bound on this range - - The upper bound on this range - - Does this range include the lower bound? - - Does this range include the upper bound? - - IllegalArgumentException if both terms are null or if - lowerTerm is null and includeLower is true (similar for upperTerm - and includeUpper) - - - - WARNING: Using this constructor and supplying a non-null - value in the collator parameter will cause every single - index Term in the Field referenced by lowerTerm and/or upperTerm to be - examined. Depending on the number of index Terms in this Field, the - operation could be very slow. - - - The lower bound on this range - - The upper bound on this range - - Does this range include the lower bound? - - Does this range include the upper bound? - - The collator to use when determining range inclusion; set - to null to use Unicode code point ordering instead of collation. - - IllegalArgumentException if both terms are null or if - lowerTerm is null and includeLower is true (similar for upperTerm - and includeUpper) - - - - Constructs a filter for field fieldName matching - less than or equal to upperTerm. - - - - Constructs a filter for field fieldName matching - greater than or equal to lowerTerm. - - - - Returns the field name for this filter - - - Returns the lower value of this range filter - - - Returns the upper value of this range filter - - - Returns true if the lower endpoint is inclusive - - - Returns true if the upper endpoint is inclusive - - - Returns the collator used to determine range inclusion, if any. - - - Matches the union of its clauses. - - - Construct a SpanOrQuery merging the provided clauses. - - - Return the clauses whose spans are matched. - - - Returns a collection of all terms matched by this query. - use extractTerms instead - - - - - - A Query that matches documents containing a particular sequence of terms. - A PhraseQuery is built by QueryParser for input like "new york". - -

    This query may be combined with other terms or queries with a {@link BooleanQuery}. -

    -
    - - Constructs an empty phrase query. - - - Sets the number of other words permitted between words in query phrase. - If zero, then this is an exact phrase search. For larger values this works - like a WITHIN or NEAR operator. -

    The slop is in fact an edit-distance, where the units correspond to - moves of terms in the query phrase out of position. For example, to switch - the order of two words requires two moves (the first move places the words - atop one another), so to permit re-orderings of phrases, the slop must be - at least two. -

    More exact matches are scored higher than sloppier matches, thus search - results are sorted by exactness. -

    The slop is zero by default, requiring exact matches. -

    -
    - - Returns the slop. See setSlop(). - - - Adds a term to the end of the query phrase. - The relative position of the term is the one immediately after the last term added. - - - - Adds a term to the end of the query phrase. - The relative position of the term within the phrase is specified explicitly. - This allows e.g. phrases with more than one term at the same position - or phrases with gaps (e.g. in connection with stopwords). - - - - - - - - - Returns the set of terms in this phrase. - - - Returns the relative positions of terms in this phrase. - - - - - - - Prints a user-readable version of this query. - - - Returns true iff o is equal to this. - - - Returns a hash code value for this object. - - - Experimental class to get set of payloads for most standard Lucene queries. - Operates like Highlighter - IndexReader should only contain doc of interest, - best to use MemoryIndex. - -

    - - WARNING: The status of the Payloads feature is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

    -
    - - that contains doc with payloads to extract - - - - Query should be rewritten for wild/fuzzy support. - - - - - payloads Collection - - IOException - - - Expert: A Query that sets the scores of document to the - values obtained from a {@link Lucene.Net.Search.Function.ValueSource ValueSource}. -

    - This query provides a score for each and every undeleted document in the index. -

    - The value source can be based on a (cached) value of an indexed field, but it - can also be based on an external source, e.g. values read from an external database. -

    - Score is set as: Score(doc,query) = query.getBoost()2 * valueSource(doc). - -

    - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. -

    -
    - - Create a value source query - provides the values defines the function to be used for scoring - - - - Returns true if o is equal to this. - - - Returns a hash code value for this object. - - - A scorer that (simply) matches all documents, and scores each document with - the value of the value soure in effect. As an example, if the value source - is a (cached) field source, then value of that field in that document will - be used. (assuming field is indexed for this doc, with a single token.) - - - - use {@link #NextDoc()} instead. - - - - use {@link #DocID()} instead. - - - - use {@link #Advance(int)} instead. - - - - Token Manager. - - - Debug output. - - - Set debug output. - - - Token literal values. - - - Lexer state names. - - - Lex State array. - - - Constructor. - - - Constructor. - - - Reinitialise parser. - - - Reinitialise parser. - - - Switch to specified lex state. - - - Get the next Token. - - - $Id: TermVectorsReader.java 687046 2008-08-19 13:01:11Z mikemccand $ - - - - Retrieve the length (in bytes) of the tvd and tvf - entries for the next numDocs starting with - startDocID. This is used for bulk copying when - merging segments, if the field numbers are - congruent. Once this returns, the tvf & tvd streams - are seeked to the startDocID. - - - - - The number of documents in the reader - - - - Retrieve the term vector for the given document and field - The document number to retrieve the vector for - - The field within the document to retrieve - - The TermFreqVector for the document and field or null if there is no termVector for this field. - - IOException if there is an error reading the term vector files - - - Return all term vectors stored for this document or null if the could not be read in. - - - The document number to retrieve the vector for - - All term frequency vectors - - IOException if there is an error reading the term vector files - - - - The field to read in - - The pointer within the tvf file where we should start reading - - The mapper used to map the TermVector - - IOException - - - Models the existing parallel array structure - - - Construct the vector - The {@link TermFreqVector} based on the mappings. - - - - Allows you to iterate over the {@link TermPositions} for multiple {@link Term}s as - a single {@link TermPositions}. - - - - - Creates a new MultipleTermPositions instance. - - - - - - - Not implemented. - UnsupportedOperationException - - - Not implemented. - UnsupportedOperationException - - - Not implemented. - UnsupportedOperationException - - - Not implemented. - UnsupportedOperationException - - - Not implemented. - UnsupportedOperationException - - - - false - - - - This is a {@link LogMergePolicy} that measures size of a - segment as the total byte size of the segment's files. - - - -

    This class implements a {@link MergePolicy} that tries - to merge segments into levels of exponentially - increasing size, where each level has fewer segments than - the value of the merge factor. Whenever extra segments - (beyond the merge factor upper bound) are encountered, - all segments within the level are merged. You can get or - set the merge factor using {@link #GetMergeFactor()} and - {@link #SetMergeFactor(int)} respectively.

    - -

    This class is abstract and requires a subclass to - define the {@link #size} method which specifies how a - segment's size is determined. {@link LogDocMergePolicy} - is one subclass that measures size by document count in - the segment. {@link LogByteSizeMergePolicy} is another - subclass that measures size as the total byte size of the - file(s) for the segment.

    -

    -
    - -

    Expert: a MergePolicy determines the sequence of - primitive merge operations to be used for overall merge - and optimize operations.

    - -

    Whenever the segments in an index have been altered by - {@link IndexWriter}, either the addition of a newly - flushed segment, addition of many segments from - addIndexes* calls, or a previous merge that may now need - to cascade, {@link IndexWriter} invokes {@link - #findMerges} to give the MergePolicy a chance to pick - merges that are now required. This method returns a - {@link MergeSpecification} instance describing the set of - merges that should be done, or null if no merges are - necessary. When IndexWriter.optimize is called, it calls - {@link #findMergesForOptimize} and the MergePolicy should - then return the necessary merges.

    - -

    Note that the policy can return more than one merge at - a time. In this case, if the writer is using {@link - SerialMergeScheduler}, the merges will be run - sequentially but if it is using {@link - ConcurrentMergeScheduler} they will be run concurrently.

    - -

    The default MergePolicy is {@link - LogByteSizeMergePolicy}.

    - -

    NOTE: This API is new and still experimental - (subject to change suddenly in the next release)

    - -

    NOTE: This class typically requires access to - package-private APIs (e.g. SegmentInfos) to do its job; - if you implement your own MergePolicy, you'll need to put - it in package Lucene.Net.Index in order to use - these APIs. -

    -
    - - Determine what set of merge operations are now necessary on the index. - {@link IndexWriter} calls this whenever there is a change to the segments. - This call is always synchronized on the {@link IndexWriter} instance so - only one thread at a time will call this method. - - - the total set of segments in the index - - - - Determine what set of merge operations is necessary in order to optimize - the index. {@link IndexWriter} calls this when its - {@link IndexWriter#Optimize()} method is called. This call is always - synchronized on the {@link IndexWriter} instance so only one thread at a - time will call this method. - - - the total set of segments in the index - - requested maximum number of segments in the index (currently this - is always 1) - - contains the specific SegmentInfo instances that must be merged - away. This may be a subset of all SegmentInfos. - - - - Determine what set of merge operations is necessary in order to expunge all - deletes from the index. - - - the total set of segments in the index - - - - Release all resources for the policy. - - - Returns true if a newly flushed (not from merge) - segment should use the compound file format. - - - - Returns true if the doc store files should use the - compound file format. - - - - OneMerge provides the information necessary to perform - an individual primitive merge operation, resulting in - a single new segment. The merge spec includes the - subset of segments to be merged as well as whether the - new segment should use the compound file format. - - - - Record that an exception occurred while executing - this merge - - - - Retrieve previous exception set by {@link - #setException}. - - - - Mark this merge as aborted. If this is called - before the merge is committed then the merge will - not be committed. - - - - Returns true if this merge was aborted. - - - A MergeSpecification instance provides the information - necessary to perform multiple merges. It simply - contains a list of {@link OneMerge} instances. - - - - The subset of segments to be included in the primitive merge. - - - Exception thrown if there are any problems while - executing a merge. - - - - - Use {@link #MergePolicy.MergeException(String,Directory)} instead - - - - - Use {@link #MergePolicy.MergeException(Throwable,Directory)} instead - - - - Returns the {@link Directory} of the index that hit - the exception. - - - - Defines the allowed range of log(size) for each - level. A level is computed by taking the max segment - log size, minus LEVEL_LOG_SPAN, and finding all - segments falling within that range. - - - - Default merge factor, which is how many segments are - merged at a time - - - - Default maximum segment size. A segment of this size - - - - - Default noCFSRatio. If a merge's size is >= 10% of - the index, then we disable compound file for it. - @see #setNoCFSRatio - - - - @see #setNoCFSRatio - - - If a merged segment will be more than this percentage - of the total size of the index, leave the segment as - non-compound file even if compound file is enabled. - Set to 1.0 to always use CFS regardless of merge - size. - - -

    Returns the number of segments that are merged at - once and also controls the total number of segments - allowed to accumulate in the index.

    -

    -
    - - Determines how often segment indices are merged by - addDocument(). With smaller values, less RAM is used - while indexing, and searches on unoptimized indices are - faster, but indexing speed is slower. With larger - values, more RAM is used during indexing, and while - searches on unoptimized indices are slower, indexing is - faster. Thus larger values (> 10) are best for batch - index creation, and smaller values (< 10) for indices - that are interactively maintained. - - - - Sets whether compound file format should be used for - newly flushed and newly merged segments. - - - - Returns true if newly flushed and newly merge segments - - - - - Sets whether compound file format should be used for - newly flushed and newly merged doc store - segment files (term vectors and stored fields). - - - - Returns true if newly flushed and newly merge doc - store segment files (term vectors and stored fields) - - - - - - Sets whether the segment size should be calibrated by - the number of deletes when choosing segments for merge. - - - - Returns true if the segment size should be calibrated - by the number of deletes when choosing segments for merge. - - - - Returns true if this single info is optimized (has no - pending norms or deletes, is in the same dir as the - writer, and matches the current compound file setting - - - - Returns the merges necessary to optimize the index. - This merge policy defines "optimized" to mean only one - segment in the index, where that segment has no - deletions pending nor separate norms, and it is in - compound file format if the current useCompoundFile - setting is true. This method returns multiple merges - (mergeFactor at a time) so the {@link MergeScheduler} - in use may make use of concurrency. - - - - Finds merges necessary to expunge all deletes from the - index. We simply merge adjacent segments that have - deletes, up to mergeFactor at a time. - - - - Checks if any merges are now necessary and returns a - {@link MergePolicy.MergeSpecification} if so. A merge - is necessary when there are more than {@link - #setMergeFactor} segments at a given level. When - multiple levels have too many segments, this method - will return multiple merges, allowing the {@link - MergeScheduler} to use concurrency. - - - -

    Determines the largest segment (measured by - document count) that may be merged with other segments. - Small values (e.g., less than 10,000) are best for - interactive indexing, as this limits the length of - pauses while indexing to a few seconds. Larger values - are best for batched indexing and speedier - searches.

    - -

    The default value is {@link Integer#MAX_VALUE}.

    - -

    The default merge policy ({@link - LogByteSizeMergePolicy}) also allows you to set this - limit by net size (in MB) of the segment, using {@link - LogByteSizeMergePolicy#setMaxMergeMB}.

    -

    -
    - - Returns the largest segment (measured by document - count) that may be merged with other segments. - - - - - - - - - - Default maximum segment size. A segment of this size - - - - -

    Determines the largest segment (measured by total - byte size of the segment's files, in MB) that may be - merged with other segments. Small values (e.g., less - than 50 MB) are best for interactive indexing, as this - limits the length of pauses while indexing to a few - seconds. Larger values are best for batched indexing - and speedier searches.

    - -

    Note that {@link #setMaxMergeDocs} is also - used to check whether a segment is too large for - merging (it's either or).

    -

    -
    - - Returns the largest segment (meaured by total byte - size of the segment's files, in MB) that may be merged - with other segments. - - - - - - Sets the minimum size for the lowest level segments. - Any segments below this size are considered to be on - the same level (even if they vary drastically in size) - and will be merged whenever there are mergeFactor of - them. This effectively truncates the "long tail" of - small segments that would otherwise be created into a - single level. If you set this too large, it could - greatly increase the merging cost during indexing (if - you flush many small segments). - - - - Get the minimum size for a segment to remain - un-merged. - - - - - -

    This class provides a {@link Field} that enables indexing - of numeric values for efficient range filtering and - sorting. Here's an example usage, adding an int value: -

    -            document.add(new NumericField(name).setIntValue(value));
    -            
    - - For optimal performance, re-use the - NumericField and {@link Document} instance for more than - one document: - -
    -            NumericField field = new NumericField(name);
    -            Document document = new Document();
    -            document.add(field);
    -            
    -            for(all documents) {
    -            ...
    -            field.setIntValue(value)
    -            writer.addDocument(document);
    -            ...
    -            }
    -            
    - -

    The java native types int, long, - float and double are - directly supported. However, any value that can be - converted into these native types can also be indexed. - For example, date/time values represented by a - {@link java.util.Date} can be translated into a long - value using the {@link java.util.Date#getTime} method. If you - don't need millisecond precision, you can quantize the - value, either by dividing the result of - {@link java.util.Date#getTime} or using the separate getters - (for year, month, etc.) to construct an int or - long value.

    - -

    To perform range querying or filtering against a - NumericField, use {@link NumericRangeQuery} or {@link - NumericRangeFilter}. To sort according to a - NumericField, use the normal numeric sort types, eg - {@link SortField#INT} (note that {@link SortField#AUTO} - will not work with these fields). NumericField values - can also be loaded directly from {@link FieldCache}.

    - -

    By default, a NumericField's value is not stored but - is indexed for range filtering and sorting. You can use - the {@link #NumericField(String,Field.Store,boolean)} - constructor if you need to change these defaults.

    - -

    You may add the same field name as a NumericField to - the same document more than once. Range querying and - filtering will be the logical OR of all values; so a range query - will hit all documents that have at least one value in - the range. However sort behavior is not defined. If you need to sort, - you should separately index a single-valued NumericField.

    - -

    A NumericField will consume somewhat more disk space - in the index than an ordinary single-valued field. - However, for a typical index that includes substantial - textual content per document, this increase will likely - be in the noise.

    - -

    Within Lucene, each numeric value is indexed as a - trie structure, where each term is logically - assigned to larger and larger pre-defined brackets (which - are simply lower-precision representations of the value). - The step size between each successive bracket is called the - precisionStep, measured in bits. Smaller - precisionStep values result in larger number - of brackets, which consumes more disk space in the index - but may result in faster range search performance. The - default value, 4, was selected for a reasonable tradeoff - of disk space consumption versus performance. You can - use the expert constructor {@link - #NumericField(String,int,Field.Store,boolean)} if you'd - like to change the value. Note that you must also - specify a congruent value when creating {@link - NumericRangeQuery} or {@link NumericRangeFilter}. - For low cardinality fields larger precision steps are good. - If the cardinality is < 100, it is fair - to use {@link Integer#MAX_VALUE}, which produces one - term per value. - -

    For more information on the internals of numeric trie - indexing, including the precisionStep - configuration, see {@link NumericRangeQuery}. The format of - indexed values is described in {@link NumericUtils}. - -

    If you only need to sort by numeric value, and never - run range querying/filtering, you can index using a - precisionStep of {@link Integer#MAX_VALUE}. - This will minimize disk space consumed.

    - -

    More advanced users can instead use {@link - NumericTokenStream} directly, when indexing numbers. This - class is a wrapper around this token stream type for - easier, more intuitive usage.

    - -

    NOTE: This class is only used during - indexing. When retrieving the stored field value from a - {@link Document} instance after search, you will get a - conventional {@link Fieldable} instance where the numeric - values are returned as {@link String}s (according to - toString(value) of the used data type). - -

    NOTE: This API is - experimental and might change in incompatible ways in the - next release. - -

    - 2.9 - -
    - - - - - - - - Sets the boost factor hits on this field. This value will be - multiplied into the score of all hits on this this field of this - document. - -

    The boost is multiplied by {@link Lucene.Net.Documents.Document#GetBoost()} of the document - containing this field. If a document has multiple fields with the same - name, all such values are multiplied together. This product is then - used to compute the norm factor for the field. By - default, in the {@link - Lucene.Net.Search.Similarity#ComputeNorm(String, - FieldInvertState)} method, the boost value is multipled - by the {@link - Lucene.Net.Search.Similarity#LengthNorm(String, - int)} and then - rounded by {@link Lucene.Net.Search.Similarity#EncodeNorm(float)} before it is stored in the - index. One should attempt to ensure that this product does not overflow - the range of that encoding. - -

    - - - - - - -
    - - Returns the boost factor for hits for this field. - -

    The default value is 1.0. - -

    Note: this value is not stored directly with the document in the index. - Documents returned from {@link Lucene.Net.Index.IndexReader#Document(int)} and - {@link Lucene.Net.Search.Hits#Doc(int)} may thus not have the same value present as when - this field was indexed. - -

    - - -
    - - Returns the name of the field as an interned string. - For example "date", "title", "body", ... - - - - True iff the value of the field is to be stored in the index for return - with search hits. It is an error for this to be true if a field is - Reader-valued. - - - - True iff the value of the field is to be indexed, so that it may be - searched on. - - - - True iff the value of the field should be tokenized as text prior to - indexing. Un-tokenized fields are indexed as a single word and may not be - Reader-valued. - - - - True if the value of the field is stored and compressed within the index - - - True iff the term or terms used to index this field are stored as a term - vector, available from {@link Lucene.Net.Index.IndexReader#GetTermFreqVector(int,String)}. - These methods do not provide access to the original content of the field, - only to terms used to index it. If the original content must be - preserved, use the stored attribute instead. - - - - - - - True iff terms are stored as term vector together with their offsets - (start and end position in source text). - - - - True iff terms are stored as term vector together with their token positions. - - - True iff the value of the filed is stored as binary - - - Return the raw byte[] for the binary field. Note that - you must also call {@link #getBinaryLength} and {@link - #getBinaryOffset} to know which range of bytes in this - returned array belong to the field. - - reference to the Field value as byte[]. - - - - Returns length of byte[] segment that is used as value, if Field is not binary - returned value is undefined - - length of byte[] segment that represents this Field value - - - - Returns offset into byte[] segment that is used as value, if Field is not binary - returned value is undefined - - index of the first character in byte[] segment that represents this Field value - - - - True if norms are omitted for this indexed field - - - Renamed to {@link #getOmitTermFreqAndPositions} - - - - - - - - Expert: - - If set, omit normalization factors associated with this indexed field. - This effectively disables indexing boosts and length normalization for this field. - - - - Renamed to {@link #setOmitTermFreqAndPositions} - - - - Expert: - - If set, omit term freq, positions and payloads from - postings for this field. - -

    NOTE: While this option reduces storage space - required in the index, it also means any query - requiring positional information, such as {@link - PhraseQuery} or {@link SpanQuery} subclasses will - silently fail to find results. -

    -
    - - Prints a Field for human consumption. - - - Creates a field for numeric values using the default precisionStep - {@link NumericUtils#PRECISION_STEP_DEFAULT} (4). The instance is not yet initialized with - a numeric value, before indexing a document containing this field, - set a value using the various set???Value() methods. - This constructor creates an indexed, but not stored field. - - the field name - - - - Creates a field for numeric values using the default precisionStep - {@link NumericUtils#PRECISION_STEP_DEFAULT} (4). The instance is not yet initialized with - a numeric value, before indexing a document containing this field, - set a value using the various set???Value() methods. - - the field name - - if the field should be stored in plain text form - (according to toString(value) of the used data type) - - if the field should be indexed using {@link NumericTokenStream} - - - - Creates a field for numeric values with the specified - precisionStep. The instance is not yet initialized with - a numeric value, before indexing a document containing this field, - set a value using the various set???Value() methods. - This constructor creates an indexed, but not stored field. - - the field name - - the used precision step - - - - Creates a field for numeric values with the specified - precisionStep. The instance is not yet initialized with - a numeric value, before indexing a document containing this field, - set a value using the various set???Value() methods. - - the field name - - the used precision step - - if the field should be stored in plain text form - (according to toString(value) of the used data type) - - if the field should be indexed using {@link NumericTokenStream} - - - - Returns a {@link NumericTokenStream} for indexing the numeric value. - - - Returns always null for numeric fields - - - Returns always null for numeric fields - - - Returns always null for numeric fields - - - Returns the numeric value as a string (how it is stored, when {@link Field.Store#YES} is chosen). - - - Returns the current numeric value as a subclass of {@link Number}, null if not yet initialized. - - - Initializes the field with the supplied long value. - the numeric value - - this instance, because of this you can use it the following way: - document.add(new NumericField(name, precisionStep).SetLongValue(value)) - - - - Initializes the field with the supplied int value. - the numeric value - - this instance, because of this you can use it the following way: - document.add(new NumericField(name, precisionStep).setIntValue(value)) - - - - Initializes the field with the supplied double value. - the numeric value - - this instance, because of this you can use it the following way: - document.add(new NumericField(name, precisionStep).setDoubleValue(value)) - - - - Initializes the field with the supplied float value. - the numeric value - - this instance, because of this you can use it the following way: - document.add(new NumericField(name, precisionStep).setFloatValue(value)) - - - - The term text of a Token. - - - Returns the Token's term text. - - This method has a performance penalty - because the text is stored internally in a char[]. If - possible, use {@link #TermBuffer()} and {@link - #TermLength()} directly instead. If you really need a - String, use this method, which is nothing more than - a convenience call to new String(token.termBuffer(), 0, token.termLength()) - - - - Copies the contents of buffer, starting at offset for - length characters, into the termBuffer array. - - the buffer to copy - - the index in the buffer of the first character to copy - - the number of characters to copy - - - - Copies the contents of buffer into the termBuffer array. - the buffer to copy - - - - Copies the contents of buffer, starting at offset and continuing - for length characters, into the termBuffer array. - - the buffer to copy - - the index in the buffer of the first character to copy - - the number of characters to copy - - - - Returns the internal termBuffer character array which - you can then directly alter. If the array is too - small for your token, use {@link - #ResizeTermBuffer(int)} to increase it. After - altering the buffer be sure to call {@link - #setTermLength} to record the number of valid - characters that were placed into the termBuffer. - - - - Grows the termBuffer to at least size newSize, preserving the - existing content. Note: If the next operation is to change - the contents of the term buffer use - {@link #SetTermBuffer(char[], int, int)}, - {@link #SetTermBuffer(String)}, or - {@link #SetTermBuffer(String, int, int)} - to optimally combine the resize with the setting of the termBuffer. - - minimum size of the new termBuffer - - newly created termBuffer with length >= newSize - - - - Allocates a buffer char[] of at least newSize, without preserving the existing content. - its always used in places that set the content - - minimum size of the buffer - - - - Return number of valid characters (length of the term) - in the termBuffer array. - - - - Set number of valid characters (length of the term) in - the termBuffer array. Use this to truncate the termBuffer - or to synchronize with external manipulation of the termBuffer. - Note: to grow the size of the array, - use {@link #ResizeTermBuffer(int)} first. - - the truncated length - - - - The positionIncrement determines the position of this token - relative to the previous Token in a {@link TokenStream}, used in phrase - searching. - -

    The default value is one. - -

    Some common uses for this are:

      - -
    • Set it to zero to put multiple terms in the same position. This is - useful if, e.g., a word has multiple stems. Searches for phrases - including either stem will match. In this case, all but the first stem's - increment should be set to zero: the increment of the first instance - should be one. Repeating a token with an increment of zero can also be - used to boost the scores of matches on that token.
    • - -
    • Set it to values greater than one to inhibit exact phrase matches. - If, for example, one does not want phrases to match across removed stop - words, then one could build a stop word filter that removes stop words and - also sets the increment to the number of stop words removed before each - non-stop word. Then exact phrase queries will only match when the terms - occur with no intervening stop words.
    • - -
    -
    -
    - - Set the position increment. The default value is one. - - - the distance from the prior term - - - - Returns the position increment of this Token. - - - - - Normalizes token text to lower case. - - - $Id: LowerCaseFilter.java 797665 2009-07-24 21:45:48Z buschmi $ - - - - This class converts alphabetic, numeric, and symbolic Unicode characters - which are not in the first 127 ASCII characters (the "Basic Latin" Unicode - block) into their ASCII equivalents, if one exists. - - Characters from the following Unicode blocks are converted; however, only - those characters with reasonable ASCII alternatives are converted: - - - - See: http://en.wikipedia.org/wiki/Latin_characters_in_Unicode - - The set of character conversions supported by this class is a superset of - those supported by Lucene's {@link ISOLatin1AccentFilter} which strips - accents from Latin1 characters. For example, 'À' will be replaced by - 'a'. - - - - Converts characters above ASCII to their ASCII equivalents. For example, - accents are removed from accented characters. - - The string to fold - - The number of characters in the input string - - - - Estimates the size of a given Object using a given MemoryModel for primitive - size information. - - Resource Usage: - - Internally uses a Map to temporally hold a reference to every - object seen. - - If checkIntered, all Strings checked will be interned, but those - that were not already interned will be released for GC when the - estimate is complete. - - - - Constructs this object with an AverageGuessMemoryModel and - checkInterned = true. - - - - check if Strings are interned and don't add to size - if they are. Defaults to true but if you know the objects you are checking - won't likely contain many interned Strings, it will be faster to turn off - intern checking. - - - - MemoryModel to use for primitive object sizes. - - - - MemoryModel to use for primitive object sizes. - - check if Strings are interned and don't add to size - if they are. Defaults to true but if you know the objects you are checking - won't likely contain many interned Strings, it will be faster to turn off - intern checking. - - - - Return good default units based on byte size. - - - Simple DocIdSet and DocIdSetIterator backed by a BitSet - - - This DocIdSet implementation is cacheable. - - - Returns the underlying BitSet. - - - use {@link #DocID()} instead. - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - A {@link LockFactory} that wraps another {@link - LockFactory} and verifies that each lock obtain/release - is "correct" (never results in two processes holding the - lock at the same time). It does this by contacting an - external server ({@link LockVerifyServer}) to assert that - at most one process holds the lock at a time. To use - this, you should also run {@link LockVerifyServer} on the - host & port matching what you pass to the constructor. - - - - - - - - - should be a unique id across all clients - - the LockFactory that we are testing - - host or IP where {@link LockVerifyServer} - is running - - the port {@link LockVerifyServer} is - listening on - - - - A memory-resident {@link IndexOutput} implementation. - - - $Id: RAMOutputStream.java 691694 2008-09-03 17:34:29Z mikemccand $ - - - - Construct an empty output buffer. - - - Copy the current contents of this buffer to the named output. - - - Resets this to an empty buffer. - - - Returns byte usage of all buffers. - - - Use this {@link LockFactory} to disable locking entirely. - This LockFactory is used when you call {@link FSDirectory#setDisableLocks}. - Only one instance of this lock is created. You should call {@link - #GetNoLockFactory()} to get the instance. - - - - - - - This exception is thrown when the write.lock - could not be released. - - - - - - Matches spans which are near one another. One can specify slop, the - maximum number of intervening unmatched positions, as well as whether - matches are required to be in-order. - - - - Construct a SpanNearQuery. Matches spans matching a span from each - clause, with up to slop total unmatched positions between - them. * When inOrder is true, the spans from each clause - must be * ordered as in clauses. - - - - Return the clauses whose spans are matched. - - - Return the maximum number of intervening unmatched positions permitted. - - - Return true if matches are required to be in-order. - - - Returns a collection of all terms matched by this query. - use extractTerms instead - - - - - - Returns true iff o is equal to this. - - -

    A {@link Query} that matches numeric values within a - specified range. To use this, you must first index the - numeric values using {@link NumericField} (expert: {@link - NumericTokenStream}). If your terms are instead textual, - you should use {@link TermRangeQuery}. {@link - NumericRangeFilter} is the filter equivalent of this - query.

    - -

    You create a new NumericRangeQuery with the static - factory methods, eg: - -

    -            Query q = NumericRangeQuery.newFloatRange("weight",
    -            new Float(0.3f), new Float(0.10f),
    -            true, true);
    -            
    - - matches all documents whose float valued "weight" field - ranges from 0.3 to 0.10, inclusive. - -

    The performance of NumericRangeQuery is much better - than the corresponding {@link TermRangeQuery} because the - number of terms that must be searched is usually far - fewer, thanks to trie indexing, described below.

    - -

    You can optionally specify a precisionStep - when creating this query. This is necessary if you've - changed this configuration from its default (4) during - indexing. Lower values consume more disk space but speed - up searching. Suitable values are between 1 and - 8. A good starting point to test is 4, - which is the default value for all Numeric* - classes. See below for - details. - -

    This query defaults to {@linkplain - MultiTermQuery#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT} for - 32 bit (int/float) ranges with precisionStep <8 and 64 - bit (long/double) ranges with precisionStep <6. - Otherwise it uses {@linkplain - MultiTermQuery#CONSTANT_SCORE_FILTER_REWRITE} as the - number of terms is likely to be high. With precision - steps of <4, this query can be run with one of the - BooleanQuery rewrite methods without changing - BooleanQuery's default max clause count. - -

    NOTE: This API is experimental and - might change in incompatible ways in the next release. - -

    How it works

    - -

    See the publication about panFMP, - where this algorithm was described (referred to as TrieRangeQuery): - -

    Schindler, U, Diepenbroek, M, 2008. - Generic XML-based Framework for Metadata Portals. - Computers & Geosciences 34 (12), 1947-1955. - doi:10.1016/j.cageo.2008.02.023
    - -

    A quote from this paper: Because Apache Lucene is a full-text - search engine and not a conventional database, it cannot handle numerical ranges - (e.g., field value is inside user defined bounds, even dates are numerical values). - We have developed an extension to Apache Lucene that stores - the numerical values in a special string-encoded format with variable precision - (all numerical values like doubles, longs, floats, and ints are converted to - lexicographic sortable string representations and stored with different precisions - (for a more detailed description of how the values are stored, - see {@link NumericUtils}). A range is then divided recursively into multiple intervals for searching: - The center of the range is searched only with the lowest possible precision in the trie, - while the boundaries are matched more exactly. This reduces the number of terms dramatically.

    - -

    For the variant that stores long values in 8 different precisions (each reduced by 8 bits) that - uses a lowest precision of 1 byte, the index contains only a maximum of 256 distinct values in the - lowest precision. Overall, a range could consist of a theoretical maximum of - 7*255*2 + 255 = 3825 distinct terms (when there is a term for every distinct value of an - 8-byte-number in the index and the range covers almost all of them; a maximum of 255 distinct values is used - because it would always be possible to reduce the full 256 values to one term with degraded precision). - In practice, we have seen up to 300 terms in most cases (index with 500,000 metadata records - and a uniform value distribution).

    - -

    Precision Step

    -

    You can choose any precisionStep when encoding values. - Lower step values mean more precisions and so more terms in index (and index gets larger). - On the other hand, the maximum number of terms to match reduces, which optimized query speed. - The formula to calculate the maximum term count is: -

    -            n = [ (bitsPerValue/precisionStep - 1) * (2^precisionStep - 1 ) * 2 ] + (2^precisionStep - 1 )
    -            
    -

    (this formula is only correct, when bitsPerValue/precisionStep is an integer; - in other cases, the value must be rounded up and the last summand must contain the modulo of the division as - precision step). - For longs stored using a precision step of 4, n = 15*15*2 + 15 = 465, and for a precision - step of 2, n = 31*3*2 + 3 = 189. But the faster search speed is reduced by more seeking - in the term enum of the index. Because of this, the ideal precisionStep value can only - be found out by testing. Important: You can index with a lower precision step value and test search speed - using a multiple of the original step value.

    - -

    Good values for precisionStep are depending on usage and data type: -

      -
    • The default for all data types is 4, which is used, when no precisionStep is given.
    • -
    • Ideal value in most cases for 64 bit data types (long, double) is 6 or 8.
    • -
    • Ideal value in most cases for 32 bit data types (int, float) is 4.
    • -
    • Steps >64 for long/double and >32 for int/float produces one token - per value in the index and querying is as slow as a conventional {@link TermRangeQuery}. But it can be used - to produce fields, that are solely used for sorting (in this case simply use {@link Integer#MAX_VALUE} as - precisionStep). Using {@link NumericField NumericFields} for sorting - is ideal, because building the field cache is much faster than with text-only numbers. - Sorting is also possible with range query optimized fields using one of the above precisionSteps.
    • -
    - -

    Comparisons of the different types of RangeQueries on an index with about 500,000 docs showed - that {@link TermRangeQuery} in boolean rewrite mode (with raised {@link BooleanQuery} clause count) - took about 30-40 secs to complete, {@link TermRangeQuery} in constant score filter rewrite mode took 5 secs - and executing this class took <100ms to complete (on an Opteron64 machine, Java 1.5, 8 bit - precision step). This query type was developed for a geographic portal, where the performance for - e.g. bounding boxes or exact date/time stamps is important.

    - -

    - 2.9 - - -
    - - Factory that creates a NumericRangeQuery, that queries a long - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - -
    - - Factory that creates a NumericRangeQuery, that queries a long - range using the default precisionStep {@link NumericUtils#PRECISION_STEP_DEFAULT} (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeQuery, that queries a int - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeQuery, that queries a int - range using the default precisionStep {@link NumericUtils#PRECISION_STEP_DEFAULT} (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeQuery, that queries a double - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeQuery, that queries a double - range using the default precisionStep {@link NumericUtils#PRECISION_STEP_DEFAULT} (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeQuery, that queries a float - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeQuery, that queries a float - range using the default precisionStep {@link NumericUtils#PRECISION_STEP_DEFAULT} (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Returns the field name for this query - - - Returns true if the lower endpoint is inclusive - - - Returns true if the upper endpoint is inclusive - - - Returns the lower value of this range query - - - Returns the upper value of this range query - - - Subclass of FilteredTermEnum for enumerating all terms that match the - sub-ranges for trie range queries. -

    - WARNING: This term enumeration is not guaranteed to be always ordered by - {@link Term#compareTo}. - The ordering depends on how {@link NumericUtils#splitLongRange} and - {@link NumericUtils#splitIntRange} generates the sub-ranges. For - {@link MultiTermQuery} ordering is not relevant. -

    -
    - - this is a dummy, it is not used by this class. - - - Compares if current upper bound is reached, - this also updates the term count for statistics. - In contrast to {@link FilteredTermEnum}, a return value - of false ends iterating the current enum - and forwards to the next sub-range. - - - - Increments the enumeration to the next element. True if one exists. - - - Closes the enumeration to further activity, freeing resources. - - - Implements search over a single IndexReader. - -

    Applications usually need only call the inherited {@link #Search(Query)} - or {@link #Search(Query,Filter)} methods. For performance reasons it is - recommended to open only one IndexSearcher and use it for all of your searches. - -

    Note that you can only access Hits from an IndexSearcher as long as it is - not yet closed, otherwise an IOException will be thrown. - -

    NOTE: {@link - IndexSearcher} instances are completely - thread safe, meaning multiple threads can call any of its - methods, concurrently. If your application requires - external synchronization, you should not - synchronize on the IndexSearcher instance; - use your own (non-Lucene) objects instead.

    -

    -
    - - Creates a searcher searching the index in the named directory. - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use {@link #IndexSearcher(Directory, boolean)} instead - - - - Creates a searcher searching the index in the named - directory. You should pass readOnly=true, since it - gives much better concurrent performance, unless you - intend to do write operations (delete documents or - change norms) with the underlying IndexReader. - - directory where IndexReader will be opened - - if true, the underlying IndexReader - will be opened readOnly - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use {@link #IndexSearcher(Directory, boolean)} instead - - - - Creates a searcher searching the index in the provided directory. - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - Use {@link #IndexSearcher(Directory, boolean)} instead - - - - Creates a searcher searching the index in the named - directory. You should pass readOnly=true, since it - gives much better concurrent performance, unless you - intend to do write operations (delete documents or - change norms) with the underlying IndexReader. - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - directory where IndexReader will be opened - - if true, the underlying IndexReader - will be opened readOnly - - - - Creates a searcher searching the provided index. - - - Return the {@link IndexReader} this searches. - - - Note that the underlying IndexReader is not closed, if - IndexSearcher was constructed with IndexSearcher(IndexReader r). - If the IndexReader was supplied implicitly by specifying a directory, then - the IndexReader gets closed. - - - - - .NET - - - - Just like {@link #Search(Weight, Filter, int, Sort)}, but you choose - whether or not the fields in the returned {@link FieldDoc} instances - should be set by specifying fillFields.
    - -

    - NOTE: this does not compute scores by default. If you need scores, create - a {@link TopFieldCollector} instance by calling - {@link TopFieldCollector#create} and then pass that to - {@link #Search(Weight, Filter, Collector)}. -

    -

    -
    - - By default, no scores are computed when sorting by field (using - {@link #Search(Query,Filter,int,Sort)}). You can change that, per - IndexSearcher instance, by calling this method. Note that this will incur - a CPU cost. - - - If true, then scores are returned for every matching document - in {@link TopFieldDocs}. - - - If true, then the max score for all matching docs is computed. - - - - A clause in a BooleanQuery. - - - The query whose matching documents are combined by the boolean query. - - - Constructs a BooleanClause. - - - Returns true if o is equal to this. - - - Returns a hash code value for this object. - - - Specifies how clauses are to occur in matching documents. - - - Use this operator for clauses that must appear in the matching documents. - - - Use this operator for clauses that should appear in the - matching documents. For a BooleanQuery with no MUST - clauses one or more SHOULD clauses must match a document - for the BooleanQuery to match. - - - - - - Use this operator for clauses that must not appear in the matching documents. - Note that it is not possible to search for queries that only consist - of a MUST_NOT clause. - - - - Add a complete document specified by all its term vectors. If document has no - term vectors, add value for tvx. - - - - - IOException - - - Do a bulk copy of numDocs documents from reader to our - streams. This is used to expedite merging, if the - field numbers are congruent. - - - - Close all streams. - - - This is a {@link LogMergePolicy} that measures size of a - segment as the number of documents (not taking deletions - into account). - - - - - - - - Sets the minimum size for the lowest level segments. - Any segments below this size are considered to be on - the same level (even if they vary drastically in size) - and will be merged whenever there are mergeFactor of - them. This effectively truncates the "long tail" of - small segments that would otherwise be created into a - single level. If you set this too large, it could - greatly increase the merging cost during indexing (if - you flush many small segments). - - - - Get the minimum size for a segment to remain - un-merged. - - - - - - A {@link MergeScheduler} that runs each merge using a - separate thread, up until a maximum number of threads - ({@link #setMaxThreadCount}) at which when a merge is - needed, the thread(s) that are updating the index will - pause until one or more merges completes. This is a - simple way to use concurrency in the indexing process - without having to create and manage application level - threads. - - - - Sets the max # simultaneous threads that may be - running. If a merge is necessary yet we already have - this many threads running, the incoming thread (that - is calling add/updateDocument) will block until - a merge thread has completed. - - - - Get the max # simultaneous threads that may be - - - - - Return the priority that merge threads run at. By - default the priority is 1 plus the priority of (ie, - slightly higher priority than) the first thread that - calls merge. - - - - Return the priority that merge threads run at. - - - Does the actual merge, by calling {@link IndexWriter#merge} - - - Create and return a new MergeThread - - - Called when an exception is hit in a background merge - thread - - - - Used for testing - - - Used for testing - - - Used for testing - - - Used for testing - - - Used for testing - - - Documents are the unit of indexing and search. - - A Document is a set of fields. Each field has a name and a textual value. - A field may be {@link Fieldable#IsStored() stored} with the document, in which - case it is returned with search hits on the document. Thus each document - should typically contain one or more stored fields which uniquely identify - it. - -

    Note that fields which are not {@link Fieldable#IsStored() stored} are - not available in documents retrieved from the index, e.g. with {@link - ScoreDoc#doc}, {@link Searcher#Doc(int)} or {@link - IndexReader#Document(int)}. -

    -
    - - Constructs a new document with no fields. - - - Sets a boost factor for hits on any field of this document. This value - will be multiplied into the score of all hits on this document. - -

    The default value is 1.0. - -

    Values are multiplied into the value of {@link Fieldable#GetBoost()} of - each field in this document. Thus, this method in effect sets a default - boost for the fields of this document. - -

    - - -
    - - Returns, at indexing time, the boost factor as set by {@link #SetBoost(float)}. - -

    Note that once a document is indexed this value is no longer available - from the index. At search time, for retrieved documents, this method always - returns 1. This however does not mean that the boost value set at indexing - time was ignored - it was just combined with other indexing time factors and - stored elsewhere, for better indexing and search performance. (For more - information see the "norm(t,d)" part of the scoring formula in - {@link Lucene.Net.Search.Similarity Similarity}.) - -

    - - -
    - -

    Adds a field to a document. Several fields may be added with - the same name. In this case, if the fields are indexed, their text is - treated as though appended for the purposes of search.

    -

    Note that add like the removeField(s) methods only makes sense - prior to adding a document to an index. These methods cannot - be used to change the content of an existing index! In order to achieve this, - a document has to be deleted from an index and a new changed version of that - document has to be added.

    -

    -
    - -

    Removes field with the specified name from the document. - If multiple fields exist with this name, this method removes the first field that has been added. - If there is no field with the specified name, the document remains unchanged.

    -

    Note that the removeField(s) methods like the add method only make sense - prior to adding a document to an index. These methods cannot - be used to change the content of an existing index! In order to achieve this, - a document has to be deleted from an index and a new changed version of that - document has to be added.

    -

    -
    - -

    Removes all fields with the given name from the document. - If there is no field with the specified name, the document remains unchanged.

    -

    Note that the removeField(s) methods like the add method only make sense - prior to adding a document to an index. These methods cannot - be used to change the content of an existing index! In order to achieve this, - a document has to be deleted from an index and a new changed version of that - document has to be added.

    -

    -
    - - Returns a field with the given name if any exist in this document, or - null. If multiple fields exists with this name, this method returns the - first value added. - Do not use this method with lazy loaded fields. - - - - Returns a field with the given name if any exist in this document, or - null. If multiple fields exists with this name, this method returns the - first value added. - - - - Returns the string value of the field with the given name if any exist in - this document, or null. If multiple fields exist with this name, this - method returns the first value added. If only binary fields with this name - exist, returns null. - - - - Returns an Enumeration of all the fields in a document. - use {@link #GetFields()} instead - - - - Returns a List of all the fields in a document. -

    Note that fields which are not {@link Fieldable#IsStored() stored} are - not available in documents retrieved from the - index, e.g. {@link Searcher#Doc(int)} or {@link - IndexReader#Document(int)}. -

    -
    - - Returns an array of {@link Field}s with the given name. - Do not use with lazy loaded fields. - This method returns an empty array when there are no - matching fields. It never returns null. - - - the name of the field - - a Field[] array - - - - Returns an array of {@link Fieldable}s with the given name. - This method returns an empty array when there are no - matching fields. It never returns null. - - - the name of the field - - a Fieldable[] array - - - - Returns an array of values of the field specified as the method parameter. - This method returns an empty array when there are no - matching fields. It never returns null. - - the name of the field - - a String[] of field values - - - - Returns an array of byte arrays for of the fields that have the name specified - as the method parameter. This method returns an empty - array when there are no matching fields. It never - returns null. - - - the name of the field - - a byte[][] of binary field values - - - - Returns an array of bytes for the first (or only) field that has the name - specified as the method parameter. This method will return null - if no binary fields with the specified name are available. - There may be non-binary fields with the same name. - - - the name of the field. - - a byte[] containing the binary field value or null - - - - Prints the fields of a document for human consumption. - - - - Stemmer, implementing the Porter Stemming Algorithm - - The Stemmer class transforms a word into its root form. The input - word can be provided a character at time (by calling add()), or at once - by calling one of the various stem(something) methods. - - - - reset() resets the stemmer so it can stem another word. If you invoke - the stemmer by calling add(char) and then stem(), you must call reset() - before starting another word. - - - - Add a character to the word being stemmed. When you are finished - adding characters, you can call stem(void) to process the word. - - - - After a word has been stemmed, it can be retrieved by toString(), - or a reference to the internal buffer can be retrieved by getResultBuffer - and getResultLength (which is generally more efficient.) - - - - Returns the length of the word resulting from the stemming process. - - - Returns a reference to a character buffer containing the results of - the stemming process. You also need to consult getResultLength() - to determine the length of the result. - - - - Stem a word provided as a String. Returns the result as a String. - - - Stem a word contained in a char[]. Returns true if the stemming process - resulted in a word different from the input. You can retrieve the - result with getResultLength()/getResultBuffer() or toString(). - - - - Stem a word contained in a portion of a char[] array. Returns - true if the stemming process resulted in a word different from - the input. You can retrieve the result with - getResultLength()/getResultBuffer() or toString(). - - - - Stem a word contained in a leading portion of a char[] array. - Returns true if the stemming process resulted in a word different - from the input. You can retrieve the result with - getResultLength()/getResultBuffer() or toString(). - - - - Stem the word placed into the Stemmer buffer through calls to add(). - Returns true if the stemming process resulted in a word different - from the input. You can retrieve the result with - getResultLength()/getResultBuffer() or toString(). - - - - Test program for demonstrating the Stemmer. It reads a file and - stems each word, writing the result to standard out. - Usage: Stemmer file-name - - - - An iterator to iterate over set bits in an OpenBitSet. - This is faster than nextSetBit() for iterating over the complete set of bits, - especially when the density of the bits set is high. - - - $Id$ - - - - ** the python code that generated bitlist - def bits2int(val): - arr=0 - for shift in range(8,0,-1): - if val & 0x80: - arr = (arr << 4) | shift - val = val << 1 - return arr - def int_table(): - tbl = [ hex(bits2int(val)).strip('L') for val in range(256) ] - return ','.join(tbl) - **** - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - use {@link #DocID()} instead. - - - - Some useful constants. - - - - $Id: Constants.java 828327 2009-10-22 06:47:40Z uschindler $ - - - - - The value of System.getProperty("java.version"). * - - - True iff this is Java version 1.1. - - - True iff this is Java version 1.2. - - - True iff this is Java version 1.3. - - - The value of System.getProperty("os.name"). * - - - True iff running on Linux. - - - True iff running on Windows. - - - True iff running on SunOS. - - - Optimized implementation of a vector of bits. This is more-or-less like - java.util.BitSet, but also includes the following: -
      -
    • a count() method, which efficiently computes the number of one bits;
    • -
    • optimized read from and write to disk;
    • -
    • inlinable get() method;
    • -
    • store and load, as bit set or d-gaps, depending on sparseness;
    • -
    -
    - $Id: BitVector.java 765649 2009-04-16 14:29:26Z mikemccand $ - -
    - - Constructs a vector capable of holding n bits. - - - Sets the value of bit to one. - - - Sets the value of bit to true, and - returns true if bit was already set - - - - Sets the value of bit to zero. - - - Returns true if bit is one and - false if it is zero. - - - - Returns the number of bits in this vector. This is also one greater than - the number of the largest valid bit number. - - - - Returns the total number of one bits in this vector. This is efficiently - computed and cached, so that, if the vector is not changed, no - recomputation is done for repeated calls. - - - - - For testing - - - - Writes this vector to the file name in Directory - d, in a format that can be read by the constructor {@link - #BitVector(Directory, String)}. - - - - Write as a bit set - - - Write as a d-gaps list - - - Indicates if the bit vector is sparse and should be saved as a d-gaps list, or dense, and should be saved as a bit set. - - - Constructs a bit vector from the file name in Directory - d, as written by the {@link #write} method. - - - - Read as a bit set - - - read as a d-gaps list - - - Retrieve a subset of this BitVector. - - - starting index, inclusive - - ending index, exclusive - - subset - - - - - - - - - - - The original list of terms from the query, can contain duplicates - - - - Implements parallel search over a set of Searchables. - -

    Applications usually need only call the inherited {@link #Search(Query)} - or {@link #Search(Query,Filter)} methods. -

    -
    - - Creates a searchable which searches searchables. - - - TODO: parallelize this one too - - - A search implementation which spans a new thread for each - Searchable, waits for each search to complete and merge - the results back together. - - - - A search implementation allowing sorting which spans a new thread for each - Searchable, waits for each search to complete and merges - the results back together. - - - - Lower-level search API. - -

    {@link Collector#Collect(int)} is called for every matching document. - -

    Applications should only use this if they need all of the - matching documents. The high-level search API ({@link - Searcher#Search(Query)}) is usually more efficient, as it skips - non-high-scoring hits. - -

    - to match documents - - if non-null, a bitset used to eliminate some documents - - to receive hits - - TODO: parallelize this one too - -
    - - A thread subclass for searching a single searchable - - - An iterator over {@link Hits} that provides lazy fetching of each document. - {@link Hits#Iterator()} returns an instance of this class. Calls to {@link #next()} - return a {@link Hit} instance. - - - Use {@link TopScoreDocCollector} and {@link TopDocs} instead. Hits will be removed in Lucene 3.0. - - - - Constructed from {@link Hits#Iterator()}. - - - true if current hit is less than the total number of {@link Hits}. - - - - Unsupported operation. - - - UnsupportedOperationException - - - Returns the total number of hits. - - - Returns a {@link Hit} instance representing the next hit in {@link Hits}. - - - Next {@link Hit}. - - - - Implements the fuzzy search query. The similarity measurement - is based on the Levenshtein (edit distance) algorithm. - - Warning: this query is not very scalable with its default prefix - length of 0 - in this case, *every* term will be enumerated and - cause an edit score calculation. - - - - - Create a new FuzzyQuery that will match terms with a similarity - of at least minimumSimilarity to term. - If a prefixLength > 0 is specified, a common prefix - of that length is also required. - - - the term to search for - - a value between 0 and 1 to set the required similarity - between the query term and the matching terms. For example, for a - minimumSimilarity of 0.5 a term of the same length - as the query term is considered similar to the query term if the edit distance - between both terms is less than length(term)*0.5 - - length of common (non-fuzzy) prefix - - IllegalArgumentException if minimumSimilarity is >= 1 or < 0 - or if prefixLength < 0 - - - - Calls {@link #FuzzyQuery(Term, float) FuzzyQuery(term, minimumSimilarity, 0)}. - - - Calls {@link #FuzzyQuery(Term, float) FuzzyQuery(term, 0.5f, 0)}. - - - Returns the minimum similarity that is required for this query to match. - float value between 0.0 and 1.0 - - - - Returns the non-fuzzy prefix length. This is the number of characters at the start - of a term that must be identical (not fuzzy) to the query term if the query - is to match that term. - - - - Returns the pattern term. - - - Expert: obtains short field values from the - {@link Lucene.Net.Search.FieldCache FieldCache} - using getShorts() and makes those values - available as other numeric types, casting as needed. - -

    - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

    - for requirements - on the field. - -

    NOTE: with the switch in 2.9 to segment-based - searching, if {@link #getValues} is invoked with a - composite (multi-segment) reader, this can easily cause - double RAM usage for the values in the FieldCache. It's - best to switch your application to pass only atomic - (single segment) readers to this API. Alternatively, for - a short-term fix, you could wrap your ValueSource using - {@link MultiValueSource}, which costs more CPU per lookup - but will not consume double the FieldCache RAM.

    - - - -

    Create a cached short field source with default string-to-short parser. -
    - - Create a cached short field source with a specific string-to-short parser. - - - Query that sets document score as a programmatic function of several (sub) scores: -
      -
    1. the score of its subQuery (any query)
    2. -
    3. (optional) the score of its ValueSourceQuery (or queries). - For most simple/convenient use cases this query is likely to be a - {@link Lucene.Net.Search.Function.FieldScoreQuery FieldScoreQuery}
    4. -
    - Subclasses can modify the computation by overriding {@link #getCustomScoreProvider}. - -

    - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. -

    -
    - - Create a CustomScoreQuery over input subQuery. - the sub query whose scored is being customed. Must not be null. - - - - Create a CustomScoreQuery over input subQuery and a {@link ValueSourceQuery}. - the sub query whose score is being customed. Must not be null. - - a value source query whose scores are used in the custom score - computation. For most simple/convineient use case this would be a - {@link Lucene.Net.Search.Function.FieldScoreQuery FieldScoreQuery}. - This parameter is optional - it can be null or even an empty array. - - - - Create a CustomScoreQuery over input subQuery and a {@link ValueSourceQuery}. - the sub query whose score is being customized. Must not be null. - - value source queries whose scores are used in the custom score - computation. For most simple/convenient use case these would be - {@link Lucene.Net.Search.Function.FieldScoreQuery FieldScoreQueries}. - This parameter is optional - it can be null or even an empty array. - - - - Returns true if o is equal to this. - - - Returns a hash code value for this object. - - - Returns a {@link CustomScoreProvider} that calculates the custom scores - for the given {@link IndexReader}. The default implementation returns a default - implementation as specified in the docs of {@link CustomScoreProvider}. - @since 2.9.2 - - - - Compute a custom score by the subQuery score and a number of - ValueSourceQuery scores. - - The doc is relative to the current reader, which is - unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9). - Please override {@link #getCustomScoreProvider} and return a subclass - of {@link CustomScoreProvider} for the given {@link IndexReader}. - see CustomScoreProvider#customScore(int,float,float[]) - - - - Compute a custom score by the subQuery score and the ValueSourceQuery score. - - The doc is relative to the current reader, which is - unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9). - Please override {@link #getCustomScoreProvider} and return a subclass - of {@link CustomScoreProvider} for the given {@link IndexReader}. - @see CustomScoreProvider#customScore(int,float,float) - - - - Explain the custom score. - - The doc is relative to the current reader, which is - unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9). - Please override {@link #getCustomScoreProvider} and return a subclass - of {@link CustomScoreProvider} for the given {@link IndexReader}. - - - - Explain the custom score. - The doc is relative to the current reader, which is - unknown to CustomScoreQuery when using per-segment search (since Lucene 2.9). - Please override {@link #getCustomScoreProvider} and return a subclass - of {@link CustomScoreProvider} for the given {@link IndexReader}. - - - - Checks if this is strict custom scoring. - In strict custom scoring, the ValueSource part does not participate in weight normalization. - This may be useful when one wants full control over how scores are modified, and does - not care about normalizing by the ValueSource part. - One particular case where this is useful if for testing this query. -

    - Note: only has effect when the ValueSource part is not null. -

    -
    - - Set the strict mode of this query. - The strict mode to set. - - - - - - A short name of this query, used in {@link #ToString(String)}. - - - A scorer that applies a (callback) function on scores of the subQuery. - - - use {@link #NextDoc()} instead. - - - - use {@link #DocID()} instead. - - - - use {@link #Advance(int)} instead. - - - - Filter caching singleton. It can be used - to save filters locally for reuse. - This class makes it possble to cache Filters even when using RMI, as it - keeps the cache on the seaercher side of the RMI connection. - - Also could be used as a persistent storage for any filter as long as the - filter provides a proper hashCode(), as that is used as the key in the cache. - - The cache is periodically cleaned up from a separate thread to ensure the - cache doesn't exceed the maximum size. - - - - The default maximum number of Filters in the cache - - - The default frequency of cache clenup - - - The cache itself - - - Maximum allowed cache size - - - Cache cleaning frequency - - - Cache cleaner that runs in a separate thread - - - Sets up the FilterManager singleton. - - - Sets the max size that cache should reach before it is cleaned up - maximum allowed cache size - - - - Sets the cache cleaning frequency in milliseconds. - cleaning frequency in millioseconds - - - - Returns the cached version of the filter. Allows the caller to pass up - a small filter but this will keep a persistent version around and allow - the caching filter to do its job. - - - The input filter - - The cached version of the filter - - - - Holds the filter and the last time the filter was used, to make LRU-based - cache cleaning possible. - TODO: Clean this up when we switch to Java 1.5 - - - - Keeps the cache from getting too big. - If we were using Java 1.5, we could use LinkedHashMap and we would not need this thread - to clean out the cache. - - The SortedSet sortedFilterItems is used only to sort the items from the cache, - so when it's time to clean up we have the TreeSet sort the FilterItems by - timestamp. - - Removes 1.5 * the numbers of items to make the cache smaller. - For example: - If cache clean size is 10, and the cache is at 15, we would remove (15 - 10) * 1.5 = 7.5 round up to 8. - This way we clean the cache a bit more, and avoid having the cache cleaner having to do it frequently. - - - - A query that generates the union of documents produced by its subqueries, and that scores each document with the maximum - score for that document as produced by any subquery, plus a tie breaking increment for any additional matching subqueries. - This is useful when searching for a word in multiple fields with different boost factors (so that the fields cannot be - combined equivalently into a single search field). We want the primary score to be the one associated with the highest boost, - not the sum of the field scores (as BooleanQuery would give). - If the query is "albino elephant" this ensures that "albino" matching one field and "elephant" matching - another gets a higher score than "albino" matching both fields. - To get this result, use both BooleanQuery and DisjunctionMaxQuery: for each term a DisjunctionMaxQuery searches for it in - each field, while the set of these DisjunctionMaxQuery's is combined into a BooleanQuery. - The tie breaker capability allows results that include the same term in multiple fields to be judged better than results that - include this term in only the best of those multiple fields, without confusing this with the better case of two different terms - in the multiple fields. - - - - Creates a new empty DisjunctionMaxQuery. Use add() to add the subqueries. - the score of each non-maximum disjunct for a document is multiplied by this weight - and added into the final score. If non-zero, the value should be small, on the order of 0.1, which says that - 10 occurrences of word in a lower-scored field that is also in a higher scored field is just as good as a unique - word in the lower scored field (i.e., one that is not in any higher scored field. - - - - Creates a new DisjunctionMaxQuery - a Collection<Query> of all the disjuncts to add - - the weight to give to each matching non-maximum disjunct - - - - Add a subquery to this disjunction - the disjunct added - - - - Add a collection of disjuncts to this disjunction - via Iterable - - - - An Iterator<Query> over the disjuncts - - - Optimize our representation and our subqueries representations - the IndexReader we query - - an optimized copy of us (which may not be a copy if there is nothing to optimize) - - - - Create a shallow copy of us -- used in rewriting if necessary - a copy of us (but reuse, don't copy, our subqueries) - - - - Prettyprint us. - the field to which we are applied - - a string that shows what we do, of the form "(disjunct1 | disjunct2 | ... | disjunctn)^boost" - - - - Return true iff we represent the same query as o - another object - - true iff o is a DisjunctionMaxQuery with the same boost and the same subqueries, in the same order, as us - - - - Compute a hash code for hashing us - the hash code - - - - Expert: the Weight for DisjunctionMaxQuery, used to - normalize, score and explain these queries. - -

    NOTE: this API and implementation is subject to - change suddenly in the next release.

    -

    -
    - - The Similarity implementation. - - - The Weights for our subqueries, in 1-1 correspondence with disjuncts - - - A QueryParser which constructs queries to search multiple fields. - - - $Revision: 829134 $ - - - - Creates a MultiFieldQueryParser. Allows passing of a map with term to - Boost, and the boost to apply to each term. - -

    - It will, when parse(String query) is called, construct a query like this - (assuming the query consists of two terms and you specify the two fields - title and body): -

    - - - (title:term1 body:term1) (title:term2 body:term2) - - -

    - When setDefaultOperator(AND_OPERATOR) is set, the result will be: -

    - - - +(title:term1 body:term1) +(title:term2 body:term2) - - -

    - When you pass a boost (title=>5 body=>10) you can get -

    - - - +(title:term1^5.0 body:term1^10.0) +(title:term2^5.0 body:term2^10.0) - - -

    - In other words, all the query's terms must appear, but it doesn't matter - in what fields they appear. -

    - -

    - Please use - {@link #MultiFieldQueryParser(Version, String[], Analyzer, Map)} - instead - -
    - - Creates a MultiFieldQueryParser. Allows passing of a map with term to - Boost, and the boost to apply to each term. - -

    - It will, when parse(String query) is called, construct a query like this - (assuming the query consists of two terms and you specify the two fields - title and body): -

    - - - (title:term1 body:term1) (title:term2 body:term2) - - -

    - When setDefaultOperator(AND_OPERATOR) is set, the result will be: -

    - - - +(title:term1 body:term1) +(title:term2 body:term2) - - -

    - When you pass a boost (title=>5 body=>10) you can get -

    - - - +(title:term1^5.0 body:term1^10.0) +(title:term2^5.0 body:term2^10.0) - - -

    - In other words, all the query's terms must appear, but it doesn't matter - in what fields they appear. -

    -

    -
    - - Creates a MultiFieldQueryParser. - -

    - It will, when parse(String query) is called, construct a query like this - (assuming the query consists of two terms and you specify the two fields - title and body): -

    - - - (title:term1 body:term1) (title:term2 body:term2) - - -

    - When setDefaultOperator(AND_OPERATOR) is set, the result will be: -

    - - - +(title:term1 body:term1) +(title:term2 body:term2) - - -

    - In other words, all the query's terms must appear, but it doesn't matter - in what fields they appear. -

    - -

    - Please use - {@link #MultiFieldQueryParser(Version, String[], Analyzer)} - instead - -
    - - Creates a MultiFieldQueryParser. - -

    - It will, when parse(String query) is called, construct a query like this - (assuming the query consists of two terms and you specify the two fields - title and body): -

    - - - (title:term1 body:term1) (title:term2 body:term2) - - -

    - When setDefaultOperator(AND_OPERATOR) is set, the result will be: -

    - - - +(title:term1 body:term1) +(title:term2 body:term2) - - -

    - In other words, all the query's terms must appear, but it doesn't matter - in what fields they appear. -

    -

    -
    - - Parses a query which searches on the fields specified. -

    - If x fields are specified, this effectively constructs: - -

    -            <code>
    -            (field1:query1) (field2:query2) (field3:query3)...(fieldx:queryx)
    -            </code>
    -            
    - -
    - Queries strings to parse - - Fields to search on - - Analyzer to use - - ParseException - if query parsing fails - - IllegalArgumentException - if the length of the queries array differs from the length of - the fields array - - Use {@link #Parse(Version,String[],String[],Analyzer)} - instead - -
    - - Parses a query which searches on the fields specified. -

    - If x fields are specified, this effectively constructs: - -

    -            <code>
    -            (field1:query1) (field2:query2) (field3:query3)...(fieldx:queryx)
    -            </code>
    -            
    - -
    - Lucene version to match; this is passed through to - QueryParser. - - Queries strings to parse - - Fields to search on - - Analyzer to use - - ParseException - if query parsing fails - - IllegalArgumentException - if the length of the queries array differs from the length of - the fields array - -
    - - Parses a query, searching on the fields specified. - Use this if you need to specify certain fields as required, - and others as prohibited. -

    -            Usage:
    -            
    -            String[] fields = {"filename", "contents", "description"};
    -            BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD,
    -            BooleanClause.Occur.MUST,
    -            BooleanClause.Occur.MUST_NOT};
    -            MultiFieldQueryParser.parse("query", fields, flags, analyzer);
    -            
    -            
    -

    - The code above would construct a query: -

    -            
    -            (filename:query) +(contents:query) -(description:query)
    -            
    -            
    - -
    - Query string to parse - - Fields to search on - - Flags describing the fields - - Analyzer to use - - ParseException if query parsing fails - IllegalArgumentException if the length of the fields array differs - from the length of the flags array - - Use - {@link #Parse(Version, String, String[], BooleanClause.Occur[], Analyzer)} - instead - -
    - - Parses a query, searching on the fields specified. Use this if you need - to specify certain fields as required, and others as prohibited. -

    - -

    -            Usage:
    -            <code>
    -            String[] fields = {"filename", "contents", "description"};
    -            BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD,
    -            BooleanClause.Occur.MUST,
    -            BooleanClause.Occur.MUST_NOT};
    -            MultiFieldQueryParser.parse("query", fields, flags, analyzer);
    -            </code>
    -            
    -

    - The code above would construct a query: - -

    -            <code>
    -            (filename:query) +(contents:query) -(description:query)
    -            </code>
    -            
    - -
    - Lucene version to match; this is passed through to - QueryParser. - - Query string to parse - - Fields to search on - - Flags describing the fields - - Analyzer to use - - ParseException - if query parsing fails - - IllegalArgumentException - if the length of the fields array differs from the length of - the flags array - -
    - - Parses a query, searching on the fields specified. - Use this if you need to specify certain fields as required, - and others as prohibited. -

    -            Usage:
    -            
    -            String[] query = {"query1", "query2", "query3"};
    -            String[] fields = {"filename", "contents", "description"};
    -            BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD,
    -            BooleanClause.Occur.MUST,
    -            BooleanClause.Occur.MUST_NOT};
    -            MultiFieldQueryParser.parse(query, fields, flags, analyzer);
    -            
    -            
    -

    - The code above would construct a query: -

    -            
    -            (filename:query1) +(contents:query2) -(description:query3)
    -            
    -            
    - -
    - Queries string to parse - - Fields to search on - - Flags describing the fields - - Analyzer to use - - ParseException if query parsing fails - IllegalArgumentException if the length of the queries, fields, - and flags array differ - - Used - {@link #Parse(Version, String[], String[], BooleanClause.Occur[], Analyzer)} - instead - -
    - - Parses a query, searching on the fields specified. Use this if you need - to specify certain fields as required, and others as prohibited. -

    - -

    -            Usage:
    -            <code>
    -            String[] query = {"query1", "query2", "query3"};
    -            String[] fields = {"filename", "contents", "description"};
    -            BooleanClause.Occur[] flags = {BooleanClause.Occur.SHOULD,
    -            BooleanClause.Occur.MUST,
    -            BooleanClause.Occur.MUST_NOT};
    -            MultiFieldQueryParser.parse(query, fields, flags, analyzer);
    -            </code>
    -            
    -

    - The code above would construct a query: - -

    -            <code>
    -            (filename:query1) +(contents:query2) -(description:query3)
    -            </code>
    -            
    - -
    - Lucene version to match; this is passed through to - QueryParser. - - Queries string to parse - - Fields to search on - - Flags describing the fields - - Analyzer to use - - ParseException - if query parsing fails - - IllegalArgumentException - if the length of the queries, fields, and flags array differ - -
    - - Convenience class for holding TermVector information. - - - Writes norms. Each thread X field accumulates the norms - for the doc/fields it saw, then the flush method below - merges all of these together into a single _X.nrm file. - - - - Produce _X.nrm if any document had a field with norms - not disabled - - - - Adds a new term in this field - - - Called when we are done adding terms to this field - - - Declare what fields to load normally and what fields to load lazily - - - - - - Pass in the Set of {@link Field} names to load and the Set of {@link Field} names to load lazily. If both are null, the - Document will not have any {@link Field} on it. - - A Set of {@link String} field names to load. May be empty, but not null - - A Set of {@link String} field names to load lazily. May be empty, but not null - - - - Indicate whether to load the field with the given name or not. If the {@link Field#Name()} is not in either of the - initializing Sets, then {@link Lucene.Net.Documents.FieldSelectorResult#NO_LOAD} is returned. If a Field name - is in both fieldsToLoad and lazyFieldsToLoad, lazy has precedence. - - - The {@link Field} name to check - - The {@link FieldSelectorResult} - - - - A WhitespaceTokenizer is a tokenizer that divides text at whitespace. - Adjacent sequences of non-Whitespace characters form tokens. - - - - Construct a new WhitespaceTokenizer. - - - Construct a new WhitespaceTokenizer using a given {@link AttributeSource}. - - - Construct a new WhitespaceTokenizer using a given {@link Lucene.Net.Util.AttributeSource.AttributeFactory}. - - - Collects only characters which do not satisfy - {@link Character#isWhitespace(char)}. - - - - This TokenFilter provides the ability to set aside attribute states - that have already been analyzed. This is useful in situations where multiple fields share - many common analysis steps and then go their separate ways. -

    - It is also useful for doing things like entity extraction or proper noun analysis as - part of the analysis workflow and saving off those tokens for use in another field. - -

    -            TeeSinkTokenFilter source1 = new TeeSinkTokenFilter(new WhitespaceTokenizer(reader1));
    -            TeeSinkTokenFilter.SinkTokenStream sink1 = source1.newSinkTokenStream();
    -            TeeSinkTokenFilter.SinkTokenStream sink2 = source1.newSinkTokenStream();
    -            TeeSinkTokenFilter source2 = new TeeSinkTokenFilter(new WhitespaceTokenizer(reader2));
    -            source2.addSinkTokenStream(sink1);
    -            source2.addSinkTokenStream(sink2);
    -            TokenStream final1 = new LowerCaseFilter(source1);
    -            TokenStream final2 = source2;
    -            TokenStream final3 = new EntityDetect(sink1);
    -            TokenStream final4 = new URLDetect(sink2);
    -            d.add(new Field("f1", final1));
    -            d.add(new Field("f2", final2));
    -            d.add(new Field("f3", final3));
    -            d.add(new Field("f4", final4));
    -            
    - In this example, sink1 and sink2 will both get tokens from both - reader1 and reader2 after whitespace tokenizer - and now we can further wrap any of these in extra analysis, and more "sources" can be inserted if desired. - It is important, that tees are consumed before sinks (in the above example, the field names must be - less the sink's field names). If you are not sure, which stream is consumed first, you can simply - add another sink and then pass all tokens to the sinks at once using {@link #consumeAllTokens}. - This TokenFilter is exhausted after this. In the above example, change - the example above to: -
    -            ...
    -            TokenStream final1 = new LowerCaseFilter(source1.newSinkTokenStream());
    -            TokenStream final2 = source2.newSinkTokenStream();
    -            sink1.consumeAllTokens();
    -            sink2.consumeAllTokens();
    -            ...
    -            
    - In this case, the fields can be added in any order, because the sources are not used anymore and all sinks are ready. -

    Note, the EntityDetect and URLDetect TokenStreams are for the example and do not currently exist in Lucene. -

    -
    - - Instantiates a new TeeSinkTokenFilter. - - - Returns a new {@link SinkTokenStream} that receives all tokens consumed by this stream. - - - Returns a new {@link SinkTokenStream} that receives all tokens consumed by this stream - that pass the supplied filter. - - - - - - Adds a {@link SinkTokenStream} created by another TeeSinkTokenFilter - to this one. The supplied stream will also receive all consumed tokens. - This method can be used to pass tokens from two different tees to one sink. - - - - TeeSinkTokenFilter passes all tokens to the added sinks - when itself is consumed. To be sure, that all tokens from the input - stream are passed to the sinks, you can call this methods. - This instance is exhausted after this, but all sinks are instant available. - - - - A filter that decides which {@link AttributeSource} states to store in the sink. - - - Returns true, iff the current state of the passed-in {@link AttributeSource} shall be stored - in the sink. - - - - Called by {@link SinkTokenStream#Reset()}. This method does nothing by default - and can optionally be overridden. - - - - A grammar-based tokenizer constructed with JFlex - -

    This should be a good tokenizer for most European-language documents: - -

      -
    • Splits words at punctuation characters, removing punctuation. However, a - dot that's not followed by whitespace is considered part of a token.
    • -
    • Splits words at hyphens, unless there's a number in the token, in which case - the whole token is interpreted as a product number and is not split.
    • -
    • Recognizes email addresses and internet hostnames as one token.
    • -
    - -

    Many applications have specific tokenizer needs. If this tokenizer does - not suit your application, please consider copying this source code - directory to your project and maintaining your own grammar-based tokenizer. - - -

    - You must specify the required {@link Version} compatibility when creating - StandardAnalyzer: -

    -
    -
    - - this solves a bug where HOSTs that end with '.' are identified - as ACRONYMs. It is deprecated and will be removed in the next - release. - - - - A private instance of the JFlex-constructed scanner - - - String token types that correspond to token type int constants - - - Please use {@link #TOKEN_TYPES} instead - - - - Specifies whether deprecated acronyms should be replaced with HOST type. - This is false by default to support backward compatibility. -

    - See http://issues.apache.org/jira/browse/LUCENE-1068 - -

    - this should be removed in the next release (3.0). - -
    - - Set the max allowed token length. Any token longer - than this is skipped. - - - - - - - - Creates a new instance of the {@link StandardTokenizer}. Attaches the - input to a newly created JFlex scanner. - - Use {@link #StandardTokenizer(Version, Reader)} instead - - - - Creates a new instance of the {@link Lucene.Net.Analysis.Standard.StandardTokenizer}. Attaches - the input to the newly created JFlex scanner. - - - The input reader - - Set to true to replace mischaracterized acronyms with HOST. - - See http://issues.apache.org/jira/browse/LUCENE-1068 - - Use {@link #StandardTokenizer(Version, Reader)} instead - - - - Creates a new instance of the - {@link org.apache.lucene.analysis.standard.StandardTokenizer}. Attaches - the input to the newly created JFlex scanner. - - - The input reader - - See http://issues.apache.org/jira/browse/LUCENE-1068 - - - - Creates a new StandardTokenizer with a given {@link AttributeSource}. - Use - {@link #StandardTokenizer(Version, AttributeSource, Reader)} - instead - - - - Creates a new StandardTokenizer with a given {@link AttributeSource}. - - - Creates a new StandardTokenizer with a given {@link Lucene.Net.Util.AttributeSource.AttributeFactory} - Use - {@link #StandardTokenizer(Version, org.apache.lucene.util.AttributeSource.AttributeFactory, Reader)} - instead - - - - Creates a new StandardTokenizer with a given - {@link org.apache.lucene.util.AttributeSource.AttributeFactory} - - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Prior to https://issues.apache.org/jira/browse/LUCENE-1068, StandardTokenizer mischaracterized as acronyms tokens like www.abc.com - when they should have been labeled as hosts instead. - - true if StandardTokenizer now returns these tokens as Hosts, otherwise false - - - Remove in 3.X and make true the only valid value - - - - - Set to true to replace mischaracterized acronyms as HOST. - - Remove in 3.X and make true the only valid value - - See https://issues.apache.org/jira/browse/LUCENE-1068 - - - - Class to encode java's UTF16 char[] into UTF8 byte[] - without always allocating a new byte[] as - String.getBytes("UTF-8") does. - -

    WARNING: This API is a new and experimental and - may suddenly change.

    -

    -
    - - Encode characters from a char[] source, starting at - offset and stopping when the character 0xffff is seen. - Returns the number of bytes written to bytesOut. - - - - Encode characters from a char[] source, starting at - offset for length chars. Returns the number of bytes - written to bytesOut. - - - - Encode characters from this String, starting at offset - for length characters. Returns the number of bytes - written to bytesOut. - - - - Convert UTF8 bytes into UTF16 characters. If offset - is non-zero, conversion starts at that starting point - in utf8, re-using the results from the previous call - up until offset. - - - - Borrowed from Cglib. Allows custom swap so that two arrays can be sorted - at the same time. - - - - Helper class for keeping Listss of Objects associated with keys. WARNING: THIS CLASS IS NOT THREAD SAFE - - - the backing store for this object - - - - direct access to the map backing this object. - - - - Adds val to the Set associated with key in the Map. If key is not - already in the map, a new Set will first be created. - - the size of the Set associated with key once val is added to it. - - - - Adds multiple vals to the Set associated with key in the Map. - If key is not - already in the map, a new Set will first be created. - - the size of the Set associated with key once val is added to it. - - - - A variety of high efficiencly bit twiddling routines. - - - $Id$ - - - - Returns the number of bits set in the long - - - Returns the number of set bits in an array of longs. - - - Returns the popcount or cardinality of the two sets after an intersection. - Neither array is modified. - - - - Returns the popcount or cardinality of the union of two sets. - Neither array is modified. - - - - Returns the popcount or cardinality of A & ~B - Neither array is modified. - - - - table of number of trailing zeros in a byte - - - Returns number of trailing zeros in a 64 bit long value. - - - Returns number of trailing zeros in a 32 bit int value. - - - returns 0 based index of first set bit - (only works for x!=0) -
    This is an alternate implementation of ntz() -
    -
    - - returns 0 based index of first set bit -
    This is an alternate implementation of ntz() -
    -
    - - returns true if v is a power of two or zero - - - returns true if v is a power of two or zero - - - returns the next highest power of two, or the current value if it's already a power of two or zero - - - returns the next highest power of two, or the current value if it's already a power of two or zero - - - A memory-resident {@link Directory} implementation. Locking - implementation is by default the {@link SingleInstanceLockFactory} - but can be changed with {@link #setLockFactory}. - - - $Id: RAMDirectory.java 781333 2009-06-03 10:38:57Z mikemccand $ - - - - Constructs an empty {@link Directory}. - - - Creates a new RAMDirectory instance from a different - Directory implementation. This can be used to load - a disk-based index into memory. -

    - This should be used only with indices that can fit into memory. -

    - Note that the resulting RAMDirectory instance is fully - independent from the original Directory (it is a - complete copy). Any subsequent changes to the - original Directory will not be visible in the - RAMDirectory instance. - -

    - a Directory value - - if an error occurs - -
    - - Creates a new RAMDirectory instance from the {@link FSDirectory}. - - - a File specifying the index directory - - - - - Use {@link #RAMDirectory(Directory)} instead - - - - Creates a new RAMDirectory instance from the {@link FSDirectory}. - - - a String specifying the full index directory path - - - - - Use {@link #RAMDirectory(Directory)} instead - - - - Returns true iff the named file exists in this directory. - - - Returns the time the named file was last modified. - IOException if the file does not exist - - - Set the modified time of an existing file to now. - IOException if the file does not exist - - - Returns the length in bytes of a file in the directory. - IOException if the file does not exist - - - Return total size in bytes of all files in this - directory. This is currently quantized to - RAMOutputStream.BUFFER_SIZE. - - - - Removes an existing file in the directory. - IOException if the file does not exist - - - Renames an existing file in the directory. - FileNotFoundException if from does not exist - - - - - Creates a new, empty file in the directory with the given name. Returns a stream writing this file. - - - Returns a stream reading an existing file. - - - Closes the store to future operations, releasing associated memory. - - - - .NET - - - -

    Implements {@link LockFactory} using native OS file - locks. Note that because this LockFactory relies on - java.nio.* APIs for locking, any problems with those APIs - will cause locking to fail. Specifically, on certain NFS - environments the java.nio.* locks will fail (the lock can - incorrectly be double acquired) whereas {@link - SimpleFSLockFactory} worked perfectly in those same - environments. For NFS based access to an index, it's - recommended that you try {@link SimpleFSLockFactory} - first and work around the one limitation that a lock file - could be left when the JVM exits abnormally.

    - -

    The primary benefit of {@link NativeFSLockFactory} is - that lock files will be properly removed (by the OS) if - the JVM has an abnormal exit.

    - -

    Note that, unlike {@link SimpleFSLockFactory}, the existence of - leftover lock files in the filesystem on exiting the JVM - is fine because the OS will free the locks held against - these files even though the files still remain.

    - -

    If you suspect that this or any other LockFactory is - not working properly in your environment, you can easily - test it by using {@link VerifyingLockFactory}, {@link - LockVerifyServer} and {@link LockStressTest}.

    - -

    - - -
    - - Create a NativeFSLockFactory instance, with null (unset) - lock directory. When you pass this factory to a {@link FSDirectory} - subclass, the lock directory is automatically set to the - directory itsself. Be sure to create one instance for each directory - your create! - - - - Create a NativeFSLockFactory instance, storing lock - files into the specified lockDirName: - - - where lock files are created. - - - - Create a NativeFSLockFactory instance, storing lock - files into the specified lockDir: - - - where lock files are created. - - - - Create a NativeFSLockFactory instance, storing lock - files into the specified lockDir: - - - where lock files are created. - - - - - Represents hits returned by {@link Searcher#search(Query,Filter,int,Sort)}. - - - - The fields which were used to sort results by. - - - Creates one of these objects. - Total number of hits for the query. - - The top hits for the query. - - The sort criteria used to find the top hits. - - The maximum score encountered. - - - -

    - The TimeLimitedCollector is used to timeout search requests that take longer - than the maximum allowed search time limit. After this time is exceeded, the - search thread is stopped by throwing a TimeExceeded Exception. -

    - -

    - Use {@link TimeLimitingCollector} instead, which extends the new - {@link Collector}. This class will be removed in 3.0. - -
    - - Default timer resolution. - - - - - Default for {@link #IsGreedy()}. - - - - - Create a TimeLimitedCollector wrapper over another HitCollector with a specified timeout. - the wrapped HitCollector - - max time allowed for collecting hits after which {@link TimeExceededException} is thrown - - - - Calls collect() on the decorated HitCollector. - - - TimeExceededException if the time allowed has been exceeded. - - - Return the timer resolution. - - - - - Set the timer resolution. - The default timer resolution is 20 milliseconds. - This means that a search required to take no longer than - 800 milliseconds may be stopped after 780 to 820 milliseconds. -
    Note that: -
      -
    • Finer (smaller) resolution is more accurate but less efficient.
    • -
    • Setting resolution to less than 5 milliseconds will be silently modified to 5 milliseconds.
    • -
    • Setting resolution smaller than current resolution might take effect only after current - resolution. (Assume current resolution of 20 milliseconds is modified to 5 milliseconds, - then it can take up to 20 milliseconds for the change to have effect.
    • -
    -
    -
    - - Checks if this time limited collector is greedy in collecting the last hit. - A non greedy collector, upon a timeout, would throw a {@link TimeExceededException} - without allowing the wrapped collector to collect current doc. A greedy one would - first allow the wrapped hit collector to collect current doc and only then - throw a {@link TimeExceededException}. - - - - - - Sets whether this time limited collector is greedy. - true to make this time limited greedy - - - - - - TimerThread provides a pseudo-clock service to all searching - threads, so that they can count elapsed time with less overhead - than repeatedly calling System.currentTimeMillis. A single - thread should be created to be used for all searches. - - - - Get the timer value in milliseconds. - - - Thrown when elapsed search time exceeds allowed search time. - - - Returns allowed time (milliseconds). - - - Returns elapsed time (milliseconds). - - - Returns last doc that was collected when the search time exceeded. - - - Constrains search results to only match those which also match a provided - query. Also provides position information about where each document matches - at the cost of extra space compared with the QueryWrapperFilter. - There is an added cost to this above what is stored in a {@link QueryWrapperFilter}. Namely, - the position information for each matching document is stored. -

    - This filter does not cache. See the {@link Lucene.Net.Search.CachingSpanFilter} for a wrapper that - caches. - - -

    - $Id:$ - -
    - - Constructs a filter which only matches documents matching - query. - - The {@link Lucene.Net.Search.Spans.SpanQuery} to use as the basis for the Filter. - - - - This class is very similar to - {@link Lucene.Net.Search.Spans.SpanNearQuery} except that it factors - in the value of the payloads located at each of the positions where the - {@link Lucene.Net.Search.Spans.TermSpans} occurs. -

    - In order to take advantage of this, you must override - {@link Lucene.Net.Search.Similarity#ScorePayload(String, byte[],int,int)} - which returns 1 by default. -

    - Payload scores are aggregated using a pluggable {@link PayloadFunction}. - -

    - - -
    - - By default, uses the {@link PayloadFunction} to score the payloads, but - can be overridden to do other things. - - - The payloads - - The start position of the span being scored - - The end position of the span being scored - - - - - - - A {@link Filter} that only accepts numeric values within - a specified range. To use this, you must first index the - numeric values using {@link NumericField} (expert: {@link - NumericTokenStream}). - -

    You create a new NumericRangeFilter with the static - factory methods, eg: - -

    -            Filter f = NumericRangeFilter.newFloatRange("weight",
    -            new Float(0.3f), new Float(0.10f),
    -            true, true);
    -            
    - - accepts all documents whose float valued "weight" field - ranges from 0.3 to 0.10, inclusive. - See {@link NumericRangeQuery} for details on how Lucene - indexes and searches numeric valued fields. - -

    NOTE: This API is experimental and - might change in incompatible ways in the next - release. - -

    - 2.9 - - -
    - - Factory that creates a NumericRangeFilter, that filters a long - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeFilter, that queries a long - range using the default precisionStep {@link NumericUtils#PRECISION_STEP_DEFAULT} (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeFilter, that filters a int - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeFilter, that queries a int - range using the default precisionStep {@link NumericUtils#PRECISION_STEP_DEFAULT} (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeFilter, that filters a double - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeFilter, that queries a double - range using the default precisionStep {@link NumericUtils#PRECISION_STEP_DEFAULT} (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeFilter, that filters a float - range using the given precisionStep. - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Factory that creates a NumericRangeFilter, that queries a float - range using the default precisionStep {@link NumericUtils#PRECISION_STEP_DEFAULT} (4). - You can have half-open ranges (which are in fact </≤ or >/≥ queries) - by setting the min or max value to null. By setting inclusive to false, it will - match all documents excluding the bounds, with inclusive on, the boundaries are hits, too. - - - - Returns the field name for this filter - - - Returns true if the lower endpoint is inclusive - - - Returns true if the upper endpoint is inclusive - - - Returns the lower value of this range filter - - - Returns the upper value of this range filter - - - This class wraps another ValueSource, but protects - against accidental double RAM usage in FieldCache when - a composite reader is passed to {@link #getValues}. - -

    NOTE: this class adds a CPU penalty to every - lookup, as it must resolve the incoming document to the - right sub-reader using a binary search.

    - -

    - This class is temporary, to ease the - migration to segment-based searching. Please change your - code to not pass composite readers to these APIs. - -
    - - Fills in no-term-vectors for all docs we haven't seen - since the last doc that had term vectors. - - - - An IndexReader which reads multiple indexes, appending their content. - - - $Id: MultiReader.java 782406 2009-06-07 16:31:18Z mikemccand $ - - - -

    Construct a MultiReader aggregating the named set of (sub)readers. - Directory locking for delete, undeleteAll, and setNorm operations is - left to the subreaders.

    -

    Note that all subreaders are closed if this Multireader is closed.

    -

    - set of (sub)readers - - IOException -
    - -

    Construct a MultiReader aggregating the named set of (sub)readers. - Directory locking for delete, undeleteAll, and setNorm operations is - left to the subreaders.

    -

    - indicates whether the subreaders should be closed - when this MultiReader is closed - - set of (sub)readers - - IOException -
    - - Tries to reopen the subreaders. -
    - If one or more subreaders could be re-opened (i. e. subReader.reopen() - returned a new instance != subReader), then a new MultiReader instance - is returned, otherwise this instance is returned. -

    - A re-opened instance might share one or more subreaders with the old - instance. Index modification operations result in undefined behavior - when performed before the old instance is closed. - (see {@link IndexReader#Reopen()}). -

    - If subreaders are shared, then the reference count of those - readers is increased to ensure that the subreaders remain open - until the last referring reader is closed. - -

    - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Clones the subreaders. - (see {@link IndexReader#clone()}). -
    -

    - If subreaders are shared, then the reference count of those - readers is increased to ensure that the subreaders remain open - until the last referring reader is closed. -

    -
    - - If clone is true then we clone each of the subreaders - - - New IndexReader, or same one (this) if - reopen/clone is not necessary - - CorruptIndexException - IOException - - - - - - - Checks recursively if all subreaders are up to date. - - - Not implemented. - UnsupportedOperationException - - - Add a new position & payload. If payloadLength > 0 - you must read those bytes from the IndexInput. - - - - Called when we are done adding positions & payloads - - - Add a new position & payload - - - Called when we are done adding positions & payloads - - - Bulk write a contiguous series of documents. The - lengths array is the length (in bytes) of each raw - document. The stream IndexInput is the - fieldsStream from which we should bulk-copy all - bytes. - - - - Class responsible for access to stored document fields. -

    - It uses <segment>.fdt and <segment>.fdx; files. - -

    - $Id: FieldsReader.java 801344 2009-08-05 18:05:06Z yonik $ - -
    - - Returns a cloned FieldsReader that shares open - IndexInputs with the original one. It is the caller's - job not to close the original FieldsReader until all - clones are called (eg, currently SegmentReader manages - this logic). - - - - AlreadyClosedException if this FieldsReader is closed - - - Closes the underlying {@link Lucene.Net.Store.IndexInput} streams, including any ones associated with a - lazy implementation of a Field. This means that the Fields values will not be accessible. - - - IOException - - - Returns the length in bytes of each raw document in a - contiguous range of length numDocs starting with - startDocID. Returns the IndexInput (the fieldStream), - already seeked to the starting point for startDocID. - - - - Skip the field. We still have to read some of the information about the field, but can skip past the actual content. - This will have the most payoff on large fields. - - - - A Lazy implementation of Fieldable that differs loading of fields until asked for, instead of when the Document is - loaded. - - - - The value of the field in Binary, or null. If null, the Reader value, - String value, or TokenStream value is used. Exactly one of stringValue(), - readerValue(), binaryValue(), and tokenStreamValue() must be set. - - - - The value of the field as a Reader, or null. If null, the String value, - binary value, or TokenStream value is used. Exactly one of stringValue(), - readerValue(), binaryValue(), and tokenStreamValue() must be set. - - - - The value of the field as a TokenStream, or null. If null, the Reader value, - String value, or binary value is used. Exactly one of stringValue(), - readerValue(), binaryValue(), and tokenStreamValue() must be set. - - - - The value of the field as a String, or null. If null, the Reader value, - binary value, or TokenStream value is used. Exactly one of stringValue(), - readerValue(), binaryValue(), and tokenStreamValue() must be set. - - - - This is a DocFieldConsumer that inverts each field, - separately, from a Document, and accepts a - InvertedTermsConsumer to process those terms. - - - - Removes words that are too long or too short from the stream. - - - - $Id: LengthFilter.java 807201 2009-08-24 13:22:34Z markrmiller $ - - - - Build a filter that removes words that are too long or too - short from the text. - - - - Returns the next input Token whose term() is the right len - - - Helper methods to ease implementing {@link Object#toString()}. - - - for printing boost only if not 1.0 - - - Expert: - Public for extension only - - - - Encapsulates sort criteria for returned hits. - -

    The fields used to determine sort order must be carefully chosen. - Documents must contain a single term in such a field, - and the value of the term should indicate the document's relative position in - a given sort order. The field must be indexed, but should not be tokenized, - and does not need to be stored (unless you happen to want it back with the - rest of your document data). In other words: - -

    document.add (new Field ("byNumber", Integer.toString(x), Field.Store.NO, Field.Index.NOT_ANALYZED));

    - - -

    Valid Types of Values

    - -

    There are four possible kinds of term values which may be put into - sorting fields: Integers, Longs, Floats, or Strings. Unless - {@link SortField SortField} objects are specified, the type of value - in the field is determined by parsing the first term in the field. - -

    Integer term values should contain only digits and an optional - preceding negative sign. Values must be base 10 and in the range - Integer.MIN_VALUE and Integer.MAX_VALUE inclusive. - Documents which should appear first in the sort - should have low value integers, later documents high values - (i.e. the documents should be numbered 1..n where - 1 is the first and n the last). - -

    Long term values should contain only digits and an optional - preceding negative sign. Values must be base 10 and in the range - Long.MIN_VALUE and Long.MAX_VALUE inclusive. - Documents which should appear first in the sort - should have low value integers, later documents high values. - -

    Float term values should conform to values accepted by - {@link Float Float.valueOf(String)} (except that NaN - and Infinity are not supported). - Documents which should appear first in the sort - should have low values, later documents high values. - -

    String term values can contain any valid String, but should - not be tokenized. The values are sorted according to their - {@link Comparable natural order}. Note that using this type - of term value has higher memory requirements than the other - two types. - -

    Object Reuse

    - -

    One of these objects can be - used multiple times and the sort order changed between usages. - -

    This class is thread safe. - -

    Memory Usage

    - -

    Sorting uses of caches of term values maintained by the - internal HitQueue(s). The cache is static and contains an integer - or float array of length IndexReader.maxDoc() for each field - name for which a sort is performed. In other words, the size of the - cache in bytes is: - -

    4 * IndexReader.maxDoc() * (# of different fields actually used to sort) - -

    For String fields, the cache is larger: in addition to the - above array, the value of every term in the field is kept in memory. - If there are many unique terms in the field, this could - be quite large. - -

    Note that the size of the cache is not affected by how many - fields are in the index and might be used to sort - only by - the ones actually used to sort a result set. - -

    Created: Feb 12, 2004 10:53:57 AM - -

    - lucene 1.4 - - $Id: Sort.java 795179 2009-07-17 18:23:30Z mikemccand $ - -
    - - Represents sorting by computed relevance. Using this sort criteria returns - the same results as calling - {@link Searcher#Search(Query) Searcher#search()}without a sort criteria, - only with slightly more overhead. - - - - Represents sorting by index order. - - - Sorts by computed relevance. This is the same sort criteria as calling - {@link Searcher#Search(Query) Searcher#search()}without a sort criteria, - only with slightly more overhead. - - - - Sorts by the terms in field then by index order (document - number). The type of value in field is determined - automatically. - - - - - Please specify the type explicitly by - first creating a {@link SortField} and then use {@link - #Sort(SortField)} - - - - Sorts possibly in reverse by the terms in field then by - index order (document number). The type of value in field is - determined automatically. - - - - - Please specify the type explicitly by - first creating a {@link SortField} and then use {@link - #Sort(SortField)} - - - - Sorts in succession by the terms in each field. The type of value in - field is determined automatically. - - - - - Please specify the type explicitly by - first creating {@link SortField}s and then use {@link - #Sort(SortField[])} - - - - Sorts by the criteria in the given SortField. - - - Sorts in succession by the criteria in each SortField. - - - Sets the sort to the terms in field then by index order - (document number). - - Please specify the type explicitly by - first creating a {@link SortField} and then use {@link - #SetSort(SortField)} - - - - Sets the sort to the terms in field possibly in reverse, - then by index order (document number). - - Please specify the type explicitly by - first creating a {@link SortField} and then use {@link - #SetSort(SortField)} - - - - Sets the sort to the terms in each field in succession. - Please specify the type explicitly by - first creating {@link SortField}s and then use {@link - #SetSort(SortField[])} - - - - Sets the sort to the given criteria. - - - Sets the sort to the given criteria in succession. - - - Representation of the sort criteria. - Array of SortField objects used in this sort criteria - - - - Returns true if o is equal to this. - - - Returns a hash code value for this object. - - - Expert: Compares two ScoreDoc objects for sorting. - -

    Created: Feb 3, 2004 9:00:16 AM - -

    - lucene 1.4 - - $Id: ScoreDocComparator.java 738219 2009-01-27 20:15:21Z mikemccand $ - - use {@link FieldComparator} - -
    - - Special comparator for sorting hits according to computed relevance (document score). - - - Special comparator for sorting hits according to index order (document number). - - - A Query that matches documents containing terms with a specified prefix. A PrefixQuery - is built by QueryParser for input like app*. - -

    This query uses the {@link - MultiTermQuery#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT} - rewrite method. -

    -
    - - Constructs a query for terms starting with prefix. - - - Returns the prefix of this query. - - - Prints a user-readable version of this query. - - - Expert: A hit queue for sorting by hits by terms in more than one field. - Uses FieldCache.DEFAULT for maintaining - internal term lookup tables. - - This class will not resolve SortField.AUTO types, and expects the type - of all SortFields used for construction to already have been resolved. - {@link SortField#DetectFieldType(IndexReader, String)} is a utility method which - may be used for field type detection. - - NOTE: This API is experimental and might change in - incompatible ways in the next release. - - - 2.9 - - $Id: - - - - - - - - Creates a hit queue sorted by the given list of fields. - -

    NOTE: The instances returned by this method - pre-allocate a full array of length numHits. - -

    - SortField array we are sorting by in priority order (highest - priority first); cannot be null or empty - - The number of hits to retain. Must be greater than zero. - - IOException -
    - - Stores the sort criteria being used. - - - Given a queue Entry, creates a corresponding FieldDoc - that contains the values used to sort the given document. - These values are not the raw values out of the index, but the internal - representation of them. This is so the given search hit can be collated by - a MultiSearcher with other search hits. - - - The Entry used to create a FieldDoc - - The newly created FieldDoc - - - - - - Returns the SortFields being used by this hit queue. - - - An implementation of {@link FieldValueHitQueue} which is optimized in case - there is just one comparator. - - - - Returns whether a is less relevant than b. - ScoreDoc - - ScoreDoc - - true if document a should be sorted after document b. - - - - An implementation of {@link FieldValueHitQueue} which is optimized in case - there is more than one comparator. - - - - Provides a {@link FieldComparator} for custom field sorting. - - NOTE: This API is experimental and might change in - incompatible ways in the next release. - - - - - Creates a comparator for the field in the given index. - - - Name of the field to create comparator for. - - FieldComparator. - - IOException - If an error occurs reading the index. - - - - A {@link Filter} that only accepts documents whose single - term value in the specified field is contained in the - provided set of allowed terms. - -

    - - This is the same functionality as TermsFilter (from - contrib/queries), except this filter requires that the - field contains only a single term for all documents. - Because of drastically different implementations, they - also have different performance characteristics, as - described below. - -

    - - The first invocation of this filter on a given field will - be slower, since a {@link FieldCache.StringIndex} must be - created. Subsequent invocations using the same field - will re-use this cache. However, as with all - functionality based on {@link FieldCache}, persistent RAM - is consumed to hold the cache, and is not freed until the - {@link IndexReader} is closed. In contrast, TermsFilter - has no persistent RAM consumption. - - -

    - - With each search, this filter translates the specified - set of Terms into a private {@link OpenBitSet} keyed by - term number per unique {@link IndexReader} (normally one - reader per segment). Then, during matching, the term - number for each docID is retrieved from the cache and - then checked for inclusion using the {@link OpenBitSet}. - Since all testing is done using RAM resident data - structures, performance should be very fast, most likely - fast enough to not require further caching of the - DocIdSet for each possible combination of terms. - However, because docIDs are simply scanned linearly, an - index with a great many small documents may find this - linear scan too costly. - -

    - - In contrast, TermsFilter builds up an {@link OpenBitSet}, - keyed by docID, every time it's created, by enumerating - through all matching docs using {@link TermDocs} to seek - and scan through each term's docID list. While there is - no linear scan of all docIDs, besides the allocation of - the underlying array in the {@link OpenBitSet}, this - approach requires a number of "disk seeks" in proportion - to the number of terms, which can be exceptionally costly - when there are cache misses in the OS's IO cache. - -

    - - Generally, this filter will be slower on the first - invocation for a given field, but subsequent invocations, - even if you change the allowed set of Terms, should be - faster than TermsFilter, especially as the number of - Terms being matched increases. If you are matching only - a very small number of terms, and those terms in turn - match a very small number of documents, TermsFilter may - perform faster. - -

    - - Which filter is best is very application dependent. -

    -
    - - This DocIdSet implementation is cacheable. - - - use {@link #DocID()} instead. - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - Expert: Default scoring implementation. - - - Implemented as - state.getBoost()*lengthNorm(numTerms), where - numTerms is {@link FieldInvertState#GetLength()} if {@link - #setDiscountOverlaps} is false, else it's {@link - FieldInvertState#GetLength()} - {@link - FieldInvertState#GetNumOverlap()}. - -

    WARNING: This API is new and experimental, and may suddenly - change.

    -

    -
    - - Implemented as 1/sqrt(numTerms). - - - Implemented as 1/sqrt(sumOfSquaredWeights). - - - Implemented as sqrt(freq). - - - Implemented as 1 / (distance + 1). - - - Implemented as log(numDocs/(docFreq+1)) + 1. - - - Implemented as overlap / maxOverlap. - - - Determines whether overlap tokens (Tokens with - 0 position increment) are ignored when computing - norm. By default this is false, meaning overlap - tokens are counted just like non-overlap tokens. - -

    WARNING: This API is new and experimental, and may suddenly - change.

    - -

    - - -
    - - - - - - MessageBundles classes extend this class, to implement a bundle. - - For Native Language Support (NLS), system of software internationalization. - - This interface is similar to the NLS class in eclipse.osgi.util.NLS class - - initializeMessages() method resets the values of all static strings, should - only be called by classes that extend from NLS (see TestMessages.java for - reference) - performs validation of all message in a bundle, at class load - time - performs per message validation at runtime - see NLSTest.java for - usage reference - - MessageBundle classes may subclass this type. - - - - Initialize a given class with the message bundle Keys Should be called from - a class that extends NLS in a static block at class load time. - - - Property file with that contains the message bundle - - where constants will reside - - - - - - - - - - - - - - - Message Key - - - - - Performs the priviliged action. - - A value that may represent the result of the action. - - - This stores a monotonically increasing set of <Term, TermInfo> pairs in a - Directory. A TermInfos can be written once, in order. - - - - The file format version, a negative number. - - - Expert: The fraction of terms in the "dictionary" which should be stored - in RAM. Smaller values use more memory, but make searching slightly - faster, while larger values use less memory and make searching slightly - slower. Searching is typically not dominated by dictionary lookup, so - tweaking this is rarely useful. - - - - Expert: The fraction of {@link TermDocs} entries stored in skip tables, - used to accellerate {@link TermDocs#SkipTo(int)}. Larger values result in - smaller indexes, greater acceleration, but fewer accelerable cases, while - smaller values result in bigger indexes, less acceleration and more - accelerable cases. More detailed experiments would be useful here. - - - - Expert: The maximum number of skip levels. Smaller values result in - slightly smaller indexes, but slower skipping in big posting lists. - - - - Adds a new <fieldNumber, termBytes>, TermInfo> pair to the set. - Term must be lexicographically greater than all previous Terms added. - TermInfo pointers must be positive and greater than all previous. - - - - Called to complete TermInfos creation. - - - This stores a monotonically increasing set of <Term, TermInfo> pairs in a - Directory. Pairs are accessed either by Term or by ordinal position the - set. - - - - Returns the number of term/value pairs in the set. - - - Returns the offset of the greatest index entry which is less than or equal to term. - - - Returns the TermInfo for a Term in the set, or null. - - - Returns the TermInfo for a Term in the set, or null. - - - Returns the position of a Term in the set or -1. - - - Returns an enumeration of all the Terms and TermInfos in the set. - - - Returns an enumeration of terms starting at or after the named term. - - - Per-thread resources managed by ThreadLocal - - - Increments the enumeration to the next element. True if one exists. - - - Optimized scan, without allocating new terms. - Return number of invocations to next(). - - - - Returns the current Term in the enumeration. - Initially invalid, valid after next() called for the first time. - - - - Returns the previous Term enumerated. Initially null. - - - Returns the current TermInfo in the enumeration. - Initially invalid, valid after next() called for the first time. - - - - Sets the argument to the current TermInfo in the enumeration. - Initially invalid, valid after next() called for the first time. - - - - Returns the docFreq from the current TermInfo in the enumeration. - Initially invalid, valid after next() called for the first time. - - - - Closes the enumeration to further activity, freeing resources. - - - Provides support for converting longs to Strings, and back again. The strings - are structured so that lexicographic sorting order is preserved. - -

    - That is, if l1 is less than l2 for any two longs l1 and l2, then - NumberTools.longToString(l1) is lexicographically less than - NumberTools.longToString(l2). (Similarly for "greater than" and "equals".) - -

    - This class handles all long values (unlike - {@link Lucene.Net.Documents.DateField}). - -

    - For new indexes use {@link NumericUtils} instead, which - provides a sortable binary representation (prefix encoded) of numeric - values. - To index and efficiently query numeric values use {@link NumericField} - and {@link NumericRangeQuery}. - This class is included for use with existing - indices and will be removed in a future release. - -
    - - Equivalent to longToString(Long.MIN_VALUE) - - - Equivalent to longToString(Long.MAX_VALUE) - - - The length of (all) strings returned by {@link #longToString} - - - Converts a long to a String suitable for indexing. - - - Converts a String that was returned by {@link #longToString} back to a - long. - - - IllegalArgumentException - if the input is null - - NumberFormatException - if the input does not parse (it was not a String returned by - longToString()). - - - - Provides information about what should be done with this Field - - - - - - Load this {@link Field} every time the {@link Document} is loaded, reading in the data as it is encountered. - {@link Document#GetField(String)} and {@link Document#GetFieldable(String)} should not return null. -

    - {@link Document#Add(Fieldable)} should be called by the Reader. -

    -
    - - Lazily load this {@link Field}. This means the {@link Field} is valid, but it may not actually contain its data until - invoked. {@link Document#GetField(String)} SHOULD NOT BE USED. {@link Document#GetFieldable(String)} is safe to use and should - return a valid instance of a {@link Fieldable}. -

    - {@link Document#Add(Fieldable)} should be called by the Reader. -

    -
    - - Do not load the {@link Field}. {@link Document#GetField(String)} and {@link Document#GetFieldable(String)} should return null. - {@link Document#Add(Fieldable)} is not called. -

    - {@link Document#Add(Fieldable)} should not be called by the Reader. -

    -
    - - Load this field as in the {@link #LOAD} case, but immediately return from {@link Field} loading for the {@link Document}. Thus, the - Document may not have its complete set of Fields. {@link Document#GetField(String)} and {@link Document#GetFieldable(String)} should - both be valid for this {@link Field} -

    - {@link Document#Add(Fieldable)} should be called by the Reader. -

    -
    - - Behaves much like {@link #LOAD} but does not uncompress any compressed data. This is used for internal purposes. - {@link Document#GetField(String)} and {@link Document#GetFieldable(String)} should not return null. -

    - {@link Document#Add(Fieldable)} should be called by - the Reader. -

    - This is an internal option only, and is - no longer needed now that {@link CompressionTools} - is used for field compression. - -
    - - Expert: Load the size of this {@link Field} rather than its value. - Size is measured as number of bytes required to store the field == bytes for a binary or any compressed value, and 2*chars for a String value. - The size is stored as a binary value, represented as an int in a byte[], with the higher order byte first in [0] - - - - Expert: Like {@link #SIZE} but immediately break from the field loading loop, i.e., stop loading further fields, after the size is loaded - - - Emits the entire input as a single token. - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Will be removed in Lucene 3.0. This method is final, as it should - not be overridden. Delegates to the backwards compatibility layer. - - - - Replacement for Java 1.5 Character.valueOf() - Move to Character.valueOf() in 3.0 - - - - Returns a Character instance representing the given char value - - - a char value - - a Character representation of the given char value. - - - - File-based {@link Directory} implementation that uses - mmap for reading, and {@link - SimpleFSDirectory.SimpleFSIndexOutput} for writing. - -

    NOTE: memory mapping uses up a portion of the - virtual memory address space in your process equal to the - size of the file being mapped. Before using this class, - be sure your have plenty of virtual address space, e.g. by - using a 64 bit JRE, or a 32 bit JRE with indexes that are - guaranteed to fit within the address space. - On 32 bit platforms also consult {@link #setMaxChunkSize} - if you have problems with mmap failing because of fragmented - address space. If you get an OutOfMemoryException, it is recommened - to reduce the chunk size, until it works. - -

    Due to - this bug in Sun's JRE, MMapDirectory's {@link IndexInput#close} - is unable to close the underlying OS file handle. Only when GC - finally collects the underlying objects, which could be quite - some time later, will the file handle be closed. - -

    This will consume additional transient disk usage: on Windows, - attempts to delete or overwrite the files will result in an - exception; on other platforms, which typically have a "delete on - last close" semantics, while such operations will succeed, the bytes - are still consuming space on disk. For many applications this - limitation is not a problem (e.g. if you have plenty of disk space, - and you don't rely on overwriting files on Windows) but it's still - an important limitation to be aware of. - -

    This class supplies the workaround mentioned in the bug report - (disabled by default, see {@link #setUseUnmap}), which may fail on - non-Sun JVMs. It forcefully unmaps the buffer on close by using - an undocumented internal cleanup functionality. - {@link #UNMAP_SUPPORTED} is true, if the workaround - can be enabled (with no guarantees). -

    -
    - - Create a new MMapDirectory for the named location. - - - the path of the directory - - the lock factory to use, or null for the default. - - IOException - - - Create a new MMapDirectory for the named location. - - - the path of the directory - - the lock factory to use, or null for the default. - - IOException - - - Create a new MMapDirectory for the named location and the default lock factory. - - - the path of the directory - - IOException - - - Create a new MMapDirectory for the named location and the default lock factory. - - - the path of the directory - - IOException - - - - - - - true, if this platform supports unmapping mmaped files. - - - This method enables the workaround for unmapping the buffers - from address space after closing {@link IndexInput}, that is - mentioned in the bug report. This hack may fail on non-Sun JVMs. - It forcefully unmaps the buffer on close by using - an undocumented internal cleanup functionality. -

    NOTE: Enabling this is completely unsupported - by Java and may lead to JVM crashs if IndexInput - is closed while another thread is still accessing it (SIGSEGV). -

    - IllegalArgumentException if {@link #UNMAP_SUPPORTED} - is false and the workaround cannot be enabled. - -
    - - Returns true, if the unmap workaround is enabled. - - - - - Try to unmap the buffer, this method silently fails if no support - for that in the JVM. On Windows, this leads to the fact, - that mmapped files cannot be modified or deleted. - - - - Sets the maximum chunk size (default is {@link Integer#MAX_VALUE} for - 64 bit JVMs and 256 MiBytes for 32 bit JVMs) used for memory mapping. - Especially on 32 bit platform, the address space can be very fragmented, - so large index files cannot be mapped. - Using a lower chunk size makes the directory implementation a little - bit slower (as the correct chunk must be resolved on each seek) - but the chance is higher that mmap does not fail. On 64 bit - Java platforms, this parameter should always be {@link Integer#MAX_VALUE}, - as the adress space is big enough. - - - - Returns the current mmap chunk size. - - - - - Creates an IndexInput for the file with the given name. - - - Creates an IndexOutput for the file with the given name. - - - Constrains search results to only match those which also match a provided - query. Results are cached, so that searches after the first on the same - index using this filter are much faster. - - - $Id: QueryFilter.java 528298 2007-04-13 00:59:28Z hossman $ - - use a CachingWrapperFilter with QueryWrapperFilter - - - - Constructs a filter which only matches documents matching - query. - - - - Subclass of FilteredTermEnum for enumerating all terms that match the - specified prefix filter term. -

    - Term enumerations are always ordered by Term.compareTo(). Each term in - the enumeration is greater than all that precede it. - -

    -
    - - Calculates the minimum payload seen - - - - - - A ranked list of documents, used to hold search results. -

    - Caution: Iterate only over the hits needed. Iterating over all hits is - generally not desirable and may be the source of performance issues. If you - need to iterate over many or all hits, consider using the search method that - takes a {@link HitCollector}. -

    -

    - Note: Deleting matching documents concurrently with traversing the - hits, might, when deleting hits that were not yet retrieved, decrease - {@link #Length()}. In such case, - {@link java.util.ConcurrentModificationException - ConcurrentModificationException} is thrown when accessing hit n - > current_{@link #Length()} (but n < {@link #Length()} - _at_start). - -

    - see {@link Searcher#Search(Query, int)}, - {@link Searcher#Search(Query, Filter, int)} and - {@link Searcher#Search(Query, Filter, int, Sort)}:
    - -
    -            TopDocs topDocs = searcher.Search(query, numHits);
    -            ScoreDoc[] hits = topDocs.scoreDocs;
    -            for (int i = 0; i < hits.Length; i++) {
    -            int docId = hits[i].doc;
    -            Document d = searcher.Doc(docId);
    -            // do something with current hit
    -            ...
    -            
    -
    -
    - - Tries to add new documents to hitDocs. - Ensures that the hit numbered min has been retrieved. - - - - Returns the total number of hits available in this set. - - - Returns the stored fields of the nth document in this set. -

    Documents are cached, so that repeated requests for the same element may - return the same Document object. -

    - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error -
    - - Returns the score for the nth document in this set. - - - Returns the id for the nth document in this set. - Note that ids may change when the index changes, so you cannot - rely on the id to be stable. - - - - Returns a {@link HitIterator} to navigate the Hits. Each item returned - from {@link Iterator#next()} is a {@link Hit}. -

    - Caution: Iterate only over the hits needed. Iterating over all - hits is generally not desirable and may be the source of - performance issues. If you need to iterate over many or all hits, consider - using a search method that takes a {@link HitCollector}. -

    -

    -
    - - A query that wraps a filter and simply returns a constant score equal to the - query boost for every document in the filter. - - - - $Id: ConstantScoreQuery.java 807180 2009-08-24 12:26:43Z markrmiller $ - - - - Returns the encapsulated filter - - - Prints a user-readable version of this query. - - - Returns true if o is equal to this. - - - Returns a hash code value for this object. - - - use {@link #NextDoc()} instead. - - - - use {@link #DocID()} instead. - - - - use {@link #Advance(int)} instead. - - - - A Payload is metadata that can be stored together with each occurrence - of a term. This metadata is stored inline in the posting list of the - specific term. -

    - To store payloads in the index a {@link TokenStream} has to be used that - produces payload data. -

    - Use {@link TermPositions#GetPayloadLength()} and {@link TermPositions#GetPayload(byte[], int)} - to retrieve the payloads from the index.
    - -

    -
    - - the byte array containing the payload data - - - the offset within the byte array - - - the length of the payload data - - - Creates an empty payload and does not allocate a byte array. - - - Creates a new payload with the the given array as data. - A reference to the passed-in array is held, i. e. no - copy is made. - - - the data of this payload - - - - Creates a new payload with the the given array as data. - A reference to the passed-in array is held, i. e. no - copy is made. - - - the data of this payload - - the offset in the data byte array - - the length of the data - - - - Sets this payloads data. - A reference to the passed-in array is held, i. e. no - copy is made. - - - - Sets this payloads data. - A reference to the passed-in array is held, i. e. no - copy is made. - - - - Returns a reference to the underlying byte array - that holds this payloads data. - - - - Returns the offset in the underlying byte array - - - Returns the length of the payload data. - - - Returns the byte at the given index. - - - Allocates a new byte array, copies the payload data into it and returns it. - - - Copies the payload data to a byte array. - - - the target byte array - - the offset in the target byte array - - - - Clones this payload by creating a copy of the underlying - byte array. - - - - - - - - - - Constructs a new runtime exception with null as its - detail message. The cause is not initialized, and may subsequently be - initialized by a call to {@link #innerException}. - - - - Constructs a new runtime exception with the specified cause and a - detail message of (cause==null ? null : cause.toString()) - (which typically contains the class and detail message of - cause). -

    - This constructor is useful for runtime exceptions - that are little more than wrappers for other throwables. - -

    - the cause (which is saved for later retrieval by the - {@link #InnerException()} method). (A null value is - permitted, and indicates that the cause is nonexistent or - unknown.) - - 1.4 - -
    - - Constructs a new runtime exception with the specified detail message. - The cause is not initialized, and may subsequently be initialized by a - call to {@link #innerException}. - - - the detail message. The detail message is saved for - later retrieval by the {@link #getMessage()} method. - - - - Constructs a new runtime exception with the specified detail message and - cause.

    Note that the detail message associated with - cause is not automatically incorporated in - this runtime exception's detail message. - -

    - the detail message (which is saved for later retrieval - by the {@link #getMessage()} method). - - the cause (which is saved for later retrieval by the - {@link #InnerException()} method). (A null value is - permitted, and indicates that the cause is nonexistent or - unknown.) - - 1.4 - -
    - - This is a DocConsumer that gathers all fields under the - same name, and calls per-field consumers to process field - by field. This class doesn't doesn't do any "real" work - of its own: it just forwards the fields to a - DocFieldConsumer. - - - - A field is a section of a Document. Each field has two parts, a name and a - value. Values may be free text, provided as a String or as a Reader, or they - may be atomic keywords, which are not further processed. Such keywords may - be used to represent dates, urls, etc. Fields are optionally stored in the - index, so that they may be returned with hits on the document. - - - - The value of the field as a String, or null. If null, the Reader value or - binary value is used. Exactly one of stringValue(), - readerValue(), and getBinaryValue() must be set. - - - - The value of the field as a Reader, or null. If null, the String value or - binary value is used. Exactly one of stringValue(), - readerValue(), and getBinaryValue() must be set. - - - - The value of the field in Binary, or null. If null, the Reader value, - or String value is used. Exactly one of stringValue(), - readerValue(), and getBinaryValue() must be set. - - This method must allocate a new byte[] if - the {@link AbstractField#GetBinaryOffset()} is non-zero - or {@link AbstractField#GetBinaryLength()} is not the - full length of the byte[]. Please use {@link - AbstractField#GetBinaryValue()} instead, which simply - returns the byte[]. - - - - The TokesStream for this field to be used when indexing, or null. If null, the Reader value - or String value is analyzed to produce the indexed tokens. - - - -

    Expert: change the value of this field. This can - be used during indexing to re-use a single Field - instance to improve indexing speed by avoiding GC cost - of new'ing and reclaiming Field instances. Typically - a single {@link Document} instance is re-used as - well. This helps most on small documents.

    - -

    Each Field instance should only be used once - within a single {@link Document} instance. See ImproveIndexingSpeed - for details.

    -

    -
    - - Expert: change the value of this field. See setValue(String). - - - Expert: change the value of this field. See setValue(String). - - - Expert: change the value of this field. See setValue(String). - - - Expert: change the value of this field. See setValue(String). - use {@link #setTokenStream} - - - - Expert: sets the token stream to be used for indexing and causes isIndexed() and isTokenized() to return true. - May be combined with stored values from stringValue() or binaryValue() - - - - Create a field by specifying its name, value and how it will - be saved in the index. Term vectors will not be stored in the index. - - - The name of the field - - The string to process - - Whether value should be stored in the index - - Whether the field should be indexed, and if so, if it should - be tokenized before indexing - - NullPointerException if name or value is null - IllegalArgumentException if the field is neither stored nor indexed - - - Create a field by specifying its name, value and how it will - be saved in the index. - - - The name of the field - - The string to process - - Whether value should be stored in the index - - Whether the field should be indexed, and if so, if it should - be tokenized before indexing - - Whether term vector should be stored - - NullPointerException if name or value is null - IllegalArgumentException in any of the following situations: -
      -
    • the field is neither stored nor indexed
    • -
    • the field is not indexed but termVector is TermVector.YES
    • -
    -
    -
    - - Create a field by specifying its name, value and how it will - be saved in the index. - - - The name of the field - - Whether to .intern() name or not - - The string to process - - Whether value should be stored in the index - - Whether the field should be indexed, and if so, if it should - be tokenized before indexing - - Whether term vector should be stored - - NullPointerException if name or value is null - IllegalArgumentException in any of the following situations: -
      -
    • the field is neither stored nor indexed
    • -
    • the field is not indexed but termVector is TermVector.YES
    • -
    -
    -
    - - Create a tokenized and indexed field that is not stored. Term vectors will - not be stored. The Reader is read only when the Document is added to the index, - i.e. you may not close the Reader until {@link IndexWriter#AddDocument(Document)} - has been called. - - - The name of the field - - The reader with the content - - NullPointerException if name or reader is null - - - Create a tokenized and indexed field that is not stored, optionally with - storing term vectors. The Reader is read only when the Document is added to the index, - i.e. you may not close the Reader until {@link IndexWriter#AddDocument(Document)} - has been called. - - - The name of the field - - The reader with the content - - Whether term vector should be stored - - NullPointerException if name or reader is null - - - Create a tokenized and indexed field that is not stored. Term vectors will - not be stored. This is useful for pre-analyzed fields. - The TokenStream is read only when the Document is added to the index, - i.e. you may not close the TokenStream until {@link IndexWriter#AddDocument(Document)} - has been called. - - - The name of the field - - The TokenStream with the content - - NullPointerException if name or tokenStream is null - - - Create a tokenized and indexed field that is not stored, optionally with - storing term vectors. This is useful for pre-analyzed fields. - The TokenStream is read only when the Document is added to the index, - i.e. you may not close the TokenStream until {@link IndexWriter#AddDocument(Document)} - has been called. - - - The name of the field - - The TokenStream with the content - - Whether term vector should be stored - - NullPointerException if name or tokenStream is null - - - Create a stored field with binary value. Optionally the value may be compressed. - - - The name of the field - - The binary value - - How value should be stored (compressed or not) - - IllegalArgumentException if store is Store.NO - - - Create a stored field with binary value. Optionally the value may be compressed. - - - The name of the field - - The binary value - - Starting offset in value where this Field's bytes are - - Number of bytes to use for this Field, starting at offset - - How value should be stored (compressed or not) - - IllegalArgumentException if store is Store.NO - - - Specifies whether and how a field should be stored. - - - Store the original field value in the index in a compressed form. This is - useful for long documents and for binary valued fields. - - Please use {@link CompressionTools} instead. - For string fields that were previously indexed and stored using compression, - the new way to achieve this is: First add the field indexed-only (no store) - and additionally using the same field name as a binary, stored field - with {@link CompressionTools#compressString}. - - - - Store the original field value in the index. This is useful for short texts - like a document's title which should be displayed with the results. The - value is stored in its original form, i.e. no analyzer is used before it is - stored. - - - - Do not store the field value in the index. - - - Specifies whether and how a field should be indexed. - - - Do not index the field value. This field can thus not be searched, - but one can still access its contents provided it is - {@link Field.Store stored}. - - - - Index the tokens produced by running the field's - value through an Analyzer. This is useful for - common text. - - - - this has been renamed to {@link #ANALYZED} - - - - Index the field's value without using an Analyzer, so it can be searched. - As no analyzer is used the value will be stored as a single term. This is - useful for unique Ids like product numbers. - - - - This has been renamed to {@link #NOT_ANALYZED} - - - - Expert: Index the field's value without an Analyzer, - and also disable the storing of norms. Note that you - can also separately enable/disable norms by calling - {@link Field#setOmitNorms}. No norms means that - index-time field and document boosting and field - length normalization are disabled. The benefit is - less memory usage as norms take up one byte of RAM - per indexed field for every document in the index, - during searching. Note that once you index a given - field with norms enabled, disabling norms will - have no effect. In other words, for this to have the - above described effect on a field, all instances of - that field must be indexed with NOT_ANALYZED_NO_NORMS - from the beginning. - - - - This has been renamed to - {@link #NOT_ANALYZED_NO_NORMS} - - - - Expert: Index the tokens produced by running the - field's value through an Analyzer, and also - separately disable the storing of norms. See - {@link #NOT_ANALYZED_NO_NORMS} for what norms are - and why you may want to disable them. - - - - Specifies whether and how a field should have term vectors. - - - Do not store term vectors. - - - Store the term vectors of each document. A term vector is a list - of the document's terms and their number of occurrences in that document. - - - - Store the term vector + token position information - - - - - - - Store the term vector + Token offset information - - - - - - - Store the term vector + Token position and offset information - - - - - - - - - - - An Analyzer that uses {@link WhitespaceTokenizer}. - - - Provides support for converting byte sequences to Strings and back again. - The resulting Strings preserve the original byte sequences' sort order. - - The Strings are constructed using a Base 8000h encoding of the original - binary data - each char of an encoded String represents a 15-bit chunk - from the byte sequence. Base 8000h was chosen because it allows for all - lower 15 bits of char to be used without restriction; the surrogate range - [U+D8000-U+DFFF] does not represent valid chars, and would require - complicated handling to avoid them and allow use of char's high bit. - - Although unset bits are used as padding in the final char, the original - byte sequence could contain trailing bytes with no set bits (null bytes): - padding is indistinguishable from valid information. To overcome this - problem, a char is appended, indicating the number of encoded bytes in the - final content char. - - This class's operations are defined over CharBuffers and ByteBuffers, to - allow for wrapped arrays to be reused, reducing memory allocation costs for - repeated operations. Note that this class calls array() and arrayOffset() - on the CharBuffers and ByteBuffers it uses, so only wrapped arrays may be - used. This class interprets the arrayOffset() and limit() values returned by - its input buffers as beginning and end+1 positions on the wrapped array, - resprectively; similarly, on the output buffer, arrayOffset() is the first - position written to, and limit() is set to one past the final output array - position. - - - - Returns the number of chars required to encode the given byte sequence. - - - The byte sequence to be encoded. Must be backed by an array. - - The number of chars required to encode the given byte sequence - - IllegalArgumentException If the given ByteBuffer is not backed by an array - - - Returns the number of bytes required to decode the given char sequence. - - - The char sequence to be encoded. Must be backed by an array. - - The number of bytes required to decode the given char sequence - - IllegalArgumentException If the given CharBuffer is not backed by an array - - - Encodes the input byte sequence into the output char sequence. Before - calling this method, ensure that the output CharBuffer has sufficient - capacity by calling {@link #GetEncodedLength(java.nio.ByteBuffer)}. - - - The byte sequence to encode - - Where the char sequence encoding result will go. The limit - is set to one past the position of the final char. - - IllegalArgumentException If either the input or the output buffer - is not backed by an array - - - - Decodes the input char sequence into the output byte sequence. Before - calling this method, ensure that the output ByteBuffer has sufficient - capacity by calling {@link #GetDecodedLength(java.nio.CharBuffer)}. - - - The char sequence to decode - - Where the byte sequence decoding result will go. The limit - is set to one past the position of the final char. - - IllegalArgumentException If either the input or the output buffer - is not backed by an array - - - - Decodes the given char sequence, which must have been encoded by - {@link #Encode(java.nio.ByteBuffer)} or - {@link #Encode(java.nio.ByteBuffer, java.nio.CharBuffer)}. - - - The char sequence to decode - - A byte sequence containing the decoding result. The limit - is set to one past the position of the final char. - - IllegalArgumentException If the input buffer is not backed by an - array - - - - Encodes the input byte sequence. - - - The byte sequence to encode - - A char sequence containing the encoding result. The limit is set - to one past the position of the final char. - - IllegalArgumentException If the input buffer is not backed by an - array - - - - This exception is thrown when the write.lock - could not be acquired. This - happens when a writer tries to open an index - that another writer already has open. - - - - - - This exception is thrown when there is an attempt to - access something that has already been closed. - - - - The {@link TimeLimitingCollector} is used to timeout search requests that - take longer than the maximum allowed search time limit. After this time is - exceeded, the search thread is stopped by throwing a - {@link TimeExceededException}. - - - - Default timer resolution. - - - - - Default for {@link #IsGreedy()}. - - - - - Create a TimeLimitedCollector wrapper over another {@link Collector} with a specified timeout. - the wrapped {@link Collector} - - max time allowed for collecting hits after which {@link TimeExceededException} is thrown - - - - Return the timer resolution. - - - - - Set the timer resolution. - The default timer resolution is 20 milliseconds. - This means that a search required to take no longer than - 800 milliseconds may be stopped after 780 to 820 milliseconds. -
    Note that: -
      -
    • Finer (smaller) resolution is more accurate but less efficient.
    • -
    • Setting resolution to less than 5 milliseconds will be silently modified to 5 milliseconds.
    • -
    • Setting resolution smaller than current resolution might take effect only after current - resolution. (Assume current resolution of 20 milliseconds is modified to 5 milliseconds, - then it can take up to 20 milliseconds for the change to have effect.
    • -
    -
    -
    - - Checks if this time limited collector is greedy in collecting the last hit. - A non greedy collector, upon a timeout, would throw a {@link TimeExceededException} - without allowing the wrapped collector to collect current doc. A greedy one would - first allow the wrapped hit collector to collect current doc and only then - throw a {@link TimeExceededException}. - - - - - - Sets whether this time limited collector is greedy. - true to make this time limited greedy - - - - - - Calls {@link Collector#Collect(int)} on the decorated {@link Collector} - unless the allowed time has passed, in which case it throws an exception. - - - TimeExceededException - if the time allowed has exceeded. - - - - TimerThread provides a pseudo-clock service to all searching - threads, so that they can count elapsed time with less overhead - than repeatedly calling System.currentTimeMillis. A single - thread should be created to be used for all searches. - - - - Get the timer value in milliseconds. - - - Thrown when elapsed search time exceeds allowed search time. - - - Returns allowed time (milliseconds). - - - Returns elapsed time (milliseconds). - - - Returns last doc(absolute doc id) that was collected when the search time exceeded. - - - Stores information about how to sort documents by terms in an individual - field. Fields must be indexed in order to sort by them. - -

    Created: Feb 11, 2004 1:25:29 PM - -

    - lucene 1.4 - - $Id: SortField.java 801344 2009-08-05 18:05:06Z yonik $ - - - -
    - - Sort by document score (relevancy). Sort values are Float and higher - values are at the front. - - - - Sort by document number (index order). Sort values are Integer and lower - values are at the front. - - - - Guess type of sort based on field contents. A regular expression is used - to look at the first term indexed for the field and determine if it - represents an integer number, a floating point number, or just arbitrary - string characters. - - Please specify the exact type, instead. - Especially, guessing does not work with the new - {@link NumericField} type. - - - - Sort using term values as Strings. Sort values are String and lower - values are at the front. - - - - Sort using term values as encoded Integers. Sort values are Integer and - lower values are at the front. - - - - Sort using term values as encoded Floats. Sort values are Float and - lower values are at the front. - - - - Sort using term values as encoded Longs. Sort values are Long and - lower values are at the front. - - - - Sort using term values as encoded Doubles. Sort values are Double and - lower values are at the front. - - - - Sort using term values as encoded Shorts. Sort values are Short and - lower values are at the front. - - - - Sort using a custom Comparator. Sort values are any Comparable and - sorting is done according to natural order. - - - - Sort using term values as encoded Bytes. Sort values are Byte and - lower values are at the front. - - - - Sort using term values as Strings, but comparing by - value (using String.compareTo) for all comparisons. - This is typically slower than {@link #STRING}, which - uses ordinals to do the sorting. - - - - Represents sorting by document score (relevancy). - - - Represents sorting by document number (index order). - - - Creates a sort by terms in the given field where the type of term value - is determined dynamically ({@link #AUTO AUTO}). - - Name of field to sort by, cannot be - null. - - Please specify the exact type instead. - - - - Creates a sort, possibly in reverse, by terms in the given field where - the type of term value is determined dynamically ({@link #AUTO AUTO}). - - Name of field to sort by, cannot be null. - - True if natural order should be reversed. - - Please specify the exact type instead. - - - - Creates a sort by terms in the given field with the type of term - values explicitly given. - - Name of field to sort by. Can be null if - type is SCORE or DOC. - - Type of values in the terms. - - - - Creates a sort, possibly in reverse, by terms in the given field with the - type of term values explicitly given. - - Name of field to sort by. Can be null if - type is SCORE or DOC. - - Type of values in the terms. - - True if natural order should be reversed. - - - - Creates a sort by terms in the given field, parsed - to numeric values using a custom {@link FieldCache.Parser}. - - Name of field to sort by. Must not be null. - - Instance of a {@link FieldCache.Parser}, - which must subclass one of the existing numeric - parsers from {@link FieldCache}. Sort type is inferred - by testing which numeric parser the parser subclasses. - - IllegalArgumentException if the parser fails to - subclass an existing numeric parser, or field is null - - - - Creates a sort, possibly in reverse, by terms in the given field, parsed - to numeric values using a custom {@link FieldCache.Parser}. - - Name of field to sort by. Must not be null. - - Instance of a {@link FieldCache.Parser}, - which must subclass one of the existing numeric - parsers from {@link FieldCache}. Sort type is inferred - by testing which numeric parser the parser subclasses. - - True if natural order should be reversed. - - IllegalArgumentException if the parser fails to - subclass an existing numeric parser, or field is null - - - - Creates a sort by terms in the given field sorted - according to the given locale. - - Name of field to sort by, cannot be null. - - Locale of values in the field. - - - - Creates a sort, possibly in reverse, by terms in the given field sorted - according to the given locale. - - Name of field to sort by, cannot be null. - - Locale of values in the field. - - - - Creates a sort with a custom comparison function. - Name of field to sort by; cannot be null. - - Returns a comparator for sorting hits. - - use SortField (String field, FieldComparatorSource comparator) - - - - Creates a sort with a custom comparison function. - Name of field to sort by; cannot be null. - - Returns a comparator for sorting hits. - - - - Creates a sort, possibly in reverse, with a custom comparison function. - Name of field to sort by; cannot be null. - - Returns a comparator for sorting hits. - - True if natural order should be reversed. - - use SortField (String field, FieldComparatorSource comparator, boolean reverse) - - - - Creates a sort, possibly in reverse, with a custom comparison function. - Name of field to sort by; cannot be null. - - Returns a comparator for sorting hits. - - True if natural order should be reversed. - - - - Returns the name of the field. Could return null - if the sort is by SCORE or DOC. - - Name of field, possibly null. - - - - Returns the type of contents in the field. - One of the constants SCORE, DOC, AUTO, STRING, INT or FLOAT. - - - - Returns the Locale by which term values are interpreted. - May return null if no Locale was specified. - - Locale, or null. - - - - Returns the instance of a {@link FieldCache} parser that fits to the given sort type. - May return null if no parser was specified. Sorting is using the default parser then. - - An instance of a {@link FieldCache} parser, or null. - - - - Returns whether the sort should be reversed. - True if natural order should be reversed. - - - - use {@link #GetComparatorSource()} - - - - Use legacy IndexSearch implementation: search with a DirectoryReader rather - than passing a single hit collector to multiple SegmentReaders. - - - true for legacy behavior - - will be removed in Lucene 3.0. - - - - if true, IndexSearch will use legacy sorting search implementation. - eg. multiple Priority Queues. - - will be removed in Lucene 3.0. - - - - Returns true if o is equal to this. If a - {@link SortComparatorSource} (deprecated) or {@link - FieldCache.Parser} was provided, it must properly - implement equals (unless a singleton is always used). - - - - Returns true if o is equal to this. If a - {@link SortComparatorSource} (deprecated) or {@link - FieldCache.Parser} was provided, it must properly - implement hashCode (unless a singleton is always - used). - - - - Returns the {@link FieldComparator} to use for - sorting. - - NOTE: This API is experimental and might change in - incompatible ways in the next release. - - - number of top hits the queue will store - - position of this SortField within {@link - Sort}. The comparator is primary if sortPos==0, - secondary if sortPos==1, etc. Some comparators can - optimize themselves when they are the primary sort. - - {@link FieldComparator} to use when sorting - - - - Attempts to detect the given field type for an IndexReader. - - - - - A Scorer for queries with a required part and an optional part. - Delays skipTo() on the optional part until a score() is needed. -
    - This Scorer implements {@link Scorer#SkipTo(int)}. -
    -
    - - The scorers passed from the constructor. - These are set to null as soon as their next() or skipTo() returns false. - - - - Construct a ReqOptScorer. - The required scorer. This must match. - - The optional scorer. This is used for scoring only. - - - - use {@link #NextDoc()} instead. - - - - use {@link #Advance(int)} instead. - - - - use {@link #DocID()} instead. - - - - Returns the score of the current document matching the query. - Initially invalid, until {@link #Next()} is called the first time. - - The score of the required scorer, eventually increased by the score - of the optional scorer when it also matches the current document. - - - - Explain the score of a document. - TODO: Also show the total score. - See BooleanScorer.explain() on how to do this. - - - - A query that scores each document as the value of the numeric input field. -

    - The query matches all documents, and scores each document according to the numeric - value of that field. -

    - It is assumed, and expected, that: -

      -
    • The field used here is indexed, and has exactly - one token in every scored document.
    • -
    • Best if this field is un_tokenized.
    • -
    • That token is parsable to the selected type.
    • -
    -

    - Combining this query in a FunctionQuery allows much freedom in affecting document scores. - Note, that with this freedom comes responsibility: it is more than likely that the - default Lucene scoring is superior in quality to scoring modified as explained here. - However, in some cases, and certainly for research experiments, this capability may turn useful. -

    - When contructing this query, select the appropriate type. That type should match the data stored in the - field. So in fact the "right" type should be selected before indexing. Type selection - has effect on the RAM usage: -

      -
    • {@link Type#BYTE} consumes 1 * maxDocs bytes.
    • -
    • {@link Type#SHORT} consumes 2 * maxDocs bytes.
    • -
    • {@link Type#INT} consumes 4 * maxDocs bytes.
    • -
    • {@link Type#FLOAT} consumes 8 * maxDocs bytes.
    • -
    -

    - Caching: - Values for the numeric field are loaded once and cached in memory for further use with the same IndexReader. - To take advantage of this, it is extremely important to reuse index-readers or index-searchers, - otherwise, for instance if for each query a new index reader is opened, large penalties would be - paid for loading the field values into memory over and over again! - -

    - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. -

    -
    - - Create a FieldScoreQuery - a query that scores each document as the value of the numeric input field. -

    - The type param tells how to parse the field string values into a numeric score value. -

    - the numeric field to be used. - - the type of the field: either - {@link Type#BYTE}, {@link Type#SHORT}, {@link Type#INT}, or {@link Type#FLOAT}. - -
    - - Type of score field, indicating how field values are interpreted/parsed. -

    - The type selected at search search time should match the data stored in the field. - Different types have different RAM requirements: -

      -
    • {@link #BYTE} consumes 1 * maxDocs bytes.
    • -
    • {@link #SHORT} consumes 2 * maxDocs bytes.
    • -
    • {@link #INT} consumes 4 * maxDocs bytes.
    • -
    • {@link #FLOAT} consumes 8 * maxDocs bytes.
    • -
    -
    -
    - - field values are interpreted as numeric byte values. - - - field values are interpreted as numeric short values. - - - field values are interpreted as numeric int values. - - - field values are interpreted as numeric float values. - - - Describes the input token stream. - - - An integer that describes the kind of this token. This numbering - system is determined by JavaCCParser, and a table of these numbers is - stored in the file ...Constants.java. - - - - The line number of the first character of this Token. - - - The column number of the first character of this Token. - - - The line number of the last character of this Token. - - - The column number of the last character of this Token. - - - The string image of the token. - - - A reference to the next regular (non-special) token from the input - stream. If this is the last token from the input stream, or if the - token manager has not read tokens beyond this one, this field is - set to null. This is true only if this token is also a regular - token. Otherwise, see below for a description of the contents of - this field. - - - - This field is used to access special tokens that occur prior to this - token, but after the immediately preceding regular (non-special) token. - If there are no such special tokens, this field is set to null. - When there are more than one such special token, this field refers - to the last of these special tokens, which in turn refers to the next - previous special token through its specialToken field, and so on - until the first special token (whose specialToken field is null). - The next fields of special tokens refer to other special tokens that - immediately follow it (without an intervening regular token). If there - is no such token, this field is null. - - - - An optional attribute value of the Token. - Tokens which are not used as syntactic sugar will often contain - meaningful values that will be used later on by the compiler or - interpreter. This attribute value is often different from the image. - Any subclass of Token that actually wants to return a non-null value can - override this method as appropriate. - - - - No-argument constructor - - - Constructs a new token for the specified Image. - - - Constructs a new token for the specified Image and Kind. - - - Returns the image. - - - Returns a new Token object, by default. However, if you want, you - can create and return subclass objects based on the value of ofKind. - Simply add the cases to the switch for all those special cases. - For example, if you have a subclass of Token called IDToken that - you want to create if ofKind is ID, simply add something like : - - case MyParserConstants.ID : return new IDToken(ofKind, image); - - to the following switch statement. Then you can cast matchedToken - variable to the appropriate type and use sit in your lexical actions. - - - - An efficient implementation of JavaCC's CharStream interface.

    Note that - this does not do line-number counting, but instead keeps track of the - character position of the token in the input, as required by Lucene's {@link - Lucene.Net.Analysis.Token} API. - -

    -
    - - Constructs from a Reader. - - - This exception is thrown when an {@link IndexReader} - tries to make changes to the index (via {@link - IndexReader#deleteDocument}, {@link - IndexReader#undeleteAll} or {@link IndexReader#setNorm}) - but changes have already been committed to the index - since this reader was instantiated. When this happens - you must open a new reader on the current index to make - the changes. - - - - Useful constants representing filenames and extensions used by lucene - - - $rcs = ' $Id: Exp $ ' ; - - - - Name of the index segment file - - - Name of the generation reference file name - - - Name of the index deletable file (only used in - pre-lockless indices) - - - - Extension of norms file - - - Extension of freq postings file - - - Extension of prox postings file - - - Extension of terms file - - - Extension of terms index file - - - Extension of stored fields index file - - - Extension of stored fields file - - - Extension of vectors fields file - - - Extension of vectors documents file - - - Extension of vectors index file - - - Extension of compound file - - - Extension of compound file for doc store files - - - Extension of deletes - - - Extension of field infos - - - Extension of plain norms - - - Extension of separate norms - - - Extension of gen file - - - This array contains all filename extensions used by - Lucene's index files, with two exceptions, namely the - extension made up from .f + a number and - from .s + a number. Also note that - Lucene's segments_N files do not have any - filename extension. - - - - File extensions that are added to a compound file - (same as above, minus "del", "gen", "cfs"). - - - - File extensions of old-style index files - - - File extensions for term vector support - - - Computes the full file name from base, extension and - generation. If the generation is -1, the file name is - null. If it's 0, the file name is - If it's > 0, the file name is - - - -- main part of the file name - - -- extension of the filename (including .) - - -- generation - - - - Returns true if the provided filename is one of the doc - store files (ends with an extension in - STORE_INDEX_EXTENSIONS). - - - - Filters {@link LetterTokenizer} with {@link LowerCaseFilter} and - {@link StopFilter}. - - -

    - You must specify the required {@link Version} compatibility when creating - StopAnalyzer: -

      -
    • As of 2.9, position increments are preserved
    • -
    -
    -
    - - An array containing some common English words that are not usually useful - for searching. - - Use {@link #ENGLISH_STOP_WORDS_SET} instead - - - - An unmodifiable set containing some common English words that are not usually useful - for searching. - - - - Builds an analyzer which removes words in - ENGLISH_STOP_WORDS. - - Use {@link #StopAnalyzer(Version)} instead - - - - Builds an analyzer which removes words in ENGLISH_STOP_WORDS. - - - Builds an analyzer which removes words in - ENGLISH_STOP_WORDS. - - - See {@link StopFilter#SetEnablePositionIncrements} - - Use {@link #StopAnalyzer(Version)} instead - - - - Builds an analyzer with the stop words from the given set. - Use {@link #StopAnalyzer(Version, Set)} instead - - - - Builds an analyzer with the stop words from the given set. - - - Builds an analyzer with the stop words from the given set. - Set of stop words - - - See {@link StopFilter#SetEnablePositionIncrements} - - Use {@link #StopAnalyzer(Version, Set)} instead - - - - Builds an analyzer which removes words in the provided array. - Use {@link #StopAnalyzer(Set, boolean)} instead - - Use {@link #StopAnalyzer(Version, Set)} instead - - - - Builds an analyzer which removes words in the provided array. - Array of stop words - - - See {@link StopFilter#SetEnablePositionIncrements} - - Use {@link #StopAnalyzer(Version, Set)} instead - - - - Builds an analyzer with the stop words from the given file. - - - Use {@link #StopAnalyzer(Version, File)} instead - - - - Builds an analyzer with the stop words from the given file. - - - File to load stop words from - - - See {@link StopFilter#SetEnablePositionIncrements} - - Use {@link #StopAnalyzer(Version, File)} instead - - - - Builds an analyzer with the stop words from the given file. - - - - - See above - - File to load stop words from - -
    - - Builds an analyzer with the stop words from the given reader. - - - Use {@link #StopAnalyzer(Version, Reader)} instead - - - - Builds an analyzer with the stop words from the given reader. - - - Reader to load stop words from - - - See {@link StopFilter#SetEnablePositionIncrements} - - Use {@link #StopAnalyzer(Version, Reader)} instead - - - - Builds an analyzer with the stop words from the given reader. - - - See above - - Reader to load stop words from - - - - Filters LowerCaseTokenizer with StopFilter. - - - Filters LowerCaseTokenizer with StopFilter. - - - Implements {@link LockFactory} for a single in-process instance, - meaning all locking will take place through this one instance. - Only use this {@link LockFactory} when you are certain all - IndexReaders and IndexWriters for a given index are running - against a single shared in-process Directory instance. This is - currently the default locking for RAMDirectory. - - - - - - - This exception is thrown when you try to list a - non-existent directory. - - - - A Scorer for queries with a required subscorer - and an excluding (prohibited) sub DocIdSetIterator. -
    - This Scorer implements {@link Scorer#SkipTo(int)}, - and it uses the skipTo() on the given scorers. -
    -
    - - Construct a ReqExclScorer. - The scorer that must match, except where - - indicates exclusion. - - - - use {@link #NextDoc()} instead. - - - - Advance to non excluded doc. -
    On entry: -
      -
    • reqScorer != null,
    • -
    • exclScorer != null,
    • -
    • reqScorer was advanced once via next() or skipTo() - and reqScorer.doc() may still be excluded.
    • -
    - Advances reqScorer a non excluded required doc, if any. -
    - true iff there is a non excluded required doc. - -
    - - use {@link #DocID()} instead. - - - - Returns the score of the current document matching the query. - Initially invalid, until {@link #Next()} is called the first time. - - The score of the required scorer. - - - - use {@link #Advance(int)} instead. - - - - Expert: obtains the ordinal of the field value from the default Lucene - {@link Lucene.Net.Search.FieldCache FieldCache} using getStringIndex() - and reverses the order. -

    - The native lucene index order is used to assign an ordinal value for each field value. -

    - Field values (terms) are lexicographically ordered by unicode value, and numbered starting at 1. -
    - Example of reverse ordinal (rord): -
    If there were only three field values: "apple","banana","pear" -
    then rord("apple")=3, rord("banana")=2, ord("pear")=1 -

    - WARNING: - rord() depends on the position in an index and can thus change - when other documents are inserted or deleted, - or if a MultiSearcher is used. - -

    - WARNING: The status of the Search.Function package is experimental. - The APIs introduced here might change in the future and will not be - supported anymore in such a case. - -

    NOTE: with the switch in 2.9 to segment-based - searching, if {@link #getValues} is invoked with a - composite (multi-segment) reader, this can easily cause - double RAM usage for the values in the FieldCache. It's - best to switch your application to pass only atomic - (single segment) readers to this API. Alternatively, for - a short-term fix, you could wrap your ValueSource using - {@link MultiValueSource}, which costs more CPU per lookup - but will not consume double the FieldCache RAM.

    -

    -
    - - Contructor for a certain field. - field whose values reverse order is used. - - - - This interface is obsolete, use {@link FieldCache} instead. - - - Use {@link FieldCache}, this will be removed in Lucene 3.0 - - - - - Use {@link FieldCache#DEFAULT}; this will be removed in Lucene 3.0 - - - - Use {@link FieldCache.LongParser}, this will be removed in Lucene 3.0 - - - - Use {@link FieldCache.DoubleParser}, this will be removed in Lucene 3.0 - - - - Token Manager Error. - - - Lexical error occurred. - - - An attempt was made to create a second instance of a static token manager. - - - Tried to change to an invalid lexical state. - - - Detected (and bailed out of) an infinite loop in the token manager. - - - Indicates the reason why the exception is thrown. It will have - one of the above 4 values. - - - - Replaces unprintable characters by their escaped (or unicode escaped) - equivalents in the given string - - - - Returns a detailed message for the Error when it is thrown by the - token manager to indicate a lexical error. - Parameters : - EOFSeen : indicates if EOF caused the lexical error - curLexState : lexical state in which this error occurred - errorLine : line number when the error occurred - errorColumn : column number when the error occurred - errorAfter : prefix that was seen before this error occurred - curchar : the offending character - Note: You can customize the lexical error message by modifying this method. - - - - No arg constructor. - - - Constructor with message and reason. - - - Full Constructor. - - - You can also modify the body of this method to customize your error messages. - For example, cases like LOOP_DETECTED and INVALID_LEXICAL_STATE are not - of end-users concern, so you can return something like : - - "Internal Error : Please file a bug report .... " - - from this method for such cases in the release version of your parser. - - - - Call this if the IndexInput passed to {@link #read} - stores terms in the "modified UTF8" (pre LUCENE-510) - format. - - - - The SegmentMerger class combines two or more Segments, represented by an IndexReader ({@link #add}, - into a single Segment. After adding the appropriate readers, call the merge method to combine the - segments. -

    - If the compoundFile flag is set, then the segments will be merged into a compound file. - - -

    - - - - -
    - - Maximum number of contiguous documents to bulk-copy - when merging stored fields - - - - norms header placeholder - - - This ctor used only by test code. - - - The Directory to merge the other segments into - - The name of the new segment - - - - Add an IndexReader to the collection of readers that are to be merged - - - - - - The index of the reader to return - - The ith reader to be merged - - - - Merges the readers specified by the {@link #add} method into the directory passed to the constructor - The number of documents that were merged - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Merges the readers specified by the {@link #add} method - into the directory passed to the constructor. - - if false, we will not merge the - stored fields nor vectors files - - The number of documents that were merged - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - close all IndexReaders that have been added. - Should not be called before merge(). - - IOException - - - - The number of documents in all of the readers - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Merge the TermVectors from each of the segments into the new one. - IOException - - - Process postings from multiple segments all positioned on the - same term. Writes out merged entries into freqOutput and - the proxOutput streams. - - - array of segments - - number of cells in the array actually occupied - - number of documents across all segments where this term was found - - CorruptIndexException if the index is corrupt - IOException if there is a low-level IO error - - - Records the fact that roughly units amount of work - have been done since this method was last called. - When adding time-consuming code into SegmentMerger, - you should test different values for units to ensure - that the time in between calls to merge.checkAborted - is up to ~ 1 second. - - - - This is a DocFieldConsumer that inverts each field, - separately, from a Document, and accepts a - InvertedTermsConsumer to process those terms. - - - - Class to write byte streams into slices of shared - byte[]. This is used by DocumentsWriter to hold the - posting list for many terms in RAM. - - - - Set up the writer to write at address. - - - Write byte into byte slice stream - - - This class wraps a Token and supplies a single attribute instance - where the delegate token can be replaced. - - Will be removed, when old TokenStream API is removed. - - - - Normalizes tokens extracted with {@link StandardTokenizer}. - - - Construct filtering in. - - - Returns the next token in the stream, or null at EOS. -

    Removes 's from the end of words. -

    Removes dots from acronyms. -

    -
    - - diff --git a/lib/RavenDB/RavenDB.Database.992/Raven.Abstractions.XML b/lib/RavenDB/RavenDB.Database.992/Raven.Abstractions.XML deleted file mode 100644 index 951ca43913b..00000000000 --- a/lib/RavenDB/RavenDB.Database.992/Raven.Abstractions.XML +++ /dev/null @@ -1,2662 +0,0 @@ - - - - Raven.Abstractions - - - - - A single batch operation for a document DELETE - - - - - A single operation inside a batch - - - - - Translate this instance to a Json object. - - - - - Gets the key. - - The key. - - - - Gets the method. - - The method. - - - - Gets the etag. - - The etag. - - - - Gets the transaction information. - - The transaction information. - - - - Gets the metadata. - - The metadata. - - - - Translate this instance to a Json object. - - - - - Gets or sets the key. - - The key. - - - - Gets the method. - - The method. - - - - Gets or sets the etag. - - The etag. - - - - Gets or sets the transaction information. - - The transaction information. - - - - Gets or sets the metadata. - - The metadata. - - - - A single batch operation for a document PATCH - - - - - Translate this instance to a Json object. - - - - - Gets or sets the patches applied to this document - - The patches. - - - - Gets the key. - - The key. - - - - Gets the method. - - The method. - - - - Gets or sets the etag. - - The etag. - - - - Gets the transaction information. - - The transaction information. - - - - Gets or sets the metadata. - - The metadata. - - - - A single batch operation for a document PUT - - - - - Translate this instance to a Json object. - - - - - Gets or sets the key. - - The key. - - - - Gets the method. - - The method. - - - - Gets or sets the etag. - - The etag. - - - - Gets or sets the document. - - The document. - - - - Gets the transaction information. - - The transaction information. - - - - Gets or sets the metadata. - - The metadata. - - - - Extensions for web requests - - - - - Gets the response stream with HTTP decompression. - - The response. - - - - - Attachment data and metadata - - - - - Gets or sets the data. - - The data. - - - - The size of the attachment - - - - - Gets or sets the metadata. - - The metadata. - - - - Gets or sets the etag. - - The etag. - - - - The result of a single operation inside a batch - - - - - Gets or sets the etag generated by the etag (if applicable) - - The etag. - - - - Gets or sets the method used for the operation (PUT,DELETE,PATCH). - - The method. - - - - Gets or sets the key of the document - - The key. - - - - Gets or sets the updated metadata. - - The metadata. - - - - Parse the connection string option - - - - - Interface that is used purely internally - - - - - Gets or sets the metadata for the document - - The metadata. - - - - Gets or sets the key for the document - - The key. - - - - Gets or sets a value indicating whether this document is non authoritative (modified by uncommitted transaction). - - - - - Gets or sets the etag. - - The etag. - - - - Gets or sets the last modified date for the document - - The last modified. - - - - A document representation: - * Data / Projection - * Etag - * Metadata - - - - - Create a new instance of JsonDocument - - - - - How much space this document takes on disk - Only relevant during indexing phases, and not available on the client - - - - - Translate the json document to a - - - - - - Gets or sets the document data as json. - - The data as json. - - - - Gets or sets the metadata for the document - - The metadata. - - - - Gets or sets the key for the document - - The key. - - - - Gets or sets a value indicating whether this document is non authoritative (modified by uncommitted transaction). - - - - - Gets or sets the etag. - - The etag. - - - - Gets or sets the last modified date for the document - - The last modified. - - - - A document representation: - * Etag - * Metadata - - - - - Gets or sets the metadata for the document - - The metadata. - - - - Gets or sets the key for the document - - The key. - - - - Gets or sets a value indicating whether this document is non authoritative (modified by uncommitted transaction). - - - - - Gets or sets the etag. - - The etag. - - - - Gets or sets the last modified date for the document - - The last modified. - - - - Represent a result which include both document results and included documents - - - - - Initializes a new instance of the class. - - - - - Gets or sets the document results. - - - - - Gets or sets the included documents - - - - - Patch command options - - - - - Set a property - - - - - Unset (remove) a property - - - - - Add an item to an array - - - - - Insert an item to an array at a specified position - - - - - Remove an item from an array at a specified position - - - - - Modify a property value by providing a nested set of patch operation - - - - - Increment a property by a specified value - - - - - Copy a property value to another property - - - - - Rename a property - - - - - A patch request for a specified document - - - - - Translate this instance to json - - - - - Create an instance from a json object - - The patch request json. - - - - Gets or sets the type of the operation - - The type. - - - - Gets or sets the previous value, which is compared against the current value to verify a - change isn't overwriting new values. - If the value is null, the operation is always successful - - The previous value. - - - - Gets or sets the value. - - The value. - - - - Gets or sets the nested operations to perform. This is only valid when the is . - - The nested. - - - - Gets or sets the name. - - The name. - - - - Gets or sets the position. - - The position. - - - - Get or sets AllPositions. Set this property to true if you want to modify all items in an collection. - - AllPositions true/false - - - - The result of a patch operation - - - - - The document does not exists, operation was a no-op - - - - - Document was properly patched - - - - - The result of a PUT operation - - - - - Gets or sets the key. - - The key. - - - - Gets or sets the generated Etag for the PUT operation - - The Etag. - - - - Represent a field sort options - - - - - Initializes a new instance of the class. - - The field with potential prefix. - - - - Gets or sets the field. - - The field. - - - - Gets or sets a value indicating whether this is descending. - - true if descending; otherwise, false. - - - - A query using spatial filtering - - - - - All the information required to query a Raven index - - - - - Initializes a new instance of the class. - - - - - Gets the index query URL. - - The operation URL. - The index. - Name of the operation. - - - - - Gets the custom query string variables. - - - - - - Gets or sets the query. - - The query. - - - - Gets or sets the total size. - - The total size. - - - - Gets or sets the start of records to read. - - The start. - - - - Gets or sets the size of the page. - - The size of the page. - - - - The aggregation operation for this query - - - - - The fields to group the query by - - - - - Gets or sets the fields to fetch. - - The fields to fetch. - - - - Gets or sets the fields to sort by - - The sorted fields. - - - - Gets or sets the cutoff date - - The cutoff. - - - - Gets or sets the cutoff etag - - - Cutoff etag is used to check if the index has already process a document with the given - etag. Unlike Cutoff, which uses dates and is susceptible to clock syncronization issues between - machines, cutoff etag doesn't rely on both the server and client having a syncronized clock and - can work without it. - However, when used to query map/reduce indexes, it does NOT guarantee that the document that this - etag belong to is actually considered for the results. - What it does it guarantee that the document has been mapped, but not that the mapped values has been reduce. - Since map/reduce queries, by their nature,tend to be far less susceptible to issues with staleness, this is - considered to be an acceptable tradeoff. - If you need absolute no staleness with a map/reduce index, you will need to ensure syncronized clocks and - use the Cutoff date option, instead. - - - - - The default field to use when querying directly on the Lucene query - - - - - If set to true, RavenDB won't execute the transform results function - returning just the raw results instead - - - - - Gets or sets the number of skipped results. - - The skipped results. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The query. - - - - Gets the custom query string variables. - - - - - - Gets or sets the latitude. - - The latitude. - - - - Gets or sets the longitude. - - The longitude. - - - - Gets or sets the radius. - - The radius, in miles. - - - - String distance algorithms used in suggestion query - - - - - Default, equivalent to Levenshtein - - - - - JaroWinkler distance algorithm - - - - - Levenshtein distance algorithm (default) - - - - - NGram distance algorithm - - - - - - - - - - Create a new instance of - - - - - Gets or sets the term. The term is what the user likely entered, and will used as the basis of the suggestions. - - The term. - - - - Gets or sets the field to be used in conjunction with the index. - - The field. - - - - Gets or sets the number of suggestions to return. - - The number of suggestions. - - - - Gets or sets the string distance algorithm. - - The distance. - - - - Gets or sets the accuracy. - - The accuracy. - - - - The result of the suggestion query - - - - - The suggestions based on the term and dictionary - - The suggestions. - - - - Transaction information that identify the transaction id and timeout - - - - - Gets or sets the id. - - The id. - - - - Gets or sets the timeout. - - The timeout. - - - - Extension methods to handle common scenarios - - - - - Recursively examines the inner exceptions of an and returns a single child exception. - - - If any of the aggregated exceptions have more than one inner exception, null is returned. - - - - - Extracts a portion of an exception for a user friendly display - - The exception. - The primary portion of the exception message. - - - - This exception is raised when a concurrency conflict is encountered - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - Gets or sets the expected E tag. - - The expected E tag. - - - - Gets or sets the actual E tag. - - The actual E tag. - - - - A helper class that translate between Disposable and Action - - - - - Initializes a new instance of the class. - - The action. - - - - Execute the relevant actions - - - - - Extensions for Linq expressions - - - - - Turn an expression like x=< x.User.Name to "User.Name" - - - - - Json extensions - - - - - Convert a byte array to a RavenJObject - - - - - Convert a byte array to a RavenJObject - - - - - Convert a RavenJToken to a byte array - - - - - Deserialize a to an instance of - - - - - Deserialize a to an instance of - - - - - Deserialize a to an instance of - - - - - Converts the value. - - The type to convert the value to. - A cast as a of . - A converted value. - - - - Converts the value. - - The source collection type. - The type to convert the value to. - A cast as a of . - A converted value. - - - - Returns a collection of converted child values of every object in the source collection. - - The type to convert the values to. - An of that contains the source collection. - An that contains the converted values of every node in the source collection. - - - - Returns a collection of child values of every object in the source collection with the given key. - - An of that contains the source collection. - The token key. - An of that contains the values of every node in the source collection with the given key. - - - - Returns a collection of child values of every object in the source collection. - - An of that contains the source collection. - An of that contains the values of every node in the source collection. - - - - Represents a JSON array. - - - - - Represents an abstract JSON token. - - - - - Clones this object - - A cloned RavenJToken - - - - Creates a from an object. - - The object that will be used to create . - A with the value of the specified object - - - - Creates a from an object using the specified . - - The object that will be used to create . - The that will be used when reading the object. - A with the value of the specified object - - - - Returns the indented JSON for this token. - - - The indented JSON for this token. - - - - - Returns the JSON for this token using the given formatting and converters. - - Indicates how the output is formatted. - A collection of which will be used when writing the token. - The JSON for this token using the given formatting and converters. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Creates a from a . - - An positioned at the token to read into this . - - An that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Creates a from a . - - An positioned at the token to read into this . - - An that contains the token and its descendant tokens - that were read from the reader. The runtime type of the token is determined - by the token type of the first token encountered in the reader. - - - - - Gets the with the specified key converted to the specified type. - - The type to convert the token to. - The token key. - The converted token value. - - - - Compares the values of two tokens, including the values of all descendant tokens. - - The first to compare. - The second to compare. - true if the tokens are equal; otherwise false. - - - - Selects the token that matches the object path. - - - The object path from the current to the - to be returned. This must be a string of property names or array indexes separated - by periods, such as Tables[0].DefaultView[0].Price in C# or - Tables(0).DefaultView(0).Price in Visual Basic. - - The that matches the object path or a null reference if no matching token is found. - - - - Selects the token that matches the object path. - - - The object path from the current to the - to be returned. This must be a string of property names or array indexes separated - by periods, such as Tables[0].DefaultView[0].Price in C# or - Tables(0).DefaultView(0).Price in Visual Basic. - - A flag to indicate whether an error should be thrown if no token is found. - The that matches the object path. - - - - Returns a collection of the child values of this token, in document order. - - The type to convert the values to. - - A containing the child values of this , in document order. - - - - - Returns a collection of the child values of this token, in document order. - - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Performs an implicit conversion from to . - - The value to create a from. - The initialized with the specified value. - - - - Gets the node type for this . - - The type. - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Initializes a new instance of the class with the specified content. - - The contents of the array. - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the node type for this . - - The type. - - - - Gets or sets the at the specified index. - - - - - - Represents a JSON object. - - - - - Initializes a new instance of the class. - - - - - Gets the with the specified key converted to the specified type. - - The type to convert the token to. - The token key. - The converted token value. - - - - Creates a from an object. - - The object that will be used to create . - A with the values of the specified object - - - - Creates a from an object. - - The object that will be used to create . - The that will be used to read the object. - A with the values of the specified object - - - - Loads an from a . - - A that will be read for the content of the . - A that contains the JSON that was read from the specified . - - - - Load a from a string that contains JSON. - - A that contains JSON. - A populated from the string that contains JSON. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Gets the node type for this . - - The type. - - - - Gets or sets the with the specified property name. - - - - - - Compares tokens to determine whether they are equal. - - - - - Determines whether the specified objects are equal. - - The first object of type to compare. - The second object of type to compare. - - true if the specified objects are equal; otherwise, false. - - - - - Returns a hash code for the specified object. - - The for which a hash code is to be returned. - A hash code for the specified object. - The type of is a reference type and is null. - - - - Represents a reader that provides fast, non-cached, forward-only access to serialized Json data. - - - - - Initializes a new instance of the class. - - The token to read from. - - - - Reads the next JSON token from the stream as a . - - - A or a null reference if the next JSON token is null. - - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream as a . - - A . - - - - Reads the next JSON token from the stream. - - - true if the next token was read successfully; false if there are no more tokens to read. - - - - - Represents a writer that provides a fast, non-cached, forward-only way of generating Json data. - - - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - - - Writes the beginning of a Json array. - - - - - Writes the end. - - The token. - - - - Writes a null value. - - - - - Writes an undefined value. - - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Writes a value. - - The value to write. - - - - Gets the token being writen. - - The token being writen. - - - - Represents a value in JSON (string, integer, date, etc). - - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Initializes a new instance of the class with the given value. - - The value. - - - - Writes this token to a . - - A into which this method will write. - A collection of which will be used when writing the token. - - - - Determines whether the specified is equal to the current . - - The to compare with the current . - - true if the specified is equal to the current ; otherwise, false. - - - The parameter is null. - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format provider. - - A that represents this instance. - - - - - Returns a that represents this instance. - - The format. - The format provider. - - A that represents this instance. - - - - - Gets the node type for this . - - The type. - - - - Gets or sets the underlying token value. - - The underlying token value. - - - - Writes the JSON representation of the object. - - The to write to.The value.The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from.Type of the object.The existing value of object being read.The calling serializer. - - The object value. - - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Convert a MultiDimensional Array to a json string - - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Read in all the values from the Json reader and populate a nested ArrayList - - JsonReader to use - JsonSerializer to use - - - - - Retrieve a list of lengths for each rank represented - - The list to process - - - - - Assign values from the ArrayList into their respective place in the multidimensional array - - Array that will be receiving the newValues - A list of the lengths of each rank - A list of the current index settings to be used for assignments - Rank currently being processed - New Values that will be used in the assignment - - - - Write a rank of an array in Json format - - JsonWriter in use - JsonSerializer in use - Array to be written - Current rank "depth" - List of indexes currently being used to read from the array - - - - Extensions for handling metadata - - - - - Filters the headers from unwanted headers - - The self. - if set to true [is server document]. - public static RavenJObject FilterHeaders(this System.Collections.Specialized.NameValueCollection self, bool isServerDocument) - - - - Filters the headers from unwanted headers - - The self. - if set to true [is server document]. - public static RavenJObject FilterHeaders(this System.Collections.Specialized.NameValueCollection self, bool isServerDocument) - - - - A reference that can be used with lambda expression - to pass a value out. - - - - - Gets or sets the value. - - The value. - - - - Extensions for working with streams - - - - - Reads the entire request buffer to memory and return it as a byte array. - - The stream to read. - The returned byte array. - - - - Options for indexing a field - - - - - Do not index the field value. This field can thus not be searched, but one can still access its contents provided it is stored. - - - - - Index the tokens produced by running the field's value through an Analyzer. This is useful for common text. - - - - - Index the field's value without using an Analyzer, so it can be searched. As no analyzer is used the - value will be stored as a single term. This is useful for unique Ids like product numbers. - - - - - Index this field using the default internal analyzer: LowerCaseKeywordAnalyzer - - - - - Specifies whether and how a field should be stored. - - - - - Store the original field value in the index. This is useful for short texts like a document's title which should be displayed with the results. - The value is stored in its original form, i.e. no analyzer is used before it is stored. - - - - - Do not store the field value in the index. - - - - - Store the original field value in the index in a compressed form. This is useful for long documents and for binary valued fields. - - - - - A definition of a RavenIndex - - - - - Initializes a new instance of the class. - - - - - Equals the specified other. - - The other. - - - - - Determines whether the specified is equal to this instance. - - The to compare with this instance. - - true if the specified is equal to this instance; otherwise, false. - - - - - Provide a cached version of the index hash code, which is used when generating - the index etag. - It isn't really useful for anything else, in particular, we cache that because - we want to avoid calculating the cost of doing this over and over again on each - query. - - - - - Returns a hash code for this instance. - - - A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. - - - - - Remove the default values that we don't actually need - - - - - Get or set the name of the index - - - - - Gets or sets the map function, if there is only one - - - This property only exists for backward compatability purposes - - - - - All the map functions for this index - - - - - Gets or sets the reduce function - - The reduce. - - - - Gets or sets the translator function - - - - - Gets a value indicating whether this instance is map reduce index definition - - - true if this instance is map reduce; otherwise, false. - - - - - Returns a boolean value indicating whether this IndexDefinition is of a temporary index - - - - - Gets or sets the stores options - - The stores. - - - - Gets or sets the indexing options - - The indexes. - - - - Gets or sets the sort options. - - The sort options. - - - - Gets or sets the analyzers options - - The analyzers. - - - - The fields that are queryable in the index - - - - - Helper function for numeric to indexed string and vice versa - - - - - Translate a number to an indexable string - - - - - Translate a number to an indexable string - - - - - Translate a number to an indexable string - - - - - Translate a number to an indexable string - - - - - Translate an indexable string to a number - - - - - Helper class for working with dynamic values completely dynamically - - - - - Gets the value dynamically. - - The entity. - Name of the dynamic member. - - - - - Convert a dynamic variable to a json value and vice versa - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Convert an enum to a json string - - - - - Writes the JSON representation of the object. - - The to write to. - The value. - The calling serializer. - - - - Reads the JSON representation of the object. - - The to read from. - Type of the object. - The existing value of object being read. - The calling serializer. - The object value. - - - - Determines whether this instance can convert the specified object type. - - Type of the object. - - true if this instance can convert the specified object type; otherwise, false. - - - - - Extensions for RavenJToken - - - - Provides support for converting dates to strings and vice-versa. - The strings are structured so that lexicographic sorting orders - them by date, which makes them suitable for use as field values - and search terms. - -

    This class also helps you to limit the resolution of your dates. Do not - save dates with a finer resolution than you really need, as then - RangeQuery and PrefixQuery will require more memory and become slower. - -

    Compared to {@link DateField} the strings generated by the methods - in this class take slightly more space, unless your selected resolution - is set to Resolution.DAY or lower. - -

    - Another approach is {@link NumericUtils}, which provides - a sortable binary representation (prefix encoded) of numeric values, which - date/time are. - For indexing a {@link Date} or {@link Calendar}, just get the Unix timestamp as - long using {@link Date#getTime} or {@link Calendar#getTimeInMillis} and - index this as a numeric value with {@link NumericField} - and use {@link NumericRangeQuery} to query it. -

    -
    - - Converts a Date to a string suitable for indexing. - - - the date to be converted - - the desired resolution, see - {@link #Round(Date, DateTools.Resolution)} - - a string in format yyyyMMddHHmmssSSS or shorter, - depending on resolution; using GMT as timezone - - - - Converts a millisecond time to a string suitable for indexing. - - - the date expressed as milliseconds since January 1, 1970, 00:00:00 GMT - - the desired resolution, see - {@link #Round(long, DateTools.Resolution)} - - a string in format yyyyMMddHHmmssSSS or shorter, - depending on resolution; using GMT as timezone - - - - Converts a string produced by timeToString or - DateToString back to a time, represented as the - number of milliseconds since January 1, 1970, 00:00:00 GMT. - - - the date string to be converted - - the number of milliseconds since January 1, 1970, 00:00:00 GMT - - ParseException if dateString is not in the - expected format - - - - Converts a string produced by timeToString or - DateToString back to a time, represented as a - Date object. - - - the date string to be converted - - the parsed time as a Date object - - ParseException if dateString is not in the - expected format - - - - - Limit a date's resolution. For example, the date 2004-09-21 13:50:11 - will be changed to 2004-09-01 00:00:00 when using - Resolution.MONTH. - - The date. - The desired resolution of the date to be returned - - the date with all values more precise than resolution - set to 0 or 1 - - - - Limit a date's resolution. For example, the date 1095767411000 - (which represents 2004-09-21 13:50:11) will be changed to - 1093989600000 (2004-09-01 00:00:00) when using - Resolution.MONTH. - - - The time in milliseconds (not ticks). - The desired resolution of the date to be returned - - the date with all values more precise than resolution - set to 0 or 1, expressed as milliseconds since January 1, 1970, 00:00:00 GMT - - - - Specifies the time granularity. - - - - Resolution by year - - - - - Resolution by month - - - - - Resolution by day - - - - - Resolution by hour - - - - - Resolution by minute - - - - - Resolution by second - - - - - Resolution by millisecond - - - - - Returns a that represents this instance. - - - A that represents this instance. - - - - - Gets the inner json object - - The inner. - - - - A dynamic implementation on top of - - - - - Returns a that represents the current . - - - A that represents the current . - - 2 - - - - Determines whether the specified is equal to the current . - - - true if the specified is equal to the current ; otherwise, false. - - The to compare with the current . 2 - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - 2 - - - - Initializes a new instance of the class. - - The obj. - - - - Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. - - Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. - The result of the get operation. For example, if the method is called for a property, you can assign the property value to . - - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) - - - - - Provides the implementation for operations that get a value by index. Classes derived from the class can override this method to specify dynamic behavior for indexing operations. - - - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) - - - - - Gets the value for the specified name - - The name. - - - - - Gets the document id. - - - - - - Gets the inner json object - - The inner. - - - - Gets the length. - - The length. - - - - The result of a query - - - - - Initializes a new instance of the class. - - - - - Ensures that the query results can be used in snapshots - - - - - Creates a snapshot of the query results - - - - - Gets or sets the document resulting from this query. - - The results. - - - - Gets or sets the document included in the result. - - The includes. - - - - Gets or sets a value indicating whether the index is stale. - - true if the index is stale; otherwise, false. - - - - The last time the index was updated. - This can be used to determine the freshness of the data. - - - - - Gets or sets the total results for this query - - The total results. - - - - Gets or sets the skipped results (duplicate documents); - - The skipped results. - - - - The index used to answer this query - - - - - The last etag indexed by the index. - This can be used to determine whatever the results can be cached. - - - - - The ETag value for this index current state, which include what we docs we indexed, - what document were deleted, etc. - - - - - Gets or sets a value indicating whether any of the documents returned by this query - are non authoritative (modified by uncommitted transaction). - - - - - The sort options to use for a particular field - - - - - No sort options - - - - Sort using term values as Strings. Sort values are String and lower - values are at the front. - - - - Sort using term values as encoded Integers. Sort values are Integer and - lower values are at the front. - - - - Sort using term values as encoded Floats. Sort values are Float and - lower values are at the front. - - - - Sort using term values as encoded Longs. Sort values are Long and - lower values are at the front. - - - - Sort using term values as encoded Doubles. Sort values are Double and - lower values are at the front. - - - - Sort using term values as encoded Shorts. Sort values are Short and - lower values are at the front. - - - - Sort using a custom Comparator. Sort values are any Comparable and - sorting is done according to natural order. - - - - Sort using term values as encoded Bytes. Sort values are Byte and - lower values are at the front. - - - - Sort using term values as Strings, but comparing by - value (using String.compareTo) for all comparisons. - This is typically slower than {@link #STRING}, which - uses ordinals to do the sorting. - - - - - Data class for replication destination documents - - - - - The name of the connection string specified in the - server configuration file. - Override all other properties of the destination - - - - - Gets or sets the URL of the replication destination - - The URL. - - - - The replication server username to use - - - - - The replication server password to use - - - - - The replication server domain to use - - - - - The replication server api key to use - - - - - The database to use - - - - - How should the replication bundle behave with respect to replicated documents. - If a document was replicated to us from another node, should we replicate that to - this destination, or should we replicate only documents that were locally modified. - - - - - Options for how to replicate replicated documents - - - - - Don't replicate replicated documents - - - - - Replicate replicated documents - - - - - This class represent the list of replication destinations for the server - - - - - Initializes a new instance of the class. - - - - - Gets or sets the list of replication destinations. - - - - - Gets or sets the id. - - The id. - - - - A file to write to when doing an export or read from when doing an import. - - - - - Specify the types to operate on. You can specify more than one type by combining items with the OR parameter. - Default is all items. - Usage example: OperateOnTypes = ItemType.Indexes | ItemType.Documents | ItemType.Attachments. - - -
    -
    diff --git a/lib/RavenDB/RavenDB.Database.992/Raven.Abstractions.dll b/lib/RavenDB/RavenDB.Database.992/Raven.Abstractions.dll deleted file mode 100644 index 8e6f261bf4e..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Raven.Abstractions.dll and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Raven.Abstractions.pdb b/lib/RavenDB/RavenDB.Database.992/Raven.Abstractions.pdb deleted file mode 100644 index babb7c7c75f..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Raven.Abstractions.pdb and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Raven.Database.XML b/lib/RavenDB/RavenDB.Database.992/Raven.Database.XML deleted file mode 100644 index 0ffd66fe39b..00000000000 --- a/lib/RavenDB/RavenDB.Database.992/Raven.Database.XML +++ /dev/null @@ -1,1667 +0,0 @@ - - - - Raven.Database - - - - - The process for backing up a directory index is simple: - a) create hard links to all the files in the lucene directory in a temp director - that gives us the current snapshot, and protect us from lucene's - deleting files. - b) copy the hard links to the destination directory - c) delete the temp directory - - - - - Delete the backup status document, if it indicate a backup was in progress when the server crashed / shutdown - we have to do that to enable the next backup to complete - - - - - Returns a string value from the cluster database. - - Key identifying the location of the value in the cluster database. - A null-terminated Unicode string containing the name of the value to retrieve. - If the operation succeeds, the function returns a pointer to a buffer containing the string value. - - - - The Cluster service is not installed on the node. - - - - - The Cluster service is installed on the node but has not yet been configured. - - - - - The Cluster service is installed and configured on the node but is not currently running. - - - - - The Cluster service is installed, configured, and running on the node. - - - - - This let us know that an OOME has happened, and we need to be much more - conservative with regards to how fast we can grow memory. - - - - - Note that we assume that source is a relatively small number, expected to be - the number of indexes, not the number of documents. - - - - - Ask the trigger whatever the PUT should be vetoed. - If the trigger vote to veto the PUT, it needs to provide a human readable - explanation why the PUT was rejected. - - This method SHOULD NOT modify either the document or the metadata. - The document keyThe new document about to be put into RavenThe new document metadataThe current transaction, if it existsWhatever the put was vetoed or not - - - - Allow the trigger to perform any logic just before the document is saved to disk. - Any modifications the trigger makes to the document or the metadata will be persisted - to disk. - - If the trigger need to access the previous state of the document, the trigger should - implement and use the provided - instance to Get it. The returned result would be the old - document (if it exists) or null. - Any call to the provided instance will be done under the - same transaction as the PUT operation. - The document keyThe new document about to be put into RavenThe new document metadataThe current transaction, if it exists - - - - Allow the trigger to perform any logic after the document was put but still in the - same transaction as the put - - Any call to the provided instance will be done under the - same transaction as the PUT operation. - The document keyThe new document about to be put into RavenThe new document metadata - The etag of the just put document - The current transaction, if it exists - - - - Allow the trigger to perform any logic _after_ the transaction was committed. - For example, by notifying interested parties. - - This method SHOULD NOT modify either the document or the metadata - The document keyThe document that was put into RavenThe document metadata - The etag of the just put document - - - - Ask the trigger whatever the DELETE should be vetoed. - If the trigger vote to veto the DELETE, it needs to provide a human readable - explanation why the DELETE was rejected. - - This method SHOULD NOT modify either the document or the metadata. - The document keyThe current transaction, if anyWhatever the put was vetoed or not - - - - Allow the trigger to perform any logic just before the document is deleted. - - If the trigger need to access the previous state of the document, the trigger should - implement and use the provided - instance to Get it. The returned result would be the old - document (if it exists) or null. - Any call to the provided instance will be done under the - same transaction as the DELETE operation. - The current transaction, if anyThe document key - - - - Allow the trigger to perform any logic after the document was deleted but still in the - same transaction as the delete. - This method is called only if a row was actually deleted - - Any call to the provided instance will be done under the - same transaction as the DELETE operation. - The current transaction, if anyThe document key - - - - Allow the trigger to perform any logic _after_ the transaction was committed. - For example, by notifying interested parties. - The document key - - - - Base license validator. - - - - - License validator logger - - - - - Standard Time servers - - - - - Creates a license validator with specfied public key. - - public key - - - - Creates a license validator using the client information - and a service endpoint address to validate the license. - - - - - Validates loaded license - - - - - Validates loaded license - - - - - Loads the license file. - - - - - - - Removes existing license from the machine. - - - - - Loads license data from validated license file. - - - - - - Disables further license checks for the session. - - - - - Fired when license data is invalidated - - - - - Gets the expiration date of the license - - - - - How to behave when using the same license multiple times - - - - - Gets or Sets the endpoint address of the subscription service - - - - - Gets the Type of the license - - - - - Gets the Id of the license holder - - - - - Gets the name of the license holder - - - - - Gets or Sets Floating license support - - - - - Gets extra license information - - - - - Gets or Sets the license content - - - - - Options for detecting multiple licenses - - - - - Deny if multiple licenses are used - - - - - Only allow if it is running for the same user - - - - - Allow multiple copies of the same license to exist - Usually valid for OEM scenarios - - - - - Publish the presence of a client over the network - - - - - Publish the presence of this node - - - - - Listen to presence notifications - - - - - Starts listening to network notifications - - - - - Notify when a client is discovered - - - - - Notification raised when a client is discovered - - - - - The client's license id - - - - - The client machine name - - - - - The client user name - - - - - The id of the sender - - - - - - - - - - Base class for all licensing exceptions. - - - - - Creates a new instance of . - - - - - Creates a new instance of . - - error message - - - - Creates a new instance of . - - error message - inner exception - - - - Creates a new instance of . - - serialization information - streaming context - - - - Creates a new instance of . - - - - - Creates a new instance of . - - error message - - - - Creates a new instance of . - - error message - inner exception - - - - Creates a new instance of . - - serialization information - streaming context - - - - Service contract of the licensing server. - - - - - Issues a float license for the user. - - machine name - user name - Id of the license holder - - - - - InvalidationType - - - - - Can not create a new license - - - - - License is expired - - - - - Service contract of subscription server. - - - - - Issues a leased license - - - - - - - Thrown when license is found but is past it's expiration date - - - - - Creates a new instance of . - - - - - Creates a new instance of . - - error message - - - - Creates a new instance of . - - error message - inner exception - - - - Creates a new instance of . - - serialization information - streaming context - - - - Thrown when a valid license file can not be - found on the client machine. - - - - - Creates a new instance of - - - - - Creates a new instance of - - error message - - - - Creates a new instance of - - error message - inner exception - - - - Creates a new instance of - - serialization information - streaming context - - - - LicenseGenerator generates and signs license. - - - - - Creates a new instance of . - - private key of the product - - - - Generates a new floating license. - - Name of the license holder - public key of the license server - license content - - - - Generates a new license - - name of the license holder - Id of the license holder - expiry date - type of the license - - - - - Generates a new license - - name of the license holder - Id of the license holder - expiry date - type of the license - extra information stored as key/valye in the license file - - - - - Thrown when suitable license is not found. - - - - - Creates a new instance of . - - - - - Creates a new instance of . - - error message - - - - Creates a new instance of . - - error message - inner exception - - - - Creates a new instance of . - - serialization information - steaming context - - - - License Type - - - - - No type specified - - - - - For trial use - - - - - Standard license - - - - - For personal use - - - - - Floating license - - - - - Subscription based license - - - - - License validator validates a license file - that can be located on disk. - - - - - Creates a new instance of . - - public key - path to license file - - - - Creates a new instance of . - - public key - path to license file - license server endpoint address - Id of the license holder - - - - Validates loaded license - - - - - Removes existing license from the machine. - - - - - Gets or Sets the license content - - - - - Licensing server implementation. - Because we use this service behavior, we don't have to worry - about multi threading issues. it is not something that we - expect to have to deal with huge load, anyway. - - - - - Creates a new instance of . - - - - - Leases a new license to the client machine. - - client machine name - user name - Id of the license holder - - - - - Gets or Sets the public key of the product - - - - - Gets or Sets the private key of the license server - - - - - Creates a new instance of . - - - - - Creates a new instance of . - - error message - - - - Creates a new instance of . - - error message - inner exception - - - - Creates a new instance of . - - serialization information - streaming context - - - - Validates content of a license file - - - - - Creates a new instance of - - public key - license content - - - - License content - - - - - Extension methods that we are translating on dynamic objects during the - translation phase of the indx compilation - - - - - Allows to extend the query parsing capability of RavenDB, providing users with a way to modify - the queries before they are executed against the index - - - - - This exception is raised when a bad request is made to the server - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - 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). - - - - Describe an attachment, but without the actual attachment data - - - - - Gets or sets the size. - - The size. - - - - Gets or sets the key. - - The key. - - - - Gets or sets the metadata. - - The metadata. - - - - Gets or sets the etag. - - The etag. - - - - This is used to provide a way for a translator function - to access values from the database - - - - - Returns the document matching this id, if exists, or null if it doesn't - - - - - Returns null object - - - - - We have to replace code such as: - doc.FirstName ?? "" - Into - doc.FirstName != null ? doc.FirstName : "" - Because we use DynamicNullObject instead of null, and that preserve the null coallasing semantics. - - - - - This exception is raised when a query is made against a non existing index - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - 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). - - - - We have to use this stupid trick because HttpUtility.UrlEncode / Decode - uses HttpContext.Current under the covers, which doesn't work in IIS7 - Application_Start - - - - Provides support for converting byte sequences to Strings and back again. - The resulting Strings preserve the original byte sequences' sort order. - - The Strings are constructed using a Base 8000h encoding of the original - binary data - each char of an encoded String represents a 15-bit chunk - from the byte sequence. Base 8000h was chosen because it allows for all - lower 15 bits of char to be used without restriction; the surrogate range - [U+D8000-U+DFFF] does not represent valid chars, and would require - complicated handling to avoid them and allow use of char's high bit. - - Although unset bits are used as padding in the final char, the original - byte sequence could contain trailing bytes with no set bits (null bytes): - padding is indistinguishable from valid information. To overcome this - problem, a char is appended, indicating the number of encoded bytes in the - final content char. - - This class's operations are defined over CharBuffers and ByteBuffers, to - allow for wrapped arrays to be reused, reducing memory allocation costs for - repeated operations. Note that this class calls array() and arrayOffset() - on the CharBuffers and ByteBuffers it uses, so only wrapped arrays may be - used. This class interprets the arrayOffset() and limit() values returned by - its input buffers as beginning and end+1 positions on the wrapped array, - resprectively; similarly, on the output buffer, arrayOffset() is the first - position written to, and limit() is set to one past the final output array - position. - - - Note that the reason we have this code here is that we don't want to convert to/from List / array - which is the case of the same class in the Lucene code. - - - - Returns the number of chars required to encode the given byte sequence. - - - The byte sequence to be encoded. Must be backed by an array. - - The number of chars required to encode the given byte sequence - - IllegalArgumentException If the given ByteBuffer is not backed by an array - - - Returns the number of bytes required to decode the given char sequence. - - - The char sequence to be encoded. Must be backed by an array. - - The number of bytes required to decode the given char sequence - - IllegalArgumentException If the given CharBuffer is not backed by an array - - - Encodes the input byte sequence into the output char sequence. Before - calling this method, ensure that the output CharBuffer has sufficient - capacity by calling {@link #GetEncodedLength(java.nio.ByteBuffer)}. - - - The byte sequence to encode - - Where the char sequence encoding result will go. The limit - is set to one past the position of the final char. - - IllegalArgumentException If either the input or the output buffer - is not backed by an array - - - - Decodes the input char sequence into the output byte sequence. Before - calling this method, ensure that the output ByteBuffer has sufficient - capacity by calling {@link #GetDecodedLength(java.nio.CharBuffer)}. - - - The char sequence to decode - - Where the byte sequence decoding result will go. The limit - is set to one past the position of the final char. - - IllegalArgumentException If either the input or the output buffer - is not backed by an array - - - - Decodes the given char sequence, which must have been encoded by - {@link #Encode(java.nio.ByteBuffer)} or - {@link #Encode(java.nio.ByteBuffer, java.nio.CharBuffer)}. - - - The char sequence to decode - - A byte sequence containing the decoding result. The limit - is set to one past the position of the final char. - - IllegalArgumentException If the input buffer is not backed by an - array - - - - Encodes the input byte sequence. - - - The byte sequence to encode - - A char sequence containing the encoding result. The limit is set - to one past the position of the final char. - - IllegalArgumentException If the input buffer is not backed by an - array - - - - - Detects numeric range terms and expands range expressions accordingly - - - - - - - - - - Make a spatial query - - - - Radius, in miles - - - - - When the database is shut down rudely, determine whatever to reset the index or to check it. - Checking the index may take some time on large databases - - - - - What thread priority to give the various background tasks RavenDB uses (mostly for indexing) - Allowed values: Lowest, BelowNormal, Normal, AboveNormal, Highest - Default: Normal - - - - - The maximum allowed page size for queries. - Default: 1024 - Minimum: 10 - - - - - Percentage of physical memory used for caching - Allowed values: 0-99 (0 = autosize) - - - - - An integer value that specifies the maximum allowable size, in megabytes, that caching - document instances will use - - - - - Interval for checking the memory cache limits - Allowed values: max precision is 1 second - Default: 00:02:00 (or value provided by system.runtime.caching app config) - - - - - The indexing scheduler to use - - - - - Max number of items to take for indexing in a batch - Minimum: 128 - - - - - The initial number of items to take when indexing a batch - Default: 512 or 256 depending on CPU architecture - - - - - Max number of items to take for reducing in a batch - Minimum: 128 - - - - - The initial number of items to take when reducing a batch - Default: 256 or 128 depending on CPU architecture - - - - - The maximum number of indexing tasks allowed to run in parallel - Default: The number of processors in the current machine - - - - - Time (in milliseconds) the index has to be queried at least once in order for it to - become permanent - Default: 60000 (once per minute) - - - - - How many times a temporary, auto-generated index has to be accessed before it can - be promoted to be a permanent one - Default: 100 - - - - - How often to run the temporary index cleanup process (in seconds) - Default: 600 (10 minutes) - - - - - How much time in seconds to wait after a temporary index has been used before removing it if no further - calls were made to it during that time - Default: 1200 (20 minutes) - - - - - Temp indexes are kept in memory until they reach this integer value in bytes - Default: 25 MB - Minimum: 1 MB - - - - - The hostname to use when creating the http listener (null to accept any hostname or address) - Default: none, binds to all host names - - - - - The port to use when creating the http listener. - Default: 8080. You can set it to *, in which case it will find the first available port from 8080 and upward. - - - - - Determine the value of the Access-Control-Allow-Origin header sent by the server. - Indicates the URL of a site trusted to make cross-domain requests to this server. - Allowed values: null (don't send the header), *, http://example.org (space separated if multiple sites) - - - - - Determine the value of the Access-Control-Max-Age header sent by the server. - Indicates how long (seconds) the browser should cache the Access Control settings. - Ignored if AccessControlAllowOrigin is not specified. - Default: 1728000 (20 days) - - - - - Determine the value of the Access-Control-Allow-Methods header sent by the server. - Indicates which HTTP methods (verbs) are permitted for requests from allowed cross-domain origins. - Ignored if AccessControlAllowOrigin is not specified. - Default: PUT,PATCH,GET,DELETE,POST - - - - - Determine the value of the Access-Control-Request-Headers header sent by the server. - Indicates which HTTP headers are permitted for requests from allowed cross-domain origins. - Ignored if AccessControlAllowOrigin is not specified. - Allowed values: null (allow whatever headers are being requested), HTTP header field name - - - - - The virtual directory to use when creating the http listener. - Default: / - - - - - Whether to use http compression or not. - Allowed values: true/false; - Default: true - - - - - Defines which operations are allowed for anonymous users. - Allowed values: All, Get, None - Default: Get - - - - - Defines which mode to use to authenticate requests - Allowed values: Windows, OAuth - Default: Windows - - - - - If set local request don't require authentication - Allowed values: true/false - Default: false - - - - - The certificate to use when verifying access token signatures for OAuth - - - - - The directory for the RavenDB database. - You can use the ~\ prefix to refer to RavenDB's base directory. - Default: ~\Data - - - - - What storage type to use (see: RavenDB Storage engines) - Allowed values: esent, munin - Default: esent - - - - - Should RavenDB's storage be in-memory. If set to true, Munin would be used as the - storage engine, regardless of what was specified for StorageTypeName - Allowed values: true/false - Default: false - - - - - What sort of transaction mode to use. - Allowed values: - Lazy - faster, but can result in data loss in the case of server crash. - Safe - slower, but will never lose data - Default: Safe - - - - - The directory to search for RavenDB's WebUI. - This is usually only useful if you are debugging RavenDB's WebUI. - Default: ~/Raven/WebUI - - - - - Where to look for plugins for RavenDB. - Default: ~\Plugins - - - - - The expiration value for documents in the internal managed cache - - - - - Ask the trigger whatever the DELETE should be vetoed. - If the trigger vote to veto the DELETE, it needs to provide a human readable - explanation why the DELETE was rejected. - - This method SHOULD NOT modify either the attachment or the metadata. - The attachment key - Whatever the put was vetoed or not - - - - Allow the trigger to perform any logic just before the attachment is deleted. - - If the trigger need to access the previous state of the attachment, the trigger should - implement and use the provided - instance to Get it. The returned result would be the old - document (if it exists) or null. - Any call to the provided instance will be done under the - same transaction as the DELETE operation. - - The document key - - - - Allow the trigger to perform any logic after the attachment was deleted but still in the - same transaction as the delete. - This method is called only if a row was actually deleted - - Any call to the provided instance will be done under the - same transaction as the DELETE operation. - - The attachment key - - - - Allow the trigger to perform any logic _after_ the transaction was committed. - For example, by notifying interested parties. - The attachment key - - - - Ask the trigger whatever the PUT should be vetoed. - If the trigger vote to veto the PUT, it needs to provide a human readable - explanation why the PUT was rejected. - - This method SHOULD NOT modify either the document or the metadata. - The document key - The new attachment data about to be put into Raven - The new document metadata - Whatever the put was vetoed or not - - - - Allow the trigger to perform any logic just before the document is saved to disk. - Any modifications the trigger makes to the document or the metadata will be persisted - to disk. - - If the trigger need to access the previous state of the document, the trigger should - implement and use the provided - instance to Get it. The returned result would be the old - document (if it exists) or null. - Any call to the provided instance will be done under the - same transaction as the PUT operation. - The document key - The new attachment data about to be put into Raven - The new document metadata - - - - Allow the trigger to perform any logic after the document was put but still in the - same transaction as the put - - Any call to the provided instance will be done under the - same transaction as the PUT operation. - The document key - The new attachment data about to be put into Raven - The new document metadata - The etag of the just put document - - - - Allow the trigger to perform any logic _after_ the transaction was committed. - For example, by notifying interested parties. - - This method SHOULD NOT modify either the document or the metadata - The document key - The attachment data that was put into Raven - The document metadata - The etag of the just put document - - - - Ask the trigger whatever the document should be read by the user. - - The document and metadata instances SHOULD NOT be modified. - - The key of the read document - can be null if reading a projection - The attachment data being read - The document metadata - Whatever the operation is a load or a query - - * If the result is Allow, the operation continues as usual. - * If the result is Deny, the operation will return an error to the user - if asking for a particular document, or an error document in place of - the result if asking for a query. - * If the result is Ignore, the operation will return null to the user if - asking for a particular document, or skip including the result entirely - in the query results. - - - - - Allow the trigger the option of modifying the document and metadata instances - before the user can see them. - - The modified values are transient, and are NOT saved to the database. - - - - - Get the group by value from the document - - - - - Defining the translator function for a set of results - about to sent to the user and apply final processing - - - - - * Read triggers may be called on projections from indexes, not just documents - - - - - Ask the trigger whatever the document should be read by the user. - - The document and metadata instances SHOULD NOT be modified. - - The key of the read document - can be null if reading a projection - The document metadata - Whatever the operation is a load or a query - The transaction information, if any - - * If the result is Allow, the operation continues as usual. - * If the result is Deny, the operation will return an error to the user - if asking for a particular document, or an error document in place of - the result if asking for a query. - * If the result is Ignore, the operation will return null to the user if - asking for a particular document, or skip including the result entirely - in the query results. - - - - - Allow the trigger the option of modifying the document and metadata instances - before the user can see them. - - The modified values are transient, and are NOT saved to the database. - - The key of the read document - can be null if reading a projection - The document being read - The document metadata - Whatever the operation is a load or a query - The transaction information, if any - - - - Implementers of this class are called whenever an index entry is - created / deleted. - Work shouldn't be done by the methods of this interface, rather, they - should be done in a background thread. Communication between threads can - use either in memory data structure or the persistent (and transactional ) - queue implementation available on the transactional storage. - - - * All operations are delete/create operations, whatever the value - previously existed or not. - * It is possible for OnIndexEntryDeleted to be called for non existent - values. - * It is possible for a single entry key to be called inserted several times - entry keys are NOT unique. - - - - - Notify that a document with the specified key was deleted - Key may represent a missing document - - The entry key - - - - Notify that the specified document with the specified key is about - to be inserted. - - You may modify the provided lucene document, changes made to the document - will be written to the Lucene index - - The entry keyThe lucene document about to be written - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - - - Information about index failure rates - - - - - Gets the error message. - - - - - - Gets a value indicating whether this is invalid index. - - - true if this is invalid index; otherwise, false. - - - - - Gets or sets the name. - - The name. - - - - Gets or sets the number of indexing attempts. - - - - - Gets or sets the number of indexing errors. - - - - - Gets or sets the number of indexing successes. - - - - - Gets or sets the number of reduce attempts. - - - - - Gets or sets the number of reduce errors. - - - - - Gets or sets the number of reduce successes. - - - - - Gets the failure rate. - - The failure rate. - - - - This exception is raised when querying an index that was disabled because the error rate exceeded safety margins - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The information. - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - 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). - - - - Gets or sets the information about the index failure - - The information. - - - - This exception is raised when an operation has been vetoed by a trigger - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - The message. - - - - Initializes a new instance of the class. - - The message. - The inner. - - - - 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). - - - - This is a thread safe, single instance for a particular index. - - - - - Whatever this is a map reduce index or not - - - - - Detects untokenized fields and sets as NotAnalyzed in analyzer - - - - - This is required to ensure serial generation of etags during puts - - - - - This API is provided solely for the use of bundles that might need to run - without any other bundle interfering. Specifically, the replication bundle - need to be able to run without interference from any other bundle. - - - - - - Get the total size taken by the database on the disk. - This explicitly does NOT include in memory indexes or in memory database. - It does include any reserved space on the file system, which may significantly increase - the database size. - - - This is a potentially a very expensive call, avoid making it if possible. - - - - - The name of the database. - Defaults to null for the root database (or embedded database), or the name of the database if this db is a tenant database - - - - - This is used to hold state associated with this instance by external extensions - - - - - Whatever this database has been disposed - - - - - This method generate the fields for indexing documents in lucene from the values. - Given a name and a value, it has the following behavior: - * If the value is enumerable, index all the items in the enumerable under the same field name - * If the value is null, create a single field with the supplied name with the unanalyzed value 'NULL_VALUE' - * If the value is string or was set to not analyzed, create a single field with the supplied name - * If the value is date, create a single field with millisecond precision with the supplied name - * If the value is numeric (int, long, double, decimal, or float) will create two fields: - 1. with the supplied name, containing the numeric value as an unanalyzed string - useful for direct queries - 2. with the name: name +'_Range', containing the numeric value in a form that allows range queries - - - - - This class represents a base class for all "Views" we generate and compile on the fly - all - Map and MapReduce indexes are being re-written into this class and then compiled and executed - against the data in RavenDB - - - - - Takes two query expressions as strings, and compile them. - Along the way we apply some minimal transformations, the end result is an instance - of AbstractViewGenerator, representing the map/reduce functions - - - - - Defining the indexing function for a set of documents - - - - - These methods allow the indexes to use Linq query syntax using dynamic - - - - - Responds the specified context. - - The context. - - - - This is used mostly for replication - - - - - We need to NOT remove documents that has been removed then added. - We DO remove documents that would be filtered out because of an Entity Name changed, though. - - - - - Thread safe, single instance for the entire application - - - - diff --git a/lib/RavenDB/RavenDB.Database.992/Raven.Database.dll b/lib/RavenDB/RavenDB.Database.992/Raven.Database.dll deleted file mode 100644 index 793aa69c04c..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Raven.Database.dll and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Raven.Database.pdb b/lib/RavenDB/RavenDB.Database.992/Raven.Database.pdb deleted file mode 100644 index 806e6d04283..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Raven.Database.pdb and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Raven.Munin.XML b/lib/RavenDB/RavenDB.Database.992/Raven.Munin.XML deleted file mode 100644 index f5a257e1038..00000000000 --- a/lib/RavenDB/RavenDB.Database.992/Raven.Munin.XML +++ /dev/null @@ -1,26 +0,0 @@ - - - - Raven.Munin - - - - - This method should be called when the application is idle - It is used for book keeping tasks such as compacting the data storage file. - - - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - 2 - - - - Simple read only version of the file based data. - It is mostly meant for read only access from remote application domain. - - - - diff --git a/lib/RavenDB/RavenDB.Database.992/Raven.Munin.dll b/lib/RavenDB/RavenDB.Database.992/Raven.Munin.dll deleted file mode 100644 index e0a2ef26016..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Raven.Munin.dll and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Raven.Munin.pdb b/lib/RavenDB/RavenDB.Database.992/Raven.Munin.pdb deleted file mode 100644 index bccc8b745e7..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Raven.Munin.pdb and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Raven.Storage.Esent.dll b/lib/RavenDB/RavenDB.Database.992/Raven.Storage.Esent.dll deleted file mode 100644 index 914d0cd6b24..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Raven.Storage.Esent.dll and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Raven.Storage.Esent.pdb b/lib/RavenDB/RavenDB.Database.992/Raven.Storage.Esent.pdb deleted file mode 100644 index 96614bab107..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Raven.Storage.Esent.pdb and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Raven.Storage.Managed.dll b/lib/RavenDB/RavenDB.Database.992/Raven.Storage.Managed.dll deleted file mode 100644 index 3eced2c3c5e..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Raven.Storage.Managed.dll and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Raven.Storage.Managed.pdb b/lib/RavenDB/RavenDB.Database.992/Raven.Storage.Managed.pdb deleted file mode 100644 index 8c9082474c4..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Raven.Storage.Managed.pdb and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Spatial4n.Core.dll b/lib/RavenDB/RavenDB.Database.992/Spatial4n.Core.dll deleted file mode 100644 index fb7942f03e5..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Spatial4n.Core.dll and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Database.992/Spatial4n.Core.pdb b/lib/RavenDB/RavenDB.Database.992/Spatial4n.Core.pdb deleted file mode 100644 index 69c100b5397..00000000000 Binary files a/lib/RavenDB/RavenDB.Database.992/Spatial4n.Core.pdb and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Embedded.992/Raven.Client.Embedded.dll b/lib/RavenDB/RavenDB.Embedded.992/Raven.Client.Embedded.dll deleted file mode 100644 index 1d94cfc31ec..00000000000 Binary files a/lib/RavenDB/RavenDB.Embedded.992/Raven.Client.Embedded.dll and /dev/null differ diff --git a/lib/RavenDB/RavenDB.Embedded.992/Raven.Client.Embedded.pdb b/lib/RavenDB/RavenDB.Embedded.992/Raven.Client.Embedded.pdb deleted file mode 100644 index 4d0182d1439..00000000000 Binary files a/lib/RavenDB/RavenDB.Embedded.992/Raven.Client.Embedded.pdb and /dev/null differ diff --git a/lib/ServiceLocation/Microsoft.Practices.ServiceLocation.dll b/lib/ServiceLocation/Microsoft.Practices.ServiceLocation.dll deleted file mode 100644 index 3f8895473ed..00000000000 Binary files a/lib/ServiceLocation/Microsoft.Practices.ServiceLocation.dll and /dev/null differ diff --git a/lib/ServiceLocation/Microsoft.Practices.ServiceLocation.xml b/lib/ServiceLocation/Microsoft.Practices.ServiceLocation.xml deleted file mode 100644 index 6c6f2fe625f..00000000000 --- a/lib/ServiceLocation/Microsoft.Practices.ServiceLocation.xml +++ /dev/null @@ -1,280 +0,0 @@ - - - - Microsoft.Practices.ServiceLocation - - - - - The standard exception thrown when a ServiceLocator has an error in resolving an object. - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class with a specified error message. - - - The message that describes the error. - - - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - - - The error message that explains the reason for the exception. - - - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - - - Initializes a new instance of the class with serialized data. - - - 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). - - - - - The generic Service Locator interface. This interface is used - to retrieve services (instances identified by type and optional - name) from a container. - - - - - Get an instance of the given . - - Type of object requested. - if there is an error resolving - the service instance. - The requested service instance. - - - - Get an instance of the given named . - - Type of object requested. - Name the object was registered with. - if there is an error resolving - the service instance. - The requested service instance. - - - - Get all instances of the given currently - registered in the container. - - Type of object requested. - if there is are errors resolving - the service instance. - A sequence of instances of the requested . - - - - Get an instance of the given . - - Type of object requested. - if there is are errors resolving - the service instance. - The requested service instance. - - - - Get an instance of the given named . - - Type of object requested. - Name the object was registered with. - if there is are errors resolving - the service instance. - The requested service instance. - - - - Get all instances of the given currently - registered in the container. - - Type of object requested. - if there is are errors resolving - the service instance. - A sequence of instances of the requested . - - - - 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 Activation error occured while trying to get all instances of type {0}. - - - - - Looks up a localized string similar to Activation error occured while trying to get instance of type {0}, key "{1}". - - - - - This class provides the ambient container for this application. If your - framework defines such an ambient container, use ServiceLocator.Current - to get it. - - - - - Set the delegate that is used to retrieve the current container. - - Delegate that, when called, will return - the current ambient container. - - - - The current ambient container. - - - - - This class is a helper that provides a default implementation - for most of the methods of . - - - - - Implementation of . - - The requested service. - if there is an error in resolving the service instance. - The requested object. - - - - Get an instance of the given . - - Type of object requested. - if there is an error resolving - the service instance. - The requested service instance. - - - - Get an instance of the given named . - - Type of object requested. - Name the object was registered with. - if there is an error resolving - the service instance. - The requested service instance. - - - - Get all instances of the given currently - registered in the container. - - Type of object requested. - if there is are errors resolving - the service instance. - A sequence of instances of the requested . - - - - Get an instance of the given . - - Type of object requested. - if there is are errors resolving - the service instance. - The requested service instance. - - - - Get an instance of the given named . - - Type of object requested. - Name the object was registered with. - if there is are errors resolving - the service instance. - The requested service instance. - - - - Get all instances of the given currently - registered in the container. - - Type of object requested. - if there is are errors resolving - the service instance. - A sequence of instances of the requested . - - - - When implemented by inheriting classes, this method will do the actual work of resolving - the requested service instance. - - Type of instance requested. - Name of registered service you want. May be null. - The requested service instance. - - - - When implemented by inheriting classes, this method will do the actual work of - resolving all the requested service instances. - - Type of service requested. - Sequence of service instance objects. - - - - Format the exception message for use in an - that occurs while resolving a single service. - - The actual exception thrown by the implementation. - Type of service requested. - Name requested. - The formatted exception message string. - - - - Format the exception message for use in an - that occurs while resolving multiple service instances. - - The actual exception thrown by the implementation. - Type of service requested. - The formatted exception message string. - - - - This delegate type is used to provide a method that will - return the current container. Used with the - static accessor class. - - An . - - - diff --git a/lib/System.Web.Mvc.dll b/lib/System.Web.Mvc.dll deleted file mode 100644 index 775ac8846ce..00000000000 Binary files a/lib/System.Web.Mvc.dll and /dev/null differ diff --git a/lib/System.Web.Mvc.xml b/lib/System.Web.Mvc.xml deleted file mode 100644 index a98dde87ae3..00000000000 --- a/lib/System.Web.Mvc.xml +++ /dev/null @@ -1,8318 +0,0 @@ - - - - System.Web.Mvc - - - - Represents an attribute that specifies which HTTP verbs an action method will respond to. - - - Initializes a new instance of the class by using a list of HTTP verbs that the action method will respond to. - The HTTP verbs that the action method will respond to. - The parameter is null or zero length. - - - Initializes a new instance of the class using the HTTP verbs that the action method will respond to. - The HTTP verbs that the action method will respond to. - - - Determines whether the specified method information is valid for the specified controller context. - true if the method information is valid; otherwise, false. - The controller context. - The method information. - The parameter is null. - - - Gets or sets the list of HTTP verbs that the action method will respond to. - The list of HTTP verbs that the action method will respond to. - - - Provides information about an action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - - - Gets the name of the action method. - The name of the action method. - - - Gets the controller descriptor. - The controller descriptor. - - - Executes the action method by using the specified parameters and controller context. - The result of executing the action method. - The controller context. - The parameters of the action method. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes of the specified type exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - The parameter is null. - - - Returns the filters that are associated with this action method. - The filters that are associated with this action method. - - - Returns the parameters of the action method. - The parameters of the action method. - - - Returns the action-method selectors. - The action-method selectors. - - - Determines whether one or more instances of the specified attribute type are defined for this member. - true if the is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The parameter is null. - - - Provides the context for the ActionExecuted method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The controller context. - The action method descriptor. - true if the action is canceled. - The exception object. - The parameter is null. - - - Gets or sets the action descriptor. - The action descriptor. - - - Gets or sets a value that indicates that this object is canceled. - true if the context canceled; otherwise, false. - - - Gets or sets the exception that occurred during the execution of the action method, if any. - The exception that occurred during the execution of the action method. - - - Gets or sets a value that indicates whether the exception is handled. - true if the exception is handled; otherwise, false. - - - Gets or sets the result returned by the action method. - The result returned by the action method. - - - Provides the context for the ActionExecuting method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified controller context, action descriptor, and action-method parameters. - The controller context. - The action descriptor. - The action-method parameters. - The or parameter is null. - - - Gets or sets the action descriptor. - The action descriptor. - - - Gets or sets the action-method parameters. - The action-method parameters. - - - Gets or sets the result that is returned by the action method. - The result that is returned by the action method. - - - Represents the base class for all action-filter attributes. - - - Initializes a new instance of the class. - - - Called by the MVC framework after the action method executes. - The filter context. - - - Called by the MVC framework before the action method executes. - The filter context. - - - Called by the MVC framework after the action result executes. - The filter context. - - - Called by the MVC framework before the action result executes. - The filter context. - - - Represents an attribute that is used to influence the selection of an action method. - - - Initializes a new instance of the class. - - - Determines whether the action method selection is valid for the specified controller context. - true if the action method selection is valid for the specified controller context; otherwise, false. - The controller context. - Information about the action method. - - - Represents an attribute that is used for the name of an action. - - - Initializes a new instance of the class. - Name of the action. - The parameter is null or empty. - - - Determines whether the action name is valid within the specified controller context. - true if the action name is valid within the specified controller context; otherwise, false. - The controller context. - The name of the action. - Information about the action method. - - - Gets or sets the name of the action. - The name of the action. - - - Represents an attribute that affects the selection of an action method. - - - Initializes a new instance of the class. - - - Determines whether the action name is valid in the specified controller context. - true if the action name is valid in the specified controller context; otherwise, false. - The controller context. - The name of the action. - Information about the action method. - - - Encapsulates the result of an action method and is used to perform a framework-level operation on behalf of the action method. - - - Initializes a new instance of the class. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - - - Represents a delegate that contains the logic for selecting an action method. - true if an action method was successfully selected; otherwise, false. - The current HTTP request context. - - - Represents support for rendering HTML in AJAX scenarios within a view. - - - Initializes a new instance of the class using the specified view context and view data container. - The view context. - The view data container. - One or both of the parameters is null. - - - Initializes a new instance of the class by using the specified view context, view data container, and route collection. - The view context. - The view data container. - The URL route collection. - One or more of the parameters is null. - - - Gets or sets the root path for the location to use for globalization script files. - The location of the folder where globalization script files are stored. The default location is "~/Scripts/Globalization". - - - Serializes the specified message and returns the resulting JSON-formatted string. - The serialized message as a JSON-formatted string. - The message to serialize. - - - Gets the collection of URL routes for the application. - The collection of routes for the application. - - - Gets the context information about the view. - The context of the view. - - - Gets the current view data dictionary. - The view data dictionary. - - - Gets the view data container. - The view data container. - - - Represents support for rendering HTML in AJAX scenarios within a strongly typed view. - The type of the model. - - - Initializes a new instance of the class by using the specified view context and view data container. - The view context. - The view data container. - - - Initializes a new instance of the class by using the specified view context, view data container, and URL route collection. - The view context. - The view data container. - The URL route collection. - - - Gets the strongly typed version of the view data dictionary. - The strongly typed data dictionary of the view. - - - Represents a class that extends the class by adding the ability to determine whether an HTTP request is an AJAX request. - - - Determines whether the specified HTTP request is an AJAX request. - true if the specified HTTP request is an AJAX request; otherwise, false. - The HTTP request. - The parameter is null (Nothing in Visual Basic). - - - Provides a way to register one or more areas in an ASP.NET MVC application. - - - Initializes a new instance of the class. - - - Gets the name of the area to be registered. - The name of the area to be registered. - - - Registers all areas in an ASP.NET MVC application. - - - Registers all areas in an ASP.NET MVC application by using the specified user-defined state information. - An object that contains user-defined information to pass to the area. - - - Registers an area in an ASP.NET MVC application using the specified area's context information. - Encapsulates the information that is required in order to register the area. - - - Encapsulates the information that is required in order to register an area within an ASP.NET MVC application. - - - Initializes a new instance of the class using the specified area name and routes collection. - The name of the area to register. - The collection of routes for the application. - - - Initializes a new instance of the class using the specified area name, routes collection, and user-defined data. - The name of the area to register. - The collection of routes for the application. - An object that contains user-defined information to pass to the area. - - - Gets the name of the area to register. - The name of the area to register. - - - Maps the specified URL route and associates it with the area that is specified by the property. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values and constraint. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify valid values for a URL parameter. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values, constraints, and namespaces. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify valid values for a URL parameter. - An enumerable set of namespaces for the application. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified route default values and namespaces. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An object that contains default route values. - An enumerable set of namespaces for the application. - The parameter is null. - - - Maps the specified URL route and associates it with the area that is specified by the property, using the specified namespaces. - A reference to the mapped route. - The name of the route. - The URL pattern for the route. - An enumerable set of namespaces for the application. - The parameter is null. - - - Gets the namespaces for the application. - An enumerable set of namespaces for the application. - - - Gets a collection of defined routes for the application. - A collection of defined routes for the application. - - - Gets an object that contains user-defined information to pass to the area. - An object that contains user-defined information to pass to the area. - - - Provides an abstract class to implement a metadata provider. - - - Called from constructors in a derived class to initialize the class. - - - When overridden in a derived class, creates the model metadata for the property. - The model metadata for the property. - The set of attributes. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - - - Gets a list of attributes. - A list of attributes. - The type of the container. - The property descriptor. - The attribute container. - - - Returns a list of properties for the model. - A list of properties for the model. - The model container. - The type of the container. - - - Returns the metadata for the specified property using the container type and property descriptor. - The metadata for the specified property. - The model accessor. - The type of the container. - The property descriptor. - - - Returns the metadata for the specified property using the container type and property name. - The metadata for the specified property. - The model accessor. - The type of the container. - The name of the property. - - - Returns the metadata for the specified property using the type of the model. - The metadata for the specified property. - The model accessor. - The type of the container. - - - Returns the type descriptor from the specified type. - The type descriptor. - The type. - - - Provides an abstract class for classes that implement a validation provider. - - - Called from constructors in derived classes to initialize the class. - - - Gets a type descriptor for the specified type. - A type descriptor for the specified type. - The type of the validation provider. - - - Gets the validators for the model using the metadata and controller context. - The validators for the model. - The metadata. - The controller context. - - - Gets the validators for the model using the metadata, the controller context, and a list of attributes. - The validators for the model. - The metadata. - The controller context. - The list of attributes. - - - Provides the base class for asynchronous controllers. - - - Initializes a new instance of the class. - - - Gets the asynchronous manager instance. - The asynchronous manager instance. - - - Called by ASP.NET to initialize asynchronous request processing. - The status of the asynchronous operation. - The request context. - The asynchronous callback method. - The state object. - - - Called by ASP.NET during initialization of asynchronous request processing. - The status of the asynchronous operation. - The asynchronous callback method. - The state object. - - - Creates an action invoker. - An action invoker. - - - Cancels the execution of an asynchronous action method. - The status of the asynchronous result. - - - Called by ASP.NET when the current asynchronous action has completed. - The status of the asynchronous result. - - - Called by ASP.NET to begin the execution of an asynchronous action method. - The status of the asynchronous operation. - The request context. - The asynchronous callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Cancels the execution of an asynchronous action method by ASP.NET at the end of the execution of an asynchronous action method. - The status of the asynchronous result. - - - Represents an attribute that is used to set the timeout value, in milliseconds, for an asynchronous method. - - - Initializes a new instance of the class. - The timeout value, in milliseconds. - - - Gets the timeout duration, in milliseconds. - The timeout duration, in milliseconds. - - - Called by ASP.NET before the asynchronous action method executes. - The filter context. - - - Encapsulates the information that is required for using an attribute. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified controller context. - The context within which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - - - Initializes a new instance of the class using the specified controller context and action descriptor. - The context in which the result is executed. The context information includes the controller, HTTP content, request context, and route data. - An object that provides information about an action method, such as its name, controller, parameters, attributes, and filters. - - - Provides information about the action method that is marked by the attribute, such as its name, controller, parameters, attributes, and filters. - The action descriptor for the action method that is marked by the attribute. - - - Gets or sets the result that is returned by an action method. - The result that is returned by an action method. - - - Represents an attribute that is used to restrict access by callers to an action method. - - - Initializes a new instance of the class. - - - Determines whether access to the core framework is authorized. - true if access is authorized; otherwise, false. - The HTTP context, which encapsulates all HTTP-specific information about an individual HTTP request. - The parameter is null. - - - Processes HTTP requests that fail authorization. - Encapsulates the information for using . The object contains the controller, HTTP context, request context, action result, and route data. - - - Called when a process requests authorization. - The filter context, which encapsulates information for using . - The parameter is null. - - - Called when the caching module requests authorization. - A reference to the validation status. - The HTTP context, which encapsulates all HTTP-specific information about an individual HTTP request. - The parameter is null. - - - Gets or sets the user roles. - The user roles. - - - Gets the unique identifier for this attribute. - The unique identifier for this attribute. - - - Gets or sets the authorized users. - The authorized users. - - - Represents an attribute that is used to provide details about how model binding to a parameter should occur. - - - Initializes a new instance of the class. - - - Gets or sets a comma-delimited list of property names for which binding is not allowed. - The exclude list. - - - Gets or sets a comma-delimited list of property names for which binding is allowed. - The include list. - - - Determines whether the specified property is allowed. - true if the specified property is allowed; otherwise, false. - The name of the property. - - - Gets or sets the prefix to use when markup is rendered for binding to an action argument or to a model property. - The prefix to use. - - - Maps a browser request to a byte array. - - - Initializes a new instance of the class. - - - Binds the model by using the specified controller context and binding context. - The bound data object. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The parameter is null. - - - Represents an attribute that is used to indicate that an action method should be called only as a child action. - - - Initializes a new instance of the class. - - - Called when authorization is required. - An object that encapsulates the information that is required in order to authorize access to the child action. - - - Returns the client data-type model validators. - - - Initializes a new instance of the class. - - - Returns the client data-type model validators. - The client data-type model validators. - The metadata. - The context. - - - Represents a user-defined content type that is the result of an action method. - - - Initializes a new instance of the class. - - - Gets or sets the content. - The content. - - - Gets or sets the content encoding. - The content encoding. - - - Gets or sets the type of the content. - The type of the content. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Provides methods that respond to HTTP requests that are made to an ASP.NET MVC Web site. - - - Initializes a new instance of the class. - - - Gets the action invoker for the controller. - The action invoker. - - - Gets or sets the binder. - The binder. - - - Creates a content result object by using a string. - The content result instance. - The content to write to the response. - - - Creates a content result object by using a string and the content type. - The content result instance. - The content to write to the response. - The content type (MIME type). - - - Creates a content result object by using a string, the content type, and content encoding. - The content result instance. - The content to write to the response. - The content type (MIME type). - The content encoding. - - - Creates an action invoker. - An action invoker. - - - Creates a temporary data provider. - A temporary data provider. - - - Releases all resources that are used by the current instance of the class. - - - Releases unmanaged resources and optionally releases managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Invokes the action in the current controller context. - - - Creates a object by using the file contents and file type. - The file-content result object. - The binary content to send to the response. - The content type (MIME type). - - - Creates a object by using the file contents, content type, and the destination file name. - The file-content result object. - The binary content to send to the response. - The content type (MIME type). - The file name to use in the file-download dialog box that is displayed in the browser. - - - Creates a object by using the object and content type. - The file-content result object. - The stream to send to the response. - The content type (MIME type). - - - Creates a object using the object, the content type, and the target file name. - The file-stream result object. - The stream to send to the response. - The content type (MIME type) - The file name to use in the file-download dialog box that is displayed in the browser. - - - Creates a object by using the file name and the content type. - The file-stream result object. - The path of the file to send to the response. - The content type (MIME type). - - - Creates a object by using the file name, the content type, and the file download name. - The file-stream result object. - The path of the file to send to the response. - The content type (MIME type). - The file name to use in the file-download dialog box that is displayed in the browser. - - - Called when a request matches this controller, but no method with the specified action name is found in the controller. - The name of the attempted action. - - - Gets HTTP-specific information about an individual HTTP request. - The HTTP context. - - - Initializes data that might not be available when the constructor is called. - The HTTP context and route data. - - - Creates a object. - The object that writes the script to the response. - The JavaScript code to run on the client - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON). - The JSON result object that serializes the specified object to JSON format. The result object that is prepared by this method is written to the response by the MVC framework when the object is executed. - The JavaScript object graph to serialize. - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format. - The JSON result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format. - The JSON result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - The content encoding. - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the content type, content encoding, and the JSON request behavior. - The result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - The content encoding. - The JSON request behavior - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified content type and JSON request behavior. - The result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - The JSON request behavior - - - Creates a object that serializes the specified object to JavaScript Object Notation (JSON) format using the specified JSON request behavior. - The result object that serializes the specified object to JSON format. - The JavaScript object graph to serialize. - The content type (MIME type). - - - Gets the model state dictionary object that contains the state of the model and of model-binding validation. - The model state dictionary. - - - Called after the action method is invoked. - Information about the current request and action. - - - Called before the action method is invoked. - Information about the current request and action. - - - Called when authorization occurs. - Information about the current request and action. - - - Called when an unhandled exception occurs in the action. - Information about the current request and action. - - - Called after the action result that is returned by an action method is executed. - Information about the current request and action result - - - Called before the action result that is returned by an action method is executed. - Information about the current request and action result - - - Creates a object that renders a partial view. - A partial-view result object. - - - Creates a object that renders a partial view, by using the specified model. - A partial-view result object. - The model that is rendered by the partial view - - - Creates a object that renders a partial view, by using the specified view name. - A partial-view result object. - The name of the view that is rendered to the response. - - - Creates a object that renders a partial view, by using the specified view name and model. - A partial-view result object. - The name of the view that is rendered to the response. - The model that is rendered by the partial view - - - Creates a object that redirects to the specified URL. - The redirect result object. - The URL to redirect to. - - - Redirects to the specified action using the action name. - The redirect result object. - The name of the action. - - - Redirects to the specified action using the action name and route values. - The redirect result object. - The name of the action. - The parameters for a route. - - - Redirects to the specified action using the action name and controller name. - The redirect result object. - The name of the action. - The name of the controller - - - Redirects to the specified action using the action name, controller name, and route values. - The redirect result object. - The name of the action. - The name of the controller - The parameters for a route. - - - Redirects to the specified action using the action name, controller name, and route dictionary. - The redirect result object. - The name of the action. - The name of the controller - The parameters for a route. - - - Redirects to the specified action using the action name and route dictionary. - The redirect result object. - The name of the action. - The parameters for a route. - - - Redirects to the specified route using the specified route values. - The redirect-to-route result object. - The parameters for a route. - - - Redirects to the specified route using the route name. - The redirect-to-route result object. - The name of the route - - - Redirects to the specified route using the route name and route values. - The redirect-to-route result object. - The name of the route - The parameters for a route. - - - Redirects to the specified route using the route name and route dictionary. - The redirect-to-route result object. - The name of the route - The parameters for a route. - - - Redirects to the specified route using the route dictionary. - The redirect-to-route result object. - The parameters for a route. - - - Gets the object for the current HTTP request. - The request object. - - - Gets the object for the current HTTP response. - The response object. - - - Gets the route data for the current request. - The route data. - - - Gets the object that provides methods that are used during Web request processing. - The HTTP server object. - - - Gets the object for the current HTTP request. - The HTTP session-state object for the current HTTP request. - - - This API supports the MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The filter context. - - - This API supports the MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The filter context. - - - This API supports the MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The filter context. - - - This API supports the MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The filter context. - - - This API supports the MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The filter context. - - - This API supports the MVC infrastructure and is not intended to be used directly from your code. This method calls the method. - The filter context. - - - Gets the temporary-data provider object that is used to store data for the next request. - The temporary-data provider. - - - Updates the specified model instance using values from the controller's current value provider. - true if the update is successful; otherwise, false. - The model instance to update. - The type of the model object. - The parameter or the property is null. - - - Updates the specified model instance using values from the controller's current value provider and a prefix. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - The type of the model object. - The parameter or the property is null. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - The type of the model object. - The parameter or the property is null. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, a list of properties to exclude, and a list of properties to include. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the parameter list. - The type of the model object. - The parameter or the property is null. - - - Updates the specified model instance using values from the value provider, a prefix, a list of properties to exclude , and a list of properties to include. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the parameter list. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, and included properties. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider and a prefix. - true if the update is successful; otherwise, false. - The model instance to update. - The prefix to use when looking up values in the value provider. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the controller's current value provider and included properties. - true if the update is successful; otherwise, false. - The model instance to update. - A list of properties of the model to update. - The type of the model object. - The parameter or the property is null. - - - Updates the specified model instance using values from the value provider and a list of properties to include. - true if the update is successful; otherwise, false. - The model instance to update. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider. - true if the update is successful; otherwise, false. - The model instance to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Validates the specified model instance. - true if the model validation is successful; otherwise, false. - The model instance to validate. - - - Validates the specified model instance using an HTML prefix. - true if the model validation is successful; otherwise, false. - The model to validate. - The prefix to use when looking up values in the model provider. - - - Updates the specified model instance using values from the controller's current value provider. - The model instance to update. - The type of the model object. - The model was not successfully updated. - - - Updates the specified model instance using values from the controller's current value provider and a prefix. - The model instance to update. - A prefix to use when looking up values in the value provider. - The type of the model object. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, and included properties. - The model instance to update. - A prefix to use when looking up values in the value provider. - A list of properties of the model to update. - The type of the model object. - - - Updates the specified model instance using values from the controller's current value provider, a prefix, a list of properties to exclude, and a list of properties to include. - The model instance to update. - A prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the list. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, a list of properties to exclude, and a list of properties to include. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A list of properties to explicitly exclude from the update. These are excluded even if they are listed in the parameter list. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. - The model instance to update. - The prefix to use when looking up values in the value provider. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider and a prefix. - The model instance to update. - The prefix to use when looking up values in the value provider. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the controller object's current value provider. - The model instance to update. - A list of properties of the model to update. - The type of the model object. - - - Updates the specified model instance using values from the value provider, a prefix, and a list of properties to include. - The model instance to update. - A list of properties of the model to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Updates the specified model instance using values from the value provider. - The model instance to update. - A dictionary of values that is used to update the model. - The type of the model object. - - - Gets the URL helper object that is used to generate URLs by using routing. - The URL helper object. - - - Gets the user security information for the current HTTP request. - The user security information for the current HTTP request. - - - Validates the specified model instance. - The model to validate. - - - Validates the specified model instance using an HTML prefix. - The model to validate. - The prefix to use when looking up values in the model provider. - - - Creates a object that renders a view to the response. - The view result that renders a view to the response. - - - Creates a object by using the model that renders a view to the response. - The view result. - The model that is rendered by the view. - - - Creates a object by using the view name that renders a view. - The view result. - The name of the view that is rendered to the response. - - - Creates a object by using the view name and model that renders a view to the response. - The view result. - The name of the view that is rendered to the response. - The model that is rendered by the view. - - - Creates a object using the view name and master-page name that renders a view to the response. - The view result. - The name of the view that is rendered to the response. - The name of the master page or template to use when the view is rendered. - - - Creates a object using the view name, master-page name, and model that renders a view. - The view result. - The name of the view that is rendered to the response. - The name of the master page or template to use when the view is rendered. - The model that is rendered by the view. - - - Creates a object that renders the specified object. - The view result. - The view that is rendered to the response. - - - Creates a object that renders the specified object. - The view result. - The view that is rendered to the response. - The model that is rendered by the view. - - - Represents a class that is responsible for invoking the action methods of a controller. - - - Initializes a new instance of the class. - - - Gets or sets the model binders that are associated with the action. - The model binders that are associated with the action. - - - Creates the action result. - The action result object. - The controller context. - The action descriptor. - The action return value. - - - Finds the information about the action method. - Information about the action method. - The controller context. - The controller descriptor. - The name of the action. - - - Retrieves information about the controller by using the specified controller context. - Information about the controller. - The controller context. - - - Retrieves information about the action filters. - Information about the action filters. - The controller context. - The action descriptor. - - - Gets the value of the specified action-method parameter. - The value of the action-method parameter. - The controller context. - The parameter descriptor. - - - Gets the values of the action-method parameters. - The values of the action-method parameters. - The controller context. - The action descriptor. - - - Invokes the specified action by using the specified controller context. - The result of executing the action. - The controller context. - The name of the action to invoke. - The parameter is null. - The parameter is null or empty. - The thread was aborted during invocation of the action. - An unspecified error occurred during invocation of the action. - - - Invokes the specified action method by using the specified parameters and the controller context. - The result of executing the action method. - The controller context. - The action descriptor. - The parameters. - - - Invokes the specified action method by using the specified parameters, controller context, and action filters. - The context for the ActionExecuted method of the class. - The controller context. - The action filters. - The action descriptor. - The parameters. - - - Invokes the specified action result by using the specified controller context. - The controller context. - The action result. - - - Invokes the specified action result by using the specified action filters and the controller context. - The context for the ResultExecuted method of the class. - The controller context. - The action filters. - The action result. - - - Invokes the specified authorization filters by using the specified action descriptor and controller context. - The context for the object. - The controller context. - The authorization filters. - The action descriptor. - - - Invokes the specified exception filters by using the specified exception and controller context. - The context for the object. - The controller context. - The exception filters. - The exception. - - - Represents the base class for all MVC controllers. - - - Initializes a new instance of the class. - - - Gets or sets the controller context. - The controller context. - - - Executes the specified request context. - The request context. - The parameter is null. - - - Executes the request. - - - Initializes the specified request context. - The request context. - - - Executes the specified request context. - The request context. - - - Gets or sets the dictionary for temporary data. - The dictionary for temporary data. - - - Gets or sets a value that indicates whether request validation is enabled for this request. - true if request validation is enabled for this request; otherwise, false. The default is true. - - - Gets or sets the value provider for the controller. - The value provider for the controller. - - - Gets or sets the dictionary for view data. - The dictionary for the view data. - - - Represents a class that is responsible for dynamically building a controller. - - - Initializes a new instance of the class. - - - Gets the current controller builder object. - The current controller builder. - - - Gets the default namespaces. - The default namespaces. - - - Gets the associated controller factory. - The controller factory. - - - Sets the controller factory by using the specified type. - The type of the controller factory. - The parameter is null. - The controller factory cannot be assigned from the type in the parameter. - An error occurred while the controller factory was being set. - - - Sets the specified controller factory. - The controller factory. - The parameter is null. - - - Encapsulates information about an HTTP request that matches specified and instances. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified HTTP context, URL route data, and controller. - The HTTP context. - The route data. - The controller. - - - Initializes a new instance of the class by using the specified controller context. - The controller context. - The parameter is null. - - - Initializes a new instance of the class by using the specified request context and controller. - The request context. - The controller. - One or both parameters are null. - - - Gets or sets the controller. - The controller. - - - Gets or sets the HTTP context. - The HTTP context. - - - Gets a value that indicates whether the associated action method is a child action. - true if the associated action method is a child action; otherwise, false. - - - Gets an object that contains the view context information for the parent action method. - An object that contains the view context information for the parent action method. - - - Gets or sets the request context. - The request context. - - - Gets or sets the URL route data. - The URL route data. - - - Encapsulates information that describes a controller, such as its name, type, and actions. - - - Initializes a new instance of the class. - - - Gets the name of the controller. - The name of the controller. - - - Gets the type of the controller. - The type of the controller. - - - Finds an action method by using the specified name and controller context. - The information about the action method. - The controller context. - The name of the action. - - - Retrieves a list of action-method descriptors in the controller. - A list of action-method descriptors in the controller. - - - Retrieves custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Retrieves custom attributes of a specified type that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - The parameter is null (Nothing in Visual Basic). - - - Retrieves a value that indicates whether one or more instance of the specified custom attribute are defined for this member. - true if the is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The parameter is null (Nothing in Visual Basic). - - - Represents an attribute that invokes a custom model binder. - - - Initializes a new instance of the class. - - - Retrieves the associated model binder. - A reference to an object that implements the interface. - - - Provides a container for common metadata, for the class, and for the class for a data model. - - - Initializes a new instance of the class. - The data-annotations model metadata provider. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - The display column attribute. - - - Returns simple text for the model data. - Simple text for the model data. - - - Implements the default model metadata provider for ASP.NET MVC. - - - Initializes a new instance of the class. - - - Gets the metadata for the specified property. - The metadata for the property. - The attributes. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - - - Represents the method that creates a instance. - - - Provides a model validator. - - - Initializes a new instance of the class. - The metadata for the model. - The controller context for the model. - The validation attribute for the model. - - - Gets the validation attribute for the model validator. - The validation attribute for the model validator. - - - Gets the error message for the validation failure. - The error message for the validation failure. - - - Gets a value that indicates whether model validation is required. - true if model validation is required; otherwise, false. - - - Returns a list of validation error messages for the model. - A list of validation error messages for the model, or an empty list if no errors have occurred. - The container for the model. - - - Provides a model validator for a specified validation type. - - - - Initializes a new instance of the class. - The metadata for the model. - The controller context for the model. - The validation attribute for the model. - - - Gets the validation attribute from the model validator. - The validation attribute from the model validator. - - - Implements the default validation provider for MVC. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether non-nullable value types are required. - true if non-nullable value types are required; otherwise, false. - - - Gets a list of validators. - A list of validators. - The metadata. - The context. - The list of validation attributes. - - - Registers an adapter to provide client-side validation. - The type of the validation attribute. - The type of the adapter. - - - Registers an adapter factory for the validation provider. - The type of the attribute. - The factory that will be used to create the object for the specified attribute. - - - Registers the default adapter. - The type of the adapter. - - - Registers the default adapter factory. - The factory that will be used to create the object for the default adapter. - - - Provides a container for the error-information model validator. - - - Initializes a new instance of the class. - - - Gets a list of error-information model validators. - A list of error-information model validators. - The model metadata. - The controller context. - - - Represents the controller factory that is registered by default. - - - Initializes a new instance of the class. - - - Creates the specified controller by using the specified request context. - A reference to the controller. - The context of the HTTP request, which includes the HTTP context and route data. - The name of the controller. - The parameter is null. - The parameter is null or empty. - - - Retrieves the controller instance for the specified request context and controller type. - The controller instance. - The context of the HTTP request, which includes the HTTP context and route data. - The type of the controller. - - is null. - - cannot be assigned. - An instance of cannot be created. - - - Retrieves the controller type for the specified name and request context. - The controller type. - The context of the HTTP request, which includes the HTTP context and route data. - The name of the controller. - - - Releases the specified controller. - The controller to release. - - - Maps a browser request to a data object. This class provides a concrete implementation of a model binder. - - - Initializes a new instance of the class. - - - Gets or sets the model binders for the application. - The model binders for the application. - - - Binds the model by using the specified controller context and binding context. - The bound object. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The parameter is null. - - - Binds the specified property by using the specified controller context and binding context and the specified property descriptor. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property to be bound. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - - - Creates the specified model type by using the specified controller context and binding context. - A data object of the specified type. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The type of the model object to return. - - - Creates an index (a subindex) based on a category of components that make up a larger index, where the specified index value is an integer. - The name of the subindex. - The prefix for the subindex. - The index value. - - - Creates an index (a subindex) based on a category of components that make up a larger index, where the specified index value is a string. - The name of the subindex. - The prefix for the subindex. - The index value. - - - Creates the name of the subproperty by using the specified prefix and property name. - The name of the subproperty. - The prefix for the subproperty. - The name of the property. - - - Returns a set of properties that match the property filter restrictions that are established by the specified . - An enumerable set of property descriptors. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Returns the properties of the model by using the specified controller context and binding context. - A collection of property descriptors. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Returns the value of a property using the specified controller context, binding context, property descriptor, and property binder. - An object that represents the property value. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The descriptor for the property to access. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - An object that provides a way to bind the property. - - - Returns the descriptor object for a type that is specified by its controller context and binding context. - A custom type descriptor object. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Determines whether a data model is valid for the specified binding context. - true if the model is valid; otherwise, false. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - The parameter is null. - - - Called when the model is updated. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Called when the model is updating. - true if the model is updating; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Called when the specified property is validated. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property to be validated. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - The value to set for the property. - - - Called when the specified property is validating. - true if the property is validating; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property being validated. The descriptor provides information such as component type, property type, and property value. It also provides methods to get or set the property value. - The value to set for the property. - - - Gets or sets the name of the resource file (class key) that contains localized string values. - The name of the resource file (class key). - - - Sets the specified property by using the specified controller context, binding context, and property value. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - Describes a property to be set. The descriptor provides information such as the component type, property type, and property value. It also provides methods to get or set the property value. - The value to set for the property. - - - Represents a memory cache for view locations. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified cache time span. - The cache time span. - The Ticks attribute of the parameter is set to a negative number. - - - Retrieves the default view location by using the specified HTTP context and cache key. - The default view location. - The HTTP context. - The cache key - The parameter is null. - - - Inserts the view in the specified virtual path by using the specified HTTP context, cache key, and virtual path. - The HTTP context. - The cache key. - The virtual path - The parameter is null. - - - Creates an empty view location cache. - - - Gets or sets the cache time span. - The cache time span. - - - Represents the base class for value providers whose values come from a collection that implements the interface. - The type of the value. - - - Initializes a new instance of the class. - The name/value pairs that are used to initialize the value provider. - Information about a specific culture, such as the names of the culture, the writing system, and the calendar used. - The parameter is null. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - The parameter is null. - - - Returns a value object using the specified key and controller context. - The value object for the specified key. - The key of the value object to retrieve. - The parameter is null. - - - Provides an empty metadata provider for data models that do not require metadata. - - - Initializes a new instance of the class. - - - Creates a new instance of the class. - An empty instance of the model metadata. - The attributes. - The type of the container. - The model accessor. - The type of the model. - The name of the model. - - - Provides an empty validation provider for models that do not require a validator. - - - Initializes a new instance of the class. - - - Gets the empty model validator. - The empty model validator. - The metadata. - The context. - - - Represents a result that does nothing, such as a controller action method that returns nothing. - - - Initializes a new instance of the class. - - - Executes the specified result context. - The result context. - - - Provides the context for using the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class for the specified exception by using the specified controller context. - The controller context. - The exception. - The parameter is null. - - - Gets or sets the exception object. - The exception object. - - - Gets or sets a value that indicates whether the exception has been handled. - true if the exception has been handled; otherwise, false. - - - Gets or sets the action result. - The action result. - - - Provides a helper class to get the model name from an expression. - - - Gets the model name from a lambda expression. - The model name. - The expression. - - - Gets the model name from a string expression. - The model name. - The expression. - - - Provides a container for client-side field validation metadata. - - - Initializes a new instance of the class. - - - Gets or sets the name of the data field. - The name of the data field. - - - Gets or sets a value that indicates whether the validation message contents should be replaced with the client validation error. - true if the validation message contents should be replaced with the client validation error; otherwise, false. - - - Gets or sets the validator message ID. - The validator message ID. - - - Gets the client validation rules. - The client validation rules. - - - Sends the contents of a binary file to the response. - - - Initializes a new instance of the class by using the specified file contents and content type. - The byte array to send to the response. - The content type to use for the response. - The parameter is null (Nothing in Visual Basic). - - - The binary content to send to the response. - The file contents. - - - Writes the file content to the response. - The response. - - - Sends the contents of a file to the response. - - - Initializes a new instance of the class by using the specified file name and content type. - The name of the file to send to the response. - The content type of the response. - The parameter is null or empty. - - - Gets or sets the path of the file that is sent to the response. - The path of the file that is sent to the response. - - - Writes the file to the response. - The response. - - - Represents a base class that is used to send binary file content to the response. - - - Initializes a new instance of the class. - The type of the content. - The parameter is null or empty. - - - Gets the content type to use for the response. - The type of the content. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets or sets the content-disposition header so that a file-download dialog box is displayed in the browser with the specified file name. - The name of the file. - - - Writes the file to the response. - The response. - - - Sends binary content to the response by using a instance. - - - Initializes a new instance of the class. - The stream to send to the response. - The content type to use for the response. - The parameter is null (Nothing in Visual Basic). - - - Gets the stream that will be sent to the response. - The file stream. - - - Writes the file to the response. - The response. - - - Represents the base class for action-filter attributes. - - - Initializes a new instance of the class. - - - Gets or sets the order in which the action filters are executed. - The order in which the action filters are executed. - - - Encapsulates information about the available action filters. - - - Initializes a new instance of the class. - - - Gets all the action filters in the application. - All action filters. - - - Gets all the authorization filters in the application. - The authorization filters. - - - Gets all the exception filters in the application. - The exception filters. - - - Gets all the result filters in the application. - The result filters. - - - Contains the form value providers for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The collection. - The parameter is null. - - - Gets the specified value provider. - The value provider. - The name of the value provider to get. - The parameter is null or empty. - - - Gets a value that indicates whether the value provider contains an entry that has the specified prefix. - true if the value provider contains an entry that has the specified prefix; otherwise, false. - The prefix to look for. - - - Gets a value from a value provider using the specified key. - A value from a value provider. - The key. - - - Returns a dictionary that contains the value providers. - A dictionary of value providers. - - - Encapsulates information that is required in order to validate and process the input data from an HTML form. - - - Initializes a new instance of the class. - - - Gets the field validators for the form. - A dictionary of field validators for the form. - - - Gets or sets the form identifier. - The form identifier. - - - Retrieves a serialized object that contains the form identifier and field-validation values for the form. - A serialized object that contains the form identifier and field-validation values for the form. - - - Retrieves the validation value for the specified input field. - The value to validate the field input with. - The name of the field to retrieve the validation value for. - The parameter is either null or empty. - - - Retrieves the validation value for the specified input field and a value that indicates what to do if the validation value is not found. - The value to validate the field input with. - The name of the field to retrieve the validation value for. - true to create a validation value if one is not found; otherwise, false. - The parameter is either null or empty. - - - Determines whether client validation errors should be dynamically added to the validation summary. - true if client validation errors should be added to the validation summary; otherwise, false. - - - Gets or sets the identifier for the validation summary. - The identifier for the validation summary. - - - Enumerates the HTTP request types for a form. - - - Specifies a GET request. - - - Specifies a POST request. - - - Represents a value provider for form values that are contained in a object. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - - - Represents a class that is responsible for creating a new instance of a form-value provider object. - - - Initializes a new instance of the class. - - - Returns a form-value provider object for the specified controller context. - A form-value provider object. - An object that encapsulates information about the current HTTP request. - The parameter is null. - - - Represents an attribute that is used to handle an exception that is thrown by an action method. - - - Initializes a new instance of the class. - - - Gets or sets the type of the exception. - The type of the exception. - - - Gets or sets the master view for displaying exception information. - The master view. - - - Called when an exception occurs. - The action-filter context. - The parameter is null. - - - Gets the unique identifier for this attribute. - The unique identifier for this attribute. - - - Gets or sets the page view for displaying exception information. - The page view. - - - Encapsulates information for handling an error that was thrown by an action method. - - - Initializes a new instance of the class. - The exception. - The name of the controller. - The name of the action. - The parameter is null. - The or parameter is null or empty. - - - Gets or sets the name of the action that was executing when the exception was thrown. - The name of the action. - - - Gets or sets the name of the controller that contains the action method that threw the exception. - The name of the controller. - - - Gets or sets the exception object. - The exception object. - - - Represents an attribute that is used to indicate whether a property or field value should be rendered as a hidden input element. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether to display the value of the hidden input element. - true if the value should be displayed; otherwise, false. - - - Represents support for rendering HTML controls in a view. - - - Initializes a new instance of the class by using the specified view context and view data container. - The view context. - The view data container. - The or the parameter is null. - - - Initializes a new instance of the class by using the specified view context, view data container, and route collection. - The view context. - The view data container. - The route collection. - One or more parameters is null. - - - Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. - The generated form field (anti-forgery token). - - - Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. The field value is generated using the specified salt value. - The generated form field (anti-forgery token). - The salt value, which can be any non-empty string. - - - Generates a hidden form field (anti-forgery token) that is validated when the form is submitted. The field value is generated using the specified salt value, domain, and path. - The generated form field (anti-forgery token). - The salt value, which can be any non-empty string. - The application domain. - The virtual path. - - - Converts the specified attribute object to an HTML-encoded string. - The HTML-encoded string. If the value parameter is null or empty, this method returns an empty string. - The object to encode. - - - Converts the specified attribute string to an HTML-encoded string. - The HTML-encoded string. If the value parameter is null or empty, this method returns an empty string. - The string to encode. - - - Enables input validation that is performed by using client script in the browser. - - - Converts the value of the specified object to an HTML-encoded string. - The HTML-encoded string. - The object to encode. - - - Converts the specified string to an HTML-encoded string. - The HTML-encoded string. - The string to encode. - - - Creates an HTML element ID using the specified element name. - The ID of the HTML element. - The name of the HTML element. - The parameter is null. - - - Creates an HTML element ID using the specified element name and a string that replaces dots in the name. - The ID of the HTML element. - The name of the HTML element. - The string that replaces dots (.) in the parameter. - The parameter or the parameter is null. - - - Generates an HTML anchor element (a element) that links to the specified action method, and enables the user to specify the communication protocol, name of the host, and a URL fragment. - An HTML element that links to the specified action method. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - The name of the action method. - The name of the controller. - The communication protocol, such as HTTP or HTTPS. If this parameter is null, the protocol defaults to HTTP. - The name of the host. - The fragment identifier. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Generates an HTML anchor element (a element) that links to the specified action method. - An HTML element that links to the specified action method. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Generates an HTML anchor element (a element) that links to the specified URL route, and enables the user to specify the communication protocol, name of the host, and a URL fragment. - An HTML element that links to the specified URL route. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - The communication protocol, such as HTTP or HTTPS. If this parameter is null, the protocol defaults to HTTP. - The name of the host. - The fragment identifier. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Generates an HTML anchor element (a element) that links to the specified URL route. - An HTML element that links to the specified URL route. - The context of the HTTP request. - The collection of URL routes. - The text caption to display for the link. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. - An object that contains the HTML attributes for the element. - - - Returns the HTTP method that handles form input (GET or POST) as a string. - The form method string, either "get" or "post". - The HTTP method that handles the form. - - - Returns the HTML input control type as a string. - The input type string ("checkbox", "hidden", "password", "radio", or "text"). - The enumerated input type. - - - Returns a hidden input element that identifies the override method for the specified HTTP data-transfer method that was used by the client. - The override method that uses the HTTP data-transfer method that was used by the client. - The HTTP data-transfer method that was used by the client (DELETE, HEAD, or PUT). - The parameter is not "PUT", "DELETE", or "HEAD". - - - Returns a hidden input element that identifies the override method for the specified verb that represents the HTTP data-transfer method used by the client. - The override method that uses the verb that represents the HTTP data-transfer method used by the client. - The verb that represents the HTTP data-transfer method used by the client. - The parameter is not "PUT", "DELETE", or "HEAD". - - - Gets or sets the character that replaces periods in the ID attribute of an element. - The character that replaces periods in the ID attribute of an element. - - - Gets or sets the collection of routes for the application. - The collection of routes for the application. - - - The name of the CSS class that is used to style an input field when a validation error occurs. - - - The name of the CSS class that is used to style an input field when the input is valid. - - - The name of the CSS class that is used to style the error message when a validation error occurs. - - - The name of the CSS class that is used to style the validation message when the input is valid. - - - The name of the CSS class that is used to style validation summary error messages. - - - The name of the CSS class that is used to style the validation summary when the input is valid. - - - Gets or sets the context information about the view. - The context of the view. - - - Gets the current view data dictionary. - The view data dictionary. - - - Gets or sets the view data container. - The view data container. - - - Represents support for rendering HTML controls in a strongly typed view. - The type of the model. - - - Initializes a new instance of the class by using the specified view context and view data container. - The view context. - The view data container. - - - Initializes a new instance of the class by using the specified view context, view data container, and route collection. - The view context. - The view data container. - The route collection. - - - Gets the strongly typed view data dictionary. - The strongly typed view data dictionary. - - - Represents an HTTP anti-forgery exception. - - - Initializes a new instance of the class by using a system-supplied message that describes the error. - - - Initializes a new instance of the class by using a specified message that describes the error. - The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. - - - Initializes a new instance of the class by using a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP DELETE requests. - - - Initializes a new instance of the class. - - - Determines whether a request is a valid HTTP DELETE request. - true if the request is valid; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - Encapsulates information about a method, such as its type, return type, and arguments. - - - Represents a value provider to use with values that come from a collection of HTTP files. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - - - Represents a class that is responsible for creating a new instance of an HTTP file collection value provider object. - - - Initializes a new instance of the class. - - - Returns a value provider object for the specified controller context. - An HTTP file collection value provider. - An object that encapsulates information about the HTTP request. - The parameter is null. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP GET requests. - - - Initializes a new instance of the class. - - - Determines whether a request is a valid HTTP GET request. - true if the request is valid; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - Encapsulates information about a method, such as its type, return type, and arguments. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP POST requests. - - - Initializes a new instance of the class. - - - Determines whether a request is a valid HTTP POST request. - true if the request is valid; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - Encapsulates information about a method, such as its type, return type, and arguments. - - - Binds a model to a posted file. - - - Initializes a new instance of the class. - - - Binds the model. - The bound value. - The controller context. - The binding context. - One or both parameters are null. - - - Represents an attribute that is used to restrict an action method so that the method handles only HTTP PUT requests. - - - Initializes a new instance of the class. - - - Determines whether a request is a valid HTTP PUT request. - true if the request is valid; otherwise, false. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - Encapsulates information about a method, such as its type, return type, and arguments. - - - Extends the class that contains the HTTP values that were sent by a client during a Web request. - - - Retrieves the HTTP data-transfer method override that was used by the client. - The HTTP data-transfer method override that was used by the client. - An object that contains the HTTP values that were sent by a client during a Web request. - The parameter is null. - The HTTP data-transfer method override was not implemented. - - - Represents the result of an unauthorized HTTP request. - - - Initializes a new instance of the class. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Enumerates the HTTP verbs. - - - Retrieves the information or entity that is identified by the URI of the request. - - - Posts a new entity as an addition to a URI. - - - Replaces an entity that is identified by a URI. - - - Requests that a specified URI be deleted. - - - Retrieves the message headers for the information or entity that is identified by the URI of the request. - - - Defines the methods that are used in an action filter. - - - Called after the action method executes. - The filter context. - - - Called before an action method executes. - The filter context. - - - Defines the contract for an action invoker, which is used to invoke an action in response to an HTTP request. - - - Invokes the specified action by using the specified controller context. - true if the action was found; otherwise, false. - The controller context. - The name of the action. - - - Defines the methods that are required for an authorization filter. - - - Called when authorization is required. - The filter context. - - - Defines the methods that are required for a controller. - - - Executes the specified request context. - The request context. - - - Defines the methods that are required for a controller factory. - - - Creates the specified controller by using the specified request context. - The controller. - The request context. - The name of the controller. - - - Releases the specified controller. - The controller. - - - Defines the methods that are required for an exception filter. - - - Called when an exception occurs. - The filter context. - - - Defines the methods that are required for a model binder. - - - Binds the model to a value by using the specified controller context and binding context. - The bound value. - The controller context. - The binding context. - - - Enumerates the types of input controls. - - - A check box. - - - A hidden field. - - - A password box. - - - A radio button. - - - A text box. - - - Defines the methods that are required for a result filter. - - - Called after an action result executes. - The filter context. - - - Called before an action result executes. - The filter context. - - - Associates a route with an area in an ASP.NET MVC application. - - - Gets the name of the area to associate the route with. - The name of the area to associate the route with. - - - Defines the contract for temporary-data providers that store data that is viewed on the next request. - - - Loads the temporary data. - The temporary data. - The controller context. - - - Saves the temporary data. - The controller context. - The values. - - - Defines the methods that are required for a value provider in ASP.NET MVC. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Retrieves a value object using the specified key. - The value object for the specified key. - The key of the value object to retrieve. - - - Defines the methods that are required for a view. - - - Renders the specified view context by using the specified the writer object. - The view context. - The writer object. - - - Defines the methods that are required for a view data dictionary. - - - Gets or sets the view data dictionary. - The view data dictionary. - - - Defines the methods that are required for a view engine. - - - Finds the specified partial view by using the specified controller context. - The partial view. - The controller context. - The name of the partial view. - true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false. - - - Finds the specified view by using the specified controller context. - The page view. - The controller context. - The name of the view. - The name of the master. - true to specify that the view engine returns the cached view, if a cached view exists; otherwise, false. - - - Releases the specified view by using the specified controller context. - The controller context. - The view. - - - Defines the methods that are required in order to cache view locations in memory. - - - Gets the view location by using the specified HTTP context and the cache key. - The view location. - The HTTP context. - The cache key. - - - Inserts the specified view location into the cache by using the specified HTTP context and the cache key. - The HTTP context. - The cache key. - The virtual path. - - - Sends JavaScript content to the response. - - - Initializes a new instance of the class. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets or sets the script. - The script. - - - Specifies whether HTTP GET requests from the client are allowed. - - - HTTP GET requests from the client are allowed. - - - HTTP GET requests from the client are not allowed. - - - Represents a class that is used to send JSON-formatted content to the response. - - - Initializes a new instance of the class. - - - Gets or sets the content encoding. - The content encoding. - - - Gets or sets the type of the content. - The type of the content. - - - Gets or sets the data. - The data. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets or sets a value that indicates whether HTTP GET requests from the client are allowed. - A value that indicates whether HTTP GET requests from the client are allowed. - - - Maps a browser request to a LINQ object. - - - Initializes a new instance of the class. - - - Binds the model by using the specified controller context and binding context. - The bound data object. If the model cannot be bound, this method returns null. - The context within which the controller operates. The context information includes the controller, HTTP content, request context, and route data. - The context within which the model is bound. The context includes information such as the model object, model name, model type, property filter, and value provider. - - - Represents an attribute that is used to associate a model type to a model-builder type. - - - Initializes a new instance of the class. - The type of the binder. - The parameter is null. - - - Gets or sets the type of the binder. - The type of the binder. - - - Retrieves an instance of the model binder. - A reference to an object that implements the interface. - An error occurred while an instance of the model binder was being created. - - - Represents a class that contains all model binders for the application, listed by binder type. - - - Initializes a new instance of the class. - - - Adds the specified item to the model binder dictionary. - The object to add to the instance. - The object is read-only. - - - Adds the specified item to the model binder dictionary using the specified key. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the same key already exists in the object. - - - Removes all items from the model binder dictionary. - The object is read-only. - - - Determines whether the model binder dictionary contains a specified value. - true if is found in the model binder dictionary; otherwise, false. - The object to locate in the object. - - - Determines whether the model binder dictionary contains an element that has the specified key. - true if the model binder dictionary contains an element that has the specified key; otherwise, false. - The key to locate in the object. - - is null. - - - Copies the elements of the model binder dictionary to an array, starting at a specified index. - The one-dimensional array that is the destination of the elements copied from . The array must have zero-based indexing. - The zero-based index in at which copying starts. - - 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 object is greater than the available space from to the end of the destination array. -or- Type cannot be cast automatically to the type of the destination array. - - - Gets the number of elements in the model binder dictionary. - The number of elements in the model binder dictionary. - - - Gets or sets the default model binder. - The default model binder. - - - Retrieves the model binder for the specified type. - The model binder. - The type of the model to retrieve. - The parameter is null. - - - Retrieves the model binder for the specified type or retrieves the default model binder. - The model binder. - The type of the model to retrieve. - true to retrieve the default model binder. - The parameter is null. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the model binder dictionary is read-only. - true if the model binder dictionary is read-only; otherwise, false. - - - Gets or sets the specified key in an object that implements the interface. - The key for the specified item. - The item key. - - - Gets a collection that contains the keys in the model binder dictionary. - A collection that contains the keys in the model binder dictionary. - - - Removes the first occurrence of the specified element from the model binder dictionary. - true if was successfully removed from the model binder dictionary; otherwise, false. This method also returns false if is not found in the model binder dictionary. - The object to remove from the object. - The object is read-only. - - - Removes the element that has the specified key from the model binder dictionary. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the model binder dictionary. - The key of the element to remove. - The object is read-only. - - is null. - - - Returns an enumerator that can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - Gets the value that is associated with the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the 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. - - is null. - - - Gets a collection that contains the values in the model binder dictionary. - A collection that contains the values in the model binder dictionary. - - - Provides global access to the model binders for the application. - - - Gets the model binders for the application. - The model binders for the application. - - - Provides the context in which a model binder functions. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the binding context. - The binding context. - - - Gets or sets a value that indicates whether the binder should use an empty prefix. - true if the binder should use an empty prefix; otherwise, false. - - - Gets or sets the model. - The model. - - - Gets or sets the model metadata. - The model metadata. - - - Gets or sets the name of the model. - The name of the model. - - - Gets or sets the state of the model. - The state of the model. - - - Gets or sets the type of the model. - The type of the model. - - - Gets or sets the property filter. - The property filter. - - - Gets the property metadata. - The property metadata. - - - Gets or sets the value provider. - The value provider. - - - Provides a container for a range-validation rule that is sent to the browser. - - - Initializes a new instance of the class. - The error message. - The minimum value. - The maximum value. - - - Provides a container for a regular-expression client validation rule that is sent to the browser. - - - Initializes a new instance of the class. - The error message to display when the regular expression validation fails. - The regular expression. - - - Provides a container for client validation for required field. - - - Initializes a new instance of the class. - The error message to display when a value for the required field is not provided. - - - Provides a base class container for a client validation rule that is sent to the browser. - - - Initializes a new instance of the class. - - - Gets or sets the error message for the client validation rule. - The error message for the client validation rule. - - - Gets the list of validation parameters. - A list of validation parameters. - - - Gets or sets the validation type. - The validation type. - - - Provides a container for a string-length validation rule that is sent to the browser. - - - Initializes a new instance of the class. - The validation error message. - The minimum length of the string. - The maximum length of the string. - - - Represents an error that occurs during model binding. - - - Initializes a new instance of the class by using the specified exception. - The exception. - The parameter is null. - - - Initializes a new instance of the class by using the specified exception and error message. - The exception. - The error message. - The parameter is null. - - - Initializes a new instance of the class by using the specified error message. - The error message. - - - Gets or sets the error message. - The error message. - - - Gets or sets the exception object. - The exception object. - - - A collection of instances. - - - Initializes a new instance of the class. - - - Adds the specified object to the model-error collection. - The exception. - - - Adds the specified error message to the model-error collection. - The error message. - - - Provides a container for common metadata, for the class, and for the class for a data model. - - - Initializes a new instance of the class. - The provider. - The type of the container. - The model accessor. - The type of the model. - The name of the property. - - - Gets a dictionary that contains additional metadata about the model. - A dictionary that contains additional metadata about the model. - - - Gets or sets the type of the container for the model. - The type of the container for the model. - - - Gets or sets a value that indicates whether empty strings that are posted back in forms should be converted to null. - true if empty strings that are posted back in forms should be converted to null; otherwise, false. The default value is true. - - - Gets or sets meta information about the data type. - Meta information about the data type. - - - Gets or sets the description of the model. - The description of the model. The default value is null. - - - Gets or sets the display format string for the model. - The display format string for the model. - - - Gets or sets the display name of the model. - The display name of the model. - - - Gets or sets the edit format string of the model. - The edit format string of the model. - - - Gets the metadata from the parameter for the model. - The metadata for the model. - An expression that identifies the model. - The view data dictionary. - The type of the parameter. - The type of the value. - - - Gets the metadata from the expression parameter for the model. - The metadata for the model. - An expression that identifies the model. - The view data dictionary. - - - Gets the display name for the model. - The display name for the model. - - - Returns the simple description of the model. - The simple description of the model. - - - Gets a list of validators for the model. - A list of validators for the model. - The controller context. - - - Gets or sets a value that indicates whether the model object should be rendered using associated HTML elements. - true if the associated HTML elements that contains the model object should be included with the object; otherwise, false. - - - Gets or sets a value that indicates whether the model is a complex type. - A value that indicates whether the model is considered a complex type by the MVC framework. - - - Gets a value that indicates whether the type is nullable. - true if the type is nullable; otherwise, false. - - - Gets or sets a value that indicates whether the model is read-only. - true if the model is read-only; otherwise, false. - - - Gets or sets a value that indicates whether the model is required. - true if the model is required; otherwise, false. - - - Gets the value of the model. - The value of the model. For more information about , see the entry ASP.NET MVC 2 Templates, Part 2: ModelMetadata on Brad Wilson's blog - - - Gets the type of the model. - The type of the model. - - - Gets or sets the string to display for null values. - The string to display for null values. - - - Gets a collection of model metadata objects that describe the properties of the model. - A collection of model metadata objects that describe the properties of the model. - - - Gets the property name. - The property name. - - - Gets or sets the provider. - The provider. - - - Gets or sets a short display name. - The short display name. - - - Gets or sets a value that indicates whether the property should be displayed in read-only views such as list and detail views. - true if the model should be displayed in read-only views; otherwise, false. - - - Gets or sets a value that indicates whether the model should be displayed in editable views. - true if the model should be displayed in editable views; otherwise, false. - - - Gets or sets the simple display string for the model. - The simple display string for the model. - - - Gets or sets a hint that suggests what template to use for this model. - A hint that suggests what template to use for this model. - - - Gets or sets a value that can be used as a watermark. - The watermark. - - - Provides an abstract base class for a custom metadata provider. - - - When overridden in a derived class, initializes a new instance of the object that derives from the class. - - - Gets a object for each property of a model. - A object for each property of a model. - The container. - The type of the container. - - - Gets metadata for the specified property. - The metadata model for the specified property. - The model accessor. - The type of the container. - The property to get the metadata model for. - - - Gets metadata for the specified model accessor and model type. - The metadata. - The model accessor. - They type of the model. - - - Provides a container for the current instance. - - - Gets or sets the current object. - The current object. - - - Encapsulates the state of model binding to a property of an action-method argument, or to the argument itself. - - - Initializes a new instance of the class. - - - Returns a object that contains any errors that occurred during model binding. - The errors. - - - Returns a object that encapsulates the value that was being bound during model binding. - The value. - - - Represents the state of an attempt to bind a posted form to an action method, which includes validation information. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using values that are copied from the specified model-state dictionary. - The model-state dictionary. - The parameter is null. - - - Adds the specified item to the model-state dictionary. - The object to add to the model-state dictionary. - The model-state dictionary is read-only. - - - Adds an element that has the specified key and value to the model-state dictionary. - The key of the element to add. - The value of the element to add. - The model-state dictionary is read-only. - - is null. - An element that has the specified key already occurs in the model-state dictionary. - - - Adds the specified model error to the errors collection for the model-state dictionary that is associated with the specified key. - The key. - The exception. - - - Adds the specified error message to the errors collection for the model-state dictionary that is associated with the specified key. - The key. - The error message. - - - Removes all items from the model-state dictionary. - The model-state dictionary is read-only. - - - Determines whether the model-state dictionary contains a specific value. - true if is found in the model-state dictionary; otherwise, false. - The object to locate in the model-state dictionary. - - - Determines whether the model-state dictionary contains the specified key. - true if the model-state dictionary contains the specified key; otherwise, false. - The key to locate in the model-state dictionary. - - - Copies the elements of the model-state dictionary to an array, starting at a specified index. - The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. - The zero-based index in at which copying starts. - - 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 collection 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 . - - - Gets the number of key/value pairs in the collection. - The number of key/value pairs in the collection. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets a value that indicates whether this instance of the model-state dictionary is valid. - true if this instance is valid; otherwise, false. - - - Determines whether there are any objects that are associated with or prefixed with the specified key. - true if the model-state dictionary contains a value that is associated with the specified key; otherwise, false. - The key. - The parameter is null. - - - Gets or sets the value that is associated with the specified key. - The model state item. - The key. - - - Gets a collection that contains the keys in the dictionary. - A collection that contains the keys of the model-state dictionary. - - - Copies the values from the specified object into this dictionary, overwriting existing values if keys are the same. - The dictionary. - - - Removes the first occurrence of the specified object from the model-state dictionary. - true if was successfully removed the model-state dictionary; otherwise, false. This method also returns false if is not found in the model-state dictionary. - The object to remove from the model-state dictionary. - The model-state dictionary is read-only. - - - Removes the element that has the specified key from the model-state dictionary. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the model-state dictionary. - The key of the element to remove. - The model-state dictionary is read-only. - - is null. - - - Sets the value for the specified key by using the specified value provider dictionary. - The key. - The value. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Attempts to gets the value that is associated with the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the 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. - - is null. - - - Gets a collection that contains the values in the dictionary. - A collection that contains the values of the model-state dictionary. - - - Provides a container for a validation result. - - - Initializes a new instance of the class. - - - Gets or sets the name of the member. - The name of the member. - - - Gets or sets the validation result message. - The validation result message. - - - Provides a base class for implementing validation logic. - - - Called from constructors in derived classes to initialize the class. - The metadata. - The controller context. - - - Gets the controller context. - The controller context. - - - When implemented in a derived class, returns metadata for client validation. - The metadata for client validation. - - - Returns a composite model validator for the model. - A composite model validator for the model. - The metadata. - The controller context. - - - Gets or sets a value that indicates whether a model property is required. - true if the model property is required; otherwise, false. - - - Gets the metadata for the model validator. - The metadata for the model validator. - - - When implemented in a derived class, validates the object. - A list of validation results. - The container. - - - Provides a list of validators for a model. - - - When implemented in a derived class, initializes a new instance of the class. - - - Gets a list of validators. - A list of validators. - The metadata. - The context. - - - Provides a container for a list of validation providers. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a list of model-validation providers. - A list of model-validation providers. - - - Returns the list of model validators. - The list of model validators. - The model metadata. - The controller context. - - - Inserts a model-validator provider into the collection. - The zero-based index at which item should be inserted. - The model-validator provider object to insert. - - - Replaces the model-validator provider element at the specified index. - The zero-based index of the model-validator provider element to replace. - The new value for the model-validator provider element. - - - Provides a container for the current validation provider. - - - Gets the model validator provider collection. - The model validator provider collection. - - - Represents a list of items that users can select more than one item from. - - - Initializes a new instance of the class by using the specified items to include in the list. - The items. - The parameter is null. - - - Initializes a new instance of the class by using the specified items to include in the list and the selected values. - The items. - The selected values. - The parameter is null. - - - Initializes a new instance of the class by using the items to include in the list, the data value field, and the data text field. - The items. - The data value field. - The data text field. - The parameter is null. - - - Initializes a new instance of the class by using the items to include in the list, the data value field, the data text field, and the selected values. - The items. - The data value field. - The data text field. - The selected values. - The parameter is null. - - - Gets or sets the data text field. - The data text field. - - - Gets or sets the data value field. - The data value field. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets or sets the items in the list. - The items in the list. - - - Gets or sets the selected values. - The selected values. - - - Returns an enumerator can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - Selects the controller that will handle an HTTP request. - - - Initializes a new instance of the class. - The request context. - The parameter is null. - - - Adds the version header by using the specified HTTP context. - The HTTP context. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The state of the asynchronous object. - - - Called by ASP.NET to begin asynchronous request processing using the base HTTP context. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The state of the asynchronous object. - - - Gets or sets a value that indicates whether the MVC response header is disabled. - true if the MVC response header is disabled; otherwise, false. - - - Called by ASP.NET when asynchronous request processing has ended. - The asynchronous result. - - - Gets a value that indicates whether another request can use the instance. - true if the instance is reusable; otherwise, false. - - - Contains the header name of the ASP.NET MVC version. - - - Processes the request by using the specified HTTP request context. - The HTTP context. - - - Processes the request by using the specified base HTTP request context. - The HTTP context. - - - Gets the request context. - The request context. - - - Called by ASP.NET to begin asynchronous request processing using the base HTTP context. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The data. - - - Called by ASP.NET when asynchronous request processing has ended. - The asynchronous result. - - - Gets a value that indicates whether another request can use the instance. - true if the instance is reusable; otherwise, false. - - - Enables processing of HTTP Web requests by a custom HTTP handler that implements the interface. - An object that provides references to the intrinsic server objects (for example, Request, Response, Session, and Server) that are used to service HTTP requests. - - - Represents an HTML-encoded string that should not be encoded again. - - - Initializes a new instance of the class. - The string to create. If no value is assigned, the object is created using an empty-string value. - - - Creates an HTML-encoded string using the specified text value. - An HTML-encoded string. - The value of the string to create . - - - Contains an empty HTML string. - - - Determines whether the specified string contains content or is either null or empty. - true if the string is null or empty; otherwise, false. - The string. - - - Returns an HTML-encoded string that represents the current object. - An HTML-encoded string that represents the current object. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Verifies and processes an HTTP request. - - - Initializes a new instance of the class. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The HTTP context. - The asynchronous callback method. - The state. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The base HTTP context. - The asynchronous callback method. - The state. - - - Called by ASP.NET when asynchronous request processing has ended. - The asynchronous result. - - - Called by ASP.NET to begin asynchronous request processing. - The status of the asynchronous call. - The context. - The asynchronous callback method. - An object that contains data. - - - Called by ASP.NET when asynchronous request processing has ended. - The status of the asynchronous operations. - - - Verifies and processes an HTTP request. - The HTTP handler. - The HTTP context. - - - Creates an object that implements the IHttpHandler interface and gives it the request context. - - - Initializes a new instance of the class. - - - Retrieves the HTTP handler by using the specified HTTP context. - The HTTP handler. - The request context. - - - Retrieves the HTTP handler by using the specified request context. - The HTTP handler. - The request context. - - - Extends a NameValueCollection object so that the collection can be copied to a specified dictionary. - - - Copies the specified collection to the specified destination. - The collection. - The destination. - - - Copies the specified collection to the specified destination, and optionally replaces previous entries. - The collection. - The destination. - true to replace previous entries; otherwise, false. - - - Represents the base class for value providers whose values come from a object. - - - Initializes a new instance of the class. - A collection that contains the values that are used to initialize the provider. - An object that contains information about the target culture. - The parameter is null. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - The parameter is null. - - - Returns a value object using the specified key. - The value object for the specified key. - The key of the value object to retrieve. - The parameter is null. - - - Provides a convenience wrapper for the attribute. - - - Initializes a new instance of the class. - - - Represents an attribute that is used to indicate that a controller method is not an action method. - - - Initializes a new instance of the class. - - - Determines whether the attribute marks a method that is not an action method by using the specified controller context. - true if the attribute marks a valid non-action method; otherwise, false. - The controller context. - The method information. - - - Represents an attribute that is used to mark an action method whose output will be cached. - - - Initializes a new instance of the class. - - - Gets or sets the cache profile name. - The cache profile name. - - - Gets or sets the cache duration. - The cache duration. - - - Gets or sets the location. - The location. - - - Gets or sets a value that indicates whether to store the cache. - true if the cache should be stored; otherwise, false. - - - Called before the action result executes. - The filter context, which encapsulates information for using . - The parameter is null. - - - Gets or sets the SQL dependency. - The SQL dependency. - - - Gets or sets the vary-by-content encoding. - The vary-by-content encoding. - - - Gets or sets the vary-by-custom value. - The vary-by-custom value. - - - Gets or sets the vary-by-header value. - The vary-by-header value. - - - Gets or sets the vary-by-param value. - The vary-by-param value. - - - Encapsulates information for binding action-method parameters to a data model. - - - Initializes a new instance of the class. - - - Gets the model binder. - The model binder. - - - Gets a comma-delimited list of property names for which binding is disabled. - The exclude list. - - - Gets a comma-delimited list of property names for which binding is enabled. - The include list. - - - Gets the prefix to use when the MVC framework binds a value to an action parameter or to a model property. - The prefix. - - - Contains information that describes a parameter. - - - Initializes a new instance of the class. - - - Gets the action descriptor. - The action descriptor. - - - Gets the binding information. - The binding information. - - - Gets the default value of the parameter. - The default value of the parameter. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - The parameter is null. - - - Indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The parameter is null. - - - Gets the name of the parameter. - The name of the parameter. - - - Gets the type of the parameter. - The type of the parameter. - - - Represents a base class that is used to send a partial view to the response. - - - Initializes a new instance of the class. - - - Returns the object that is used to render the view. - The view engine result. - The controller context. - An error occurred while the method was attempting to find the view. - - - Represents a value provider for query strings that are contained in a object. - - - Initializes a new instance of the class. - An object that encapsulates information about the current HTTP request. - - - Represents a class that is responsible for creating a new instance of a query-string value-provider object. - - - Initializes a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A query-string value-provider object. - An object that encapsulates information about the current HTTP request. - The parameter is null. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The range attribute. - - - Gets a list of client validation rules for a range check. - A list of client validation rules for a range check. - - - Controls the processing of application actions by redirecting to a specified URI. - - - Initializes a new instance of the class. - The target URL. - The parameter is null. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets or sets the target URL. - The target URL. - - - Represents a result that performs a redirection by using the specified route values dictionary. - - - Initializes a new instance of the class by using the specified route name and route values. - The name of the route. - The route values. - - - Initializes a new instance of the class by using the specified route values. - The route values. - - - Enables processing of the result of an action method by a custom type that inherits from the class. - The context within which the result is executed. - The parameter is null. - - - Gets or sets the name of the route. - The name of the route. - - - Gets or sets the route values. - The route values. - - - Contains information that describes a reflected action method. - - - Initializes a new instance of the class. - The action-method information. - The name of the action. - The controller descriptor. - Either the or parameter is null. - The parameter is null or empty. - - - Gets the name of the action. - The name of the action. - - - Gets the controller descriptor. - The controller descriptor. - - - Executes the specified controller context by using the specified action-method parameters. - The action return value. - The controller context. - The parameters. - The or parameter is null. - - - Returns an array of custom attributes defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Retrieves information about action filters. - The filter information. - - - Retrieves the parameters of the action method. - The parameters of the action method. - - - Retrieves the action selectors. - The action selectors. - - - Indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Gets or sets the action-method information. - The action-method information. - - - Contains information that describes a reflected controller. - - - Initializes a new instance of the class. - The type of the controller. - The parameter is null. - - - Gets the type of the controller. - The type of the controller. - - - Finds the specified action for the specified controller context. - The information about the action. - The controller context. - The name of the action. - The parameter is null. - The parameter is null or empty. - - - Returns the list of actions for the controller. - A list of action descriptors for the controller. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns a value that indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Contains information that describes a reflected action-method parameter. - - - Initializes a new instance of the class. - The parameter information. - The action descriptor. - The or parameter is null. - - - Gets the action descriptor. - The action descriptor. - - - Gets the binding information. - The binding information. - - - Gets the default value of the reflected parameter. - The default value of the reflected parameter. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - The custom attribute type cannot be loaded. - There is more than one attribute of type defined for this member. - - - Returns a value that indicates whether one or more instances of a custom attribute type are defined for this member. - true if the custom attribute type is defined for this member; otherwise, false. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Gets or sets the parameter information. - The parameter information. - - - Gets the name of the parameter. - The name of the parameter. - - - Gets the type of the parameter. - The type of the parameter. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The regular expression attribute. - - - Gets a list of regular-expression client validation rules. - A list of regular-expression client validation rules. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The required attribute. - - - Gets a list of required-value client validation rules. - A list of required-value client validation rules. - - - Represents an attribute that forces an unsecured HTTP request to be re-sent over HTTPS. - - - Initializes a new instance of the class. - - - Handles unsecured HTTP requests that are sent to the action method. - An object that encapsulates information that is required in order to use the attribute. - The HTTP request contains an invalid transfer method override. All GET requests are considered invalid. - - - Determines whether a request is secured (HTTPS) and, if it is not, calls the method. - An object that encapsulates information that is required in order to use the attribute. - The parameter is null. - - - Provides the context for the method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The controller context. - The result object. - true to cancel execution; otherwise, false. - The exception object. - The parameter is null. - - - Gets or sets a value that indicates whether this instance is canceled. - true if the instance is canceled; otherwise, false. - - - Gets or sets the exception object. - The exception object. - - - Gets or sets a value that indicates whether the exception has been handled. - true if the exception has been handled; otherwise, false. - - - Gets or sets the action result. - The action result. - - - Provides the context for the method of the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified controller context and action result. - The controller context. - The action result. - The parameter is null. - - - Gets or sets a value that indicates whether this value is "cancel". - true if the value is "cancel"; otherwise, false. - - - Gets or sets the action result. - The action result. - - - Extends a object for MVC routing. - - - Returns an object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains the routes for the applications. - An object that encapsulates information about the requested route. - The name of the route to use when information about the URL path is retrieved. - An object that contains the parameters for a route. - - - Returns an object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains information about the route and virtual path that are the result of generating a URL in the current area. - An object that contains the routes for the applications. - An object that encapsulates information about the requested route. - An object that contains the parameters for a route. - - - Ignores the specified URL route for the given list of available routes. - A collection of routes for the application. - The URL pattern for the route to ignore. - The or parameter is null. - - - Ignores the specified URL route for the given list of the available routes and a list of constraints. - A collection of routes for the application. - The URL pattern for the route to ignore. - A set of expressions that specify values for the parameter. - The or parameter is null. - - - Maps the specified URL route. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - The or parameter is null. - - - Maps the specified URL route and sets default route values. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - The or parameter is null. - - - Maps the specified URL route and sets default route values and constraints. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify values for the parameter. - The or parameter is null. - - - Maps the specified URL route and sets default route values, constraints, and namespaces. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - A set of expressions that specify values for the parameter. - A set of namespaces for the application. - The or parameter is null. - - - Maps the specified URL route and sets default route values and namespaces. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - An object that contains default route values. - A set of namespaces for the application. - The or parameter is null. - - - Maps the specified URL route and sets the namespaces. - A reference to the mapped route. - A collection of routes for the application. - The name of the route to map. - The URL pattern for the route. - A set of namespaces for the application. - The or parameter is null. - - - Represents a value provider for route data that is contained in an object that implements the interface. - - - Initializes a new instance of the class. - An object that contain information about the HTTP request. - - - Represents a factory for creating route-data value provider objects. - - - Initialized a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A value-provider object. - An object that encapsulates information about the current HTTP request. - The parameter is null. - - - Represents a list that lets users select one item. - - - Initializes a new instance of the class by using the specified items for the list. - The items. - - - Initializes a new instance of the class by using the specified items for the list and a selected value. - The items. - The selected value. - - - Initializes a new instance of the class by using the specified items for the list, the data value field, and the data text field. - The items. - The data value field. - The data text field. - - - Initializes a new instance of the class by using the specified items for the list, the data value field, the data text field, and a selected value. - The items. - The data value field. - The data text field. - The selected value. - - - Gets or sets the selected value. - The selected value. - - - Represents the selected item in an instance of the class. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether this is selected. - true if the item is selected; otherwise, false. - - - Gets or sets the text of the selected item. - The text. - - - Gets or sets the value of the selected item. - The value. - - - Provides session-state data to the current object. - - - Initializes a new instance of the class. - - - Loads the temporary data by using the specified controller context. - The temporary data. - The controller context. - An error occurred when the session context was being retrieved. - - - Saves the specified values in the temporary data dictionary by using the specified controller context. - The controller context. - The values. - An error occurred the session context was being retrieved. - - - Provides an adapter for the attribute. - - - Initializes a new instance of the class. - The model metadata. - The controller context. - The string-length attribute. - - - Gets a list of string-length client validation rules. - A list of string-length client validation rules. - - - Represents a class that is used by HTML helpers to build HTML elements. - - - Initializes a new instance of the class. - The name of the tag. - - - Adds the specified CSS class to the tag-builder attributes. - The CSS class value string. - - - Gets or sets the collection of attributes for the tag. - The collection of attributes for the tag. - - - Generates the id attribute for the tag by using the specified name. - The name to use to generate the id value. - - - Gets or sets the character that is used to replace the periods (dots) in the id attribute. - The character that is used to replace periods (dots) in the id attribute. - - - Gets or sets the inner HTML for the tag (element). - The inner HTML for the tag (element). - - - Adds an attribute to the tag by using the specified key/value pair. - The key. - The value. - The parameter is null or empty. - - - Adds an attribute to the tag by using the specified key/value pair. - The key. - The value. - true to replace the existing attribute. - The parameter is null or empty. - - - Adds an attribute to the specified collection of attributes for the tag. - The attributes. - The type of the key. - The type of the value. - - - Adds an attribute to the specified collection of attributes for the tag. - The attributes. - true to replace the existing attributes. - The type of the key. - The type of the value. - - - Sets the inner text of the tag (element). - The inner text for the tag (element). - - - Gets or sets the name of the tag. - The name of the tag. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Returns a string that represents the current object by using the specified tag-render mode. - A string that represents the current object. - The tag-render mode. - - - Enumerates the modes that are available for rendering HTML tags. - - - Represents normal mode. - - - Represents the start-tag mode. - - - Represents end-tag mode. - - - Represents self-closing-tag mode. - - - Represents a set of data that persists only from one request to the next. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The information. - The controller context. - - - Adds an element that has the specified key and value to the object. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the same key already exists in the object. - - - Removes all items from the instance. - The object is read-only. - - - Determines whether the instance contains an element that has the specified key. - true if the instance contains an element that has the specified key; otherwise, false. - The key to locate in the instance. - - is null. - - - Determines whether the dictionary contains the specified value. - true if the dictionary contains the specified value; otherwise, false. - The value. - - - Gets the number of elements in the object. - The number of elements in the object. - - - Gets the enumerator. - The enumerator. - - - Populates a class by using the data that is that is required to serialize the target object. - The object to populate with data. - The destination for this serialization. For more information, see . - The caller does not have the required permission. - - - Gets or sets the object that has the specified key. - The object that has the specified key. - The key to access. - - - Marks all keys in the dictionary for retention. - - - Marks the specified key in the dictionary for retention. - The key to retain in the dictionary. - - - Gets an object that contains the keys of elements in the object. - The keys of the elements in the object. - - - Loads the specified controller context by using the specified data provider. - The controller context. - The temporary data provider. - - - Returns an object that contains the element that is associated with the specified key, without marking the key for deletion. - An object that contains the element that is associated with the specified key. - The key of the element to return. - - - Removes the element that has the specified key from the object. - true if the element was removed successfully; otherwise, false. This method also returns false if was not found in the . instance. - The key of the element to remove. - The object is read-only. - - is null. - - - Saves the specified controller context by using the specified data provider. - The controller context. - The temporary data provider. - - - Adds the specified key/value pair to the dictionary. - The key/value pair. - - - Determines whether a sequence contains a specified element by using the default equality comparer. - true if the dictionary contains the specified key/value pair; otherwise, false. - The key/value pair to search for. - - - Copies a key/value pair to the specified array at the specified index. - The target array. - The index. - - - Gets a value that indicates whether the dictionary is read-only. - true if the dictionary is read-only; otherwise, false. - - - Deletes the specified key/value pair from the dictionary. - true if the key/value pair was removed successfully; otherwise, false. - The key/value pair. - - - Returns an enumerator that can be used to iterate through a collection. - An object that can be used to iterate through the collection. - - - Populates a object by using the data that is that is required to serialize the target object. - The object to populate with data. - The destination for this serialization. For more information, see . - The caller does not have the required permission. - - - Gets the value of the element that has the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the value to get. - When this method returns, the value that is 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. - - is null. - - - Gets the object that contains the values in the object. - The values of the elements in the object that implements . - - - Encapsulates information about the current template context. - - - Initializes a new instance of the class. - - - Gets or sets the formatted model value. - The formatted model value. - - - Retrieves the full DOM ID of a field using the specified HTML name attribute. - The full DOM ID. - The value of the HTML name attribute. - - - Retrieves the fully qualified name (including a prefix) for a field using the specified HTML name attribute. - The prefixed name of the field. - The value of the HTML name attribute. - - - Gets or sets the HTML field prefix. - The HTML field prefix. - - - Contains the number of objects that were visited by the user. - The number of objects. - - - Determines whether the template has been visited by the user. - true if the template has been visited by the user; otherwise, false. - An object that encapsulates information that describes the model. - - - Contains methods to build URLs for ASP.NET MVC within an application. - - - Initializes a new instance of the class using the specified request context. - An object that contains information about the current request and about the route that it matched. - The parameter is null. - - - Initializes a new instance of the class by using the specified request context and route collection. - An object that contains information about the current request and about the route that it matched. - A collection of routes. - The or the parameter is null. - - - Generates a fully qualified URL to an action method by using the specified action name. - The fully qualified URL to an action method. - The name of the action method. - - - Generates a fully qualified URL to an action method by using the specified action name and route values. - The fully qualified URL to an action method. - The name of the action method. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL to an action method by using the specified action name and controller name. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - - - Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL to an action method by using the specified action name, controller name, route values, and protocol to use. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The protocol for the URL, such as "http" or "https". - - - Generates a fully qualified URL to an action method by using the specified action name, controller name, and route values. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - - - Generates a fully qualified URL for an action method by using the specified action name, controller name, route values, protocol to use, and host name. - The fully qualified URL to an action method. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - - - Generates a fully qualified URL to an action method for the specified action name and route values. - The fully qualified URL to an action method. - The name of the action method. - An object that contains the parameters for a route. - - - Converts a virtual (relative) path to an application absolute path. - The application absolute path. - The virtual path of the content. - - - Encodes special characters in a URL string into character-entity equivalents. - An encoded URL string. - The text to encode. - - - Returns a string that contains a content URL. - A string that contains a content URL. - The content path. - The HTTP context. - - - Returns a string that contains a URL. - A string that contains a URL. - The route name. - The action name. - The controller name. - The HTTP protocol. - The host name. - The fragment. - The route values. - The route collection. - The request context. - true to include implicit MVC values; otherwise false. - - - Returns a string that contains a URL. - A string that contains a URL. - The route name. - The action name. - The controller name. - The route values. - The route collection. - The request context. - true to include implicit MVC values; otherwise. false. - - - Gets information about an HTTP request that matches a defined route. - The request context. - - - Gets a collection that contains the routes that are registered for the application. - The route collection. - - - Generates a fully qualified URL for the specified route values. - The fully qualified URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL for the specified route name. - The fully qualified URL. - The name of the route that is used to generate the URL. - - - Generates a fully qualified URL for the specified route values by using a route name. - The fully qualified URL. - The name of the route that is used to generate the URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - - - Generates a fully qualified URL for the specified route values by using a route name and the protocol to use. - The fully qualified URL. - The name of the route that is used to generate the URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The protocol for the URL, such as "http" or "https". - - - Generates a fully qualified URL for the specified route values by using a route name. - The fully qualified URL. - The name of the route that is used to generate the URL. - An object that contains the parameters for a route. - - - Generates a fully qualified URL for the specified route values by using the specified route name, protocol to use, and host name. - The fully qualified URL. - The name of the route that is used to generate the URL. - An object that contains the parameters for a route. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - - - Generates a fully qualified URL for the specified route values. - The fully qualified URL. - An object that contains the parameters for a route. - - - Represents an optional parameter that is used by the class during routing. - - - Contains the read-only value for the optional parameter. - - - Represents an attribute that is used to detect whether a server request has been tampered with. - - - Initializes a new instance of the class. - - - Called when authorization is required. - The filter context. - The parameter is null. - - - Gets or sets the salt string. - The salt string. - - - Represents an attribute that is used to mark action methods whose input must be validated. - - - Initializes a new instance of the class. - true to enable validation. - - - Gets or sets a value that indicates whether to enable validation. - true if validation is enabled; otherwise, false. - - - Called when authorization is required. - The filter context. - The parameter is null. - - - Represents the collection of value-provider objects for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and registers the specified value providers. - A list of value providers to register. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Returns a value object using the specified key. - The value object for the specified key - The key of the value object to retrieve. - - - Inserts the specified value-provider object into the collection at the specified index location. - The zero-based index location at which to insert the value provider into the collection. - The value-provider object to insert. - The parameter is null. - - - Replaces the value provider at the specified index location with a new value provider. - The zero-based index of the element to replace. - The new value for the element at the specified index. - The parameter is null. - - - Represents a dictionary of value providers for the application. - - - Initializes a new instance of the class. - The controller context. - - - Adds the specified item to the collection of value providers. - The object to add to the object. - The object is read-only. - - - Adds an element that has the specified key and value to the collection of value providers. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the specified key already exists in the object. - - - Adds an element that has the specified key and value to the collection of value providers. - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element that has the specified key already exists in the object. - - - Removes all items from the collection of value providers. - The object is read-only. - - - Determines whether the collection of value providers contains the specified item. - true if is found in the collection of value providers; otherwise, false. - The object to locate in the instance. - - - Determines whether the collection of value providers contains an element that has the specified key. - true if the collection of value providers contains an element that has the key; otherwise, false. - The key of the element to find in the instance. - - is null. - - - Gets or sets the controller context. - The controller context. - - - Copies the elements of the collection to an array, starting at the specified index. - The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. - The zero-based index in at which copying starts. - - 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 collection 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 array. - - - Gets the number of elements in the collection. - The number of elements in the collection. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets or sets the object that has the specified key. - The object. - The key. - - - Gets a collection that contains the keys of the instance. - A collection that contains the keys of the object that implements the interface. - - - Removes the first occurrence of the specified item from the collection of value providers. - true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the collection. - The object to remove from the instance. - The object is read-only. - - - Removes the element that has the specified key from the collection of value providers. - true if the element was successfully removed; otherwise, false. This method also returns false if was not found in the collection. - The key of the element to remove. - The object is read-only. - - is null. - - - Returns an enumerator that can be used to iterate through a collection. - An enumerator that can be used to iterate through the collection. - - - Determines whether the collection contains the specified prefix. - true if the collection contains the specified prefix; otherwise, false. - The prefix to search for. - - - Returns a value object using the specified key. - The value object for the specified key. - The key of the value object to return. - - - Gets the value of the element that has the specified key. - true if the object that implements contains an element that has the specified key; otherwise, false. - The key of the element to get. - When this method returns, the value that is 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. - - is null. - - - Gets a collection that contains the values in the object. - A collection of the values in the object that implements the interface. - - - Represents a container for value-provider factory objects. - - - Gets the collection of value-provider factories for the application. - The collection of value-provider factory objects. - - - Represents a factory for creating value-provider objects. - - - Initializes a new instance of the class. - - - Returns a value-provider object for the specified controller context. - A value-provider object. - An object that encapsulates information about the current HTTP request. - - - Represents the collection of value-provider factories for the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified list of value-provider factories. - A list of value-provider factories to initialize the collection with. - - - Returns the value-provider factory for the specified controller context. - The value-provider factory object for the specified controller context. - An object that encapsulates information about the current HTTP request. - - - Inserts the specified value-provider factory object at the specified index location. - The zero-based index location at which to insert the value provider into the collection. - The value-provider factory object to insert. - The parameter is null. - - - Sets the specified value-provider factory object at the given index location. - The zero-based index location at which to insert the value provider into the collection. - The value-provider factory object to set. - The parameter is null. - - - Represents the result of binding a value (such as from a form post or query string) to an action-method argument property, or to the argument itself. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified raw value, attempted value, and culture information. - The raw value. - The attempted value. - The culture. - - - Gets or sets the raw value that is converted to a string for display. - The raw value. - - - Converts the value that is encapsulated by this result to the specified type. - The converted value. - The target type. - The parameter is null. - - - Converts the value that is encapsulated by this result to the specified type by using the specified culture information. - The converted value. - The target type. - The culture to use in the conversion. - The parameter is null. - - - Gets or sets the culture. - The culture. - - - Gets or set the raw value that is supplied by the value provider. - The raw value. - - - Encapsulates information that is related to rendering a view. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified controller context, view, view data dictionary, temporary data dictionary, and text writer. - Encapsulates information about the HTTP request. - The view to render. - The dictionary that contains the data that is required in order to render the view. - The dictionary that contains temporary data for the view. - The text writer object that is used to write HTML output. - One of the parameters is null. - - - Gets or sets a value that indicates whether client-side validation is enabled. - true if client-side validation is enabled; otherwise, false. - - - Gets or sets an object that encapsulates information that is required in order to validate and process the input data from an HTML form. - An object that encapsulates information that is required in order to validate and process the input data from an HTML form. - - - Writes the client validation information to the HTTP response. - - - Gets data that is associated with this request and that is available for only one request. - The temporary data. - - - Gets an object that implements the interface to render in the browser. - The view. - - - Gets the view data that is passed to the view. - The view data. - - - Gets or sets the text writer object that is used to write HTML output. - The object that is used to write the HTML output. - - - Represents a container that is used to pass data between a controller and a view. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified model. - The model. - - - Initializes a new instance of the class by using the specified dictionary. - The dictionary. - The parameter is null. - - - Adds the specified item to the collection. - The object to add to the collection. - The collection is read-only. - - - Adds an element to the collection using the specified key and value . - The key of the element to add. - The value of the element to add. - The object is read-only. - - is null. - An element with the same key already exists in the object. - - - Removes all items from the collection. - The object is read-only. - - - Determines whether the collection contains the specified item. - true if is found in the collection; otherwise, false. - The object to locate in the collection. - - - Determines whether the collection contains an element that has the specified key. - true if the collection contains an element that has the specified key; otherwise, false. - The key of the element to locate in the collection. - - is null. - - - Copies the elements of the collection to an array, starting at a particular index. - The one-dimensional array that is the destination of the elements copied from the collection. The array 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 collection 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 . - - - Gets the number of elements in the collection. - The number of elements in the collection. - - - Evaluates the specified expression. - The results of the evaluation. - The expression. - The parameter is null or empty. - - - Evaluates the specified expression by using the specified format. - The results of the evaluation. - The expression. - The format. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Returns information about the view data as defined by the parameter. - An object that contains the view data information that is defined by the parameter. - A set of key/value pairs that define the view-data information to return. - The parameter is either null or empty. - - - Gets a value that indicates whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets or sets the item that is associated with the specified key. - The value of the selected item. - The key. - - - Gets a collection that contains the keys of this dictionary. - A collection that contains the keys of the object that implements . - - - Gets or sets the model that is associated with the view data. - The model that is associated with the view data. - - - Gets or sets information about the model. - Information about the model. - - - Gets the state of the model. - The state of the model. - - - Removes the first occurrence of a specified object from the collection. - true if was successfully removed from the collection; otherwise, false. This method also returns false if is not found in the collection. - The object to remove from the collection. - The collection is read-only. - - - Removes the element from the collection using the specified key. - true if the element is successfully removed; otherwise, false. This method also returns false if was not found in the original collection. - The key of the element to remove. - The collection is read-only. - - is null. - - - Sets the data model to use for the view. - The data model to use for the view. - - - Returns an enumerator that can be used to iterate through the collection. - An enumerator that can be used to iterate through the collection. - - - Gets or sets an object that encapsulates information about the current template context. - An object that contains information about the current template. - - - Attempts to retrieve the value that is associated with the specified key. - true if the collection contains an element with the specified key; otherwise, false. - The key of the value to get. - When this method returns, the value that is 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. - - is null. - - - Gets a collection that contains the values in this dictionary. - A collection that contains the values of the object that implements . - - - Represents a container that is used to pass strongly typed data between a controller and a view. - The type of the model. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified view data dictionary. - An existing view data dictionary to copy into this instance. - - - Initializes a new instance of the class by using the specified model. - The data model to use for the view. - - - Gets or sets the model. - A reference to the data model. - - - Gets or sets information about the model. - Information about the model. - - - Sets the data model to use for the view. - The data model to use for the view. - An error occurred while the model was being set. - - - Encapsulates information about the current template content that is used to develop templates and about HTML helpers that interact with templates. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and associates a delegate for accessing the view data information. - A delegate that defines how the view data information is accessed. - - - Gets or sets the object that contains the values to be displayed by the template. - The object that contains the values to be displayed by the template. - - - Gets or sets the description of the property to be displayed by the template. - The description of the property to be displayed by the template. - - - Gets or sets the current value to be displayed by the template. - The current value to be displayed by the template. - - - Represents a collection of view engines that are available to the application. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified list of view engines. - The list that is wrapped by the new collection. - - is null. - - - Finds the specified partial view by using the specified controller context. - The partial view. - The controller context. - The name of the partial view. - The parameter is null. - The parameter is null or empty. - - - Finds the specified view by using the specified controller context and master view. - The view. - The controller context. - The name of the view. - The name of the master view. - The parameter is null. - The parameter is null or empty. - - - Inserts an element into the collection at the specified index. - The zero-based index at which should be inserted. - The object to insert. - - is less than zero.-or- is greater than the number of items in the collection. - The parameter is null. - - - 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. - - is less than zero.-or- is greater than the number of items in the collection. - The parameter is null. - - - Represents the result of locating a view engine. - - - Initializes a new instance of the class by using the specified searched locations. - The searched locations. - The parameter is null. - - - Initializes a new instance of the class by using the specified view and view engine. - The view. - The view engine. - The or parameter is null. - - - Gets or sets the searched locations. - The searched locations. - - - Gets or sets the view. - The view. - - - Gets or sets the view engine. - The view engine. - - - Represents a collection of view engines that are available to the application. - - - Gets the view engines. - The view engines. - - - Represents the information that is needed to build a master view page. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the master page. - The AJAX script for the master page. - - - Gets the HTML for the master page. - The HTML for the master page. - - - Gets the model. - The model. - - - Gets the temporary data. - The temporary data. - - - Gets the URL. - The URL. - - - Gets the view context. - The view context. - - - Gets the view data. - The view data. - - - Gets the writer that is used to render the master page. - The writer that is used to render the master page. - - - Represents the information that is required in order to build a strongly typed master view page. - The type of the model. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the master page. - The AJAX script for the master page. - - - Gets the HTML for the master page. - The HTML for the master page. - - - Gets the model. - A reference to the data model. - - - Gets the view data. - The view data. - - - Represents the properties and methods that are needed to render a view as a Web Forms page. - - - Initializes a new instance of the class. - - - Gets or sets the object that is used to render HTML in Ajax scenarios. - The Ajax helper object that is associated with the view. - - - Gets or sets the object that is used to render HTML elements. - The HTML helper object that is associated with the view. - - - Initializes the , , and properties. - - - Gets or sets the path of the master view. - The path of the master view. - - - Gets the Model property of the associated object. - The Model property of the associated object. - - - Raises the event at the beginning of page initialization. - The event data. - - - Enables processing of the specified HTTP request by the ASP.NET MVC framework. - An object that encapsulates HTTP-specific information about the current HTTP request. - - - Initializes the object that receives the page content to be rendered. - The object that receives the page content. - - - Renders the view page to the response using the specified view context. - An object that encapsulates the information that is required in order to render the view, which includes the controller context, form context, the temporary data, and the view data for the associated view. - - - Sets the text writer that is used to render the view to the response. - The writer that is used to render the view to the response. - - - Sets the view data dictionary for the associated view. - A dictionary of data to pass to the view. - - - Gets the temporary data to pass to the view. - The temporary data to pass to the view. - - - Gets or sets the URL of the rendered page. - The URL of the rendered page. - - - Gets or sets the information that is used to render the view. - The information that is used to render the view, which includes the form context, the temporary data, and the view data of the associated view. - - - Gets or sets a dictionary that contains data to pass between the controller and the view. - A dictionary that contains data to pass between the controller and the view. - - - Gets the text writer that is used to render the view to the response. - The text writer that is used to render the view to the response. - - - Represents the information that is required in order to render a strongly typed view as a Web Forms page. - The type of the model. - - - Initializes a new instance of the class. - - - Gets or sets the object that supports rendering HTML in Ajax scenarios. - The Ajax helper object that is associated with the view. - - - Gets or sets the object that provides support for rendering elements. - The HTML helper object that is associated with the view. - - - Instantiates and initializes the and properties. - - - Gets the property of the associated object. - A reference to the data model. - - - Sets the view data dictionary for the associated view. - A dictionary of data to pass to the view. - - - Gets or sets a dictionary that contains data to pass between the controller and the view. - A dictionary that contains data to pass between the controller and the view. - - - Represents a class that is used to render a view by using an instance that is returned by an object. - - - Initializes a new instance of the class. - - - Searches the registered view engines and returns the object that is used to render the view. - The object that is used to render the view. - The controller context. - An error occurred while the method was searching for the view. - - - Gets the name of the master view (such as a master page or template) to use when the view is rendered. - The name of the master view. - - - Represents a base class that is used to provide the model to the view and then render the view to the response. - - - Initializes a new instance of the class. - - - When called by the action invoker, renders the view to the response. - The context that the result is executed in. - The parameter is null. - - - Returns the object that is used to render the view. - The view engine. - The context. - - - Gets or sets the object for this result. - The temporary data. - - - Gets or sets the object that is rendered to the response. - The view. - - - Gets or sets the view data object for this result. - The view data. - - - Gets or sets the collection of view engines that are associated with this result. - The collection of view engines. - - - Gets or sets the name of the view to render. - The name of the view. - - - Provides a container for objects. - - - Initializes a new instance of the class. - - - Provides a container for objects. - The type of the model. - - - Initializes a new instance of the class. - - - Gets the formatted value. - The formatted value. - - - Represents the type of a view. - - - Initializes a new instance of the class. - - - Gets or sets the name of the type. - The name of the type. - - - Represents the information that is needed to build a user control. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the view. - The AJAX script for the view. - - - Ensures that view data is added to the object of the user control if the view data exists. - - - Gets the HTML for the view. - The HTML for the view. - - - Gets the model. - The model. - - - Renders the view by using the specified view context. - The view context. - - - Sets the text writer that is used to render the view to the response. - The writer that is used to render the view to the response. - - - Sets the view-data dictionary by using the specified view data. - The view data. - - - Gets the temporary-data dictionary. - The temporary-data dictionary. - - - Gets the URL for the view. - The URL for the view. - - - Gets or sets the view context. - The view context. - - - Gets or sets the view-data dictionary. - The view-data dictionary. - - - Gets or sets the view-data key. - The view-data key. - - - Gets the writer that is used to render the view to the response. - The writer that is used to render the view to the response. - - - Represents the information that is required in order to build a strongly typed user control. - The type of the model. - - - Initializes a new instance of the class. - - - Gets the AJAX script for the view. - The AJAX script for the view. - - - Gets the HTML for the view. - The HTML for the view. - - - Gets the model. - A reference to the data model. - - - Sets the view data for the view. - The view data. - - - Gets or sets the view data. - The view data. - - - Represents an abstract base-class implementation of the interface. - - - Initializes a new instance of the class. - - - Gets or sets the area-enabled master location formats. - The area-enabled master location formats. - - - Gets or sets the area-enabled partial-view location formats. - The area-enabled partial-view location formats. - - - Gets or sets the area-enabled view location formats. - The area-enabled view location formats. - - - Creates the specified partial view by using the specified controller context. - A reference to the partial view. - The controller context. - The partial path for the new partial view. - - - Creates the specified view by using the controller context, path of the view, and path of the master view. - A reference to the view. - The controller context. - The path of the view. - The path of the master view. - - - Returns a value that indicates whether the file is in the specified path by using the specified controller context. - true if the file is in the specified path; otherwise, false. - The controller context. - The virtual path. - - - Finds the specified partial view by using the specified controller context. - The partial view. - The controller context. - The name of the partial view. - true to use the cached partial view. - The parameter is null (Nothing in Visual Basic). - The parameter is null or empty. - - - Finds the specified view by using the specified controller context and master view name. - The page view. - The controller context. - The name of the view. - The name of the master view. - true to use the cached view. - The parameter is null (Nothing in Visual Basic). - The parameter is null or empty. - - - Gets or sets the master location formats. - The master location formats. - - - Gets or sets the partial-view location formats. - The partial-view location formats. - - - Releases the specified view by using the specified controller context. - The controller context. - The view to release. - - - Gets or sets the view location cache. - The view location cache. - - - Gets or sets the view location formats. - The view location formats. - - - Gets or sets the virtual path provider. - The virtual path provider. - - - Represents the information that is needed to build a Web Forms page in MVC. - - - Initializes a new instance of the class by using the specified path to the view. - The view path. - The parameter is null (Nothing in Visual Basic). - - - Initializes a new instance of the class by using the specified paths to the view and master view. - The view path. - The master path. - The parameter is null (Nothing in Visual Basic). - - - Gets or sets the master path. - The master path. - - - Renders the specified view context by using the specified writer for rendering the view to the response. - The view context. - The writer that is used to render the view to the response. - The parameter is null (Nothing in Visual Basic). - An error occurred while attempting to render the view. - - - Gets or sets the view path. - The view path. - - - Represents a view engine that is used to render a Web Forms page to the response. - - - Initializes a new instance of the class. - - - Creates the specified partial view by using the specified controller context. - The partial view. - The controller context. - The partial path. - - - Creates the specified view by using the specified controller context and the paths of the view and master view. - The view. - The controller context. - The view path. - The master-view path. - - - Determines whether a file at the specified location exists for the specified controller context. - true if the file exists; otherwise, false. - The controller context. - The virtual path. - - - Represents support for ASP.NET AJAX within an ASP.NET MVC application. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the URL to the specified action method; when the action link is clicked, the action method is invoked asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the action method. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - The name of the controller. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - The name of the action method that will handle the request. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element.. - - - Writes an opening <form> tag to the response. - An opening <form> tag. - The AJAX helper. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - - - Writes an opening <form> tag to the response using the specified routing information. - An opening <form> tag. - The AJAX helper. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML script element that contains a reference to a globalization script that defines the culture information. - A script element whose src attribute is set to the globalization script, as in the following example: <script type="text/javascript" src="/MvcApplication1/Scripts/Globalization/en-US.js"></script> - The AJAX helper object that this method extends. - - - Returns an HTML script element that contains a reference to a globalization script that defines the specified culture information. - An HTML script element whose src attribute is set to the globalization script, as in the following example:<script type="text/javascript" src="/MvcApplication1/Scripts/Globalization/en-US.js"></script> - The AJAX helper object that this method extends. - Encapsulates information about the target culture, such as date formats. - The parameter is null. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - The name of the route to use to obtain the form post URL. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - The parameter is null or empty. - - - Returns an anchor element that contains the virtual path for the specified route values; when the link is clicked, a request is made to the virtual path asynchronously by using JavaScript. - An anchor element. - The AJAX helper. - The inner text of the anchor element. - An object that contains the parameters for a route. - An object that provides options for the asynchronous request. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Represents option settings for running AJAX scripts in an MVC application. - - - Initializes a new instance of the class. - - - Gets or sets the message to display in a confirmation window before a request is submitted. - The message to display in a confirmation window. - - - Gets or sets the HTTP request method ("Get" or "Post"). - The HTTP request method. - - - Gets or sets the mode that specifies how to insert the response into the target DOM element. - The insertion mode ("InsertAfter", "InsertBefore", or "Replace"). - - - Gets or sets the id attribute of an HTML element that is displayed while the Ajax function is loading. - The ID of the element that is displayed while the Ajax function is loading. - - - Gets or sets the name of the JavaScript function to call immediately before the page is updated. - The name of the JavaScript function to call before the page is updated. - - - Gets or sets the JavaScript function to call when response data has been instantiated but before the page is updated. - The JavaScript function to call when the response data has been instantiated. - - - Gets or sets the JavaScript function to call if the page update fails. - The JavaScript function to call if the page update fails. - - - Gets or sets the JavaScript function to call after the page is successfully updated. - The JavaScript function to call after the page is successfully updated. - - - Gets or sets the ID of the DOM element to update by using the response from the server. - The ID of the DOM element to update. - - - Gets or sets the URL to make the request to. - The URL to make the request to. - - - Enumerates the AJAX script insertion modes. - - - Replace the element. - - - Insert before the element. - - - Insert after the element. - - - Provides information about an asynchronous action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - - - Invokes the asynchronous action method by using the specified parameters and controller context. - An object that contains the result of an asynchronous call. - The controller context. - The parameters of the action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Returns the result of an asynchronous operation. - The result of an asynchronous operation. - An object that represents the status of an asynchronous operation. - - - Executes the asynchronous action method by using the specified parameters and controller context. - The result of executing the asynchronous action method. - The controller context. - The parameters of the action method. - - - Represents a class that is responsible for invoking the action methods of an asynchronous controller. - - - Initializes a new instance of the class. - - - Invokes the asynchronous action method by using the specified controller context, action name, callback method, and state. - An object that contains the result of an asynchronous operation. - The controller context. - The name of the action. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Invokes the asynchronous action method by using the specified controller context, action descriptor, parameters, callback method, and state. - An object that contains the result of an asynchronous operation. - The controller context. - The action descriptor. - The parameters for the asynchronous action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Invokes the asynchronous action method by using the specified controller context, filters, action descriptor, parameters, callback method, and state. - An object that contains the result of an asynchronous operation. - The controller context. - The filters. - The action descriptor. - The parameters for the asynchronous action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Cancels the action. - true if the action was canceled; otherwise, false. - The user-defined object that qualifies or contains information about an asynchronous operation. - - - Cancels the action. - true if the action was canceled; otherwise, false. - The user-defined object that qualifies or contains information about an asynchronous operation. - - - Cancels the action. - true if the action was canceled; otherwise, false. - The user-defined object that qualifies or contains information about an asynchronous operation. - - - Returns the controller descriptor. - The controller descriptor. - The controller context. - - - Provides asynchronous operations for the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the synchronization context. - The synchronization context. - - - Notifies ASP.NET that all asynchronous operations are complete. - - - Occurs when the method is called. - - - Gets the number of outstanding operations. - The number of outstanding operations. - - - Gets the parameters that were passed to the asynchronous completion method. - The parameters that were passed to the asynchronous completion method. - - - Executes a callback in the current synchronization context. - The asynchronous action. - - - Gets or sets the asynchronous timeout value, in milliseconds. - The asynchronous timeout value, in milliseconds. - - - Defines the interface for an action invoker, which is used to invoke an asynchronous action in response to an HTTP request. - - - Invokes the specified action. - The status of the asynchronous result. - The controller context. - The name of the asynchronous action. - The callback method. - The state. - - - Cancels the asynchronous action. - true if the asynchronous method could be canceled; otherwise, false. - The asynchronous result. - - - Defines the methods that are required for an asynchronous controller. - - - Executes the specified request context. - The status of the asynchronous operation. - The request context. - The asynchronous callback method. - The state. - - - Ends the asynchronous operation. - The asynchronous result. - - - Provides a container for the asynchronous manager object. - - - Gets the asynchronous manager object. - The asynchronous manager object. - - - Provides a container that maintains a count of pending asynchronous operations. - - - Initializes a new instance of the class. - - - Occurs when an asynchronous method completes. - - - Gets the operation count. - The operation count. - - - Reduces the operation count by 1. - The updated operation count. - - - Reduces the operation count by the specified value. - The updated operation count. - The number of operations to reduce the count by. - - - Increments the operation count by one. - The updated operation count. - - - Increments the operation count by the specified value. - The updated operation count. - The number of operations to increment the count by. - - - Provides information about an asynchronous action method, such as its name, controller, parameters, attributes, and filters. - - - Initializes a new instance of the class. - An object that contains information about the method that begins the asynchronous operation (the method whose name ends with "Asynch"). - An object that contains information about the completion method (method whose name ends with "Completed"). - The name of the action. - The controller descriptor. - - - Gets the name of the action method. - The name of the action method. - - - Gets the method information for the asynchronous action method. - The method information for the asynchronous action method. - - - Begins running the asynchronous action method by using the specified parameters and controller context. - An object that contains the result of an asynchronous call. - The controller context. - The parameters of the action method. - The callback method. - An object that contains information to be used by the callback method. This parameter can be null. - - - Gets the method information for the asynchronous completion method. - The method information for the asynchronous completion method. - - - Gets the controller descriptor for the asynchronous action method. - The controller descriptor for the asynchronous action method. - - - Returns the result of an asynchronous operation. - The result of an asynchronous operation. - An object that represents the status of an asynchronous operation. - - - Returns an array of custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns an array of custom attributes that are defined for this member, identified by type. - An array of custom attributes, or an empty array if no custom attributes of the specified type exist. - The type of the custom attributes to return. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns the filters that are associated with the action method. - The filters that are associated with the action method. - - - Returns the parameters of the action method. - The parameters of the action method. - - - Returns the action method selectors. - The action method selectors. - - - Determines whether one or more instances of the specified attribute type are defined for the action member. - true if an attribute of type that is represented by is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Encapsulates information that describes an asynchronous controller, such as its name, type, and actions. - - - Initializes a new instance of the class. - The type of the controller. - - - Gets the type of the controller. - The type of the controller. - - - Finds an action method by using the specified name and controller context. - The information about the action method. - The controller context. - The name of the action. - - - Returns a list of action method descriptors in the controller. - A list of action method descriptors in the controller. - - - Returns custom attributes that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns custom attributes of a specified type that are defined for this member, excluding named attributes. - An array of custom attributes, or an empty array if no custom attributes exist. - The type of the custom attributes. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Returns a value that indicates whether one or more instances of the specified custom attribute are defined for this member. - true if an attribute of the type represented by is defined for this member; otherwise, false. - The type of the custom attribute. - true to look up the hierarchy chain for the inherited custom attribute; otherwise, false. - - - Represents an exception that occurred during the synchronous processing of an HTTP request in an ASP.NET MVC application. - - - Initializes a new instance of the class using a system-supplied message. - - - Initializes a new instance of the class using the specified message. - The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. - - - Initializes a new instance of the class using a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents support for calling child action methods and rendering the result inline in a parent view. - - - Invokes the specified child action method and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method with the specified parameters and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified controller name and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The name of the controller that contains the action method. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The name of the controller that contains the action method. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - The name of the controller that contains the action method. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and returns the result as an HTML string. - The child action result as an HTML string. - The HTML helper instance that this method extends. - The name of the action method to invoke. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified controller name and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The name of the controller that contains the action method. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The name of the controller that contains the action method. - An object that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and controller name and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - The name of the controller that contains the action method. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Invokes the specified child action method using the specified parameters and renders the result inline in the parent view. - The HTML helper instance that this method extends. - The name of the child action method to invoke. - A dictionary that contains the parameters for a route. You can use to provide the parameters that are bound to the action method parameters. The parameter is merged with the original route values and overrides them. - The parameter is null. - The parameter is null or empty. - The required virtual path data cannot be found. - - - Represents support for rendering object values as HTML. - - - Returns HTML markup for each property in the object that is represented by a string expression. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - - - Returns HTML markup for each property in the object that is represented by a string expression, using additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template and an HTML field ID. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns HTML markup for each property in the object that is represented by the expression, using the specified template, HTML field ID, and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - - Returns HTML markup for each property in the object that is represented by the expression. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The type of the model. - The type of the value. - - - Returns a string that contains each property value in the object that is represented by the specified expression, using additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns a string that contains each property value in the object that is represented by the , using the specified template. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - The type of the model. - The type of the value. - - - Returns a string that contains each property value in the object that is represented by the specified expression, using the specified template and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns HTML markup for each property in the object that is represented by the , using the specified template and an HTML field ID. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - The type of the model. - The type of the value. - - - Returns HTML markup for each property in the object that is represented by the specified expression, using the template, an HTML field ID, and additional view data. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns HTML markup for each property in the model. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - - - Returns HTML markup for each property in the model, using the additional view data. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the model using the specified template. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - - - Returns HTML markup for each property in the model, using the specified template and additional view data. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns HTML markup for each property in the model using the specified template and HTML field ID. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns HTML markup for each property in the model, using the specified template, an HTML field ID, and additional view data. - The HTML markup for each property in the model. - The HTML helper instance that this method extends. - The name of the template that is used to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Provides a way to render object values as HTML. - - - Returns HTML markup for each property in the object that is represented by the specified expression. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - - - Returns HTML markup for each property in the object that is represented by the specified expression. - The HTML markup for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The type of the model. - The type of the value. - - - Represents support for the HTML input element in an application. - - - Returns an HTML input element for each property in the object that is represented by the expression. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and HTML field name. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template, HTML field name, and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the object that is represented by the expression. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template and HTML field name. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the object that is represented by the expression, using the specified template, HTML field name, and additional view data. - An HTML input element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to display. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - The type of the model. - The type of the value. - - - Returns an HTML input element for each property in the model. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - - - Returns an HTML input element for each property in the model, using additional view data. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the model, using the specified template. - An HTML input element for each property in the model and in the specified template. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - - - Returns an HTML input element for each property in the model, using the specified template and additional view data. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Returns an HTML input element for each property in the model, using the specified template name and HTML field name. - An HTML input element for each property in the model and in the named template. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - - - Returns an HTML input element for each property in the model, using the template name, HTML field name and additional view data. - An HTML input element for each property in the model. - The HTML helper instance that this method extends. - The name of the template to use to render the object. - A string that is used to disambiguate the names of HTML input elements that are rendered for properties that have the same name. - An anonymous object that can contain additional view data that will be merged into the instance that is created for the template. - - - Represents support for HTML in an application. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the action method. - The name of the controller. - An object that contains the parameters for a route. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by an action method. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. This object is typically created by using object initializer syntax. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route - The HTTP method for processing the form, either GET or POST. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - The name of the route to use to obtain the form-post URL. - An object that contains the parameters for a route - The HTTP method for processing the form, either GET or POST. - An object that contains the HTML attributes to set for the element. - - - Writes an opening <form> tag to the response. When the user submits the form, the request will be processed by the route target. - An opening <form> tag. - The HTML helper instance that this method extends. - An object that contains the parameters for a route - - - Renders the closing </form> tag to the response. - The HTML helper instance that this method extends. - - - Represents support for HTML input controls in an application. - - - Returns a check box input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, and a value to indicate whether the check box is selected. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - true to select the check box; otherwise, false. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, a value to indicate whether the check box is selected, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - true to select the check box; otherwise, false. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, a value that indicates whether the check box is selected, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - true to select the check box; otherwise, false. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element by using the specified HTML helper, the name of the form field, and the HTML attributes. - An input element whose type attribute is set to "checkbox". - The HTML helper instance that this method extends. - The name of the form field. - An object that contains the HTML attributes to set for the element. - - - Returns a check box input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The parameter is null. - - - Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The parameter is null. - - - Returns a check box input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "checkbox" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The parameter is null. - - - Returns a hidden input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - - - Returns a hidden input element by using the specified HTML helper, the name of the form field, and the value. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the hidden input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - - - Returns a hidden input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the hidden input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - An object that contains the HTML attributes to set for the element. - - - Returns a hidden input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "hidden". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the hidden input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML hidden input element for each property in the object that is represented by the specified expression. - An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Returns an HTML hidden input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Returns an HTML hidden input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An input element whose type attribute is set to "hidden" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Returns a password input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - - - Returns a password input element by using the specified HTML helper, the name of the form field, and the value. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the password input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - - - Returns a password input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the password input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - An object that contains the HTML attributes to set for the element. - - - Returns a password input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "password". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the password input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - An object that contains the HTML attributes to set for the element. - - - Returns a password input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a password input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a password input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "password" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - true to select the radio button; otherwise, false. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - true to select the radio button; otherwise, false. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - true to select the radio button; otherwise, false. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element that is used to present mutually exclusive options. - An input element whose type attribute is set to "radio". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - The parameter is null. - - - Returns a radio button input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a radio button input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "radio" for each property in the object that is represented by the specified expression, using the specified HTML attributes. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - If this radio button is selected, the value of the radio button that is submitted when the form is posted. If the value of the selected radio button in the or the object matches this value, this radio button is selected. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns a text input element by using the specified HTML helper and the name of the form field. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - - - Returns a text input element by using the specified HTML helper, the name of the form field, and the value. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - - - Returns a text input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - An object that contains the HTML attributes to set for the element. - - - Returns a text input element by using the specified HTML helper, the name of the form field, the value, and the HTML attributes. - An input element whose type attribute is set to "text". - The HTML helper instance that this method extends. - The name of the form field and the key that is used to look up the value. - The value of the text input element. If this value is null, the value of the element is retrieved from the object. If no value exists there, the value is retrieved from the object. - An object that contains the HTML attributes to set for the element. - - - Returns a text input element for each property in the object that is represented by the specified expression. - An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element type attribute is set to "text" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Returns a text input element for each property in the object that is represented by the specified expression, using the specified HTML attributes. - An HTML input element whose type attribute is set to "text" for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null or empty. - - - Represents support for the HTML label element in an ASP.NET MVC view. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - - - Returns an HTML label element and the property name of the property that is represented by the specified expression. - An HTML label element and the property name of the property that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the property to display. - The type of the model. - The type of the value. - - - Returns an HTML label element and the property name of the property that is represented by the model. - An HTML label element and the property name of the property that is represented by the model. - The HTML helper instance that this method extends. - - - Represents support for HTML links in an application. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes for the element. The attributes are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - The name of the controller. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the action. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. The parameters are retrieved through reflection by examining the properties of the object. The object is typically created by using object initializer syntax. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - The protocol for the URL, such as "http" or "https". - The host name for the URL. - The URL fragment name (the anchor name). - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - The name of the route that is used to return a virtual path. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. - The parameter is null or empty. - - - Returns an anchor element (a element) that contains the virtual path of the specified action. - An anchor element (a element). - The HTML helper instance that this method extends. - The inner text of the anchor element. - An object that contains the parameters for a route. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Represents an HTML form element in an MVC view. - - - Initializes a new instance of the class using the specified HTTP response object. - The HTTP response object. - The parameter is null. - - - Initializes a new instance of the class using the specified view context. - An object that encapsulates the information that is required in order to render a view. - The parameter is null. - - - Releases all resources that are used by the current instance of the class. - - - Releases unmanaged and, optionally, managed resources used by the current instance of the class. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Ends the form and disposes of all form resources. - - - Represents the functionality to render a partial view as an HTML-encoded string. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view to render. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view to render. - The model for the partial view. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view. - The model for the partial view. - The view data dictionary for the partial view. - - - Renders the specified partial view as an HTML-encoded string. - The partial view that is rendered as an HTML-encoded string. - The HTML helper instance that this method extends. - The name of the partial view to render. - The view data dictionary for the partial view. - - - Provides support for rendering a partial view. - - - Renders the specified partial view by using the specified HMTL helper. - The HTML helper. - The name of the partial view - - - Renders the specified partial view, passing it a copy of the current object, but with the Model property set to the specified model. - The HTML helper. - The name of the partial view. - The model. - - - Renders the specified partial view, replacing the partial view's ViewData property with the specified object and setting the Model property of the view data to the specified model. - The HTML helper. - The name of the partial view. - The model for the partial view. - The view data for the partial view. - - - Renders the specified partial view, replacing its ViewData property with the specified object. - The HTML helper. - The name of the partial view. - The view data. - - - Represents support for making selections in a list. - - - Returns a single-selection select element using the specified HTML helper and the name of the form field. - An HTML select element. - The HTML helper instance that this method extends. - The name of the form field to return. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, and the specified list items. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, and an option label. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, the specified list items, an option label, and the specified HTML attributes. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a single-selection select element using the specified HTML helper, the name of the form field, and an option label. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - The text for a default empty item. This parameter can be null. - The parameter is null or empty. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A collection of objects that are used to populate the drop-down list. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A collection of objects that are used to populate the drop-down list. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and option label. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items, option label, and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items, option label, and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A collection of objects that are used to populate the drop-down list. - The text for a default empty item. This parameter can be null. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - - - Returns a multi-select select element using the specified HTML helper and the name of the form field. - An HTML select element. - The HTML helper instance that this method extends. - The name of the form field to return. - The parameter is null or empty. - - - Returns a multi-select select element using the specified HTML helper, the name of the form field, and the specified list items. - An HTML select element with an option subelement for each item in the list. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - The parameter is null or empty. - - - Returns a multi-select select element using the specified HTML helper, the name of the form field, the specified list items, and the specified HMTL attributes. - An HTML select element with an option subelement for each item in the list.. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns a multi-select select element using the specified HTML helper, the name of the form field, and the specified list items. - An HTML select element with an option subelement for each item in the list.. - The HTML helper instance that this method extends. - The name of the form field to return. - A collection of objects that are used to populate the drop-down list. - An object that contains the HTML attributes to set for the element. - The parameter is null or empty. - - - Returns an HTML select element for each property in the object that is represented by the specified expression and using the specified list items. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A collection of objects that are used to populate the list. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A collection of objects that are used to populate the list. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML select element for each property in the object that is represented by the specified expression using the specified list items and HTML attributes. - An HTML select element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A collection of objects that are used to populate the list. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Represents support for HTML textarea controls. - - - Returns the specified textarea element by using the specified HTML helper and the name of the form field. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper and HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, and the text content. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, the number of rows and columns, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - The number of rows. - The number of columns. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, the number of rows and columns, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - The number of rows. - The number of columns. - An object that contains the HTML attributes to set for the element. - - - Returns the specified textarea element by using the specified HTML helper, the name of the form field, the text content, and the specified HTML attributes. - The textarea element. - The HTML helper instance that this method extends. - The name of the form field to return. - The text content. - An object that contains the HTML attributes to set for the element. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes and the number of rows and columns. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The number of rows. - The number of columns. - A dictionary that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes and the number of rows and columns. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The number of rows. - The number of columns. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Returns an HTML textarea element for each property in the object that is represented by the specified expression using the specified HTML attributes. - An HTML textarea element for each property in the object that is represented by the expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - An object that contains the HTML attributes to set for the element. - The type of the model. - The type of the value. - The parameter is null. - - - Provides support for validating the input from an HTML form. - - - Gets or sets the name of the resource file (class key) that contains localized string values. - The name of the resource file (class key). - - - Retrieves the validation metadata for the specified model and applies each rule to the data field. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The parameter is null. - - - Retrieves the validation metadata and validates each data field that is represented by the specified expression. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the value. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - An object that contains the HTML attributes for the element. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - An object that contains the HTML attributes for the element. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The message to display if the specified field contains an error. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - - - Displays a validation message if an error exists for the specified field in the object. - If the property or object is valid, an empty string; otherwise, a span element that contains an error message. - The HTML helper instance that this method extends. - The name of the property or model object that is being validated. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression. - The HTML markup for a validation-error message for each data field that is represented by the expression. If no validation error occurs or client validation is disabled, this method returns null. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The type of the model. - The type of the value. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message. - The HTML markup for a validation-error message for each data field that is represented by the expression. If no validation error occurs or client validation is disabled, this method returns null. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The message to display if the specified field contains an error. - The type of the model. - The type of the value. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes. - The HTML markup for a validation-error message for each data field that is represented by the expression. If no validation error occurs or client validation is disabled, this method returns null. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The message to display if the specified field contains an error. - A dictionary that contains the HTML attributes for the element. - The type of the model. - The type of the value. - - - Returns the HTML markup for a validation-error message for each data field that is represented by the specified expression, using the specified message and HTML attributes. - The HTML markup for a validation-error message for each data field that is represented by the expression. If no validation error occurs or client validation is disabled, this method returns null. - The HTML helper instance that this method extends. - An expression that identifies the object that contains the properties to render. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - The type of the model. - The type of the value. - - - Returns an unordered list (ul element) of validation messages that are in the object. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - The message to display with the validation summary. - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - The message to display with the validation summary. - A dictionary that contains the HTML attributes for the element. - - - Returns an unordered list (ul element) of validation messages that are in the object and optionally displays only model-level errors. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - true to have the summary display model-level errors only, or false to have the summary display all errors. - The message to display with the validation summary. - An object that contains the HTML attributes for the element. - - - Returns an unordered list (ul element) of validation messages that are in the object. - A string that contains an unordered list (ul element) of validation messages. - The HMTL helper instance that this method extends. - The message to display if the specified field contains an error. - - - Returns an unordered list (ul element) of validation messages that are in the object. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - The message to display if the specified field contains an error. - A dictionary that contains the HTML attributes for the element. - - - Returns an unordered list (ul element) of validation messages in the object. - A string that contains an unordered list (ul element) of validation messages. - The HTML helper instance that this method extends. - The message to display if the specified field contains an error. - An object that contains the HTML attributes for the element. - - - \ No newline at end of file diff --git a/lib/Topshelf/Magnum.dll b/lib/Topshelf/Magnum.dll deleted file mode 100644 index ad5b50b7e22..00000000000 Binary files a/lib/Topshelf/Magnum.dll and /dev/null differ diff --git a/lib/Topshelf/Topshelf.dll b/lib/Topshelf/Topshelf.dll index 936111cbfdf..e65dbdb4100 100644 Binary files a/lib/Topshelf/Topshelf.dll and b/lib/Topshelf/Topshelf.dll differ diff --git a/lib/Topshelf/Topshelf.pdb b/lib/Topshelf/Topshelf.pdb index d61018cf84c..0bf662b6de3 100644 Binary files a/lib/Topshelf/Topshelf.pdb and b/lib/Topshelf/Topshelf.pdb differ diff --git a/lib/nunit.license.txt b/lib/nunit.license.txt deleted file mode 100644 index 4beb762c937..00000000000 --- a/lib/nunit.license.txt +++ /dev/null @@ -1,15 +0,0 @@ -Copyright 2002-2007 Charlie Poole -Copyright 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov -Copyright 2000-2002 Philip A. Craig - -This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software. - -Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment (see the following) in the product documentation is required. - -Portions Copyright 2002-2007 Charlie Poole or Copyright 2002-2004 James W. Newkirk, Michael C. Two, Alexei A. Vorontsov or Copyright 2000-2002 Philip A. Craig - -2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. - -3. This notice may not be removed or altered from any source distribution. diff --git a/lib/rhino.mocks/Rhino.Mocks.dll b/lib/rhino.mocks/Rhino.Mocks.dll deleted file mode 100644 index 3fc4b2ae437..00000000000 Binary files a/lib/rhino.mocks/Rhino.Mocks.dll and /dev/null differ diff --git a/lib/rhino.mocks/Rhino.Mocks.license.txt b/lib/rhino.mocks/Rhino.Mocks.license.txt deleted file mode 100644 index 1c8a46e4702..00000000000 --- a/lib/rhino.mocks/Rhino.Mocks.license.txt +++ /dev/null @@ -1,25 +0,0 @@ -Copyright (c) 2005 - 2008 Ayende Rahien (ayende@ayende.com) -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - * Neither the name of Ayende Rahien nor the names of its - contributors may be used to endorse or promote products derived from this - software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/lib/rhino.mocks/Rhino.Mocks.xml b/lib/rhino.mocks/Rhino.Mocks.xml deleted file mode 100644 index f9b8912b023..00000000000 --- a/lib/rhino.mocks/Rhino.Mocks.xml +++ /dev/null @@ -1,5413 +0,0 @@ - - - - Rhino.Mocks - - - - - Defines constraints and return values for arguments of a mock. - Only use Arg inside a method call on a mock that is recording. - Example: - ExpectCall( - mock.foo( - Arg<int>.Is.GreaterThan(2), - Arg<string>.Is.Anything - )); - Use Arg.Text for string specific constraints - Use Arg<ListClass>.List for list specific constraints - - - - - - Register the predicate as a constraint for the current call. - - The predicate. - default(T) - - Allow you to use code to create constraints - - demo.AssertWasCalled(x => x.Bar(Arg{string}.Matches(a => a.StartsWith("b") && a.Contains("ba")))); - - - - - - Define a complex constraint for this argument by passing several constraints - combined with operators. (Use Is in simple cases.) - Example: Arg<string>.Matches(Is.Equal("Hello") || Text.EndsWith("u")); - - Constraints using Is, Text and List - Dummy to satisfy the compiler - - - - Define a Ref argument. - - Constraints for this argument - value returned by the mock - - - - - Define a out parameter. Use it together with the keyword out and use the - Dummy field available by the return value. - Example: mock.foo( out Arg<string>.Out("hello").Dummy ); - - - - - - - Define a simple constraint for this argument. (Use Matches in simple cases.) - Example: - Arg<int>.Is.Anthing - Arg<string>.Is.Equal("hello") - - - - - Define Constraints on list arguments. - - - - - Use the Arg class (without generic) to define Text constraints - - - - - Evaluate an equal constraint for . - - The object the parameter should equal to - - - - Define constraints on text arguments. - - - - - Used to manage the static state of the Arg<T> class"/> - - - - - Resets the static state - - - - - Returns return values for the out and ref parameters - Note: the array returned has the size of the number of out and ref - argument definitions - - - - - - Returns the constraints for all arguments. - Out arguments have an Is.Anything constraint and are also in the list. - - - - - - What should BackToRecord clear - - - - - Retain all expectations and behaviors and return to mock - - - - - All expectations - - - - - Event subscribers for this instance - - - - - Methods that should be forwarded to the base class implementation - - - - - Properties that should behave like properties - - - - - Remove all the behavior of the object - - - - - Interface for constraints - - - - - Determines if the object pass the constraints - - - - - And operator for constraints - - - - - Not operator for constraints - - - - - Or operator for constraints - - - - - Allow overriding of || or && - - - - - - - Allow overriding of || or && - - - - - - - Gets the message for this constraint - - - - - - Constrain that the public field has a specified value - - - - - Constrain that the public field matches another constraint. - - - - - Creates a new instance. - - Name of the public field. - Constraint to place on the public field value. - - - - Creates a new instance, specifying a disambiguating - for the public field. - - The type that declares the public field, used to disambiguate between public fields. - Name of the public field. - Constraint to place on the public field value. - - - - Determines if the object passes the constraint. - - - - - Gets the message for this constraint - - - - - - Creates a new instance. - - Name of the public field. - Expected value. - - - - Creates a new instance, specifying a disambiguating - for the public field. - - The type that declares the public field, used to disambiguate between public fields. - Name of the public field. - Expected value. - - - - Constrain that the property has a specified value - - - - - Constrain that the property matches another constraint. - - - - - Creates a new instance. - - Name of the property. - Constraint to place on the property value. - - - - Creates a new instance, specifying a disambiguating - for the property. - - The type that declares the property, used to disambiguate between properties. - Name of the property. - Constraint to place on the property value. - - - - Determines if the object passes the constraint. - - - - - Gets the message for this constraint - - - - - - Creates a new instance. - - Name of the property. - Expected value. - - - - Creates a new instance, specifying a disambiguating - for the property. - - The type that declares the property, used to disambiguate between properties. - Name of the property. - Expected value. - - - - Constrain that the parameter must be of the specified type - - - - - Creates a new instance. - - Type. - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constraint that determines whether an object is the same object as another. - - - - - Creates a new instance. - - Obj. - - - - Determines if the object passes the constraints. - - - - - Gets the message for this constraint. - - - - - Evaluate a parameter using constraints - - - - - Create new instance - - - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - A constraint based on lambda expression, we are using Expression{T} - because we want to be able to get good error reporting on that. - - - - - Initializes a new instance of the class. - - The expr. - - - - Determines if the object pass the constraints - - - - - - - Gets the message for this constraint - - - - - - Constrain that the list contains the same items as the parameter list - - - - - Creates a new instance. - - In list. - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constrain that the parameter is one of the items in the list - - - - - Creates a new instance. - - In list. - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constrain that the object is inside the parameter list - - - - - Creates a new instance. - - In list. - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Applies another AbstractConstraint to the collection count. - - - - - Creates a new instance. - - The constraint that should be applied to the collection count. - - - - Determines if the parameter conforms to this constraint. - - - - - Gets the message for this constraint. - - - - - Applies another AbstractConstraint to a specific list element. - - - - - Creates a new instance. - - The zero-based index of the list element. - The constraint that should be applied to the list element. - - - - Determines if the parameter conforms to this constraint. - - - - - Gets the message for this constraint - - - - - - Applies another AbstractConstraint to a specific generic keyed list element. - - - - - Creates a new instance. - - The key of the list element. - The constraint that should be applied to the list element. - - - - Determines if the parameter conforms to this constraint. - - - - - Gets the message for this constraint - - - - - - Constrains that all elements are in the parameter list - - - - - Initializes a new instance of the class. - - The these. - - - - Determines if the object pass the constraints - - - - - - - Gets the message for this constraint - - - - - - Combines two constraints, constraint pass if either is fine. - - - - - Creates a new instance. - - C1. - C2. - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Negate a constraint - - - - - Creates a new instance. - - C1. - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Combines two constraints - - - - - - Creates a new instance. - - C1. - C2. - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constrain the argument to validate according to regex pattern - - - - - Creates a new instance. - - Pattern. - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constraint that evaluate whatever an argument contains the specified string. - - - - - Creates a new instance. - - Inner string. - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constraint that evaluate whatever an argument ends with the specified string - - - - - Creates a new instance. - - End. - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constraint that evaluate whatever an argument start with the specified string - - - - - Creates a new instance. - - Start. - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constraint that evaluate whatever an object equals another - - - - - Creates a new instance. - - Obj. - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constraint that always returns true - - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Constraint that evaluate whatever a comparable is greater than another - - - - - Creates a new instance. - - - - - Determines if the object pass the constraints - - - - - Gets the message for this constraint - - - - - - Initializes a new constraint object. - - The expected object, The actual object is passed in as a parameter to the method - - - - Evaluate this constraint. - - The actual object that was passed in the method call to the mock. - True when the constraint is met, else false. - - - - Checks if the properties of the object - are the same as the properies of the object. - - The expected object - The actual object - True when both objects have the same values, else False. - - - - - - - - - This is the real heart of the beast. - - - - Used by CheckReferenceType to check all properties of the reference type. - - The expected object - The actual object - True when both objects have the same values, else False. - - - - Used by CheckReferenceType to check all fields of the reference type. - - The expected object - The actual object - True when both objects have the same values, else False. - - - - Checks the items of both collections - - The expected collection - - True if both collections contain the same items in the same order. - - - - Builds a propertyname from the Stack _properties like 'Order.Product.Price' - to be used in the error message. - - A nested property name. - - - - Rhino.Mocks uses this property to generate an error message. - - - A message telling the tester why the constraint failed. - - - - - Provides access to the constraintes defined in the class to be used in context - with the syntax. - - The type of the argument - - - - Evaluate a greater than constraint for . - - The object the parameter should be greater than - - - - Evaluate a less than constraint for . - - The object the parameter should be less than - - - - Evaluate a less than or equal constraint for . - - The object the parameter should be less than or equal to - - - - Evaluate a greater than or equal constraint for . - - The object the parameter should be greater than or equal to - - - - Evaluate an equal constraint for . - - The object the parameter should equal to - - - - Evaluate a not equal constraint for . - - The object the parameter should not equal to - - - - Evaluate a same as constraint. - - The object the parameter should the same as. - - - - Evaluate a not same as constraint. - - The object the parameter should not be the same as. - - - - Throws NotSupportedException. Don't use Equals to define constraints. Use Equal instead. - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - A constraints that accept anything - - - - - - A constraint that accept only nulls - - - - - - A constraint that accept only non null values - - - - - - A constraint that accept only value of the specified type. - The check is performed on the type that has been defined - as the argument type. - - - - - Provides access to the constraints defined in the class to be used in context - with the syntax. - - - - - Determines whether the specified object is in the parameter. - The parameter must be IEnumerable. - - Obj. - - - - - Determines whatever the parameter is in the collection. - - - - - Determines that the parameter collection is identical to the specified collection - - - - - Determines that the parameter collection has the specified number of elements. - - The constraint that should be applied to the collection count. - - - - Determines that an element of the parameter collections conforms to another AbstractConstraint. - - The zero-based index of the list element. - The constraint which should be applied to the list element. - - - - Determines that all elements of the specified collection are in the the parameter collection - - The collection to compare against - The constraint which should be applied to the list parameter. - - - - Throws NotSupportedException. Don't use Equals to define constraints. Use Equal instead. - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - Provides a dummy field to pass as out or ref argument. - - - - - - Dummy field to satisfy the compiler. Used for out and ref arguments. - - - - - Central location for constraints for object's public fields - - - - - Constrains the parameter to have a public field with the specified value - - Name of the public field. - Expected value. - - - - - Constrains the parameter to have a public field with the specified value. - - The type that declares the public field, used to disambiguate between public fields. - Name of the public field. - Expected value. - - - - - Constrains the parameter to have a public field satisfying a specified constraint. - - Name of the public field. - Constraint for the public field. - - - - Constrains the parameter to have a public field satisfying a specified constraint. - - The type that declares the public field, used to disambiguate between public fields. - Name of the public field. - Constraint for the public field. - - - - Determines whether the parameter has the specified public field and that it is null. - - Name of the public field. - - - - - Determines whether the parameter has the specified public field and that it is null. - - The type that declares the public field, used to disambiguate between public fields. - Name of the public field. - - - - - Determines whether the parameter has the specified public field and that it is not null. - - Name of the public field. - - - - - Determines whether the parameter has the specified public field and that it is not null. - - The type that declares the public field, used to disambiguate between public fields. - Name of the public field. - - - - - Central location for constraints - - - - - Evaluate a greater than constraint for . - - The object the parameter should be greater than - - - - Evaluate a less than constraint for . - - The object the parameter should be less than - - - - Evaluate a less than or equal constraint for . - - The object the parameter should be less than or equal to - - - - Evaluate a greater than or equal constraint for . - - The object the parameter should be greater than or equal to - - - - Evaluate an equal constraint for . - - The object the parameter should equal to - - - - Evaluate a not equal constraint for . - - The object the parameter should not equal to - - - - Evaluate a same as constraint. - - The object the parameter should the same as. - - - - Evaluate a not same as constraint. - - The object the parameter should not be the same as. - - - - A constraints that accept anything - - - - - - A constraint that accept only nulls - - - - - - A constraint that accept only non null values - - - - - - A constraint that accept only value of the specified type - - - - - A constraint that accept only value of the specified type - - - - - Evaluate a parameter using a predicate - - The predicate to use - - - - Central location for constraints about lists and collections - - - - - Determines whether the specified obj is in the parameter. - The parameter must be IEnumerable. - - Obj. - - - - - Determines whatever the parameter is in the collection. - - - - - Determines that the parameter collection is identical to the specified collection - - - - - Determines that the parameter collection has the specified number of elements. - - The constraint that should be applied to the collection count. - - - - Determines that an element of the parameter collections conforms to another AbstractConstraint. - - The zero-based index of the list element. - The constraint which should be applied to the list element. - - - - Determines that an element of the parameter collections conforms to another AbstractConstraint. - - The key of the element. - The constraint which should be applied to the element. - - - - Determines that all elements of the specified collection are in the the parameter collection - - The collection to compare against - The constraint which should be applied to the list parameter. - - - - Central location for constraints for object's properties - - - - - Constrains the parameter to have property with the specified value - - Name of the property. - Expected value. - - - - - Constrains the parameter to have property with the specified value. - - The type that declares the property, used to disambiguate between properties. - Name of the property. - Expected value. - - - - - Constrains the parameter to have a property satisfying a specified constraint. - - Name of the property. - Constraint for the property. - - - - Constrains the parameter to have a property satisfying a specified constraint. - - The type that declares the property, used to disambiguate between properties. - Name of the property. - Constraint for the property. - - - - Determines whether the parameter has the specified property and that it is null. - - Name of the property. - - - - - Determines whether the parameter has the specified property and that it is null. - - The type that declares the property, used to disambiguate between properties. - Name of the property. - - - - - Determines whether the parameter has the specified property and that it is not null. - - Name of the property. - - - - - Determines whether the parameter has the specified property and that it is not null. - - The type that declares the property, used to disambiguate between properties. - Name of the property. - - - - - constraints the parameter to have the exact same property values as the expected object. - - An object, of the same type as the parameter, whose properties are set with the expected values. - An instance of the constraint that will do the actual check. - - The parameter's public property values and public field values will be matched against the expected object's - public property values and public field values. The first mismatch will be reported and no further matching is done. - The matching is recursive for any property or field that has properties or fields of it's own. - Collections are supported through IEnumerable, which means the constraint will check if the actual and expected - collection contain the same values in the same order, where the values contained by the collection can have properties - and fields of their own that will be checked as well because of the recursive nature of this constraint. - - - - - Central location for all text related constraints - - - - - Constrain the argument to starts with the specified string - - - - - Constrain the argument to end with the specified string - - - - - Constrain the argument to contain the specified string - - - - - Constrain the argument to validate according to regex pattern - - - - - Provides access to the constraintes defined in the class to be used in context - with the syntax. - - - - - Constrain the argument to starts with the specified string - - - - - - Constrain the argument to end with the specified string - - - - - Constrain the argument to contain the specified string - - - - - Constrain the argument to validate according to regex pattern - - - - - Throws NotSupportedException. Don't use Equals to define constraints. Use Equal instead. - - - - - - - Serves as a hash function for a particular type. - - - A hash code for the current . - - - - - This class defines a lot of method signatures, which we will use - to allow compatability on net-2.0 - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - dummy - - - - - Allows expectations to be set on methods that should never be called. - For methods with void return value, you need to use LastCall or - DoNotExpect.Call() with a delegate. - - - - - Sets LastCall.Repeat.Never() on /any/ proxy on /any/ repository on the current thread. - This method if not safe for multi threading scenarios. - - - - - Accepts a delegate that will execute inside the method which - LastCall.Repeat.Never() will be applied to. - It is expected to be used with anonymous delegates / lambda expressions and only one - method should be called. - - - IService mockSrv = mocks.CreateMock(typeof(IService)) as IService; - DoNotExpect.Call(delegate{ mockSrv.Stop(); }); - ... - - - - - An expectaton violation was detected. - - - - - Creates a new instance. - - Message. - - - - Serialization constructor - - - - - Signals that an object was call on a mock repository which doesn't - belong to this mock repository or not a mock - - - - - Creates a new instance. - - Message. - - - - Serialization constructor - - - - - Allows to set expectation on methods that has return values. - For methods with void return value, you need to use LastCall - - - - - The method options for the last call on /any/ proxy on /any/ repository on the current thread. - This method if not safe for multi threading scenarios, use . - - - - - Accepts a delegate that will execute inside the method, and then return the resulting - instance. - It is expected to be used with anonymous delegates / lambda expressions and only one - method should be called. - - - IService mockSrv = mocks.CreateMock(typeof(IService)) as IService; - Expect.Call(delegate{ mockSrv.Start(); }).Throw(new NetworkException()); - ... - - - - - Get the method options for the last method call on the mockInstance. - - - - - A delegate that can be used to get better syntax on Expect.Call(delegate { foo.DoSomething(); }); - - - - - Abstract class that holds common information for - expectations. - - - - - Interface to validate that a method call is correct. - - - - - Validate the arguments for the method. - This method can be called numerous times, so be careful about side effects - - The arguments with which the method was called - - - - Add an actual method call to this expectation - - - - - Returns the return value or throw the exception and setup any output / ref parameters - that has been set. - - - - - Builds the verification failure message. - - - - - - Gets the error message. - - - - - - Range of expected calls - - - - - Number of call actually made for this method - - - - - If this expectation is still waiting for calls. - - - - - The return value for a method matching this expectation - - - - - Gets or sets the exception to throw on a method matching this expectation. - - - - - Gets a value indicating whether this instance's action is staisfied. - A staisfied instance means that there are no more requirements from - this method. A method with non void return value must register either - a return value or an exception to throw. - - - - - Gets the method this expectation is for. - - - - - Gets or sets what special condtions there are for this method - repeating. - - - - - Gets a value indicating whether this expectation was satisfied - - - - - Specify whatever this expectation has a return value set - You can't check ReturnValue for this because a valid return value include null. - - - - - An action to execute when the method is matched. - - - - - Set the out / ref parameters for the method call. - The indexing is zero based and ignores any non out/ref parameter. - It is possible not to pass all the parameters. This method can be called only once. - - - - - Documentation Message - - - - - Gets the invocation for this expectation - - The invocation. - - - - Occurs when the exceptation is match on a method call - - - - - Allow to set the return value in the future, if it was already set. - - - - - Number of actuall calls made that passed this expectation - - - - - Range of expected calls that should pass this expectation. - - - - - The return value for a method matching this expectation - - - - - The exception to throw on a method matching this expectation. - - - - - The method this expectation is for. - - - - - The return value for this method was set - - - - - Whether this method will repeat - unlimited number of times. - - - - - A delegate that will be run when the - expectation is matched. - - - - - The arguments that matched this expectation. - - - - - Documentation message - - - - - The method originalInvocation - - - - - Get the hash code - - - - - Add an actual actualMethodCall call to this expectation - - - - - Builds the verification failure message. - - - - - - Returns the return value or throw the exception and setup output / ref parameters - - - - - Validate the arguments for the method on the child methods - - The arguments with which the method was called - - - - Creates a new instance. - - The originalInvocation for this method, required because it contains the generic type infromation - Number of method calls for this expectations - - - - Creates a new instance. - - Expectation. - - - - Validate the arguments for the method on the child methods - - The arguments with which the method was called - - - - Determines if this object equal to obj - - - - - The error message for these arguments - - - - - Asserts that the delegate has the same parameters as the expectation's method call - - - - - Setter for the outpur / ref parameters for this expecataion. - Can only be set once. - - - - - Specify whether this expectation has a return value set - You can't check ReturnValue for this because a valid return value include null. - - - - - Gets the method this expectation is for. - - - - - Gets the originalInvocation for this expectation - - The originalInvocation. - - - - Gets or sets what special condtions there are for this method - - - - - Range of expected calls - - - - - Number of call actually made for this method - - - - - If this expectation is still waiting for calls. - - - - - Gets a value indicating whether this expectation was satisfied - - - - - The return value for a method matching this expectation - - - - - An action to execute when the method is matched. - - - - - Gets or sets the exception to throw on a method matching this expectation. - - - - - Gets a value indicating whether this instance's action is staisfied. - A staisfied instance means that there are no more requirements from - this method. A method with non void return value must register either - a return value or an exception to throw or an action to execute. - - - - - Documentation message - - - - - Occurs when the exceptation is match on a method call - - - - - Allow to set the return value in the future, if it was already set. - - - - - Gets the error message. - - - - - - Expectation that matches any arguments for the method. - - - - - Creates a new instance. - - Invocation for this expectation - Number of method calls for this expectations - - - - Creates a new instance. - - Expectation. - - - - Validate the arguments for the method. - - The arguments with which the method was called - - - - Determines if the object equal to expectation - - - - - Get the hash code - - - - - Gets the error message. - - - - - - Summary description for ArgsEqualExpectation. - - - - - Creates a new instance. - - Expected args. - The invocation for this expectation - Number of method calls for this expectations - - - - Validate the arguments for the method. - - The arguments with which the method was called - - - - Determines if the object equal to expectation - - - - - Get the hash code - - - - - Gets the error message. - - - - - - Get the expected args. - - - - - Call a specified callback to verify the expectation - - - - - Creates a new instance. - - Expectation. - Callback. - - - - Creates a new instance. - - Invocation for this expectation - Callback. - Number of method calls for this expectations - - - - Validate the arguments for the method on the child methods - - The arguments with which the method was called - - - - Determines if the object equal to expectation - - - - - Get the hash code - - - - - Gets the error message. - - - - - - Expect the method's arguments to match the contraints - - - - - Creates a new instance. - - Invocation for this expectation - Constraints. - Number of method calls for this expectations - - - - Creates a new instance. - - Expectation. - Constraints. - - - - Validate the arguments for the method. - - The arguments with which the method was called - - - - Determines if the object equal to expectation - - - - - Get the hash code - - - - - Gets the error message. - - - - - - Doesn't log anything, just makes happy noises - - - - - Log expectations - allows to see what is going on inside Rhino Mocks - - - - - Logs the expectation as is was recorded - - The invocation. - The expectation. - - - - Logs the expectation as it was recorded - - The invocation. - The expectation. - - - - Logs the unexpected method call. - - The invocation. - The message. - - - - Logs the expectation as is was recorded - - The invocation. - The expectation. - - - - Logs the expectation as it was recorded - - The invocation. - The expectation. - - - - Logs the unexpected method call. - - The invocation. - The message. - - - - Operation on a remoting proxy - - - It is not possible to directly communicate to a real proxy via transparent proxy. - Transparent proxy impersonates a user type and only methods of that user type are callable. - The only methods that are guaranteed to exist on any transparent proxy are methods defined - in Object: namely ToString(), GetHashCode(), and Equals()). - - These three methods are the only way to tell the real proxy to do something. - Equals() is the most suitable of all, since it accepts an arbitrary object parameter. - The RemotingProxy code is built so that if it is compared to an IRemotingProxyOperation, - transparentProxy.Equals(operation) will call operation.Process(realProxy). - This way we can retrieve a real proxy from transparent proxy and perform - arbitrary operation on it. - - - - - Generates remoting proxies and provides utility functions - - - - - Create the proxy using remoting - - - - - Check whether an object is a transparent proxy with a RemotingProxy behind it - - Object to check - true if the object is a transparent proxy with a RemotingProxy instance behind it, false otherwise - We use Equals() method to communicate with the real proxy behind the object. - See IRemotingProxyOperation for more details - - - - Retrieve a mocked object from a transparent proxy - - Transparent proxy with a RemotingProxy instance behind it - Mocked object associated with the proxy - We use Equals() method to communicate with the real proxy behind the object. - See IRemotingProxyOperation for more details - - - - Implementation of IInvocation based on remoting proxy - - Some methods are marked NotSupported since they either don't make sense - for remoting proxies, or they are never called by Rhino Mocks - - - - Rudimetry implementation that simply logs methods calls as text. - - - - - Initializes a new instance of the class. - - The writer. - - - - Logs the expectation as it was recorded - - The invocation. - The expectation. - - - - Logs the expectation as it was recorded - - The invocation. - The expectation. - - - - Logs the unexpected method call. - - The invocation. - The message. - - - - Behave like a stub, all properties and events acts normally, methods calls - return default values by default (but can use expectations to set them up), etc. - - - - - Records all the expectations for a mock - - - - - Different actions on this mock - - - - - Add a method call for this state' mock. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Verify that this mock expectations have passed. - - - - - Verify that we can move to replay state and move - to the reply state. - - - - - Gets a mock state that match the original mock state of the object. - - - - - Get the options for the last method call - - - - - Set the exception to throw when Verify is called. - This is used to report exception that may have happened but where caught in the code. - This way, they are reported anyway when Verify() is called. - - - - - This method is called to indicate that a property behavior call. - This is done so we generate good error message in the common case of people using - Stubbed properties with Return(). - - - - - Gets the matching verify state for this state - - - - - Get the options for the last method call - - - - - Get the options for the last method call - - - - - Set the exception to throw when Verify is called. - This is used to report exception that may have happened but where caught in the code. - This way, they are reported anyway when Verify() is called. - - - - - This method is called to indicate that a property behavior call. - This is done so we generate good error message in the common case of people using - Stubbed properties with Return(). - - - - - Creates a new instance. - - Repository. - The proxy that generates the method calls - - - - Add a method call for this state' mock. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Verify that we can move to replay state and move - to the reply state. - - - - - Verify that we can move to replay state and move - to the reply state. - - - - - Verify that this mock expectations have passed. - - - - - Gets a mock state that match the original mock state of the object. - - - - - Asserts the previous method is closed (had an expectation set on it so we can replay it correctly) - - - - - Get the default call count range expectation - - - - - - Gets the last expectation. - - - - - Gets the total method calls count. - - - - - Get the options for the last method call - - - - - Gets the matching verify state for this state - - - - - Initializes a new instance of the class. - - The proxy that generates the method calls - Repository. - - - - We don't care much about expectations here, so we will remove the expectation if - it is not closed. - - - - - Verify that we can move to replay state and move - to the reply state. - - - - - - Get the default call count range expectation - - - - - - Validate expectations on recorded methods, but in general completely ignoring them. - Similar to except that it would return a - when BackToRecord is called. - - - - - Validate all expectations on a mock - - - - - The repository for this state - - - - - The proxy object for this state - - - - - Get the options for the last method call - - - - - Creates a new instance. - - The previous state for this method - - - - Add a method call for this state' mock. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Add a method call for this state' mock. - This allows derived method to cleanly get a the setupresult behavior while adding - their own. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Set the exception to throw when Verify is called. - This is used to report exception that may have happened but where caught in the code. - This way, they are reported anyway when Verify() is called. - - - - - not relevant - - - - - Verify that this mock expectations have passed. - - - - - Verify that we can move to replay state and move - to the reply state. - - - - - Gets a mock state that match the original mock state of the object. - - - - - Get the options for the last method call - - - - - Gets the matching verify state for this state - - - - - Initializes a new instance of the class. - - The previous state for this method - - - - Add a method call for this state' mock. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Gets a mock state that matches the original mock state of the object. - - - - - Write rhino mocks log info to the trace - - - - - Initializes a new instance of the class. - - - - - Initializes a new instance of the class. - - if set to true [log recorded]. - if set to true [log replayed]. - if set to true [log unexpected]. - - - - Logs the expectation as is was recorded - - The invocation. - The expectation. - - - - Logs the expectation as it was recorded - - The invocation. - The expectation. - - - - Logs the unexpected method call. - - The invocation. - The message. - - - - Writes log information as stack traces about rhino mocks activity - - - - - Allows to redirect output to a different location. - - - - - Logs the expectation as is was recorded - - The invocation. - The expectation. - - - - Logs the expectation as it was recorded - - The invocation. - The expectation. - - - - Logs the unexpected method call. - - The invocation. - The message. - - - - Marker interface used to indicate that this is a partial mock. - - - - - Options for CallOriginalMethod - - - - - No expectation is created, the method will be called directly - - - - - Normal expectation is created, but when the method is later called, it will also call the original method - - - - - This is a data structure that is used by - to pass - the current method to the relevant delegate - - - - - Initializes a new instance of the class. - - The invocation. - - - - Gets the args for this method invocation - - - - - Get the method that was caused this invocation - - - - - Gets or sets the return value for this method invocation - - The return value. - - - - Adds optional new usage: - using(mockRepository.Record()) { - Expect.Call(mock.Method()).Return(retVal); - } - using(mockRepository.Playback()) { - // Execute code - } - N.B. mockRepository.ReplayAll() and mockRepository.VerifyAll() - calls are taken care of by Record/Playback - - - Creates proxied instances of types. - - - - Generates a stub without needing a - Arguments for 's constructor - The of stub to create. - The stub - - - - Generates a stub without needing a - The of stub. - Arguments for the 's constructor. - The stub - - - - Generate a mock object without needing a - type of mock object to create. - Arguments for 's constructor - the mock object - - - - Generate a multi-mock object without needing a - The typeof object to generate a mock for. - A second interface to generate a multi-mock for. - Arguments for 's constructor - the multi-mock object - - - - Generate a multi-mock object without without needing a - The typeof object to generate a mock for. - An interface to generate a multi-mock for. - A second interface to generate a multi-mock for. - Arguments for 's constructor - the multi-mock object - - - - Creates a multi-mock without without needing a - The type of mock to create, this can be a class - Any extra interfaces to add to the multi-mock, these can only be interfaces. - Arguments for 's constructor - the multi-mock object - - - - Creates a strict mock without without needing a - Any arguments required for the 's constructor - The type of mock object to create. - The mock object with strict replay semantics - - - - Creates a strict multi-mock without needing a - Any arguments required for the 's constructor - The type of mock object to create, this can be a class. - An interface to generate a multi-mock for, this must be an interface! - The multi-mock object with strict replay semantics - - - - Creates a strict multi-mock without needing a - Any arguments required for the 's constructor - The type of mock object to create, this can be a class. - An interface to generate a multi-mock for, this must be an interface! - A second interface to generate a multi-mock for, this must be an interface! - The multi-mock object with strict replay semantics - - - - Creates a strict multi-mock without needing a - The type of mock object to create, this can be a class - Any extra interfaces to generate a multi-mock for, these must be interaces! - Any arguments for the 's constructor - The strict multi-mock object - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Generate a mock object with dynamic replay semantics and remoting without needing the mock repository - - - - - Generate a mock object with strict replay semantics and remoting without needing the mock repository - - - - Helper method to create a mock object without a repository instance and put the object back into replay mode. - The type of mock object to create - A delegate that uses a mock repository instance to create the underlying mock - The mock object in the replay mode. - - - - - - - - - - - - - - This is a map of types to ProxyGenerators. - - - - - This is used to record the last repository that has a method called on it. - - - - - this is used to get to the last proxy on this repository. - - - - - For mock delegates, maps the proxy instance from intercepted invocations - back to the delegate that was originally returned to client code, if any. - - - - - All the proxies in the mock repositories - - - - - This is here because we can't put it in any of the recorders, since repeatable methods - have no orderring, and if we try to handle them using the usual manner, we would get into - wierd situations where repeatable method that was defined in an orderring block doesn't - exists until we enter this block. - - - - - Creates a new instance. - - - - - Move the repository to ordered mode - - - - - Move the repository to un-ordered mode - - - - - Creates a mock for the specified type. - - Type. - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a strict mock for the specified type. - - Type. - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a remoting mock for the specified type. - - Type. - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a strict remoting mock for the specified type. - - Type. - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a remoting mock for the specified type. - - - Arguments for the class' constructor, if mocking a concrete class - - - - - Creates a strict remoting mock for the specified type. - - - Arguments for the class' constructor, if mocking a concrete class - - - - - Creates a mock from several types, with strict semantics. - Only may be a class. - - - - - Creates a strict mock from several types, with strict semantics. - Only may be a class. - - - - - Creates a mock from several types, with strict semantics. - Only may be a class. - - The main type to mock. - Extra interface types to mock. - Arguments for the class' constructor, if mocking a concrete class. - - - - Creates a strict mock from several types, with strict semantics. - Only may be a class. - - The main type to mock. - Extra interface types to mock. - Arguments for the class' constructor, if mocking a concrete class. - - - - Creates a mock from several types, with dynamic semantics. - Only may be a class. - - The main type to mock. - Extra interface types to mock. - - - - Creates a mock from several types, with dynamic semantics. - Only may be a class. - - The main type to mock. - Extra interface types to mock. - Arguments for the class' constructor, if mocking a concrete class. - - - Creates a dynamic mock for the specified type. - Type. - Arguments for the class' constructor, if mocking a concrete class - - - Creates a dynamic mock for the specified type. - Type. - Arguments for the class' constructor, if mocking a concrete class - - - Creates a dynamic mock for the specified type. - - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a mock object that defaults to calling the class methods if no expectation is set on the method. - Type. - Arguments for the class' constructor. - - - Creates a mock object that defaults to calling the class methods. - Type. - Extra interface types to mock. - - - Creates a mock object that defaults to calling the class methods. - Type. - Extra interface types to mock. - Arguments for the class' constructor. - - - Creates a mock object using remoting proxies - Type to mock - must be MarshalByRefObject - Mock object - Proxy mock can mock non-virtual methods, but not static methods - Creates the mock state for this proxy - - - - Cause the mock state to change to replay, any further call is compared to the - ones that were called in the record state. - - This method *cannot* be called from inside an ordering. - the object to move to replay state - - - - Cause the mock state to change to replay, any further call is compared to the - ones that were called in the record state. - - the object to move to replay state - - - - Move the mocked object back to record state.You can (and it's recommended) to run {Verify()} before you use this method. - Will delete all current expectations! - - - - Move the mocked object back to record state. - Optionally, can delete all current expectations, but allows more granularity about how - it would behave with regard to the object state. - - - - - Verify that all the expectations for this object were fulfilled. - - the object to verify the expectations for - - - - Get the method options for the last call on - mockedInstance. - - The mock object - Method options for the last call - - - - Maps an invocation proxy back to the mock object instance that was originally - returned to client code which might have been a delegate to this proxy. - - The mock object proxy from the intercepted invocation - The mock object - - - This is provided to allow advance extention functionality, where Rhino Mocks standard functionality is not enough. - The type to mock - Delegate that create the first state of the mocked object (usualy the record state). - Additional types to be implemented, this can be only interfaces - optional arguments for the constructor - - - - - Method: GetMockedObject - Get an IProxy from a mocked object instance, or throws if the - object is not a mock object. - - - - - Method: GetMockedObjectOrNull - Get an IProxy from a mocked object instance, or null if the - object is not a mock object. - - - - Pops the recorder. - - - Pushes the recorder. - New recorder. - - - - All the mock objects in this repository will be moved - to record state. - - - - - All the mock objects in this repository will be moved - to record state. - - - - - Replay all the mocks from this repository - - - - - Verify all the mocks from this repository - - - - - Gets the proxy generator for a specific type. Having a single ProxyGenerator - with multiple types linearly degrades the performance so this implementation - keeps one ProxyGenerator per type. - - - - Set the exception to be thrown when verified is called. - - - - Creates a mock for the spesified type with strict mocking semantics. - Strict semantics means that any call that wasn't explicitly recorded is considered an error and would cause an exception to be thrown. - - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a mock for the spesified type with strict mocking semantics. - Strict semantics means that any call that wasn't explicitly recorded is considered an error and would cause an exception to be thrown. - - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a dynamic mock for the specified type. - - Arguments for the class' constructor, if mocking a concrete class - - - - Creates a mock object from several types. - - - - - Creates a strict mock object from several types. - - - - - Create a mock object from several types with dynamic semantics. - - - - - Create a mock object from several types with partial semantics. - - - - - Create a mock object from several types with strict semantics. - - Extra interface types to mock. - Arguments for the class' constructor, if mocking a concrete class - - - - Create a strict mock object from several types with strict semantics. - - Extra interface types to mock. - Arguments for the class' constructor, if mocking a concrete class - - - - Create a mock object from several types with dynamic semantics. - - Extra interface types to mock. - Arguments for the class' constructor, if mocking a concrete class - - - - Create a mock object from several types with partial semantics. - - Extra interface types to mock. - Arguments for the class' constructor, if mocking a concrete class - - - - Create a mock object with from a class that defaults to calling the class methods - - Arguments for the class' constructor, if mocking a concrete class - - - - Create a stub object, one that has properties and events ready for use, and - can have methods called on it. It requires an explicit step in order to create - an expectation for a stub. - - The arguments for constructor. - - - - Create a stub object, one that has properties and events ready for use, and - can have methods called on it. It requires an explicit step in order to create - an expectation for a stub. - - The type. - The arguments for constructor. - The stub - - - - Returns true if the passed mock is currently in replay mode. - - The mock to test. - True if the mock is in replay mode, false otherwise. - - - - Determines whether the specified proxy is a stub. - - The proxy. - - - - Register a call on a prperty behavior - - - - - - Gets the recorder. - - - - - - Gets the replayer for this repository. - - - - - - Gets the last proxy which had a method call. - - - - - Delegate: CreateMockState - This is used internally to cleanly handle the creation of different - RecordMockStates. - - - - - A set of extension methods that adds Arrange Act Assert mode to Rhino Mocks - - - - - Create an expectation on this mock for this action to occur - - - The mock. - The action. - - - - - Reset all expectations on this mock object - - - The mock. - - - - Reset the selected expectation on this mock object - - - The mock. - The options to reset the expectations on this mock. - - - - Cause the mock state to change to replay, any further call is compared to the - ones that were called in the record state. - - the mocked object to move to replay state - - - - Gets the mock repository for this specificied mock object - - - The mock. - - - - - Create an expectation on this mock for this action to occur - - - - The mock. - The action. - - - - - Tell the mock object to perform a certain action when a matching - method is called. - Does not create an expectation for this method. - - - The mock. - The action. - - - - - Tell the mock object to perform a certain action when a matching - method is called. - Does not create an expectation for this method. - - - - The mock. - The action. - - - - - Gets the arguments for calls made on this mock object and the method that was called - in the action. - - - The mock. - The action. - - - Here we will get all the arguments for all the calls made to DoSomething(int) - - var argsForCalls = foo54.GetArgumentsForCallsMadeOn(x => x.DoSomething(0)) - - - - - - Gets the arguments for calls made on this mock object and the method that was called - in the action and matches the given constraints - - - The mock. - The action. - The setup constraints. - - - Here we will get all the arguments for all the calls made to DoSomething(int) - - var argsForCalls = foo54.GetArgumentsForCallsMadeOn(x => x.DoSomething(0)) - - - - - - Asserts that a particular method was called on this mock object - - - The mock. - The action. - - - - Asserts that a particular method was called on this mock object that match - a particular constraint set. - - - The mock. - The action. - The setup constraints. - - - - Asserts that a particular method was called on this mock object that match - a particular constraint set. - - - The mock. - The action. - - - - Asserts that a particular method was called on this mock object that match - a particular constraint set. - - - The mock. - The action. - The setup constraints. - - - - Asserts that a particular method was NOT called on this mock object - - - The mock. - The action. - - - - Asserts that a particular method was NOT called on this mock object that match - a particular constraint set. - - - The mock. - The action. - The setup constraints. - - - - Asserts that a particular method was NOT called on this mock object - - - The mock. - The action. - - - - Asserts that a particular method was NOT called on this mock object - - - The mock. - The action. - The setup constraints. - - - - Finds the approprite implementation type of this item. - This is the class or an interface outside of the rhino mocks. - - The mocked obj. - - - - - Verifies all expectations on this mock object - - The mock object. - - - - Gets the event raiser for the event that was called in the action passed - - The type of the event source. - The mock object. - The event subscription. - - - - - Raise the specified event using the passed arguments. - The even is extracted from the passed labmda - - The type of the event source. - The mock object. - The event subscription. - The sender. - The instance containing the event data. - - - - Raise the specified event using the passed arguments. - The even is extracted from the passed labmda - - The type of the event source. - The mock object. - The event subscription. - The args. - - - TODO: Make this better! It currently breaks down when mocking classes or - ABC's that call other virtual methods which are getting intercepted too. I wish - we could just walk Expression{Action{Action{T}} to assert only a single - method is being made. - - The workaround is to not call foo.AssertWasCalled .. rather foo.VerifyAllExpectations() - The type of mock object - The mock repository - The actual mock object to assert expectations on. - - - - Fake type that disallow creating it. - Should have been System.Type, but we can't use it. - - - - - Utility class for dealing with messing generics scenarios. - - - - - There are issues with trying to get this to work correctly with open generic types, since this is an edge case, - I am letting the runtime handle it. - - - - - Gets the real type, including de-constructing and constructing the type of generic - methods parameters. - - The type. - The invocation. - - - - - Because we need to support complex types here (simple generics were handled above) we - need to be aware of the following scenarios: - List[T] and List[Foo[T]] - - - - - ExpectationsList - - - - - Dictionary - - - - - Dictionary class - - - - - Create a new instance of ProxyStateDictionary - - - - - Allows to call a method and immediately get it's options. - - - - - Interface to allow calling a method and immediately get it's options. - - - - - Get the method options for the call - - The method call should go here, the return value is ignored - - - - Creates a new instance. - - - - - Get the method options for the call - - The method call should go here, the return value is ignored - - - - Allows to call a method and immediately get it's options. - Set the expected number for the call to Any() - - - - - Creates a new instance. - - Proxy. - Mocked instance. - - - - Get the method options for the call - - The method call should go here, the return value is ignored - - - - This class is reponsible for taking a delegate and creating a wrapper - interface around it, so it can be mocked. - - - - - The scope for all the delegate interfaces create by this mock repository. - - - - - Gets a type with an "Invoke" method suitable for use as a target of the - specified delegate type. - - - - - - - Raise events for all subscribers for an event - - - - - Raise events for all subscribers for an event - - - - - Raise the event - - - - - The most common form for the event handler signature - - - - - Create an event raiser for the specified event on this instance. - - - - - Creates a new instance of EventRaiser - - - - - Raise the event - - - - - The most common signature for events - Here to allow intellisense to make better guesses about how - it should suggest parameters. - - - - - Allows to define what would happen when a method - is called. - - - - - Allows to define what would happen when a method - is called. - - - - - Set the return value for the method. - - The object the method will return - IRepeat that defines how many times the method will return this value - - - - Allow to override this return value in the future - - IRepeat that defines how many times the method will return this value - - - - Throws the specified exception when the method is called. - - Exception to throw - - - - Ignores the arguments for this method. Any argument will be matched - againt this method. - - - - - Add constraints for the method's arguments. - - - - - Set a callback method for the last call - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched - and allow to optionally modify the invocation as needed - - - - - Call the original method on the class, bypassing the mocking layers. - - - - - - Call the original method on the class, optionally bypassing the mocking layers. - - - - - - Use the property as a simple property, getting/setting the values without - causing mock expectations. - - - - - Expect last (property) call as property setting, ignore the argument given - - - - - - Expect last (property) call as property setting with a given argument. - - - - - - - Get an event raiser for the last subscribed event. - - - - - Set the parameter values for out and ref parameters. - This is done using zero based indexing, and _ignoring_ any non out/ref parameter. - - - - - Documentation message for the expectation - - Message - - - - Better syntax to define repeats. - - - - - Allows to specify the number of time for method calls - - - - - Repeat the method twice. - - - - - Repeat the method once. - - - - - Repeat the method at least once, then repeat as many time as it would like. - - - - - Repeat the method any number of times. - This has special affects in that this method would now ignore orderring. - - - - - Set the range to repeat an action. - - Min. - Max. - - - - Set the amount of times to repeat an action. - - - - - This method must not appear in the replay state. - This has special affects in that this method would now ignore orderring. - - - - - Creates a new instance. - - the repository for this expectation - the recorder for this proxy - the proxy for this expectation - Expectation. - - - - Add constraints for the method's arguments. - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Set the return value for the method. - - The object the method will return - IRepeat that defines how many times the method will return this value - - - - Set the return value for the method, but allow to override this return value in the future - - IRepeat that defines how many times the method will return this value - - - - Throws the specified exception when the method is called. - - Exception to throw - - - - Ignores the arguments for this method. Any argument will be matched - againt this method. - - - - - Call the original method on the class, bypassing the mocking layers. - - - - - - Call the original method on the class, optionally bypassing the mocking layers - - - - - - Use the property as a simple property, getting/setting the values without - causing mock expectations. - - - - - Expect last (property) call as property setting, ignore the argument given - - - - - - Expect last (property) call as property setting with a given argument. - - - - - - - Gets the event raiser for the last event - - - - - Set the parameter values for out and ref parameters. - This is done using zero based indexing, and _ignoring_ any non out/ref parameter. - - - - - Repeat the method twice. - - - - - Repeat the method once. - - - - - Repeat the method at least once, then repeat as many time as it would like. - - - - - This method must not appear in the replay state. - - - - - Documentation message for the expectation - - Message - - - - Repeat the method any number of times. - - - - - Set the range to repeat an action. - - Min. - Max. - - - - Set the amount of times to repeat an action. - - - - - Better syntax to define repeats. - - - - - This class will provide hash code for hashtables without needing - to call the GetHashCode() on the object, which may very well be mocked. - This class has no state so it is a singelton to avoid creating a lot of objects - that does the exact same thing. See flyweight patterns. - - - - - Get the hash code for a proxy object without calling GetHashCode() - on the object. - - - - - Compares two instances of mocked objects - - - - - Compare two mocked objects - - - - - The next hash code value for a mock object. - This is safe for multi threading. - - - - - The sole instance of - - - - - This is a dummy type that is used merely to give DynamicProxy the proxy instance that - it needs to create IProxy's types. - - - - - Interface to find the repository of a mocked object - - - - - Return true if it should call the original method on the object - instead of pass it to the message chain. - - The method to call - - - - Register a method to be called on the object directly - - - - - Register a property on the object that will behave as a simple property - - - - - Check if the method was registered as a property method. - - - - - Do get/set on the property, according to need. - - - - - Do add/remove on the event - - - - - Get the subscribers of a spesific event - - - - - Gets the declaring type of the method, taking into acccount the possible generic - parameters that it was created with. - - - - - Clears the state of the object, remove original calls, property behavior, subscribed events, etc. - - - - - Get all the method calls arguments that were made against this object with the specificed - method. - - - Only method calls in replay mode are counted - - - - - Records the method call - - - - - Mocks that are tied to this mock lifestyle - - - - - The unique hash code of this mock, which is not related - to the value of the GetHashCode() call on the object. - - - - - Gets the repository. - - - - - Gets the implemented types by this mocked object - - The implemented. - - - - Gets or sets the constructor arguments. - - The constructor arguments. - - - - The mocked instance that this is representing - - - - - Create a new instance of - - - - - Return true if it should call the original method on the object - instead of pass it to the message chain. - - The method to call - - - - Register a method to be called on the object directly - - - - - Register a property on the object that will behave as a simple property - Return true if there is already a value for the property - - - - - Check if the method was registered as a property method. - - - - - Do get/set on the property, according to need. - - - - - Do add/remove on the event - - - - - Get the subscribers of a spesific event - - - - - Gets the declaring type of the method, taking into acccount the possible generic - parameters that it was created with. - - - - - Get all the method calls arguments that were made against this object with the specificed - method. - - - - - Only method calls in replay mode are counted - - - - - Records the method call - - - - - - - Clears the state of the object, remove original calls, property behavior, subscribed events, etc. - - - - - Mocks that are tied to this mock lifestyle - - - - - The unique hash code of this proxy, which is not related - to the value of the GetHashCode() call on the object. - - - - - Gets the repository. - - - - - Gets or sets the constructor arguments. - - The constructor arguments. - - - - The mocked instance that this is representing - - - - - Gets the implemented types by this mocked object - - The implemented. - - - - Range for expected method calls - - - - - Creates a new instance. - - Min. - Max. - - - - Return the string representation of this range. - - - - - Gets or sets the min. - - - - - - Gets or sets the max. - - - - - - Records all the expectations for a mock and - return a ReplayDynamicMockState when Replay() - is called. - - - - - Creates a new instance. - - Repository. - The proxy that generates the method calls - - - - Verify that we can move to replay state and move - to the reply state. - - - - - Get the default call count range expectation - - - - - - Gets a mock state that match the original mock state of the object. - - - - - Records all the expectations for a mock and - return a ReplayPartialMockState when Replay() - is called. - - - - - Creates a new instance. - - Repository. - The proxy that generates the method calls - - - - Verify that we can move to replay state and move - to the reply state. - - - - - Gets a mock state that matches the original mock state of the object. - - - - - Options for special repeat option - - - - - This method can be called only as many times as the IMethodOptions.Expect allows. - - - - - This method should never be called - - - - - This method can be call any number of times - - - - - This method will call the original method - - - - - This method will call the original method, bypassing the mocking layer - - - - - This method will simulate simple property behavior - - - - - Validate all expectations on a mock and ignores calls to - any method that was not setup properly. - - - - - Creates a new instance. - - The previous state for this method - - - - Add a method call for this state' mock. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Gets a mock state that match the original mock state of the object. - - - - - Validate all expectations on a mock and ignores calls to - any method that was not setup properly. - - - - - Creates a new instance. - - The previous state for this method - - - - Add a method call for this state' mock. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Gets a mock state that match the original mock state of the object. - - - - - Summary description for RhinoInterceptor. - - - - - Creates a new instance. - - - - - Intercept a method call and direct it to the repository. - - - - - Validate arguments for methods - - - - - Validate that the passed argument is not null. - - The object to validate - The name of the argument - - If the obj is null, an ArgumentNullException with the passed name - is thrown. - - - - - Validate that the arguments are equal. - - Expected args. - Actual Args. - - - - Validate that the two arguments are equals, including validation for - when the arguments are collections, in which case it will validate their values. - - - - - This method is safe for use even if any of the objects is a mocked object - that override equals. - - - - - Throw an object already verified when accessed - - - - - Create a new instance of VerifiedMockState - - The previous mock state, used to get the initial record state - - - - Add a method call for this state' mock. - - The invocation for this method - The method that was called - The arguments this method was called with - - - - Verify that this mock expectations have passed. - - - - - Verify that we can move to replay state and move - to the reply state. - - - - - Gets a mock state that match the original mock state of the object. - - - - - Get the options for the last method call - - - - - Set the exception to throw when Verify is called. - This is used to report exception that may have happened but where caught in the code. - This way, they are reported anyway when Verify() is called. - - - - - not relevant - - - - - Gets the matching verify state for this state - - - - - Get the options for the last method call - - - - - Records the actions on all the mocks created by a repository. - - - - - Records the specified call with the specified args on the mocked object. - - - - - Get the expectation for this method on this object with this arguments - - - - - This check the methods that were setup using the SetupResult.For() - or LastCall.Repeat.Any() and that bypass the whole expectation model. - - - - - Gets the all expectations for a mocked object and method combination, - regardless of the expected arguments / callbacks / contraints. - - Mocked object. - Method. - List of all relevant expectation - - - - Gets the all expectations for proxy. - - Mocked object. - List of all relevant expectation - - - - Removes all the repeatable expectations for proxy. - - Mocked object. - - - - Replaces the old expectation with the new expectation for the specified proxy/method pair. - This replace ALL expectations that equal to old expectations. - - Proxy. - Method. - Old expectation. - New expectation. - - - - Adds the recorder and turn it into the active recorder. - - Recorder. - - - - Moves to previous recorder. - - - - - Gets the recorded expectation or null. - - - - - Gets the next expected calls string. - - - - - Moves to parent recorder. - - - - - Set the expectation so it can repeat any number of times. - - - - - Removes the expectation from the recorder - - - - - Clear the replayer to call (and all its chain of replayers) - This also removes it from the list of expectations, so it will never be considered again - - - - - Get the expectation for this method on this object with this arguments - - - - - Gets a value indicating whether this instance has expectations that weren't satisfied yet. - - - true if this instance has expectations; otherwise, false. - - - - - Allows to set various options for the last method call on - a specified object. - If the method has a return value, it's recommended to use Expect - - - - - Allows to get an interface to work on the last call. - - The mocked object - Interface that allows to set options for the last method call on this object - - - - Set the return value for the method. - - The object the method will return - IRepeat that defines how many times the method will return this value - - - - Set the return value for the method. This overload is needed for LastCall.Return(null) - - The object the method will return - IRepeat that defines how many times the method will return this value - - - - Throws the specified exception when the method is called. - - Exception to throw - - - - Ignores the arguments for this method. Any argument will be matched - againt this method. - - - - - Add constraints for the method's arguments. - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Set a callback method for the last call - - - - - Call the original method on the class, bypassing the mocking layers, for the last call. - - - - - Call the original method on the class, optionally bypassing the mocking layers, for the last call. - - - - - Set a delegate to be called when the expectation is matched. - The delegate return value will be returned from the expectation. - - - - - Gets an interface that will raise the last event when called. - - - - - Set the parameter values for out and ref parameters. - This is done using zero based indexing, and _ignoring_ any non out/ref parameter. - - - - - Documentation message for the expectation - - Message - - - - Use the property as a simple property, getting/setting the values without - causing mock expectations. - - - - - Better syntax to define repeats. - - - - - Base class for method recorders, handle delegating to inner recorder if needed. - - - - - List of the expected actions on for this recorder - The legal values are: - * Expectations - * Method Recorders - - - - - The current recorder. - - - - - The current replayer; - - - - - The parent recorder of this one, may be null. - - - - - This contains a list of all the replayers that should be ignored - for a spesific method call. A replayer gets into this list by calling - ClearReplayerToCall() on its parent. This list is Clear()ed on each new invocation. - - - - - All the repeatable methods calls. - - - - - Counts the recursion depth of the current expectation search stack - - - - - Creates a new instance. - - - - - Creates a new instance. - - Parent recorder. - Repeatable methods - - - - Records the specified call with the specified args on the mocked object. - - - - - Get the expectation for this method on this object with this arguments - - - - - Gets the all expectations for a mocked object and method combination, - regardless of the expected arguments / callbacks / contraints. - - Mocked object. - Method. - List of all relevant expectation - - - - Gets the all expectations for proxy. - - Mocked object. - List of all relevant expectation - - - - Replaces the old expectation with the new expectation for the specified proxy/method pair. - This replace ALL expectations that equal to old expectations. - - Proxy. - Method. - Old expectation. - New expectation. - - - - Remove the all repeatable expectations for proxy. - - Mocked object. - - - - Set the expectation so it can repeat any number of times. - - - - - Removes the expectation from the recorder - - - - - Adds the recorder and turn it into the active recorder. - - Recorder. - - - - Moves to previous recorder. - - - - - Moves to parent recorder. - - - - - Gets the recorded expectation or null. - - - - - Clear the replayer to call (and all its chain of replayers). - This also removes it from the list of expectations, so it will never be considered again - - - - - Get the expectation for this method on this object with this arguments - - - - - Gets the next expected calls string. - - - - - Handles the real getting of the recorded expectation or null. - - - - - Handle the real execution of this method for the derived class - - - - - Handle the real execution of this method for the derived class - - - - - Handle the real execution of this method for the derived class - - - - - Handle the real execution of this method for the derived class - - - - - Handle the real execution of this method for the derived class - - - - - Handle the real execution of this method for the derived class - - - - - Should this replayer be considered valid for this call? - - - - - This check the methods that were setup using the SetupResult.For() - or LastCall.Repeat.Any() and that bypass the whole expectation model. - - - - - Gets a value indicating whether this instance has expectations that weren't satisfied yet. - - - true if this instance has expectations; otherwise, false. - - - - - Handle the real execution of this method for the derived class - - - - - Ordered collection of methods, methods must arrive in specified order - in order to pass. - - - - - Unordered collection of method records, any expectation that exist - will be matched. - - - - - The parent recorder we have redirected to. - Useful for certain edge cases in orderring. - See: FieldProblem_Entropy for the details. - - - - - Creates a new instance. - - Parent recorder. - Repeatable methods - - - - Creates a new instance. - - - - - Records the specified call with the specified args on the mocked object. - - Mocked object. - Method. - Expectation. - - - - Get the expectation for this method on this object with this arguments - - Invocation for this method - Mocked object. - Method. - Args. - True is the call was recorded, false otherwise - - - - Gets the all expectations for a mocked object and method combination, - regardless of the expected arguments / callbacks / contraints. - - Mocked object. - Method. - List of all relevant expectation - - - - Gets the all expectations for proxy. - - Mocked object. - List of all relevant expectation - - - - Replaces the old expectation with the new expectation for the specified proxy/method pair. - This replace ALL expectations that equal to old expectations. - - Proxy. - Method. - Old expectation. - New expectation. - - - - Handle the real execution of this method for the derived class - - - - - Handles the real getting of the recorded expectation or null. - - - - - Handle the real execution of this method for the derived class - - - - - Gets the next expected calls string. - - - - - Create an exception for an unexpected method call. - - - - - Gets a value indicating whether this instance has expectations that weren't satisfied yet. - - - true if this instance has expectations; otherwise, false. - - - - - Creates a new instance. - - Parent recorder. - Repetable methods - - - - Creates a new instance. - - - - - Handles the real getting of the recorded expectation or null. - - - - - Get the expectation for this method on this object with this arguments - - - - - Gets the next expected calls string. - - - - - Hold an expectation for a method call on an object - - - - - Creates a new instance. - - Proxy. - Method. - Expectation. - - - - Determines if the object equal to this instance - - Obj. - - - - - Gets the hash code. - - - - - - Gets the proxy. - - - - - - Gets the method. - - - - - - Gets the expectation. - - - - - - Holds a pair of mocked object and a method - and allows to compare them against each other. - This allows us to have a distinction between mockOne.MyMethod() and - mockTwo.MyMethod()... - - - - - Creates a new instance. - - Proxy. - Method. - - - - Determines whatever obj equals to this instance. - ProxyMethodPairs are equal when they point to the same /instance/ of - an object, and to the same method. - - Obj. - - - - - Gets the hash code. - - - - - - Gets the proxy. - - - - - - Gets the method. - - - - - - Change the recorder from ordered to unordered and vice versa - - - - - Creates a new instance. - - - - - Disposes this instance. - - - - - Accessor for the current mocker - - - - - The current mocker - - - - - Used for [assembly: InternalsVisibleTo(RhinoMocks.StrongName)] - Used for [assembly: InternalsVisibleTo(RhinoMocks.NormalName)] - - - - - Strong name for the Dynamic Proxy assemblies. Used for InternalsVisibleTo specification. - - - - - Normal name for dynamic proxy assemblies. Used for InternalsVisibleTo specification. - - - - - Logs all method calls for methods - - - - - Setup method calls to repeat any number of times. - - - - - Get the method options and set the last method call to repeat - any number of times. - This also means that the method would transcend ordering - - - - - Get the method options for the last method call on the mockInstance and set it - to repeat any number of times. - This also means that the method would transcend ordering - - - - - Utility class for working with method calls. - - - - - Return the string representation of a method call and its arguments. - - The method - The method arguments - Invocation of the method, used to get the generics arguments - Delegate to format the parameter - The string representation of this method call - - - - Return the string representation of a method call and its arguments. - - The invocation of the method, used to get the generic parameters - The method - The method arguments - The string representation of this method call - - - - Delegate to format the argument for the string representation of - the method call. - - - - - Utility to get the default value for a type - - - - - The default value for a type. - Null for reference types and void - 0 for value types. - First element for enums - Note that we need to get the value even for opened generic types, such as those from - generic methods. - - Type. - The invocation. - the default value - - - - Allows easier access to MockRepository, works closely with Mocker.Current to - allow access to a context where the mock repository is automatially verified at - the end of the code block. - - - - - Initialize a code block where Mocker.Current is initialized. - At the end of the code block, all the expectation will be verified. - This overload will create a new MockRepository. - - The code that will be executed under the mock context - - - - Initialize a code block where Mocker.Current is initialized. - At the end of the code block, all the expectation will be verified. - This overload will create a new MockRepository. - - The mock repository to use, at the end of the code block, VerifyAll() will be called on the repository. - The code that will be executed under the mock context - - - - Create a FluentMocker - - The mock repository to use. - - - - A method with no arguments and no return value that will be called under the mock context. - - - - - FluentMocker implements some kind of fluent interface attempt - for saying "With the Mocks [mocks], Expecting (in same order) [things] verify [that]." - - - - - Interface to verify previously defined expectations - - - - - Verifies if a piece of code - - - - - Defines unordered expectations - - A delegate describing the expectations - an IMockVerifier - - - - Defines ordered expectations - - A delegate describing the expectations - an IMockVerifier - - - - Verifies previously defined expectations - - - - - This delegate is compatible with the System.Func{T,R} signature - We have to define our own to get compatability with 2.0 - - - - - This attribute is here so we can get better Pex integration - Using this means that Pex will not try to inspect the work of - the actual proxies being generated by Rhino Mocks - - - - diff --git a/local-pkg.ps1 b/local-pkg.ps1 index 30461b0eed8..17340f6894e 100644 --- a/local-pkg.ps1 +++ b/local-pkg.ps1 @@ -1,13 +1,16 @@ -param( - [Parameter(Position=1, Mandatory=0)] - [switch]$genAsmInfo = $true - ) - - -Import-Module .\tools\psake\psake.psm1 -ErrorAction SilentlyContinue - -# You should increment the BuildNumber whereever you used/referenced the locally built packages -# Point your VS Package Manager / Nuget at ./release/packages or ./core-only/packages to use your locally built package - -Invoke-psake .\default.ps1 -taskList @("CreatePackages") -properties @{BuildNumber="0"; PreRelease="-local"} -Remove-Module psake -ErrorAction SilentlyContinue \ No newline at end of file +param( + [Parameter(Position=1, Mandatory=0)] + $buildNumber = 0, + + [Parameter(Position=2, Mandatory=0)] + [switch]$genAsmInfo = $true +) + + +Import-Module .\tools\psake\psake.psm1 -ErrorAction SilentlyContinue + +# You should increment the BuildNumber whereever you used/referenced the locally built packages +# Point your VS Package Manager / Nuget at ./release/packages or ./core-only/packages to use your locally built package + +Invoke-psake .\default.ps1 -taskList @("CreatePackages") -properties @{BuildNumber=$buildNumber; PreRelease="-local"} +Remove-Module psake -ErrorAction SilentlyContinue diff --git a/normalize-crlf.ps1 b/normalize-crlf.ps1 new file mode 100644 index 00000000000..e84e2c1a671 --- /dev/null +++ b/normalize-crlf.ps1 @@ -0,0 +1,7 @@ +foreach ($ext in @("*.cs", "*.txt", "*.bat", "*.sln")) { + (dir -Recurse -Filter $ext) | foreach { + $file = gc $_.FullName + $file | Out-File -Encoding UTF8 $_.FullName + } + +} \ No newline at end of file diff --git a/packages/repositories.config b/packages/repositories.config index 41c5a3f89ee..d33a95ed22f 100644 --- a/packages/repositories.config +++ b/packages/repositories.config @@ -1,49 +1,39 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/quick.ps1 b/quick.ps1 new file mode 100644 index 00000000000..65e96398e4d --- /dev/null +++ b/quick.ps1 @@ -0,0 +1 @@ +.\build.ps1 Quick diff --git a/readme.txt b/readme.txt deleted file mode 100644 index 9605fbf4c71..00000000000 --- a/readme.txt +++ /dev/null @@ -1,207 +0,0 @@ -======================= -= NServiceBus License = -======================= - -By accessing NServiceBus code here, you are agreeing to the following licensing terms. -If you do not agree to these terms, do not access the NServiceBus code. - -Your license to the NServiceBus source and/or binaries is governed by the Reciprocal Public License 1.5 (RPL1.5) license as described here: - -http://www.opensource.org/licenses/rpl1.5.txt - -If you do not wish to release the source of software you build using NServiceBus, you may use NServiceBus source and/or binaries under the NServiceBus Express End User License Agreement as described here: - -http://particular.net/LicenseAgreement - - -============ -= Building = -============ - -The following web page contains information about how to build NServiceBus form source files: -http://particular.net/SourceCode In order to build the source, run the build.ps1 powershell script. - -You'll find the built assemblies in /build/binaries. - -If you see CS1668 warning when building under 2008, go to the 'C:\Program Files\Microsoft SDKs\Windows\v6.0A' directory and create the 'lib' subdirectory. - -If you see the build failing, check that you haven't put nServiceBus in a deep subdirectory since long path names (greater than 248 characters) aren't supported by MSBuild. - - -=========== -= Running = -=========== - -To run NServiceBus Msmq and MSDTC need to be installed and configured on your machine. To do this please -run RunMeFirst.bat. - -Running an nServiceBus process is simple. Any external dependencies that are needed like MSMQ, MSDTC, databases will be set up automatically at startup if they aren't found. - - -========= -= Sagas = -========= - -The 'Manufacturing' sample shows the use of sagas. - - - -============ -= Licenses = -============ - -NHibernate is licensed under the LGPL v2.1 license as described here: - -http://www.hibernate.org/license.html - -NHibernate binaries are merged into NServiceBus allowed under the LGPL license terms found here: - -http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt - -****************************** - - -LinFu is licensed under the LGPL v3 license as described here: - -http://code.google.com/p/linfu/ - -LinFu binaries are merged into NServiceBus allowed under the LGPL license terms found here: - -http://www.gnu.org/licenses/lgpl-3.0.txt - -****************************** - - -Iesi.Collections binaries are merged into NServiceBus allowed under the license terms found here: - -Copyright ? 2002-2004 by Aidant Systems, Inc., and by Jason Smith. - -Copied from http://www.codeproject.com/csharp/sets.asp#xx703510xx that was posted by JasonSmith 12:13 2 Jan '04 - -Feel free to use this code any way you want to. As a favor to me, you can leave the copyright in there. You never know when someone might recognize your name! - -If you do use the code in a commercial product, I would appreciate hearing about it. This message serves as legal notice that I won't be suing you for royalties! The code is in the public domain. - -On the other hand, I don't provide support. The code is actually simple enough that it shouldn't need it. - -****************************** - - -Fluent NHibernate is licensed under the BSD license as described here: - -http://github.com/jagregory/fluent-nhibernate/raw/master/LICENSE.txt - -Fluent NHibernate binaries are merged into NServiceBus allowed under the terms of the license. - -****************************** - - -Autofac is licensed under the MIT license as described here: - -http://code.google.com/p/autofac/ - -Autofac binaries are linked into the NServiceBus distribution allowed under the license terms found here: - -http://www.opensource.org/licenses/mit-license.php - -****************************** - -Spring.NET is licensed under the Apache license version 2.0 as described here: - -http://www.springframework.net/license.html - -Spring.NET binaries are merged into NServiceBus allowed under the license terms found here: - -http://www.apache.org/licenses/LICENSE-2.0.txt - -****************************** - - -Antlr is licensed under the BSD license as described here: - -http://antlr.org/license.html - -Antlr binaries are merged into NServiceBus allowed under the license terms described above. - -****************************** - - -Common.Logging is licensed under the Apache License, Version 2.0 as described here: - -http://netcommon.sourceforge.net/license.html - -Common.Logging binaries are merged into NServiceBus allowed under the LGPL license terms found here: - -http://www.apache.org/licenses/LICENSE-2.0.txt - -****************************** - - -StructureMap is licensed under the Apache License, Version 2.0 as described here: - -http://structuremap.github.com/structuremap/index.html - -StructureMap baries are linked into the NServiceBus distribution allowed under the license terms found here: - -http://www.apache.org/licenses/LICENSE-2.0.txt - -****************************** - - -Castle is licensed under the Apache License, Version 2.0 as described here: - -http://www.castleproject.org/ - -Castle binaries are linked into the NServiceBus distribution allowed under the license terms found here: - -http://www.apache.org/licenses/LICENSE-2.0.txt - -****************************** - - -Unity is licensed under the MSPL license as described here: - -http://unity.codeplex.com/license - -Unity binaries are linked into the NServiceBus distribution allowed under the license terms described above. - -****************************** - - -Log4Net is licensed under the Apache License, Version 2.0 as described here: - -http://logging.apache.org/log4net/license.html - -Log4Net binaries are linked into the NServiceBus distribution allowed under the license terms described above. - -****************************** - - -TopShelf is licensed under the Apache License, Version 2.0 as described here: - -http://code.google.com/p/topshelf/ - -TopShelf binaries are merged into NServiceBus as allowed under the license terms described here: - -http://www.apache.org/licenses/LICENSE-2.0.txt - -****************************** - - -SQLite is in the public domain as described here: - -http://www.sqlite.org/copyright.html - -SQLite binaries are linked into the NServiceBus distribution allowed under the license terms described above. - -****************************** - - -Rhino Mocks is licensed under the BSD License as described here: - -http://www.ayende.com/projects/rhino-mocks.aspx - -Rhino Mocks binaries are merged into NServiceBus allowed under the license terms described here: - -http://www.opensource.org/licenses/bsd-license.php - diff --git a/scaffolding.config b/scaffolding.config new file mode 100644 index 00000000000..e013ea0e3f4 --- /dev/null +++ b/scaffolding.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMQMessageDeferTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMQMessageDeferTests.cs new file mode 100644 index 00000000000..d5bb03dd78d --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMQMessageDeferTests.cs @@ -0,0 +1,58 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests +{ + using System; + using FluentAssertions; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + + [TestFixture] + public class ActiveMQMessageDeferTests + { + private ActiveMQMessageDefer testee; + + private Mock messageSenderMock; + + [SetUp] + public void SetUp() + { + this.messageSenderMock = new Mock(); + + this.testee = new ActiveMQMessageDefer { MessageSender = this.messageSenderMock.Object }; + } + + [Test] + public void WhenDeferMessage_AMQScheduledDelayShouldBeAdded() + { + var address = new Address("SomeQueue", "SomeMachine"); + var time = DateTime.UtcNow + TimeSpan.FromMinutes(1); + var message = new TransportMessage(); + + this.testee.Defer(message, time, address); + + this.messageSenderMock.Verify(s => s.Send(message, address)); + message.Headers.Should().ContainKey(ScheduledMessage.AMQ_SCHEDULED_DELAY); + Int32.Parse(message.Headers[ScheduledMessage.AMQ_SCHEDULED_DELAY]).Should().BeInRange(59500,60100); + } + + [Test] + public void WhenClearDeferredMessages_MessageIsSentToTheActiveMqSchedulerManagement() + { + const string headerKey = "theKey"; + const string headerValue = "someValue"; + Address.InitializeLocalAddress("localqueue"); + + var expectedSelector = string.Format("{0} = '{1}'", headerKey, headerValue); + Address sentToAddress = null; + TransportMessage sentMessage = null; + this.messageSenderMock + .Setup(ms => ms.Send(It.IsAny(), It.IsAny
    ())) + .Callback((m, a) => { sentToAddress = a; sentMessage = m; }); + + this.testee.ClearDeferredMessages(headerKey, headerValue); + + sentToAddress.Queue.Should().Be("localqueue.ActiveMqSchedulerManagement"); + sentMessage.Headers.Should().Contain(ActiveMqSchedulerManagement.ClearScheduledMessagesSelectorHeader, expectedSelector); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageDecoderPipelineTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageDecoderPipelineTest.cs new file mode 100644 index 00000000000..0005b904f6e --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageDecoderPipelineTest.cs @@ -0,0 +1,47 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests +{ + using System; + using Apache.NMS; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + + [TestFixture] + public class ActiveMqMessageDecoderPipelineTest + { + private Mock firstDecoder; + + private Mock secondDecoder; + + private ActiveMqMessageDecoderPipeline testee; + + [SetUp] + public void SetUp() + { + this.firstDecoder = new Mock(); + this.secondDecoder = new Mock(); + + this.testee = + new ActiveMqMessageDecoderPipeline(new[] { this.firstDecoder.Object, this.secondDecoder.Object }); + } + + [Test] + public void Decode_FirstDecoderReturnsDecodedMessage() + { + this.firstDecoder.Setup(d => d.Decode(It.IsAny(), It.IsAny())).Returns(true); + + this.testee.Decode(new TransportMessage(), Mock.Of()); + + this.secondDecoder.Verify(d => d.Decode(It.IsAny(), It.IsAny()), Times.Never()); + } + + [Test] + public void Decode_WhenAllDecoderCannotDecode_ThenThrow() + { + this.firstDecoder.Setup(d => d.Decode(It.IsAny(), It.IsAny())).Returns(false); + this.secondDecoder.Setup(d => d.Decode(It.IsAny(), It.IsAny())).Returns(false); + + Assert.Throws(() => this.testee.Decode(new TransportMessage(), Mock.Of())); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageDequeueStrategyTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageDequeueStrategyTests.cs new file mode 100644 index 00000000000..6b66ad014d1 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageDequeueStrategyTests.cs @@ -0,0 +1,122 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests +{ + using System; + using System.Collections.Generic; + using System.Transactions; + using FluentAssertions; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + using NServiceBus.Transports.ActiveMQ.Receivers; + using NServiceBus.Transports.ActiveMQ.SessionFactories; + using TransactionSettings = Unicast.Transport.TransactionSettings; + + [TestFixture] + public class ActiveMqMessageDequeueStrategyTests + { + [SetUp] + public void SetUp() + { + Configure.Transactions.Enable() + .Advanced( + settings => + settings.DefaultTimeout(TimeSpan.FromSeconds(10)) + .IsolationLevel(IsolationLevel.ReadCommitted) + .EnableDistributedTransactions()); + + notifyMessageReceivedFactoryMock = new Mock(); + sessionFactroyMock = new Mock(); + testee = new ActiveMqMessageDequeueStrategy(notifyMessageReceivedFactoryMock.Object, this.sessionFactroyMock.Object); + messageReceivers = new List>(); + stoppedMessageReceivers = new List>(); + disposedMessageReceivers = new List>(); + + notifyMessageReceivedFactoryMock + .Setup(f => f.CreateMessageReceiver(It.IsAny>(), It.IsAny>())) + .Returns(CreateMessageReceiver); + } + + private Mock notifyMessageReceivedFactoryMock; + private ActiveMqMessageDequeueStrategy testee; + private List> messageReceivers; + private List> stoppedMessageReceivers; + private List> disposedMessageReceivers; + private readonly Func tryReceiveMessage = m => true; + private Mock sessionFactroyMock; + + private void VerifyAllReceiversAreStarted(Address address, TransactionSettings settings) + { + foreach (var messageReceiver in messageReceivers) + { + messageReceiver.Verify(mr => mr.Start(address, settings)); + } + } + + private INotifyMessageReceived CreateMessageReceiver() + { + var messageReceiver = new Mock(); + messageReceivers.Add(messageReceiver); + messageReceiver.Setup(mr => mr.Stop()).Callback(() => stoppedMessageReceivers.Add(messageReceiver)); + messageReceiver.Setup(mr => mr.Dispose()).Callback(() => disposedMessageReceivers.Add(messageReceiver)); + messageReceiver.SetupAllProperties(); + return messageReceiver.Object; + } + + [Test] + public void WhenStarted_ThenTheSpecifiedNumberOfReceiversIsCreatedAndStarted() + { + TransactionSettings settings = TransactionSettings.Default; + const int NumberOfWorkers = 2; + + var address = new Address("someQueue", "machine"); + + testee.Init(address, settings, this.tryReceiveMessage, (s, exception) => { }); + testee.Start(NumberOfWorkers); + + messageReceivers.Count.Should().Be(NumberOfWorkers); + VerifyAllReceiversAreStarted(address, settings); + } + + [Test] + public void WhenStoped_ThenAllReceiversAreStopped() + { + const int InitialNumberOfWorkers = 5; + var address = new Address("someQueue", "machine"); + + testee.Init(address, TransactionSettings.Default, m => { return true; }, (s, exception) => { }); + testee.Start(InitialNumberOfWorkers); + testee.Stop(); + + stoppedMessageReceivers.Should().BeEquivalentTo(messageReceivers); + } + + [Test] + public void WhenStoped_ThenAllReceiversAreDisposed() + { + const int InitialNumberOfWorkers = 5; + var address = new Address("someQueue", "machine"); + + testee.Init(address, TransactionSettings.Default, m => { return true; }, (s, exception) => { }); + testee.Start(InitialNumberOfWorkers); + testee.Stop(); + + disposedMessageReceivers.Should().BeEquivalentTo(messageReceivers); + } + + [Test] + public void WhenStoped_SessionFactoryIsDisposedAfterMessageReceivers() + { + const int InitialNumberOfWorkers = 5; + int disposedReceivers = 0; + sessionFactroyMock.Setup(sf => sf.Dispose()).Callback(() => disposedReceivers = this.disposedMessageReceivers.Count); + var address = new Address("someQueue", "machine"); + + testee.Init(address, TransactionSettings.Default, m => true, (s, exception) => { }); + testee.Start(InitialNumberOfWorkers); + testee.Stop(); + + sessionFactroyMock.VerifyAll(); + disposedReceivers.Should().Be(InitialNumberOfWorkers); + } + } +} diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageEncoderPipelineTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageEncoderPipelineTest.cs new file mode 100644 index 00000000000..621d133e9fe --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageEncoderPipelineTest.cs @@ -0,0 +1,49 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests +{ + using System; + using Apache.NMS; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + + [TestFixture] + public class ActiveMqMessageEncoderPipelineTest + { + private Mock firstEncoder; + + private Mock secondEncoder; + + private ActiveMqMessageEncoderPipeline testee; + + [SetUp] + public void SetUp() + { + this.firstEncoder = new Mock(); + this.secondEncoder = new Mock(); + + this.testee = + new ActiveMqMessageEncoderPipeline(new[] { this.firstEncoder.Object, this.secondEncoder.Object }); + } + + [Test] + public void Encode_FirstEncoderReturnsEncodedMessage() + { + var expectedMessage = Mock.Of(); + this.firstEncoder.Setup(d => d.Encode(It.IsAny(), It.IsAny())).Returns(expectedMessage); + + IMessage message = this.testee.Encode(new TransportMessage(), Mock.Of()); + + this.secondEncoder.Verify(d => d.Encode(It.IsAny(), It.IsAny()), Times.Never()); + Assert.AreSame(expectedMessage, message); + } + + [Test] + public void Encode_WhenAllEncoderCannotEncode_ThenThrow() + { + this.firstEncoder.Setup(d => d.Encode(It.IsAny(), It.IsAny())).Returns(default(IMessage)); + this.secondEncoder.Setup(d => d.Encode(It.IsAny(), It.IsAny())).Returns(default(IMessage)); + + Assert.Throws(() => this.testee.Encode(new TransportMessage(), Mock.Of())); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageMapperTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageMapperTest.cs new file mode 100644 index 00000000000..569928e8a83 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageMapperTest.cs @@ -0,0 +1,303 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests +{ + using System; + using System.Collections.Generic; + + using Apache.NMS; + using Apache.NMS.Util; + + using FluentAssertions; + + using Moq; + + using NServiceBus.Serialization; + using NServiceBus.Transports.ActiveMQ; + + using NUnit.Framework; + + [TestFixture] + public class ActiveMqMessageMapperTest + { + private ActiveMqMessageMapper testee; + private Mock session; + private Mock messageTypeInterpreter; + + private Mock decoderPipeline; + + private Mock encoderPipeline; + + Mock serializer; + + [SetUp] + public void SetUp() + { + this.session = new Mock(); + this.serializer = new Mock(); + this.messageTypeInterpreter = new Mock(); + this.encoderPipeline = new Mock(); + this.decoderPipeline = new Mock(); + + this.testee = new ActiveMqMessageMapper(this.serializer.Object, this.messageTypeInterpreter.Object, this.encoderPipeline.Object, this.decoderPipeline.Object); + } + + [Test] + public void CreateJmsMessage_ShouldEncodeMessage() + { + this.SetupMessageCreation(); + + TransportMessage transportMessage = this.CreateTransportMessage(); + + this.testee.CreateJmsMessage(transportMessage, this.session.Object); + + this.encoderPipeline.Verify(e => e.Encode(transportMessage, this.session.Object)); + } + + [Test] + public void CreateJmsMessage_ShouldSetNMSTypeToNamespaceAndTypeOnlyForBetterInteroperability() + { + this.SetupMessageCreation(); + + TransportMessage transportMessage = this.CreateTransportMessage(); + transportMessage.Headers[Headers.EnclosedMessageTypes] = typeof(string).AssemblyQualifiedName; + + var message = this.testee.CreateJmsMessage(transportMessage, this.session.Object); + + message.NMSType.Should().Be("System.String"); + } + + [Test] + public void CreateJmsMessage_WhenMultipleEnclosedTypes_ShouldSetNMSTypeToNamespaceAndTypeOnlyForBetterInteroperability() + { + this.SetupMessageCreation(); + + TransportMessage transportMessage = this.CreateTransportMessage(); + transportMessage.Headers[Headers.EnclosedMessageTypes] = string.Format("{0};{1}", typeof(string).AssemblyQualifiedName, typeof(int).AssemblyQualifiedName); + + var message = this.testee.CreateJmsMessage(transportMessage, this.session.Object); + + message.NMSType.Should().Be("System.String"); + } + + [Test] + public void CreateTransportMessage_WhenHeaderKeyNull_ShouldAddNullHeaderKey() + { + const string KeyWhichIsNull = "SomeKeyWhichIsNull"; + + var message = CreateTextMessage(string.Empty); + message.Properties[KeyWhichIsNull] = null; + + var result = this.testee.CreateTransportMessage(message); + + result.Headers[KeyWhichIsNull].Should().BeNull(); + } + + [Test] + public void CreateTransportMessage_ShouldDecodeMessage() + { + var message = CreateTextMessage("SomeContent"); + + this.testee.CreateTransportMessage(message); + + this.decoderPipeline.Verify(d => d.Decode(It.IsAny(), message)); + } + + [Test] + public void CreateTransportMessage_IfNServiceBusVersionIsDefined_ShouldAssignNServiceBusVersion() + { + const string Version = "2.0.0.0"; + var message = CreateTextMessage(string.Empty); + message.Properties[Headers.NServiceBusVersion] = Version; + + var result = this.testee.CreateTransportMessage(message); + + result.Headers[Headers.NServiceBusVersion].Should().Be(Version); + } + + [Test] + public void CreateTransportMessage_IfNServiceBusVersionIsNotDefined_ShouldAssignDefaultNServiceBusVersion() + { + const string Version = "4.0.0.0"; + var message = CreateTextMessage(string.Empty); + + var result = this.testee.CreateTransportMessage(message); + + result.Headers[Headers.NServiceBusVersion].Should().Be(Version); + } + + [Test] + public void CreateTransportMessage_IfContentTypeIsDefined_ShouldAssignContentType() + { + var message = CreateTextMessage(string.Empty); + message.Properties[Headers.ContentType] = ContentTypes.Xml; + + var result = this.testee.CreateTransportMessage(message); + + result.Headers[Headers.ContentType].Should().Be(ContentTypes.Xml); + } + + [Test] + public void CreateTransportMessage_IfContentTypeIsNotDefined_ShouldAssignContentType() + { + this.serializer.Setup(s => s.ContentType).Returns(ContentTypes.Xml); + + var message = CreateTextMessage(string.Empty); + + var result = this.testee.CreateTransportMessage(message); + + result.Headers[Headers.ContentType].Should().Be(ContentTypes.Xml); + } + + [Test] + public void CreateTransportMessage_IfEnclosedMessageTypesIsDefined_ShouldAssignIt() + { + string EnclosedMessageTypes = typeof(string).AssemblyQualifiedName; + + var message = CreateTextMessage(string.Empty); + message.Properties[Headers.EnclosedMessageTypes] = EnclosedMessageTypes; + + var result = this.testee.CreateTransportMessage(message); + + result.Headers[Headers.EnclosedMessageTypes].Should().Be(EnclosedMessageTypes); + } + + [Test] + public void CreateTransportMessage_IfEnclosedMessageTypesIsNotDefined_ShouldAssignInterpretedTypeFromJmsMessage() + { + string ExpectedEnclosedMessageTypes = typeof(string).AssemblyQualifiedName; + const string JmsMessageType = "JmsMessageType"; + var message = CreateTextMessage(string.Empty); + message.NMSType = JmsMessageType; + + this.messageTypeInterpreter + .Setup(i => i.GetAssemblyQualifiedName(JmsMessageType)) + .Returns(ExpectedEnclosedMessageTypes); + + var result = this.testee.CreateTransportMessage(message); + + result.Headers[Headers.EnclosedMessageTypes].Should().Be(ExpectedEnclosedMessageTypes); + } + + [Test] + public void CreateTransportMessage_IfEnclosedMessageTypesIsNotDefinedAndNoJmsType_ShouldNotAddEnclosedMessageTypes() + { + var message = CreateTextMessage(string.Empty); + + var result = this.testee.CreateTransportMessage(message); + + result.Headers.Should().NotContainKey(Headers.EnclosedMessageTypes); + } + + [Test] + public void CreateTransportMessage_ShouldAssignCorrelationId() + { + const string CorrelationId = "TheCorrelationId"; + var message = CreateTextMessage(string.Empty); + message.NMSCorrelationID = CorrelationId; + + var result = this.testee.CreateTransportMessage(message); + + result.CorrelationId.Should().Be(CorrelationId); + } + + + [Test] + public void CreateTransportMessage_WhenMessageHasErrorCodeKey_ShouldAssignReturnMessageErrorCodeHeader() + { + const string Error = "Error"; + var message = CreateTextMessage(string.Empty); + message.Properties[ActiveMqMessageMapper.ErrorCodeKey] = Error; + + var result = this.testee.CreateTransportMessage(message); + + result.Headers[Headers.ReturnMessageErrorCodeHeader].Should().Be(Error); + result.Headers[Headers.ControlMessageHeader].Should().Be("true"); + } + + [Test] + public void CreateTransportMessage_WhenHeaderWith_DOT_ThenConvertedtoDot() + { + const string Value = "Value"; + var message = CreateTextMessage(string.Empty); + message.Properties["NSB_DOT_Feature"] = Value; + + var result = this.testee.CreateTransportMessage(message); + + result.Headers["NSB.Feature"].Should().Be(Value); + } + + [Test] + public void CreateTransportMessage_WhenHeaderWith_HYPHEN_ThenConvertedtoHyphen() + { + const string Value = "Value"; + var message = CreateTextMessage(string.Empty); + message.Properties["NSB_HYPHEN_Feature"] = Value; + + var result = this.testee.CreateTransportMessage(message); + + result.Headers["NSB-Feature"].Should().Be(Value); + } + + [Test] + public void ConvertMessageHeaderKeyFromActiveMQ_Converts_DOT_toDot() + { + var header = ActiveMqMessageMapper.ConvertMessageHeaderKeyFromActiveMQ("NSB_DOT_Feature"); + + header.Should().Be("NSB.Feature"); + } + + [Test] + public void ConvertMessageHeaderKeyFromActiveMQ_Converts_HYPHEN_toHyphen() + { + var header = ActiveMqMessageMapper.ConvertMessageHeaderKeyFromActiveMQ("NSB_HYPHEN_Feature"); + + header.Should().Be("NSB-Feature"); + } + + [Test] + public void ConvertMessageHeaderKeyToActiveMQ_ConvertsDot_to_DOT_() + { + var header = ActiveMqMessageMapper.ConvertMessageHeaderKeyToActiveMQ("NSB.Feature"); + + header.Should().Be("NSB_DOT_Feature"); + } + + [Test] + public void ConvertMessageHeaderKeyToActiveMQ_Converts_Hyphen_to_HYPHEN_() + { + var header = ActiveMqMessageMapper.ConvertMessageHeaderKeyToActiveMQ("NSB-Feature"); + + header.Should().Be("NSB_HYPHEN_Feature"); + } + + private static ITextMessage CreateTextMessage(string body) + { + var message = new Mock(); + message.SetupAllProperties(); + + message.Setup(m => m.Properties).Returns(new PrimitiveMap()); + message.Object.Text = body; + + return message.Object; + } + + private void SetupMessageCreation() + { + var message = new Mock(); + message.SetupAllProperties(); + message.Setup(m => m.Properties).Returns(new PrimitiveMap()); + + this.encoderPipeline.Setup(e => e.Encode(It.IsAny(), It.IsAny())) + .Returns(message.Object); + } + + private TransportMessage CreateTransportMessage() + { + return new TransportMessage(Guid.NewGuid().ToString(),new Dictionary { { Headers.EnclosedMessageTypes, "FancyHeader" }, }) + { + Recoverable = true, + TimeToBeReceived = TimeSpan.FromSeconds(2), + ReplyToAddress = new Address("someAddress", "localhorst") + }; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessagePublisherTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessagePublisherTests.cs new file mode 100644 index 00000000000..07a7a0f5b01 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessagePublisherTests.cs @@ -0,0 +1,36 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests +{ + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + + [TestFixture] + public class ActiveMqMessagePublisherTests + { + private Mock messageProducerMock; + private Mock topicEvaluatorMock; + private ActiveMqMessagePublisher testee; + + [SetUp] + public void SetUp() + { + this.messageProducerMock = new Mock(); + this.topicEvaluatorMock = new Mock(); + this.testee = new ActiveMqMessagePublisher(this.topicEvaluatorMock.Object, this.messageProducerMock.Object); + } + + [Test] + public void WhenPublishingAMessage_ThenItIsSentUsingTheMessageProducer() + { + const string Topic = "TheTopic"; + var message = new TransportMessage(); + var type = this.GetType(); + + this.topicEvaluatorMock.Setup(te => te.GetTopicFromMessageType(type)).Returns(Topic); + + this.testee.Publish(message, new[] { type }); + + this.messageProducerMock.Verify(mp => mp.SendMessage(message, Topic, "topic://")); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageSenderTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageSenderTests.cs new file mode 100644 index 00000000000..49a5a264dbc --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqMessageSenderTests.cs @@ -0,0 +1,31 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests +{ + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + + [TestFixture] + public class ActiveMqMessageSenderTests + { + private Mock messageProducerMock; + private ActiveMqMessageSender testee; + + [SetUp] + public void SetUp() + { + this.messageProducerMock = new Mock(); + this.testee = new ActiveMqMessageSender(this.messageProducerMock.Object); + } + + [Test] + public void WhenSendingAMessage_ThenItIsSentUsingTheMessageProducer() + { + const string Queue = "QueueName"; + var message = new TransportMessage(); + + this.testee.Send(message, new Address(Queue, "SomeMachineName")); + + this.messageProducerMock.Verify(mp => mp.SendMessage(message, Queue, "queue://")); + } + } +} diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqSchedulerManagementCommandsTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqSchedulerManagementCommandsTest.cs new file mode 100644 index 00000000000..ee84b23c85b --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqSchedulerManagementCommandsTest.cs @@ -0,0 +1,112 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests +{ + using System.Collections.Generic; + using Apache.NMS; + using Apache.NMS.ActiveMQ.Commands; + using FluentAssertions; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + using NServiceBus.Transports.ActiveMQ.SessionFactories; + + public class ActiveMqSchedulerManagementCommandsTest + { + private ActiveMqSchedulerManagementCommands testee; + private Mock sessionFactoryMock; + + [SetUp] + public void SetUp() + { + this.sessionFactoryMock = new Mock(); + + this.testee = new ActiveMqSchedulerManagementCommands + { + SessionFactory = this.sessionFactoryMock.Object + }; + } + + [Test] + public void WhenStopped_SessionIsReleased() + { + var session = this.SetupCreateSession(); + + this.testee.Start(); + this.testee.Stop(); + + this.sessionFactoryMock.Verify(sf => sf.Release(session.Object)); + } + + [Test] + public void WhenRequestDeferredMessages_AMessageIsSentToTheAMQSchedulerTopic() + { + IMessage sentMessage = null; + var destination = new ActiveMQTopic("someTopic"); + var session = this.SetupCreateSession(); + var producer = SetupCreateTopicProducer(session, ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION); + producer.Setup(p => p.Send(It.IsAny())).Callback(m => sentMessage = m); + + this.testee.RequestDeferredMessages(destination); + + sentMessage.Should().NotBeNull(); + sentMessage.NMSReplyTo.Should().Be(destination); + sentMessage.Properties.Keys.Should().Contain(ScheduledMessage.AMQ_SCHEDULER_ACTION); + sentMessage.Properties[ScheduledMessage.AMQ_SCHEDULER_ACTION].Should().Be(ScheduledMessage.AMQ_SCHEDULER_ACTION_BROWSE); + } + + [Test] + public void WhenProcessingJob_MessagesAreDeleted() + { + const string Selector = "Selector"; + const int Id = 42; + var message = new ActiveMQMessage(); + message.Properties[ScheduledMessage.AMQ_SCHEDULED_ID] = Id; + var messages = new Queue(); + messages.Enqueue(message); + IMessage sentDeletionMessage = null; + + var session = this.SetupCreateSession(); + var consumer = this.SetupCreateTemporaryTopicConsumer(session, Selector, ""); + consumer.Setup(c => c.ReceiveNoWait()).Returns(() => messages.Count > 0 ? messages.Dequeue() : null); + var producer = SetupCreateTopicProducer(session, ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION); + producer.Setup(p => p.Send(It.IsAny())).Callback(m => sentDeletionMessage = m); + + this.testee.Start(); + var job = this.testee.CreateActiveMqSchedulerManagementJob(Selector); + this.testee.ProcessJob(job); + + sentDeletionMessage.Should().NotBeNull(); + sentDeletionMessage.Properties[ScheduledMessage.AMQ_SCHEDULER_ACTION].Should().Be(ScheduledMessage.AMQ_SCHEDULER_ACTION_REMOVE); + sentDeletionMessage.Properties[ScheduledMessage.AMQ_SCHEDULED_ID].Should().Be(Id); + } + + + private Mock SetupCreateTemporaryTopicConsumer(Mock session, string Selector, string topicName) + { + var consumer = new Mock(); + var destination = new ActiveMQTempTopic(topicName); + session.Setup(s => s.CreateTemporaryTopic()).Returns(destination); + session.Setup(s => s.CreateConsumer(destination, Selector)).Returns(consumer.Object); + return consumer; + } + + private static Mock SetupCreateTopicProducer(Mock producerSession, string topicName) + { + var producer = new Mock(); + var topic = new Mock(); + + topic.Setup(d => d.TopicName).Returns(topicName); + producerSession.Setup(s => s.GetTopic(topicName)).Returns(topic.Object); + producerSession.Setup(s => s.CreateProducer(topic.Object)).Returns(producer.Object); + + return producer; + } + + private Mock SetupCreateSession() + { + var session = new Mock(); + session.Setup(s => s.CreateMessage()).Returns(() => new ActiveMQMessage()); + this.sessionFactoryMock.Setup(sf => sf.GetSession()).Returns(session.Object); + return session; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqSchedulerManagementJobProcessorTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqSchedulerManagementJobProcessorTests.cs new file mode 100644 index 00000000000..1179c78215c --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/ActiveMqSchedulerManagementJobProcessorTests.cs @@ -0,0 +1,90 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests +{ + using System; + using System.Threading; + using Apache.NMS; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + + public class ActiveMqSchedulerManagementJobProcessorTests + { + private ActiveMqSchedulerManagementJobProcessor testee; + private Mock activeMqSchedulerManagementCommandsMock; + + [SetUp] + public void SetUp() + { + this.activeMqSchedulerManagementCommandsMock = new Mock(); + + this.testee = new ActiveMqSchedulerManagementJobProcessor(this.activeMqSchedulerManagementCommandsMock.Object); + } + + [Test] + public void WhenStarted_ActiveMqSchedulerManagementCommandsAreStarted() + { + this.testee.Start(); + + this.activeMqSchedulerManagementCommandsMock.Verify(c => c.Start()); + } + + [Test] + public void WhenStopped_ActiveMqSchedulerManagementCommandsAreStopped() + { + this.testee.Stop(); + + this.activeMqSchedulerManagementCommandsMock.Verify(c => c.Stop()); + } + + [Test] + public void WhenMessageIsHandled_DeferredMessagesAreRequested() + { + const string Selector = "Selector"; + var message = new TransportMessage(); + var destination = new Mock().Object; + message.Headers[ActiveMqSchedulerManagement.ClearScheduledMessagesSelectorHeader] = Selector; + + this.activeMqSchedulerManagementCommandsMock.Setup(c => c.CreateActiveMqSchedulerManagementJob(Selector)) + .Returns(new ActiveMqSchedulerManagementJob(null, destination, DateTime.Now)); + + this.testee.HandleTransportMessage(message); + + this.activeMqSchedulerManagementCommandsMock.Verify(c => c.RequestDeferredMessages(destination)); + } + + [Test] + public void WhenProcessingJobs_AllCurrentJobsAreProcessed() + { + const string Selector = "Selector"; + var message = new TransportMessage(); + var destination = new Mock().Object; + var job = new ActiveMqSchedulerManagementJob(null, destination, DateTime.Now + TimeSpan.FromMinutes(1)); + message.Headers[ActiveMqSchedulerManagement.ClearScheduledMessagesSelectorHeader] = Selector; + + this.activeMqSchedulerManagementCommandsMock.Setup(c => c.CreateActiveMqSchedulerManagementJob(Selector)).Returns(job); + + this.testee.HandleTransportMessage(message); + this.testee.ProcessAllJobs(new CancellationToken(false)); + + this.activeMqSchedulerManagementCommandsMock.Verify(c => c.ProcessJob(job)); + this.activeMqSchedulerManagementCommandsMock.Verify(c => c.DisposeJob(job), Times.Never()); + } + + [Test] + public void WhenProcessingJobs_ExpiredJobsAreDisposed() + { + const string Selector = "Selector"; + var message = new TransportMessage(); + var destination = new Mock().Object; + var job = new ActiveMqSchedulerManagementJob(null, destination, DateTime.Now + TimeSpan.FromMinutes(-1)); + message.Headers[ActiveMqSchedulerManagement.ClearScheduledMessagesSelectorHeader] = Selector; + + this.activeMqSchedulerManagementCommandsMock.Setup(c => c.CreateActiveMqSchedulerManagementJob(Selector)).Returns(job); + + this.testee.HandleTransportMessage(message); + this.testee.ProcessAllJobs(new CancellationToken(false)); + + this.activeMqSchedulerManagementCommandsMock.Verify(c => c.DisposeJob(job)); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Decoders/ByteMessageDecoderTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Decoders/ByteMessageDecoderTest.cs new file mode 100644 index 00000000000..74aae94f945 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Decoders/ByteMessageDecoderTest.cs @@ -0,0 +1,62 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.Decoders +{ + using Apache.NMS; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ.Decoders; + + [TestFixture] + public class ByteMessageDecoderTest + { + private ByteMessageDecoder testee; + + [SetUp] + public void SetUp() + { + this.testee = new ByteMessageDecoder(); + } + + [Test] + public void Decode_WhenByteMessage_ThenTrue() + { + var transportMessage = new TransportMessage(); + + var result = this.testee.Decode(transportMessage, Mock.Of()); + + Assert.True(result); + } + + [Test] + public void Decode_WhenByteMessageWithContent_ThenAssignBody() + { + var transportMessage = new TransportMessage { Body = null }; + var bytesMessage = Mock.Of(m => m.Content == new byte[] { 1 }); + + this.testee.Decode(transportMessage, bytesMessage); + + Assert.NotNull(transportMessage.Body); + } + + [Test] + public void Decode_WhenByteMessageWithNoContent_ThenNotAssignBody() + { + var transportMessage = new TransportMessage { Body = null }; + var bytesMessage = Mock.Of(); + bytesMessage.Content = null; + + this.testee.Decode(transportMessage, bytesMessage); + + Assert.Null(transportMessage.Body); + } + + [Test] + public void Decode_WhenNotByteMessage_ThenFalse() + { + var transportMessage = new TransportMessage(); + + var result = this.testee.Decode(transportMessage, Mock.Of()); + + Assert.False(result); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Decoders/ControlMessageDecoderTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Decoders/ControlMessageDecoderTest.cs new file mode 100644 index 00000000000..a5de79c0f1b --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Decoders/ControlMessageDecoderTest.cs @@ -0,0 +1,72 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.Decoders +{ + using Apache.NMS; + using Apache.NMS.Util; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ.Decoders; + + [TestFixture] + public class ControlMessageDecoderTest + { + private ControlMessageDecoder testee; + + [SetUp] + public void SetUp() + { + this.testee = new ControlMessageDecoder(); + } + + [Test] + public void Decode_WhenControlMessage_ThenTrue() + { + var primitiveMap = new PrimitiveMap(); + primitiveMap[Headers.ControlMessageHeader] = null; + + var message = Mock.Of(x => x.Properties == primitiveMap); + + var result = this.testee.Decode(new TransportMessage(), message); + + Assert.IsTrue(result); + } + + [Test] + public void Decode_WhenControlMessageWithContent_ThenAssignBody() + { + var transportMessage = new TransportMessage { Body = null }; + + var primitiveMap = new PrimitiveMap(); + primitiveMap[Headers.ControlMessageHeader] = null; + + var bytesMessage = Mock.Of(m => m.Properties == primitiveMap && m.Content == new byte[] { 1 }); + + this.testee.Decode(transportMessage, bytesMessage); + + Assert.NotNull(transportMessage.Body); + } + + [Test] + public void Decode_WhenControlMessageWithNoContent_ThenNotAssignBody() + { + var transportMessage = new TransportMessage { Body = null }; + transportMessage.Headers.Add(Headers.ControlMessageHeader, null); + + var bytesMessage = Mock.Of(); + bytesMessage.Content = null; + + this.testee.Decode(transportMessage, bytesMessage); + + Assert.Null(transportMessage.Body); + } + + [Test] + public void Decode_WhenNotControlMessage_ThenFalse() + { + var message = Mock.Of(x => x.Properties == new PrimitiveMap()); + + var result = this.testee.Decode(new TransportMessage(), message); + + Assert.IsFalse(result); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Decoders/TestMessageDecoderTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Decoders/TestMessageDecoderTest.cs new file mode 100644 index 00000000000..10c89872ff9 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Decoders/TestMessageDecoderTest.cs @@ -0,0 +1,61 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.Decoders +{ + using Apache.NMS; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ.Decoders; + + [TestFixture] + public class TestMessageDecoderTest + { + private TextMessageDecoder testee; + + [SetUp] + public void SetUp() + { + this.testee = new TextMessageDecoder(); + } + + [Test] + public void Decode_WhenTextMessage_ThenTrue() + { + var transportMessage = new TransportMessage(); + + var result = this.testee.Decode(transportMessage, Mock.Of()); + + Assert.True(result); + } + + [Test] + public void Decode_WhenTextMessageWithText_ThenAssignBody() + { + var transportMessage = new TransportMessage { Body = null }; + var textMessage = Mock.Of(m => m.Text == "SomeContent"); + + this.testee.Decode(transportMessage, textMessage); + + Assert.NotNull(transportMessage.Body); + } + + [Test] + public void Decode_WhenTextMessageWithNoText_ThenNotAssignBody() + { + var transportMessage = new TransportMessage { Body = null }; + var textMessage = Mock.Of(); + + this.testee.Decode(transportMessage, textMessage); + + Assert.Null(transportMessage.Body); + } + + [Test] + public void Decode_WhenNotTextMessage_ThenFalse() + { + var transportMessage = new TransportMessage(); + + var result = this.testee.Decode(transportMessage, Mock.Of()); + + Assert.False(result); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/DestinationEvaluatorTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/DestinationEvaluatorTests.cs new file mode 100644 index 00000000000..b912ffe15dd --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/DestinationEvaluatorTests.cs @@ -0,0 +1,101 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests +{ + using Apache.NMS; + using FluentAssertions; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + + [TestFixture] + public class DestinationEvaluatorTests + { + private readonly DestinationEvaluator testee; + + public DestinationEvaluatorTests() + { + this.testee = new DestinationEvaluator(); + } + + [Test] + public void GetDestination_ForQueue_ShouldGetQueueDestinationFromSession() + { + const string QueueName = "Queue"; + var session = new Mock(); + var destination = new Mock().Object; + + session.Setup(s => s.GetQueue(QueueName)).Returns(destination); + + var result = this.testee.GetDestination(session.Object, QueueName, "queue://"); + + result.Should().BeSameAs(destination); + } + + [Test] + public void GetDestination_ForQueueWithQueuePrefix_ShouldGetQueueDestinationFromSession() + { + const string QueueName = "Queue"; + var session = new Mock(); + var destination = new Mock().Object; + + session.Setup(s => s.GetQueue(QueueName)).Returns(destination); + + var result = this.testee.GetDestination(session.Object, "queue://" + QueueName, "queue://"); + + result.Should().BeSameAs(destination); + } + + [Test] + public void GetDestination_ForQueueWithTempQueuePrefix_ShouldReturnTemporaryQueueDestination() + { + const string QueueName = "temp-queue://Queue"; + var session = new Mock(); + + var result = this.testee.GetDestination(session.Object, QueueName, "queue://"); + + result.IsTemporary.Should().BeTrue(); + result.IsQueue.Should().BeTrue(); + result.ToString().Should().Be(QueueName); + } + + [Test] + public void GetDestination_ForTopic_ShouldGetTopicDestinationFromSession() + { + const string TopicName = "Topic"; + var session = new Mock(); + var destination = new Mock().Object; + + session.Setup(s => s.GetTopic(TopicName)).Returns(destination); + + var result = this.testee.GetDestination(session.Object, TopicName, "topic://"); + + result.Should().BeSameAs(destination); + } + + [Test] + public void GetDestination_ForTopicWithQueuePrefix_ShouldGetTopicDestinationFromSession() + { + const string TopicName = "Topic"; + var session = new Mock(); + var destination = new Mock().Object; + + session.Setup(s => s.GetTopic(TopicName)).Returns(destination); + + var result = this.testee.GetDestination(session.Object, "topic://" + TopicName, "topic://"); + + result.Should().BeSameAs(destination); + } + + [Test] + public void GetDestination_ForTopicWithTempQueuePrefix_ShouldReturnTemporaryTopicDestination() + { + const string TopicName = "temp-topic://Topic"; + var session = new Mock(); + + var result = this.testee.GetDestination(session.Object, TopicName, "topic://"); + + result.IsTemporary.Should().BeTrue(); + result.IsTopic.Should().BeTrue(); + result.ToString().Should().Be(TopicName); + } + } +} diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Encoders/ByteMessageEncoderTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Encoders/ByteMessageEncoderTest.cs new file mode 100644 index 00000000000..83d24400d31 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Encoders/ByteMessageEncoderTest.cs @@ -0,0 +1,76 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.Encoders +{ + using Apache.NMS; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ.Encoders; + + [TestFixture] + public class ByteMessageEncoderTest + { + private ByteMessageEncoder testee; + + private Mock session; + + [SetUp] + public void SetUp() + { + this.session = new Mock { DefaultValue = DefaultValue.Mock }; + + this.SetupMessageCreation(); + + this.testee = new ByteMessageEncoder(); + } + + [Test] + [TestCase(ContentTypes.Bson)] + [TestCase(ContentTypes.Binary)] + public void Encode_WhenBinaryContentTypeWithoutBody_ReturnEmptyBinaryMessage(string contentType) + { + var transportMessage = new TransportMessage(); + transportMessage.Headers.Add(Headers.ContentType, contentType); + + IMessage message = this.testee.Encode(transportMessage, this.session.Object); + + Assert.IsInstanceOf(message); + Assert.IsEmpty(((IBytesMessage)message).Content); + } + + [Test] + [TestCase(ContentTypes.Bson)] + [TestCase(ContentTypes.Binary)] + public void Encode_WhenBinaryContentTypeWithBody_ReturnFilledBinaryMessage(string contentType) + { + byte[] content = new byte[] { 2 }; + + var transportMessage = new TransportMessage { Body = content }; + transportMessage.Headers.Add(Headers.ContentType, contentType); + + IMessage message = this.testee.Encode(transportMessage, this.session.Object); + + Assert.IsInstanceOf(message); + Assert.AreEqual(content, ((IBytesMessage)message).Content); + } + + [Test] + [TestCase(ContentTypes.Xml)] + [TestCase(ContentTypes.Json)] + public void Encode_WhenNonBinaryContentType_ReturnNull(string contentType) + { + var transportMessage = new TransportMessage(); + transportMessage.Headers.Add(Headers.ContentType, contentType); + + IMessage message = this.testee.Encode(transportMessage, this.session.Object); + + Assert.IsNull(message); + } + + private void SetupMessageCreation() + { + byte[] content = null; + this.session.Setup(s => s.CreateBytesMessage(It.IsAny())) + .Callback(c => content = c) + .Returns(() => Mock.Of(m => m.Content == content)); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Encoders/ControlMessageEncoderTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Encoders/ControlMessageEncoderTest.cs new file mode 100644 index 00000000000..cc954f32276 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Encoders/ControlMessageEncoderTest.cs @@ -0,0 +1,68 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.Encoders +{ + using Apache.NMS; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ.Encoders; + + [TestFixture] + public class ControlMessageEncoderTest + { + private ControlMessageEncoder testee; + + private Mock session; + + [SetUp] + public void SetUp() + { + this.session = new Mock { DefaultValue = DefaultValue.Mock }; + + this.SetupMessageCreation(); + + this.testee = new ControlMessageEncoder(); + } + + [Test] + public void Encode_WhenControlMessageWithEmptyBody_ReturnEmptyBinaryMessage() + { + var transportMessage = new TransportMessage(); + transportMessage.Headers.Add(Headers.ControlMessageHeader, null); + + IMessage message = this.testee.Encode(transportMessage, this.session.Object); + + Assert.IsInstanceOf(message); + Assert.IsEmpty(((IBytesMessage)message).Content); + } + + [Test] + public void Encode_WhenControlMessageWithBody_ReturnFilledBinaryMessage() + { + byte[] content = new byte[] { 2 }; + var transportMessage = new TransportMessage { Body = content }; + transportMessage.Headers.Add(Headers.ControlMessageHeader, null); + + IMessage message = this.testee.Encode(transportMessage, this.session.Object); + + Assert.IsInstanceOf(message); + Assert.AreEqual(content, ((IBytesMessage)message).Content); + } + + [Test] + public void Encode_WhenNotControlMessage_ReturnNull() + { + var transportMessage = new TransportMessage(); + + IMessage message = this.testee.Encode(transportMessage, this.session.Object); + + Assert.IsNull(message); + } + + private void SetupMessageCreation() + { + byte[] content = null; + this.session.Setup(s => s.CreateBytesMessage(It.IsAny())) + .Callback(c => content = c) + .Returns(() => Mock.Of(m => m.Content == content)); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Encoders/TextMessageEncoderTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Encoders/TextMessageEncoderTest.cs new file mode 100644 index 00000000000..4f9855d7753 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Encoders/TextMessageEncoderTest.cs @@ -0,0 +1,80 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.Encoders +{ + using System.Text; + using Apache.NMS; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ.Encoders; + + [TestFixture] + public class TextMessageEncoderTest + { + private TextMessageEncoder testee; + + private Mock session; + + [SetUp] + public void SetUp() + { + this.session = new Mock { DefaultValue = DefaultValue.Mock }; + + this.SetupMessageCreation(); + + this.testee = new TextMessageEncoder(); + } + + [Test] + [TestCase(ContentTypes.Json)] + [TestCase(ContentTypes.Xml)] + public void Encode_WhenTextContentTypeWithoutBody_ReturnEmptyTextMessage(string contentType) + { + var transportMessage = new TransportMessage(); + transportMessage.Headers.Add(Headers.ContentType, contentType); + + IMessage message = this.testee.Encode(transportMessage, this.session.Object); + + Assert.IsInstanceOf(message); + Assert.IsNullOrEmpty(((ITextMessage)message).Text); + } + + [Test] + [TestCase(ContentTypes.Json)] + [TestCase(ContentTypes.Xml)] + public void Encode_WhenTextContentTypeWithBody_ReturnFilledTextMessage(string contentType) + { + const string ExpectedContent = "SomeContent"; + + var transportMessage = new TransportMessage + { + Body = Encoding.UTF8.GetBytes(ExpectedContent), + }; + transportMessage.Headers.Add(Headers.ContentType, contentType); + + IMessage message = this.testee.Encode(transportMessage, this.session.Object); + + Assert.IsInstanceOf(message); + Assert.AreEqual(ExpectedContent, ((ITextMessage)message).Text); + } + + [Test] + [TestCase(ContentTypes.Bson)] + [TestCase(ContentTypes.Binary)] + public void Encode_WhenNonTextContentType_ReturnNull(string contentType) + { + var transportMessage = new TransportMessage(); + transportMessage.Headers.Add(Headers.ContentType, contentType); + + IMessage message = this.testee.Encode(transportMessage, this.session.Object); + + Assert.IsNull(message); + } + + private void SetupMessageCreation() + { + string content = null; + this.session.Setup(s => s.CreateTextMessage(It.IsAny())) + .Callback(c => content = c) + .Returns(() => Mock.Of(m => m.Text == content)); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/MessageProducerTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/MessageProducerTests.cs new file mode 100644 index 00000000000..0dfb14371dd --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/MessageProducerTests.cs @@ -0,0 +1,123 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests +{ + using System; + using Apache.NMS; + using FluentAssertions; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + using NServiceBus.Transports.ActiveMQ.SessionFactories; + + [TestFixture] + public class MessageProducerTests + { + private Mock sessionFactoryMock; + private Mock activeMqMessageMapperMock; + private Mock destinationEvaluatorMock; + private MessageProducer testee; + + [SetUp] + public void SetUp() + { + this.sessionFactoryMock = new Mock(MockBehavior.Loose); + this.activeMqMessageMapperMock = new Mock(); + this.destinationEvaluatorMock = new Mock(); + + this.testee = new MessageProducer( + this.sessionFactoryMock.Object, + this.activeMqMessageMapperMock.Object, + this.destinationEvaluatorMock.Object); + } + + [Test] + public void WhenSendingASendMessage_OnExcpetion_TheSessionIsReleasedAfterwards() + { + const string Reason = "TheExcpetionReason"; + var sessionMock = this.SetupCreateSession(); + this.activeMqMessageMapperMock.Setup(mm => mm + .CreateJmsMessage(It.IsAny(), sessionMock.Object)) + .Throws(new Exception(Reason)); + + Action action = () => this.testee.SendMessage(new TransportMessage(), string.Empty, string.Empty); + + action.ShouldThrow(Reason); + this.sessionFactoryMock.Verify(sf => sf.Release(sessionMock.Object)); + } + + [Test] + public void WhenSendingASendMessage_TheSessionIsReleasedAfterwards() + { + var sessionMock = this.SetupCreateSession(); + + this.testee.SendMessage(new TransportMessage(), string.Empty, string.Empty); + + this.sessionFactoryMock.Verify(sf => sf.Release(sessionMock.Object)); + } + + [Test] + public void WhenSendingAMessage() + { + const string Destination = "TheDestination"; + const string DestinationPrefix = "TheDestinationPrefix"; + + var message = new TransportMessage(); + var sessionMock = this.SetupCreateSession(); + var producerMock = this.SetupCreateProducer(sessionMock); + var jmsMessage = this.SetupCreateJmsMessageFromTransportMessage(message, sessionMock.Object); + var destination = this.SetupGetDestination(sessionMock, Destination, DestinationPrefix); + + this.testee.SendMessage(message, Destination, DestinationPrefix); + + producerMock.Verify(p => p.Send(destination, jmsMessage)); + } + + [Test, Ignore("Why do we need this daniel/remo")] + public void WhenSendingAMessage_ThenAssignTransportMessageIdToJmsMessageId() + { + const string Destination = "TheDestination"; + const string DestinationPrefix = "TheDestinationPrefix"; + + var message = new TransportMessage(); + var sessionMock = this.SetupCreateSession(); + this.SetupCreateProducer(sessionMock); + var jmsMessage = this.SetupCreateJmsMessageFromTransportMessage(message, sessionMock.Object); + this.SetupGetDestination(sessionMock, Destination, DestinationPrefix); + + this.testee.SendMessage(message, Destination, DestinationPrefix); + + message.Id.Should().BeEquivalentTo(jmsMessage.NMSMessageId); + } + + private IDestination SetupGetDestination(Mock sessionMock, string Destination, string DestinationPrefix) + { + var destination = new Mock().Object; + this.destinationEvaluatorMock.Setup(de => de.GetDestination(sessionMock.Object, Destination, DestinationPrefix)) + .Returns(destination); + return destination; + } + + private Mock SetupCreateSession() + { + var sessionMock = new Mock(); + this.sessionFactoryMock.Setup(c => c.GetSession()).Returns(sessionMock.Object); + this.SetupCreateProducer(sessionMock); + return sessionMock; + } + + private IMessage SetupCreateJmsMessageFromTransportMessage(TransportMessage message, ISession session) + { + var jmsMessage = new Mock().SetupAllProperties().Object; + jmsMessage.NMSMessageId = Guid.NewGuid().ToString(); + + this.activeMqMessageMapperMock.Setup(m => m.CreateJmsMessage(message, session)).Returns(jmsMessage); + return jmsMessage; + } + + private Mock SetupCreateProducer(Mock sessionMock) + { + var producerMock = new Mock(); + sessionMock.Setup(s => s.CreateProducer()).Returns(producerMock.Object); + return producerMock; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/MessageTypeInterpreterTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/MessageTypeInterpreterTests.cs new file mode 100644 index 00000000000..539595e0233 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/MessageTypeInterpreterTests.cs @@ -0,0 +1,65 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests +{ + using FluentAssertions; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + + [TestFixture] + public class MessageTypeInterpreterTests + { + private MessageTypeInterpreter testee; + + [SetUp] + public void SetUp() + { + this.testee = new MessageTypeInterpreter(); + } + + [Test] + public void GetAssemblyQualifiedName_IfNull_ReturnsEmptyString() + { + var result = this.testee.GetAssemblyQualifiedName(null); + + result.Should().BeEmpty(); + } + + [Test] + public void GetAssemblyQualifiedName_IfEmptyString_ReturnsEmptyString() + { + var result = this.testee.GetAssemblyQualifiedName(string.Empty); + + result.Should().BeEmpty(); + } + + [Test] + public void GetAssemblyQualifiedName_IfAssemblyQualifiedName_ReturnsAssemblyQualifiedName() + { + var name = this.GetType().AssemblyQualifiedName; + + var result = this.testee.GetAssemblyQualifiedName(name); + + result.Should().Be(name); + } + + [Test] + public void GetAssemblyQualifiedName_IfFullName_ReturnsAssemblyQualifiedName() + { + var name = this.GetType().FullName; + var expectedName = this.GetType().AssemblyQualifiedName; + + var result = this.testee.GetAssemblyQualifiedName(name); + + result.Should().Be(expectedName); + } + + [Test] + public void GetAssemblyQualifiedName_IfUninterpretableType_ReturnsInputValue() + { + const string Name = "SomeNonsenseType"; + + var result = this.testee.GetAssemblyQualifiedName(Name); + + result.Should().Be(Name); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/NServiceBus.Transports.ActiveMQ.Tests.csproj b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/NServiceBus.Transports.ActiveMQ.Tests.csproj new file mode 100644 index 00000000000..a102c3d8a95 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/NServiceBus.Transports.ActiveMQ.Tests.csproj @@ -0,0 +1,127 @@ + + + + + Debug + AnyCPU + {88485CCA-BE4A-46D7-864A-2ABEF45074BF} + Library + Properties + NServiceBus.Transports.ActiveMQ.Tests + NServiceBus.Transports.ActiveMQ.Tests + v4.0 + 512 + + ..\..\..\ + true + + + true + full + false + bin\debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\packages\Apache.NMS.1.5.1\lib\net40\Apache.NMS.dll + + + False + ..\..\..\lib\Apache.NMS-CustomBuild\Apache.NMS.ActiveMQ.dll + + + False + ..\..\..\packages\FluentAssertions.2.0.1\lib\net40\FluentAssertions.dll + + + ..\..\..\packages\Moq.4.0.10827\lib\NET40\Moq.dll + + + False + ..\..\..\packages\NUnit.2.6.2\lib\nunit.framework.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer + + + + + {dd48b2d0-e996-412d-9157-821ed8b17a9d} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + + {6FC67824-B465-4796-828E-76E5BF4F0D54} + NServiceBus.Transports.ActiveMQ + + + + + + + \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Properties/AssemblyInfo.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..9bbbf1bf8f8 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("NServiceBus.Unicast.Queuing.ActiveMQ.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyProduct("NServiceBus.Unicast.Queuing.ActiveMQ.Tests")] +[assembly: AssemblyCompany("NServiceBus")] +[assembly: AssemblyConfiguration("release")] +[assembly: AssemblyInformationalVersion("4.0.0-alpha0")] +[assembly: ComVisible(false)] +[assembly: CLSCompliantAttribute(true)] + diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/ActiveMqMessageReceiverTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/ActiveMqMessageReceiverTests.cs new file mode 100644 index 00000000000..1a136d8bb7d --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/ActiveMqMessageReceiverTests.cs @@ -0,0 +1,157 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.Receivers +{ + using System; + using System.Transactions; + using Apache.NMS; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ.Receivers; + using TransactionSettings = Unicast.Transport.TransactionSettings; + + [TestFixture] + public class ActiveMqMessageReceiverTests + { + private ActiveMqMessageReceiver testee; + + private Mock messageConsumerMock; + private Mock eventConsumerMock; + private Mock messageProcessorMock; + + [SetUp] + public void SetUp() + { + Configure.Transactions.Enable() + .Advanced( + settings => + settings.DefaultTimeout(TimeSpan.FromSeconds(10)) + .IsolationLevel(IsolationLevel.ReadCommitted) + .EnableDistributedTransactions()); + + this.messageProcessorMock = new Mock(); + this.eventConsumerMock = new Mock(); + this.messageConsumerMock = new Mock(); + + this.testee = new ActiveMqMessageReceiver( + this.eventConsumerMock.Object, + this.messageProcessorMock.Object); + + this.messageProcessorMock + .Setup(mp => mp.CreateMessageConsumer(It.IsAny())) + .Returns(this.messageConsumerMock.Object); + + Address.InitializeLocalAddress("local"); + } + + [Test] + public void OnStart_MessageProcessorIsStarted() + { + var transactionSettings = TransactionSettings.Default; + + this.testee.Start(Address.Local, transactionSettings); + + this.messageProcessorMock.Verify(mp => mp.Start(transactionSettings)); + } + + [Test] + public void OnStart_WhenLocalAddress_EventConsumerIsStarted() + { + var transactionSettings = TransactionSettings.Default; + + this.testee.Start(Address.Local, transactionSettings); + + this.eventConsumerMock.Verify(mp => mp.Start()); + } + + [Test] + public void OnStart_WhenNotLocalAddress_EventConsumerIsNotStarted() + { + var transactionSettings = TransactionSettings.Default; + + this.testee.Start(new Address("someOtherQueue", "localhost"), transactionSettings); + + this.eventConsumerMock.Verify(mp => mp.Start(), Times.Never()); + } + + [Test] + public void OnStart_MessageConsumerForAddreddIsCreated() + { + var queue = "somequeue"; + var transactionSettings = TransactionSettings.Default; + + this.testee.Start(new Address(queue, "localhost"), transactionSettings); + + this.messageProcessorMock.Verify(mp => mp.CreateMessageConsumer("queue://" + queue)); + } + + [Test] + public void WhenMessageReceived_MessageProcessorIsInvoked() + { + var message = new Mock().Object; + + this.testee.Start(Address.Local, TransactionSettings.Default); + this.messageConsumerMock.Raise(mc => mc.Listener += null, message); + + this.messageProcessorMock.Verify(mp => mp.ProcessMessage(message)); + } + + [Test] + public void OnStop_MessageProcessorIsStopped() + { + this.testee.Start(Address.Local, TransactionSettings.Default); + this.testee.Stop(); + + this.messageProcessorMock.Verify(mp => mp.Stop()); + } + + [Test] + public void OnStop_EventConsumerIsStopped() + { + this.testee.Start(Address.Local, TransactionSettings.Default); + this.testee.Stop(); + + this.eventConsumerMock.Verify(mp => mp.Stop()); + } + + [Test] + public void WhenMessageReceivedAfterStop_MessageProcessorIsNotInvoked() + { + var message = new Mock().Object; + + this.testee.Start(Address.Local, TransactionSettings.Default); + this.testee.Stop(); + this.messageConsumerMock.Raise(mc => mc.Listener += null, message); + + this.messageProcessorMock.Verify(mp => mp.ProcessMessage(message), Times.Never()); + } + + [Test] + public void OnDispose_MessageProcessorIsDisposed() + { + this.testee.Start(Address.Local, TransactionSettings.Default); + this.testee.Stop(); + this.testee.Dispose(); + + this.messageProcessorMock.Verify(mp => mp.Dispose()); + } + + [Test] + public void OnDispose_EventConsumerIsDisposed() + { + this.testee.Start(Address.Local, TransactionSettings.Default); + this.testee.Stop(); + this.testee.Dispose(); + + this.eventConsumerMock.Verify(mp => mp.Dispose()); + } + + [Test] + public void OnDispose_MessageConsumerIsDisposed() + { + this.testee.Start(Address.Local, TransactionSettings.Default); + this.testee.Stop(); + this.testee.Dispose(); + + this.messageConsumerMock.Verify(mp => mp.Dispose()); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/ActiveMqPurgerTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/ActiveMqPurgerTest.cs new file mode 100644 index 00000000000..ef9fffb7a1b --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/ActiveMqPurgerTest.cs @@ -0,0 +1,43 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.Receivers +{ + using Apache.NMS; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ.Receivers; + + public class ActiveMqPurgerTest + { + private Mock session; + + private Mock destination; + + private ActiveMqPurger testee; + + [SetUp] + public void SetUp() + { + this.session = new Mock(); + this.destination = new Mock(); + + this.testee = new ActiveMqPurger(); + } + + [Test] + public void Purge_WhenAlreadyPurged_ThenDontPurgeAgain() + { + this.testee.Purge(this.session.Object, this.destination.Object); + + this.testee.Purge(this.session.Object, this.destination.Object); + + this.session.Verify(s => s.DeleteDestination(this.destination.Object), Times.Once()); + } + + [Test] + public void Purge_WhenNotYetPurged_ThenPurge() + { + this.testee.Purge(this.session.Object, this.destination.Object); + + this.session.Verify(s => s.DeleteDestination(this.destination.Object)); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/EventConsumerTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/EventConsumerTests.cs new file mode 100644 index 00000000000..8f66722ccb9 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/EventConsumerTests.cs @@ -0,0 +1,197 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.Receivers +{ + using System; + using System.Collections.Generic; + using Apache.NMS; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + using NServiceBus.Transports.ActiveMQ.Receivers; + + [TestFixture] + public class EventConsumerTests + { + private EventConsumer testee; + private Mock messageProcessorMock; + private NotifyTopicSubscriptionsMock subscriptionManagerMock; + + [SetUp] + public void SetUp() + { + this.messageProcessorMock = new Mock(); + this.subscriptionManagerMock = new NotifyTopicSubscriptionsMock(); + + this.testee = new EventConsumer(this.subscriptionManagerMock, this.messageProcessorMock.Object); + } + + [Test] + public void WhenSubscriptionIsAddedToStartedConsumer_ThenTopicIsSubscribed() + { + const string Topic = "SomeTopic"; + const string ConsumerName = "A"; + var message = new Mock().Object; + + var topicConsumer = this.SetupCreateConsumer(string.Format("queue://Consumer.{0}.{1}", ConsumerName, Topic)); + + this.testee.ConsumerName = ConsumerName; + this.testee.Start(); + this.subscriptionManagerMock.RaiseTopicSubscribed(Topic); + this.RaiseEventReceived(topicConsumer, message); + + this.messageProcessorMock.Verify(mp => mp.ProcessMessage(message)); + } + + [Test] + public void WhenEventReceivedAfterStop_ThenProcessorIsNotInvoked() + { + const string Topic = "SomeTopic"; + const string ConsumerName = "A"; + var message = new Mock().Object; + + var topicConsumer = this.SetupCreateConsumer(string.Format("queue://Consumer.{0}.{1}", ConsumerName, Topic)); + + this.testee.ConsumerName = ConsumerName; + this.testee.Start(); + this.subscriptionManagerMock.RaiseTopicSubscribed(Topic); + this.testee.Stop(); + this.RaiseEventReceived(topicConsumer, message); + + this.messageProcessorMock.Verify(mp => mp.ProcessMessage(message), Times.Never()); + } + + [Test] + public void WhenSubscriptionIsAddedToNotStartedConsumer_ThenTopicIsNotSubscribed() + { + const string Topic = "SomeTopic"; + const string ConsumerName = "A"; + var message = new Mock().Object; + + var topicConsumer = this.SetupCreateConsumer(string.Format("queue://Consumer.{0}.{1}", ConsumerName, Topic)); + + this.testee.ConsumerName = ConsumerName; + this.subscriptionManagerMock.RaiseTopicSubscribed(Topic); + this.RaiseEventReceived(topicConsumer, message); + + this.messageProcessorMock.Verify(mp => mp.ProcessMessage(It.IsAny()), Times.Never()); + } + + [Test] + public void WhenStarted_ThenCurrentTopicAreSubscribed() + { + const string Topic = "SomeTopic"; + const string ConsumerName = "A"; + var message = new Mock().Object; + + var topicConsumer = this.SetupCreateConsumer(string.Format("queue://Consumer.{0}.{1}", ConsumerName, Topic)); + this.subscriptionManagerMock.InitialTopics.Add(Topic); + + this.testee.ConsumerName = ConsumerName; + this.testee.Start(); + this.RaiseEventReceived(topicConsumer, message); + + this.messageProcessorMock.Verify(mp => mp.ProcessMessage(message)); + } + + [Test] + public void WhenTopicIsUnsubscribed_ThenConsumerIsDisposed() + { + const string Topic = "SomeTopic"; + const string ConsumerName = "A"; + + var topicConsumer = this.SetupCreateConsumer(string.Format("queue://Consumer.{0}.{1}", ConsumerName, Topic)); + + this.testee.ConsumerName = ConsumerName; + this.testee.Start(); + this.subscriptionManagerMock.RaiseTopicSubscribed(Topic); + this.subscriptionManagerMock.RaiseTopicUnsubscribed(Topic); + + topicConsumer.Verify(c => c.Dispose()); + } + + [Test] + public void WhenDisposed_ThenConsumersAreDisposed() + { + const string Topic = "SomeTopic"; + const string ConsumerName = "A"; + + var topicConsumer = this.SetupCreateConsumer(string.Format("queue://Consumer.{0}.{1}", ConsumerName, Topic)); + + this.testee.ConsumerName = ConsumerName; + this.testee.Start(); + this.subscriptionManagerMock.RaiseTopicSubscribed(Topic); + this.testee.Stop(); + this.testee.Dispose(); + + topicConsumer.Verify(c => c.Dispose()); + } + + [Test] + public void WhenConsumerNameHasDot_ThenItIsReplacedByDashForSubscriptions_SoThatTheVirtualTopicNamePatternIsNotBroken() + { + const string Topic = "Some.Topic"; + const string ConsumerName = "A.B.C"; + const string ExpectedConsumerName = "A-B-C"; + var message = new Mock().Object; + + var topicConsumer = this.SetupCreateConsumer(string.Format("queue://Consumer.{0}.{1}", ExpectedConsumerName, Topic)); + + this.testee.ConsumerName = ConsumerName; + this.testee.Start(); + this.subscriptionManagerMock.RaiseTopicSubscribed(Topic); + this.RaiseEventReceived(topicConsumer, message); + + this.messageProcessorMock.Verify(mp => mp.ProcessMessage(message)); + } + + private Mock SetupCreateConsumer(string queue) + { + var consumerMock = new Mock(); + this.messageProcessorMock.Setup(mp => mp.CreateMessageConsumer(queue)).Returns(consumerMock.Object); + return consumerMock; + } + + private IQueue SetupGetQueue(Mock sessionMock, string queue) + { + var destinationMock = new Mock(); + sessionMock.Setup(s => s.GetQueue(queue)).Returns(destinationMock.Object); + destinationMock.Setup(destination => destination.QueueName).Returns(queue); + return destinationMock.Object; + } + + private void RaiseEventReceived(Mock topicConsumer, IMessage message) + { + topicConsumer.Raise(c => c.Listener += null, message); + } + + private class NotifyTopicSubscriptionsMock : INotifyTopicSubscriptions + { + public event EventHandler TopicSubscribed = delegate { }; + public event EventHandler TopicUnsubscribed = delegate { }; + public List InitialTopics = new List(); + + public IEnumerable Register(ITopicSubscriptionListener listener) + { + this.TopicSubscribed += listener.TopicSubscribed; + this.TopicUnsubscribed += listener.TopicUnsubscribed; + + return this.InitialTopics; + } + + public void Unregister(ITopicSubscriptionListener listener) + { + this.TopicSubscribed -= listener.TopicSubscribed; + this.TopicUnsubscribed -= listener.TopicUnsubscribed; + } + + public void RaiseTopicSubscribed(string topic) + { + this.TopicSubscribed(this, new SubscriptionEventArgs(topic)); + } + + public void RaiseTopicUnsubscribed(string topic) + { + this.TopicUnsubscribed(this, new SubscriptionEventArgs(topic)); + } + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/MessageProcessorTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/MessageProcessorTest.cs new file mode 100644 index 00000000000..12889e54d4f --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/MessageProcessorTest.cs @@ -0,0 +1,260 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.Receivers +{ + using System; + using System.Transactions; + using Apache.NMS; + using FluentAssertions; + using Moq; + + using NServiceBus.Transports.ActiveMQ.Receivers.TransactionsScopes; + + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + using NServiceBus.Transports.ActiveMQ.Receivers; + using NServiceBus.Transports.ActiveMQ.SessionFactories; + using TransactionSettings = Unicast.Transport.TransactionSettings; + + [TestFixture] + public class MessageProcessorTest + { + private MessageProcessor testee; + + private Mock sessionFactoryMock; + private Mock activeMqMessageMapperMock; + private Mock session; + private Mock purger; + private Mock transactionScopeFactoryMock; + private string order; + + [SetUp] + public void SetUp() + { + Configure.Transactions.Enable() + .Advanced( + settings => + settings.DefaultTimeout(TimeSpan.FromSeconds(10)) + .IsolationLevel(IsolationLevel.ReadCommitted) + .EnableDistributedTransactions()); + + this.sessionFactoryMock = new Mock(); + this.activeMqMessageMapperMock = new Mock(); + this.purger = new Mock(); + this.transactionScopeFactoryMock = new Mock(); + + this.testee = new MessageProcessor( + this.activeMqMessageMapperMock.Object, + this.sessionFactoryMock.Object, + this.purger.Object, + this.transactionScopeFactoryMock.Object); + + this.transactionScopeFactoryMock + .Setup(f => f.CreateNewTransactionScope(It.IsAny(), It.IsAny())) + .Returns(new Mock().Object); + +order = string.Empty; + } + + [Test] + public void WhenMessageIsReceived_ThenMessageReceivedIsRaised() + { + var messageMock = new Mock(); + var transportMessage = new TransportMessage(); + TransportMessage receivedMessage = null; + + this.SetupMapMessageToTransportMessage(messageMock.Object, transportMessage); + + this.testee.EndProcessMessage = (m, e) => { }; + this.testee.TryProcessMessage = m => + { + receivedMessage = m; + return true; + }; + + + this.StartTestee(); + this.testee.ProcessMessage(messageMock.Object); + + receivedMessage.Should().Be(transportMessage); + } + + [Test] + public void WhenMessageIsProcessedSucccessfully_ThenTransactionIsCompleted() + { + var message = new Mock().Object; + + this.SetuptransactionOrderTracking(message); + + this.testee.EndProcessMessage = (m, e) => { order += "EndProcess_"; }; + this.testee.TryProcessMessage = m => + { + order += "MsgProcessed_"; + return true; + }; + + this.StartTestee(); + this.testee.ProcessMessage(message); + + order.Should().Be("StartTx_TxMessageAccepted_MsgProcessed_TxComplete_EndProcess_TxDispose_"); + } + + [Test] + public void WhenMessageProcessingFails_ThenTransactionIsNotCompleted() + { + var message = new Mock().Object; + + this.SetuptransactionOrderTracking(message); + + this.testee.EndProcessMessage = (m, e) => { order += "EndProcess_"; }; + this.testee.TryProcessMessage = m => + { + order += "MsgProcessed_"; + return false; + }; + + this.StartTestee(); + this.testee.ProcessMessage(message); + + order.Should().Be("StartTx_TxMessageAccepted_MsgProcessed_EndProcess_TxDispose_"); + } + + [Test] + public void WhenMessageProcessingThrowsException_ThenTransactionIsNotCompleted() + { + var message = new Mock().Object; + + this.SetuptransactionOrderTracking(message); + + this.testee.EndProcessMessage = (m, e) => { order += "EndProcess_"; }; + this.testee.TryProcessMessage = m => + { + order += "MsgProcessed_"; + throw new Exception(); + }; + + this.StartTestee(); + this.testee.ProcessMessage(message); + + order.Should().Be("StartTx_TxMessageAccepted_MsgProcessed_EndProcess_TxDispose_"); + } + + [Test] + public void WhenStoppedBeforeIncrementingCounter_MessageIsNotProcessedAndTransactionRollbacked() + { + var message = new Mock().Object; + + this.SetuptransactionOrderTracking(message); + + this.testee.EndProcessMessage = (m, e) => { order += "EndProcess_"; }; + this.testee.TryProcessMessage = m => + { + order += "MsgProcessed_"; + return true; + }; + + this.StartTestee(); + this.testee.Stop(); + this.testee.ProcessMessage(message); + + order.Should().Be(""); + } + + [Test] + public void WhenDisposed_SessionIsReleased() + { + var message = new Mock().Object; + + this.SetuptransactionOrderTracking(message); + + this.testee.EndProcessMessage = (m, e) => { }; + this.testee.TryProcessMessage = m => true; + + this.StartTestee(); + this.testee.Stop(); + this.testee.Dispose(); + + this.sessionFactoryMock.Verify(sf => sf.Release(this.session.Object)); + } + + [Test] + [Ignore] + public void WhenConsumerIsCreated_AndPurgeOnStartup_ThenDestinationIsPurged() + { + const string Destination = "anyqueue"; + + this.testee.PurgeOnStartup = true; + this.StartTestee(TransactionSettings.Default); + this.SetupGetQueue(this.session, Destination); + + this.testee.CreateMessageConsumer(Destination); + + this.purger.Verify(p => p.Purge(this.session.Object, It.Is(d => d.QueueName.Contains(Destination)))); + } + + [Test] + [Ignore] + public void WhenConsumerIsCreated_AndNotPurgeOnStartup_ThenDestinationIsNotPurged() + { + const string Destination = "anyqueue"; + + this.testee.PurgeOnStartup = false; + this.StartTestee(TransactionSettings.Default); + this.SetupGetQueue(this.session, Destination); + + this.testee.CreateMessageConsumer(Destination); + + this.purger.Verify(p => p.Purge(this.session.Object, It.Is(d => d.QueueName.Contains(Destination))), Times.Never()); + } + + private void SetuptransactionOrderTracking(IMessage message) + { + var transactionScopeMock = new Mock(); + + transactionScopeMock.Setup(tx => tx.Complete()).Callback(() => this.order += "TxComplete_"); + transactionScopeMock.Setup(tx => tx.MessageAccepted(message)).Callback(() => this.order += "TxMessageAccepted_"); + transactionScopeMock.Setup(tx => tx.Dispose()).Callback(() => this.order += "TxDispose_"); + + this.transactionScopeFactoryMock.Setup( + f => f.CreateNewTransactionScope(It.IsAny(), It.IsAny())) + .Returns(transactionScopeMock.Object) + .Callback((t, s) => this.order += "StartTx_"); + } + + private void StartTestee() + { + var txSettings = TransactionSettings.Default; + txSettings.IsTransactional = false; + txSettings.DontUseDistributedTransactions = false; + txSettings.IsolationLevel = IsolationLevel.Serializable; + + StartTestee(txSettings); + } + + private void StartTestee(TransactionSettings transactionSettings) + { + this.session = this.SetupCreateSession(); + this.testee.Start(transactionSettings); + } + + private IQueue SetupGetQueue(Mock sessionMock, string queue) + { + var destinationMock = new Mock(); + sessionMock.Setup(s => s.GetQueue(queue)).Returns(destinationMock.Object); + destinationMock.Setup(destination => destination.QueueName).Returns(queue); + return destinationMock.Object; + } + + + + private Mock SetupCreateSession() + { + var sessionMock = new Mock { DefaultValue = DefaultValue.Mock }; + this.sessionFactoryMock.Setup(c => c.GetSession()).Returns(sessionMock.Object); + return sessionMock; + } + + private void SetupMapMessageToTransportMessage(IMessage messageMock, TransportMessage transportMessage) + { + this.activeMqMessageMapperMock.Setup(m => m.CreateTransportMessage(messageMock)).Returns(transportMessage); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/TransactionScopes/ActiveMqTransactionTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/TransactionScopes/ActiveMqTransactionTests.cs new file mode 100644 index 00000000000..91dd31f4a53 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/TransactionScopes/ActiveMqTransactionTests.cs @@ -0,0 +1,66 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.Receivers.TransactionScopes +{ + using Apache.NMS; + using Moq; + + using NServiceBus.Transports.ActiveMQ.Receivers.TransactionsScopes; + + using NUnit.Framework; + + using NServiceBus.Transports.ActiveMQ.SessionFactories; + + [TestFixture] + public class ActiveMqTransactionTests + { + [Test] + public void WhenCreated_ThenSessionIsSetForCurrentThread() + { + var sessionFactoryMock = new Mock(); + var session = new Mock().Object; + + var testee = new ActiveMqTransaction(sessionFactoryMock.Object, session); + + sessionFactoryMock.Verify(sf => sf.SetSessionForCurrentThread(session)); + sessionFactoryMock.Verify(sf => sf.RemoveSessionForCurrentThread(), Times.Never()); + } + + [Test] + public void WhenDisposed_ThenSessionIsReleasedForCurrentThread() + { + var sessionFactoryMock = new Mock(); + var session = new Mock().Object; + + var testee = new ActiveMqTransaction(sessionFactoryMock.Object, session); + testee.Dispose(); + + sessionFactoryMock.Verify(sf => sf.RemoveSessionForCurrentThread()); + } + + [Test] + public void WhenCompletedAndDisposed_ThenSessionIsCommit_AndNotRollbacked() + { + var sessionFactoryMock = new Mock(); + var sessionMock = new Mock(); + + var testee = new ActiveMqTransaction(sessionFactoryMock.Object, sessionMock.Object); + testee.Complete(); + testee.Dispose(); + + sessionMock.Verify(s => s.Commit()); + sessionMock.Verify(s => s.Rollback(), Times.Never()); + } + + [Test] + public void WhenDisposed_ThenSessionIsRollbacked() + { + var sessionFactoryMock = new Mock(); + var sessionMock = new Mock(); + + var testee = new ActiveMqTransaction(sessionFactoryMock.Object, sessionMock.Object); + testee.Dispose(); + + sessionMock.Verify(s => s.Rollback()); + sessionMock.Verify(s => s.Commit(), Times.Never()); + } + } +} diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/TransactionScopes/DTCTransactionScopeTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/TransactionScopes/DTCTransactionScopeTests.cs new file mode 100644 index 00000000000..49b64f1b9b8 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/TransactionScopes/DTCTransactionScopeTests.cs @@ -0,0 +1,70 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.Receivers.TransactionScopes +{ + using System; + using System.Transactions; + using FluentAssertions; + using Moq; + + using NServiceBus.Transports.ActiveMQ.Receivers.TransactionsScopes; + + using NUnit.Framework; + + using NServiceBus.Transports.ActiveMQ.SessionFactories; + + [TestFixture] + public class DTCTransactionScopeTests + { + private Mock sesstionFactoryMock; + + [SetUp] + public void SetUp() + { + this.sesstionFactoryMock = new Mock(); + } + + [Test] + public void WhenCreated_ThenNewTransactionIsStarted() + { + using (var tx = new DTCTransactionScope(null, new TransactionOptions(), this.sesstionFactoryMock.Object)) + { + Transaction.Current.Should().NotBeNull(); + + tx.Complete(); + } + } + + [Test] + public void WhenCompleted_ThenTransactionShouldBeCommited() + { + var transactionStatus = TransactionStatus.InDoubt; + + using (var tx = new DTCTransactionScope(null, new TransactionOptions(), this.sesstionFactoryMock.Object)) + { + Transaction.Current.TransactionCompleted += + (s, e) => transactionStatus = e.Transaction.TransactionInformation.Status; + + tx.Complete(); + } + + transactionStatus.Should().Be(TransactionStatus.Committed); + } + + [Test] + public void WhenDisposedButNotCommited_ThenTransactionShouldBeAbortedAndExceptionThrown() + { + var transactionStatus = TransactionStatus.InDoubt; + + Action action = () => + { + using (var tx = new DTCTransactionScope(null, new TransactionOptions(), this.sesstionFactoryMock.Object)) + { + Transaction.Current.TransactionCompleted += + (s, e) => transactionStatus = e.Transaction.TransactionInformation.Status; + } + }; + + action.ShouldThrow(); + transactionStatus.Should().Be(TransactionStatus.Aborted); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/TransactionScopes/NoTransactionScopeTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/TransactionScopes/NoTransactionScopeTests.cs new file mode 100644 index 00000000000..9daefeffee5 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/Receivers/TransactionScopes/NoTransactionScopeTests.cs @@ -0,0 +1,24 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.Receivers.TransactionScopes +{ + using Apache.NMS; + using Moq; + + using NServiceBus.Transports.ActiveMQ.Receivers.TransactionsScopes; + + using NUnit.Framework; + + [TestFixture] + public class NoTransactionScopeTests + { + [Test] + public void WhenMessageIsAccepted_ThisItIsAcknowledged() + { + var messageMock = new Mock(); + var testee = new NoTransactionScope(); + + testee.MessageAccepted(messageMock.Object); + + messageMock.Verify(m => m.Acknowledge()); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SessionFactories/ActiveMqTransactionSessionFactoryTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SessionFactories/ActiveMqTransactionSessionFactoryTest.cs new file mode 100644 index 00000000000..64a7215da52 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SessionFactories/ActiveMqTransactionSessionFactoryTest.cs @@ -0,0 +1,96 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.SessionFactories +{ + using System.Threading; + using System.Threading.Tasks; + using Apache.NMS; + using FluentAssertions; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ.SessionFactories; + + [TestFixture] + public class ActiveMqTransactionSessionFactoryTest + { + private ActiveMqTransactionSessionFactory testee; + private PooledSessionFactoryMock pooledPooledSessionFactoryMock; + + [SetUp] + public void SetUp() + { + this.pooledPooledSessionFactoryMock = new PooledSessionFactoryMock(); + this.testee = new ActiveMqTransactionSessionFactory(this.pooledPooledSessionFactoryMock); + } + + [Test] + public void EachGetSessionShouldRequestASessionFromThePooledSessionFactory() + { + var expectedSessions = this.pooledPooledSessionFactoryMock.EnqueueNewSessions(2); + + var session1 = this.testee.GetSession(); + var session2 = this.testee.GetSession(); + + session1.Should().BeSameAs(expectedSessions[0]); + session2.Should().BeSameAs(expectedSessions[1]); + } + + [Test] + public void OnReleaseSessionsShouldBeReleasedtoThePooledSessionFactory() + { + this.pooledPooledSessionFactoryMock.EnqueueNewSessions(1); + + var session = this.testee.GetSession(); + this.testee.Release(session); + + this.pooledPooledSessionFactoryMock.sessions.Should().Contain(session); + } + + [Test] + public void WhenSessionIsPinnedForThread_ItShouldBeReusedOnNextGetSession() + { + this.pooledPooledSessionFactoryMock.EnqueueNewSessions(1); + + var session1 = this.testee.GetSession(); + this.testee.SetSessionForCurrentThread(session1); + + var session2 = this.testee.GetSession(); + + session1.Should().BeSameAs(session2); + } + + [Test] + public void WhenSessionIsUnpinnedForThread_ANewOneShouldBeReturnedOnNextGetSession() + { + this.pooledPooledSessionFactoryMock.EnqueueNewSessions(2); + + var session1 = this.testee.GetSession(); + this.testee.SetSessionForCurrentThread(session1); + this.testee.RemoveSessionForCurrentThread(); + + var session2 = this.testee.GetSession(); + + session1.Should().NotBeSameAs(session2); + } + + [Test] + public void WhenSessionIsPinnedForThread_ANewOneShouldBeReturnedOnAnotherThread() + { + this.pooledPooledSessionFactoryMock.EnqueueNewSessions(2); + + ISession session2 = null; + var autoResetEvent = new AutoResetEvent(false); + + var session1 = this.testee.GetSession(); + this.testee.SetSessionForCurrentThread(session1); + + + Task.Factory.StartNew( + () => + { + session2 = this.testee.GetSession(); + autoResetEvent.Set(); + }); + + autoResetEvent.WaitOne(1000).Should().BeTrue(reason: "Task was not finished!"); + session1.Should().NotBeSameAs(session2); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SessionFactories/DtcTransactionSessionFactoryTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SessionFactories/DtcTransactionSessionFactoryTest.cs new file mode 100644 index 00000000000..c68458c40fe --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SessionFactories/DtcTransactionSessionFactoryTest.cs @@ -0,0 +1,118 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.SessionFactories +{ + using System.Transactions; + using Apache.NMS; + using FluentAssertions; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ.SessionFactories; + + [TestFixture] + public class DtcTransactionSessionFactoryTest + { + private DTCTransactionSessionFactory testee; + private PooledSessionFactoryMock pooledPooledSessionFactoryMock; + + [SetUp] + public void SetUp() + { + this.pooledPooledSessionFactoryMock = new PooledSessionFactoryMock(); + this.testee = new DTCTransactionSessionFactory(this.pooledPooledSessionFactoryMock); + } + + [Test] + public void WhenSessionIsRequested_OneFromThePoolesSessionFactoryIsReturned() + { + var expectedSessions = this.pooledPooledSessionFactoryMock.EnqueueNewSessions(1); + + var session = this.testee.GetSession(); + + session.Should().BeSameAs(expectedSessions[0]); + } + + [Test] + public void WhenSessionIsReleased_ItIsReturnedToThePooledSessionFactory() + { + this.pooledPooledSessionFactoryMock.EnqueueNewSessions(1); + + var session = this.testee.GetSession(); + this.testee.Release(session); + + this.pooledPooledSessionFactoryMock.sessions.Should().Contain(session); + } + + [Test] + public void GetSession_WhenInTransaction_ThenSameSessionIsUsed() + { + this.pooledPooledSessionFactoryMock.EnqueueNewSessions(1); + + ISession session1; + ISession session2; + + using (var tx = new TransactionScope()) + { + session1 = this.testee.GetSession(); + this.testee.Release(session1); + + session2 = this.testee.GetSession(); + this.testee.Release(session2); + + tx.Complete(); + } + + session1.Should().BeSameAs(session2); + } + + [Test] + public void GetSession_WhenInDifferentTransaction_ThenDifferentSessionAreUsed() + { + this.pooledPooledSessionFactoryMock.EnqueueNewSessions(2); + + ISession session1; + ISession session2; + + using (var tx1 = new TransactionScope()) + { + session1 = this.testee.GetSession(); + this.testee.Release(session1); + + using (var tx2 = new TransactionScope(TransactionScopeOption.RequiresNew)) + { + session2 = this.testee.GetSession(); + this.testee.Release(session2); + + tx2.Complete(); + } + + tx1.Complete(); + } + + session1.Should().NotBeSameAs(session2); + } + + [Test] + public void GetSession_WhenInDifferentCompletedTransaction_ThenSessionIsReused() + { + this.pooledPooledSessionFactoryMock.EnqueueNewSessions(1); + + ISession session1; + ISession session2; + using (var tx1 = new TransactionScope()) + { + session1 = this.testee.GetSession(); + this.testee.Release(session1); + + tx1.Complete(); + } + + using (var tx2 = new TransactionScope()) + { + session2 = this.testee.GetSession(); + this.testee.Release(session2); + + tx2.Complete(); + } + + session1.Should().BeSameAs(session2); + } + } +} diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SessionFactories/PooledSessionFactoryMock.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SessionFactories/PooledSessionFactoryMock.cs new file mode 100644 index 00000000000..525d0edc08d --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SessionFactories/PooledSessionFactoryMock.cs @@ -0,0 +1,51 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.SessionFactories +{ + using System.Collections.Generic; + using Apache.NMS; + using Moq; + using NServiceBus.Transports.ActiveMQ.SessionFactories; + + internal class PooledSessionFactoryMock : ISessionFactory + { + public readonly Queue sessions = new Queue(); + + public List EnqueueNewSessions(int count) + { + var result = new List(); + + for (int i = 0; i < count; i++ ) + { + var session = new Mock().Object; + this.sessions.Enqueue(session); + result.Add(session); + } + + return result; + } + + public ISession GetSession() + { + return this.sessions.Dequeue(); + } + + public void Release(ISession session) + { + this.sessions.Enqueue(session); + } + + public void SetSessionForCurrentThread(ISession session) + { + throw new System.NotImplementedException(); + } + + public void RemoveSessionForCurrentThread() + { + throw new System.NotImplementedException(); + } + + public void Dispose() + { + throw new System.NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SessionFactories/PooledSessionFactoryTest.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SessionFactories/PooledSessionFactoryTest.cs new file mode 100644 index 00000000000..8b3a7560569 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SessionFactories/PooledSessionFactoryTest.cs @@ -0,0 +1,75 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests.SessionFactories +{ + using System.Collections.Generic; + using Apache.NMS; + using FluentAssertions; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ.SessionFactories; + + [TestFixture] + public class PooledSessionFactoryTest + { + private Mock connectionFactoryMock; + + private PooledSessionFactory testee; + + private IDictionary connectionForSession; + + [SetUp] + public void SetUp() + { + this.connectionForSession = new Dictionary(); + this.connectionFactoryMock = new Mock(); + this.connectionFactoryMock.Setup(cf => cf.CreateConnection()).Returns(this.CreateConnectionMock); + + this.testee = new PooledSessionFactory(this.connectionFactoryMock.Object); + } + + [Test] + public void WhenGettingTwoSession_TheyShouldNotBeSame() + { + var session1 = this.testee.GetSession(); + var session2 = this.testee.GetSession(); + + session1.Should().NotBeSameAs(session2); + } + + [Test] + public void WhenGettingTwoSession_EachShouldHaveItsOwnConnection() + { + var session1 = this.testee.GetSession(); + var session2 = this.testee.GetSession(); + + this.connectionForSession[session1].Should().NotBeSameAs(this.connectionForSession[session2]); + } + + [Test] + public void WhenReleasingASession_ItShouldBeReusedOnNextGetSession() + { + var session1 = this.testee.GetSession(); + this.testee.Release(session1); + var session2 = this.testee.GetSession(); + + session1.Should().BeSameAs(session2); + } + + private IConnection CreateConnectionMock() + { + var connectionMock = new Mock(); + + connectionMock.Setup(c => c.CreateSession()).Returns(() => this.CreateSessionMock(connectionMock.Object)); + + return connectionMock.Object; + } + + private ISession CreateSessionMock(IConnection connection) + { + var session = new Mock().Object; + + this.connectionForSession[session] = connection; + + return session; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SubscriptionManagerTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SubscriptionManagerTests.cs new file mode 100644 index 00000000000..87508ffc6e4 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/SubscriptionManagerTests.cs @@ -0,0 +1,116 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests +{ + using System; + using System.Collections.Generic; + using FluentAssertions; + using Moq; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + + [TestFixture] + class SubscriptionManagerTests : ITopicSubscriptionListener + { + private const string DefaultTopic = "TheDefaultTopic"; + private readonly Type defaultType = typeof(SubscriptionManagerTests); + + private SubscriptionManager testee; + private Mock topicEvaluatorMock; + + private IList subscribedTopics; + private IList unsubscribedTopics; + + [SetUp] + public void SetUp() + { + this.subscribedTopics = new List(); + this.unsubscribedTopics = new List(); + + this.topicEvaluatorMock = new Mock(); + this.testee = new SubscriptionManager(this.topicEvaluatorMock.Object); + } + + [Test] + public void WhenATopicIsSubscribed_ThenItIsReturnedWhenSomeoneSubscribesLater() + { + this.SetupTypeToTopicMapping(defaultType, DefaultTopic); + + this.testee.Subscribe(defaultType, Address.Local); + var subscribedTopics = this.testee.Register(this); + + subscribedTopics.Should().Equal(new object[] { DefaultTopic }); + } + + [Test] + public void WhenATopicIsSubscribed_ThenTopicSubscribedShouldBeRaised() + { + this.SetupTypeToTopicMapping(defaultType, DefaultTopic); + + this.testee.Register(this); + this.testee.Subscribe(defaultType, Address.Local); + + this.subscribedTopics.Should().BeEquivalentTo(new object[] { DefaultTopic }); + } + + [Test] + public void WhenAnAlreadySubscribedTopicIsSubscribed_ThenGetTopicsShouldContainItOnce() + { + this.SetupTypeToTopicMapping(defaultType, DefaultTopic); + + this.testee.Subscribe(defaultType, Address.Local); + this.testee.Subscribe(defaultType, Address.Local); + var topics = this.testee.Register(this); + + topics.Should().Equal(new object[] { DefaultTopic }); + } + + [Test] + public void WhenAnAlreadySubscribedTopicIsSubscribed_ThenTopicSubscribedShouldBeRaised() + { + this.SetupTypeToTopicMapping(defaultType, DefaultTopic); + + this.testee.Subscribe(defaultType, Address.Local); + this.testee.Register(this); + this.testee.Subscribe(defaultType, Address.Local); + + this.subscribedTopics.Should().BeEmpty(); + } + + [Test] + public void WhenATopicIsUnsubscribed_ThenGetTopicsShouldNotContainItAnymore() + { + this.SetupTypeToTopicMapping(defaultType, DefaultTopic); + + this.testee.Subscribe(defaultType, Address.Local); + this.testee.Unsubscribe(defaultType, Address.Local); + var topics = this.testee.Register(this); + + topics.Should().BeEmpty(); + } + + [Test] + public void WhenATopicIsUnsubscribed_ThenTopicUnubscribedShouldBeRaised() + { + this.SetupTypeToTopicMapping(defaultType, DefaultTopic); + + this.testee.Subscribe(defaultType, Address.Local); + this.testee.Register(this); + this.testee.Unsubscribe(defaultType, Address.Local); + + this.unsubscribedTopics.Should().BeEquivalentTo(new object[] { DefaultTopic }); + } + + private void SetupTypeToTopicMapping(Type type, string Topic) + { + this.topicEvaluatorMock.Setup(te => te.GetTopicFromMessageType(type)).Returns(Topic); + } + public void TopicSubscribed(object sender, SubscriptionEventArgs e) + { + this.subscribedTopics.Add(e.Topic); + } + + public void TopicUnsubscribed(object sender, SubscriptionEventArgs e) + { + this.unsubscribedTopics.Add(e.Topic); + } + } +} diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/TopicEvaluatorTests.cs b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/TopicEvaluatorTests.cs new file mode 100644 index 00000000000..8e9172fd0af --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/TopicEvaluatorTests.cs @@ -0,0 +1,30 @@ +namespace NServiceBus.Transports.ActiveMQ.Tests +{ + using FluentAssertions; + using NUnit.Framework; + using NServiceBus.Transports.ActiveMQ; + + [TestFixture] + public class TopicEvaluatorTests + { + private TopicEvaluator testee; + + [SetUp] + public void SetUp() + { + this.testee = new TopicEvaluator(); + } + + [Test] + public void GetTopicFromMessageType_ShouldReturnTheFirstMessageTypePreceededByVirtualTopic() + { + var topic = this.testee.GetTopicFromMessageType(typeof(ISimpleMessage)); + + topic.Should().Be("VirtualTopic." + typeof(ISimpleMessage).FullName); + } + } + + public interface ISimpleMessage + { + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/packages.config b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/packages.config new file mode 100644 index 00000000000..abd5e8bf7ba --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ.Tests/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMQ.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMQ.cs new file mode 100644 index 00000000000..b5ce8187a0c --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMQ.cs @@ -0,0 +1,13 @@ +namespace NServiceBus +{ + using Transports; + + public class ActiveMQ : TransportDefinition + { + public ActiveMQ() + { + HasNativePubSubSupport = true; + HasSupportForCentralizedPubSub = true; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMQMessageDefer.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMQMessageDefer.cs new file mode 100644 index 00000000000..8192eebd762 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMQMessageDefer.cs @@ -0,0 +1,30 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System; + using System.Globalization; + using NServiceBus.Unicast.Queuing; + using NServiceBus.Unicast.Transport; + + public class ActiveMQMessageDefer : IDeferMessages + { + public ISendMessages MessageSender { get; set; } + + public void Defer(TransportMessage message, DateTime processAt, Address address) + { + message.Headers[ScheduledMessage.AMQ_SCHEDULED_DELAY] = + ((int)processAt.Subtract(DateTime.UtcNow).TotalMilliseconds).ToString(CultureInfo.InvariantCulture); + + this.MessageSender.Send(message, address); + } + + public void ClearDeferredMessages(string headerKey, string headerValue) + { + var selector = string.Format("{0} = '{1}'", ActiveMqMessageMapper.ConvertMessageHeaderKeyToActiveMQ(headerKey), headerValue); + + var message = ControlMessage.Create(Address.Local); + message.Headers[ActiveMqSchedulerManagement.ClearScheduledMessagesSelectorHeader] = selector; + + this.MessageSender.Send(message, Address.Local.SubScope(ActiveMqSchedulerManagement.SubScope)); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageDecoderPipeline.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageDecoderPipeline.cs new file mode 100644 index 00000000000..8218976ef03 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageDecoderPipeline.cs @@ -0,0 +1,36 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System; + using System.Collections.Generic; + using Apache.NMS; + using Decoders; + + public class ActiveMqMessageDecoderPipeline : IActiveMqMessageDecoderPipeline + { + private readonly IEnumerable decoders; + + public ActiveMqMessageDecoderPipeline() + : this(new IActiveMqMessageDecoder[] { new ControlMessageDecoder(), new TextMessageDecoder(), new ByteMessageDecoder(), }) + { + } + + public ActiveMqMessageDecoderPipeline(IEnumerable decoders) + { + this.decoders = decoders; + } + + public void Decode(TransportMessage transportMessage, IMessage message) + { + foreach (var decoder in this.decoders) + { + bool decoded = decoder.Decode(transportMessage, message); + if (decoded) + { + return; + } + } + + throw new InvalidOperationException("Unable to decode provided message body from ActiveMQ message."); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageDequeueStrategy.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageDequeueStrategy.cs new file mode 100644 index 00000000000..62e0bb42abc --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageDequeueStrategy.cs @@ -0,0 +1,88 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System; + using System.Collections.Generic; + using Receivers; + using SessionFactories; + using Unicast.Transport; + + /// + /// ActiveMq implementation if . + /// + public class ActiveMqMessageDequeueStrategy : IDequeueMessages + { + private readonly List messageReceivers = new List(); + private readonly INotifyMessageReceivedFactory notifyMessageReceivedFactory; + private readonly ISessionFactory sessionFactory; + + private Address address; + private TransactionSettings settings; + private Func tryProcessMessage; + private Action endProcessMessage; + + /// + /// Default constructor. + /// + /// + public ActiveMqMessageDequeueStrategy( + INotifyMessageReceivedFactory notifyMessageReceivedFactory, + ISessionFactory sessionFactory) + { + this.notifyMessageReceivedFactory = notifyMessageReceivedFactory; + this.sessionFactory = sessionFactory; + } + + /// + /// Initializes the . + /// + /// The address to listen on. + /// The to be used by . + /// Called when a message has been dequeued and is ready for processing. + /// Needs to be called by after the message has been processed regardless if the outcome was successful or not. + public void Init(Address address, TransactionSettings transactionSettings, Func tryProcessMessage, Action endProcessMessage) + { + settings = transactionSettings; + this.tryProcessMessage = tryProcessMessage; + this.endProcessMessage = endProcessMessage; + this.address = address; + } + + /// + /// Starts the dequeuing of message using the specified . + /// + /// Indicates the maximum concurrency level this is able to support. + public void Start(int maximumConcurrencyLevel) + { + for (int i = 0; i < maximumConcurrencyLevel; i++) + { + CreateAndStartMessageReceiver(); + } + } + + /// + /// Stops the dequeuing of messages. + /// + public void Stop() + { + foreach (INotifyMessageReceived messageReceiver in messageReceivers) + { + messageReceiver.Stop(); + } + + foreach (INotifyMessageReceived messageReceiver in messageReceivers) + { + messageReceiver.Dispose(); + } + + messageReceivers.Clear(); + sessionFactory.Dispose(); + } + + void CreateAndStartMessageReceiver() + { + INotifyMessageReceived receiver = notifyMessageReceivedFactory.CreateMessageReceiver(tryProcessMessage, endProcessMessage); + receiver.Start(address, settings); + messageReceivers.Add(receiver); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageEncoderPipeline.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageEncoderPipeline.cs new file mode 100644 index 00000000000..8ca432f9cb4 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageEncoderPipeline.cs @@ -0,0 +1,36 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System; + using System.Collections.Generic; + using Apache.NMS; + using Encoders; + + public class ActiveMqMessageEncoderPipeline : IActiveMqMessageEncoderPipeline + { + private readonly IEnumerable encoders; + + public ActiveMqMessageEncoderPipeline() + : this(new IActiveMqMessageEncoder[] { new ControlMessageEncoder(), new TextMessageEncoder(), new ByteMessageEncoder(), }) + { + } + + public ActiveMqMessageEncoderPipeline(IEnumerable encoders) + { + this.encoders = encoders; + } + + public IMessage Encode(TransportMessage message, ISession session) + { + foreach (var encoder in this.encoders) + { + IMessage encoded = encoder.Encode(message, session); + if (encoded != null) + { + return encoded; + } + } + + throw new InvalidOperationException("Unable to encode provided message to ActiveMQ message."); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageMapper.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageMapper.cs new file mode 100644 index 00000000000..f1be7ed8de1 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageMapper.cs @@ -0,0 +1,142 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Apache.NMS; + using Apache.NMS.Util; + + using NServiceBus.Serialization; + + public class ActiveMqMessageMapper : IActiveMqMessageMapper + { + public const string ErrorCodeKey = "ErrorCode"; + + readonly IMessageSerializer serializer; + + private readonly IMessageTypeInterpreter messageTypeInterpreter; + + private readonly IActiveMqMessageEncoderPipeline encoderPipeline; + + private readonly IActiveMqMessageDecoderPipeline decoderPipeline; + + public ActiveMqMessageMapper(IMessageSerializer serializer, IMessageTypeInterpreter messageTypeInterpreter, IActiveMqMessageEncoderPipeline encoderPipeline, IActiveMqMessageDecoderPipeline decoderPipeline) + { + this.serializer = serializer; + this.messageTypeInterpreter = messageTypeInterpreter; + this.encoderPipeline = encoderPipeline; + this.decoderPipeline = decoderPipeline; + } + + public IMessage CreateJmsMessage(TransportMessage message, ISession session) + { + IMessage jmsmessage = this.encoderPipeline.Encode(message, session); + + // We only assign the correlation id because the message id is chosen by the broker. + jmsmessage.NMSCorrelationID = message.CorrelationId; + + if (message.TimeToBeReceived < TimeSpan.FromMilliseconds(uint.MaxValue)) + { + jmsmessage.NMSTimeToLive = message.TimeToBeReceived; + } + + if (message.Headers.ContainsKey(Headers.EnclosedMessageTypes)) + { + jmsmessage.NMSType = message.Headers[Headers.EnclosedMessageTypes].Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault(); + } + + jmsmessage.NMSDeliveryMode = message.Recoverable ? MsgDeliveryMode.Persistent : MsgDeliveryMode.NonPersistent; + + if (message.ReplyToAddress != null && message.ReplyToAddress != Address.Undefined) + { + jmsmessage.NMSReplyTo = SessionUtil.GetQueue(session, message.ReplyToAddress.Queue); + } + + foreach (var header in message.Headers) + { + jmsmessage.Properties[ConvertMessageHeaderKeyToActiveMQ(header.Key)] = header.Value; + } + + return jmsmessage; + } + + public TransportMessage CreateTransportMessage(IMessage message) + { + var headers = ExtractHeaders(message); + + var transportMessage = new TransportMessage(message.NMSMessageId, headers); + + this.decoderPipeline.Decode(transportMessage, message); + + var replyToAddress = message.NMSReplyTo == null + ? null + : new Address(message.NMSReplyTo.ToString(), string.Empty); + + transportMessage.ReplyToAddress = replyToAddress; + transportMessage.CorrelationId = message.NMSCorrelationID; + transportMessage.TimeToBeReceived = message.NMSTimeToLive; + transportMessage.Recoverable = message.NMSDeliveryMode == MsgDeliveryMode.Persistent; + + if (!transportMessage.Headers.ContainsKey(Headers.EnclosedMessageTypes)) + { + var type = this.messageTypeInterpreter.GetAssemblyQualifiedName(message.NMSType); + if (!string.IsNullOrEmpty(type)) + { + transportMessage.Headers[Headers.EnclosedMessageTypes] = type; + } + } + + if (!transportMessage.Headers.ContainsKey(Headers.ControlMessageHeader) + && message.Properties.Contains(ErrorCodeKey)) + { + transportMessage.Headers[Headers.ControlMessageHeader] = "true"; + transportMessage.Headers[Headers.ReturnMessageErrorCodeHeader] = + message.Properties[ErrorCodeKey].ToString(); + } + + if (!transportMessage.Headers.ContainsKey(Headers.NServiceBusVersion)) + { + transportMessage.Headers[Headers.NServiceBusVersion] = "4.0.0.0"; + } + + if (!transportMessage.Headers.ContainsKey(Headers.ContentType)) + { + transportMessage.Headers[Headers.ContentType] = this.serializer.ContentType; + } + + return transportMessage; + } + + static Dictionary ExtractHeaders(IMessage message) + { + var result = new Dictionary(); + + foreach (var key in message.Properties.Keys) + { + var keyString = (string) key; + if (keyString == ErrorCodeKey) + { + continue; + } + + result.Add(ConvertMessageHeaderKeyFromActiveMQ(keyString), message.Properties[keyString] != null + ? message.Properties[keyString] + .ToString() + : null); + } + + return result; + } + + public static string ConvertMessageHeaderKeyToActiveMQ(string headerKey) + { + return headerKey.Replace(".", "_DOT_").Replace("-", "_HYPHEN_"); + } + + public static string ConvertMessageHeaderKeyFromActiveMQ(string headerKey) + { + return headerKey.Replace("_DOT_", ".").Replace("_HYPHEN_", "-"); + } + + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessagePublisher.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessagePublisher.cs new file mode 100644 index 00000000000..141c25fd6b5 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessagePublisher.cs @@ -0,0 +1,28 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System; + using System.Collections.Generic; + using System.Linq; + + public class ActiveMqMessagePublisher : IPublishMessages + { + private readonly ITopicEvaluator topicEvaluator; + private readonly IMessageProducer messageProducer; + + public ActiveMqMessagePublisher(ITopicEvaluator topicEvaluator, IMessageProducer messageProducer) + { + this.topicEvaluator = topicEvaluator; + this.messageProducer = messageProducer; + } + + public bool Publish(TransportMessage message, IEnumerable eventTypes) + { + var eventType = eventTypes.First(); //we route on the first event for now + + var topic = this.topicEvaluator.GetTopicFromMessageType(eventType); + this.messageProducer.SendMessage(message, topic, "topic://"); + + return true; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageSender.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageSender.cs new file mode 100644 index 00000000000..fcd2e3939ff --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqMessageSender.cs @@ -0,0 +1,19 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using NServiceBus.Unicast.Queuing; + + public class ActiveMqMessageSender : ISendMessages + { + private readonly IMessageProducer messageProducer; + + public ActiveMqMessageSender(IMessageProducer messageProducer) + { + this.messageProducer = messageProducer; + } + + public void Send(TransportMessage message, Address address) + { + this.messageProducer.SendMessage(message, address.Queue, "queue://"); + } + } +} diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqQueueCreator.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqQueueCreator.cs new file mode 100644 index 00000000000..f90605365bc --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqQueueCreator.cs @@ -0,0 +1,10 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + public class ActiveMqQueueCreator : ICreateQueues + { + public void CreateQueueIfNecessary(Address address, string account) + { + // no op + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqSchedulerManagement.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqSchedulerManagement.cs new file mode 100644 index 00000000000..a676bcd5081 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqSchedulerManagement.cs @@ -0,0 +1,62 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System.Threading; + using System.Threading.Tasks; + using NServiceBus.Satellites; + + public class ActiveMqSchedulerManagement : ISatellite + { + public const string SubScope = "ActiveMqSchedulerManagement"; + public const string ClearScheduledMessagesSelectorHeader = "ClearScheduledMessagesSelector"; + + private CancellationTokenSource cancellationTokenSource; + private Task task; + + public ActiveMqSchedulerManagement() + { + Disabled = true; + } + + public ActiveMqSchedulerManagementJobProcessor ActiveMqSchedulerManagementJobProcessor { get; set; } + + public Address InputAddress + { + get { return Address.Local.SubScope(SubScope); } + } + + public bool Disabled { get; set; } + + public void Start() + { + ActiveMqSchedulerManagementJobProcessor.Start(); + cancellationTokenSource = new CancellationTokenSource(); + var token = cancellationTokenSource.Token; + task = Task.Factory.StartNew(() => RunDeferredMessageCleanup(token), + token, TaskCreationOptions.LongRunning, + TaskScheduler.Current); + } + + public void Stop() + { + cancellationTokenSource.Cancel(); + task.Wait(cancellationTokenSource.Token); + + ActiveMqSchedulerManagementJobProcessor.Stop(); + } + + public bool Handle(TransportMessage message) + { + ActiveMqSchedulerManagementJobProcessor.HandleTransportMessage(message); + return true; + } + + private void RunDeferredMessageCleanup(CancellationToken token) + { + while (!token.IsCancellationRequested) + { + ActiveMqSchedulerManagementJobProcessor.ProcessAllJobs(token); + Thread.Sleep(100); + } + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqSchedulerManagementCommands.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqSchedulerManagementCommands.cs new file mode 100644 index 00000000000..11b34a71e05 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqSchedulerManagementCommands.cs @@ -0,0 +1,82 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System; + using System.Transactions; + using Apache.NMS; + using SessionFactories; + + public class ActiveMqSchedulerManagementCommands : IActiveMqSchedulerManagementCommands + { + private readonly TimeSpan DeleteTaskMaxIdleTime = TimeSpan.FromSeconds(10); + private ISession consumerSession; + public ISessionFactory SessionFactory { get; set; } + + public void Start() + { + this.consumerSession = this.SessionFactory.GetSession(); + } + + public void Stop() + { + this.SessionFactory.Release(this.consumerSession); + } + + public void RequestDeferredMessages(IDestination browseDestination) + { + var session = this.SessionFactory.GetSession(); + var amqSchedulerManagementDestionation = + session.GetTopic(ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION); + + using (var producer = session.CreateProducer(amqSchedulerManagementDestionation)) + { + var request = session.CreateMessage(); + request.Properties[ScheduledMessage.AMQ_SCHEDULER_ACTION] = ScheduledMessage.AMQ_SCHEDULER_ACTION_BROWSE; + request.NMSReplyTo = browseDestination; + producer.Send(request); + } + } + + public ActiveMqSchedulerManagementJob CreateActiveMqSchedulerManagementJob(string selector) + { + var temporaryDestination = this.consumerSession.CreateTemporaryTopic(); + var consumer = this.consumerSession.CreateConsumer( + temporaryDestination, + selector); + return new ActiveMqSchedulerManagementJob(consumer, temporaryDestination, DateTime.Now + this.DeleteTaskMaxIdleTime); + } + + public void DisposeJob(ActiveMqSchedulerManagementJob job) + { + job.Consumer.Dispose(); + this.consumerSession.DeleteDestination(job.Destination); + } + + public void ProcessJob(ActiveMqSchedulerManagementJob job) + { + IMessage message = job.Consumer.ReceiveNoWait(); + while (message != null) + { + this.RemoveDeferredMessages(message.Properties[ScheduledMessage.AMQ_SCHEDULED_ID]); + + job.ExprirationDate = DateTime.Now + this.DeleteTaskMaxIdleTime; + message = job.Consumer.ReceiveNoWait(); + } + } + + private void RemoveDeferredMessages(object id) + { + using (var tx = new TransactionScope(TransactionScopeOption.Suppress)) + { + using (var producer = this.consumerSession.CreateProducer(this.consumerSession.GetTopic(ScheduledMessage.AMQ_SCHEDULER_MANAGEMENT_DESTINATION))) + { + var remove = this.consumerSession.CreateMessage(); + remove.Properties[ScheduledMessage.AMQ_SCHEDULER_ACTION] = ScheduledMessage.AMQ_SCHEDULER_ACTION_REMOVE; + remove.Properties[ScheduledMessage.AMQ_SCHEDULED_ID] = id; + producer.Send(remove); + } + + tx.Complete(); + } + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqSchedulerManagementJob.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqSchedulerManagementJob.cs new file mode 100644 index 00000000000..ac9914d781d --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqSchedulerManagementJob.cs @@ -0,0 +1,19 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System; + using Apache.NMS; + + public class ActiveMqSchedulerManagementJob + { + public ActiveMqSchedulerManagementJob(IMessageConsumer consumer, IDestination temporaryDestination, DateTime expirationDate) + { + this.Consumer = consumer; + this.Destination = temporaryDestination; + this.ExprirationDate = expirationDate; + } + + public IMessageConsumer Consumer { get; set; } + public IDestination Destination { get; set; } + public DateTime ExprirationDate { get; set; } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqSchedulerManagementJobProcessor.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqSchedulerManagementJobProcessor.cs new file mode 100644 index 00000000000..f6766a4472b --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ActiveMqSchedulerManagementJobProcessor.cs @@ -0,0 +1,71 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Linq; + using System.Threading; + + public class ActiveMqSchedulerManagementJobProcessor + { + private readonly IActiveMqSchedulerManagementCommands activeMqSchedulerManagementCommands; + private readonly ConcurrentDictionary jobs = + new ConcurrentDictionary(); + + public ActiveMqSchedulerManagementJobProcessor(IActiveMqSchedulerManagementCommands activeMqSchedulerManagementCommands) + { + this.activeMqSchedulerManagementCommands = activeMqSchedulerManagementCommands; + } + + public void Start() + { + this.activeMqSchedulerManagementCommands.Start(); + } + + public void Stop() + { + this.DeleteJobs(this.jobs.Keys); + this.activeMqSchedulerManagementCommands.Stop(); + } + + public bool HandleTransportMessage(TransportMessage message) + { + var job = this.activeMqSchedulerManagementCommands.CreateActiveMqSchedulerManagementJob( + message.Headers[ActiveMqSchedulerManagement.ClearScheduledMessagesSelectorHeader]); + + this.activeMqSchedulerManagementCommands.RequestDeferredMessages(job.Destination); + this.jobs[job] = job; + + return true; + } + + public void ProcessAllJobs(CancellationToken token) + { + foreach (var job in this.jobs.Keys.ToList()) + { + if (token.IsCancellationRequested) + { + return; + } + activeMqSchedulerManagementCommands.ProcessJob(job); + } + + RemoveExpiredJobs(); + } + + private void RemoveExpiredJobs() + { + this.DeleteJobs(this.jobs.Keys.Where(j => DateTime.Now > j.ExprirationDate)); + } + + private void DeleteJobs(IEnumerable jobs) + { + foreach (var job in jobs.ToList()) + { + ActiveMqSchedulerManagementJob jobValue; + this.jobs.TryRemove(job, out jobValue); + this.activeMqSchedulerManagementCommands.DisposeJob(job); + } + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Config/ActiveMQTransportConfigurer.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Config/ActiveMQTransportConfigurer.cs new file mode 100644 index 00000000000..d9f28e64a37 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Config/ActiveMQTransportConfigurer.cs @@ -0,0 +1,171 @@ +namespace NServiceBus.Transports.ActiveMQ.Config +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Security.Cryptography; + using System.Text; + using Apache.NMS; + using Apache.NMS.ActiveMQ; + using Apache.NMS.Policies; + + using NServiceBus.Config; + using NServiceBus.Transports.ActiveMQ.Receivers.TransactionsScopes; + using NServiceBus.Unicast.Queuing.Installers; + using Receivers; + + using SessionFactories; + using Settings; + using Unicast.Subscriptions; + using MessageProducer = ActiveMQ.MessageProducer; + + /// + /// Default configuration for ActiveMQ + /// + public class ActiveMqTransportConfigurer : ConfigureTransport, IFinalizeConfiguration + { + private static Dictionary connectionConfiguration; + + private const string UriKey = "ServerUrl"; + + private const string ResourceManagerIdKey = "ResourceManagerId"; + + protected override void InternalConfigure(Configure config, string brokerUri) + { + connectionConfiguration = this.Parse(brokerUri); + + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + + config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + config.Configurer.ConfigureComponent(() => new ActiveMqMessageDecoderPipeline(), DependencyLifecycle.InstancePerCall); + config.Configurer.ConfigureComponent(() => new ActiveMqMessageEncoderPipeline(), DependencyLifecycle.InstancePerCall); + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(p => p.ConsumerName, NServiceBus.Configure.EndpointName); + config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + + InfrastructureServices.RegisterServiceFor(typeof(NoConfigRequiredAutoSubscriptionStrategy),DependencyLifecycle.InstancePerCall); + + EndpointInputQueueCreator.Enabled = true; + } + + public void FinalizeConfiguration() + { + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(p => p.PurgeOnStartup, ConfigurePurging.PurgeRequested); + + if (!SettingsHolder.Get("Transactions.Enabled")) + { + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + NServiceBus.Configure.Component(DependencyLifecycle.SingleInstance) + .ConfigureProperty(p => p.Disabled, false); + NServiceBus.Configure.Component(DependencyLifecycle.SingleInstance); + NServiceBus.Configure.Component(DependencyLifecycle.SingleInstance); + + RegisterNoneTransactionSessionFactory(connectionConfiguration[UriKey]); + } + else + { + var transportConfig = NServiceBus.Configure.GetConfigSection(); + + if (SettingsHolder.Get("Transactions.SuppressDistributedTransactions")) + { + RegisterActiveMQManagedTransactionSessionFactory(transportConfig, connectionConfiguration[UriKey]); + } + else + { + RegisterDTCManagedTransactionSessionFactory(transportConfig, connectionConfiguration); + } + } + } + + private Dictionary Parse(string brokerUri) + { + var parts = brokerUri.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); + return parts.ToDictionary( + p => p.Split('=')[0].Trim(), + p => p.Substring(p.IndexOf("=", StringComparison.OrdinalIgnoreCase) + 1).Trim(), + StringComparer.OrdinalIgnoreCase); + } + + private static void RegisterNoneTransactionSessionFactory(string brokerUri) + { + var connectionFactory = new ConnectionFactory(brokerUri) + { + AcknowledgementMode = AcknowledgementMode.IndividualAcknowledge, + AsyncSend = true + }; + var sessionFactory = new PooledSessionFactory(connectionFactory); + + NServiceBus.Configure.Component(() => sessionFactory, DependencyLifecycle.SingleInstance); + } + + private static void RegisterActiveMQManagedTransactionSessionFactory(TransportConfig transportConfig, string brokerUri) + { + var connectionFactory = new ConnectionFactory(brokerUri) + { + AcknowledgementMode = AcknowledgementMode.Transactional, + RedeliveryPolicy = new RedeliveryPolicy { MaximumRedeliveries = transportConfig.MaxRetries, BackOffMultiplier = 0, UseExponentialBackOff = false } + }; + var pooledSessionFactory = new PooledSessionFactory(connectionFactory); + var sessionFactory = new ActiveMqTransactionSessionFactory(pooledSessionFactory); + + NServiceBus.Configure.Component(() => sessionFactory, DependencyLifecycle.SingleInstance); + } + + private static void RegisterDTCManagedTransactionSessionFactory(TransportConfig transportConfig, Dictionary connectionConfiguration) + { + NetTxConnection.ConfiguredResourceManagerId = connectionConfiguration.ContainsKey(ResourceManagerIdKey) + ? new Guid(connectionConfiguration[ResourceManagerIdKey]) + : DefaultResourceManagerId; + var connectionFactory = new NetTxConnectionFactory(connectionConfiguration[UriKey]) + { + AcknowledgementMode = AcknowledgementMode.Transactional, + RedeliveryPolicy = new RedeliveryPolicy { MaximumRedeliveries = transportConfig.MaxRetries, BackOffMultiplier = 0, UseExponentialBackOff = false } + }; + var pooledSessionFactory = new PooledSessionFactory(connectionFactory); + var sessionFactory = new DTCTransactionSessionFactory(pooledSessionFactory); + + NServiceBus.Configure.Component(() => sessionFactory, DependencyLifecycle.SingleInstance); + } + + protected override string ExampleConnectionStringForErrorMessage + { + get { return "ServerUrl=activemq:tcp://localhost:61616; ResourceManagerId=2f2c3321-f251-4975-802d-11fc9d9e5e37"; } + } + + public static Guid DefaultResourceManagerId + { + get + { + var resourceManagerId = "ActiveMQ" + Address.Local + "-" + NServiceBus.Configure.DefineEndpointVersionRetriever(); + return DeterministicGuidBuilder(resourceManagerId); + } + } + + static Guid DeterministicGuidBuilder(string input) + { + //use MD5 hash to get a 16-byte hash of the string + using (var provider = new MD5CryptoServiceProvider()) + { + byte[] inputBytes = Encoding.Default.GetBytes(input); + byte[] hashBytes = provider.ComputeHash(inputBytes); + //generate a guid from the hash: + return new Guid(hashBytes); + } + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Config/ActiveMqTransport.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Config/ActiveMqTransport.cs new file mode 100644 index 00000000000..3c576175d67 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Config/ActiveMqTransport.cs @@ -0,0 +1,178 @@ +namespace NServiceBus.Features +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Security.Cryptography; + using System.Text; + using Apache.NMS; + using Apache.NMS.ActiveMQ; + using Apache.NMS.Policies; + using Config; + using Transports; + using Transports.ActiveMQ; + using Transports.ActiveMQ.Receivers; + using Transports.ActiveMQ.Receivers.TransactionsScopes; + using Transports.ActiveMQ.SessionFactories; + using Unicast.Queuing.Installers; + using Settings; + using MessageProducer = Transports.ActiveMQ.MessageProducer; + + /// + /// Default configuration for ActiveMQ + /// + public class ActiveMqTransport : ConfigureTransport + { + public override void Initialize() + { + if (!SettingsHolder.GetOrDefault("ScaleOut.UseSingleBrokerQueue")) + { + Address.InitializeLocalAddress(Address.Local.Queue + "." + Address.Local.Machine); + } + + var connectionString = SettingsHolder.Get("NServiceBus.Transport.ConnectionString"); + + var connectionConfiguration = Parse(connectionString); + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + + NServiceBus.Configure.Component(DependencyLifecycle.SingleInstance); + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + NServiceBus.Configure.Component(() => new ActiveMqMessageDecoderPipeline(), DependencyLifecycle.InstancePerCall); + NServiceBus.Configure.Component(() => new ActiveMqMessageEncoderPipeline(), DependencyLifecycle.InstancePerCall); + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(p => p.ConsumerName, NServiceBus.Configure.EndpointName); + NServiceBus.Configure.Component(DependencyLifecycle.SingleInstance); + NServiceBus.Configure.Component(DependencyLifecycle.SingleInstance); + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(p => p.PurgeOnStartup, ConfigurePurging.PurgeRequested); + + if (!SettingsHolder.Get("Transactions.Enabled")) + { + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + NServiceBus.Configure.Component(DependencyLifecycle.SingleInstance) + .ConfigureProperty(p => p.Disabled, false); + NServiceBus.Configure.Component(DependencyLifecycle.SingleInstance); + NServiceBus.Configure.Component(DependencyLifecycle.SingleInstance); + + RegisterNoneTransactionSessionFactory(connectionConfiguration[UriKey]); + } + else + { + var transportConfig = NServiceBus.Configure.GetConfigSection(); + + var maxRetries = transportConfig == null ? 6 : transportConfig.MaxRetries + 1; + + if (SettingsHolder.Get("Transactions.SuppressDistributedTransactions")) + { + RegisterActiveMQManagedTransactionSessionFactory(maxRetries, connectionConfiguration[UriKey]); + } + else + { + RegisterDTCManagedTransactionSessionFactory(maxRetries, connectionConfiguration); + } + } + } + + protected override void InternalConfigure(Configure config) + { + Enable(); + } + + protected override string ExampleConnectionStringForErrorMessage + { + get { return "ServerUrl=activemq:tcp://localhost:61616; ResourceManagerId=2f2c3321-f251-4975-802d-11fc9d9e5e37"; } + } + + Dictionary Parse(string brokerUri) + { + var parts = brokerUri.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); + return parts.ToDictionary( + p => p.Split('=')[0].Trim(), + p => p.Substring(p.IndexOf("=", StringComparison.OrdinalIgnoreCase) + 1).Trim(), + StringComparer.OrdinalIgnoreCase); + } + + static void RegisterNoneTransactionSessionFactory(string brokerUri) + { + var connectionFactory = new ConnectionFactory(brokerUri) + { + AcknowledgementMode = AcknowledgementMode.IndividualAcknowledge, + AsyncSend = true + }; + var sessionFactory = new PooledSessionFactory(connectionFactory); + + NServiceBus.Configure.Component(() => sessionFactory, DependencyLifecycle.SingleInstance); + } + + static void RegisterActiveMQManagedTransactionSessionFactory(int maxRetries, string brokerUri) + { + var connectionFactory = new ConnectionFactory(brokerUri) + { + AcknowledgementMode = AcknowledgementMode.Transactional, + RedeliveryPolicy = new RedeliveryPolicy { MaximumRedeliveries = maxRetries, BackOffMultiplier = 0, UseExponentialBackOff = false } + }; + var pooledSessionFactory = new PooledSessionFactory(connectionFactory); + var sessionFactory = new ActiveMqTransactionSessionFactory(pooledSessionFactory); + + NServiceBus.Configure.Component(() => sessionFactory, DependencyLifecycle.SingleInstance); + } + + static void RegisterDTCManagedTransactionSessionFactory(int maxRetries, Dictionary connectionConfiguration) + { + NetTxConnection.ConfiguredResourceManagerId = connectionConfiguration.ContainsKey(ResourceManagerIdKey) + ? new Guid(connectionConfiguration[ResourceManagerIdKey]) + : DefaultResourceManagerId; + var connectionFactory = new NetTxConnectionFactory(connectionConfiguration[UriKey]) + { + AcknowledgementMode = AcknowledgementMode.Transactional, + RedeliveryPolicy = new RedeliveryPolicy { MaximumRedeliveries = maxRetries, BackOffMultiplier = 0, UseExponentialBackOff = false } + }; + var pooledSessionFactory = new PooledSessionFactory(connectionFactory); + var sessionFactory = new DTCTransactionSessionFactory(pooledSessionFactory); + + NServiceBus.Configure.Component(() => sessionFactory, DependencyLifecycle.SingleInstance); + } + + + static Guid DefaultResourceManagerId + { + get + { + var resourceManagerId = "ActiveMQ" + Address.Local + "-" + NServiceBus.Configure.DefineEndpointVersionRetriever(); + return DeterministicGuidBuilder(resourceManagerId); + } + } + + static Guid DeterministicGuidBuilder(string input) + { + //use MD5 hash to get a 16-byte hash of the string + using (var provider = new MD5CryptoServiceProvider()) + { + byte[] inputBytes = Encoding.Default.GetBytes(input); + byte[] hashBytes = provider.ComputeHash(inputBytes); + //generate a guid from the hash: + return new Guid(hashBytes); + } + } + + + const string UriKey = "ServerUrl"; + + const string ResourceManagerIdKey = "ResourceManagerId"; + + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Decoders/ByteMessageDecoder.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Decoders/ByteMessageDecoder.cs new file mode 100644 index 00000000000..4d5ba30c7eb --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Decoders/ByteMessageDecoder.cs @@ -0,0 +1,27 @@ +namespace NServiceBus.Transports.ActiveMQ.Decoders +{ + using Apache.NMS; + + public class ByteMessageDecoder : IActiveMqMessageDecoder + { + public bool Decode(TransportMessage transportMessage, IMessage message) + { + var decoded = message as IBytesMessage; + + if (decoded != null) + { + // currently there is an issue in active mq NMS, accessing the content property + // multiple times will return different results + byte[] content = decoded.Content; + if (content != null) + { + transportMessage.Body = content; + } + + return true; + } + + return false; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Decoders/ControlMessageDecoder.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Decoders/ControlMessageDecoder.cs new file mode 100644 index 00000000000..178547ba38a --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Decoders/ControlMessageDecoder.cs @@ -0,0 +1,27 @@ +namespace NServiceBus.Transports.ActiveMQ.Decoders +{ + using Apache.NMS; + + public class ControlMessageDecoder : IActiveMqMessageDecoder + { + public bool Decode(TransportMessage transportMessage, IMessage message) + { + if (message.IsControlMessage()) + { + var decoded = (IBytesMessage)message; + + // currently there is an issue in active mq NMS, accessing the content property + // multiple times will return different results + byte[] content = decoded.Content; + if (content != null) + { + transportMessage.Body = content; + } + + return true; + } + + return false; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Decoders/TextMessageDecoder.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Decoders/TextMessageDecoder.cs new file mode 100644 index 00000000000..48c89d7d033 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Decoders/TextMessageDecoder.cs @@ -0,0 +1,25 @@ +namespace NServiceBus.Transports.ActiveMQ.Decoders +{ + using System.Text; + using Apache.NMS; + + public class TextMessageDecoder : IActiveMqMessageDecoder + { + public bool Decode(TransportMessage transportMessage, IMessage message) + { + var decoded = message as ITextMessage; + + if (decoded != null) + { + if (decoded.Text != null) + { + transportMessage.Body = Encoding.UTF8.GetBytes(decoded.Text); + } + + return true; + } + + return false; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/DestinationEvaluator.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/DestinationEvaluator.cs new file mode 100644 index 00000000000..8b97953fdc9 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/DestinationEvaluator.cs @@ -0,0 +1,33 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using Apache.NMS; + using Apache.NMS.ActiveMQ.Commands; + using Apache.NMS.Util; + + public class DestinationEvaluator : IDestinationEvaluator + { + private static string AddPrefix(string destination, string destinationPrefix) + { + return destination.StartsWith(destinationPrefix) || (destination.StartsWith("temp-" + destinationPrefix)) + ? destination + : destinationPrefix + destination; + } + + public IDestination GetDestination(ISession session, string destination, string prefix) + { + destination = AddPrefix(destination, prefix); + + if (destination.StartsWith("temp-queue://")) + { + return new ActiveMQTempQueue(destination.Substring("temp-queue://".Length)); + } + + if (destination.StartsWith("temp-topic://")) + { + return new ActiveMQTempTopic(destination.Substring("temp-topic://".Length)); + } + + return SessionUtil.GetDestination(session, destination); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Encoders/ByteMessageEncoder.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Encoders/ByteMessageEncoder.cs new file mode 100644 index 00000000000..7c02fd1c282 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Encoders/ByteMessageEncoder.cs @@ -0,0 +1,26 @@ +namespace NServiceBus.Transports.ActiveMQ.Encoders +{ + using Apache.NMS; + + public class ByteMessageEncoder : IActiveMqMessageEncoder + { + public IMessage Encode(TransportMessage message, ISession session) + { + string contentType = message.Headers[Headers.ContentType]; + + if (contentType == ContentTypes.Bson || contentType == ContentTypes.Binary) + { + IMessage encoded = session.CreateBytesMessage(); + + if (message.Body != null) + { + encoded = session.CreateBytesMessage(message.Body); + } + + return encoded; + } + + return null; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Encoders/ControlMessageEncoder.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Encoders/ControlMessageEncoder.cs new file mode 100644 index 00000000000..07e988b0c5e --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Encoders/ControlMessageEncoder.cs @@ -0,0 +1,25 @@ +namespace NServiceBus.Transports.ActiveMQ.Encoders +{ + using Apache.NMS; + using NServiceBus.Unicast.Transport; + + public class ControlMessageEncoder : IActiveMqMessageEncoder + { + public IMessage Encode(TransportMessage message, ISession session) + { + if (message.IsControlMessage()) + { + IMessage encoded = session.CreateBytesMessage(); + + if (message.Body != null) + { + encoded = session.CreateBytesMessage(message.Body); + } + + return encoded; + } + + return null; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Encoders/TextMessageEncoder.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Encoders/TextMessageEncoder.cs new file mode 100644 index 00000000000..69a1a4f7232 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Encoders/TextMessageEncoder.cs @@ -0,0 +1,28 @@ +namespace NServiceBus.Transports.ActiveMQ.Encoders +{ + using System.Text; + using Apache.NMS; + + public class TextMessageEncoder : IActiveMqMessageEncoder + { + public IMessage Encode(TransportMessage message, ISession session) + { + string contentType = message.Headers[Headers.ContentType]; + + if (contentType == ContentTypes.Json || contentType == ContentTypes.Xml) + { + IMessage encoded = session.CreateTextMessage(); + + if (message.Body != null) + { + string messageBody = Encoding.UTF8.GetString(message.Body); + encoded = session.CreateTextMessage(messageBody); + } + + return encoded; + } + + return null; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Fody.targets b/src/ActiveMQ/NServiceBus.ActiveMQ/Fody.targets new file mode 100644 index 00000000000..a668a51fc04 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Fody.targets @@ -0,0 +1,89 @@ + + + + + + $(NCrunchOriginalSolutionDir) + + + + + $(SolutionDir) + + + + + $(MSBuildProjectDirectory)\..\ + + + + + + + $(KeyOriginatorFile) + + + + + $(AssemblyOriginatorKeyFile) + + + + + + + + + + $(ProjectDir)$(IntermediateOutputPath) + Low + $(SignAssembly) + $(MSBuildThisFileDirectory) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/FodyWeavers.xml b/src/ActiveMQ/NServiceBus.ActiveMQ/FodyWeavers.xml new file mode 100644 index 00000000000..c6e1b7c8af7 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/FodyWeavers.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageDecoder.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageDecoder.cs new file mode 100644 index 00000000000..51244aef31c --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageDecoder.cs @@ -0,0 +1,14 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using Apache.NMS; + + public interface IActiveMqMessageDecoder + { + /// + /// Decodes a given message. + /// + /// The message to decode + /// true if decoded; false otherwise; + bool Decode(TransportMessage transportMessage, IMessage message); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageDecoderPipeline.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageDecoderPipeline.cs new file mode 100644 index 00000000000..5a2ebc9782b --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageDecoderPipeline.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using Apache.NMS; + + public interface IActiveMqMessageDecoderPipeline + { + void Decode(TransportMessage transportMessage, IMessage message); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageEncoder.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageEncoder.cs new file mode 100644 index 00000000000..2fe90b3e773 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageEncoder.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using Apache.NMS; + + public interface IActiveMqMessageEncoder + { + IMessage Encode(TransportMessage message, ISession session); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageEncoderPipeline.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageEncoderPipeline.cs new file mode 100644 index 00000000000..49baf92a6f4 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageEncoderPipeline.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using Apache.NMS; + + public interface IActiveMqMessageEncoderPipeline + { + IMessage Encode(TransportMessage message, ISession session); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageMapper.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageMapper.cs new file mode 100644 index 00000000000..7f141aab99d --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqMessageMapper.cs @@ -0,0 +1,11 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using Apache.NMS; + + public interface IActiveMqMessageMapper + { + IMessage CreateJmsMessage(TransportMessage message, ISession session); + + TransportMessage CreateTransportMessage(IMessage message); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqSchedulerManagementCommands.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqSchedulerManagementCommands.cs new file mode 100644 index 00000000000..b443aeef095 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/IActiveMqSchedulerManagementCommands.cs @@ -0,0 +1,14 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using Apache.NMS; + + public interface IActiveMqSchedulerManagementCommands + { + void Start(); + void Stop(); + void RequestDeferredMessages(IDestination browseDestination); + ActiveMqSchedulerManagementJob CreateActiveMqSchedulerManagementJob(string selector); + void DisposeJob(ActiveMqSchedulerManagementJob job); + void ProcessJob(ActiveMqSchedulerManagementJob job); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/IDestinationEvaluator.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/IDestinationEvaluator.cs new file mode 100644 index 00000000000..7133f1e75d5 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/IDestinationEvaluator.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using Apache.NMS; + + public interface IDestinationEvaluator + { + IDestination GetDestination(ISession session, string destination, string prefix); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/IMessageProducer.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/IMessageProducer.cs new file mode 100644 index 00000000000..d6467c1a7c7 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/IMessageProducer.cs @@ -0,0 +1,7 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + public interface IMessageProducer + { + void SendMessage(TransportMessage message, string destination, string destinationPrefix); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/IMessageTypeInterpreter.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/IMessageTypeInterpreter.cs new file mode 100644 index 00000000000..66e11921327 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/IMessageTypeInterpreter.cs @@ -0,0 +1,7 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + public interface IMessageTypeInterpreter + { + string GetAssemblyQualifiedName(string nmsType); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/INotifyTopicSubscriptions.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/INotifyTopicSubscriptions.cs new file mode 100644 index 00000000000..cc21fcd2c2c --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/INotifyTopicSubscriptions.cs @@ -0,0 +1,10 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System.Collections.Generic; + + public interface INotifyTopicSubscriptions + { + IEnumerable Register(ITopicSubscriptionListener listener); + void Unregister(ITopicSubscriptionListener listener); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ITopicEvaluator.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ITopicEvaluator.cs new file mode 100644 index 00000000000..63fbe53d8ae --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ITopicEvaluator.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System; + + public interface ITopicEvaluator + { + string GetTopicFromMessageType(Type type); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ITopicSubscriptionListener.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ITopicSubscriptionListener.cs new file mode 100644 index 00000000000..b6078dee4a4 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ITopicSubscriptionListener.cs @@ -0,0 +1,8 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + public interface ITopicSubscriptionListener + { + void TopicSubscribed(object sender, SubscriptionEventArgs e); + void TopicUnsubscribed(object sender, SubscriptionEventArgs e); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/MessageExtensions.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/MessageExtensions.cs new file mode 100644 index 00000000000..3d6a48d9ca1 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/MessageExtensions.cs @@ -0,0 +1,21 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using Apache.NMS; + + /// + /// Extensions to make the usage if control messages easier + /// + internal static class MessageExtensions + { + /// + /// True if the transport message is a control message + /// + /// + /// + public static bool IsControlMessage(this IMessage message) + { + return message.Properties != null && + message.Properties.Contains(Headers.ControlMessageHeader); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/MessageProducer.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/MessageProducer.cs new file mode 100644 index 00000000000..a55d5eecd26 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/MessageProducer.cs @@ -0,0 +1,43 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using SessionFactories; + + public class MessageProducer : IMessageProducer + { + private readonly IActiveMqMessageMapper activeMqMessageMapper; + private readonly ISessionFactory sessionFactory; + private readonly IDestinationEvaluator destinationEvaluator; + + public MessageProducer( + ISessionFactory sessionFactory, + IActiveMqMessageMapper activeMqMessageMapper, + IDestinationEvaluator destinationEvaluator) + { + this.sessionFactory = sessionFactory; + this.activeMqMessageMapper = activeMqMessageMapper; + this.destinationEvaluator = destinationEvaluator; + } + + public void SendMessage(TransportMessage message, string destination, string destinationPrefix) + { + var session = this.sessionFactory.GetSession(); + try + { + var jmsMessage = this.activeMqMessageMapper.CreateJmsMessage(message, session); + + using (var producer = session.CreateProducer()) + { + producer.Send(this.destinationEvaluator.GetDestination(session, destination, destinationPrefix), jmsMessage); + } + + // We assign here the Id to the underlying id which was chosen by the broker. + // TODO: Why do we need this daniel/remo? + //message.Id = jmsMessage.NMSMessageId; + } + finally + { + this.sessionFactory.Release(session); + } + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/MessageTypeInterpreter.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/MessageTypeInterpreter.cs new file mode 100644 index 00000000000..ddc8600c6c7 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/MessageTypeInterpreter.cs @@ -0,0 +1,32 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System; + + public class MessageTypeInterpreter : IMessageTypeInterpreter + { + public string GetAssemblyQualifiedName(string nmsType) + { + if (string.IsNullOrEmpty(nmsType)) + { + return string.Empty; + } + + var type = Type.GetType(nmsType); + if (type != null) + { + return type.AssemblyQualifiedName; + } + + foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies()) + { + type = assembly.GetType(nmsType); + if (type != null) + { + return type.AssemblyQualifiedName; + } + } + + return nmsType; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/NServiceBus.Transports.ActiveMQ.csproj b/src/ActiveMQ/NServiceBus.ActiveMQ/NServiceBus.Transports.ActiveMQ.csproj new file mode 100644 index 00000000000..9deb5a084cf --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/NServiceBus.Transports.ActiveMQ.csproj @@ -0,0 +1,145 @@ + + + + + Debug + AnyCPU + {6FC67824-B465-4796-828E-76E5BF4F0D54} + Library + Properties + NServiceBus.Transports.ActiveMQ + NServiceBus.Transports.ActiveMQ + v4.0 + 512 + true + ..\..\NServiceBus.snk + ..\..\..\ + true + ..\..\..\packages\Fody.1.13.8.0 + + + true + full + false + ..\..\..\binaries\ + DEBUG;TRACE + prompt + 4 + ..\..\..\binaries\NServiceBus.Transports.ActiveMQ.xml + + + pdbonly + true + ..\..\..\binaries\ + TRACE + prompt + 4 + ..\..\..\binaries\NServiceBus.Transports.ActiveMQ.xml + + + + ..\..\..\packages\Apache.NMS.1.5.1\lib\net40\Apache.NMS.dll + + + False + ..\..\..\lib\Apache.NMS-CustomBuild\Apache.NMS.ActiveMQ.dll + + + + + + + + + + + + + + Designer + + + + + + + + + + Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Code + + + + + + + + + + + + + {dd48b2d0-e996-412d-9157-821ed8b17a9d} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + + + + + \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Properties/AssemblyInfo.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..6749e909c2d --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("NServiceBus.ActiveMQ")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyProduct("NServiceBus.ActiveMQ")] +[assembly: AssemblyCompany("NServiceBus")] +[assembly: AssemblyConfiguration("release")] +[assembly: AssemblyInformationalVersion("4.0.0-alpha0")] +[assembly: ComVisible(false)] +[assembly: CLSCompliantAttribute(true)] + diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/ActiveMqMessageReceiver.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/ActiveMqMessageReceiver.cs new file mode 100644 index 00000000000..2ba99ebe0c8 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/ActiveMqMessageReceiver.cs @@ -0,0 +1,78 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers +{ + using System; + using Apache.NMS; + using NServiceBus.Logging; + using Unicast.Transport; + + public class ActiveMqMessageReceiver : INotifyMessageReceived + { + private readonly IConsumeEvents eventConsumer; + private readonly IProcessMessages messageProcessor; + private IMessageConsumer defaultConsumer; + private bool disposed; + + public ActiveMqMessageReceiver( + IConsumeEvents eventConsumer, + IProcessMessages messageProcessor) + { + this.eventConsumer = eventConsumer; + this.messageProcessor = messageProcessor; + } + + ~ActiveMqMessageReceiver() + { + Dispose(false); + } + + public void Dispose() + { + Dispose(true); + + GC.SuppressFinalize(this); + } + + public void Start(Address address, TransactionSettings transactionSettings) + { + this.messageProcessor.Start(transactionSettings); + + this.defaultConsumer = this.messageProcessor.CreateMessageConsumer("queue://" + address.Queue); + this.defaultConsumer.Listener += this.messageProcessor.ProcessMessage; + + if (address == Address.Local) + { + this.eventConsumer.Start(); + } + } + + public void Stop() + { + this.messageProcessor.Stop(); + this.eventConsumer.Stop(); + this.defaultConsumer.Listener -= this.messageProcessor.ProcessMessage; + } + + protected virtual void Dispose(bool disposing) + { + if (this.disposed) return; + + try + { + if (disposing) + { + this.eventConsumer.Dispose(); + this.defaultConsumer.Dispose(); + this.messageProcessor.Dispose(); + } + } + catch (Exception ex) + { + Logger.Warn("Failed to dispose the receiver",ex); + } + + disposed = true; + } + + static ILog Logger = LogManager.GetLogger(typeof(ActiveMqMessageReceiver)); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/ActiveMqPurger.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/ActiveMqPurger.cs new file mode 100644 index 00000000000..302ce5511ba --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/ActiveMqPurger.cs @@ -0,0 +1,28 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers +{ + using System.Collections.Generic; + using Apache.NMS; + + public class ActiveMqPurger : IActiveMqPurger + { + private readonly HashSet destinations; + + public ActiveMqPurger() + { + this.destinations = new HashSet(); + } + + public void Purge(ISession session, IDestination destination) + { + lock (this.destinations) + { + if (!this.destinations.Contains(destination)) + { + session.DeleteDestination(destination); + + this.destinations.Add(destination); + } + } + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/EventConsumer.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/EventConsumer.cs new file mode 100644 index 00000000000..845ea0a700c --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/EventConsumer.cs @@ -0,0 +1,112 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers +{ + using System; + using System.Collections.Generic; + using Apache.NMS; + + public class EventConsumer : ITopicSubscriptionListener, IConsumeEvents + { + private readonly IDictionary topicConsumers = new Dictionary(); + private readonly INotifyTopicSubscriptions notifyTopicSubscriptions; + private readonly IProcessMessages messageProcessor; + private bool disposed; + private string consumerName; + private string internalConsumerName; + + public EventConsumer(INotifyTopicSubscriptions notifyTopicSubscriptions, IProcessMessages messageProcessor) + { + this.notifyTopicSubscriptions = notifyTopicSubscriptions; + this.messageProcessor = messageProcessor; + } + + ~EventConsumer() + { + this.Dispose(false); + } + + public string ConsumerName + { + get + { + return this.consumerName; + } + set + { + this.consumerName = value; + this.internalConsumerName = value.Replace('.', '-'); + } + } + + public void Start() + { + this.SubscribeTopics(); + } + + public void Stop() + { + this.notifyTopicSubscriptions.Unregister(this); + foreach (var messageConsumer in this.topicConsumers) + { + messageConsumer.Value.Listener -= this.messageProcessor.ProcessMessage; + } + } + + public void Dispose() + { + this.Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (this.disposed) + { + return; + } + + if (disposing) + { + foreach (var messageConsumer in this.topicConsumers) + { + messageConsumer.Value.Dispose(); + } + } + + this.disposed = true; + } + + public void TopicUnsubscribed(object sender, SubscriptionEventArgs e) + { + IMessageConsumer consumer; + if (this.topicConsumers.TryGetValue(e.Topic, out consumer)) + { + consumer.Dispose(); + this.topicConsumers.Remove(e.Topic); + } + } + + public void TopicSubscribed(object sender, SubscriptionEventArgs e) + { + string topic = e.Topic; + this.Subscribe(topic); + } + + private void SubscribeTopics() + { + lock (this.notifyTopicSubscriptions) + { + foreach (string topic in this.notifyTopicSubscriptions.Register(this)) + { + this.Subscribe(topic); + } + } + } + + private void Subscribe(string topic) + { + var consumer = this.messageProcessor.CreateMessageConsumer(string.Format("queue://Consumer.{0}.{1}", this.internalConsumerName, topic)); + consumer.Listener += this.messageProcessor.ProcessMessage; + this.topicConsumers[topic] = consumer; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/IActiveMqPurger.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/IActiveMqPurger.cs new file mode 100644 index 00000000000..ae4c3011283 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/IActiveMqPurger.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers +{ + using Apache.NMS; + + public interface IActiveMqPurger + { + void Purge(ISession session, IDestination destination); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/IConsumeEvents.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/IConsumeEvents.cs new file mode 100644 index 00000000000..898bf44432f --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/IConsumeEvents.cs @@ -0,0 +1,10 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers +{ + using System; + + public interface IConsumeEvents : IDisposable + { + void Start(); + void Stop(); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/INotifyMessageReceived.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/INotifyMessageReceived.cs new file mode 100644 index 00000000000..46eea68b79c --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/INotifyMessageReceived.cs @@ -0,0 +1,12 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers +{ + using System; + using NServiceBus.Unicast.Transport.Transactional; + using Unicast.Transport; + + public interface INotifyMessageReceived : IDisposable + { + void Start(Address address, TransactionSettings settings); + void Stop(); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/INotifyMessageReceivedFactory.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/INotifyMessageReceivedFactory.cs new file mode 100644 index 00000000000..ec01216814c --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/INotifyMessageReceivedFactory.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers +{ + using System; + + public interface INotifyMessageReceivedFactory + { + INotifyMessageReceived CreateMessageReceiver(Func tryProcessMessage, Action endProcessMessage); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/IProcessMessages.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/IProcessMessages.cs new file mode 100644 index 00000000000..de03362ba41 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/IProcessMessages.cs @@ -0,0 +1,20 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers +{ + using System; + using Apache.NMS; + using Unicast.Transport; + + public interface IProcessMessages : IDisposable + { + Action EndProcessMessage { get; set; } + Func TryProcessMessage { get; set; } + + void ProcessMessage(IMessage message); + + void Start(TransactionSettings transactionSettings); + + void Stop(); + + IMessageConsumer CreateMessageConsumer(string destination); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/MessageProcessor.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/MessageProcessor.cs new file mode 100644 index 00000000000..ea6847c7f54 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/MessageProcessor.cs @@ -0,0 +1,153 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers +{ + using System; + using System.Threading; + using System.Transactions; + using Apache.NMS; + using Apache.NMS.ActiveMQ; + using Apache.NMS.Util; + + using TransactionsScopes; + + using SessionFactories; + + using Unicast.Transport; + + public class MessageProcessor : IProcessMessages + { + private readonly IActiveMqMessageMapper activeMqMessageMapper; + private readonly IActiveMqPurger purger; + private readonly ISessionFactory sessionFactory; + private readonly ITransactionScopeFactory transactionScopeFactory; + readonly AutoResetEvent resetEvent = new AutoResetEvent(true); + + private volatile bool stop; + private ISession session; + private TransactionSettings transactionSettings; + private bool disposed; + + public Action EndProcessMessage { get; set; } + public Func TryProcessMessage { get; set; } + public bool PurgeOnStartup { get; set; } + + + public MessageProcessor( + IActiveMqMessageMapper activeMqMessageMapper, + ISessionFactory sessionFactory, + IActiveMqPurger purger, + ITransactionScopeFactory transactionScopeFactory) + { + this.activeMqMessageMapper = activeMqMessageMapper; + this.sessionFactory = sessionFactory; + this.purger = purger; + this.transactionScopeFactory = transactionScopeFactory; + } + + ~MessageProcessor() + { + Dispose(false); + } + + public virtual void Start(TransactionSettings transactionSettings) + { + this.transactionSettings = transactionSettings; + session = sessionFactory.GetSession(); + } + + public void Stop() + { + stop = true; + resetEvent.WaitOne(); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + sessionFactory.Release(session); + } + + disposed = true; + } + + public void ProcessMessage(IMessage message) + { + if (stop) + { + return; + } + + try + { + resetEvent.Reset(); + + if (stop) + { + resetEvent.Set(); + return; + } + + using (var tx = transactionScopeFactory.CreateNewTransactionScope(transactionSettings, session)) + { + tx.MessageAccepted(message); + TransportMessage transportMessage = null; + Exception exception = null; + + try + { + transportMessage = activeMqMessageMapper.CreateTransportMessage(message); + if (TryProcessMessage(transportMessage)) + { + tx.Complete(); + } + } + catch (Exception e) + { + exception = e; + } + finally + { + EndProcessMessage(transportMessage, exception); + } + } + } + finally + { + resetEvent.Set(); + } + } + + public IMessageConsumer CreateMessageConsumer(string destination) + { + IDestination d = SessionUtil.GetDestination(session, destination); + this.PurgeIfNecessary(session, d); + var consumer = session.CreateConsumer(d); + ((MessageConsumer)consumer).CreateTransactionScopeForAsyncMessage = CreateTransactionScopeForAsyncMessage; + return consumer; + } + + private TransactionScope CreateTransactionScopeForAsyncMessage() + { + return transactionScopeFactory.CreateTransactionScopeForAsyncMessage(transactionSettings); + } + + private void PurgeIfNecessary(ISession session, IDestination destination) + { + if (PurgeOnStartup) + { + purger.Purge(session, destination); + } + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/NotifyMessageReceivedFactory.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/NotifyMessageReceivedFactory.cs new file mode 100644 index 00000000000..c8f7d57f7b5 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/NotifyMessageReceivedFactory.cs @@ -0,0 +1,23 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers +{ + using System; + + public class NotifyMessageReceivedFactory : INotifyMessageReceivedFactory + { + public string ConsumerName { get; set; } + + public INotifyMessageReceived CreateMessageReceiver(Func tryProcessMessage, Action endProcessMessage) + { + var messageProcessor = Configure.Instance.Builder.Build(); + messageProcessor.TryProcessMessage = tryProcessMessage; + messageProcessor.EndProcessMessage = endProcessMessage; + + var subscriptionManager = Configure.Instance.Builder.Build(); + var eventConsumer = new EventConsumer(subscriptionManager, messageProcessor) { ConsumerName = this.ConsumerName }; + + var messageReceiver = new ActiveMqMessageReceiver(eventConsumer, messageProcessor); + + return messageReceiver; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/ActiveMqTransaction.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/ActiveMqTransaction.cs new file mode 100644 index 00000000000..a995f1641d6 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/ActiveMqTransaction.cs @@ -0,0 +1,67 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers.TransactionsScopes +{ + using System; + + using Apache.NMS; + + using NServiceBus.Transports.ActiveMQ.SessionFactories; + + public class ActiveMqTransaction : ITransactionScope + { + private readonly ISessionFactory sessionFactory; + private readonly ISession session; + + bool disposed; + private bool doRollback = true; + + public ActiveMqTransaction(ISessionFactory sessionFactory, ISession session) + { + this.sessionFactory = sessionFactory; + this.session = session; + + this.sessionFactory.SetSessionForCurrentThread(this.session); + } + + public void MessageAccepted(IMessage message) + { + } + + public void Complete() + { + this.session.Commit(); + this.doRollback = false; + } + + public void Dispose() + { + this.Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (this.disposed) + { + return; + } + + if (disposing) + { + // Dispose managed resources. + if (this.doRollback) + { + this.session.Rollback(); + } + + this.sessionFactory.RemoveSessionForCurrentThread(); + } + + this.disposed = true; + } + + ~ActiveMqTransaction() + { + this.Dispose(false); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/DTCTransactionScope.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/DTCTransactionScope.cs new file mode 100644 index 00000000000..3318f2b779b --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/DTCTransactionScope.cs @@ -0,0 +1,67 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers.TransactionsScopes +{ + using System; + using System.Transactions; + + using Apache.NMS; + + using NServiceBus.Transports.ActiveMQ.SessionFactories; + + public class DTCTransactionScope : ITransactionScope + { + private readonly ISessionFactory sessionFactory; + + private readonly TransactionScope transactionScope; + private bool complete; + bool disposed; + + public DTCTransactionScope(ISession session, TransactionOptions transactionOptions, ISessionFactory sessionFactory) + { + this.sessionFactory = sessionFactory; + this.transactionScope = new TransactionScope(TransactionScopeOption.Required, transactionOptions); + this.sessionFactory.SetSessionForCurrentThread(session); + } + + public void Dispose() + { + this.Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (this.disposed) + { + return; + } + + if (disposing) + { + // Dispose managed resources. + this.sessionFactory.RemoveSessionForCurrentThread(); + this.transactionScope.Dispose(); + if (!this.complete) + { + throw new Exception(); + } + } + + this.disposed = true; + } + + ~DTCTransactionScope() + { + this.Dispose(false); + } + + public void MessageAccepted(IMessage message) + { + } + + public void Complete() + { + this.complete = true; + this.transactionScope.Complete(); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/ITransactionScope.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/ITransactionScope.cs new file mode 100644 index 00000000000..f1442db65e9 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/ITransactionScope.cs @@ -0,0 +1,12 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers.TransactionsScopes +{ + using System; + + using Apache.NMS; + + public interface ITransactionScope : IDisposable + { + void MessageAccepted(IMessage message); + void Complete(); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/ITransactionScopeFactory.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/ITransactionScopeFactory.cs new file mode 100644 index 00000000000..f9eda2bed48 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/ITransactionScopeFactory.cs @@ -0,0 +1,15 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers.TransactionsScopes +{ + using System.Transactions; + + using Apache.NMS; + + using NServiceBus.Unicast.Transport; + + public interface ITransactionScopeFactory + { + ITransactionScope CreateNewTransactionScope(TransactionSettings transactionSettings, ISession session); + + TransactionScope CreateTransactionScopeForAsyncMessage(TransactionSettings transactionSettings); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/NoTransactionScope.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/NoTransactionScope.cs new file mode 100644 index 00000000000..bcc43f12946 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/NoTransactionScope.cs @@ -0,0 +1,47 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers.TransactionsScopes +{ + using System; + + using Apache.NMS; + + public class NoTransactionScope : ITransactionScope + { + bool disposed; + + public void Dispose() + { + this.Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (this.disposed) + { + return; + } + + if (disposing) + { + // Dispose managed resources. + + } + + this.disposed = true; + } + + ~NoTransactionScope() + { + this.Dispose(false); + } + + public void MessageAccepted(IMessage message) + { + message.Acknowledge(); + } + + public void Complete() + { + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/TransactionScopeFactory.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/TransactionScopeFactory.cs new file mode 100644 index 00000000000..4e0722df76a --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/Receivers/TransactionsScopes/TransactionScopeFactory.cs @@ -0,0 +1,50 @@ +namespace NServiceBus.Transports.ActiveMQ.Receivers.TransactionsScopes +{ + using System.Transactions; + + using Apache.NMS; + + using NServiceBus.Transports.ActiveMQ.SessionFactories; + using NServiceBus.Unicast.Transport; + + public class TransactionScopeFactory : ITransactionScopeFactory + { + private readonly ISessionFactory sessionFactory; + + public TransactionScopeFactory(ISessionFactory sessionFactory) + { + this.sessionFactory = sessionFactory; + } + + public ITransactionScope CreateNewTransactionScope(TransactionSettings transactionSettings, ISession session) + { + if (!transactionSettings.IsTransactional) + { + return new NoTransactionScope(); + } + + if (transactionSettings.DontUseDistributedTransactions) + { + return new ActiveMqTransaction(this.sessionFactory, session); + } + + return new DTCTransactionScope(session, new TransactionOptions { IsolationLevel = transactionSettings.IsolationLevel, Timeout = transactionSettings.TransactionTimeout }, this.sessionFactory); + } + + public TransactionScope CreateTransactionScopeForAsyncMessage(TransactionSettings transactionSettings) + { + if (!transactionSettings.IsTransactional) + { + return null; + } + + if (transactionSettings.DontUseDistributedTransactions) + { + return null; + } + + return new TransactionScope(TransactionScopeOption.RequiresNew, + new TransactionOptions { IsolationLevel = transactionSettings.IsolationLevel, Timeout = transactionSettings.TransactionTimeout }); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/ScheduledMessage.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/ScheduledMessage.cs new file mode 100644 index 00000000000..ca9e458f76b --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/ScheduledMessage.cs @@ -0,0 +1,18 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + public static class ScheduledMessage + { + public const string AMQ_SCHEDULED_DELAY = "AMQ_SCHEDULED_DELAY"; + public const string AMQ_SCHEDULED_PERIOD = "AMQ_SCHEDULED_PERIOD"; + public const string AMQ_SCHEDULED_REPEAT = "AMQ_SCHEDULED_REPEAT"; + public const string AMQ_SCHEDULED_CRON = "AMQ_SCHEDULED_CRON"; + public const string AMQ_SCHEDULED_ID = "scheduledJobId"; + public const string AMQ_SCHEDULER_MANAGEMENT_DESTINATION = "ActiveMQ.Scheduler.Management"; + public const string AMQ_SCHEDULER_ACTION = "AMQ_SCHEDULER_ACTION"; + public const string AMQ_SCHEDULER_ACTION_BROWSE = "BROWSE"; + public const string AMQ_SCHEDULER_ACTION_REMOVE = "REMOVE"; + public const string AMQ_SCHEDULER_ACTION_REMOVEALL = "REMOVEALL"; + public const string AMQ_SCHEDULER_ACTION_START_TIME = "ACTION_START_TIME"; + public const string AMQ_SCHEDULER_ACTION_END_TIME = "ACTION_END_TIME"; + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/SessionFactories/ActiveMqTransactionSessionFactory.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/SessionFactories/ActiveMqTransactionSessionFactory.cs new file mode 100644 index 00000000000..3b2755bf289 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/SessionFactories/ActiveMqTransactionSessionFactory.cs @@ -0,0 +1,79 @@ +namespace NServiceBus.Transports.ActiveMQ.SessionFactories +{ + using System; + using System.Collections.Concurrent; + using System.Threading; + using Apache.NMS; + + public class ActiveMqTransactionSessionFactory : ISessionFactory + { + private readonly ISessionFactory pooledSessionFactory; + private readonly ConcurrentDictionary sessionsForThreads = new ConcurrentDictionary(); + bool disposed; + + public ActiveMqTransactionSessionFactory(ISessionFactory pooledSessionFactory) + { + this.pooledSessionFactory = pooledSessionFactory; + } + + public ISession GetSession() + { + ISession session; + if (this.sessionsForThreads.TryGetValue(Thread.CurrentThread.ManagedThreadId, out session)) + { + return session; + } + + return this.pooledSessionFactory.GetSession(); + } + + public void Release(ISession session) + { + if (this.sessionsForThreads.ContainsKey(Thread.CurrentThread.ManagedThreadId)) + { + return; + } + + session.Commit(); + this.pooledSessionFactory.Release(session); + } + + public void SetSessionForCurrentThread(ISession session) + { + this.sessionsForThreads.AddOrUpdate(Thread.CurrentThread.ManagedThreadId, session, (key, value) => session); + } + + public void RemoveSessionForCurrentThread() + { + ISession session; + this.sessionsForThreads.TryRemove(Thread.CurrentThread.ManagedThreadId, out session); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + // Dispose managed resources. + pooledSessionFactory.Dispose(); + } + + disposed = true; + } + + ~ActiveMqTransactionSessionFactory() + { + Dispose(false); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/SessionFactories/DTCTransactionSessionFactory.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/SessionFactories/DTCTransactionSessionFactory.cs new file mode 100644 index 00000000000..35b446d3227 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/SessionFactories/DTCTransactionSessionFactory.cs @@ -0,0 +1,102 @@ +namespace NServiceBus.Transports.ActiveMQ.SessionFactories +{ + using System; + using System.Collections.Concurrent; + using System.Transactions; + using Apache.NMS; + + public class DTCTransactionSessionFactory : ISessionFactory + { + private readonly ISessionFactory pooledSessionFactory; + private readonly ConcurrentDictionary sessionsForTransactions = new ConcurrentDictionary(); + private bool disposed; + + public DTCTransactionSessionFactory(ISessionFactory pooledSessionFactory) + { + this.pooledSessionFactory = pooledSessionFactory; + } + + public ISession GetSession() + { + if (Transaction.Current != null) + { + // Currently in case of DTC the consumer and produce of messages use an own session due to a bug in the ActiveMQ NMS client: + // https://issues.apache.org/jira/browse/AMQNET-405 . When this issue is resolved then we should return the same session within + // a DTC transaction to be able to use Single Phase Commits in case no other systems are involved in the transaction for better + // performance. + return this.sessionsForTransactions.GetOrAdd( + Transaction.Current.TransactionInformation.LocalIdentifier, id => this.GetSessionForTransaction()); + } + + return this.pooledSessionFactory.GetSession(); + } + + public void Release(ISession session) + { + if (Transaction.Current != null) + { + return; + } + + this.pooledSessionFactory.Release(session); + } + + private ISession GetSessionForTransaction() + { + var session = this.pooledSessionFactory.GetSession(); + + Transaction.Current.TransactionCompleted += (s, e) => this.ReleaseSessionForTransaction(e.Transaction); + + return session; + } + + private void ReleaseSessionForTransaction(Transaction transaction) + { + ISession session; + this.sessionsForTransactions.TryRemove(transaction.TransactionInformation.LocalIdentifier, out session); + this.pooledSessionFactory.Release(session); + } + + [ThreadStatic] + private static string transactionId; + + public virtual void SetSessionForCurrentThread(ISession session) + { + transactionId = Transaction.Current.TransactionInformation.LocalIdentifier; + this.sessionsForTransactions.TryAdd(transactionId, session); + } + + public virtual void RemoveSessionForCurrentThread() + { + ISession session; + this.sessionsForTransactions.TryRemove(transactionId, out session); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + // Dispose managed resources. + pooledSessionFactory.Dispose(); + } + + disposed = true; + } + + ~DTCTransactionSessionFactory() + { + Dispose(false); + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/SessionFactories/ISessionFactory.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/SessionFactories/ISessionFactory.cs new file mode 100644 index 00000000000..8a435cd08cf --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/SessionFactories/ISessionFactory.cs @@ -0,0 +1,16 @@ +namespace NServiceBus.Transports.ActiveMQ.SessionFactories +{ + using System; + using Apache.NMS; + + public interface ISessionFactory : IDisposable + { + ISession GetSession(); + + void Release(ISession session); + + void SetSessionForCurrentThread(ISession session); + + void RemoveSessionForCurrentThread(); + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/SessionFactories/PooledSessionFactory.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/SessionFactories/PooledSessionFactory.cs new file mode 100644 index 00000000000..dc0b3d83d73 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/SessionFactories/PooledSessionFactory.cs @@ -0,0 +1,85 @@ +namespace NServiceBus.Transports.ActiveMQ.SessionFactories +{ + using System; + using System.Collections.Concurrent; + using Apache.NMS; + + public class PooledSessionFactory : ISessionFactory + { + private readonly IConnectionFactory connectionFactory; + private readonly ConcurrentBag sessionPool = new ConcurrentBag(); + private readonly ConcurrentDictionary connections = new ConcurrentDictionary(); + private bool disposed; + + public PooledSessionFactory(IConnectionFactory connectionFactory) + { + this.connectionFactory = connectionFactory; + } + + ~PooledSessionFactory() + { + this.Dispose(false); + } + + public virtual ISession GetSession() + { + ISession session; + if (this.sessionPool.TryTake(out session)) + { + return session; + } + + return this.CreateNewSession(); + } + + public virtual void Release(ISession session) + { + this.sessionPool.Add(session); + } + + public virtual void SetSessionForCurrentThread(ISession session) + { + throw new NotSupportedException("Thread specific sessions are not supported by this implementation."); + } + + public virtual void RemoveSessionForCurrentThread() + { + throw new NotSupportedException("Thread specific sessions are not supported by this implementation."); + } + + protected ISession CreateNewSession() + { + var connection = this.connectionFactory.CreateConnection(); + connection.Start(); + + var session = connection.CreateSession(); + this.connections.TryAdd(session, connection); + + return session; + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + private void Dispose(bool disposing) + { + if (this.disposed) + { + return; + } + + if (disposing) + { + foreach (var connection in this.connections) + { + connection.Value.Close(); + } + } + + this.disposed = true; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/SubscriptionEventArgs.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/SubscriptionEventArgs.cs new file mode 100644 index 00000000000..74e3629898c --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/SubscriptionEventArgs.cs @@ -0,0 +1,14 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System; + + public class SubscriptionEventArgs : EventArgs + { + public SubscriptionEventArgs(string topic) + { + this.Topic = topic; + } + + public string Topic { get; private set; } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/SubscriptionManager.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/SubscriptionManager.cs new file mode 100644 index 00000000000..2aeca8e20d2 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/SubscriptionManager.cs @@ -0,0 +1,65 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System; + using System.Collections.Generic; + using NServiceBus.Unicast.Subscriptions; + + public class SubscriptionManager : INotifyTopicSubscriptions, IManageSubscriptions + { + private readonly ISet subscriptions = new HashSet(); + private readonly ITopicEvaluator topicEvaluator; + + private event EventHandler TopicSubscribed = delegate { }; + private event EventHandler TopicUnsubscribed = delegate { }; + + public SubscriptionManager(ITopicEvaluator topicEvaluator) + { + this.topicEvaluator = topicEvaluator; + } + + public IEnumerable Register(ITopicSubscriptionListener listener) + { + lock (subscriptions) + { + this.TopicSubscribed += listener.TopicSubscribed; + this.TopicUnsubscribed += listener.TopicUnsubscribed; + return new HashSet(this.subscriptions); + } + } + + public void Unregister(ITopicSubscriptionListener listener) + { + lock (subscriptions) + { + this.TopicSubscribed -= listener.TopicSubscribed; + this.TopicUnsubscribed -= listener.TopicUnsubscribed; + } + } + + public void Subscribe(Type eventType, Address publisherAddress) + { + var topic = this.topicEvaluator.GetTopicFromMessageType(eventType); + + lock (subscriptions) + { + if (this.subscriptions.Add(topic)) + { + this.TopicSubscribed(this, new SubscriptionEventArgs(topic)); + } + } + } + + public void Unsubscribe(Type eventType, Address publisherAddress) + { + var topic = this.topicEvaluator.GetTopicFromMessageType(eventType); + + lock (subscriptions) + { + if (this.subscriptions.Remove(topic)) + { + this.TopicUnsubscribed(this, new SubscriptionEventArgs(topic)); + } + } + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/TopicEvaluator.cs b/src/ActiveMQ/NServiceBus.ActiveMQ/TopicEvaluator.cs new file mode 100644 index 00000000000..088abc540d4 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/TopicEvaluator.cs @@ -0,0 +1,12 @@ +namespace NServiceBus.Transports.ActiveMQ +{ + using System; + + public class TopicEvaluator : ITopicEvaluator + { + public string GetTopicFromMessageType(Type type) + { + return "VirtualTopic." + type.FullName; + } + } +} \ No newline at end of file diff --git a/src/ActiveMQ/NServiceBus.ActiveMQ/packages.config b/src/ActiveMQ/NServiceBus.ActiveMQ/packages.config new file mode 100644 index 00000000000..60cb8510b65 --- /dev/null +++ b/src/ActiveMQ/NServiceBus.ActiveMQ/packages.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/AttributeAssemblies/AttributeAssemblies.sln b/src/AttributeAssemblies/AttributeAssemblies.sln deleted file mode 100644 index 06c2d1eaa17..00000000000 --- a/src/AttributeAssemblies/AttributeAssemblies.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Core", "NServiceBus.Core\NServiceBus.Core.csproj", "{ADE75574-EA8E-49ED-9AC6-F1CC54D25DB6}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NServiceBus.Core", "NServiceBus.Core", "{3387E847-04BA-4B91-9CAB-EB70C7340D97}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NServiceBus.Azure", "NServiceBus.Azure", "{C42312C5-6594-4909-9232-C8ED4376523D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Azure", "NServiceBus.Azure\NServiceBus.Azure.csproj", "{B95CAA46-809D-4387-B488-1EEDE804ADDE}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {ADE75574-EA8E-49ED-9AC6-F1CC54D25DB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ADE75574-EA8E-49ED-9AC6-F1CC54D25DB6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ADE75574-EA8E-49ED-9AC6-F1CC54D25DB6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ADE75574-EA8E-49ED-9AC6-F1CC54D25DB6}.Release|Any CPU.Build.0 = Release|Any CPU - {B95CAA46-809D-4387-B488-1EEDE804ADDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B95CAA46-809D-4387-B488-1EEDE804ADDE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B95CAA46-809D-4387-B488-1EEDE804ADDE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B95CAA46-809D-4387-B488-1EEDE804ADDE}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {ADE75574-EA8E-49ED-9AC6-F1CC54D25DB6} = {3387E847-04BA-4B91-9CAB-EB70C7340D97} - {B95CAA46-809D-4387-B488-1EEDE804ADDE} = {C42312C5-6594-4909-9232-C8ED4376523D} - EndGlobalSection -EndGlobal diff --git a/src/AttributeAssemblies/NServiceBus.Azure/NServiceBus.Azure.csproj b/src/AttributeAssemblies/NServiceBus.Azure/NServiceBus.Azure.csproj deleted file mode 100644 index 1a445211c12..00000000000 --- a/src/AttributeAssemblies/NServiceBus.Azure/NServiceBus.Azure.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {B95CAA46-809D-4387-B488-1EEDE804ADDE} - Library - Properties - NServiceBus.Azure - NServiceBus.Azure - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - \ No newline at end of file diff --git a/src/AttributeAssemblies/NServiceBus.Azure/Properties/AssemblyInfo.cs b/src/AttributeAssemblies/NServiceBus.Azure/Properties/AssemblyInfo.cs deleted file mode 100644 index ade93cdaf11..00000000000 --- a/src/AttributeAssemblies/NServiceBus.Azure/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("NServiceBus.Azure")] -[assembly: AssemblyDescription("The NServiceBus Implementation for Azure app fabric framework")] -[assembly: AssemblyVersion("3.1.0.0")] -[assembly: AssemblyFileVersion("3.1.0.0")] -[assembly: AssemblyCopyright("Copyright (c) NServiceBus 2007-2012")] -[assembly: AssemblyProduct("NServiceBus")] -[assembly: AssemblyCompany("NServiceBus")] -[assembly: AssemblyConfiguration("release")] -[assembly: AssemblyInformationalVersion("3.1.0.0")] -[assembly: ComVisible(false)] -[assembly: CLSCompliantAttribute(true)] - diff --git a/src/AttributeAssemblies/NServiceBus.Core/NServiceBus.Core.csproj b/src/AttributeAssemblies/NServiceBus.Core/NServiceBus.Core.csproj deleted file mode 100644 index 121169933e1..00000000000 --- a/src/AttributeAssemblies/NServiceBus.Core/NServiceBus.Core.csproj +++ /dev/null @@ -1,44 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {ADE75574-EA8E-49ED-9AC6-F1CC54D25DB6} - Library - Properties - NServiceBus.Core - NServiceBus.Core - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - \ No newline at end of file diff --git a/src/AttributeAssemblies/NServiceBus.Core/Properties/AssemblyInfo.cs b/src/AttributeAssemblies/NServiceBus.Core/Properties/AssemblyInfo.cs deleted file mode 100644 index df7c6bb2230..00000000000 --- a/src/AttributeAssemblies/NServiceBus.Core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Reflection; -using System.Runtime.InteropServices; - -[assembly: AssemblyTitle("NServiceBus.Core")] -[assembly: AssemblyDescription("The implementation for NServiceBus core functionality interfaces")] -[assembly: AssemblyVersion("3.1.0.0")] -[assembly: AssemblyFileVersion("3.1.0.0")] -[assembly: AssemblyCopyright("Copyright (c) NServiceBus 2007-2012")] -[assembly: AssemblyProduct("NServiceBus")] -[assembly: AssemblyCompany("NServiceBus")] -[assembly: AssemblyConfiguration("release")] -[assembly: AssemblyInformationalVersion("3.1.0.0")] -[assembly: ComVisible(false)] -[assembly: CLSCompliantAttribute(true)] - diff --git a/src/NServiceBus.Core.Tests/App.config b/src/NServiceBus.Core.Tests/App.config new file mode 100644 index 00000000000..f6742a570c1 --- /dev/null +++ b/src/NServiceBus.Core.Tests/App.config @@ -0,0 +1,37 @@ + + + +
    +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/NServiceBus.Core.Tests/AutomaticSubscriptions/AutoSubscriptionContext.cs b/src/NServiceBus.Core.Tests/AutomaticSubscriptions/AutoSubscriptionContext.cs new file mode 100644 index 00000000000..4d91af85184 --- /dev/null +++ b/src/NServiceBus.Core.Tests/AutomaticSubscriptions/AutoSubscriptionContext.cs @@ -0,0 +1,40 @@ +namespace NServiceBus.Core.Tests.AutomaticSubscriptions +{ + using System; + using System.Collections.Generic; + using NServiceBus.AutomaticSubscriptions; + using NUnit.Framework; + using Unicast; + using Unicast.Routing; + + public class AutoSubscriptionContext + { + [SetUp] + public void SetUp() + { + autoSubscriptionStrategy = new DefaultAutoSubscriptionStrategy + { + HandlerRegistry = new MessageHandlerRegistry(), + MessageRouter = new StaticMessageRouter(KnownMessageTypes()) + }; + } + + protected virtual IEnumerable KnownMessageTypes() + { + return new List(); + } + + protected void RegisterMessageHandlerType() + { + ((MessageHandlerRegistry)autoSubscriptionStrategy.HandlerRegistry).RegisterHandler(typeof(T)); + } + + protected void RegisterMessageType(Address address) + { + ((StaticMessageRouter)autoSubscriptionStrategy.MessageRouter).RegisterRoute(typeof(T),address); + } + + protected DefaultAutoSubscriptionStrategy autoSubscriptionStrategy; + + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/AutomaticSubscriptions/AutoSubscriptions.cs b/src/NServiceBus.Core.Tests/AutomaticSubscriptions/AutoSubscriptions.cs new file mode 100644 index 00000000000..987f4401de0 --- /dev/null +++ b/src/NServiceBus.Core.Tests/AutomaticSubscriptions/AutoSubscriptions.cs @@ -0,0 +1,13 @@ +namespace NServiceBus.Core.Tests.AutomaticSubscriptions +{ + using System; + using Unicast.Tests.Contexts; + using Rhino.Mocks; + using Saga; + + + + + + +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/AutomaticSubscriptions/When_autosubscribing_a_saga_that_handles_a_superclass_event.cs b/src/NServiceBus.Core.Tests/AutomaticSubscriptions/When_autosubscribing_a_saga_that_handles_a_superclass_event.cs new file mode 100644 index 00000000000..3fa929b6f5b --- /dev/null +++ b/src/NServiceBus.Core.Tests/AutomaticSubscriptions/When_autosubscribing_a_saga_that_handles_a_superclass_event.cs @@ -0,0 +1,52 @@ +namespace NServiceBus.Core.Tests.AutomaticSubscriptions +{ + using System; + using System.Collections.Generic; + using System.Linq; + using NUnit.Framework; + using Saga; + + [TestFixture] + public class When_autosubscribing_a_saga_that_handles_a_superclass_event : AutoSubscriptionContext + { + protected override IEnumerable KnownMessageTypes() + { + return new[] { typeof(EventWithParent), typeof(EventMessageBase) }; + } + [Test] + public void Should_autosubscribe_the_saga_messagehandler() + { + + var eventEndpointAddress = new Address("PublisherAddress", "localhost"); + + RegisterMessageType(eventEndpointAddress); + RegisterMessageHandlerType(); + + Assert.True(autoSubscriptionStrategy.GetEventsToSubscribe().Any(), "Saga event handler should be subscribed"); + } + + public class MySagaThatReactsOnASuperClassEvent : Saga, IAmStartedByMessages + { + public void Handle(EventMessageBase message) + { + throw new NotImplementedException(); + } + + + public class MySagaData : ContainSagaData + { + } + } + public class EventMessageBase : IEvent + { + + } + + + public class EventWithParent : EventMessageBase + { + + } + + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/AutomaticSubscriptions/When_starting_an_endpoint_containing_a_saga.cs b/src/NServiceBus.Core.Tests/AutomaticSubscriptions/When_starting_an_endpoint_containing_a_saga.cs new file mode 100644 index 00000000000..dca5f996685 --- /dev/null +++ b/src/NServiceBus.Core.Tests/AutomaticSubscriptions/When_starting_an_endpoint_containing_a_saga.cs @@ -0,0 +1,49 @@ +namespace NServiceBus.Core.Tests.AutomaticSubscriptions +{ + using System; + using System.Linq; + using NUnit.Framework; + using Saga; + using Unicast.Tests.Contexts; + + [TestFixture] + public class When_starting_an_endpoint_containing_a_saga : AutoSubscriptionContext + { + [Test] + public void Should_autosubscribe_the_saga_messagehandler_by_default() + { + var eventEndpointAddress = new Address("PublisherAddress", "localhost"); + + RegisterMessageType(eventEndpointAddress); + RegisterMessageHandlerType(); + + Assert.True(autoSubscriptionStrategy.GetEventsToSubscribe().Any(), "Events only handled by sagas should be auto subscribed"); + } + + [Test] + public void Should_not_autosubscribe_the_saga_messagehandler_on_demand() + { + var eventEndpointAddress = new Address("PublisherAddress", "localhost"); + + RegisterMessageType(eventEndpointAddress); + RegisterMessageHandlerType(); + + autoSubscriptionStrategy.DoNotAutoSubscribeSagas = true; + + Assert.False(autoSubscriptionStrategy.GetEventsToSubscribe().Any(), "Events only handled by sagas should not be auto subscribed on demand"); + } + + public class MySaga : Saga, IAmStartedByMessages + { + public void Handle(EventMessage message) + { + throw new NotImplementedException(); + } + + + public class MySagaData : ContainSagaData + { + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/AutomaticSubscriptions/When_starting_an_endpoint_with_autosubscribe_turned_on.cs b/src/NServiceBus.Core.Tests/AutomaticSubscriptions/When_starting_an_endpoint_with_autosubscribe_turned_on.cs new file mode 100644 index 00000000000..83e997e527a --- /dev/null +++ b/src/NServiceBus.Core.Tests/AutomaticSubscriptions/When_starting_an_endpoint_with_autosubscribe_turned_on.cs @@ -0,0 +1,101 @@ +namespace NServiceBus.Core.Tests.AutomaticSubscriptions +{ + using System; + using System.Linq; + using NUnit.Framework; + using Saga; + using Unicast.Tests.Contexts; + + [TestFixture] + public class When_starting_an_endpoint_with_autosubscribe_turned_on : AutoSubscriptionContext + { + [Test] + public void Should_not_autosubscribe_commands() + { + + var commandEndpointAddress = new Address("CommandEndpoint", "localhost"); + + RegisterMessageType(commandEndpointAddress); + RegisterMessageHandlerType(); + + + Assert.False(autoSubscriptionStrategy.GetEventsToSubscribe().Any(), "Commands should not be auto subscribed"); + } + + + [Test] + public void Should_not_autosubscribe_messages_by_default() + { + var endpointAddress = new Address("MyEndpoint", "localhost"); + + RegisterMessageType(endpointAddress); + RegisterMessageHandlerType(); + + Assert.False(autoSubscriptionStrategy.GetEventsToSubscribe().Any(), "Plain messages should not be auto subscribed by default"); + } + + [Test] + public void Should_not_autosubscribe_messages_unless_asked_to_by_the_users() + { + var endpointAddress = new Address("MyEndpoint", "localhost"); + + autoSubscriptionStrategy.SubscribePlainMessages = true; + + RegisterMessageType(endpointAddress); + RegisterMessageHandlerType(); + + Assert.True(autoSubscriptionStrategy.GetEventsToSubscribe().Any(), "Plain messages should be auto subscribed if users wants them to be"); + } + + + [Test] + public void Should_not_autosubscribe_messages_with_no_explicit_routing() + { + RegisterMessageType(Address.Undefined); + RegisterMessageHandlerType(); + + + Assert.False(autoSubscriptionStrategy.GetEventsToSubscribe().Any(), "Events without routing should not be auto subscribed by default"); + } + + + [Test] + public void Should_autosubscribe_messages_without_routing_if_configured_to_do_so() + { + RegisterMessageType(Address.Undefined); + RegisterMessageHandlerType(); + + autoSubscriptionStrategy.DoNotRequireExplicitRouting = true; + Assert.True(autoSubscriptionStrategy.GetEventsToSubscribe().Any(), "Events without routing should be auto subscribed if asked for"); + } + + class MyMessage : IMessage + { + + } + + class MyMessageHandler : IHandleMessages + { + public void Handle(MyMessage message) + { + throw new System.NotImplementedException(); + } + } + + + public class EventMessageHandler : IHandleMessages + { + public void Handle(EventMessage message) + { + throw new System.NotImplementedException(); + } + } + public class CommandMessageHandler : IHandleMessages + { + public void Handle(CommandMessage message) + { + throw new System.NotImplementedException(); + } + } + } +} \ No newline at end of file diff --git a/src/config/NServiceBus.Config.UnitTests/TestConfigurationSection.cs b/src/NServiceBus.Core.Tests/Config/TestConfigurationSection.cs similarity index 87% rename from src/config/NServiceBus.Config.UnitTests/TestConfigurationSection.cs rename to src/NServiceBus.Core.Tests/Config/TestConfigurationSection.cs index ce7d79f1af7..e2f19fe5d0d 100644 --- a/src/config/NServiceBus.Config.UnitTests/TestConfigurationSection.cs +++ b/src/NServiceBus.Core.Tests/Config/TestConfigurationSection.cs @@ -1,7 +1,7 @@ -using System.Configuration; - -namespace NServiceBus.Config.UnitTests +namespace NServiceBus.Core.Tests.Config { + using System.Configuration; + public class TestConfigurationSection : ConfigurationSection { [ConfigurationProperty("TestSetting", IsRequired = true)] diff --git a/src/NServiceBus.Core.Tests/Config/When_finding_assemblies_to_scan_with_expressions.cs b/src/NServiceBus.Core.Tests/Config/When_finding_assemblies_to_scan_with_expressions.cs new file mode 100644 index 00000000000..e6c22215ca7 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Config/When_finding_assemblies_to_scan_with_expressions.cs @@ -0,0 +1,89 @@ +namespace NServiceBus.Core.Tests.Config +{ + using System.IO; + using System.Linq; + using NUnit.Framework; + + [TestFixture] + public class When_finding_assemblies_to_scan_with_expressions + { + [Test] + public void Should_exclude_by_name_without_extension() + { + var found = AllAssemblies.Except("rhino.mocks").ToArray(); + + Assert.False( + found.Any(a => a.GetName().Name == "Rhino.Mocks")); + } + + [Test] + public void Should_exclude_by_name_without_extension_and_with_upper_letters() + { + var found = AllAssemblies.Except("Rhino.Mocks").ToArray(); + + Assert.False( + found.Any(a => a.GetName().Name == "Rhino.Mocks")); + } + + [Test] + public void Should_exclude_by_name_with_extension() + { + var found = AllAssemblies.Except("rhino.mocks.dll").ToArray(); + + Assert.False( + found.Any(a => a.GetName().Name == "Rhino.Mocks")); + } + + [Test] + public void Should_exclude_by_name_with_expression() + { + var found = AllAssemblies.Except("rhino.").ToArray(); + + Assert.False( + found.Any(a => a.GetName().Name == "Rhino.Mocks")); + } + + [Test] + public void Should_include_fsharp_by_expression() + { + var found = AllAssemblies + .Matching("TestAssembly.").ToArray(); + + Assert.True(found.Any(a => a.GetName().Name == "TestAssembly")); + } + + [Test] + public void Should_include_NServiceBus_by_default() + { + var found = AllAssemblies + .Matching("foo.bar").ToArray(); + + Assert.True(found.Any(a => a.GetName().Name.StartsWith("NServiceBus."))); + } + + [Test] + public void Should_include_fsharp_using_And() + { + var found = AllAssemblies + .Matching("foo.bar") + .And("TestAssembly.") + .ToArray(); + + Assert.True(found.Any(a => a.GetName().Name == "TestAssembly")); + } + + [Test] + public void Should_use_Appdomain_Assemblies_if_flagged() + { + var loadThisIntoAppdomain = new TestAssembly.Class1(); + + var someDir = Path.Combine(Path.GetTempPath(), "empty"); + Directory.CreateDirectory(someDir); + + var found = Configure.FindAssemblies(someDir, /*includeAppDomainAssemblies*/ true, null, null); + + var collection = found.Select(a => a.GetName().Name).ToArray(); + CollectionAssert.Contains(collection, "TestAssembly"); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Config/When_loading_types.cs b/src/NServiceBus.Core.Tests/Config/When_loading_types.cs new file mode 100644 index 00000000000..e5163d437d9 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Config/When_loading_types.cs @@ -0,0 +1,41 @@ +namespace NServiceBus.Core.Tests.Config +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + using NUnit.Framework; + + [TestFixture] + public class When_loading_types + { + private List loadedTypes; + + [SetUp] + public void SetUp() + { + Configure.With(Assembly.GetExecutingAssembly()); + loadedTypes = Configure.TypesToScan.ToList(); + } + + [Test] + public void Should_exclude_the_raven_client_types() + { + CollectionAssert.AreEquivalent( + new Type[0], + loadedTypes.Where(a => a.Namespace != null && a.Namespace.StartsWith("Raven.Client")).ToArray()); + } + + [Test] + public void Should_always_include_the_core_nservicebus_types() + { + Assert.True( + loadedTypes.Any(a => a.Assembly.GetName().Name.Equals("NServiceBus.Core"))); + } + } + + public class TestClass + { + + } +} \ No newline at end of file diff --git a/src/config/NServiceBus.Config.UnitTests/When_no_custom_configuration_source_is_specified.cs b/src/NServiceBus.Core.Tests/Config/When_no_custom_configuration_source_is_specified.cs similarity index 84% rename from src/config/NServiceBus.Config.UnitTests/When_no_custom_configuration_source_is_specified.cs rename to src/NServiceBus.Core.Tests/Config/When_no_custom_configuration_source_is_specified.cs index 6bb88ba0b3d..edbb5c26733 100644 --- a/src/config/NServiceBus.Config.UnitTests/When_no_custom_configuration_source_is_specified.cs +++ b/src/NServiceBus.Core.Tests/Config/When_no_custom_configuration_source_is_specified.cs @@ -1,8 +1,8 @@ -using System; -using NUnit.Framework; - -namespace NServiceBus.Config.UnitTests +namespace NServiceBus.Core.Tests.Config { + using System; + using NUnit.Framework; + [TestFixture] public class When_no_custom_configuration_source_is_specified { diff --git a/src/NServiceBus.Core.Tests/Config/When_scanning_assemblies.cs b/src/NServiceBus.Core.Tests/Config/When_scanning_assemblies.cs new file mode 100644 index 00000000000..95d66482c87 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Config/When_scanning_assemblies.cs @@ -0,0 +1,58 @@ +namespace NServiceBus.Core.Tests.Config +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + using NUnit.Framework; + + [TestFixture] + public class When_finding_assemblies_to_scan + { + List foundAssemblies; + + [SetUp] + public void SetUp() + { + foundAssemblies = Configure.GetAssembliesInDirectory(AppDomain.CurrentDomain.BaseDirectory) + .ToList(); + } + + [Test, Ignore] + public void Should_for_our_code_exclude_everything_but_NServiceBus_by_default() + { + CollectionAssert.AreEquivalent(new String[0], + foundAssemblies.Where(a => !a.FullName.StartsWith("NServiceBus") && !a.FullName.StartsWith("Obsolete") + // FSharp is used as an example external assembly in other tests that is not excluded by default + && !a.FullName.StartsWith("TestAssembly")).ToArray()); + } + + [Test] + public void Should_exclude_system_assemblies() + { + CollectionAssert.AreEquivalent(new String[0], + foundAssemblies.Where(a => a.FullName.StartsWith("System")).ToArray()); + } + + [Test] + public void Should_exclude_nhibernate_assemblies() + { + CollectionAssert.AreEquivalent(new String[0], + foundAssemblies.Where(a => a.FullName.ToLower().StartsWith("nhibernate")).ToArray()); + } + + [Test] + public void Should_exclude_log4net() + { + CollectionAssert.AreEquivalent(new String[0], + foundAssemblies.Where(a => a.FullName.ToLower().StartsWith("log4net")).ToArray()); + } + + [Test] + public void Should_exclude_raven() + { + CollectionAssert.AreEquivalent(new String[0], + foundAssemblies.Where(a => a.FullName.ToLower().StartsWith("raven")).ToArray()); + } + } +} diff --git a/src/config/NServiceBus.Config.UnitTests/When_users_override_the_configuration_source.cs b/src/NServiceBus.Core.Tests/Config/When_users_override_the_configuration_source.cs similarity index 75% rename from src/config/NServiceBus.Config.UnitTests/When_users_override_the_configuration_source.cs rename to src/NServiceBus.Core.Tests/Config/When_users_override_the_configuration_source.cs index a3ade4d2707..629f2b97b06 100644 --- a/src/config/NServiceBus.Config.UnitTests/When_users_override_the_configuration_source.cs +++ b/src/NServiceBus.Core.Tests/Config/When_users_override_the_configuration_source.cs @@ -1,9 +1,9 @@ -using System; -using NServiceBus.Config.ConfigurationSource; -using NUnit.Framework; +namespace NServiceBus.Core.Tests.Config +{ + using System; + using NServiceBus.Config.ConfigurationSource; + using NUnit.Framework; -namespace NServiceBus.Config.UnitTests -{ [TestFixture] public class When_users_override_the_configuration_source { @@ -16,6 +16,12 @@ public void SetUp() Configure.With(new Type[]{}) .CustomConfigurationSource(userConfigurationSource); } + + [TearDown] + public void TearDown() + { + Configure.Instance.CustomConfigurationSource(new DefaultConfigurationSource()); + } [Test] public void NService_bus_should_resolve_configuration_from_that_source() @@ -25,8 +31,8 @@ public void NService_bus_should_resolve_configuration_from_that_source() Assert.AreEqual(section.TestSetting,"TestValue"); } - } - + } + public class UserConfigurationSource : IConfigurationSource { T IConfigurationSource.GetConfiguration() diff --git a/src/NServiceBus.Core.Tests/Conventions/MessageConventionSpecs.cs b/src/NServiceBus.Core.Tests/Conventions/MessageConventionSpecs.cs new file mode 100644 index 00000000000..5f81033b3e9 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Conventions/MessageConventionSpecs.cs @@ -0,0 +1,101 @@ +namespace NServiceBus.Core.Tests.Conventions +{ + using NUnit.Framework; + + namespace NServiceBus.Config.UnitTests + { + [TestFixture] + public class When_applying_message_conventions_to_messages : MessageConventionTestBase + { + [Test] + public void Should_cache_the_message_convention() + { + var timesCalled = 0; + MessageConventionExtensions.IsMessageTypeAction = (t) => + { + timesCalled++; + return false; + }; + + MessageConventionExtensions.IsMessage(this); + Assert.AreEqual(1, timesCalled); + + MessageConventionExtensions.IsMessage(this); + Assert.AreEqual(1, timesCalled); + } + } + + [TestFixture] + public class When_applying_message_conventions_to_events:MessageConventionTestBase + { + [Test] + public void Should_cache_the_message_convention() + { + var timesCalled = 0; + MessageConventionExtensions.IsEventTypeAction = (t) => + { + timesCalled++; + return false; + }; + + MessageConventionExtensions.IsEvent(this); + Assert.AreEqual(1, timesCalled); + + MessageConventionExtensions.IsEvent(this); + Assert.AreEqual(1, timesCalled); + } + } + + [TestFixture] + public class When_applying_message_conventions_to_commands : MessageConventionTestBase + { + [Test] + public void Should_cache_the_message_convention() + { + var timesCalled = 0; + MessageConventionExtensions.IsCommandTypeAction = (t) => + { + timesCalled++; + return false; + }; + + MessageConventionExtensions.IsCommand(this); + Assert.AreEqual(1, timesCalled); + + MessageConventionExtensions.IsCommand(this); + Assert.AreEqual(1, timesCalled); + } + } + } +} + +namespace NServiceBus.Core.Tests.Conventions.NServiceBus.Config.UnitTests +{ + using System; + using NUnit.Framework; + + public class MessageConventionTestBase + { + Func IsEventTypeAction; + Func IsCommandTypeAction; + Func IsMessageTypeAction; + + [SetUp] + public void SetUp() + { + IsEventTypeAction = MessageConventionExtensions.IsEventTypeAction; + IsCommandTypeAction = MessageConventionExtensions.IsCommandTypeAction; + IsMessageTypeAction = MessageConventionExtensions.IsMessageTypeAction; + + } + + [TearDown] + public void TearDown() + { + MessageConventionExtensions.IsEventTypeAction = IsEventTypeAction; + MessageConventionExtensions.IsCommandTypeAction = IsCommandTypeAction; + MessageConventionExtensions.IsMessageTypeAction = IsMessageTypeAction; + + } + } +} diff --git a/src/NServiceBus.Core.Tests/DataBus/FileShare/AcceptanceTests.cs b/src/NServiceBus.Core.Tests/DataBus/FileShare/AcceptanceTests.cs new file mode 100644 index 00000000000..75fd4e60a09 --- /dev/null +++ b/src/NServiceBus.Core.Tests/DataBus/FileShare/AcceptanceTests.cs @@ -0,0 +1,57 @@ +namespace NServiceBus.Core.Tests.DataBus.FileShare +{ + using System; + using System.IO; + using System.Text; + using NUnit.Framework; + using NServiceBus.DataBus.FileShare; + + [TestFixture] + public class AcceptanceTests + { + FileShareDataBus dataBus; + readonly string basePath = Path.GetTempPath(); + + [SetUp] + public void SetUp() + { + dataBus = new FileShareDataBus(basePath); + dataBus.MaxMessageTimeToLive = TimeSpan.MaxValue; + } + + [Test] + public void Should_handle_max_ttl() + { + Put("Test", TimeSpan.MaxValue); + Assert.True(Directory.Exists(Path.Combine(basePath, DateTime.MaxValue.ToString("yyyy-MM-dd_HH")))); + } + + [Test] + public void Should_honour_the_ttl_limit() + { + dataBus.MaxMessageTimeToLive = TimeSpan.FromDays(1); + + Put("Test", TimeSpan.MaxValue); + Assert.True(Directory.Exists(Path.Combine(basePath, DateTime.Now.AddDays(1).ToString("yyyy-MM-dd_HH")))); + } + + [Test] + public void Should_handle_be_able_to_read_stored_values() + { + const string content = "Test"; + + var key = Put(content, TimeSpan.MaxValue); + using(var stream = dataBus.Get(key)) + { + Assert.AreEqual(new StreamReader(stream).ReadToEnd(),content); + } + } + + string Put(string content,TimeSpan timeToLive) + { + byte[] byteArray = Encoding.ASCII.GetBytes( content); + using (var stream = new MemoryStream(byteArray)) + return dataBus.Put(stream, timeToLive); + } + } +} diff --git a/src/NServiceBus.Core.Tests/DataBus/InMemoryDataBus.cs b/src/NServiceBus.Core.Tests/DataBus/InMemoryDataBus.cs new file mode 100644 index 00000000000..8d46b7b9721 --- /dev/null +++ b/src/NServiceBus.Core.Tests/DataBus/InMemoryDataBus.cs @@ -0,0 +1,35 @@ +namespace NServiceBus.Core.Tests.DataBus +{ + using System.Collections.Generic; + using System.IO; + using System; + using NServiceBus.DataBus; + + public class InMemoryDataBus : IDataBus + { + private readonly IDictionary storage = new Dictionary(); + + public Stream Get(string key) + { + lock (storage) + return new MemoryStream(storage[key]); + } + + public string Put(Stream stream, TimeSpan timeToBeReceived) + { + var key = Guid.NewGuid().ToString(); + + var data = new byte[stream.Length]; + stream.Read(data, 0, (int) stream.Length); + + lock (storage) + storage.Add(key, data); + return key; + } + + public void Start() + { + //no-op + } + } +} \ No newline at end of file diff --git a/src/databus/NServiceBus.Databus.Tests/MessageWithDataBusProperty.cs b/src/NServiceBus.Core.Tests/DataBus/MessageWithDataBusProperty.cs similarity index 87% rename from src/databus/NServiceBus.Databus.Tests/MessageWithDataBusProperty.cs rename to src/NServiceBus.Core.Tests/DataBus/MessageWithDataBusProperty.cs index fa726acefe5..4d10dc718d7 100644 --- a/src/databus/NServiceBus.Databus.Tests/MessageWithDataBusProperty.cs +++ b/src/NServiceBus.Core.Tests/DataBus/MessageWithDataBusProperty.cs @@ -1,12 +1,12 @@ -namespace NServiceBus.DataBus.Tests +namespace NServiceBus.Core.Tests.DataBus { public class MessageWithDataBusProperty : IMessage { public DataBusProperty DataBusProperty { get; set; } - } - - public class MessageWithNullDataBusProperty : IMessage - { - public DataBusProperty DataBusProperty { get; set; } + } + + public class MessageWithNullDataBusProperty : IMessage + { + public DataBusProperty DataBusProperty { get; set; } } } \ No newline at end of file diff --git a/src/databus/NServiceBus.Databus.Tests/MessageWithExplicitTimeToLive.cs b/src/NServiceBus.Core.Tests/DataBus/MessageWithExplicitTimeToLive.cs similarity index 81% rename from src/databus/NServiceBus.Databus.Tests/MessageWithExplicitTimeToLive.cs rename to src/NServiceBus.Core.Tests/DataBus/MessageWithExplicitTimeToLive.cs index e4836be76d3..77f445857f8 100644 --- a/src/databus/NServiceBus.Databus.Tests/MessageWithExplicitTimeToLive.cs +++ b/src/NServiceBus.Core.Tests/DataBus/MessageWithExplicitTimeToLive.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.DataBus.Tests +namespace NServiceBus.Core.Tests.DataBus { [TimeToBeReceived("00:01:00")] public class MessageWithExplicitTimeToLive : IMessage diff --git a/src/databus/NServiceBus.Databus.Tests/MessageWithNonSerializableDataBusProperty.cs b/src/NServiceBus.Core.Tests/DataBus/MessageWithNonSerializableDataBusProperty.cs similarity index 82% rename from src/databus/NServiceBus.Databus.Tests/MessageWithNonSerializableDataBusProperty.cs rename to src/NServiceBus.Core.Tests/DataBus/MessageWithNonSerializableDataBusProperty.cs index 70a5f7e44dd..0f0c482c557 100644 --- a/src/databus/NServiceBus.Databus.Tests/MessageWithNonSerializableDataBusProperty.cs +++ b/src/NServiceBus.Core.Tests/DataBus/MessageWithNonSerializableDataBusProperty.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.DataBus.Tests +namespace NServiceBus.Core.Tests.DataBus { public class MessageWithNonSerializableDataBusProperty : IMessage { diff --git a/src/NServiceBus.Core.Tests/DataBus/MessageWithoutDataBusProperty.cs b/src/NServiceBus.Core.Tests/DataBus/MessageWithoutDataBusProperty.cs new file mode 100644 index 00000000000..545eaf95980 --- /dev/null +++ b/src/NServiceBus.Core.Tests/DataBus/MessageWithoutDataBusProperty.cs @@ -0,0 +1,7 @@ +namespace NServiceBus.Core.Tests.DataBus +{ + public class MessageWithoutDataBusProperty + { + public string SomeProperty { get; set; } + } +} \ No newline at end of file diff --git a/src/databus/NServiceBus.Databus.Tests/When_applying_the_databus_message_mutator_to_incoming_messages.cs b/src/NServiceBus.Core.Tests/DataBus/When_applying_the_databus_message_mutator_to_incoming_messages.cs similarity index 96% rename from src/databus/NServiceBus.Databus.Tests/When_applying_the_databus_message_mutator_to_incoming_messages.cs rename to src/NServiceBus.Core.Tests/DataBus/When_applying_the_databus_message_mutator_to_incoming_messages.cs index 5a9213e23ce..d4de548269c 100644 --- a/src/databus/NServiceBus.Databus.Tests/When_applying_the_databus_message_mutator_to_incoming_messages.cs +++ b/src/NServiceBus.Core.Tests/DataBus/When_applying_the_databus_message_mutator_to_incoming_messages.cs @@ -1,6 +1,6 @@ -namespace NServiceBus.DataBus.Tests -{ - using System; +namespace NServiceBus.Core.Tests.DataBus +{ + using System; using System.IO; using System.Runtime.Serialization.Formatters.Binary; using NUnit.Framework; @@ -15,18 +15,18 @@ public void Incoming_databus_properties_should_be_hydrated() var message = new MessageWithDataBusProperty { DataBusProperty = new DataBusProperty("not used in this test") - }; - message.DataBusProperty.Key = Guid.NewGuid().ToString(); - - var databusKey = Guid.NewGuid().ToString(); - - message.SetHeader("NServiceBus.DataBus." + message.DataBusProperty.Key, databusKey); + }; + message.DataBusProperty.Key = Guid.NewGuid().ToString(); + + var databusKey = Guid.NewGuid().ToString(); + + message.SetHeader("NServiceBus.DataBus." + message.DataBusProperty.Key, databusKey); using (var stream = new MemoryStream()) { new BinaryFormatter().Serialize(stream, "test"); - stream.Position = 0; - + stream.Position = 0; + dataBus.Stub(s => s.Get(databusKey)).Return(stream); message = (MessageWithDataBusProperty) incomingMutator.MutateIncoming(message); @@ -34,5 +34,5 @@ public void Incoming_databus_properties_should_be_hydrated() Assert.AreEqual(message.DataBusProperty.Value, "test"); } - } + } } \ No newline at end of file diff --git a/src/databus/NServiceBus.Databus.Tests/When_applying_the_databus_message_mutator_to_null_properties.cs b/src/NServiceBus.Core.Tests/DataBus/When_applying_the_databus_message_mutator_to_null_properties.cs similarity index 91% rename from src/databus/NServiceBus.Databus.Tests/When_applying_the_databus_message_mutator_to_null_properties.cs rename to src/NServiceBus.Core.Tests/DataBus/When_applying_the_databus_message_mutator_to_null_properties.cs index da929d7e6b9..9aea909183a 100644 --- a/src/databus/NServiceBus.Databus.Tests/When_applying_the_databus_message_mutator_to_null_properties.cs +++ b/src/NServiceBus.Core.Tests/DataBus/When_applying_the_databus_message_mutator_to_null_properties.cs @@ -1,29 +1,29 @@ -namespace NServiceBus.DataBus.Tests -{ - using System.IO; - using System.Runtime.Serialization.Formatters.Binary; - using NUnit.Framework; - - [TestFixture] - public class When_applying_the_databus_message_mutator_to_null_properties : on_the_bus - { - [Test] - public void Should_not_blow_up() - { - var message = new MessageWithNullDataBusProperty(); - - outgoingMutator.MutateOutgoing(message); - - using (var stream = new MemoryStream()) - { - new BinaryFormatter().Serialize(stream, "test"); - stream.Position = 0; - - incomingMutator.MutateIncoming(message); - } - - - } - - } +namespace NServiceBus.Core.Tests.DataBus +{ + using System.IO; + using System.Runtime.Serialization.Formatters.Binary; + using NUnit.Framework; + + [TestFixture] + public class When_applying_the_databus_message_mutator_to_null_properties : on_the_bus + { + [Test] + public void Should_not_blow_up() + { + var message = new MessageWithNullDataBusProperty(); + + outgoingMutator.MutateOutgoing(message); + + using (var stream = new MemoryStream()) + { + new BinaryFormatter().Serialize(stream, "test"); + stream.Position = 0; + + incomingMutator.MutateIncoming(message); + } + + + } + + } } \ No newline at end of file diff --git a/src/databus/NServiceBus.Databus.Tests/When_applying_the_databus_message_mutator_to_outgoing_messages.cs b/src/NServiceBus.Core.Tests/DataBus/When_applying_the_databus_message_mutator_to_outgoing_messages.cs similarity index 96% rename from src/databus/NServiceBus.Databus.Tests/When_applying_the_databus_message_mutator_to_outgoing_messages.cs rename to src/NServiceBus.Core.Tests/DataBus/When_applying_the_databus_message_mutator_to_outgoing_messages.cs index f1e5b62f432..1b95cf3020f 100644 --- a/src/databus/NServiceBus.Databus.Tests/When_applying_the_databus_message_mutator_to_outgoing_messages.cs +++ b/src/NServiceBus.Core.Tests/DataBus/When_applying_the_databus_message_mutator_to_outgoing_messages.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.DataBus.Tests +namespace NServiceBus.Core.Tests.DataBus { using System; using System.IO; diff --git a/src/NServiceBus.Core.Tests/DataBus/When_nservicebus_is_initalizing.cs b/src/NServiceBus.Core.Tests/DataBus/When_nservicebus_is_initalizing.cs new file mode 100644 index 00000000000..21145d21de2 --- /dev/null +++ b/src/NServiceBus.Core.Tests/DataBus/When_nservicebus_is_initalizing.cs @@ -0,0 +1,97 @@ +namespace NServiceBus.Core.Tests.DataBus +{ + using System.IO; + using NServiceBus.DataBus; + using NUnit.Framework; + using System; + using NServiceBus.DataBus.Config; + + [TestFixture] + public class When_nservicebus_is_initalizing + { + [Test] + public void Databus_mutators_should_be_registered_if_a_databus_property_is_found() + { + Configure.With(new[] {typeof (MessageWithDataBusProperty)}) + .DefineEndpointName("xyz") + .DefaultBuilder(); + + IWantToRunBeforeConfigurationIsFinalized bootStrapper = new Bootstrapper(); + + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + + bootStrapper.Run(); + + Assert.True(Configure.Instance.Configurer.HasComponent()); + } + + [Test] + public void Databus_mutators_should_not_be_registered_if_no_databus_property_is_found() + { + Configure.With(new[] { typeof(MessageWithoutDataBusProperty) }) + .DefineEndpointName("xyz") + .DefaultBuilder(); + + IWantToRunBeforeConfigurationIsFinalized bootStrapper = new Bootstrapper(); + + bootStrapper.Run(); + + Assert.False(Configure.Instance.Configurer.HasComponent()); + } + + [Test] + public void Should_throw_if_propertytype_is_not_serializable() + { + if (!System.Diagnostics.Debugger.IsAttached) + { + Assert.Ignore("This only work in debug mode."); + } + + Configure.With(new[] { typeof(MessageWithNonSerializableDataBusProperty) }) + .DefineEndpointName("xyz") + .DefiningDataBusPropertiesAs(p => p.Name.EndsWith("DataBus")) + .DefaultBuilder() + .Configurer.RegisterSingleton(new InMemoryDataBus()); + + IWantToRunBeforeConfigurationIsFinalized bootStrapper = new Bootstrapper(); + + Assert.Throws(bootStrapper.Run); + } + + [Test] + public void Should_not_throw_propertytype_is_not_serializable_if_a_IDataBusSerializer_is_already_registered() + { + if (!System.Diagnostics.Debugger.IsAttached) + { + Assert.Ignore("This only work in debug mode."); + } + + Configure.With(new[] { typeof(MessageWithNonSerializableDataBusProperty) }) + .DefineEndpointName("xyz") + .DefiningDataBusPropertiesAs(p => p.Name.EndsWith("DataBus")) + .DefaultBuilder() + .Configurer.RegisterSingleton(new InMemoryDataBus()); + + IWantToRunBeforeConfigurationIsFinalized bootStrapper = new Bootstrapper(); + + Configure.Instance.Configurer.ConfigureComponent(() => new MyDataBusSerializer(),DependencyLifecycle.SingleInstance); + + Assert.DoesNotThrow(bootStrapper.Run); + } + + class MyDataBusSerializer : IDataBusSerializer + { + public void Serialize(object databusProperty, Stream stream) + { + throw new NotImplementedException(); + } + + public object Deserialize(Stream stream) + { + throw new NotImplementedException(); + } + } + } + + +} diff --git a/src/databus/NServiceBus.Databus.Tests/on_the_bus.cs b/src/NServiceBus.Core.Tests/DataBus/on_the_bus.cs similarity index 82% rename from src/databus/NServiceBus.Databus.Tests/on_the_bus.cs rename to src/NServiceBus.Core.Tests/DataBus/on_the_bus.cs index bd9d6013ad8..892ff91feb0 100644 --- a/src/databus/NServiceBus.Databus.Tests/on_the_bus.cs +++ b/src/NServiceBus.Core.Tests/DataBus/on_the_bus.cs @@ -1,7 +1,8 @@ -namespace NServiceBus.DataBus.Tests +namespace NServiceBus.Core.Tests.DataBus { - using MessageHeaders; - using MessageMutator; + using NServiceBus.DataBus; + using NServiceBus.MessageHeaders; + using NServiceBus.MessageMutator; using NUnit.Framework; using Rhino.Mocks; @@ -21,9 +22,9 @@ public void SetUp() ExtensionMethods.GetHeaderAction = headerManager.GetHeader; dataBus = MockRepository.GenerateMock(); - + var databusMutator = new DataBusMessageMutator(dataBus, new DefaultDataBusSerializer()); - + incomingMutator = databusMutator; outgoingMutator = databusMutator; } diff --git a/tests/encryption/NServiceBus.Encryption.Tests/ConventionBasedEncryptedStringSpecs.cs b/src/NServiceBus.Core.Tests/Encryption/ConventionBasedEncryptedStringSpecs.cs similarity index 95% rename from tests/encryption/NServiceBus.Encryption.Tests/ConventionBasedEncryptedStringSpecs.cs rename to src/NServiceBus.Core.Tests/Encryption/ConventionBasedEncryptedStringSpecs.cs index 95a0df328df..310583d8d05 100644 --- a/tests/encryption/NServiceBus.Encryption.Tests/ConventionBasedEncryptedStringSpecs.cs +++ b/src/NServiceBus.Core.Tests/Encryption/ConventionBasedEncryptedStringSpecs.cs @@ -1,77 +1,77 @@ -namespace NServiceBus.Encryption.Tests -{ - using System; - using NUnit.Framework; - - [TestFixture] - public class When_sending_a_message_with_user_defined_convention:UserDefinedConventionContext - { - [Test] - public void Should_encrypt_the_value() - { - var message = new ConventionBasedSecureMessage() - { - EncryptedSecret = "A secret" - }; - mutator.MutateOutgoing(message); - - Assert.AreEqual(string.Format("{0}@{1}", "encrypted value", "init_vector"), message.EncryptedSecret); - } - } - - [TestFixture] - public class When_receiving_a_message_with_user_defined_convention : UserDefinedConventionContext - { - [Test] - public void Should_encrypt_the_value() - { - var message = new ConventionBasedSecureMessage() - { - EncryptedSecret = "encrypted value@init_vector" - }; - mutator.MutateIncoming(message); - - Assert.AreEqual("A secret", message.EncryptedSecret); - } - } - - [TestFixture] - public class When_encrypting_a_property_that_is_not_a_string:UserDefinedConventionContext - { - [Test] - public void Should_throw_an_exception() - { - Assert.Throws(() => mutator.MutateOutgoing(new MessageWithNonStringSecureProperty())); - } - } - - [TestFixture] - public class When_decrypting_a_property_that_is_not_a_string : UserDefinedConventionContext - { - [Test] - public void Should_throw_an_exception() - { - Assert.Throws(() => mutator.MutateIncoming(new MessageWithNonStringSecureProperty())); - } - } - - public class UserDefinedConventionContext : WireEncryptedStringContext - { - [SetUp] - public void SetUp() - { - MessageConventionExtensions.IsEncryptedPropertyAction = (p) => p.Name.StartsWith("Encrypted"); - } - } - - public class MessageWithNonStringSecureProperty - { - public int EncryptedInt { get; set; } - } - - public class ConventionBasedSecureMessage:IMessage - { - public string EncryptedSecret { get; set; } - public string EncryptedSecretThatIsNull { get; set; } - } -} +namespace NServiceBus.Core.Tests.Encryption +{ + using System; + using NUnit.Framework; + + [TestFixture] + public class When_sending_a_message_with_user_defined_convention:UserDefinedConventionContext + { + [Test] + public void Should_encrypt_the_value() + { + var message = new ConventionBasedSecureMessage() + { + EncryptedSecret = "A secret" + }; + mutator.MutateOutgoing(message); + + Assert.AreEqual(string.Format("{0}@{1}", "encrypted value", "init_vector"), message.EncryptedSecret); + } + } + + [TestFixture] + public class When_receiving_a_message_with_user_defined_convention : UserDefinedConventionContext + { + [Test] + public void Should_encrypt_the_value() + { + var message = new ConventionBasedSecureMessage() + { + EncryptedSecret = "encrypted value@init_vector" + }; + mutator.MutateIncoming(message); + + Assert.AreEqual("A secret", message.EncryptedSecret); + } + } + + [TestFixture] + public class When_encrypting_a_property_that_is_not_a_string:UserDefinedConventionContext + { + [Test] + public void Should_throw_an_exception() + { + Assert.Throws(() => mutator.MutateOutgoing(new MessageWithNonStringSecureProperty())); + } + } + + [TestFixture] + public class When_decrypting_a_property_that_is_not_a_string : UserDefinedConventionContext + { + [Test] + public void Should_throw_an_exception() + { + Assert.Throws(() => mutator.MutateIncoming(new MessageWithNonStringSecureProperty())); + } + } + + public class UserDefinedConventionContext : WireEncryptedStringContext + { + [SetUp] + public void SetUp() + { + MessageConventionExtensions.IsEncryptedPropertyAction = (p) => p.Name.StartsWith("Encrypted"); + } + } + + public class MessageWithNonStringSecureProperty + { + public int EncryptedInt { get; set; } + } + + public class ConventionBasedSecureMessage:IMessage + { + public string EncryptedSecret { get; set; } + public string EncryptedSecretThatIsNull { get; set; } + } +} diff --git a/tests/encryption/NServiceBus.Encryption.Tests/FakeEncryptionService.cs b/src/NServiceBus.Core.Tests/Encryption/FakeEncryptionService.cs similarity index 90% rename from tests/encryption/NServiceBus.Encryption.Tests/FakeEncryptionService.cs rename to src/NServiceBus.Core.Tests/Encryption/FakeEncryptionService.cs index 19e1be0c23c..a268bc52041 100644 --- a/tests/encryption/NServiceBus.Encryption.Tests/FakeEncryptionService.cs +++ b/src/NServiceBus.Core.Tests/Encryption/FakeEncryptionService.cs @@ -1,28 +1,29 @@ -namespace NServiceBus.Encryption.Tests -{ - using System; - - public class FakeEncryptionService : IEncryptionService - { - readonly EncryptedValue hardcodedValue; - - public FakeEncryptionService(EncryptedValue hardcodedValue) - { - this.hardcodedValue = hardcodedValue; - } - - public EncryptedValue Encrypt(string value) - { - return hardcodedValue; - } - - public string Decrypt(EncryptedValue encryptedValue) - { - if (encryptedValue.Base64Iv == hardcodedValue.Base64Iv && encryptedValue.EncryptedBase64Value == hardcodedValue.EncryptedBase64Value) - return "A secret"; - - throw new InvalidOperationException("Failed to decrypt"); - } - - } -} \ No newline at end of file +namespace NServiceBus.Core.Tests.Encryption +{ + using System; + using NServiceBus.Encryption; + + public class FakeEncryptionService : IEncryptionService + { + readonly EncryptedValue hardcodedValue; + + public FakeEncryptionService(EncryptedValue hardcodedValue) + { + this.hardcodedValue = hardcodedValue; + } + + public EncryptedValue Encrypt(string value) + { + return hardcodedValue; + } + + public string Decrypt(EncryptedValue encryptedValue) + { + if (encryptedValue.Base64Iv == hardcodedValue.Base64Iv && encryptedValue.EncryptedBase64Value == hardcodedValue.EncryptedBase64Value) + return "A secret"; + + throw new InvalidOperationException("Failed to decrypt"); + } + + } +} diff --git a/tests/encryption/NServiceBus.Encryption.Tests/Issue_701.cs b/src/NServiceBus.Core.Tests/Encryption/Issue_701.cs similarity index 93% rename from tests/encryption/NServiceBus.Encryption.Tests/Issue_701.cs rename to src/NServiceBus.Core.Tests/Encryption/Issue_701.cs index 6f11fce5e91..60a071b9002 100644 --- a/tests/encryption/NServiceBus.Encryption.Tests/Issue_701.cs +++ b/src/NServiceBus.Core.Tests/Encryption/Issue_701.cs @@ -1,66 +1,66 @@ -namespace NServiceBus.Encryption.Tests -{ - using NUnit.Framework; - - [TestFixture] - public class Issue_701 : WireEncryptedStringContext - { - [Test] - public void No_get_on_property() - { - var message = new TestMessageWithSets(); - message.Name = "John"; - - var result = (TestMessageWithSets)mutator.MutateOutgoing(message); - - Assert.AreEqual("John", result.Name); - } - - [Test] - public void No_set_on_property() - { - var message = new TestMessageWithGets(); - message.Name = "John"; - - var result = (TestMessageWithGets)mutator.MutateOutgoing(message); - - Assert.AreEqual("John", result.Name); - } - - private class TestMessageWithSets - { - public string Name { get; set; } - - public string Options1 - { - set - { - //do nothing - } - } - - public int Options2 - { - set - { - //do nothing - } - } - } - - private class TestMessageWithGets - { - public string Name { get; set; } - - public string Options1 - { - get { return "Testing"; } - } - - public int Options2 - { - get { return 5; } - } - } - } +namespace NServiceBus.Core.Tests.Encryption +{ + using NUnit.Framework; + + [TestFixture] + public class Issue_701 : WireEncryptedStringContext + { + [Test] + public void No_get_on_property() + { + var message = new TestMessageWithSets(); + message.Name = "John"; + + var result = (TestMessageWithSets)mutator.MutateOutgoing(message); + + Assert.AreEqual("John", result.Name); + } + + [Test] + public void No_set_on_property() + { + var message = new TestMessageWithGets(); + message.Name = "John"; + + var result = (TestMessageWithGets)mutator.MutateOutgoing(message); + + Assert.AreEqual("John", result.Name); + } + + private class TestMessageWithSets + { + public string Name { get; set; } + + public string Options1 + { + set + { + //do nothing + } + } + + public int Options2 + { + set + { + //do nothing + } + } + } + + private class TestMessageWithGets + { + public string Name { get; set; } + + public string Options1 + { + get { return "Testing"; } + } + + public int Options2 + { + get { return 5; } + } + } + } } \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Encryption/Issue_949.cs b/src/NServiceBus.Core.Tests/Encryption/Issue_949.cs new file mode 100644 index 00000000000..0734f9e817e --- /dev/null +++ b/src/NServiceBus.Core.Tests/Encryption/Issue_949.cs @@ -0,0 +1,42 @@ +namespace NServiceBus.Encryption.Tests +{ + using Core.Tests.Encryption; + using NUnit.Framework; + + [TestFixture] + public class Issue_949 : WireEncryptedStringContext + { + [Test] + public void null_element_in_primitive_array() + { + var message = new TestMessageWithPrimitives(); + message.Data = new int?[] { null, 1 }; + + mutator.MutateOutgoing(message); + + Assert.AreEqual(new int?[] { null, 1}, message.Data); + } + + [Test] + public void null_element_in_object_array() + { + var message = new TestMessageWithObjects(); + message.Data = new object[] { null, this, null }; + + mutator.MutateOutgoing(message); + + Assert.AreEqual(new object[] { null, this,null }, message.Data); + + } + + private class TestMessageWithPrimitives + { + public int?[] Data; + } + + private class TestMessageWithObjects + { + public object[] Data; + } + } +} diff --git a/tests/encryption/NServiceBus.Encryption.Tests/Mailing_list_complex_dto.cs b/src/NServiceBus.Core.Tests/Encryption/Mailing_list_complex_dto.cs similarity index 94% rename from tests/encryption/NServiceBus.Encryption.Tests/Mailing_list_complex_dto.cs rename to src/NServiceBus.Core.Tests/Encryption/Mailing_list_complex_dto.cs index b6fe7a4ac21..0192dc05f29 100644 --- a/tests/encryption/NServiceBus.Encryption.Tests/Mailing_list_complex_dto.cs +++ b/src/NServiceBus.Core.Tests/Encryption/Mailing_list_complex_dto.cs @@ -1,62 +1,62 @@ -namespace NServiceBus.Encryption.Tests -{ - using System.Collections.Generic; - using NUnit.Framework; - - [TestFixture] - public class Mailing_list_complex_dto : WireEncryptedStringContext - { - [Test] - public void Indexed_enum_property() - { - var message = new TestDto(); - - var dict = message.Options[TestEnum.EnumValue1]; - dict["test"] = "asdf"; - - message.Options[TestEnum.EnumValue1]["test"] = "asdf"; - - var result = (TestDto)mutator.MutateOutgoing(message); - - Assert.True(result.Options.ContainsKey(TestEnum.EnumValue1)); - } - - private enum TestEnum - { - EnumValue1 - } - - private class TestOptions - { - private readonly Dictionary> _dictionary = new Dictionary>(); - public Dictionary> Dictionary { get { return _dictionary; } } - - public bool ContainsKey(TestEnum key) - { - return _dictionary.ContainsKey(key); - } - - public IEnumerable Keys { get { return _dictionary.Keys; } } - - public Dictionary this[TestEnum appEnum] - { - get - { - return _dictionary.ContainsKey(appEnum) - ? _dictionary[appEnum] - : _dictionary[appEnum] = new Dictionary(); - } - } - } - - private class TestDto - { - public TestDto() - { - Options = new TestOptions(); - } - - public TestOptions Options { get; set; } - } - } +namespace NServiceBus.Core.Tests.Encryption +{ + using System.Collections.Generic; + using NUnit.Framework; + + [TestFixture] + public class Mailing_list_complex_dto : WireEncryptedStringContext + { + [Test] + public void Indexed_enum_property() + { + var message = new TestDto(); + + var dict = message.Options[TestEnum.EnumValue1]; + dict["test"] = "asdf"; + + message.Options[TestEnum.EnumValue1]["test"] = "asdf"; + + var result = (TestDto)mutator.MutateOutgoing(message); + + Assert.True(result.Options.ContainsKey(TestEnum.EnumValue1)); + } + + private enum TestEnum + { + EnumValue1 + } + + private class TestOptions + { + private readonly Dictionary> _dictionary = new Dictionary>(); + public Dictionary> Dictionary { get { return _dictionary; } } + + public bool ContainsKey(TestEnum key) + { + return _dictionary.ContainsKey(key); + } + + public IEnumerable Keys { get { return _dictionary.Keys; } } + + public Dictionary this[TestEnum appEnum] + { + get + { + return _dictionary.ContainsKey(appEnum) + ? _dictionary[appEnum] + : _dictionary[appEnum] = new Dictionary(); + } + } + } + + private class TestDto + { + public TestDto() + { + Options = new TestOptions(); + } + + public TestOptions Options { get; set; } + } + } } \ No newline at end of file diff --git a/tests/encryption/NServiceBus.Encryption.Tests/WireEncryptedStringSpecs.cs b/src/NServiceBus.Core.Tests/Encryption/WireEncryptedStringSpecs.cs similarity index 89% rename from tests/encryption/NServiceBus.Encryption.Tests/WireEncryptedStringSpecs.cs rename to src/NServiceBus.Core.Tests/Encryption/WireEncryptedStringSpecs.cs index 9376bbdf5ee..e83f4cc3225 100644 --- a/tests/encryption/NServiceBus.Encryption.Tests/WireEncryptedStringSpecs.cs +++ b/src/NServiceBus.Core.Tests/Encryption/WireEncryptedStringSpecs.cs @@ -1,445 +1,440 @@ -namespace NServiceBus.Encryption.Tests -{ - using System; - using System.Collections; - using System.Collections.Generic; - using Config; - using NUnit.Framework; - - [TestFixture] - public class When_sending_a_message_using_the_default_convention : WireEncryptedStringContext - { - [Test] - public void Should_use_the_wireencrypted_string() - { - var message = new Customer - { - Secret = MySecretMessage, - SecretField = MySecretMessage, - CreditCard = new CreditCardDetails {CreditCardNumber = MySecretMessage}, - LargeByteArray = new byte[1000000], - ListOfCreditCards = - new List - { - new CreditCardDetails {CreditCardNumber = MySecretMessage}, - new CreditCardDetails {CreditCardNumber = MySecretMessage} - } - }; - message.ListOfSecrets = new ArrayList(message.ListOfCreditCards); - - mutator.MutateOutgoing(message); - - Assert.AreEqual(message.Secret.EncryptedValue.EncryptedBase64Value, EncryptedBase64Value); - Assert.AreEqual(message.SecretField.EncryptedValue.EncryptedBase64Value, EncryptedBase64Value); - Assert.AreEqual(message.CreditCard.CreditCardNumber.EncryptedValue.EncryptedBase64Value, - EncryptedBase64Value); - Assert.AreEqual(message.ListOfCreditCards[0].CreditCardNumber.EncryptedBase64Value, EncryptedBase64Value); - Assert.AreEqual(message.ListOfCreditCards[1].CreditCardNumber.EncryptedBase64Value, EncryptedBase64Value); - - Assert.AreEqual(((CreditCardDetails) message.ListOfSecrets[0]).CreditCardNumber.EncryptedBase64Value, - EncryptedBase64Value); - Assert.AreEqual(((CreditCardDetails) message.ListOfSecrets[1]).CreditCardNumber.EncryptedBase64Value, - EncryptedBase64Value); - } - } - - [TestFixture] - public class When_encrypting_a_message_with_indexed_properties : WireEncryptedStringContext - { - [Test] - public void Should_encrypt_the_property_correctly() - { - var message = new MessageWithindexdProperties - { - Secret = MySecretMessage - }; - - message[0] = "boo"; - message[1] = "foo"; - - mutator.MutateOutgoing(message); - - Assert.AreEqual("boo", message[0]); - Assert.AreEqual("foo", message[1]); - Assert.AreEqual(EncryptedBase64Value, message.Secret.EncryptedValue.EncryptedBase64Value); - } - - public class MessageWithindexdProperties : IMessage - { - private readonly string[] indexedList = new string[2]; - - public string this[int index] - { - get { return indexedList[index]; } - set { indexedList[index] = value; } - } - - public WireEncryptedString Secret { get; set; } - } - } - - [TestFixture] - public class When_encrypting_a_message_with_WireEncryptedString_as_an_indexed_properties : WireEncryptedStringContext - { - [Test] - public void Should_throw_exception() - { - var message = new MessageWithindexdProperties(); - - message[0] = MySecretMessage; - message[1] = MySecretMessage; - - Assert.Throws(() => mutator.MutateOutgoing(message)); - } - - public class MessageWithindexdProperties : IMessage - { - private readonly WireEncryptedString[] indexedList = new WireEncryptedString[2]; - - public WireEncryptedString this[int index] - { - get { return indexedList[index]; } - set { indexedList[index] = value; } - } - } - } - - [TestFixture] - public class When_encrypting_a_message_with_circular_references : WireEncryptedStringContext - { - [Test] - public void Should_encrypt_the_property_correctly() - { - var child = new SubProperty {Secret = MySecretMessage}; - - var message = new MessageWithCircularReferences - { - Child = child - }; - child.Self = child; - child.Parent = message; - - mutator.MutateOutgoing(message); - - Assert.AreEqual(EncryptedBase64Value, message.Child.Secret.EncryptedValue.EncryptedBase64Value); - } - } - - [TestFixture] - public class When_decrypting_a_message_with_indexed_properties : WireEncryptedStringContext - { - [Test] - public void Should_decrypt_the_property_correctly() - { - var message = new MessageWithIndexProperties() - { - Secret = Create() - }; - - message[0] = "boo"; - message[1] = "foo"; - - mutator.MutateIncoming(message); - - Assert.AreEqual("boo", message[0]); - Assert.AreEqual("foo", message[1]); - Assert.AreEqual(MySecretMessage, message.Secret.Value); - } - - public class MessageWithIndexProperties : IMessage - { - private readonly string[] indexedList = new string[2]; - - public string this[int index] - { - get { return indexedList[index]; } - set { indexedList[index] = value; } - } - - public WireEncryptedString Secret { get; set; } - } - } - - [TestFixture] - public class When_decrypting_a_message_with_property_with_backing_public_field : WireEncryptedStringContext - { - [Test] - public void Should_decrypt_the_property_correctly() - { - var message = new MessageWithPropertyWithBackingPublicField - { - MySecret = Create(), - - }; - - mutator.MutateIncoming(message); - - Assert.AreEqual(MySecretMessage, message.MySecret.Value); - } - - public class MessageWithPropertyWithBackingPublicField : IMessage - { - public WireEncryptedString mySuperSecret; - - public WireEncryptedString MySecret - { - get { return mySuperSecret; } - set { mySuperSecret = value; } - } - } - } - - [TestFixture] - public class When_decrypting_a_message_with_circular_references : WireEncryptedStringContext - { - [Test] - public void Should_decrypt_the_property_correctly() - { - var child = new SubProperty {Secret = Create()}; - - var message = new MessageWithCircularReferences - { - Child = child - }; - child.Self = child; - child.Parent = message; - - mutator.MutateIncoming(message); - - Assert.AreEqual(message.Child.Secret.Value, MySecretMessage); - - - } - } - - [TestFixture] - public class When_decrypting_a_member_that_is_missing_encryption_data : WireEncryptedStringContext - { - [Test] - public void Should_throw_an_exception() - { - - var message = new MessageWithMissingData - { - Secret = new WireEncryptedString {Value = "The real value"} - }; - - Assert.Throws(() => mutator.MutateIncoming(message)); - } - } - - [TestFixture] - public class When_receiving_a_message_with_a_encrypted_property_that_has_a_nonpublic_setter : - WireEncryptedStringContext - { - [Test] - public void Should_decrypt_correctly() - { - var message = new SecureMessageWithProtectedSetter(Create()); - mutator.MutateIncoming(message); - - Assert.AreEqual(message.Secret.Value, MySecretMessage); - } - } - - [TestFixture] - public class When_sending_a_message_with_2x_compatibility_disabled : WireEncryptedStringContext - { - [Test] - public void Should_clear_the_compatibility_properties() - { - ConfigureEncryption.DisableCompatibilityWithNSB2(null); - - var message = new Customer - { - Secret = MySecretMessage - }; - mutator.MutateOutgoing(message); - - Assert.AreEqual(message.Secret.EncryptedValue.EncryptedBase64Value, EncryptedBase64Value); - Assert.AreEqual(message.Secret.EncryptedBase64Value, null); - Assert.AreEqual(message.Secret.Base64Iv, null); - } - } - - [TestFixture] - public class When_decrypting_a_message_using_the_default_convention : WireEncryptedStringContext - { - [Test] - public void Should_use_the_wireencrypted_string() - { - var message = new Customer - { - Secret = Create(), - SecretField = Create(), - CreditCard = new CreditCardDetails {CreditCardNumber = Create()} - - }; - mutator.MutateIncoming(message); - - Assert.AreEqual(MySecretMessage, message.Secret.Value); - Assert.AreEqual(MySecretMessage, message.SecretField.Value); - Assert.AreEqual(MySecretMessage, message.CreditCard.CreditCardNumber.Value); - } - } - - - - [TestFixture] - public class When_sending_a_encrypted_message_without_a_encryption_service_configured : WireEncryptedStringContext - { - [Test] - public void Should_throw_an_exception() - { - mutator.EncryptionService = null; - Assert.Throws(() => mutator.MutateOutgoing(new Customer {Secret = "x"})); - } - } - - [TestFixture] - public class When_receiving_a_encrypted_message_without_a_encryption_service_configured : WireEncryptedStringContext - { - [Test] - public void Should_throw_an_exception() - { - mutator.EncryptionService = null; - Assert.Throws(() => mutator.MutateIncoming(new Customer {Secret = "x"})); - } - } - - [TestFixture] - public class When_sending_a_non_encrypted_message_without_a_encryption_service_configured : - WireEncryptedStringContext - { - [Test] - public void Should_not_throw_an_exception() - { - mutator.EncryptionService = null; - - Assert.DoesNotThrow(() => mutator.MutateOutgoing(new NonSecureMessage())); - } - } - - [TestFixture] - public class When_receiving_a_non_encrypted_message_without_a_encryption_service_configured : - WireEncryptedStringContext - { - [Test] - public void Should_not_throw_an_exception() - { - mutator.EncryptionService = null; - - Assert.DoesNotThrow(() => mutator.MutateIncoming(new NonSecureMessage())); - } - } - - [TestFixture] - public class When_sending_a_message_with_a_large_payload : - WireEncryptedStringContext - { - [Test] - public void Should_not_throw_an_exception() - { - mutator.EncryptionService = null; - - Assert.DoesNotThrow(() => mutator.MutateOutgoing(new MessageWithLargePayload{LargeByteArray = new byte[1000000]})); - } - } - - public class WireEncryptedStringContext - { - protected EncryptionMessageMutator mutator; - - public const string EncryptedBase64Value = "encrypted value"; - public const string MySecretMessage = "A secret"; - - [SetUp] - public void BaseSetUp() - { - mutator = new EncryptionMessageMutator - { - EncryptionService = new FakeEncryptionService(new EncryptedValue - { - EncryptedBase64Value = EncryptedBase64Value, - Base64Iv = "init_vector" - }) - }; - - MessageConventionExtensions.IsEncryptedPropertyAction = - property => typeof (WireEncryptedString).IsAssignableFrom(property.PropertyType); - } - - protected WireEncryptedString Create() - { - return new WireEncryptedString - { - EncryptedValue = new EncryptedValue - { - EncryptedBase64Value = EncryptedBase64Value, - Base64Iv = "init_vector" - } - }; - } - } - - public class NonSecureMessage : IMessage - { - public string NotASecret { get; set; } - } - - public class Customer : IMessage - { - public WireEncryptedString Secret { get; set; } - public WireEncryptedString SecretField; - public CreditCardDetails CreditCard { get; set; } - - public WireEncryptedString SecretThatIsNull { get; set; } - - public DateTime DateTime { get; set; } - - public List ListOfCreditCards { get; set; } - - public ArrayList ListOfSecrets { get; set; } - - public byte[] LargeByteArray{ get; set; } - } - - public class CreditCardDetails - { - public WireEncryptedString CreditCardNumber { get; set; } - } - - public class SecureMessageWithProtectedSetter : IMessage - { - public SecureMessageWithProtectedSetter(WireEncryptedString secret) - { - Secret = secret; - } - - public WireEncryptedString Secret { get; protected set; } - } - - public class MessageWithCircularReferences : IMessage - { - public SubProperty Child { get; set; } - - } - - public class MessageWithMissingData : IMessage - { - public WireEncryptedString Secret { get; set; } - } - - public class SubProperty - { - public MessageWithCircularReferences Parent { get; set; } - public WireEncryptedString Secret { get; set; } - public SubProperty Self { get; set; } - } - - - public class MessageWithLargePayload : IMessage - { - public byte[] LargeByteArray { get; set; } - } -} +namespace NServiceBus.Core.Tests.Encryption +{ + using System; + using System.Collections; + using System.Collections.Generic; + using NServiceBus.Encryption; + using NUnit.Framework; + + [TestFixture] + public class When_sending_a_message_using_the_default_convention : WireEncryptedStringContext + { + [Test] + public void Should_use_the_wireencrypted_string() + { + var message = new Customer + { + Secret = MySecretMessage, + SecretField = MySecretMessage, + CreditCard = new CreditCardDetails {CreditCardNumber = MySecretMessage}, + LargeByteArray = new byte[1000000], + ListOfCreditCards = + new List + { + new CreditCardDetails {CreditCardNumber = MySecretMessage}, + new CreditCardDetails {CreditCardNumber = MySecretMessage} + } + }; + message.ListOfSecrets = new ArrayList(message.ListOfCreditCards); + + mutator.MutateOutgoing(message); + + Assert.AreEqual(EncryptedBase64Value, message.Secret.EncryptedValue.EncryptedBase64Value); + Assert.AreEqual(EncryptedBase64Value, message.SecretField.EncryptedValue.EncryptedBase64Value); + Assert.AreEqual(EncryptedBase64Value, message.CreditCard.CreditCardNumber.EncryptedValue.EncryptedBase64Value); + Assert.AreEqual(EncryptedBase64Value, message.ListOfCreditCards[0].CreditCardNumber.EncryptedValue.EncryptedBase64Value); + Assert.AreEqual(EncryptedBase64Value, message.ListOfCreditCards[1].CreditCardNumber.EncryptedValue.EncryptedBase64Value); + + Assert.AreEqual(EncryptedBase64Value, ((CreditCardDetails)message.ListOfSecrets[0]).CreditCardNumber.EncryptedValue.EncryptedBase64Value); + Assert.AreEqual(EncryptedBase64Value, ((CreditCardDetails)message.ListOfSecrets[1]).CreditCardNumber.EncryptedValue.EncryptedBase64Value); + } + } + + [TestFixture] + public class When_encrypting_a_message_with_indexed_properties : WireEncryptedStringContext + { + [Test] + public void Should_encrypt_the_property_correctly() + { + var message = new MessageWithindexdProperties + { + Secret = MySecretMessage + }; + + message[0] = "boo"; + message[1] = "foo"; + + mutator.MutateOutgoing(message); + + Assert.AreEqual("boo", message[0]); + Assert.AreEqual("foo", message[1]); + Assert.AreEqual(EncryptedBase64Value, message.Secret.EncryptedValue.EncryptedBase64Value); + } + + public class MessageWithindexdProperties : IMessage + { + private readonly string[] indexedList = new string[2]; + + public string this[int index] + { + get { return indexedList[index]; } + set { indexedList[index] = value; } + } + + public WireEncryptedString Secret { get; set; } + } + } + + [TestFixture] + public class When_encrypting_a_message_with_WireEncryptedString_as_an_indexed_properties : WireEncryptedStringContext + { + [Test] + public void Should_throw_exception() + { + var message = new MessageWithindexdProperties(); + + message[0] = MySecretMessage; + message[1] = MySecretMessage; + + Assert.Throws(() => mutator.MutateOutgoing(message)); + } + + public class MessageWithindexdProperties : IMessage + { + private readonly WireEncryptedString[] indexedList = new WireEncryptedString[2]; + + public WireEncryptedString this[int index] + { + get { return indexedList[index]; } + set { indexedList[index] = value; } + } + } + } + + [TestFixture] + public class When_encrypting_a_message_with_circular_references : WireEncryptedStringContext + { + [Test] + public void Should_encrypt_the_property_correctly() + { + var child = new SubProperty {Secret = MySecretMessage}; + + var message = new MessageWithCircularReferences + { + Child = child + }; + child.Self = child; + child.Parent = message; + + mutator.MutateOutgoing(message); + + Assert.AreEqual(EncryptedBase64Value, message.Child.Secret.EncryptedValue.EncryptedBase64Value); + } + } + + [TestFixture] + public class When_decrypting_a_message_with_indexed_properties : WireEncryptedStringContext + { + [Test] + public void Should_decrypt_the_property_correctly() + { + var message = new MessageWithIndexProperties() + { + Secret = Create() + }; + + message[0] = "boo"; + message[1] = "foo"; + + mutator.MutateIncoming(message); + + Assert.AreEqual("boo", message[0]); + Assert.AreEqual("foo", message[1]); + Assert.AreEqual(MySecretMessage, message.Secret.Value); + } + + public class MessageWithIndexProperties : IMessage + { + private readonly string[] indexedList = new string[2]; + + public string this[int index] + { + get { return indexedList[index]; } + set { indexedList[index] = value; } + } + + public WireEncryptedString Secret { get; set; } + } + } + + [TestFixture] + public class When_decrypting_a_message_with_property_with_backing_public_field : WireEncryptedStringContext + { + [Test] + public void Should_decrypt_the_property_correctly() + { + var message = new MessageWithPropertyWithBackingPublicField + { + MySecret = Create(), + + }; + + mutator.MutateIncoming(message); + + Assert.AreEqual(MySecretMessage, message.MySecret.Value); + } + + public class MessageWithPropertyWithBackingPublicField : IMessage + { + public WireEncryptedString mySuperSecret; + + public WireEncryptedString MySecret + { + get { return mySuperSecret; } + set { mySuperSecret = value; } + } + } + } + + [TestFixture] + public class When_decrypting_a_message_with_circular_references : WireEncryptedStringContext + { + [Test] + public void Should_decrypt_the_property_correctly() + { + var child = new SubProperty {Secret = Create()}; + + var message = new MessageWithCircularReferences + { + Child = child + }; + child.Self = child; + child.Parent = message; + + mutator.MutateIncoming(message); + + Assert.AreEqual(message.Child.Secret.Value, MySecretMessage); + + + } + } + + [TestFixture] + public class When_decrypting_a_member_that_is_missing_encryption_data : WireEncryptedStringContext + { + [Test] + public void Should_throw_an_exception() + { + + var message = new MessageWithMissingData + { + Secret = new WireEncryptedString {Value = "The real value"} + }; + + Assert.Throws(() => mutator.MutateIncoming(message)); + } + } + + [TestFixture] + public class When_receiving_a_message_with_a_encrypted_property_that_has_a_nonpublic_setter : + WireEncryptedStringContext + { + [Test] + public void Should_decrypt_correctly() + { + var message = new SecureMessageWithProtectedSetter(Create()); + mutator.MutateIncoming(message); + + Assert.AreEqual(message.Secret.Value, MySecretMessage); + } + } + + [TestFixture] + public class When_sending_a_message_with_2x_compatibility_disabled : WireEncryptedStringContext + { + [Test] + public void Should_clear_the_compatibility_properties() + { + var message = new Customer + { + Secret = MySecretMessage + }; + mutator.MutateOutgoing(message); + + Assert.AreEqual(message.Secret.EncryptedValue.EncryptedBase64Value, EncryptedBase64Value); + Assert.AreEqual(message.Secret.EncryptedBase64Value, null); + Assert.AreEqual(message.Secret.Base64Iv, null); + } + } + + [TestFixture] + public class When_decrypting_a_message_using_the_default_convention : WireEncryptedStringContext + { + [Test] + public void Should_use_the_wireencrypted_string() + { + var message = new Customer + { + Secret = Create(), + SecretField = Create(), + CreditCard = new CreditCardDetails {CreditCardNumber = Create()} + + }; + mutator.MutateIncoming(message); + + Assert.AreEqual(MySecretMessage, message.Secret.Value); + Assert.AreEqual(MySecretMessage, message.SecretField.Value); + Assert.AreEqual(MySecretMessage, message.CreditCard.CreditCardNumber.Value); + } + } + + + + [TestFixture] + public class When_sending_a_encrypted_message_without_a_encryption_service_configured : WireEncryptedStringContext + { + [Test] + public void Should_throw_an_exception() + { + mutator.EncryptionService = null; + Assert.Throws(() => mutator.MutateOutgoing(new Customer {Secret = "x"})); + } + } + + [TestFixture] + public class When_receiving_a_encrypted_message_without_a_encryption_service_configured : WireEncryptedStringContext + { + [Test] + public void Should_throw_an_exception() + { + mutator.EncryptionService = null; + Assert.Throws(() => mutator.MutateIncoming(new Customer {Secret = "x"})); + } + } + + [TestFixture] + public class When_sending_a_non_encrypted_message_without_a_encryption_service_configured : + WireEncryptedStringContext + { + [Test] + public void Should_not_throw_an_exception() + { + mutator.EncryptionService = null; + + Assert.DoesNotThrow(() => mutator.MutateOutgoing(new NonSecureMessage())); + } + } + + [TestFixture] + public class When_receiving_a_non_encrypted_message_without_a_encryption_service_configured : + WireEncryptedStringContext + { + [Test] + public void Should_not_throw_an_exception() + { + mutator.EncryptionService = null; + + Assert.DoesNotThrow(() => mutator.MutateIncoming(new NonSecureMessage())); + } + } + + [TestFixture] + public class When_sending_a_message_with_a_large_payload : + WireEncryptedStringContext + { + [Test] + public void Should_not_throw_an_exception() + { + mutator.EncryptionService = null; + + Assert.DoesNotThrow(() => mutator.MutateOutgoing(new MessageWithLargePayload{LargeByteArray = new byte[1000000]})); + } + } + + public class WireEncryptedStringContext + { + protected EncryptionMessageMutator mutator; + + public const string EncryptedBase64Value = "encrypted value"; + public const string MySecretMessage = "A secret"; + + [SetUp] + public void BaseSetUp() + { + mutator = new EncryptionMessageMutator + { + EncryptionService = new FakeEncryptionService(new EncryptedValue + { + EncryptedBase64Value = EncryptedBase64Value, + Base64Iv = "init_vector" + }) + }; + + MessageConventionExtensions.IsEncryptedPropertyAction = + property => typeof (WireEncryptedString).IsAssignableFrom(property.PropertyType); + } + + protected WireEncryptedString Create() + { + return new WireEncryptedString + { + EncryptedValue = new EncryptedValue + { + EncryptedBase64Value = EncryptedBase64Value, + Base64Iv = "init_vector" + } + }; + } + } + + public class NonSecureMessage : IMessage + { + public string NotASecret { get; set; } + } + + public class Customer : IMessage + { + public WireEncryptedString Secret { get; set; } + public WireEncryptedString SecretField; + public CreditCardDetails CreditCard { get; set; } + + public WireEncryptedString SecretThatIsNull { get; set; } + + public DateTime DateTime { get; set; } + + public List ListOfCreditCards { get; set; } + + public ArrayList ListOfSecrets { get; set; } + + public byte[] LargeByteArray{ get; set; } + } + + public class CreditCardDetails + { + public WireEncryptedString CreditCardNumber { get; set; } + } + + public class SecureMessageWithProtectedSetter : IMessage + { + public SecureMessageWithProtectedSetter(WireEncryptedString secret) + { + Secret = secret; + } + + public WireEncryptedString Secret { get; protected set; } + } + + public class MessageWithCircularReferences : IMessage + { + public SubProperty Child { get; set; } + + } + + public class MessageWithMissingData : IMessage + { + public WireEncryptedString Secret { get; set; } + } + + public class SubProperty + { + public MessageWithCircularReferences Parent { get; set; } + public WireEncryptedString Secret { get; set; } + public SubProperty Self { get; set; } + } + + + public class MessageWithLargePayload : IMessage + { + public byte[] LargeByteArray { get; set; } + } +} diff --git a/src/scheduling/NServiceBus.Scheduling.Tests/FakeBus.cs b/src/NServiceBus.Core.Tests/Fakes/FakeBus.cs similarity index 88% rename from src/scheduling/NServiceBus.Scheduling.Tests/FakeBus.cs rename to src/NServiceBus.Core.Tests/Fakes/FakeBus.cs index e2b754aa1ef..2bcb5220f72 100644 --- a/src/scheduling/NServiceBus.Scheduling.Tests/FakeBus.cs +++ b/src/NServiceBus.Core.Tests/Fakes/FakeBus.cs @@ -1,8 +1,9 @@ -using System; -using System.Collections.Generic; - -namespace NServiceBus.Scheduling.Tests +namespace NServiceBus.Core.Tests.Fakes { + using System; + using System.Collections.Generic; + using System.Threading; + public class FakeBus : IBus { public T CreateInstance() @@ -127,7 +128,7 @@ public ICallback SendToSites(IEnumerable siteKeys, params object[] messa public ICallback Defer(TimeSpan delay, params object[] messages) { - _deferWasCalled++; + Interlocked.Increment(ref _deferWasCalled); _deferDelay = delay; _deferMessages = messages; return null; @@ -157,7 +158,7 @@ public DateTime DeferProcessAt } public ICallback Defer(DateTime processAt, params object[] messages) { - _deferWasCalled++; + Interlocked.Increment(ref _deferWasCalled); _deferProcessAt = processAt; _deferMessages = messages; return null; @@ -202,5 +203,27 @@ public IMessageContext CurrentMessageContext { get { throw new NotImplementedException(); } } + + public IInMemoryOperations InMemory + { + get { throw new NotImplementedException(); } + } + + public void Shutdown() + { + throw new NotImplementedException(); + } + + public IBus Start(Action startupAction) + { + throw new NotImplementedException(); + } + + public IBus Start() + { + throw new NotImplementedException(); + } + + public event EventHandler Started; } } \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Fakes/FakeFailureManager.cs b/src/NServiceBus.Core.Tests/Fakes/FakeFailureManager.cs new file mode 100644 index 00000000000..7cd29eaaf21 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Fakes/FakeFailureManager.cs @@ -0,0 +1,23 @@ +namespace NServiceBus.Core.Tests.Fakes +{ + using System; + using NServiceBus.Faults; + + public class FakeFailureManager : IManageMessageFailures + { + public void SerializationFailedForMessage(TransportMessage message, Exception e) + { + + } + + public void ProcessingAlwaysFailsForMessage(TransportMessage message, Exception e) + { + + } + + public void Init(Address address) + { + + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Fakes/FakeReceiver.cs b/src/NServiceBus.Core.Tests/Fakes/FakeReceiver.cs new file mode 100644 index 00000000000..5ef3b7ff25d --- /dev/null +++ b/src/NServiceBus.Core.Tests/Fakes/FakeReceiver.cs @@ -0,0 +1,48 @@ +namespace NServiceBus.Core.Tests.Fakes +{ + using System; + using Transports; + using Unicast.Transport; + + public class FakeReceiver : IDequeueMessages + { + public void FakeMessageReceived() + { + FakeMessageReceived(new TransportMessage()); + } + + public void FakeMessageReceived(TransportMessage message) + { + if (TryProcessMessage(message)) + NumMessagesReceived++; + } + + + public void Init(Address address, TransactionSettings transactionSettings, Func tryProcessMessage, Action endProcessMessage) + { + InputAddress = address; + TryProcessMessage = tryProcessMessage; + } + + public void Start(int maximumConcurrencyLevel) + { + IsStarted = true; + NumberOfTimesStarted++; + } + + public void Stop() + { + + } + + public int NumberOfTimesStarted { get; set; } + + + Func TryProcessMessage; + public int NumMessagesReceived; + + public bool IsStarted { get; set; } + + public Address InputAddress { get; set; } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Fakes/FakeTransport.cs b/src/NServiceBus.Core.Tests/Fakes/FakeTransport.cs new file mode 100644 index 00000000000..3fa7c2be584 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Fakes/FakeTransport.cs @@ -0,0 +1,76 @@ +namespace NServiceBus.Core.Tests.Fakes +{ + using System; + using Unicast.Transport; + + public class FakeTransport : ITransport + { + public void Dispose() + { + throw new NotImplementedException(); + } + + public void Stop() + { + } + + public void Start(string inputqueue) + { + Start(Address.Parse(inputqueue)); + } + + public bool IsStarted { get; set; } + public Address InputAddress { get; set; } + public void Start(Address localAddress) + { + IsStarted = true; + InputAddress = localAddress; + } + + public int HasChangedMaximumConcurrencyLevelNTimes { get; set; } + + public int MaximumConcurrencyLevel { get; private set; } + + public void ChangeNumberOfWorkerThreads(int targetNumberOfWorkerThreads) + { + ChangeMaximumConcurrencyLevel(targetNumberOfWorkerThreads); + } + + public void ChangeMaximumConcurrencyLevel(int maximumConcurrencyLevel) + { + MaximumConcurrencyLevel = maximumConcurrencyLevel; + HasChangedMaximumConcurrencyLevelNTimes++; + } + + public void AbortHandlingCurrentMessage() + { + throw new NotImplementedException(); + } + + public int NumberOfWorkerThreads { get; set; } + + public int MaxThroughputPerSecond { get; set; } + + public int MaximumMessageThroughputPerSecond { get; private set; } + + public bool IsEventAssiged + { + get { return TransportMessageReceived != null; } + } + + public void RaiseEvent(TransportMessage message) + { + TransportMessageReceived(this, new TransportMessageReceivedEventArgs(message)); + } + + public void ChangeMaximumMessageThroughputPerSecond(int maximumMessageThroughputPerSecond) + { + throw new NotImplementedException(); + } + + public event EventHandler TransportMessageReceived; + public event EventHandler StartedMessageProcessing; + public event EventHandler FinishedMessageProcessing; + public event EventHandler FailedMessageProcessing; + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Features/FeatureCategories.cs b/src/NServiceBus.Core.Tests/Features/FeatureCategories.cs new file mode 100644 index 00000000000..4107951a084 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Features/FeatureCategories.cs @@ -0,0 +1,37 @@ +namespace NServiceBus.Core.Tests.Features +{ + using System.Collections.Generic; + using NServiceBus.Features; + using NUnit.Framework; + + [TestFixture] + public class FeatureCategories + { + [Test] + public void Equality() + { + Assert.AreEqual(new MyCategory(),new MyCategory()); + + + + Assert.True(new MyCategory() == new MyCategory()); + Assert.AreNotEqual(new AnotherCategory(), new MyCategory()); + + var collection = new List{new MyCategory(), new AnotherCategory(), FeatureCategory.None}; + + + Assert.Contains(new MyCategory(), collection); + } + + class MyCategory:FeatureCategory + { + + + } + + class AnotherCategory : FeatureCategory + { + + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/FuncBuilder.cs b/src/NServiceBus.Core.Tests/FuncBuilder.cs new file mode 100644 index 00000000000..4d38b6dd029 --- /dev/null +++ b/src/NServiceBus.Core.Tests/FuncBuilder.cs @@ -0,0 +1,88 @@ +namespace NServiceBus.Core.Tests +{ + using System; + using System.Collections.Generic; + using System.Linq; + using ObjectBuilder; + + public class FuncBuilder : IBuilder + { + readonly IList>> funcs = new List>>(); + + public void Dispose() + { + + } + + public void Register(Func func) + { + Register(typeof(T), func); + } + + public void Register(Type t, Func func) + { + funcs.Add(new Tuple>(t, func)); + } + + public object Build(Type typeToBuild) + { + var fn = funcs.FirstOrDefault(f => f.Item1 == typeToBuild); + + if (fn == null) + { + var @interface = typeToBuild.GetInterfaces().FirstOrDefault(); + if (@interface != null) + { + fn = funcs.FirstOrDefault(f => f.Item1 == @interface); + } + } + + var obj = fn.Item2(); + + //enable property injection + obj.GetType().GetProperties() + .Select(p => p.PropertyType) + .Intersect(funcs.Select(f => f.Item1)).ToList() + .ForEach(propertyTypeToSet => obj.GetType().GetProperties().First(p => p.PropertyType == propertyTypeToSet) + .SetValue(obj, Build(propertyTypeToSet), null)); + + return obj; + } + + public IBuilder CreateChildBuilder() + { + return this; + } + + public T Build() + { + return (T)Build(typeof(T)); + } + + public IEnumerable BuildAll() + { + return funcs.Where(f => f.Item1 == typeof(T)) + .Select(f => (T)f.Item2()) + .ToList(); + } + + public IEnumerable BuildAll(Type typeToBuild) + { + return funcs.Where(f => f.Item1 == typeToBuild) + .Select(f => f.Item2()) + .ToList(); + } + + public void Release(object instance) + { + + } + + public void BuildAndDispatch(Type typeToBuild, Action action) + { + var obj = Build(typeToBuild); + + action(obj); + } + } +} diff --git a/src/NServiceBus.Core.Tests/Gateway/Config/When_routing_using_the_configuration_source.cs b/src/NServiceBus.Core.Tests/Gateway/Config/When_routing_using_the_configuration_source.cs new file mode 100644 index 00000000000..f18b6f56846 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Gateway/Config/When_routing_using_the_configuration_source.cs @@ -0,0 +1,50 @@ +using NUnit.Framework; + +namespace NServiceBus.Gateway.Tests.Routing +{ + using System.Collections.Generic; + using System.Linq; + using Channels; + using Receiving; + + [TestFixture] + public class When_using_the_configuration_bases_channel_manager + { + IManageReceiveChannels config; + IEnumerable activeChannels; + Channel defaultChannel; + + [SetUp] + public void SetUp() + { + config = new ConfigurationBasedChannelManager(); + activeChannels = config.GetReceiveChannels(); + defaultChannel = config.GetDefaultChannel(); + + } + + [Test] + public void Should_read_the_channels_from_the_configsource() + { + Assert.AreEqual(activeChannels.Count(), 3); + } + + [Test] + public void Should_default_the_number_of_worker_threads_to_1() + { + Assert.AreEqual(activeChannels.First().NumberOfWorkerThreads, 1); + } + + [Test] + public void Should_allow_number_of_worker_threads_to_be_specified() + { + Assert.AreEqual(activeChannels.Last().NumberOfWorkerThreads, 3); + } + + [Test] + public void Should_default_to_the_first_channel_if_no_default_is_set() + { + Assert.AreEqual(activeChannels.First(), defaultChannel); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Gateway/FakeMessageSender.cs b/src/NServiceBus.Core.Tests/Gateway/FakeMessageSender.cs new file mode 100644 index 00000000000..84194308b9f --- /dev/null +++ b/src/NServiceBus.Core.Tests/Gateway/FakeMessageSender.cs @@ -0,0 +1,41 @@ +namespace NServiceBus.Gateway.Tests +{ + using System; + using System.Threading; + using Transports; + using Unicast.Queuing; + + public class FakeMessageSender : ISendMessages + { + public FakeMessageSender() + { + messageReceived = new ManualResetEvent(false); + } + + void ISendMessages.Send(TransportMessage message, Address address) + { + details = new SendDetails + { + Destination = address, + Message = message + }; + + messageReceived.Set(); + } + + public SendDetails GetResultingMessage() + { + messageReceived.WaitOne(TimeSpan.FromSeconds(200)); + return details; + } + + SendDetails details; + readonly ManualResetEvent messageReceived; + + public class SendDetails + { + public TransportMessage Message { get; set; } + public Address Destination { get; set; } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Gateway/FakeTransport.cs b/src/NServiceBus.Core.Tests/Gateway/FakeTransport.cs new file mode 100644 index 00000000000..32094ae6463 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Gateway/FakeTransport.cs @@ -0,0 +1,72 @@ +namespace NServiceBus.Gateway.Tests +{ + using System; + using Unicast.Transport; + + public class FakeTransport : ITransport + { + public void Dispose() + { + } + + public void Stop() + { + } + + public void Start(string inputqueue) + { + Start(Address.Parse(inputqueue)); + } + + public bool IsStarted { get; set; } + + public Address InputAddress { get; set; } + + public void Start(Address localAddress) + { + IsStarted = true; + InputAddress = localAddress; + } + + public int HasChangedMaximumConcurrencyLevelNTimes { get; set; } + + public int MaximumConcurrencyLevel { get; private set; } + + public void ChangeNumberOfWorkerThreads(int targetNumberOfWorkerThreads) + { + ChangeMaximumConcurrencyLevel(targetNumberOfWorkerThreads); + } + + public void ChangeMaximumConcurrencyLevel(int maximumConcurrencyLevel) + { + MaximumConcurrencyLevel = maximumConcurrencyLevel; + HasChangedMaximumConcurrencyLevelNTimes++; + } + + public void AbortHandlingCurrentMessage() + { + throw new NotImplementedException(); + } + + public int NumberOfWorkerThreads { get; private set; } + + public int MaxThroughputPerSecond { get; set; } + + public int MaximumMessageThroughputPerSecond { get; private set; } + + public void RaiseEvent(TransportMessage message) + { + TransportMessageReceived(this, new TransportMessageReceivedEventArgs(message)); + } + + public void ChangeMaximumMessageThroughputPerSecond(int maximumMessageThroughputPerSecond) + { + throw new NotImplementedException(); + } + + public event EventHandler TransportMessageReceived; + public event EventHandler StartedMessageProcessing; + public event EventHandler FinishedMessageProcessing; + public event EventHandler FailedMessageProcessing; + } +} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/HeaderManagement/When_receiving_a_message_from_another_site.cs b/src/NServiceBus.Core.Tests/Gateway/HeaderManagement/When_receiving_a_message_from_another_site.cs similarity index 92% rename from src/gateway/NServiceBus.Gateway.Tests/HeaderManagement/When_receiving_a_message_from_another_site.cs rename to src/NServiceBus.Core.Tests/Gateway/HeaderManagement/When_receiving_a_message_from_another_site.cs index ac3228d4af3..ce613400507 100644 --- a/src/gateway/NServiceBus.Gateway.Tests/HeaderManagement/When_receiving_a_message_from_another_site.cs +++ b/src/NServiceBus.Core.Tests/Gateway/HeaderManagement/When_receiving_a_message_from_another_site.cs @@ -1,14 +1,13 @@ namespace NServiceBus.Gateway.Tests.HeaderManagement -{ - using System.Collections.Generic; +{ + using System.Collections.Generic; + using Gateway.HeaderManagement; using NUnit.Framework; - using Gateway.HeaderManagement; - using Unicast.Transport; [TestFixture] public class When_receiving_a_message_from_another_site { - GatewayHeaderManager gatewayHeaderManager; + GatewayHeaderManager gatewayHeaderManager; TransportMessage incomingMessage; TransportMessage responseMessage; @@ -21,26 +20,22 @@ public void SetUp() { addressOfOriginatingEndpoint = Address.Parse( "EnpointLocatedInSiteA"); - - incomingMessage = new TransportMessage - { - Headers = new Dictionary(), - ReplyToAddress = addressOfOriginatingEndpoint + + incomingMessage = new TransportMessage + { + ReplyToAddress = addressOfOriginatingEndpoint }; - incomingMessage.Headers[Headers.OriginatingSite] = originatingSite; - incomingMessage.Headers[Headers.HttpFrom] = originatingSite; - + incomingMessage.Headers[Headers.OriginatingSite] = originatingSite; + incomingMessage.Headers[Headers.HttpFrom] = originatingSite; gatewayHeaderManager = new GatewayHeaderManager(); gatewayHeaderManager.MutateIncoming(incomingMessage); responseMessage = new TransportMessage { - Headers = new Dictionary(), CorrelationId = idOfIncommingMessage }; - } [Test] diff --git a/src/gateway/NServiceBus.Gateway.Tests/Idempotency/Raven/When_acking_an_already_acked_message.cs b/src/NServiceBus.Core.Tests/Gateway/Idempotency/Raven/When_acking_an_already_acked_message.cs similarity index 100% rename from src/gateway/NServiceBus.Gateway.Tests/Idempotency/Raven/When_acking_an_already_acked_message.cs rename to src/NServiceBus.Core.Tests/Gateway/Idempotency/Raven/When_acking_an_already_acked_message.cs diff --git a/src/NServiceBus.Core.Tests/Gateway/Idempotency/Raven/When_acking_an_existing_message.cs b/src/NServiceBus.Core.Tests/Gateway/Idempotency/Raven/When_acking_an_existing_message.cs new file mode 100644 index 00000000000..4b4baca05e9 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Gateway/Idempotency/Raven/When_acking_an_existing_message.cs @@ -0,0 +1,86 @@ +namespace NServiceBus.Gateway.Tests.Idempotency.Raven +{ + using System.Collections.Generic; + using System.IO; + using System.Messaging; + using System.Threading; + using System.Transactions; + using NUnit.Framework; + using Persistence.Raven; + + [TestFixture] + public class When_acking_an_existing_message : in_the_raven_storage + { + const string QueueAddress = "FormatName:DIRECT=OS:win2008r2\\private$\\headquarter.gateway"; + + + [Test] + public void Should_return_the_message_and_headers() + { + var message = CreateTestMessage(); + + Store(message); + + byte[] msg; + + IDictionary headers; + + using (var tx = new TransactionScope()) + { + ravenPersister.AckMessage(message.ClientId, out msg, out headers); + tx.Complete(); + } + + Assert.AreEqual(message.Headers, headers); + Assert.AreEqual(message.OriginalMessage, msg); + } + + [Test] + public void Should_mark_the_message_as_acked() + { + var message = CreateTestMessage(); + + Store(message); + + byte[] msg; + + IDictionary headers; + + ravenPersister.AckMessage(message.ClientId, out msg, out headers); + + Assert.True(GetStoredMessage(message.ClientId).Acknowledged); + } + + [Test, Category("Integration")] + public void Raven_dtc_bug() + { + new MessageQueue(QueueAddress, QueueAccessMode.ReceiveAndAdmin) + .Purge(); + + using (var tx = new TransactionScope()) + { + + using (var session = store.OpenSession()) + { + session.Store(new GatewayMessage()); + session.SaveChanges(); + } + + using (var q = new MessageQueue(QueueAddress, QueueAccessMode.Send)) + { + var toSend = new Message { BodyStream = new MemoryStream(new byte[8]) }; + + //sending a message to a msmq queue causes raven to promote the tx + q.Send(toSend, MessageQueueTransactionType.Automatic); + } + + //when we complete raven commits it tx but the DTC tx is never commited and eventually times out + tx.Complete(); + } + Thread.Sleep(1000); + + Assert.AreEqual(1,new MessageQueue(QueueAddress, QueueAccessMode.ReceiveAndAdmin) + .GetAllMessages().Length); + } + } +} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/Idempotency/Raven/When_storing_a_duplicate_message.cs b/src/NServiceBus.Core.Tests/Gateway/Idempotency/Raven/When_storing_a_duplicate_message.cs similarity index 100% rename from src/gateway/NServiceBus.Gateway.Tests/Idempotency/Raven/When_storing_a_duplicate_message.cs rename to src/NServiceBus.Core.Tests/Gateway/Idempotency/Raven/When_storing_a_duplicate_message.cs diff --git a/src/gateway/NServiceBus.Gateway.Tests/Idempotency/Raven/When_storing_a_new_message.cs b/src/NServiceBus.Core.Tests/Gateway/Idempotency/Raven/When_storing_a_new_message.cs similarity index 100% rename from src/gateway/NServiceBus.Gateway.Tests/Idempotency/Raven/When_storing_a_new_message.cs rename to src/NServiceBus.Core.Tests/Gateway/Idempotency/Raven/When_storing_a_new_message.cs diff --git a/src/gateway/NServiceBus.Gateway.Tests/Idempotency/Raven/When_updating_a_header_of_message.cs b/src/NServiceBus.Core.Tests/Gateway/Idempotency/Raven/When_updating_a_header_of_message.cs similarity index 100% rename from src/gateway/NServiceBus.Gateway.Tests/Idempotency/Raven/When_updating_a_header_of_message.cs rename to src/NServiceBus.Core.Tests/Gateway/Idempotency/Raven/When_updating_a_header_of_message.cs diff --git a/src/gateway/NServiceBus.Gateway.Tests/Idempotency/Raven/in_the_raven_storage.cs b/src/NServiceBus.Core.Tests/Gateway/Idempotency/Raven/in_the_raven_storage.cs similarity index 90% rename from src/gateway/NServiceBus.Gateway.Tests/Idempotency/Raven/in_the_raven_storage.cs rename to src/NServiceBus.Core.Tests/Gateway/Idempotency/Raven/in_the_raven_storage.cs index 3aa45dd7c38..fbdf86392c1 100644 --- a/src/gateway/NServiceBus.Gateway.Tests/Idempotency/Raven/in_the_raven_storage.cs +++ b/src/NServiceBus.Core.Tests/Gateway/Idempotency/Raven/in_the_raven_storage.cs @@ -3,11 +3,11 @@ using System; using System.Collections.Generic; using System.IO; - using System.Transactions; - using global::Raven.Client; - using NUnit.Framework; + using NServiceBus.Persistence.Raven; using Persistence; using Persistence.Raven; + using global::Raven.Client; + using NUnit.Framework; using global::Raven.Client.Document; using global::Raven.Client.Embedded; @@ -21,10 +21,11 @@ public void SetUp() { store = new EmbeddableDocumentStore { RunInMemory = true }; //store = new DocumentStore { Url = "http://localhost:8080" }; + store.Conventions.DefaultQueryingConsistency = ConsistencyOptions.QueryYourWrites; store.Initialize(); - ravenPersister = new RavenDbPersistence(store); + ravenPersister = new RavenDbPersistence(new StoreAccessor(store)); } [TearDown] @@ -51,6 +52,7 @@ protected TestMessage GetStoredMessage(string clientId) { using (var session = store.OpenSession()) { + session.Advanced.AllowNonAuthoritativeInformation = false; var messageStored = session.Load(RavenDbPersistence.EscapeClientId(clientId)); return new TestMessage @@ -62,10 +64,8 @@ protected TestMessage GetStoredMessage(string clientId) Acknowledged = messageStored.Acknowledged }; } - } - protected TestMessage CreateTestMessage() { var headers = new Dictionary(); @@ -82,13 +82,10 @@ protected TestMessage CreateTestMessage() Headers = headers, OriginalMessage = new byte[] { 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 } - } - ; + }; } - } - public class TestMessage { public IDictionary Headers { get; set; } diff --git a/src/NServiceBus.Core.Tests/Gateway/InMemoryDataBus.cs b/src/NServiceBus.Core.Tests/Gateway/InMemoryDataBus.cs new file mode 100644 index 00000000000..1e67b5b763b --- /dev/null +++ b/src/NServiceBus.Core.Tests/Gateway/InMemoryDataBus.cs @@ -0,0 +1,68 @@ +namespace NServiceBus.Gateway.Tests +{ + using System.Collections.Generic; + using System.IO; + using System; + using DataBus; + + /// + /// In memory implementation of . + /// + public class InMemoryDataBus : IDataBus + { + private readonly IDictionary storage = new Dictionary(); + + /// + /// Gets a data item from the bus. + /// + /// The key to look for. + /// The data . + public Stream Get(string key) + { + lock (storage) + return new MemoryStream(storage[key].Data); + } + + /// + /// Adds a data item to the bus and returns the assigned key. + /// + /// A create containing the data to be sent on the databus. + /// The time to be received specified on the message type. TimeSpan.MaxValue is the default. + public string Put(Stream stream, TimeSpan timeToBeReceived) + { + var key = Guid.NewGuid().ToString(); + + var data = new byte[stream.Length]; + stream.Read(data, 0, (int) stream.Length); + + lock (storage) + storage.Add(key, new Entry + { + Data = data, + ExpireAt = DateTime.Now + timeToBeReceived + }); + return key; + } + + /// + /// Called when the bus starts up to allow the data bus to active background tasks. + /// + public void Start() + { + //no-op + } + + //used for test purposes + public Entry Peek(string key) + { + lock (storage) + return storage[key]; + } + + public class Entry + { + public byte[] Data; + public DateTime ExpireAt; + } + } +} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/RegularMessage.cs b/src/NServiceBus.Core.Tests/Gateway/RegularMessage.cs similarity index 100% rename from src/gateway/NServiceBus.Gateway.Tests/RegularMessage.cs rename to src/NServiceBus.Core.Tests/Gateway/RegularMessage.cs diff --git a/src/gateway/NServiceBus.Gateway.Tests/Routing/When_routing_a_reply_message.cs b/src/NServiceBus.Core.Tests/Gateway/Routing/When_routing_a_reply_message.cs similarity index 83% rename from src/gateway/NServiceBus.Gateway.Tests/Routing/When_routing_a_reply_message.cs rename to src/NServiceBus.Core.Tests/Gateway/Routing/When_routing_a_reply_message.cs index de55c4c709f..7753f117527 100644 --- a/src/gateway/NServiceBus.Gateway.Tests/Routing/When_routing_a_reply_message.cs +++ b/src/NServiceBus.Core.Tests/Gateway/Routing/When_routing_a_reply_message.cs @@ -5,7 +5,6 @@ namespace NServiceBus.Gateway.Tests.Routing using Channels; using Gateway.Routing.Sites; using NUnit.Framework; - using Unicast.Transport; [TestFixture] public class When_routing_a_reply_message @@ -15,7 +14,7 @@ public void Should_return_the_correct_site_based_on_the_originating_site_header( { var router = new OriginatingSiteHeaderRouter(); - var message = new TransportMessage { Headers = new Dictionary() }; + var message = new TransportMessage(); var defaultChannel = new Channel { @@ -35,7 +34,7 @@ public void Should_return_empty_list_if_header_is_missing() { var router = new OriginatingSiteHeaderRouter(); - var message = new TransportMessage { Headers = new Dictionary() }; + var message = new TransportMessage(); Assert.AreEqual(0, router.GetDestinationSitesFor(message).Count()); } diff --git a/src/NServiceBus.Core.Tests/Gateway/Routing/When_routing_using_the_configuration_source.cs b/src/NServiceBus.Core.Tests/Gateway/Routing/When_routing_using_the_configuration_source.cs new file mode 100644 index 00000000000..925ddcd068d --- /dev/null +++ b/src/NServiceBus.Core.Tests/Gateway/Routing/When_routing_using_the_configuration_source.cs @@ -0,0 +1,36 @@ +using NUnit.Framework; + +namespace NServiceBus.Gateway.Tests.Routing +{ + using System.Linq; + using System.Reflection; + using Channels; + using Gateway.Routing; + using Gateway.Routing.Sites; + + [TestFixture] + public class When_routing_using_the_configuration_source + { + IRouteMessagesToSites router; + + [SetUp] + public void SetUp() + { + Configure.With(new Assembly[] {}); + router = new ConfigurationBasedSiteRouter(); + } + + [Test] + public void Should_read_sites_and_their_keys_from_the_configsource() + { + + var message = new TransportMessage(); + + message.Headers.Add(Headers.DestinationSites, "SiteA"); + + var sites = router.GetDestinationSitesFor(message); + + Assert.AreEqual(new Channel{ Address = "http://sitea.com",Type = "http"},sites.First().Channel); + } + } +} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/When_a_message_is_sent.cs b/src/NServiceBus.Core.Tests/Gateway/When_a_message_is_sent.cs similarity index 93% rename from src/gateway/NServiceBus.Gateway.Tests/When_a_message_is_sent.cs rename to src/NServiceBus.Core.Tests/Gateway/When_a_message_is_sent.cs index 4aa4a1d4a26..21e960ef35c 100644 --- a/src/gateway/NServiceBus.Gateway.Tests/When_a_message_is_sent.cs +++ b/src/NServiceBus.Core.Tests/Gateway/When_a_message_is_sent.cs @@ -1,12 +1,10 @@ namespace NServiceBus.Gateway.Tests { - using Channels; using NUnit.Framework; - [TestFixture] + [TestFixture, Ignore("Need to redo all this tests because the gateway is now a satellite!")] public class When_a_message_is_sent : via_the_gateway { - [Test] public void Should_send_the_message_to_the_specified_site() { @@ -27,8 +25,6 @@ public void Should_set_the_return_address_to_the_gateway_itself() Assert.AreEqual(receivedMessage.ReplyToAddress, GatewayAddressForSiteB); } - - [Test] public void Should_set_the_default_channel_as_the_originating_site() { diff --git a/src/gateway/NServiceBus.Gateway.Tests/When_a_message_with_a_databus_property_is_sent.cs b/src/NServiceBus.Core.Tests/Gateway/When_a_message_with_a_databus_property_is_sent.cs similarity index 93% rename from src/gateway/NServiceBus.Gateway.Tests/When_a_message_with_a_databus_property_is_sent.cs rename to src/NServiceBus.Core.Tests/Gateway/When_a_message_with_a_databus_property_is_sent.cs index dae77809e48..508328c9458 100644 --- a/src/gateway/NServiceBus.Gateway.Tests/When_a_message_with_a_databus_property_is_sent.cs +++ b/src/NServiceBus.Core.Tests/Gateway/When_a_message_with_a_databus_property_is_sent.cs @@ -5,7 +5,7 @@ using System.IO; using NUnit.Framework; - [TestFixture] + [TestFixture, Ignore("Need to redo all this tests because the gateway is now a satellite!")] public class When_a_message_with_a_databus_property_is_sent : via_the_gateway { [Test] diff --git a/src/NServiceBus.Core.Tests/Gateway/via_the_gateway.cs b/src/NServiceBus.Core.Tests/Gateway/via_the_gateway.cs new file mode 100644 index 00000000000..5dd0f27ab14 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Gateway/via_the_gateway.cs @@ -0,0 +1,134 @@ +namespace NServiceBus.Gateway.Tests +{ + using System; + using System.Collections.Generic; + using Channels; + using Channels.Http; + using Gateway.Routing; + using Gateway.Routing.Endpoints; + using Gateway.Routing.Sites; + using NUnit.Framework; + using Notifications; + using ObjectBuilder; + using Persistence; + using Receiving; + using Rhino.Mocks; + using Sending; + using Transports; + using Unicast.Queuing; + + public class via_the_gateway + { + protected Address GatewayAddressForSiteA = Address.Parse("SiteAEndpoint.gateway@masternode_in_site_a"); + protected const string HttpAddressForSiteA = "http://localhost:8090/Gateway/"; + + protected Address EndpointAddressForSiteB = Address.Parse("SiteBEndpoint@masternode_in_site_b"); + protected Address GatewayAddressForSiteB = Address.Parse("SiteBEndpoint.gateway@masternode_in_site_b"); + protected const string HttpAddressForSiteB = "http://localhost:8092/Gateway/"; + + protected InMemoryDataBus databusForSiteA; + protected InMemoryDataBus databusForSiteB; + + protected Channel defaultChannelForSiteA = new Channel {Address = HttpAddressForSiteA, Type = "http"}; + + [TearDown] + public void TearDown() + { + dispatcherInSiteA.Stop(); + receiverInSiteB.Stop(); + } + + [SetUp] + public void SetUp() + { + databusForSiteA = new InMemoryDataBus(); + databusForSiteB = new InMemoryDataBus(); + fakeTransport = new FakeTransport(); + + var builder = MockRepository.GenerateStub(); + + var channelFactory = new ChannelFactory(); + + channelFactory.RegisterReceiver(typeof(HttpChannelReceiver)); + + channelFactory.RegisterSender(typeof(HttpChannelSender)); + + + var channelManager = MockRepository.GenerateStub(); + channelManager.Stub(x => x.GetReceiveChannels()).Return(new[] {new ReceiveChannel() + { + Address = HttpAddressForSiteB, + Type = "http", + NumberOfWorkerThreads = 1 + }}); + channelManager.Stub(x => x.GetDefaultChannel()).Return(defaultChannelForSiteA); + + builder.Stub(x => x.Build()).Return(new IdempotentChannelForwarder(channelFactory) + { + DataBus = databusForSiteA + }); + + builder.Stub(x => x.Build()).Return(new IdempotentChannelReceiver(channelFactory, new InMemoryPersistence()) + { + DataBus = databusForSiteB + }); + + builder.Stub(x => x.BuildAll()).Return(new[] { new KeyPrefixConventionSiteRouter() }); + + messageSender = new FakeMessageSender(); + receiverInSiteB = new GatewayReceiver(); + receiverInSiteB.ChannelManager = channelManager; + receiverInSiteB.EndpointRouter = new DefaultEndpointRouter + { + MainInputAddress = EndpointAddressForSiteB + }; + receiverInSiteB.MessageSender = messageSender; + receiverInSiteB.builder = builder; + //receiverInSiteB.InputAddress = GatewayAddressForSiteA; + + dispatcherInSiteA = new GatewaySender(); + dispatcherInSiteA.ChannelManager = channelManager; + dispatcherInSiteA.Builder = builder; + dispatcherInSiteA.MessageSender = MockRepository.GenerateStub(); + dispatcherInSiteA.Notifier = MockRepository.GenerateStub(); + // dispatcherInSiteA.InputAddress = GatewayAddressForSiteA; + + dispatcherInSiteA.Start(); + receiverInSiteB.Start(); + } + + protected void SendMessage(string destinationSites) + { + SendMessage(destinationSites, new Dictionary()); + } + + protected void SendMessage(string destinationSites,Dictionary headers) + { + var message = new TransportMessage(Guid.NewGuid().ToString(),headers) + { + Body = new byte[500], + TimeToBeReceived = TimeSpan.FromDays(1), + ReplyToAddress = GatewayAddressForSiteA + }; + + message.Headers[Headers.DestinationSites] = destinationSites; + + SendMessage(message); + } + + protected void SendMessage(TransportMessage message) + { + fakeTransport.RaiseEvent(message); + } + + protected FakeMessageSender.SendDetails GetDetailsForReceivedMessage() + { + return messageSender.GetResultingMessage(); + } + + GatewaySender dispatcherInSiteA; + GatewayReceiver receiverInSiteB; + FakeTransport fakeTransport; + FakeMessageSender messageSender; + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Installers/PerformanceMonitorUsersInstallerTests.cs b/src/NServiceBus.Core.Tests/Installers/PerformanceMonitorUsersInstallerTests.cs new file mode 100644 index 00000000000..075e25f99f6 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Installers/PerformanceMonitorUsersInstallerTests.cs @@ -0,0 +1,17 @@ +namespace NServiceBus.Core.Tests.Installers +{ + using Installation; + using NUnit.Framework; + + [TestFixture] + public class PerformanceMonitorUsersInstallerTests + { + [Test] + [Explicit] + public void Integration() + { + var installer = new PerformanceMonitorUsersInstaller(); + installer.Install(@"location\username"); + } + } +} diff --git a/src/NServiceBus.Core.Tests/Installers/RavenUserInstallerTests.cs b/src/NServiceBus.Core.Tests/Installers/RavenUserInstallerTests.cs new file mode 100644 index 00000000000..17d913addef --- /dev/null +++ b/src/NServiceBus.Core.Tests/Installers/RavenUserInstallerTests.cs @@ -0,0 +1,66 @@ +namespace NServiceBus.Core.Tests.Installers +{ + using System; + using NServiceBus.Persistence.Raven; + using NUnit.Framework; + using Raven.Client.Document; + using Raven.Client.Embedded; + + [TestFixture] + public class RavenUserInstallerTests + { + [Test] + [Explicit("this will edit your current installed RavenDB")] + public void Integration() + { + using (var documentStore = new DocumentStore + { + Url = "http://localhost:8080", + DefaultDatabase = "Test" + }) + { + documentStore.Initialize(); + + var identity = Environment.MachineName + @"\Test"; + RavenUserInstaller.AddUserToDatabase(identity, documentStore); + } + } + + [Test] + public void EnsureUserIsAddedToWindowsSettings() + { + using (var documentStore = new EmbeddableDocumentStore + { + RunInMemory = true, + }) + { + documentStore.Initialize(); + RavenUserInstaller.AddUserToDatabase(@"domain\user", documentStore); + var systemCommands = documentStore + .DatabaseCommands + .ForSystemDatabase(); + var existing = systemCommands.Get("Raven/Authorization/WindowsSettings"); + + var expected = @"{ + ""RequiredGroups"": [], + ""RequiredUsers"": [ + { + ""Name"": ""domain\\user"", + ""Enabled"": true, + ""Databases"": [ + { + ""Admin"": true, + ""ReadOnly"": false, + ""TenantId"": """" + } + ] + } + ] +}".Replace("\r", String.Empty); + + var actual = existing.DataAsJson.ToString().Replace("\r", String.Empty); + Assert.AreEqual(expected, actual); + } + } + } +} diff --git a/src/NServiceBus.Core.Tests/Lib/TestAssembly.dll b/src/NServiceBus.Core.Tests/Lib/TestAssembly.dll new file mode 100644 index 00000000000..b4ccf67e457 Binary files /dev/null and b/src/NServiceBus.Core.Tests/Lib/TestAssembly.dll differ diff --git a/src/NServiceBus.Core.Tests/Msmq/MsmqUtilitiesTests.cs b/src/NServiceBus.Core.Tests/Msmq/MsmqUtilitiesTests.cs new file mode 100644 index 00000000000..4c22babe669 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Msmq/MsmqUtilitiesTests.cs @@ -0,0 +1,43 @@ +namespace NServiceBus.Core.Tests.Msmq +{ + using System; + using NUnit.Framework; + using Transports.Msmq; + + [TestFixture] + public class MsmqUtilitiesTests + { + [Test] + public void Should_convert_a_message_back_even_if_special_characters_are_contained_in_the_headers() + { + var expected = String.Format("Can u see this '{0}' character!", (char)0x19); + var transportMessage = new TransportMessage(); + transportMessage.Headers.Add("NServiceBus.ExceptionInfo.Message", expected); + + var message = MsmqUtilities.Convert(transportMessage); + var result = MsmqUtilities.Convert(message); + + Assert.AreEqual(expected, result.Headers["NServiceBus.ExceptionInfo.Message"]); + } + + [Test] + public void Should_convert_message_headers_that_contain_nulls_at_the_end() + { + var expected = "Hello World!"; + var transportMessage = new TransportMessage(); + transportMessage.Headers.Add("NServiceBus.ExceptionInfo.Message", expected); + + Console.Out.WriteLine(sizeof(char)); + var message = MsmqUtilities.Convert(transportMessage); + var bufferWithNULLs = new byte[message.Extension.Length + (10 * sizeof(char))]; + + Buffer.BlockCopy(message.Extension, 0, bufferWithNULLs, 0, bufferWithNULLs.Length - (10 * sizeof(char))); + + message.Extension = bufferWithNULLs; + + var result = MsmqUtilities.Convert(message); + + Assert.AreEqual(expected, result.Headers["NServiceBus.ExceptionInfo.Message"]); + } + } +} diff --git a/src/NServiceBus.Core.Tests/NServiceBus.Core.Tests.csproj b/src/NServiceBus.Core.Tests/NServiceBus.Core.Tests.csproj new file mode 100644 index 00000000000..0b55883b90c --- /dev/null +++ b/src/NServiceBus.Core.Tests/NServiceBus.Core.Tests.csproj @@ -0,0 +1,252 @@ + + + + + Debug + AnyCPU + {2C8F181B-9BAF-4858-968B-1C16F5DDCFA7} + Library + Properties + NServiceBus.Core.Tests + NServiceBus.Core.Tests + v4.0 + 512 + true + ..\NServiceBus.snk + ..\..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll + + + ..\..\packages\NUnit.2.6.2\lib\nunit.framework.dll + + + False + ..\..\packages\RavenDB.Client.2.0.2375\lib\net40\Raven.Abstractions.dll + + + False + ..\..\packages\RavenDB.Embedded.2.0.2375\lib\net40\Raven.Client.Embedded.dll + + + False + ..\..\packages\RavenDB.Client.2.0.2375\lib\net40\Raven.Client.Lightweight.dll + + + False + ..\..\packages\RavenDB.Database.2.0.2375\lib\net40\Raven.Database.dll + + + ..\..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll + + + + + + + + + + + + + + Lib\TestAssembly.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {dd48b2d0-e996-412d-9157-821ed8b17a9d} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + + + + + + + \ No newline at end of file diff --git a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/EqualityExtensions.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/EqualityExtensions.cs similarity index 84% rename from src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/EqualityExtensions.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/EqualityExtensions.cs index 850428fb75e..2ef581dc377 100644 --- a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/EqualityExtensions.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/EqualityExtensions.cs @@ -1,22 +1,22 @@ -using System; - -namespace NServiceBus.SagaPersisters.Raven.Tests -{ - public static class EqualityExtensions - { - public static bool EqualTo(this T item, object obj, Func equals) - { - if (!(obj is T)) return false; - - var x = (T)obj; - - if (item != null && x == null) return false; - - if (item == null && x != null) return false; - - if (item == null && x == null) return true; - - return equals(item, x); - } - } +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using System; + + public static class EqualityExtensions + { + public static bool EqualTo(this T item, object obj, Func equals) + { + if (!(obj is T)) return false; + + var x = (T)obj; + + if (item != null && x == null) return false; + + if (item == null && x != null) return false; + + if (item == null && x == null) return true; + + return equals(item, x); + } + } } \ No newline at end of file diff --git a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/Persisting_a_saga_entity_with_a_raven_saga_persister.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/Persisting_a_saga_entity_with_a_raven_saga_persister.cs similarity index 77% rename from src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/Persisting_a_saga_entity_with_a_raven_saga_persister.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/Persisting_a_saga_entity_with_a_raven_saga_persister.cs index caa354d9e3e..6751d1d9c6d 100644 --- a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/Persisting_a_saga_entity_with_a_raven_saga_persister.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/Persisting_a_saga_entity_with_a_raven_saga_persister.cs @@ -1,30 +1,27 @@ -using System; -using NUnit.Framework; -using Raven.Storage.Managed; - -namespace NServiceBus.SagaPersisters.Raven.Tests -{ - using global::Raven.Client.Embedded; - - public abstract class Persisting_a_saga_entity_with_a_raven_saga_persister : Raven_saga_persistence_concern - { - protected TestSaga entity; - protected TestSaga savedEntity; - - [TestFixtureSetUp] - public override void Setup() - { - base.Setup(); - - entity = new TestSaga { Id = Guid.NewGuid() }; - - SetupEntity(entity); - - WithASagaPersistenceUnitOfWork(p => p.Save(entity)); - - WithASagaPersistenceUnitOfWork(p => savedEntity = p.Get(entity.Id)); - } - - public abstract void SetupEntity(TestSaga saga); - } +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using System; + using NUnit.Framework; + + public abstract class Persisting_a_saga_entity_with_a_raven_saga_persister : Raven_saga_persistence_concern + { + protected TestSaga entity; + protected TestSaga savedEntity; + + [TestFixtureSetUp] + public override void Setup() + { + base.Setup(); + + entity = new TestSaga { Id = Guid.NewGuid() }; + + SetupEntity(entity); + + WithASagaPersistenceUnitOfWork(p => p.Save(entity)); + + WithASagaPersistenceUnitOfWork(p => savedEntity = p.Get(entity.Id)); + } + + public abstract void SetupEntity(TestSaga saga); + } } \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/Raven_saga_persistence_concern.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/Raven_saga_persistence_concern.cs new file mode 100644 index 00000000000..9814bab8d74 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/Raven_saga_persistence_concern.cs @@ -0,0 +1,73 @@ +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using System; + using NServiceBus.Persistence.Raven; + using NServiceBus.Persistence.Raven.SagaPersister; + using NUnit.Framework; + using Raven.Client; + using Raven.Client.Embedded; + using NServiceBus.Saga; + + public abstract class Raven_saga_persistence_concern + { + protected IDocumentStore store; + + [TestFixtureSetUp] + public virtual void Setup() + { + store = new EmbeddableDocumentStore { RunInMemory = true }; + + store.Initialize(); + } + + [TestFixtureTearDown] + public void Teardown() + { + store.Dispose(); + } + + public void WithASagaPersistenceUnitOfWork(Action action) + { + var sessionFactory = new RavenSessionFactory(new StoreAccessor(store)); + + try + { + var sagaPersister = new RavenSagaPersister(sessionFactory); + action(sagaPersister); + + sessionFactory.SaveChanges(); + } + finally + { + sessionFactory.ReleaseSession(); + + } + } + + protected void SaveSaga(T saga) where T : IContainSagaData + { + WithASagaPersistenceUnitOfWork(p => p.Save(saga)); + } + + protected void CompleteSaga(Guid sagaId) where T : IContainSagaData + { + WithASagaPersistenceUnitOfWork(p => + { + var saga = p.Get(sagaId); + Assert.NotNull(saga, "Could not complete saga. Saga not found"); + p.Complete(saga); + }); + } + + protected void UpdateSaga(Guid sagaId, Action update) where T : IContainSagaData + { + WithASagaPersistenceUnitOfWork(p => + { + var saga = p.Get(sagaId); + Assert.NotNull(saga, "Could not update saga. Saga not found"); + update(saga); + p.Update(saga); + }); + } + } +} diff --git a/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/SagaWithUniqueProperty.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/SagaWithUniqueProperty.cs new file mode 100644 index 00000000000..21caf3ca5d8 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/SagaWithUniqueProperty.cs @@ -0,0 +1,19 @@ +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using System; + using NServiceBus.Saga; + + public class SagaWithUniqueProperty : IContainSagaData + { + public virtual Guid Id { get; set; } + + public virtual string Originator { get; set; } + + public virtual string OriginalMessageId { get; set; } + + [Unique] + public virtual string UniqueString { get; set; } + + public string NonUniqueString { get; set; } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/SagaWithUniquePropertyAndALongNamespace.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/SagaWithUniquePropertyAndALongNamespace.cs new file mode 100644 index 00000000000..d613f0e6512 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/SagaWithUniquePropertyAndALongNamespace.cs @@ -0,0 +1,18 @@ +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using System; + using NServiceBus.Saga; + + public class SagaWithUniquePropertyAndALongNamespace : IContainSagaData + { + public virtual Guid Id { get; set; } + + public virtual string Originator { get; set; } + + public virtual string OriginalMessageId { get; set; } + + [Unique] + public virtual string UniqueString { get; set; } + + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/SagaWithoutUniqueProperties.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/SagaWithoutUniqueProperties.cs new file mode 100644 index 00000000000..1e118e672d1 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/SagaWithoutUniqueProperties.cs @@ -0,0 +1,18 @@ +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using System; + using NServiceBus.Saga; + + public class SagaWithoutUniqueProperties : IContainSagaData + { + public virtual Guid Id { get; set; } + + public virtual string Originator { get; set; } + + public virtual string OriginalMessageId { get; set; } + + public virtual string UniqueString { get; set; } + + public string NonUniqueString { get; set; } + } +} \ No newline at end of file diff --git a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/Saga_with_unique_property_set_to_null.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/Saga_with_unique_property_set_to_null.cs similarity index 82% rename from src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/Saga_with_unique_property_set_to_null.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/Saga_with_unique_property_set_to_null.cs index 574d7eb75f1..f25b9287933 100644 --- a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/Saga_with_unique_property_set_to_null.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/Saga_with_unique_property_set_to_null.cs @@ -1,8 +1,8 @@ -using System; -using NUnit.Framework; - -namespace NServiceBus.SagaPersisters.Raven.Tests +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister { + using System; + using NUnit.Framework; + public class Saga_with_unique_property_set_to_null : Raven_saga_persistence_concern { [Test, ExpectedException(typeof(ArgumentNullException))] diff --git a/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/TestSaga.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/TestSaga.cs new file mode 100644 index 00000000000..45570e62ca8 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/TestSaga.cs @@ -0,0 +1,97 @@ +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using System; + using System.Collections.Generic; + using NServiceBus.Saga; + using Raven.Imports.Newtonsoft.Json; + + [JsonObject(IsReference = true)] + public class TestSaga : IContainSagaData + { + public virtual Guid Id { get; set; } + + public virtual string Originator { get; set; } + + public virtual string OriginalMessageId { get; set; } + + public virtual RelatedClass RelatedClass { get; set; } + + public virtual IList OrderLines { get; set; } + + public virtual StatusEnum Status { get; set; } + + public virtual DateTime DateTimeProperty { get; set; } + + public virtual TestComponent TestComponent { get; set; } + + public virtual PolymorpicPropertyBase PolymorpicRelatedProperty { get; set; } + + public override bool Equals(object obj) + { + return this.EqualTo(obj, (x, y) => x.Id == y.Id); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } + + public class PolymorpicProperty : PolymorpicPropertyBase + { + public virtual int SomeInt { get; set; } + + public override bool Equals(object obj) + { + return this.EqualTo(obj, (x, y) => x.Id == y.Id && x.SomeInt == y.SomeInt); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } + + public class PolymorpicPropertyBase + { + public virtual Guid Id { get; set; } + } + + public enum StatusEnum + { + SomeStatus, AnotherStatus + } + + public class TestComponent + { + public string Property { get; set; } + public string AnotherProperty { get; set; } + + public override bool Equals(object obj) + { + return this.EqualTo(obj, (x, y) => + x.Property == y.Property && + x.AnotherProperty == y.AnotherProperty); + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + } + + public class OrderLine + { + public virtual Guid Id { get; set; } + + public virtual Guid ProductId { get; set; } + + } + + public class RelatedClass + { + public virtual Guid Id { get; set; } + + public virtual TestSaga ParentSaga { get; set; } + } +} \ No newline at end of file diff --git a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_completing_a_saga_with_the_raven_persister.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_completing_a_saga_with_the_raven_persister.cs similarity index 83% rename from src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_completing_a_saga_with_the_raven_persister.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_completing_a_saga_with_the_raven_persister.cs index 10ea4af9265..316cfc76581 100644 --- a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_completing_a_saga_with_the_raven_persister.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_completing_a_saga_with_the_raven_persister.cs @@ -1,22 +1,20 @@ -using NServiceBus.Saga; - -namespace NServiceBus.SagaPersisters.Raven.Tests -{ - using System; - using NUnit.Framework; - - public class When_completing_a_saga_with_the_raven_persister : Raven_saga_persistence_concern - { - - [Test] - public void Should_delete_the_saga() - { - var sagaId = Guid.NewGuid(); - - SaveSaga(new TestSaga { Id = sagaId }); - CompleteSaga(sagaId); - - WithASagaPersistenceUnitOfWork(p => Assert.Null(p.Get(sagaId))); - } - } +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using System; + using NUnit.Framework; + + public class When_completing_a_saga_with_the_raven_persister : Raven_saga_persistence_concern + { + + [Test] + public void Should_delete_the_saga() + { + var sagaId = Guid.NewGuid(); + + SaveSaga(new TestSaga { Id = sagaId }); + CompleteSaga(sagaId); + + WithASagaPersistenceUnitOfWork(p => Assert.Null(p.Get(sagaId))); + } + } } \ No newline at end of file diff --git a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_a_concrete_class_property.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_a_concrete_class_property.cs similarity index 84% rename from src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_a_concrete_class_property.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_a_concrete_class_property.cs index 3142a7b7aaf..da0d5ee484d 100644 --- a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_a_concrete_class_property.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_a_concrete_class_property.cs @@ -1,18 +1,18 @@ -using NUnit.Framework; - -namespace NServiceBus.SagaPersisters.Raven.Tests -{ - public class When_persisting_a_saga_entity_with_a_concrete_class_property : Persisting_a_saga_entity_with_a_raven_saga_persister - { - public override void SetupEntity(TestSaga saga) - { - entity.TestComponent = new TestComponent { Property = "Prop" }; - } - - [Test] - public void Public_setters_and_getters_of_concrete_classes_should_be_persisted() - { - Assert.AreEqual(entity.TestComponent, savedEntity.TestComponent); - } - } +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using NUnit.Framework; + + public class When_persisting_a_saga_entity_with_a_concrete_class_property : Persisting_a_saga_entity_with_a_raven_saga_persister + { + public override void SetupEntity(TestSaga saga) + { + entity.TestComponent = new TestComponent { Property = "Prop" }; + } + + [Test] + public void Public_setters_and_getters_of_concrete_classes_should_be_persisted() + { + Assert.AreEqual(entity.TestComponent, savedEntity.TestComponent); + } + } } \ No newline at end of file diff --git a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_a_date_time_property.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_a_date_time_property.cs similarity index 80% rename from src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_a_date_time_property.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_a_date_time_property.cs index 88b893e4916..d57b225ac29 100644 --- a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_a_date_time_property.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_a_date_time_property.cs @@ -1,19 +1,19 @@ -using System; -using NUnit.Framework; - -namespace NServiceBus.SagaPersisters.Raven.Tests -{ - public class When_persisting_a_saga_entity_with_a_DateTime_property : Persisting_a_saga_entity_with_a_raven_saga_persister - { - public override void SetupEntity(TestSaga saga) - { - saga.DateTimeProperty = DateTime.Parse("12/02/2010 12:00:00.01"); - } - - [Test] - public void Datetime_property_should_be_persisted() - { - Assert.AreEqual(entity.DateTimeProperty, savedEntity.DateTimeProperty); - } - } +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using System; + using NUnit.Framework; + + public class When_persisting_a_saga_entity_with_a_DateTime_property : Persisting_a_saga_entity_with_a_raven_saga_persister + { + public override void SetupEntity(TestSaga saga) + { + saga.DateTimeProperty = DateTime.Parse("12/02/2010 12:00:00.01"); + } + + [Test] + public void Datetime_property_should_be_persisted() + { + Assert.AreEqual(entity.DateTimeProperty, savedEntity.DateTimeProperty); + } + } } \ No newline at end of file diff --git a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_an_Enum_property.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_an_Enum_property.cs similarity index 80% rename from src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_an_Enum_property.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_an_Enum_property.cs index 5c4164cd839..ff58f679ebe 100644 --- a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_an_Enum_property.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_an_Enum_property.cs @@ -1,19 +1,18 @@ -using System; -using NUnit.Framework; - -namespace NServiceBus.SagaPersisters.Raven.Tests -{ - public class When_persisting_a_saga_entity_with_an_Enum_property : Persisting_a_saga_entity_with_a_raven_saga_persister - { - public override void SetupEntity(TestSaga saga) - { - entity.Status = StatusEnum.AnotherStatus; - } - - [Test] - public void Enums_should_be_persisted() - { - Assert.AreEqual(entity.Status, savedEntity.Status); - } - } +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using NUnit.Framework; + + public class When_persisting_a_saga_entity_with_an_Enum_property : Persisting_a_saga_entity_with_a_raven_saga_persister + { + public override void SetupEntity(TestSaga saga) + { + entity.Status = StatusEnum.AnotherStatus; + } + + [Test] + public void Enums_should_be_persisted() + { + Assert.AreEqual(entity.Status, savedEntity.Status); + } + } } \ No newline at end of file diff --git a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_inherited_property.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_inherited_property.cs similarity index 84% rename from src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_inherited_property.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_inherited_property.cs index d4039344100..804525a32fb 100644 --- a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_inherited_property.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_inherited_property.cs @@ -1,18 +1,18 @@ -using NUnit.Framework; - -namespace NServiceBus.SagaPersisters.Raven.Tests -{ - public class When_persisting_a_saga_entity_with_inherited_property : Persisting_a_saga_entity_with_a_raven_saga_persister - { - public override void SetupEntity(TestSaga saga) - { - entity.PolymorpicRelatedProperty = new PolymorpicProperty {SomeInt = 9}; - } - - [Test] - public void Inherited_property_classes_should_be_persisted() - { - Assert.AreEqual(entity.PolymorpicRelatedProperty, savedEntity.PolymorpicRelatedProperty); - } - } +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using NUnit.Framework; + + public class When_persisting_a_saga_entity_with_inherited_property : Persisting_a_saga_entity_with_a_raven_saga_persister + { + public override void SetupEntity(TestSaga saga) + { + entity.PolymorpicRelatedProperty = new PolymorpicProperty {SomeInt = 9}; + } + + [Test] + public void Inherited_property_classes_should_be_persisted() + { + Assert.AreEqual(entity.PolymorpicRelatedProperty, savedEntity.PolymorpicRelatedProperty); + } + } } \ No newline at end of file diff --git a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_related_entities.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_related_entities.cs similarity index 79% rename from src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_related_entities.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_related_entities.cs index f4efa06c20f..09afbb01ce9 100644 --- a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_entity_with_related_entities.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_entity_with_related_entities.cs @@ -1,27 +1,24 @@ -using NUnit.Framework; - -namespace NServiceBus.SagaPersisters.Raven.Tests -{ - using Newtonsoft.Json.Linq; - using global::Raven.Json.Linq; - - public class When_persisting_a_saga_entity_with_related_entities : Persisting_a_saga_entity_with_a_raven_saga_persister - { - public override void SetupEntity(TestSaga saga) - { - entity.RelatedClass = new RelatedClass { ParentSaga = entity }; - } - - [Test] - public void Related_entities_should_also_be_persisted() - { - Assert.AreEqual(entity, savedEntity.RelatedClass.ParentSaga); - } - - [Test] - public void Self_referenced_properties_should_be_persisted_as_references() - { - Assert.AreSame(savedEntity.RelatedClass.ParentSaga, savedEntity); - } - } +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using NUnit.Framework; + + public class When_persisting_a_saga_entity_with_related_entities : Persisting_a_saga_entity_with_a_raven_saga_persister + { + public override void SetupEntity(TestSaga saga) + { + entity.RelatedClass = new RelatedClass { ParentSaga = entity }; + } + + [Test] + public void Related_entities_should_also_be_persisted() + { + Assert.AreEqual(entity, savedEntity.RelatedClass.ParentSaga); + } + + [Test] + public void Self_referenced_properties_should_be_persisted_as_references() + { + Assert.AreSame(savedEntity.RelatedClass.ParentSaga, savedEntity); + } + } } \ No newline at end of file diff --git a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_with_the_same_unique_property_as_a_completed_saga.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_with_the_same_unique_property_as_a_completed_saga.cs similarity index 90% rename from src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_with_the_same_unique_property_as_a_completed_saga.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_with_the_same_unique_property_as_a_completed_saga.cs index 804856c7a7c..37518256697 100644 --- a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_with_the_same_unique_property_as_a_completed_saga.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_with_the_same_unique_property_as_a_completed_saga.cs @@ -1,40 +1,40 @@ -using System; -using NUnit.Framework; - -namespace NServiceBus.SagaPersisters.Raven.Tests -{ - public class When_persisting_a_saga_with_the_same_unique_property_as_a_completed_saga : Raven_saga_persistence_concern - { +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using System; + using NUnit.Framework; + + public class When_persisting_a_saga_with_the_same_unique_property_as_a_completed_saga : Raven_saga_persistence_concern + { [Test] - public void It_should_persist_successfully() - { - var uniqueString = Guid.NewGuid().ToString(); - var saga1 = new SagaWithUniqueProperty - { - Id = Guid.NewGuid(), - UniqueString = uniqueString + public void It_should_persist_successfully() + { + var uniqueString = Guid.NewGuid().ToString(); + var saga1 = new SagaWithUniqueProperty + { + Id = Guid.NewGuid(), + UniqueString = uniqueString }; - var saga2 = new SagaWithUniqueProperty - { - Id = Guid.NewGuid(), - UniqueString = uniqueString - }; - - SaveSaga(saga1); - CompleteSaga(saga1.Id); - SaveSaga(saga2); + var saga2 = new SagaWithUniqueProperty + { + Id = Guid.NewGuid(), + UniqueString = uniqueString + }; + + SaveSaga(saga1); + CompleteSaga(saga1.Id); + SaveSaga(saga2); + } + } + + + public class When_trying_to_fetch_a_non_existing_saga_by_its_unique_property : Raven_saga_persistence_concern + { + [Test] + public void It_should_return_null() + { + WithASagaPersistenceUnitOfWork(p => Assert.Null(p.Get("UniqueString", + Guid.NewGuid().ToString()))); } - } - - - public class When_trying_to_fetch_a_non_existing_saga_by_its_unique_property : Raven_saga_persistence_concern - { - [Test] - public void It_should_return_null() - { - WithASagaPersistenceUnitOfWork(p => Assert.Null(p.Get("UniqueString", - Guid.NewGuid().ToString()))); - } - } + } } \ No newline at end of file diff --git a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_with_the_same_unique_property_as_another_saga.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_with_the_same_unique_property_as_another_saga.cs similarity index 84% rename from src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_with_the_same_unique_property_as_another_saga.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_with_the_same_unique_property_as_another_saga.cs index 4f24c7325ab..ae112808088 100644 --- a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_persisting_a_saga_with_the_same_unique_property_as_another_saga.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_persisting_a_saga_with_the_same_unique_property_as_another_saga.cs @@ -1,31 +1,30 @@ -using System; -using NUnit.Framework; - -namespace NServiceBus.SagaPersisters.Raven.Tests -{ - using Persistence.Raven; - - public class When_persisting_a_saga_with_the_same_unique_property_as_another_saga : Raven_saga_persistence_concern - { - [Test] - public void It_should_enforce_uniqueness() - { - var uniqueString = Guid.NewGuid().ToString(); - - var saga1 = new SagaWithUniqueProperty - { - Id = Guid.NewGuid(), - UniqueString = uniqueString +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using System; + using NUnit.Framework; + using NServiceBus.Persistence; + + public class When_persisting_a_saga_with_the_same_unique_property_as_another_saga : Raven_saga_persistence_concern + { + [Test] + public void It_should_enforce_uniqueness() + { + var uniqueString = Guid.NewGuid().ToString(); + + var saga1 = new SagaWithUniqueProperty + { + Id = Guid.NewGuid(), + UniqueString = uniqueString }; - var saga2 = new SagaWithUniqueProperty - { - Id = Guid.NewGuid(), - UniqueString = uniqueString - }; - - SaveSaga(saga1); - Assert.Throws(() => SaveSaga(saga2)); + var saga2 = new SagaWithUniqueProperty + { + Id = Guid.NewGuid(), + UniqueString = uniqueString + }; + + SaveSaga(saga1); + Assert.Throws(() => SaveSaga(saga2)); } - } + } } \ No newline at end of file diff --git a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_storing_a_saga_with_a_long_namespace.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_storing_a_saga_with_a_long_namespace.cs similarity index 85% rename from src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_storing_a_saga_with_a_long_namespace.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_storing_a_saga_with_a_long_namespace.cs index 3b9c79ba73c..da57cd0e824 100644 --- a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_storing_a_saga_with_a_long_namespace.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_storing_a_saga_with_a_long_namespace.cs @@ -1,9 +1,8 @@ -namespace NServiceBus.SagaPersisters.Raven.Tests +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister { using System; - using AveryLoooooooooooooooooooongNamespace; using NUnit.Framework; - + public class When_storing_a_saga_with_a_long_namespace : Raven_saga_persistence_concern { [Test] diff --git a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_updating_a_saga_property_that_does_not_have_a_unique_attribute.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_updating_a_saga_property_that_does_not_have_a_unique_attribute.cs similarity index 94% rename from src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_updating_a_saga_property_that_does_not_have_a_unique_attribute.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_updating_a_saga_property_that_does_not_have_a_unique_attribute.cs index a3b55a12183..059fae155a7 100644 --- a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_updating_a_saga_property_that_does_not_have_a_unique_attribute.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_updating_a_saga_property_that_does_not_have_a_unique_attribute.cs @@ -1,88 +1,89 @@ -using System; -using NUnit.Framework; - -namespace NServiceBus.SagaPersisters.Raven.Tests -{ - public class When_updating_a_saga_property_that_does_not_have_a_unique_attribute : Raven_saga_persistence_concern - { - [Test] - public void It_should_persist_successfully() - { - var uniqueString = Guid.NewGuid().ToString(); - - var saga1 = new SagaWithUniqueProperty() - { - Id = Guid.NewGuid(), - UniqueString = uniqueString, - NonUniqueString = "notUnique" - }; - - SaveSaga(saga1); - - UpdateSaga(saga1.Id, s => s.NonUniqueString = "notUnique2"); - } - } - - public class When_updating_a_saga_property_on_a_existing_sagainstance_that_just_got_a_unique_attribute_set : Raven_saga_persistence_concern - { - [Test] - public void It_should_set_the_attribute_and_allow_the_update() - { - var uniqueString = Guid.NewGuid().ToString(); - - var anotherUniqueString = Guid.NewGuid().ToString(); - - var saga1 = new SagaWithUniqueProperty() - { - Id = Guid.NewGuid(), - UniqueString = uniqueString, - NonUniqueString = "notUnique" - }; - - SaveSaga(saga1); - - using(var session = store.OpenSession()) - { - //fake that the attribute was just added by removing the metadata - session.Advanced.GetMetadataFor(saga1).Remove(RavenSagaPersister.UniqueValueMetadataKey); - session.SaveChanges(); - } - - UpdateSaga(saga1.Id, s => s.UniqueString = anotherUniqueString); - - string value; - - using (var session = store.OpenSession()) - value = session.Advanced.GetMetadataFor(saga1)[RavenSagaPersister.UniqueValueMetadataKey].ToString(); - - Assert.AreEqual(anotherUniqueString, value); - - } - } - - - public class When_updating_a_saga_without_unique_properties : Raven_saga_persistence_concern - { - [Test] - public void It_should_persist_successfully() - { - var uniqueString = Guid.NewGuid().ToString(); - var anotherUniqueString = Guid.NewGuid().ToString(); - - var saga1 = new SagaWithoutUniqueProperties() - { - Id = Guid.NewGuid(), - UniqueString = uniqueString, - NonUniqueString = "notUnique" - }; - - SaveSaga(saga1); - - UpdateSaga(saga1.Id, s => - { - s.NonUniqueString = "notUnique2"; - s.UniqueString = anotherUniqueString; - }); - } - } +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using System; + using NServiceBus.Persistence.Raven.SagaPersister; + using NUnit.Framework; + + public class When_updating_a_saga_property_that_does_not_have_a_unique_attribute : Raven_saga_persistence_concern + { + [Test] + public void It_should_persist_successfully() + { + var uniqueString = Guid.NewGuid().ToString(); + + var saga1 = new SagaWithUniqueProperty() + { + Id = Guid.NewGuid(), + UniqueString = uniqueString, + NonUniqueString = "notUnique" + }; + + SaveSaga(saga1); + + UpdateSaga(saga1.Id, s => s.NonUniqueString = "notUnique2"); + } + } + + public class When_updating_a_saga_property_on_a_existing_sagainstance_that_just_got_a_unique_attribute_set : Raven_saga_persistence_concern + { + [Test] + public void It_should_set_the_attribute_and_allow_the_update() + { + var uniqueString = Guid.NewGuid().ToString(); + + var anotherUniqueString = Guid.NewGuid().ToString(); + + var saga1 = new SagaWithUniqueProperty() + { + Id = Guid.NewGuid(), + UniqueString = uniqueString, + NonUniqueString = "notUnique" + }; + + SaveSaga(saga1); + + using(var session = store.OpenSession()) + { + //fake that the attribute was just added by removing the metadata + session.Advanced.GetMetadataFor(saga1).Remove(RavenSagaPersister.UniqueValueMetadataKey); + session.SaveChanges(); + } + + UpdateSaga(saga1.Id, s => s.UniqueString = anotherUniqueString); + + string value; + + using (var session = store.OpenSession()) + value = session.Advanced.GetMetadataFor(saga1)[RavenSagaPersister.UniqueValueMetadataKey].ToString(); + + Assert.AreEqual(anotherUniqueString, value); + + } + } + + + public class When_updating_a_saga_without_unique_properties : Raven_saga_persistence_concern + { + [Test] + public void It_should_persist_successfully() + { + var uniqueString = Guid.NewGuid().ToString(); + var anotherUniqueString = Guid.NewGuid().ToString(); + + var saga1 = new SagaWithoutUniqueProperties() + { + Id = Guid.NewGuid(), + UniqueString = uniqueString, + NonUniqueString = "notUnique" + }; + + SaveSaga(saga1); + + UpdateSaga(saga1.Id, s => + { + s.NonUniqueString = "notUnique2"; + s.UniqueString = anotherUniqueString; + }); + } + } } \ No newline at end of file diff --git a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_updating_a_saga_property_that_has_a_unique_attribute.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_updating_a_saga_property_that_has_a_unique_attribute.cs similarity index 86% rename from src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_updating_a_saga_property_that_has_a_unique_attribute.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_updating_a_saga_property_that_has_a_unique_attribute.cs index ad5987864c8..f1f4c4cce4a 100644 --- a/src/impl/SagaPersisters/RavenSagaPersister/NServiceBus.SagaPersisters.Raven.Tests/When_updating_a_saga_property_that_has_a_unique_attribute.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SagaPersister/When_updating_a_saga_property_that_has_a_unique_attribute.cs @@ -1,34 +1,32 @@ -using System; -using NUnit.Framework; - -namespace NServiceBus.SagaPersisters.Raven.Tests -{ - using Saga; - - public class When_updating_a_saga_property_that_has_a_unique_attribute : Raven_saga_persistence_concern - { - [Test] - public void It_should_allow_the_update() - { - var uniqueString = Guid.NewGuid().ToString(); - var saga1 = new SagaWithUniqueProperty - { - Id = Guid.NewGuid(), - UniqueString = uniqueString - }; - - SaveSaga(saga1); - - UpdateSaga(saga1.Id, s => s.UniqueString = Guid.NewGuid().ToString()); - - var saga2 = new SagaWithUniqueProperty - { - Id = Guid.NewGuid(), - UniqueString = uniqueString - }; - - //this should not blow since we changed the uniq value in the previous saga - SaveSaga(saga2); - } - } -} \ No newline at end of file +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SagaPersister +{ + using System; + using NUnit.Framework; + + public class When_updating_a_saga_property_that_has_a_unique_attribute : Raven_saga_persistence_concern + { + [Test] + public void It_should_allow_the_update() + { + var uniqueString = Guid.NewGuid().ToString(); + var saga1 = new SagaWithUniqueProperty + { + Id = Guid.NewGuid(), + UniqueString = uniqueString + }; + + SaveSaga(saga1); + + UpdateSaga(saga1.Id, s => s.UniqueString = Guid.NewGuid().ToString()); + + var saga2 = new SagaWithUniqueProperty + { + Id = Guid.NewGuid(), + UniqueString = uniqueString + }; + + //this should not blow since we changed the uniq value in the previous saga + SaveSaga(saga2); + } + } +} diff --git a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.Raven.Tests/TestData.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/TestData.cs similarity index 91% rename from src/impl/unicast/NServiceBus.Unicast.Subscriptions.Raven.Tests/TestData.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/TestData.cs index 6a8798fadff..c8beaa1f0df 100644 --- a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.Raven.Tests/TestData.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/TestData.cs @@ -1,42 +1,43 @@ -namespace NServiceBus.Unicast.Subscriptions.Raven.Tests -{ - using System; - using System.Collections.Generic; - - public interface ISomeInterface - { - } - public interface ISomeInterface2 - { - } - public interface ISomeInterface3 - { - } - - public class MessageB - { - } - - public class MessageA - { - - } - public class MessageTypes - { - public static IEnumerable MessageA = new[] { new MessageType(typeof(MessageA).FullName, new Version(1, 0, 0, 0)) }; - public static IEnumerable MessageAv2 = new[] { new MessageType(typeof(MessageA).FullName, new Version(2, 0, 0, 0)) }; - public static IEnumerable MessageAv11 = new[] { new MessageType(typeof(MessageA).FullName, new Version(1, 1, 0, 0)) }; - - public static IEnumerable MessageB = new[] { new MessageType(typeof(MessageB)) }; - - public static IEnumerable All = new[] { new MessageType(typeof(MessageA)), new MessageType(typeof(MessageB)) }; - } - - public class TestClients - { - public static Address ClientA = Address.Parse("ClientA"); - public static Address ClientB = Address.Parse("ClientB"); - public static Address ClientC = Address.Parse("ClientC"); - } - +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SubscriptionStorage +{ + using System; + using System.Collections.Generic; + using Unicast.Subscriptions; + + public interface ISomeInterface + { + } + public interface ISomeInterface2 + { + } + public interface ISomeInterface3 + { + } + + public class MessageB + { + } + + public class MessageA + { + + } + public class MessageTypes + { + public static IEnumerable MessageA = new[] { new MessageType(typeof(MessageA).FullName, new Version(1, 0, 0, 0)) }; + public static IEnumerable MessageAv2 = new[] { new MessageType(typeof(MessageA).FullName, new Version(2, 0, 0, 0)) }; + public static IEnumerable MessageAv11 = new[] { new MessageType(typeof(MessageA).FullName, new Version(1, 1, 0, 0)) }; + + public static IEnumerable MessageB = new[] { new MessageType(typeof(MessageB)) }; + + public static IEnumerable All = new[] { new MessageType(typeof(MessageA)), new MessageType(typeof(MessageB)) }; + } + + public class TestClients + { + public static Address ClientA = Address.Parse("ClientA"); + public static Address ClientB = Address.Parse("ClientB"); + public static Address ClientC = Address.Parse("ClientC"); + } + } \ No newline at end of file diff --git a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.Raven.Tests/When_listing_subscribers_for_message_types.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/When_listing_subscribers_for_message_types.cs similarity index 89% rename from src/impl/unicast/NServiceBus.Unicast.Subscriptions.Raven.Tests/When_listing_subscribers_for_message_types.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/When_listing_subscribers_for_message_types.cs index ad8f410a611..ea64bcd7f1c 100644 --- a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.Raven.Tests/When_listing_subscribers_for_message_types.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/When_listing_subscribers_for_message_types.cs @@ -1,52 +1,48 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework; - -namespace NServiceBus.Unicast.Subscriptions.Raven.Tests -{ - using global::Raven.Client.Document; - - [TestFixture] - public class When_listing_subscribers_for_message_types : WithRavenSubscriptionStorage - { - [Test] - public void The_names_of_all_subscribers_should_be_returned() - { - storage.Subscribe(TestClients.ClientA, MessageTypes.MessageA); - storage.Subscribe(TestClients.ClientA, MessageTypes.MessageB); - storage.Subscribe(TestClients.ClientB, MessageTypes.MessageA); - storage.Subscribe(TestClients.ClientA, MessageTypes.MessageAv2); - - var subscriptionsForMessageType = storage.GetSubscriberAddressesForMessage(MessageTypes.MessageA); - - Assert.AreEqual(2, subscriptionsForMessageType.Count()); - Assert.AreEqual(TestClients.ClientA, subscriptionsForMessageType.First()); - } - - [Test] - public void Duplicates_should_not_be_generated_for_interface_inheritance_chains() - { - storage.Subscribe(TestClients.ClientA, new[] { new MessageType(typeof(ISomeInterface)) }); - storage.Subscribe(TestClients.ClientA, new[] { new MessageType(typeof(ISomeInterface2)) }); - storage.Subscribe(TestClients.ClientA, new[] { new MessageType(typeof(ISomeInterface3)) }); - - var subscriptionsForMessageType = storage.GetSubscriberAddressesForMessage(new[] { new MessageType(typeof(ISomeInterface)), new MessageType(typeof(ISomeInterface2)), new MessageType(typeof(ISomeInterface3)) }); - - Assert.AreEqual(1, subscriptionsForMessageType.Count()); - } - } - - - [TestFixture] - public class When_listing_subscribers_for_a_non_existing_message_type : WithRavenSubscriptionStorage - { - [Test] - public void No_subscribers_should_be_returned() - { - var subscriptionsForMessageType = storage.GetSubscriberAddressesForMessage(MessageTypes.MessageA); - - Assert.AreEqual(0, subscriptionsForMessageType.Count()); - } - } +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SubscriptionStorage +{ + using System.Linq; + using NUnit.Framework; + using Unicast.Subscriptions; + + [TestFixture] + public class When_listing_subscribers_for_message_types : WithRavenSubscriptionStorage + { + [Test] + public void The_names_of_all_subscribers_should_be_returned() + { + storage.Subscribe(TestClients.ClientA, MessageTypes.MessageA); + storage.Subscribe(TestClients.ClientA, MessageTypes.MessageB); + storage.Subscribe(TestClients.ClientB, MessageTypes.MessageA); + storage.Subscribe(TestClients.ClientA, MessageTypes.MessageAv2); + + var subscriptionsForMessageType = storage.GetSubscriberAddressesForMessage(MessageTypes.MessageA); + + Assert.AreEqual(2, subscriptionsForMessageType.Count()); + Assert.AreEqual(TestClients.ClientA, subscriptionsForMessageType.First()); + } + + [Test] + public void Duplicates_should_not_be_generated_for_interface_inheritance_chains() + { + storage.Subscribe(TestClients.ClientA, new[] { new MessageType(typeof(ISomeInterface)) }); + storage.Subscribe(TestClients.ClientA, new[] { new MessageType(typeof(ISomeInterface2)) }); + storage.Subscribe(TestClients.ClientA, new[] { new MessageType(typeof(ISomeInterface3)) }); + + var subscriptionsForMessageType = storage.GetSubscriberAddressesForMessage(new[] { new MessageType(typeof(ISomeInterface)), new MessageType(typeof(ISomeInterface2)), new MessageType(typeof(ISomeInterface3)) }); + + Assert.AreEqual(1, subscriptionsForMessageType.Count()); + } + } + + [TestFixture] + public class When_listing_subscribers_for_a_non_existing_message_type : WithRavenSubscriptionStorage + { + [Test] + public void No_subscribers_should_be_returned() + { + var subscriptionsForMessageType = storage.GetSubscriberAddressesForMessage(MessageTypes.MessageA); + + Assert.AreEqual(0, subscriptionsForMessageType.Count()); + } + } } \ No newline at end of file diff --git a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.Raven.Tests/When_receiving_a_subscription_message.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/When_receiving_a_subscription_message.cs similarity index 78% rename from src/impl/unicast/NServiceBus.Unicast.Subscriptions.Raven.Tests/When_receiving_a_subscription_message.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/When_receiving_a_subscription_message.cs index 455ed0cfbed..2a0beae7d04 100644 --- a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.Raven.Tests/When_receiving_a_subscription_message.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/When_receiving_a_subscription_message.cs @@ -1,34 +1,36 @@ -using System.Linq; -using System.Transactions; -using NUnit.Framework; - -namespace NServiceBus.Unicast.Subscriptions.Raven.Tests -{ - [TestFixture] - public class When_receiving_a_subscription_message : WithRavenSubscriptionStorage - { - [Test] - public void A_subscription_entry_should_be_added_to_the_database() - { - Address clientEndpoint = Address.Parse("TestEndpoint"); - - var messageTypes = new[] { new MessageType("MessageType1", "1.0.0.0"), new MessageType("MessageType2", "1.0.0.0") }; - - using (var transaction = new TransactionScope()) - { - storage.Subscribe(clientEndpoint, messageTypes); - transaction.Complete(); - } - - using (var session = store.OpenSession()) - { - var subscriptions = session - .Query() - .Customize(c => c.WaitForNonStaleResults()) - .Count(); - - Assert.AreEqual(2, subscriptions); - } - } - } -} +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SubscriptionStorage +{ + using System.Linq; + using System.Transactions; + using NServiceBus.Persistence.Raven.SubscriptionStorage; + using NUnit.Framework; + using Unicast.Subscriptions; + + [TestFixture] + public class When_receiving_a_subscription_message : WithRavenSubscriptionStorage + { + [Test] + public void A_subscription_entry_should_be_added_to_the_database() + { + Address clientEndpoint = Address.Parse("TestEndpoint"); + + var messageTypes = new[] { new MessageType("MessageType1", "1.0.0.0"), new MessageType("MessageType2", "1.0.0.0") }; + + using (var transaction = new TransactionScope()) + { + storage.Subscribe(clientEndpoint, messageTypes); + transaction.Complete(); + } + + using (var session = store.OpenSession()) + { + var subscriptions = session + .Query() + .Customize(c => c.WaitForNonStaleResults()) + .Count(); + + Assert.AreEqual(2, subscriptions); + } + } + } +} diff --git a/src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/When_receiving_an_unsubscription_message.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/When_receiving_an_unsubscription_message.cs new file mode 100644 index 00000000000..164da34ee0f --- /dev/null +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/When_receiving_an_unsubscription_message.cs @@ -0,0 +1,20 @@ +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SubscriptionStorage +{ + using System.Linq; + using NUnit.Framework; + + [TestFixture] + public class When_receiving_an_unsubscription_message : WithRavenSubscriptionStorage + { + [Test] + public void All_subscription_entries_for_specfied_message_types_should_be_removed() + { + storage.Subscribe(TestClients.ClientA, MessageTypes.All); + + storage.Unsubscribe(TestClients.ClientA, MessageTypes.All); + + var clients = storage.GetSubscriberAddressesForMessage(MessageTypes.All); + Assert.IsFalse(clients.Any(a => a == TestClients.ClientA)); + } + } +} \ No newline at end of file diff --git a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.Raven.Tests/When_receiving_duplicate_subscription_messages.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/When_receiving_duplicate_subscription_messages.cs similarity index 76% rename from src/impl/unicast/NServiceBus.Unicast.Subscriptions.Raven.Tests/When_receiving_duplicate_subscription_messages.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/When_receiving_duplicate_subscription_messages.cs index d9d538ce95a..349a5469f7c 100644 --- a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.Raven.Tests/When_receiving_duplicate_subscription_messages.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/When_receiving_duplicate_subscription_messages.cs @@ -1,29 +1,31 @@ -using System.Collections.Generic; -using System.Linq; -using NUnit.Framework; - -namespace NServiceBus.Unicast.Subscriptions.Raven.Tests -{ +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SubscriptionStorage +{ + using System.Collections.Generic; + using System.Linq; + using NServiceBus.Persistence.Raven.SubscriptionStorage; + using NUnit.Framework; + using Unicast.Subscriptions; + [TestFixture] public class When_receiving_duplicate_subscription_messages : WithRavenSubscriptionStorage - { - [Test] - public void shouldnt_create_additional_db_rows() - { - - storage.Subscribe(new Address("testendpoint", "localhost"), new List { new MessageType("SomeMessageType","1.0.0.0") }); - storage.Subscribe(new Address("testendpoint", "localhost"), new List { new MessageType("SomeMessageType", "1.0.0.0") }); - - - using (var session = store.OpenSession()) - { - var subscriptions = session - .Query() - .Customize(c => c.WaitForNonStaleResults()) - .Count(); - - Assert.AreEqual(1, subscriptions); - } + { + [Test] + public void shouldnt_create_additional_db_rows() + { + + storage.Subscribe(new Address("testendpoint", "localhost"), new List { new MessageType("SomeMessageType","1.0.0.0") }); + storage.Subscribe(new Address("testendpoint", "localhost"), new List { new MessageType("SomeMessageType", "1.0.0.0") }); + + + using (var session = store.OpenSession()) + { + var subscriptions = session + .Query() + .Customize(c => c.WaitForNonStaleResults()) + .Count(); + + Assert.AreEqual(1, subscriptions); + } } - } + } } \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/WithRavenSubscriptionStorage.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/WithRavenSubscriptionStorage.cs new file mode 100644 index 00000000000..f14e25e9584 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/SubscriptionStorage/WithRavenSubscriptionStorage.cs @@ -0,0 +1,35 @@ +namespace NServiceBus.Core.Tests.Persistence.RavenDB.SubscriptionStorage +{ + using NServiceBus.Persistence.Raven; + using NServiceBus.Persistence.Raven.SubscriptionStorage; + using NUnit.Framework; + using Raven.Client; + using Raven.Client.Document; + using Raven.Client.Embedded; + using Unicast.Subscriptions; + using Unicast.Subscriptions.MessageDrivenSubscriptions; + + public class WithRavenSubscriptionStorage + { + protected ISubscriptionStorage storage; + protected IDocumentStore store; + + [SetUp] + public void SetupContext() + { + store = new EmbeddableDocumentStore { RunInMemory = true}; + store.Conventions.DefaultQueryingConsistency = ConsistencyOptions.QueryYourWrites; + + store.Initialize(); + + storage = new RavenSubscriptionStorage(new StoreAccessor(store)); + storage.Init(); + } + + [TearDown] + public void Cleanup() + { + store.Dispose(); + } + } +} \ No newline at end of file diff --git a/src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven.Tests/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string.cs similarity index 90% rename from src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven.Tests/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string.cs index 4309103bf30..0c9421e8d71 100644 --- a/src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven.Tests/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string.cs @@ -1,32 +1,32 @@ -using NUnit.Framework; - -namespace NServiceBus.Persistence.Raven.Tests -{ - [TestFixture] - public class When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string : WithRavenDbServer - { +namespace NServiceBus.Core.Tests.Persistence.RavenDB +{ + using NUnit.Framework; + + [TestFixture] + public class When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string : WithRavenDbServer + { protected override void Initialize(Configure config) - { + { config.RavenPersistence("Raven"); - } - - [Test] - public void It_should_use_a_document_store() - { - Assert.IsNotNull(store); - } - - [Test] - public void It_should_configure_the_document_store_with_the_connection_string() - { - Assert.AreEqual("http://localhost:8080", store.Url); + } + + [Test] + public void It_should_use_a_document_store() + { + Assert.IsNotNull(store); + } + + [Test] + public void It_should_configure_the_document_store_with_the_connection_string() + { + Assert.AreEqual("http://localhost:8080", store.Url); Assert.AreEqual("b5058088-3a5d-4f35-8a64-49b06719d6ef", store.ApiKey); - } - - [Test] - public void It_should_configure_the_document_store_to_use_the_calling_assembly_name_as_the_database() - { - Assert.AreEqual("UnitTests", store.DefaultDatabase); - } - } -} + } + + [Test] + public void It_should_configure_the_document_store_to_use_the_calling_assembly_name_as_the_database() + { + Assert.AreEqual("UnitTests", store.DefaultDatabase); + } + } +} diff --git a/src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven.Tests/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_and_database.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_and_database.cs similarity index 94% rename from src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven.Tests/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_and_database.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_and_database.cs index ae4e472d74c..4750884b567 100644 --- a/src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven.Tests/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_and_database.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_and_database.cs @@ -1,98 +1,98 @@ -using NUnit.Framework; - -namespace NServiceBus.Persistence.Raven.Tests -{ - using System; - - [TestFixture] - public class When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_and_database : WithRavenDbServer - { +namespace NServiceBus.Core.Tests.Persistence.RavenDB +{ + using NServiceBus.Persistence.Raven; + using NUnit.Framework; + using System; + + [TestFixture] + public class When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_and_database : WithRavenDbServer + { protected override void Initialize(Configure config) - { + { config.RavenPersistence("Raven", "CustomDatabase"); - } - - [Test] - public void It_should_use_a_document_store() - { - Assert.IsNotNull(store); - } - - [Test] - public void It_should_configure_the_document_store_with_the_connection_string() - { - Assert.AreEqual("http://localhost:8080", store.Url); - } - - [Test] - public void It_should_configure_the_document_store_to_use_the_database() - { + } + + [Test] + public void It_should_use_a_document_store() + { + Assert.IsNotNull(store); + } + + [Test] + public void It_should_configure_the_document_store_with_the_connection_string() + { + Assert.AreEqual("http://localhost:8080", store.Url); + } + + [Test] + public void It_should_configure_the_document_store_to_use_the_database() + { Assert.AreEqual("CustomDatabase", store.DefaultDatabase); - } - - - [Test] - public void It_should_use_the_default_resourcemanager_id_if_not_specified_in_the_string() - { - Assert.AreEqual(RavenPersistenceConstants.DefaultResourceManagerId, store.ResourceManagerId); - } - } - - [TestFixture] - public class When_configuring_the_raven_saga_persister_with_a_connection_string_that_has_a_default_database_set : WithRavenDbServer - { + } + + + [Test] + public void It_should_use_the_default_resourcemanager_id_if_not_specified_in_the_string() + { + Assert.AreEqual(RavenPersistenceConstants.DefaultResourceManagerId, store.ResourceManagerId); + } + } + + [TestFixture] + public class When_configuring_the_raven_saga_persister_with_a_connection_string_that_has_a_default_database_set : WithRavenDbServer + { protected override void Initialize(Configure config) - { + { config.RavenPersistence("RavenWithDefaultDBSet"); - } - - [Test] - public void It_should_use_the_default_database_of_the_store() - { - Assert.AreEqual("MyDB", store.DefaultDatabase); - } - - [Test] - public void It_should_use_the_default_resourcemanager_id_if_not_specified_in_the_string() - { - Assert.AreEqual(RavenPersistenceConstants.DefaultResourceManagerId, store.ResourceManagerId); - } - } - - [TestFixture] - public class When_configuring_the_raven_saga_persister_with_a_connection_string_that_has_a_database_set : WithRavenDbServer - { - protected override void Initialize(Configure config) - { - config.RavenPersistence("RavenWithDefaultDBSetUsingDataBase"); - } - - [Test] - public void It_should_use_the_default_database_of_the_store() - { - Assert.AreEqual("MyDB", store.DefaultDatabase); - } - - [Test] - public void It_should_use_the_default_resourcemanager_id_if_not_specified_in_the_string() - { - Assert.AreEqual(RavenPersistenceConstants.DefaultResourceManagerId, store.ResourceManagerId); - } - } - - [TestFixture] - public class When_configuring_the_raven_saga_persister_with_a_connection_string_that_has_a_resourcemanager_set : WithRavenDbServer - { + } + + [Test] + public void It_should_use_the_default_database_of_the_store() + { + Assert.AreEqual("MyDB", store.DefaultDatabase); + } + + [Test] + public void It_should_use_the_default_resourcemanager_id_if_not_specified_in_the_string() + { + Assert.AreEqual(RavenPersistenceConstants.DefaultResourceManagerId, store.ResourceManagerId); + } + } + + [TestFixture] + public class When_configuring_the_raven_saga_persister_with_a_connection_string_that_has_a_database_set : WithRavenDbServer + { + protected override void Initialize(Configure config) + { + config.RavenPersistence("RavenWithDefaultDBSetUsingDataBase"); + } + + [Test] + public void It_should_use_the_default_database_of_the_store() + { + Assert.AreEqual("MyDB", store.DefaultDatabase); + } + + [Test] + public void It_should_use_the_default_resourcemanager_id_if_not_specified_in_the_string() + { + Assert.AreEqual(RavenPersistenceConstants.DefaultResourceManagerId, store.ResourceManagerId); + } + } + + [TestFixture] + public class When_configuring_the_raven_saga_persister_with_a_connection_string_that_has_a_resourcemanager_set : WithRavenDbServer + { protected override void Initialize(Configure config) - { + { config.RavenPersistence("RavenWithRmSet"); - } - - - [Test] - public void It_should_use_the_resourcemanager_id_specified_in_the_string() - { - Assert.AreEqual(Guid.Parse("2f2c3321-f251-4975-802d-11fc9d9e5e37"), store.ResourceManagerId); - } - } -} \ No newline at end of file + } + + + [Test] + public void It_should_use_the_resourcemanager_id_specified_in_the_string() + { + Assert.AreEqual(Guid.Parse("2f2c3321-f251-4975-802d-11fc9d9e5e37"), store.ResourceManagerId); + } + } +} diff --git a/src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_lambda.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_lambda.cs new file mode 100644 index 00000000000..2f661bcaca6 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_lambda.cs @@ -0,0 +1,25 @@ +namespace NServiceBus.Core.Tests.Persistence.RavenDB +{ + using NUnit.Framework; + + [TestFixture] + public class When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_lambda : WithRavenDbServer + { + protected override void Initialize(Configure config) + { + config.RavenPersistence(() => "Url = http://localhost:8080"); + } + + [Test] + public void It_should_use_a_document_store() + { + Assert.IsNotNull(store); + } + + [Test] + public void It_should_configure_the_document_store_with_the_connection_string_lambda() + { + Assert.AreEqual("http://localhost:8080", store.Url); + } + } +} diff --git a/src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven.Tests/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_lambda_and_database.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_lambda_and_database.cs similarity index 86% rename from src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven.Tests/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_lambda_and_database.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_lambda_and_database.cs index e052c666408..9760caa1fd5 100644 --- a/src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven.Tests/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_lambda_and_database.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_lambda_and_database.cs @@ -1,47 +1,45 @@ -using System; -using NUnit.Framework; -using Raven.Client; -using Raven.Client.Document; - -namespace NServiceBus.Persistence.Raven.Tests -{ - [TestFixture] - public class When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_lambda_and_database : WithRavenDbServer - { - Func connectionStringFunc; - string database; - +namespace NServiceBus.Core.Tests.Persistence.RavenDB +{ + using System; + using NServiceBus.Persistence.Raven; + using NUnit.Framework; + + [TestFixture] + public class When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_lambda_and_database : WithRavenDbServer + { + Func connectionStringFunc; + string database; + protected override void Initialize(Configure config) - { - connectionStringFunc = () => "Url = http://localhost:8080"; - database = "CustomDatabase"; - + { + connectionStringFunc = () => "Url = http://localhost:8080; DefaultDatabase=MyDB"; + database = "CustomDatabase"; + config.RavenPersistence(connectionStringFunc, database); - } - - [Test] - public void It_should_use_a_document_store() - { - Assert.IsNotNull(store); - } - - [Test] - public void It_should_configure_the_document_store_with_the_connection_string() - { - Assert.AreEqual("http://localhost:8080", store.Url); - } - - [Test] - public void It_should_configure_the_document_store_to_use_the_database() - { - Assert.AreEqual(database, store.DefaultDatabase); - } - - - [Test] - public void It_should_use_the_default_resourcemanager_id_if_not_specified_in_the_string() - { - Assert.AreEqual(RavenPersistenceConstants.DefaultResourceManagerId, store.ResourceManagerId); - } - } -} \ No newline at end of file + } + + [Test] + public void It_should_use_a_document_store() + { + Assert.IsNotNull(store); + } + + [Test] + public void It_should_configure_the_document_store_with_the_connection_string() + { + Assert.AreEqual("http://localhost:8080", store.Url); + } + + [Test] + public void It_should_configure_the_document_store_to_use_the_database() + { + Assert.AreEqual(database, store.DefaultDatabase); + } + + [Test] + public void It_should_use_the_default_resourcemanager_id_if_not_specified_in_the_string() + { + Assert.AreEqual(RavenPersistenceConstants.DefaultResourceManagerId, store.ResourceManagerId); + } + } +} diff --git a/src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven.Tests/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_that_does_not_exist.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_that_does_not_exist.cs similarity index 82% rename from src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven.Tests/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_that_does_not_exist.cs rename to src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_that_does_not_exist.cs index 949202d8c85..5ffa5b8e9f1 100644 --- a/src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven.Tests/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_that_does_not_exist.cs +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_that_does_not_exist.cs @@ -1,20 +1,18 @@ -using System; -using NUnit.Framework; - -namespace NServiceBus.Persistence.Raven.Tests -{ - using System.Configuration; - - [TestFixture] - public class When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_that_does_not_exist - { - [Test] - [ExpectedException(typeof(ConfigurationErrorsException))] - public void It_should_throw_an_exception() - { - Configure.With(new[] { GetType().Assembly }) - .DefaultBuilder() - .RavenPersistence("ConnectionStringDoesNotExist"); - } - } +namespace NServiceBus.Core.Tests.Persistence.RavenDB +{ + using NUnit.Framework; + using System.Configuration; + + [TestFixture] + public class When_configuring_persistence_to_use_a_raven_server_instance_using_a_connection_string_that_does_not_exist + { + [Test] + [ExpectedException(typeof(ConfigurationErrorsException))] + public void It_should_throw_an_exception() + { + Configure.With(new[] { GetType().Assembly }) + .DefaultBuilder() + .RavenPersistence("ConnectionStringDoesNotExist"); + } + } } \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_with_the_default_settings.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_with_the_default_settings.cs new file mode 100644 index 00000000000..e571b90e707 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/When_configuring_persistence_to_use_a_raven_server_instance_with_the_default_settings.cs @@ -0,0 +1,32 @@ +namespace NServiceBus.Core.Tests.Persistence.RavenDB +{ + using System.Globalization; + using NUnit.Framework; + using Utils; + + [TestFixture] + public class When_configuring_persistence_to_use_a_raven_server_instance_with_the_default_settings : WithRavenDbServer + { + [Test] + public void It_should_configure_the_document_store_to_use_the_default_url() + { + var port = RegistryReader.Read("RavenPort", 8080); + + var ravenUrl = string.Format("http://localhost:{0}", port.ToString(CultureInfo.InvariantCulture)); + + Assert.AreEqual(ravenUrl, store.Url); + } + + [Test] + public void It_should_configure_the_document_store_with_MaxNumberOfRequestsPerSession() + { + Assert.AreEqual(100, store.Conventions.MaxNumberOfRequestsPerSession); + } + + [Test] + public void It_should_configure_the_document_store_to_use_the_calling_assembly_name_as_the_database() + { + Assert.AreEqual("UnitTests", store.DefaultDatabase); + } + } +} diff --git a/src/NServiceBus.Core.Tests/Persistence/RavenDB/WithRavenDbServer.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/WithRavenDbServer.cs new file mode 100644 index 00000000000..d7ac5181743 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/WithRavenDbServer.cs @@ -0,0 +1,34 @@ +namespace NServiceBus.Core.Tests.Persistence.RavenDB +{ + using NServiceBus.Persistence.Raven; + using NUnit.Framework; + using Raven.Client.Document; + + public class WithRavenDbServer + { + protected DocumentStore store; + + [TestFixtureSetUp] + public void SetUp() + { + var config = Configure.With(new[] { GetType().Assembly }) + .DefineEndpointName("UnitTests") + .DefaultBuilder(); + + Initialize(config); + + store = config.Builder.Build().Store as DocumentStore; + } + + [TestFixtureTearDown] + public void TearDown() + { + store.Dispose(); + } + + protected virtual void Initialize(Configure config) + { + config.RavenPersistence(); + } + } +} diff --git a/src/NServiceBus.Core.Tests/Persistence/RavenDB/With_using_raven_persistence.cs b/src/NServiceBus.Core.Tests/Persistence/RavenDB/With_using_raven_persistence.cs new file mode 100644 index 00000000000..5609b01682d --- /dev/null +++ b/src/NServiceBus.Core.Tests/Persistence/RavenDB/With_using_raven_persistence.cs @@ -0,0 +1,20 @@ +namespace NServiceBus.Core.Tests.Persistence.RavenDB +{ + using NUnit.Framework; + using Raven.Client; + + [TestFixture] + public class With_using_raven_persistence + { + [Test] + public void Should_not_register_IDocumentStore_into_the_container() + { + var config = Configure.With(new[] { GetType().Assembly }) + .DefineEndpointName("UnitTests") + .DefaultBuilder() + .RavenPersistence(); + + Assert.IsFalse(config.Configurer.HasComponent()); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Properties/AssemblyInfo.cs b/src/NServiceBus.Core.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..6c317bde2ac --- /dev/null +++ b/src/NServiceBus.Core.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("NServiceBus.Core.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyProduct("NServiceBus.Core.Tests")] +[assembly: AssemblyCompany("NServiceBus")] +[assembly: AssemblyConfiguration("release")] +[assembly: AssemblyInformationalVersion("4.0.0-alpha0")] +[assembly: ComVisible(false)] +[assembly: CLSCompliantAttribute(true)] + diff --git a/src/NServiceBus.Core.Tests/Satellite/SatelliteLauncherContext.cs b/src/NServiceBus.Core.Tests/Satellite/SatelliteLauncherContext.cs new file mode 100644 index 00000000000..ceb4aeaff66 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Satellite/SatelliteLauncherContext.cs @@ -0,0 +1,55 @@ +namespace NServiceBus.Core.Tests.Satellite +{ + using System.Reflection; + using Fakes; + using Faults; + using NServiceBus.Config; + using NUnit.Framework; + using Satellites; + using Unicast.Transport; + + public abstract class SatelliteLauncherContext + { + protected FuncBuilder Builder; + protected IManageMessageFailures InMemoryFaultManager; + protected TransportReceiver Transport; + protected FakeReceiver FakeReceiver; + + [SetUp] + public void SetUp() + { + Builder = new FuncBuilder(); + InMemoryFaultManager = new Faults.InMemory.FaultManager(); + FakeReceiver = new FakeReceiver(); + + Transport = new TransportReceiver + { + Receiver = FakeReceiver, + TransactionSettings = TransactionSettings.Default + }; + + Configure.With(new Assembly[0]) + .DefineEndpointName("Test") + .DefaultBuilder(); + Configure.Instance.Builder = Builder; + + RegisterTypes(); + Builder.Register(() => InMemoryFaultManager); + Builder.Register(() => Transport); + + var configurer = new SatelliteConfigurer(); + configurer.Init(); + + var launcher = new SatelliteLauncher + { + Builder = Builder, + }; + + BeforeRun(); + launcher.Start(); + } + + public abstract void BeforeRun(); + public abstract void RegisterTypes(); + } +} diff --git a/src/NServiceBus.Core.Tests/Satellite/SatelliteLauncherTests.cs b/src/NServiceBus.Core.Tests/Satellite/SatelliteLauncherTests.cs new file mode 100644 index 00000000000..a826e4ff41c --- /dev/null +++ b/src/NServiceBus.Core.Tests/Satellite/SatelliteLauncherTests.cs @@ -0,0 +1,151 @@ +namespace NServiceBus.Core.Tests.Satellite +{ + using System; + using Satellites; + using NUnit.Framework; + + public class FakeSatellite : ISatellite + { + public bool IsMessageHandled = false; + public bool Handle(TransportMessage message) + { + IsMessageHandled = true; + + return true; + } + + public Address InputAddress { get; set; } + public bool Disabled { get; set; } + + public bool IsStarted = false; + public bool IsStopped = false; + + public virtual void Start() + { + IsStarted = true; + } + + public void Stop() + { + IsStopped = true; + } + } + + public class SatelliteWithQueue : FakeSatellite + { + public SatelliteWithQueue() + { + InputAddress = new Address("input", "machineName"); + } + } + + [TestFixture] + public class TransportEventTests : SatelliteLauncherContext + { + readonly SatelliteWithQueue _sat = new SatelliteWithQueue(); + public override void BeforeRun() + { + } + + public override void RegisterTypes() + { + Builder.Register(() => _sat); + } + + [Test] + public void When_a_message_is_received_the_Handle_method_should_called_on_the_satellite() + { + var tm = new TransportMessage(); + FakeReceiver.FakeMessageReceived(tm); + + Assert.That(_sat.IsMessageHandled, Is.True); + } + } + + [TestFixture] + public class TransportTests : SatelliteLauncherContext + { + readonly SatelliteWithQueue _satelliteWithQueue = new SatelliteWithQueue(); + + public override void BeforeRun() + { + } + + public override void RegisterTypes() + { + Builder.Register(() => _satelliteWithQueue); + } + + [Test] + public void The_transport_should_be_started() + { + Assert.That(FakeReceiver.IsStarted, Is.True); + } + + [Test] + public void The_transport_should_be_started_with_the_satellites_inputQueueAddress() + { + Assert.AreEqual(_satelliteWithQueue.InputAddress, FakeReceiver.InputAddress); + } + } + + [TestFixture] + public class SatelliteRestartTests : SatelliteLauncherContext + { + readonly SatelliteWithQueueThatThrowException _satellite = new SatelliteWithQueueThatThrowException(); + + public override void BeforeRun() + { + } + + public override void RegisterTypes() + { + Builder.Register(() => _satellite); + } + + [Test] + public void Number_of_worker_threads_should_be_set_to_0() + { + Assert.That(Transport.NumberOfWorkerThreads, Is.EqualTo(0)); + } + + [Test] + public void TheTransport_should_have_been_restarted() + { + Assert.That(FakeReceiver.NumberOfTimesStarted, Is.GreaterThan(0)); + } + } + + public class SatelliteWithQueueThatThrowException : SatelliteWithQueue + { + public override void Start() + { + throw new Exception("This enpoint should not start!"); + } + } + + [TestFixture] + public class DefaultsTests : SatelliteLauncherContext + { + readonly FakeSatellite _fakeSatellite = new FakeSatellite(); + + public override void BeforeRun() { } + + public override void RegisterTypes() + { + Builder.Register(() => _fakeSatellite); + } + + [Test] + public void By_default_the_satellite_should_not_be_disabled() + { + Assert.That(_fakeSatellite.Disabled, Is.False); + } + + [Test] + public void The_satellite_should_be_started() + { + Assert.That(_fakeSatellite.IsStarted, Is.True); + } + } +} diff --git a/src/scheduling/NServiceBus.Scheduling.Tests/DefaultSchedulerTests.cs b/src/NServiceBus.Core.Tests/Scheduler/DefaultSchedulerTests.cs similarity index 87% rename from src/scheduling/NServiceBus.Scheduling.Tests/DefaultSchedulerTests.cs rename to src/NServiceBus.Core.Tests/Scheduler/DefaultSchedulerTests.cs index cde7d81a57f..89f428c5670 100644 --- a/src/scheduling/NServiceBus.Scheduling.Tests/DefaultSchedulerTests.cs +++ b/src/NServiceBus.Core.Tests/Scheduler/DefaultSchedulerTests.cs @@ -1,14 +1,14 @@ -using System; -using System.Threading; -using NUnit.Framework; - -namespace NServiceBus.Scheduling.Tests +namespace NServiceBus.Scheduling.Tests { + using System.Threading; + using NUnit.Framework; + using Core.Tests.Fakes; + [TestFixture] public class DefaultSchedulerTests { private FakeBus _bus = new FakeBus(); - private IScheduledTaskStorage _taskStorage = new InMemoryScheduledTaskStorage(); + private readonly IScheduledTaskStorage _taskStorage = new InMemoryScheduledTaskStorage(); private IScheduler _scheduler; [SetUp] diff --git a/src/NServiceBus.Core.Tests/Scheduler/ScheduleTests.cs b/src/NServiceBus.Core.Tests/Scheduler/ScheduleTests.cs new file mode 100644 index 00000000000..d98e04a73a6 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Scheduler/ScheduleTests.cs @@ -0,0 +1,64 @@ +namespace NServiceBus.Scheduling.Tests +{ + using System; + using System.Linq; + using System.Reflection; + using NUnit.Framework; + using System.Threading.Tasks; + using Core.Tests; + using Core.Tests.Fakes; + + [TestFixture] + public class ScheduleTests + { + private const string ACTION_NAME = "my action"; + private FuncBuilder _builder = new FuncBuilder(); + private FakeBus _bus = new FakeBus(); + + private readonly InMemoryScheduledTaskStorage _taskStorage = new InMemoryScheduledTaskStorage(); + + [SetUp] + public void SetUp() + { + Configure.With(new Assembly[0]); + Configure.Instance.Builder = _builder; + + _builder.Register(() => _bus); + _builder.Register(() => _taskStorage); + _builder.Register(() => new DefaultScheduler(_bus, _taskStorage)); + } + + [Test] + public void When_scheduling_an_action_with_a_name_the_task_should_get_that_name() + { + Schedule.Every(TimeSpan.FromMinutes(5)).Action(ACTION_NAME, () => { }); + Assert.That(EnsureThatNameExists(ACTION_NAME)); + } + + [Test] + public void When_scheduling_an_action_without_a_name_the_task_should_get_the_DeclaringType_as_name() + { + Schedule.Every(TimeSpan.FromMinutes(5)).Action(() => { }); + Assert.That(EnsureThatNameExists("ScheduleTests")); + } + + [Test] + public void Schedule_tasks_using_mutiple_threads() + { + Parallel.For(0, 20, i => Schedule.Every(TimeSpan.FromSeconds(1)).Action(() => { })); + + _bus.DeferWasCalled = 0; + + Parallel.ForEach(_taskStorage.Tasks, + t => new ScheduledTaskMessageHandler(new DefaultScheduler(_bus, _taskStorage)).Handle( + new Messages.ScheduledTask { TaskId = t.Key })); + + Assert.That(_bus.DeferWasCalled, Is.EqualTo(20)); + } + + private bool EnsureThatNameExists(string name) + { + return _taskStorage.Tasks.Any(task => task.Value.Name.Equals(name)); + } + } +} \ No newline at end of file diff --git a/src/scheduling/NServiceBus.Scheduling.Tests/ScheduledTaskMessageHandlerTests.cs b/src/NServiceBus.Core.Tests/Scheduler/ScheduledTaskMessageHandlerTests.cs similarity index 89% rename from src/scheduling/NServiceBus.Scheduling.Tests/ScheduledTaskMessageHandlerTests.cs rename to src/NServiceBus.Core.Tests/Scheduler/ScheduledTaskMessageHandlerTests.cs index 774e6029b09..23004f96efb 100644 --- a/src/scheduling/NServiceBus.Scheduling.Tests/ScheduledTaskMessageHandlerTests.cs +++ b/src/NServiceBus.Core.Tests/Scheduler/ScheduledTaskMessageHandlerTests.cs @@ -1,8 +1,9 @@ -using System; -using NUnit.Framework; - -namespace NServiceBus.Scheduling.Tests +namespace NServiceBus.Scheduling.Tests { + using System; + using NUnit.Framework; + using Core.Tests.Fakes; + [TestFixture] public class ScheduledTaskMessageHandlerTests { diff --git a/src/NServiceBus.Core.Tests/SecondLevelRetries/DefaultRetryPolicyTests.cs b/src/NServiceBus.Core.Tests/SecondLevelRetries/DefaultRetryPolicyTests.cs new file mode 100644 index 00000000000..78602dae4ef --- /dev/null +++ b/src/NServiceBus.Core.Tests/SecondLevelRetries/DefaultRetryPolicyTests.cs @@ -0,0 +1,46 @@ +namespace NServiceBus.Management.Retries.Tests +{ + using System; + using NServiceBus.SecondLevelRetries; + using NServiceBus.SecondLevelRetries.Helpers; + using NUnit.Framework; + + [TestFixture] + public class DefaultRetryPolicyTests + { + private readonly int[] _expectedResults = new[] {10,20,30}; + private TransportMessage _message; + + [SetUp] + public void SetUp() + { + _message = new TransportMessage(); + } + + [Test] + public void The_time_span_should_increase_with_10_sec_for_every_retry() + { + for (int i=0; i<3; i++) + { + var timeSpan = DefaultRetryPolicy.RetryPolicy(_message); + + Defer(); + + Assert.AreEqual(_expectedResults[i], timeSpan.Seconds); + } + } + + [Test] + public void The_default_time_out_should_be_1_day() + { + TransportMessageHelpers.SetHeader(_message, SecondLevelRetriesHeaders.RetriesTimestamp, DateTimeExtensions.ToWireFormattedString(DateTime.UtcNow.AddDays(-1).AddSeconds(-1))); + var hasTimedOut = DefaultRetryPolicy.RetryPolicy(_message) == TimeSpan.MinValue; + Assert.IsTrue(hasTimedOut); + } + + private void Defer() + { + TransportMessageHelpers.SetHeader(_message, Headers.Retries, (TransportMessageHelpers.GetNumberOfRetries(_message) + 1).ToString()); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/SecondLevelRetries/SecondLevelRetriesTests.cs b/src/NServiceBus.Core.Tests/SecondLevelRetries/SecondLevelRetriesTests.cs new file mode 100644 index 00000000000..edc74c6aacb --- /dev/null +++ b/src/NServiceBus.Core.Tests/SecondLevelRetries/SecondLevelRetriesTests.cs @@ -0,0 +1,175 @@ +namespace NServiceBus.Management.Retries.Tests +{ + using System; + using Faults.Forwarder; + using NServiceBus.SecondLevelRetries; + using NServiceBus.SecondLevelRetries.Helpers; + using NUnit.Framework; + using Transports; + + [TestFixture] + public class SecondLevelRetriesTests + { + readonly SecondLevelRetriesProcessor satellite = new SecondLevelRetriesProcessor(); + readonly FakeMessageSender messageSender = new FakeMessageSender(); + readonly FakeMessageDeferrer deferrer = new FakeMessageDeferrer(); + readonly Address ERROR_QUEUE = new Address("error","localhost"); + readonly Address RETRIES_QUEUE = new Address("retries", "localhost"); + readonly Address ORIGINAL_QUEUE = new Address("org", "hostname"); + TransportMessage message; + + [SetUp] + public void SetUp() + { + satellite.InputAddress = RETRIES_QUEUE; + satellite.FaultManager = new FaultManager {ErrorQueue = ERROR_QUEUE}; + + satellite.MessageSender = messageSender; + satellite.MessageDeferrer = deferrer; + + satellite.RetryPolicy = DefaultRetryPolicy.RetryPolicy; + + message = new TransportMessage(); + } + + [Test] + public void Message_should_have_ReplyToAddress_set_to_original_sender_when_sent_to_real_errorq() + { + var expected = new Address("clientQ", "myMachine"); + message.ReplyToAddress = expected; + satellite.RetryPolicy = _ => TimeSpan.MinValue; + + satellite.Handle(message); + + Assert.AreEqual(expected, message.ReplyToAddress); + } + + [Test] + public void Message_should_have_ReplyToAddress_set_to_original_sender_when_sent_to_real_errorq_after_retries() + { + TransportMessageHelpers.SetHeader(message, Faults.FaultsHeaderKeys.FailedQ, "reply@address"); + + var expected = new Address("clientQ", "myMachine"); + message.ReplyToAddress = expected; + + for (var i = 0; i < DefaultRetryPolicy.NumberOfRetries + 1; i++) + { + satellite.Handle(message); + } + + Assert.AreEqual(expected, message.ReplyToAddress); + } + + [Test] + public void Message_should_be_sent_to_real_errorQ_if_defer_timespan_is_less_than_zero() + { + TransportMessageHelpers.SetHeader(message, Faults.FaultsHeaderKeys.FailedQ, "reply@address"); + satellite.RetryPolicy = _ => { return TimeSpan.MinValue; }; + + satellite.Handle(message); + + Assert.AreEqual(ERROR_QUEUE, messageSender.MessageSentTo); + } + + [Test] + public void Message_should_be_sent_to_retryQ_if_defer_timespan_is_greater_than_zero() + { + TransportMessageHelpers.SetHeader(message, Faults.FaultsHeaderKeys.FailedQ, "reply@address"); + satellite.RetryPolicy = _ => { return TimeSpan.FromSeconds(1); }; + + satellite.Handle(message); + + Assert.AreEqual(message, deferrer.DeferredMessage); + } + + [Test] + public void Message_should_only_be_retried_X_times_when_using_the_defaultPolicy() + { + TransportMessageHelpers.SetHeader(message, Faults.FaultsHeaderKeys.FailedQ, "reply@address"); + + for (int i = 0; i < DefaultRetryPolicy.NumberOfRetries + 1; i++) + { + satellite.Handle(message); + } + + Assert.AreEqual(ERROR_QUEUE, messageSender.MessageSentTo); + } + + [Test] + public void Message_retries_header_should_be_removed_before_being_sent_to_real_errorQ() + { + TransportMessageHelpers.SetHeader(message, Faults.FaultsHeaderKeys.FailedQ, "reply@address"); + + satellite.Handle(message); + + TransportMessageHelpers.SetHeader(message, SecondLevelRetriesHeaders.RetriesTimestamp, DateTimeExtensions.ToWireFormattedString(DateTime.Now.AddDays(-2))); + + satellite.Handle(message); + + Assert.False(message.Headers.ContainsKey(Headers.Retries)); + } + + [Test] + public void A_message_should_only_be_able_to_retry_during_N_minutes() + { + TransportMessageHelpers.SetHeader(message, Faults.FaultsHeaderKeys.FailedQ, "reply@address"); + TransportMessageHelpers.SetHeader(message, SecondLevelRetriesHeaders.RetriesTimestamp, DateTimeExtensions.ToWireFormattedString(DateTime.Now.AddDays(-2))); + satellite.Handle(message); + + Assert.AreEqual(ERROR_QUEUE, messageSender.MessageSentTo); + } + + [Test] + public void For_each_retry_the_NServiceBus_Retries_header_should_be_increased() + { + TransportMessageHelpers.SetHeader(message, Faults.FaultsHeaderKeys.FailedQ, "reply@address"); + satellite.RetryPolicy = _ => { return TimeSpan.FromSeconds(1); }; + + for (int i = 0; i < 10; i++) + { + satellite.Handle(message); + } + + Assert.AreEqual(10, TransportMessageHelpers.GetNumberOfRetries(message)); + } + + [Test] + public void Message_should_be_routed_to_the_failing_endpoint_when_the_time_is_up() + { + TransportMessageHelpers.SetHeader(message, Faults.FaultsHeaderKeys.FailedQ, ORIGINAL_QUEUE.ToString()); + satellite.RetryPolicy = _ => TimeSpan.FromSeconds(1); + + satellite.Handle(message); + + Assert.AreEqual(ORIGINAL_QUEUE, deferrer.MessageRoutedTo); + } + } + + internal class FakeMessageDeferrer : IDeferMessages + { + public Address MessageRoutedTo { get; set; } + + public TransportMessage DeferredMessage { get; set; } + + public void Defer(TransportMessage message, DateTime processAt, Address address) + { + MessageRoutedTo = address; + DeferredMessage = message; + } + + public void ClearDeferredMessages(string headerKey, string headerValue) + { + + } + } + + internal class FakeMessageSender : ISendMessages + { + public Address MessageSentTo { get; set; } + + public void Send(TransportMessage message, Address address) + { + MessageSentTo = address; + } + } +} diff --git a/src/NServiceBus.Core.Tests/Serializers/Binary/BinarySerializerTest.cs b/src/NServiceBus.Core.Tests/Serializers/Binary/BinarySerializerTest.cs new file mode 100644 index 00000000000..a40a3bb8d39 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Serializers/Binary/BinarySerializerTest.cs @@ -0,0 +1,69 @@ +namespace NServiceBus.Core.Tests.Serializers.Binary +{ + using System; + using System.IO; + using System.Xml.Linq; + + using NServiceBus.Serializers.Binary; + + using NUnit.Framework; + + using System.Linq; + + [TestFixture] + public class BinarySerializerTest + { + private BinaryMessageSerializer serializer; + + [SetUp] + public void SetUp() + { + serializer = new BinaryMessageSerializer(); + } + + [Test] + public void When_Using_Property_WithXContainerAssignable_should_serialize() + { + const string XmlElement = ""; + const string XmlDocument = "" + XmlElement; + + var messageWithXDocument = new MessageWithXDocument { Document = XDocument.Load(new StringReader(XmlDocument)) }; + var messageWithXElement = new MessageWithXElement { Document = XElement.Load(new StringReader(XmlElement)) }; + + MessageWithXDocument resultXDocument; + using (var stream = new MemoryStream()) + { + serializer.Serialize(new object[] { messageWithXDocument }, stream); + + stream.Position = 0; + + resultXDocument = this.serializer.Deserialize(stream, new[] { typeof(MessageWithXDocument) }).OfType().Single(); + } + + MessageWithXElement resultXElement; + using (var stream = new MemoryStream()) + { + serializer.Serialize(new object[] { messageWithXElement }, stream); + + stream.Position = 0; + + resultXElement = this.serializer.Deserialize(stream, new[] { typeof(MessageWithXElement) }).OfType().Single(); + } + + Assert.AreEqual(messageWithXDocument.Document.ToString(), resultXDocument.Document.ToString()); + Assert.AreEqual(messageWithXElement.Document.ToString(), resultXElement.Document.ToString()); + } + + [Serializable] + public class MessageWithXDocument : IMessage + { + public XDocument Document { get; set; } + } + + [Serializable] + public class MessageWithXElement : IMessage + { + public XElement Document { get; set; } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Serializers/Json/BsonMessageSerializerTest.cs b/src/NServiceBus.Core.Tests/Serializers/Json/BsonMessageSerializerTest.cs new file mode 100644 index 00000000000..c8fce63c752 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Serializers/Json/BsonMessageSerializerTest.cs @@ -0,0 +1,50 @@ +namespace NServiceBus.Serializers.Json.Tests +{ + using System.IO; + using System.Linq; + using System.Xml.Linq; + + using NUnit.Framework; + + [TestFixture] + public class BsonMessageSerializerTest : JsonMessageSerializerTestBase + { + [SetUp] + public void Setup() + { + Serializer = new BsonMessageSerializer(MessageMapper); + } + + [Test] + public void When_Using_Property_WithXContainerAssignable_should_serialize() + { + const string XmlElement = ""; + const string XmlDocument = "" + XmlElement; + + var messageWithXDocument = new MessageWithXDocument { Document = XDocument.Load(new StringReader(XmlDocument)) }; + var messageWithXElement = new MessageWithXElement { Document = XElement.Load(new StringReader(XmlElement)) }; + + using (var stream = new MemoryStream()) + { + Serializer.Serialize(new object[] { messageWithXDocument }, stream); + + stream.Position = 0; + + var result = Serializer.Deserialize(stream, new[] { typeof(MessageWithXDocument) }).Cast().Single(); + + Assert.AreEqual(messageWithXDocument.Document.ToString(), result.Document.ToString()); + } + + using (var stream = new MemoryStream()) + { + Serializer.Serialize(new object[] { messageWithXElement }, stream); + + stream.Position = 0; + + var result = Serializer.Deserialize(stream, new[] { typeof(MessageWithXElement) }).Cast().Single(); + + Assert.AreEqual(messageWithXElement.Document.ToString(), result.Document.ToString()); + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Serializers/Json/JsonMessageSerializerTest.cs b/src/NServiceBus.Core.Tests/Serializers/Json/JsonMessageSerializerTest.cs new file mode 100644 index 00000000000..a6d38dd7a20 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Serializers/Json/JsonMessageSerializerTest.cs @@ -0,0 +1,155 @@ +namespace NServiceBus.Serializers.Json.Tests +{ + using System.IO; + using System.Linq; + using System.Xml.Linq; + + using NUnit.Framework; + + [TestFixture] + public class JsonMessageSerializerTest : JsonMessageSerializerTestBase + { + public JsonMessageSerializerTest() + : base(typeof(SimpleMessage)) + { + } + + [SetUp] + public void Setup() + { + Serializer = new JsonMessageSerializer(MessageMapper); + } + + [Test] + public void Deserialize_message_with_interface_without_wrapping() + { + using (var stream = new MemoryStream()) + { + Serializer.SkipArrayWrappingForSingleMessages = true; + + Serializer.Serialize(new object[] { new SuperMessage {SomeProperty = "John"} }, stream); + + stream.Position = 0; + + var result = (SuperMessage)Serializer.Deserialize(stream, new[] { typeof(SuperMessage), typeof(IMyEvent) })[0]; + + Assert.AreEqual("John", result.SomeProperty); + } + } + + [Test] + public void Serialize_message_without_wrapping() + { + using (var stream = new MemoryStream()) + { + Serializer.SkipArrayWrappingForSingleMessages = true; + + Serializer.Serialize(new object[] { new SimpleMessage() }, stream); + + stream.Position = 0; + var result = new StreamReader(stream).ReadToEnd(); + + Assert.That(!result.StartsWith("["), result); + } + } + + [Test] + public void Deserialize_message_without_wrapping() + { + using (var stream = new MemoryStream()) + { + Serializer.SkipArrayWrappingForSingleMessages = true; + + Serializer.Serialize(new object[] { new SimpleMessage{SomeProperty = "test"} }, stream); + + stream.Position = 0; + var result = (SimpleMessage) Serializer.Deserialize(stream, new[]{typeof(SimpleMessage)})[0]; + + Assert.AreEqual("test",result.SomeProperty); + } + + } + + [Test] + public void Serialize_message_without_typeinfo() + { + using (var stream = new MemoryStream()) + { + Serializer.SkipArrayWrappingForSingleMessages = true; + + Serializer.Serialize(new object[] { new SimpleMessage() }, stream); + + stream.Position = 0; + var result = new StreamReader(stream).ReadToEnd(); + + Assert.That(!result.Contains("$type"), result); + } + } + + [Test] + public void When_Using_Property_WithXContainerAssignable_should_preserve_xml() + { + const string XmlElement = ""; + const string XmlDocument = "" + XmlElement; + + var messageWithXDocument = new MessageWithXDocument { Document = XDocument.Load(new StringReader(XmlDocument)) }; + var messageWithXElement = new MessageWithXElement { Document = XElement.Load(new StringReader(XmlElement)) }; + + using (var stream = new MemoryStream()) + { + Serializer.SkipArrayWrappingForSingleMessages = true; + + Serializer.Serialize(new object[] { messageWithXDocument }, stream); + + stream.Position = 0; + var json = new StreamReader(stream).ReadToEnd(); + stream.Position = 0; + + var result = Serializer.Deserialize(stream, new[] { typeof(MessageWithXDocument) }).Cast().Single(); + + Assert.AreEqual(messageWithXDocument.Document.ToString(), result.Document.ToString()); + Assert.AreEqual(XmlElement, json.Substring(13, json.Length - 15).Replace("\\", string.Empty)); + } + + using (var stream = new MemoryStream()) + { + Serializer.SkipArrayWrappingForSingleMessages = true; + + Serializer.Serialize(new object[] { messageWithXElement }, stream); + + stream.Position = 0; + var json = new StreamReader(stream).ReadToEnd(); + stream.Position = 0; + + var result = Serializer.Deserialize(stream, new[] { typeof(MessageWithXElement) }).Cast().Single(); + + Assert.AreEqual(messageWithXElement.Document.ToString(), result.Document.ToString()); + Assert.AreEqual(XmlElement, json.Substring(13, json.Length - 15).Replace("\\", string.Empty)); + } + } + } + + public class SimpleMessage + { + public string SomeProperty { get; set; } + } + + public class SuperMessage : IMyEvent + { + public string SomeProperty { get; set; } + } + + public interface IMyEvent + { + } + + public class MessageWithXDocument + { + public XDocument Document { get; set; } + } + + public class MessageWithXElement + { + public XElement Document { get; set; } + } +} diff --git a/src/impl/Serializers/NServiceBus.Serializers.Json.Tests/JsonMessageSerializerTestBase.cs b/src/NServiceBus.Core.Tests/Serializers/Json/JsonMessageSerializerTestBase.cs similarity index 95% rename from src/impl/Serializers/NServiceBus.Serializers.Json.Tests/JsonMessageSerializerTestBase.cs rename to src/NServiceBus.Core.Tests/Serializers/Json/JsonMessageSerializerTestBase.cs index 854c44dac99..eda24f5ed7f 100644 --- a/src/impl/Serializers/NServiceBus.Serializers.Json.Tests/JsonMessageSerializerTestBase.cs +++ b/src/NServiceBus.Core.Tests/Serializers/Json/JsonMessageSerializerTestBase.cs @@ -2,11 +2,14 @@ using System.Collections.Generic; using System.IO; using System.Reflection; -using NServiceBus.MessageInterfaces.MessageMapper.Reflection; using NUnit.Framework; namespace NServiceBus.Serializers.Json.Tests { + using MessageInterfaces.MessageMapper.Reflection; + + using System.Linq; + public class A : IMessage { public Guid Aguid { get; set; } @@ -51,13 +54,13 @@ public class C public abstract class JsonMessageSerializerTestBase { - protected abstract JsonMessageSerializerBase Serializer { get; set; } - protected MessageMapper MessageMapper { get; private set; } + protected JsonMessageSerializerBase Serializer { get; set; } + protected MessageMapper MessageMapper { get; set; } - protected JsonMessageSerializerTestBase() + protected JsonMessageSerializerTestBase(params Type[] messageTypes) { MessageMapper = new MessageMapper(); - MessageMapper.Initialize(new[] { typeof(IA), typeof(A) }); + MessageMapper.Initialize(new[] { typeof(IA), typeof(A) }.Union(messageTypes)); } [Test] diff --git a/src/impl/Serializers/NServiceBus.Serializers.XML.Test/Command1.cs b/src/NServiceBus.Core.Tests/Serializers/XML/Command1.cs similarity index 100% rename from src/impl/Serializers/NServiceBus.Serializers.XML.Test/Command1.cs rename to src/NServiceBus.Core.Tests/Serializers/XML/Command1.cs diff --git a/src/impl/Serializers/NServiceBus.Serializers.XML.Test/Command2.cs b/src/NServiceBus.Core.Tests/Serializers/XML/Command2.cs similarity index 100% rename from src/impl/Serializers/NServiceBus.Serializers.XML.Test/Command2.cs rename to src/NServiceBus.Core.Tests/Serializers/XML/Command2.cs diff --git a/src/NServiceBus.Core.Tests/Serializers/XML/ConcurrencySerializerTests.cs b/src/NServiceBus.Core.Tests/Serializers/XML/ConcurrencySerializerTests.cs new file mode 100644 index 00000000000..a287c1098cc --- /dev/null +++ b/src/NServiceBus.Core.Tests/Serializers/XML/ConcurrencySerializerTests.cs @@ -0,0 +1,45 @@ +namespace NServiceBus.Serializers.XML.Test +{ + using System; + using System.IO; + using System.Threading.Tasks; + using NUnit.Framework; + + [TestFixture] + public class ConcurrencySerializerTests + { + [Test] + public void Should_deserialize_in_parallel() + { + var expected = new RequestDataMessage + { + DataId = Guid.Empty, + String = "it's my \"node\" & i like it", + }; + + var serialiser = SerializerFactory.Create(); + + Parallel.For(1, 1000, i => + { + RequestDataMessage result; + using (var stream = new MemoryStream()) + { + serialiser.Serialize(new object[] {expected}, stream); + stream.Position = 0; + + var msgArray = serialiser.Deserialize(stream); + result = (RequestDataMessage) msgArray[0]; + } + + Assert.AreEqual(expected.DataId, result.DataId); + Assert.AreEqual(expected.String, result.String); + }); + } + } + + public class RequestDataMessage : IMessage + { + public Guid DataId { get; set; } + public string String { get; set; } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Serializers/XML/DictionaryTests.cs b/src/NServiceBus.Core.Tests/Serializers/XML/DictionaryTests.cs new file mode 100644 index 00000000000..0ffa1235c34 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Serializers/XML/DictionaryTests.cs @@ -0,0 +1,144 @@ +namespace NServiceBus.Serializers.XML.Test +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using NUnit.Framework; + + [TestFixture] + public class DictionaryTests + { + [Test] + public void Should_deserialize_dictionaries() + { + var expected = new MessageWithDictionaries + { + Bools = new Dictionary + { + {true, true}, + {false, false} + }, + Chars = new Dictionary + { + //{char.MinValue, char.MaxValue}, // doesn't work becayse we use UTF8 + {'a', 'b'}, + {'c', 'd'}, + {'e', 'f'} + }, + Bytes = new Dictionary + { + {byte.MinValue, byte.MaxValue}, + {11, 1}, + {1, 0} + }, + Ints = new Dictionary + { + {int.MinValue, int.MaxValue}, + {1, 2}, + {3, 4}, + {5, 6} + }, + Decimals = new Dictionary + { + {decimal.MinValue, decimal.MaxValue}, + {.2m, 4m}, + {.5m, .4234m} + }, + Doubles = new Dictionary + { + {double.MinValue, double.MaxValue}, + {.223d, 234d}, + {.513d, .4212334d} + }, + Floats = new Dictionary + { + {float.MinValue, float.MaxValue}, + {.223f, 234f}, + {.513f, .4212334f} + }, + Enums = new Dictionary + { + {DateTimeStyles.AdjustToUniversal, DateTimeKind.Local}, + {DateTimeStyles.AllowLeadingWhite, DateTimeKind.Unspecified}, + + }, + Longs = new Dictionary + { + {long.MaxValue, long.MinValue}, + {34234, 234324}, + {45345345, 34534534565} + }, + SBytes = new Dictionary + { + {sbyte.MaxValue, sbyte.MaxValue}, + {56, 13} + }, + Shorts = new Dictionary + { + {short.MinValue, short.MaxValue}, + {5231, 6123} + }, + Strings = new Dictionary + { + {"Key1", "Value1"}, + {"Key2", "Value2"}, + {"Key3", "Value3"}, + }, + UInts = new Dictionary + { + {uint.MinValue, 23}, + {uint.MaxValue, 34324} + }, + ULongs = new Dictionary + { + {ulong.MinValue, ulong.MaxValue}, + {34324234, 3243243245} + }, + UShorts = new Dictionary + { + {ushort.MinValue, ushort.MaxValue}, + {42324, 32} + } + + }; + + var result = ExecuteSerializer.ForMessage(expected); + + CollectionAssert.AreEqual(expected.Bools, result.Bools); + CollectionAssert.AreEqual(expected.Chars, result.Chars); + CollectionAssert.AreEqual(expected.Bytes, result.Bytes); + CollectionAssert.AreEqual(expected.Ints, result.Ints); + CollectionAssert.AreEqual(expected.Decimals, result.Decimals); + CollectionAssert.AreEqual(expected.Doubles, result.Doubles); + CollectionAssert.AreEqual(expected.Floats, result.Floats); + CollectionAssert.AreEqual(expected.Enums, result.Enums); + CollectionAssert.AreEqual(expected.Longs, result.Longs); + CollectionAssert.AreEqual(expected.SBytes, result.SBytes); + CollectionAssert.AreEqual(expected.Shorts, result.Shorts); + CollectionAssert.AreEqual(expected.Strings, result.Strings); + CollectionAssert.AreEqual(expected.UInts, result.UInts); + CollectionAssert.AreEqual(expected.ULongs, result.ULongs); + CollectionAssert.AreEqual(expected.UShorts, result.UShorts); + } + } + + [Serializable] + public class MessageWithDictionaries : IMessage + { + public Dictionary Bools { get; set; } + public Dictionary Bytes { get; set; } + public Dictionary Chars { get; set; } + public Dictionary Decimals { get; set; } + public Dictionary Doubles { get; set; } + public Dictionary Enums { get; set; } + public Dictionary Floats { get; set; } + public Dictionary Ints { get; set; } + public Dictionary Longs { get; set; } + public Dictionary SBytes { get; set; } + public Dictionary Shorts { get; set; } + public Dictionary UInts { get; set; } + public Dictionary ULongs { get; set; } + public Dictionary UShorts { get; set; } + public Dictionary Strings { get; set; } + } +} \ No newline at end of file diff --git a/src/impl/Serializers/NServiceBus.Serializers.XML.Test/IM1.cs b/src/NServiceBus.Core.Tests/Serializers/XML/IM1.cs similarity index 100% rename from src/impl/Serializers/NServiceBus.Serializers.XML.Test/IM1.cs rename to src/NServiceBus.Core.Tests/Serializers/XML/IM1.cs diff --git a/src/impl/Serializers/NServiceBus.Serializers.XML.Test/IM2.cs b/src/NServiceBus.Core.Tests/Serializers/XML/IM2.cs similarity index 100% rename from src/impl/Serializers/NServiceBus.Serializers.XML.Test/IM2.cs rename to src/NServiceBus.Core.Tests/Serializers/XML/IM2.cs diff --git a/src/NServiceBus.Core.Tests/Serializers/XML/Issue_934.cs b/src/NServiceBus.Core.Tests/Serializers/XML/Issue_934.cs new file mode 100644 index 00000000000..5c83c8abbee --- /dev/null +++ b/src/NServiceBus.Core.Tests/Serializers/XML/Issue_934.cs @@ -0,0 +1,40 @@ +namespace NServiceBus.Core.Tests.Serializers.XML +{ + using System.IO; + using NServiceBus.Serializers.XML.Test; + using NUnit.Framework; + + [TestFixture] + public class Issue_934 + { + [Test] + public void Serialize_ShouldSucceed_WhenCharContainsXmlSpecialCharacters() + { + var serializer = SerializerFactory.Create(); + var message = new TestMessageWithChar + { + ValidCharacter = 'a', + InvalidCharacter = '<' + }; + + object[] messageDeserialized; + using (Stream stream = new MemoryStream()) + { + serializer.Serialize(new object[] { message }, stream); + + stream.Position = 0; + + messageDeserialized = serializer.Deserialize(stream, new[] { message.GetType() }); + } + + Assert.AreEqual(message.InvalidCharacter, ((TestMessageWithChar)messageDeserialized[0]).InvalidCharacter); + Assert.AreEqual(message.ValidCharacter, ((TestMessageWithChar)messageDeserialized[0]).ValidCharacter); + } + + public class TestMessageWithChar : IMessage + { + public char InvalidCharacter { get; set; } + public char ValidCharacter { get; set; } + } + } +} diff --git a/src/NServiceBus.Core.Tests/Serializers/XML/ListTests.cs b/src/NServiceBus.Core.Tests/Serializers/XML/ListTests.cs new file mode 100644 index 00000000000..ef606880e40 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Serializers/XML/ListTests.cs @@ -0,0 +1,83 @@ +namespace NServiceBus.Serializers.XML.Test +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using NUnit.Framework; + + [TestFixture] + public class ListTests + { + [Test] + public void Should_deserialize_list() + { + var expected = new MessageWithLists + { + Bools = new List {true, false}, + Chars = new List {'a', 'b', 'c', 'd', 'e', 'f'}, + Bytes = new List {byte.MinValue, byte.MaxValue, 11, 1, 1, 0}, + Ints = new List {int.MinValue, int.MaxValue, 1, 2, 3, 4, 5, 6}, + Decimals = + new List {decimal.MinValue, decimal.MaxValue, .2m, 4m, .5m, .4234m}, + Doubles = + new List + {double.MinValue, double.MaxValue, .223d, 234d, .513d, .4212334d}, + Floats = + new List {float.MinValue, float.MaxValue, .223f, 234f, .513f, .4212334f}, + Enums = new List + { + DateTimeStyles.AdjustToUniversal, + DateTimeStyles.AllowLeadingWhite, + DateTimeStyles.AllowTrailingWhite + }, + Longs = + new List + {long.MaxValue, long.MinValue, 34234, 234324, 45345345, 34534534565}, + SBytes = new List {sbyte.MaxValue, sbyte.MaxValue, 56, 13}, + Shorts = new List {short.MinValue, short.MaxValue, 5231, 6123}, + Strings = new List {"Key1", "Value1", "Key2", "Value2", "Key3", "Value3"}, + UInts = new List {uint.MinValue, 23, uint.MaxValue, 34324}, + ULongs = new List {ulong.MinValue, ulong.MaxValue, 34324234, 3243243245}, + UShorts = new List {ushort.MinValue, ushort.MaxValue, 42324, 32} + }; + + var result = ExecuteSerializer.ForMessage(expected); + + CollectionAssert.AreEqual(expected.Bools, result.Bools); + CollectionAssert.AreEqual(expected.Chars, result.Chars); + CollectionAssert.AreEqual(expected.Bytes, result.Bytes); + CollectionAssert.AreEqual(expected.Ints, result.Ints); + CollectionAssert.AreEqual(expected.Decimals, result.Decimals); + CollectionAssert.AreEqual(expected.Doubles, result.Doubles); + CollectionAssert.AreEqual(expected.Floats, result.Floats); + CollectionAssert.AreEqual(expected.Enums, result.Enums); + CollectionAssert.AreEqual(expected.Longs, result.Longs); + CollectionAssert.AreEqual(expected.SBytes, result.SBytes); + CollectionAssert.AreEqual(expected.Shorts, result.Shorts); + CollectionAssert.AreEqual(expected.Strings, result.Strings); + CollectionAssert.AreEqual(expected.UInts, result.UInts); + CollectionAssert.AreEqual(expected.ULongs, result.ULongs); + CollectionAssert.AreEqual(expected.UShorts, result.UShorts); + } + } + + [Serializable] + public class MessageWithLists : IMessage + { + public List Bools { get; set; } + public List Bytes { get; set; } + public List Chars { get; set; } + public List Decimals { get; set; } + public List Doubles { get; set; } + public List Enums { get; set; } + public List Floats { get; set; } + public List Ints { get; set; } + public List Longs { get; set; } + public List SBytes { get; set; } + public List Shorts { get; set; } + public List UInts { get; set; } + public List ULongs { get; set; } + public List UShorts { get; set; } + public List Strings { get; set; } + } +} \ No newline at end of file diff --git a/src/impl/Serializers/NServiceBus.Serializers.XML.Test/M1.cs b/src/NServiceBus.Core.Tests/Serializers/XML/M1.cs similarity index 100% rename from src/impl/Serializers/NServiceBus.Serializers.XML.Test/M1.cs rename to src/NServiceBus.Core.Tests/Serializers/XML/M1.cs diff --git a/src/impl/Serializers/NServiceBus.Serializers.XML.Test/M2.cs b/src/NServiceBus.Core.Tests/Serializers/XML/M2.cs similarity index 100% rename from src/impl/Serializers/NServiceBus.Serializers.XML.Test/M2.cs rename to src/NServiceBus.Core.Tests/Serializers/XML/M2.cs diff --git a/src/impl/Serializers/NServiceBus.Serializers.XML.Test/MultipleInterfaces.cs b/src/NServiceBus.Core.Tests/Serializers/XML/MultipleInterfaces.cs similarity index 100% rename from src/impl/Serializers/NServiceBus.Serializers.XML.Test/MultipleInterfaces.cs rename to src/NServiceBus.Core.Tests/Serializers/XML/MultipleInterfaces.cs diff --git a/src/NServiceBus.Core.Tests/Serializers/XML/Pull_819.cs b/src/NServiceBus.Core.Tests/Serializers/XML/Pull_819.cs new file mode 100644 index 00000000000..7d5ef1ec4b5 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Serializers/XML/Pull_819.cs @@ -0,0 +1,44 @@ +namespace NServiceBus.Serializers.XML.Test +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Xml.Serialization; + using NUnit.Framework; + + [TestFixture] + public class Pull_819 + { + [Test] + public void Should_check_for_ignore_attribute_before_checking_type() + { + var result = ExecuteSerializer.ForMessage(m3 => + { + m3.FirstName = "John"; + m3.LastName = "Simons"; + m3.List = new ArrayList(); + m3.GenericList = new List(); + }); + + Assert.AreEqual("John", result.FirstName); + } + + [Serializable] + public class MessageWithXmlIgnore : MessageWithXmlIgnoreBase + { + [XmlIgnore] + public IList List { get; set; } + + public string FirstName { get; set; } + } + + [Serializable] + public class MessageWithXmlIgnoreBase : IMessage + { + [XmlIgnore] + public List GenericList { get; set; } + + public string LastName { get; set; } + } + } +} diff --git a/src/impl/Serializers/NServiceBus.Serializers.XML.Test/Risk.cs b/src/NServiceBus.Core.Tests/Serializers/XML/Risk.cs similarity index 100% rename from src/impl/Serializers/NServiceBus.Serializers.XML.Test/Risk.cs rename to src/NServiceBus.Core.Tests/Serializers/XML/Risk.cs diff --git a/src/NServiceBus.Core.Tests/Serializers/XML/SerializerFactory.cs b/src/NServiceBus.Core.Tests/Serializers/XML/SerializerFactory.cs new file mode 100644 index 00000000000..bb255f76a9c --- /dev/null +++ b/src/NServiceBus.Core.Tests/Serializers/XML/SerializerFactory.cs @@ -0,0 +1,120 @@ +namespace NServiceBus.Serializers.XML.Test +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Xml; + using MessageInterfaces.MessageMapper.Reflection; + + public class SerializerFactory + { + public static XmlMessageSerializer Create() + { + var types = new List {typeof (T)}; + var mapper = new MessageMapper(); + mapper.Initialize(types); + var serializer = new XmlMessageSerializer(mapper); + + serializer.Initialize(types); + + return serializer; + } + + public static XmlMessageSerializer Create(params Type[] types) + { + var mapper = new MessageMapper(); + mapper.Initialize(types); + var serializer = new XmlMessageSerializer(mapper); + + serializer.Initialize(types); + + return serializer; + } + } + + public class ExecuteSerializer + { + public static T ForMessage(Action a) where T : class,new() + { + var msg = new T(); + a(msg); + + return ForMessage(msg); + } + + public static T ForMessage(object message) + { + using (var stream = new MemoryStream()) + { + SerializerFactory.Create().Serialize(new[] { message }, stream); + stream.Position = 0; + + var msgArray = SerializerFactory.Create().Deserialize(stream, new[]{message.GetType()}); + return (T)msgArray[0]; + + } + } + + } + + public class Serializer + { + string xmlResult; + XmlDocument xmlDocument; + + Serializer(string result) + { + xmlResult = result; + } + + public static Serializer Serialize(Action a) where T : class,new() + { + var msg = new T(); + a(msg); + + return ForMessage(msg); + } + + public static Serializer ForMessage(object message,Action config = null) + { + using (var stream = new MemoryStream()) + { + var serializer = SerializerFactory.Create(); + + if(config != null) + config(serializer); + + + serializer.Serialize(new[] { message }, stream); + stream.Position = 0; + var result = new StreamReader(stream); + + return new Serializer(result.ReadToEnd()); + } + } + + public Serializer AssertResultingXml(Func check, string message) + { + if(xmlDocument == null) + { + xmlDocument = new XmlDocument(); + + try + { + xmlDocument.LoadXml(xmlResult); + } + catch (Exception ex) + { + + throw new Exception("Failed to parse xml: " + xmlResult,ex); + } + + + } + if (!check(xmlDocument)) + throw new Exception(string.Format("{0}, Offending XML: {1}",message, xmlResult)); + + return this; + } + } +} diff --git a/src/NServiceBus.Core.Tests/Serializers/XML/SerializerTests.cs b/src/NServiceBus.Core.Tests/Serializers/XML/SerializerTests.cs new file mode 100644 index 00000000000..4a2d40e54b7 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Serializers/XML/SerializerTests.cs @@ -0,0 +1,1021 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Threading; +using System.Runtime.Serialization; +using System.Xml; +using System.Collections; +using NUnit.Framework; + +namespace NServiceBus.Serializers.XML.Test +{ + using System.Net.Mail; + using System.Text; + using System.Xml.Linq; + + using A; + using B; + using MessageInterfaces; + using MessageInterfaces.MessageMapper.Reflection; + + using Serialization; + + [TestFixture] + public class SerializerTests + { + private int number = 1; + private int numberOfIterations = 100; + + [Test] + public void SerializeInvalidCharacters() + { + IMessageMapper mapper = new MessageMapper(); + var serializer = SerializerFactory.Create(); + var msg = mapper.CreateInstance(); + + var sb = new StringBuilder(); + sb.Append("Hello"); + sb.Append((char)0x1C); + sb.Append("John"); + msg.Special = sb.ToString(); + + using (var stream = new MemoryStream()) + { + serializer.Serialize(new[] { msg }, stream); + stream.Position = 0; + + var msgArray = serializer.Deserialize(stream); + var m = msgArray[0] as MessageWithInvalidCharacter; + Assert.AreEqual(sb.ToString(), m.Special); + } + } + + [Test, Ignore("ArrayList is not supported")] + public void Should_deserialize_arraylist() + { + var expected = new ArrayList + { + "Value1", + "Value2", + "Value3", + }; + var result = ExecuteSerializer.ForMessage(m3 => m3.ArrayList = expected); + + CollectionAssert.AreEqual(expected, result.ArrayList); + } + + [Test, Ignore("Hashtable is not supported")] + public void Should_deserialize_hashtable() + { + var expected = new Hashtable + { + {"Key1", "Value1"}, + {"Key2", "Value2"}, + {"Key3", "Value3"}, + }; + var result = ExecuteSerializer.ForMessage(m3 => m3.Hashtable = expected); + + CollectionAssert.AreEqual(expected, result.Hashtable); + } + + [Test] + public void Should_deserialize_multiple_messages_from_different_namespaces() + { + using (var stream = new MemoryStream()) + { + SerializerFactory.Create(typeof(Command1), typeof(Command2)).Serialize(new object[] { new Command1(Guid.NewGuid()), new Command2(Guid.NewGuid()) }, stream); + stream.Position = 0; + + var msgArray = SerializerFactory.Create(typeof(Command1), typeof(Command2)).Deserialize(stream); + + Assert.AreEqual(typeof(Command1), msgArray[0].GetType()); + Assert.AreEqual(typeof(Command2), msgArray[1].GetType()); + } + } + + [Test] + public void Should_deserialize_a_single_message_where_root_element_is_the_typename() + { + using (var stream = new MemoryStream()) + { + var writer = new StreamWriter(stream); + writer.WriteLine("23.4"); + writer.Flush(); + stream.Position = 0; + + var msgArray = SerializerFactory.Create(typeof(MessageWithDouble)).Deserialize(stream); + + Assert.AreEqual(typeof(MessageWithDouble), msgArray[0].GetType()); + + } + } + + [Test] + public void Should_be_able_to_serialize_single_message_without_wrapping_element() + { + Serializer.ForMessage(new EmptyMessage(), s => + { s.SkipWrappingElementForSingleMessages = true; }) + .AssertResultingXml(d=> d.DocumentElement.Name == "EmptyMessage","Root should be message typename"); + } + + [Test] + public void Should_be_able_to_serialize_single_message_without_wrapping_xml_raw_data() + { + const string XmlElement = ""; + const string XmlDocument = "" + XmlElement; + + var messageWithXDocument = new MessageWithXDocument { Document = XDocument.Load(new StringReader(XmlDocument)) }; + var messageWithXElement = new MessageWithXElement { Document = XElement.Load(new StringReader(XmlElement)) }; + + Serializer.ForMessage(messageWithXDocument, s => + { s.SkipWrappingRawXml = true; }) + .AssertResultingXml(d => d.DocumentElement.ChildNodes[0].FirstChild.Name != "Document", "Property name should not be available"); + + Serializer.ForMessage(messageWithXElement, s => + { s.SkipWrappingRawXml = true; }) + .AssertResultingXml(d => d.DocumentElement.ChildNodes[0].FirstChild.Name != "Document", "Property name should not be available"); + } + + [Test] + public void Should_be_able_to_deserialize_messages_which_xml_raw_data_root_element_matches_property_name() + { + const string XmlElement = ""; + const string XmlDocument = "" + XmlElement; + + var messageWithXDocument = new MessageWithXDocument { Document = XDocument.Load(new StringReader(XmlDocument)) }; + var messageWithXElement = new MessageWithXElement { Document = XElement.Load(new StringReader(XmlElement)) }; + + var serializer = SerializerFactory.Create(); + serializer.SkipWrappingRawXml = true; + + using (var stream = new MemoryStream()) + { + serializer.Serialize(new[] { messageWithXDocument }, stream); + stream.Position = 0; + + serializer = SerializerFactory.Create(typeof (MessageWithXDocument)); + serializer.SkipWrappingRawXml = true; + + var msg = serializer.Deserialize(stream).Cast().Single(); + + Assert.NotNull(msg.Document); + Assert.AreEqual("Document", msg.Document.Root.Name.LocalName); + } + + serializer = SerializerFactory.Create(); + serializer.SkipWrappingRawXml = true; + + using (var stream = new MemoryStream()) + { + serializer.Serialize(new[] { messageWithXElement }, stream); + stream.Position = 0; + + serializer = SerializerFactory.Create(typeof (MessageWithXElement)); + serializer.SkipWrappingRawXml = true; + + var msg = serializer.Deserialize(stream).Cast().Single(); + + Assert.NotNull(msg.Document); + Assert.AreEqual("Document", msg.Document.Name.LocalName); + } + } + + [Test] + public void Should_be_able_to_serialize_single_message_with_default_namespaces_and_then_deserialize() + { + var serializer = SerializerFactory.Create(); + serializer.SkipWrappingElementForSingleMessages = true; + var msg = new MessageWithDouble(); + + using (var stream = new MemoryStream()) + { + serializer.Serialize(new[] { msg }, stream); + stream.Position = 0; + + var msgArray = SerializerFactory.Create(typeof(MessageWithDouble)).Deserialize(stream); + + Assert.AreEqual(typeof(MessageWithDouble), msgArray[0].GetType()); + } + } + + [Test] + public void Should_be_able_to_serialize_single_message_with_default_namespaces() + { + var serializer = SerializerFactory.Create(); + serializer.SkipWrappingElementForSingleMessages = true; + var msg = new EmptyMessage(); + + var expected = @""; + + using (var stream = new MemoryStream()) + { + serializer.Serialize(new[] { msg }, stream); + stream.Position = 0; + + string result; + using (var reader = new StreamReader(stream)) + { + reader.ReadLine(); + result = reader.ReadLine(); + } + + Assert.AreEqual(expected, result); + } + } + + [Test] + public void Should_be_able_to_serialize_single_message_with_specified_namespaces() + { + var serializer = SerializerFactory.Create(); + serializer.SkipWrappingElementForSingleMessages = true; + serializer.Namespace = "http://super.com"; + var msg = new EmptyMessage(); + + var expected = @""; + using (var stream = new MemoryStream()) + { + serializer.Serialize(new[] { msg }, stream); + stream.Position = 0; + + string result; + using (var reader = new StreamReader(stream)) + { + reader.ReadLine(); + result = reader.ReadLine(); + } + + Assert.AreEqual(expected, result); + } + } + + [Test] + public void Should_deserialize_a_single_message_with_typename_passed_in_externally() + { + using (var stream = new MemoryStream()) + { + var writer = new StreamWriter(stream); + writer.WriteLine("23.4"); + writer.Flush(); + stream.Position = 0; + + var msgArray = SerializerFactory.Create(typeof(MessageWithDouble)).Deserialize(stream, new[] { typeof(MessageWithDouble) }); + + Assert.AreEqual(typeof(MessageWithDouble), msgArray[0].GetType()); + + } + } + + [Test] + public void Should_deserialize_a_batched_messages_with_typename_passed_in_externally() + { + using (var stream = new MemoryStream()) + { + var writer = new StreamWriter(stream); + writer.WriteLine("23.4"); + writer.Flush(); + stream.Position = 0; + + var msgArray = SerializerFactory.Create(typeof(MessageWithDouble),typeof(EmptyMessage)) + .Deserialize(stream, new[] { typeof(MessageWithDouble), typeof(EmptyMessage) }); + + Assert.AreEqual(typeof(MessageWithDouble), msgArray[0].GetType()); + Assert.AreEqual(typeof(EmptyMessage), msgArray[1].GetType()); + + } + } + + [Test] + public void TestMultipleInterfacesDuplicatedPropery() + { + IMessageMapper mapper = new MessageMapper(); + var serializer = SerializerFactory.Create(); + var msgBeforeSerialization = mapper.CreateInstance(x => x.FirstName = "Danny"); + + var count = 0; + using (var stream = new MemoryStream()) + { + serializer.Serialize(new[] { msgBeforeSerialization }, stream); + stream.Position = 0; + + var reader = XmlReader.Create(stream); + + while (reader.Read()) + if ((reader.NodeType == XmlNodeType.Element) && (reader.Name == "FirstName")) + count++; + } + Assert.AreEqual(count, 1); + } + + + [Test] + public void Generic_properties_should_be_supported() + { + + var result = ExecuteSerializer.ForMessage(m => + { + m.GenericProperty = + new GenericProperty("test") { WhatEver = "a property" }; + }); + + Assert.AreEqual("a property", result.GenericProperty.WhatEver); + } + + + [Test] + public void Culture() + { + var serializer = SerializerFactory.Create(); + double val = 65.36; + var msg = new MessageWithDouble { Double = val }; + + Thread.CurrentThread.CurrentCulture = new CultureInfo("de-DE"); + + var stream = new MemoryStream(); + serializer.Serialize(new[] { msg }, stream); + + Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); + + stream.Position = 0; + var msgArray = serializer.Deserialize(stream); + var m = msgArray[0] as MessageWithDouble; + + Assert.AreEqual(val, m.Double); + + stream.Dispose(); + } + + [Test] + public void Comparison() + { + TestInterfaces(); + TestDataContractSerializer(); + } + + [Test] + public void TestInterfaces() + { + IMessageMapper mapper = new MessageMapper(); + var serializer = SerializerFactory.Create(); + + + var o = mapper.CreateInstance(); + + o.Id = Guid.NewGuid(); + o.Age = 10; + o.Address = Guid.NewGuid().ToString(); + o.Int = 7; + o.Name = "udi"; + o.Uri = new Uri("http://www.UdiDahan.com/"); + o.Risk = new Risk { Percent = 0.15D, Annum = true, Accuracy = 0.314M }; + o.Some = SomeEnum.B; + o.Start = DateTime.Now; + o.Duration = TimeSpan.Parse("-01:15:27.123"); + o.Offset = DateTimeOffset.Now; + o.Lookup = new MyDic(); + o.Lookup["1"] = "1"; + o.Foos = new Dictionary>(); + o.Foos["foo1"] = new List(new[] { new Foo { Name = "1", Title = "1" }, new Foo { Name = "2", Title = "2" } }); + o.Data = new byte[] { 1, 2, 3, 4, 5, 4, 3, 2, 1 }; + o.SomeStrings = new List { "a", "b", "c" }; + + o.ArrayFoos = new Foo[] { new Foo { Name = "FooArray1", Title = "Mr." }, new Foo { Name = "FooAray2", Title = "Mrs" } }; + o.Bars = new Bar[] { new Bar { Name = "Bar1", Length = 1 }, new Bar { Name = "BAr2", Length = 5 } }; + o.NaturalNumbers = new HashSet(new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }); + o.Developers = new HashSet(new string[] { "Udi Dahan", "Andreas Ohlund", "Matt Burton", "Jonathan Oliver et al" }); + + o.Parent = mapper.CreateInstance(); + o.Parent.Name = "udi"; + o.Parent.Age = 10; + o.Parent.Address = Guid.NewGuid().ToString(); + o.Parent.Int = 7; + o.Parent.Name = "-1"; + o.Parent.Risk = new Risk { Percent = 0.15D, Annum = true, Accuracy = 0.314M }; + + o.Names = new List(); + for (int i = 0; i < number; i++) + { + var m1 = mapper.CreateInstance(); + o.Names.Add(m1); + m1.Age = 10; + m1.Address = Guid.NewGuid().ToString(); + m1.Int = 7; + m1.Name = i.ToString(); + m1.Risk = new Risk { Percent = 0.15D, Annum = true, Accuracy = 0.314M }; + } + + o.MoreNames = o.Names.ToArray(); + + IMessage[] messages = new IMessage[] { o }; + + Time(messages, serializer); + } + + [Test] + public void TestDataContractSerializer() + { + M2 o = CreateM2(); + IMessage[] messages = new IMessage[] { o }; + + DataContractSerializer dcs = new DataContractSerializer(typeof(ArrayList), new Type[] { typeof(M2), typeof(SomeEnum), typeof(M1), typeof(Risk), typeof(List) }); + + Stopwatch sw = new Stopwatch(); + sw.Start(); + + XmlWriterSettings xws = new XmlWriterSettings(); + xws.OmitXmlDeclaration = false; + + XmlReaderSettings xrs = new XmlReaderSettings(); + xrs.IgnoreProcessingInstructions = true; + xrs.ValidationType = ValidationType.None; + xrs.IgnoreWhitespace = true; + xrs.CheckCharacters = false; + xrs.ConformanceLevel = ConformanceLevel.Auto; + + for (int i = 0; i < numberOfIterations; i++) + using (MemoryStream stream = new MemoryStream()) + DataContractSerialize(xws, dcs, messages, stream); + + sw.Stop(); + Debug.WriteLine("serialization " + sw.Elapsed); + + sw.Reset(); + + File.Delete("a.xml"); + using (FileStream fs = File.Open("a.xml", FileMode.OpenOrCreate)) + DataContractSerialize(xws, dcs, messages, fs); + + MemoryStream s = new MemoryStream(); + DataContractSerialize(xws, dcs, messages, s); + byte[] buffer = s.GetBuffer(); + s.Dispose(); + + sw.Start(); + + for (int i = 0; i < numberOfIterations; i++) + using (XmlReader reader = XmlReader.Create(new MemoryStream(buffer), xrs)) + dcs.ReadObject(reader); + + sw.Stop(); + Debug.WriteLine("deserializing: " + sw.Elapsed); + } + + [Test] + public void SerializeLists() + { + IMessageMapper mapper = new MessageMapper(); + var serializer = SerializerFactory.Create(); + var msg = mapper.CreateInstance(); + + msg.Items = new List { new MessageWithListItem { Data = "Hello" } }; + + using (var stream = new MemoryStream()) + { + serializer.Serialize(new[] { msg }, stream); + stream.Position = 0; + + var msgArray = serializer.Deserialize(stream); + var m = msgArray[0] as MessageWithList; + Assert.AreEqual("Hello", m.Items.First().Data); + } + } + + [Test] + public void SerializeClosedGenericListsInAlternateNamespace() + { + IMessageMapper mapper = new MessageMapper(); + var serializer = SerializerFactory.Create(); + var msg = mapper.CreateInstance(); + + msg.Items = new NServiceBus.Serializers.XML.Test.AlternateNamespace.AlternateItemList { new NServiceBus.Serializers.XML.Test.AlternateNamespace.MessageWithListItemAlternate { Data = "Hello" } }; + + using (var stream = new MemoryStream()) + { + serializer.Serialize(new[] { msg }, stream); + stream.Position = 0; + + var msgArray = serializer.Deserialize(stream); + var m = msgArray[0] as MessageWithClosedListInAlternateNamespace; + Assert.AreEqual("Hello", m.Items.First().Data); + } + } + + [Test] + public void SerializeClosedGenericListsInAlternateNamespaceMultipleIEnumerableImplementations() + { + IMessageMapper mapper = new MessageMapper(); + var serializer = SerializerFactory.Create(); + var msg = mapper.CreateInstance(); + + msg.Items = new NServiceBus.Serializers.XML.Test.AlternateNamespace.AlternateItemListMultipleIEnumerableImplementations { new NServiceBus.Serializers.XML.Test.AlternateNamespace.MessageWithListItemAlternate { Data = "Hello" } }; + + using (var stream = new MemoryStream()) + { + serializer.Serialize(new[] { msg }, stream); + stream.Position = 0; + + var msgArray = serializer.Deserialize(stream); + var m = msgArray[0] as MessageWithClosedListInAlternateNamespaceMultipleIEnumerableImplementations; + Assert.AreEqual("Hello", m.Items.First().Data); + } + } + + [Test] + public void SerializeClosedGenericListsInAlternateNamespaceMultipleIListImplementations() + { + IMessageMapper mapper = new MessageMapper(); + var serializer = SerializerFactory.Create(); + var msg = mapper.CreateInstance(); + + msg.Items = new NServiceBus.Serializers.XML.Test.AlternateNamespace.AlternateItemListMultipleIListImplementations { new NServiceBus.Serializers.XML.Test.AlternateNamespace.MessageWithListItemAlternate { Data = "Hello" } }; + + using (var stream = new MemoryStream()) + { + serializer.Serialize(new[] { msg }, stream); + stream.Position = 0; + + var msgArray = serializer.Deserialize(stream); + var m = msgArray[0] as MessageWithClosedListInAlternateNamespaceMultipleIListImplementations; + Assert.AreEqual("Hello", m.Items.First().Data); + } + } + + [Test] + public void SerializeClosedGenericListsInSameNamespace() + { + IMessageMapper mapper = new MessageMapper(); + var serializer = SerializerFactory.Create(); + var msg = mapper.CreateInstance(); + + msg.Items = new ItemList { new MessageWithListItem { Data = "Hello" } }; + + using (var stream = new MemoryStream()) + { + serializer.Serialize(new[] { msg }, stream); + stream.Position = 0; + + var msgArray = serializer.Deserialize(stream); + var m = msgArray[0] as MessageWithClosedList; + Assert.AreEqual("Hello", m.Items.First().Data); + } + } + + [Test] + public void SerializeEmptyLists() + { + IMessageMapper mapper = new MessageMapper(); + var serializer = SerializerFactory.Create(); + var msg = mapper.CreateInstance(); + + msg.Items = new List(); + + using (var stream = new MemoryStream()) + { + serializer.Serialize(new[] { msg }, stream); + stream.Position = 0; + + var msgArray = serializer.Deserialize(stream); + var m = msgArray[0] as MessageWithList; + Assert.IsEmpty(m.Items); + } + } + + + private void DataContractSerialize(XmlWriterSettings xws, DataContractSerializer dcs, IMessage[] messages, Stream str) + { + ArrayList o = new ArrayList(messages); + using (XmlWriter xwr = XmlWriter.Create(str, xws)) + { + dcs.WriteStartObject(xwr, o); + dcs.WriteObjectContent(xwr, o); + dcs.WriteEndObject(xwr); + } + } + + private M2 CreateM2() + { + M2 o = new M2(); + o.Id = Guid.NewGuid(); + o.Age = 10; + o.Address = Guid.NewGuid().ToString(); + o.Int = 7; + o.Name = "udi"; + o.Risk = new Risk { Percent = 0.15D, Annum = true, Accuracy = 0.314M }; + o.Some = SomeEnum.B; + o.Start = DateTime.Now; + o.Duration = TimeSpan.Parse("-01:15:27.123"); + o.Offset = DateTimeOffset.Now; + + o.Parent = new M1(); + o.Parent.Name = "udi"; + o.Parent.Age = 10; + o.Parent.Address = Guid.NewGuid().ToString(); + o.Parent.Int = 7; + o.Parent.Name = "-1"; + o.Parent.Risk = new Risk { Percent = 0.15D, Annum = true, Accuracy = 0.314M }; + + o.Names = new List(); + for (int i = 0; i < number; i++) + { + var m1 = new M1(); + o.Names.Add(m1); + m1.Age = 10; + m1.Address = Guid.NewGuid().ToString(); + m1.Int = 7; + m1.Name = i.ToString(); + m1.Risk = new Risk { Percent = 0.15D, Annum = true, Accuracy = 0.314M }; + } + + o.MoreNames = o.Names.ToArray(); + + return o; + } + + private void Time(IMessage[] messages, IMessageSerializer serializer) + { + Stopwatch watch = new Stopwatch(); + watch.Start(); + + for (int i = 0; i < numberOfIterations; i++) + using (MemoryStream stream = new MemoryStream()) + serializer.Serialize(messages, stream); + + watch.Stop(); + Debug.WriteLine("Serializing: " + watch.Elapsed); + + watch.Reset(); + + MemoryStream s = new MemoryStream(); + serializer.Serialize(messages, s); + byte[] buffer = s.GetBuffer(); + s.Dispose(); + + watch.Start(); + + object[] result = null; + + for (int i = 0; i < numberOfIterations; i++) + using (var forDeserializing = new MemoryStream(buffer)) + result = serializer.Deserialize(forDeserializing); + + watch.Stop(); + Debug.WriteLine("Deserializing: " + watch.Elapsed); + } + + public void TestSchemaValidation() + { + try + { + XmlReaderSettings settings = new XmlReaderSettings(); + settings.Schemas.Add(null, "schema0.xsd"); + settings.Schemas.Add(null, "schema1.xsd"); + settings.ValidationType = ValidationType.Schema; + XmlDocument document = new XmlDocument(); + document.Load("XMLFile1.xml"); + XmlReader rdr = XmlReader.Create(new StringReader(document.InnerXml), settings); + while (rdr.Read()) { } + } + catch (Exception e) + { + string s = e.Message; + } + } + [Test] + public void NestedObjectWithNullPropertiesShouldBeSerialized() + { + var result = ExecuteSerializer.ForMessage(m => + { + m.NestedObject = new MessageWithNullProperty(); + }); + Assert.IsNotNull(result.NestedObject); + } + + [Test] + public void Messages_with_generic_properties_closing_nullables_should_be_supported() + { + var theTime = DateTime.Now; + + var result = ExecuteSerializer.ForMessage( + m => + { + m.GenericNullable = new GenericPropertyWithNullable { TheType = theTime }; + m.Whatever = "fdsfsdfsd"; + }); + Assert.IsNotNull(result.GenericNullable.TheType == theTime); + } + + [Test] + public void When_Using_A_Dictionary_With_An_object_As_Key_should_throw() + { + Assert.Throws(() => SerializerFactory.Create()); + } + + [Test] + public void When_Using_A_Dictionary_With_An_Object_As_Value_should_throw() + { + Assert.Throws(() => SerializerFactory.Create()); + } + + + + [Test, Ignore("We're not supporting this type")] + public void System_classes_with_non_default_ctors_should_be_supported() + { + var message = new MailMessage("from@gmail.com", "to@hotmail.com") + { + Subject = "Testing the NSB email support", + Body = "Hello", + }; + + var result = ExecuteSerializer.ForMessage( + m => + { + m.MailMessage = message; + }); + Assert.IsNotNull(result.MailMessage); + Assert.AreEqual("from@gmail.com", result.MailMessage.From.Address); + Assert.AreEqual(message.To.First(), result.MailMessage.To.First()); + Assert.AreEqual(message.BodyEncoding.CodePage, result.MailMessage.BodyEncoding.CodePage); + Assert.AreEqual(message.BodyEncoding.EncoderFallback.MaxCharCount, result.MailMessage.BodyEncoding.EncoderFallback.MaxCharCount); + + } + + [Test, Ignore("We're currently not supporting polymorphic properties")] + public void Messages_with_polymorphic_properties_should_be_supported() + { + var message = new PolyMessage + { + BaseType = new ChildOfBase + { + BaseTypeProp = "base", + ChildProp = "Child" + } + }; + + var result = ExecuteSerializer.ForMessage(message); + + Assert.AreEqual(message.BaseType.BaseTypeProp, result.BaseType.BaseTypeProp); + + Assert.AreEqual(((ChildOfBase)message.BaseType).ChildProp, ((ChildOfBase)result.BaseType).ChildProp); + } + + [Test] + public void When_Using_Property_WithXContainerAssignable_should_preserve_xml() + { + const string XmlElement = ""; + const string XmlDocument = "" + XmlElement; + + var messageWithXDocument = new MessageWithXDocument { Document = XDocument.Load(new StringReader(XmlDocument)) }; + var messageWithXElement = new MessageWithXElement { Document = XElement.Load(new StringReader(XmlElement)) }; + + var resultXDocument = ExecuteSerializer.ForMessage(messageWithXDocument); + var resultXElement = ExecuteSerializer.ForMessage(messageWithXElement); + + Assert.AreEqual(messageWithXDocument.Document.ToString(), resultXDocument.Document.ToString()); + Assert.AreEqual(messageWithXElement.Document.ToString(), resultXElement.Document.ToString()); + } + + [Test] + public void Should_be_able_to_deserialize_many_messages_of_same_type() + { + var serializer = SerializerFactory.Create(); + + using (var stream = new MemoryStream()) + { + serializer.Serialize(new[] { new EmptyMessage(), new EmptyMessage(), new EmptyMessage() }, stream); + stream.Position = 0; + + var msgArray = serializer.Deserialize(stream, new[] { typeof(EmptyMessage) }); + + Assert.AreEqual(3, msgArray.Length); + } + } + } + + public class EmptyMessage:IMessage + { + } + + public class PolyMessage : IMessage + { + public BaseType BaseType { get; set; } + } + + public class ChildOfBase : BaseType + { + public BaseType BaseType { get; set; } + + + public string ChildProp { get; set; } + } + + public class BaseType + { + public string BaseTypeProp { get; set; } + } + public class MessageWithGenericPropClosingNullable + { + public GenericPropertyWithNullable GenericNullable { get; set; } + public string Whatever { get; set; } + } + + public class MessageWithNullProperty + { + public string WillBeNull { get; set; } + } + + public class MessageWithDouble + { + public double Double { get; set; } + } + + public class MessageWithGenericProperty + { + public GenericProperty GenericProperty { get; set; } + public GenericProperty GenericPropertyThatIsNull { get; set; } + + } + + public class MessageWithNestedObject + { + public MessageWithNullProperty NestedObject { get; set; } + } + + + public class MessageWithSystemClassAsProperty + { + public MailMessage MailMessage { get; set; } + } + + + public class GenericPropertyWithNullable + { + public T TheType { get; set; } + } + + public class GenericProperty + { + private T value; + + public GenericProperty(T value) + { + this.value = value; + } + + public T ReadOnlyBlob + { + get + { + return value; + } + } + + public string WhatEver { get; set; } + } + + public class MessageWithDictionaryWithAnObjectAsKey + { + public Dictionary Content { get; set; } + } + + public class MessageWithDictionaryWithAnObjectAsValue + { + public Dictionary Content { get; set; } + } + + public class MessageWithListItem + { + public string Data { get; set; } + } + + public class MessageWithInvalidCharacter : IMessage + { + public string Special { get; set; } + } + + public class MessageWithList : IMessage + { + public List Items { get; set; } + } + + [Serializable] + public class MessageWithHashtable : IMessage + { + public Hashtable Hashtable { get; set; } + } + + [Serializable] + public class MessageWithArrayList : IMessage + { + public ArrayList ArrayList { get; set; } + } + + public class MessageWithClosedListInAlternateNamespace : IMessage + { + public NServiceBus.Serializers.XML.Test.AlternateNamespace.AlternateItemList Items { get; set; } + } + + public class MessageWithClosedListInAlternateNamespaceMultipleIEnumerableImplementations : IMessage + { + public NServiceBus.Serializers.XML.Test.AlternateNamespace.AlternateItemListMultipleIEnumerableImplementations Items { get; set; } + } + + public class MessageWithClosedListInAlternateNamespaceMultipleIListImplementations : IMessage + { + public NServiceBus.Serializers.XML.Test.AlternateNamespace.AlternateItemListMultipleIListImplementations Items { get; set; } + } + + public class MessageWithClosedList : IMessage + { + public ItemList Items { get; set; } + } + + [Serializable] + public class MessageWithXDocument : IMessage + { + public XDocument Document { get; set; } + } + + [Serializable] + public class MessageWithXElement : IMessage + { + public XElement Document { get; set; } + } + + public class ItemList : List + { + } +} + +namespace NServiceBus.Serializers.XML.Test.AlternateNamespace +{ + public class AlternateItemList : List + { + } + + public class MessageWithListItemAlternate + { + public string Data { get; set; } + } + + public class AlternateItemListMultipleIEnumerableImplementations : List, IEnumerable + { + public IEnumerator GetEnumerator() + { + return this.ToArray().Select(item => item.Data).GetEnumerator(); + } + } + + public class AlternateItemListMultipleIListImplementations : List, IList + { + private IList stringList = new List(); + + IEnumerator IEnumerable.GetEnumerator() + { + return stringList.GetEnumerator(); + } + + void ICollection.Add(string item) + { + stringList.Add(item); + } + + bool ICollection.Contains(string item) + { + return stringList.Contains(item); + } + + void ICollection.CopyTo(string[] array, int arrayIndex) + { + stringList.CopyTo(array, arrayIndex); + } + + bool ICollection.Remove(string item) + { + return stringList.Remove(item); + } + + bool ICollection.IsReadOnly + { + get { return stringList.IsReadOnly; } + } + + int IList.IndexOf(string item) + { + return stringList.IndexOf(item); + } + + void IList.Insert(int index, string item) + { + stringList.Insert(index, item); + } + + string IList.this[int index] + { + get { return stringList[index]; } + set { stringList[index] = value; } + } + } +} diff --git a/src/impl/Serializers/NServiceBus.Serializers.XML.Test/SerializingArrayTests.cs b/src/NServiceBus.Core.Tests/Serializers/XML/SerializingArrayTests.cs similarity index 98% rename from src/impl/Serializers/NServiceBus.Serializers.XML.Test/SerializingArrayTests.cs rename to src/NServiceBus.Core.Tests/Serializers/XML/SerializingArrayTests.cs index 7cf0c67e08c..9445b5a6ae4 100644 --- a/src/impl/Serializers/NServiceBus.Serializers.XML.Test/SerializingArrayTests.cs +++ b/src/NServiceBus.Core.Tests/Serializers/XML/SerializingArrayTests.cs @@ -1,6 +1,6 @@ -using System; +using System; using System.IO; -using System.Text; +using System.Text; using NUnit.Framework; namespace NServiceBus.Serializers.XML.Test @@ -16,13 +16,13 @@ public MessageWithArray(Guid sagaId, int[] someInts) SagaId = sagaId; SomeInts = someInts; } - } - - [Serializable] - public class MessageWithArrayAndNoDefaultCtor - { - public Guid SagaId { get; set; } - public string[] SomeWords { get; set; } + } + + [Serializable] + public class MessageWithArrayAndNoDefaultCtor + { + public Guid SagaId { get; set; } + public string[] SomeWords { get; set; } } [TestFixture] @@ -43,8 +43,8 @@ public void CanDeserializeXmlWithWhitespace() "; - var data = Encoding.UTF8.GetBytes(str); - + var data = Encoding.UTF8.GetBytes(str); + var serializer = SerializerFactory.Create(); var messages = serializer.Deserialize(new MemoryStream(data)); @@ -60,36 +60,36 @@ public void CanDeserializeXmlWithWhitespace() } [Test] - public void CanSerializeAndBack() - { + public void CanSerializeAndBack() + { var message = new MessageWithArray(Guid.NewGuid(), new int[] { 1234, 5323 }); var result = ExecuteSerializer.ForMessage(message); - Assert.IsNotNull(result.SomeInts); - Assert.That(result.SomeInts, Has.Length.EqualTo(2)); - Assert.AreEqual(1234, result.SomeInts[0]); + Assert.IsNotNull(result.SomeInts); + Assert.That(result.SomeInts, Has.Length.EqualTo(2)); + Assert.AreEqual(1234, result.SomeInts[0]); Assert.AreEqual(5323, result.SomeInts[1]); } [Test] - public void CanSerializeMessagewithNullArray() - { - var message = new MessageWithArrayAndNoDefaultCtor(); - message.SomeWords = null; - - var result = ExecuteSerializer.ForMessage(message); - - Assert.IsNull(message.SomeWords); - } - [Test] - public void CanSerializeMessagewithEmptyArray() - { - var message = new MessageWithArrayAndNoDefaultCtor(); - message.SomeWords = new string[0]; - - var result = ExecuteSerializer.ForMessage(message); - - Assert.AreEqual(result.SomeWords, new string[0]); + public void CanSerializeMessagewithNullArray() + { + var message = new MessageWithArrayAndNoDefaultCtor(); + message.SomeWords = null; + + var result = ExecuteSerializer.ForMessage(message); + + Assert.IsNull(message.SomeWords); + } + [Test] + public void CanSerializeMessagewithEmptyArray() + { + var message = new MessageWithArrayAndNoDefaultCtor(); + message.SomeWords = new string[0]; + + var result = ExecuteSerializer.ForMessage(message); + + Assert.AreEqual(result.SomeWords, new string[0]); } } } \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Serializers/XML/SerializingEnumerableTests.cs b/src/NServiceBus.Core.Tests/Serializers/XML/SerializingEnumerableTests.cs new file mode 100644 index 00000000000..e111cedef70 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Serializers/XML/SerializingEnumerableTests.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using NUnit.Framework; + +namespace NServiceBus.Serializers.XML.Test +{ + [Serializable] + public class MessageWithEnumerableOfString + { + public Guid SagaId { get; set; } + public IEnumerable SomeStrings { get; set; } + } + + [TestFixture] + public class SerializingEnumerableTests + { + [Test] + public void CanSerializeNullElements() + { + var message = new MessageWithEnumerableOfString + { + SomeStrings = new[] + { + "element 1", + null, + null, + "element 2" + } + }; + + var result = ExecuteSerializer.ForMessage(message); + Assert.IsNotNull(result.SomeStrings); + Assert.AreEqual(4, result.SomeStrings.Count()); + } + } +} diff --git a/src/impl/Serializers/NServiceBus.Serializers.XML.Test/SomeEnum.cs b/src/NServiceBus.Core.Tests/Serializers/XML/SomeEnum.cs similarity index 100% rename from src/impl/Serializers/NServiceBus.Serializers.XML.Test/SomeEnum.cs rename to src/NServiceBus.Core.Tests/Serializers/XML/SomeEnum.cs diff --git a/src/NServiceBus.Core.Tests/Timeout/FakeMessageSender.cs b/src/NServiceBus.Core.Tests/Timeout/FakeMessageSender.cs new file mode 100644 index 00000000000..8cbcbfc3a87 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Timeout/FakeMessageSender.cs @@ -0,0 +1,21 @@ +namespace NServiceBus.Core.Tests.Timeout +{ + using NServiceBus.Unicast.Queuing; + using Transports; + + public class FakeMessageSender : ISendMessages + { + private volatile int messagesSent; + + public int MessagesSent + { + get { return messagesSent; } + set { messagesSent = value; } + } + + public void Send(TransportMessage message, Address address) + { + MessagesSent++; + } + } +} \ No newline at end of file diff --git a/tests/timeout/NServiceBus.Timeout.Tests/When_fetching_timeouts_from_storage.cs b/src/NServiceBus.Core.Tests/Timeout/When_fetching_timeouts_from_storage.cs similarity index 91% rename from tests/timeout/NServiceBus.Timeout.Tests/When_fetching_timeouts_from_storage.cs rename to src/NServiceBus.Core.Tests/Timeout/When_fetching_timeouts_from_storage.cs index 0591937e63a..d11e51266e0 100644 --- a/tests/timeout/NServiceBus.Timeout.Tests/When_fetching_timeouts_from_storage.cs +++ b/src/NServiceBus.Core.Tests/Timeout/When_fetching_timeouts_from_storage.cs @@ -1,154 +1,158 @@ -namespace NServiceBus.Timeout.Tests -{ - using System; - using System.Collections.Generic; - using Core; - using Hosting.Windows.Persistence; - using NUnit.Framework; - using Raven.Client; - using Raven.Client.Document; - using Raven.Client.Embedded; - - [TestFixture] - public class When_fetching_timeouts_from_storage_with_raven : When_fetching_timeouts_from_storage - { - private IDocumentStore store; - - protected override IPersistTimeouts CreateTimeoutPersister() - { - store = new EmbeddableDocumentStore {RunInMemory = true}; - //store = new DocumentStore { Url = "http://localhost:8080", DefaultDatabase = "TempTest" }; - store.Conventions.DefaultQueryingConsistency = ConsistencyOptions.QueryYourWrites; - store.Conventions.MaxNumberOfRequestsPerSession = 10; - store.Initialize(); - - return new RavenTimeoutPersistence(store); - } - - [TearDown] - public void Cleanup() - { - store.Dispose(); - } - - [Test] - public void Should_only_return_timeouts_for_this_specific_endpoint_and_any_ones_without_a_owner() - { - const int numberOfTimeoutsToAdd = 3; - - for (var i = 0; i < numberOfTimeoutsToAdd; i++) - { - var d = new TimeoutData - { - Time = DateTime.UtcNow.AddHours(-1), - OwningTimeoutManager = Configure.EndpointName - }; - - persister.Add(d); - } - - persister.Add(new TimeoutData - { - Time = DateTime.UtcNow.AddHours(-1), - OwningTimeoutManager = "MyOtherTM" - }); - - persister.Add(new TimeoutData - { - Time = DateTime.UtcNow.AddHours(-1), - OwningTimeoutManager = String.Empty, - }); - - Assert.AreEqual(numberOfTimeoutsToAdd + 1, GetNextChunk().Count); - } - } - - [TestFixture] - public class When_fetching_timeouts_from_storage_with_inmemory : When_fetching_timeouts_from_storage - { - protected override IPersistTimeouts CreateTimeoutPersister() - { - return new InMemoryTimeoutPersistence(); - } - } - - public abstract class When_fetching_timeouts_from_storage - { - protected IPersistTimeouts persister; - - protected abstract IPersistTimeouts CreateTimeoutPersister(); - - [SetUp] - public void Setup() - { - Address.InitializeLocalAddress("MyEndpoint"); - - Configure.GetEndpointNameAction = () => "MyEndpoint"; - - persister = CreateTimeoutPersister(); - } - - [Test] - public void Should_only_return_timeouts_for_time_slice() - { - const int numberOfTimeoutsToAdd = 10; - - for (var i = 0; i < numberOfTimeoutsToAdd; i++) - { - persister.Add(new TimeoutData - { - OwningTimeoutManager = String.Empty, - Time = DateTime.UtcNow.AddHours(-1) - }); - } - - for (var i = 0; i < numberOfTimeoutsToAdd; i++) - { - persister.Add(new TimeoutData - { - OwningTimeoutManager = String.Empty, - Time = DateTime.UtcNow.AddHours(1) - }); - } - - Assert.AreEqual(numberOfTimeoutsToAdd, GetNextChunk().Count); - } - - [Test] - public void Should_set_the_next_run() - { - const int numberOfTimeoutsToAdd = 50; - - for (var i = 0; i < numberOfTimeoutsToAdd; i++) - { - var d = new TimeoutData - { - Time = DateTime.UtcNow.AddHours(-1), - OwningTimeoutManager = Configure.EndpointName - }; - - persister.Add(d); - } - - var expected = DateTime.UtcNow.AddHours(1); - persister.Add(new TimeoutData - { - Time = expected, - OwningTimeoutManager = String.Empty, - }); - - DateTime nextTimeToRunQuery; - persister.GetNextChunk(DateTime.UtcNow.AddYears(-3), out nextTimeToRunQuery); - - var totalMilliseconds = (expected - nextTimeToRunQuery).Duration().TotalMilliseconds; - - Assert.True(totalMilliseconds < 200); - } - - protected List> GetNextChunk() - { - DateTime nextTimeToRunQuery; - return persister.GetNextChunk(DateTime.UtcNow.AddYears(-3), out nextTimeToRunQuery); - } - } +namespace NServiceBus.Core.Tests.Timeout +{ + using System; + using System.Collections.Generic; + using NServiceBus.Persistence.InMemory.TimeoutPersister; + using NServiceBus.Persistence.Raven; + using NServiceBus.Persistence.Raven.TimeoutPersister; + using NServiceBus.Timeout.Core; + using NUnit.Framework; + using Raven.Client; + using Raven.Client.Document; + using Raven.Client.Embedded; + + [TestFixture, Category("Integration")] + public class When_fetching_timeouts_from_storage_with_raven : When_fetching_timeouts_from_storage + { + private IDocumentStore store; + + protected override IPersistTimeouts CreateTimeoutPersister() + { + store = new EmbeddableDocumentStore {RunInMemory = true}; + //store = new DocumentStore { Url = "http://localhost:8080", DefaultDatabase = "TempTest" }; + store.Conventions.DefaultQueryingConsistency = ConsistencyOptions.QueryYourWrites; + store.Conventions.MaxNumberOfRequestsPerSession = 10; + store.Initialize(); + + store.JsonRequestFactory.DisableRequestCompression = true; + + return new RavenTimeoutPersistence(new StoreAccessor(store)); + } + + [TearDown] + public void Cleanup() + { + store.Dispose(); + } + + [Test] + public void Should_only_return_timeouts_for_this_specific_endpoint_and_any_ones_without_a_owner() + { + const int numberOfTimeoutsToAdd = 3; + + for (var i = 0; i < numberOfTimeoutsToAdd; i++) + { + var d = new TimeoutData + { + Time = DateTime.UtcNow.AddHours(-1), + OwningTimeoutManager = Configure.EndpointName + }; + + persister.Add(d); + } + + persister.Add(new TimeoutData + { + Time = DateTime.UtcNow.AddHours(-1), + OwningTimeoutManager = "MyOtherTM" + }); + + persister.Add(new TimeoutData + { + Time = DateTime.UtcNow.AddHours(-1), + OwningTimeoutManager = String.Empty, + }); + + Assert.AreEqual(numberOfTimeoutsToAdd + 1, GetNextChunk().Count); + } + } + + [TestFixture] + public class When_fetching_timeouts_from_storage_with_inmemory : When_fetching_timeouts_from_storage + { + protected override IPersistTimeouts CreateTimeoutPersister() + { + return new InMemoryTimeoutPersistence(); + } + } + + public abstract class When_fetching_timeouts_from_storage + { + protected IPersistTimeouts persister; + + protected abstract IPersistTimeouts CreateTimeoutPersister(); + + [SetUp] + public void Setup() + { + Address.InitializeLocalAddress("MyEndpoint"); + + Configure.GetEndpointNameAction = () => "MyEndpoint"; + + persister = CreateTimeoutPersister(); + } + + [Test] + public void Should_only_return_timeouts_for_time_slice() + { + const int numberOfTimeoutsToAdd = 10; + + for (var i = 0; i < numberOfTimeoutsToAdd; i++) + { + persister.Add(new TimeoutData + { + OwningTimeoutManager = String.Empty, + Time = DateTime.UtcNow.AddHours(-1) + }); + } + + for (var i = 0; i < numberOfTimeoutsToAdd; i++) + { + persister.Add(new TimeoutData + { + OwningTimeoutManager = String.Empty, + Time = DateTime.UtcNow.AddHours(1) + }); + } + + Assert.AreEqual(numberOfTimeoutsToAdd, GetNextChunk().Count); + } + + [Test] + public void Should_set_the_next_run() + { + const int numberOfTimeoutsToAdd = 50; + + for (var i = 0; i < numberOfTimeoutsToAdd; i++) + { + var d = new TimeoutData + { + Time = DateTime.UtcNow.AddHours(-1), + OwningTimeoutManager = Configure.EndpointName + }; + + persister.Add(d); + } + + var expected = DateTime.UtcNow.AddHours(1); + persister.Add(new TimeoutData + { + Time = expected, + OwningTimeoutManager = String.Empty, + }); + + DateTime nextTimeToRunQuery; + persister.GetNextChunk(DateTime.UtcNow.AddYears(-3), out nextTimeToRunQuery); + + var totalMilliseconds = (expected - nextTimeToRunQuery).Duration().TotalMilliseconds; + + Assert.True(totalMilliseconds < 200); + } + + protected List> GetNextChunk() + { + DateTime nextTimeToRunQuery; + return persister.GetNextChunk(DateTime.UtcNow.AddYears(-3), out nextTimeToRunQuery); + } + } } \ No newline at end of file diff --git a/tests/timeout/NServiceBus.Timeout.Tests/When_pooling_timeouts.cs b/src/NServiceBus.Core.Tests/Timeout/When_pooling_timeouts.cs similarity index 91% rename from tests/timeout/NServiceBus.Timeout.Tests/When_pooling_timeouts.cs rename to src/NServiceBus.Core.Tests/Timeout/When_pooling_timeouts.cs index 49fe74ada12..506ccc148fb 100644 --- a/tests/timeout/NServiceBus.Timeout.Tests/When_pooling_timeouts.cs +++ b/src/NServiceBus.Core.Tests/Timeout/When_pooling_timeouts.cs @@ -1,214 +1,217 @@ -namespace NServiceBus.Timeout.Tests -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Threading; - using System.Threading.Tasks; - using Core; - using Hosting.Windows; - using Hosting.Windows.Persistence; - using NUnit.Framework; - using Raven.Client; - using Raven.Client.Document; - using Raven.Client.Embedded; - - [TestFixture] - public class When_pooling_timeouts_with_raven : When_pooling_timeouts - { - private IDocumentStore store; - - protected override IPersistTimeouts CreateTimeoutPersister() - { - store = new EmbeddableDocumentStore { RunInMemory = true }; - //IDocumentStore store = new DocumentStore { Url = "http://localhost:8080", DefaultDatabase = "TempTest" }; - store.Conventions.DefaultQueryingConsistency = ConsistencyOptions.QueryYourWrites; - store.Conventions.MaxNumberOfRequestsPerSession = 10; - store.Initialize(); - - return new RavenTimeoutPersistence(store); - } - - [TearDown] - public void Cleanup() - { - store.Dispose(); - } - } - - [TestFixture] - public class When_pooling_timeouts_with_inmemory : When_pooling_timeouts - { - protected override IPersistTimeouts CreateTimeoutPersister() - { - return new InMemoryTimeoutPersistence(); - } - } - - public abstract class When_pooling_timeouts - { - private IManageTimeouts manager; - private FakeMessageSender messageSender; - readonly Random rand = new Random(); - private int expected; - - protected IPersistTimeouts persister; - protected TimeoutPersisterReceiver receiver; - - protected abstract IPersistTimeouts CreateTimeoutPersister(); - - [SetUp] - public void Setup() - { - Address.InitializeLocalAddress("MyEndpoint"); - - Configure.GetEndpointNameAction = () => "MyEndpoint"; - - persister = CreateTimeoutPersister(); - messageSender = new FakeMessageSender(); - - manager = new DefaultTimeoutManager - { - TimeoutsPersister = persister, - MessageSender = messageSender, - }; - - receiver = new TimeoutPersisterReceiver(manager) - { - TimeoutsPersister = persister, - MessageSender = messageSender, - SecondsToSleepBetweenPolls = 1, - }; - } - - [Test] - public void Should_retrieve_all_timeout_messages_that_expired() - { - expected = 50; - - Enumerable.Range(1, expected).ToList().ForEach(i => persister.Add(CreateData(DateTime.UtcNow.AddSeconds(-5)))); - - StartAndStopReceiver(); - - WaitForMessagesThenAssert(5); - } - - [Test] - public void Should_pickup_future_timeout_messages_and_send_when_expired() - { - expected = 1; - - manager.PushTimeout(CreateData(DateTime.UtcNow.AddSeconds(2))); - - StartAndStopReceiver(5); - - WaitForMessagesThenAssert(5); - } - - [Test] - public void Should_send_more_timeout_messages_after_completed_a_batch() - { - receiver.Start(); - - expected = 10; - Push(expected, DateTime.UtcNow.AddSeconds(1)); - - Thread.Sleep(TimeSpan.FromSeconds(5)); - - WaitForMessagesThenAssert(10); - - messageSender.MessagesSent = 0; - expected = 30; - - Push(expected, DateTime.UtcNow.AddSeconds(3)); - - Thread.Sleep(TimeSpan.FromSeconds(8)); - receiver.Stop(); - - WaitForMessagesThenAssert(10); - } - - [Test] - public void Should_pickup_new_timeout_messages_as_they_arrive_and_send_all() - { - expected = 100; - - receiver.Start(); - - Task.Factory.StartNew(() => - { - Thread.Sleep(TimeSpan.FromSeconds(1)); - Push(50, DateTime.UtcNow.AddSeconds(rand.Next(0, 5))); - }); - - Push(50, DateTime.UtcNow.AddSeconds(1)); - - Thread.Sleep(TimeSpan.FromSeconds(20)); - - receiver.Stop(); - - WaitForMessagesThenAssert(10); - } - - [Test] - public void Should_pickup_new_timeout_messages_even_if_they_due_now_and_send_all() - { - expected = 25; - - receiver.Start(); - - Push(25, DateTime.UtcNow.AddSeconds(1)); - - Thread.Sleep(TimeSpan.FromSeconds(5)); - - WaitForMessagesThenAssert(5); - - messageSender.MessagesSent = 0; - expected = 40; - - Task.Factory.StartNew(() => Push(10, DateTime.UtcNow.AddSeconds(rand.Next(0, 30)))); - - Push(30, DateTime.UtcNow.AddSeconds(3)); - - Thread.Sleep(TimeSpan.FromSeconds(40)); - - receiver.Stop(); - - WaitForMessagesThenAssert(10); - } - - private void Push(int total, DateTime time) - { - Enumerable.Range(1, total).ToList().ForEach(i => manager.PushTimeout(CreateData(time))); - } - - private void StartAndStopReceiver(int secondsToWaitBeforeCallingStop = 1) - { - receiver.Start(); - Thread.Sleep(TimeSpan.FromSeconds(secondsToWaitBeforeCallingStop)); - receiver.Stop(); - } - - private static TimeoutData CreateData(DateTime time) - { - return new TimeoutData - { - OwningTimeoutManager = Configure.EndpointName, - Time = time, - Headers = new Dictionary(), - }; - } - - private void WaitForMessagesThenAssert(int maxSecondsToWait) - { - var maxTime = DateTime.Now.AddSeconds(maxSecondsToWait); - - while (messageSender.MessagesSent < expected && DateTime.Now < maxTime) - { - Thread.Sleep(TimeSpan.FromSeconds(1)); - } - - Assert.AreEqual(expected, messageSender.MessagesSent); - } - } +namespace NServiceBus.Core.Tests.Timeout +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading; + using System.Threading.Tasks; + using NServiceBus.Persistence.InMemory.TimeoutPersister; + using NServiceBus.Persistence.Raven; + using NServiceBus.Persistence.Raven.TimeoutPersister; + using NServiceBus.Timeout.Core; + using NServiceBus.Timeout.Hosting.Windows; + using NUnit.Framework; + using Raven.Client; + using Raven.Client.Document; + using Raven.Client.Embedded; + + [TestFixture, Category("Integration")] + public class When_pooling_timeouts_with_raven : When_pooling_timeouts + { + private IDocumentStore store; + + protected override IPersistTimeouts CreateTimeoutPersister() + { + store = new EmbeddableDocumentStore { RunInMemory = true }; + //IDocumentStore store = new DocumentStore { Url = "http://localhost:8080", DefaultDatabase = "TempTest" }; + store.Conventions.DefaultQueryingConsistency = ConsistencyOptions.QueryYourWrites; + store.Conventions.MaxNumberOfRequestsPerSession = 10; + store.Initialize(); + + return new RavenTimeoutPersistence(new StoreAccessor(store)); + } + + [TearDown] + public void Cleanup() + { + store.Dispose(); + } + } + + [TestFixture, Category("Integration")] + public class When_pooling_timeouts_with_inmemory : When_pooling_timeouts + { + protected override IPersistTimeouts CreateTimeoutPersister() + { + return new InMemoryTimeoutPersistence(); + } + } + + public abstract class When_pooling_timeouts + { + private IManageTimeouts manager; + private FakeMessageSender messageSender; + readonly Random rand = new Random(); + private int expected; + + protected IPersistTimeouts persister; + protected TimeoutPersisterReceiver receiver; + + protected abstract IPersistTimeouts CreateTimeoutPersister(); + + [SetUp] + public void Setup() + { + Address.InitializeLocalAddress("MyEndpoint"); + + Configure.GetEndpointNameAction = () => "MyEndpoint"; + + persister = CreateTimeoutPersister(); + messageSender = new FakeMessageSender(); + + manager = new DefaultTimeoutManager + { + TimeoutsPersister = persister, + MessageSender = messageSender, + }; + + receiver = new TimeoutPersisterReceiver + { + TimeoutManager = manager, + TimeoutsPersister = persister, + MessageSender = messageSender, + SecondsToSleepBetweenPolls = 1, + }; + } + + [Test] + public void Should_retrieve_all_timeout_messages_that_expired() + { + expected = 50; + + Enumerable.Range(1, expected).ToList().ForEach(i => persister.Add(CreateData(DateTime.UtcNow.AddSeconds(-5)))); + + StartAndStopReceiver(); + + WaitForMessagesThenAssert(5); + } + + [Test] + public void Should_pickup_future_timeout_messages_and_send_when_expired() + { + expected = 1; + + manager.PushTimeout(CreateData(DateTime.UtcNow.AddSeconds(2))); + + StartAndStopReceiver(5); + + WaitForMessagesThenAssert(5); + } + + [Test] + public void Should_send_more_timeout_messages_after_completed_a_batch() + { + receiver.Start(); + + expected = 10; + Push(expected, DateTime.UtcNow.AddSeconds(1)); + + Thread.Sleep(TimeSpan.FromSeconds(5)); + + WaitForMessagesThenAssert(10); + + messageSender.MessagesSent = 0; + expected = 30; + + Push(expected, DateTime.UtcNow.AddSeconds(3)); + + Thread.Sleep(TimeSpan.FromSeconds(8)); + receiver.Stop(); + + WaitForMessagesThenAssert(10); + } + + [Test] + public void Should_pickup_new_timeout_messages_as_they_arrive_and_send_all() + { + expected = 100; + + receiver.Start(); + + Task.Factory.StartNew(() => + { + Thread.Sleep(TimeSpan.FromSeconds(1)); + Push(50, DateTime.UtcNow.AddSeconds(rand.Next(0, 5))); + }); + + Push(50, DateTime.UtcNow.AddSeconds(1)); + + Thread.Sleep(TimeSpan.FromSeconds(20)); + + receiver.Stop(); + + WaitForMessagesThenAssert(10); + } + + [Test] + public void Should_pickup_new_timeout_messages_even_if_they_due_now_and_send_all() + { + expected = 25; + + receiver.Start(); + + Push(25, DateTime.UtcNow.AddSeconds(1)); + + Thread.Sleep(TimeSpan.FromSeconds(5)); + + WaitForMessagesThenAssert(5); + + messageSender.MessagesSent = 0; + expected = 40; + + Task.Factory.StartNew(() => Push(10, DateTime.UtcNow.AddSeconds(rand.Next(0, 30)))); + + Push(30, DateTime.UtcNow.AddSeconds(3)); + + Thread.Sleep(TimeSpan.FromSeconds(40)); + + receiver.Stop(); + + WaitForMessagesThenAssert(10); + } + + private void Push(int total, DateTime time) + { + Enumerable.Range(1, total).ToList().ForEach(i => manager.PushTimeout(CreateData(time))); + } + + private void StartAndStopReceiver(int secondsToWaitBeforeCallingStop = 1) + { + receiver.Start(); + Thread.Sleep(TimeSpan.FromSeconds(secondsToWaitBeforeCallingStop)); + receiver.Stop(); + } + + private static TimeoutData CreateData(DateTime time) + { + return new TimeoutData + { + OwningTimeoutManager = Configure.EndpointName, + Time = time, + Headers = new Dictionary(), + }; + } + + private void WaitForMessagesThenAssert(int maxSecondsToWait) + { + var maxTime = DateTime.Now.AddSeconds(maxSecondsToWait); + + while (messageSender.MessagesSent < expected && DateTime.Now < maxTime) + { + Thread.Sleep(TimeSpan.FromSeconds(1)); + } + + Assert.AreEqual(expected, messageSender.MessagesSent); + } + } } \ No newline at end of file diff --git a/tests/timeout/NServiceBus.Timeout.Tests/When_receiving_timeouts.cs b/src/NServiceBus.Core.Tests/Timeout/When_receiving_timeouts.cs similarity index 90% rename from tests/timeout/NServiceBus.Timeout.Tests/When_receiving_timeouts.cs rename to src/NServiceBus.Core.Tests/Timeout/When_receiving_timeouts.cs index 57e5dfd5acf..e03c631aa65 100644 --- a/tests/timeout/NServiceBus.Timeout.Tests/When_receiving_timeouts.cs +++ b/src/NServiceBus.Core.Tests/Timeout/When_receiving_timeouts.cs @@ -1,38 +1,38 @@ -namespace NServiceBus.Timeout.Tests -{ - using System; - using Core; - using NUnit.Framework; - - [TestFixture] - public class When_receiving_timeouts - { - private FakeMessageSender messageSender; - private IManageTimeouts manager; - - [SetUp] - public void Setup() - { - Address.InitializeLocalAddress("MyEndpoint"); - - Configure.GetEndpointNameAction = () => "MyEndpoint"; - - messageSender = new FakeMessageSender(); - manager = new DefaultTimeoutManager - { - MessageSender = messageSender, - }; - } - - [Test] - public void Should_dispath_timeout_if_is_due_now() - { - manager.PushTimeout(new TimeoutData - { - Time = DateTime.UtcNow, - }); - - Assert.AreEqual(1, messageSender.MessagesSent); - } - } +namespace NServiceBus.Core.Tests.Timeout +{ + using System; + using NServiceBus.Timeout.Core; + using NUnit.Framework; + + [TestFixture] + public class When_receiving_timeouts + { + private FakeMessageSender messageSender; + private IManageTimeouts manager; + + [SetUp] + public void Setup() + { + Address.InitializeLocalAddress("MyEndpoint"); + + Configure.GetEndpointNameAction = () => "MyEndpoint"; + + messageSender = new FakeMessageSender(); + manager = new DefaultTimeoutManager + { + MessageSender = messageSender, + }; + } + + [Test] + public void Should_dispath_timeout_if_is_due_now() + { + manager.PushTimeout(new TimeoutData + { + Time = DateTime.UtcNow, + }); + + Assert.AreEqual(1, messageSender.MessagesSent); + } + } } \ No newline at end of file diff --git a/tests/timeout/NServiceBus.Timeout.Tests/When_removing_timeouts_from_the_storage.cs b/src/NServiceBus.Core.Tests/Timeout/When_removing_timeouts_from_the_storage.cs similarity index 87% rename from tests/timeout/NServiceBus.Timeout.Tests/When_removing_timeouts_from_the_storage.cs rename to src/NServiceBus.Core.Tests/Timeout/When_removing_timeouts_from_the_storage.cs index 9dc6b686756..8dd34f7687f 100644 --- a/tests/timeout/NServiceBus.Timeout.Tests/When_removing_timeouts_from_the_storage.cs +++ b/src/NServiceBus.Core.Tests/Timeout/When_removing_timeouts_from_the_storage.cs @@ -1,88 +1,88 @@ -namespace NServiceBus.Timeout.Tests -{ - using System; - using System.Collections.Generic; - using System.Threading; - using System.Transactions; - using Core; - using Hosting.Windows.Persistence; - using NUnit.Framework; - using Raven.Client; - using Raven.Client.Document; - using Raven.Client.Embedded; - - [TestFixture] - public class When_removing_timeouts_from_the_storage_with_raven : When_removing_timeouts_from_the_storage - { - private IDocumentStore store; - - protected override IPersistTimeouts CreateTimeoutPersister() - { - store = new EmbeddableDocumentStore {RunInMemory = true}; - //store = new DocumentStore { Url = "http://localhost:8080", DefaultDatabase = "TempTest" }; - store.Conventions.DefaultQueryingConsistency = ConsistencyOptions.MonotonicRead; - store.Conventions.MaxNumberOfRequestsPerSession = 10; - store.Initialize(); - - return new RavenTimeoutPersistence(store); - } - - [TearDown] - public void Cleanup() - { - store.Dispose(); - } - } - - [TestFixture] - public class When_removing_timeouts_from_the_storage_with_inmemory : When_removing_timeouts_from_the_storage - { - protected override IPersistTimeouts CreateTimeoutPersister() - { - return new InMemoryTimeoutPersistence(); - } - } - - public abstract class When_removing_timeouts_from_the_storage - { - protected IPersistTimeouts persister; - - protected abstract IPersistTimeouts CreateTimeoutPersister(); - - [SetUp] - public void Setup() - { - Address.InitializeLocalAddress("MyEndpoint"); - - Configure.GetEndpointNameAction = () => "MyEndpoint"; - - persister = CreateTimeoutPersister(); - } - - [Test] - public void Should_remove_timeouts_by_id() - { - var t1 = new TimeoutData {Id = "1", Time = DateTime.UtcNow.AddHours(-1)}; - persister.Add(t1); - - var t2 = new TimeoutData {Id = "2", Time = DateTime.UtcNow.AddHours(-1)}; - persister.Add(t2); - - var timeouts = GetNextChunk(); - - foreach (var timeout in timeouts) - { - TimeoutData timeoutData; - persister.TryRemove(timeout.Item1, out timeoutData); - } - - Assert.AreEqual(0, GetNextChunk().Count); - } - - protected List> GetNextChunk() - { - DateTime nextTimeToRunQuery; - return persister.GetNextChunk(DateTime.UtcNow.AddYears(-3), out nextTimeToRunQuery); - } - } -} \ No newline at end of file +namespace NServiceBus.Core.Tests.Timeout +{ + using System; + using System.Collections.Generic; + using NServiceBus.Persistence.InMemory.TimeoutPersister; + using NServiceBus.Persistence.Raven; + using NServiceBus.Persistence.Raven.TimeoutPersister; + using NServiceBus.Timeout.Core; + using NUnit.Framework; + using Raven.Client; + using Raven.Client.Document; + using Raven.Client.Embedded; + + [TestFixture] + public class When_removing_timeouts_from_the_storage_with_raven : When_removing_timeouts_from_the_storage + { + private IDocumentStore store; + + protected override IPersistTimeouts CreateTimeoutPersister() + { + store = new EmbeddableDocumentStore {RunInMemory = true}; + //store = new DocumentStore { Url = "http://localhost:8080", DefaultDatabase = "TempTest" }; + store.Conventions.DefaultQueryingConsistency = ConsistencyOptions.QueryYourWrites; + store.Conventions.MaxNumberOfRequestsPerSession = 10; + store.Initialize(); + + return new RavenTimeoutPersistence(new StoreAccessor(store)); + } + + [TearDown] + public void Cleanup() + { + store.Dispose(); + } + } + + [TestFixture] + public class When_removing_timeouts_from_the_storage_with_inmemory : When_removing_timeouts_from_the_storage + { + protected override IPersistTimeouts CreateTimeoutPersister() + { + return new InMemoryTimeoutPersistence(); + } + } + + public abstract class When_removing_timeouts_from_the_storage + { + protected IPersistTimeouts persister; + + protected abstract IPersistTimeouts CreateTimeoutPersister(); + + [SetUp] + public void Setup() + { + Address.InitializeLocalAddress("MyEndpoint"); + + Configure.GetEndpointNameAction = () => "MyEndpoint"; + + persister = CreateTimeoutPersister(); + } + + [Test] + public void Should_remove_timeouts_by_id() + { + var t1 = new TimeoutData {Id = "1", Time = DateTime.UtcNow.AddHours(-1)}; + persister.Add(t1); + + var t2 = new TimeoutData {Id = "2", Time = DateTime.UtcNow.AddHours(-1)}; + persister.Add(t2); + + var timeouts = GetNextChunk(); + + foreach (var timeout in timeouts) + { + TimeoutData timeoutData; + persister.TryRemove(timeout.Item1, out timeoutData); + } + + Assert.AreEqual(0, GetNextChunk().Count); + } + + protected List> GetNextChunk() + { + DateTime nextTimeToRunQuery; + return persister.GetNextChunk(DateTime.UtcNow.AddYears(-3), out nextTimeToRunQuery); + } + } +} diff --git a/src/NServiceBus.Core.Tests/Transport/When_specifying_a_non_zero_throughput_limit.cs b/src/NServiceBus.Core.Tests/Transport/When_specifying_a_non_zero_throughput_limit.cs new file mode 100644 index 00000000000..ed58235e3f1 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Transport/When_specifying_a_non_zero_throughput_limit.cs @@ -0,0 +1,34 @@ +namespace NServiceBus.Core.Tests.Transport +{ + using System.Threading; + using NUnit.Framework; + + [TestFixture,Explicit("Timing sensitive")] + public class When_specifying_a_non_zero_throughput_limit : for_the_transactional_transport + { + const int ThroughputLimit = 4; + + [Test, Category("Integration")] + public void Should_limit_the_throughput_to_the_set_limit() + { + TransportReceiver.ChangeMaximumMessageThroughputPerSecond(ThroughputLimit); + TransportReceiver.Start(Address.Parse("mytest")); + + ThreadPool.QueueUserWorkItem(Receive10); + + Thread.Sleep(600); + Assert.AreEqual(ThroughputLimit, fakeReceiver.NumMessagesReceived); + + Thread.Sleep(500); + Assert.AreEqual(ThroughputLimit*2, fakeReceiver.NumMessagesReceived); + } + + private void Receive10(object state) + { + for (int i = 0; i < ThroughputLimit*2; i++) + { + fakeReceiver.FakeMessageReceived(); + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Transport/When_specifying_a_zero_throughput_limit.cs b/src/NServiceBus.Core.Tests/Transport/When_specifying_a_zero_throughput_limit.cs new file mode 100644 index 00000000000..6eca5e41d7f --- /dev/null +++ b/src/NServiceBus.Core.Tests/Transport/When_specifying_a_zero_throughput_limit.cs @@ -0,0 +1,24 @@ +namespace NServiceBus.Core.Tests.Transport +{ + using NUnit.Framework; + + [TestFixture] + public class When_specifying_a_zero_throughput_limit : for_the_transactional_transport + { + [Test] + public void Should_not_limit_the_throughput() + { + const int throughputLimit = 0; + + TransportReceiver.ChangeMaximumMessageThroughputPerSecond(throughputLimit); + TransportReceiver.Start(Address.Parse("mytest")); + + for (int i = 0; i < 100; i++) + { + fakeReceiver.FakeMessageReceived(); + + } + Assert.AreEqual(100, fakeReceiver.NumMessagesReceived); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Transport/for_the_transactional_transport.cs b/src/NServiceBus.Core.Tests/Transport/for_the_transactional_transport.cs new file mode 100644 index 00000000000..50fd830ea82 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Transport/for_the_transactional_transport.cs @@ -0,0 +1,28 @@ +namespace NServiceBus.Core.Tests.Transport +{ + using System; + using System.Transactions; + using Fakes; + using NUnit.Framework; + using Unicast.Transport; + + public class for_the_transactional_transport + { + [SetUp] + public void SetUp() + { + fakeReceiver = new FakeReceiver(); + + TransportReceiver = new TransportReceiver + { + FailureManager = new FakeFailureManager(), + Receiver = fakeReceiver, + TransactionSettings = TransactionSettings.Default + }; + + } + + protected FakeReceiver fakeReceiver; + protected TransportReceiver TransportReceiver; + } +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast.Tests/ConfigurationSettings.cs b/src/NServiceBus.Core.Tests/Unicast/ConfigurationSettings.cs similarity index 96% rename from src/unicast/NServiceBus.Unicast.Tests/ConfigurationSettings.cs rename to src/NServiceBus.Core.Tests/Unicast/ConfigurationSettings.cs index 442ab3a0e43..e0578c92b26 100644 --- a/src/unicast/NServiceBus.Unicast.Tests/ConfigurationSettings.cs +++ b/src/NServiceBus.Core.Tests/Unicast/ConfigurationSettings.cs @@ -1,35 +1,35 @@ -namespace NServiceBus.Unicast.Tests -{ - using System; - using System.Configuration; - using NServiceBus.Config; - using NUnit.Framework; - - [TestFixture] - public class When_no_time_to_be_received_on_forwarded_messages_is_specified:ConfigContext - { - [Test] - public void Should_return_zero_if_not_found() - { - Assert.AreEqual(TimeSpan.Zero, GetSection("UnicastBus_with_empty_ttr").TimeToBeReceivedOnForwardedMessages); - } - } - - [TestFixture] - public class When_time_to_be_received_on_forwarded_messages_is_specified : ConfigContext - { - [Test] - public void Should_return_the_configured_value() - { - Assert.AreEqual(TimeSpan.FromMinutes(30), GetSection("UnicastBus_with_ttr_set").TimeToBeReceivedOnForwardedMessages); - } - } - - public class ConfigContext - { - protected UnicastBusConfig GetSection(string name) - { - return ConfigurationManager.GetSection(name) as UnicastBusConfig; - } - } -} +namespace NServiceBus.Unicast.Tests +{ + using System; + using System.Configuration; + using NServiceBus.Config; + using NUnit.Framework; + + [TestFixture] + public class When_no_time_to_be_received_on_forwarded_messages_is_specified:ConfigContext + { + [Test] + public void Should_return_zero_if_not_found() + { + Assert.AreEqual(TimeSpan.Zero, GetSection("UnicastBus_with_empty_ttr").TimeToBeReceivedOnForwardedMessages); + } + } + + [TestFixture] + public class When_time_to_be_received_on_forwarded_messages_is_specified : ConfigContext + { + [Test] + public void Should_return_the_configured_value() + { + Assert.AreEqual(TimeSpan.FromMinutes(30), GetSection("UnicastBus_with_ttr_set").TimeToBeReceivedOnForwardedMessages); + } + } + + public class ConfigContext + { + protected UnicastBusConfig GetSection(string name) + { + return ConfigurationManager.GetSection(name) as UnicastBusConfig; + } + } +} diff --git a/src/NServiceBus.Core.Tests/Unicast/ConfiguringMessageEndpointMapping.cs b/src/NServiceBus.Core.Tests/Unicast/ConfiguringMessageEndpointMapping.cs new file mode 100644 index 00000000000..2f4e1419907 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Unicast/ConfiguringMessageEndpointMapping.cs @@ -0,0 +1,187 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using NServiceBus.Config; +using NServiceBus.Unicast.Tests.Messages; +using NServiceBus.Unicast.Tests.Messages.ANamespace; +using NServiceBus.Unicast.Tests.Messages.ANamespace.ASubNamespace; +using NUnit.Framework; + +namespace NServiceBus.Unicast.Tests.Messages +{ + public class MessageE : IMessage + { + } + + public class MessageF : IMessage + { + } +} + +namespace NServiceBus.Unicast.Tests +{ + using System.Reflection; + using NServiceBus.Config.ConfigurationSource; + using Routing; + using Subscriptions; + + public class Configuring_message_endpoint_mapping + { + public IDictionary Configure(Action setupMapping) + { + var mappings = new Dictionary(); + + var mapping = new MessageEndpointMapping() { Endpoint = "SomeEndpoint" }; + + setupMapping(mapping); + + mapping.Configure((t, a) => mappings[t] = a); + + return mappings; + } + + protected void ConfigureShouldMapTypes(Action messageAction, params Type[] expected) + { + var mappings = Configure(messageAction).Keys.ToArray(); + + Assert.That(expected, Is.SubsetOf(mappings)); + } + } + + [TestFixture] + public class The_more_specific_mappings + { + [Test] + public void Should_take_precedence() + { + Configure.With(Assembly.GetExecutingAssembly()) + .DefineEndpointName("Foo") + .DefaultBuilder(); + + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + + Configure.Instance.UnicastBus(); + + var messageOwners = Configure.Instance.Builder.Build(); + + Assert.AreEqual("Type", messageOwners.GetDestinationFor(typeof(MessageA)).Queue); + Assert.AreEqual("Namespace", messageOwners.GetDestinationFor(typeof(MessageB)).Queue); + Assert.AreEqual("Assembly", messageOwners.GetDestinationFor(typeof(MessageD)).Queue); + Assert.AreEqual("MessagesWithType", messageOwners.GetDestinationFor(typeof(MessageE)).Queue); + Assert.AreEqual("Namespace", messageOwners.GetDestinationFor(typeof(MessageF)).Queue); + } + + public class CustomUnicastBusConfig : IProvideConfiguration + { + public UnicastBusConfig GetConfiguration() + { + var mappingByType = new MessageEndpointMapping { Endpoint = "Type", TypeFullName = "NServiceBus.Unicast.Tests.Messages.MessageA", AssemblyName = "NServiceBus.Core.Tests" }; + var mappingByNamespace = new MessageEndpointMapping { Endpoint = "Namespace", Namespace = "NServiceBus.Unicast.Tests.Messages", AssemblyName = "NServiceBus.Core.Tests" }; + var mappingByAssembly = new MessageEndpointMapping { Endpoint = "Assembly", AssemblyName = "NServiceBus.Core.Tests" }; + var mappingByMessagesWithType = new MessageEndpointMapping { Endpoint = "MessagesWithType", Messages = "NServiceBus.Unicast.Tests.Messages.MessageE, NServiceBus.Core.Tests" }; + var mappings = new MessageEndpointMappingCollection { mappingByNamespace, mappingByType, mappingByAssembly, mappingByMessagesWithType }; + + return new UnicastBusConfig + { + MessageEndpointMappings = mappings + }; + } + } + } + + [TestFixture] + public class When_configuring_an_endpoint_mapping_using_an_assembly_name_in_the_messages_property : Configuring_message_endpoint_mapping + { + [Test] + public void Should_map_all_the_types_in_the_assembly() + { + ConfigureShouldMapTypes(m => m.Messages = "NServiceBus.Core.Tests", + typeof(MessageA), typeof(MessageB), typeof(MessageC), typeof(MessageD)); + } + } + + [TestFixture] + public class When_configuring_an_endpoint_mapping_using_an_assembly_name_in_the_messages_property_that_does_not_exist : Configuring_message_endpoint_mapping + { + [Test] + [ExpectedException(typeof(ArgumentException))] + public void Should_fail() + { + Configure(m => m.Messages = "NServiceBus.Unicast.Tests.MessagesThatDoesNotExist"); + } + } + + [TestFixture] + public class When_configuring_an_endpoint_mapping_using_a_type_name_in_the_messages_property : Configuring_message_endpoint_mapping + { + [Test] + public void Should_only_map_the_type() + { + ConfigureShouldMapTypes(m => m.Messages = "NServiceBus.Unicast.Tests.Messages.MessageA, NServiceBus.Core.Tests", typeof(MessageA)); + } + } + + [TestFixture] + public class When_configuring_an_endpoint_mapping_using_a_type_name_in_the_messages_property_that_does_not_exist : Configuring_message_endpoint_mapping + { + [Test] + [ExpectedException(typeof(ArgumentException))] + public void Should_fail() + { + Configure(m => m.Messages = "NServiceBus.Unicast.Tests.Messages.MessageThatDoesNotExist, NServiceBus.Core.Tests"); + } + } + + [TestFixture] + public class When_configuring_an_endpoint_mapping_using_only_the_assembly_property : Configuring_message_endpoint_mapping + { + [Test] + public void Should_map_all_the_types_in_the_assembly() + { + ConfigureShouldMapTypes(m => m.AssemblyName = "NServiceBus.Core.Tests", + typeof(MessageA), typeof(MessageB), typeof(MessageC), typeof(MessageD)); + } + } + + [TestFixture] + public class When_configuring_an_endpoint_mapping_using_the_assembly_property_with_an_assembly_that_does_not_exist : Configuring_message_endpoint_mapping + { + [Test] + [ExpectedException(typeof(ArgumentException))] + public void Should_fail() + { + Configure(m => m.AssemblyName = "NServiceBus.Unicast.Tests.MessagesThatDoesNotExist"); + } + } + + [TestFixture] + public class When_configuring_an_endpoint_mapping_using_the_type_property : Configuring_message_endpoint_mapping + { + [Test] + public void Should_only_map_the_type() + { + ConfigureShouldMapTypes(m => { m.AssemblyName = "NServiceBus.Core.Tests"; m.TypeFullName = "NServiceBus.Unicast.Tests.Messages.MessageA"; }, typeof(MessageA)); + } + } + + [TestFixture] + public class When_configuring_an_endpoint_mapping_using_the_type_property_with_a_type_that_does_not_exist : Configuring_message_endpoint_mapping + { + [Test] + [ExpectedException(typeof(ArgumentException))] + public void Should_fail() + { + Configure(m => { m.AssemblyName = "NServiceBus.Core.Tests"; m.TypeFullName = "NServiceBus.Unicast.Tests.Messages.MessageThatDoesNotExist"; }); + } + } + + [TestFixture] + public class When_configuring_an_endpoint_mapping_using_the_namespace_property : Configuring_message_endpoint_mapping + { + [Test] + public void Should_only_map_the_types_directly_in_the_namespace() + { + ConfigureShouldMapTypes(m => { m.AssemblyName = "NServiceBus.Core.Tests"; m.Namespace = "NServiceBus.Unicast.Tests.Messages.ANamespace"; }, typeof(MessageC)); + } + } +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast.Tests/Contexts/CommandMessage.cs b/src/NServiceBus.Core.Tests/Unicast/Contexts/CommandMessage.cs similarity index 96% rename from src/unicast/NServiceBus.Unicast.Tests/Contexts/CommandMessage.cs rename to src/NServiceBus.Core.Tests/Unicast/Contexts/CommandMessage.cs index d21cf25cc01..9d04d91a7ca 100644 --- a/src/unicast/NServiceBus.Unicast.Tests/Contexts/CommandMessage.cs +++ b/src/NServiceBus.Core.Tests/Unicast/Contexts/CommandMessage.cs @@ -1,8 +1,8 @@ namespace NServiceBus.Unicast.Tests.Contexts -{ - using NServiceBus; - +{ + using NServiceBus; + public class CommandMessage : ICommand { - } -} \ No newline at end of file + } +} diff --git a/src/unicast/NServiceBus.Unicast.Tests/Contexts/CommandWithDataBusPropertyMessage.cs b/src/NServiceBus.Core.Tests/Unicast/Contexts/CommandWithDataBusPropertyMessage.cs similarity index 96% rename from src/unicast/NServiceBus.Unicast.Tests/Contexts/CommandWithDataBusPropertyMessage.cs rename to src/NServiceBus.Core.Tests/Unicast/Contexts/CommandWithDataBusPropertyMessage.cs index 2566e302a8d..ddbbf900d21 100644 --- a/src/unicast/NServiceBus.Unicast.Tests/Contexts/CommandWithDataBusPropertyMessage.cs +++ b/src/NServiceBus.Core.Tests/Unicast/Contexts/CommandWithDataBusPropertyMessage.cs @@ -1,7 +1,7 @@ -namespace NServiceBus.Unicast.Tests.Contexts -{ - public class CommandWithDataBusPropertyMessage : ICommand - { - public DataBusProperty MyData { get; set; } - } +namespace NServiceBus.Unicast.Tests.Contexts +{ + public class CommandWithDataBusPropertyMessage : ICommand + { + public DataBusProperty MyData { get; set; } + } } \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast.Tests/Contexts/EventMessage.cs b/src/NServiceBus.Core.Tests/Unicast/Contexts/EventMessage.cs similarity index 97% rename from src/unicast/NServiceBus.Unicast.Tests/Contexts/EventMessage.cs rename to src/NServiceBus.Core.Tests/Unicast/Contexts/EventMessage.cs index 0f36d68039b..baa338aca2c 100644 --- a/src/unicast/NServiceBus.Unicast.Tests/Contexts/EventMessage.cs +++ b/src/NServiceBus.Core.Tests/Unicast/Contexts/EventMessage.cs @@ -1,7 +1,7 @@ namespace NServiceBus.Unicast.Tests.Contexts -{ - using NServiceBus; - +{ + using NServiceBus; + public class EventMessage : IEvent { } diff --git a/src/unicast/NServiceBus.Unicast.Tests/Contexts/InterfaceMessage.cs b/src/NServiceBus.Core.Tests/Unicast/Contexts/InterfaceMessage.cs similarity index 97% rename from src/unicast/NServiceBus.Unicast.Tests/Contexts/InterfaceMessage.cs rename to src/NServiceBus.Core.Tests/Unicast/Contexts/InterfaceMessage.cs index a067683c260..42d2c584fab 100644 --- a/src/unicast/NServiceBus.Unicast.Tests/Contexts/InterfaceMessage.cs +++ b/src/NServiceBus.Core.Tests/Unicast/Contexts/InterfaceMessage.cs @@ -1,7 +1,7 @@ namespace NServiceBus.Unicast.Tests.Contexts -{ - using NServiceBus; - +{ + using NServiceBus; + public interface InterfaceMessage:IMessage { } diff --git a/src/NServiceBus.Core.Tests/Unicast/Contexts/using_the_unicastbus.cs b/src/NServiceBus.Core.Tests/Unicast/Contexts/using_the_unicastbus.cs new file mode 100644 index 00000000000..368025115e3 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Unicast/Contexts/using_the_unicastbus.cs @@ -0,0 +1,274 @@ +namespace NServiceBus.Unicast.Tests.Contexts +{ + using System; + using System.Collections.Generic; + using System.Collections.ObjectModel; + using System.Threading; + using Core.Tests; + using Helpers; + using Impersonation; + using Impersonation.Windows; + using MessageInterfaces.MessageMapper.Reflection; + using MessageMutator; + using Monitoring; + using NUnit.Framework; + using Publishing; + using Rhino.Mocks; + using Routing; + using Serializers.XML; + using Settings; + using Subscriptions.MessageDrivenSubscriptions; + using Subscriptions.MessageDrivenSubscriptions.SubcriberSideFiltering; + using Timeout; + using Transports; + using Unicast.Messages; + using UnitOfWork; + + public class using_a_configured_unicastbus + { + protected IBus bus; + + protected UnicastBus unicastBus; + protected ISendMessages messageSender; + protected FakeSubscriptionStorage subscriptionStorage; + + protected Address gatewayAddress; + MessageHeaderManager headerManager = new MessageHeaderManager(); + MessageMapper MessageMapper = new MessageMapper(); + + protected FakeTransport Transport; + protected XmlMessageSerializer MessageSerializer; + protected FuncBuilder FuncBuilder; + protected Address MasterNodeAddress; + protected EstimatedTimeToSLABreachCalculator SLABreachCalculator = new EstimatedTimeToSLABreachCalculator(); + protected MessageMetadataRegistry MessageMetadataRegistry; + protected MessageDrivenSubscriptionManager subscriptionManager; + SubscriptionPredicatesEvaluator subscriptionPredicatesEvaluator; + protected StaticMessageRouter router; + + protected MessageHandlerRegistry handlerRegistry; + + + [SetUp] + public void SetUp() + { + HandlerInvocationCache.Clear(); + + SettingsHolder.Reset(); + SettingsHolder.SetDefault("Endpoint.SendOnly", false); + + Transport = new FakeTransport(); + FuncBuilder = new FuncBuilder(); + Configure.GetEndpointNameAction = () => "TestEndpoint"; + const string localAddress = "endpointA"; + MasterNodeAddress = new Address(localAddress, "MasterNode"); + subscriptionPredicatesEvaluator = new SubscriptionPredicatesEvaluator(); + router = new StaticMessageRouter(KnownMessageTypes()); + handlerRegistry = new MessageHandlerRegistry(); + MessageMetadataRegistry = new MessageMetadataRegistry + { + DefaultToNonPersistentMessages = false + }; + + try + { + Address.InitializeLocalAddress(localAddress); + } + catch // intentional + { + } + + MessageSerializer = new XmlMessageSerializer(MessageMapper); + ExtensionMethods.GetStaticOutgoingHeadersAction = () => MessageHeaderManager.staticHeaders; + gatewayAddress = MasterNodeAddress.SubScope("gateway"); + + messageSender = MockRepository.GenerateStub(); + subscriptionStorage = new FakeSubscriptionStorage(); + + subscriptionManager = new MessageDrivenSubscriptionManager + { + Builder = FuncBuilder, + MessageSender = messageSender, + SubscriptionStorage = subscriptionStorage + }; + + FuncBuilder.Register(() => headerManager); + FuncBuilder.Register(() => new FilteringMutator + { + SubscriptionPredicatesEvaluator = subscriptionPredicatesEvaluator + }); + FuncBuilder.Register(() => new SentTimeMutator()); + FuncBuilder.Register(() => subscriptionManager); + FuncBuilder.Register(() => new DefaultDispatcherFactory()); + FuncBuilder.Register(() => SLABreachCalculator); + FuncBuilder.Register(() => new WindowsImpersonator()); + + unicastBus = new UnicastBus + { + MasterNodeAddress = MasterNodeAddress, + MessageSerializer = MessageSerializer, + Builder = FuncBuilder, + MessageSender = messageSender, + Transport = Transport, + MessageMapper = MessageMapper, + MessagePublisher = new StorageDrivenPublisher + { + MessageSender = messageSender, + SubscriptionStorage = subscriptionStorage + }, + MessageDeferrer = new TimeoutManagerDeferrer + { + MessageSender = messageSender, + TimeoutManagerAddress = MasterNodeAddress.SubScope("Timeouts") + }, + SubscriptionManager = subscriptionManager, + MessageMetadataRegistry = MessageMetadataRegistry, + SubscriptionPredicatesEvaluator = subscriptionPredicatesEvaluator, + HandlerRegistry = handlerRegistry, + MessageRouter = router + + }; + bus = unicastBus; + + FuncBuilder.Register(() => new CausationMutator { Bus = bus }); + FuncBuilder.Register(() => bus); + + ExtensionMethods.SetHeaderAction = headerManager.SetHeader; + } + + protected virtual IEnumerable KnownMessageTypes() + { + return new Collection(); + } + + protected void VerifyThatMessageWasSentTo(Address destination) + { + messageSender.AssertWasCalled(x => x.Send(Arg.Is.Anything, Arg
    .Is.Equal(destination))); + } + + protected void VerifyThatMessageWasSentWithHeaders(Func, bool> predicate) + { + messageSender.AssertWasCalled(x => x.Send(Arg.Matches(t => predicate(t.Headers)), Arg
    .Is.Anything)); + } + + protected void RegisterUow(IManageUnitsOfWork uow) + { + FuncBuilder.Register(() => uow); + } + + protected void RegisterMessageHandlerType() where T : new() + { + FuncBuilder.Register(() => new T()); + + handlerRegistry.RegisterHandler(typeof(T)); + + if (unicastBus.MessageDispatcherMappings == null) + unicastBus.MessageDispatcherMappings = new Dictionary(); + + unicastBus.MessageDispatcherMappings[typeof(T)] = typeof(DefaultDispatcherFactory); + } + protected void RegisterOwnedMessageType() + { + router.RegisterRoute(typeof(T), Address.Local); + } + protected Address RegisterMessageType() + { + var address = new Address(typeof(T).Name, "localhost"); + RegisterMessageType(address); + + return address; + } + + protected void RegisterMessageType(Address address) + { + MessageMapper.Initialize(new[] { typeof(T) }); + MessageSerializer.Initialize(new[] { typeof(T) }); + router.RegisterRoute(typeof(T), address); + MessageMetadataRegistry.RegisterMessageType(typeof(T)); + + } + + protected void StartBus() + { + ((IStartableBus)bus).Start(); + } + + protected void AssertSubscription(Predicate condition, Address addressOfPublishingEndpoint) + { + try + { + messageSender.AssertWasCalled(x => + x.Send(Arg.Matches(m => condition(m)), Arg
    .Is.Equal(addressOfPublishingEndpoint))); + + } + catch (Exception) + { + //retry to avoid race conditions + Thread.Sleep(2000); + messageSender.AssertWasCalled(x => + x.Send(Arg.Matches(m => condition(m)), Arg
    .Is.Equal(addressOfPublishingEndpoint))); + } + } + + protected void AssertSubscription(Address addressOfPublishingEndpoint) + { + try + { + messageSender.AssertWasCalled(x => + x.Send(Arg.Matches(m => IsSubscriptionFor(m)), Arg
    .Is.Equal(addressOfPublishingEndpoint))); + + } + catch (Exception) + { + //retry to avoid race conditions + Thread.Sleep(1000); + messageSender.AssertWasCalled(x => + x.Send(Arg.Matches(m => IsSubscriptionFor(m)), Arg
    .Is.Equal(addressOfPublishingEndpoint))); + } + } + + bool IsSubscriptionFor(TransportMessage transportMessage) + { + var type = Type.GetType(transportMessage.Headers[Headers.SubscriptionMessageType]); + + return type == typeof(T); + } + } + + public class using_the_unicastbus : using_a_configured_unicastbus + { + [SetUp] + public new void SetUp() + { + StartBus(); + } + + protected Exception ResultingException; + + protected void ReceiveMessage(TransportMessage transportMessage) + { + try + { + Transport.FakeMessageBeeingProcessed(transportMessage); + } + catch (Exception ex) + { + ResultingException = ex; + } + } + + protected void SimulateMessageBeeingAbortedDueToRetryCountExceeded(TransportMessage transportMessage) + { + try + { + Transport.FakeMessageBeeingPassedToTheFaultManager(transportMessage); + } + catch (Exception ex) + { + ResultingException = ex; + } + } + + + } +} diff --git a/src/unicast/NServiceBus.Unicast.Tests/DeferedMessages.cs b/src/NServiceBus.Core.Tests/Unicast/DeferedMessages.cs similarity index 89% rename from src/unicast/NServiceBus.Unicast.Tests/DeferedMessages.cs rename to src/NServiceBus.Core.Tests/Unicast/DeferedMessages.cs index ff40e17970e..6355a06ed95 100644 --- a/src/unicast/NServiceBus.Unicast.Tests/DeferedMessages.cs +++ b/src/NServiceBus.Core.Tests/Unicast/DeferedMessages.cs @@ -1,63 +1,63 @@ namespace NServiceBus.Unicast.Tests { - using System; - using Contexts; + using System; + using Contexts; using NUnit.Framework; - using Rhino.Mocks; - using Transport; + using Rhino.Mocks; + using Timeout; [TestFixture] public class When_defering_a_message_with_no_timeoutmanager_address_specified : using_the_unicastbus { [Test] - public void Should_use_a_convention_to_set_the_address() - { + public void Should_use_a_convention_to_set_the_address() + { var conventionBasedAddressToTimeoutManager = MasterNodeAddress.SubScope("Timeouts"); - RegisterMessageType(); - bus.Defer(TimeSpan.FromDays(1),new DeferedMessage()); - - VerifyThatMessageWasSentTo(conventionBasedAddressToTimeoutManager); + RegisterMessageType(); + bus.Defer(TimeSpan.FromDays(1),new DeferedMessage()); + + VerifyThatMessageWasSentTo(conventionBasedAddressToTimeoutManager); + } + } + + [TestFixture] + public class When_defering_a_message_with_a_set_delay : using_the_unicastbus + { + [Test] + public void Should_set_the_expiry_header_to_a_absolute_utc_time() + { + RegisterMessageType(); + var delay = TimeSpan.FromDays(1); + + bus.Defer(delay, new DeferedMessage()); + + VerifyThatMessageWasSentWithHeaders(h=> + { + var e = DateTimeExtensions.ToUtcDateTime(h[TimeoutManagerHeaders.Expire]); + var now = DateTime.UtcNow + delay; + return e <= now; + }); + } + } + + [TestFixture] + public class When_defering_a_message_with_a_absoulte_time : using_the_unicastbus + { + [Test] + public void Should_set_the_expiry_header_to_a_absolute_utc_time() + { + RegisterMessageType(); + var time = DateTime.Now + TimeSpan.FromDays(1); + + bus.Defer(time, new DeferedMessage()); + + VerifyThatMessageWasSentWithHeaders(h => h[TimeoutManagerHeaders.Expire] == DateTimeExtensions.ToWireFormattedString(time)); } - } - - [TestFixture] - public class When_defering_a_message_with_a_set_delay : using_the_unicastbus - { - [Test] - public void Should_set_the_expiry_header_to_a_absolute_utc_time() - { - RegisterMessageType(); - var delay = TimeSpan.FromDays(1); - - bus.Defer(delay, new DeferedMessage()); - - VerifyThatMessageWasSentWithHeaders(h=> - { - var e = h[Headers.Expire].ToUtcDateTime(); - var now = DateTime.UtcNow + delay; - return e <= now; - }); - } - } - - [TestFixture] - public class When_defering_a_message_with_a_absoulte_time : using_the_unicastbus - { - [Test] - public void Should_set_the_expiry_header_to_a_absolute_utc_time() - { - RegisterMessageType(); - var time = DateTime.Now + TimeSpan.FromDays(1); - - bus.Defer(time, new DeferedMessage()); - - VerifyThatMessageWasSentWithHeaders(h => h[Headers.Expire] == time.ToWireFormattedString()); - } - } - - - public class DeferedMessage:IMessage - { - } + } + + + public class DeferedMessage:IMessage + { + } } \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Unicast/HandlerInvocationCache.cs b/src/NServiceBus.Core.Tests/Unicast/HandlerInvocationCache.cs new file mode 100644 index 00000000000..5b61f1bc236 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Unicast/HandlerInvocationCache.cs @@ -0,0 +1,144 @@ +namespace NServiceBus.Unicast.Tests +{ + using System.Diagnostics; + using NUnit.Framework; + using Saga; + + [TestFixture] + [Explicit("Performance Tests")] + public class HandlerInvocationCachePerformanceTests + { + [Test] + public void RunNew() + { + HandlerInvocationCache.CacheMethodForHandler( typeof(StubMessageHandler), typeof (StubMessage)); + HandlerInvocationCache.CacheMethodForHandler(typeof(StubTimeoutHandler), typeof(StubTimeoutState)); + var handler1 = new StubMessageHandler(); + var handler2 = new StubTimeoutHandler(); + var stubMessage1 = new StubMessage(); + var stubMessage2 = new StubTimeoutState(); + HandlerInvocationCache.InvokeHandle(handler1, stubMessage1); + HandlerInvocationCache.InvokeHandle(handler2, stubMessage2); + + var startNew = Stopwatch.StartNew(); + for (var i = 0; i < 100000; i++) + { + HandlerInvocationCache.InvokeHandle(handler1, stubMessage1); + HandlerInvocationCache.InvokeHandle(handler2, stubMessage2); + } + startNew.Stop(); + Trace.WriteLine(startNew.ElapsedMilliseconds); + } + + public class StubMessageHandler : IHandleMessages + { + + public void Handle(StubMessage message) + { + } + } + + public class StubMessage + { + } + + public class StubTimeoutHandler : IHandleTimeouts + { + public bool TimeoutCalled; + public StubTimeoutState HandledState; + + + public void Timeout(StubTimeoutState state) + { + TimeoutCalled = true; + HandledState = state; + } + } + + public class StubTimeoutState + { + } + } + + [TestFixture] + public class When_invoking_a_cached_message_handler + { + [Test] + public void Should_invoke_handle_method() + { + HandlerInvocationCache.CacheMethodForHandler(typeof (StubHandler), typeof (StubMessage)); + var handler = new StubHandler(); + HandlerInvocationCache.InvokeHandle(handler, new StubMessage()); + Assert.IsTrue(handler.HandleCalled); + } + + [Test] + public void Should_have_passed_through_correct_message() + { + HandlerInvocationCache.CacheMethodForHandler(typeof (StubHandler), typeof (StubMessage)); + var handler = new StubHandler(); + var stubMessage = new StubMessage(); + HandlerInvocationCache.InvokeHandle(handler, stubMessage); + Assert.AreEqual(stubMessage, handler.HandledMessage); + } + + public class StubHandler : IHandleMessages + { + public bool HandleCalled; + public StubMessage HandledMessage; + + public void Handle(StubMessage message) + { + HandleCalled = true; + HandledMessage = message; + } + } + + public class StubMessage + { + } + } + + [TestFixture] + public class When_invoking_a_cached_timout_handler + { + [Test] + public void Should_invoke_timeout_method() + { + HandlerInvocationCache.CacheMethodForHandler(typeof(StubHandler), typeof(StubTimeoutState)); + var handler = new StubHandler(); + HandlerInvocationCache.InvokeTimeout(handler, new StubTimeoutState()); + Assert.IsTrue(handler.TimeoutCalled); + } + + [Test] + public void Should_have_passed_through_correct_state() + { + HandlerInvocationCache.CacheMethodForHandler(typeof(StubHandler), typeof(StubTimeoutState)); + var handler = new StubHandler(); + var stubState = new StubTimeoutState(); + HandlerInvocationCache.InvokeTimeout(handler, stubState); + Assert.AreEqual(stubState, handler.HandledState); + } + + public class StubHandler : IHandleTimeouts + { + public bool TimeoutCalled; + public StubTimeoutState HandledState; + + + public void Timeout(StubTimeoutState state) + { + TimeoutCalled = true; + HandledState = state; + } + } + + public class StubTimeoutState + { + } + + } + +} + diff --git a/src/unicast/NServiceBus.Unicast.Tests/Helpers/FakeSubscriptionStorage.cs b/src/NServiceBus.Core.Tests/Unicast/Helpers/FakeSubscriptionStorage.cs similarity index 81% rename from src/unicast/NServiceBus.Unicast.Tests/Helpers/FakeSubscriptionStorage.cs rename to src/NServiceBus.Core.Tests/Unicast/Helpers/FakeSubscriptionStorage.cs index cdef8d262fe..4ec3d3ffe8a 100644 --- a/src/unicast/NServiceBus.Unicast.Tests/Helpers/FakeSubscriptionStorage.cs +++ b/src/NServiceBus.Core.Tests/Unicast/Helpers/FakeSubscriptionStorage.cs @@ -1,54 +1,55 @@ -namespace NServiceBus.Unicast.Tests.Helpers -{ - using System.Collections.Generic; - using System.Linq; - using NServiceBus.Unicast.Subscriptions; - - public class FakeSubscriptionStorage : ISubscriptionStorage - { - - void ISubscriptionStorage.Subscribe(Address address, IEnumerable messageTypes) - { - messageTypes.ToList().ForEach(messageType => - { - if (!storage.ContainsKey(messageType)) - storage[messageType] = new List
    (); - - if (!storage[messageType].Contains(address)) - storage[messageType].Add(address); - }); - } - - void ISubscriptionStorage.Unsubscribe(Address address, IEnumerable messageTypes) - { - messageTypes.ToList().ForEach(messageType => - { - if (storage.ContainsKey(messageType)) - storage[messageType].Remove(address); - }); - } - - - IEnumerable
    ISubscriptionStorage.GetSubscriberAddressesForMessage(IEnumerable messageTypes) - { - var result = new List
    (); - messageTypes.ToList().ForEach(m => - { - if (storage.ContainsKey(m)) - result.AddRange(storage[m]); - }); - - return result; - } - public void FakeSubscribe(Address address) - { - ((ISubscriptionStorage)this).Subscribe(address, new[] { new MessageType(typeof(T)) }); - } - - public void Init() - { - } - - readonly Dictionary> storage = new Dictionary>(); - } +namespace NServiceBus.Unicast.Tests.Helpers +{ + using System.Collections.Generic; + using System.Linq; + using Subscriptions; + using Subscriptions.MessageDrivenSubscriptions; + + public class FakeSubscriptionStorage : ISubscriptionStorage + { + + public void Subscribe(Address address, IEnumerable messageTypes) + { + messageTypes.ToList().ForEach(messageType => + { + if (!storage.ContainsKey(messageType)) + storage[messageType] = new List
    (); + + if (!storage[messageType].Contains(address)) + storage[messageType].Add(address); + }); + } + + public void Unsubscribe(Address address, IEnumerable messageTypes) + { + messageTypes.ToList().ForEach(messageType => + { + if (storage.ContainsKey(messageType)) + storage[messageType].Remove(address); + }); + } + + + public IEnumerable
    GetSubscriberAddressesForMessage(IEnumerable messageTypes) + { + var result = new List
    (); + messageTypes.ToList().ForEach(m => + { + if (storage.ContainsKey(m)) + result.AddRange(storage[m]); + }); + + return result; + } + public void FakeSubscribe(Address address) + { + ((ISubscriptionStorage)this).Subscribe(address, new[] { new MessageType(typeof(T)) }); + } + + public void Init() + { + } + + readonly Dictionary> storage = new Dictionary>(); + } } \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Unicast/Helpers/FakeTransport.cs b/src/NServiceBus.Core.Tests/Unicast/Helpers/FakeTransport.cs new file mode 100644 index 00000000000..52c0bb6d6bd --- /dev/null +++ b/src/NServiceBus.Core.Tests/Unicast/Helpers/FakeTransport.cs @@ -0,0 +1,87 @@ +namespace NServiceBus.Unicast.Tests.Helpers +{ + using System; + using Transport; + + public class FakeTransport : ITransport + { + public void Dispose() + { + + } + + public void Start(string inputqueue) + { + } + + public void Start(Address localAddress) + { + } + + public int MaximumConcurrencyLevel + { + get { return 1; } + } + + public void ChangeNumberOfWorkerThreads(int targetNumberOfWorkerThreads) + { + } + + public void ChangeMaximumConcurrencyLevel(int maximumConcurrencyLevel) + { + + } + + public void AbortHandlingCurrentMessage() + { + + } + + public void Stop() + { + } + + public int NumberOfWorkerThreads + { + get { return MaximumConcurrencyLevel; } + } + + public void ChangeMaximumMessageThroughputPerSecond(int maximumMessageThroughputPerSecond) + { + throw new NotImplementedException(); + } + + public event EventHandler TransportMessageReceived; + public event EventHandler StartedMessageProcessing; + public event EventHandler FinishedMessageProcessing; + + public event EventHandler FailedMessageProcessing; + + public void FakeMessageBeeingProcessed(TransportMessage transportMessage) + { + StartedMessageProcessing(this, new StartedMessageProcessingEventArgs(transportMessage)); + TransportMessageReceived(this,new TransportMessageReceivedEventArgs(transportMessage)); + FinishedMessageProcessing(this,new EventArgs()); + } + + public void FakeMessageBeeingPassedToTheFaultManager(TransportMessage transportMessage) + { + try + { + StartedMessageProcessing(this, new StartedMessageProcessingEventArgs(transportMessage)); + } + catch(Exception ex) + { + if (FailedMessageProcessing != null) + FailedMessageProcessing(this, new FailedMessageProcessingEventArgs(ex)); + } + FinishedMessageProcessing(this, new EventArgs()); + } + /// + /// todo: use for testing. + /// + public int MaxThroughputPerSecond { get; set; } + + public int MaximumMessageThroughputPerSecond { get; private set; } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Unicast/Helpers/Helpers.cs b/src/NServiceBus.Core.Tests/Unicast/Helpers/Helpers.cs new file mode 100644 index 00000000000..e5adadcee33 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Unicast/Helpers/Helpers.cs @@ -0,0 +1,53 @@ +namespace NServiceBus.Unicast.Tests.Helpers +{ + using System.IO; + using MessageInterfaces.MessageMapper.Reflection; + using Serializers.XML; + + class Helpers + { + public static TransportMessage EmptyTransportMessage() + { + return new TransportMessage + { + }; + } + + public static TransportMessage EmptySubscriptionMessage() + { + var subscriptionMessage = new TransportMessage + { + MessageIntent = MessageIntentEnum.Subscribe, + ReplyToAddress = Address.Parse("mySubscriber") + }; + + subscriptionMessage.Headers[Headers.SubscriptionMessageType] = + "NServiceBus.Unicast.Tests.MyMessage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=9fc386479f8a226c"; + + return subscriptionMessage; + } + + public static TransportMessage MessageThatFailsToSerialize() + { + var m = EmptyTransportMessage(); + m.Body = new byte[1]; + return m; + } + + public static TransportMessage Serialize(T message) + { + var s = new XmlMessageSerializer(new MessageMapper()); + s.Initialize(new[] { typeof(T) }); + + var m = EmptyTransportMessage(); + + using (var stream = new MemoryStream()) + { + s.Serialize(new object[] { message }, stream); + m.Body = stream.ToArray(); + } + + return m; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Unicast/Helpers/MessageHeaderManager.cs b/src/NServiceBus.Core.Tests/Unicast/Helpers/MessageHeaderManager.cs new file mode 100644 index 00000000000..b90beafcdc4 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Unicast/Helpers/MessageHeaderManager.cs @@ -0,0 +1,47 @@ +namespace NServiceBus.Unicast.Tests.Helpers +{ + using System; + using System.Collections.Generic; + using MessageMutator; + + public class MessageHeaderManager : IMutateOutgoingTransportMessages + { + void IMutateOutgoingTransportMessages.MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + foreach (var staticHeader in staticHeaders.Keys) + { + transportMessage.Headers.Add(staticHeader, staticHeaders[staticHeader]); + } + + if (messageHeaders == null) + return; + + if ((messages != null) && (messages.Length > 0) && (messageHeaders.ContainsKey(messages[0]))) + foreach (var key in messageHeaders[messages[0]].Keys) + transportMessage.Headers.Add(key, messageHeaders[messages[0]][key]); + + messageHeaders.Clear(); + } + + + public void SetHeader(object message, string key, string value) + { + if (message == ExtensionMethods.CurrentMessageBeingHandled) + throw new InvalidOperationException("Cannot change headers on the message being processed."); + + if (messageHeaders == null) + messageHeaders = new Dictionary>(); + + if (!messageHeaders.ContainsKey(message)) + messageHeaders.Add(message, new Dictionary()); + + if (!messageHeaders[message].ContainsKey(key)) + messageHeaders[message].Add(key, value); + else + messageHeaders[message][key] = value; + } + + public static IDictionary staticHeaders = new Dictionary(); + static IDictionary> messageHeaders; + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Unicast/Impersonation.cs b/src/NServiceBus.Core.Tests/Unicast/Impersonation.cs new file mode 100644 index 00000000000..0340c45babf --- /dev/null +++ b/src/NServiceBus.Core.Tests/Unicast/Impersonation.cs @@ -0,0 +1,38 @@ +namespace NServiceBus.Unicast.Tests +{ + using System.Security.Principal; + using System.Threading; + using Contexts; + using NUnit.Framework; + + [TestFixture] + public class When_windows_impersonation_is_enabled : using_the_unicastbus + { + [Test] + public void Should_impersonate_the_client() + { + var receivedMessage = Helpers.Helpers.Serialize(new EventMessage()); + + RegisterMessageType(); + + ConfigureImpersonation.RunHandlersUnderIncomingPrincipal(null, true); + + RegisterMessageHandlerType(); + receivedMessage.Headers[Headers.WindowsIdentityName] = "TestUser"; + ReceiveMessage(receivedMessage); + + + Assert.AreEqual("TestUser", MyHandler.Principal.Identity.Name); + } + + class MyHandler:IHandleMessages + { + public static IPrincipal Principal { get; set; } + public void Handle(EventMessage message) + { + + Principal = Thread.CurrentPrincipal; + } + } + } +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast.Tests/MessageModules.cs b/src/NServiceBus.Core.Tests/Unicast/MessageModules.cs similarity index 94% rename from src/unicast/NServiceBus.Unicast.Tests/MessageModules.cs rename to src/NServiceBus.Core.Tests/Unicast/MessageModules.cs index bcc7b1e9c6f..b9dfe5ca74f 100644 --- a/src/unicast/NServiceBus.Unicast.Tests/MessageModules.cs +++ b/src/NServiceBus.Core.Tests/Unicast/MessageModules.cs @@ -1,102 +1,102 @@ -namespace NServiceBus.Unicast.Tests -{ - using System; - using Contexts; - using NUnit.Framework; - - [TestFixture] - public class When_processing_a_message_successfully_with_a_registered_message_module : using_the_unicastbus - { - [Test] - public void Should_invoke_the_begin_and_end_on_the_message_module() - { - - var endCalled = false; - - var messageModule = new StubMessageModule(); - bool beginCalled = false; - - var receivedMessage = Helpers.Helpers.EmptyTransportMessage(); - - messageModule.OnBegin = () => - { - Assert.False(endCalled); - beginCalled = true; - Assert.AreEqual( bus.CurrentMessageContext.Id, receivedMessage.Id); - }; - - messageModule.OnEnd = () => - { - Assert.True(beginCalled); - endCalled = true; - Assert.AreEqual(bus.CurrentMessageContext.Id, receivedMessage.Id); - }; - FuncBuilder.Register(()=>messageModule); - - - ReceiveMessage(receivedMessage); - - Assert.True(beginCalled); - Assert.True(endCalled); - } - } - - [TestFixture] - public class When_a_message_if_forwarded_via_the_fault_manager : using_the_unicastbus - { - [Test] - public void Should_invoke_begin_and_end_message() - { - var endCalled = false; - - var messageModule = new StubMessageModule(); - bool beginCalled = false; - - messageModule.OnBegin = () => - { - Assert.False(endCalled); - beginCalled = true; - }; - - messageModule.OnEnd = () => - { - Assert.True(beginCalled); - endCalled = true; - }; - FuncBuilder.Register(() => messageModule); - - - SimulateMessageBeeingAbortedDueToRetryCountExceeded(Helpers.Helpers.EmptyTransportMessage()); - - Assert.True(beginCalled); - Assert.True(endCalled); - } - - [Test] - public void Should_not_invoke_handle_error() - { - } - - } - - public class StubMessageModule:IMessageModule - { - public Action OnBegin = () => { }; - public Action OnEnd = () => { }; - public Action OnError = () => Assert.Fail("Error occured"); - public void HandleBeginMessage() - { - OnBegin(); - } - - public void HandleEndMessage() - { - OnEnd(); - } - - public void HandleError() - { - OnError(); - } - } +namespace NServiceBus.Unicast.Tests +{ + using System; + using Contexts; + using NUnit.Framework; + + [TestFixture] + public class When_processing_a_message_successfully_with_a_registered_message_module : using_the_unicastbus + { + [Test] + public void Should_invoke_the_begin_and_end_on_the_message_module() + { + + var endCalled = false; + + var messageModule = new StubMessageModule(); + bool beginCalled = false; + + var receivedMessage = Helpers.Helpers.EmptyTransportMessage(); + + messageModule.OnBegin = () => + { + Assert.False(endCalled); + beginCalled = true; + Assert.AreEqual( bus.CurrentMessageContext.Id, receivedMessage.Id); + }; + + messageModule.OnEnd = () => + { + Assert.True(beginCalled); + endCalled = true; + Assert.AreEqual(bus.CurrentMessageContext.Id, receivedMessage.Id); + }; + FuncBuilder.Register(()=>messageModule); + + + ReceiveMessage(receivedMessage); + + Assert.True(beginCalled); + Assert.True(endCalled); + } + } + + [TestFixture] + public class When_a_message_if_forwarded_via_the_fault_manager : using_the_unicastbus + { + [Test] + public void Should_invoke_begin_and_end_message() + { + var endCalled = false; + + var messageModule = new StubMessageModule(); + bool beginCalled = false; + + messageModule.OnBegin = () => + { + Assert.False(endCalled); + beginCalled = true; + }; + + messageModule.OnEnd = () => + { + Assert.True(beginCalled); + endCalled = true; + }; + FuncBuilder.Register(() => messageModule); + + + SimulateMessageBeeingAbortedDueToRetryCountExceeded(Helpers.Helpers.EmptyTransportMessage()); + + Assert.True(beginCalled); + Assert.True(endCalled); + } + + [Test] + public void Should_not_invoke_handle_error() + { + } + + } + + public class StubMessageModule:IMessageModule + { + public Action OnBegin = () => { }; + public Action OnEnd = () => { }; + public Action OnError = () => Assert.Fail("Error occurred"); + public void HandleBeginMessage() + { + OnBegin(); + } + + public void HandleEndMessage() + { + OnEnd(); + } + + public void HandleError() + { + OnError(); + } + } } \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast.Tests.Messages/ANamespace/ASubNamespace/MessageD.cs b/src/NServiceBus.Core.Tests/Unicast/Messages/ANamespace/ASubNamespace/MessageD.cs similarity index 99% rename from src/unicast/NServiceBus.Unicast.Tests.Messages/ANamespace/ASubNamespace/MessageD.cs rename to src/NServiceBus.Core.Tests/Unicast/Messages/ANamespace/ASubNamespace/MessageD.cs index 938928a5b83..75b3c431449 100644 --- a/src/unicast/NServiceBus.Unicast.Tests.Messages/ANamespace/ASubNamespace/MessageD.cs +++ b/src/NServiceBus.Core.Tests/Unicast/Messages/ANamespace/ASubNamespace/MessageD.cs @@ -1,5 +1,5 @@ namespace NServiceBus.Unicast.Tests.Messages.ANamespace.ASubNamespace -{ +{ public class MessageD : IMessage { diff --git a/src/unicast/NServiceBus.Unicast.Tests.Messages/ANamespace/MessageC.cs b/src/NServiceBus.Core.Tests/Unicast/Messages/ANamespace/MessageC.cs similarity index 99% rename from src/unicast/NServiceBus.Unicast.Tests.Messages/ANamespace/MessageC.cs rename to src/NServiceBus.Core.Tests/Unicast/Messages/ANamespace/MessageC.cs index 83bb9580d1b..6f6b90e6644 100644 --- a/src/unicast/NServiceBus.Unicast.Tests.Messages/ANamespace/MessageC.cs +++ b/src/NServiceBus.Core.Tests/Unicast/Messages/ANamespace/MessageC.cs @@ -1,5 +1,5 @@ namespace NServiceBus.Unicast.Tests.Messages.ANamespace -{ +{ public class MessageC : IMessage { diff --git a/src/NServiceBus.Core.Tests/Unicast/Messages/DefaultMessageRegistryTests.cs b/src/NServiceBus.Core.Tests/Unicast/Messages/DefaultMessageRegistryTests.cs new file mode 100644 index 00000000000..3064ef469c4 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Unicast/Messages/DefaultMessageRegistryTests.cs @@ -0,0 +1,31 @@ +namespace NServiceBus.Unicast.Tests +{ + using System; + using NUnit.Framework; + using Unicast.Messages; + + [TestFixture] + public class DefaultMessageRegistryTests + { + [TestFixture] + public class When_getting_message_definition + { + [Test] + public void Should_throw_an_exception_for_a_unmapped_type() + { + var defaultMessageRegistry = new MessageMetadataRegistry(); + var exception = Assert.Throws(() => defaultMessageRegistry.GetMessageDefinition(typeof (int))); + Assert.AreEqual("Could not find Metadata for 'System.Int32'. Messages need to implement either 'IMessage', 'IEvent' or 'ICommand'. Alternatively, if you don't want to implement an interface, you can configure 'Unobtrusive Mode Messages' and use convention to configure how messages are mapped.", exception.Message); + + } + [Test] + public void Should_return_metadata_for_a_mapped_type() + { + var defaultMessageRegistry = new MessageMetadataRegistry(); + defaultMessageRegistry.RegisterMessageType(typeof(int)); + var messageMetadata = defaultMessageRegistry.GetMessageDefinition(typeof (int)); + Assert.AreEqual(typeof(int),messageMetadata.MessageType); + } + } + } +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast.Tests.Messages/MessageA.cs b/src/NServiceBus.Core.Tests/Unicast/Messages/MessageA.cs similarity index 99% rename from src/unicast/NServiceBus.Unicast.Tests.Messages/MessageA.cs rename to src/NServiceBus.Core.Tests/Unicast/Messages/MessageA.cs index 72724e607ec..3115117625d 100644 --- a/src/unicast/NServiceBus.Unicast.Tests.Messages/MessageA.cs +++ b/src/NServiceBus.Core.Tests/Unicast/Messages/MessageA.cs @@ -1,5 +1,5 @@ namespace NServiceBus.Unicast.Tests.Messages -{ +{ public class MessageA : IMessage { } diff --git a/src/unicast/NServiceBus.Unicast.Tests.Messages/MessageB.cs b/src/NServiceBus.Core.Tests/Unicast/Messages/MessageB.cs similarity index 99% rename from src/unicast/NServiceBus.Unicast.Tests.Messages/MessageB.cs rename to src/NServiceBus.Core.Tests/Unicast/Messages/MessageB.cs index 311049e84d9..b2091eb652b 100644 --- a/src/unicast/NServiceBus.Unicast.Tests.Messages/MessageB.cs +++ b/src/NServiceBus.Core.Tests/Unicast/Messages/MessageB.cs @@ -1,5 +1,5 @@ namespace NServiceBus.Unicast.Tests.Messages -{ +{ public class MessageB : IMessage { diff --git a/src/NServiceBus.Core.Tests/Unicast/Publishing.cs b/src/NServiceBus.Core.Tests/Unicast/Publishing.cs new file mode 100644 index 00000000000..1f60e4949c8 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Unicast/Publishing.cs @@ -0,0 +1,59 @@ +namespace NServiceBus.Unicast.Tests +{ + using System; + using Contexts; + using NUnit.Framework; + using Rhino.Mocks; + + [TestFixture] + public class When_publishing_a_command_messages : using_the_unicastbus + { + [Test] + public void Should_get_an_error_messages() + { + RegisterMessageType(); + + Assert.Throws(() => bus.Publish(new CommandMessage())); + } + } + + [TestFixture] + public class When_publishing_a_event_messages : using_the_unicastbus + { + [Test] + public void Should_send_a_message_to_each_subscriber() + { + var subscriber1 = new Address("sub1", "."); + var subscriber2 = new Address("sub2", "."); + + RegisterMessageType(); + subscriptionStorage.FakeSubscribe(subscriber1); + subscriptionStorage.FakeSubscribe(subscriber2); + + bus.Publish(new EventMessage()); + + messageSender.AssertWasCalled(x => x.Send(Arg.Is.Anything, Arg
    .Is.Equal(subscriber1))); + + messageSender.AssertWasCalled(x => x.Send(Arg.Is.Anything, Arg
    .Is.Equal(subscriber2))); + } + + [Test] + public void Should_fire_the_no_subscribers_for_message_if_no_subscribers_exists() + { + + RegisterMessageType(); + + var eventFired = false; + var eventMessage = new EventMessage(); + + unicastBus.NoSubscribersForMessage += (sender, args) => + { + eventFired = true; + Assert.AreSame(eventMessage,args.Message); + }; + bus.Publish(eventMessage); + + Assert.True(eventFired); + } + } +} diff --git a/src/NServiceBus.Core.Tests/Unicast/Receiving.cs b/src/NServiceBus.Core.Tests/Unicast/Receiving.cs new file mode 100644 index 00000000000..10b1a73ba9f --- /dev/null +++ b/src/NServiceBus.Core.Tests/Unicast/Receiving.cs @@ -0,0 +1,477 @@ +namespace NServiceBus.Unicast.Tests +{ + using System; + using System.Collections.Generic; + using System.Linq; + using BackwardCompatibility; + using Contexts; + using NUnit.Framework; + using Rhino.Mocks; + using Subscriptions; + using Timeout; + + [TestFixture] + public class When_receiving_a_regular_message : using_the_unicastbus + { + [Test] + public void Should_invoke_the_registered_message_handlers() + { + var receivedMessage = Helpers.Helpers.Serialize(new EventMessage()); + + RegisterMessageType(); + RegisterMessageHandlerType(); + RegisterMessageHandlerType(); + + ReceiveMessage(receivedMessage); + + + Assert.True(Handler1.Called); + Assert.True(Handler2.Called); + } + } + + [TestFixture] + public class When_receiving_any_message : using_the_unicastbus + { + [Test] + public void Should_invoke_the_registered_catch_all_handler_using_a_object_parameter() + { + var receivedMessage = Helpers.Helpers.Serialize(new EventMessage()); + + RegisterMessageType(); + RegisterMessageHandlerType(); + + ReceiveMessage(receivedMessage); + + Assert.True(CatchAllHandler_object.Called); + } + [Test] + public void Should_invoke_the_registered_catch_all_handler_using_a_dynamic_parameter() + { + var receivedMessage = Helpers.Helpers.Serialize(new EventMessage()); + + RegisterMessageType(); + RegisterMessageHandlerType(); + + ReceiveMessage(receivedMessage); + + Assert.True(CatchAllHandler_dynamic.Called); + } + + + [Test] + public void Should_invoke_the_registered_catch_all_handler_using_a_imessage_parameter() + { + var receivedMessage = Helpers.Helpers.Serialize(new EventMessage()); + + RegisterMessageType(); + RegisterMessageHandlerType(); + + ReceiveMessage(receivedMessage); + + Assert.True(CatchAllHandler_IMessage.Called); + } + } + + [TestFixture] + public class When_sending_messages_from_a_messagehandler : using_the_unicastbus + { + [Test] + public void Should_set_the_related_to_header_with_the_id_of_the_current_message() + { + var receivedMessage = Helpers.Helpers.Serialize(new EventMessage()); + + RegisterMessageType(); + RegisterMessageType(); + RegisterMessageHandlerType(); + + ReceiveMessage(receivedMessage); + + messageSender.AssertWasCalled(x => x.Send(Arg.Matches(m => m.Headers[Headers.RelatedTo] == receivedMessage.CorrelationId), Arg
    .Is.Anything)); + } + } + + [TestFixture] + public class When_replying_with_a_command : using_the_unicastbus + { + [Test] + public void Should_not_be_allowed() + { + var receivedMessage = Helpers.Helpers.Serialize(new EventMessage()); + + RegisterMessageType(); + RegisterMessageType(); + RegisterMessageHandlerType(); + + ReceiveMessage(receivedMessage); + + messageSender.AssertWasNotCalled(x => x.Send(Arg.Is.Anything, Arg
    .Is.Anything)); + } + } + + [TestFixture] + public class When_receiving_a_subscription_request : using_the_unicastbus + { + [Test] + public void Should_register_the_subscriber() + { + var subscriberAddress = Address.Parse("mySubscriber"); + + var subscriptionMessage = new TransportMessage + { + MessageIntent = MessageIntentEnum.Subscribe, + ReplyToAddress = subscriberAddress + }; + + + subscriptionMessage.Headers[Headers.SubscriptionMessageType] = typeof (EventMessage).AssemblyQualifiedName; + + var eventFired = false; + subscriptionManager.ClientSubscribed += (sender, args) => + { + Assert.AreEqual(subscriberAddress, args.SubscriberReturnAddress); + eventFired = true; + }; + + + ReceiveMessage(subscriptionMessage); + + + Assert.AreEqual(subscriberAddress, subscriptionStorage.GetSubscriberAddressesForMessage(new[] { new MessageType(typeof(EventMessage)) }).First()); + Assert.True(eventFired); + } + } + + [TestFixture] + public class When_receiving_a_message_with_the_deserialization_turned_off : using_the_unicastbus + { + [Test] + public void Handlers_should_not_be_invoked() + { + unicastBus.SkipDeserialization = true; + + var receivedMessage = Helpers.Helpers.Serialize(new EventMessage()); + + RegisterMessageType(); + RegisterMessageHandlerType(); + + ReceiveMessage(receivedMessage); + + + Assert.False(Handler1.Called); + } + } + + [TestFixture] + public class When_receiving_an_event_that_is_filtered_out_by_the_subscribe_predicate : using_the_unicastbus + { + [Test] + public void Should_not_invoke_the_handlers() + { + Handler2.Called = false; + var receivedMessage = Helpers.Helpers.Serialize(new EventMessage()); + + RegisterMessageType(); + bus.Subscribe(typeof(EventMessage),m=>false); + + RegisterMessageHandlerType(); + + ReceiveMessage(receivedMessage); + + Assert.False(Handler2.Called); + } + } + + [TestFixture] + public class When_receiving_a_v3_saga_timeout_message : using_the_unicastbus + { + [Test] + public void Should_set_the_newv4_flag() + { + var timeoutMessage = Helpers.Helpers.Serialize(new SomeTimeout()); + var mutator = new SetIsSagaMessageHeaderForV3XMessages + { + Bus = new MyBus{CurrentMessageContext = new MessageContext(timeoutMessage)}, + }; + + var headers = new Dictionary(); + + ExtensionMethods.GetHeaderAction = (o, s) => + { + string v; + headers.TryGetValue(s, out v); + return v; + }; + + ExtensionMethods.SetHeaderAction = (o, s, v) => + { + headers[s] = v; + }; + + Headers.SetMessageHeader(timeoutMessage, Headers.NServiceBusVersion, "3.3.8"); + Headers.SetMessageHeader(timeoutMessage, Headers.SagaId, "ded93a22-1e4b-466a-818f-a1e300cfb9d6"); + Headers.SetMessageHeader(timeoutMessage, TimeoutManagerHeaders.Expire, "2013-06-20 03:41:00:188412 Z"); + + mutator.MutateIncoming(timeoutMessage); + + Assert.True(timeoutMessage.Headers.ContainsKey(Headers.IsSagaTimeoutMessage)); + Assert.AreEqual(Boolean.TrueString, timeoutMessage.Headers[Headers.IsSagaTimeoutMessage]); + } + + class MyBus: IBus + { + public T CreateInstance() + { + throw new NotImplementedException(); + } + + public T CreateInstance(Action action) + { + throw new NotImplementedException(); + } + + public object CreateInstance(Type messageType) + { + throw new NotImplementedException(); + } + + public void Publish(params T[] messages) + { + throw new NotImplementedException(); + } + + public void Publish(Action messageConstructor) + { + throw new NotImplementedException(); + } + + public void Subscribe(Type messageType) + { + throw new NotImplementedException(); + } + + public void Subscribe() + { + throw new NotImplementedException(); + } + + public void Subscribe(Type messageType, Predicate condition) + { + throw new NotImplementedException(); + } + + public void Subscribe(Predicate condition) + { + throw new NotImplementedException(); + } + + public void Unsubscribe(Type messageType) + { + throw new NotImplementedException(); + } + + public void Unsubscribe() + { + throw new NotImplementedException(); + } + + public ICallback SendLocal(params object[] messages) + { + throw new NotImplementedException(); + } + + public ICallback SendLocal(Action messageConstructor) + { + throw new NotImplementedException(); + } + + public ICallback Send(params object[] messages) + { + throw new NotImplementedException(); + } + + public ICallback Send(Action messageConstructor) + { + throw new NotImplementedException(); + } + + public ICallback Send(string destination, params object[] messages) + { + throw new NotImplementedException(); + } + + public ICallback Send(Address address, params object[] messages) + { + throw new NotImplementedException(); + } + + public ICallback Send(string destination, Action messageConstructor) + { + throw new NotImplementedException(); + } + + public ICallback Send(Address address, Action messageConstructor) + { + throw new NotImplementedException(); + } + + public ICallback Send(string destination, string correlationId, params object[] messages) + { + throw new NotImplementedException(); + } + + public ICallback Send(Address address, string correlationId, params object[] messages) + { + throw new NotImplementedException(); + } + + public ICallback Send(string destination, string correlationId, Action messageConstructor) + { + throw new NotImplementedException(); + } + + public ICallback Send(Address address, string correlationId, Action messageConstructor) + { + throw new NotImplementedException(); + } + + public ICallback SendToSites(IEnumerable siteKeys, params object[] messages) + { + throw new NotImplementedException(); + } + + public ICallback Defer(TimeSpan delay, params object[] messages) + { + throw new NotImplementedException(); + } + + public ICallback Defer(DateTime processAt, params object[] messages) + { + throw new NotImplementedException(); + } + + public void Reply(params object[] messages) + { + throw new NotImplementedException(); + } + + public void Reply(Action messageConstructor) + { + throw new NotImplementedException(); + } + + public void Return(T errorEnum) + { + throw new NotImplementedException(); + } + + public void HandleCurrentMessageLater() + { + throw new NotImplementedException(); + } + + public void ForwardCurrentMessageTo(string destination) + { + throw new NotImplementedException(); + } + + public void DoNotContinueDispatchingCurrentMessageToHandlers() + { + throw new NotImplementedException(); + } + + public IDictionary OutgoingHeaders { get; private set; } + public IMessageContext CurrentMessageContext { get; set; } + public IInMemoryOperations InMemory { get; private set; } + } + + class SomeTimeout{} + } + + + class HandlerThatRepliesWithACommand : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(EventMessage message) + { + Bus.Reply(new CommandMessage()); + } + } + + class HandlerThatSendsAMessage : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(EventMessage message) + { + Bus.Send(new CommandMessage()); + } + } + + class CheckMesageIdHandler : IHandleMessages + { + public static bool Called; + + public void Handle(EventMessage message) + { + Called = true; + } + } + + class Handler1:IHandleMessages + { + public static bool Called; + + public void AHelperMethodThatTakesTheMessageAsArgument(EventMessage message) + { + + } + + public void Handle(EventMessage message) + { + Called = true; + } + } + + class Handler2 : IHandleMessages + { + public static bool Called; + + public void Handle(EventMessage message) + { + Called = true; + } + } + + public class CatchAllHandler_object:IHandleMessages + { + public static bool Called; + + public void Handle(object message) + { + Called = true; + } + } + + public class CatchAllHandler_dynamic : IHandleMessages + { + public static bool Called; + + public void Handle(dynamic message) + { + Called = true; + } + } + + + public class CatchAllHandler_IMessage : IHandleMessages + { + public static bool Called; + + public void Handle(IMessage message) + { + Called = true; + } + } +} diff --git a/src/NServiceBus.Core.Tests/Unicast/SendOnlyMode.cs b/src/NServiceBus.Core.Tests/Unicast/SendOnlyMode.cs new file mode 100644 index 00000000000..750cc759f37 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Unicast/SendOnlyMode.cs @@ -0,0 +1,95 @@ +namespace NServiceBus.Unicast.Tests +{ + using System; + using Contexts; + using NServiceBus; + using NUnit.Framework; + using Transport; + + [TestFixture] + public class When_sending_a_message_in_send_only_mode : using_a_configured_unicastbus + { + [Test] + public void Should_be_allowed() + { + Configure.Endpoint.AsSendOnly(); + RegisterMessageType(); + bus.Send(Address.Local, new TestMessage()); + } + } + [TestFixture] + public class When_subscribing_to_a_message_in_send_only_mode : using_a_configured_unicastbus + { + [Test] + public void Should_not_be_allowed() + { + Configure.Endpoint.AsSendOnly(); + RegisterMessageType(); + Assert.Throws(() => bus.Subscribe()); + } + } + + [TestFixture] + public class When_unsubscribing_to_a_message_in_send_only_mode : using_a_configured_unicastbus + { + [Test] + public void Should_not_be_allowed() + { + Configure.Endpoint.AsSendOnly(); + + RegisterMessageType(); + Assert.Throws(() => bus.Unsubscribe()); + } + } + [TestFixture] + public class When_replying_to_a_message_that_was_sent_with_null_reply_to_address : using_the_unicastbus + { + [Test] + public void Should_blow() + { + RegisterMessageType(); + var receivedMessage = Helpers.Helpers.Serialize(new TestMessage()); + RegisterMessageHandlerType(); + ReceiveMessage(receivedMessage); + Assert.IsInstanceOf(ResultingException.InnerException); + } + } + [TestFixture] + public class When_returning_to_a_message_that_was_sent_with_null_reply_to_address : using_the_unicastbus + { + [Test] + public void Should_blow() + { + RegisterMessageType(); + var receivedMessage = Helpers.Helpers.Serialize(new TestMessage()); + RegisterMessageHandlerType(); + ReceiveMessage(receivedMessage); + Assert.IsInstanceOf(ResultingException.InnerException); + } + } + + public class TestMessage : IMessage + { + } + + class HandlerThatRepliesWithACommandToAMessage : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(TestMessage message) + { + Bus.Reply(new TestMessage()); + } + } + + class HandlerThatReturns : IHandleMessages + { + public IBus Bus { get; set; } + + public void Handle(TestMessage message) + { + Bus.Return(1); + } + } + +} \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/Unicast/Sending.cs b/src/NServiceBus.Core.Tests/Unicast/Sending.cs new file mode 100644 index 00000000000..c894ec251f0 --- /dev/null +++ b/src/NServiceBus.Core.Tests/Unicast/Sending.cs @@ -0,0 +1,253 @@ +namespace NServiceBus.Unicast.Tests +{ + using System; + using Contexts; + using NUnit.Framework; + using Rhino.Mocks; + + [TestFixture] + public class When_sending_a_message_with_databusproperty : using_the_unicastbus + { + [Test] + public void Should_throw_if_more_than_one_is_sent_in_the_same_send() + { + RegisterMessageType(); + + Assert.Throws(() => bus.Send(new CommandWithDataBusPropertyMessage(), new CommandWithDataBusPropertyMessage())); + } + + [Test] + public void Should_sent_if_only_one_message_is_in_the_same_send() + { + RegisterMessageType(); + + bus.Send(new CommandWithDataBusPropertyMessage()); + } + } + + [TestFixture] + public class When_sending_a_event_message : using_the_unicastbus + { + [Test] + public void Should_get_an_error_messages() + { + RegisterMessageType(); + Assert.Throws(() => bus.Send(new EventMessage())); + } + } + + [TestFixture] + public class When_sending_a_event_message_to_sites : using_the_unicastbus + { + [Test] + public void Should_get_an_error_messages() + { + RegisterMessageType(); + Assert.Throws(() => bus.SendToSites(new[] { "KeyA" }, new EventMessage())); + } + } + + [TestFixture] + public class When_sending_messages_to_sites : using_the_unicastbus + { + [Test] + public void The_destination_sites_header_should_be_set_to_the_given_sitekeys() + { + RegisterMessageType(); + bus.SendToSites(new[] { "SiteA,SiteB" }, new TestMessage()); + + messageSender.AssertWasCalled(x => x.Send(Arg.Matches(m => m.Headers.ContainsKey(Headers.DestinationSites)), Arg
    .Is.Anything)); + } + + [Test] + public void The_gateway_address_should_be_generated_based_on_the_master_node() + { + RegisterMessageType(); + bus.SendToSites(new[] { "SiteA,SiteB" }, new TestMessage()); + + messageSender.AssertWasCalled(x => x.Send(Arg.Is.Anything, Arg
    .Is.Equal(gatewayAddress))); + } + } + + [TestFixture] + public class When_sending_any_message : using_the_unicastbus + { + [Test] + public void The_content_type_should_be_set() + { + RegisterMessageType(); + bus.Send(new TestMessage()); + + messageSender.AssertWasCalled(x => x.Send(Arg.Matches(m => m.Headers[Headers.ContentType] == "text/xml"), Arg
    .Is.Anything)); + } + + [Test] + public void It_should_be_persistent_by_default() + { + RegisterMessageType(); + bus.Send(new TestMessage()); + + messageSender.AssertWasCalled(x => x.Send(Arg.Matches(m => m.Recoverable), Arg
    .Is.Anything)); + } + + [Test] + public void Should_set_the_reply_to_address() + { + RegisterMessageType(); + bus.Send(new TestMessage()); + + messageSender.AssertWasCalled(x => x.Send(Arg.Matches(m => m.ReplyToAddress == Address.Local), Arg
    .Is.Anything)); + } + + [Test, Ignore("Needs refactoring to make testing possible")] + public void Should_propagate_the_incoming_replyto_address_if_requested() + { + var addressOfIncomingMessage = Address.Parse("Incoming"); + + //todo - add a way to set the context from out tests + + unicastBus.PropagateReturnAddressOnSend = true; + RegisterMessageType(); + bus.Send(new TestMessage()); + + messageSender.AssertWasCalled(x => x.Send(Arg.Matches(m => m.ReplyToAddress == addressOfIncomingMessage), Arg
    .Is.Anything)); + } + } + + [TestFixture] + public class When_sending_multiple_messages_in_one_go : using_the_unicastbus + { + + [Test] + public void Should_be_persistent_if_any_of_the_messages_is_persistent() + { + RegisterMessageType(); + RegisterMessageType(); + bus.Send(new NonPersistentMessage(), new PersistentMessage()); + + messageSender.AssertWasCalled(x => x.Send(Arg.Matches(m => m.Recoverable), Arg
    .Is.Anything)); + } + + + [Test] + public void Should_use_the_lovest_time_to_be_received() + { + RegisterMessageType(); + RegisterMessageType(); + bus.Send(new NonPersistentMessage(), new PersistentMessage()); + + messageSender.AssertWasCalled(x => x.Send(Arg.Matches(m => m.TimeToBeReceived == TimeSpan.FromMinutes(45)), Arg
    .Is.Anything)); + } + + [Test] + public void Should_use_the_address_of_the_first_message() + { + var firstAddress = Address.Parse("first"); + var secondAddress = Address.Parse("second"); + RegisterMessageType(firstAddress); + RegisterMessageType(secondAddress); + bus.Send(new NonPersistentMessage(), new PersistentMessage()); + + messageSender.AssertWasCalled(x => x.Send(Arg.Matches(m => m.Recoverable), Arg
    .Is.Equal(firstAddress))); + } + + + [TimeToBeReceived("00:45:00")] + class PersistentMessage { } + + [Express] + class NonPersistentMessage { } + } + + + + [TestFixture] + public class When_sending_any_message_from_a_volatile_endpoint : using_the_unicastbus + { + [Test] + public void It_should_be_non_persistent_by_default() + { + MessageMetadataRegistry.DefaultToNonPersistentMessages = true; + RegisterMessageType(); + bus.Send(new TestMessage()); + + messageSender.AssertWasCalled(x => x.Send(Arg.Matches(m => !m.Recoverable), Arg
    .Is.Anything)); + } + } + + [TestFixture] + public class When_sending_a_message_that_has_no_configured_address : using_the_unicastbus + { + [Test] + public void Should_throw() + { + Assert.Throws(() => bus.Send(new CommandMessage())); + } + } + + [TestFixture] + public class When_sending_a_command_message : using_the_unicastbus + { + [Test] + public void Should_specify_the_message_to_be_recoverable() + { + RegisterMessageType(); + + bus.Send(new CommandMessage()); + + messageSender.AssertWasCalled(x => x.Send(Arg.Matches(m => m.Recoverable), Arg
    .Is.Anything)); + } + } + + [TestFixture] + public class When_sending_a_interface_message : using_the_unicastbus + { + [Test] + public void Should_specify_the_message_to_be_recoverable() + { + var defaultAddress = RegisterMessageType(); + + bus.Send(m => { }); + + messageSender.AssertWasCalled(x => x.Send(Arg.Matches(m => m.Recoverable), Arg
    .Is.Equal(defaultAddress))); + } + } + + [TestFixture] + public class When_raising_an_in_memory_message : using_the_unicastbus + { + [Test] + public void Should_invoke_registered_message_handlers() + { + RegisterMessageType(); + + RegisterMessageHandlerType(); + RegisterMessageHandlerType(); + + bus.InMemory.Raise(new TestMessage()); + + Assert.True(TestMessageHandler1.Called); + Assert.True(TestMessageHandler2.Called); + } + + public class TestMessageHandler1 : IHandleMessages + { + public static bool Called; + + public void Handle(TestMessage message) + { + Called = true; + } + } + + public class TestMessageHandler2 : IHandleMessages + { + public static bool Called; + + public void Handle(TestMessage message) + { + Called = true; + } + } + } +} diff --git a/src/unicast/NServiceBus.Unicast.Tests/Subscriptions.cs b/src/NServiceBus.Core.Tests/Unicast/Subscriptions.cs similarity index 89% rename from src/unicast/NServiceBus.Unicast.Tests/Subscriptions.cs rename to src/NServiceBus.Core.Tests/Unicast/Subscriptions.cs index 4dd034ec926..a2c540065e0 100644 --- a/src/unicast/NServiceBus.Unicast.Tests/Subscriptions.cs +++ b/src/NServiceBus.Core.Tests/Unicast/Subscriptions.cs @@ -1,62 +1,61 @@ namespace NServiceBus.Unicast.Tests { - using System; - using Contexts; + using System; + using Contexts; using NUnit.Framework; - using Rhino.Mocks; - using Transport; + using Rhino.Mocks; [TestFixture] public class When_subscribing_to_messages : using_the_unicastbus { readonly Address addressToOwnerOfTestMessage = new Address("TestMessageOwner", "localhost"); - /// - /// Set Up + /// + /// Set Up /// [SetUp] public new void SetUp() { - unicastBus.RegisterMessageType(typeof(TestMessage), addressToOwnerOfTestMessage); + router.RegisterRoute(typeof(TestMessage), addressToOwnerOfTestMessage); } [Test] public void Should_send_the_assemblyqualified_name_as_subscription_type() { bus.Subscribe(); - - AssertSubscription(m => m.Headers.ContainsKey(UnicastBus.SubscriptionMessageType) && - m.Headers[UnicastBus.SubscriptionMessageType] == typeof(TestMessage).AssemblyQualifiedName, + + AssertSubscription(m => m.Headers.ContainsKey(Headers.SubscriptionMessageType) && + m.Headers[Headers.SubscriptionMessageType] == typeof(TestMessage).AssemblyQualifiedName, addressToOwnerOfTestMessage); - } - - [Test] - public void Should_set_the_message_intent_to_subscribe() - { - bus.Subscribe(); - - AssertSubscription(m => m.MessageIntent == MessageIntentEnum.Subscribe, - addressToOwnerOfTestMessage); } - } - - [TestFixture] - public class When_subscribing_to_a_message_that_has_no_configured_address : using_the_unicastbus - { - [Test] - public void Should_throw() - { - Assert.Throws(() => bus.Subscribe()); - } - } - - [TestFixture] - public class When_unsubscribing_to_a_message_that_has_no_configured_address : using_the_unicastbus - { - [Test] - public void Should_throw() - { - Assert.Throws(() => bus.Unsubscribe()); - } + + [Test] + public void Should_set_the_message_intent_to_subscribe() + { + bus.Subscribe(); + + AssertSubscription(m => m.MessageIntent == MessageIntentEnum.Subscribe, + addressToOwnerOfTestMessage); + } + } + + [TestFixture] + public class When_subscribing_to_a_message_that_has_no_configured_address : using_the_unicastbus + { + [Test] + public void Should_throw() + { + Assert.Throws(() => bus.Subscribe()); + } + } + + [TestFixture] + public class When_unsubscribing_to_a_message_that_has_no_configured_address : using_the_unicastbus + { + [Test] + public void Should_throw() + { + Assert.Throws(() => bus.Unsubscribe()); + } } [TestFixture] public class When_subscribing_to_command_messages : using_the_unicastbus @@ -78,42 +77,42 @@ public void Should_get_an_error_messages() RegisterMessageType(); Assert.Throws(() => bus.Unsubscribe()); } - } - - [TestFixture] - public class When_creating_message_types - { - [Test] - public void Should_parse_types() - { - var messageType = new Subscriptions.MessageType(typeof(TestMessage)); - - Assert.AreEqual(messageType.TypeName, typeof(TestMessage).FullName); - Assert.AreEqual(messageType.Version, typeof(TestMessage).Assembly.GetName().Version); - } - - [Test] - public void Should_parse_AssemblyQualifiedName() - { - var messageType = new Subscriptions.MessageType(typeof(TestMessage).AssemblyQualifiedName); - - Assert.AreEqual(messageType.TypeName, typeof(TestMessage).FullName); - Assert.AreEqual(messageType.Version, typeof(TestMessage).Assembly.GetName().Version); - } - - [Test] - public void Should_parse_version_strings() - { - var messageType = new Subscriptions.MessageType("TestMessage", "1.2.3.4"); - - Assert.AreEqual(messageType.TypeName, "TestMessage"); - Assert.AreEqual(messageType.Version, new Version(1, 2, 3, 4)); - } - - - class TestMessage - { - - } - } + } + + [TestFixture] + public class When_creating_message_types + { + [Test] + public void Should_parse_types() + { + var messageType = new Subscriptions.MessageType(typeof(TestMessage)); + + Assert.AreEqual(messageType.TypeName, typeof(TestMessage).FullName); + Assert.AreEqual(messageType.Version, typeof(TestMessage).Assembly.GetName().Version); + } + + [Test] + public void Should_parse_AssemblyQualifiedName() + { + var messageType = new Subscriptions.MessageType(typeof(TestMessage).AssemblyQualifiedName); + + Assert.AreEqual(messageType.TypeName, typeof(TestMessage).FullName); + Assert.AreEqual(messageType.Version, typeof(TestMessage).Assembly.GetName().Version); + } + + [Test] + public void Should_parse_version_strings() + { + var messageType = new Subscriptions.MessageType("TestMessage", "1.2.3.4"); + + Assert.AreEqual(messageType.TypeName, "TestMessage"); + Assert.AreEqual(messageType.Version, new Version(1, 2, 3, 4)); + } + + + class TestMessage + { + + } + } } diff --git a/src/NServiceBus.Core.Tests/Unicast/Timing.cs b/src/NServiceBus.Core.Tests/Unicast/Timing.cs new file mode 100644 index 00000000000..bdd29e787ac --- /dev/null +++ b/src/NServiceBus.Core.Tests/Unicast/Timing.cs @@ -0,0 +1,40 @@ +namespace NServiceBus.Unicast.Tests +{ + using Contexts; + using Monitoring; + using NUnit.Framework; + using Rhino.Mocks; + using UnitOfWork; + + [TestFixture] + public class When_processing_a_message_with_timing_turned_on : using_the_unicastbus + { + [Test] + public void Should_set_the_processing_headers() + { + FuncBuilder.Register(() => new ProcessingStatistics{Bus = bus}); + + var receivedMessage = Helpers.Helpers.Serialize(new EventMessage()); + + RegisterMessageType(); + + ReceiveMessage(receivedMessage); + + Assert.True(bus.CurrentMessageContext.Headers.ContainsKey("NServiceBus.ProcessingStarted")); + Assert.True(bus.CurrentMessageContext.Headers.ContainsKey("NServiceBus.ProcessingEnded")); + } + } + + [TestFixture] + public class When_sending_a_message_with_timing_turned_on : using_the_unicastbus + { + [Test] + public void Should_set_the_time_sent_header() + { + RegisterMessageType(); + + bus.Send(new CommandMessage()); + messageSender.AssertWasCalled(x => x.Send(Arg.Matches(m => m.Headers.ContainsKey("NServiceBus.TimeSent")), Arg
    .Is.Anything)); + } + } +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast.Tests/UnitOfWork.cs b/src/NServiceBus.Core.Tests/Unicast/UnitOfWork.cs similarity index 95% rename from src/unicast/NServiceBus.Unicast.Tests/UnitOfWork.cs rename to src/NServiceBus.Core.Tests/Unicast/UnitOfWork.cs index 1d1bb236c14..75c27deaaae 100644 --- a/src/unicast/NServiceBus.Unicast.Tests/UnitOfWork.cs +++ b/src/NServiceBus.Core.Tests/Unicast/UnitOfWork.cs @@ -1,327 +1,326 @@ -namespace NServiceBus.Unicast.Tests -{ - using System; - using Contexts; - using NUnit.Framework; - using UnitOfWork; - - [TestFixture] - public class When_processing_a_subscribe_message_successfully : using_the_unicastbus - { - [Test] - public void Should_invoke_the_uow_begin_and_end() - { - var beginCalled = false; - var endCalled = false; - - var uow = new TestUnitOfWork - { - OnBegin = () => - { - beginCalled = true; - Assert.False(endCalled); - }, - OnEnd = (ex) => { Assert.Null(ex); endCalled = true; } - }; - - RegisterUow(uow); - ReceiveMessage(Helpers.Helpers.EmptySubscribeTransportMessage()); - - Assert.True(beginCalled); - Assert.True(endCalled); - } - } - - [TestFixture] - public class When_begin_and_end_executes : using_the_unicastbus - { - [Test] - public void Should_invoke_ends_in_reverse_order() - { - var currentEnd = 0; - int firstUoWEndOrder = 0, secondUoWEndOrder = 0, thirdUoWEndOrder = 0; - var firstUoW = new TestUnitOfWork - { - ExpectedEndOrder = 3, - OnEnd = ex => { firstUoWEndOrder = ++currentEnd; } - }; - var secondUoW = new TestUnitOfWork - { - ExpectedEndOrder = 2, - OnEnd = ex => { secondUoWEndOrder = ++currentEnd; } - }; - var thirdUoW = new TestUnitOfWork - { - ExpectedEndOrder = 1, - OnEnd = ex => { thirdUoWEndOrder = ++currentEnd; } - }; - RegisterUow(firstUoW); - RegisterUow(secondUoW); - RegisterUow(thirdUoW); - ReceiveMessage(Helpers.Helpers.EmptyTransportMessage()); - - Assert.AreEqual(firstUoW.ExpectedEndOrder, firstUoWEndOrder); - Assert.AreEqual(secondUoW.ExpectedEndOrder, secondUoWEndOrder); - Assert.AreEqual(thirdUoW.ExpectedEndOrder, thirdUoWEndOrder); - } - - [Test] - public void Should_invoke_ends_in_reverse_order_even_if_an_end_throws() - { - var currentEnd = 0; - int firstUoWEndOrder = 0, secondUoWEndOrder = 0, thirdUoWEndOrder = 0; - var firstUoW = new TestUnitOfWork - { - ExpectedEndOrder = 3, - OnEnd = ex => { firstUoWEndOrder = ++currentEnd; } - }; - var secondUoW = new TestUnitOfWork - { - ExpectedEndOrder = 2, - OnEnd = ex => - { - secondUoWEndOrder = ++currentEnd; - throw new Exception(); - } - }; - var thirdUoW = new TestUnitOfWork - { - ExpectedEndOrder = 1, - OnEnd = ex => { thirdUoWEndOrder = ++currentEnd; } - }; - RegisterUow(firstUoW); - RegisterUow(secondUoW); - RegisterUow(thirdUoW); - ReceiveMessage(Helpers.Helpers.EmptyTransportMessage()); - Console.Out.WriteLine(FuncBuilder); - Assert.AreEqual(firstUoW.ExpectedEndOrder, firstUoWEndOrder); - Assert.AreEqual(secondUoW.ExpectedEndOrder, secondUoWEndOrder); - Assert.AreEqual(thirdUoW.ExpectedEndOrder, thirdUoWEndOrder); - } - - [Test] - public void Should_invoke_ends_in_reverse_order_even_if_a_begin_throws() - { - var currentEnd = 0; - int firstUoWEndOrder = 0, secondUoWEndOrder = 0, thirdUoWEndOrder = -1; - var firstUoW = new TestUnitOfWork - { - ExpectedEndOrder = 2, - OnEnd = ex => { firstUoWEndOrder = ++currentEnd; } - }; - var secondUoW = new TestUnitOfWork - { - ExpectedEndOrder = 1, - OnBegin = () => - { - throw new Exception(); - }, - OnEnd = ex => - { - secondUoWEndOrder = ++currentEnd; - } - }; - var thirdUoW = new TestUnitOfWork - { - ExpectedEndOrder = -1, - OnEnd = ex => { thirdUoWEndOrder = ++currentEnd; } - }; - RegisterUow(firstUoW); - RegisterUow(secondUoW); - RegisterUow(thirdUoW); - ReceiveMessage(Helpers.Helpers.EmptyTransportMessage()); - - Assert.AreEqual(firstUoW.ExpectedEndOrder, firstUoWEndOrder); - Assert.AreEqual(secondUoW.ExpectedEndOrder, secondUoWEndOrder); - Assert.AreEqual(thirdUoW.ExpectedEndOrder, thirdUoWEndOrder); - } - } - - [TestFixture] - public class When_a_uow_end_throws : using_the_unicastbus - { - [Test] - public void Should_invoke_end_if_begin_was_invoked() - { - var firstEndCalled = false; - var throwableEndCalled = false; - var lastEndCalled = false; - - var firstUoW = new TestUnitOfWork - { - OnEnd = (ex) => { firstEndCalled = true; } - }; - var throwableUoW = new TestUnitOfWork - { - OnEnd = (ex) => - { - throwableEndCalled = true; - throw new Exception(); - } - }; - var lastUoW = new TestUnitOfWork - { - OnEnd = (ex) => { lastEndCalled = true; } - }; - RegisterUow(firstUoW); - RegisterUow(throwableUoW); - RegisterUow(lastUoW); - ReceiveMessage(Helpers.Helpers.EmptyTransportMessage()); - - Assert.True(firstEndCalled); - Assert.True(throwableEndCalled); - Assert.True(lastEndCalled); - } - - [Test] - public void Should_invoke_each_end_only_once() - { - var firstEndCalled = 0; - var throwableEndCalled = 0; - var lastEndCalled = 0; - - var firstUoW = new TestUnitOfWork - { - OnEnd = (ex) => { firstEndCalled++; } - }; - var throwableUoW = new TestUnitOfWork - { - OnEnd = (ex) => - { - throwableEndCalled++; - throw new Exception(); - } - }; - var lastUoW = new TestUnitOfWork - { - OnEnd = (ex) => { lastEndCalled++; } - }; - RegisterUow(firstUoW); - RegisterUow(throwableUoW); - RegisterUow(lastUoW); - ReceiveMessage(Helpers.Helpers.EmptyTransportMessage()); - - Assert.AreEqual(1, firstEndCalled); - Assert.AreEqual(1, throwableEndCalled); - Assert.AreEqual(1, lastEndCalled); - } - } - - [TestFixture] - public class When_a_uow_begin_throws : using_the_unicastbus - { - [Test] - public void Should_not_invoke_end_if_begin_was_not_invoked() - { - var firstEndCalled = false; - var throwableEndCalled = false; - var lastEndCalled = false; - - var firstUoW = new TestUnitOfWork - { - OnEnd = ex => { firstEndCalled = true; } - }; - var throwableUoW = new TestUnitOfWork - { - OnBegin = () => - { - throw new Exception(); - }, - OnEnd = ex => { throwableEndCalled = true; } - }; - var lastUoW = new TestUnitOfWork - { - OnEnd = ex => { lastEndCalled = true; } - }; - RegisterUow(firstUoW); - RegisterUow(throwableUoW); - RegisterUow(lastUoW); - ReceiveMessage(Helpers.Helpers.EmptyTransportMessage()); - - Assert.True(firstEndCalled); - Assert.True(throwableEndCalled); - Assert.False(lastEndCalled); - } - } - - [TestFixture] - public class When_processing_a_message_successfully : using_the_unicastbus - { - [Test] - public void Should_invoke_the_uow_begin_and_end() - { - var beginCalled = false; - var endCalled = false; - - var uow = new TestUnitOfWork - { - OnBegin = () => - { - beginCalled = true; - Assert.False(endCalled); - }, - OnEnd = (ex) => { Assert.Null(ex); endCalled = true; } - }; - - RegisterUow(uow); - ReceiveMessage(Helpers.Helpers.EmptyTransportMessage()); - - Assert.True(beginCalled); - Assert.True(endCalled); - } - } - - [TestFixture] - public class When_processing_a_message_fails : using_the_unicastbus - { - [Test] - public void Should_pass_the_exception_to_the_uow_end() - { - RegisterMessageType(); - - unicastBus.MessageHandlerTypes = new[] { typeof(MessageThatBlowsUpHandler) }; - - var endCalled = false; - - var uow = new TestUnitOfWork - { - OnEnd = (ex) => { Assert.NotNull(ex); endCalled = true; } - }; - - RegisterUow(uow); - ReceiveMessage(Helpers.Helpers.Serialize(new MessageThatBlowsUp())); - - Assert.True(endCalled); - } - } - - public class MessageThatBlowsUpHandler:IHandleMessages - { - public void Handle(MessageThatBlowsUp message) - { - throw new Exception("Generated failure"); - } - } - - public class MessageThatBlowsUp:IMessage - { - } - - public class TestUnitOfWork : IManageUnitsOfWork - { - public int ExpectedEndOrder; - - public Action OnEnd = ex => { }; - public Action OnBegin = () => { }; - - public void Begin() - { - OnBegin(); - } - - public void End(Exception ex = null) - { - OnEnd(ex); - } - } +namespace NServiceBus.Unicast.Tests +{ + using System; + using Contexts; + using NUnit.Framework; + using UnitOfWork; + + [TestFixture] + public class When_processing_a_subscribe_message_successfully : using_the_unicastbus + { + [Test] + public void Should_invoke_the_uow_begin_and_end() + { + var beginCalled = false; + var endCalled = false; + + var uow = new TestUnitOfWork + { + OnBegin = () => + { + beginCalled = true; + Assert.False(endCalled); + }, + OnEnd = (ex) => { Assert.Null(ex); endCalled = true; } + }; + + RegisterUow(uow); + ReceiveMessage(Helpers.Helpers.EmptySubscriptionMessage()); + + Assert.True(beginCalled); + Assert.True(endCalled); + } + } + + [TestFixture] + public class When_begin_and_end_executes : using_the_unicastbus + { + [Test] + public void Should_invoke_ends_in_reverse_order() + { + var currentEnd = 0; + int firstUoWEndOrder = 0, secondUoWEndOrder = 0, thirdUoWEndOrder = 0; + var firstUoW = new TestUnitOfWork + { + ExpectedEndOrder = 3, + OnEnd = ex => { firstUoWEndOrder = ++currentEnd; } + }; + var secondUoW = new TestUnitOfWork + { + ExpectedEndOrder = 2, + OnEnd = ex => { secondUoWEndOrder = ++currentEnd; } + }; + var thirdUoW = new TestUnitOfWork + { + ExpectedEndOrder = 1, + OnEnd = ex => { thirdUoWEndOrder = ++currentEnd; } + }; + RegisterUow(firstUoW); + RegisterUow(secondUoW); + RegisterUow(thirdUoW); + ReceiveMessage(Helpers.Helpers.EmptyTransportMessage()); + + Assert.AreEqual(firstUoW.ExpectedEndOrder, firstUoWEndOrder); + Assert.AreEqual(secondUoW.ExpectedEndOrder, secondUoWEndOrder); + Assert.AreEqual(thirdUoW.ExpectedEndOrder, thirdUoWEndOrder); + } + + [Test] + public void Should_invoke_ends_in_reverse_order_even_if_an_end_throws() + { + var currentEnd = 0; + int firstUoWEndOrder = 0, secondUoWEndOrder = 0, thirdUoWEndOrder = 0; + var firstUoW = new TestUnitOfWork + { + ExpectedEndOrder = 3, + OnEnd = ex => { firstUoWEndOrder = ++currentEnd; } + }; + var secondUoW = new TestUnitOfWork + { + ExpectedEndOrder = 2, + OnEnd = ex => + { + secondUoWEndOrder = ++currentEnd; + throw new Exception(); + } + }; + var thirdUoW = new TestUnitOfWork + { + ExpectedEndOrder = 1, + OnEnd = ex => { thirdUoWEndOrder = ++currentEnd; } + }; + RegisterUow(firstUoW); + RegisterUow(secondUoW); + RegisterUow(thirdUoW); + ReceiveMessage(Helpers.Helpers.EmptyTransportMessage()); + Assert.AreEqual(firstUoW.ExpectedEndOrder, firstUoWEndOrder); + Assert.AreEqual(secondUoW.ExpectedEndOrder, secondUoWEndOrder); + Assert.AreEqual(thirdUoW.ExpectedEndOrder, thirdUoWEndOrder); + } + + [Test] + public void Should_invoke_ends_in_reverse_order_even_if_a_begin_throws() + { + var currentEnd = 0; + int firstUoWEndOrder = 0, secondUoWEndOrder = 0, thirdUoWEndOrder = -1; + var firstUoW = new TestUnitOfWork + { + ExpectedEndOrder = 2, + OnEnd = ex => { firstUoWEndOrder = ++currentEnd; } + }; + var secondUoW = new TestUnitOfWork + { + ExpectedEndOrder = 1, + OnBegin = () => + { + throw new Exception(); + }, + OnEnd = ex => + { + secondUoWEndOrder = ++currentEnd; + } + }; + var thirdUoW = new TestUnitOfWork + { + ExpectedEndOrder = -1, + OnEnd = ex => { thirdUoWEndOrder = ++currentEnd; } + }; + RegisterUow(firstUoW); + RegisterUow(secondUoW); + RegisterUow(thirdUoW); + ReceiveMessage(Helpers.Helpers.EmptyTransportMessage()); + + Assert.AreEqual(firstUoW.ExpectedEndOrder, firstUoWEndOrder); + Assert.AreEqual(secondUoW.ExpectedEndOrder, secondUoWEndOrder); + Assert.AreEqual(thirdUoW.ExpectedEndOrder, thirdUoWEndOrder); + } + } + + [TestFixture] + public class When_a_uow_end_throws : using_the_unicastbus + { + [Test] + public void Should_invoke_end_if_begin_was_invoked() + { + var firstEndCalled = false; + var throwableEndCalled = false; + var lastEndCalled = false; + + var firstUoW = new TestUnitOfWork + { + OnEnd = (ex) => { firstEndCalled = true; } + }; + var throwableUoW = new TestUnitOfWork + { + OnEnd = (ex) => + { + throwableEndCalled = true; + throw new Exception(); + } + }; + var lastUoW = new TestUnitOfWork + { + OnEnd = (ex) => { lastEndCalled = true; } + }; + RegisterUow(firstUoW); + RegisterUow(throwableUoW); + RegisterUow(lastUoW); + ReceiveMessage(Helpers.Helpers.EmptyTransportMessage()); + + Assert.True(firstEndCalled); + Assert.True(throwableEndCalled); + Assert.True(lastEndCalled); + } + + [Test] + public void Should_invoke_each_end_only_once() + { + var firstEndCalled = 0; + var throwableEndCalled = 0; + var lastEndCalled = 0; + + var firstUoW = new TestUnitOfWork + { + OnEnd = (ex) => { firstEndCalled++; } + }; + var throwableUoW = new TestUnitOfWork + { + OnEnd = (ex) => + { + throwableEndCalled++; + throw new Exception(); + } + }; + var lastUoW = new TestUnitOfWork + { + OnEnd = (ex) => { lastEndCalled++; } + }; + RegisterUow(firstUoW); + RegisterUow(throwableUoW); + RegisterUow(lastUoW); + ReceiveMessage(Helpers.Helpers.EmptyTransportMessage()); + + Assert.AreEqual(1, firstEndCalled); + Assert.AreEqual(1, throwableEndCalled); + Assert.AreEqual(1, lastEndCalled); + } + } + + [TestFixture] + public class When_a_uow_begin_throws : using_the_unicastbus + { + [Test] + public void Should_not_invoke_end_if_begin_was_not_invoked() + { + var firstEndCalled = false; + var throwableEndCalled = false; + var lastEndCalled = false; + + var firstUoW = new TestUnitOfWork + { + OnEnd = ex => { firstEndCalled = true; } + }; + var throwableUoW = new TestUnitOfWork + { + OnBegin = () => + { + throw new Exception(); + }, + OnEnd = ex => { throwableEndCalled = true; } + }; + var lastUoW = new TestUnitOfWork + { + OnEnd = ex => { lastEndCalled = true; } + }; + RegisterUow(firstUoW); + RegisterUow(throwableUoW); + RegisterUow(lastUoW); + ReceiveMessage(Helpers.Helpers.EmptyTransportMessage()); + + Assert.True(firstEndCalled); + Assert.True(throwableEndCalled); + Assert.False(lastEndCalled); + } + } + + [TestFixture] + public class When_processing_a_message_successfully : using_the_unicastbus + { + [Test] + public void Should_invoke_the_uow_begin_and_end() + { + var beginCalled = false; + var endCalled = false; + + var uow = new TestUnitOfWork + { + OnBegin = () => + { + beginCalled = true; + Assert.False(endCalled); + }, + OnEnd = (ex) => { Assert.Null(ex); endCalled = true; } + }; + + RegisterUow(uow); + ReceiveMessage(Helpers.Helpers.EmptyTransportMessage()); + + Assert.True(beginCalled); + Assert.True(endCalled); + } + } + + [TestFixture] + public class When_processing_a_message_fails : using_the_unicastbus + { + [Test] + public void Should_pass_the_exception_to_the_uow_end() + { + RegisterMessageType(); + + handlerRegistry.RegisterHandler(typeof(MessageThatBlowsUpHandler)); + + var endCalled = false; + + var uow = new TestUnitOfWork + { + OnEnd = (ex) => { Assert.NotNull(ex); endCalled = true; } + }; + + RegisterUow(uow); + ReceiveMessage(Helpers.Helpers.Serialize(new MessageThatBlowsUp())); + + Assert.True(endCalled); + } + } + + public class MessageThatBlowsUpHandler:IHandleMessages + { + public void Handle(MessageThatBlowsUp message) + { + throw new Exception("Generated failure"); + } + } + + public class MessageThatBlowsUp:IMessage + { + } + + public class TestUnitOfWork : IManageUnitsOfWork + { + public int ExpectedEndOrder; + + public Action OnEnd = ex => { }; + public Action OnBegin = () => { }; + + public void Begin() + { + OnBegin(); + } + + public void End(Exception ex = null) + { + OnEnd(ex); + } + } } \ No newline at end of file diff --git a/src/NServiceBus.Core.Tests/packages.config b/src/NServiceBus.Core.Tests/packages.config new file mode 100644 index 00000000000..70dd2dc9262 --- /dev/null +++ b/src/NServiceBus.Core.Tests/packages.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/NServiceBus.Core/AllAssemblies.cs b/src/NServiceBus.Core/AllAssemblies.cs new file mode 100644 index 00000000000..5a318791938 --- /dev/null +++ b/src/NServiceBus.Core/AllAssemblies.cs @@ -0,0 +1,104 @@ +namespace NServiceBus +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + using System.Web; + + /// + /// Class for specifying which assemblies not to load. + /// + public class AllAssemblies : IExcludesBuilder, IIncludesBuilder + { + /// + /// Indicate that assemblies matching the given expression are not to be used. + /// Use the 'And' method to indicate other assemblies to be skipped. + /// + /// + /// + /// + public static IExcludesBuilder Except(string assemblyExpression) + { + return new AllAssemblies { assembliesToExclude = new List(new[] { assemblyExpression })}; + } + + /// + /// Indicate that assemblies matching the given expression are to be used. + /// Use the 'And' method to indicate other assemblies to be included. + /// + /// + /// + /// + public static IIncludesBuilder Matching(string assemblyExpression) + { + return new AllAssemblies { assembliesToInclude = new List(new[] { assemblyExpression }) }; + } + + IExcludesBuilder IExcludesBuilder.And(string assemblyExpression) + { + if (!assembliesToExclude.Contains(assemblyExpression)) + assembliesToExclude.Add(assemblyExpression); + + return this; + } + + IExcludesBuilder IIncludesBuilder.Except(string assemblyExpression) + { + if (assembliesToExclude == null) + assembliesToExclude = new List(); + + if (!assembliesToExclude.Contains(assemblyExpression)) + assembliesToExclude.Add(assemblyExpression); + + return this; + } + + IIncludesBuilder IIncludesBuilder.And(string assemblyExpression) + { + if (!assembliesToInclude.Contains(assemblyExpression)) + assembliesToInclude.Add(assemblyExpression); + + return this; + } + + /// + /// Returns an enumerator for looping over the assemblies to be loaded. + /// + /// + public IEnumerator GetEnumerator() + { + Predicate exclude = assembliesToExclude != null + ? name => assembliesToExclude.Any(skip => Configure.IsMatch(skip, name)) + : (Predicate) null; + + Predicate include = assembliesToInclude != null + ? name => assembliesToInclude.Any(skip => Configure.IsMatch(skip, name)) + : (Predicate) null; + + return Configure.FindAssemblies(directory, true, include, exclude).GetEnumerator(); + } + + /// + /// Return a non-generic enumerator. + /// + /// + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + private AllAssemblies() + { + if (HttpRuntime.AppDomainAppId != null) + directory = HttpRuntime.BinDirectory; + else + directory = AppDomain.CurrentDomain.BaseDirectory; + } + + private List assembliesToExclude; + private List assembliesToInclude; + private readonly string directory; + } +} diff --git a/src/NServiceBus.Core/AutomaticSubscriptions/AutoSubscribe.cs b/src/NServiceBus.Core/AutomaticSubscriptions/AutoSubscribe.cs new file mode 100644 index 00000000000..5ce403162e2 --- /dev/null +++ b/src/NServiceBus.Core/AutomaticSubscriptions/AutoSubscribe.cs @@ -0,0 +1,38 @@ +namespace NServiceBus.Features +{ + using AutomaticSubscriptions; + using Config; + using Settings; + using Transports; + + public class AutoSubscribe : Feature + { + public override void Initialize() + { + InfrastructureServices.Enable(); + + if (Configure.HasComponent()) + { + var transportDefiniton = SettingsHolder.GetOrDefault("NServiceBus.Transport.SelectedTransport"); + + //if the transport has centralized pubsub we can autosubscribe all events regardless if they have explicit routing or not + if (transportDefiniton != null && transportDefiniton.HasSupportForCentralizedPubSub) + { + Configure.Instance.Configurer.ConfigureProperty(s => s.DoNotRequireExplicitRouting, true); + } + + //apply any user specific settings + SettingsHolder.ApplyTo(); + } + + } + + public override bool IsEnabledByDefault + { + get + { + return true; + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/AutomaticSubscriptions/AutoSubscriber.cs b/src/NServiceBus.Core/AutomaticSubscriptions/AutoSubscriber.cs new file mode 100644 index 00000000000..192feb7e89f --- /dev/null +++ b/src/NServiceBus.Core/AutomaticSubscriptions/AutoSubscriber.cs @@ -0,0 +1,36 @@ +namespace NServiceBus.AutomaticSubscriptions +{ + using System.Linq; + using Features; + using Logging; + using Unicast.Subscriptions; + + public class AutoSubscriber:IWantToRunWhenBusStartsAndStops + { + public IAutoSubscriptionStrategy AutoSubscriptionStrategy { get; set; } + + public IBus Bus { get; set; } + + public void Start() + { + if (!Feature.IsEnabled()) + return; + + + foreach (var eventType in AutoSubscriptionStrategy.GetEventsToSubscribe() + .Where(t => !MessageConventionExtensions.IsInSystemConventionList(t))) //never autosubscribe system messages + { + Bus.Subscribe(eventType); + + Logger.DebugFormat("Autosubscribed to event {0}", eventType); + } + } + + public void Stop() + { + + } + + readonly static ILog Logger = LogManager.GetLogger(typeof(DefaultAutoSubscriptionStrategy)); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/AutomaticSubscriptions/Config/AutoSubscribeSettings.cs b/src/NServiceBus.Core/AutomaticSubscriptions/Config/AutoSubscribeSettings.cs new file mode 100644 index 00000000000..ec58ffc2139 --- /dev/null +++ b/src/NServiceBus.Core/AutomaticSubscriptions/Config/AutoSubscribeSettings.cs @@ -0,0 +1,55 @@ +namespace NServiceBus.AutomaticSubscriptions.Config +{ + using NServiceBus.Config; + using Settings; + + public class AutoSubscribeSettings:ISetDefaultSettings + { + public AutoSubscribeSettings() + { + InfrastructureServices.SetDefaultFor(typeof(DefaultAutoSubscriptionStrategy),DependencyLifecycle.SingleInstance); + } + + /// + /// Turns off auto subscriptions for sagas. Sagas where not auto subscribed by default in < v4 + /// + /// + public AutoSubscribeSettings DoNotAutoSubscribeSagas() + { + SettingsHolder.SetProperty(c=>c.DoNotAutoSubscribeSagas,true); + return this; + } + + /// + /// Allows to endpoint to subscribe to messages owned by the local endpoint + /// + /// + public AutoSubscribeSettings DoNotRequireExplicitRouting() + { + SettingsHolder.SetProperty(c => c.DoNotRequireExplicitRouting, true); + return this; + } + + /// + /// Turns on autosubscriptions for messages not marked as commands. This was the default in < v4 + /// + /// + public AutoSubscribeSettings AutoSubscribePlainMessages() + { + SettingsHolder.SetProperty(c => c.SubscribePlainMessages, true); + return this; + } + + + + /// + /// Registers a custom autosubscription strategy + /// + /// + public AutoSubscribeSettings CustomAutoSubscriptionStrategy() where T : IAutoSubscriptionStrategy + { + InfrastructureServices.RegisterServiceFor(typeof(T), DependencyLifecycle.SingleInstance); + return this; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/AutomaticSubscriptions/Config/AutoSubscribeSettingsExtensions.cs b/src/NServiceBus.Core/AutomaticSubscriptions/Config/AutoSubscribeSettingsExtensions.cs new file mode 100644 index 00000000000..422ae0fd1ba --- /dev/null +++ b/src/NServiceBus.Core/AutomaticSubscriptions/Config/AutoSubscribeSettingsExtensions.cs @@ -0,0 +1,17 @@ +namespace NServiceBus +{ + using System; + using AutomaticSubscriptions.Config; + using Features; + + + public static class AutoSubscribeSettingsExtensions + { + public static FeatureSettings AutoSubscribe(this FeatureSettings settings, Action customSettings) + { + customSettings(new AutoSubscribeSettings()); + + return settings; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/AutomaticSubscriptions/DefaultAutoSubscriptionStrategy.cs b/src/NServiceBus.Core/AutomaticSubscriptions/DefaultAutoSubscriptionStrategy.cs new file mode 100644 index 00000000000..2e134d5e043 --- /dev/null +++ b/src/NServiceBus.Core/AutomaticSubscriptions/DefaultAutoSubscriptionStrategy.cs @@ -0,0 +1,53 @@ +namespace NServiceBus.AutomaticSubscriptions +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Unicast.Routing; + using Saga; + using Unicast; + + /// + /// The default strategy for auto subscriptions. + /// + public class DefaultAutoSubscriptionStrategy:IAutoSubscriptionStrategy + { + /// + /// The known handlers + /// + public IMessageHandlerRegistry HandlerRegistry { get; set; } + + /// + /// The message routing + /// + public IRouteMessages MessageRouter { get; set; } + + /// + /// If set to true the endpoint will subscribe to it self even if no endpoint mappings exists + /// + public bool DoNotRequireExplicitRouting { get; set; } + + /// + /// if true messages that are handled by sagas wont be auto subscribed + /// + public bool DoNotAutoSubscribeSagas { get; set; } + + /// + /// If true all messages that are not commands will be auto subscribed + /// + public bool SubscribePlainMessages { get; set; } + + public IEnumerable GetEventsToSubscribe() + { + return HandlerRegistry.GetMessageTypes() + //get all potential messages + .Where(t => !MessageConventionExtensions.IsCommandType(t) && (SubscribePlainMessages || MessageConventionExtensions.IsEventType(t))) + //get messages that has routing if required + .Where(t => DoNotRequireExplicitRouting || MessageRouter.GetDestinationFor(t) != Address.Undefined) + //get messages with other handlers than sagas if needed + .Where(t => !DoNotAutoSubscribeSagas || HandlerRegistry.GetHandlerTypes(t).Any(handler => !typeof(ISaga).IsAssignableFrom(handler))) + .ToList(); + } + } + +} \ No newline at end of file diff --git a/src/NServiceBus.Core/AutomaticSubscriptions/IAutoSubscriptionStrategy.cs b/src/NServiceBus.Core/AutomaticSubscriptions/IAutoSubscriptionStrategy.cs new file mode 100644 index 00000000000..10ab6357e95 --- /dev/null +++ b/src/NServiceBus.Core/AutomaticSubscriptions/IAutoSubscriptionStrategy.cs @@ -0,0 +1,17 @@ +namespace NServiceBus.AutomaticSubscriptions +{ + using System; + using System.Collections.Generic; + + /// + /// Abstracts the strategy for selecting which events to autosubscribe to during startup + /// + public interface IAutoSubscriptionStrategy + { + /// + /// Returns the list of events to autosubscribe + /// + /// + IEnumerable GetEventsToSubscribe(); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/CircuitBreakers/CircuitBreaker.cs b/src/NServiceBus.Core/CircuitBreakers/CircuitBreaker.cs new file mode 100644 index 00000000000..5ace9a98fbc --- /dev/null +++ b/src/NServiceBus.Core/CircuitBreakers/CircuitBreaker.cs @@ -0,0 +1,42 @@ +namespace NServiceBus.CircuitBreakers +{ + using System; + using System.Threading; + + /// + /// A circuit breaker implementation. + /// + public class CircuitBreaker + { + private readonly int threshold; + private int firedTimes; + private Timer timer; + private int failureCount; + + /// + /// Create a . + /// + /// Number of triggers before it fires. + /// The to wait before resetting the . + public CircuitBreaker(int threshold, TimeSpan resetEvery) + { + this.threshold = threshold; + timer = new Timer(state => failureCount = 0, null, resetEvery, resetEvery); + } + + /// + /// Method to execute. + /// + /// The callback to execute. + public void Execute(Action trigger) + { + if (Interlocked.Increment(ref failureCount) > threshold) + { + if (Interlocked.Exchange(ref firedTimes, 1) == 0) + { + trigger(); + } + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/CircuitBreakers/ICircuitBreaker.cs b/src/NServiceBus.Core/CircuitBreakers/ICircuitBreaker.cs new file mode 100644 index 00000000000..93a80ad0a01 --- /dev/null +++ b/src/NServiceBus.Core/CircuitBreakers/ICircuitBreaker.cs @@ -0,0 +1,10 @@ +namespace NServiceBus.CircuitBreakers +{ + using System; + + public interface ICircuitBreaker + { + bool Success(); + void Failure(Exception exception); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/CircuitBreakers/RepeatedFailuresOverTimeCircuitBreaker.cs b/src/NServiceBus.Core/CircuitBreakers/RepeatedFailuresOverTimeCircuitBreaker.cs new file mode 100644 index 00000000000..1fc7ccfc33b --- /dev/null +++ b/src/NServiceBus.Core/CircuitBreakers/RepeatedFailuresOverTimeCircuitBreaker.cs @@ -0,0 +1,70 @@ +namespace NServiceBus.CircuitBreakers +{ + using System; + using System.Threading; + using Logging; + + public class RepeatedFailuresOverTimeCircuitBreaker : ICircuitBreaker + { + public RepeatedFailuresOverTimeCircuitBreaker(string name, TimeSpan timeToWaitBeforeTriggering, Action triggerAction) + : this(name, timeToWaitBeforeTriggering, triggerAction, TimeSpan.FromSeconds(1)) + { + } + + public RepeatedFailuresOverTimeCircuitBreaker(string name, TimeSpan timeToWaitBeforeTriggering, Action triggerAction, TimeSpan delayAfterFailure) + { + this.name = name; + this.delayAfterFailure = delayAfterFailure; + this.triggerAction = triggerAction; + this.timeToWaitBeforeTriggering = timeToWaitBeforeTriggering; + + timer = new Timer(CircuitBreakerTriggered); + } + + public bool Success() + { + var newValue = Interlocked.Exchange(ref failureCount, 0); + + if (newValue == 0) + return false; + + timer.Change(Timeout.Infinite, Timeout.Infinite); + Logger.InfoFormat("The circuit breaker for {0} is now disarmed", name); + + return true; + } + public void Failure(Exception exception) + { + lastException = exception; + var newValue = Interlocked.Increment(ref failureCount); + + if (newValue == 1) + { + timer.Change(timeToWaitBeforeTriggering, NoPeriodicTriggering); + Logger.InfoFormat("The circuit breaker for {0} is now in the armed state", name); + } + + + Thread.Sleep(delayAfterFailure); + } + + void CircuitBreakerTriggered(object state) + { + if (Interlocked.Read(ref failureCount) > 0) + { + Logger.WarnFormat("The circuit breaker for {0} will now be triggered", name); + triggerAction(lastException); + } + } + + readonly Action triggerAction; + readonly string name; + readonly TimeSpan delayAfterFailure; + readonly TimeSpan timeToWaitBeforeTriggering; + readonly Timer timer; + long failureCount; + Exception lastException; + static readonly TimeSpan NoPeriodicTriggering = TimeSpan.FromMilliseconds(-1); + static readonly ILog Logger = LogManager.GetLogger(typeof(RepeatedFailuresOverTimeCircuitBreaker)); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Config/AddressInitializer.cs b/src/NServiceBus.Core/Config/AddressInitializer.cs new file mode 100644 index 00000000000..a52cbad1da3 --- /dev/null +++ b/src/NServiceBus.Core/Config/AddressInitializer.cs @@ -0,0 +1,17 @@ +namespace NServiceBus.Config +{ + /// + /// Initializes the local address + /// + public class AddressInitializer : IWantToRunBeforeConfiguration + { + /// + /// Initialize the local address + /// + public void Init() + { + if (Address.Local == null) + Address.InitializeLocalAddress(ConfigureSettingLocalAddressNameAction.GetLocalAddressName()); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Config/Advanced/ConfigureSettingLocalAddressNameAction.cs b/src/NServiceBus.Core/Config/Advanced/ConfigureSettingLocalAddressNameAction.cs new file mode 100644 index 00000000000..5c846fad52a --- /dev/null +++ b/src/NServiceBus.Core/Config/Advanced/ConfigureSettingLocalAddressNameAction.cs @@ -0,0 +1,60 @@ +namespace NServiceBus.Config.Advanced +{ + using System; + + /// + /// Allow overriding local address name. + /// + public static class ConfigureSettingLocalAddressNameAction + { + /// + /// Set a function that overrides the default naming of NServiceBus local addresses. + /// See: Here for more details. + /// + /// + /// + /// + [ObsoleteEx(Message = "Moved to NServiceBus namespace.", RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0")] + public static Configure DefineLocalAddressNameFunc(this Configure config, Func setLocalAddressNameFunc) + { + NServiceBus.ConfigureSettingLocalAddressNameAction.defineLocalAddressNameFunc = setLocalAddressNameFunc; + return config; + } + } +} + +namespace NServiceBus +{ + using System; + + /// + /// Allow overriding local address name. + /// + public static class ConfigureSettingLocalAddressNameAction + { + internal static Func defineLocalAddressNameFunc = Configure.GetEndpointNameAction; + + /// + /// Set a function that overrides the default naming of NServiceBus local addresses. + /// See: Here for more details. + /// + /// + /// + /// + public static Configure DefineLocalAddressNameFunc(this Configure config, Func setLocalAddressNameFunc) + { + defineLocalAddressNameFunc = setLocalAddressNameFunc; + return config; + } + /// + /// Execute function that returns the NServiceBus local addresses name. If not override by the user, NServiceBus defaults will be used. + /// See: Here for more details. + /// + /// + internal static string GetLocalAddressName() + { + return defineLocalAddressNameFunc(); + } + } +} + diff --git a/src/config/NServiceBus.Config/ConfigurationSource/DefaultConfigurationSource.cs b/src/NServiceBus.Core/Config/ConfigurationSource/DefaultConfigurationSource.cs similarity index 97% rename from src/config/NServiceBus.Config/ConfigurationSource/DefaultConfigurationSource.cs rename to src/NServiceBus.Core/Config/ConfigurationSource/DefaultConfigurationSource.cs index 1b7b22d6bc6..cddde9a2297 100644 --- a/src/config/NServiceBus.Config/ConfigurationSource/DefaultConfigurationSource.cs +++ b/src/NServiceBus.Core/Config/ConfigurationSource/DefaultConfigurationSource.cs @@ -1,19 +1,19 @@ -namespace NServiceBus.Config.ConfigurationSource -{ - using System; - using System.Configuration; - - /// - /// A configuration source implementation on top of ConfigurationManager. - /// - public class DefaultConfigurationSource : IConfigurationSource - { - T IConfigurationSource.GetConfiguration() - { - if (!typeof(ConfigurationSection).IsAssignableFrom(typeof(T))) - throw new ArgumentException("DefaultConfigurationSource only supports .Net ConfigurationSections"); - - return ConfigurationManager.GetSection(typeof(T).Name) as T; - } - } +namespace NServiceBus.Config.ConfigurationSource +{ + using System; + using System.Configuration; + + /// + /// A configuration source implementation on top of ConfigurationManager. + /// + public class DefaultConfigurationSource : IConfigurationSource + { + T IConfigurationSource.GetConfiguration() + { + if (!typeof(ConfigurationSection).IsAssignableFrom(typeof(T))) + throw new ArgumentException("DefaultConfigurationSource only supports .Net ConfigurationSections"); + + return ConfigurationManager.GetSection(typeof(T).Name) as T; + } + } } \ No newline at end of file diff --git a/src/config/NServiceBus.Config/ConfigurationSource/IConfigurationSource.cs b/src/NServiceBus.Core/Config/ConfigurationSource/IConfigurationSource.cs similarity index 100% rename from src/config/NServiceBus.Config/ConfigurationSource/IConfigurationSource.cs rename to src/NServiceBus.Core/Config/ConfigurationSource/IConfigurationSource.cs diff --git a/src/NServiceBus.Core/Config/ConfigureExtensions.cs b/src/NServiceBus.Core/Config/ConfigureExtensions.cs new file mode 100644 index 00000000000..7f6d974474f --- /dev/null +++ b/src/NServiceBus.Core/Config/ConfigureExtensions.cs @@ -0,0 +1,22 @@ +namespace NServiceBus +{ + /// + /// Configure Extensions. + /// + public static class ConfigureExtensions + { + /// + /// Configures this endpoint as a send only endpoint. + /// + /// + /// Use this in endpoints whose only purpose is sending messages, websites are often a good example of send only endpoints. + /// + public static IBus SendOnly(this Configure config) + { + Configure.Endpoint.AsSendOnly(); + + config.Initialize(); + return config.Builder.Build(); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Config/Conventions/EndpointHelper.cs b/src/NServiceBus.Core/Config/Conventions/EndpointHelper.cs new file mode 100644 index 00000000000..6da32278985 --- /dev/null +++ b/src/NServiceBus.Core/Config/Conventions/EndpointHelper.cs @@ -0,0 +1,123 @@ +namespace NServiceBus.Config.Conventions +{ + using System; + using System.Diagnostics; + using System.Linq; + using System.Reflection; + using System.Web; + using Hosting.Helpers; + using Utils; + + /// + /// The default name for a endpoint + /// + public static class EndpointHelper + { + private static Type entryType; + private static bool intialized; + + /// + /// Gets the name of this endpoint + /// + /// The name of the endpoint. + public static string GetDefaultEndpointName() + { + Initialize(); + + string endpointName = null; + + if (entryType != null) + { + endpointName = entryType.Namespace ?? entryType.Assembly.GetName().Name; + } + + if (endpointName == null) + { + throw new InvalidOperationException( + "No endpoint name could be generated, please specify your own convention using Configure.DefineEndpointName()"); + } + + return endpointName; + } + + /// + /// Gets the version of the endpoint. + /// + /// The the endpoint. + public static string GetEndpointVersion() + { + Initialize(); + + if (entryType != null) + { + return FileVersionRetriever.GetFileVersion(entryType); + } + + throw new InvalidOperationException( + "No version of the endpoint could not be retrieved using the default convention, please specify your own convention using Configure.DefineEndpointVersionRetriever()"); + } + + /// + /// If set this will be used to figure out what to name the endpoint and select the version. + /// + public static StackTrace StackTraceToExamine { get; set; } + + static void Initialize() + { + if (intialized) + return; + try + { + var entryAssembly = Assembly.GetEntryAssembly(); + if (entryAssembly != null && entryAssembly.EntryPoint != null) + { + entryType = entryAssembly.EntryPoint.ReflectedType; + return; + } + + StackFrame targetFrame = null; + + StackFrame[] stackFrames = new StackTrace().GetFrames(); + if (stackFrames != null) + { + targetFrame = + stackFrames.FirstOrDefault( + f => typeof(HttpApplication).IsAssignableFrom(f.GetMethod().DeclaringType)); + } + + if (targetFrame != null) + { + entryType= targetFrame.GetMethod().ReflectedType; + return; + } + + if (StackTraceToExamine != null) + { + stackFrames = StackTraceToExamine.GetFrames(); + if (stackFrames != null) + { + targetFrame = + stackFrames.FirstOrDefault( + f => f.GetMethod().DeclaringType != typeof(NServiceBus.Configure)); + + + } + } + + if (targetFrame == null) + targetFrame = stackFrames.FirstOrDefault( + f => f.GetMethod().DeclaringType.Assembly != typeof(NServiceBus.Configure).Assembly); + + if (targetFrame != null) + { + entryType = targetFrame.GetMethod().ReflectedType; + return; + } + } + finally + { + intialized = true; + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Config/Conventions/SystemMessageConventions.cs b/src/NServiceBus.Core/Config/Conventions/SystemMessageConventions.cs new file mode 100644 index 00000000000..eb50a62769d --- /dev/null +++ b/src/NServiceBus.Core/Config/Conventions/SystemMessageConventions.cs @@ -0,0 +1,44 @@ +namespace NServiceBus.Config.Conventions +{ + using System; + + /// + /// Define system message convention + /// + public static class SystemMessageConventions + { + /// + /// Add system messages convention + /// + /// + /// + [ObsoleteEx(Message = "Moved to NServiceBus namespace.", RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0")] + public static Configure AddSystemMessagesAs(this Configure config, Func definesMessageType) + { + MessageConventionExtensions.AddSystemMessagesConventions(definesMessageType); + return config; + } + } +} + +namespace NServiceBus +{ + using System; + + /// + /// Define system message convention + /// + public static class SystemMessageConventions + { + /// + /// Add system messages convention + /// + /// + /// + public static Configure AddSystemMessagesAs(this Configure config, Func definesMessageType) + { + MessageConventionExtensions.AddSystemMessagesConventions(definesMessageType); + return config; + } + } +} \ No newline at end of file diff --git a/src/impl/unicast/queuing/NServiceBus.Unicast.Queuing.Ftp.Config/FtpQueueConfig.cs b/src/NServiceBus.Core/Config/FtpQueueConfig.cs similarity index 87% rename from src/impl/unicast/queuing/NServiceBus.Unicast.Queuing.Ftp.Config/FtpQueueConfig.cs rename to src/NServiceBus.Core/Config/FtpQueueConfig.cs index e05a1f48a10..e161f97cca3 100644 --- a/src/impl/unicast/queuing/NServiceBus.Unicast.Queuing.Ftp.Config/FtpQueueConfig.cs +++ b/src/NServiceBus.Core/Config/FtpQueueConfig.cs @@ -1,14 +1,14 @@ -using System; -using System.Configuration; - namespace NServiceBus.Config { + using System; + using System.Configuration; + public class FtpQueueConfig : ConfigurationSection { /// /// The temp directory where files will be place before sending /// - [Obsolete("Not required any longer. You can safely remove this attribute.", false)] + [ObsoleteEx(Message = "Not required any longer. You can safely remove this attribute.", RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0")] [ConfigurationProperty("SendDirectory", IsRequired = false)] public String SendDirectory { diff --git a/src/gateway/NServiceBus.Gateway/Config/GatewayConfig.cs b/src/NServiceBus.Core/Config/GatewayConfig.cs similarity index 85% rename from src/gateway/NServiceBus.Gateway/Config/GatewayConfig.cs rename to src/NServiceBus.Core/Config/GatewayConfig.cs index f3466d828db..6fa74b150a7 100644 --- a/src/gateway/NServiceBus.Gateway/Config/GatewayConfig.cs +++ b/src/NServiceBus.Core/Config/GatewayConfig.cs @@ -1,6 +1,5 @@ -namespace NServiceBus.Config +namespace NServiceBus.Config { - using System; using System.Collections.Generic; using System.Configuration; using Gateway.Channels; @@ -25,23 +24,23 @@ public SiteCollection Sites { this["Sites"] = value; } - } - - /// - /// Collection of channels - /// - [ConfigurationProperty("Channels", IsRequired = true)] - [ConfigurationCollection(typeof(ChannelCollection), AddItemName = "Channel")] - public ChannelCollection Channels - { - get - { - return this["Channels"] as ChannelCollection; - } - set - { - this["Channels"] = value; - } + } + + /// + /// Collection of channels + /// + [ConfigurationProperty("Channels", IsRequired = true)] + [ConfigurationCollection(typeof(ChannelCollection), AddItemName = "Channel")] + public ChannelCollection Channels + { + get + { + return this["Channels"] as ChannelCollection; + } + set + { + this["Channels"] = value; + } } public IDictionary SitesAsDictionary() @@ -58,119 +57,140 @@ public ChannelCollection Channels } return result; - } - - public IEnumerable GetChannels() - { - var result = new List(); - - foreach (ChannelConfig channel in Channels) - { - result.Add(new ReceiveChannel - { - Address = channel.Address, - Type = channel.ChannelType, - NumberOfWorkerThreads = channel.NumberOfWorkerThreads, - Default = channel.Default - }); - } - - return result; - } - } - - public class ChannelCollection : ConfigurationElementCollection - { - /// - /// Creates a new empty property - /// - /// - protected override ConfigurationElement CreateNewElement() - { - return new ChannelConfig(); - } - - /// - /// Returns the key for the given element - /// - /// - /// - protected override object GetElementKey(ConfigurationElement element) - { - return ((ChannelConfig)element).Address; - } - - - } - - public class ChannelConfig : ConfigurationElement - { - /// - /// True if this channel is the default channel - /// - [ConfigurationProperty("Default", IsRequired = false,DefaultValue = false, IsKey = false)] - public bool Default - { - get - { - return (bool)this["Default"]; - } - set - { - this["Default"] = value; - } - } - - /// - /// The Address that the channel is listening on - /// - [ConfigurationProperty("Address", IsRequired = true, IsKey = false)] - public string Address - { - get - { - return (string)this["Address"]; - } - set - { - this["Address"] = value; - } - } - - /// - /// The number of worker threads that will be used for this channel - /// - [ConfigurationProperty("NumberOfWorkerThreads", IsRequired = false,DefaultValue =1, IsKey = false)] - public int NumberOfWorkerThreads - { - get - { - return (int)this["NumberOfWorkerThreads"]; - } - set - { - this["NumberOfWorkerThreads"] = value; - } - } - - - /// - /// The ChannelType - /// - [ConfigurationProperty("ChannelType", IsRequired = true, IsKey = false)] - public string ChannelType - { - get - { - return ((string)this["ChannelType"]).ToLower(); - } - set - { - this["ChannelType"] = value; - } - } - } - + } + + public IEnumerable GetChannels() + { + var result = new List(); + + foreach (ChannelConfig channel in Channels) + { + result.Add(new ReceiveChannel + { + Address = channel.Address, + Type = channel.ChannelType, + NumberOfWorkerThreads = channel.NumberOfWorkerThreads, + Default = channel.Default + }); + } + + return result; + } + } + + public class ChannelCollection : ConfigurationElementCollection + { + /// + /// Creates a new empty property + /// + /// + protected override ConfigurationElement CreateNewElement() + { + return new ChannelConfig(); + } + + /// + /// Returns the key for the given element + /// + /// + /// + protected override object GetElementKey(ConfigurationElement element) + { + return ((ChannelConfig)element).Address; + } + + public override bool IsReadOnly() + { + return false; + } + + /// + /// Calls BaseAdd. + /// + /// + public void Add(ChannelConfig channel) + { + BaseAdd(channel); + } + + /// + /// Calls BaseAdd with true as the additional parameter. + /// + /// + protected override void BaseAdd(ConfigurationElement element) + { + BaseAdd(element, true); + } + } + + public class ChannelConfig : ConfigurationElement + { + /// + /// True if this channel is the default channel + /// + [ConfigurationProperty("Default", IsRequired = false,DefaultValue = false, IsKey = false)] + public bool Default + { + get + { + return (bool)this["Default"]; + } + set + { + this["Default"] = value; + } + } + + /// + /// The Address that the channel is listening on + /// + [ConfigurationProperty("Address", IsRequired = true, IsKey = false)] + public string Address + { + get + { + return (string)this["Address"]; + } + set + { + this["Address"] = value; + } + } + + /// + /// The number of worker threads that will be used for this channel + /// + [ConfigurationProperty("NumberOfWorkerThreads", IsRequired = false,DefaultValue =1, IsKey = false)] + public int NumberOfWorkerThreads + { + get + { + return (int)this["NumberOfWorkerThreads"]; + } + set + { + this["NumberOfWorkerThreads"] = value; + } + } + + + /// + /// The ChannelType + /// + [ConfigurationProperty("ChannelType", IsRequired = true, IsKey = false)] + public string ChannelType + { + get + { + return ((string)this["ChannelType"]).ToLower(); + } + set + { + this["ChannelType"] = value; + } + } + } + /// /// Collection of sites /// @@ -195,7 +215,28 @@ protected override object GetElementKey(ConfigurationElement element) return ((SiteConfig)element).Key; } + public override bool IsReadOnly() + { + return false; + } + /// + /// Calls BaseAdd. + /// + /// + public void Add(SiteConfig site) + { + BaseAdd(site); + } + + /// + /// Calls BaseAdd with true as the additional parameter. + /// + /// + protected override void BaseAdd(ConfigurationElement element) + { + BaseAdd(element, true); + } } /// @@ -251,4 +292,4 @@ public string ChannelType } } } -} \ No newline at end of file +} diff --git a/src/NServiceBus.Core/Config/IFinalizeConfiguration.cs b/src/NServiceBus.Core/Config/IFinalizeConfiguration.cs new file mode 100644 index 00000000000..60b84eb7d62 --- /dev/null +++ b/src/NServiceBus.Core/Config/IFinalizeConfiguration.cs @@ -0,0 +1,13 @@ +namespace NServiceBus.Config +{ + /// + /// Interface used to finalize configuration. This is the final point where the container can be altered. + /// + public interface IFinalizeConfiguration + { + /// + /// Invoked by the framework when the configuration is to be finalized + /// + void FinalizeConfiguration(); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Config/INeedInitialization.cs b/src/NServiceBus.Core/Config/INeedInitialization.cs new file mode 100644 index 00000000000..11e7e0bc228 --- /dev/null +++ b/src/NServiceBus.Core/Config/INeedInitialization.cs @@ -0,0 +1,15 @@ +namespace NServiceBus.Config +{ + /// + /// Implementers will be called after NServiceBus.Configure.With completes and a container + /// has been set. + /// + [ObsoleteEx(Replacement = "NServiceBus!NServiceBus.INeedInitialization", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public interface INeedInitialization + { + /// + /// Implementers will include custom initialization code here. + /// + void Init(); + } +} diff --git a/src/config/NServiceBus.Config/IWantToRunWhenConfigurationIsComplete.cs b/src/NServiceBus.Core/Config/IWantToRunWhenConfigurationIsComplete.cs similarity index 92% rename from src/config/NServiceBus.Config/IWantToRunWhenConfigurationIsComplete.cs rename to src/NServiceBus.Core/Config/IWantToRunWhenConfigurationIsComplete.cs index a1a39267285..3ed1fead4fb 100644 --- a/src/config/NServiceBus.Config/IWantToRunWhenConfigurationIsComplete.cs +++ b/src/NServiceBus.Core/Config/IWantToRunWhenConfigurationIsComplete.cs @@ -1,16 +1,14 @@ -using System; - -namespace NServiceBus.Config -{ - /// - /// Implementors are invoked when configuration is complete. - /// Implementors are resolved from the container so have access to full DI. - /// - public interface IWantToRunWhenConfigurationIsComplete - { - /// - /// Method invoked to run custom code. - /// - void Run(); - } -} +namespace NServiceBus.Config +{ + /// + /// Implementors are invoked when configuration is complete. + /// Implementors are resolved from the container so have access to full DI. + /// + public interface IWantToRunWhenConfigurationIsComplete + { + /// + /// Method invoked to run custom code. + /// + void Run(); + } +} diff --git a/src/NServiceBus.Core/Config/InfrastructureServices.cs b/src/NServiceBus.Core/Config/InfrastructureServices.cs new file mode 100644 index 00000000000..323afc1997d --- /dev/null +++ b/src/NServiceBus.Core/Config/InfrastructureServices.cs @@ -0,0 +1,174 @@ +namespace NServiceBus.Config +{ + using System; + using System.Collections.Generic; + using System.Configuration; + using System.Text; + using NServiceBus.Logging; + using Settings; + + /// + /// Class used to control the various infrastructure services required by NServiceBus + /// + public class InfrastructureServices + { + public static IEnumerable CurrentStatus + { + get { return knownServices.Values; } + } + + /// + /// Enables the given infrastructure service by registering it in the container + /// + /// + public static void Enable() + { + var serviceType = typeof(T); + + if (Configure.Instance.Configurer.HasComponent()) + { + Logger.InfoFormat("Infrastructure service {0} was found in the container and will be used instead of the default", serviceType.FullName); + SetStatusToEnabled(serviceType); + + //todo: We should guide users to register their infrastructure overrides in a more explicit way in the future + return; + } + + if (!SettingsHolder.HasSetting()) + { + throw new ConfigurationErrorsException(string.Format("No explicit settings or default found for service {0}, please configure one explicity", serviceType.FullName)); + } + + var configAction = SettingsHolder.Get(serviceType.FullName); + + configAction(); + + SetStatusToEnabled(serviceType); + + Logger.DebugFormat("Infrastructure service {0} has been configured", serviceType.FullName); + } + + + + /// + /// Set the default for the infastructure service to the action passed in. + /// If the service is enabled and no explict override is found this action will be used to configure the service. + /// + /// + /// + public static void SetDefaultFor(Action configAction) + { + var serviceType = typeof(T); + + SettingsHolder.SetDefault(configAction); + SetStatusToDisabled(serviceType); + Logger.DebugFormat("Default provider for infrastructure service {0} has been set to a custom action", serviceType.FullName); + } + + + /// + /// Sets the default provider for the service to the give type. If the service is enabled the type will be registered + /// in the container with the specified lifecycle + /// + /// + /// + /// + public static void SetDefaultFor(Type providerType, DependencyLifecycle dependencyLifecycle) + { + var serviceType = typeof(T); + + SettingsHolder.SetDefault(() => Configure.Component(providerType, dependencyLifecycle)); + SetStatusToDisabled(serviceType); + Logger.DebugFormat("Default provider for infrastructure service {0} has been set to {1}, lifecycle: {2}", serviceType.FullName, providerType.FullName, dependencyLifecycle); + } + + /// + /// Register a explict service provider + /// + /// + /// + public static void RegisterServiceFor(Action configAction) + { + var serviceType = typeof(T); + + SettingsHolder.Set(configAction); + Logger.InfoFormat("Explicit provider for infrastructure service {0} has been set to custom action", serviceType.FullName); + } + + /// + /// Register a explict service provider + /// + /// + /// + /// + public static void RegisterServiceFor(Type providerType, DependencyLifecycle dependencyLifecycle) + { + var serviceType = typeof(T); + + SettingsHolder.Set(() => Configure.Component(providerType, dependencyLifecycle)); + Logger.InfoFormat("Explicit provider for infrastructure service {0} has been set to {1}, lifecycle: {2}", serviceType.FullName, providerType.FullName, dependencyLifecycle); + } + + + /// + /// Returns true if the requested service is available and can be enabled on demand + /// + /// + /// + public static bool IsAvailable() + { + return SettingsHolder.HasSetting(); + } + + static void SetStatusToEnabled(Type serviceType) + { + knownServices[serviceType] = new ServiceStatus { Service = serviceType, Enabled = true }; + } + + static void SetStatusToDisabled(Type serviceType) + { + knownServices[serviceType] = new ServiceStatus { Service = serviceType, Enabled = false }; + } + + static readonly IDictionary knownServices = new Dictionary(); + static readonly ILog Logger = LogManager.GetLogger(typeof(InfrastructureServices)); + + + public class ServiceStatus + { + public Type Service { get; set; } + public bool Enabled { get; set; } + + } + + + } + + + /// + /// Displays the current status for the infrastructure services + /// + public class DisplayInfrastructureServicesStatus:IWantToRunWhenConfigurationIsComplete + { + public void Run() + { + var statusText = new StringBuilder(); + + foreach (var serviceStatus in InfrastructureServices.CurrentStatus) + { + var provider = "Not defined"; + + if (Configure.HasComponent(serviceStatus.Service)) + { + provider = Configure.Instance.Builder.Build(serviceStatus.Service).GetType().FullName; + } + + statusText.AppendLine(string.Format("{0} provided by {1} - {2}", serviceStatus.Service.Name, provider, serviceStatus.Enabled ? "Enabled" : "Disabled")); + } + + Logger.DebugFormat("Infrastructure services: \n{0}",statusText); + } + + static readonly ILog Logger = LogManager.GetLogger(typeof(DisplayInfrastructureServicesStatus)); + } +} \ No newline at end of file diff --git a/src/logging/NServiceBus.Logging/Logging.cs b/src/NServiceBus.Core/Config/Logging.cs similarity index 94% rename from src/logging/NServiceBus.Logging/Logging.cs rename to src/NServiceBus.Core/Config/Logging.cs index e6b136c7614..a7b13aa9582 100644 --- a/src/logging/NServiceBus.Logging/Logging.cs +++ b/src/NServiceBus.Core/Config/Logging.cs @@ -1,7 +1,7 @@ -using System.Configuration; - namespace NServiceBus.Config { + using System.Configuration; + /// /// Logging ConfigurationSection /// diff --git a/src/unicast/NServiceBus.Unicast.Config/MessageEndpointMapping.cs b/src/NServiceBus.Core/Config/MessageEndpointMapping.cs similarity index 98% rename from src/unicast/NServiceBus.Unicast.Config/MessageEndpointMapping.cs rename to src/NServiceBus.Core/Config/MessageEndpointMapping.cs index bb1b1858397..563dccbbee3 100644 --- a/src/unicast/NServiceBus.Unicast.Config/MessageEndpointMapping.cs +++ b/src/NServiceBus.Core/Config/MessageEndpointMapping.cs @@ -1,11 +1,11 @@ -using System; -using System.Configuration; -using System.IO; -using System.Linq; -using System.Reflection; - namespace NServiceBus.Config { + using System; + using System.Configuration; + using System.IO; + using System.Linq; + using System.Reflection; + /// /// A configuration element representing which message types map to which endpoint. /// diff --git a/src/unicast/NServiceBus.Unicast.Config/MessageEndpointMappingCollection.cs b/src/NServiceBus.Core/Config/MessageEndpointMappingCollection.cs similarity index 97% rename from src/unicast/NServiceBus.Unicast.Config/MessageEndpointMappingCollection.cs rename to src/NServiceBus.Core/Config/MessageEndpointMappingCollection.cs index 29e48b59a60..df62c59baad 100644 --- a/src/unicast/NServiceBus.Unicast.Config/MessageEndpointMappingCollection.cs +++ b/src/NServiceBus.Core/Config/MessageEndpointMappingCollection.cs @@ -1,8 +1,8 @@ -using System; -using System.Configuration; - namespace NServiceBus.Config { + using System; + using System.Configuration; + /// /// A configuration element collection of MessageEndpointMappings. /// @@ -193,5 +193,10 @@ public void Clear() { BaseClear(); } + + public override bool IsReadOnly() + { + return false; + } } } diff --git a/src/impl/faults/NServiceBus.Faults.Forwarder.Config/MessageForwardingInCaseOfFaultConfig.cs b/src/NServiceBus.Core/Config/MessageForwardingInCaseOfFaultConfig.cs similarity index 95% rename from src/impl/faults/NServiceBus.Faults.Forwarder.Config/MessageForwardingInCaseOfFaultConfig.cs rename to src/NServiceBus.Core/Config/MessageForwardingInCaseOfFaultConfig.cs index e5bffb30333..12eaad371bb 100644 --- a/src/impl/faults/NServiceBus.Faults.Forwarder.Config/MessageForwardingInCaseOfFaultConfig.cs +++ b/src/NServiceBus.Core/Config/MessageForwardingInCaseOfFaultConfig.cs @@ -1,7 +1,7 @@ -using System.Configuration; - namespace NServiceBus.Config { + using System.Configuration; + /// /// Message Forwarding In Case Of Fault Config /// diff --git a/src/NServiceBus.Core/Config/MsmqMessageQueueConfig.cs b/src/NServiceBus.Core/Config/MsmqMessageQueueConfig.cs new file mode 100644 index 00000000000..4dee84a00dd --- /dev/null +++ b/src/NServiceBus.Core/Config/MsmqMessageQueueConfig.cs @@ -0,0 +1,75 @@ +namespace NServiceBus.Config +{ + using System.Configuration; + using System.Data.Common; + using Transports.Msmq.Config; + + /// + /// Contains the properties representing the MsmqMessageQueue configuration section. + /// + [ObsoleteEx(Message = "Use NServiceBus/Transport connectionString instead.", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + public class MsmqMessageQueueConfig : ConfigurationSection + { + + /// + /// If true, then message-delivery failure should result in a copy of the message being sent to a dead-letter queue + /// + [ConfigurationProperty("UseDeadLetterQueue", IsRequired = false, DefaultValue = true)] + public bool UseDeadLetterQueue + { + get + { + return (bool)this["UseDeadLetterQueue"]; + } + set + { + this["UseDeadLetterQueue"] = value; + } + } + + /// + /// If true, require that a copy of a message be kept in the originating computer's machine journal after the message has been successfully transmitted (from the originating computer to the next server) + /// + [ConfigurationProperty("UseJournalQueue", IsRequired = false)] + public bool UseJournalQueue + { + get + { + return (bool)this["UseJournalQueue"]; + } + set + { + this["UseJournalQueue"] = value; + } + } + } + + class MsmqConnectionStringBuilder : DbConnectionStringBuilder + { + public MsmqConnectionStringBuilder(string connectionString) + { + + ConnectionString = connectionString; + } + + public MsmqSettings RetrieveSettings() + { + var settings = new MsmqSettings(); + + if (ContainsKey("deadLetter")) + settings.UseDeadLetterQueue = bool.Parse((string)this["deadLetter"]); + + if (ContainsKey("journal")) + settings.UseJournalQueue = bool.Parse((string) this["journal"]); + + if (ContainsKey("cacheSendConnection")) + settings.UseConnectionCache = bool.Parse((string)this["cacheSendConnection"]); + + if (ContainsKey("useTransactionalQueues")) + settings.UseTransactionalQueues = bool.Parse((string)this["useTransactionalQueues"]); + + + return settings; + } + } +} diff --git a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.Msmq/NServiceBus.Unicast.Subscriptions.Msmq.Config/MsmqSubscriptionStorageConfig.cs b/src/NServiceBus.Core/Config/MsmqSubscriptionStorageConfig.cs similarity index 95% rename from src/impl/unicast/NServiceBus.Unicast.Subscriptions.Msmq/NServiceBus.Unicast.Subscriptions.Msmq.Config/MsmqSubscriptionStorageConfig.cs rename to src/NServiceBus.Core/Config/MsmqSubscriptionStorageConfig.cs index f6774abf4ad..b231093ed41 100644 --- a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.Msmq/NServiceBus.Unicast.Subscriptions.Msmq.Config/MsmqSubscriptionStorageConfig.cs +++ b/src/NServiceBus.Core/Config/MsmqSubscriptionStorageConfig.cs @@ -1,7 +1,7 @@ -using System.Configuration; - namespace NServiceBus.Config { + using System.Configuration; + /// /// Contains the properties representing the MsmqSubscriptionStorage configuration section. /// @@ -15,7 +15,7 @@ public class MsmqSubscriptionStorageConfig : ConfigurationSection public string Queue { get - { + { return this["Queue"] as string; } set diff --git a/src/impl/unicast/NServiceBus.Unicast.Msmq/NServiceBus.Unicast.Transport.Msmq.Config/MsmqTransportConfig.cs b/src/NServiceBus.Core/Config/MsmqTransportConfig.cs similarity index 89% rename from src/impl/unicast/NServiceBus.Unicast.Msmq/NServiceBus.Unicast.Transport.Msmq.Config/MsmqTransportConfig.cs rename to src/NServiceBus.Core/Config/MsmqTransportConfig.cs index 3d0d2aab3ff..62afd3aba93 100644 --- a/src/impl/unicast/NServiceBus.Unicast.Msmq/NServiceBus.Unicast.Transport.Msmq.Config/MsmqTransportConfig.cs +++ b/src/NServiceBus.Core/Config/MsmqTransportConfig.cs @@ -1,10 +1,11 @@ -using System.Configuration; - namespace NServiceBus.Config { + using System.Configuration; + /// /// Contains the properties representing the MsmqTransport configuration section. /// + [ObsoleteEx(Message = "'MsmqTransportConfig' section is obsolete. Please update your configuration to use the new 'TransportConfig' section instead.", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] public class MsmqTransportConfig : ConfigurationSection { /// @@ -74,10 +75,5 @@ public int MaxRetries this["MaxRetries"] = value; } } - - /// - /// Indicates that queues should not be created. - /// - public static bool DoNotCreateQueues { get; set; } } } diff --git a/src/impl/encryption/NServiceBus.Encryption.Rijndael.Config/RijndaelEncryptionServiceConfig.cs b/src/NServiceBus.Core/Config/RijndaelEncryptionServiceConfig.cs similarity index 93% rename from src/impl/encryption/NServiceBus.Encryption.Rijndael.Config/RijndaelEncryptionServiceConfig.cs rename to src/NServiceBus.Core/Config/RijndaelEncryptionServiceConfig.cs index 9f74c530cb7..ace203d982e 100644 --- a/src/impl/encryption/NServiceBus.Encryption.Rijndael.Config/RijndaelEncryptionServiceConfig.cs +++ b/src/NServiceBus.Core/Config/RijndaelEncryptionServiceConfig.cs @@ -1,7 +1,7 @@ -using System.Configuration; - namespace NServiceBus.Config { + using System.Configuration; + public class RijndaelEncryptionServiceConfig : ConfigurationSection { /// diff --git a/src/NServiceBus.Core/Config/SatelliteConfigurer.cs b/src/NServiceBus.Core/Config/SatelliteConfigurer.cs new file mode 100644 index 00000000000..1070e352d7f --- /dev/null +++ b/src/NServiceBus.Core/Config/SatelliteConfigurer.cs @@ -0,0 +1,12 @@ +namespace NServiceBus.Config +{ + using Satellites; + + public class SatelliteConfigurer : NServiceBus.INeedInitialization + { + public void Init() + { + Configure.Instance.ForAllTypes(s => Configure.Instance.Configurer.ConfigureComponent(s, DependencyLifecycle.SingleInstance)); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Config/TransportConfig.cs b/src/NServiceBus.Core/Config/TransportConfig.cs new file mode 100644 index 00000000000..a1561cca072 --- /dev/null +++ b/src/NServiceBus.Core/Config/TransportConfig.cs @@ -0,0 +1,58 @@ +namespace NServiceBus.Config +{ + using System.Configuration; + using Unicast.Transport; + + public class TransportConfig : ConfigurationSection + { + /// + /// Specifies the maximum concurrency level this is able to support. + /// + [ConfigurationProperty("MaximumConcurrencyLevel", IsRequired = false, DefaultValue = 1)] + public int MaximumConcurrencyLevel + { + get + { + return (int)this["MaximumConcurrencyLevel"]; + } + set + { + this["MaximumConcurrencyLevel"] = value; + + } + } + + /// + /// The maximum number of times to retry processing a message + /// when it fails before moving it to the error queue. + /// + [ConfigurationProperty("MaxRetries", IsRequired = false, DefaultValue = 5)] + public int MaxRetries + { + get + { + return (int)this["MaxRetries"]; + } + set + { + this["MaxRetries"] = value; + } + } + + /// + /// The max throughput for the transport. This allows the user to throttle their endpoint if needed + /// + [ConfigurationProperty("MaximumMessageThroughputPerSecond", IsRequired = false, DefaultValue = 0)] + public int MaximumMessageThroughputPerSecond + { + get + { + return (int)this["MaximumMessageThroughputPerSecond"]; + } + set + { + this["MaximumMessageThroughputPerSecond"] = value; + } + } + } +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast.Config/UnicastBusConfig.cs b/src/NServiceBus.Core/Config/UnicastBusConfig.cs similarity index 98% rename from src/unicast/NServiceBus.Unicast.Config/UnicastBusConfig.cs rename to src/NServiceBus.Core/Config/UnicastBusConfig.cs index 7a9ea2428ed..5faf243de8b 100644 --- a/src/unicast/NServiceBus.Unicast.Config/UnicastBusConfig.cs +++ b/src/NServiceBus.Core/Config/UnicastBusConfig.cs @@ -1,10 +1,8 @@ -using System.Configuration; - - namespace NServiceBus.Config -{ - using System; - +{ + using System; + using System.Configuration; + /// /// A configuration section for UnicastBus specific settings. /// @@ -18,7 +16,7 @@ public string DistributorControlAddress { get { - var result = this["DistributorControlAddress"] as string; + var result = this["DistributorControlAddress"] as string; if (string.IsNullOrWhiteSpace(result)) result = null; @@ -38,7 +36,7 @@ public string DistributorDataAddress { get { - var result = this["DistributorDataAddress"] as string; + var result = this["DistributorDataAddress"] as string; if (string.IsNullOrWhiteSpace(result)) result = null; @@ -58,7 +56,7 @@ public string ForwardReceivedMessagesTo { get { - var result = this["ForwardReceivedMessagesTo"] as string; + var result = this["ForwardReceivedMessagesTo"] as string; if (string.IsNullOrWhiteSpace(result)) result = null; @@ -68,43 +66,43 @@ public string ForwardReceivedMessagesTo { this["ForwardReceivedMessagesTo"] = value; } - } - - - /// - /// Gets/sets the time to be received set on forwarded messages - /// - [ConfigurationProperty("TimeToBeReceivedOnForwardedMessages", IsRequired = false)] - public TimeSpan TimeToBeReceivedOnForwardedMessages - { - get - { - return (TimeSpan)this["TimeToBeReceivedOnForwardedMessages"]; - } - set - { - this["TimeToBeReceivedOnForwardedMessages"] = value; - } - } - - /// - /// Gets/sets the address that the timeout manager will use to send and receive messages. - /// - [ConfigurationProperty("TimeoutManagerAddress", IsRequired = false)] - public string TimeoutManagerAddress - { - get - { - var result = this["TimeoutManagerAddress"] as string; - if (string.IsNullOrWhiteSpace(result)) - result = null; - - return result; - } - set - { - this["TimeoutManagerAddress"] = value; - } + } + + + /// + /// Gets/sets the time to be received set on forwarded messages + /// + [ConfigurationProperty("TimeToBeReceivedOnForwardedMessages", IsRequired = false)] + public TimeSpan TimeToBeReceivedOnForwardedMessages + { + get + { + return (TimeSpan)this["TimeToBeReceivedOnForwardedMessages"]; + } + set + { + this["TimeToBeReceivedOnForwardedMessages"] = value; + } + } + + /// + /// Gets/sets the address that the timeout manager will use to send and receive messages. + /// + [ConfigurationProperty("TimeoutManagerAddress", IsRequired = false)] + public string TimeoutManagerAddress + { + get + { + var result = this["TimeoutManagerAddress"] as string; + if (string.IsNullOrWhiteSpace(result)) + result = null; + + return result; + } + set + { + this["TimeoutManagerAddress"] = value; + } } /// diff --git a/src/NServiceBus.Core/Configure.cs b/src/NServiceBus.Core/Configure.cs new file mode 100644 index 00000000000..f54d21ff78d --- /dev/null +++ b/src/NServiceBus.Core/Configure.cs @@ -0,0 +1,786 @@ +namespace NServiceBus +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using System.IO; + using System.Linq; + using System.Reflection; + using System.Text; + using System.Web; + using Config; + using Config.ConfigurationSource; + using Config.Conventions; + using Features; + using Installation; + using Installation.Environments; + using Logging; + using ObjectBuilder; + using Settings; + + /// + /// Central configuration entry point for NServiceBus. + /// + public class Configure + { + static Configure() + { + ConfigurationSource = new DefaultConfigurationSource(); + } + + /// + /// Provides static access to the configuration object. + /// + public static Configure Instance + { + get + { + //we can't check for null here since that would break the way we do extension methods (the must be on a instance) + return instance; + } + } + + /// + /// True if any of the Configure.With() has been called + /// + /// + public static bool WithHasBeenCalled() + { + return instance != null; + } + + /// + /// Event raised when configuration is complete + /// + public static event Action ConfigurationComplete; + + /// + /// Gets/sets the builder. + /// Setting the builder should only be done by NServiceBus framework code. + /// + public IBuilder Builder + { + get + { + if (builder == null) + throw new InvalidOperationException("You can't access Configure.Instance.Builder before calling specifying a builder. Please add a call to Configure.DefaultBuilder() or any of the other supported builders to set one up"); + + return builder; + + } + set { builder = value; } + } + + /// + /// True if a builder has been defined + /// + /// + public static bool BuilderIsConfigured() + { + if (!WithHasBeenCalled()) + return false; + + return Instance.HasBuilder(); + } + + bool HasBuilder() + { + return builder != null && configurer != null; + } + + + IBuilder builder; + + static bool initialized { get; set; } + + /// + /// Gets/sets the configuration source to be used by NServiceBus. + /// + public static IConfigurationSource ConfigurationSource { get; set; } + + /// + /// Sets the current configuration source + /// + /// + /// + public Configure CustomConfigurationSource(IConfigurationSource configurationSource) + { + ConfigurationSource = configurationSource; + return this; + } + + /// + /// Gets/sets the object used to configure components. + /// This object should eventually reference the same container as the Builder. + /// + public IConfigureComponents Configurer + { + get + { + if (configurer == null) + throw new InvalidOperationException("You can't access Configure.Instance.Configurer before calling specifying a builder. Please add a call to Configure.DefaultBuilder() or any of the other supported builders to set one up"); + + return configurer; + } + set + { + configurer = value; + WireUpConfigSectionOverrides(); + InvokeBeforeConfigurationInitializers(); + } + } + + private IConfigureComponents configurer; + private static bool configSectionOverridesInitialized; + + void WireUpConfigSectionOverrides() + { + if (configSectionOverridesInitialized) + { + return; + } + + TypesToScan + .Where(t => t.GetInterfaces().Any(IsGenericConfigSource)) + .ToList().ForEach(t => configurer.ConfigureComponent(t, DependencyLifecycle.InstancePerCall)); + + configSectionOverridesInitialized = true; + } + + /// + /// Protected constructor to enable creation only via the With method. + /// + protected Configure() + { + } + + // ------------ Configuration extensions, please C# give us extension properties to avoid all this --- + private static Endpoint endpoint; + + public static Endpoint Endpoint { get { return endpoint ?? (endpoint = new Endpoint()); } } + + private static TransactionSettings transactionSetting; + + public static TransactionSettings Transactions { get { return transactionSetting ?? (transactionSetting = new TransactionSettings()); } } + + public static TransportSettings Transports { get { return transports ?? (transports = new TransportSettings()); } } + + private static TransportSettings transports; + + public static FeatureSettings Features { get { return features ?? (features = new FeatureSettings()); } } + + private static FeatureSettings features; + + public static SerializationSettings Serialization { get { return serialization ?? (serialization = new SerializationSettings()); } } + + private static SerializationSettings serialization; + + // ------------ End Configuration extensions --- + + /// + /// Allows the user to control how the current endpoint behaves when scaled out + /// + /// + public static void ScaleOut(Action customScaleOutSettings) + { + customScaleOutSettings(new ScaleOutSettings()); + } + + /// + /// True if this endpoint is operating in send only mode + /// + [ObsoleteEx(TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public static bool SendOnlyMode { get { return SettingsHolder.Get("Endpoint.SendOnly"); } } + + /// + /// Creates a new configuration object scanning assemblies + /// in the regular runtime directory. + /// + /// + public static Configure With() + { + if (HttpRuntime.AppDomainAppId != null) + return With((string)HttpRuntime.BinDirectory); + + return With(AppDomain.CurrentDomain.BaseDirectory); + } + + /// + /// Configures NServiceBus to scan for assemblies + /// in the relevant web directory instead of regular + /// runtime directory. + /// + /// + [ObsoleteEx(Replacement = "With()", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public static Configure WithWeb() + { + return With(); + } + + /// + /// Configures NServiceBus to scan for assemblies + /// in the given directory rather than the regular + /// runtime directory. + /// + /// + /// + public static Configure With(string probeDirectory) + { + lastProbeDirectory = probeDirectory; + return With(GetAssembliesInDirectory(probeDirectory)); + } + + /// + /// Configures NServiceBus to use the types found in the given assemblies. + /// + /// + /// + public static Configure With(IEnumerable assemblies) + { + return With(assemblies.ToArray()); + } + + /// + /// Configures nServiceBus to scan the given assemblies only. + /// + /// + /// + public static Configure With(params Assembly[] assemblies) + { + var types = GetAllowedTypes(assemblies); + + return With(types); + } + + /// + /// Configures nServiceBus to scan the given types. + /// + /// + /// + public static Configure With(IEnumerable typesToScan) + { + if (instance == null) + { + instance = new Configure(); + } + + TypesToScan = typesToScan.Union(GetAllowedTypes(Assembly.GetExecutingAssembly())).ToList(); + + if (HttpRuntime.AppDomainAppId == null) + { + var hostPath = Path.Combine(lastProbeDirectory ?? AppDomain.CurrentDomain.BaseDirectory, "NServiceBus.Host.exe"); + if (File.Exists(hostPath)) + { + TypesToScan = TypesToScan.Union(GetAllowedTypes(Assembly.LoadFrom(hostPath))).ToList(); + } + } + + Logger.DebugFormat("Number of types to scan: {0}", TypesToScan.Count()); + + EndpointHelper.StackTraceToExamine = new StackTrace(); + + instance.InvokeISetDefaultSettings(); + + return instance; + } + + /// + /// Run a custom action at configuration time - useful for performing additional configuration not exposed by the fluent interface. + /// + /// + /// + public Configure RunCustomAction(Action action) + { + action(); + + return this; + } + + /// + /// Provides an instance to a startable bus. + /// + /// + public IStartableBus CreateBus() + { + Initialize(); + + if (!Configurer.HasComponent()) + { + Instance.UnicastBus(); + } + + return Builder.Build(); + } + + private static bool beforeConfigurationInitializersCalled; + private bool invokeISetDefaultSettingsCalled; + + private void InvokeISetDefaultSettings() + { + if (invokeISetDefaultSettingsCalled) + { + return; + } + + ForAllTypes(t => Activator.CreateInstance(t)); + + invokeISetDefaultSettingsCalled = true; + } + + private void InvokeBeforeConfigurationInitializers() + { + if (beforeConfigurationInitializersCalled) + { + return; + } + + ActivateAndInvoke(t => t.Init()); + + beforeConfigurationInitializersCalled = true; + } + + /// + /// Finalizes the configuration by invoking all initialisers. + /// + public void Initialize() + { + if (initialized) + return; + + ForAllTypes(t => Configurer.ConfigureComponent(t, DependencyLifecycle.InstancePerCall)); + + ForAllTypes(t => Configurer.ConfigureComponent(t, DependencyLifecycle.InstancePerCall)); + + InvokeBeforeConfigurationInitializers(); + + ActivateAndInvoke(t => t.Init()); + + ActivateAndInvoke(t => t.Init()); + + ActivateAndInvoke(t => t.Run()); + + ForAllTypes>(t => Instance.Configurer.ConfigureComponent(t, DependencyLifecycle.InstancePerCall)); + + //lockdown the settings + SettingsHolder.PreventChanges(); + + ActivateAndInvoke(t => t.FinalizeConfiguration()); + + initialized = true; + + if (ConfigurationComplete != null) + ConfigurationComplete(); + + Builder.BuildAll() + .ToList().ForEach(o => o.Run()); + } + + + /// + /// Applies the given action to all the scanned types that can be assigned to T + /// + /// + /// + public void ForAllTypes(Action action) where T : class + { + TypesToScan.Where(t => typeof(T).IsAssignableFrom(t) && !(t.IsAbstract || t.IsInterface)) + .ToList().ForEach(action); + } + + /// + /// Returns types in assemblies found in the current directory. + /// + public static IList TypesToScan { get; private set; } + + /// + /// Returns the requested config section using the current configuration source + /// + /// + /// + public static T GetConfigSection() where T : class,new() + { + if(TypesToScan == null) + return ConfigurationSource.GetConfiguration(); + + var sectionOverrideType = TypesToScan.FirstOrDefault(t => typeof (IProvideConfiguration).IsAssignableFrom(t)); + + if (sectionOverrideType == null) + return ConfigurationSource.GetConfiguration(); + + var sectionOverride = Activator.CreateInstance(sectionOverrideType) as IProvideConfiguration; + + return sectionOverride.GetConfiguration(); + + + } + + /// + /// Load and return all assemblies in the given directory except the given ones to exclude + /// + /// + /// The exclude must either be the full + /// + public static IEnumerable GetAssembliesInDirectory(string path, params string[] assembliesToSkip) + { + Predicate exclude = + f => assembliesToSkip.Any(skip => distillLowerAssemblyName(skip) == f); + + return FindAssemblies(path, false, null, exclude); + } + + static string distillLowerAssemblyName(string assemblyOrFileName) + { + var lowerAssemblyName = assemblyOrFileName.ToLowerInvariant(); + if (lowerAssemblyName.EndsWith(".dll")) + lowerAssemblyName = lowerAssemblyName.Substring(0, lowerAssemblyName.Length - 4); + return lowerAssemblyName; + } + + + /// + /// Find and return all assemblies in the given directory and the current appdomain + /// filtered to , if given, + /// but except + /// + /// Directory to search in. + /// Shortcut Assembly.Load by instead using yet loaded assemblies. + /// All, if null + /// None, if null + /// + public static IEnumerable FindAssemblies(string path, bool includeAppDomainAssemblies, Predicate includeAssemblyNames, Predicate excludeAssemblyNames) + { + var possiblyChangedExcludePredicate = excludeAssemblyNames; + if (includeAppDomainAssemblies) + { + var yetLoadedMatchingAssemblies = + (from assembly in AppDomain.CurrentDomain.GetAssemblies() + where IsIncluded(assembly.GetName().Name, includeAssemblyNames, excludeAssemblyNames) + select assembly).ToArray(); + + foreach (var a in yetLoadedMatchingAssemblies) + { + yield return a; + } + + Predicate additionalExclude = + name => yetLoadedMatchingAssemblies.Any( + a => IsMatch(a.GetName().Name, name)); + + if (possiblyChangedExcludePredicate != null) + possiblyChangedExcludePredicate = name => additionalExclude(name) || excludeAssemblyNames(name); + else + { + possiblyChangedExcludePredicate = additionalExclude; + } + } + + foreach (var a in GetAssembliesInDirectoryWithExtension(path, "*.exe", includeAssemblyNames, possiblyChangedExcludePredicate)) + yield return a; + foreach (var a in GetAssembliesInDirectoryWithExtension(path, "*.dll", includeAssemblyNames, possiblyChangedExcludePredicate)) + yield return a; + } + + /// + /// Configures the given type with the given lifecycle + /// + /// + /// + /// + public static IComponentConfig Component(DependencyLifecycle lifecycle) + { + if (Instance == null) + throw new InvalidOperationException("You need to call Configure.With() before calling Configure.Component()"); + + return Instance.Configurer.ConfigureComponent(lifecycle); + } + + /// + /// Configures the given type with the given lifecycle + /// + /// + /// + /// + public static IComponentConfig Component(Type type, DependencyLifecycle lifecycle) + { + if (Instance == null) + throw new InvalidOperationException("You need to call Configure.With() before calling Configure.Component()"); + + return Instance.Configurer.ConfigureComponent(type, lifecycle); + } + + /// + /// Configures the given type with the given lifecycle + /// + public static IComponentConfig Component(Func componentFactory, DependencyLifecycle lifecycle) + { + if (Instance == null) + throw new InvalidOperationException("You need to call Configure.With() before calling Configure.Component()"); + + return Instance.Configurer.ConfigureComponent(componentFactory, lifecycle); + } + + /// + /// Returns true if the given component exists in the container + /// + /// + /// + public static bool HasComponent() + { + return HasComponent(typeof(T)); + } + + + /// + /// Returns true if the given component exists in the container + /// + /// + /// + public static bool HasComponent(Type componentType) + { + if (Instance == null) + throw new InvalidOperationException("You need to call Configure.With() before calling Configure.HasComponent"); + + return Instance.Configurer.HasComponent(componentType); + } + + + /// + /// The name of this endpoint + /// + public static string EndpointName + { + get { return GetEndpointNameAction(); } + } + + /// + /// The function used to get the name of this endpoint + /// + public static Func GetEndpointNameAction = () => EndpointHelper.GetDefaultEndpointName(); + + /// + /// The function used to get the version of this endpoint + /// + public static Func DefineEndpointVersionRetriever = () => EndpointHelper.GetEndpointVersion(); + + private static IEnumerable GetAllowedTypes(params Assembly[] assemblies) + { + var types = new List(); + Array.ForEach( + assemblies, + a => + { + try + { + types.AddRange(a.GetTypes() + .Where(t => !t.IsValueType && + (t.FullName == null || + !defaultTypeExclusions.Union(defaultAssemblyExclusions).Any( + exclusion => IsMatch(exclusion, t.FullName))))); + } + catch (ReflectionTypeLoadException e) + { + var sb = new StringBuilder(); + sb.Append(string.Format("Could not scan assembly: {0}. Exception message {1}.", a.FullName, e)); + if (e.LoaderExceptions.Any()) + { + sb.Append(Environment.NewLine + "Scanned type errors: "); + foreach (var ex in e.LoaderExceptions) + sb.Append(Environment.NewLine + ex.Message); + } + LogManager.GetLogger(typeof(Configure)).Warn(sb.ToString()); + //intentionally swallow exception + } + }); + return types; + } + + /// + /// The function used to get the name of this endpoint + /// + public static Func LoadAssembly = s => Assembly.LoadFrom(s.FullName); + + void ActivateAndInvoke(Action action, TimeSpan? thresholdForWarning = null) where T : class + { + if (!thresholdForWarning.HasValue) + thresholdForWarning = TimeSpan.FromSeconds(5); + + var totalTime = new Stopwatch(); + + totalTime.Start(); + + var details = new List>(); + + ForAllTypes(t => + { + var sw = new Stopwatch(); + + sw.Start(); + var instanceToInvoke = (T)Activator.CreateInstance(t); + action(instanceToInvoke); + sw.Stop(); + + details.Add(new Tuple(t, sw.Elapsed)); + }); + + totalTime.Stop(); + + var message = string.Format("Invocation of {0} completed in {1:f2} s", typeof(T).FullName, totalTime.Elapsed.TotalSeconds); + + var logAsWarn = details.Any(d => d.Item2 > thresholdForWarning); + + var detailsMessage = new StringBuilder(); + + detailsMessage.AppendLine(" - Details:"); + + foreach (var detail in details.OrderByDescending(d => d.Item2)) + { + detailsMessage.AppendLine(string.Format("{0} - {1:f4} s", detail.Item1.FullName, detail.Item2.TotalSeconds)); + } + + + if (logAsWarn) + { + Logger.Warn(message + detailsMessage); + } + else + { + Logger.Info(message); + Logger.Debug(detailsMessage.ToString()); + } + } + + + static IEnumerable GetAssembliesInDirectoryWithExtension(string path, string extension, Predicate includeAssemblyNames, Predicate excludeAssemblyNames) + { + var result = new List(); + + foreach (FileInfo file in new DirectoryInfo(path).GetFiles(extension, SearchOption.AllDirectories)) + { + try + { + if (IsIncluded(file.Name, includeAssemblyNames, excludeAssemblyNames)) + { + var loadAssembly = LoadAssembly(file); + if (loadAssembly != null) + { + result.Add(loadAssembly); + } + } + } + catch (BadImageFormatException bif) + { + if (bif.FileName.ToLower().Contains("system.data.sqlite.dll")) + throw new BadImageFormatException( + "You've installed the wrong version of System.Data.SQLite.dll on this machine. If this machine is x86, this dll should be roughly 800KB. If this machine is x64, this dll should be roughly 1MB. You can find the x86 file under /binaries and the x64 version under /binaries/x64. *If you're running the samples, a quick fix would be to copy the file from /binaries/x64 over the file in /binaries - you should 'clean' your solution and rebuild after.", + bif.FileName, bif); + + throw new InvalidOperationException( + "Could not load " + file.FullName + + ". Consider using 'Configure.With(AllAssemblies.Except(\"" + file.Name + "\"))' to tell NServiceBus not to load this file.", + bif); + } + } + + return result; + } + + static bool IsIncluded(string assemblyNameOrFileName, Predicate includeAssemblyNames, Predicate excludeAssemblyNames) + { + + if (includeAssemblyNames != null + && !includeAssemblyNames(assemblyNameOrFileName) + && !defaultAssemblyInclusionOverrides.Any(s => IsMatch(s, assemblyNameOrFileName))) + return false; + + if (defaultAssemblyExclusions.Any(exclusion => IsMatch(exclusion, assemblyNameOrFileName))) + return false; + + if (excludeAssemblyNames != null && excludeAssemblyNames(assemblyNameOrFileName)) + return false; + + return true; + } + + /// + /// Check, if an assembly name matches the given expression. + /// + /// + /// Wildcard. matches 'Wildcard' and Assemblies starting with 'Wildcard.'; + /// Exact matches only "Exact". Casing is generally ignored. + /// + /// The name or file name of the assembly, a full type name or namespace. + /// + public static bool IsMatch(string expression, string scopedNameOrFileName) + { + if (distillLowerAssemblyName(scopedNameOrFileName).StartsWith(expression.ToLower())) + return true; + if (distillLowerAssemblyName(expression).TrimEnd('.') == distillLowerAssemblyName(scopedNameOrFileName)) + return true; + + return false; + } + + static bool IsGenericConfigSource(Type t) + { + if (!t.IsGenericType) + return false; + + var args = t.GetGenericArguments(); + if (args.Length != 1) + return false; + + return typeof(IProvideConfiguration<>).MakeGenericType(args).IsAssignableFrom(t); + } + + static string lastProbeDirectory; + static Configure instance; + static ILog Logger + { + get + { + return LogManager.GetLogger(typeof(Configure)); + } + } + + static readonly IEnumerable defaultAssemblyInclusionOverrides = new[] { "nservicebus." }; + + // TODO: rename to defaultAssemblyAndNamespaceExclusions + static readonly IEnumerable defaultAssemblyExclusions + = new[] + { + + "system.", + + // NSB Build-Dependencies + "nunit.", "pnunit.", "rhino.mocks.","XsdGenerator.", + + // NSB OSS Dependencies + "rhino.licensing.", "bouncycastle.crypto", + "magnum.", "interop.", "nlog.", "newtonsoft.json.", + "common.logging.", "topshelf.", + "Autofac.", "log4net.","nhibernate.", + + // Raven + "raven.server", "raven.client", "raven.munin.", + "raven.storage.", "raven.abstractions.", "raven.database", + "esent.interop", "asyncctplibrary.", "lucene.net.", + "icsharpcode.nrefactory", "spatial4n.core", + + // Azure host process, which is typically referenced for ease of deployment but should not be scanned + "NServiceBus.Hosting.Azure.HostProcess.exe", + + // And other windows azure stuff + "Microsoft.WindowsAzure.", + + // SQLite unmanaged DLLs that cause BadImageFormatException's + "sqlite3.dll", "SQLite.Interop.dll" + }; + + // TODO: rename to additionalTypeExclusions + private static readonly IEnumerable defaultTypeExclusions + = new string[] + { + // defaultAssemblyExclusions will merged inn; specify additional ones here + }; + } +} diff --git a/src/NServiceBus.Core/ConfigureCriticalErrorAction.cs b/src/NServiceBus.Core/ConfigureCriticalErrorAction.cs new file mode 100644 index 00000000000..2de5c9385e7 --- /dev/null +++ b/src/NServiceBus.Core/ConfigureCriticalErrorAction.cs @@ -0,0 +1,73 @@ +namespace NServiceBus +{ + using System; + using Logging; + + /// + /// Allow override critical error action + /// + public static class ConfigureCriticalErrorAction + { + private static Action onCriticalErrorAction = (errorMessage, exception) => + { + if (!Configure.BuilderIsConfigured()) + return; + + if (!Configure.Instance.Configurer.HasComponent()) + return; + + Configure.Instance.Builder.Build() + .Shutdown(); + }; + + /// + /// Sets the function to be used when critical error occurs. + /// + /// The configuration object. + /// Assigns the action to perform on critical error. + /// The configuration object. + public static Configure DefineCriticalErrorAction(this Configure config, + Action onCriticalError) + { + onCriticalErrorAction = onCriticalError; + return config; + } + + /// + /// Execute the configured Critical error action. + /// + /// The configuration object. + /// The error message. + /// The critical exception thrown. + public static void RaiseCriticalError(this Configure config, string errorMessage, Exception exception) + { + LogManager.GetLogger("NServiceBus").Fatal(errorMessage, exception); + + onCriticalErrorAction(errorMessage, exception); + } + + /// + /// Sets the function to be used when critical error occurs + /// + /// The configuration object. + /// Assigns the action to perform on critical error. + /// The configuration object. + [ObsoleteEx(Replacement = "DefineCriticalErrorAction(this Configure config, Action onCriticalError)", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public static Configure DefineCriticalErrorAction(this Configure config, Action onCriticalError) + { + onCriticalErrorAction = (s, exception) => onCriticalError(); + return config; + } + /// + /// Execute the configured Critical error action + /// + /// The configuration object. + /// The configuration object. + [ObsoleteEx(Replacement = "RaiseCriticalError(this Configure config, string errorMessage, Exception exception)", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public static Configure OnCriticalError(this Configure config) + { + onCriticalErrorAction("A critical error occurred.", new Exception()); + return config; + } + } +} \ No newline at end of file diff --git a/src/impl/ObjectBuilder.Common/NServiceBus.ObjectBuilder.DefaultBuilder/Config/ConfigureDefaultBuilder.cs b/src/NServiceBus.Core/ConfigureDefaultBuilder.cs similarity index 87% rename from src/impl/ObjectBuilder.Common/NServiceBus.ObjectBuilder.DefaultBuilder/Config/ConfigureDefaultBuilder.cs rename to src/NServiceBus.Core/ConfigureDefaultBuilder.cs index a8240cc3ccf..ebbf47ac154 100644 --- a/src/impl/ObjectBuilder.Common/NServiceBus.ObjectBuilder.DefaultBuilder/Config/ConfigureDefaultBuilder.cs +++ b/src/NServiceBus.Core/ConfigureDefaultBuilder.cs @@ -1,8 +1,8 @@ -using NServiceBus.ObjectBuilder.Autofac; -using NServiceBus.ObjectBuilder.Common.Config; - namespace NServiceBus { + using ObjectBuilder.Autofac; + using ObjectBuilder.Common.Config; + /// /// Configuration extension for the default builder /// diff --git a/src/distributor/NServiceBus.Distributor/Config/ConfigureDistributor.cs b/src/NServiceBus.Core/ConfigureDistributor.cs similarity index 89% rename from src/distributor/NServiceBus.Distributor/Config/ConfigureDistributor.cs rename to src/NServiceBus.Core/ConfigureDistributor.cs index 3cc7f7c1135..21c98bbf210 100644 --- a/src/distributor/NServiceBus.Distributor/Config/ConfigureDistributor.cs +++ b/src/NServiceBus.Core/ConfigureDistributor.cs @@ -1,128 +1,126 @@ -using System.Configuration; -using System.Globalization; -using System.Linq; -using System.Net; -using log4net; - -namespace NServiceBus -{ - using System; - using Distributor.Config; - using Unicast; - - public static class ConfigureDistributor - { - public static bool DistributorEnabled(this Configure config) - { - return distributorEnabled; - } - public static bool DistributorConfiguredToRunOnThisEndpoint(this Configure config) - { - return distributorEnabled && distributorShouldRunOnThisEndpoint; - } - /// - /// Return whether this endpoint contains a worker - /// - /// - /// - public static bool WorkerRunsOnThisEndpoint(this Configure config) - { - return workerRunsOnThisEndpoint; - } - - /// - /// Configure the distributor to run on this endpoint - /// - /// - /// True if this endpoint should enlist as a worker - /// - public static Configure RunDistributor(this Configure config, bool withWorker = true) - { - distributorEnabled = true; - distributorShouldRunOnThisEndpoint = true; - - DistributorInitializer.Init(withWorker); - - if (withWorker) - { - UnicastBus.WorkerRunsOnThisEndpoint = workerRunsOnThisEndpoint = true; - WorkerInitializer.Init(); - } - - - return config; - } - /// - /// Starting the Distributor without a worker running on its endpoint - /// - /// - /// - public static Configure RunDistributorWithNoWorkerOnItsEndpoint(this Configure config) - { - config.RunDistributor(false); - return config; - } - - - /// - /// Enlist Worker with Master node defined in the config. - /// - /// - /// - public static Configure EnlistWithDistributor(this Configure config) - { - UnicastBus.WorkerRunsOnThisEndpoint = workerRunsOnThisEndpoint = true; - - ValidateMasterNodeConfigurationForWorker(config); - - WorkerInitializer.Init(); - - return config; - } - - private static void ValidateMasterNodeConfigurationForWorker(Configure config) - { - var masterNodeName = config.GetMasterNode(); - - if (masterNodeName == null) - throw new ConfigurationErrorsException( - "When defining Worker profile, 'MasterNodeConfig' section must be defined and the 'Node' entry should point to a valid host name."); - - switch (IsLocalIpAddress(masterNodeName)) - { - case true: - Address.InitializeLocalAddress(Address.Local.SubScope(Guid.NewGuid().ToString()).ToString()); - logger.WarnFormat("'MasterNodeConfig.Node' points to a local host name: [{0}]. Worker input address name is [{1}]. It is randomly and uniquely generated to allow multiple workers working from the same machine as the Distributor.", masterNodeName, Address.Local); - break; - case false: - logger.InfoFormat("'MasterNodeConfig.Node' points to a non-local valid host name: [{0}].", masterNodeName); - break; - case null: - throw new ConfigurationErrorsException( - string.Format("'MasterNodeConfig.Node' entry should point to a valid host name. Currently it is: [{0}].", masterNodeName)); - } - } - - internal static bool? IsLocalIpAddress(string hostName) - { - if (string.IsNullOrWhiteSpace(hostName)) return null; - try - { - var hostIPs = Dns.GetHostAddresses(hostName); - var localIPs = Dns.GetHostAddresses(Dns.GetHostName()); - - if (hostIPs.Any(hostIp => (IPAddress.IsLoopback(hostIp) || (localIPs.Contains(hostIp))))) - return true; - } - catch - { - return null; - } - return false; - } - static bool distributorEnabled; - static bool distributorShouldRunOnThisEndpoint; - static bool workerRunsOnThisEndpoint; - static ILog logger = LogManager.GetLogger("ConfigureDistributor"); - } +namespace NServiceBus +{ + using System; + using System.Configuration; + using System.Linq; + using System.Net; + using Distributor.Config; + using Logging; + + public static class ConfigureDistributor + { + public static bool DistributorEnabled(this Configure config) + { + return distributorEnabled; + } + + public static bool DistributorConfiguredToRunOnThisEndpoint(this Configure config) + { + return distributorEnabled && distributorShouldRunOnThisEndpoint; + } + /// + /// Return whether this endpoint contains a worker + /// + /// + /// + public static bool WorkerRunsOnThisEndpoint(this Configure config) + { + return workerRunsOnThisEndpoint; + } + + /// + /// Configure the distributor to run on this endpoint + /// + /// + /// True if this endpoint should enlist as a worker + /// + public static Configure RunDistributor(this Configure config, bool withWorker = true) + { + distributorEnabled = true; + distributorShouldRunOnThisEndpoint = true; + + DistributorInitializer.Init(withWorker); + + if (withWorker) + { + workerRunsOnThisEndpoint = true; + WorkerInitializer.Init(); + } + + + return config; + } + /// + /// Starting the Distributor without a worker running on its endpoint + /// + /// + /// + public static Configure RunDistributorWithNoWorkerOnItsEndpoint(this Configure config) + { + config.RunDistributor(false); + return config; + } + + + /// + /// Enlist Worker with Master node defined in the config. + /// + /// + /// + public static Configure EnlistWithDistributor(this Configure config) + { + workerRunsOnThisEndpoint = true; + + ValidateMasterNodeConfigurationForWorker(config); + + WorkerInitializer.Init(); + + return config; + } + + private static void ValidateMasterNodeConfigurationForWorker(Configure config) + { + var masterNodeName = config.GetMasterNode(); + + if (masterNodeName == null) + throw new ConfigurationErrorsException( + "When defining Worker profile, 'MasterNodeConfig' section must be defined and the 'Node' entry should point to a valid host name."); + + switch (IsLocalIpAddress(masterNodeName)) + { + case true: + Address.InitializeLocalAddress(Address.Local.SubScope(Guid.NewGuid().ToString()).ToString()); + logger.WarnFormat("'MasterNodeConfig.Node' points to a local host name: [{0}]. Worker input address name is [{1}]. It is randomly and uniquely generated to allow multiple workers working from the same machine as the Distributor.", masterNodeName, Address.Local); + break; + case false: + logger.InfoFormat("'MasterNodeConfig.Node' points to a non-local valid host name: [{0}].", masterNodeName); + break; + case null: + throw new ConfigurationErrorsException( + string.Format("'MasterNodeConfig.Node' entry should point to a valid host name. Currently it is: [{0}].", masterNodeName)); + } + } + + internal static bool? IsLocalIpAddress(string hostName) + { + if (string.IsNullOrWhiteSpace(hostName)) return null; + try + { + var hostIPs = Dns.GetHostAddresses(hostName); + var localIPs = Dns.GetHostAddresses(Dns.GetHostName()); + + if (hostIPs.Any(hostIp => (IPAddress.IsLoopback(hostIp) || (localIPs.Contains(hostIp))))) + return true; + } + catch + { + return null; + } + return false; + } + static bool distributorEnabled; + static bool distributorShouldRunOnThisEndpoint; + static bool workerRunsOnThisEndpoint; + static ILog logger = LogManager.GetLogger(typeof(ConfigureDistributor)); + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/ConfigureFaultsForwarder.cs b/src/NServiceBus.Core/ConfigureFaultsForwarder.cs new file mode 100644 index 00000000000..974a09cf948 --- /dev/null +++ b/src/NServiceBus.Core/ConfigureFaultsForwarder.cs @@ -0,0 +1,93 @@ +namespace NServiceBus +{ + using System.Configuration; + using Config; + using Faults; + using Faults.Forwarder; + using Logging; + using Settings; + using Utils; + + /// + /// Contains extension methods to NServiceBus.Configure + /// + public static class ConfigureFaultsForwarder + { + /// + /// Forward messages that have repeatedly failed to another endpoint. + /// + /// + /// + public static Configure MessageForwardingInCaseOfFault(this Configure config) + { + if (ErrorQueue != null) + { + return config; + } + if (SettingsHolder.Get("Endpoint.SendOnly")) + { + return config; + } + + ErrorQueue = Address.Undefined; + + var section = Configure.GetConfigSection(); + if (section != null) + { + if (string.IsNullOrWhiteSpace(section.ErrorQueue)) + { + throw new ConfigurationErrorsException( + "'MessageForwardingInCaseOfFaultConfig' configuration section is found but 'ErrorQueue' value is missing." + + "\n The following is an example for adding such a value to your app config: " + + "\n \n"); + } + + Logger.Debug("Error queue retrieved from element in config file."); + + ErrorQueue = Address.Parse(section.ErrorQueue); + + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(fm => fm.ErrorQueue, ErrorQueue); + + return config; + } + + + var errorQueue = RegistryReader.Read("ErrorQueue"); + if (!string.IsNullOrWhiteSpace(errorQueue)) + { + Logger.Debug("Error queue retrieved from registry settings."); + ErrorQueue = Address.Parse(errorQueue); + + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(fm => fm.ErrorQueue, ErrorQueue); + } + + if (ErrorQueue == Address.Undefined) + { + throw new ConfigurationErrorsException("Faults forwarding requires an error queue to be specified. Please add a 'MessageForwardingInCaseOfFaultConfig' section to your app.config" + + "\n or configure a global one using the powershell command: Set-NServiceBusLocalMachineSettings -ErrorQueue {address of error queue}"); + } + + return config; + } + + /// + /// The queue to which to forward errors. + /// + public static Address ErrorQueue { get; private set; } + + static readonly ILog Logger = LogManager.GetLogger(typeof(ConfigureFaultsForwarder)); + } + + class Bootstrapper : INeedInitialization + { + public void Init() + { + if (!Configure.Instance.Configurer.HasComponent()) + { + Configure.Instance.MessageForwardingInCaseOfFault(); + } + } + } +} diff --git a/src/NServiceBus.Core/ConfigureFileShareDataBus.cs b/src/NServiceBus.Core/ConfigureFileShareDataBus.cs new file mode 100644 index 00000000000..00f40a4143a --- /dev/null +++ b/src/NServiceBus.Core/ConfigureFileShareDataBus.cs @@ -0,0 +1,27 @@ +namespace NServiceBus +{ + using DataBus; + using DataBus.FileShare; + + /// + /// Contains extension methods to NServiceBus.Configure for the file share data bus + /// + public static class ConfigureFileShareDataBus + { + /// + /// Use the file-based databus implementation with the default binary serializer. + /// + /// The configuration. + /// The location to which to write serialized properties for the databus. + /// The configuration. + public static Configure FileShareDataBus(this Configure config, string basePath) + { + var dataBus = new FileShareDataBus(basePath); + + config.Configurer.RegisterSingleton(dataBus); + + return config; + } + } + +} \ No newline at end of file diff --git a/src/NServiceBus.Core/ConfigureGateway.cs b/src/NServiceBus.Core/ConfigureGateway.cs new file mode 100644 index 00000000000..91d8a4a2727 --- /dev/null +++ b/src/NServiceBus.Core/ConfigureGateway.cs @@ -0,0 +1,77 @@ +namespace NServiceBus +{ + using System; + using Features; + using Gateway.Persistence; + using Gateway.Persistence.Raven; + using Persistence.Raven; + + public static class ConfigureGateway + { + /// + /// The Gateway is turned on by default for the Master role. Call DisableGateway method to turn the Gateway off. + /// + /// + /// + public static Configure DisableGateway(this Configure config) + { + Feature.Disable(); + return config; + } + + /// + /// Configuring to run the Gateway. By default Gateway will use RavenPersistence (see GatewayDefaults class). + /// + /// + /// + public static Configure RunGateway(this Configure config) + { + Feature.Enable(); + + return config; + } + + public static Configure RunGatewayWithInMemoryPersistence(this Configure config) + { + return RunGateway(config, typeof(InMemoryPersistence)); + } + + public static Configure RunGatewayWithRavenPersistence(this Configure config) + { + return RunGateway(config, typeof(RavenDbPersistence)); + } + + public static Configure RunGateway(this Configure config, Type persistence) + { + config.Configurer.ConfigureComponent(persistence, DependencyLifecycle.SingleInstance); + Feature.Enable(); + return config; + } + + /// + /// Use the in memory messages persistence by the gateway. + /// + /// + /// + public static Configure UseInMemoryGatewayPersister(this Configure config) + { + config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + return config; + } + + + /// + /// Use RavenDB messages persistence by the gateway. + /// + /// + /// + public static Configure UseRavenGatewayPersister(this Configure config) + { + if (!config.Configurer.HasComponent()) + config.RavenPersistence(); + + config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + return config; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/ConfigureImpersonation.cs b/src/NServiceBus.Core/ConfigureImpersonation.cs new file mode 100644 index 00000000000..50ed1b71074 --- /dev/null +++ b/src/NServiceBus.Core/ConfigureImpersonation.cs @@ -0,0 +1,47 @@ +namespace NServiceBus +{ + using System.Security.Principal; + using Unicast.Config; + + /// + /// Contains extension methods for the purpose of configuring impersonation. + /// + public static class ConfigureImpersonation + { + /// + /// Impersonate by default, otherwise this configuration would not be backward compatible + /// + static ConfigureImpersonation() + { + Impersonate = true; + } + + /// + /// Instructs the bus to run the processing of messages being handled + /// under the permissions of the sender of the message. + /// + /// + /// + /// + [ObsoleteEx(Message = "This method was incorrectly named, there is no true impersonation, all this method does is populate the current handler thread with an IPrincipal, because of this we decided to rename it to RunHandlersUnderIncomingPrincipal()", RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0")] + public static ConfigUnicastBus ImpersonateSender(this ConfigUnicastBus config, bool value) + { + return config.RunHandlersUnderIncomingPrincipal(value); + } + + /// + /// Instructs the bus to run the processing of messages being handled under the incoming user principal, by default this is a created from the . + /// + /// + /// + /// + public static ConfigUnicastBus RunHandlersUnderIncomingPrincipal(this ConfigUnicastBus config, bool value) + { + Impersonate = value; + + return config; + } + + public static bool Impersonate { get; private set; } + } +} \ No newline at end of file diff --git a/src/impl/faults/NServiceBus.Faults.InMemory.Config/ConfigureInMemoryFaultManagement.cs b/src/NServiceBus.Core/ConfigureInMemoryFaultManagement.cs similarity index 89% rename from src/impl/faults/NServiceBus.Faults.InMemory.Config/ConfigureInMemoryFaultManagement.cs rename to src/NServiceBus.Core/ConfigureInMemoryFaultManagement.cs index fe63201b26c..db2e7de4e1f 100644 --- a/src/impl/faults/NServiceBus.Faults.InMemory.Config/ConfigureInMemoryFaultManagement.cs +++ b/src/NServiceBus.Core/ConfigureInMemoryFaultManagement.cs @@ -1,8 +1,7 @@ -using NServiceBus.Faults.InMemory; -using NServiceBus.ObjectBuilder; - namespace NServiceBus { + using Faults.InMemory; + /// /// Contains extension methods to NServiceBus.Configure /// diff --git a/src/impl/licensing/NServiceBus.Licensing/ConfigureLicenseExtensions.cs b/src/NServiceBus.Core/ConfigureLicenseExtensions.cs similarity index 95% rename from src/impl/licensing/NServiceBus.Licensing/ConfigureLicenseExtensions.cs rename to src/NServiceBus.Core/ConfigureLicenseExtensions.cs index cf48d39ed79..ba852800a8d 100644 --- a/src/impl/licensing/NServiceBus.Licensing/ConfigureLicenseExtensions.cs +++ b/src/NServiceBus.Core/ConfigureLicenseExtensions.cs @@ -1,44 +1,44 @@ -namespace NServiceBus -{ - using System.IO; - using Licensing; - - /// - /// Contains extension methods to configure license. - /// - public static class ConfigureLicenseExtensions - { - /// - /// Allows user to specify the license string. - /// - /// The current . - /// The license text. - /// The current . - public static Configure License(this Configure config, string licenseText) - { - LicenseManager.Parse(licenseText); - - return config; - } - - - /// - /// Allows user to specify the path for the license file. - /// - /// The current . - /// A relative or absolute path to the license file. - /// The current . - public static Configure LicensePath(this Configure config, string licenseFile) - { - - if (!File.Exists(licenseFile)) - { - throw new FileNotFoundException("License file not found", licenseFile); - } - - var licenseText = LicenseManager.ReadAllTextWithoutLocking(licenseFile); - - return config.License(licenseText); - } - } -} \ No newline at end of file +namespace NServiceBus +{ + using System.IO; + using Licensing; + + /// + /// Contains extension methods to configure license. + /// + public static class ConfigureLicenseExtensions + { + /// + /// Allows user to specify the license string. + /// + /// The current . + /// The license text. + /// The current . + public static Configure License(this Configure config, string licenseText) + { + LicenseManager.Parse(licenseText); + + return config; + } + + + /// + /// Allows user to specify the path for the license file. + /// + /// The current . + /// A relative or absolute path to the license file. + /// The current . + public static Configure LicensePath(this Configure config, string licenseFile) + { + + if (!File.Exists(licenseFile)) + { + throw new FileNotFoundException("License file not found", licenseFile); + } + + var licenseText = LicenseManager.ReadAllTextWithoutLocking(licenseFile); + + return config.License(licenseText); + } + } +} diff --git a/src/unicast/NServiceBus.Unicast.Queuing/ConfigurePurging.cs b/src/NServiceBus.Core/ConfigurePurging.cs similarity index 99% rename from src/unicast/NServiceBus.Unicast.Queuing/ConfigurePurging.cs rename to src/NServiceBus.Core/ConfigurePurging.cs index 8a6f94c0167..2b08299ba52 100644 --- a/src/unicast/NServiceBus.Unicast.Queuing/ConfigurePurging.cs +++ b/src/NServiceBus.Core/ConfigurePurging.cs @@ -14,16 +14,16 @@ public static class ConfigurePurging /// /// /// - public static Configure PurgeOnStartup(this Configure config, bool value) - { + public static Configure PurgeOnStartup(this Configure config, bool value) + { PurgeRequested = value; return config; - } - - /// - /// True if the users wants the input queue to be purged when we starts up - /// - public static bool PurgeRequested { get; private set; } + } + + /// + /// True if the users wants the input queue to be purged when we starts up + /// + public static bool PurgeRequested { get; private set; } } } \ No newline at end of file diff --git a/src/NServiceBus.Core/ConfigureQueueCreation.cs b/src/NServiceBus.Core/ConfigureQueueCreation.cs new file mode 100644 index 00000000000..e4afd1e5a0b --- /dev/null +++ b/src/NServiceBus.Core/ConfigureQueueCreation.cs @@ -0,0 +1,22 @@ +namespace NServiceBus +{ + /// + /// Contains extension methods to NServiceBus.Configure. + /// + public static class ConfigureQueueCreation + { + /// + /// If queues configured do not exist, will cause them not to be created on startup. + /// + /// + /// + public static Configure DoNotCreateQueues(this Configure config) + { + DontCreateQueues = true; + + return config; + } + + internal static bool DontCreateQueues { get; private set; } + } +} diff --git a/src/impl/encryption/NServiceBus.Encryption.Rijndael.Config/ConfigureRijndaelEncryptionService.cs b/src/NServiceBus.Core/ConfigureRijndaelEncryptionService.cs similarity index 88% rename from src/impl/encryption/NServiceBus.Encryption.Rijndael.Config/ConfigureRijndaelEncryptionService.cs rename to src/NServiceBus.Core/ConfigureRijndaelEncryptionService.cs index b8e87252457..6ba9beb7477 100644 --- a/src/impl/encryption/NServiceBus.Encryption.Rijndael.Config/ConfigureRijndaelEncryptionService.cs +++ b/src/NServiceBus.Core/ConfigureRijndaelEncryptionService.cs @@ -1,11 +1,10 @@ -using System.Text; -using Common.Logging; -using NServiceBus.Config; -using NServiceBus.Encryption.Rijndael; -using NServiceBus.ObjectBuilder; - namespace NServiceBus { + using System.Text; + using Config; + using Encryption.Rijndael; + using Logging; + /// /// Contains extension methods to NServiceBus.Configure. /// diff --git a/src/NServiceBus.Core/ConfigureSagas.cs b/src/NServiceBus.Core/ConfigureSagas.cs new file mode 100644 index 00000000000..801f10579b5 --- /dev/null +++ b/src/NServiceBus.Core/ConfigureSagas.cs @@ -0,0 +1,25 @@ +namespace NServiceBus +{ + using Features; + + /// + /// Contains extension methods to NServiceBus.Configure. + /// + public static class ConfigureSagas + { + /// + /// Configure this endpoint to support sagas. + /// + /// + /// + [ObsoleteEx(Replacement = "Configure.Features.Enable()", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + public static Configure Sagas(this Configure config) + { + Feature.Enable(); + return config; + } + } + + + +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast.Config/ConfigureUnicastBus.cs b/src/NServiceBus.Core/ConfigureUnicastBus.cs similarity index 75% rename from src/unicast/NServiceBus.Unicast.Config/ConfigureUnicastBus.cs rename to src/NServiceBus.Core/ConfigureUnicastBus.cs index 68db8273a52..7f13dee729a 100644 --- a/src/unicast/NServiceBus.Unicast.Config/ConfigureUnicastBus.cs +++ b/src/NServiceBus.Core/ConfigureUnicastBus.cs @@ -1,52 +1,56 @@ -using NServiceBus.Config; -using NServiceBus.Unicast.Config; - -namespace NServiceBus -{ - using System; - - /// - /// Contains extension methods to NServiceBus.Configure. - /// - public static class ConfigureUnicastBus - { - /// - /// Use unicast messaging (your best option on nServiceBus right now). - /// - /// - /// - public static ConfigUnicastBus UnicastBus(this Configure config) - { - Instance = new ConfigUnicastBus(); - Instance.Configure(config); - - return Instance; - } - /// - /// Return Timeout Manager Address. Uses "TimeoutManagerAddress" parameter form config file if defined, if not, uses "EndpointName.Timeouts". - /// - /// - /// - public static Address GetTimeoutManagerAddress(this Configure config) - { - var unicastConfig = Configure.GetConfigSection(); - - if ((unicastConfig != null) && (!String.IsNullOrWhiteSpace(unicastConfig.TimeoutManagerAddress))) - return Address.Parse(unicastConfig.TimeoutManagerAddress); - - return Address.Parse(Configure.EndpointName).SubScope("Timeouts"); - } - - internal static ConfigUnicastBus Instance { get; private set; } - } - - class EnsureLoadMessageHandlersWasCalled : INeedInitialization - { - void INeedInitialization.Init() - { - if (ConfigureUnicastBus.Instance != null) - if (!ConfigureUnicastBus.Instance.LoadMessageHandlersCalled) - ConfigureUnicastBus.Instance.LoadMessageHandlers(); - } - } -} +namespace NServiceBus +{ + using Config; + using Unicast.Config; + + /// + /// Contains extension methods to NServiceBus.Configure. + /// + public static class ConfigureUnicastBus + { + /// + /// Use unicast messaging (your best option on nServiceBus right now). + /// + /// + /// + public static ConfigUnicastBus UnicastBus(this Configure config) + { + if (Instance == null) + { + Instance = new ConfigUnicastBus(); + Instance.Configure(config); + } + + return Instance; + } + + /// + /// Return Timeout Manager Address. Uses "TimeoutManagerAddress" parameter form config file if defined, if not, uses "EndpointName.Timeouts". + /// + /// + /// + public static Address GetTimeoutManagerAddress(this Configure config) + { + var unicastConfig = Configure.GetConfigSection(); + + if (unicastConfig != null && !string.IsNullOrWhiteSpace(unicastConfig.TimeoutManagerAddress)) + { + return Address.Parse(unicastConfig.TimeoutManagerAddress); + } + + return config.GetMasterNodeAddress().SubScope("Timeouts"); + } + + internal static ConfigUnicastBus Instance { get; private set; } + } + + class EnsureLoadMessageHandlersWasCalled : INeedInitialization + { + public void Init() + { + if (ConfigureUnicastBus.Instance != null) + if (!ConfigureUnicastBus.Instance.LoadMessageHandlersCalled) + ConfigureUnicastBus.Instance.LoadMessageHandlers(); + } + } +} diff --git a/src/NServiceBus.Core/DataBus/Config/Bootstrapper.cs b/src/NServiceBus.Core/DataBus/Config/Bootstrapper.cs new file mode 100644 index 00000000000..96d5dd2f033 --- /dev/null +++ b/src/NServiceBus.Core/DataBus/Config/Bootstrapper.cs @@ -0,0 +1,73 @@ +namespace NServiceBus.DataBus.Config +{ + using System; + using System.Linq; + using NServiceBus.Config; + + public class Bootstrapper : IWantToRunBeforeConfigurationIsFinalized, IWantToRunWhenConfigurationIsComplete + { + static bool dataBusPropertyFound; + + void IWantToRunBeforeConfigurationIsFinalized.Run() + { + if (!Configure.Instance.Configurer.HasComponent() && System.Diagnostics.Debugger.IsAttached) + { + var properties = Configure.TypesToScan + .Where(MessageConventionExtensions.IsMessageType) + .SelectMany(messageType => messageType.GetProperties()) + .Where(MessageConventionExtensions.IsDataBusProperty); + + foreach (var property in properties) + { + dataBusPropertyFound = true; + + if (!property.PropertyType.IsSerializable) + { + throw new InvalidOperationException( + String.Format( + @"The property type for '{0}' is not serializable. +In order to use the databus feature for transporting the data stored in the property types defined in the call '.DefiningDataBusPropertiesAs()', need to be serializable. +To fix this, please mark the property type '{0}' as serializable, see http://msdn.microsoft.com/en-us/library/system.runtime.serialization.iserializable.aspx on how to do this.", + String.Format("{0}.{1}", property.DeclaringType.FullName, property.Name))); + } + } + } + else + { + dataBusPropertyFound = Configure.TypesToScan + .Where(MessageConventionExtensions.IsMessageType) + .SelectMany(messageType => messageType.GetProperties()) + .Any(MessageConventionExtensions.IsDataBusProperty); + } + + if (!dataBusPropertyFound) + { + return; + } + + if (!Configure.Instance.Configurer.HasComponent()) + { + throw new InvalidOperationException("Messages containing databus properties found, please configure a databus!"); + } + + Configure.Instance.Configurer.ConfigureComponent( + DependencyLifecycle.InstancePerCall); + + if (!Configure.Instance.Configurer.HasComponent()) + { + Configure.Instance.Configurer.ConfigureComponent( + DependencyLifecycle.SingleInstance); + } + } + + void IWantToRunWhenConfigurationIsComplete.Run() + { + if (dataBusPropertyFound) + { + Bus.Started += (sender, eventargs) => Configure.Instance.Builder.Build().Start(); + } + } + + public IStartableBus Bus { get; set; } + } +} diff --git a/src/databus/NServiceBus.Databus/DataBusMessageMutator.cs b/src/NServiceBus.Core/DataBus/DataBusMessageMutator.cs similarity index 93% rename from src/databus/NServiceBus.Databus/DataBusMessageMutator.cs rename to src/NServiceBus.Core/DataBus/DataBusMessageMutator.cs index e6491a133a4..89480f8596e 100644 --- a/src/databus/NServiceBus.Databus/DataBusMessageMutator.cs +++ b/src/NServiceBus.Core/DataBus/DataBusMessageMutator.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.DataBus +namespace NServiceBus.DataBus { using System; using System.Collections.Concurrent; @@ -13,7 +13,7 @@ public class DataBusMessageMutator : IMessageMutator { const string DATABUS_PREFIX = "NServiceBus.DataBus."; readonly IDataBus dataBus; - readonly IDataBusSerializer serializer; + readonly IDataBusSerializer serializer; public DataBusMessageMutator(IDataBus dataBus, IDataBusSerializer serializer) { @@ -62,7 +62,7 @@ object IMutateOutgoingMessages.MutateOutgoing(object message) } //we use the headers to in order to allow the infrastructure (eg. the gateway) to modify the actual key - message.SetHeader(DATABUS_PREFIX + headerKey, headerValue); + Headers.SetMessageHeader(message, DATABUS_PREFIX + headerKey, headerValue); } } } @@ -90,9 +90,9 @@ object IMutateIncomingMessages.MutateIncoming(object message) headerKey = String.Format("{0}.{1}", message.GetType().FullName, property.Name); } - var dataBusKey = message.GetHeader(DATABUS_PREFIX + headerKey); - - if (string.IsNullOrEmpty(dataBusKey)) + var dataBusKey = Headers.GetMessageHeader(message, DATABUS_PREFIX + headerKey); + + if (string.IsNullOrEmpty(dataBusKey)) continue; using (var stream = dataBus.Get(dataBusKey)) @@ -120,7 +120,7 @@ static List GetDataBusProperties(object message) if (!cache.ContainsKey(messageType)) cache[messageType] = messageType.GetProperties() - .Where(property => property.IsDataBusProperty()) + .Where(property => MessageConventionExtensions.IsDataBusProperty(property)) .ToList(); return cache[messageType]; @@ -131,8 +131,8 @@ static TimeSpan TimeToBeReceived(object message) if (GetDataBusProperties(message).Count == 0) { return TimeSpan.MaxValue; - } - + } + return MessageConventionExtensions.TimeToBeReceivedAction(message.GetType()); } diff --git a/src/NServiceBus.Core/DataBus/DefaultDatabusSerializer.cs b/src/NServiceBus.Core/DataBus/DefaultDatabusSerializer.cs new file mode 100644 index 00000000000..e2584d40f78 --- /dev/null +++ b/src/NServiceBus.Core/DataBus/DefaultDatabusSerializer.cs @@ -0,0 +1,20 @@ +namespace NServiceBus.DataBus +{ + using System.IO; + using System.Runtime.Serialization.Formatters.Binary; + + public class DefaultDataBusSerializer : IDataBusSerializer + { + private static readonly BinaryFormatter formatter = new BinaryFormatter(); + + public void Serialize(object databusProperty, Stream stream) + { + formatter.Serialize(stream, databusProperty); + } + + public object Deserialize(Stream stream) + { + return formatter.Deserialize(stream); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/DataBus/FileShare/FileShareDataBus.cs b/src/NServiceBus.Core/DataBus/FileShare/FileShareDataBus.cs new file mode 100644 index 00000000000..82e991219b7 --- /dev/null +++ b/src/NServiceBus.Core/DataBus/FileShare/FileShareDataBus.cs @@ -0,0 +1,95 @@ +namespace NServiceBus.DataBus.FileShare +{ + using System; + using System.IO; + using Logging; + + /// + /// File share implementation of . + /// + public class FileShareDataBus : IDataBus + { + readonly string basePath; + private readonly ILog logger = LogManager.GetLogger(typeof(IDataBus)); + + /// + /// Create a with the specified . + /// + /// The path to save files on. + public FileShareDataBus(string basePath) + { + this.basePath = basePath; + } + + /// + /// Gets/Sets the maximum message TTL. + /// + public TimeSpan MaxMessageTimeToLive { get; set; } + + /// + /// Gets a data item from the bus. + /// + /// The key to look for. + /// The data . + public Stream Get(string key) + { + var filePath = Path.Combine(basePath, key); + + logger.DebugFormat("Opening stream from '{0}'.", filePath); + + return new FileStream(filePath, FileMode.Open); + } + + /// + /// Adds a data item to the bus and returns the assigned key. + /// + /// A create containing the data to be sent on the databus. + /// The time to be received specified on the message type. TimeSpan.MaxValue is the default. + public string Put(Stream stream, TimeSpan timeToBeReceived) + { + var key = GenerateKey(timeToBeReceived); + + var filePath = Path.Combine(basePath, key); + + Directory.CreateDirectory(Path.GetDirectoryName(filePath)); + + using (var output = new FileStream(filePath, FileMode.CreateNew)) + { + var buffer = new byte[32 * 1024]; + int read; + + while ((read = stream.Read(buffer, 0, buffer.Length)) > 0) + { + output.Write(buffer, 0, read); + } + } + + logger.DebugFormat("Saved stream to '{0}'.", filePath); + + return key; + } + + /// + /// Called when the bus starts up to allow the data bus to active background tasks. + /// + public void Start() + { + logger.Info("File share data bus started. Location: " + basePath); + + //TODO: Implement a clean up thread + } + + string GenerateKey(TimeSpan timeToBeReceived) + { + if (timeToBeReceived > MaxMessageTimeToLive) + timeToBeReceived = MaxMessageTimeToLive; + + var keepMessageUntil = DateTime.MaxValue; + + if (timeToBeReceived < TimeSpan.MaxValue) + keepMessageUntil = DateTime.Now + timeToBeReceived; + + return Path.Combine(keepMessageUntil.ToString("yyyy-MM-dd_HH"), Guid.NewGuid().ToString()); + } + } +} diff --git a/src/NServiceBus.Core/DataBus/IDataBus.cs b/src/NServiceBus.Core/DataBus/IDataBus.cs new file mode 100644 index 00000000000..90d5cf3fca6 --- /dev/null +++ b/src/NServiceBus.Core/DataBus/IDataBus.cs @@ -0,0 +1,30 @@ +namespace NServiceBus.DataBus +{ + using System; + using System.IO; + + /// + /// The main interface for interactions with the databus. + /// + public interface IDataBus + { + /// + /// Gets a data item from the bus. + /// + /// The key to look for. + /// The data . + Stream Get(string key); + + /// + /// Adds a data item to the bus and returns the assigned key. + /// + /// A create containing the data to be sent on the databus. + /// The time to be received specified on the message type. TimeSpan.MaxValue is the default. + string Put(Stream stream, TimeSpan timeToBeReceived); + + /// + /// Called when the bus starts up to allow the data bus to active background tasks. + /// + void Start(); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/DataBus/IDatabusSerializer.cs b/src/NServiceBus.Core/DataBus/IDatabusSerializer.cs new file mode 100644 index 00000000000..4edf2e7e788 --- /dev/null +++ b/src/NServiceBus.Core/DataBus/IDatabusSerializer.cs @@ -0,0 +1,24 @@ +namespace NServiceBus.DataBus +{ + using System.IO; + + /// + /// Interface used for serializing and deserializing of databus properties. + /// + public interface IDataBusSerializer + { + /// + /// Serializes the property into the given stream. + /// + /// The property to serialize. + /// The stream to which to write the property.> + void Serialize(object databusProperty, Stream stream); + + /// + /// Deserializes a property from the given stream. + /// + /// The stream from which to read the property. + /// The deserialized object. + object Deserialize(Stream stream); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/DataBus/InMemory/InMemoryDataBus.cs b/src/NServiceBus.Core/DataBus/InMemory/InMemoryDataBus.cs new file mode 100644 index 00000000000..a5b19cd8d0d --- /dev/null +++ b/src/NServiceBus.Core/DataBus/InMemory/InMemoryDataBus.cs @@ -0,0 +1,67 @@ +namespace NServiceBus.DataBus.InMemory +{ + using System; + using System.Collections.Generic; + using System.IO; + + /// + /// In memory implementation of . + /// + public class InMemoryDataBus : IDataBus + { + private readonly IDictionary storage = new Dictionary(); + + /// + /// Gets a data item from the bus. + /// + /// The key to look for. + /// The data . + public Stream Get(string key) + { + lock (storage) + return new MemoryStream(storage[key].Data); + } + + /// + /// Adds a data item to the bus and returns the assigned key. + /// + /// A create containing the data to be sent on the databus. + /// The time to be received specified on the message type. TimeSpan.MaxValue is the default. + public string Put(Stream stream, TimeSpan timeToBeReceived) + { + var key = Guid.NewGuid().ToString(); + + var data = new byte[stream.Length]; + stream.Read(data, 0, (int)stream.Length); + + lock (storage) + storage.Add(key, new Entry + { + Data = data, + ExpireAt = DateTime.Now + timeToBeReceived + }); + return key; + } + + /// + /// Called when the bus starts up to allow the data bus to active background tasks. + /// + public void Start() + { + //no-op + } + + //used for test purposes + public Entry Peek(string key) + { + lock (storage) + return storage[key]; + } + + public class Entry + { + public byte[] Data; + public DateTime ExpireAt; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/DateTimeExtensions.cs b/src/NServiceBus.Core/DateTimeExtensions.cs new file mode 100644 index 00000000000..1a00b6a8de0 --- /dev/null +++ b/src/NServiceBus.Core/DateTimeExtensions.cs @@ -0,0 +1,31 @@ +namespace NServiceBus +{ + using System; + using System.Globalization; + + /// + /// Common date time extensions + /// + public static class DateTimeExtensions + { + const string Format = "yyyy-MM-dd HH:mm:ss:ffffff Z"; + + /// + /// Converts the to a suitable for transport over the wire + /// + /// + public static string ToWireFormattedString(DateTime dateTime) + { + return dateTime.ToUniversalTime().ToString(Format, CultureInfo.InvariantCulture); + } + + /// + /// Converts a wire formatted from to a UTC + /// + /// + public static DateTime ToUtcDateTime(string wireFormattedString) + { + return DateTime.ParseExact(wireFormattedString, Format, CultureInfo.InvariantCulture).ToUniversalTime(); + } + } +} diff --git a/src/ObjectBuilder/DependencyLifecycle.cs b/src/NServiceBus.Core/DependencyLifecycle.cs similarity index 84% rename from src/ObjectBuilder/DependencyLifecycle.cs rename to src/NServiceBus.Core/DependencyLifecycle.cs index a571b08f42c..b2faabd8f5b 100644 --- a/src/ObjectBuilder/DependencyLifecycle.cs +++ b/src/NServiceBus.Core/DependencyLifecycle.cs @@ -1,9 +1,7 @@ -using System; - namespace NServiceBus { /// - /// Represent the various lifecycles available for coponents configured in the container + /// Represent the various lifecycles available for components configured in the container. /// public enum DependencyLifecycle { diff --git a/src/NServiceBus.Core/Distributor/Config/DistributorInitializer.cs b/src/NServiceBus.Core/Distributor/Config/DistributorInitializer.cs new file mode 100644 index 00000000000..4d153e7b9fb --- /dev/null +++ b/src/NServiceBus.Core/Distributor/Config/DistributorInitializer.cs @@ -0,0 +1,32 @@ +namespace NServiceBus.Distributor.Config +{ + using Logging; + using Transports.Msmq.WorkerAvailabilityManager; + using Unicast; + + public class DistributorInitializer + { + public static void Init(bool withWorker) + { + var config = Configure.Instance; + + var applicativeInputQueue = Address.Local.SubScope("worker"); + + config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance) + .ConfigureProperty(r => r.InputAddress, applicativeInputQueue) + .ConfigureProperty(r => r.DoNotStartTransport, !withWorker); + + if (!config.Configurer.HasComponent()) + { + config.Configurer.ConfigureComponent( + DependencyLifecycle.SingleInstance) + .ConfigureProperty(r => r.StorageQueueAddress, Address.Local.SubScope("distributor.storage")); + } + + Logger.InfoFormat("Endpoint configured to host the distributor, applicative input queue re routed to {0}", + applicativeInputQueue); + } + + static readonly ILog Logger = LogManager.GetLogger("NServiceBus.Distributor." + Configure.EndpointName); + } +} \ No newline at end of file diff --git a/src/distributor/NServiceBus.Distributor/Config/WorkerInitializer.cs b/src/NServiceBus.Core/Distributor/Config/WorkerInitializer.cs similarity index 97% rename from src/distributor/NServiceBus.Distributor/Config/WorkerInitializer.cs rename to src/NServiceBus.Core/Distributor/Config/WorkerInitializer.cs index 8be824bdb25..ad8574b214e 100644 --- a/src/distributor/NServiceBus.Distributor/Config/WorkerInitializer.cs +++ b/src/NServiceBus.Core/Distributor/Config/WorkerInitializer.cs @@ -1,30 +1,30 @@ -namespace NServiceBus.Distributor.Config -{ - using NServiceBus.Config; - using ReadyMessages; - - public class WorkerInitializer - { - public static void Init() - { - var config = Configure.Instance; - - var masterNodeAddress = config.GetMasterNodeAddress(); - - var distributorControlAddress = masterNodeAddress.SubScope("distributor.control"); - - var unicastBusConfig = Configure.GetConfigSection(); - - //allow users to override control address in config - if (unicastBusConfig != null && !string.IsNullOrWhiteSpace(unicastBusConfig.DistributorControlAddress)) - distributorControlAddress = Address.Parse(unicastBusConfig.DistributorControlAddress); - - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance) - .ConfigureProperty(p => p.DistributorControlAddress, distributorControlAddress); - - config.Configurer.ConfigureComponent( - DependencyLifecycle.SingleInstance) - .ConfigureProperty(r => r.DistributorDataAddress, masterNodeAddress); - } - } +namespace NServiceBus.Distributor.Config +{ + using NServiceBus.Config; + using ReadyMessages; + + public class WorkerInitializer + { + public static void Init() + { + var config = Configure.Instance; + + var masterNodeAddress = config.GetMasterNodeAddress(); + + var distributorControlAddress = masterNodeAddress.SubScope("distributor.control"); + + var unicastBusConfig = Configure.GetConfigSection(); + + //allow users to override control address in config + if (unicastBusConfig != null && !string.IsNullOrWhiteSpace(unicastBusConfig.DistributorControlAddress)) + distributorControlAddress = Address.Parse(unicastBusConfig.DistributorControlAddress); + + config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance) + .ConfigureProperty(p => p.DistributorControlAddress, distributorControlAddress); + + config.Configurer.ConfigureComponent( + DependencyLifecycle.SingleInstance) + .ConfigureProperty(r => r.DistributorDataAddress, masterNodeAddress); + } + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Distributor/DistributorReadyMessageProcessor.cs b/src/NServiceBus.Core/Distributor/DistributorReadyMessageProcessor.cs new file mode 100644 index 00000000000..d3b1d1a4d25 --- /dev/null +++ b/src/NServiceBus.Core/Distributor/DistributorReadyMessageProcessor.cs @@ -0,0 +1,109 @@ +namespace NServiceBus.Distributor +{ + using System; + using Logging; + using ReadyMessages; + using Satellites; + using Unicast.Transport; + + /// + /// Part of the Distributor infrastructure. + /// + public class DistributorReadyMessageProcessor : IAdvancedSatellite + { + private static readonly ILog Logger = LogManager.GetLogger("NServiceBus.Distributor." + Configure.EndpointName); + private static readonly Address Address; + private static readonly bool Disable; + + static DistributorReadyMessageProcessor() + { + Address = Configure.Instance.GetMasterNodeAddress().SubScope("distributor.control"); + Disable = !Configure.Instance.DistributorConfiguredToRunOnThisEndpoint(); + } + + /// + /// Sets the implementation that will be + /// used to determine whether or not a worker is available. + /// + public IWorkerAvailabilityManager WorkerAvailabilityManager { get; set; } + + /// + /// This method is called when a message is available to be processed. + /// + /// + /// The received. + /// + public bool Handle(TransportMessage message) + { + if (!message.IsControlMessage()) + return true; + + HandleControlMessage(message); + + return true; + } + + /// + /// The for this to use when receiving messages. + /// + public Address InputAddress + { + get { return Address; } + } + + /// + /// Set to true to disable this . + /// + public bool Disabled + { + get { return Disable; } + } + + /// + /// Starts the . + /// + public void Start() + { + } + + /// + /// Stops the . + /// + public void Stop() + { + } + + public Action GetReceiverCustomization() + { + return receiver => + { + //we don't need any DTC for the distributor + receiver.TransactionSettings.DontUseDistributedTransactions = true; + receiver.TransactionSettings.DoNotWrapHandlersExecutionInATransactionScope = true; + }; + } + + private void HandleControlMessage(TransportMessage controlMessage) + { + Address replyToAddress = controlMessage.ReplyToAddress; + + if (LicenseConfig.LimitNumberOfWorkers(replyToAddress)) + return; + + if (controlMessage.Headers.ContainsKey(Headers.WorkerStarting)) + { + WorkerAvailabilityManager.ClearAvailabilityForWorker(replyToAddress); + Logger.InfoFormat("Worker {0} has started up, clearing previous reported capacity", replyToAddress); + } + + if (controlMessage.Headers.ContainsKey(Headers.WorkerCapacityAvailable)) + { + int capacity = int.Parse(controlMessage.Headers[Headers.WorkerCapacityAvailable]); + + WorkerAvailabilityManager.WorkerAvailable(replyToAddress, capacity); + + Logger.InfoFormat("Worker {0} checked in with available capacity: {1}", replyToAddress, capacity); + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Distributor/DistributorSatellite.cs b/src/NServiceBus.Core/Distributor/DistributorSatellite.cs new file mode 100644 index 00000000000..a47c88c527a --- /dev/null +++ b/src/NServiceBus.Core/Distributor/DistributorSatellite.cs @@ -0,0 +1,96 @@ +namespace NServiceBus.Distributor +{ + using System; + using Logging; + using Satellites; + using Transports; + using Unicast.Transport; + + /// + /// Provides functionality for distributing messages from a bus + /// to multiple workers when using a unicast transport. + /// + public class DistributorSatellite : IAdvancedSatellite + { + static DistributorSatellite() + { + Address = Configure.Instance.GetMasterNodeAddress(); + Disable = !Configure.Instance.DistributorConfiguredToRunOnThisEndpoint(); + } + + /// + /// Object used to send messages. + /// + public ISendMessages MessageSender { get; set; } + + /// + /// Sets the implementation that will be + /// used to determine whether or not a worker is available. + /// + public IWorkerAvailabilityManager WorkerManager { get; set; } + + /// + /// The for this to use when receiving messages. + /// + public Address InputAddress + { + get { return Address; } + } + + /// + /// Set to true to disable this . + /// + public bool Disabled + { + get { return Disable; } + } + + /// + /// Starts the Distributor. + /// + public void Start() + { + WorkerManager.Start(); + } + + /// + /// Stops the Distributor. + /// + public void Stop() + { + WorkerManager.Stop(); + } + + public Action GetReceiverCustomization() + { + return receiver => + { + //we don't need any DTC for the distributor + receiver.TransactionSettings.DontUseDistributedTransactions = true; + receiver.TransactionSettings.DoNotWrapHandlersExecutionInATransactionScope = true; + }; + } + + /// + /// This method is called when a message is available to be processed. + /// + /// The received. + public bool Handle(TransportMessage message) + { + var destination = WorkerManager.PopAvailableWorker(); + + if (destination == null) + return false; + + Logger.Debug("Sending message to: " + destination); + MessageSender.Send(message, destination); + + return true; + } + + static readonly ILog Logger = LogManager.GetLogger(typeof(DistributorSatellite)); + + static readonly Address Address; + static readonly bool Disable; + } +} \ No newline at end of file diff --git a/src/distributor/NServiceBus.Unicast.Distributor/IWorkerAvailabilityManager.cs b/src/NServiceBus.Core/Distributor/IWorkerAvailabilityManager.cs similarity index 85% rename from src/distributor/NServiceBus.Unicast.Distributor/IWorkerAvailabilityManager.cs rename to src/NServiceBus.Core/Distributor/IWorkerAvailabilityManager.cs index 406033de509..3694276e91a 100644 --- a/src/distributor/NServiceBus.Unicast.Distributor/IWorkerAvailabilityManager.cs +++ b/src/NServiceBus.Core/Distributor/IWorkerAvailabilityManager.cs @@ -1,23 +1,28 @@ -namespace NServiceBus.Unicast.Distributor +namespace NServiceBus.Distributor { /// /// Defines a manager class that determines the availability - /// of a worker for the . + /// of a worker for the . /// public interface IWorkerAvailabilityManager { /// /// Start the worker availability manager /// - void Start(); - - /// - /// Signal that a worker is available to receive a dispatched message. - /// - /// - /// The address of the worker that will accept the dispatched message. - /// - /// The number of messages that this worker is ready to process + void Start(); + + /// + /// Stops the worker availability manager + /// + void Stop(); + + /// + /// Signal that a worker is available to receive a dispatched message. + /// + /// + /// The address of the worker that will accept the dispatched message. + /// + /// The number of messages that this worker is ready to process void WorkerAvailable(Address address,int capacity); /// diff --git a/src/NServiceBus.Core/Distributor/LicenseConfig.cs b/src/NServiceBus.Core/Distributor/LicenseConfig.cs new file mode 100644 index 00000000000..6f3e58b0c21 --- /dev/null +++ b/src/NServiceBus.Core/Distributor/LicenseConfig.cs @@ -0,0 +1,39 @@ +namespace NServiceBus.Distributor +{ + using System.Collections.Concurrent; + using System.Linq; + using Licensing; + using Logging; + using Configure = NServiceBus.Configure; + + /// + /// Limit number of workers in accordance with Licensing policy + /// + public static class LicenseConfig + { + private static readonly ILog Logger = LogManager.GetLogger("NServiceBus.Distributor." + Configure.EndpointName); + private static readonly int allowedWorkerNodes; + private static readonly ConcurrentBag
    WorkersList = new ConcurrentBag
    (); + + static LicenseConfig() + { + allowedWorkerNodes = LicenseManager.CurrentLicense.AllowedNumberOfWorkerNodes; + } + + internal static bool LimitNumberOfWorkers(Address workerAddress) + { + if (WorkersList.Contains(workerAddress)) + return false; + + if (WorkersList.Count < allowedWorkerNodes) + { + WorkersList.Add(workerAddress); + return false; + } + Logger.WarnFormat( + "License limitation for [{0}] workers per distributor reached. To obtain a license that allows to add more workers, please visit http://particular.net/licensing", + allowedWorkerNodes); + return true; + } + } +} diff --git a/src/NServiceBus.Core/Distributor/QueueCreators/WorkerQueueCreator.cs b/src/NServiceBus.Core/Distributor/QueueCreators/WorkerQueueCreator.cs new file mode 100644 index 00000000000..5dce686a806 --- /dev/null +++ b/src/NServiceBus.Core/Distributor/QueueCreators/WorkerQueueCreator.cs @@ -0,0 +1,25 @@ +namespace NServiceBus.Distributor.QueueCreators +{ + using Unicast.Queuing; + + /// + /// Signal to create the queue for a worker + /// + public class WorkerQueueCreator : IWantQueueCreated + { + /// + /// Address of worker queue + /// + public Address Address + { + get { return Address.Local.SubScope("Worker"); } + } + /// + /// Disabling the creation of the worker queue + /// + public bool IsDisabled + { + get {return !((Configure.Instance.DistributorConfiguredToRunOnThisEndpoint()) && (Configure.Instance.WorkerRunsOnThisEndpoint()));} + } + } +} diff --git a/src/NServiceBus.Core/Distributor/ReadyMessages/Headers.cs b/src/NServiceBus.Core/Distributor/ReadyMessages/Headers.cs new file mode 100644 index 00000000000..51f2360823f --- /dev/null +++ b/src/NServiceBus.Core/Distributor/ReadyMessages/Headers.cs @@ -0,0 +1,8 @@ +namespace NServiceBus.Distributor.ReadyMessages +{ + public struct Headers + { + public static string WorkerCapacityAvailable = "NServiceBus.Distributor.WorkerCapacityAvailable"; + public static string WorkerStarting = "NServiceBus.Distributor.WorkerStarting"; + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Distributor/ReadyMessages/ReadyMessageSender.cs b/src/NServiceBus.Core/Distributor/ReadyMessages/ReadyMessageSender.cs new file mode 100644 index 00000000000..f31d397863a --- /dev/null +++ b/src/NServiceBus.Core/Distributor/ReadyMessages/ReadyMessageSender.cs @@ -0,0 +1,52 @@ +namespace NServiceBus.Distributor.ReadyMessages +{ + using System; + using Transports; + using Unicast; + using Unicast.Queuing; + using Unicast.Transport; + + public class ReadyMessageSender : IWantToRunWhenBusStartsAndStops + { + public ISendMessages MessageSender { get; set; } + + public UnicastBus Bus { get; set; } + + public Address DistributorControlAddress { get; set; } + + public void Start() + { + if (!Configure.Instance.WorkerRunsOnThisEndpoint()) + return; + + var capacityAvailable = Bus.Transport.MaximumConcurrencyLevel; + SendReadyMessage(capacityAvailable, true); + + Bus.Transport.FinishedMessageProcessing += TransportOnFinishedMessageProcessing; + } + + public void Stop() + { + Bus.Transport.FinishedMessageProcessing -= TransportOnFinishedMessageProcessing; + } + + void TransportOnFinishedMessageProcessing(object sender, EventArgs eventArgs) + { + //if there was a failure this "send" will be rolled back + SendReadyMessage(); + } + + void SendReadyMessage(int capacityAvailable = 1, bool isStarting = false) + { + //we use the actual address to make sure that the worker inside the masternode will check in correctly + var readyMessage = ControlMessage.Create(Bus.InputAddress); + + readyMessage.Headers.Add(Headers.WorkerCapacityAvailable, capacityAvailable.ToString()); + + if (isStarting) + readyMessage.Headers.Add(Headers.WorkerStarting, Boolean.TrueString); + + MessageSender.Send(readyMessage, DistributorControlAddress); + } + } +} diff --git a/src/distributor/NServiceBus.Distributor/ReadyMessages/ReturnAddressRewriter.cs b/src/NServiceBus.Core/Distributor/ReadyMessages/ReturnAddressRewriter.cs similarity index 78% rename from src/distributor/NServiceBus.Distributor/ReadyMessages/ReturnAddressRewriter.cs rename to src/NServiceBus.Core/Distributor/ReadyMessages/ReturnAddressRewriter.cs index 10330b3b348..90c2d22c626 100644 --- a/src/distributor/NServiceBus.Distributor/ReadyMessages/ReturnAddressRewriter.cs +++ b/src/NServiceBus.Core/Distributor/ReadyMessages/ReturnAddressRewriter.cs @@ -1,8 +1,7 @@ -namespace NServiceBus.Distributor.ReadyMessages -{ - using NServiceBus.MessageMutator; - using NServiceBus.Unicast.Transport; - +namespace NServiceBus.Distributor.ReadyMessages +{ + using MessageMutator; + class ReturnAddressRewriter : IMutateOutgoingTransportMessages { public Address DistributorDataAddress { get; set; } diff --git a/src/NServiceBus.Core/Encryption/Bootstrapper.cs b/src/NServiceBus.Core/Encryption/Bootstrapper.cs new file mode 100644 index 00000000000..6d94e2bfd06 --- /dev/null +++ b/src/NServiceBus.Core/Encryption/Bootstrapper.cs @@ -0,0 +1,10 @@ +namespace NServiceBus.Encryption +{ + class Bootstrapper : INeedInitialization + { + public void Init() + { + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + } + } +} diff --git a/src/NServiceBus.Core/Encryption/Config/ConfigureEncryption.cs b/src/NServiceBus.Core/Encryption/Config/ConfigureEncryption.cs new file mode 100644 index 00000000000..fe1c4099a65 --- /dev/null +++ b/src/NServiceBus.Core/Encryption/Config/ConfigureEncryption.cs @@ -0,0 +1,15 @@ +namespace NServiceBus.Encryption.Config +{ + public static class ConfigureEncryption + { + /// + /// Causes the endpoint to no longer send extra data to make encryption compatible with NSB 2.X + /// + /// + [ObsoleteEx(Message = "Not supported anymore.", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public static Configure DisableCompatibilityWithNSB2(this Configure config) + { + return config; + } + } +} \ No newline at end of file diff --git a/src/encryption/NServiceBus.Encryption/EncryptionMessageMutator.cs b/src/NServiceBus.Core/Encryption/EncryptionMessageMutator.cs similarity index 85% rename from src/encryption/NServiceBus.Encryption/EncryptionMessageMutator.cs rename to src/NServiceBus.Core/Encryption/EncryptionMessageMutator.cs index 660a022360a..55a1ae6c0d4 100644 --- a/src/encryption/NServiceBus.Encryption/EncryptionMessageMutator.cs +++ b/src/NServiceBus.Core/Encryption/EncryptionMessageMutator.cs @@ -1,297 +1,285 @@ -using System; -using System.Linq; -using Common.Logging; -using NServiceBus.MessageMutator; - -namespace NServiceBus.Encryption -{ - using System.Collections; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Reflection; - using Config; - - /// - /// Invokes the encryption service to encrypt/decrypt messages - /// - public class EncryptionMessageMutator : IMessageMutator - { - public IEncryptionService EncryptionService { get; set; } - - public object MutateOutgoing(object message) - { - ForEachMember(message, EncryptMember, IsEncryptedMember); - - return message; - } - - public object MutateIncoming(object message) - { - ForEachMember(message, DecryptMember, IsEncryptedMember); - - return message; - } - - static bool IsIndexedProperty(MemberInfo member) - { - var propertyInfo = member as PropertyInfo; - - if (propertyInfo != null) - { - return propertyInfo.GetIndexParameters().Length > 0; - } - - return false; - } - - static bool IsEncryptedMember(MemberInfo arg) - { - - var propertyInfo = arg as PropertyInfo; - if (propertyInfo != null) - { - if (propertyInfo.GetIndexParameters().Length > 0) - { - if (propertyInfo.IsEncryptedProperty()) - { - throw new NotSupportedException("Cannot encrypt or decrypt indexed properties that return a WireEncryptedString."); - } - - return false; - } - - return propertyInfo.IsEncryptedProperty(); - } - - var fieldInfo = arg as FieldInfo; - if (fieldInfo != null) - { - return fieldInfo.FieldType == typeof(WireEncryptedString); - } - - return false; - } - - void ForEachMember(object root, Action action, Func appliesTo) - { - if (root == null || visitedMembers.Contains(root)) - return; - - visitedMembers.Add(root); - - var members = GetFieldsAndProperties(root); - - foreach (var member in members) - { - if (appliesTo(member)) - { - action(root, member); - } - - //don't recurse over primitives or system types - if (member.ReflectedType.IsPrimitive || member.ReflectedType.IsSystemType()) - continue; - - if (IsIndexedProperty(member)) - continue; - - var child = member.GetValue(root); - - var items = child as IEnumerable; - if (items != null) - { - foreach (var item in items) - { - //don't recurse over primitives or system types - if (item.GetType().IsPrimitive || item.GetType().IsSystemType()) - break; - - ForEachMember(item, action, appliesTo); - } - } - else - { - ForEachMember(child, action, appliesTo); - } - } - } - - void EncryptMember(object target, MemberInfo member) - { - var valueToEncrypt = member.GetValue(target); - - if (valueToEncrypt == null) - return; - - if (EncryptionService == null) - throw new InvalidOperationException( - String.Format("Cannot encrypt field {0} because no encryption service was configured.", - member.Name)); - - if (valueToEncrypt is WireEncryptedString) - { - var encryptedString = (WireEncryptedString)valueToEncrypt; - EncryptWireEncryptedString(encryptedString); - - if (!ConfigureEncryption.EnsureCompatibilityWithNSB2) - { - //we clear the properties to avoid having the extra data serialized - encryptedString.EncryptedBase64Value = null; - encryptedString.Base64Iv = null; - } - } - else - { - member.SetValue(target, EncryptUserSpecifiedProperty(valueToEncrypt)); - } - - Log.Debug(member.Name + " encrypted successfully"); - } - - void DecryptMember(object target, MemberInfo property) - { - var encryptedValue = property.GetValue(target); - - if (encryptedValue == null) - return; - - if (EncryptionService == null) - throw new InvalidOperationException( - String.Format("Cannot decrypt field {0} because no encryption service was configured.", property.Name)); - - if (encryptedValue is WireEncryptedString) - { - Decrypt((WireEncryptedString)encryptedValue); - } - else - { - property.SetValue(target, DecryptUserSpecifiedProperty(encryptedValue)); - } - - Log.Debug(property.Name + " decrypted successfully"); - } - - string DecryptUserSpecifiedProperty(object encryptedValue) - { - var stringToDecrypt = encryptedValue as string; - - if (stringToDecrypt == null) - throw new InvalidOperationException("Only string properties is supported for convention based encryption, please check your convention"); - - var parts = stringToDecrypt.Split(new[] { '@' }, StringSplitOptions.None); - - return EncryptionService.Decrypt(new EncryptedValue - { - EncryptedBase64Value = parts[0], - Base64Iv = parts[1] - }); - } - - void Decrypt(WireEncryptedString encryptedValue) - { - if (encryptedValue.EncryptedValue == null) - throw new InvalidOperationException("Encrypted property is missing encryption data"); - - encryptedValue.Value = EncryptionService.Decrypt(encryptedValue.EncryptedValue); - } - - string EncryptUserSpecifiedProperty(object valueToEncrypt) - { - var stringToEncrypt = valueToEncrypt as string; - - if (stringToEncrypt == null) - throw new InvalidOperationException("Only string properties is supported for convention based encryption, please check your convention"); - - var encryptedValue = EncryptionService.Encrypt(stringToEncrypt); - - return string.Format("{0}@{1}", encryptedValue.EncryptedBase64Value, encryptedValue.Base64Iv); - } - - void EncryptWireEncryptedString(WireEncryptedString wireEncryptedString) - { - wireEncryptedString.EncryptedValue = EncryptionService.Encrypt(wireEncryptedString.Value); - wireEncryptedString.Value = null; - - } - static IEnumerable GetFieldsAndProperties(object target) - { - if (target == null) - { - return new List(); - } - - var messageType = target.GetType(); - - if (!cache.ContainsKey(messageType)) - { - cache[messageType] = messageType.GetMembers(BindingFlags.Public | BindingFlags.Instance) - .Where(m => m is FieldInfo || m is PropertyInfo) - .ToList(); - } - - return cache[messageType]; - } - - readonly HashSet visitedMembers = new HashSet(); - - readonly static IDictionary> cache = new ConcurrentDictionary>(); - - readonly static ILog Log = LogManager.GetLogger(typeof(IEncryptionService)); - } - - - static class TypeExtensions - { - private static readonly byte[] MsPublicKeyToken = typeof(string).Assembly.GetName().GetPublicKeyToken(); - - static bool IsClrType(byte[] a1) - { - IStructuralEquatable eqa1 = a1; - return eqa1.Equals(MsPublicKeyToken, StructuralComparisons.StructuralEqualityComparer); - } - - public static bool IsSystemType(this Type propertyType) - { - var nameOfContainingAssembly = propertyType.Assembly.GetName().GetPublicKeyToken(); - - return IsClrType(nameOfContainingAssembly); - } - } - - static class MemberInfoExtensions - { - public static object GetValue(this MemberInfo member, object source) - { - if (member is FieldInfo) - { - return ((FieldInfo)member).GetValue(source); - } - - var propertyInfo = (PropertyInfo) member; - - if (!propertyInfo.CanRead) - { - if (propertyInfo.PropertyType.IsValueType) - { - return Activator.CreateInstance(propertyInfo.PropertyType); - } - - return null; - } - - return propertyInfo.GetValue(source, null); - } - - public static void SetValue(this MemberInfo member, object target, object value) - { - if (member is FieldInfo) - { - ((FieldInfo)member).SetValue(target, value); - } - else - { - ((PropertyInfo)member).SetValue(target, value, null); - } - } - } -} \ No newline at end of file +namespace NServiceBus.Encryption +{ + using System; + using System.Collections; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + using Logging; + using MessageMutator; + using Utils.Reflection; + + /// + /// Invokes the encryption service to encrypt/decrypt messages + /// + public class EncryptionMessageMutator : IMessageMutator + { + public IEncryptionService EncryptionService { get; set; } + + public object MutateOutgoing(object message) + { + ForEachMember(message, EncryptMember, IsEncryptedMember); + + return message; + } + + public object MutateIncoming(object message) + { + ForEachMember(message, DecryptMember, IsEncryptedMember); + + return message; + } + + static bool IsIndexedProperty(MemberInfo member) + { + var propertyInfo = member as PropertyInfo; + + if (propertyInfo != null) + { + return propertyInfo.GetIndexParameters().Length > 0; + } + + return false; + } + + static bool IsEncryptedMember(MemberInfo arg) + { + + var propertyInfo = arg as PropertyInfo; + if (propertyInfo != null) + { + if (propertyInfo.GetIndexParameters().Length > 0) + { + if (MessageConventionExtensions.IsEncryptedProperty(propertyInfo)) + { + throw new NotSupportedException("Cannot encrypt or decrypt indexed properties that return a WireEncryptedString."); + } + + return false; + } + + return MessageConventionExtensions.IsEncryptedProperty(propertyInfo); + } + + var fieldInfo = arg as FieldInfo; + if (fieldInfo != null) + { + return fieldInfo.FieldType == typeof(WireEncryptedString); + } + + return false; + } + + void ForEachMember(object root, Action action, Func appliesTo) + { + if (root == null || visitedMembers.Contains(root)) + return; + + visitedMembers.Add(root); + + var members = GetFieldsAndProperties(root); + + foreach (var member in members) + { + if (appliesTo(member)) + { + action(root, member); + } + + //don't recurse over primitives or system types + if (member.ReflectedType.IsPrimitive || member.ReflectedType.IsSystemType()) + { + continue; + } + + if (IsIndexedProperty(member)) + { + continue; + } + + var child = member.GetValue(root); + + var items = child as IEnumerable; + if (items != null) + { + foreach (var item in items) + { + if (item == null) + { + continue; + } + + //don't recurse over primitives or system types + if (item.GetType().IsPrimitive || item.GetType().IsSystemType()) + { + break; + } + + ForEachMember(item, action, appliesTo); + } + } + else + { + ForEachMember(child, action, appliesTo); + } + } + } + + void EncryptMember(object target, MemberInfo member) + { + var valueToEncrypt = member.GetValue(target); + + if (valueToEncrypt == null) + return; + + if (EncryptionService == null) + throw new InvalidOperationException( + String.Format("Cannot encrypt field {0} because no encryption service was configured.", + member.Name)); + + if (valueToEncrypt is WireEncryptedString) + { + var encryptedString = (WireEncryptedString)valueToEncrypt; + EncryptWireEncryptedString(encryptedString); + + //we clear the properties to avoid having the extra data serialized + encryptedString.EncryptedBase64Value = null; + encryptedString.Base64Iv = null; + } + else + { + member.SetValue(target, EncryptUserSpecifiedProperty(valueToEncrypt)); + } + + Log.Debug(member.Name + " encrypted successfully"); + } + + void DecryptMember(object target, MemberInfo property) + { + var encryptedValue = property.GetValue(target); + + if (encryptedValue == null) + return; + + if (EncryptionService == null) + throw new InvalidOperationException( + String.Format("Cannot decrypt field {0} because no encryption service was configured.", property.Name)); + + if (encryptedValue is WireEncryptedString) + { + Decrypt((WireEncryptedString)encryptedValue); + } + else + { + property.SetValue(target, DecryptUserSpecifiedProperty(encryptedValue)); + } + + Log.Debug(property.Name + " decrypted successfully"); + } + + string DecryptUserSpecifiedProperty(object encryptedValue) + { + var stringToDecrypt = encryptedValue as string; + + if (stringToDecrypt == null) + throw new InvalidOperationException("Only string properties is supported for convention based encryption, please check your convention"); + + var parts = stringToDecrypt.Split(new[] { '@' }, StringSplitOptions.None); + + return EncryptionService.Decrypt(new EncryptedValue + { + EncryptedBase64Value = parts[0], + Base64Iv = parts[1] + }); + } + + void Decrypt(WireEncryptedString encryptedValue) + { + if (encryptedValue.EncryptedValue == null) + throw new InvalidOperationException("Encrypted property is missing encryption data"); + + encryptedValue.Value = EncryptionService.Decrypt(encryptedValue.EncryptedValue); + } + + string EncryptUserSpecifiedProperty(object valueToEncrypt) + { + var stringToEncrypt = valueToEncrypt as string; + + if (stringToEncrypt == null) + throw new InvalidOperationException("Only string properties is supported for convention based encryption, please check your convention"); + + var encryptedValue = EncryptionService.Encrypt(stringToEncrypt); + + return string.Format("{0}@{1}", encryptedValue.EncryptedBase64Value, encryptedValue.Base64Iv); + } + + void EncryptWireEncryptedString(WireEncryptedString wireEncryptedString) + { + wireEncryptedString.EncryptedValue = EncryptionService.Encrypt(wireEncryptedString.Value); + wireEncryptedString.Value = null; + + } + static IEnumerable GetFieldsAndProperties(object target) + { + if (target == null) + { + return new List(); + } + + var messageType = target.GetType(); + + if (!cache.ContainsKey(messageType)) + { + cache[messageType] = messageType.GetMembers(BindingFlags.Public | BindingFlags.Instance) + .Where(m => m is FieldInfo || m is PropertyInfo) + .ToList(); + } + + return cache[messageType]; + } + + readonly HashSet visitedMembers = new HashSet(); + + readonly static IDictionary> cache = new ConcurrentDictionary>(); + + readonly static ILog Log = LogManager.GetLogger(typeof(IEncryptionService)); + } + + static class MemberInfoExtensions + { + public static object GetValue(this MemberInfo member, object source) + { + if (member is FieldInfo) + { + return ((FieldInfo)member).GetValue(source); + } + + var propertyInfo = (PropertyInfo) member; + + if (!propertyInfo.CanRead) + { + if (propertyInfo.PropertyType.IsValueType) + { + return Activator.CreateInstance(propertyInfo.PropertyType); + } + + return null; + } + + return propertyInfo.GetValue(source, null); + } + + public static void SetValue(this MemberInfo member, object target, object value) + { + if (member is FieldInfo) + { + ((FieldInfo)member).SetValue(target, value); + } + else + { + ((PropertyInfo)member).SetValue(target, value, null); + } + } + } +} diff --git a/src/encryption/NServiceBus.Encryption/IEncryptionService.cs b/src/NServiceBus.Core/Encryption/IEncryptionService.cs similarity index 94% rename from src/encryption/NServiceBus.Encryption/IEncryptionService.cs rename to src/NServiceBus.Core/Encryption/IEncryptionService.cs index 4c0917622d9..d7de022f47e 100644 --- a/src/encryption/NServiceBus.Encryption/IEncryptionService.cs +++ b/src/NServiceBus.Core/Encryption/IEncryptionService.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Encryption +namespace NServiceBus.Encryption { /// /// Abstraction for encryption capabilities. diff --git a/src/impl/encryption/NServiceBus.Encryption.Rijndael/EncryptionService.cs b/src/NServiceBus.Core/Encryption/Rijndael/EncryptionService.cs similarity index 96% rename from src/impl/encryption/NServiceBus.Encryption.Rijndael/EncryptionService.cs rename to src/NServiceBus.Core/Encryption/Rijndael/EncryptionService.cs index 168bd1aa9e1..6059f98269a 100644 --- a/src/impl/encryption/NServiceBus.Encryption.Rijndael/EncryptionService.cs +++ b/src/NServiceBus.Core/Encryption/Rijndael/EncryptionService.cs @@ -1,10 +1,10 @@ -using System; -using System.IO; -using System.Security.Cryptography; -using Common.Logging; - namespace NServiceBus.Encryption.Rijndael { + using System; + using System.IO; + using System.Security.Cryptography; + using Logging; + /// /// Implementation of the encryption capability using Rijndael. /// Copied from https://rhino-tools.svn.sourceforge.net/svnroot/rhino-tools/trunk/esb/Rhino.ServiceBus/Impl/RijndaelEncryptionService.cs diff --git a/src/config/NServiceBus.Config/Conventions/EndpointConventions.cs b/src/NServiceBus.Core/EndpointConventions.cs similarity index 89% rename from src/config/NServiceBus.Config/Conventions/EndpointConventions.cs rename to src/NServiceBus.Core/EndpointConventions.cs index 268df730b6e..18306f86a46 100644 --- a/src/config/NServiceBus.Config/Conventions/EndpointConventions.cs +++ b/src/NServiceBus.Core/EndpointConventions.cs @@ -1,34 +1,33 @@ -using System; - -namespace NServiceBus -{ - - /// - /// Static extension methods to Configure. - /// - public static class EndpointConventions - { - /// - /// Sets the function that specified the name of this endpoint - /// - /// - /// - public static Configure DefineEndpointName(this Configure config, Func definesEndpointName) - { - Configure.GetEndpointNameAction = definesEndpointName; - return config; - } - - /// - /// Sets the function that specified the name of this endpoint - /// - /// - /// - public static Configure DefineEndpointName(this Configure config, string name) - { - Configure.GetEndpointNameAction = ()=> name; - return config; - } - - } -} +namespace NServiceBus +{ + using System; + + /// + /// Static extension methods to Configure. + /// + public static class EndpointConventions + { + /// + /// Sets the function that specified the name of this endpoint + /// + /// + /// + public static Configure DefineEndpointName(this Configure config, Func definesEndpointName) + { + Configure.GetEndpointNameAction = definesEndpointName; + return config; + } + + /// + /// Sets the function that specified the name of this endpoint + /// + /// + /// + public static Configure DefineEndpointName(this Configure config, string name) + { + Configure.GetEndpointNameAction = () => name; + return config; + } + + } +} diff --git a/src/faults/NServiceBus.Faults/FaultsHeaderKeys.cs b/src/NServiceBus.Core/Faults/FaultsHeaderKeys.cs similarity index 91% rename from src/faults/NServiceBus.Faults/FaultsHeaderKeys.cs rename to src/NServiceBus.Core/Faults/FaultsHeaderKeys.cs index 0686042f67d..fa579ce9cc1 100644 --- a/src/faults/NServiceBus.Faults/FaultsHeaderKeys.cs +++ b/src/NServiceBus.Core/Faults/FaultsHeaderKeys.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Faults +namespace NServiceBus.Faults { /// /// Class holding keys to message headers for faults. diff --git a/src/NServiceBus.Core/Faults/Forwarder/Config/FaultsQueueCreator.cs b/src/NServiceBus.Core/Faults/Forwarder/Config/FaultsQueueCreator.cs new file mode 100644 index 00000000000..5216db19015 --- /dev/null +++ b/src/NServiceBus.Core/Faults/Forwarder/Config/FaultsQueueCreator.cs @@ -0,0 +1,26 @@ +namespace NServiceBus.Faults.Forwarder.Config +{ + using Unicast.Queuing; + + /// + /// Signals to create faults queue + /// + public class FaultsQueueCreator : IWantQueueCreated + { + /// + /// Signals to create the faults queue + /// + public Address Address + { + get { return ConfigureFaultsForwarder.ErrorQueue; } + } + + /// + /// Disabling the creation of faults queue + /// + public bool IsDisabled + { + get { return ConfigureFaultsForwarder.ErrorQueue == null; } + } + } +} diff --git a/src/NServiceBus.Core/Faults/Forwarder/FaultManager.cs b/src/NServiceBus.Core/Faults/Forwarder/FaultManager.cs new file mode 100644 index 00000000000..8b7c1ad5713 --- /dev/null +++ b/src/NServiceBus.Core/Faults/Forwarder/FaultManager.cs @@ -0,0 +1,126 @@ +namespace NServiceBus.Faults.Forwarder +{ + using System; + using Logging; + using SecondLevelRetries.Helpers; + using Transports; + using Unicast.Queuing; + + /// + /// Implementation of IManageMessageFailures by forwarding messages + /// using ISendMessages. + /// + public class FaultManager : IManageMessageFailures + { + void IManageMessageFailures.SerializationFailedForMessage(TransportMessage message, Exception e) + { + SendFailureMessage(message, e, true); + } + + void IManageMessageFailures.ProcessingAlwaysFailsForMessage(TransportMessage message, Exception e) + { + SendFailureMessage(message, e); + } + + void IManageMessageFailures.Init(Address address) + { + localAddress = address; + } + + void SendFailureMessage(TransportMessage message, Exception e, bool serializationException = false) + { + SetExceptionHeaders(message, e); + + try + { + var destinationQ = RetriesErrorQueue ?? ErrorQueue; + + // Intentionally service-locate ISendMessages to avoid circular + // resolution problem in the container + var sender = Configure.Instance.Builder.Build(); + + if (serializationException || MessageWasSentFromSLR(message)) + { + sender.Send(message, ErrorQueue); + return; + } + + sender.Send(message, destinationQ); + + //HACK: We need this hack here till we refactor the SLR to be a first class concept in the TransportReceiver + if (RetriesErrorQueue == null) + { + Logger.ErrorFormat("Message has failed FLR and will be moved to the configured error q, ID={0}.", message.Id); + } + else + { + var retryAttempt = TransportMessageHelpers.GetNumberOfRetries(message) + 1; + + Logger.WarnFormat("Message has failed FLR and will be handed over to SLR for retry attempt: {0}, MessageID={1}.", retryAttempt, message.Id); + } + } + catch (Exception exception) + { + var qnfEx = exception as QueueNotFoundException; + string errorMessage; + + if (qnfEx != null) + { + errorMessage = string.Format("Could not forward failed message to error queue '{0}' as it could not be found.", qnfEx.Queue); + Logger.Fatal(errorMessage); + } + else + { + errorMessage = "Could not forward failed message to error queue."; + Logger.Fatal(errorMessage, exception); + } + + throw new InvalidOperationException(errorMessage, exception); + } + } + + bool MessageWasSentFromSLR(TransportMessage message) + { + if (RetriesErrorQueue == null) + { + return false; + } + + // if the reply to address == ErrorQueue and RealErrorQueue is not null, the + // SecondLevelRetries sat is running and the error happened within that sat. + return TransportMessageHelpers.GetAddressOfFaultingEndpoint(message) == RetriesErrorQueue; + } + + void SetExceptionHeaders(TransportMessage message, Exception e) + { + message.Headers["NServiceBus.ExceptionInfo.ExceptionType"] = e.GetType().FullName; + + if (e.InnerException != null) + { + message.Headers["NServiceBus.ExceptionInfo.InnerExceptionType"] = e.InnerException.GetType().FullName; + } + + message.Headers["NServiceBus.ExceptionInfo.Message"] = e.Message; + message.Headers["NServiceBus.ExceptionInfo.Source"] = e.Source; + message.Headers["NServiceBus.ExceptionInfo.StackTrace"] = e.ToString(); + + var failedQ = localAddress ?? Address.Local; + + message.Headers[FaultsHeaderKeys.FailedQ] = failedQ.ToString(); + message.Headers["NServiceBus.TimeOfFailure"] = DateTimeExtensions.ToWireFormattedString(DateTime.UtcNow); + } + + /// + /// Endpoint to which message failures are forwarded + /// + public Address ErrorQueue { get; set; } + + /// + /// The address of the Second Level Retries input queue when SLR is enabled + /// + public Address RetriesErrorQueue { get; set; } + + Address localAddress; + static readonly ILog Logger = LogManager.GetLogger(typeof(FaultManager)); + } +} diff --git a/src/management/retries/NServiceBus.Management.Retries/Helpers/MessageHelpers.cs b/src/NServiceBus.Core/Faults/Forwarder/MessageHelpers.cs similarity index 89% rename from src/management/retries/NServiceBus.Management.Retries/Helpers/MessageHelpers.cs rename to src/NServiceBus.Core/Faults/Forwarder/MessageHelpers.cs index c90e9b4c1f4..31edccf4f7f 100644 --- a/src/management/retries/NServiceBus.Management.Retries/Helpers/MessageHelpers.cs +++ b/src/NServiceBus.Core/Faults/Forwarder/MessageHelpers.cs @@ -1,11 +1,11 @@ -using System.Messaging; - -namespace NServiceBus.Management.Retries.Helpers +namespace NServiceBus.Faults.Forwarder { + using System.Messaging; + // Copied from NServiceBus.Tools.Management.Errors.ReturnToSourceQueue - internal static class MessageHelpers + static class MessageHelpers { - private static string FAILEDQUEUE = "FailedQ"; + static string FAILEDQUEUE = "FailedQ"; /// /// For compatibility with V2.6: @@ -46,6 +46,7 @@ public static string GetFailedQueueFromLabel(Message m) var count = m.Label.IndexOf(string.Format("", FAILEDQUEUE)) - startIndex; return m.Label.Substring(startIndex, count); - } + } } -} \ No newline at end of file + +} diff --git a/src/faults/NServiceBus.Faults/IManageMessageFailures.cs b/src/NServiceBus.Core/Faults/IManageMessageFailures.cs similarity index 93% rename from src/faults/NServiceBus.Faults/IManageMessageFailures.cs rename to src/NServiceBus.Core/Faults/IManageMessageFailures.cs index dd504117e7d..48a24ebec76 100644 --- a/src/faults/NServiceBus.Faults/IManageMessageFailures.cs +++ b/src/NServiceBus.Core/Faults/IManageMessageFailures.cs @@ -1,8 +1,7 @@ -using System; -using NServiceBus.Unicast.Transport; - namespace NServiceBus.Faults { + using System; + /// /// Interface for defining how message failures will be handled. /// @@ -20,13 +19,12 @@ public interface IManageMessageFailures /// /// /// - void ProcessingAlwaysFailsForMessage(TransportMessage message, Exception e); - - - /// - /// Initializes the fault manager - /// - /// The address of the message source - void Init(Address address); + void ProcessingAlwaysFailsForMessage(TransportMessage message, Exception e); + + /// + /// Initializes the fault manager + /// + /// The address of the message source + void Init(Address address); } } diff --git a/src/NServiceBus.Core/Faults/InMemory/FaultManager.cs b/src/NServiceBus.Core/Faults/InMemory/FaultManager.cs new file mode 100644 index 00000000000..cd98b8ec199 --- /dev/null +++ b/src/NServiceBus.Core/Faults/InMemory/FaultManager.cs @@ -0,0 +1,32 @@ +namespace NServiceBus.Faults.InMemory +{ + using System; + using Logging; + + /// + /// Logging implementation of IManageMessageFailures. + /// + public class FaultManager : IManageMessageFailures + { + void IManageMessageFailures.SerializationFailedForMessage(TransportMessage message, Exception e) + { + logger.Error("Serialization failed for message with ID " + message.Id + ".", e); + } + + void IManageMessageFailures.ProcessingAlwaysFailsForMessage(TransportMessage message, Exception e) + { + logger.Error("Message processing always fails for message with ID " + message.Id + ".", e); + } + + /// + /// Initializes the fault manager + /// + /// The address of the message source + public void Init(Address address) + { + + } + + readonly ILog logger = LogManager.GetLogger(typeof(FaultManager)); + } +} diff --git a/src/NServiceBus.Core/Features/Feature.cs b/src/NServiceBus.Core/Features/Feature.cs new file mode 100644 index 00000000000..f17d0dfb39c --- /dev/null +++ b/src/NServiceBus.Core/Features/Feature.cs @@ -0,0 +1,307 @@ +namespace NServiceBus.Features +{ + using System; + using System.Collections.Generic; + using Settings; + + /// + /// Used to control the various features supported by the framework. + /// + public abstract class Feature + { + + /// + /// Called when the feature should perform its initialization. This call will only happen if the feature is enabled. + /// + public virtual void Initialize() + { + + } + + /// + /// Returns true if the feature should be enable. This method wont be called if the feature is explicitly disabled + /// + /// + public virtual bool ShouldBeEnabled() + { + return true; + } + + /// + /// Return true if this is a default that needs to be turned on automatically. + /// + public virtual bool IsEnabledByDefault + { + get { return false; } + } + + /// + /// Feature name. + /// + public string Name + { + get { return name; } + } + + /// + /// True if this specific feature is enabled + /// + public bool Enabled + { + get { return IsEnabled(GetType()); } + + } + + /// + /// Enables the give feature + /// + /// + public static void Enable() where T : Feature + { + Enable(typeof (T)); + } + + // + /// Enables the give feature + /// + public static void Enable(Type featureType) + { + SettingsHolder.Set(featureType.FullName, true); + } + + // + /// Enables the give feature unless explicitly disabled + /// + public static void EnableByDefault() where T : Feature + { + EnableByDefault(typeof (T)); + } + + // + /// Enables the give feature unless explicitly disabled + /// + public static void EnableByDefault(Type featureType) + { + SettingsHolder.SetDefault(featureType.FullName, true); + } + + + + /// + /// Turns the given feature off + /// + /// + public static void Disable() where T : Feature + { + Disable(typeof (T)); + } + + /// + /// Turns the given feature off + /// + public static void Disable(Type featureType) + { + SettingsHolder.Set(featureType.FullName, false); + } + + // + /// Disabled the give feature unless explicitly enabled + /// + public static void DisableByDefault(Type featureType) + { + SettingsHolder.SetDefault(featureType.FullName, false); + } + + /// + /// Returns true if the given feature is enabled + /// + /// + /// + public static bool IsEnabled() where T : Feature + { + return IsEnabled(typeof (T)); + } + + + /// + /// Returns true if the given feature is enabled + /// + /// + /// + public static bool IsEnabled(Type feature) + { + return SettingsHolder.GetOrDefault(feature.FullName); + } + + /// + /// Returns the category for this feature if any + /// + public virtual FeatureCategory Category + { + get { return FeatureCategory.None; } + } + + /// + /// Gets all features for the given category + /// + /// + /// + public static IEnumerable ByCategory(FeatureCategory category) + { + var result = new List(); + + Configure.Instance.ForAllTypes(t => + { + var feature = (Feature)Activator.CreateInstance(t); + + if (feature.Category == category) + { + result.Add(feature); + } + + }); + + return result; + } + + protected bool Equals(Feature other) + { + return string.Equals(name, other.name); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) + { + return false; + } + if (ReferenceEquals(this, obj)) + { + return true; + } + if (obj.GetType() != this.GetType()) + { + return false; + } + return Equals((Feature)obj); + } + + public override int GetHashCode() + { + return (name != null ? name.GetHashCode() : 0); + } + + + public static bool operator ==(Feature feature1, Feature feature2) + { + if (ReferenceEquals(feature1, null)) + { + return ReferenceEquals(feature2, null); + } + + return feature1.Equals(feature2); + } + + public static bool operator !=(Feature feature1, Feature feature2) + { + return !(feature1 == feature2); + } + + protected Feature() + { + name = GetType().Name.Replace("Feature", String.Empty); + } + + + string name; + } + + public abstract class Feature:Feature where T: FeatureCategory + { + public override FeatureCategory Category + { + get { return Activator.CreateInstance(); } + } + } + + public abstract class FeatureCategory + { + public FeatureCategory() + { + name = GetType().Name.Replace(typeof(FeatureCategory).Name, String.Empty); + } + + public static FeatureCategory None + { + get { return new NoneFeatureCategory(); } + + } + + /// + /// Returns the list of features in the category that should be used + /// + public virtual IEnumerable GetFeaturesToInitialize() + { + return new List(); + } + + /// + /// Feature name. + /// + public string Name + { + get { return name; } + } + + public IEnumerable GetAllAvailableFeatures() + { + return Feature.ByCategory(this); + } + + protected bool Equals(FeatureCategory other) + { + return string.Equals(name, other.name); + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) + { + return false; + } + if (ReferenceEquals(this, obj)) + { + return true; + } + if (obj.GetType() != this.GetType()) + { + return false; + } + return Equals((FeatureCategory)obj); + } + + public override int GetHashCode() + { + return (name != null ? name.GetHashCode() : 0); + } + + public static bool operator ==(FeatureCategory cat1, FeatureCategory cat2) + { + if (ReferenceEquals(cat1, null)) + { + return ReferenceEquals(cat2, null); + } + + return cat1.Equals(cat2); + } + + public static bool operator !=(FeatureCategory cat1, FeatureCategory cat2) + { + return !(cat1 == cat2); + } + + string name; + + public class NoneFeatureCategory :FeatureCategory{} + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Features/FeatureSettings.cs b/src/NServiceBus.Core/Features/FeatureSettings.cs new file mode 100644 index 00000000000..bc0f9dd85fe --- /dev/null +++ b/src/NServiceBus.Core/Features/FeatureSettings.cs @@ -0,0 +1,32 @@ +namespace NServiceBus.Features +{ + /// + /// Settings for the various features + /// + public class FeatureSettings + { + /// + /// Enables the given feature + /// + /// + /// + public FeatureSettings Enable() where T : Feature + { + Feature.Enable(); + + return this; + } + + /// + /// Disables the given feature + /// + /// + /// + public FeatureSettings Disable() where T : Feature + { + Feature.Disable(); + + return this; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Features/FeatureStatus.cs b/src/NServiceBus.Core/Features/FeatureStatus.cs new file mode 100644 index 00000000000..c4f85f50fad --- /dev/null +++ b/src/NServiceBus.Core/Features/FeatureStatus.cs @@ -0,0 +1,23 @@ +namespace NServiceBus.Features +{ + using System.Text; + using Config; + using Logging; + + /// + /// Displays the current status of the features + /// + public class FeatureStatus:IWantToRunWhenConfigurationIsComplete + { + public void Run() + { + var statusText = new StringBuilder(); + + Configure.Instance.ForAllTypes(t => statusText.AppendLine(string.Format("{0} - {1}", t.Name,Feature.IsEnabled(t) ? "Enabled" : "Disabled"))); + + Logger.InfoFormat("Features: \n{0}",statusText); + } + + static readonly ILog Logger = LogManager.GetLogger(typeof(FeatureStatus)); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Features/Support/EnableDefaultFeatures.cs b/src/NServiceBus.Core/Features/Support/EnableDefaultFeatures.cs new file mode 100644 index 00000000000..4d6a085fac7 --- /dev/null +++ b/src/NServiceBus.Core/Features/Support/EnableDefaultFeatures.cs @@ -0,0 +1,24 @@ +namespace NServiceBus.Features +{ + using System; + using Logging; + + public class EnableDefaultFeatures : IWantToRunBeforeConfiguration + { + public void Init() + { + Configure.Instance.ForAllTypes(t => + { + var feature = (Feature)Activator.CreateInstance(t); + + if (feature.IsEnabledByDefault) + { + Feature.EnableByDefault(t); + Logger.DebugFormat("Feature {0} will be enabled by default", feature.Name); + } + }); + } + + static readonly ILog Logger = LogManager.GetLogger(typeof(FeatureInitializer)); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Features/Support/FeatureInitializer.cs b/src/NServiceBus.Core/Features/Support/FeatureInitializer.cs new file mode 100644 index 00000000000..3ed58e5209d --- /dev/null +++ b/src/NServiceBus.Core/Features/Support/FeatureInitializer.cs @@ -0,0 +1,101 @@ +namespace NServiceBus.Features +{ + using System; + using System.Linq; + using System.Text; + using Config; + using Logging; + + public class FeatureInitializer : IFinalizeConfiguration, IWantToRunBeforeConfigurationIsFinalized + { + /// + /// Go trough all conditional features and figure out if the should be enabled or not + /// + public void Run() + { + Configure.Instance.ForAllTypes(t => + { + var feature = (Feature)Activator.CreateInstance(t); + + if (feature.IsEnabledByDefault && !Feature.IsEnabled(t)) + { + Logger.InfoFormat("Default feature {0} has been explicitly disabled", feature.Name); + return; + } + + if (feature.IsEnabledByDefault && !feature.ShouldBeEnabled()) + { + Feature.Disable(t); + Logger.DebugFormat("Default feature {0} disabled", feature.Name); + } + }); + } + + public void FinalizeConfiguration() + { + InitializeFeatures(); + InitializeCategories(); + } + + static void InitializeFeatures() + { + var statusText = new StringBuilder(); + + Configure.Instance.ForAllTypes(t => + { + var feature = (Feature) Activator.CreateInstance(t); + + if (feature.Category != FeatureCategory.None) + { + statusText.AppendLine(string.Format("{0} - Controlled by category {1}", feature.Name, + feature.Category.Name)); + return; + } + + if (!Feature.IsEnabled(t)) + { + statusText.AppendLine(string.Format("{0} - Disabled", feature.Name)); + return; + } + + feature.Initialize(); + + statusText.AppendLine(string.Format("{0} - Enabled", feature.Name)); + }); + + Logger.InfoFormat("Features: \n{0}", statusText); + } + + static void InitializeCategories() + { + var statusText = new StringBuilder(); + + Configure.Instance.ForAllTypes(t => + { + if(t == typeof(FeatureCategory.NoneFeatureCategory)) + return; + + var category = (FeatureCategory)Activator.CreateInstance(t); + + var featuresToInitialize = category.GetFeaturesToInitialize().ToList(); + + statusText.AppendLine(string.Format(" - {0}", category.Name)); + + foreach (var feature in category.GetAllAvailableFeatures()) + { + var shouldBeInitialized = featuresToInitialize.Contains(feature); + + if (shouldBeInitialized) + feature.Initialize(); + + statusText.AppendLine(string.Format(" * {0} - {1}", feature.Name, shouldBeInitialized ? "Enabled" : "Disabled")); + } + + }); + + Logger.InfoFormat("Feature categories: \n{0}", statusText); + } + + static readonly ILog Logger = LogManager.GetLogger(typeof (FeatureInitializer)); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Fody.targets b/src/NServiceBus.Core/Fody.targets new file mode 100644 index 00000000000..a668a51fc04 --- /dev/null +++ b/src/NServiceBus.Core/Fody.targets @@ -0,0 +1,89 @@ + + + + + + $(NCrunchOriginalSolutionDir) + + + + + $(SolutionDir) + + + + + $(MSBuildProjectDirectory)\..\ + + + + + + + $(KeyOriginatorFile) + + + + + $(AssemblyOriginatorKeyFile) + + + + + + + + + + $(ProjectDir)$(IntermediateOutputPath) + Low + $(SignAssembly) + $(MSBuildThisFileDirectory) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/NServiceBus.Core/FodyWeavers.xml b/src/NServiceBus.Core/FodyWeavers.xml new file mode 100644 index 00000000000..a9c8f75f252 --- /dev/null +++ b/src/NServiceBus.Core/FodyWeavers.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Channels/Channel.cs b/src/NServiceBus.Core/Gateway/Channels/Channel.cs similarity index 99% rename from src/gateway/NServiceBus.Gateway/Channels/Channel.cs rename to src/NServiceBus.Core/Gateway/Channels/Channel.cs index 72369841d08..bbab44a1b39 100644 --- a/src/gateway/NServiceBus.Gateway/Channels/Channel.cs +++ b/src/NServiceBus.Core/Gateway/Channels/Channel.cs @@ -1,16 +1,16 @@ namespace NServiceBus.Gateway.Channels { - using System; - - public class ReceiveChannel:Channel - { - public int NumberOfWorkerThreads { get; set; } - public bool Default { get; set; } - - public override string ToString() - { - return base.ToString() + "NumberOfWorkerThreads=" + NumberOfWorkerThreads + "Default=" + Default; - } + using System; + + public class ReceiveChannel:Channel + { + public int NumberOfWorkerThreads { get; set; } + public bool Default { get; set; } + + public override string ToString() + { + return base.ToString() + "NumberOfWorkerThreads=" + NumberOfWorkerThreads + "Default=" + Default; + } } public class Channel : IEquatable diff --git a/src/gateway/NServiceBus.Gateway/Channels/ChannelFactory.cs b/src/NServiceBus.Core/Gateway/Channels/ChannelFactory.cs similarity index 79% rename from src/gateway/NServiceBus.Gateway/Channels/ChannelFactory.cs rename to src/NServiceBus.Core/Gateway/Channels/ChannelFactory.cs index 661f6c07a7a..ac904acb21c 100644 --- a/src/gateway/NServiceBus.Gateway/Channels/ChannelFactory.cs +++ b/src/NServiceBus.Core/Gateway/Channels/ChannelFactory.cs @@ -1,6 +1,7 @@ namespace NServiceBus.Gateway.Channels { using System; + using System.Linq; using System.Collections.Generic; public interface IChannelFactory @@ -39,7 +40,11 @@ public void RegisterReceiver(Type receiver, string type) public void RegisterSender(Type sender) { - RegisterSender(sender, sender.Name.Substring(0, sender.Name.IndexOf("Channel"))); + var channelTypes = sender.GetCustomAttributes(true).OfType().ToList(); + if(channelTypes.Any()) + channelTypes.ForEach(type => RegisterSender(sender, type.Type)); + else + RegisterSender(sender, sender.Name.Substring(0, sender.Name.IndexOf("Channel"))); } public void RegisterSender(Type sender, string type) diff --git a/src/NServiceBus.Core/Gateway/Channels/ChannelTypeAttribute.cs b/src/NServiceBus.Core/Gateway/Channels/ChannelTypeAttribute.cs new file mode 100644 index 00000000000..dc90126ccee --- /dev/null +++ b/src/NServiceBus.Core/Gateway/Channels/ChannelTypeAttribute.cs @@ -0,0 +1,15 @@ +using System; + +namespace NServiceBus.Gateway.Channels +{ + [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] + public class ChannelTypeAttribute : Attribute + { + public ChannelTypeAttribute(string type) + { + Type = type; + } + + public string Type { get; set; } + } +} diff --git a/src/gateway/NServiceBus.Gateway/Channels/Http/DefaultResponder.cs b/src/NServiceBus.Core/Gateway/Channels/Http/DefaultResponder.cs similarity index 93% rename from src/gateway/NServiceBus.Gateway/Channels/Http/DefaultResponder.cs rename to src/NServiceBus.Core/Gateway/Channels/Http/DefaultResponder.cs index af7bfd1c1dd..b961be29a5f 100644 --- a/src/gateway/NServiceBus.Gateway/Channels/Http/DefaultResponder.cs +++ b/src/NServiceBus.Core/Gateway/Channels/Http/DefaultResponder.cs @@ -1,27 +1,26 @@ -namespace NServiceBus.Gateway.Channels.Http -{ - using System.Net; - using NServiceBus.Config; - - public class DefaultResponder : IHttpResponder - { - public void Handle(HttpListenerContext ctx) - { - ctx.Response.StatusCode = 200; - - var response = string.Format("EndpointName:{0} - Status: Ok", Configure.EndpointName); - - ctx.Response.ContentType = "text/html"; - ctx.Response.Close(System.Text.Encoding.UTF8.GetBytes(response),true); - } - } - - public class SetDefaultResponder : IWantToRunBeforeConfigurationIsFinalized - { - public void Run() - { - if (!Configure.Instance.Configurer.HasComponent()) - Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); - } - } +namespace NServiceBus.Gateway.Channels.Http +{ + using System.Net; + + public class DefaultResponder : IHttpResponder + { + public void Handle(HttpListenerContext ctx) + { + ctx.Response.StatusCode = 200; + + var response = string.Format("EndpointName:{0} - Status: Ok", Configure.EndpointName); + + ctx.Response.ContentType = "text/html"; + ctx.Response.Close(System.Text.Encoding.UTF8.GetBytes(response),true); + } + } + + public class SetDefaultResponder : IWantToRunBeforeConfigurationIsFinalized + { + public void Run() + { + if (!Configure.Instance.Configurer.HasComponent()) + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + } + } } \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Channels/Http/HttpChannelException.cs b/src/NServiceBus.Core/Gateway/Channels/Http/HttpChannelException.cs similarity index 85% rename from src/gateway/NServiceBus.Gateway/Channels/Http/HttpChannelException.cs rename to src/NServiceBus.Core/Gateway/Channels/Http/HttpChannelException.cs index f280532cd05..3e6dced6fd3 100644 --- a/src/gateway/NServiceBus.Gateway/Channels/Http/HttpChannelException.cs +++ b/src/NServiceBus.Core/Gateway/Channels/Http/HttpChannelException.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Gateway.Channels.Http +namespace NServiceBus.Gateway.Channels.Http { using System; diff --git a/src/NServiceBus.Core/Gateway/Channels/Http/HttpChannelReceiver.cs b/src/NServiceBus.Core/Gateway/Channels/Http/HttpChannelReceiver.cs new file mode 100644 index 00000000000..d6ad127b388 --- /dev/null +++ b/src/NServiceBus.Core/Gateway/Channels/Http/HttpChannelReceiver.cs @@ -0,0 +1,220 @@ +namespace NServiceBus.Gateway.Channels.Http +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Net; + using System.Text; + using System.Threading; + using System.Threading.Tasks; + using System.Threading.Tasks.Schedulers; + using System.Web; + using HeaderManagement; + using Logging; + using Utils; + + public class HttpChannelReceiver : IChannelReceiver + { + public event EventHandler DataReceived; + + private MTATaskScheduler scheduler; + private bool disposed; + CancellationTokenSource tokenSource; + + public void Start(string address, int numWorkerThreads) + { + tokenSource = new CancellationTokenSource(); + listener = new HttpListener(); + + listener.Prefixes.Add(address); + + scheduler = new MTATaskScheduler(numWorkerThreads, String.Format("NServiceBus Gateway Channel Receiver Thread for [{0}]", address)); + + try + { + listener.Start(); + } + catch (Exception ex) + { + throw new Exception(string.Format("Failed to start listener for {0} make sure that you have admin privileges", address), ex); + } + + var token = tokenSource.Token; + Task.Factory.StartNew(HttpServer, token, token, TaskCreationOptions.LongRunning, TaskScheduler.Default); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + tokenSource.Cancel(); + + listener.Stop(); + + scheduler.Dispose(); + } + + disposed = true; + } + + ~HttpChannelReceiver() + { + Dispose(false); + } + + public void Handle(HttpListenerContext ctx) + { + try + { + if(!IsGatewayRequest(ctx.Request)) + { + //there will always be a responder + Configure.Instance.Builder.Build().Handle(ctx); + return; + } + + DataReceived(this, new DataReceivedOnChannelArgs + { + Headers = GetHeaders(ctx), + Data = GetMessageStream(ctx) + }); + ReportSuccess(ctx); + + Logger.Debug("Http request processing complete."); + } + catch (HttpChannelException ex) + { + CloseResponseAndWarn(ctx, ex.Message, ex.StatusCode); + } + catch (Exception ex) + { + Logger.Error("Unexpected error", ex); + CloseResponseAndWarn(ctx, "Unexpected server error", 502); + } + } + + static MemoryStream GetMessageStream(HttpListenerContext ctx) + { + if(ctx.Request.QueryString.AllKeys.Contains("Message")) + { + var message = HttpUtility.UrlDecode(ctx.Request.QueryString["Message"]); + + return new MemoryStream(Encoding.UTF8.GetBytes(message)); + } + + var streamToReturn = new MemoryStream(); + + ctx.Request.InputStream.CopyTo_net35(streamToReturn, MaximumBytesToRead); + streamToReturn.Position = 0; + return streamToReturn; + } + + bool IsGatewayRequest(HttpListenerRequest request) + { + return request.Headers.AllKeys.Contains(GatewayHeaders.CallTypeHeader) || + request.Headers.AllKeys.Contains(GatewayHeaders.CallTypeHeader.ToLower()) || + request.QueryString[GatewayHeaders.CallTypeHeader] != null; + } + + + static IDictionary GetHeaders(HttpListenerContext ctx) + { + var headers = new Dictionary(StringComparer.CurrentCultureIgnoreCase); + + foreach (string header in ctx.Request.Headers.Keys) + headers.Add(HttpUtility.UrlDecode(header), HttpUtility.UrlDecode(ctx.Request.Headers[header])); + + foreach (string header in ctx.Request.QueryString.Keys) + headers[HttpUtility.UrlDecode(header)] = HttpUtility.UrlDecode(ctx.Request.QueryString[header]); + + return headers; + } + + + void HttpServer(object o) + { + var cancellationToken = (CancellationToken)o; + + while (!cancellationToken.IsCancellationRequested) + { + try + { + var ctx = listener.GetContext(); + new Task(() => Handle(ctx)).Start(scheduler); + } + catch (HttpListenerException ex) + { + Logger.Error("Gateway failed to receive incoming request.", ex); + break; + } + catch (InvalidOperationException ex) + { + Logger.Error("Gateway failed to receive incoming request.", ex); + break; + } + } + } + + static void ReportSuccess(HttpListenerContext ctx) + { + Logger.Debug("Sending HTTP 200 response."); + + ctx.Response.StatusCode = 200; + ctx.Response.StatusDescription = "OK"; + + + WriteData(ctx,"OK"); + } + + static void WriteData(HttpListenerContext ctx,string status) + { + var str = status; + + var jsonp = ctx.Request.QueryString["callback"]; + if (string.IsNullOrEmpty(jsonp) == false) + { + str = jsonp + "({ status: '" + str + "'})"; + ctx.Response.AddHeader("Content-Type", "application/javascript; charset=utf-8"); + } + else + { + ctx.Response.AddHeader("Content-Type", "application/json; charset=utf-8"); + } + ctx.Response.Close(Encoding.ASCII.GetBytes(str), false); + } + + static void CloseResponseAndWarn(HttpListenerContext ctx, string warning, int statusCode) + { + try + { + Logger.WarnFormat("Cannot process HTTP request from {0}. Reason: {1}.", ctx.Request.RemoteEndPoint, warning); + ctx.Response.StatusCode = statusCode; + ctx.Response.StatusDescription = warning; + + WriteData(ctx, warning); + } + catch (Exception e) + { + Logger.Error("Could not return warning to client.", e); + } + } + + HttpListener listener; + + const int MaximumBytesToRead = 100000; + + static readonly ILog Logger = LogManager.GetLogger(typeof(HttpChannelReceiver)); + } +} diff --git a/src/gateway/NServiceBus.Gateway/Channels/Http/HttpChannelSender.cs b/src/NServiceBus.Core/Gateway/Channels/Http/HttpChannelSender.cs similarity index 84% rename from src/gateway/NServiceBus.Gateway/Channels/Http/HttpChannelSender.cs rename to src/NServiceBus.Core/Gateway/Channels/Http/HttpChannelSender.cs index 94bf5fd5a07..5aab1427f96 100644 --- a/src/gateway/NServiceBus.Gateway/Channels/Http/HttpChannelSender.cs +++ b/src/NServiceBus.Core/Gateway/Channels/Http/HttpChannelSender.cs @@ -1,17 +1,18 @@ -namespace NServiceBus.Gateway.Channels.Http +namespace NServiceBus.Gateway.Channels.Http { using System; using System.Collections.Generic; - using System.Collections.Specialized; using System.IO; using System.Net; using System.Web; - using log4net; + using Logging; using Utils; + [ChannelType("http")] + [ChannelType("https")] public class HttpChannelSender : IChannelSender { - public void Send(string remoteUrl,IDictionary headers,Stream data) + public void Send(string remoteUrl, IDictionary headers,Stream data) { var request = WebRequest.Create(remoteUrl); request.Method = "POST"; @@ -53,6 +54,6 @@ static WebHeaderCollection Encode(IDictionary headers) } - static readonly ILog Logger = LogManager.GetLogger("NServiceBus.Gateway"); + static readonly ILog Logger = LogManager.GetLogger(typeof(HttpChannelSender)); } } \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Channels/Http/HttpHeaders.cs b/src/NServiceBus.Core/Gateway/Channels/Http/HttpHeaders.cs similarity index 76% rename from src/gateway/NServiceBus.Gateway/Channels/Http/HttpHeaders.cs rename to src/NServiceBus.Core/Gateway/Channels/Http/HttpHeaders.cs index ad71fcf7683..030ec79e051 100644 --- a/src/gateway/NServiceBus.Gateway/Channels/Http/HttpHeaders.cs +++ b/src/NServiceBus.Core/Gateway/Channels/Http/HttpHeaders.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Gateway.Channels.Http +namespace NServiceBus.Gateway.Channels.Http { public static class HttpHeaders { diff --git a/src/gateway/NServiceBus.Gateway/Channels/Http/IHttpResponder.cs b/src/NServiceBus.Core/Gateway/Channels/Http/IHttpResponder.cs similarity index 95% rename from src/gateway/NServiceBus.Gateway/Channels/Http/IHttpResponder.cs rename to src/NServiceBus.Core/Gateway/Channels/Http/IHttpResponder.cs index 54f6b4f55f5..afd92032522 100644 --- a/src/gateway/NServiceBus.Gateway/Channels/Http/IHttpResponder.cs +++ b/src/NServiceBus.Core/Gateway/Channels/Http/IHttpResponder.cs @@ -1,9 +1,9 @@ -namespace NServiceBus.Gateway.Channels.Http -{ - using System.Net; - - public interface IHttpResponder - { - void Handle(HttpListenerContext ctx); - } +namespace NServiceBus.Gateway.Channels.Http +{ + using System.Net; + + public interface IHttpResponder + { + void Handle(HttpListenerContext ctx); + } } \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Channels/IChannelReceiver.cs b/src/NServiceBus.Core/Gateway/Channels/IChannelReceiver.cs similarity index 91% rename from src/gateway/NServiceBus.Gateway/Channels/IChannelReceiver.cs rename to src/NServiceBus.Core/Gateway/Channels/IChannelReceiver.cs index af4c535ee02..2d1501ac7d7 100644 --- a/src/gateway/NServiceBus.Gateway/Channels/IChannelReceiver.cs +++ b/src/NServiceBus.Core/Gateway/Channels/IChannelReceiver.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Gateway.Channels +namespace NServiceBus.Gateway.Channels { using System; using System.Collections.Generic; diff --git a/src/gateway/NServiceBus.Gateway/Channels/IChannelSender.cs b/src/NServiceBus.Core/Gateway/Channels/IChannelSender.cs similarity index 82% rename from src/gateway/NServiceBus.Gateway/Channels/IChannelSender.cs rename to src/NServiceBus.Core/Gateway/Channels/IChannelSender.cs index 683b4172185..7e1d6de6bd0 100644 --- a/src/gateway/NServiceBus.Gateway/Channels/IChannelSender.cs +++ b/src/NServiceBus.Core/Gateway/Channels/IChannelSender.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Gateway.Channels +namespace NServiceBus.Gateway.Channels { using System.Collections.Generic; using System.IO; diff --git a/src/NServiceBus.Core/Gateway/DefaultInputAddress.cs b/src/NServiceBus.Core/Gateway/DefaultInputAddress.cs new file mode 100644 index 00000000000..36a685ae475 --- /dev/null +++ b/src/NServiceBus.Core/Gateway/DefaultInputAddress.cs @@ -0,0 +1,17 @@ +namespace NServiceBus.Gateway +{ + using Settings; + + /// + /// Sets the default input address for the gateway + /// + public class DefaultInputAddress:IWantToRunBeforeConfigurationIsFinalized + { + public void Run() + { + var gatewayInputAddress = Address.Parse(Configure.EndpointName).SubScope("gateway"); + + SettingsHolder.SetDefault("Gateway.InputAddress", gatewayInputAddress); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Gateway/Gateway.cs b/src/NServiceBus.Core/Gateway/Gateway.cs new file mode 100644 index 00000000000..8e0bac584e6 --- /dev/null +++ b/src/NServiceBus.Core/Gateway/Gateway.cs @@ -0,0 +1,73 @@ +namespace NServiceBus.Features +{ + using System.Linq; + using Config; + using NServiceBus.Gateway.Channels; + using NServiceBus.Gateway.Notifications; + using NServiceBus.Gateway.Persistence; + using NServiceBus.Gateway.Receiving; + using NServiceBus.Gateway.Routing.Endpoints; + using NServiceBus.Gateway.Routing.Sites; + using NServiceBus.Gateway.Sending; + + public class Gateway : Feature + { + public override void Initialize() + { + ConfigureChannels(); + + ConfigureReceiver(); + + ConfigureSender(); + + InfrastructureServices.Enable(); + } + + static void ConfigureChannels() + { + var channelFactory = new ChannelFactory(); + + foreach ( + var type in + Configure.TypesToScan.Where(t => typeof (IChannelReceiver).IsAssignableFrom(t) && !t.IsInterface)) + channelFactory.RegisterReceiver(type); + + foreach ( + var type in + Configure.TypesToScan.Where(t => typeof (IChannelSender).IsAssignableFrom(t) && !t.IsInterface)) + channelFactory.RegisterSender(type); + + Configure.Instance.Configurer.RegisterSingleton(channelFactory); + } + + static void ConfigureSender() + { + Configure.Component(DependencyLifecycle.InstancePerCall); + + var configSection = Configure.ConfigurationSource.GetConfiguration(); + + if (configSection != null && configSection.GetChannels().Any()) + Configure.Component(DependencyLifecycle.SingleInstance); + else + Configure.Component(DependencyLifecycle.SingleInstance); + + ConfigureSiteRouters(); + } + + static void ConfigureSiteRouters() + { + Configure.Component(DependencyLifecycle.SingleInstance); + Configure.Component(DependencyLifecycle.SingleInstance); + Configure.Component(DependencyLifecycle.SingleInstance); + } + + static void ConfigureReceiver() + { + Configure.Component(DependencyLifecycle.SingleInstance); + Configure.Component(DependencyLifecycle.InstancePerCall); + Configure.Component(DependencyLifecycle.SingleInstance) + .ConfigureProperty(x => x.MainInputAddress, Address.Parse(Configure.EndpointName)); + + } + } +} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/HeaderManagement/GatewayHeaderManager.cs b/src/NServiceBus.Core/Gateway/HeaderManagement/GatewayHeaderManager.cs similarity index 92% rename from src/gateway/NServiceBus.Gateway/HeaderManagement/GatewayHeaderManager.cs rename to src/NServiceBus.Core/Gateway/HeaderManagement/GatewayHeaderManager.cs index 9889172cda4..75ce815b0b8 100644 --- a/src/gateway/NServiceBus.Gateway/HeaderManagement/GatewayHeaderManager.cs +++ b/src/NServiceBus.Core/Gateway/HeaderManagement/GatewayHeaderManager.cs @@ -1,61 +1,59 @@ -namespace NServiceBus.Gateway.HeaderManagement +namespace NServiceBus.Gateway.HeaderManagement { using System; - using MessageMutator; - using NServiceBus.Config; - using Unicast.Transport; - - public class GatewayHeaderManager : IMutateTransportMessages,INeedInitialization - { - public void MutateIncoming(TransportMessage transportMessage) - { - returnInfo = null; - - if (!transportMessage.Headers.ContainsKey(Headers.HttpFrom) && - !transportMessage.Headers.ContainsKey(Headers.OriginatingSite)) - return; - - returnInfo = new HttpReturnInfo - { - //we preserve the httfrom to be backwards compatible with NServiceBus 2.X - HttpFrom = transportMessage.Headers.ContainsKey(Headers.HttpFrom) ? transportMessage.Headers[Headers.HttpFrom] : null, - OriginatingSite = transportMessage.Headers.ContainsKey(Headers.OriginatingSite) ? transportMessage.Headers[Headers.OriginatingSite] : null, - ReplyToAddress = transportMessage.ReplyToAddress - }; - } - - public void MutateOutgoing(object[] messages, TransportMessage transportMessage) - { - if (returnInfo == null) - return; - - if (string.IsNullOrEmpty(transportMessage.CorrelationId)) - return; - - if (transportMessage.Headers.ContainsKey(Headers.HttpTo) || transportMessage.Headers.ContainsKey(Headers.DestinationSites)) - return; - - transportMessage.Headers[Headers.HttpTo] = returnInfo.HttpFrom; - transportMessage.Headers[Headers.OriginatingSite] = returnInfo.OriginatingSite; - - if (!transportMessage.Headers.ContainsKey(Headers.RouteTo)) - transportMessage.Headers[Headers.RouteTo] = returnInfo.ReplyToAddress.ToString(); - } - - public void Init() - { - Configure.Instance.Configurer.ConfigureComponent( - DependencyLifecycle.InstancePerCall); - } - - [ThreadStatic] - static HttpReturnInfo returnInfo; - - class HttpReturnInfo - { - public string HttpFrom { get; set; } - public string OriginatingSite { get; set; } - public Address ReplyToAddress { get; set; } + using MessageMutator; + + public class GatewayHeaderManager : IMutateTransportMessages, INeedInitialization + { + public void MutateIncoming(TransportMessage transportMessage) + { + returnInfo = null; + + if (!transportMessage.Headers.ContainsKey(Headers.HttpFrom) && + !transportMessage.Headers.ContainsKey(Headers.OriginatingSite)) + return; + + returnInfo = new HttpReturnInfo + { + //we preserve the httfrom to be backwards compatible with NServiceBus 2.X + HttpFrom = transportMessage.Headers.ContainsKey(Headers.HttpFrom) ? transportMessage.Headers[Headers.HttpFrom] : null, + OriginatingSite = transportMessage.Headers.ContainsKey(Headers.OriginatingSite) ? transportMessage.Headers[Headers.OriginatingSite] : null, + ReplyToAddress = transportMessage.ReplyToAddress + }; + } + + public void MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + if (returnInfo == null) + return; + + if (string.IsNullOrEmpty(transportMessage.CorrelationId)) + return; + + if (transportMessage.Headers.ContainsKey(Headers.HttpTo) || transportMessage.Headers.ContainsKey(Headers.DestinationSites)) + return; + + transportMessage.Headers[Headers.HttpTo] = returnInfo.HttpFrom; + transportMessage.Headers[Headers.OriginatingSite] = returnInfo.OriginatingSite; + + if (!transportMessage.Headers.ContainsKey(Headers.RouteTo)) + transportMessage.Headers[Headers.RouteTo] = returnInfo.ReplyToAddress.ToString(); + } + + public void Init() + { + Configure.Instance.Configurer.ConfigureComponent( + DependencyLifecycle.InstancePerCall); + } + + [ThreadStatic] + static HttpReturnInfo returnInfo; + + class HttpReturnInfo + { + public string HttpFrom { get; set; } + public string OriginatingSite { get; set; } + public Address ReplyToAddress { get; set; } } } -} \ No newline at end of file +} diff --git a/src/gateway/NServiceBus.Gateway/HeaderManagement/GatewayHeaders.cs b/src/NServiceBus.Core/Gateway/HeaderManagement/GatewayHeaders.cs similarity index 99% rename from src/gateway/NServiceBus.Gateway/HeaderManagement/GatewayHeaders.cs rename to src/NServiceBus.Core/Gateway/HeaderManagement/GatewayHeaders.cs index 913e041da5b..4dadf467c3c 100644 --- a/src/gateway/NServiceBus.Gateway/HeaderManagement/GatewayHeaders.cs +++ b/src/NServiceBus.Core/Gateway/HeaderManagement/GatewayHeaders.cs @@ -1,8 +1,8 @@ namespace NServiceBus.Gateway.HeaderManagement { public class GatewayHeaders - { - public const string AutoAck = "NServiceBus.AutoAck"; + { + public const string AutoAck = "NServiceBus.AutoAck"; public const string DatabusKey = "NServiceBus.Gateway.DataBusKey"; public const string IsGatewayMessage = "NServiceBus.Gateway"; diff --git a/src/NServiceBus.Core/Gateway/HeaderManagement/GatewayReturnInfo.cs b/src/NServiceBus.Core/Gateway/HeaderManagement/GatewayReturnInfo.cs new file mode 100644 index 00000000000..a5599b73d28 --- /dev/null +++ b/src/NServiceBus.Core/Gateway/HeaderManagement/GatewayReturnInfo.cs @@ -0,0 +1,8 @@ +namespace NServiceBus.Gateway.HeaderManagement +{ + public class GatewayReturnInfo + { + public string From { get; set; } + public string ReplyToAddress { get; set; } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Gateway/HeaderManagement/HeaderMapper.cs b/src/NServiceBus.Core/Gateway/HeaderManagement/HeaderMapper.cs new file mode 100644 index 00000000000..1ded3c07af4 --- /dev/null +++ b/src/NServiceBus.Core/Gateway/HeaderManagement/HeaderMapper.cs @@ -0,0 +1,104 @@ +namespace NServiceBus.Gateway.HeaderManagement +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Transports.Msmq; + + public class HeaderMapper + { + public static TransportMessage Map(IDictionary from) + { + if (!from.ContainsKey(GatewayHeaders.IsGatewayMessage)) + return new TransportMessage(); + + var headers = ExtractHeaders(from); + var to = new TransportMessage(from[NServiceBus + Id], headers); + + to.CorrelationId = @from[NServiceBus + CorrelationId] ?? to.Id; + + bool recoverable; + if(bool.TryParse(from[NServiceBus + Recoverable], out recoverable)) + to.Recoverable = recoverable; + + TimeSpan timeToBeReceived; + TimeSpan.TryParse(from[NServiceBus + TimeToBeReceived], out timeToBeReceived); + to.TimeToBeReceived = timeToBeReceived; + + if (to.TimeToBeReceived < TimeSpan.FromSeconds(1)) + to.TimeToBeReceived = TimeSpan.FromSeconds(1); + + return to; + } + + static Dictionary ExtractHeaders(IDictionary from) + { + var result = new Dictionary(); + + foreach (string header in from.Keys) + { + if (header.Contains(NServiceBus + Headers.HeaderName)) + { + result.Add(header.Replace(NServiceBus + Headers.HeaderName + ".", String.Empty),from[header]); + } + } + + return result; + } + + public static void Map(TransportMessage from, IDictionary to) + { + to[NServiceBus + Id] = from.Id; + to[NServiceBus + CorrelationId] = GetCorrelationForBackwardsCompatibility(from); + to[NServiceBus + Recoverable] = from.Recoverable.ToString(); + to[NServiceBus + TimeToBeReceived] = from.TimeToBeReceived.ToString(); + to[NServiceBus + ReplyToAddress] = from.ReplyToAddress.ToString(); + + SetBackwardsCompatibilityHeaders(to); + + if (from.Headers.ContainsKey(ReplyToAddress)) + to[Headers.RouteTo] = from.Headers[ReplyToAddress]; + + from.Headers.ToList() + .ForEach(header =>to[NServiceBus + Headers.HeaderName + "." + header.Key] = header.Value); + } + + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "5.0")] + static void SetBackwardsCompatibilityHeaders(IDictionary to) + { + if (Configure.HasComponent()) + { + to[NServiceBus + IdForCorrelation] = to[NServiceBus + CorrelationId]; + } + } + + [ObsoleteEx(Message = "No need for this in v5", RemoveInVersion = "5.0", TreatAsErrorFromVersion = "5.0")] + static string GetCorrelationForBackwardsCompatibility(TransportMessage message) + { + var correlationIdToStore = message.CorrelationId; + + if (Configure.HasComponent()) + { + Guid correlationId; + + if (Guid.TryParse(message.CorrelationId, out correlationId)) + { + correlationIdToStore = message.CorrelationId + "\\0";//msmq required the id's to be in the {guid}\{incrementing number} format so we need to fake a \0 at the end to make it compatible + } + } + + return correlationIdToStore; + } + + public const string NServiceBus = "NServiceBus."; + public const string Id = "Id"; + public const string CallType = "CallType"; + const string CorrelationId = "CorrelationId"; + const string Recoverable = "Recoverable"; + const string ReplyToAddress = "ReplyToAddress"; + const string TimeToBeReceived = "TimeToBeReceived"; + + const string CorrIdHeader = "CorrId"; + const string IdForCorrelation = "IdForCorrelation"; + } +} diff --git a/src/NServiceBus.Core/Gateway/Notifications/IMessageNotifier.cs b/src/NServiceBus.Core/Gateway/Notifications/IMessageNotifier.cs new file mode 100644 index 00000000000..ee6d95298f4 --- /dev/null +++ b/src/NServiceBus.Core/Gateway/Notifications/IMessageNotifier.cs @@ -0,0 +1,7 @@ +namespace NServiceBus.Gateway.Notifications +{ + public interface IMessageNotifier : INotifyAboutMessages + { + void RaiseMessageForwarded(string fromChannel, string toChannel, TransportMessage message); + } +} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Notifications/INotifyAboutMessages.cs b/src/NServiceBus.Core/Gateway/Notifications/INotifyAboutMessages.cs similarity index 76% rename from src/gateway/NServiceBus.Gateway/Notifications/INotifyAboutMessages.cs rename to src/NServiceBus.Core/Gateway/Notifications/INotifyAboutMessages.cs index 42c0979788f..b9cb903ff33 100644 --- a/src/gateway/NServiceBus.Gateway/Notifications/INotifyAboutMessages.cs +++ b/src/NServiceBus.Core/Gateway/Notifications/INotifyAboutMessages.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Gateway.Notifications +namespace NServiceBus.Gateway.Notifications { using System; diff --git a/src/gateway/NServiceBus.Gateway/Notifications/MessageNotifier.cs b/src/NServiceBus.Core/Gateway/Notifications/MessageNotifier.cs similarity index 89% rename from src/gateway/NServiceBus.Gateway/Notifications/MessageNotifier.cs rename to src/NServiceBus.Core/Gateway/Notifications/MessageNotifier.cs index 260b7ac3735..62218f8969d 100644 --- a/src/gateway/NServiceBus.Gateway/Notifications/MessageNotifier.cs +++ b/src/NServiceBus.Core/Gateway/Notifications/MessageNotifier.cs @@ -1,13 +1,11 @@ -namespace NServiceBus.Gateway.Notifications +namespace NServiceBus.Gateway.Notifications { using System; - using Unicast.Transport; public class MessageNotifier : IMessageNotifier { public event EventHandler MessageForwarded; - void IMessageNotifier.RaiseMessageForwarded(string from, string to, TransportMessage message) { if (MessageForwarded != null) diff --git a/src/gateway/NServiceBus.Gateway/Notifications/MessageReceivedOnChannelArgs.cs b/src/NServiceBus.Core/Gateway/Notifications/MessageReceivedOnChannelArgs.cs similarity index 75% rename from src/gateway/NServiceBus.Gateway/Notifications/MessageReceivedOnChannelArgs.cs rename to src/NServiceBus.Core/Gateway/Notifications/MessageReceivedOnChannelArgs.cs index 4ca84bd514c..836abd1bf64 100644 --- a/src/gateway/NServiceBus.Gateway/Notifications/MessageReceivedOnChannelArgs.cs +++ b/src/NServiceBus.Core/Gateway/Notifications/MessageReceivedOnChannelArgs.cs @@ -1,7 +1,6 @@ -namespace NServiceBus.Gateway.Notifications +namespace NServiceBus.Gateway.Notifications { using System; - using Unicast.Transport; public class MessageReceivedOnChannelArgs : EventArgs { diff --git a/src/NServiceBus.Core/Gateway/Persistence/IPersistMessages.cs b/src/NServiceBus.Core/Gateway/Persistence/IPersistMessages.cs new file mode 100644 index 00000000000..580c3a4cefb --- /dev/null +++ b/src/NServiceBus.Core/Gateway/Persistence/IPersistMessages.cs @@ -0,0 +1,39 @@ +namespace NServiceBus.Gateway.Persistence +{ + using System; + using System.Collections.Generic; + using System.IO; + + /// + /// Provides the basic functionality to persist Gateway messages. + /// + public interface IPersistMessages + { + /// + /// When implemented in a class, stores a gateway message. + /// + /// Message identifier. + /// Message time received. + /// The Message. + /// Ant associated message headers. + /// true if success, otherwise false. + bool InsertMessage(string clientId, DateTime timeReceived, Stream message, IDictionary headers); + + /// + /// When implemented in a class, updates the message with a status of acknowledged. + /// + /// Message identifier. + /// The Message. + /// Ant associated message headers. + /// true if success, otherwise false. + bool AckMessage(string clientId, out byte[] message, out IDictionary headers); + + /// + /// When implemented in a class, updates the message headers. + /// + /// Message identifier. + /// Header key to update. + /// New value. + void UpdateHeader(string clientId, string headerKey, string newValue); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Gateway/Persistence/InMemoryPersistence.cs b/src/NServiceBus.Core/Gateway/Persistence/InMemoryPersistence.cs new file mode 100644 index 00000000000..1c98aa2f3a6 --- /dev/null +++ b/src/NServiceBus.Core/Gateway/Persistence/InMemoryPersistence.cs @@ -0,0 +1,90 @@ +namespace NServiceBus.Gateway.Persistence +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + + public class InMemoryPersistence : IPersistMessages + { + readonly IList storage = new List(); + + public bool InsertMessage(string clientId, DateTime timeReceived, Stream messageData, IDictionary headers) + { + lock(storage) + { + if (storage.Any(m => m.ClientId == clientId)) + return false; + + var messageInfo = new MessageInfo + { + ClientId = clientId, + At = timeReceived, + Message = new byte[messageData.Length], + Headers = headers + }; + + messageData.Read(messageInfo.Message, 0, messageInfo.Message.Length); + storage.Add(messageInfo); + } + + return true; + } + + public bool AckMessage(string clientId, out byte[] message, out IDictionary headers) + { + message = null; + headers = null; + + lock(storage) + { + var messageToAck = + storage.FirstOrDefault(m => !m.Acknowledged && m.ClientId == clientId); + + if (messageToAck == null || messageToAck.Acknowledged) + return false; + + messageToAck.Acknowledged = true; + + message = messageToAck.Message; + headers = messageToAck.Headers; + + return true; + } + } + + public void UpdateHeader(string clientId, string headerKey, string newValue) + { + lock (storage) + { + var message = storage.First(m => m.ClientId == clientId); + + + message.Headers[headerKey] = newValue; + } + } + + public int DeleteDeliveredMessages(DateTime until) + { + lock(storage) + { + var toDelete = storage.Where(m => m.At < until).ToList(); + + return toDelete.Count(m => storage.Remove(m)); + } + } + } + + public class MessageInfo + { + public string ClientId { get; set; } + + public DateTime At { get; set; } + + public byte[] Message { get; set; } + + public IDictionary Headers { get; set; } + + public bool Acknowledged { get; set; } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Gateway/Persistence/Raven/GatewayMessage.cs b/src/NServiceBus.Core/Gateway/Persistence/Raven/GatewayMessage.cs new file mode 100644 index 00000000000..80a0242b575 --- /dev/null +++ b/src/NServiceBus.Core/Gateway/Persistence/Raven/GatewayMessage.cs @@ -0,0 +1,18 @@ +namespace NServiceBus.Gateway.Persistence.Raven +{ + using System; + using System.Collections.Generic; + + public class GatewayMessage + { + public IDictionary Headers { get; set; } + + public DateTime TimeReceived { get; set; } + + public string Id { get; set; } + + public byte[] OriginalMessage { get; set; } + + public bool Acknowledged { get; set; } + } +} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Persistence/Raven/RavenDBPersistence.cs b/src/NServiceBus.Core/Gateway/Persistence/Raven/RavenDBPersistence.cs similarity index 78% rename from src/gateway/NServiceBus.Gateway/Persistence/Raven/RavenDBPersistence.cs rename to src/NServiceBus.Core/Gateway/Persistence/Raven/RavenDBPersistence.cs index 78e204c03c7..4089f85717d 100644 --- a/src/gateway/NServiceBus.Gateway/Persistence/Raven/RavenDBPersistence.cs +++ b/src/NServiceBus.Core/Gateway/Persistence/Raven/RavenDBPersistence.cs @@ -1,19 +1,17 @@ -namespace NServiceBus.Gateway.Persistence.Raven +namespace NServiceBus.Gateway.Persistence.Raven { using System; using System.Collections.Generic; using System.IO; - using global::Raven.Abstractions.Exceptions; + using NServiceBus.Persistence.Raven; using global::Raven.Client; - using Persistence; + using ConcurrencyException = global::Raven.Abstractions.Exceptions.ConcurrencyException; public class RavenDbPersistence : IPersistMessages { - readonly IDocumentStore store; - - public RavenDbPersistence(IDocumentStore store) + public RavenDbPersistence(StoreAccessor storeAccessor) { - this.store = store; + store = storeAccessor.Store; } public bool InsertMessage(string clientId, DateTime timeReceived, Stream messageStream, IDictionary headers) @@ -28,7 +26,7 @@ public bool InsertMessage(string clientId, DateTime timeReceived, Stream message }; messageStream.Read(gatewayMessage.OriginalMessage, 0, (int)messageStream.Length); - using (var session = store.OpenSession()) + using (var session = OpenSession()) { session.Advanced.UseOptimisticConcurrency = true; session.Store(gatewayMessage); @@ -51,7 +49,7 @@ public bool AckMessage(string clientId, out byte[] message, out IDictionary(EscapeClientId(clientId)); @@ -74,7 +72,7 @@ public bool AckMessage(string clientId, out byte[] message, out IDictionary(EscapeClientId(clientId)).Headers[headerKey] = newValue; @@ -86,5 +84,16 @@ public static string EscapeClientId(string clientId) { return clientId.Replace("\\", "_"); } + + IDocumentSession OpenSession() + { + var session = store.OpenSession(); + + session.Advanced.AllowNonAuthoritativeInformation = false; + + return session; + } + + private readonly IDocumentStore store; } } \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Persistence/Sql/Schema.sql b/src/NServiceBus.Core/Gateway/Persistence/Sql/Schema.sql similarity index 98% rename from src/gateway/NServiceBus.Gateway/Persistence/Sql/Schema.sql rename to src/NServiceBus.Core/Gateway/Persistence/Sql/Schema.sql index f30a1834f26..7b5e2266dec 100644 --- a/src/gateway/NServiceBus.Gateway/Persistence/Sql/Schema.sql +++ b/src/NServiceBus.Core/Gateway/Persistence/Sql/Schema.sql @@ -1,4 +1,4 @@ -BEGIN TRANSACTION +BEGIN TRANSACTION SET QUOTED_IDENTIFIER ON SET ARITHABORT ON SET NUMERIC_ROUNDABORT OFF diff --git a/src/gateway/NServiceBus.Gateway/Persistence/Sql/SqlPersistence.cs b/src/NServiceBus.Core/Gateway/Persistence/Sql/SqlPersistence.cs similarity index 93% rename from src/gateway/NServiceBus.Gateway/Persistence/Sql/SqlPersistence.cs rename to src/NServiceBus.Core/Gateway/Persistence/Sql/SqlPersistence.cs index 6c0322763d1..8a9a1cff9f8 100644 --- a/src/gateway/NServiceBus.Gateway/Persistence/Sql/SqlPersistence.cs +++ b/src/NServiceBus.Core/Gateway/Persistence/Sql/SqlPersistence.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Gateway.Persistence.Sql +namespace NServiceBus.Gateway.Persistence.Sql { using System; using System.Collections.Generic; @@ -6,6 +6,7 @@ using System.IO; using System.Runtime.Serialization.Formatters.Binary; + [ObsoleteEx(Message = "Please use UseNHibernateGatewayPersister() in the NServiceBus.NHibernate assembly instead.", RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0")] public class SqlPersistence:IPersistMessages { public string ConnectionString { get; set; } @@ -44,12 +45,12 @@ public bool InsertMessage(string clientId, DateTime timeReceived, Stream message if (ms == null) messageParam.Value = message; else - messageParam.Value = ms.GetBuffer(); + messageParam.Value = ms.ToArray(); cmd.Parameters.Add(messageParam); var headersParam = cmd.CreateParameter(); headersParam.ParameterName = "@Headers"; - headersParam.Value = stream.GetBuffer(); + headersParam.Value = stream.ToArray(); cmd.Parameters.Add(headersParam); results = cmd.ExecuteNonQuery(); diff --git a/src/gateway/NServiceBus.Gateway/Receiving/ConfigurationBasedChannelManager.cs b/src/NServiceBus.Core/Gateway/Receiving/ConfigurationBasedChannelManager.cs similarity index 86% rename from src/gateway/NServiceBus.Gateway/Receiving/ConfigurationBasedChannelManager.cs rename to src/NServiceBus.Core/Gateway/Receiving/ConfigurationBasedChannelManager.cs index c44e8e6d825..5e565a26163 100644 --- a/src/gateway/NServiceBus.Gateway/Receiving/ConfigurationBasedChannelManager.cs +++ b/src/NServiceBus.Core/Gateway/Receiving/ConfigurationBasedChannelManager.cs @@ -1,33 +1,32 @@ -namespace NServiceBus.Gateway.Receiving -{ - using System; - using System.Collections.Generic; - using System.Linq; - using Channels; - using NServiceBus.Config; - - public class ConfigurationBasedChannelManager : IMangageReceiveChannels - { - readonly IEnumerable channels; - - public ConfigurationBasedChannelManager() - { - channels = Configure.ConfigurationSource.GetConfiguration().GetChannels(); - - } - - public IEnumerable GetReceiveChannels() - { - return channels; - } - - public Channel GetDefaultChannel() - { - var defaultChannel = channels.Where(c => c.Default).SingleOrDefault(); - - if (defaultChannel == null) - defaultChannel = channels.First(); - return defaultChannel; - } - } +namespace NServiceBus.Gateway.Receiving +{ + using System.Collections.Generic; + using System.Linq; + using Channels; + using NServiceBus.Config; + + public class ConfigurationBasedChannelManager : IManageReceiveChannels + { + readonly IEnumerable channels; + + public ConfigurationBasedChannelManager() + { + channels = Configure.ConfigurationSource.GetConfiguration().GetChannels(); + + } + + public IEnumerable GetReceiveChannels() + { + return channels; + } + + public Channel GetDefaultChannel() + { + var defaultChannel = channels.Where(c => c.Default).SingleOrDefault(); + + if (defaultChannel == null) + defaultChannel = channels.First(); + return defaultChannel; + } + } } \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Receiving/ConventionBasedChannelManager.cs b/src/NServiceBus.Core/Gateway/Receiving/ConventionBasedChannelManager.cs similarity index 85% rename from src/gateway/NServiceBus.Gateway/Receiving/ConventionBasedChannelManager.cs rename to src/NServiceBus.Core/Gateway/Receiving/ConventionBasedChannelManager.cs index e7cbedcafd3..2c7fa06cb63 100644 --- a/src/gateway/NServiceBus.Gateway/Receiving/ConventionBasedChannelManager.cs +++ b/src/NServiceBus.Core/Gateway/Receiving/ConventionBasedChannelManager.cs @@ -1,25 +1,24 @@ -namespace NServiceBus.Gateway.Receiving -{ - using System; - using System.Collections.Generic; - using System.Linq; - using Channels; - - public class ConventionBasedChannelManager : IMangageReceiveChannels - { - public IEnumerable GetReceiveChannels() - { - yield return new ReceiveChannel() - { - Address = string.Format("http://localhost/{0}/",Configure.EndpointName), - Type = "Http", - NumberOfWorkerThreads = 1 - }; - } - - public Channel GetDefaultChannel() - { - return GetReceiveChannels().First(); - } - } +namespace NServiceBus.Gateway.Receiving +{ + using System.Collections.Generic; + using System.Linq; + using Channels; + + public class ConventionBasedChannelManager : IManageReceiveChannels + { + public IEnumerable GetReceiveChannels() + { + yield return new ReceiveChannel() + { + Address = string.Format("http://localhost/{0}/",Configure.EndpointName), + Type = "Http", + NumberOfWorkerThreads = 1 + }; + } + + public Channel GetDefaultChannel() + { + return GetReceiveChannels().First(); + } + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Gateway/Receiving/GatewayReceiver.cs b/src/NServiceBus.Core/Gateway/Receiving/GatewayReceiver.cs new file mode 100644 index 00000000000..f2f8e278ef9 --- /dev/null +++ b/src/NServiceBus.Core/Gateway/Receiving/GatewayReceiver.cs @@ -0,0 +1,94 @@ +namespace NServiceBus.Gateway.Receiving +{ + using System.Collections.Generic; + using Channels; + using Features; + using Logging; + using Notifications; + using ObjectBuilder; + using Routing; + using Satellites; + using Settings; + using Transports; + + public class GatewayReceiver : ISatellite + { + private static readonly ILog Logger = LogManager.GetLogger(typeof(GatewayReceiver)); + private readonly ICollection activeReceivers; + + public GatewayReceiver() + { + activeReceivers = new List(); + } + + public ISendMessages MessageSender { get; set; } + public IManageReceiveChannels ChannelManager { get; set; } + public IRouteMessagesToEndpoints EndpointRouter { get; set; } + public IBuilder builder { get; set; } + + public void Stop() + { + Logger.InfoFormat("Receiver is shutting down"); + + foreach (IReceiveMessagesFromSites channelReceiver in activeReceivers) + { + Logger.InfoFormat("Stopping channel - {0}", channelReceiver.GetType()); + + channelReceiver.MessageReceived -= MessageReceivedOnChannel; + + channelReceiver.Dispose(); + } + + activeReceivers.Clear(); + + Logger.InfoFormat("Receiver shutdown complete"); + } + + public bool Handle(TransportMessage message) + { + return true; + } + + public Address InputAddress + { + get { return null; } + } + + public bool Disabled + { + get { return !Feature.IsEnabled(); } + } + + public void Start() + { + replyToAddress = SettingsHolder.Get
    ("Gateway.InputAddress"); + + foreach (ReceiveChannel receiveChannel in ChannelManager.GetReceiveChannels()) + { + var receiver = builder.Build(); + + receiver.MessageReceived += MessageReceivedOnChannel; + receiver.Start(receiveChannel, receiveChannel.NumberOfWorkerThreads); + activeReceivers.Add(receiver); + + Logger.InfoFormat("Receive channel started: {0}", receiveChannel); + } + } + + private void MessageReceivedOnChannel(object sender, MessageReceivedOnChannelArgs e) + { + TransportMessage messageToSend = e.Message; + + messageToSend.ReplyToAddress = replyToAddress; + + Address destination = EndpointRouter.GetDestinationFor(messageToSend); + + Logger.Info("Sending message to " + destination); + + MessageSender.Send(messageToSend, destination); + } + + Address replyToAddress; + + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Gateway/Receiving/IManageReceiveChannels.cs b/src/NServiceBus.Core/Gateway/Receiving/IManageReceiveChannels.cs new file mode 100644 index 00000000000..4188cfb7526 --- /dev/null +++ b/src/NServiceBus.Core/Gateway/Receiving/IManageReceiveChannels.cs @@ -0,0 +1,11 @@ +namespace NServiceBus.Gateway.Receiving +{ + using System.Collections.Generic; + using Channels; + + public interface IManageReceiveChannels + { + IEnumerable GetReceiveChannels(); + Channel GetDefaultChannel(); + } +} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Receiving/IReceiveMessagesFromSites.cs b/src/NServiceBus.Core/Gateway/Receiving/IReceiveMessagesFromSites.cs similarity index 86% rename from src/gateway/NServiceBus.Gateway/Receiving/IReceiveMessagesFromSites.cs rename to src/NServiceBus.Core/Gateway/Receiving/IReceiveMessagesFromSites.cs index 996ae74f87f..9a27143de94 100644 --- a/src/gateway/NServiceBus.Gateway/Receiving/IReceiveMessagesFromSites.cs +++ b/src/NServiceBus.Core/Gateway/Receiving/IReceiveMessagesFromSites.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Gateway.Receiving +namespace NServiceBus.Gateway.Receiving { using System; using Channels; diff --git a/src/gateway/NServiceBus.Gateway/Receiving/IdempotentChannelReceiver.cs b/src/NServiceBus.Core/Gateway/Receiving/IdempotentChannelReceiver.cs similarity index 85% rename from src/gateway/NServiceBus.Gateway/Receiving/IdempotentChannelReceiver.cs rename to src/NServiceBus.Core/Gateway/Receiving/IdempotentChannelReceiver.cs index 2ed225d0bfe..bc4c68b9ec3 100644 --- a/src/gateway/NServiceBus.Gateway/Receiving/IdempotentChannelReceiver.cs +++ b/src/NServiceBus.Core/Gateway/Receiving/IdempotentChannelReceiver.cs @@ -1,175 +1,188 @@ -namespace NServiceBus.Gateway.Receiving -{ - using System; - using System.Collections.Generic; - using System.Transactions; - using Channels; - using Channels.Http; - using DataBus; - using HeaderManagement; - using Unicast.Transport; - using log4net; - using Notifications; - using Persistence; - using Sending; - using Utils; - - public class IdempotentChannelReceiver : IReceiveMessagesFromSites - { - public IdempotentChannelReceiver(IChannelFactory channelFactory, IPersistMessages persister) - { - this.channelFactory = channelFactory; - this.persister = persister; - } - - public event EventHandler MessageReceived; - - public IDataBus DataBus { get; set; } - - - public void Start(Channel channel, int numWorkerThreads) - { - - channelReceiver = channelFactory.GetReceiver(channel.Type); - - channelReceiver.DataReceived += DataReceivedOnChannel; - channelReceiver.Start(channel.Address,numWorkerThreads); - } - - void DataReceivedOnChannel(object sender, DataReceivedOnChannelArgs e) - { - using (e.Data) - { - var callInfo = GetCallInfo(e); - - Logger.DebugFormat("Received message of type {0} for client id: {1}", callInfo.Type, callInfo.ClientId); - - using (var scope = DefaultTransactionScope()) - { - switch (callInfo.Type) - { - case CallType.Submit: HandleSubmit(callInfo); break; - case CallType.DatabusProperty: HandleDatabusProperty(callInfo); break; - case CallType.Ack: HandleAck(callInfo); break; - } - - scope.Complete(); - } - - } - } - - static TransactionScope DefaultTransactionScope() - { - return new TransactionScope(TransactionScopeOption.Required, - new TransactionOptions - { - IsolationLevel = IsolationLevel.ReadCommitted, - Timeout = TimeSpan.FromSeconds(30) - }); - } - - CallInfo GetCallInfo(DataReceivedOnChannelArgs receivedData) - { - var headers = receivedData.Headers; - - string callType = headers[GatewayHeaders.CallTypeHeader]; - if (!Enum.IsDefined(typeof(CallType), callType)) - throw new HttpChannelException(400, "Required header '" + GatewayHeaders.CallTypeHeader + "' missing."); - - var type = (CallType)Enum.Parse(typeof(CallType), callType); - - var clientId = headers[GatewayHeaders.ClientIdHeader]; - if (clientId == null) - throw new HttpChannelException(400, "Required header '" + GatewayHeaders.ClientIdHeader + "' missing."); - - var md5 = headers[HttpHeaders.ContentMd5Key]; - - if (md5 == null) - throw new HttpChannelException(400, "Required header '" + HttpHeaders.ContentMd5Key + "' missing."); - - var hash = Hasher.Hash(receivedData.Data); - - if (receivedData.Data.Length > 0 && hash != md5) - throw new HttpChannelException(412, "MD5 hash received does not match hash calculated on server. Consider resubmitting."); - - - return new CallInfo - { - ClientId = clientId, - Type = type, - Headers = headers, - Data = receivedData.Data, - AutoAck = headers.ContainsKey(GatewayHeaders.AutoAck) - }; - } - - void HandleSubmit(CallInfo callInfo) - { - persister.InsertMessage(callInfo.ClientId, DateTime.UtcNow, callInfo.Data, callInfo.Headers); - - if(callInfo.AutoAck) - HandleAck(callInfo); - } - - void HandleDatabusProperty(CallInfo callInfo) - { - if (DataBus == null) - throw new InvalidOperationException("Databus transmission received without a databus configured"); - - TimeSpan timeToBeReceived; - - if (!TimeSpan.TryParse(callInfo.Headers["NServiceBus.TimeToBeReceived"], out timeToBeReceived)) - timeToBeReceived = TimeSpan.FromHours(1); - - string newDatabusKey; - - using (callInfo.Data) - newDatabusKey = DataBus.Put(callInfo.Data, timeToBeReceived); - - var specificDataBusHeaderToUpdate = callInfo.Headers[GatewayHeaders.DatabusKey]; - - persister.UpdateHeader(callInfo.ClientId, specificDataBusHeaderToUpdate, newDatabusKey); - } - - void HandleAck(CallInfo callInfo) - { - byte[] outMessage; - IDictionary outHeaders; - - if (!persister.AckMessage(callInfo.ClientId, out outMessage, out outHeaders)) - { - Logger.InfoFormat("Message with id: {0} is already acked, dropping the request", callInfo.ClientId); - return; - } - - var msg = new TransportMessage - { - Body = outMessage, - Headers = new Dictionary(), - MessageIntent = MessageIntentEnum.Send, - Recoverable = true - }; - - - if (outHeaders.ContainsKey(GatewayHeaders.IsGatewayMessage)) - HeaderMapper.Map(outHeaders, msg); - - - MessageReceived(this, new MessageReceivedOnChannelArgs { Message = msg }); - } - - public void Dispose() - { - channelReceiver.DataReceived -= DataReceivedOnChannel; - channelReceiver.Dispose(); - } - - IChannelReceiver channelReceiver; - readonly IChannelFactory channelFactory; - readonly IPersistMessages persister; - - static readonly ILog Logger = LogManager.GetLogger("NServiceBus.Gateway"); - - } -} +namespace NServiceBus.Gateway.Receiving +{ + using System; + using System.Collections.Generic; + using System.Transactions; + using Channels; + using Channels.Http; + using DataBus; + using HeaderManagement; + using Logging; + using Notifications; + using Persistence; + using Sending; + using Utils; + + public class IdempotentChannelReceiver : IReceiveMessagesFromSites + { + public IdempotentChannelReceiver(IChannelFactory channelFactory, IPersistMessages persister) + { + this.channelFactory = channelFactory; + this.persister = persister; + } + + public event EventHandler MessageReceived; + + public IDataBus DataBus { get; set; } + + public void Start(Channel channel, int numWorkerThreads) + { + + channelReceiver = channelFactory.GetReceiver(channel.Type); + + channelReceiver.DataReceived += DataReceivedOnChannel; + channelReceiver.Start(channel.Address,numWorkerThreads); + } + + void DataReceivedOnChannel(object sender, DataReceivedOnChannelArgs e) + { + using (e.Data) + { + var callInfo = GetCallInfo(e); + + Logger.DebugFormat("Received message of type {0} for client id: {1}", callInfo.Type, callInfo.ClientId); + + using (var scope = DefaultTransactionScope()) + { + switch (callInfo.Type) + { + case CallType.Submit: HandleSubmit(callInfo); break; + case CallType.DatabusProperty: HandleDatabusProperty(callInfo); break; + case CallType.Ack: HandleAck(callInfo); break; + } + + scope.Complete(); + } + + } + } + + static TransactionScope DefaultTransactionScope() + { + return new TransactionScope(TransactionScopeOption.Required, + new TransactionOptions + { + IsolationLevel = IsolationLevel.ReadCommitted, + Timeout = TimeSpan.FromSeconds(30) + }); + } + + CallInfo GetCallInfo(DataReceivedOnChannelArgs receivedData) + { + var headers = receivedData.Headers; + + string callType = headers[GatewayHeaders.CallTypeHeader]; + if (!Enum.IsDefined(typeof(CallType), callType)) + throw new HttpChannelException(400, "Required header '" + GatewayHeaders.CallTypeHeader + "' missing."); + + var type = (CallType)Enum.Parse(typeof(CallType), callType); + + var clientId = headers[GatewayHeaders.ClientIdHeader]; + if (clientId == null) + throw new HttpChannelException(400, "Required header '" + GatewayHeaders.ClientIdHeader + "' missing."); + + var md5 = headers[HttpHeaders.ContentMd5Key]; + + if (md5 == null) + throw new HttpChannelException(400, "Required header '" + HttpHeaders.ContentMd5Key + "' missing."); + + var hash = Hasher.Hash(receivedData.Data); + + if (receivedData.Data.Length > 0 && hash != md5) + throw new HttpChannelException(412, "MD5 hash received does not match hash calculated on server. Consider resubmitting."); + + + return new CallInfo + { + ClientId = clientId, + Type = type, + Headers = headers, + Data = receivedData.Data, + AutoAck = headers.ContainsKey(GatewayHeaders.AutoAck) + }; + } + + void HandleSubmit(CallInfo callInfo) + { + persister.InsertMessage(callInfo.ClientId, DateTime.UtcNow, callInfo.Data, callInfo.Headers); + + if(callInfo.AutoAck) + HandleAck(callInfo); + } + + void HandleDatabusProperty(CallInfo callInfo) + { + if (DataBus == null) + throw new InvalidOperationException("Databus transmission received without a databus configured"); + + TimeSpan timeToBeReceived; + + if (!TimeSpan.TryParse(callInfo.Headers["NServiceBus.TimeToBeReceived"], out timeToBeReceived)) + timeToBeReceived = TimeSpan.FromHours(1); + + string newDatabusKey; + + using (callInfo.Data) + newDatabusKey = DataBus.Put(callInfo.Data, timeToBeReceived); + + var specificDataBusHeaderToUpdate = callInfo.Headers[GatewayHeaders.DatabusKey]; + + persister.UpdateHeader(callInfo.ClientId, specificDataBusHeaderToUpdate, newDatabusKey); + } + + void HandleAck(CallInfo callInfo) + { + byte[] outMessage; + IDictionary outHeaders; + + if (!persister.AckMessage(callInfo.ClientId, out outMessage, out outHeaders)) + { + Logger.InfoFormat("Message with id: {0} is already acked, dropping the request", callInfo.ClientId); + return; + } + + + var msg = HeaderMapper.Map(outHeaders); + + msg.Body = outMessage; + + MessageReceived(this, new MessageReceivedOnChannelArgs { Message = msg }); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + // Dispose managed resources. + channelReceiver.DataReceived -= DataReceivedOnChannel; + channelReceiver.Dispose(); + } + + disposed = true; + } + + ~IdempotentChannelReceiver() + { + Dispose(false); + } + + bool disposed; + IChannelReceiver channelReceiver; + readonly IChannelFactory channelFactory; + readonly IPersistMessages persister; + + static readonly ILog Logger = LogManager.GetLogger(typeof(IdempotentChannelReceiver)); + + } +} diff --git a/src/NServiceBus.Core/Gateway/Routing/Endpoints/DefaultEndpointRouter.cs b/src/NServiceBus.Core/Gateway/Routing/Endpoints/DefaultEndpointRouter.cs new file mode 100644 index 00000000000..bca4be413c6 --- /dev/null +++ b/src/NServiceBus.Core/Gateway/Routing/Endpoints/DefaultEndpointRouter.cs @@ -0,0 +1,12 @@ +namespace NServiceBus.Gateway.Routing.Endpoints +{ + public class DefaultEndpointRouter : IRouteMessagesToEndpoints + { + public Address MainInputAddress { get; set; } + + public Address GetDestinationFor(TransportMessage messageToSend) + { + return MainInputAddress; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Gateway/Routing/IRouteMessagesToEndpoints.cs b/src/NServiceBus.Core/Gateway/Routing/IRouteMessagesToEndpoints.cs new file mode 100644 index 00000000000..b1d7106e97c --- /dev/null +++ b/src/NServiceBus.Core/Gateway/Routing/IRouteMessagesToEndpoints.cs @@ -0,0 +1,7 @@ +namespace NServiceBus.Gateway.Routing +{ + public interface IRouteMessagesToEndpoints + { + Address GetDestinationFor(TransportMessage messageToSend); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Gateway/Routing/IRouteMessagesToSites.cs b/src/NServiceBus.Core/Gateway/Routing/IRouteMessagesToSites.cs new file mode 100644 index 00000000000..6d9ac889679 --- /dev/null +++ b/src/NServiceBus.Core/Gateway/Routing/IRouteMessagesToSites.cs @@ -0,0 +1,10 @@ +namespace NServiceBus.Gateway.Routing +{ + using System.Collections.Generic; + + public interface IRouteMessagesToSites + + { + IEnumerable GetDestinationSitesFor(TransportMessage messageToDispatch); + } +} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Routing/Site.cs b/src/NServiceBus.Core/Gateway/Routing/Site.cs similarity index 77% rename from src/gateway/NServiceBus.Gateway/Routing/Site.cs rename to src/NServiceBus.Core/Gateway/Routing/Site.cs index 18162123b7b..f00555a5096 100644 --- a/src/gateway/NServiceBus.Gateway/Routing/Site.cs +++ b/src/NServiceBus.Core/Gateway/Routing/Site.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Gateway.Routing +namespace NServiceBus.Gateway.Routing { using Channels; diff --git a/src/gateway/NServiceBus.Gateway/Routing/Sites/ConfigurationBasedSiteRouter.cs b/src/NServiceBus.Core/Gateway/Routing/Sites/ConfigurationBasedSiteRouter.cs similarity index 91% rename from src/gateway/NServiceBus.Gateway/Routing/Sites/ConfigurationBasedSiteRouter.cs rename to src/NServiceBus.Core/Gateway/Routing/Sites/ConfigurationBasedSiteRouter.cs index 8b5e4d3c2ec..ad0fba68df0 100644 --- a/src/gateway/NServiceBus.Gateway/Routing/Sites/ConfigurationBasedSiteRouter.cs +++ b/src/NServiceBus.Core/Gateway/Routing/Sites/ConfigurationBasedSiteRouter.cs @@ -1,9 +1,7 @@ -namespace NServiceBus.Gateway.Routing.Sites +namespace NServiceBus.Gateway.Routing.Sites { using System.Collections.Generic; using NServiceBus.Config; - using Unicast.Transport; - using Site = Site; public class ConfigurationBasedSiteRouter : IRouteMessagesToSites { diff --git a/src/gateway/NServiceBus.Gateway/Routing/Sites/KeyPrefixConventionSiteRouter.cs b/src/NServiceBus.Core/Gateway/Routing/Sites/KeyPrefixConventionSiteRouter.cs similarity index 92% rename from src/gateway/NServiceBus.Gateway/Routing/Sites/KeyPrefixConventionSiteRouter.cs rename to src/NServiceBus.Core/Gateway/Routing/Sites/KeyPrefixConventionSiteRouter.cs index f3cfb08d3dc..de6cbf8e77f 100644 --- a/src/gateway/NServiceBus.Gateway/Routing/Sites/KeyPrefixConventionSiteRouter.cs +++ b/src/NServiceBus.Core/Gateway/Routing/Sites/KeyPrefixConventionSiteRouter.cs @@ -1,8 +1,7 @@ -namespace NServiceBus.Gateway.Routing.Sites +namespace NServiceBus.Gateway.Routing.Sites { using System.Collections.Generic; using Channels; - using Unicast.Transport; public class KeyPrefixConventionSiteRouter : IRouteMessagesToSites { diff --git a/src/gateway/NServiceBus.Gateway/Routing/Sites/OriginatingSiteHeaderRouter.cs b/src/NServiceBus.Core/Gateway/Routing/Sites/OriginatingSiteHeaderRouter.cs similarity index 95% rename from src/gateway/NServiceBus.Gateway/Routing/Sites/OriginatingSiteHeaderRouter.cs rename to src/NServiceBus.Core/Gateway/Routing/Sites/OriginatingSiteHeaderRouter.cs index 5acb03af923..5b3f6c6e2dd 100644 --- a/src/gateway/NServiceBus.Gateway/Routing/Sites/OriginatingSiteHeaderRouter.cs +++ b/src/NServiceBus.Core/Gateway/Routing/Sites/OriginatingSiteHeaderRouter.cs @@ -2,7 +2,6 @@ namespace NServiceBus.Gateway.Routing.Sites { using System.Collections.Generic; using Channels; - using Unicast.Transport; public class OriginatingSiteHeaderRouter : IRouteMessagesToSites { diff --git a/src/gateway/NServiceBus.Gateway/Sending/CallInfo.cs b/src/NServiceBus.Core/Gateway/Sending/CallInfo.cs similarity index 91% rename from src/gateway/NServiceBus.Gateway/Sending/CallInfo.cs rename to src/NServiceBus.Core/Gateway/Sending/CallInfo.cs index 1f69ba5738b..81856fdfaf2 100644 --- a/src/gateway/NServiceBus.Gateway/Sending/CallInfo.cs +++ b/src/NServiceBus.Core/Gateway/Sending/CallInfo.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Gateway.Sending +namespace NServiceBus.Gateway.Sending { using System.Collections.Generic; using System.IO; @@ -8,7 +8,7 @@ public class CallInfo public string ClientId { get; set; } public CallType Type { get; set; } public IDictionary Headers { get; set; } - public Stream Data { get; set; } + public Stream Data { get; set; } public bool AutoAck { get; set; } } diff --git a/src/NServiceBus.Core/Gateway/Sending/GatewaySender.cs b/src/NServiceBus.Core/Gateway/Sending/GatewaySender.cs new file mode 100644 index 00000000000..796be394974 --- /dev/null +++ b/src/NServiceBus.Core/Gateway/Sending/GatewaySender.cs @@ -0,0 +1,103 @@ +namespace NServiceBus.Gateway.Sending +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Features; + using Notifications; + using ObjectBuilder; + using Receiving; + using Routing; + using Satellites; + using Settings; + using Transports; + using Unicast; + + public class GatewaySender : ISatellite + { + + public UnicastBus UnicastBus { get; set; } + public IBuilder Builder { get; set; } + public IManageReceiveChannels ChannelManager { get; set; } + public IMessageNotifier Notifier { get; set; } + public ISendMessages MessageSender { get; set; } + + public bool Handle(TransportMessage message) + { + IList destinationSites = GetDestinationSitesFor(message); + + //if there is more than 1 destination we break it up into multiple messages + if (destinationSites.Count() > 1) + { + foreach (Site destinationSite in destinationSites) + { + CloneAndSendLocal(message, destinationSite); + } + + return true; + } + + Site destination = destinationSites.FirstOrDefault(); + + if (destination == null) + throw new InvalidOperationException("No destination found for message"); + + SendToSite(message, destination); + + return true; + } + + public Address InputAddress + { + get { return SettingsHolder.Get
    ("Gateway.InputAddress"); } + } + + public bool Disabled + { + get { return !Feature.IsEnabled(); } + } + + public void Start() + { + } + + public void Stop() + { + } + + private IList GetDestinationSitesFor(TransportMessage messageToDispatch) + { + return Builder.BuildAll() + .SelectMany(r => r.GetDestinationSitesFor(messageToDispatch)).ToList(); + } + + private void CloneAndSendLocal(TransportMessage messageToDispatch, Site destinationSite) + { + //todo - do we need to clone? check with Jonathan O + messageToDispatch.Headers[Headers.DestinationSites] = destinationSite.Key; + + MessageSender.Send(messageToDispatch, InputAddress); + } + + private void SendToSite(TransportMessage transportMessage, Site targetSite) + { + transportMessage.Headers[Headers.OriginatingSite] = GetDefaultAddressForThisSite(); + + //todo - derive this from the message and the channeltype + Builder.Build() + .Forward(transportMessage, targetSite); + + Notifier.RaiseMessageForwarded(Address.Local.ToString(), targetSite.Channel.Type, transportMessage); + + if (UnicastBus != null && UnicastBus.ForwardReceivedMessagesTo != null && + UnicastBus.ForwardReceivedMessagesTo != Address.Undefined) + MessageSender.Send(transportMessage, UnicastBus.ForwardReceivedMessagesTo); + } + + + private string GetDefaultAddressForThisSite() + { + return ChannelManager.GetDefaultChannel().ToString(); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Gateway/Sending/IForwardMessagesToSites.cs b/src/NServiceBus.Core/Gateway/Sending/IForwardMessagesToSites.cs new file mode 100644 index 00000000000..fd6d113470d --- /dev/null +++ b/src/NServiceBus.Core/Gateway/Sending/IForwardMessagesToSites.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Gateway.Sending +{ + using Routing; + + public interface IForwardMessagesToSites + { + void Forward(TransportMessage message,Site targetSite); + } +} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Sending/IdempotentChannelForwarder.cs b/src/NServiceBus.Core/Gateway/Sending/IdempotentChannelForwarder.cs similarity index 90% rename from src/gateway/NServiceBus.Gateway/Sending/IdempotentChannelForwarder.cs rename to src/NServiceBus.Core/Gateway/Sending/IdempotentChannelForwarder.cs index 22d66238345..0414e427a4a 100644 --- a/src/gateway/NServiceBus.Gateway/Sending/IdempotentChannelForwarder.cs +++ b/src/NServiceBus.Core/Gateway/Sending/IdempotentChannelForwarder.cs @@ -1,80 +1,84 @@ -namespace NServiceBus.Gateway.Sending -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using Channels; - using Channels.Http; - using DataBus; - using HeaderManagement; - using Unicast.Transport; - using log4net; - using Routing; - using Utils; - - public class IdempotentChannelForwarder : IForwardMessagesToSites - { - private readonly IChannelFactory channelFactory; - - public IdempotentChannelForwarder(IChannelFactory channelFactory) - { - this.channelFactory = channelFactory; - } - - public void Forward(TransportMessage message, Site targetSite) - { - var headers = new Dictionary(StringComparer.CurrentCultureIgnoreCase); - - HeaderMapper.Map(message, headers); - - var channelSender = channelFactory.GetSender(targetSite.Channel.Type); - - using (var messagePayload = new MemoryStream(message.Body)) - Transmit(channelSender, targetSite, CallType.Submit, headers, messagePayload); - - TransmittDataBusProperties(channelSender, targetSite, headers); - - Transmit(channelSender, targetSite, CallType.Ack, headers, new MemoryStream()); - } - - private void Transmit(IChannelSender channelSender, Site targetSite, CallType callType, - IDictionary headers, Stream data) - { - headers[GatewayHeaders.IsGatewayMessage] = Boolean.TrueString; - headers[HeaderMapper.NServiceBus + HeaderMapper.CallType] = Enum.GetName(typeof (CallType), callType); - headers[HttpHeaders.ContentMd5Key] = Hasher.Hash(data); - - Logger.DebugFormat("Sending message - {0} to: {1}", callType, targetSite.Channel.Address); - - channelSender.Send(targetSite.Channel.Address, headers, data); - } - - private void TransmittDataBusProperties(IChannelSender channelSender, Site targetSite, - IDictionary headers) - { - var headersToSend = new Dictionary(headers); - - foreach (string headerKey in headers.Keys.Where(headerKey => headerKey.Contains(DATABUS_PREFIX))) - { - if (DataBus == null) - throw new InvalidOperationException( - "Can't send a message with a databus property without a databus configured"); - - headersToSend[GatewayHeaders.DatabusKey] = headerKey; - - var databusKeyForThisProperty = headers[headerKey]; - - using (var stream = DataBus.Get(databusKeyForThisProperty)) - Transmit(channelSender, targetSite, CallType.DatabusProperty, headersToSend, stream); - } - } - - - public IDataBus DataBus { get; set; } - - private const string DATABUS_PREFIX = "NServiceBus.DataBus."; - - private static readonly ILog Logger = LogManager.GetLogger("NServiceBus.Gateway"); - } -} +namespace NServiceBus.Gateway.Sending +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using Channels; + using Channels.Http; + using DataBus; + using HeaderManagement; + using Logging; + using Routing; + using Utils; + + public class IdempotentChannelForwarder : IForwardMessagesToSites + { + private readonly IChannelFactory channelFactory; + + public IdempotentChannelForwarder(IChannelFactory channelFactory) + { + this.channelFactory = channelFactory; + } + + public void Forward(TransportMessage message, Site targetSite) + { + var headers = new Dictionary(StringComparer.CurrentCultureIgnoreCase); + + HeaderMapper.Map(message, headers); + + var channelSender = channelFactory.GetSender(targetSite.Channel.Type); + + using (var messagePayload = new MemoryStream(message.Body)) + { + Transmit(channelSender, targetSite, CallType.Submit, headers, messagePayload); + } + + TransmittDataBusProperties(channelSender, targetSite, headers); + + using (var stream = new MemoryStream(0)) + { + Transmit(channelSender, targetSite, CallType.Ack, headers, stream); + } + } + + private void Transmit(IChannelSender channelSender, Site targetSite, CallType callType, + IDictionary headers, Stream data) + { + headers[GatewayHeaders.IsGatewayMessage] = Boolean.TrueString; + headers[HeaderMapper.NServiceBus + HeaderMapper.CallType] = Enum.GetName(typeof (CallType), callType); + headers[HttpHeaders.ContentMd5Key] = Hasher.Hash(data); + + Logger.DebugFormat("Sending message - {0} to: {1}", callType, targetSite.Channel.Address); + + channelSender.Send(targetSite.Channel.Address, headers, data); + } + + private void TransmittDataBusProperties(IChannelSender channelSender, Site targetSite, + IDictionary headers) + { + var headersToSend = new Dictionary(headers); + + foreach (string headerKey in headers.Keys.Where(headerKey => headerKey.Contains(DATABUS_PREFIX))) + { + if (DataBus == null) + throw new InvalidOperationException( + "Can't send a message with a databus property without a databus configured"); + + headersToSend[GatewayHeaders.DatabusKey] = headerKey; + + var databusKeyForThisProperty = headers[headerKey]; + + using (var stream = DataBus.Get(databusKeyForThisProperty)) + Transmit(channelSender, targetSite, CallType.DatabusProperty, headersToSend, stream); + } + } + + + public IDataBus DataBus { get; set; } + + private const string DATABUS_PREFIX = "NServiceBus.DataBus."; + + private static readonly ILog Logger = LogManager.GetLogger(typeof(IdempotentChannelForwarder)); + } +} diff --git a/src/gateway/NServiceBus.Gateway/Utils/Hasher.cs b/src/NServiceBus.Core/Gateway/Utils/Hasher.cs similarity index 90% rename from src/gateway/NServiceBus.Gateway/Utils/Hasher.cs rename to src/NServiceBus.Core/Gateway/Utils/Hasher.cs index 2d15bb4f05b..f9dec528522 100644 --- a/src/gateway/NServiceBus.Gateway/Utils/Hasher.cs +++ b/src/NServiceBus.Core/Gateway/Utils/Hasher.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Gateway.Utils +namespace NServiceBus.Gateway.Utils { using System; using System.IO; diff --git a/src/gateway/NServiceBus.Gateway/Utils/StreamExtensions.cs b/src/NServiceBus.Core/Gateway/Utils/StreamExtensions.cs similarity index 100% rename from src/gateway/NServiceBus.Gateway/Utils/StreamExtensions.cs rename to src/NServiceBus.Core/Gateway/Utils/StreamExtensions.cs diff --git a/src/hosting/NServiceBus.Hosting/Configuration/ConfigurationManager.cs b/src/NServiceBus.Core/Hosting/Configuration/ConfigurationManager.cs similarity index 79% rename from src/hosting/NServiceBus.Hosting/Configuration/ConfigurationManager.cs rename to src/NServiceBus.Core/Hosting/Configuration/ConfigurationManager.cs index 95dc5e942a2..ebdbd83ff31 100644 --- a/src/hosting/NServiceBus.Hosting/Configuration/ConfigurationManager.cs +++ b/src/NServiceBus.Core/Hosting/Configuration/ConfigurationManager.cs @@ -1,8 +1,9 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Reflection; -using log4net; -using NServiceBus.ObjectBuilder; +using NServiceBus.Hosting.Helpers; +using NServiceBus.Logging; namespace NServiceBus.Hosting.Configuration { @@ -16,18 +17,19 @@ public class ConfigManager ///
    /// /// - public ConfigManager(IEnumerable assembliesToScan, IConfigureThisEndpoint specifier) + public ConfigManager(List assembliesToScan, IConfigureThisEndpoint specifier) { this.specifier = specifier; - foreach(var a in assembliesToScan) - foreach(var t in a.GetTypes()) - { - if (typeof(IWantCustomInitialization).IsAssignableFrom(t) && !t.IsInterface && !t.IsAbstract && !typeof(IConfigureThisEndpoint).IsAssignableFrom(t)) - toInitialize.Add(t); - if (typeof(IWantToRunAtStartup).IsAssignableFrom(t) && !t.IsInterface && !t.IsAbstract) - toRunAtStartup.Add(t); - } + toInitialize = assembliesToScan + .AllTypesAssignableTo() + .WhereConcrete() + .Where(t => !typeof(IConfigureThisEndpoint).IsAssignableFrom(t)) + .ToList(); + toRunAtStartup = assembliesToScan + .AllTypesAssignableTo() + .WhereConcrete() + .ToList(); } /// @@ -53,7 +55,7 @@ public void ConfigureCustomInitAndStartup() /// public void Startup() { - thingsToRunAtStartup = Configure.Instance.Builder.BuildAll(); + thingsToRunAtStartup = Configure.Instance.Builder.BuildAll().ToList(); if (thingsToRunAtStartup == null) return; @@ -110,10 +112,10 @@ public void Shutdown() } } - private readonly IList toInitialize = new List(); - private readonly IList toRunAtStartup = new List(); + internal List toInitialize ; + internal List toRunAtStartup; private readonly IConfigureThisEndpoint specifier; - private IEnumerable thingsToRunAtStartup; + private IList thingsToRunAtStartup; } } \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting/Configuration/EndpointNameAttribute.cs b/src/NServiceBus.Core/Hosting/Configuration/EndpointNameAttribute.cs similarity index 96% rename from src/hosting/NServiceBus.Hosting/Configuration/EndpointNameAttribute.cs rename to src/NServiceBus.Core/Hosting/Configuration/EndpointNameAttribute.cs index 2ba01180234..1c5a229d9ed 100644 --- a/src/hosting/NServiceBus.Hosting/Configuration/EndpointNameAttribute.cs +++ b/src/NServiceBus.Core/Hosting/Configuration/EndpointNameAttribute.cs @@ -1,26 +1,26 @@ -using System; - -namespace NServiceBus -{ - /// - /// Used to specify the name of the current endpoint. - /// Will be used as the name of the input queue as well. - /// - public class EndpointNameAttribute : Attribute - { - /// - /// Used to specify the name of the current endpoint. - /// Will be used as the name of the input queue as well. - /// - /// - public EndpointNameAttribute(string name) - { - Name = name; - } - - /// - /// The name of the endpoint. - /// - public string Name { get; set; } - } -} +using System; + +namespace NServiceBus +{ + /// + /// Used to specify the name of the current endpoint. + /// Will be used as the name of the input queue as well. + /// + public class EndpointNameAttribute : Attribute + { + /// + /// Used to specify the name of the current endpoint. + /// Will be used as the name of the input queue as well. + /// + /// + public EndpointNameAttribute(string name) + { + Name = name; + } + + /// + /// The name of the endpoint. + /// + public string Name { get; set; } + } +} diff --git a/src/hosting/NServiceBus.Hosting/Configuration/EndpointSLAAttribute.cs b/src/NServiceBus.Core/Hosting/Configuration/EndpointSLAAttribute.cs similarity index 96% rename from src/hosting/NServiceBus.Hosting/Configuration/EndpointSLAAttribute.cs rename to src/NServiceBus.Core/Hosting/Configuration/EndpointSLAAttribute.cs index 21f5bdb1290..91e78dc795b 100644 --- a/src/hosting/NServiceBus.Hosting/Configuration/EndpointSLAAttribute.cs +++ b/src/NServiceBus.Core/Hosting/Configuration/EndpointSLAAttribute.cs @@ -1,47 +1,47 @@ -namespace NServiceBus -{ - using System; - using System.Linq; - - /// - /// Defines the SLA for this endpoint. Needs to be set on the endpoint configuration class - /// - public class EndpointSLAAttribute : Attribute - { - /// - /// Used to define the SLA for this endpoint - /// - /// A timespan - public EndpointSLAAttribute(string sla) - { - SLA = sla; - } - - /// - /// The SLA of the endpoint. - /// - public string SLA { get; set; } - } - - class SLAInitalizer : IWantCustomInitialization,IWantTheEndpointConfig - { - public void Init() - { - var arr = Config.GetType().GetCustomAttributes(typeof(EndpointSLAAttribute), false); - if (arr.Length != 1) - return; - - - var slaString = (arr.First() as EndpointSLAAttribute).SLA; - - TimeSpan sla; - - if (!TimeSpan.TryParse(slaString, out sla)) - throw new InvalidOperationException("A invalid SLA string has been defined - " + slaString); - - Configure.Instance.SetEndpointSLA(sla); - } - - public IConfigureThisEndpoint Config { get; set; } - } +namespace NServiceBus +{ + using System; + using System.Linq; + + /// + /// Defines the SLA for this endpoint. Needs to be set on the endpoint configuration class + /// + public class EndpointSLAAttribute : Attribute + { + /// + /// Used to define the SLA for this endpoint + /// + /// A timespan + public EndpointSLAAttribute(string sla) + { + SLA = sla; + } + + /// + /// The SLA of the endpoint. + /// + public string SLA { get; set; } + } + + class SLAInitalizer : IWantCustomInitialization,IWantTheEndpointConfig + { + public void Init() + { + var arr = Config.GetType().GetCustomAttributes(typeof(EndpointSLAAttribute), false); + if (arr.Length != 1) + return; + + + var slaString = (arr.First() as EndpointSLAAttribute).SLA; + + TimeSpan sla; + + if (!TimeSpan.TryParse(slaString, out sla)) + throw new InvalidOperationException("A invalid SLA string has been defined - " + slaString); + + Configure.Instance.SetEndpointSLA(sla); + } + + public IConfigureThisEndpoint Config { get; set; } + } } \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting/Configuration/IConfigureLogging.cs b/src/NServiceBus.Core/Hosting/Configuration/IConfigureLogging.cs similarity index 100% rename from src/hosting/NServiceBus.Hosting/Configuration/IConfigureLogging.cs rename to src/NServiceBus.Core/Hosting/Configuration/IConfigureLogging.cs diff --git a/src/hosting/NServiceBus.Hosting/Configuration/IConfigureThisEndpoint.cs b/src/NServiceBus.Core/Hosting/Configuration/IConfigureThisEndpoint.cs similarity index 100% rename from src/hosting/NServiceBus.Hosting/Configuration/IConfigureThisEndpoint.cs rename to src/NServiceBus.Core/Hosting/Configuration/IConfigureThisEndpoint.cs diff --git a/src/hosting/NServiceBus.Hosting/Configuration/IWant.cs b/src/NServiceBus.Core/Hosting/Configuration/IWant.cs similarity index 89% rename from src/hosting/NServiceBus.Hosting/Configuration/IWant.cs rename to src/NServiceBus.Core/Hosting/Configuration/IWant.cs index 2b82aa4f512..6e480d1c1a7 100644 --- a/src/hosting/NServiceBus.Hosting/Configuration/IWant.cs +++ b/src/NServiceBus.Core/Hosting/Configuration/IWant.cs @@ -1,5 +1,5 @@ -using System; -using System.Collections.Generic; +using System; +using System.Collections.Generic; using NServiceBus.Hosting.Profiles; namespace NServiceBus @@ -35,6 +35,7 @@ public interface IWantCustomLogging /// Implementers will be invoked when the endpoint starts up. /// Dependency injection is provided for these types. ///
    + [ObsoleteEx(Replacement = "NServiceBus!NServiceBus.IWantToRunWhenBusStartsAndStops", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] public interface IWantToRunAtStartup { /// @@ -59,15 +60,15 @@ public interface IWantTheEndpointConfig /// IConfigureThisEndpoint Config { get; set; } } - /// - /// Implementors will recieve by the list of active Profiles. - /// Implementors must implement . - /// - public interface IWantTheListOfActiveProfiles - { - /// - /// ActiveProfiles list will be set by the infrastructure. + /// + /// Implementors will recieve the list of active Profiles from the . + /// Implementors must implement . + /// + public interface IWantTheListOfActiveProfiles + { + /// + /// ActiveProfiles list will be set by the infrastructure. /// - IEnumerable ActiveProfiles { get; set; } + IEnumerable ActiveProfiles { get; set; } } } diff --git a/src/hosting/NServiceBus.Hosting/GenericHost.cs b/src/NServiceBus.Core/Hosting/GenericHost.cs similarity index 76% rename from src/hosting/NServiceBus.Hosting/GenericHost.cs rename to src/NServiceBus.Core/Hosting/GenericHost.cs index 585f41aaded..61cf074c3e3 100644 --- a/src/hosting/NServiceBus.Hosting/GenericHost.cs +++ b/src/NServiceBus.Core/Hosting/GenericHost.cs @@ -1,161 +1,171 @@ -using System; -using System.Collections.Generic; -using System.Reflection; -using log4net; -using NServiceBus.Hosting.Configuration; -using NServiceBus.Hosting.Helpers; -using NServiceBus.Hosting.Profiles; -using NServiceBus.Hosting.Roles; -using NServiceBus.Hosting.Wcf; - -namespace NServiceBus.Hosting -{ - using System.Linq; - using Installation; - - /// - /// A generic host that can be used to provide hosting services in different environments - /// - public class GenericHost : IHost - { - /// - /// Creates and starts the bus as per the configuration - /// - public void Start() - { - try - { - PerformConfiguration(); - - var bus = Configure.Instance.CreateBus(); - if (bus != null) - bus.Start(); - - configManager.Startup(); - wcfManager.Startup(); - } - catch (Exception ex) - { - //we log the error here in order to avoid issues with non serializable exceptions - //going across the appdomain back to topshelf - LogManager.GetLogger(typeof(GenericHost)).Fatal(ex); - - throw new Exception("Exception when starting endpoint, error has been logged. Reason: " + ex.Message, ex); - } - } - - /// - /// Finalize - /// - public void Stop() - { - configManager.Shutdown(); - wcfManager.Shutdown(); - } - - /// - /// When installing as windows service (/install), run infrastructure installers - /// - /// - public void Install() where TEnvironment : IEnvironment - { - PerformConfiguration(); - Configure.Instance.ForInstallationOn().Install(); - } - - void PerformConfiguration() - { - if (specifier is IWantCustomLogging) - (specifier as IWantCustomLogging).Init(); - else - { - var loggingConfigurer = profileManager.GetLoggingConfigurer(); - loggingConfigurer.Configure(specifier); - } - - if (specifier is IWantCustomInitialization) - { - try - { - if (specifier is IWantCustomLogging) - { - bool called = false; - //make sure we don't call the Init method again, unless there's an explicit impl - var initMap = specifier.GetType().GetInterfaceMap(typeof (IWantCustomInitialization)); - foreach (var m in initMap.TargetMethods) - if (!m.IsPublic && m.Name == "NServiceBus.IWantCustomInitialization.Init") - { - (specifier as IWantCustomInitialization).Init(); - called = true; - } - - if (!called) - { - //call the regular Init method if IWantCustomLogging was an explicitly implemented method - var logMap = specifier.GetType().GetInterfaceMap(typeof (IWantCustomLogging)); - foreach (var tm in logMap.TargetMethods) - if (!tm.IsPublic && tm.Name == "NServiceBus.IWantCustomLogging.Init") - (specifier as IWantCustomInitialization).Init(); - } - } - else - (specifier as IWantCustomInitialization).Init(); - } - catch (NullReferenceException ex) - { - throw new NullReferenceException("NServiceBus has detected a null reference in your initialization code." + - " This could be due to trying to use NServiceBus.Configure before it was ready." + - " One possible solution is to inherit from IWantCustomInitialization in a different class" + - " than the one that inherits from IConfigureThisEndpoint, and put your code there.", - ex); - } - } - - if (!Configure.WithHasBeenCalled()) - Configure.With(); - - if (!Configure.BuilderIsConfigured()) - Configure.Instance.DefaultBuilder(); - - roleManager.ConfigureBusForEndpoint(specifier); - - configManager.ConfigureCustomInitAndStartup(); - } - - - /// - /// Accepts the type which will specify the users custom configuration. - /// This type should implement . - /// - /// - /// - /// - /// - /// Assemblies full name that were scanned. - public GenericHost(IConfigureThisEndpoint specifier, string[] args, IEnumerable defaultProfiles, string endpointName, IEnumerable scannableAssembliesFullName = null) - { - this.specifier = specifier; - Configure.GetEndpointNameAction = () => endpointName; - - List assembliesToScan; - - if (scannableAssembliesFullName == null) - assembliesToScan = AssemblyScanner.GetScannableAssemblies().Assemblies; - else - assembliesToScan = scannableAssembliesFullName.Select(Assembly.Load).ToList(); - - profileManager = new ProfileManager(assembliesToScan, specifier, args, defaultProfiles); - ProfileActivator.ProfileManager = profileManager; - - configManager = new ConfigManager(assembliesToScan, specifier); - wcfManager = new WcfManager(); - roleManager = new RoleManager(assembliesToScan); - } - - readonly IConfigureThisEndpoint specifier; - readonly ProfileManager profileManager; - readonly ConfigManager configManager; - readonly WcfManager wcfManager; - readonly RoleManager roleManager; - } +namespace NServiceBus.Hosting +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + using Configuration; + using Helpers; + using Installation; + using Logging; + using Profiles; + using Roles; + using Settings; + using Utils; + using Wcf; + + /// + /// A generic host that can be used to provide hosting services in different environments + /// + public class GenericHost : IHost + { + /// + /// Creates and starts the bus as per the configuration + /// + public void Start() + { + PerformConfiguration(); + + bus = Configure.Instance.CreateBus(); + if (bus != null && !SettingsHolder.Get("Endpoint.SendOnly")) + { + bus.Start(); + } + + configManager.Startup(); + wcfManager.Startup(); + } + + /// + /// Finalize + /// + public void Stop() + { + configManager.Shutdown(); + wcfManager.Shutdown(); + + if (bus != null) + { + bus.Shutdown(); + bus.Dispose(); + + bus = null; + } + } + + /// + /// When installing as windows service (/install), run infrastructure installers + /// + /// + public void Install(string username) where TEnvironment : IEnvironment + { + PerformConfiguration(); + Configure.Instance.ForInstallationOn(username).Install(); + } + + void PerformConfiguration() + { + if (specifier is IWantCustomLogging) + (specifier as IWantCustomLogging).Init(); + else + { + var loggingConfigurers = profileManager.GetLoggingConfigurer(); + foreach (var loggingConfigurer in loggingConfigurers) + { + loggingConfigurer.Configure(specifier); + } + } + + if (specifier is IWantCustomInitialization) + { + try + { + if (specifier is IWantCustomLogging) + { + bool called = false; + //make sure we don't call the Init method again, unless there's an explicit impl + var initMap = specifier.GetType().GetInterfaceMap(typeof(IWantCustomInitialization)); + foreach (var m in initMap.TargetMethods) + if (!m.IsPublic && m.Name == "NServiceBus.IWantCustomInitialization.Init") + { + (specifier as IWantCustomInitialization).Init(); + called = true; + } + + if (!called) + { + //call the regular Init method if IWantCustomLogging was an explicitly implemented method + var logMap = specifier.GetType().GetInterfaceMap(typeof(IWantCustomLogging)); + foreach (var tm in logMap.TargetMethods) + if (!tm.IsPublic && tm.Name == "NServiceBus.IWantCustomLogging.Init") + (specifier as IWantCustomInitialization).Init(); + } + } + else + (specifier as IWantCustomInitialization).Init(); + } + catch (NullReferenceException ex) + { + throw new NullReferenceException("NServiceBus has detected a null reference in your initialization code." + + " This could be due to trying to use NServiceBus.Configure before it was ready." + + " One possible solution is to inherit from IWantCustomInitialization in a different class" + + " than the one that inherits from IConfigureThisEndpoint, and put your code there.", + ex); + } + } + + if (!Configure.WithHasBeenCalled()) + Configure.With(); + + if (!Configure.BuilderIsConfigured()) + Configure.Instance.DefaultBuilder(); + + roleManager.ConfigureBusForEndpoint(specifier); + + configManager.ConfigureCustomInitAndStartup(); + } + + + /// + /// Accepts the type which will specify the users custom configuration. + /// This type should implement . + /// + /// + /// + /// + /// + /// Assemblies full name that were scanned. + public GenericHost(IConfigureThisEndpoint specifier, string[] args, List defaultProfiles, string endpointName, IEnumerable scannableAssembliesFullName = null) + { + this.specifier = specifier; + + if (String.IsNullOrEmpty(endpointName)) + { + endpointName = specifier.GetType().Namespace ?? specifier.GetType().Assembly.GetName().Name; + } + + Configure.GetEndpointNameAction = () => endpointName; + Configure.DefineEndpointVersionRetriever = () => FileVersionRetriever.GetFileVersion(specifier.GetType()); + List assembliesToScan; + + if (scannableAssembliesFullName == null) + assembliesToScan = AssemblyScanner.GetScannableAssemblies().Assemblies; + else + assembliesToScan = scannableAssembliesFullName.Select(Assembly.Load).ToList(); + + profileManager = new ProfileManager(assembliesToScan, specifier, args, defaultProfiles); + ProfileActivator.ProfileManager = profileManager; + + configManager = new ConfigManager(assembliesToScan, specifier); + wcfManager = new WcfManager(); + roleManager = new RoleManager(assembliesToScan); + } + + IStartableBus bus; + readonly IConfigureThisEndpoint specifier; + readonly ProfileManager profileManager; + readonly ConfigManager configManager; + readonly WcfManager wcfManager; + readonly RoleManager roleManager; + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Hosting/Helpers/AssemblyListExtensions.cs b/src/NServiceBus.Core/Hosting/Helpers/AssemblyListExtensions.cs new file mode 100644 index 00000000000..42727df33d1 --- /dev/null +++ b/src/NServiceBus.Core/Hosting/Helpers/AssemblyListExtensions.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using NServiceBus.Utils.Reflection; + +namespace NServiceBus.Hosting.Helpers +{ + internal static class AssemblyListExtensions + { + public static IEnumerable AllTypes(this IEnumerable assemblies) + { + foreach (var assembly in assemblies) + foreach (var type in assembly.GetTypes()) + { + yield return type; + } + } + + public static IEnumerable AllTypesAssignableTo(this IEnumerable assemblies) + { + var type = typeof(T); + return assemblies.Where(type.Assembly.IsReferencedByOrEquals) + .AllTypes() + .Where(t => t != type && type.IsAssignableFrom(t)); + } + + public static IEnumerable WhereConcrete(this IEnumerable types) + { + return types.Where(x => !x.IsInterface && !x.IsAbstract); + } + + public static IEnumerable AllTypesClosing(this IEnumerable assemblies, Type openGenericType, Type genericArg) + { + return assemblies.Where(openGenericType.Assembly.IsReferencedByOrEquals) + .AllTypes() + .Where(type => type.GetGenericallyContainedType(openGenericType, genericArg) != null); + } + + static bool IsReferencedByOrEquals(this Assembly referenceAssembly, Assembly targetAssembly) + { + var name = referenceAssembly.GetName().Name; + return targetAssembly.GetName().Name == name || targetAssembly.GetReferencedAssemblies().Any(y => y.Name == name); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Hosting/Helpers/AssemblyScanner.cs b/src/NServiceBus.Core/Hosting/Helpers/AssemblyScanner.cs new file mode 100644 index 00000000000..af3bf920a85 --- /dev/null +++ b/src/NServiceBus.Core/Hosting/Helpers/AssemblyScanner.cs @@ -0,0 +1,69 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; + +namespace NServiceBus.Hosting.Helpers +{ + /// + /// Helpers for assembly scanning operations + /// + public class AssemblyScanner + { + /// + /// Gets a list of assemblies that can be scanned and a list of errors that occurred while scanning. + /// + /// + [DebuggerNonUserCode] + public static AssemblyScannerResults GetScannableAssemblies() + { + var baseDir = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory); + var assemblyFiles = baseDir.GetFiles("*.dll", SearchOption.AllDirectories) + .Union(baseDir.GetFiles("*.exe", SearchOption.AllDirectories)); + var results = new AssemblyScannerResults(); + + foreach (var assemblyFile in assemblyFiles) + { + Assembly assembly; + + try + { + assembly = Assembly.LoadFrom(assemblyFile.FullName); + } + catch (BadImageFormatException bif) + { + var error = new ErrorWhileScanningAssemblies(bif, "Could not load " + assemblyFile.FullName + + ". Consider using 'Configure.With(AllAssemblies.Except(\"" + assemblyFile.Name + "\"))' to tell NServiceBus not to load this file."); + results.Errors.Add(error); + continue; + } + + try + { + //will throw if assembly cannot be loaded + assembly.GetTypes(); + } + catch (ReflectionTypeLoadException e) + { + var sb = new StringBuilder(); + sb.Append(string.Format("Could not scan assembly: {0}. Exception message {1}.", assemblyFile.FullName, e)); + if (e.LoaderExceptions.Any()) + { + sb.Append(Environment.NewLine + "Scanned type errors: "); + foreach (var ex in e.LoaderExceptions) + sb.Append(Environment.NewLine + ex.Message); + } + var error = new ErrorWhileScanningAssemblies(e, sb.ToString()); + results.Errors.Add(error); + continue; + } + + results.Assemblies.Add(assembly); + } + + return results; + } + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting/Helpers/AssemblyScannerResults.cs b/src/NServiceBus.Core/Hosting/Helpers/AssemblyScannerResults.cs similarity index 100% rename from src/hosting/NServiceBus.Hosting/Helpers/AssemblyScannerResults.cs rename to src/NServiceBus.Core/Hosting/Helpers/AssemblyScannerResults.cs diff --git a/src/hosting/NServiceBus.Hosting/IHost.cs b/src/NServiceBus.Core/Hosting/IHost.cs similarity index 75% rename from src/hosting/NServiceBus.Hosting/IHost.cs rename to src/NServiceBus.Core/Hosting/IHost.cs index e8ddc4cc7a5..15523175662 100644 --- a/src/hosting/NServiceBus.Hosting/IHost.cs +++ b/src/NServiceBus.Core/Hosting/IHost.cs @@ -1,7 +1,7 @@ namespace NServiceBus.Hosting -{ - using Installation; - +{ + using Installation; + /// /// Identifies a host /// @@ -15,12 +15,11 @@ public interface IHost /// /// Does shutdown work. /// - void Stop(); - - - /// - /// Performs nessesary installation - /// - void Install() where TEnvironment : IEnvironment; + void Stop(); + + /// + /// Performs necessary installation + /// + void Install(string username) where TEnvironment : IEnvironment; } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Hosting/Profiles/IHandleAnyProfile.cs b/src/NServiceBus.Core/Hosting/Profiles/IHandleAnyProfile.cs new file mode 100644 index 00000000000..a090ba68290 --- /dev/null +++ b/src/NServiceBus.Core/Hosting/Profiles/IHandleAnyProfile.cs @@ -0,0 +1,11 @@ +namespace NServiceBus.Hosting.Profiles +{ + /// + /// Abstraction for code that will be called that will take dependent action based upon + /// the Profile(s) that are active. Useful for implementing special functionality if + /// a specific profile is activated, and implementing default functionality otherwise. + /// + public interface IHandleAnyProfile : IHandleProfile, IWantTheListOfActiveProfiles + { + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting/Profiles/IHandleProfile.cs b/src/NServiceBus.Core/Hosting/Profiles/IHandleProfile.cs similarity index 100% rename from src/hosting/NServiceBus.Hosting/Profiles/IHandleProfile.cs rename to src/NServiceBus.Core/Hosting/Profiles/IHandleProfile.cs diff --git a/src/hosting/NServiceBus.Hosting/Profiles/IProfile.cs b/src/NServiceBus.Core/Hosting/Profiles/IProfile.cs similarity index 100% rename from src/hosting/NServiceBus.Hosting/Profiles/IProfile.cs rename to src/NServiceBus.Core/Hosting/Profiles/IProfile.cs diff --git a/src/hosting/NServiceBus.Hosting/Profiles/ProfileActivator.cs b/src/NServiceBus.Core/Hosting/Profiles/ProfileActivator.cs similarity index 100% rename from src/hosting/NServiceBus.Hosting/Profiles/ProfileActivator.cs rename to src/NServiceBus.Core/Hosting/Profiles/ProfileActivator.cs diff --git a/src/NServiceBus.Core/Hosting/Profiles/ProfileManager.cs b/src/NServiceBus.Core/Hosting/Profiles/ProfileManager.cs new file mode 100644 index 00000000000..cb886ef4a08 --- /dev/null +++ b/src/NServiceBus.Core/Hosting/Profiles/ProfileManager.cs @@ -0,0 +1,166 @@ +namespace NServiceBus.Hosting.Profiles +{ + using System; + using System.Collections.Generic; + using System.Configuration; + using System.Linq; + using System.Reflection; + using Helpers; + using Logging; + using Utils.Reflection; + + /// + /// Scans and loads profile handlers from the given assemblies + /// + public class ProfileManager + { + IEnumerable assembliesToScan; + internal List activeProfiles; + IConfigureThisEndpoint specifier; + + /// + /// Initializes the manager with the assemblies to scan and the endpoint configuration to use + /// + /// + /// + /// + /// + public ProfileManager(List assembliesToScan, IConfigureThisEndpoint specifier, string[] args, List defaultProfiles) + { + this.assembliesToScan = assembliesToScan; + this.specifier = specifier; + + var profilesFromArguments = assembliesToScan + .AllTypesAssignableTo() + .Where(t => args.Any(a => t.FullName.ToLower() == a.ToLower())) + .ToList(); + + if (profilesFromArguments.Count == 0) + { + activeProfiles = new List(defaultProfiles); + } + else + { + var allProfiles = new List(profilesFromArguments); + allProfiles.AddRange(profilesFromArguments.SelectMany(_ => _.GetInterfaces().Where(IsProfile))); + activeProfiles = allProfiles.Distinct().ToList(); + } + } + + static bool IsProfile(Type t) + { + return typeof(IProfile).IsAssignableFrom(t) && t != typeof(IProfile); + } + + + /// + /// Returns an object to configure logging based on the specification and profiles passed in. + /// + /// + public IEnumerable GetLoggingConfigurer() + { + return GetImplementor(typeof(IConfigureLoggingForProfile<>)); + } + + internal IEnumerable GetImplementor(Type openGenericType) where T : class + { + var options = new List(); + foreach (var a in assembliesToScan) + { + foreach (var type in a.GetTypes()) + { + if (typeof(T).IsAssignableFrom(type) && !type.IsInterface && !type.IsAbstract) + { + options.Add(type); + } + } + } + + var configs = activeProfiles + .SelectMany(_ => FindConfigurerForProfile(openGenericType, _, options)) + .ToList(); + + if (configs.Count == 0) + { + var message = string.Format("Could not find a class which implements '{0}'. If you've specified your own profile, try implementing '{0}ForProfile' for your profile.", typeof(T).Name); + throw new ConfigurationErrorsException(message); + } + + return configs.Select(_ => (T)Activator.CreateInstance(_)); + } + + + IEnumerable FindConfigurerForProfile(Type openGenericType, Type profile, List options) + { + if (profile == typeof (object) || profile == null) + { + yield break; + } + + foreach (var option in options) + { + var p = option.GetGenericallyContainedType(openGenericType, typeof(IProfile)); + if (p == profile) + { + yield return option; + } + } + + foreach (var option in FindConfigurerForProfile(openGenericType, profile.BaseType, options)) + { + yield return option; + } + + } + + /// + /// Activates the profile handlers that handle the previously identified active profiles. + /// + /// + public void ActivateProfileHandlers() + { + foreach (var p in activeProfiles) + { + Logger.Info("Going to activate profile: " + p.AssemblyQualifiedName); + } + + var activeHandlers = new List(); + + foreach (var assembly in assembliesToScan) + { + foreach (var type in assembly.GetTypes()) + { + var p = type.GetGenericallyContainedType(typeof (IHandleProfile<>), typeof (IProfile)); + if (p != null) + { + activeHandlers.AddRange(from ap in activeProfiles where (type.IsClass && !type.IsAbstract && p.IsAssignableFrom(ap) && !activeHandlers.Contains(type)) select type); + } + } + } + + var profileHandlers = new List(); + foreach (var h in activeHandlers) + { + var profileHandler = Activator.CreateInstance(h) as IHandleProfile; + var handler = profileHandler as IWantTheListOfActiveProfiles; + if (handler != null) + { + handler.ActiveProfiles = activeProfiles; + } + + profileHandlers.Add(profileHandler); + Logger.Debug("Activating profile handler: " + h.AssemblyQualifiedName); + } + + profileHandlers.Where(ph => ph is IWantTheEndpointConfig) + .ToList() + .ForEach( + ph => (ph as IWantTheEndpointConfig).Config = specifier); + + profileHandlers.ForEach(hp => hp.ProfileActivated()); + } + + + static ILog Logger = LogManager.GetLogger(typeof(ProfileManager)); + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting/Roles/IConfigureRole.cs b/src/NServiceBus.Core/Hosting/Roles/IConfigureRole.cs similarity index 100% rename from src/hosting/NServiceBus.Hosting/Roles/IConfigureRole.cs rename to src/NServiceBus.Core/Hosting/Roles/IConfigureRole.cs diff --git a/src/hosting/NServiceBus.Hosting/Roles/IRole.cs b/src/NServiceBus.Core/Hosting/Roles/IRole.cs similarity index 100% rename from src/hosting/NServiceBus.Hosting/Roles/IRole.cs rename to src/NServiceBus.Core/Hosting/Roles/IRole.cs diff --git a/src/NServiceBus.Core/Hosting/Roles/RoleManager.cs b/src/NServiceBus.Core/Hosting/Roles/RoleManager.cs new file mode 100644 index 00000000000..4a48440635f --- /dev/null +++ b/src/NServiceBus.Core/Hosting/Roles/RoleManager.cs @@ -0,0 +1,100 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Linq; +using System.Reflection; +using NServiceBus.Hosting.Helpers; +using NServiceBus.Logging; +using NServiceBus.Unicast.Config; +using NServiceBus.Utils.Reflection; + +namespace NServiceBus.Hosting.Roles +{ + /// + /// Handles the different roles that are registered + /// + public class RoleManager + { + private readonly IDictionary availableRoles; + private static readonly ILog Logger = LogManager.GetLogger(typeof(RoleManager)); + + /// + /// Creates the manager with the list of assemblies to scan for roles + /// + /// + public RoleManager(IEnumerable assembliesToScan) + { + availableRoles = assembliesToScan.AllTypes() + .Select(t => new { Role = t.GetGenericallyContainedType(typeof(IConfigureRole<>), typeof(IRole)), Configurer = t }) + .Where(x => x.Role != null) + .ToDictionary(key => key.Role, value => value.Configurer); + } + + /// + /// Checks if the specifier contains a given role and uses it to configure the UnicastBus appropriately. + /// + /// + public void ConfigureBusForEndpoint(IConfigureThisEndpoint specifier) + { + ConfigUnicastBus unicastBusConfig = null; + + var roleFound = false; + foreach (var role in availableRoles) + { + var roleType = role.Key; + bool handlesRole; + + + if (roleType.IsGenericType) + { + handlesRole = + specifier.GetType() + .GetInterfaces() + .Any( + x => + x.IsGenericType && + x.GetGenericTypeDefinition() == roleType.GetGenericTypeDefinition()); + } + else + { + handlesRole = roleType.IsInstanceOfType(specifier); + } + + if (!handlesRole) + continue; + roleFound = true; + + //apply role + var roleConfigurer = Activator.CreateInstance(role.Value) as IConfigureRole; + + var config = roleConfigurer.ConfigureRole(specifier); + + if (config != null) + { + if (unicastBusConfig != null) + throw new InvalidOperationException("Only one role can configure the unicastbus"); + + unicastBusConfig = config; + } + + Logger.Info("Role " + roleType + " configured"); + foreach (var markerProfile in GetMarkerRoles(specifier.GetType(), roleType)) + Logger.Info("Role " + markerProfile + " is marked."); + } + if (!roleFound) + { + throw new Exception("Did you forget to specify the endpoint role? Please make sure you specify the endpoint role as either 'AsA_Client','AsA_Host','AsA_Publisher', 'AsA_Server' or some other custom 'IRole'."); + } + } + + private IEnumerable GetMarkerRoles(Type configuredEndpoint, Type roleType) + { + return (from markerProfile in configuredEndpoint.GetInterfaces() + where markerProfile != roleType + where (markerProfile != typeof(IRole)) && (markerProfile.GetInterface(typeof(IRole).ToString()) != null) + select markerProfile.ToString()).ToList(); + } + } + + +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting/Wcf/WcfManager.cs b/src/NServiceBus.Core/Hosting/Wcf/WcfManager.cs similarity index 95% rename from src/hosting/NServiceBus.Hosting/Wcf/WcfManager.cs rename to src/NServiceBus.Core/Hosting/Wcf/WcfManager.cs index fd7fb1ba5fb..eafb4744827 100644 --- a/src/hosting/NServiceBus.Hosting/Wcf/WcfManager.cs +++ b/src/NServiceBus.Core/Hosting/Wcf/WcfManager.cs @@ -1,27 +1,26 @@ namespace NServiceBus.Hosting.Wcf -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.ServiceModel; - using System.ServiceModel.Channels; - using log4net; - +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.ServiceModel; + using System.ServiceModel.Channels; + using Logging; + /// /// Enable users to expose messages as WCF services /// public class WcfManager { private readonly List hosts = new List(); - + /// /// Starts a servicehost for each found service. Defaults to BasicHttpBinding if /// no user specified binding is found /// public void Startup() - { - - foreach (var serviceType in Configure.TypesToScan.Where(t => !t.IsAbstract && IsWcfService(t))) + { + foreach (var serviceType in Configure.TypesToScan.Where(t => !t.IsAbstract && IsWcfService(t))) { var host = new WcfServiceHost(serviceType); @@ -60,7 +59,7 @@ private static bool IsWcfService(Type t) { var args = t.GetGenericArguments(); if (args.Length == 2) - if (args[0].IsMessageType()) + if (MessageConventionExtensions.IsMessageType(args[0])) { var wcfType = typeof(WcfService<,>).MakeGenericType(args); if (wcfType.IsAssignableFrom(t)) diff --git a/src/hosting/NServiceBus.Hosting/Wcf/WcfServiceHost.cs b/src/NServiceBus.Core/Hosting/Wcf/WcfServiceHost.cs similarity index 98% rename from src/hosting/NServiceBus.Hosting/Wcf/WcfServiceHost.cs rename to src/NServiceBus.Core/Hosting/Wcf/WcfServiceHost.cs index 2f20da4cf26..e34e3165aaf 100644 --- a/src/hosting/NServiceBus.Hosting/Wcf/WcfServiceHost.cs +++ b/src/NServiceBus.Core/Hosting/Wcf/WcfServiceHost.cs @@ -3,7 +3,7 @@ using System.ServiceModel; using System.ServiceModel.Channels; using System.ServiceModel.Configuration; -using log4net; +using NServiceBus.Logging; namespace NServiceBus.Hosting.Wcf { diff --git a/src/NServiceBus.Core/IExcludesBuilder.cs b/src/NServiceBus.Core/IExcludesBuilder.cs new file mode 100644 index 00000000000..0544c0502ae --- /dev/null +++ b/src/NServiceBus.Core/IExcludesBuilder.cs @@ -0,0 +1,20 @@ +namespace NServiceBus +{ + using System.Collections.Generic; + using System.Reflection; + + /// + /// Supporting the fluent interface in + /// + public interface IExcludesBuilder : IEnumerable + { + /// + /// Indicate that the given assembly expression should also be excluded. + /// You can call this method multiple times. + /// + /// + /// + /// + IExcludesBuilder And(string assemblyExpression); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/IIncludesBuilder.cs b/src/NServiceBus.Core/IIncludesBuilder.cs new file mode 100644 index 00000000000..a63b888b8c5 --- /dev/null +++ b/src/NServiceBus.Core/IIncludesBuilder.cs @@ -0,0 +1,29 @@ +namespace NServiceBus +{ + using System.Collections.Generic; + using System.Reflection; + + /// + /// Supporting the fluent interface in + /// + public interface IIncludesBuilder : IEnumerable + { + /// + /// Indicate that assemblies matching the given expression should also be included. + /// You can call this method multiple times. + /// + /// + /// + /// + IIncludesBuilder And(string assemblyExpression); + + /// + /// Indicate that assemblies matching the given expression should be excluded. + /// Use the 'And' method to indicate other assemblies to be skipped. + /// + /// + /// + /// + IExcludesBuilder Except(string assemblyExpression); + } +} \ No newline at end of file diff --git a/src/config/NServiceBus.Config/IWantToRunBeforeConfiguration.cs b/src/NServiceBus.Core/IWantToRunBeforeConfiguration.cs similarity index 96% rename from src/config/NServiceBus.Config/IWantToRunBeforeConfiguration.cs rename to src/NServiceBus.Core/IWantToRunBeforeConfiguration.cs index 55e26b007d1..420e38bcfde 100644 --- a/src/config/NServiceBus.Config/IWantToRunBeforeConfiguration.cs +++ b/src/NServiceBus.Core/IWantToRunBeforeConfiguration.cs @@ -1,13 +1,13 @@ -namespace NServiceBus -{ - /// - /// Indicates that this class contains logic that need to be executed before other configuration - /// - public interface IWantToRunBeforeConfiguration - { - /// - /// Invoked before configuration starts - /// - void Init(); - } -} \ No newline at end of file +namespace NServiceBus +{ + /// + /// Indicates that this class contains logic that need to be executed before other configuration + /// + public interface IWantToRunBeforeConfiguration + { + /// + /// Invoked before configuration starts + /// + void Init(); + } +} diff --git a/src/config/NServiceBus.Config/IWantToRunBeforeConfigurationIsFinalized.cs b/src/NServiceBus.Core/IWantToRunBeforeConfigurationIsFinalized.cs similarity index 96% rename from src/config/NServiceBus.Config/IWantToRunBeforeConfigurationIsFinalized.cs rename to src/NServiceBus.Core/IWantToRunBeforeConfigurationIsFinalized.cs index 6679bc01edb..c2a86ab9d2e 100644 --- a/src/config/NServiceBus.Config/IWantToRunBeforeConfigurationIsFinalized.cs +++ b/src/NServiceBus.Core/IWantToRunBeforeConfigurationIsFinalized.cs @@ -1,14 +1,14 @@ -namespace NServiceBus -{ - /// - /// Indicates that this class contains logic that needs to run just before - /// configuration is finalized - /// - public interface IWantToRunBeforeConfigurationIsFinalized - { - /// - /// Invoked before configuration is finalized and locked - /// - void Run(); - } +namespace NServiceBus +{ + /// + /// Indicates that this class contains logic that needs to run just before + /// configuration is finalized + /// + public interface IWantToRunBeforeConfigurationIsFinalized + { + /// + /// Invoked before configuration is finalized and locked + /// + void Run(); + } } \ No newline at end of file diff --git a/src/integration/NServiceBus.Integration.WCF/IWcfService.cs b/src/NServiceBus.Core/IWcfService.cs similarity index 95% rename from src/integration/NServiceBus.Integration.WCF/IWcfService.cs rename to src/NServiceBus.Core/IWcfService.cs index 5a719638bbf..a40a035fc06 100644 --- a/src/integration/NServiceBus.Integration.WCF/IWcfService.cs +++ b/src/NServiceBus.Core/IWcfService.cs @@ -1,8 +1,8 @@ -using System.ServiceModel; -using System; - namespace NServiceBus { + using System; + using System.ServiceModel; + /// /// Service interface for a generic WCF adapter to a messaging endpoint. /// diff --git a/src/NServiceBus.Core/Impersonation/ExtractIncomingPrincipal.cs b/src/NServiceBus.Core/Impersonation/ExtractIncomingPrincipal.cs new file mode 100644 index 00000000000..3b3a53ea543 --- /dev/null +++ b/src/NServiceBus.Core/Impersonation/ExtractIncomingPrincipal.cs @@ -0,0 +1,16 @@ +namespace NServiceBus.Impersonation +{ + using System.Security.Principal; + + /// + /// Allows different authentication techniques to be plugged in. + /// + public interface ExtractIncomingPrincipal + { + /// + /// Gets the principal of the client to be used when handling the message + /// + /// + IPrincipal GetPrincipal(TransportMessage message); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Impersonation/Windows/ConfigureWindowsImpersonation.cs b/src/NServiceBus.Core/Impersonation/Windows/ConfigureWindowsImpersonation.cs new file mode 100644 index 00000000000..e02a85d47ec --- /dev/null +++ b/src/NServiceBus.Core/Impersonation/Windows/ConfigureWindowsImpersonation.cs @@ -0,0 +1,19 @@ +namespace NServiceBus.Impersonation.Windows +{ + /// + /// Configures windows impersonation + /// + public class ConfigureWindowsImpersonation : IWantToRunBeforeConfigurationIsFinalized + { + public void Run() + { + //default to Windows impersonation if no other impersonation is configured + if (Configure.Instance.Configurer.HasComponent()) + return; + + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + } + + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Impersonation/Windows/WindowsIdentityEnricher.cs b/src/NServiceBus.Core/Impersonation/Windows/WindowsIdentityEnricher.cs new file mode 100644 index 00000000000..18f220092a4 --- /dev/null +++ b/src/NServiceBus.Core/Impersonation/Windows/WindowsIdentityEnricher.cs @@ -0,0 +1,21 @@ +namespace NServiceBus.Impersonation.Windows +{ + using System.Threading; + using MessageMutator; + + /// + /// Stamps outgoing messages with the current windows identity + /// + public class WindowsIdentityEnricher : IMutateOutgoingTransportMessages + { + void IMutateOutgoingTransportMessages.MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + + if (transportMessage.Headers.ContainsKey(Headers.WindowsIdentityName)) + transportMessage.Headers.Remove(Headers.WindowsIdentityName); + + transportMessage.Headers.Add(Headers.WindowsIdentityName, Thread.CurrentPrincipal.Identity.Name); + } + } +} + diff --git a/src/NServiceBus.Core/Impersonation/Windows/WindowsImpersonator.cs b/src/NServiceBus.Core/Impersonation/Windows/WindowsImpersonator.cs new file mode 100644 index 00000000000..0c2b58dae7a --- /dev/null +++ b/src/NServiceBus.Core/Impersonation/Windows/WindowsImpersonator.cs @@ -0,0 +1,23 @@ +namespace NServiceBus.Impersonation.Windows +{ + using System.Security.Principal; + + /// + /// Impersonates the client if needed + /// + public class WindowsImpersonator : ExtractIncomingPrincipal + { + public IPrincipal GetPrincipal(TransportMessage message) + { + if (!message.Headers.ContainsKey(Headers.WindowsIdentityName)) + return null; + + var name = message.Headers[Headers.WindowsIdentityName]; + + if (name == null) + return null; + + return new GenericPrincipal(new GenericIdentity(name), new string[0]); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Install.cs b/src/NServiceBus.Core/Install.cs new file mode 100644 index 00000000000..893db303926 --- /dev/null +++ b/src/NServiceBus.Core/Install.cs @@ -0,0 +1,110 @@ +namespace NServiceBus +{ + using System; + using System.Linq; + using System.Security.Principal; + using Installation; + + /// + /// Contains extension methods to the Configure class. + /// + public static class Install + { + /// + /// Indicates which environment is going to be installed, specifying that resources + /// to be created will be provided permissions for the currently logged on user. + /// + /// The environment type. + /// Extension method object. + /// An Installer object whose Install method should be invoked. + public static Installer ForInstallationOn(this Configure config) where T : IEnvironment + { + return ForInstallationOn(config, null); + } + + /// + /// Indicates which environment is going to be installed, specifying that resources + /// to be created will be provided permissions for the user represented by the userToken + /// (where not the currently logged on user) or the currently logged on user. + /// + /// The environment type. + /// Extension method object. + /// The username. + /// An Installer object whose Install method should be invoked. + public static Installer ForInstallationOn(this Configure config, string username) where T : IEnvironment + { + if (config.Configurer == null) + throw new InvalidOperationException("No container found. Please call '.DefaultBuilder()' after 'Configure.With()' before calling this method (or provide an alternative container)."); + + IIdentity identity; + + // Passing a token results in a duplicate identity exception in some cases, you can't compare tokens so this could + // still happen but at least the explicit WindowsIdentity.GetCurrent().Token is avoided now. + if (String.IsNullOrEmpty(username)) + { + identity = WindowsIdentity.GetCurrent(); + } + else + { + identity = new GenericIdentity(username); + } + + return new Installer(identity); + } + } + + /// + /// Resolves objects who implement INeedToInstall and invokes them for the given environment. + /// Assumes that implementors have already been registered in the container. + /// + /// The environment for which the installers should be invoked. + public class Installer where T : IEnvironment + { + static Installer() + { + RunOtherInstallers = true; + } + /// + /// Initializes a new instance of the Installer + /// + /// Identity of the user to be used to setup installer. + public Installer(IIdentity identity) + { + this.identity = identity; + } + + private readonly IIdentity identity; + + /// + /// Gets or sets RunOtherInstallers + /// + public static bool RunOtherInstallers { private get; set; } + + private static bool installedOthersInstallers; + + /// + /// Invokes installers for the given environment + /// + public void Install() + { + Configure.Instance.Initialize(); + + if(RunOtherInstallers) + InstallOtherInstallers(); + } + + /// + /// Invokes only 'Something' - other than infrastructure, installers for the given environment. + /// + private void InstallOtherInstallers() + { + if (installedOthersInstallers) + return; + + Configure.Instance.Builder.BuildAll().ToList() + .ForEach(i=>i.Install(identity.Name)); + + installedOthersInstallers = true; + } + } +} diff --git a/src/NServiceBus.Core/Installation/Environments/Windows.cs b/src/NServiceBus.Core/Installation/Environments/Windows.cs new file mode 100644 index 00000000000..0a6098016cb --- /dev/null +++ b/src/NServiceBus.Core/Installation/Environments/Windows.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Installation.Environments +{ + /// + /// Windows installation environment + /// + public class Windows : IEnvironment + { + } +} diff --git a/src/installation/NServiceBus.Installation/IEnvironment.cs b/src/NServiceBus.Core/Installation/IEnvironment.cs similarity index 76% rename from src/installation/NServiceBus.Installation/IEnvironment.cs rename to src/NServiceBus.Core/Installation/IEnvironment.cs index 746ac74e847..5fa660a298a 100644 --- a/src/installation/NServiceBus.Installation/IEnvironment.cs +++ b/src/NServiceBus.Core/Installation/IEnvironment.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Installation +namespace NServiceBus.Installation { /// /// Interface for Environment diff --git a/src/installation/NServiceBus.Installation/INeedToInstallInfrastructure.cs b/src/NServiceBus.Core/Installation/INeedToInstallInfrastructure.cs similarity index 97% rename from src/installation/NServiceBus.Installation/INeedToInstallInfrastructure.cs rename to src/NServiceBus.Core/Installation/INeedToInstallInfrastructure.cs index 68906a72fb3..46fba3f5474 100644 --- a/src/installation/NServiceBus.Installation/INeedToInstallInfrastructure.cs +++ b/src/NServiceBus.Core/Installation/INeedToInstallInfrastructure.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Installation +namespace NServiceBus.Installation { /// /// Interface invoked by the infrastructure when going to install an endpoint. @@ -14,7 +14,7 @@ public interface INeedToInstallInfrastructure : INeedToInstallSomething /// Interface invoked by the infrastructure when going to install an endpoint for a specific environment. /// Implementors invoked before . /// - /// + /// [ObsoleteEx(Message = "It is possible to use NServiceBus installer or powershell support to accomplish the same thing. Please see http://particular.net/articles/managing-nservicebus-using-powershell for more information.", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] public interface INeedToInstallInfrastructure : INeedToInstallInfrastructure where T : IEnvironment { diff --git a/src/installation/NServiceBus.Installation/INeedToInstallSomething.cs b/src/NServiceBus.Core/Installation/INeedToInstallSomething.cs similarity index 91% rename from src/installation/NServiceBus.Installation/INeedToInstallSomething.cs rename to src/NServiceBus.Core/Installation/INeedToInstallSomething.cs index 59db11af5b8..dc6a3a57e35 100644 --- a/src/installation/NServiceBus.Installation/INeedToInstallSomething.cs +++ b/src/NServiceBus.Core/Installation/INeedToInstallSomething.cs @@ -1,5 +1,3 @@ -using System.Security.Principal; - namespace NServiceBus.Installation { /// @@ -13,7 +11,7 @@ public interface INeedToInstallSomething /// Performs the installation providing permission for the given user. /// /// The user for whom permissions will be given. - void Install(WindowsIdentity identity); + void Install(string identity); } /// diff --git a/src/NServiceBus.Core/Installation/PerformanceMonitorUsersInstaller.cs b/src/NServiceBus.Core/Installation/PerformanceMonitorUsersInstaller.cs new file mode 100644 index 00000000000..77127c9ee98 --- /dev/null +++ b/src/NServiceBus.Core/Installation/PerformanceMonitorUsersInstaller.cs @@ -0,0 +1,102 @@ +namespace NServiceBus.Installation +{ + using System; + using System.Diagnostics; + using System.Security.Principal; + using Environments; + using Logging; + /// + /// Add the identity to the 'Performance Monitor Users' local group + /// + public class PerformanceMonitorUsersInstaller : INeedToInstallSomething + { + static ILog logger = LogManager.GetLogger(typeof(PerformanceMonitorUsersInstaller)); + + public void Install(string identity) + { + //did not use DirectoryEntry to avoid a ref to the DirectoryServices.dll + try + { + if (!IsRunningWithElevatedPrivileges()) + { + logger.InfoFormat(@"Did not attempt to add user '{0}' to group 'Performance Monitor Users' since process is not running with elevate privileges. Processing will continue. To manually perform this action run the following command from an admin console: +net localgroup ""Performance Monitor Users"" ""{0}"" /add", identity); + return; + } + StartProcess(identity); + } + catch (Exception win32Exception) + { + var message = string.Format( + @"Failed adding user '{0}' to group 'Performance Monitor Users' due to an Exception. +To help diagnose the problem try running the following command from an admin console: +net localgroup ""Performance Monitor Users"" ""{0}"" /add", identity); + logger.Warn(message, win32Exception); + } + } + + bool IsRunningWithElevatedPrivileges() + { + using (var windowsIdentity = WindowsIdentity.GetCurrent()) + { + if (windowsIdentity == null) + { + return false; + } + var windowsPrincipal = new WindowsPrincipal(windowsIdentity); + return windowsPrincipal.IsInRole(WindowsBuiltInRole.Administrator); + } + } + + void StartProcess(string identity) + { + //net localgroup "Performance Monitor Users" "{user account}" /add + var startInfo = new ProcessStartInfo + { + CreateNoWindow = true, + UseShellExecute = false, + RedirectStandardError = true, + Arguments = string.Format("localgroup \"Performance Monitor Users\" \"{0}\" /add", identity), + FileName = "net" + }; + using (var process = Process.Start(startInfo)) + { + process.WaitForExit(5000); + + if (process.ExitCode == 0) + { + logger.Info(string.Format("Added user '{0}' to group 'Performance Monitor Users'.", identity)); + return; + } + var error = process.StandardError.ReadToEnd(); + if (IsAlreadyAMemberError(error)) + { + logger.Info(string.Format("Skipped adding user '{0}' to group 'Performance Monitor Users' because the user is already in group.", identity)); + return; + } + if (IsGroupDoesNotExistError(error)) + { + logger.Info(string.Format("Skipped adding user '{0}' to group 'Performance Monitor Users' because the group does not exist.", identity)); + return; + } + var message = string.Format( + @"Failed to add user '{0}' to group 'Performance Monitor Users'. +Error: {1} +To help diagnose the problem try running the following command from an admin console: +net localgroup ""Performance Monitor Users"" ""{0}"" /add", identity, error); + logger.Info(message); + } + } + + bool IsAlreadyAMemberError(string error) + { + return error.Contains("1378"); + } + + bool IsGroupDoesNotExistError(string error) + { + //required since 'Performance Monitor Users' does not exist on all windows OS. + return error.Contains("1376"); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/InternalsVisibleTo.cs b/src/NServiceBus.Core/InternalsVisibleTo.cs new file mode 100644 index 00000000000..72629155ee0 --- /dev/null +++ b/src/NServiceBus.Core/InternalsVisibleTo.cs @@ -0,0 +1,4 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("NServiceBus.Hosting.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100dde965e6172e019ac82c2639ffe494dd2e7dd16347c34762a05732b492e110f2e4e2e1b5ef2d85c848ccfb671ee20a47c8d1376276708dc30a90ff1121b647ba3b7259a6bc383b2034938ef0e275b58b920375ac605076178123693c6c4f1331661a62eba28c249386855637780e3ff5f23a6d854700eaa6803ef48907513b92")] +[assembly: InternalsVisibleTo("NServiceBus.Core.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100dde965e6172e019ac82c2639ffe494dd2e7dd16347c34762a05732b492e110f2e4e2e1b5ef2d85c848ccfb671ee20a47c8d1376276708dc30a90ff1121b647ba3b7259a6bc383b2034938ef0e275b58b920375ac605076178123693c6c4f1331661a62eba28c249386855637780e3ff5f23a6d854700eaa6803ef48907513b92")] \ No newline at end of file diff --git a/src/impl/licensing/NServiceBus.Licensing/License.cs b/src/NServiceBus.Core/Licensing/License.cs similarity index 89% rename from src/impl/licensing/NServiceBus.Licensing/License.cs rename to src/NServiceBus.Core/Licensing/License.cs index b33a6dd8914..4d89976555e 100644 --- a/src/impl/licensing/NServiceBus.Licensing/License.cs +++ b/src/NServiceBus.Core/Licensing/License.cs @@ -1,16 +1,16 @@ -namespace NServiceBus.Licensing -{ - using System; - - /// - /// NServiceBus License information - /// - public class License - { - public string LicenseType { get; set; } - public int MaxThroughputPerSecond { get; internal set; } - public int AllowedNumberOfThreads { get; internal set; } - public int AllowedNumberOfWorkerNodes { get; internal set; } - public DateTime ExpirationDate { get; internal set; } - } -} +namespace NServiceBus.Licensing +{ + using System; + + /// + /// NServiceBus License information + /// + public class License + { + public string LicenseType { get; set; } + public int MaxThroughputPerSecond { get; internal set; } + public int AllowedNumberOfThreads { get; internal set; } + public int AllowedNumberOfWorkerNodes { get; internal set; } + public DateTime ExpirationDate { get; internal set; } + } +} diff --git a/src/NServiceBus.Core/Licensing/LicenseDescriptor.cs b/src/NServiceBus.Core/Licensing/LicenseDescriptor.cs new file mode 100644 index 00000000000..29e9aa59d73 --- /dev/null +++ b/src/NServiceBus.Core/Licensing/LicenseDescriptor.cs @@ -0,0 +1,83 @@ +namespace NServiceBus.Licensing +{ + using System; + using System.Configuration; + using System.IO; + using Microsoft.Win32; + + public class LicenseDescriptor + { + public static string OldLocalLicenseFile + { + get + { + return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"License\License.xml"); + } + } + + public static string LocalLicenseFile + { + get + { + return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"NServiceBus\License.xml"); + } + } + + public static string HKCULicense + { + get + { + using (var registryKey = Registry.CurrentUser.OpenSubKey(String.Format(@"SOFTWARE\NServiceBus\{0}", LicenseManager.SoftwareVersion.ToString(2)))) + { + if (registryKey != null) + { + return (string)registryKey.GetValue("License", null); + } + } + + return null; + } + } + + public static string HKLMLicense + { + get + { + try + { + using (var registryKey = Registry.LocalMachine.OpenSubKey(String.Format(@"SOFTWARE\NServiceBus\{0}", LicenseManager.SoftwareVersion.ToString(2)))) + { + if (registryKey != null) + { + return (string) registryKey.GetValue("License", null); + } + } + } + catch (Exception) + { + //Swallow exception if we can't read HKLM + } + + return null; + } + } + + public static string AppConfigLicenseFile + { + get { return ConfigurationManager.AppSettings["NServiceBus/LicensePath"]; } + } + + public static string AppConfigLicenseString + { + get { return ConfigurationManager.AppSettings["NServiceBus/License"]; } + } + + public static string PublicKey + { + get + { + return @"5M9/p7N+JczIN/e5eObahxeCIe//2xRLA9YTam7zBrcUGt1UlnXqL0l/8uO8rsO5tl+tjjIV9bOTpDLfx0H03VJyxsE8BEpSVu48xujvI25+0mWRnk4V50bDZykCTS3Du0c8XvYj5jIKOHPtU//mKXVULhagT8GkAnNnMj9CvTc=AQAB"; + } + } + } +} \ No newline at end of file diff --git a/src/impl/licensing/NServiceBus.Licensing/LicenseManager.cs b/src/NServiceBus.Core/Licensing/LicenseManager.cs similarity index 88% rename from src/impl/licensing/NServiceBus.Licensing/LicenseManager.cs rename to src/NServiceBus.Core/Licensing/LicenseManager.cs index f00cf691c11..1ce5958ce4c 100644 --- a/src/impl/licensing/NServiceBus.Licensing/LicenseManager.cs +++ b/src/NServiceBus.Core/Licensing/LicenseManager.cs @@ -1,563 +1,545 @@ -namespace NServiceBus.Licensing -{ - using System; - using System.Collections.Generic; - using System.Configuration; - using System.Diagnostics; - using System.Globalization; - using System.IO; - using System.Reflection; - using System.Security.Principal; - using System.Threading; - using System.Windows.Forms; - using Common.Logging; - using Forms; - using Microsoft.Win32; - using Rhino.Licensing; - - public class LicenseManager - { - private const string LicenseTypeKey = "LicenseType"; - private const string LicenseVersionKey = "LicenseVersion"; - private const string MaxMessageThroughputPerSecondLicenseKey = "MaxMessageThroughputPerSecond"; - private const string MaxMessageThroughputPerSecond = "Max"; - private const int OneMessagePerSecondThroughput = 1; - private const string WorkerThreadsLicenseKey = "WorkerThreads"; - private const string MaxWorkerThreads = "Max"; - private const int SingleWorkerThread = 1; - private const int MaxNumberOfWorkerThreads = 1024; - private const string AllowedNumberOfWorkerNodesLicenseKey = "AllowedNumberOfWorkerNodes"; - private const string UnlimitedNumberOfWorkerNodes = "Max"; - private const int MinNumberOfWorkerNodes = 2; - - private const int TRIAL_DAYS = 14; - - private static readonly ILog Logger = LogManager.GetLogger(typeof (LicenseManager)); - public static readonly Version SoftwareVersion = GetNServiceBusVersion(); - - private License license; - private bool trialPeriodHasExpired; - private AbstractLicenseValidator validator; - - static LicenseManager instance; - - private LicenseManager() - { - ChangeRhinoLicensingLogLevelToWarn(); - - validator = CreateValidator(); - - Validate(); - } - - private LicenseManager(string licenseText) - { - ChangeRhinoLicensingLogLevelToWarn(); - - validator = CreateValidator(licenseText); - - Validate(); - } - - /// - /// Initializes the licensing system with the given license - /// - /// - public static void Parse(string licenseText) - { - instance = new LicenseManager(licenseText); - } - - /// - /// Get current NServiceBus licensing information - /// - public static License CurrentLicense - { - get - { - if(instance == null) - instance = new LicenseManager(); - - return instance.license; - } - } - - /// - /// Prompts the users if their trial license has expired - /// - public static void PromptUserForLicenseIfTrialHasExpired() - { - if (instance == null) - instance = new LicenseManager(); - - instance.PromptUserForLicenseIfTrialHasExpiredInternal(); - } - - private void PromptUserForLicenseIfTrialHasExpiredInternal() - { - if (!(Debugger.IsAttached && SystemInformation.UserInteractive)) - { - //We only prompt user if user is in debugging mode and we are running in interactive mode - return; - } - - bool createdNew; - using (new Mutex(true, string.Format("NServiceBus-{0}", SoftwareVersion.ToString(2)), out createdNew)) - { - if (!createdNew) - { - //Dialog already displaying for this software version by another process, so we just use the already assigned license. - return; - } - - //prompt user for license file - if (trialPeriodHasExpired) - { - bool validLicense; - - using (var form = new TrialExpired()) - { - form.CurrentLicenseExpireDate = license.ExpirationDate; - - form.ValidateLicenseFile = (f, s) => - { - StringLicenseValidator licenseValidator = null; - - try - { - string selectedLicenseText = ReadAllTextWithoutLocking(s); - licenseValidator = new StringLicenseValidator(LicenseDescriptor.PublicKey, - selectedLicenseText); - licenseValidator.AssertValidLicense(); - - using (var registryKey = Registry.CurrentUser.CreateSubKey(String.Format(@"SOFTWARE\NServiceBus\{0}", SoftwareVersion.ToString(2)))) - { - if (registryKey == null) - { - return false; - } - - registryKey.SetValue("License", selectedLicenseText, RegistryValueKind.String); - } - - return true; - } - catch (UnauthorizedAccessException ex) - { - Logger.Debug("Could not write to the registry.", ex); - f.DisplayError(); - } - catch (LicenseExpiredException) - { - if (licenseValidator != null) - { - f.DisplayExpiredLicenseError(licenseValidator.ExpirationDate); - } - else - { - f.DisplayError(); - } - } - catch (Exception) - { - f.DisplayError(); - } - - return false; - }; - - validLicense = form.ShowDialog() == DialogResult.OK; - } - - if (validLicense) - { - //if user specifies a valid license file then run with that license - validator = CreateValidator(); - Validate(); - } - } - } - } - - internal static string ReadAllTextWithoutLocking(string path) - { - using (var fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) - using (var textReader = new StreamReader(fileStream)) - { - return textReader.ReadToEnd(); - } - } - - private void Validate() - { - if (validator != null) - { - try - { - validator.AssertValidLicense(); - - Logger.InfoFormat("Found a {0} license.", validator.LicenseType); - Logger.InfoFormat("Registered to {0}", validator.Name); - Logger.InfoFormat("Expires on {0}", validator.ExpirationDate); - if ((validator.LicenseAttributes != null) && (validator.LicenseAttributes.Count > 0)) - foreach (var licenseAttribute in validator.LicenseAttributes) - Logger.InfoFormat("[{0}]: [{1}]", licenseAttribute.Key, licenseAttribute.Value); - - CheckIfNServiceBusVersionIsNewerThanLicenseVersion(); - - ConfigureNServiceBusLicense(); - - return; - } - catch (LicenseExpiredException) - { - trialPeriodHasExpired = true; - Logger.Error("License has expired."); - } - catch (LicenseNotFoundException) - { - Logger.Error("License could not be loaded."); - } - catch (LicenseFileNotFoundException) - { - Logger.Error("License could not be loaded."); - } - - Logger.Warn("Falling back to run in Basic1 license mode."); - RunInBasic1Mode(DateTime.UtcNow); - - return; - } - - Logger.Info("No valid license found."); - ConfigureNServiceBusToRunInTrialMode(); - } - - private void ConfigureNServiceBusToRunInTrialMode() - { - var trialExpirationDate = DateTime.UtcNow.Date; - - var windowsIdentity = WindowsIdentity.GetCurrent(); - if (windowsIdentity != null && windowsIdentity.User != null && - !windowsIdentity.User.IsWellKnown(WellKnownSidType.LocalSystemSid)) - { - //If first time run, configure expire date - try - { - string trialStartDateString; - using (var registryKey = Registry.CurrentUser.CreateSubKey(String.Format(@"SOFTWARE\NServiceBus\{0}", SoftwareVersion.ToString(2)))) - { - if (registryKey == null) - { - Logger.Warn("Falling back to run in Basic1 license mode."); - - trialPeriodHasExpired = true; - - //if trial expired, run in Basic1 - RunInBasic1Mode(trialExpirationDate); - } - - if ((trialStartDateString = (string) registryKey.GetValue("TrialStart", null)) == null) - { - trialStartDateString = DateTime.UtcNow.ToString("yyyy-MM-dd"); - registryKey.SetValue("TrialStart", trialStartDateString, RegistryValueKind.String); - - Logger.DebugFormat("First time running NServiceBus v{0}, setting trial license start.", - SoftwareVersion.ToString(2)); - } - } - - var trialStartDate = DateTime.ParseExact(trialStartDateString, "yyyy-MM-dd", - CultureInfo.InvariantCulture, - DateTimeStyles.AssumeUniversal); - - trialExpirationDate = trialStartDate.Date.AddDays(TRIAL_DAYS); - } - catch (UnauthorizedAccessException ex) - { - Logger.Debug("Could not write to the registry. Because we didn't find a license file we assume the trial has expired.", ex); - } - } - - //Check trial is still valid - if (trialExpirationDate > DateTime.UtcNow.Date) - { - Logger.DebugFormat("Trial for NServiceBus v{0} is still active, trial expires on {1}.", - SoftwareVersion.ToString(2), trialExpirationDate.ToLocalTime().ToShortDateString()); - Logger.Info("Configuring NServiceBus to run in trial mode."); - - //Run in unlimited mode during trial period - license = new License - { - LicenseType = LicenseType.Trial, - ExpirationDate = trialExpirationDate - }; - - ConfigureLicenseBasedOnAttribute(license.LicenseType, new Dictionary - { - {AllowedNumberOfWorkerNodesLicenseKey, UnlimitedNumberOfWorkerNodes}, - {WorkerThreadsLicenseKey, MaxWorkerThreads}, - {MaxMessageThroughputPerSecondLicenseKey, MaxMessageThroughputPerSecond}, - }); - } - else - { - Logger.DebugFormat("Trial for NServiceBus v{0} has expired.", SoftwareVersion.ToString(2)); - Logger.Warn("Falling back to run in Basic1 license mode."); - - trialPeriodHasExpired = true; - - //if trial expired, run in Basic1 - RunInBasic1Mode(trialExpirationDate); - } - } - - private void RunInBasic1Mode(DateTime trialExpirationDate) - { - license = new License - { - LicenseType = LicenseType.Basic1, - ExpirationDate = trialExpirationDate - }; - - ConfigureLicenseBasedOnAttribute(license.LicenseType, new Dictionary - { - { - AllowedNumberOfWorkerNodesLicenseKey, - MinNumberOfWorkerNodes.ToString(CultureInfo.InvariantCulture) - }, - {WorkerThreadsLicenseKey, SingleWorkerThread.ToString(CultureInfo.InvariantCulture)}, - { - MaxMessageThroughputPerSecondLicenseKey, - OneMessagePerSecondThroughput.ToString(CultureInfo.InvariantCulture) - }, - }); - } - - private static void ChangeRhinoLicensingLogLevelToWarn() - { - var rhinoLicensingAssembly = Assembly.GetAssembly(typeof(LicenseValidator)); - if (rhinoLicensingAssembly == null) - { - return; - } - - var rhinoLicensingRepository = log4net.LogManager.GetRepository(rhinoLicensingAssembly); - if (rhinoLicensingRepository == null) - { - return; - } - - var hier = (log4net.Repository.Hierarchy.Hierarchy)rhinoLicensingRepository; - var licenseValidatorLogger = hier.GetLogger("Rhino.Licensing.LicenseValidator"); - if (licenseValidatorLogger == null) - { - return; - } - - ((log4net.Repository.Hierarchy.Logger)licenseValidatorLogger).Level = hier.LevelMap["FATAL"]; - } - - private static AbstractLicenseValidator CreateValidator(string licenseText = "") - { - if (!String.IsNullOrEmpty(licenseText)) - { - Logger.Info(@"Using license supplied via fluent API."); - return new StringLicenseValidator(LicenseDescriptor.PublicKey, licenseText); - } - - if (!String.IsNullOrEmpty(LicenseDescriptor.AppConfigLicenseString)) - { - Logger.Info(@"Using embedded license supplied via config file AppSettings/NServiceBus/License."); - licenseText = LicenseDescriptor.AppConfigLicenseString; - } - else if (!String.IsNullOrEmpty(LicenseDescriptor.AppConfigLicenseFile)) - { - if (File.Exists(LicenseDescriptor.AppConfigLicenseFile)) - { - Logger.InfoFormat(@"Using license supplied via config file AppSettings/NServiceBus/LicensePath ({0}).", LicenseDescriptor.AppConfigLicenseFile); - licenseText = ReadAllTextWithoutLocking(LicenseDescriptor.AppConfigLicenseFile); - } - } - else if (!String.IsNullOrEmpty(LicenseDescriptor.LocalLicenseFile) && File.Exists(LicenseDescriptor.LocalLicenseFile)) - { - Logger.InfoFormat(@"Using license in current folder ({0}).", LicenseDescriptor.LocalLicenseFile); - licenseText = ReadAllTextWithoutLocking(LicenseDescriptor.LocalLicenseFile); - } - else if (!String.IsNullOrEmpty(LicenseDescriptor.RegistryLicense)) - { - Logger.InfoFormat(@"Using embeded license found in registry [HKEY_CURRENT_USER\Software\NServiceBus\{0}\License].", SoftwareVersion.ToString(2)); - licenseText = LicenseDescriptor.RegistryLicense; - } - - return String.IsNullOrEmpty(licenseText) ? null : new StringLicenseValidator(LicenseDescriptor.PublicKey, licenseText); - } - - //if NServiceBus version > license version, throw an exception - private void CheckIfNServiceBusVersionIsNewerThanLicenseVersion() - { - if (validator.LicenseType == Rhino.Licensing.LicenseType.None) - return; - - if (validator.LicenseAttributes.ContainsKey(LicenseVersionKey)) - { - try - { - Version semver = GetNServiceBusVersion(); - Version licenseVersion = Version.Parse(validator.LicenseAttributes[LicenseVersionKey]); - if (licenseVersion >= semver) - return; - } - catch (Exception exception) - { - throw new ConfigurationErrorsException( - "Your license is valid for an older version of NServiceBus. If you are still within the 1 year upgrade protection period of your original license, you should have already received a new license and if you haven’t, please contact customer.care@particular.net. If your upgrade protection has lapsed, you can renew it at http://particular.net/support.", - exception); - } - } - - throw new ConfigurationErrorsException( - "Your license is valid for an older version of NServiceBus. If you are still within the 1 year upgrade protection period of your original license, you should have already received a new license and if you haven’t, please contact customer.care@particular.net. If your upgrade protection has lapsed, you can renew it at http://particular.net/support."); - } - - private static Version GetNServiceBusVersion() - { - Version assembyVersion = Assembly.GetExecutingAssembly().GetName().Version; - - return new Version(assembyVersion.Major, assembyVersion.Minor); - } - - /// - /// Set NSeriviceBus license information. - /// - private void ConfigureNServiceBusLicense() - { - license = new License(); - - switch (validator.LicenseType) - { - case Rhino.Licensing.LicenseType.None: - license.LicenseType = LicenseType.Basic1; - break; - case Rhino.Licensing.LicenseType.Standard: - SetLicenseType(LicenseType.Standard); - break; - case Rhino.Licensing.LicenseType.Trial: - SetLicenseType(LicenseType.Trial); - break; - default: - Logger.ErrorFormat("Got unexpected license type [{0}], setting Basic1 free license type.", - validator.LicenseType.ToString()); - license.LicenseType = LicenseType.Basic1; - break; - } - - license.ExpirationDate = validator.ExpirationDate; - - ConfigureLicenseBasedOnAttribute(license.LicenseType, validator.LicenseAttributes); - } - - private void ConfigureLicenseBasedOnAttribute(string licenseType, IDictionary attributes) - { - license.MaxThroughputPerSecond = GetMaxThroughputPerSecond(licenseType, attributes); - license.AllowedNumberOfThreads = GetAllowedNumberOfThreads(licenseType, attributes); - license.AllowedNumberOfWorkerNodes = GetAllowedNumberOfWorkerNodes(license.LicenseType, attributes); - } - - private static int GetAllowedNumberOfWorkerNodes(string licenseType, IDictionary attributes) - { - if (licenseType == LicenseType.Basic1) - { - return MinNumberOfWorkerNodes; - } - - if (attributes.ContainsKey(AllowedNumberOfWorkerNodesLicenseKey)) - { - string allowedNumberOfWorkerNodes = attributes[AllowedNumberOfWorkerNodesLicenseKey]; - if (allowedNumberOfWorkerNodes == UnlimitedNumberOfWorkerNodes) - { - return int.MaxValue; - } - - int allowedWorkerNodes; - if (int.TryParse(allowedNumberOfWorkerNodes, out allowedWorkerNodes)) - { - return allowedWorkerNodes; - } - } - - return MinNumberOfWorkerNodes; - } - - private static int GetAllowedNumberOfThreads(string licenseType, IDictionary attributes) - { - if (licenseType == LicenseType.Basic1) - { - return SingleWorkerThread; - } - - if (attributes.ContainsKey(WorkerThreadsLicenseKey)) - { - string workerThreadsInLicenseFile = attributes[WorkerThreadsLicenseKey]; - - if (string.IsNullOrWhiteSpace(workerThreadsInLicenseFile)) - { - return SingleWorkerThread; - } - - if (workerThreadsInLicenseFile == MaxWorkerThreads) - { - return MaxNumberOfWorkerThreads; - } - - int workerThreads; - if (int.TryParse(workerThreadsInLicenseFile, out workerThreads)) - { - return workerThreads; - } - } - - return SingleWorkerThread; - } - - private static int GetMaxThroughputPerSecond(string licenseType, IDictionary attributes) - { - // Basic1 means there is no License file, so set throughput to one message per second. - if (licenseType == LicenseType.Basic1) - { - return OneMessagePerSecondThroughput; - } - - if (attributes.ContainsKey(MaxMessageThroughputPerSecondLicenseKey)) - { - string maxMessageThroughputPerSecond = attributes[MaxMessageThroughputPerSecondLicenseKey]; - if (maxMessageThroughputPerSecond == MaxMessageThroughputPerSecond) - { - return 0; - } - - int messageThroughputPerSecond; - if (int.TryParse(maxMessageThroughputPerSecond, out messageThroughputPerSecond)) - { - return messageThroughputPerSecond; - } - } - - return OneMessagePerSecondThroughput; - } - - private void SetLicenseType(string defaultLicenseType) - { - if ((validator.LicenseAttributes == null) || - (!validator.LicenseAttributes.ContainsKey(LicenseTypeKey)) || - (string.IsNullOrEmpty(validator.LicenseAttributes[LicenseTypeKey]))) - { - license.LicenseType = defaultLicenseType; - } - else - { - license.LicenseType = validator.LicenseAttributes[LicenseTypeKey]; - } - } - } +namespace NServiceBus.Licensing +{ + using System; + using System.Collections.Generic; + using System.Configuration; + using System.Diagnostics; + using System.Globalization; + using System.IO; + using System.Reflection; + using System.Security.Principal; + using System.Threading; + using System.Windows.Forms; + using Forms; + using Logging; + using Microsoft.Win32; + using Rhino.Licensing; + + public class LicenseManager + { + private const string LicenseTypeKey = "LicenseType"; + private const string LicenseVersionKey = "LicenseVersion"; + private const string MaxMessageThroughputPerSecondLicenseKey = "MaxMessageThroughputPerSecond"; + private const string MaxMessageThroughputPerSecond = "Max"; + private const int OneMessagePerSecondThroughput = 1; + private const string WorkerThreadsLicenseKey = "WorkerThreads"; + private const string MaxWorkerThreads = "Max"; + private const int SingleWorkerThread = 1; + private const int MaxNumberOfWorkerThreads = 1024; + private const string AllowedNumberOfWorkerNodesLicenseKey = "AllowedNumberOfWorkerNodes"; + private const string UnlimitedNumberOfWorkerNodes = "Max"; + private const int MinNumberOfWorkerNodes = 2; + + private const int TRIAL_DAYS = 14; + + private static readonly ILog Logger = LogManager.GetLogger(typeof (LicenseManager)); + public static readonly Version SoftwareVersion = GetNServiceBusVersion(); + + private License license; + private bool trialPeriodHasExpired; + private AbstractLicenseValidator validator; + + static LicenseManager instance; + + private LicenseManager() + { + validator = CreateValidator(); + + Validate(); + } + + private LicenseManager(string licenseText) + { + validator = CreateValidator(licenseText); + + Validate(); + } + + /// + /// Initializes the licensing system with the given license + /// + /// + public static void Parse(string licenseText) + { + instance = new LicenseManager(licenseText); + } + + /// + /// Get current NServiceBus licensing information + /// + public static License CurrentLicense + { + get + { + if(instance == null) + instance = new LicenseManager(); + + return instance.license; + } + } + + /// + /// Prompts the users if their trial license has expired + /// + public static void PromptUserForLicenseIfTrialHasExpired() + { + if (instance == null) + instance = new LicenseManager(); + + instance.PromptUserForLicenseIfTrialHasExpiredInternal(); + } + + private void PromptUserForLicenseIfTrialHasExpiredInternal() + { + if (!(Debugger.IsAttached && SystemInformation.UserInteractive)) + { + //We only prompt user if user is in debugging mode and we are running in interactive mode + return; + } + + bool createdNew; + using (new Mutex(true, string.Format("NServiceBus-{0}", SoftwareVersion.ToString(2)), out createdNew)) + { + if (!createdNew) + { + //Dialog already displaying for this software version by another process, so we just use the already assigned license. + return; + } + + //prompt user for license file + if (trialPeriodHasExpired) + { + bool validLicense; + + using (var form = new TrialExpired()) + { + form.CurrentLicenseExpireDate = license.ExpirationDate; + + form.ValidateLicenseFile = (f, s) => + { + StringLicenseValidator licenseValidator = null; + + try + { + string selectedLicenseText = ReadAllTextWithoutLocking(s); + licenseValidator = new StringLicenseValidator(LicenseDescriptor.PublicKey, + selectedLicenseText); + licenseValidator.AssertValidLicense(); + + using (var registryKey = Registry.CurrentUser.CreateSubKey(String.Format(@"SOFTWARE\NServiceBus\{0}", SoftwareVersion.ToString(2)))) + { + if (registryKey == null) + { + return false; + } + + registryKey.SetValue("License", selectedLicenseText, RegistryValueKind.String); + } + + return true; + } + catch (UnauthorizedAccessException ex) + { + Logger.Debug("Could not write to the registry.", ex); + f.DisplayError(); + } + catch (LicenseExpiredException) + { + if (licenseValidator != null) + { + f.DisplayExpiredLicenseError(licenseValidator.ExpirationDate); + } + else + { + f.DisplayError(); + } + } + catch (Exception) + { + f.DisplayError(); + } + + return false; + }; + + validLicense = form.ShowDialog() == DialogResult.OK; + } + + if (validLicense) + { + //if user specifies a valid license file then run with that license + validator = CreateValidator(); + Validate(); + } + } + } + } + + internal static string ReadAllTextWithoutLocking(string path) + { + using (var fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + using (var textReader = new StreamReader(fileStream)) + { + return textReader.ReadToEnd(); + } + } + + private void Validate() + { + if (validator != null) + { + try + { + validator.AssertValidLicense(); + + Logger.InfoFormat((string) "Found a {0} license.", (object) validator.LicenseType); + Logger.InfoFormat((string) "Registered to {0}", (object) validator.Name); + Logger.InfoFormat((string) "Expires on {0}", (object) validator.ExpirationDate); + if ((validator.LicenseAttributes != null) && (validator.LicenseAttributes.Count > 0)) + foreach (var licenseAttribute in validator.LicenseAttributes) + Logger.InfoFormat("[{0}]: [{1}]", licenseAttribute.Key, licenseAttribute.Value); + + CheckIfNServiceBusVersionIsNewerThanLicenseVersion(); + + ConfigureNServiceBusLicense(); + + return; + } + catch (LicenseExpiredException) + { + trialPeriodHasExpired = true; + Logger.Error("License has expired."); + } + catch (LicenseNotFoundException) + { + Logger.Error("License could not be loaded."); + } + catch (LicenseFileNotFoundException) + { + Logger.Error("License could not be loaded."); + } + + Logger.Warn("Falling back to run in Basic1 license mode."); + RunInBasic1Mode(DateTime.UtcNow); + + return; + } + + Logger.Info("No valid license found."); + ConfigureNServiceBusToRunInTrialMode(); + } + + private void ConfigureNServiceBusToRunInTrialMode() + { + var trialExpirationDate = DateTime.UtcNow.Date; + + var windowsIdentity = WindowsIdentity.GetCurrent(); + if (windowsIdentity != null && windowsIdentity.User != null && + !windowsIdentity.User.IsWellKnown(WellKnownSidType.LocalSystemSid)) + { + //If first time run, configure expire date + try + { + string trialStartDateString; + using (var registryKey = Registry.CurrentUser.CreateSubKey(String.Format(@"SOFTWARE\NServiceBus\{0}", SoftwareVersion.ToString(2)))) + { + if (registryKey == null) + { + Logger.Warn("Falling back to run in Basic1 license mode."); + + trialPeriodHasExpired = true; + + //if trial expired, run in Basic1 + RunInBasic1Mode(trialExpirationDate); + } + + if ((trialStartDateString = (string) registryKey.GetValue("TrialStart", null)) == null) + { + trialStartDateString = DateTime.UtcNow.ToString("yyyy-MM-dd"); + registryKey.SetValue("TrialStart", trialStartDateString, RegistryValueKind.String); + + Logger.DebugFormat("First time running NServiceBus v{0}, setting trial license start.", + SoftwareVersion.ToString(2)); + } + } + + var trialStartDate = DateTime.ParseExact(trialStartDateString, "yyyy-MM-dd", + CultureInfo.InvariantCulture, + DateTimeStyles.AssumeUniversal); + + trialExpirationDate = trialStartDate.Date.AddDays(TRIAL_DAYS); + } + catch (UnauthorizedAccessException ex) + { + Logger.Debug("Could not write to the registry. Because we didn't find a license file we assume the trial has expired.", ex); + } + } + + //Check trial is still valid + if (trialExpirationDate > DateTime.UtcNow.Date) + { + Logger.DebugFormat("Trial for NServiceBus v{0} is still active, trial expires on {1}.", + SoftwareVersion.ToString(2), trialExpirationDate.ToLocalTime().ToShortDateString()); + Logger.Info("Configuring NServiceBus to run in trial mode."); + + //Run in unlimited mode during trial period + license = new License + { + LicenseType = LicenseType.Trial, + ExpirationDate = trialExpirationDate + }; + + ConfigureLicenseBasedOnAttribute(license.LicenseType, new Dictionary + { + {AllowedNumberOfWorkerNodesLicenseKey, UnlimitedNumberOfWorkerNodes}, + {WorkerThreadsLicenseKey, MaxWorkerThreads}, + {MaxMessageThroughputPerSecondLicenseKey, MaxMessageThroughputPerSecond}, + }); + } + else + { + Logger.DebugFormat("Trial for NServiceBus v{0} has expired.", SoftwareVersion.ToString(2)); + Logger.Warn("Falling back to run in Basic1 license mode."); + + trialPeriodHasExpired = true; + + //if trial expired, run in Basic1 + RunInBasic1Mode(trialExpirationDate); + } + } + + private void RunInBasic1Mode(DateTime trialExpirationDate) + { + license = new License + { + LicenseType = LicenseType.Basic1, + ExpirationDate = trialExpirationDate + }; + + ConfigureLicenseBasedOnAttribute(license.LicenseType, new Dictionary + { + { + AllowedNumberOfWorkerNodesLicenseKey, + MinNumberOfWorkerNodes.ToString(CultureInfo.InvariantCulture) + }, + {WorkerThreadsLicenseKey, SingleWorkerThread.ToString(CultureInfo.InvariantCulture)}, + { + MaxMessageThroughputPerSecondLicenseKey, + OneMessagePerSecondThroughput.ToString(CultureInfo.InvariantCulture) + }, + }); + } + + private static AbstractLicenseValidator CreateValidator(string licenseText = "") + { + if (!String.IsNullOrEmpty(licenseText)) + { + Logger.Info(@"Using license supplied via fluent API."); + return new StringLicenseValidator(LicenseDescriptor.PublicKey, licenseText); + } + + if (!String.IsNullOrEmpty(LicenseDescriptor.AppConfigLicenseString)) + { + Logger.Info(@"Using embedded license supplied via config file AppSettings/NServiceBus/License."); + licenseText = LicenseDescriptor.AppConfigLicenseString; + } + else if (!String.IsNullOrEmpty(LicenseDescriptor.AppConfigLicenseFile)) + { + if (File.Exists(LicenseDescriptor.AppConfigLicenseFile)) + { + Logger.InfoFormat(@"Using license supplied via config file AppSettings/NServiceBus/LicensePath ({0}).", LicenseDescriptor.AppConfigLicenseFile); + licenseText = ReadAllTextWithoutLocking(LicenseDescriptor.AppConfigLicenseFile); + } + } + else if (File.Exists(LicenseDescriptor.LocalLicenseFile)) + { + Logger.InfoFormat(@"Using license in current folder ({0}).", LicenseDescriptor.LocalLicenseFile); + licenseText = ReadAllTextWithoutLocking(LicenseDescriptor.LocalLicenseFile); + } + else if (File.Exists(LicenseDescriptor.OldLocalLicenseFile)) + { + Logger.InfoFormat(@"Using license in current folder ({0}).", LicenseDescriptor.OldLocalLicenseFile); + licenseText = ReadAllTextWithoutLocking(LicenseDescriptor.OldLocalLicenseFile); + } + else if (!String.IsNullOrEmpty(LicenseDescriptor.HKCULicense)) + { + Logger.InfoFormat(@"Using embedded license found in registry [HKEY_CURRENT_USER\Software\NServiceBus\{0}\License].", SoftwareVersion.ToString(2)); + licenseText = LicenseDescriptor.HKCULicense; + } + else if (!String.IsNullOrEmpty(LicenseDescriptor.HKLMLicense)) + { + Logger.InfoFormat(@"Using embedded license found in registry [HKEY_LOCAL_MACHINE\Software\NServiceBus\{0}\License].", SoftwareVersion.ToString(2)); + licenseText = LicenseDescriptor.HKLMLicense; + } + + return String.IsNullOrEmpty(licenseText) ? null : new StringLicenseValidator(LicenseDescriptor.PublicKey, licenseText); + } + + //if NServiceBus version > license version, throw an exception + private void CheckIfNServiceBusVersionIsNewerThanLicenseVersion() + { + if (validator.LicenseType == Rhino.Licensing.LicenseType.None) + return; + + if (validator.LicenseAttributes.ContainsKey(LicenseVersionKey)) + { + try + { + Version semver = GetNServiceBusVersion(); + Version licenseVersion = Version.Parse(validator.LicenseAttributes[LicenseVersionKey]); + if (licenseVersion >= semver) + return; + } + catch (Exception exception) + { + throw new ConfigurationErrorsException( + "Your license is valid for an older version of NServiceBus. If you are still within the 1 year upgrade protection period of your original license, you should have already received a new license and if you havent, please contact customer.care@particular.net. If your upgrade protection has lapsed, you can renew it at http://particular.net/licensing", + exception); + } + } + + throw new ConfigurationErrorsException( + "Your license is valid for an older version of NServiceBus. If you are still within the 1 year upgrade protection period of your original license, you should have already received a new license and if you havent, please contact customer.care@particular.net. If your upgrade protection has lapsed, you can renew it at http://particular.net/licensing"); + } + + private static Version GetNServiceBusVersion() + { + Version assembyVersion = Assembly.GetExecutingAssembly().GetName().Version; + + return new Version(assembyVersion.Major, assembyVersion.Minor); + } + + /// + /// Set NSeriviceBus license information. + /// + private void ConfigureNServiceBusLicense() + { + license = new License(); + + switch (validator.LicenseType) + { + case Rhino.Licensing.LicenseType.None: + license.LicenseType = LicenseType.Basic1; + break; + case Rhino.Licensing.LicenseType.Standard: + SetLicenseType(LicenseType.Standard); + break; + case Rhino.Licensing.LicenseType.Trial: + SetLicenseType(LicenseType.Trial); + break; + default: + Logger.ErrorFormat((string) "Got unexpected license type [{0}], setting Basic1 free license type.", + (object) validator.LicenseType.ToString()); + license.LicenseType = LicenseType.Basic1; + break; + } + + license.ExpirationDate = validator.ExpirationDate; + + ConfigureLicenseBasedOnAttribute(license.LicenseType, validator.LicenseAttributes); + } + + private void ConfigureLicenseBasedOnAttribute(string licenseType, IDictionary attributes) + { + license.MaxThroughputPerSecond = GetMaxThroughputPerSecond(licenseType, attributes); + license.AllowedNumberOfThreads = GetAllowedNumberOfThreads(licenseType, attributes); + license.AllowedNumberOfWorkerNodes = GetAllowedNumberOfWorkerNodes(license.LicenseType, attributes); + } + + private static int GetAllowedNumberOfWorkerNodes(string licenseType, IDictionary attributes) + { + if (licenseType == LicenseType.Basic1) + { + return MinNumberOfWorkerNodes; + } + + if (attributes.ContainsKey(AllowedNumberOfWorkerNodesLicenseKey)) + { + string allowedNumberOfWorkerNodes = attributes[AllowedNumberOfWorkerNodesLicenseKey]; + if (allowedNumberOfWorkerNodes == UnlimitedNumberOfWorkerNodes) + { + return int.MaxValue; + } + + int allowedWorkerNodes; + if (int.TryParse(allowedNumberOfWorkerNodes, out allowedWorkerNodes)) + { + return allowedWorkerNodes; + } + } + + return MinNumberOfWorkerNodes; + } + + private static int GetAllowedNumberOfThreads(string licenseType, IDictionary attributes) + { + if (licenseType == LicenseType.Basic1) + { + return SingleWorkerThread; + } + + if (attributes.ContainsKey(WorkerThreadsLicenseKey)) + { + string workerThreadsInLicenseFile = attributes[WorkerThreadsLicenseKey]; + + if (string.IsNullOrWhiteSpace(workerThreadsInLicenseFile)) + { + return SingleWorkerThread; + } + + if (workerThreadsInLicenseFile == MaxWorkerThreads) + { + return MaxNumberOfWorkerThreads; + } + + int workerThreads; + if (int.TryParse(workerThreadsInLicenseFile, out workerThreads)) + { + return workerThreads; + } + } + + return SingleWorkerThread; + } + + private static int GetMaxThroughputPerSecond(string licenseType, IDictionary attributes) + { + // Basic1 means there is no License file, so set throughput to one message per second. + if (licenseType == LicenseType.Basic1) + { + return OneMessagePerSecondThroughput; + } + + if (attributes.ContainsKey(MaxMessageThroughputPerSecondLicenseKey)) + { + string maxMessageThroughputPerSecond = attributes[MaxMessageThroughputPerSecondLicenseKey]; + if (maxMessageThroughputPerSecond == MaxMessageThroughputPerSecond) + { + return 0; + } + + int messageThroughputPerSecond; + if (int.TryParse(maxMessageThroughputPerSecond, out messageThroughputPerSecond)) + { + return messageThroughputPerSecond; + } + } + + return OneMessagePerSecondThroughput; + } + + private void SetLicenseType(string defaultLicenseType) + { + if ((validator.LicenseAttributes == null) || + (!validator.LicenseAttributes.ContainsKey(LicenseTypeKey)) || + (string.IsNullOrEmpty(validator.LicenseAttributes[LicenseTypeKey]))) + { + license.LicenseType = defaultLicenseType; + } + else + { + license.LicenseType = validator.LicenseAttributes[LicenseTypeKey]; + } + } + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Licensing/LicenseType.cs b/src/NServiceBus.Core/Licensing/LicenseType.cs new file mode 100644 index 00000000000..aa48c5657d3 --- /dev/null +++ b/src/NServiceBus.Core/Licensing/LicenseType.cs @@ -0,0 +1,26 @@ +namespace NServiceBus.Licensing +{ + /// + /// License types. + /// + public static class LicenseType + { + public const string Standard = "Standard"; + public const string Express = "Express"; + // Express license + public const string Basic0 = "Basic0"; + public const string Trial = "Trial"; + // FREE, No license file, 1 message per second, 1 worker thread, 2 worker nodes + public const string Basic1 = "Basic1"; + // 2 message per second, 1 worker thread, 2 worker nodes + public const string Basic2 = "Basic2"; + // 4 message per second, 1 worker thread, 2 worker nodes + public const string Basic4 = "Basic4"; + // 8 message per second, 1 worker thread, 2 worker nodes + public const string Basic8 = "Basic8"; + // 16 message per second, 1 worker thread, 2 worker nodes + public const string Basic16 = "Basic16"; + // 32 message per second, 1 worker thread, 2 worker nodes + public const string Basic32 = "Basic32"; + } +} diff --git a/src/NServiceBus.Core/Licensing/LicenseValidator.cs b/src/NServiceBus.Core/Licensing/LicenseValidator.cs new file mode 100644 index 00000000000..d9402be1cee --- /dev/null +++ b/src/NServiceBus.Core/Licensing/LicenseValidator.cs @@ -0,0 +1,41 @@ +namespace NServiceBus.Licensing +{ + using System; + using Rhino.Licensing; + + /// + /// Validates content of a license file + /// + internal class StringLicenseValidator : AbstractLicenseValidator + { + /// + /// Creates a new instance of + /// + /// public key + /// license content + public StringLicenseValidator(string publicKey, string license) + : base(publicKey) + { + License = license; + } + + /// + /// License content + /// + protected override sealed string License + { + get; + set; + } + + public override void AssertValidLicense() + { + if (String.IsNullOrEmpty(License)) + { + throw new LicenseNotFoundException(); + } + + base.AssertValidLicense(); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/ILog.cs b/src/NServiceBus.Core/Logging/ILog.cs new file mode 100644 index 00000000000..206ba3d8ae6 --- /dev/null +++ b/src/NServiceBus.Core/Logging/ILog.cs @@ -0,0 +1,124 @@ +namespace NServiceBus.Logging +{ + using System; + + /// + /// + /// + public interface ILog + { + /// + /// + /// + bool IsDebugEnabled { get; } + /// + /// + /// + bool IsInfoEnabled { get; } + /// + /// + /// + bool IsWarnEnabled { get; } + /// + /// + /// + bool IsErrorEnabled { get; } + /// + /// + /// + bool IsFatalEnabled { get; } + + /// + /// + /// + /// + void Debug(string message); + /// + /// + /// + /// + /// + void Debug(string message, Exception exception); + /// + /// + /// + /// + /// + void DebugFormat(string format, params object[] args); + + /// + /// + /// + /// + void Info(string message); + /// + /// + /// + /// + /// + void Info(string message, Exception exception); + /// + /// + /// + /// + /// + void InfoFormat(string format, params object[] args); + + /// + /// + /// + /// + void Warn(string message); + /// + /// + /// + /// + /// + void Warn(string message, Exception exception); + + /// + /// + /// + /// + /// + void WarnFormat(string format, params object[] args); + + /// + /// + /// + /// + void Error(string message); + /// + /// + /// + /// + /// + void Error(string message, Exception exception); + + /// + /// + /// + /// + /// + void ErrorFormat(string format, params object[] args); + + /// + /// + /// + /// + void Fatal(string message); + /// + /// + /// + /// + /// + void Fatal(string message, Exception exception); + + /// + /// + /// + /// + /// + void FatalFormat(string format, params object[] args); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/ILoggerFactory.cs b/src/NServiceBus.Core/Logging/ILoggerFactory.cs new file mode 100644 index 00000000000..82045e00bd5 --- /dev/null +++ b/src/NServiceBus.Core/Logging/ILoggerFactory.cs @@ -0,0 +1,23 @@ +namespace NServiceBus.Logging +{ + using System; + + /// + /// + /// + public interface ILoggerFactory + { + /// + /// + /// + /// + /// + ILog GetLogger(Type type); + /// + /// + /// + /// + /// + ILog GetLogger(string name); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Internal/ReflectionExtensions.cs b/src/NServiceBus.Core/Logging/Internal/ReflectionExtensions.cs new file mode 100644 index 00000000000..b7351e08462 --- /dev/null +++ b/src/NServiceBus.Core/Logging/Internal/ReflectionExtensions.cs @@ -0,0 +1,44 @@ +namespace NServiceBus.Logging.Internal +{ + using System; + using System.Linq; + using System.Reflection; + + internal static class ReflectionExtensions + { + + public static object SetStaticProperty(this Type type, string propertyName, object val) + { + return type + .InvokeMember(propertyName, BindingFlags.SetProperty | BindingFlags.Public | BindingFlags.Static, null, null, new[] { val }); + } + + public static object GetStaticProperty(this Type type, string propertyName) + { + return type + .InvokeMember(propertyName, BindingFlags.GetProperty | BindingFlags.Public | BindingFlags.Static, null, null, null); + } + + public static object GetStaticField(this Type type, string fieldName, bool ignoreCase = false) + { + var bindingFlags = BindingFlags.GetField | BindingFlags.Public | BindingFlags.Static; + if (ignoreCase) + bindingFlags |= BindingFlags.IgnoreCase; + + return type.InvokeMember(fieldName, bindingFlags, null, null, null); + } + + + public static object InvokeStaticMethod(this Type type, string methodName, params object[] args) + { + var argTypes = args.Select(x => x.GetType()).ToArray(); + + var methodInfo = type.GetMethod(methodName, BindingFlags.Public | BindingFlags.Static, null, argTypes, null); + + if (methodInfo == null) + throw new InvalidOperationException(String.Format("Could not find static method {0} on type {1}", methodName, type)); + + return methodInfo.Invoke(null, args); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Internal/TypeExtensions.cs b/src/NServiceBus.Core/Logging/Internal/TypeExtensions.cs new file mode 100644 index 00000000000..0db0480de94 --- /dev/null +++ b/src/NServiceBus.Core/Logging/Internal/TypeExtensions.cs @@ -0,0 +1,68 @@ +namespace NServiceBus.Logging.Internal +{ + using System; + using System.Linq.Expressions; + using System.Reflection; + + internal static class TypeExtensions + { + public static Func GetInstancePropertyDelegate(this Type type, string propertyName) + { + var propertyInfo = type.GetProperty(propertyName, BindingFlags.Public | BindingFlags.Instance); + + if (propertyInfo == null) + throw new InvalidOperationException(String.Format("Could not find property {0} on type {1}", propertyName, type)); + + var instanceParam = Expression.Parameter(typeof(object)); + var expr = Expression.Property(Expression.Convert(instanceParam, type), propertyInfo); + + return Expression.Lambda>(expr, new[] { instanceParam }).Compile(); + } + + public static Action GetInstanceMethodDelegate(this Type type, string methodName) + { + var methodInfo = type.GetMethod(methodName, BindingFlags.Public | BindingFlags.Instance, null, new[] { typeof(TParam1) }, null); + + if (methodInfo == null) + throw new InvalidOperationException(String.Format("Could not find method {0} on type {1}", methodName, type)); + + var instanceParam = Expression.Parameter(typeof(object)); + var param1 = Expression.Parameter(typeof(TParam1)); + + var expr = Expression.Call(Expression.Convert(instanceParam, type), methodInfo, new Expression[] { param1 }); + + return Expression.Lambda>(expr, new[] { instanceParam, param1 }).Compile(); + } + + public static Action GetInstanceMethodDelegate(this Type type, string methodName) + { + var methodInfo = type.GetMethod(methodName, BindingFlags.Public | BindingFlags.Instance, null, new[] { typeof(TParam1), typeof(TParam2) }, null); + + if (methodInfo == null) + throw new InvalidOperationException(String.Format("Could not find method {0} on type {1}", methodName, type)); + + var instanceParam = Expression.Parameter(typeof(object)); + var param1 = Expression.Parameter(typeof(TParam1)); + var param2 = Expression.Parameter(typeof(TParam2)); + + var expr = Expression.Call(Expression.Convert(instanceParam, type), methodInfo, new Expression[] { param1, param2 }); + + return Expression.Lambda>(expr, new[] { instanceParam, param1, param2 }).Compile(); + } + + public static Func GetStaticFunctionDelegate(this Type type, string methodName) + { + var methodInfo = type.GetMethod(methodName, BindingFlags.Public | BindingFlags.Static, null, + new[] { typeof(T) }, null); + + if (methodInfo == null) + throw new InvalidOperationException(String.Format("Could not find method {0} on type {1}", methodName, type)); + + var param1 = Expression.Parameter(typeof(T)); + + return Expression + .Lambda>(Expression.Call(methodInfo, param1), new[] { param1 }) + .Compile(); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Log4NetBridge/ConfigureInternalLog4NetBridge.cs b/src/NServiceBus.Core/Logging/Log4NetBridge/ConfigureInternalLog4NetBridge.cs new file mode 100644 index 00000000000..b3eac99b279 --- /dev/null +++ b/src/NServiceBus.Core/Logging/Log4NetBridge/ConfigureInternalLog4NetBridge.cs @@ -0,0 +1,20 @@ +namespace NServiceBus.Logging.Log4NetBridge +{ + public class ConfigureInternalLog4NetBridge : IWantToRunBeforeConfiguration + { + private static bool isConfigured; + + public void Init() + { + if (isConfigured) + return; + + var isLog4NetMerged = typeof(log4net.ILog).Assembly == System.Reflection.Assembly.GetExecutingAssembly(); + + if (isLog4NetMerged) + log4net.Config.BasicConfigurator.Configure(new Log4NetBridgeAppender()); + + isConfigured = true; + } + } +} diff --git a/src/NServiceBus.Core/Logging/Log4NetBridge/Log4NetBridgeAppender.cs b/src/NServiceBus.Core/Logging/Log4NetBridge/Log4NetBridgeAppender.cs new file mode 100644 index 00000000000..feebf0f49b6 --- /dev/null +++ b/src/NServiceBus.Core/Logging/Log4NetBridge/Log4NetBridgeAppender.cs @@ -0,0 +1,25 @@ +namespace NServiceBus.Logging.Log4NetBridge +{ + using log4net.Appender; + using log4net.Core; + + internal class Log4NetBridgeAppender : AppenderSkeleton + { + protected override void Append(LoggingEvent loggingEvent) + { + // This might be slow but it should not be an issue since neither Topshelf or Rhino.Licensing logs that much. + NServiceBus.Logging.ILog Log = NServiceBus.Logging.LogManager.GetLogger(loggingEvent.LoggerName); + + if (loggingEvent.Level == Level.Debug) + Log.Debug(loggingEvent.RenderedMessage, loggingEvent.ExceptionObject); + if (loggingEvent.Level == Level.Info) + Log.Info(loggingEvent.RenderedMessage, loggingEvent.ExceptionObject); + if (loggingEvent.Level == Level.Warn) + Log.Warn(loggingEvent.RenderedMessage, loggingEvent.ExceptionObject); + if (loggingEvent.Level == Level.Error) + Log.Error(loggingEvent.RenderedMessage, loggingEvent.ExceptionObject); + if (loggingEvent.Level == Level.Fatal) + Log.Fatal(loggingEvent.RenderedMessage, loggingEvent.ExceptionObject); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/LogManager.cs b/src/NServiceBus.Core/Logging/LogManager.cs new file mode 100644 index 00000000000..bd66478102a --- /dev/null +++ b/src/NServiceBus.Core/Logging/LogManager.cs @@ -0,0 +1,48 @@ +namespace NServiceBus.Logging +{ + using System; + using Loggers; + + /// + /// + /// + public class LogManager + { + private static ILoggerFactory _loggerFactory = new NullLoggerFactory(); + + /// + /// + /// + public static ILoggerFactory LoggerFactory + { + get { return _loggerFactory; } + set + { + if (value == null) + throw new ArgumentNullException("value"); + + _loggerFactory = value; + } + } + + /// + /// + /// + /// + /// + public static ILog GetLogger(Type type) + { + return LoggerFactory.GetLogger(type); + } + + /// + /// + /// + /// + /// + public static ILog GetLogger(string name) + { + return LoggerFactory.GetLogger(name); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Loggers/ConsoleLogger.cs b/src/NServiceBus.Core/Logging/Loggers/ConsoleLogger.cs new file mode 100644 index 00000000000..b5ce997b945 --- /dev/null +++ b/src/NServiceBus.Core/Logging/Loggers/ConsoleLogger.cs @@ -0,0 +1,121 @@ +namespace NServiceBus.Logging.Loggers +{ + using System; + + /// + /// + /// + public class ConsoleLogger : ILog + { + /// + /// + /// + public bool IsDebugEnabled + { + get { return true; } + } + + /// + /// + /// + public bool IsInfoEnabled + { + get { return true; } + } + + public bool IsWarnEnabled + { + get { return true; } + } + + public bool IsErrorEnabled + { + get { return true; } + } + + public bool IsFatalEnabled + { + get { return true; } + } + + public void Debug(string message) + { + Console.WriteLine(message); + } + + public void Debug(string message, Exception exception) + { + Console.WriteLine(message); + Console.WriteLine(exception); + } + + public void DebugFormat(string format, params object[] args) + { + Console.WriteLine(format, args); + } + + public void Info(string message) + { + Console.WriteLine(message); + } + + public void Info(string message, Exception exception) + { + Console.WriteLine(message); + Console.WriteLine(exception); + } + + public void InfoFormat(string format, params object[] args) + { + Console.WriteLine(format, args); + } + + public void Warn(string message) + { + Console.WriteLine(message); + } + + public void Warn(string message, Exception exception) + { + Console.WriteLine(message); + Console.WriteLine(exception); + } + + public void WarnFormat(string format, params object[] args) + { + Console.WriteLine(format, args); + } + + public void Error(string message) + { + Console.WriteLine(message); + } + + public void Error(string message, Exception exception) + { + Console.WriteLine(message); + Console.WriteLine(exception); + } + + public void ErrorFormat(string format, params object[] args) + { + Console.WriteLine(format, args); + } + + public void Fatal(string message) + { + Console.WriteLine(message); + } + + public void Fatal(string message, Exception exception) + { + Console.WriteLine(message); + Console.WriteLine(exception); + } + + public void FatalFormat(string format, params object[] args) + { + Console.WriteLine(format, args); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Loggers/ConsoleLoggerFactory.cs b/src/NServiceBus.Core/Logging/Loggers/ConsoleLoggerFactory.cs new file mode 100644 index 00000000000..16a2779beff --- /dev/null +++ b/src/NServiceBus.Core/Logging/Loggers/ConsoleLoggerFactory.cs @@ -0,0 +1,20 @@ +namespace NServiceBus.Logging.Loggers +{ + using System; + + /// + /// + /// + public class ConsoleLoggerFactory : ILoggerFactory + { + public ILog GetLogger(Type type) + { + return new ConsoleLogger(); + } + + public ILog GetLogger(string name) + { + return new ConsoleLogger(); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Loggers/Log4NetAdapter/Log4NetAppenderFactory.cs b/src/NServiceBus.Core/Logging/Loggers/Log4NetAdapter/Log4NetAppenderFactory.cs new file mode 100644 index 00000000000..c575fa4fecf --- /dev/null +++ b/src/NServiceBus.Core/Logging/Loggers/Log4NetAdapter/Log4NetAppenderFactory.cs @@ -0,0 +1,96 @@ +namespace NServiceBus.Logging.Loggers.Log4NetAdapter +{ + using System; + using Internal; + + public class Log4NetAppenderFactory + { + private static readonly Type LevelType = Type.GetType("log4net.Core.Level, log4net"); + private static readonly Type ConsoleAppenderType = Type.GetType("log4net.Appender.ConsoleAppender, log4net"); + private static readonly Type ColoredConsoleAppenderType = Type.GetType("log4net.Appender.ColoredConsoleAppender, log4net"); + private static readonly Type RollingFileAppenderType = Type.GetType("log4net.Appender.RollingFileAppender, log4net"); + private static readonly Type LevelColorsType = Type.GetType("log4net.Appender.ColoredConsoleAppender+LevelColors, log4net"); + private static readonly Type ColorsType = Type.GetType("log4net.Appender.ColoredConsoleAppender+Colors, log4net"); + + private static readonly Type RollingModeType = Type.GetType("log4net.Appender.RollingFileAppender+RollingMode, log4net"); + private static readonly Type MinimalLockType = Type.GetType("log4net.Appender.FileAppender+MinimalLock, log4net"); + + static Log4NetAppenderFactory() + { + if (ColoredConsoleAppenderType == null) + throw new InvalidOperationException("Log4net could not be loaded. Make sure that the log4net assembly is located in the executable directory."); + } + + public static object CreateConsoleAppender(string level) + { + dynamic appender = Activator.CreateInstance(ConsoleAppenderType); + + if (level != null) + appender.Threshold = ConvertToLogLevel(level); + + return appender; + } + + public static object CreateColoredConsoleAppender(string level) + { + dynamic appender = Activator.CreateInstance(ColoredConsoleAppenderType); + + if (level != null) + appender.Threshold = ConvertToLogLevel(level); + + AddMapping(appender, "Debug", "White"); + AddMapping(appender, "Info", "Green"); + AddMapping(appender, "Warn", "Yellow", "HighIntensity"); + AddMapping(appender, "Error", "Red", "HighIntensity"); + + return appender; + } + + public static object CreateRollingFileAppender(string level, string filename) + { + dynamic appender = Activator.CreateInstance(RollingFileAppenderType); + + if (level != null) + appender.Threshold = ConvertToLogLevel(level); + + appender.CountDirection = 1; + appender.DatePattern = "yyyy-MM-dd"; + + appender.RollingStyle = (dynamic)Enum.Parse(RollingModeType, "Composite"); + appender.MaxFileSize = 1024*1024; + appender.MaxSizeRollBackups = 10; + appender.LockingModel = (dynamic)Activator.CreateInstance(MinimalLockType); + appender.StaticLogFileName = true; + appender.File =filename; + appender.AppendToFile = true; + + return appender; + } + + internal static dynamic ConvertToLogLevel(string level) + { + return LevelType.GetStaticField(level, true); + } + + private static void AddMapping(dynamic appender, string level, string color1, string color2 = null) + { + dynamic levelColors = Activator.CreateInstance(LevelColorsType); + + levelColors.Level = ConvertToLogLevel(level); + levelColors.ForeColor = GetColors(color1, color2); + + appender.AddMapping(levelColors); + } + + private static dynamic GetColors(string color1, string color2) + { + var colorsValue = (int)Enum.Parse(ColorsType, color1); + + if (color2 != null) + colorsValue |= (int)Enum.Parse(ColorsType, color2); + + return Enum.ToObject(ColorsType, colorsValue); + } + + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Loggers/Log4NetAdapter/Log4NetConfigurator.cs b/src/NServiceBus.Core/Logging/Loggers/Log4NetAdapter/Log4NetConfigurator.cs new file mode 100644 index 00000000000..e877085bed0 --- /dev/null +++ b/src/NServiceBus.Core/Logging/Loggers/Log4NetAdapter/Log4NetConfigurator.cs @@ -0,0 +1,63 @@ +namespace NServiceBus.Logging.Loggers.Log4NetAdapter +{ + using System; + using Internal; + + /// + /// + /// + public class Log4NetConfigurator + { + private static readonly Type AppenderSkeletonType = Type.GetType("log4net.Appender.AppenderSkeleton, log4net"); + private static readonly Type PatternLayoutType = Type.GetType("log4net.Layout.PatternLayout, log4net"); + private static readonly Type BasicConfiguratorType = Type.GetType("log4net.Config.BasicConfigurator, log4net"); + + public static bool Log4NetExists + { + get { return Type.GetType("log4net.LogManager, log4net") != null; } + } + + public static void Configure(dynamic appenderForNServiceBusToLogTo, string thresholdForNServiceBusToLogWith = null) + { + if (appenderForNServiceBusToLogTo == null) + { + throw new ArgumentNullException("appenderForNServiceBusToLogTo"); + } + EnsureLog4NetExists(); + + if (!AppenderSkeletonType.IsInstanceOfType(appenderForNServiceBusToLogTo)) + throw new ArgumentException("The object provided must inherit from log4net.Appender.AppenderSkeleton."); + + Configure(); + + if (appenderForNServiceBusToLogTo.Layout == null) + appenderForNServiceBusToLogTo.Layout = (dynamic)Activator.CreateInstance(PatternLayoutType, "%d [%t] %-5p %c [%x] <%X{auth}> - %m%n"); + + if (thresholdForNServiceBusToLogWith != null) + appenderForNServiceBusToLogTo.Threshold = Log4NetAppenderFactory.ConvertToLogLevel(thresholdForNServiceBusToLogWith); + + if (appenderForNServiceBusToLogTo.Threshold == null) + appenderForNServiceBusToLogTo.Threshold = Log4NetAppenderFactory.ConvertToLogLevel("Info"); + + appenderForNServiceBusToLogTo.ActivateOptions(); + + BasicConfiguratorType.InvokeStaticMethod("Configure", (object)appenderForNServiceBusToLogTo); + } + + /// + /// Configure NServiceBus to use Log4Net without setting a specific appender. + /// + public static void Configure() + { + EnsureLog4NetExists(); + + LogManager.LoggerFactory = new Log4NetLoggerFactory(); + } + + private static void EnsureLog4NetExists() + { + if (!Log4NetExists) + throw new LoggingLibraryException("Log4net could not be loaded. Make sure that the log4net assembly is located in the executable directory."); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Loggers/Log4NetAdapter/Log4NetLogger.cs b/src/NServiceBus.Core/Logging/Loggers/Log4NetAdapter/Log4NetLogger.cs new file mode 100644 index 00000000000..eb3a4461da3 --- /dev/null +++ b/src/NServiceBus.Core/Logging/Loggers/Log4NetAdapter/Log4NetLogger.cs @@ -0,0 +1,175 @@ +namespace NServiceBus.Logging.Loggers.Log4NetAdapter +{ + using System; + using Internal; + + /// + /// + /// + public class Log4NetLogger : ILog + { + private readonly object _logger; + + private static readonly Type LogType = Type.GetType("log4net.ILog, log4net"); + + private static readonly Func IsDebugEnabledDelegate; + private static readonly Func IsInfoEnabledDelegate; + private static readonly Func IsWarnEnabledDelegate; + private static readonly Func IsErrorEnabledDelegate; + private static readonly Func IsFatalEnabledDelegate; + + private static readonly Action DebugDelegate; + private static readonly Action DebugExceptionDelegate; + private static readonly Action DebugFormatDelegate; + + private static readonly Action InfoDelegate; + private static readonly Action InfoExceptionDelegate; + private static readonly Action InfoFormatDelegate; + + private static readonly Action WarnDelegate; + private static readonly Action WarnExceptionDelegate; + private static readonly Action WarnFormatDelegate; + + private static readonly Action ErrorDelegate; + private static readonly Action ErrorExceptionDelegate; + private static readonly Action ErrorFormatDelegate; + + private static readonly Action FatalDelegate; + private static readonly Action FatalExceptionDelegate; + private static readonly Action FatalFormatDelegate; + + static Log4NetLogger() + { + IsDebugEnabledDelegate = LogType.GetInstancePropertyDelegate("IsDebugEnabled"); + IsInfoEnabledDelegate = LogType.GetInstancePropertyDelegate("IsInfoEnabled"); + IsWarnEnabledDelegate = LogType.GetInstancePropertyDelegate("IsWarnEnabled"); + IsErrorEnabledDelegate = LogType.GetInstancePropertyDelegate("IsErrorEnabled"); + IsFatalEnabledDelegate = LogType.GetInstancePropertyDelegate("IsFatalEnabled"); + + DebugDelegate = LogType.GetInstanceMethodDelegate("Debug"); + DebugExceptionDelegate = LogType.GetInstanceMethodDelegate("Debug"); + DebugFormatDelegate = LogType.GetInstanceMethodDelegate("DebugFormat"); + + InfoDelegate = LogType.GetInstanceMethodDelegate("Info"); + InfoExceptionDelegate = LogType.GetInstanceMethodDelegate("Info"); + InfoFormatDelegate = LogType.GetInstanceMethodDelegate("InfoFormat"); + + WarnDelegate = LogType.GetInstanceMethodDelegate("Warn"); + WarnExceptionDelegate = LogType.GetInstanceMethodDelegate("Warn"); + WarnFormatDelegate = LogType.GetInstanceMethodDelegate("WarnFormat"); + + ErrorDelegate = LogType.GetInstanceMethodDelegate("Error"); + ErrorExceptionDelegate = LogType.GetInstanceMethodDelegate("Error"); + ErrorFormatDelegate = LogType.GetInstanceMethodDelegate("ErrorFormat"); + + FatalDelegate = LogType.GetInstanceMethodDelegate("Fatal"); + FatalExceptionDelegate = LogType.GetInstanceMethodDelegate("Fatal"); + FatalFormatDelegate = LogType.GetInstanceMethodDelegate("FatalFormat"); + } + + public Log4NetLogger(object logger) + { + _logger = logger; + } + + public bool IsDebugEnabled + { + get { return IsDebugEnabledDelegate(_logger); } + } + + public bool IsInfoEnabled + { + get { return IsInfoEnabledDelegate(_logger); } + } + + public bool IsWarnEnabled + { + get { return IsWarnEnabledDelegate(_logger); } + } + + public bool IsErrorEnabled + { + get { return IsErrorEnabledDelegate(_logger); } + } + + public bool IsFatalEnabled + { + get { return IsFatalEnabledDelegate(_logger); } + } + + public void Debug(string message) + { + DebugDelegate(_logger, message); + } + + public void Debug(string message, Exception exception) + { + DebugExceptionDelegate(_logger, message, exception); + } + + public void DebugFormat(string format, params object[] args) + { + DebugFormatDelegate(_logger, format, args); + } + + public void Info(string message) + { + InfoDelegate(_logger, message); + } + + public void Info(string message, Exception exception) + { + InfoExceptionDelegate(_logger, message, exception); + } + + public void InfoFormat(string format, params object[] args) + { + InfoFormatDelegate(_logger, format, args); + } + + public void Warn(string message) + { + WarnDelegate(_logger, message); + } + + public void Warn(string message, Exception exception) + { + WarnExceptionDelegate(_logger, message, exception); + } + + public void WarnFormat(string format, params object[] args) + { + WarnFormatDelegate(_logger, format, args); + } + + public void Error(string message) + { + ErrorDelegate(_logger, message); + } + + public void Error(string message, Exception exception) + { + ErrorExceptionDelegate(_logger, message, exception); + } + + public void ErrorFormat(string format, params object[] args) + { + ErrorFormatDelegate(_logger, format, args); + } + + public void Fatal(string message) + { + FatalDelegate(_logger, message); + } + + public void Fatal(string message, Exception exception) + { + FatalExceptionDelegate(_logger, message, exception); + } + + public void FatalFormat(string format, params object[] args) + { + FatalFormatDelegate(_logger, format, args); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Loggers/Log4NetAdapter/Log4NetLoggerFactory.cs b/src/NServiceBus.Core/Logging/Loggers/Log4NetAdapter/Log4NetLoggerFactory.cs new file mode 100644 index 00000000000..a3ab31d6c15 --- /dev/null +++ b/src/NServiceBus.Core/Logging/Loggers/Log4NetAdapter/Log4NetLoggerFactory.cs @@ -0,0 +1,35 @@ +namespace NServiceBus.Logging.Loggers.Log4NetAdapter +{ + using System; + using Internal; + + /// + /// + /// + public class Log4NetLoggerFactory : ILoggerFactory + { + private readonly Func GetLoggerByTypeDelegate; + private readonly Func GetLoggerByStringDelegate; + + public Log4NetLoggerFactory() + { + var logManagerType = Type.GetType("log4net.LogManager, log4net"); + + if (logManagerType == null) + throw new InvalidOperationException("Log4net could not be loaded. Make sure that the log4net assembly is located in the executable directory."); + + GetLoggerByTypeDelegate = logManagerType.GetStaticFunctionDelegate("GetLogger"); + GetLoggerByStringDelegate = logManagerType.GetStaticFunctionDelegate("GetLogger"); + } + + public ILog GetLogger(Type type) + { + return new Log4NetLogger(GetLoggerByTypeDelegate(type)); + } + + public ILog GetLogger(string name) + { + return new Log4NetLogger(GetLoggerByStringDelegate(name)); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Loggers/NLogAdapter/NLogConfigurator.cs b/src/NServiceBus.Core/Logging/Loggers/NLogAdapter/NLogConfigurator.cs new file mode 100644 index 00000000000..53ea4d02931 --- /dev/null +++ b/src/NServiceBus.Core/Logging/Loggers/NLogAdapter/NLogConfigurator.cs @@ -0,0 +1,87 @@ +using System.Collections.Generic; + +namespace NServiceBus.Logging.Loggers.NLogAdapter +{ + using System; + using System.Linq; + using Internal; + + /// + /// + /// + public class NLogConfigurator + { + private static readonly Type TargetType = Type.GetType("NLog.Targets.Target, NLog"); + private static readonly Type LogLevelType = Type.GetType("NLog.LogLevel, NLog"); + private static readonly Type LoggingConfigurationType = Type.GetType("NLog.Config.LoggingConfiguration, NLog"); + private static readonly Type LogManagerType = Type.GetType("NLog.LogManager, NLog"); + private static readonly Type LoggingRuleType = Type.GetType("NLog.Config.LoggingRule, NLog"); + + public static bool NLogExists + { + get { return Type.GetType("NLog.LogManager, NLog") != null; } + } + + public static void Configure(object targetForNServiceBusToLogTo, string levelForNServiceBusToLogWith = null) + { + if (targetForNServiceBusToLogTo == null) + { + throw new ArgumentNullException("targetForNServiceBusToLogTo"); + } + Configure(new[] { targetForNServiceBusToLogTo }, levelForNServiceBusToLogWith); + } + + public static void Configure(object[] targetsForNServiceBusToLogTo, string levelForNServiceBusToLogWith = null) + { + EnsureNLogExists(); + + if (!targetsForNServiceBusToLogTo.All(x => TargetType.IsInstanceOfType(x))) + throw new ArgumentException("The objects provided must inherit from NLog.Targets.Target."); + + + dynamic loggingConfiguration = LogManagerType.GetStaticProperty("Configuration"); + if (loggingConfiguration == null) + { + loggingConfiguration = Activator.CreateInstance(LoggingConfigurationType); + } + foreach (dynamic target in targetsForNServiceBusToLogTo) + { + //TODO:check if target is owned by another config + if (target.Name == null) + { + var name = target.GetType().Name; + loggingConfiguration.AddTarget(name, target); + } + } + + var logLevel = LogLevelType.GetStaticField(levelForNServiceBusToLogWith ?? "Info", true); + dynamic loggingRule = Activator.CreateInstance(LoggingRuleType, "*", logLevel, targetsForNServiceBusToLogTo.First()); + + foreach (dynamic target in targetsForNServiceBusToLogTo.Skip(1)) + { + loggingRule.Targets.Add(target); + } + + loggingConfiguration.LoggingRules.Add(loggingRule); + LogManagerType.SetStaticProperty("Configuration", (object)loggingConfiguration); + Configure(); + + } + + /// + /// Configure NServiceBus to use Log4Net without setting a specific appender. + /// + public static void Configure() + { + EnsureNLogExists(); + + LogManager.LoggerFactory = new NLogLoggerFactory(); + } + + private static void EnsureNLogExists() + { + if (!NLogExists) + throw new LoggingLibraryException("NLog could not be loaded. Make sure that the NLog assembly is located in the executable directory."); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Loggers/NLogAdapter/NLogLogger.cs b/src/NServiceBus.Core/Logging/Loggers/NLogAdapter/NLogLogger.cs new file mode 100644 index 00000000000..31c24436cda --- /dev/null +++ b/src/NServiceBus.Core/Logging/Loggers/NLogAdapter/NLogLogger.cs @@ -0,0 +1,175 @@ +namespace NServiceBus.Logging.Loggers.NLogAdapter +{ + using System; + using Internal; + + /// + /// + /// + public class NLogLogger : ILog + { + private readonly object _logger; + + private static readonly Type LogType = Type.GetType("NLog.Logger, NLog"); + + private static readonly Func IsDebugEnabledDelegate; + private static readonly Func IsInfoEnabledDelegate; + private static readonly Func IsWarnEnabledDelegate; + private static readonly Func IsErrorEnabledDelegate; + private static readonly Func IsFatalEnabledDelegate; + + private static readonly Action DebugDelegate; + private static readonly Action DebugExceptionDelegate; + private static readonly Action DebugFormatDelegate; + + private static readonly Action InfoDelegate; + private static readonly Action InfoExceptionDelegate; + private static readonly Action InfoFormatDelegate; + + private static readonly Action WarnDelegate; + private static readonly Action WarnExceptionDelegate; + private static readonly Action WarnFormatDelegate; + + private static readonly Action ErrorDelegate; + private static readonly Action ErrorExceptionDelegate; + private static readonly Action ErrorFormatDelegate; + + private static readonly Action FatalDelegate; + private static readonly Action FatalExceptionDelegate; + private static readonly Action FatalFormatDelegate; + + static NLogLogger() + { + IsDebugEnabledDelegate = LogType.GetInstancePropertyDelegate("IsDebugEnabled"); + IsInfoEnabledDelegate = LogType.GetInstancePropertyDelegate("IsInfoEnabled"); + IsWarnEnabledDelegate = LogType.GetInstancePropertyDelegate("IsWarnEnabled"); + IsErrorEnabledDelegate = LogType.GetInstancePropertyDelegate("IsErrorEnabled"); + IsFatalEnabledDelegate = LogType.GetInstancePropertyDelegate("IsFatalEnabled"); + + DebugDelegate = LogType.GetInstanceMethodDelegate("Debug"); + DebugExceptionDelegate = LogType.GetInstanceMethodDelegate("DebugException"); + DebugFormatDelegate = LogType.GetInstanceMethodDelegate("Debug"); + + InfoDelegate = LogType.GetInstanceMethodDelegate("Info"); + InfoExceptionDelegate = LogType.GetInstanceMethodDelegate("InfoException"); + InfoFormatDelegate = LogType.GetInstanceMethodDelegate("Info"); + + WarnDelegate = LogType.GetInstanceMethodDelegate("Warn"); + WarnExceptionDelegate = LogType.GetInstanceMethodDelegate("WarnException"); + WarnFormatDelegate = LogType.GetInstanceMethodDelegate("Warn"); + + ErrorDelegate = LogType.GetInstanceMethodDelegate("Error"); + ErrorExceptionDelegate = LogType.GetInstanceMethodDelegate("ErrorException"); + ErrorFormatDelegate = LogType.GetInstanceMethodDelegate("Error"); + + FatalDelegate = LogType.GetInstanceMethodDelegate("Fatal"); + FatalExceptionDelegate = LogType.GetInstanceMethodDelegate("FatalException"); + FatalFormatDelegate = LogType.GetInstanceMethodDelegate("Fatal"); + } + + public NLogLogger(object logger) + { + _logger = logger; + } + + public bool IsDebugEnabled + { + get { return IsDebugEnabledDelegate(_logger); } + } + + public bool IsInfoEnabled + { + get { return IsInfoEnabledDelegate(_logger); } + } + + public bool IsWarnEnabled + { + get { return IsWarnEnabledDelegate(_logger); } + } + + public bool IsErrorEnabled + { + get { return IsErrorEnabledDelegate(_logger); } + } + + public bool IsFatalEnabled + { + get { return IsFatalEnabledDelegate(_logger); } + } + + public void Debug(string message) + { + DebugDelegate(_logger, message); + } + + public void Debug(string message, Exception exception) + { + DebugExceptionDelegate(_logger, message, exception); + } + + public void DebugFormat(string format, params object[] args) + { + DebugFormatDelegate(_logger, format, args); + } + + public void Info(string message) + { + InfoDelegate(_logger, message); + } + + public void Info(string message, Exception exception) + { + InfoExceptionDelegate(_logger, message, exception); + } + + public void InfoFormat(string format, params object[] args) + { + InfoFormatDelegate(_logger, format, args); + } + + public void Warn(string message) + { + WarnDelegate(_logger, message); + } + + public void Warn(string message, Exception exception) + { + WarnExceptionDelegate(_logger, message, exception); + } + + public void WarnFormat(string format, params object[] args) + { + WarnFormatDelegate(_logger, format, args); + } + + public void Error(string message) + { + ErrorDelegate(_logger, message); + } + + public void Error(string message, Exception exception) + { + ErrorExceptionDelegate(_logger, message, exception); + } + + public void ErrorFormat(string format, params object[] args) + { + ErrorFormatDelegate(_logger, format, args); + } + + public void Fatal(string message) + { + FatalDelegate(_logger, message); + } + + public void Fatal(string message, Exception exception) + { + FatalExceptionDelegate(_logger, message, exception); + } + + public void FatalFormat(string format, params object[] args) + { + FatalFormatDelegate(_logger, format, args); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Loggers/NLogAdapter/NLogLoggerFactory.cs b/src/NServiceBus.Core/Logging/Loggers/NLogAdapter/NLogLoggerFactory.cs new file mode 100644 index 00000000000..c42ea950684 --- /dev/null +++ b/src/NServiceBus.Core/Logging/Loggers/NLogAdapter/NLogLoggerFactory.cs @@ -0,0 +1,34 @@ +namespace NServiceBus.Logging.Loggers.NLogAdapter +{ + using System; + using Internal; + + /// + /// + /// + public class NLogLoggerFactory : ILoggerFactory + { + private readonly Func GetLoggerByStringDelegate; + + public NLogLoggerFactory() + { + var logManagerType = Type.GetType("NLog.LogManager, NLog"); + + if (logManagerType == null) + throw new InvalidOperationException("NLog could not be loaded. Make sure that the NLog assembly is located in the executable directory."); + + GetLoggerByStringDelegate = logManagerType.GetStaticFunctionDelegate("GetLogger"); + } + + public ILog GetLogger(Type type) + { + return new NLogLogger(GetLoggerByStringDelegate(type.FullName)); + } + + public ILog GetLogger(string name) + { + var logger = GetLoggerByStringDelegate(name); + return new NLogLogger(logger); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Loggers/NLogAdapter/NLogTargetFactory.cs b/src/NServiceBus.Core/Logging/Loggers/NLogAdapter/NLogTargetFactory.cs new file mode 100644 index 00000000000..ba8c63af07b --- /dev/null +++ b/src/NServiceBus.Core/Logging/Loggers/NLogAdapter/NLogTargetFactory.cs @@ -0,0 +1,75 @@ +namespace NServiceBus.Logging.Loggers.NLogAdapter +{ + using System; + using Internal; + + /// + /// Factory to create NLog targets + /// + public class NLogTargetFactory + { + private static readonly Type ConsoleTargetType = Type.GetType("NLog.Targets.ConsoleTarget, NLog"); + private static readonly Type ColoredConsoleTargetType = Type.GetType("NLog.Targets.ColoredConsoleTarget, NLog"); + private static readonly Type FileTargetType = Type.GetType("NLog.Targets.FileTarget, NLog"); + + private static readonly Type FileArchivePeriodType = Type.GetType("NLog.Targets.FileArchivePeriod, NLog"); + private static readonly Type ArchiveNumberingModeType = Type.GetType("NLog.Targets.ArchiveNumberingMode, NLog"); + + private static readonly Type SimpleLayoutType = Type.GetType("NLog.Layouts.SimpleLayout, NLog"); + private static readonly Type LayoutType = Type.GetType("NLog.Layouts.Layout, NLog"); + + static NLogTargetFactory() + { + if (ConsoleTargetType == null || ColoredConsoleTargetType == null || FileTargetType == null) + throw new InvalidOperationException("NLog could not be loaded. Make sure that the NLog assembly is located in the executable directory."); + } + + public static object CreateConsoleTarget(string layout = null) + { + var target = Activator.CreateInstance(ConsoleTargetType); + + SetLayout(layout, target); + + return target; + } + + public static object CreateColoredConsoleTarget(string layout = null) + { + dynamic target = Activator.CreateInstance(ColoredConsoleTargetType); + + target.UseDefaultRowHighlightingRules = true; + + SetLayout(layout, target); + + return target; + } + + + public static object CreateRollingFileTarget(string filename, string layout = null) + { + dynamic target = Activator.CreateInstance(FileTargetType); + + var archiveFilename = string.Format("{0}.{{#}}", filename); + + target.FileName = (dynamic)LayoutType.InvokeStaticMethod("FromString", filename); + target.ArchiveFileName = (dynamic)LayoutType.InvokeStaticMethod("FromString", archiveFilename); + target.ArchiveAboveSize = 1024 * 1024; + target.ArchiveEvery = (dynamic)Enum.Parse(FileArchivePeriodType, "Day"); + target.ArchiveNumbering = (dynamic)Enum.Parse(ArchiveNumberingModeType, "Rolling"); + target.MaxArchiveFiles = 10; + target.KeepFileOpen = false; + + SetLayout(layout, target); + + return target; + } + + private static void SetLayout(string layout, dynamic target) + { + if (layout != null) + { + target.Layout= (dynamic)Activator.CreateInstance(SimpleLayoutType, layout); + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Loggers/NullLogger.cs b/src/NServiceBus.Core/Logging/Loggers/NullLogger.cs new file mode 100644 index 00000000000..694dcf4bf67 --- /dev/null +++ b/src/NServiceBus.Core/Logging/Loggers/NullLogger.cs @@ -0,0 +1,95 @@ +namespace NServiceBus.Logging.Loggers +{ + using System; + + /// + /// + /// + public class NullLogger : ILog + { + public bool IsDebugEnabled + { + get { return false; } + } + + public bool IsInfoEnabled + { + get { return false; } + } + + public bool IsWarnEnabled + { + get { return false; } + } + + public bool IsErrorEnabled + { + get { return false; } + } + + public bool IsFatalEnabled + { + get { return false; } + } + + public void Debug(string message) + { + } + + public void Debug(string message, Exception exception) + { + } + + public void DebugFormat(string format, params object[] args) + { + } + + public void Info(string message) + { + } + + public void Info(string message, Exception exception) + { + } + + public void InfoFormat(string format, params object[] args) + { + } + + public void Warn(string message) + { + } + + public void Warn(string message, Exception exception) + { + } + + public void WarnFormat(string format, params object[] args) + { + } + + public void Error(string message) + { + } + + public void Error(string message, Exception exception) + { + } + + public void ErrorFormat(string format, params object[] args) + { + } + + public void Fatal(string message) + { + } + + public void Fatal(string message, Exception exception) + { + } + + public void FatalFormat(string format, params object[] args) + { + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/Loggers/NullLoggerFactory.cs b/src/NServiceBus.Core/Logging/Loggers/NullLoggerFactory.cs new file mode 100644 index 00000000000..7882df7f156 --- /dev/null +++ b/src/NServiceBus.Core/Logging/Loggers/NullLoggerFactory.cs @@ -0,0 +1,20 @@ +namespace NServiceBus.Logging.Loggers +{ + using System; + + /// + /// + /// + public class NullLoggerFactory : ILoggerFactory + { + public ILog GetLogger(Type type) + { + return new NullLogger(); + } + + public ILog GetLogger(string name) + { + return new NullLogger(); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Logging/LoggingLibraryException.cs b/src/NServiceBus.Core/Logging/LoggingLibraryException.cs new file mode 100644 index 00000000000..336c38a2598 --- /dev/null +++ b/src/NServiceBus.Core/Logging/LoggingLibraryException.cs @@ -0,0 +1,19 @@ +namespace NServiceBus.Logging +{ + using System; + + /// + /// + /// + public class LoggingLibraryException : Exception + { + /// + /// + /// + /// + public LoggingLibraryException(string message) + : base(message) + { + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/MasterNode/AdjustSettingsForNonMasterNodes.cs b/src/NServiceBus.Core/MasterNode/AdjustSettingsForNonMasterNodes.cs new file mode 100644 index 00000000000..ef5e543d81e --- /dev/null +++ b/src/NServiceBus.Core/MasterNode/AdjustSettingsForNonMasterNodes.cs @@ -0,0 +1,15 @@ +namespace NServiceBus.MasterNode +{ + using Settings; + + class AdjustSettingsForNonMasterNodes:IWantToRunBeforeConfigurationIsFinalized + { + public void Run() + { + if (!Configure.Instance.HasMasterNode()) + return; + + SettingsHolder.SetDefault("SecondLevelRetries.AddressOfRetryProcessor",Configure.Instance.GetMasterNodeAddress().SubScope("Retries")); + } + } +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast.Config/ConfigureMasterNode.cs b/src/NServiceBus.Core/MasterNode/ConfigureMasterNode.cs similarity index 89% rename from src/unicast/NServiceBus.Unicast.Config/ConfigureMasterNode.cs rename to src/NServiceBus.Core/MasterNode/ConfigureMasterNode.cs index 90100158855..d749e02412e 100644 --- a/src/unicast/NServiceBus.Unicast.Config/ConfigureMasterNode.cs +++ b/src/NServiceBus.Core/MasterNode/ConfigureMasterNode.cs @@ -1,60 +1,64 @@ -using System; -using System.Configuration; - namespace NServiceBus -{ - using Config; - +{ + using System; + using System.Configuration; + using Config; + public static class ConfigureMasterNode { public static Configure AsMasterNode(this Configure config) { isMasterNode = true; return config; - } - + } + public static bool IsConfiguredAsMasterNode(this Configure config) { return isMasterNode; - } - - public static string GetMasterNode(this Configure config) - { - var section = Configure.GetConfigSection(); - if (section != null) - return section.Node; - - return null; - } - - public static Address GetMasterNodeAddress(this Configure config) - { - var unicastBusConfig = Configure.GetConfigSection(); - - //allow users to override data address in config - if (unicastBusConfig != null && !string.IsNullOrWhiteSpace(unicastBusConfig.DistributorDataAddress)) - { - return Address.Parse(unicastBusConfig.DistributorDataAddress); - } - - var masterNode = GetMasterNode(config); - - if (string.IsNullOrWhiteSpace(masterNode)) - { - return Address.Parse(Configure.EndpointName); - } - - ValidateHostName(masterNode); - - return new Address(Configure.EndpointName, masterNode); - } - - private static void ValidateHostName(string hostName) - { - if (Uri.CheckHostName(hostName) == UriHostNameType.Unknown) - throw new ConfigurationErrorsException(string.Format("The 'Node' entry in MasterNodeConfig section of the configuration file: '{0}' is not a valid DNS name.", hostName)); - } - - static bool isMasterNode; - } + } + + public static string GetMasterNode(this Configure config) + { + var section = Configure.GetConfigSection(); + if (section != null) + return section.Node; + + return null; + } + + public static bool HasMasterNode(this Configure config) + { + return !string.IsNullOrEmpty(GetMasterNode(config)); + } + + public static Address GetMasterNodeAddress(this Configure config) + { + var unicastBusConfig = Configure.GetConfigSection(); + + //allow users to override data address in config + if (unicastBusConfig != null && !string.IsNullOrWhiteSpace(unicastBusConfig.DistributorDataAddress)) + { + return Address.Parse(unicastBusConfig.DistributorDataAddress); + } + + var masterNode = GetMasterNode(config); + + if (string.IsNullOrWhiteSpace(masterNode)) + { + return Address.Parse(Configure.EndpointName); + } + + ValidateHostName(masterNode); + + return new Address(Configure.EndpointName, masterNode); + } + + private static void ValidateHostName(string hostName) + { + if (Uri.CheckHostName(hostName) == UriHostNameType.Unknown) + throw new ConfigurationErrorsException(string.Format("The 'Node' entry in MasterNodeConfig section of the configuration file: '{0}' is not a valid DNS name.", hostName)); + } + + static bool isMasterNode; + } } diff --git a/src/unicast/NServiceBus.Unicast.Config/MasterNodeConfig.cs b/src/NServiceBus.Core/MasterNode/MasterNodeConfig.cs similarity index 94% rename from src/unicast/NServiceBus.Unicast.Config/MasterNodeConfig.cs rename to src/NServiceBus.Core/MasterNode/MasterNodeConfig.cs index 817e5c1c201..afb50885232 100644 --- a/src/unicast/NServiceBus.Unicast.Config/MasterNodeConfig.cs +++ b/src/NServiceBus.Core/MasterNode/MasterNodeConfig.cs @@ -1,7 +1,7 @@ -using System.Configuration; - namespace NServiceBus.Config { + using System.Configuration; + /// /// Configuration section for holding the node which is the master. /// diff --git a/src/NServiceBus.Core/MessageConventions.cs b/src/NServiceBus.Core/MessageConventions.cs new file mode 100644 index 00000000000..ef6f624e5ed --- /dev/null +++ b/src/NServiceBus.Core/MessageConventions.cs @@ -0,0 +1,88 @@ +namespace NServiceBus +{ + using System; + using System.Reflection; + + /// + /// Static extension methods to Configure. + /// + public static class MessageConventions + { + /// + /// Sets the function to be used to evaluate whether a type is a message. + /// + /// + /// + public static Configure DefiningMessagesAs(this Configure config, Func definesMessageType) + { + MessageConventionExtensions.IsMessageTypeAction = definesMessageType; + return config; + } + + /// + /// Sets the function to be used to evaluate whether a type is a commands. + /// + /// + /// + public static Configure DefiningCommandsAs(this Configure config, Func definesCommandType) + { + MessageConventionExtensions.IsCommandTypeAction = definesCommandType; + return config; + } + + /// + /// Sets the function to be used to evaluate whether a type is a event. + /// + /// + /// + public static Configure DefiningEventsAs(this Configure config, Func definesEventType) + { + MessageConventionExtensions.IsEventTypeAction = definesEventType; + return config; + } + + /// + /// Sets the function to be used to evaluate whether a property should be encrypted or not. + /// + /// + /// + public static Configure DefiningEncryptedPropertiesAs(this Configure config, Func definesEncryptedProperty) + { + MessageConventionExtensions.IsEncryptedPropertyAction = definesEncryptedProperty; + return config; + } + + /// + /// Sets the function to be used to evaluate whether a property should be sent via the DataBus or not. + /// + /// + /// + public static Configure DefiningDataBusPropertiesAs(this Configure config, Func definesDataBusProperty) + { + MessageConventionExtensions.IsDataBusPropertyAction = definesDataBusProperty; + return config; + } + + /// + /// Sets the function to be used to evaluate whether a message has a time to be received. + /// + /// + /// + public static Configure DefiningTimeToBeReceivedAs(this Configure config, Func retrieveTimeToBeReceived) + { + MessageConventionExtensions.TimeToBeReceivedAction = retrieveTimeToBeReceived; + return config; + } + + /// + /// Sets the function to be used to evaluate whether a type is an express message or not. + /// + /// + /// + public static Configure DefiningExpressMessagesAs(this Configure config, Func definesExpressMessageType) + { + MessageConventionExtensions.IsExpressMessageAction = definesExpressMessageType; + return config; + } + } +} diff --git a/src/NServiceBus.Core/MessageHeaders/Bootstrapper.cs b/src/NServiceBus.Core/MessageHeaders/Bootstrapper.cs new file mode 100644 index 00000000000..6314b3909f9 --- /dev/null +++ b/src/NServiceBus.Core/MessageHeaders/Bootstrapper.cs @@ -0,0 +1,22 @@ +namespace NServiceBus.MessageHeaders +{ + using Config; + using INeedInitialization = NServiceBus.INeedInitialization; + + class Bootstrapper : INeedInitialization, IWantToRunWhenConfigurationIsComplete + { + void INeedInitialization.Init() + { + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + } + + public void Run() + { + ExtensionMethods.GetHeaderAction = (msg, key) => Manager.GetHeader(msg, key); + ExtensionMethods.SetHeaderAction = (msg, key, val) => Manager.SetHeader(msg, key, val); + ExtensionMethods.GetStaticOutgoingHeadersAction = () => Manager.GetStaticOutgoingHeaders(); + } + + public MessageHeaderManager Manager { get; set; } + } +} diff --git a/src/NServiceBus.Core/MessageHeaders/MessageHeaderManager.cs b/src/NServiceBus.Core/MessageHeaders/MessageHeaderManager.cs new file mode 100644 index 00000000000..531c4ec5d34 --- /dev/null +++ b/src/NServiceBus.Core/MessageHeaders/MessageHeaderManager.cs @@ -0,0 +1,107 @@ +namespace NServiceBus.MessageHeaders +{ + using System; + using System.Collections.Generic; + using MessageMutator; + using Unicast; + + /// + /// Message Header Manager + /// + public class MessageHeaderManager : IMutateOutgoingTransportMessages + { + void IMutateOutgoingTransportMessages.MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + foreach(var key in staticOutgoingHeaders.Keys) + transportMessage.Headers.Add(key, staticOutgoingHeaders[key]); + + if ((messages != null) && (messages.Length > 0) && (messageHeaders != null)) + if (messageHeaders.ContainsKey(messages[0])) + foreach(var key in messageHeaders[messages[0]].Keys) + transportMessage.Headers.Add(key, messageHeaders[messages[0]][key]); + } + + /// + /// Gets the Header for the Message + /// + /// message for which Headers to be find + /// Key + /// + public string GetHeader(object message, string key) + { + if (message == ExtensionMethods.CurrentMessageBeingHandled) + if (bus.CurrentMessageContext.Headers.ContainsKey(key)) + return bus.CurrentMessageContext.Headers[key]; + else + return null; + + if (messageHeaders == null) + return null; + + if (!messageHeaders.ContainsKey(message)) + return null; + + if (messageHeaders[message].ContainsKey(key)) + return messageHeaders[message][key]; + + return null; + } + + /// + /// Sets the Header for the Message + /// + /// + /// + /// + public void SetHeader(object message, string key, string value) + { + if (message == null) + throw new InvalidOperationException("Cannot set headers on a null object"); + + if (messageHeaders == null) + messageHeaders = new Dictionary>(); + + if (!messageHeaders.ContainsKey(message)) + messageHeaders.Add(message, new Dictionary()); + + if (!messageHeaders[message].ContainsKey(key)) + messageHeaders[message].Add(key, value); + else + messageHeaders[message][key] = value; + } + + /// + /// Gets Static Outgoing Headers + /// + /// + public IDictionary GetStaticOutgoingHeaders() + { + return staticOutgoingHeaders; + } + + /// + /// Bus + /// + public IUnicastBus Bus + { + get { return bus; } + set + { + bus = value; + bus.MessagesSent += + (s2, a2) => + { + if (a2.Messages != null && messageHeaders != null) + foreach (var msg in a2.Messages) + messageHeaders.Remove(msg); + }; + } + } + private IUnicastBus bus; + + private static IDictionary staticOutgoingHeaders = new Dictionary(); + + [ThreadStatic] + private static IDictionary> messageHeaders; + } +} diff --git a/src/messageInterfaces/NServiceBus.MessageInterfaces/IMessageMapper.cs b/src/NServiceBus.Core/MessageInterfaces/IMessageMapper.cs similarity index 94% rename from src/messageInterfaces/NServiceBus.MessageInterfaces/IMessageMapper.cs rename to src/NServiceBus.Core/MessageInterfaces/IMessageMapper.cs index aec1e1ca541..8261568a02c 100644 --- a/src/messageInterfaces/NServiceBus.MessageInterfaces/IMessageMapper.cs +++ b/src/NServiceBus.Core/MessageInterfaces/IMessageMapper.cs @@ -1,8 +1,8 @@ -using System; -using System.Collections.Generic; - namespace NServiceBus.MessageInterfaces { + using System; + using System.Collections.Generic; + /// /// Enables looking up interfaced mapped to generated concrete types /// and vice versa. diff --git a/src/impl/messageInterfaces/NServiceBus.MessageInterfaces.MessageMapper.Reflection/MessageMapper.cs b/src/NServiceBus.Core/MessageInterfaces/MessageMapper/Reflection/MessageMapper.cs similarity index 93% rename from src/impl/messageInterfaces/NServiceBus.MessageInterfaces.MessageMapper.Reflection/MessageMapper.cs rename to src/NServiceBus.Core/MessageInterfaces/MessageMapper/Reflection/MessageMapper.cs index fab6bcf54ae..43c0155e346 100644 --- a/src/impl/messageInterfaces/NServiceBus.MessageInterfaces.MessageMapper.Reflection/MessageMapper.cs +++ b/src/NServiceBus.Core/MessageInterfaces/MessageMapper/Reflection/MessageMapper.cs @@ -1,16 +1,16 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Reflection; -using System.Reflection.Emit; -using System.Runtime.Serialization; -using System.Linq; -using Common.Logging; -using NServiceBus.Utils.Reflection; - namespace NServiceBus.MessageInterfaces.MessageMapper.Reflection { + using System; + using System.Collections; + using System.Collections.Generic; + using System.ComponentModel; + using System.Linq; + using System.Reflection; + using System.Reflection.Emit; + using System.Runtime.Serialization; + using Logging; + using Utils.Reflection; + /// /// Uses reflection to map between interfaces and their generated concrete implementations. /// @@ -22,10 +22,12 @@ public class MessageMapper : IMessageMapper /// public void Initialize(IEnumerable types) { - if (types == null || types.Count() == 0) + var typesToList = types.ToList(); + + if (types == null || !typesToList.Any()) return; - string name = types.First().Namespace + SUFFIX; + string name = typesToList.First().Namespace + SUFFIX; AssemblyBuilder assemblyBuilder = AppDomain.CurrentDomain.DefineDynamicAssembly( new AssemblyName(name), @@ -34,7 +36,7 @@ public void Initialize(IEnumerable types) ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule(name); - foreach (Type t in types) + foreach (Type t in typesToList) InitType(t, moduleBuilder); } @@ -57,10 +59,13 @@ public void InitType(Type t, ModuleBuilder moduleBuilder) foreach (var interfaceType in t.GetInterfaces()) { - foreach (var g in interfaceType.GetGenericArguments()) - InitType(g, moduleBuilder); + foreach (var g in interfaceType.GetGenericArguments()) + { + if(g == t) + continue; - continue; + InitType(g, moduleBuilder); + } } return; @@ -116,9 +121,9 @@ private static string GetTypeName(Type t) /// /// /// - public string GetNewTypeName(Type t) - { - return t.FullName + SUFFIX; + public string GetNewTypeName(Type t) + { + return t.FullName + SUFFIX; } /// @@ -153,9 +158,9 @@ public Type CreateTypeFrom(Type t, ModuleBuilder moduleBuilder) propertyType, null); - foreach (var customAttribute in prop.GetCustomAttributes(true)) - { - AddCustomAttributeToProperty(customAttribute, propBuilder); + foreach (var customAttribute in prop.GetCustomAttributes(true)) + { + AddCustomAttributeToProperty(customAttribute, propBuilder); } MethodBuilder getMethodBuilder = typeBuilder.DefineMethod( @@ -197,75 +202,75 @@ public Type CreateTypeFrom(Type t, ModuleBuilder moduleBuilder) typeBuilder.AddInterfaceImplementation(t); return typeBuilder.CreateType(); - } - - /// - /// Given a custom attribute and property builder, adds an instance of custom attribute - /// to the property builder - /// - /// - /// - private void AddCustomAttributeToProperty(object customAttribute, PropertyBuilder propBuilder) - { - var customAttributeBuilder = BuildCustomAttribute(customAttribute); - if (customAttributeBuilder != null) - propBuilder.SetCustomAttribute(customAttributeBuilder); - } - - private static CustomAttributeBuilder BuildCustomAttribute(object customAttribute) - { - ConstructorInfo longestCtor = null; - // Get constructor with the largest number of parameters - foreach (ConstructorInfo cInfo in customAttribute.GetType().GetConstructors(). - Where(cInfo => longestCtor == null || longestCtor.GetParameters().Length < cInfo.GetParameters().Length)) - longestCtor = cInfo; - - if (longestCtor == null) - return null; - - // For each constructor parameter, get corresponding (by name similarity) property and get its value - var args = new object[longestCtor.GetParameters().Length]; - int pos = 0; - foreach (var consParamInfo in longestCtor.GetParameters()) - { - var attrPropInfo = customAttribute.GetType().GetProperty(consParamInfo.Name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase); - if (attrPropInfo != null) - args[pos] = attrPropInfo.GetValue(customAttribute, null); - else - { - args[pos] = null; - var attrFieldInfo = customAttribute.GetType().GetField(consParamInfo.Name, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.IgnoreCase); - if (attrFieldInfo == null) - { - if (consParamInfo.ParameterType.IsValueType) - args[pos] = Activator.CreateInstance(consParamInfo.ParameterType); - } - else - args[pos] = attrFieldInfo.GetValue(customAttribute); - } - ++pos; - } - - var propList = new List(); - var propValueList = new List(); - foreach (var attrPropInfo in customAttribute.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) - { - if (!attrPropInfo.CanWrite) - continue; - object defaultValue = null; - var defaultAttrs = attrPropInfo.GetCustomAttributes(typeof(DefaultValueAttribute), true); - if (defaultAttrs.Length > 0) - { - defaultValue = ((DefaultValueAttribute)defaultAttrs[0]).Value; - } - var value = attrPropInfo.GetValue(customAttribute, null); - if (value == defaultValue) - continue; - propList.Add(attrPropInfo); - propValueList.Add(value); - } - return new CustomAttributeBuilder(longestCtor, args, propList.ToArray(), propValueList.ToArray()); - } + } + + /// + /// Given a custom attribute and property builder, adds an instance of custom attribute + /// to the property builder + /// + /// + /// + private void AddCustomAttributeToProperty(object customAttribute, PropertyBuilder propBuilder) + { + var customAttributeBuilder = BuildCustomAttribute(customAttribute); + if (customAttributeBuilder != null) + propBuilder.SetCustomAttribute(customAttributeBuilder); + } + + private static CustomAttributeBuilder BuildCustomAttribute(object customAttribute) + { + ConstructorInfo longestCtor = null; + // Get constructor with the largest number of parameters + foreach (ConstructorInfo cInfo in customAttribute.GetType().GetConstructors(). + Where(cInfo => longestCtor == null || longestCtor.GetParameters().Length < cInfo.GetParameters().Length)) + longestCtor = cInfo; + + if (longestCtor == null) + return null; + + // For each constructor parameter, get corresponding (by name similarity) property and get its value + var args = new object[longestCtor.GetParameters().Length]; + int pos = 0; + foreach (var consParamInfo in longestCtor.GetParameters()) + { + var attrPropInfo = customAttribute.GetType().GetProperty(consParamInfo.Name, BindingFlags.Public | BindingFlags.Instance | BindingFlags.IgnoreCase); + if (attrPropInfo != null) + args[pos] = attrPropInfo.GetValue(customAttribute, null); + else + { + args[pos] = null; + var attrFieldInfo = customAttribute.GetType().GetField(consParamInfo.Name, BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.IgnoreCase); + if (attrFieldInfo == null) + { + if (consParamInfo.ParameterType.IsValueType) + args[pos] = Activator.CreateInstance(consParamInfo.ParameterType); + } + else + args[pos] = attrFieldInfo.GetValue(customAttribute); + } + ++pos; + } + + var propList = new List(); + var propValueList = new List(); + foreach (var attrPropInfo in customAttribute.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)) + { + if (!attrPropInfo.CanWrite) + continue; + object defaultValue = null; + var defaultAttrs = attrPropInfo.GetCustomAttributes(typeof(DefaultValueAttribute), true); + if (defaultAttrs.Length > 0) + { + defaultValue = ((DefaultValueAttribute)defaultAttrs[0]).Value; + } + var value = attrPropInfo.GetValue(customAttribute, null); + if (value == defaultValue) + continue; + propList.Add(attrPropInfo); + propValueList.Add(value); + } + return new CustomAttributeBuilder(longestCtor, args, propList.ToArray(), propValueList.ToArray()); + } /// /// Returns all properties on the given type, going up the inheritance /// hierarchy. @@ -323,10 +328,16 @@ public Type GetMappedTypeFor(Type t) /// public Type GetMappedTypeFor(string typeName) { - if (nameToType.ContainsKey(typeName)) - return nameToType[typeName]; + string name = typeName; + if (typeName.EndsWith(SUFFIX, StringComparison.Ordinal)) + { + name = typeName.Substring(0, typeName.Length - SUFFIX.Length); + } + + if (nameToType.ContainsKey(name)) + return nameToType[name]; - return Type.GetType(typeName); + return Type.GetType(name); } /// @@ -386,7 +397,6 @@ public object CreateInstance(Type t) private static readonly Dictionary concreteToInterfaceTypeMapping = new Dictionary(); private static readonly Dictionary nameToType = new Dictionary(); private static readonly Dictionary typeToConstructor = new Dictionary(); - private static ILog Logger = LogManager.GetLogger("MessageMapper"); - + private static ILog Logger = LogManager.GetLogger(typeof(MessageMapper)); } } diff --git a/src/messagemutator/NServiceBus.MessageMutator/IMutateTransportMessages.cs b/src/NServiceBus.Core/MessageMutator/IMutateTransportMessages.cs similarity index 97% rename from src/messagemutator/NServiceBus.MessageMutator/IMutateTransportMessages.cs rename to src/NServiceBus.Core/MessageMutator/IMutateTransportMessages.cs index 3d1ae01bec9..bd4d85e2724 100644 --- a/src/messagemutator/NServiceBus.MessageMutator/IMutateTransportMessages.cs +++ b/src/NServiceBus.Core/MessageMutator/IMutateTransportMessages.cs @@ -1,4 +1,3 @@ -using NServiceBus.Unicast.Transport; namespace NServiceBus.MessageMutator { diff --git a/src/unicast/NServiceBus.Unicast.Monitoring/Config/MonitoringConfig.cs b/src/NServiceBus.Core/MonitoringConfig.cs similarity index 94% rename from src/unicast/NServiceBus.Unicast.Monitoring/Config/MonitoringConfig.cs rename to src/NServiceBus.Core/MonitoringConfig.cs index a8bbc257e1b..5d868524411 100644 --- a/src/unicast/NServiceBus.Unicast.Monitoring/Config/MonitoringConfig.cs +++ b/src/NServiceBus.Core/MonitoringConfig.cs @@ -1,54 +1,54 @@ -namespace NServiceBus -{ - using System; - - public static class MonitoringConfig - { - /// - /// Sets the SLA for this endpoint - /// - /// - /// - /// - public static Configure SetEndpointSLA(this Configure config,TimeSpan sla) - { - endpointSLA = sla; - - return config; - } - - /// - /// Gets the current SLA for this endpoint - /// - /// - /// - public static TimeSpan EndpointSLA(this Configure config) - { - return endpointSLA; - } - - static TimeSpan endpointSLA = TimeSpan.Zero; - - /// - /// Enables the NServiceBus specific performance counters - /// - /// - public static Configure EnablePerformanceCounters(this Configure config) - { - performanceCountersEnabled = true; - return config; - } - - /// - /// True id performance counters are enabled - /// - /// - /// - public static bool PerformanceCountersEnabled(this Configure config) - { - return performanceCountersEnabled; - } - - static bool performanceCountersEnabled; - } +namespace NServiceBus +{ + using System; + + public static class MonitoringConfig + { + /// + /// Sets the SLA for this endpoint + /// + /// + /// + /// + public static Configure SetEndpointSLA(this Configure config,TimeSpan sla) + { + endpointSLA = sla; + + return config; + } + + /// + /// Gets the current SLA for this endpoint + /// + /// + /// + public static TimeSpan EndpointSLA(this Configure config) + { + return endpointSLA; + } + + static TimeSpan endpointSLA = TimeSpan.Zero; + + /// + /// Enables the NServiceBus specific performance counters + /// + /// + public static Configure EnablePerformanceCounters(this Configure config) + { + performanceCountersEnabled = true; + return config; + } + + /// + /// True id performance counters are enabled + /// + /// + /// + public static bool PerformanceCountersEnabled(this Configure config) + { + return performanceCountersEnabled; + } + + static bool performanceCountersEnabled; + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/NServiceBus.Core.csproj b/src/NServiceBus.Core/NServiceBus.Core.csproj new file mode 100644 index 00000000000..8f0ae7d9ded --- /dev/null +++ b/src/NServiceBus.Core/NServiceBus.Core.csproj @@ -0,0 +1,577 @@ + + + + + Debug + AnyCPU + {DD48B2D0-E996-412D-9157-821ED8B17A9D} + Library + Properties + NServiceBus + NServiceBus.Core + v4.0 + 512 + ..\..\ + true + true + ..\NServiceBus.snk + ..\..\packages\Fody.1.13.8.0 + + + true + full + false + ..\..\binaries\ + TRACE;DEBUG;MAKE_AutofacObjectBuilder_INTERNAL + prompt + 4 + ..\..\binaries\NServiceBus.Core.XML + + + pdbonly + true + ..\..\binaries\ + TRACE;MAKE_AutofacObjectBuilder_INTERNAL + prompt + 4 + ..\..\binaries\NServiceBus.Core.XML + + + + False + ..\..\packages\Autofac.3.0.2\lib\net40\Autofac.dll + + + False + ..\..\packages\Autofac.3.0.2\lib\net40\Autofac.Configuration.dll + + + ..\..\lib\Interop.MSMQ.dll + False + + + False + ..\..\lib\log4net.dll + + + False + ..\..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll + + + False + ..\..\packages\Obsolete.Fody.1.6.2.0\Lib\NET35\Obsolete.dll + False + + + False + ..\..\packages\RavenDB.Client.2.0.2375\lib\net40\Raven.Abstractions.dll + + + False + ..\..\packages\RavenDB.Client.2.0.2375\lib\net40\Raven.Client.Lightweight.dll + + + + + + + + + + + + + + + + + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Code + + + Code + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + True + Resources.resx + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Form + + + TrialExpired.cs + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + TrialExpired.cs + Designer + + + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + + + + + \ No newline at end of file diff --git a/src/NServiceBus.Core/ObjectBuilder/Autofac/AutofacObjectBuilder.cs b/src/NServiceBus.Core/ObjectBuilder/Autofac/AutofacObjectBuilder.cs new file mode 100644 index 00000000000..c31c2496894 --- /dev/null +++ b/src/NServiceBus.Core/ObjectBuilder/Autofac/AutofacObjectBuilder.cs @@ -0,0 +1,229 @@ +namespace NServiceBus.ObjectBuilder.Autofac +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + using global::Autofac; + using global::Autofac.Builder; + using global::Autofac.Core; + + /// + /// Autofac implementation of IContainer. + /// +#if MAKE_AutofacObjectBuilder_INTERNAL + internal class AutofacObjectBuilder : Common.IContainer +#else + public class AutofacObjectBuilder : Common.IContainer +#endif + { + private readonly ILifetimeScope container; + private bool disposed; + + /// + /// Instantiates the class utilizing the given container. + /// + /// + public AutofacObjectBuilder(ILifetimeScope container) + { + this.container = container ?? new ContainerBuilder().Build(); + } + + /// + /// Instantites the class with an empty Autofac container. + /// + public AutofacObjectBuilder() + : this(null) + { + } + + /// + /// Disposes the container and all resources instantiated by the container. + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + container.Dispose(); + } + + disposed = true; + } + + ~AutofacObjectBuilder() + { + Dispose(false); + } + + /// + /// Returns a child instance of the container to facilitate deterministic disposal + /// of all resources built by the child container. + /// + /// + public Common.IContainer BuildChildContainer() + { + return new AutofacObjectBuilder(container.BeginLifetimeScope()); + } + + /// + /// Build an instance of a given type using Autofac. + /// + /// + /// + public object Build(Type typeToBuild) + { + return container.Resolve(typeToBuild); + } + + /// + /// Build all instances of a given type using Autofac. + /// + /// + /// + public IEnumerable BuildAll(Type typeToBuild) + { + return ResolveAll(container, typeToBuild); + } + + void Common.IContainer.Configure(Type component, DependencyLifecycle dependencyLifecycle) + { + var registration = this.GetComponentRegistration(component); + + if (registration != null) + return; + + var builder = new ContainerBuilder(); + var services = GetAllServices(component).ToArray(); + var registrationBuilder = builder.RegisterType(component).As(services).PropertiesAutowired(); + + SetLifetimeScope(dependencyLifecycle, registrationBuilder); + + builder.Update(this.container.ComponentRegistry); + } + + void Common.IContainer.Configure(Func componentFactory, DependencyLifecycle dependencyLifecycle) + { + var registration = this.GetComponentRegistration(typeof (T)); + + if (registration != null) + return; + + var builder = new ContainerBuilder(); + var services = GetAllServices(typeof(T)).ToArray(); + var registrationBuilder = builder.Register(c => componentFactory.Invoke()).As(services).PropertiesAutowired(); + + SetLifetimeScope(dependencyLifecycle, (IRegistrationBuilder) registrationBuilder); + + builder.Update(this.container.ComponentRegistry); + } + + /// + /// Configure the value of a named component property. + /// + /// + /// + /// + public void ConfigureProperty(Type component, string property, object value) + { + var registration = GetComponentRegistration(component); + + if (registration == null) + { + throw new InvalidOperationException( + "Cannot configure properties for a type that hasn't been configured yet: " + component.FullName); + } + + registration.Activating += (sender, e) => SetPropertyValue(e.Instance, property, value); + } + + /// + /// Register a singleton instance of a dependency within Autofac. + /// + /// + /// + public void RegisterSingleton(Type lookupType, object instance) + { + var builder = new ContainerBuilder(); + builder.RegisterInstance(instance).As(lookupType).PropertiesAutowired(); + builder.Update(this.container.ComponentRegistry); + } + + public bool HasComponent(Type componentType) + { + return container.IsRegistered(componentType); + } + + public void Release(object instance) + { + } + + /// + /// Set a property value on an instance using reflection + /// + /// + /// + /// + private static void SetPropertyValue(object instance, string propertyName, object value) + { + instance.GetType().GetProperty(propertyName, BindingFlags.Public | BindingFlags.Instance).SetValue(instance, value, null); + } + + private static void SetLifetimeScope(DependencyLifecycle dependencyLifecycle, IRegistrationBuilder registrationBuilder) + { + switch (dependencyLifecycle) + { + case DependencyLifecycle.InstancePerCall: + registrationBuilder.InstancePerDependency(); + break; + case DependencyLifecycle.SingleInstance: + registrationBuilder.SingleInstance(); + break; + case DependencyLifecycle.InstancePerUnitOfWork: + registrationBuilder.InstancePerLifetimeScope(); + break; + default: + throw new ArgumentException("Unhandled lifecycle - " + dependencyLifecycle); + } + } + + private IComponentRegistration GetComponentRegistration(Type concreteComponent) + { + return this.container.ComponentRegistry.Registrations.FirstOrDefault(x => x.Activator.LimitType == concreteComponent); + } + + static IEnumerable GetAllServices(Type type) + { + if (type == null) + { + return new List(); + } + + var result = new List(type.GetInterfaces()) { + type + }; + + foreach (Type interfaceType in type.GetInterfaces()) + { + result.AddRange(GetAllServices(interfaceType)); + } + + return result.Distinct(); + } + + static IEnumerable ResolveAll(IComponentContext container, Type componentType) + { + return container.Resolve(typeof(IEnumerable<>).MakeGenericType(componentType)) as IEnumerable; + } + } +} \ No newline at end of file diff --git a/src/impl/ObjectBuilder.Common/ObjectBuilder.Common/CommonObjectBuilder.cs b/src/NServiceBus.Core/ObjectBuilder/Common/CommonObjectBuilder.cs similarity index 80% rename from src/impl/ObjectBuilder.Common/ObjectBuilder.Common/CommonObjectBuilder.cs rename to src/NServiceBus.Core/ObjectBuilder/Common/CommonObjectBuilder.cs index cc99e9962ca..336da5ab627 100644 --- a/src/impl/ObjectBuilder.Common/ObjectBuilder.Common/CommonObjectBuilder.cs +++ b/src/NServiceBus.Core/ObjectBuilder/Common/CommonObjectBuilder.cs @@ -1,10 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using NServiceBus.Utils.Reflection; - namespace NServiceBus.ObjectBuilder.Common { + using System; + using System.Collections.Generic; + using System.Linq.Expressions; + using Utils.Reflection; + /// /// Implementation of IBuilder, serving as a facade that container specific implementations /// of IContainer should run behind. @@ -61,15 +61,22 @@ IComponentConfig IConfigureComponents.ConfigureComponent(DependencyLifecyc Container.Configure(typeof(T), instanceLifecycle); return new ComponentConfig(Container); - } - - IComponentConfig IConfigureComponents.ConfigureComponent(Func componentFactory, DependencyLifecycle instanceLifecycle) - { - Container.Configure(componentFactory, instanceLifecycle); - - return new ComponentConfig(Container); - } - + } + + IComponentConfig IConfigureComponents.ConfigureComponent(Func componentFactory, DependencyLifecycle instanceLifecycle) + { + Container.Configure(componentFactory, instanceLifecycle); + + return new ComponentConfig(Container); + } + + IComponentConfig IConfigureComponents.ConfigureComponent(Func componentFactory, DependencyLifecycle instanceLifecycle) + { + Container.Configure(() => componentFactory(this), instanceLifecycle); + + return new ComponentConfig(Container); + } + IComponentConfig IConfigureComponents.ConfigureComponent(Type concreteComponent, ComponentCallModelEnum callModel) { var lifecycle = MapToDependencyLifecycle(callModel); @@ -92,7 +99,13 @@ IComponentConfig IConfigureComponents.ConfigureComponent(ComponentCallMode IConfigureComponents IConfigureComponents.ConfigureProperty(Expression> property, object value) { var prop = Reflect.GetProperty(property); - Container.ConfigureProperty(typeof(T), prop.Name, value); + + return ((IConfigureComponents)this).ConfigureProperty(prop.Name,value); + } + + IConfigureComponents IConfigureComponents.ConfigureProperty(string propertyName, object value) + { + Container.ConfigureProperty(typeof(T), propertyName, value); return this; } @@ -121,19 +134,41 @@ bool IConfigureComponents.HasComponent(Type componentType) #endregion - #region IBuilder Members - - IBuilder IBuilder.CreateChildBuilder() - { - return new CommonObjectBuilder - { - Container = Container.BuildChildContainer() - }; + #region IBuilder Members + + IBuilder IBuilder.CreateChildBuilder() + { + return new CommonObjectBuilder + { + Container = Container.BuildChildContainer() + }; + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + // Dispose managed resources. + Container.Dispose(); + } + + disposed = true; } - void IDisposable.Dispose() + ~CommonObjectBuilder() { - Container.Dispose(); + Dispose(false); } T IBuilder.Build() @@ -151,6 +186,11 @@ IEnumerable IBuilder.BuildAll(Type typeToBuild) return Container.BuildAll(typeToBuild); } + void IBuilder.Release(object instance) + { + Container.Release(instance); + } + IEnumerable IBuilder.BuildAll() { foreach (T element in Container.BuildAll(typeof(T))) @@ -185,7 +225,7 @@ static DependencyLifecycle MapToDependencyLifecycle(ComponentCallModelEnum callM throw new ArgumentException("Unhandled component call model: " + callModel); } - + private bool disposed; private static SynchronizedInvoker sync; private IContainer container; } diff --git a/src/impl/ObjectBuilder.Common/ObjectBuilder.Common/ComponentConfig.cs b/src/NServiceBus.Core/ObjectBuilder/Common/ComponentConfig.cs similarity index 89% rename from src/impl/ObjectBuilder.Common/ObjectBuilder.Common/ComponentConfig.cs rename to src/NServiceBus.Core/ObjectBuilder/Common/ComponentConfig.cs index 0a13a586187..ce5ab53c384 100644 --- a/src/impl/ObjectBuilder.Common/ObjectBuilder.Common/ComponentConfig.cs +++ b/src/NServiceBus.Core/ObjectBuilder/Common/ComponentConfig.cs @@ -1,42 +1,42 @@ -using System; -using System.Linq.Expressions; -using NServiceBus.Utils.Reflection; - -namespace NServiceBus.ObjectBuilder.Common -{ - class ComponentConfig : IComponentConfig - { - private Type component; - private IContainer container; - - public ComponentConfig(Type component, IContainer container) - { - this.component = component; - this.container = container; - } - - IComponentConfig IComponentConfig.ConfigureProperty(string name, object value) - { - this.container.ConfigureProperty(this.component, name, value); - - return this; - } - } - - class ComponentConfig : ComponentConfig, IComponentConfig - { - public ComponentConfig(IContainer container) : base(typeof(T), container) - { - } - - IComponentConfig IComponentConfig.ConfigureProperty(Expression> property, object value) - { - var prop = Reflect.GetProperty(property); - - ((IComponentConfig)this).ConfigureProperty(prop.Name, value); - - return this; - } - } - -} +namespace NServiceBus.ObjectBuilder.Common +{ + using System; + using System.Linq.Expressions; + using Utils.Reflection; + + class ComponentConfig : IComponentConfig + { + private Type component; + private IContainer container; + + public ComponentConfig(Type component, IContainer container) + { + this.component = component; + this.container = container; + } + + IComponentConfig IComponentConfig.ConfigureProperty(string name, object value) + { + this.container.ConfigureProperty(this.component, name, value); + + return this; + } + } + + class ComponentConfig : ComponentConfig, IComponentConfig + { + public ComponentConfig(IContainer container) : base(typeof(T), container) + { + } + + IComponentConfig IComponentConfig.ConfigureProperty(Expression> property, object value) + { + var prop = Reflect.GetProperty(property); + + ((IComponentConfig)this).ConfigureProperty(prop.Name, value); + + return this; + } + } + +} diff --git a/src/impl/ObjectBuilder.Common/ObjectBuilder.Common.Config/ConfigureCommon.cs b/src/NServiceBus.Core/ObjectBuilder/Common/Config/ConfigureCommon.cs similarity index 93% rename from src/impl/ObjectBuilder.Common/ObjectBuilder.Common.Config/ConfigureCommon.cs rename to src/NServiceBus.Core/ObjectBuilder/Common/Config/ConfigureCommon.cs index 47a2ab8344e..372e16b38e3 100644 --- a/src/impl/ObjectBuilder.Common/ObjectBuilder.Common.Config/ConfigureCommon.cs +++ b/src/NServiceBus.Core/ObjectBuilder/Common/Config/ConfigureCommon.cs @@ -1,28 +1,28 @@ -namespace NServiceBus.ObjectBuilder.Common.Config -{ - /// - /// Utility configuration class for implementers of IContainer. - /// - public static class ConfigureCommon - { - /// - /// Sets the Builder property of the given Configure object to an instance of CommonObjectBuilder. - /// Then, the given builder object is inserted in the relevant place of the builder chain. - /// Finally, the given actions are performed on the instance of CommonObjectBuilder. - /// - /// - /// - public static void With(Configure config, IContainer container) - { - var b = new CommonObjectBuilder { Container = container, Synchronized = SyncConfig.Synchronize }; - - config.Builder = b; - config.Configurer = b; - - var cfg = config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance) - .ConfigureProperty(c => c.Container, container); - - SyncConfig.MarkConfigured(); - } - } -} +namespace NServiceBus.ObjectBuilder.Common.Config +{ + /// + /// Utility configuration class for implementers of IContainer. + /// + public static class ConfigureCommon + { + /// + /// Sets the Builder property of the given Configure object to an instance of CommonObjectBuilder. + /// Then, the given builder object is inserted in the relevant place of the builder chain. + /// Finally, the given actions are performed on the instance of CommonObjectBuilder. + /// + /// + /// + public static void With(Configure config, IContainer container) + { + var b = new CommonObjectBuilder { Container = container, Synchronized = SyncConfig.Synchronize }; + + config.Builder = b; + config.Configurer = b; + + var cfg = config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance) + .ConfigureProperty(c => c.Container, container); + + SyncConfig.MarkConfigured(); + } + } +} diff --git a/src/impl/ObjectBuilder.Common/ObjectBuilder.Common.Config/ConfigureContainer.cs b/src/NServiceBus.Core/ObjectBuilder/Common/Config/ConfigureContainer.cs similarity index 100% rename from src/impl/ObjectBuilder.Common/ObjectBuilder.Common.Config/ConfigureContainer.cs rename to src/NServiceBus.Core/ObjectBuilder/Common/Config/ConfigureContainer.cs diff --git a/src/NServiceBus.Core/ObjectBuilder/Common/IContainer.cs b/src/NServiceBus.Core/ObjectBuilder/Common/IContainer.cs new file mode 100644 index 00000000000..7714b44ad12 --- /dev/null +++ b/src/NServiceBus.Core/ObjectBuilder/Common/IContainer.cs @@ -0,0 +1,77 @@ +namespace NServiceBus.ObjectBuilder.Common +{ + using System; + using System.Collections.Generic; + + /// + /// Abstraction of a container. + /// + public interface IContainer : IDisposable + { + /// + /// Returns an instantiation of the given type. + /// + /// The to build. + /// The component instance. + object Build(Type typeToBuild); + + /// + /// Returns a child instance of the container to facilitate deterministic disposal + /// of all resources built by the child container. + /// + /// Returns a new child container. + IContainer BuildChildContainer(); + + /// + /// Returns a list of objects instantiated because their type is compatible + /// with the given type. + /// + /// Type to be build. + /// Enumeration of all types that implement . + IEnumerable BuildAll(Type typeToBuild); + + /// + /// Configures the call model of the given component type. + /// + /// Type to be configured + /// The desired lifecycle for this type + void Configure(Type component, DependencyLifecycle dependencyLifecycle); + + /// + /// Configures the call model of the given component type using a . + /// + /// Type to be configured. + /// to use to configure. + /// The desired lifecycle for this type. + void Configure(Func component, DependencyLifecycle dependencyLifecycle); + + /// + /// Sets the value to be configured for the given property of the + /// given component type. + /// + /// The interface type. + /// The property name to be injected. + /// The value to assign to the . + void ConfigureProperty(Type component, string property, object value); + + /// + /// Registers the given instance as the singleton that will be returned for the given type. + /// + /// The interface type. + /// The implementation instance. + void RegisterSingleton(Type lookupType, object instance); + + /// + /// Indicates if a component of the given type has been configured. + /// + /// Component type to check. + /// true if the is registered in the container or false otherwise. + bool HasComponent(Type componentType); + + /// + /// Releases a component instance. + /// + /// The component instance to release. + void Release(object instance); + } +} diff --git a/src/impl/ObjectBuilder.Common/ObjectBuilder.Common/SynchronizedInvoker.cs b/src/NServiceBus.Core/ObjectBuilder/Common/SynchronizedInvoker.cs similarity index 94% rename from src/impl/ObjectBuilder.Common/ObjectBuilder.Common/SynchronizedInvoker.cs rename to src/NServiceBus.Core/ObjectBuilder/Common/SynchronizedInvoker.cs index 12e9f68f6da..76e4e76a485 100644 --- a/src/impl/ObjectBuilder.Common/ObjectBuilder.Common/SynchronizedInvoker.cs +++ b/src/NServiceBus.Core/ObjectBuilder/Common/SynchronizedInvoker.cs @@ -1,12 +1,12 @@ -using System; -using System.Runtime.Remoting.Contexts; - namespace NServiceBus.ObjectBuilder.Common { + using System; + using System.Runtime.Remoting.Contexts; + /// /// Invokes methods and actions within a synchronization domain. /// - [Synchronization(SynchronizationAttribute.REQUIRED)] + [Synchronization(SynchronizationAttribute.REQUIRED)] public class SynchronizedInvoker : ContextBoundObject { /// diff --git a/src/NServiceBus.Core/ObjectBuilder/ComponentCallModelEnum.cs b/src/NServiceBus.Core/ObjectBuilder/ComponentCallModelEnum.cs new file mode 100644 index 00000000000..f93d036d9c6 --- /dev/null +++ b/src/NServiceBus.Core/ObjectBuilder/ComponentCallModelEnum.cs @@ -0,0 +1,27 @@ +namespace NServiceBus.ObjectBuilder +{ + /// + /// Represent the various call models for a component. + /// + [ObsoleteEx(Replacement = "NServiceBus.DependencyLifecycle", RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0")] + public enum ComponentCallModelEnum + { + /// + /// Accept the default call model of the underlying technology. This roughly maps to the + /// InstancePerUnitOfWork lifecycle in our new lifecycle definitions + /// + None, + + /// + /// Only one instance of the component will ever be called. This maps to the + /// SingleInstance lifecycle in our new lifecycle definitions + /// + Singleton, + + /// + /// Each call on the component will be performed on a new instance. This maps to the + /// InstancePerCall lifecycle in our new lifecycle definitions + /// + Singlecall + } +} diff --git a/src/NServiceBus.Core/ObjectBuilder/IBuilder.cs b/src/NServiceBus.Core/ObjectBuilder/IBuilder.cs new file mode 100644 index 00000000000..78420091ae2 --- /dev/null +++ b/src/NServiceBus.Core/ObjectBuilder/IBuilder.cs @@ -0,0 +1,62 @@ +namespace NServiceBus.ObjectBuilder +{ + using System; + using System.Collections.Generic; + + /// + /// Used to instantiate types, so that all configured dependencies + /// and property values are set. + /// An abstraction on top of dependency injection frameworks. + /// + public interface IBuilder : IDisposable + { + /// + /// Returns an instantiation of the given type. + /// + /// The to build. + /// The component instance. + object Build(Type typeToBuild); + + /// + /// Returns a child instance of the container to facilitate deterministic disposal + /// of all resources built by the child container. + /// + /// Returns a new child container. + IBuilder CreateChildBuilder(); + + /// + /// Creates an instance of the given type, injecting it with all defined dependencies. + /// + /// Type to be resolved. + /// Instance of + T Build(); + + /// + /// For each type that is compatible with T, an instance is created with all dependencies injected, and yeilded to the caller. + /// + /// Type to be resolved. + /// Instances of + IEnumerable BuildAll(); + + /// + /// For each type that is compatible with the given type, an instance is created with all dependencies injected. + /// + /// The to build. + /// The component instances. + IEnumerable BuildAll(Type typeToBuild); + + /// + /// Releases a component instance. + /// + /// The component instance to release. + void Release(object instance); + + /// + /// Builds an instance of the defined type injecting it with all defined dependencies + /// and invokes the given action on the instance. + /// + /// The to build. + /// The callback to call. + void BuildAndDispatch(Type typeToBuild, Action action); + } +} diff --git a/src/ObjectBuilder/IComponentConfig.cs b/src/NServiceBus.Core/ObjectBuilder/IComponentConfig.cs similarity index 95% rename from src/ObjectBuilder/IComponentConfig.cs rename to src/NServiceBus.Core/ObjectBuilder/IComponentConfig.cs index 0a8e3c4c250..df0eba6dd8f 100644 --- a/src/ObjectBuilder/IComponentConfig.cs +++ b/src/NServiceBus.Core/ObjectBuilder/IComponentConfig.cs @@ -1,7 +1,8 @@ -using System.Linq.Expressions; -using System; namespace NServiceBus.ObjectBuilder { + using System; + using System.Linq.Expressions; + /// /// Used to configure the values to be set for the various /// properties on a component. diff --git a/src/ObjectBuilder/IConfigureComponents.cs b/src/NServiceBus.Core/ObjectBuilder/IConfigureComponents.cs similarity index 78% rename from src/ObjectBuilder/IConfigureComponents.cs rename to src/NServiceBus.Core/ObjectBuilder/IConfigureComponents.cs index 6263b6f7f9f..4c8786cda23 100644 --- a/src/ObjectBuilder/IConfigureComponents.cs +++ b/src/NServiceBus.Core/ObjectBuilder/IConfigureComponents.cs @@ -1,11 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Linq.Expressions; - namespace NServiceBus.ObjectBuilder { + using System; + using System.Linq.Expressions; + /// /// Used to configure components in the container. /// Should primarily be used at startup/initialization time. @@ -37,6 +34,16 @@ public interface IConfigureComponents /// IComponentConfig ConfigureComponent(Func componentFactory, DependencyLifecycle dependencyLifecycle); + /// + /// Configures the given type, allowing to fluently configure properties. + /// + /// + /// + /// + /// + IComponentConfig ConfigureComponent(Func componentFactory, DependencyLifecycle dependencyLifecycle); + + /// /// Configures the given type. Can be used to configure all kinds of properties. This method is deprecated use the signature /// that contains the DependecyLifecyle enum instead @@ -44,7 +51,7 @@ public interface IConfigureComponents /// /// Defines whether the type should have singleton or single call sematnics. /// - [Obsolete] + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "ConfigureComponent(Type, DependencyLifecycle)")] IComponentConfig ConfigureComponent(Type concreteComponent, ComponentCallModelEnum callModel); /// @@ -54,7 +61,7 @@ public interface IConfigureComponents /// /// /// - [Obsolete] + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "ConfigureComponent(DependencyLifecycle)")] IComponentConfig ConfigureComponent(ComponentCallModelEnum callModel); /// @@ -66,6 +73,15 @@ public interface IConfigureComponents /// IConfigureComponents ConfigureProperty(Expression> property, object value); + /// + /// Configures the given property of the given type to be injected with the given value. + /// + /// + /// + /// + /// + IConfigureComponents ConfigureProperty(string propertyName, object value); + /// /// Registers the given instance as the singleton that will be returned /// for the given type. diff --git a/src/NServiceBus.Core/Persistence/ConcurrencyException.cs b/src/NServiceBus.Core/Persistence/ConcurrencyException.cs new file mode 100644 index 00000000000..34d773edaaf --- /dev/null +++ b/src/NServiceBus.Core/Persistence/ConcurrencyException.cs @@ -0,0 +1,19 @@ +namespace NServiceBus.Persistence +{ + using System; + + public class ConcurrencyException : Exception + { + public ConcurrencyException(string message, Exception innerException) : base(message, innerException) + { + } + + public ConcurrencyException(string message) : base(message) + { + } + + public ConcurrencyException() + { + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Persistence/InMemory/InMemoryPersistence.cs b/src/NServiceBus.Core/Persistence/InMemory/InMemoryPersistence.cs new file mode 100644 index 00000000000..04e74ed65e6 --- /dev/null +++ b/src/NServiceBus.Core/Persistence/InMemory/InMemoryPersistence.cs @@ -0,0 +1,20 @@ +namespace NServiceBus.Persistence.InMemory +{ + using Config; + using Gateway.Persistence; + using Saga; + using Timeout.Core; + using Unicast.Subscriptions; + using Unicast.Subscriptions.MessageDrivenSubscriptions; + + public class InMemoryPersistence + { + public static void UseAsDefault() + { + InfrastructureServices.SetDefaultFor(() => Configure.Instance.InMemorySagaPersister()); + InfrastructureServices.SetDefaultFor(() => Configure.Instance.UseInMemoryTimeoutPersister()); + InfrastructureServices.SetDefaultFor(() => Configure.Instance.UseInMemoryGatewayPersister()); + InfrastructureServices.SetDefaultFor(() => Configure.Instance.InMemorySubscriptionStorage()); + } + } +} \ No newline at end of file diff --git a/src/impl/SagaPersisters/InMemory/NServiceBus.SagaPersisters.InMemory/Config/ConfigureInMemorySagaPersister.cs b/src/NServiceBus.Core/Persistence/InMemory/SagaPersister/ConfigureInMemorySagaPersister.cs similarity index 88% rename from src/impl/SagaPersisters/InMemory/NServiceBus.SagaPersisters.InMemory/Config/ConfigureInMemorySagaPersister.cs rename to src/NServiceBus.Core/Persistence/InMemory/SagaPersister/ConfigureInMemorySagaPersister.cs index 2bf4112379f..4cdea19e6f0 100644 --- a/src/impl/SagaPersisters/InMemory/NServiceBus.SagaPersisters.InMemory/Config/ConfigureInMemorySagaPersister.cs +++ b/src/NServiceBus.Core/Persistence/InMemory/SagaPersister/ConfigureInMemorySagaPersister.cs @@ -1,8 +1,7 @@ -using NServiceBus.ObjectBuilder; -using NServiceBus.SagaPersisters.InMemory; - namespace NServiceBus { + using Persistence.InMemory.SagaPersister; + /// /// Contains extension methods to NServiceBus.Configure for the in memory saga persister. /// diff --git a/src/NServiceBus.Core/Persistence/InMemory/SagaPersister/InMemorySagaPersister.cs b/src/NServiceBus.Core/Persistence/InMemory/SagaPersister/InMemorySagaPersister.cs new file mode 100644 index 00000000000..599a1532ff4 --- /dev/null +++ b/src/NServiceBus.Core/Persistence/InMemory/SagaPersister/InMemorySagaPersister.cs @@ -0,0 +1,133 @@ +namespace NServiceBus.Persistence.InMemory.SagaPersister +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Threading; + using Persistence; + using Saga; + using Serializers.Json; + + /// + /// In memory implementation of ISagaPersister for quick development. + /// + public class InMemorySagaPersister : ISagaPersister + { + void ISagaPersister.Complete(IContainSagaData saga) + { + lock (syncRoot) + { + data.Remove(saga.Id); + } + } + + T ISagaPersister.Get(string property, object value) + { + lock (syncRoot) + { + var values = data.Values.Where(x => x.SagaEntity is T); + foreach (var entity in values) + { + var prop = entity.SagaEntity.GetType().GetProperty(property); + if (prop != null) + if (prop.GetValue(entity.SagaEntity, null).Equals(value)) + { + entity.ReadByThreadId.Add(Thread.CurrentThread.ManagedThreadId); + return (T)DeepClone(entity.SagaEntity); + } + } + } + return default(T); + } + + T ISagaPersister.Get(Guid sagaId) + { + lock (syncRoot) + { + VersionedSagaEntity result; + data.TryGetValue(sagaId, out result); + if ((result != null) && (result.SagaEntity is T)) + { + result.ReadByThreadId.Add(Thread.CurrentThread.ManagedThreadId); + return (T)DeepClone(result.SagaEntity); + } + } + return default(T); + } + + void ISagaPersister.Save(IContainSagaData saga) + { + lock (syncRoot) + { + ValidateUniqueProperties(saga); + + if (data.ContainsKey(saga.Id)) + { + data[saga.Id].ConcurrencyCheck(); + } + + data[saga.Id] = new VersionedSagaEntity { SagaEntity = DeepClone(saga) }; + } + } + + void ISagaPersister.Update(IContainSagaData saga) + { + ((ISagaPersister)this).Save(saga); + } + + private void ValidateUniqueProperties(IContainSagaData saga) + { + var uniqueProperties = UniqueAttribute.GetUniqueProperties(saga.GetType()); + if (!uniqueProperties.Any()) return; + + var sagasFromSameType = from s in data + where + (s.Value.SagaEntity.GetType() == saga.GetType() && (s.Key != saga.Id)) + select s.Value; + + foreach (var storedSaga in sagasFromSameType) + foreach (var uniqueProperty in uniqueProperties) + { + if (uniqueProperty.CanRead) + { + var inComingSagaPropertyValue = uniqueProperty.GetValue(saga, null); + var storedSagaPropertyValue = uniqueProperty.GetValue(storedSaga.SagaEntity, null); + if (inComingSagaPropertyValue.Equals(storedSagaPropertyValue)) + throw new + InvalidOperationException( + string.Format("Cannot store a saga. The saga with id '{0}' already has property '{1}' with value '{2}'.", + storedSaga.SagaEntity.Id, uniqueProperty, storedSagaPropertyValue)); + } + } + } + + private class VersionedSagaEntity + { + public IContainSagaData SagaEntity; + + public void ConcurrencyCheck() + { + if (!ReadByThreadId.Contains(Thread.CurrentThread.ManagedThreadId)) + throw new ConcurrencyException( + string.Format( + "InMemorySagaPersister concurrency violation: saga entity Id[{0}] already saved by [Worker.{1}]", + SagaEntity.Id, savedByThreadId)); + } + + public readonly IList ReadByThreadId = new List(); + + private readonly int savedByThreadId = Thread.CurrentThread.ManagedThreadId; + } + + private IContainSagaData DeepClone(IContainSagaData source) + { + var json = serializer.SerializeObject(source); + + return (IContainSagaData)serializer.DeserializeObject(json, source.GetType()); + } + + private readonly JsonMessageSerializer serializer = new JsonMessageSerializer(null); + private readonly IDictionary data = new Dictionary(); + private readonly object syncRoot = new object(); + } +} diff --git a/src/NServiceBus.Core/Persistence/InMemory/SubscriptionStorage/ConfigureInMemorySubscriptionStorage.cs b/src/NServiceBus.Core/Persistence/InMemory/SubscriptionStorage/ConfigureInMemorySubscriptionStorage.cs new file mode 100644 index 00000000000..4bbad20a407 --- /dev/null +++ b/src/NServiceBus.Core/Persistence/InMemory/SubscriptionStorage/ConfigureInMemorySubscriptionStorage.cs @@ -0,0 +1,22 @@ +namespace NServiceBus +{ + using Persistence.InMemory.SubscriptionStorage; + + /// + /// Contains extension methods to NServiceBus.Configure. + /// + public static class ConfigureInMemorySubscriptionStorage + { + /// + /// Stores subscription data in memory. + /// This storage are for development scenarios only + /// + /// + /// + public static Configure InMemorySubscriptionStorage(this Configure config) + { + config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + return config; + } + } +} \ No newline at end of file diff --git a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.InMemory/InMemorySubscriptionStorage.cs b/src/NServiceBus.Core/Persistence/InMemory/SubscriptionStorage/InMemorySubscriptionStorage.cs similarity index 87% rename from src/impl/unicast/NServiceBus.Unicast.Subscriptions.InMemory/InMemorySubscriptionStorage.cs rename to src/NServiceBus.Core/Persistence/InMemory/SubscriptionStorage/InMemorySubscriptionStorage.cs index 26295d65721..d9b4ff4131b 100644 --- a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.InMemory/InMemorySubscriptionStorage.cs +++ b/src/NServiceBus.Core/Persistence/InMemory/SubscriptionStorage/InMemorySubscriptionStorage.cs @@ -1,10 +1,11 @@ -using System.Collections.Generic; -using System.Linq; +namespace NServiceBus.Persistence.InMemory.SubscriptionStorage +{ + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Linq; + using Unicast.Subscriptions; + using Unicast.Subscriptions.MessageDrivenSubscriptions; -namespace NServiceBus.Unicast.Subscriptions.InMemory -{ - using System.Collections.Concurrent; - /// /// In memory implementation of the subscription storage /// @@ -20,8 +21,8 @@ void ISubscriptionStorage.Subscribe(Address address, IEnumerable me if (!storage[m].Contains(address)) storage[m].Add(address); }); - } - + } + void ISubscriptionStorage.Unsubscribe(Address address, IEnumerable messageTypes) { messageTypes.ToList().ForEach(m => @@ -29,9 +30,9 @@ void ISubscriptionStorage.Unsubscribe(Address address, IEnumerable if (storage.ContainsKey(m)) storage[m].Remove(address); }); - } - - + } + + IEnumerable
    ISubscriptionStorage.GetSubscriberAddressesForMessage(IEnumerable messageTypes) { var result = new List
    (); @@ -46,8 +47,8 @@ IEnumerable
    ISubscriptionStorage.GetSubscriberAddressesForMessage(IEnum public void Init() { - } - + } + readonly ConcurrentDictionary> storage = new ConcurrentDictionary>(); } } \ No newline at end of file diff --git a/src/timeout/NServiceBus.Timeout.Hosting.Windows/Persistence/InMemoryTimeoutPersistence.cs b/src/NServiceBus.Core/Persistence/InMemory/TimeoutPersister/InMemoryTimeoutPersistence.cs similarity index 93% rename from src/timeout/NServiceBus.Timeout.Hosting.Windows/Persistence/InMemoryTimeoutPersistence.cs rename to src/NServiceBus.Core/Persistence/InMemory/TimeoutPersister/InMemoryTimeoutPersistence.cs index 35b06e08221..025b9af15ef 100644 --- a/src/timeout/NServiceBus.Timeout.Hosting.Windows/Persistence/InMemoryTimeoutPersistence.cs +++ b/src/NServiceBus.Core/Persistence/InMemory/TimeoutPersister/InMemoryTimeoutPersistence.cs @@ -1,61 +1,61 @@ -namespace NServiceBus.Timeout.Hosting.Windows.Persistence -{ - using System; - using System.Collections.Generic; - using System.Linq; - using Core; - - public class InMemoryTimeoutPersistence : IPersistTimeouts - { - readonly IList storage = new List(); - readonly object lockObject = new object(); - - public List> GetNextChunk(DateTime startSlice, out DateTime nextTimeToRunQuery) - { - lock (lockObject) - { - var results = storage - .Where(data => data.Time > startSlice && data.Time <= DateTime.UtcNow) - .OrderBy(data => data.Time) - .Select(t => new Tuple(t.Id, t.Time)) - .ToList(); - - var nextTimeout = storage - .Where(data => data.Time > DateTime.UtcNow) - .OrderBy(data => data.Time) - .FirstOrDefault(); - - nextTimeToRunQuery = nextTimeout != null ? nextTimeout.Time : DateTime.UtcNow.AddMinutes(1); - - return results; - } - } - - public void Add(TimeoutData timeout) - { - lock (lockObject) - { - timeout.Id = Guid.NewGuid().ToString(); - storage.Add(timeout); - } - } - - public bool TryRemove(string timeoutId, out TimeoutData timeoutData) - { - lock (lockObject) - { - timeoutData = storage.SingleOrDefault(t => t.Id == timeoutId); - - return timeoutData != null && storage.Remove(timeoutData); - } - } - - public void RemoveTimeoutBy(Guid sagaId) - { - lock (lockObject) - { - storage.Where(t => t.SagaId == sagaId).ToList().ForEach(item => storage.Remove(item)); - } - } - } -} \ No newline at end of file +namespace NServiceBus.Persistence.InMemory.TimeoutPersister +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Timeout.Core; + + public class InMemoryTimeoutPersistence : IPersistTimeouts + { + readonly IList storage = new List(); + readonly object lockObject = new object(); + + public List> GetNextChunk(DateTime startSlice, out DateTime nextTimeToRunQuery) + { + lock (lockObject) + { + var results = storage + .Where(data => data.Time > startSlice && data.Time <= DateTime.UtcNow) + .OrderBy(data => data.Time) + .Select(t => new Tuple(t.Id, t.Time)) + .ToList(); + + var nextTimeout = storage + .Where(data => data.Time > DateTime.UtcNow) + .OrderBy(data => data.Time) + .FirstOrDefault(); + + nextTimeToRunQuery = nextTimeout != null ? nextTimeout.Time : DateTime.UtcNow.AddMinutes(1); + + return results; + } + } + + public void Add(TimeoutData timeout) + { + lock (lockObject) + { + timeout.Id = Guid.NewGuid().ToString(); + storage.Add(timeout); + } + } + + public bool TryRemove(string timeoutId, out TimeoutData timeoutData) + { + lock (lockObject) + { + timeoutData = storage.SingleOrDefault(t => t.Id == timeoutId); + + return timeoutData != null && storage.Remove(timeoutData); + } + } + + public void RemoveTimeoutBy(Guid sagaId) + { + lock (lockObject) + { + storage.Where(t => t.SagaId == sagaId).ToList().ForEach(item => storage.Remove(item)); + } + } + } +} diff --git a/src/NServiceBus.Core/Persistence/Msmq/SubscriptionStorage/Config/SubscriptionsQueueCreator.cs b/src/NServiceBus.Core/Persistence/Msmq/SubscriptionStorage/Config/SubscriptionsQueueCreator.cs new file mode 100644 index 00000000000..e23c39cfd17 --- /dev/null +++ b/src/NServiceBus.Core/Persistence/Msmq/SubscriptionStorage/Config/SubscriptionsQueueCreator.cs @@ -0,0 +1,26 @@ +namespace NServiceBus.Persistence.Msmq.SubscriptionStorage.Config +{ + using NServiceBus.Unicast.Queuing; + + /// + /// Signals to create MSMQ subscription queue + /// + public class SubscriptionsQueueCreator : IWantQueueCreated + { + /// + /// MSMQ Subscription storage + /// + public Address Address + { + get { return ConfigureMsmqSubscriptionStorage.Queue; } + } + + /// + /// Disabling the creation of the MSMQ Subscription queue + /// + public bool IsDisabled + { + get { return ConfigureMsmqSubscriptionStorage.Queue == null; } + } + } +} diff --git a/src/NServiceBus.Core/Persistence/Msmq/SubscriptionStorage/ConfigureMsmqSubscriptionStorage.cs b/src/NServiceBus.Core/Persistence/Msmq/SubscriptionStorage/ConfigureMsmqSubscriptionStorage.cs new file mode 100644 index 00000000000..8f3c3c3c3ca --- /dev/null +++ b/src/NServiceBus.Core/Persistence/Msmq/SubscriptionStorage/ConfigureMsmqSubscriptionStorage.cs @@ -0,0 +1,60 @@ +namespace NServiceBus +{ + using Config; + using Logging; + using Persistence.Msmq.SubscriptionStorage; + + /// + /// Contains extension methods to NServiceBus.Configure. + /// + public static class ConfigureMsmqSubscriptionStorage + { + /// + /// Stores subscription data using MSMQ. + /// If multiple machines need to share the same list of subscribers, + /// you should not choose this option - prefer the DbSubscriptionStorage + /// in that case. + /// + /// + /// + public static Configure MsmqSubscriptionStorage(this Configure config) + { + return MsmqSubscriptionStorage(config, Configure.EndpointName); + } + + /// + /// Stores subscription data using MSMQ. + /// If multiple machines need to share the same list of subscribers, + /// you should not choose this option - prefer the DbSubscriptionStorage + /// in that case. + /// + /// + /// + /// + public static Configure MsmqSubscriptionStorage(this Configure config, string endpointName) + { + var cfg = Configure.GetConfigSection(); + + if (cfg == null && string.IsNullOrEmpty(endpointName)) + Logger.Warn("Could not find configuration section for Msmq Subscription Storage and no name was specified for this endpoint. Going to default the subscription queue"); + + if (string.IsNullOrEmpty(endpointName)) + endpointName = "NServiceBus"; + + + Queue = cfg != null ? Address.Parse(cfg.Queue): Address.Parse(endpointName).SubScope("subscriptions"); + + var storageConfig = config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + storageConfig.ConfigureProperty(s => s.Queue, Queue); + + return config; + } + + /// + /// Queue used to store subscriptions. + /// + public static Address Queue { get; set; } + + private static readonly ILog Logger = LogManager.GetLogger(typeof(MsmqSubscriptionStorage)); + } +} diff --git a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.Msmq/Entry.cs b/src/NServiceBus.Core/Persistence/Msmq/SubscriptionStorage/Entry.cs similarity index 80% rename from src/impl/unicast/NServiceBus.Unicast.Subscriptions.Msmq/Entry.cs rename to src/NServiceBus.Core/Persistence/Msmq/SubscriptionStorage/Entry.cs index 501e099ad6c..ef523e058da 100644 --- a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.Msmq/Entry.cs +++ b/src/NServiceBus.Core/Persistence/Msmq/SubscriptionStorage/Entry.cs @@ -1,7 +1,8 @@ -using System; - -namespace NServiceBus.Unicast.Subscriptions.Msmq +namespace NServiceBus.Persistence.Msmq.SubscriptionStorage { + using System; + using Unicast.Subscriptions; + /// /// Describes an entry in the list of subscriptions. /// @@ -10,7 +11,7 @@ public class Entry { /// /// Gets the message type for the subscription entry. - /// + ///
    public MessageType MessageType { get; set; } /// diff --git a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.Msmq/MsmqSubscriptionStorage.cs b/src/NServiceBus.Core/Persistence/Msmq/SubscriptionStorage/MsmqSubscriptionStorage.cs similarity index 88% rename from src/impl/unicast/NServiceBus.Unicast.Subscriptions.Msmq/MsmqSubscriptionStorage.cs rename to src/NServiceBus.Core/Persistence/Msmq/SubscriptionStorage/MsmqSubscriptionStorage.cs index ec7ed613f54..9378ef2f796 100644 --- a/src/impl/unicast/NServiceBus.Unicast.Subscriptions.Msmq/MsmqSubscriptionStorage.cs +++ b/src/NServiceBus.Core/Persistence/Msmq/SubscriptionStorage/MsmqSubscriptionStorage.cs @@ -1,34 +1,17 @@ -#region License - -/* - * Copyright 2007-2008 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#endregion - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Messaging; -using Common.Logging; -using System.Transactions; -using NServiceBus.Utils; - -namespace NServiceBus.Unicast.Subscriptions.Msmq +namespace NServiceBus.Persistence.Msmq.SubscriptionStorage { - /// + using System; + using System.Collections.Generic; + using System.Messaging; + using System.Transactions; + using NServiceBus.Logging; + using NServiceBus.Settings; + using NServiceBus.Transports.Msmq; + using Unicast.Subscriptions; + using Unicast.Subscriptions.MessageDrivenSubscriptions; + using MessageType = Unicast.Subscriptions.MessageType; + + /// /// Provides functionality for managing message subscriptions /// using MSMQ. /// @@ -50,7 +33,7 @@ void ISubscriptionStorage.Init() throw new ArgumentException(string.Format("There is a problem with the subscription storage queue {0}. See enclosed exception for details.", Queue), ex); } - if (!transactional) + if (!transactional && SettingsHolder.Get("Transactions.Enabled")) throw new ArgumentException("Queue must be transactional (" + Queue + ")."); var mpf = new MessagePropertyFilter(); @@ -63,15 +46,15 @@ void ISubscriptionStorage.Init() foreach (var m in q.GetAllMessages()) { var subscriber = Address.Parse(m.Label); - var messageTypeString = m.Body as string; - var messageType = new MessageType(messageTypeString); //this will parse both 2.6 and 3.0 type strings - - entries.Add(new Entry { MessageType = messageType, Subscriber = subscriber }); + var messageTypeString = m.Body as string; + var messageType = new MessageType(messageTypeString); //this will parse both 2.6 and 3.0 type strings + + entries.Add(new Entry { MessageType = messageType, Subscriber = subscriber }); AddToLookup(subscriber, messageType, m.Id); } - } - - + } + + IEnumerable
    ISubscriptionStorage.GetSubscriberAddressesForMessage(IEnumerable messageTypes) { var result = new List
    (); @@ -94,9 +77,9 @@ IEnumerable
    ISubscriptionStorage.GetSubscriberAddressesForMessage(IEnum private bool ConfigurationIsWrong() { return (Transaction.Current == null && !DontUseExternalTransaction); - } - - + } + + void ISubscriptionStorage.Subscribe(Address address, IEnumerable messageTypes) { lock (locker) @@ -104,7 +87,7 @@ void ISubscriptionStorage.Subscribe(Address address, IEnumerable me foreach (var messageType in messageTypes) { bool found = false; - foreach (var e in entries) + foreach (var e in entries) if (e.MessageType == messageType && e.Subscriber == address) { found = true; @@ -112,11 +95,11 @@ void ISubscriptionStorage.Subscribe(Address address, IEnumerable me } if (!found) - { - Add(address, messageType); - - entries.Add(new Entry { MessageType = messageType, Subscriber = address }); - + { + Add(address, messageType); + + entries.Add(new Entry { MessageType = messageType, Subscriber = address }); + log.Debug("Subscriber " + address + " added for message " + messageType + "."); } } @@ -129,13 +112,13 @@ void ISubscriptionStorage.Unsubscribe(Address address, IEnumerable lock (locker) { foreach (var e in entries.ToArray()) - foreach (var messageType in messageTypes) + foreach (var messageType in messageTypes) if (e.MessageType == messageType && e.Subscriber == address) - { + { Remove(address, messageType); - entries.Remove(e); - + entries.Remove(e); + log.Debug("Subscriber " + address + " removed for message " + messageType + "."); } } @@ -148,8 +131,8 @@ public void Add(Address subscriber, MessageType messageType) { var toSend = new Message {Formatter = q.Formatter, Recoverable = true, Label = subscriber.ToString(), Body = messageType.TypeName + ", Version=" + messageType.Version}; - q.Send(toSend, GetTransactionType()); - + q.Send(toSend, GetTransactionType()); + AddToLookup(subscriber, messageType, toSend.Id); } @@ -157,7 +140,7 @@ public void Add(Address subscriber, MessageType messageType) /// Removes a message from the subscription store. ///
    public void Remove(Address subscriber, MessageType messageType) - { + { var messageId = RemoveFromLookup(subscriber, messageType); if (messageId == null) @@ -173,18 +156,28 @@ public void Remove(Address subscriber, MessageType messageType) /// private MessageQueueTransactionType GetTransactionType() { + if (!SettingsHolder.Get("Transactions.Enabled")) + { + return MessageQueueTransactionType.None; + } + if (ConfigurationIsWrong()) + { throw new InvalidOperationException("This endpoint is not configured to be transactional. Processing subscriptions on a non-transactional endpoint is not supported by default. If you still wish to do so, please set the 'DontUseExternalTransaction' property of MsmqSubscriptionStorage to 'true'.\n\nThe recommended solution to this problem is to include '.IsTransaction(true)' after '.MsmqTransport()' in your fluent initialization code, or if you're using NServiceBus.Host.exe to have the class which implements IConfigureThisEndpoint to also inherit AsA_Server or AsA_Publisher."); + } var t = MessageQueueTransactionType.Automatic; if (DontUseExternalTransaction) + { t = MessageQueueTransactionType.Single; + } + return t; } /// - /// Gets/sets whether or not to use a trasaction started outside the + /// Gets/sets whether or not to use a transaction started outside the /// subscription store. /// public virtual bool DontUseExternalTransaction { get; set; } @@ -202,12 +195,12 @@ public Address Queue /// /// Adds a message to the lookup to find message from /// subscriber, to message type, to message id - /// + ///
    private void AddToLookup(Address subscriber, MessageType typeName, string messageId) { lock (lookup) { - if (!lookup.ContainsKey(subscriber)) + if (!lookup.ContainsKey(subscriber)) lookup.Add(subscriber, new Dictionary()); if (!lookup[subscriber].ContainsKey(typeName)) @@ -219,7 +212,7 @@ string RemoveFromLookup(Address subscriber, MessageType typeName) { string messageId = null; lock (lookup) - { + { Dictionary endpoints; if (lookup.TryGetValue(subscriber, out endpoints)) { @@ -241,7 +234,7 @@ string RemoveFromLookup(Address subscriber, MessageType typeName) /// /// lookup from subscriber, to message type, to message id - /// + ///
    readonly Dictionary> lookup = new Dictionary>(); readonly List entries = new List(); diff --git a/src/NServiceBus.Core/Persistence/Raven/ConfigureRavenPersistence.cs b/src/NServiceBus.Core/Persistence/Raven/ConfigureRavenPersistence.cs new file mode 100644 index 00000000000..1c10baf1413 --- /dev/null +++ b/src/NServiceBus.Core/Persistence/Raven/ConfigureRavenPersistence.cs @@ -0,0 +1,371 @@ +namespace NServiceBus +{ + using System; + using System.Configuration; + using System.IO; + using System.Net; + using System.Text; + using Config; + using Gateway.Persistence; + using Logging; + using Newtonsoft.Json; + using Persistence.Raven; + using Raven.Abstractions.Data; + using Raven.Abstractions.Extensions; + using Raven.Client; + using Raven.Client.Document; + using Saga; + using Settings; + using Timeout.Core; + using Unicast.Subscriptions.MessageDrivenSubscriptions; + using ILogManager = Raven.Abstractions.Logging.ILogManager; + + /// + /// Extension methods to configure RavenDB persister. + /// + public static class ConfigureRavenPersistence + { + /// + /// Configures RavenDB as the default persistence. + /// + /// + /// Reads configuration settings from <appSettings> config section and <connectionStrings> config section. + /// + /// + /// An example that shows the configuration: + /// + /// + /// + /// + /// + /// + /// + /// The configuration object. + /// The configuration object. + public static Configure RavenPersistence(this Configure config) + { + if (Configure.Instance.Configurer.HasComponent()) + { + return config; + } + + var connectionStringEntry = ConfigurationManager.ConnectionStrings["NServiceBus.Persistence"] ?? ConfigurationManager.ConnectionStrings["NServiceBus/Persistence"]; + + //use existing config if we can find one + if (connectionStringEntry != null) + { + return RavenPersistenceWithConnectionString(config, connectionStringEntry.ConnectionString, null); + } + + var store = new DocumentStore + { + Url = RavenPersistenceConstants.DefaultUrl, + ResourceManagerId = RavenPersistenceConstants.DefaultResourceManagerId, + DefaultDatabase = Configure.EndpointName, + }; + + return InternalRavenPersistence(config, store); + } + + /// + /// Configures RavenDB as the default persistence. + /// + /// The configuration object. + /// The connectionstring name to use to retrieve the connectionstring from. + /// The configuration object. + public static Configure RavenPersistence(this Configure config, string connectionStringName) + { + var connectionStringEntry = GetRavenConnectionString(connectionStringName); + return RavenPersistenceWithConnectionString(config, connectionStringEntry, null); + } + + /// + /// Configures RavenDB as the default persistence. + /// + /// The configuration object. + /// The connectionstring name to use to retrieve the connectionstring from. + /// The database name to use. + /// The configuration object. + public static Configure RavenPersistence(this Configure config, string connectionStringName, string database) + { + var connectionString = GetRavenConnectionString(connectionStringName); + return RavenPersistenceWithConnectionString(config, connectionString, database); + } + + /// + /// Configures RavenDB as the default persistence. + /// + /// The configuration object. + /// Specifies a callback to call to retrieve the connectionstring to use. + /// The configuration object. + public static Configure RavenPersistence(this Configure config, Func getConnectionString) + { + var connectionString = GetRavenConnectionString(getConnectionString); + return RavenPersistenceWithConnectionString(config, connectionString, null); + } + + /// + /// Configures RavenDB as the default persistence. + /// + /// The configuration object. + /// Specifies a callback to call to retrieve the connectionstring to use. + /// The database name to use. + /// The configuration object. + public static Configure RavenPersistence(this Configure config, Func getConnectionString, string database) + { + var connectionString = GetRavenConnectionString(getConnectionString); + return RavenPersistenceWithConnectionString(config, connectionString, database); + } + + /// + /// Configures RavenDB as the default persistence. + /// + /// This method does not use any of the NServiceBus conventions either specified or out of the box. + /// The configuration object. + /// An . + /// The configuration object. + public static Configure RavenPersistenceWithStore(this Configure config, IDocumentStore documentStore) + { + return config.InternalRavenPersistence(() => new StoreAccessor(documentStore)); + } + + /// + /// The is called for further customising the . + /// + /// The configuration object. + /// This callback allows to further customise/override default settings. + /// The configuration object. + public static Configure CustomiseRavenPersistence(this Configure config, Action callback) + { + customisationCallback = callback; + + return config; + } + + /// + /// Specifies the mapping to use for when resolving the database name to use for each message. + /// + /// The configuration object. + /// The method referenced by a Func delegate for finding the database name for the specified message. + /// The configuration object. + public static Configure MessageToDatabaseMappingConvention(this Configure config, Func convention) + { + RavenSessionFactory.GetDatabaseName = convention; + + return config; + } + + public static void RegisterDefaults() + { + InfrastructureServices.SetDefaultFor(() => Configure.Instance.RavenSagaPersister()); + InfrastructureServices.SetDefaultFor(() => Configure.Instance.UseRavenTimeoutPersister()); + InfrastructureServices.SetDefaultFor(() => Configure.Instance.UseRavenGatewayPersister()); + InfrastructureServices.SetDefaultFor(() => Configure.Instance.RavenSubscriptionStorage()); + } + + static Configure InternalRavenPersistence(this Configure config, DocumentStore documentStore) + { + return config.InternalRavenPersistence(() => + { + documentStore.Conventions.FindTypeTagName = RavenConventions.FindTypeTagName; + + documentStore.Conventions.MaxNumberOfRequestsPerSession = 100; + + if (SettingsHolder.Get("Transactions.SuppressDistributedTransactions")) + { + documentStore.EnlistInDistributedTransactions = false; + } + + if (customisationCallback != null) + { + customisationCallback(documentStore); + } + + VerifyConnectionToRavenDBServer(documentStore); + + return new StoreAccessor(documentStore); + }); + } + + static Configure InternalRavenPersistence(this Configure config, Func factory) + { + config.Configurer.ConfigureComponent(factory, DependencyLifecycle.SingleInstance); + config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerUnitOfWork); + + Raven.Abstractions.Logging.LogManager.CurrentLogManager = new NoOpLogManager(); + + RavenUserInstaller.RunInstaller = true; + + return config; + } + + static string GetRavenConnectionString(Func getConnectionString) + { + var connectionString = getConnectionString(); + + if (connectionString == null) + throw new ConfigurationErrorsException("Cannot configure Raven Persister. No connection string was found"); + + return connectionString; + } + + static string GetRavenConnectionString(string connectionStringName) + { + var connectionStringEntry = ConfigurationManager.ConnectionStrings[connectionStringName]; + + if (connectionStringEntry == null) + throw new ConfigurationErrorsException(string.Format("Cannot configure Raven Persister. No connection string named {0} was found", + connectionStringName)); + return connectionStringEntry.ConnectionString; + } + + static Configure RavenPersistenceWithConnectionString(Configure config, string connectionStringValue, string database) + { + var store = new DocumentStore(); + + if (connectionStringValue != null) + { + store.ParseConnectionString(connectionStringValue); + + var connectionStringParser = ConnectionStringParser.FromConnectionString(connectionStringValue); + connectionStringParser.Parse(); + if (connectionStringParser.ConnectionStringOptions.ResourceManagerId == Guid.Empty) + store.ResourceManagerId = RavenPersistenceConstants.DefaultResourceManagerId; + } + else + { + store.Url = RavenPersistenceConstants.DefaultUrl; + store.ResourceManagerId = RavenPersistenceConstants.DefaultResourceManagerId; + } + + if (database == null) + { + database = Configure.EndpointName; + } + else + { + store.DefaultDatabase = database; + } + + if (store.DefaultDatabase == null) + { + store.DefaultDatabase = database; + } + + return InternalRavenPersistence(config, store); + } + + static void VerifyConnectionToRavenDBServer(IDocumentStore store) + { + RavenBuildInfo ravenBuildInfo = null; + bool connectionSuccessful = false; + Exception exception = null; + try + { + store.Initialize(); + + //for embedded servers + if (store.Url == null) + { + return; + } + + var request = WebRequest.Create(string.Format("{0}/build/version", store.Url)); + request.Timeout = 2000; + using (var response = request.GetResponse() as HttpWebResponse) + { + if (response.StatusCode != HttpStatusCode.OK) + throw new InvalidOperationException("Call failed - " + response.StatusDescription); + + using (var stream = response.GetResponseStream()) + using(var reader = new StreamReader(stream)) + { + ravenBuildInfo = JsonConvert.DeserializeObject(reader.ReadToEnd()); + } + + connectionSuccessful = true; + } + } + catch (Exception ex) + { + exception = ex; + } + if (!connectionSuccessful) + { + ShowUncontactableRavenWarning(store,exception); + return; + } + + if (!ravenBuildInfo.IsVersion2OrHigher()) + { + throw new InvalidOperationException(string.Format(WrongRavenVersionMessage, ravenBuildInfo)); + } + + + Logger.InfoFormat("Connection to RavenDB at {0} verified. Detected version: {1}", store.Url, ravenBuildInfo); + } + + static void ShowUncontactableRavenWarning(IDocumentStore store,Exception exception) + { + var sb = new StringBuilder(); + sb.AppendFormat("Raven could not be contacted. We tried to access Raven using the following url: {0}.", + store.Url); + sb.AppendLine(); + sb.AppendFormat("Please ensure that you can open the Raven Studio by navigating to {0}.", store.Url); + sb.AppendLine(); + sb.AppendLine( + @"To configure NServiceBus to use a different Raven connection string add a connection string named ""NServiceBus.Persistence"" in your config file, example:"); + sb.AppendFormat( + @" + +"); +sb.AppendLine("Reason: " + exception); + + Logger.Warn(sb.ToString()); + } + + static readonly ILog Logger = LogManager.GetLogger(typeof(ConfigureRavenPersistence)); + static Action customisationCallback = store => { }; + + const string WrongRavenVersionMessage = +@"The RavenDB server you have specified is detected to be {0}. NServiceBus requires RavenDB version 2 or higher to operate correctly. Please update your RavenDB server. + +Further instructions can be found at:http://particular.net/articles/using-ravendb-in-nservicebus-installing"; + + class NoOpLogManager : ILogManager + { + public Raven.Abstractions.Logging.ILog GetLogger(string name) + { + return new Raven.Abstractions.Logging.LogManager.NoOpLogger(); + } + + public IDisposable OpenNestedConext(string message) + { + return new DisposableAction(() => { }); + } + + public IDisposable OpenMappedContext(string key, string value) + { + return new DisposableAction(() => { }); + } + } + + class RavenBuildInfo + { + public string ProductVersion { get; set; } + + public string BuildVersion { get; set; } + + public bool IsVersion2OrHigher() + { + return !string.IsNullOrEmpty(ProductVersion) && !ProductVersion.StartsWith("1"); + } + + public override string ToString() + { + return string.Format("Product version: {0}, Build version: {1}", ProductVersion, BuildVersion); + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Persistence/Raven/RavenConventions.cs b/src/NServiceBus.Core/Persistence/Raven/RavenConventions.cs new file mode 100644 index 00000000000..4093b6d84a5 --- /dev/null +++ b/src/NServiceBus.Core/Persistence/Raven/RavenConventions.cs @@ -0,0 +1,33 @@ +namespace NServiceBus.Persistence.Raven +{ + using System; + using Saga; + + /// + /// NServiceBus default RavenDB conventions. + /// + public class RavenConventions + { + /// + /// NServiceBus default RavenDB FindTypeTagName convention + /// + /// The type to apply convention. + /// The name of the find type tag. + public static string FindTypeTagName(Type t) + { + var tagName = t.Name; + + if (IsASagaEntity(t)) + { + tagName = tagName.Replace("Data", String.Empty); + } + + return tagName; + } + + static bool IsASagaEntity(Type t) + { + return t != null && typeof(IContainSagaData).IsAssignableFrom(t); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Persistence/Raven/RavenPersistenceConstants.cs b/src/NServiceBus.Core/Persistence/Raven/RavenPersistenceConstants.cs new file mode 100644 index 00000000000..af0f6427846 --- /dev/null +++ b/src/NServiceBus.Core/Persistence/Raven/RavenPersistenceConstants.cs @@ -0,0 +1,54 @@ +namespace NServiceBus.Persistence.Raven +{ + using System; + using System.Security.Cryptography; + using System.Text; + using Utils; + + public static class RavenPersistenceConstants + { + public const int DefaultPort = 8080; + + private static readonly int registryPort = DefaultPort; + + static RavenPersistenceConstants() + { + registryPort = RegistryReader.Read("RavenPort", DefaultPort); + } + + public static string DefaultUrl + { + get + { + var masterNode = Configure.Instance.GetMasterNode(); + + if (string.IsNullOrEmpty(masterNode)) + masterNode = "localhost"; + + return string.Format("http://{0}:{1}", masterNode, registryPort); + } + } + + public static Guid DefaultResourceManagerId + { + get + { + var resourceManagerId = Address.Local + "-" + Configure.DefineEndpointVersionRetriever() ; + + return DeterministicGuidBuilder(resourceManagerId); + } + } + + static Guid DeterministicGuidBuilder(string input) + { + // use MD5 hash to get a 16-byte hash of the string + using (var provider = new MD5CryptoServiceProvider()) + { + byte[] inputBytes = Encoding.Default.GetBytes(input); + byte[] hashBytes = provider.ComputeHash(inputBytes); + // generate a guid from the hash: + return new Guid(hashBytes); + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Persistence/Raven/RavenSessionFactory.cs b/src/NServiceBus.Core/Persistence/Raven/RavenSessionFactory.cs new file mode 100644 index 00000000000..654d85695ca --- /dev/null +++ b/src/NServiceBus.Core/Persistence/Raven/RavenSessionFactory.cs @@ -0,0 +1,74 @@ +namespace NServiceBus.Persistence.Raven +{ + using System; + using global::Raven.Client; + + public class RavenSessionFactory + { + [ThreadStatic] + static IDocumentSession session; + + public IDocumentStore Store { get; private set; } + + public IBus Bus { get; set; } + + public IDocumentSession Session + { + get { return session ?? (session = OpenSession()); } + } + + public RavenSessionFactory(StoreAccessor storeAccessor) + { + Store = storeAccessor.Store; + } + + public void ReleaseSession() + { + if (session == null) + { + return; + } + + session.Dispose(); + session = null; + } + + IDocumentSession OpenSession() + { + IMessageContext context = null; + + if (Bus != null) + context = Bus.CurrentMessageContext; + + var databaseName = GetDatabaseName(context); + + IDocumentSession documentSession; + + if (string.IsNullOrEmpty(databaseName)) + documentSession = Store.OpenSession(); + else + documentSession = Store.OpenSession(databaseName); + + documentSession.Advanced.AllowNonAuthoritativeInformation = false; + documentSession.Advanced.UseOptimisticConcurrency = true; + + return documentSession; + } + + public void SaveChanges() + { + if (session == null) + return; + try + { + session.SaveChanges(); + } + catch (global::Raven.Abstractions.Exceptions.ConcurrencyException ex) + { + throw new ConcurrencyException("A saga with the same Unique property already existed in the storage. See the inner exception for further details", ex); + } + } + + public static Func GetDatabaseName = context => String.Empty; + } +} \ No newline at end of file diff --git a/src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven/RavenUnitofWork.cs b/src/NServiceBus.Core/Persistence/Raven/RavenUnitofWork.cs similarity index 85% rename from src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven/RavenUnitofWork.cs rename to src/NServiceBus.Core/Persistence/Raven/RavenUnitofWork.cs index f1b872ceb77..83cd720be8c 100644 --- a/src/impl/Persistence/RavenPersistence/NServiceBus.Persistence.Raven/RavenUnitofWork.cs +++ b/src/NServiceBus.Core/Persistence/Raven/RavenUnitofWork.cs @@ -1,23 +1,23 @@ -using System; -using NServiceBus.UnitOfWork; - -namespace NServiceBus.Persistence.Raven -{ - public class RavenUnitOfWork : IManageUnitsOfWork - { - readonly RavenSessionFactory sessionFactory; - - public RavenUnitOfWork(RavenSessionFactory sessionFactory) - { - this.sessionFactory = sessionFactory; - } - - public void Begin() - { - } - - public void End(Exception ex) - { +namespace NServiceBus.Persistence.Raven +{ + using System; + using UnitOfWork; + + public class RavenUnitOfWork : IManageUnitsOfWork + { + readonly RavenSessionFactory sessionFactory; + + public RavenUnitOfWork(RavenSessionFactory sessionFactory) + { + this.sessionFactory = sessionFactory; + } + + public void Begin() + { + } + + public void End(Exception ex) + { try { if (ex == null) @@ -27,8 +27,8 @@ public void End(Exception ex) } finally { - sessionFactory.Dispose(); + sessionFactory.ReleaseSession(); } - } - } + } + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Persistence/Raven/RavenUserInstaller.cs b/src/NServiceBus.Core/Persistence/Raven/RavenUserInstaller.cs new file mode 100644 index 00000000000..1f111c31c82 --- /dev/null +++ b/src/NServiceBus.Core/Persistence/Raven/RavenUserInstaller.cs @@ -0,0 +1,133 @@ +namespace NServiceBus.Persistence.Raven +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Installation; + using NServiceBus.Installation.Environments; + using NServiceBus.Logging; + using global::Raven.Abstractions.Extensions; + using global::Raven.Client.Document; + using global::Raven.Json.Linq; + + /// + /// Add the identity to the Raven users group + /// + public class RavenUserInstaller : INeedToInstallSomething + { + static readonly ILog logger = LogManager.GetLogger(typeof(RavenUserInstaller)); + + public StoreAccessor StoreAccessor { get; set; } + + internal static bool RunInstaller { get; set; } + + public void Install(string identity) + { + if (!RunInstaller) + { + return; + } + + var store = StoreAccessor.Store as DocumentStore; + + if (store == null) + { + return; + } + + try + { + AddUserToDatabase(identity, store); + } + catch (Exception exception) + { + logger.Warn("Failed to add user to raven. Processing will continue", exception); + } + } + + internal static void AddUserToDatabase(string identity, DocumentStore documentStore) + { + var database = documentStore.DefaultDatabase ?? ""; + + logger.InfoFormat(string.Format("Adding user '{0}' to raven. Instance:'{1}', Database:'{2}'.", identity, documentStore.Url, database)); + + var systemCommands = documentStore + .DatabaseCommands + .ForSystemDatabase(); + var existing = systemCommands.Get("Raven/Authorization/WindowsSettings"); + + WindowsAuthDocument windowsAuthDocument; + if (existing == null) + { + windowsAuthDocument = new WindowsAuthDocument(); + } + else + { + windowsAuthDocument = existing + .DataAsJson + .JsonDeserialization(); + } + AddOrUpdateAuthUser(windowsAuthDocument, identity, database); + + var ravenJObject = RavenJObject.FromObject(windowsAuthDocument); + + systemCommands.Put("Raven/Authorization/WindowsSettings", null, ravenJObject, new RavenJObject()); + } + + static void AddOrUpdateAuthUser(WindowsAuthDocument windowsAuthDocument, string identity, string tenantId) + { + var windowsAuthForUser = windowsAuthDocument + .RequiredUsers + .FirstOrDefault(x => x.Name == identity); + if (windowsAuthForUser == null) + { + windowsAuthForUser = new WindowsAuthData + { + Name = identity + }; + windowsAuthDocument.RequiredUsers.Add(windowsAuthForUser); + } + windowsAuthForUser.Enabled = true; + + AddOrUpdateDataAccess(windowsAuthForUser, tenantId); + } + + static void AddOrUpdateDataAccess(WindowsAuthData windowsAuthForUser, string tenantId) + { + var dataAccess = windowsAuthForUser + .Databases + .FirstOrDefault(x => x.TenantId == tenantId); + if (dataAccess == null) + { + dataAccess = new DatabaseAccess + { + TenantId = tenantId + }; + windowsAuthForUser.Databases.Add(dataAccess); + } + dataAccess.ReadOnly = false; + dataAccess.Admin = true; + } + + internal class WindowsAuthDocument + { + public List RequiredGroups = new List(); + public List RequiredUsers = new List(); + } + + internal class WindowsAuthData + { + public string Name; + public bool Enabled; + public List Databases = new List(); + } + + internal class DatabaseAccess + { + public bool Admin; + public bool ReadOnly; + public string TenantId; + } + } + +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Persistence/Raven/SagaPersister/ConfigureRavenSagaPersister.cs b/src/NServiceBus.Core/Persistence/Raven/SagaPersister/ConfigureRavenSagaPersister.cs new file mode 100644 index 00000000000..02328c7a5b9 --- /dev/null +++ b/src/NServiceBus.Core/Persistence/Raven/SagaPersister/ConfigureRavenSagaPersister.cs @@ -0,0 +1,20 @@ +namespace NServiceBus +{ + using Persistence.Raven; + using Persistence.Raven.SagaPersister; + + public static class ConfigureRavenSagaPersister + { + public static Configure RavenSagaPersister(this Configure config) + { + if (!config.Configurer.HasComponent()) + { + config.RavenPersistence(); + } + + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + + return config; + } + } +} diff --git a/src/NServiceBus.Core/Persistence/Raven/SagaPersister/RavenSagaPersister.cs b/src/NServiceBus.Core/Persistence/Raven/SagaPersister/RavenSagaPersister.cs new file mode 100644 index 00000000000..48b4f302a16 --- /dev/null +++ b/src/NServiceBus.Core/Persistence/Raven/SagaPersister/RavenSagaPersister.cs @@ -0,0 +1,206 @@ +namespace NServiceBus.Persistence.Raven.SagaPersister +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Linq; + using System.Security.Cryptography; + using System.Text; + using Raven; + using Saga; + using global::Raven.Abstractions.Commands; + using global::Raven.Client; + + public class RavenSagaPersister : ISagaPersister + { + public const string UniqueValueMetadataKey = "NServiceBus-UniqueValue"; + + readonly RavenSessionFactory sessionFactory; + + protected IDocumentSession Session { get { return sessionFactory.Session; } } + + public RavenSagaPersister(RavenSessionFactory sessionFactory) + { + this.sessionFactory = sessionFactory; + } + + public void Save(IContainSagaData saga) + { + Session.Store(saga); + StoreUniqueProperty(saga); + } + + public void Update(IContainSagaData saga) + { + var p = UniqueAttribute.GetUniqueProperty(saga); + + if (!p.HasValue) + return; + + var uniqueProperty = p.Value; + + var metadata = Session.Advanced.GetMetadataFor(saga); + + //if the user just added the unique property to a saga with existing data we need to set it + if (!metadata.ContainsKey(UniqueValueMetadataKey)) + { + StoreUniqueProperty(saga); + return; + } + + var storedvalue = metadata[UniqueValueMetadataKey].ToString(); + + var currentValue = uniqueProperty.Value.ToString(); + + if (currentValue == storedvalue) + return; + + DeleteUniqueProperty(saga, new KeyValuePair(uniqueProperty.Key,storedvalue)); + StoreUniqueProperty(saga); + + } + + public T Get(Guid sagaId) where T : IContainSagaData + { + return Session.Load(sagaId); + } + + public T Get(string property, object value) where T : IContainSagaData + { + if (IsUniqueProperty(property)) + return GetByUniqueProperty(property, value); + + return GetByQuery(property, value).FirstOrDefault(); + } + + public void Complete(IContainSagaData saga) + { + Session.Delete(saga); + + var uniqueProperty = UniqueAttribute.GetUniqueProperty(saga); + + if (!uniqueProperty.HasValue) + return; + + DeleteUniqueProperty(saga, uniqueProperty.Value); + } + + bool IsUniqueProperty(string property) + { + var key = typeof(T).FullName + property; + bool value; + + if (!PropertyCache.TryGetValue(key, out value)) + { + value = UniqueAttribute.GetUniqueProperties(typeof(T)).Any(p => p.Name == property); + PropertyCache[key] = value; + } + + return value; + } + + + T GetByUniqueProperty(string property, object value) where T : IContainSagaData + { + var lookupId = SagaUniqueIdentity.FormatId(typeof(T), new KeyValuePair(property, value)); + + var lookup = Session + .Include("SagaDocId") //tell raven to pull the saga doc as well to save us a roundtrip + .Load(lookupId); + + if (lookup != null) + return lookup.SagaDocId != null + ? Session.Load(lookup.SagaDocId) //if we have a saga id we can just load it + : Get(lookup.SagaId); //if not this is a saga that was created pre 3.0.4 so we fallback to a get instead + + return default(T); + } + + IEnumerable GetByQuery(string property, object value) where T : IContainSagaData + { + try + { + return Session.Advanced.LuceneQuery() + .WhereEquals(property, value) + .WaitForNonStaleResultsAsOfNow(); + } + catch (InvalidCastException) + { + return new[] { default(T) }; + } + } + + void StoreUniqueProperty(IContainSagaData saga) + { + var uniqueProperty = UniqueAttribute.GetUniqueProperty(saga); + + if (!uniqueProperty.HasValue) return; + + var id = SagaUniqueIdentity.FormatId(saga.GetType(), uniqueProperty.Value); + var sagaDocId = sessionFactory.Store.Conventions.FindFullDocumentKeyFromNonStringIdentifier(saga.Id, saga.GetType(), false); + + Session.Store(new SagaUniqueIdentity + { + Id = id, + SagaId = saga.Id, + UniqueValue = uniqueProperty.Value.Value, + SagaDocId = sagaDocId + }); + + SetUniqueValueMetadata(saga, uniqueProperty.Value); + } + + void SetUniqueValueMetadata(IContainSagaData saga, KeyValuePair uniqueProperty) + { + Session.Advanced.GetMetadataFor(saga)[UniqueValueMetadataKey] = uniqueProperty.Value.ToString(); + } + + void DeleteUniqueProperty(IContainSagaData saga, KeyValuePair uniqueProperty) + { + var id = SagaUniqueIdentity.FormatId(saga.GetType(), uniqueProperty); + + Session.Advanced.Defer(new DeleteCommandData { Key = id }); + } + + static readonly ConcurrentDictionary PropertyCache = new ConcurrentDictionary(); + } + + public class SagaUniqueIdentity + { + public string Id { get; set; } + public Guid SagaId { get; set; } + public object UniqueValue { get; set; } + public string SagaDocId { get; set; } + + public static string FormatId(Type sagaType, KeyValuePair uniqueProperty) + { + if (uniqueProperty.Value == null) + throw new ArgumentNullException("uniqueProperty", string.Format("Property {0} is marked with the [Unique] attribute on {1} but contains a null value. Please make sure that all unique properties are set on your SagaData and/or that you have marked the correct properties as unique.", uniqueProperty.Key, sagaType.Name)); + + // use MD5 hash to get a 16-byte hash of the string + using (var provider = new MD5CryptoServiceProvider()) + { + var inputBytes = Encoding.Default.GetBytes(uniqueProperty.Value.ToString()); + byte[] hashBytes = provider.ComputeHash(inputBytes); + + // generate a guid from the hash: + var value = new Guid(hashBytes); + + var id = string.Format("{0}/{1}/{2}", sagaType.FullName.Replace('+', '-'), uniqueProperty.Key, value); + + // raven has a size limit of 255 bytes == 127 unicode chars + if (id.Length > 127) + { + // generate a guid from the hash: + var key = + new Guid( + provider.ComputeHash(Encoding.Default.GetBytes(sagaType.FullName + uniqueProperty.Key))); + + id = string.Format("MoreThan127/{0}/{1}", key, value); + } + + return id; + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Persistence/Raven/StoreAccessor.cs b/src/NServiceBus.Core/Persistence/Raven/StoreAccessor.cs new file mode 100644 index 00000000000..2808d0c56e8 --- /dev/null +++ b/src/NServiceBus.Core/Persistence/Raven/StoreAccessor.cs @@ -0,0 +1,49 @@ +namespace NServiceBus.Persistence.Raven +{ + using System; + using global::Raven.Client; + + public class StoreAccessor : IDisposable + { + private bool disposed; + + private readonly IDocumentStore store; + + public StoreAccessor(IDocumentStore store) + { + this.store = store; + } + + public IDocumentStore Store + { + get { return store; } + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + // Dispose managed resources. + store.Dispose(); + } + + disposed = true; + } + + ~StoreAccessor() + { + Dispose(false); + } + } +} diff --git a/src/NServiceBus.Core/Persistence/Raven/SubscriptionStorage/ConfigureRavenSubscriptionStorage.cs b/src/NServiceBus.Core/Persistence/Raven/SubscriptionStorage/ConfigureRavenSubscriptionStorage.cs new file mode 100644 index 00000000000..b03a41cfa9d --- /dev/null +++ b/src/NServiceBus.Core/Persistence/Raven/SubscriptionStorage/ConfigureRavenSubscriptionStorage.cs @@ -0,0 +1,19 @@ +namespace NServiceBus +{ + using Persistence.Raven; + using Persistence.Raven.SubscriptionStorage; + using Raven.Client; + + public static class ConfigureRavenSubscriptionStorage + { + public static Configure RavenSubscriptionStorage(this Configure config) + { + if (!config.Configurer.HasComponent()) + config.RavenPersistence(); + + config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + + return config; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Persistence/Raven/SubscriptionStorage/RavenSubscriptionStorage.cs b/src/NServiceBus.Core/Persistence/Raven/SubscriptionStorage/RavenSubscriptionStorage.cs new file mode 100644 index 00000000000..35c2a8cd49c --- /dev/null +++ b/src/NServiceBus.Core/Persistence/Raven/SubscriptionStorage/RavenSubscriptionStorage.cs @@ -0,0 +1,99 @@ +namespace NServiceBus.Persistence.Raven.SubscriptionStorage +{ + using System.Collections.Generic; + using System.Linq; + using NServiceBus.Persistence.Raven; + using Unicast.Subscriptions; + using Unicast.Subscriptions.MessageDrivenSubscriptions; + using global::Raven.Client; + + public class RavenSubscriptionStorage : ISubscriptionStorage + { + private readonly IDocumentStore store; + + public RavenSubscriptionStorage(StoreAccessor storeAccessor) + { + store = storeAccessor.Store; + } + + public void Init() + { + } + + void ISubscriptionStorage.Subscribe(Address client, IEnumerable messageTypes) + { + var messageTypeLookup = messageTypes.ToDictionary(Subscription.FormatId); + + using (var session = OpenSession()) + { + session.Advanced.UseOptimisticConcurrency = true; + + var existingSubscriptions = GetSubscriptions(messageTypeLookup.Values, session).ToLookup(m => m.Id); + + var newAndExistingSubscriptions = messageTypeLookup + .Select(id => existingSubscriptions[id.Key].SingleOrDefault() ?? StoreNewSubscription(session, id.Key, id.Value)) + .Where(subscription => subscription.Clients.All(c => c != client)).ToArray(); + + foreach (var subscription in newAndExistingSubscriptions) + { + subscription.Clients.Add(client); + } + + session.SaveChanges(); + } + } + + void ISubscriptionStorage.Unsubscribe(Address client, IEnumerable messageTypes) + { + using (var session = OpenSession()) + { + session.Advanced.UseOptimisticConcurrency = true; + + var subscriptions = GetSubscriptions(messageTypes, session); + + foreach (var subscription in subscriptions) + { + subscription.Clients.Remove(client); + } + + session.SaveChanges(); + } + } + + IEnumerable
    ISubscriptionStorage.GetSubscriberAddressesForMessage(IEnumerable messageTypes) + { + using (var session = OpenSession()) + { + var subscriptions = GetSubscriptions(messageTypes, session); + return subscriptions.SelectMany(s => s.Clients) + .Distinct() + .ToArray(); + } + } + + IDocumentSession OpenSession() + { + var session = store.OpenSession(); + + session.Advanced.AllowNonAuthoritativeInformation = false; + + return session; + } + + static IEnumerable GetSubscriptions(IEnumerable messageTypes, IDocumentSession session) + { + var ids = messageTypes + .Select(Subscription.FormatId); + + return session.Load(ids).Where(s => s != null); + } + + static Subscription StoreNewSubscription(IDocumentSession session, string id, MessageType messageType) + { + var subscription = new Subscription { Clients = new List
    (), Id = id, MessageType = messageType }; + session.Store(subscription); + + return subscription; + } + } +} diff --git a/src/NServiceBus.Core/Persistence/Raven/SubscriptionStorage/Subscription.cs b/src/NServiceBus.Core/Persistence/Raven/SubscriptionStorage/Subscription.cs new file mode 100644 index 00000000000..624b50f429c --- /dev/null +++ b/src/NServiceBus.Core/Persistence/Raven/SubscriptionStorage/Subscription.cs @@ -0,0 +1,52 @@ +namespace NServiceBus.Persistence.Raven.SubscriptionStorage +{ + using System; + using System.Collections.Generic; + using System.Security.Cryptography; + using System.Text; + using Unicast.Subscriptions; + using global::Raven.Imports.Newtonsoft.Json; + + public class Subscription + { + public string Id { get; set; } + + [JsonConverter(typeof(MessageTypeConverter))] + public MessageType MessageType { get; set; } + + public List
    Clients { get; set; } + + public static string FormatId(MessageType messageType) + { + // use MD5 hash to get a 16-byte hash of the string + using (var provider = new MD5CryptoServiceProvider()) + { + var inputBytes = Encoding.Default.GetBytes(messageType.TypeName + "/" + messageType.Version.Major); + var hashBytes = provider.ComputeHash(inputBytes); + // generate a guid from the hash: + var id = new Guid(hashBytes); + + return string.Format("Subscriptions/{0}", id); + } + } + } + + public class MessageTypeConverter : JsonConverter + { + public override bool CanConvert(Type objectType) + { + return (objectType == typeof(MessageType)); + } + + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + + return new MessageType(serializer.Deserialize(reader)); + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + serializer.Serialize(writer, value.ToString()); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Persistence/Raven/TimeoutPersister/RavenTimeoutPersistence.cs b/src/NServiceBus.Core/Persistence/Raven/TimeoutPersister/RavenTimeoutPersistence.cs new file mode 100644 index 00000000000..39679335e74 --- /dev/null +++ b/src/NServiceBus.Core/Persistence/Raven/TimeoutPersister/RavenTimeoutPersistence.cs @@ -0,0 +1,171 @@ +namespace NServiceBus.Persistence.Raven.TimeoutPersister +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Text; + using Timeout.Core; + using Logging; + using Raven; + using global::Raven.Client; + using global::Raven.Client.Linq; + + public class RavenTimeoutPersistence : IPersistTimeouts + { + readonly IDocumentStore store; + + public RavenTimeoutPersistence(StoreAccessor storeAccessor) + { + store = storeAccessor.Store; + } + + public List> GetNextChunk(DateTime startSlice, out DateTime nextTimeToRunQuery) + { + try + { + var now = DateTime.UtcNow; + var skip = 0; + var results = new List>(); + var numberOfRequestsExecutedSoFar = 0; + RavenQueryStatistics stats; + + do + { + using (var session = OpenSession()) + { + session.Advanced.AllowNonAuthoritativeInformation = true; + + var query = session.Query() + .Where( + t => + t.OwningTimeoutManager == String.Empty || + t.OwningTimeoutManager == Configure.EndpointName) + .Where( + t => + t.Time > startSlice && + t.Time <= now) + .OrderBy(t => t.Time) + .Select(t => new {t.Id, t.Time}) + .Statistics(out stats); + do + { + results.AddRange(query + .Skip(skip) + .Take(1024) + .ToList() + .Select(arg => new Tuple(arg.Id, arg.Time))); + + skip += 1024; + } while (skip < stats.TotalResults && + ++numberOfRequestsExecutedSoFar < session.Advanced.MaxNumberOfRequestsPerSession); + } + } while (skip < stats.TotalResults); + + using (var session = OpenSession()) + { + session.Advanced.AllowNonAuthoritativeInformation = true; + + //Retrieve next time we need to run query + var startOfNextChunk = + session.Query() + .Where( + t => + t.OwningTimeoutManager == String.Empty || + t.OwningTimeoutManager == Configure.EndpointName) + .Where(t => t.Time > now) + .OrderBy(t => t.Time) + .Select(t => new {t.Id, t.Time}) + .FirstOrDefault(); + + if (startOfNextChunk != null) + { + nextTimeToRunQuery = startOfNextChunk.Time; + } + else + { + nextTimeToRunQuery = DateTime.UtcNow.AddMinutes(10); + } + + return results; + } + } + catch (WebException ex) + { + LogRavenConnectionFailure(ex); + throw; + } + } + + public void Add(TimeoutData timeout) + { + using (var session = OpenSession()) + { + session.Store(timeout); + session.SaveChanges(); + } + } + + public bool TryRemove(string timeoutId, out TimeoutData timeoutData) + { + using (var session = OpenSession()) + { + timeoutData = session.Load(timeoutId); + + if (timeoutData == null) + return false; + + timeoutData.Time = DateTime.UtcNow.AddYears(-1); + session.SaveChanges(); + + session.Delete(timeoutData); + session.SaveChanges(); + + return true; + } + } + + public void RemoveTimeoutBy(Guid sagaId) + { + using (var session = OpenSession()) + { + var items = session.Query().Where(x => x.SagaId == sagaId); + foreach (var item in items) + session.Delete(item); + + session.SaveChanges(); + } + } + + IDocumentSession OpenSession() + { + var session = store.OpenSession(); + + session.Advanced.AllowNonAuthoritativeInformation = false; + session.Advanced.UseOptimisticConcurrency = true; + + return session; + } + + void LogRavenConnectionFailure(Exception exception) + { + var sb = new StringBuilder(); + sb.AppendFormat("Raven could not be contacted. We tried to access Raven using the following url: {0}.", + store.Url); + sb.AppendLine(); + sb.AppendFormat("Please ensure that you can open the Raven Studio by navigating to {0}.", store.Url); + sb.AppendLine(); + sb.AppendLine( + @"To configure NServiceBus to use a different Raven connection string add a connection string named ""NServiceBus.Persistence"" in your config file, example:"); + sb.AppendFormat( + @" + +"); + sb.AppendLine("Original exception: " + exception); + + Logger.Warn(sb.ToString()); + } + + static readonly ILog Logger = LogManager.GetLogger(typeof(RavenTimeoutPersistence)); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Persistence/SetupDefaultPersistence.cs b/src/NServiceBus.Core/Persistence/SetupDefaultPersistence.cs new file mode 100644 index 00000000000..77221e9ad20 --- /dev/null +++ b/src/NServiceBus.Core/Persistence/SetupDefaultPersistence.cs @@ -0,0 +1,10 @@ +namespace NServiceBus.Persistence +{ + public class SetupDefaultPersistence : IWantToRunBeforeConfiguration + { + public void Init() + { + ConfigureRavenPersistence.RegisterDefaults(); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Properties/AssemblyInfo.cs b/src/NServiceBus.Core/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..5197a16419d --- /dev/null +++ b/src/NServiceBus.Core/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("NServiceBus.Core")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyProduct("NServiceBus.Core")] +[assembly: AssemblyCompany("NServiceBus")] +[assembly: AssemblyConfiguration("release")] +[assembly: AssemblyInformationalVersion("4.0.0-alpha0")] +[assembly: ComVisible(false)] +[assembly: CLSCompliantAttribute(true)] + diff --git a/src/NServiceBus.Core/Properties/Resources.Designer.cs b/src/NServiceBus.Core/Properties/Resources.Designer.cs new file mode 100644 index 00000000000..bd5524a2c3f --- /dev/null +++ b/src/NServiceBus.Core/Properties/Resources.Designer.cs @@ -0,0 +1,121 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.18034 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace NServiceBus.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NServiceBus.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap complete { + get { + object obj = ResourceManager.GetObject("complete", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap error { + get { + object obj = ResourceManager.GetObject("error", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Icon similar to (Icon). + /// + internal static System.Drawing.Icon form_icon { + get { + object obj = ResourceManager.GetObject("form_icon", resourceCulture); + return ((System.Drawing.Icon)(obj)); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap logo { + get { + object obj = ResourceManager.GetObject("logo", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + + /// + /// Looks up a localized string similar to Import-Module .\tools\psake\psake.psm1. + /// + internal static string String { + get { + return ResourceManager.GetString("String", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invoke-psake .\default.ps1 -taskList @("ReleaseNServiceBus") -properties @{ProductVersion="3.3";PatchVersion="7";PreRelease="-beta";buildConfiguration="Release";}. + /// + internal static string String1 { + get { + return ResourceManager.GetString("String1", resourceCulture); + } + } + } +} diff --git a/src/NServiceBus.Core/Properties/Resources.resx b/src/NServiceBus.Core/Properties/Resources.resx new file mode 100644 index 00000000000..d2b0eb193e6 --- /dev/null +++ b/src/NServiceBus.Core/Properties/Resources.resx @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\Resources\complete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\error.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\formicon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + ..\Resources\NServiceBus_Logo- white.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Import-Module .\tools\psake\psake.psm1 + + + Invoke-psake .\default.ps1 -taskList @("ReleaseNServiceBus") -properties @{ProductVersion="3.3";PatchVersion="7";PreRelease="-beta";buildConfiguration="Release";} + + \ No newline at end of file diff --git a/src/NServiceBus.Core/Resources/NServiceBus.png b/src/NServiceBus.Core/Resources/NServiceBus.png new file mode 100644 index 00000000000..a0bef6670a8 Binary files /dev/null and b/src/NServiceBus.Core/Resources/NServiceBus.png differ diff --git a/src/NServiceBus.Core/Resources/NServiceBus_Logo- white.png b/src/NServiceBus.Core/Resources/NServiceBus_Logo- white.png new file mode 100644 index 00000000000..51dc53f68d4 Binary files /dev/null and b/src/NServiceBus.Core/Resources/NServiceBus_Logo- white.png differ diff --git a/src/forms/Resources/complete.png b/src/NServiceBus.Core/Resources/complete.png similarity index 100% rename from src/forms/Resources/complete.png rename to src/NServiceBus.Core/Resources/complete.png diff --git a/src/forms/Resources/error.png b/src/NServiceBus.Core/Resources/error.png similarity index 100% rename from src/forms/Resources/error.png rename to src/NServiceBus.Core/Resources/error.png diff --git a/src/forms/Resources/formicon.ico b/src/NServiceBus.Core/Resources/formicon.ico similarity index 100% rename from src/forms/Resources/formicon.ico rename to src/NServiceBus.Core/Resources/formicon.ico diff --git a/src/NServiceBus.Core/Resources/logo.bmp b/src/NServiceBus.Core/Resources/logo.bmp new file mode 100644 index 00000000000..55516c7aaa3 Binary files /dev/null and b/src/NServiceBus.Core/Resources/logo.bmp differ diff --git a/src/NServiceBus.Core/Resources/logo.png b/src/NServiceBus.Core/Resources/logo.png new file mode 100644 index 00000000000..3e9d6ed41b4 Binary files /dev/null and b/src/NServiceBus.Core/Resources/logo.png differ diff --git a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/AbstractLicenseValidator.cs b/src/NServiceBus.Core/Rhino.Licensing/AbstractLicenseValidator.cs similarity index 95% rename from src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/AbstractLicenseValidator.cs rename to src/NServiceBus.Core/Rhino.Licensing/AbstractLicenseValidator.cs index 627152cad22..7af1e8bd9dd 100644 --- a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/AbstractLicenseValidator.cs +++ b/src/NServiceBus.Core/Rhino.Licensing/AbstractLicenseValidator.cs @@ -1,265 +1,267 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.Security.Cryptography; -using System.Security.Cryptography.Xml; -using System.Threading; -using System.Xml; -using log4net; - -namespace Rhino.Licensing -{ - /// - /// Base license validator. - /// - public abstract class AbstractLicenseValidator - { - /// - /// License validator logger - /// - protected readonly ILog Log = LogManager.GetLogger(typeof(LicenseValidator)); - - private readonly string publicKey; - private readonly Timer nextLeaseTimer; - - /// - /// Fired when license data is invalidated - /// - public event Action LicenseInvalidated; - - /// - /// Gets the expiration date of the license - /// - public DateTime ExpirationDate - { - get; private set; - } - - /// - /// Gets the Type of the license - /// - public LicenseType LicenseType - { - get; private set; - } - - /// - /// Gets the Id of the license holder - /// - public Guid UserId - { - get; private set; - } - - /// - /// Gets the name of the license holder - /// - public string Name - { - get; private set; - } - - /// - /// Gets extra license information - /// - public IDictionary LicenseAttributes - { - get; private set; - } - - /// - /// Gets or Sets the license content - /// - protected abstract string License - { - get; set; - } - - private void LeaseLicenseAgain(object state) - { - if (HasExistingLicense()) - return; - - RaiseLicenseInvalidated(); - } - - private void RaiseLicenseInvalidated() - { - var licenseInvalidated = LicenseInvalidated; - if (licenseInvalidated == null) - throw new InvalidOperationException("License was invalidated, but there is no one subscribe to the LicenseInvalidated event"); - licenseInvalidated(InvalidationType.TimeExpired); - } - - /// - /// Creates a license validator with specified public key. - /// - /// public key - protected AbstractLicenseValidator(string publicKey) - { - LeaseTimeout = TimeSpan.FromHours(5); - LicenseAttributes = new Dictionary(); - nextLeaseTimer = new Timer(LeaseLicenseAgain); - this.publicKey = publicKey; - } - - /// - /// Validates loaded license - /// - public virtual void AssertValidLicense() - { - LicenseAttributes.Clear(); - if (HasExistingLicense()) - { - return; - } - - Log.WarnFormat("Could not validate existing license\r\n{0}", License); - throw new LicenseNotFoundException(); - } - - private bool HasExistingLicense() - { - try - { - if (TryLoadingLicenseValuesFromValidatedXml() == false) - { - Log.WarnFormat("Failed validating license:\r\n{0}", License); - return false; - } - Log.InfoFormat("License expiration date is {0}", ExpirationDate); - - bool result = DateTime.UtcNow < ExpirationDate; - - if (!result) - throw new LicenseExpiredException("Expiration Date : " + ExpirationDate); - - return true; - } - catch (RhinoLicensingException) - { - throw; - } - catch (Exception) - { - return false; - } - } - - /// - /// Loads license data from validated license file. - /// - /// - public bool TryLoadingLicenseValuesFromValidatedXml() - { - try - { - var doc = new XmlDocument(); - doc.LoadXml(License); - - if (TryGetValidDocument(publicKey, doc) == false) - { - Log.WarnFormat("Could not validate xml signature of:\r\n{0}", License); - return false; - } - - if (doc.FirstChild == null) - { - Log.WarnFormat("Could not find first child of:\r\n{0}", License); - return false; - } - - var result = ValidateXmlDocumentLicense(doc); - if (result) - { - nextLeaseTimer.Change(LeaseTimeout, LeaseTimeout); - } - return result; - } - catch (RhinoLicensingException) - { - throw; - } - catch (Exception e) - { - Log.Error("Could not validate license", e); - return false; - } - } - - /// - /// Lease timeout - /// - public TimeSpan LeaseTimeout { get; set; } - - internal bool ValidateXmlDocumentLicense(XmlDocument doc) - { - XmlNode id = doc.SelectSingleNode("/license/@id"); - if (id == null) - { - Log.WarnFormat("Could not find id attribute in license:\r\n{0}", License); - return false; - } - - UserId = new Guid(id.Value); - - XmlNode date = doc.SelectSingleNode("/license/@expiration"); - if (date == null) - { - Log.WarnFormat("Could not find expiration in license:\r\n{0}", License); - return false; - } - - ExpirationDate = DateTime.ParseExact(date.Value, "yyyy-MM-ddTHH:mm:ss.fffffff", CultureInfo.InvariantCulture); - - XmlNode licenseType = doc.SelectSingleNode("/license/@type"); - if (licenseType == null) - { - Log.WarnFormat("Could not find license type in {0}", licenseType); - return false; - } - - LicenseType = (LicenseType)Enum.Parse(typeof(LicenseType), licenseType.Value); - - XmlNode name = doc.SelectSingleNode("/license/name/text()"); - if (name == null) - { - Log.WarnFormat("Could not find licensee's name in license:\r\n{0}", License); - return false; - } - - Name = name.Value; - - var license = doc.SelectSingleNode("/license"); - foreach (XmlAttribute attrib in license.Attributes) - { - if (attrib.Name == "type" || attrib.Name == "expiration" || attrib.Name == "id") - continue; - - LicenseAttributes[attrib.Name] = attrib.Value; - } - - return true; - } - - private bool TryGetValidDocument(string licensePublicKey, XmlDocument doc) - { - var rsa = new RSACryptoServiceProvider(); - rsa.FromXmlString(licensePublicKey); - - var nsMgr = new XmlNamespaceManager(doc.NameTable); - nsMgr.AddNamespace("sig", "http://www.w3.org/2000/09/xmldsig#"); - - var signedXml = new SignedXml(doc); - var sig = (XmlElement)doc.SelectSingleNode("//sig:Signature", nsMgr); - if (sig == null) - { - Log.WarnFormat("Could not find this signature node on license:\r\n{0}", License); - return false; - } - signedXml.LoadXml(sig); - - return signedXml.CheckSignature(rsa); - } - } +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Security.Cryptography; +using System.Security.Cryptography.Xml; +using System.Threading; +using System.Xml; + +namespace Rhino.Licensing +{ + using NServiceBus.Logging; + using NServiceBus.Logging.Loggers; + + /// + /// Base license validator. + /// + public abstract class AbstractLicenseValidator + { + /// + /// License validator logger + /// + protected readonly ILog Log = new NullLogger(); + + private readonly string publicKey; + private readonly Timer nextLeaseTimer; + + /// + /// Fired when license data is invalidated + /// + public event Action LicenseInvalidated; + + /// + /// Gets the expiration date of the license + /// + public DateTime ExpirationDate + { + get; private set; + } + + /// + /// Gets the Type of the license + /// + public LicenseType LicenseType + { + get; private set; + } + + /// + /// Gets the Id of the license holder + /// + public Guid UserId + { + get; private set; + } + + /// + /// Gets the name of the license holder + /// + public string Name + { + get; private set; + } + + /// + /// Gets extra license information + /// + public IDictionary LicenseAttributes + { + get; private set; + } + + /// + /// Gets or Sets the license content + /// + protected abstract string License + { + get; set; + } + + private void LeaseLicenseAgain(object state) + { + if (HasExistingLicense()) + return; + + RaiseLicenseInvalidated(); + } + + private void RaiseLicenseInvalidated() + { + var licenseInvalidated = LicenseInvalidated; + if (licenseInvalidated == null) + throw new InvalidOperationException("License was invalidated, but there is no one subscribe to the LicenseInvalidated event"); + licenseInvalidated(InvalidationType.TimeExpired); + } + + /// + /// Creates a license validator with specified public key. + /// + /// public key + protected AbstractLicenseValidator(string publicKey) + { + LeaseTimeout = TimeSpan.FromHours(5); + LicenseAttributes = new Dictionary(); + nextLeaseTimer = new Timer(LeaseLicenseAgain); + this.publicKey = publicKey; + } + + /// + /// Validates loaded license + /// + public virtual void AssertValidLicense() + { + LicenseAttributes.Clear(); + if (HasExistingLicense()) + { + return; + } + + Log.WarnFormat("Could not validate existing license\r\n{0}", License); + throw new LicenseNotFoundException(); + } + + private bool HasExistingLicense() + { + try + { + if (TryLoadingLicenseValuesFromValidatedXml() == false) + { + Log.WarnFormat("Failed validating license:\r\n{0}", License); + return false; + } + Log.InfoFormat("License expiration date is {0}", ExpirationDate); + + bool result = DateTime.UtcNow < ExpirationDate; + + if (!result) + throw new LicenseExpiredException("Expiration Date : " + ExpirationDate); + + return true; + } + catch (RhinoLicensingException) + { + throw; + } + catch (Exception) + { + return false; + } + } + + /// + /// Loads license data from validated license file. + /// + /// + public bool TryLoadingLicenseValuesFromValidatedXml() + { + try + { + var doc = new XmlDocument(); + doc.LoadXml(License); + + if (TryGetValidDocument(publicKey, doc) == false) + { + Log.WarnFormat("Could not validate xml signature of:\r\n{0}", License); + return false; + } + + if (doc.FirstChild == null) + { + Log.WarnFormat("Could not find first child of:\r\n{0}", License); + return false; + } + + var result = ValidateXmlDocumentLicense(doc); + if (result) + { + nextLeaseTimer.Change(LeaseTimeout, LeaseTimeout); + } + return result; + } + catch (RhinoLicensingException) + { + throw; + } + catch (Exception e) + { + Log.Error("Could not validate license", e); + return false; + } + } + + /// + /// Lease timeout + /// + public TimeSpan LeaseTimeout { get; set; } + + internal bool ValidateXmlDocumentLicense(XmlDocument doc) + { + XmlNode id = doc.SelectSingleNode("/license/@id"); + if (id == null) + { + Log.WarnFormat("Could not find id attribute in license:\r\n{0}", License); + return false; + } + + UserId = new Guid(id.Value); + + XmlNode date = doc.SelectSingleNode("/license/@expiration"); + if (date == null) + { + Log.WarnFormat("Could not find expiration in license:\r\n{0}", License); + return false; + } + + ExpirationDate = DateTime.ParseExact(date.Value, "yyyy-MM-ddTHH:mm:ss.fffffff", CultureInfo.InvariantCulture); + + XmlNode licenseType = doc.SelectSingleNode("/license/@type"); + if (licenseType == null) + { + Log.WarnFormat("Could not find license type in {0}", licenseType); + return false; + } + + LicenseType = (LicenseType)Enum.Parse(typeof(LicenseType), licenseType.Value); + + XmlNode name = doc.SelectSingleNode("/license/name/text()"); + if (name == null) + { + Log.WarnFormat("Could not find licensee's name in license:\r\n{0}", License); + return false; + } + + Name = name.Value; + + var license = doc.SelectSingleNode("/license"); + foreach (XmlAttribute attrib in license.Attributes) + { + if (attrib.Name == "type" || attrib.Name == "expiration" || attrib.Name == "id") + continue; + + LicenseAttributes[attrib.Name] = attrib.Value; + } + + return true; + } + + private bool TryGetValidDocument(string licensePublicKey, XmlDocument doc) + { + var rsa = new RSACryptoServiceProvider(); + rsa.FromXmlString(licensePublicKey); + + var nsMgr = new XmlNamespaceManager(doc.NameTable); + nsMgr.AddNamespace("sig", "http://www.w3.org/2000/09/xmldsig#"); + + var signedXml = new SignedXml(doc); + var sig = (XmlElement)doc.SelectSingleNode("//sig:Signature", nsMgr); + if (sig == null) + { + Log.WarnFormat("Could not find this signature node on license:\r\n{0}", License); + return false; + } + signedXml.LoadXml(sig); + + return signedXml.CheckSignature(rsa); + } + } } \ No newline at end of file diff --git a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/ILicensingService.cs b/src/NServiceBus.Core/Rhino.Licensing/ILicensingService.cs similarity index 96% rename from src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/ILicensingService.cs rename to src/NServiceBus.Core/Rhino.Licensing/ILicensingService.cs index 2de3d700252..31b9d9cea64 100644 --- a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/ILicensingService.cs +++ b/src/NServiceBus.Core/Rhino.Licensing/ILicensingService.cs @@ -1,22 +1,22 @@ -using System; -using System.ServiceModel; - -namespace Rhino.Licensing -{ - /// - /// Service contract of the licensing server. - /// - [ServiceContract(SessionMode = SessionMode.NotAllowed)] - public interface ILicensingService - { - /// - /// Issues a float license for the user. - /// - /// machine name - /// user name - /// Id of the license holder - /// - [OperationContract] - string LeaseLicense(string machine, string user, Guid id); - } +using System; +using System.ServiceModel; + +namespace Rhino.Licensing +{ + /// + /// Service contract of the licensing server. + /// + [ServiceContract(SessionMode = SessionMode.NotAllowed)] + public interface ILicensingService + { + /// + /// Issues a float license for the user. + /// + /// machine name + /// user name + /// Id of the license holder + /// + [OperationContract] + string LeaseLicense(string machine, string user, Guid id); + } } \ No newline at end of file diff --git a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/ISubscriptionLicensingService.cs b/src/NServiceBus.Core/Rhino.Licensing/ISubscriptionLicensingService.cs similarity index 96% rename from src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/ISubscriptionLicensingService.cs rename to src/NServiceBus.Core/Rhino.Licensing/ISubscriptionLicensingService.cs index 7a6f8a62b3f..e123ff90842 100644 --- a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/ISubscriptionLicensingService.cs +++ b/src/NServiceBus.Core/Rhino.Licensing/ISubscriptionLicensingService.cs @@ -1,19 +1,19 @@ -using System.ServiceModel; - -namespace Rhino.Licensing -{ - /// - /// Service contract of subscription server. - /// - [ServiceContract] - public interface ISubscriptionLicensingService - { - /// - /// Issues a leased license - /// - /// - /// - [OperationContract] - string LeaseLicense(string previousLicense); - } +using System.ServiceModel; + +namespace Rhino.Licensing +{ + /// + /// Service contract of subscription server. + /// + [ServiceContract] + public interface ISubscriptionLicensingService + { + /// + /// Issues a leased license + /// + /// + /// + [OperationContract] + string LeaseLicense(string previousLicense); + } } \ No newline at end of file diff --git a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/InvalidationType.cs b/src/NServiceBus.Core/Rhino.Licensing/InvalidationType.cs similarity index 95% rename from src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/InvalidationType.cs rename to src/NServiceBus.Core/Rhino.Licensing/InvalidationType.cs index d58a24fa986..f677cf65a17 100644 --- a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/InvalidationType.cs +++ b/src/NServiceBus.Core/Rhino.Licensing/InvalidationType.cs @@ -1,18 +1,18 @@ -namespace Rhino.Licensing -{ - /// - /// InvalidationType - /// - public enum InvalidationType - { - /// - /// Can not create a new license - /// - CannotGetNewLicense, - - /// - /// License is expired - /// - TimeExpired - } +namespace Rhino.Licensing +{ + /// + /// InvalidationType + /// + public enum InvalidationType + { + /// + /// Can not create a new license + /// + CannotGetNewLicense, + + /// + /// License is expired + /// + TimeExpired + } } \ No newline at end of file diff --git a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/LicenseExpiredException.cs b/src/NServiceBus.Core/Rhino.Licensing/LicenseExpiredException.cs similarity index 97% rename from src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/LicenseExpiredException.cs rename to src/NServiceBus.Core/Rhino.Licensing/LicenseExpiredException.cs index a1ae3c077ba..8babe5ac5c3 100644 --- a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/LicenseExpiredException.cs +++ b/src/NServiceBus.Core/Rhino.Licensing/LicenseExpiredException.cs @@ -1,44 +1,44 @@ -using System; -using System.Runtime.Serialization; - -namespace Rhino.Licensing -{ - /// - /// Thrown when license is found but is past it's expiration date - /// - public class LicenseExpiredException : RhinoLicensingException - { - /// - /// Creates a new instance of . - /// - public LicenseExpiredException() - { - } - - /// - /// Creates a new instance of . - /// - /// error message - public LicenseExpiredException(string message) : base(message) - { - } - - /// - /// Creates a new instance of . - /// - /// error message - /// inner exception - public LicenseExpiredException(string message, Exception inner) : base(message, inner) - { - } - - /// - /// Creates a new instance of . - /// - /// serialization information - /// streaming context - public LicenseExpiredException(SerializationInfo info, StreamingContext context) : base(info, context) - { - } - } +using System; +using System.Runtime.Serialization; + +namespace Rhino.Licensing +{ + /// + /// Thrown when license is found but is past it's expiration date + /// + public class LicenseExpiredException : RhinoLicensingException + { + /// + /// Creates a new instance of . + /// + public LicenseExpiredException() + { + } + + /// + /// Creates a new instance of . + /// + /// error message + public LicenseExpiredException(string message) : base(message) + { + } + + /// + /// Creates a new instance of . + /// + /// error message + /// inner exception + public LicenseExpiredException(string message, Exception inner) : base(message, inner) + { + } + + /// + /// Creates a new instance of . + /// + /// serialization information + /// streaming context + public LicenseExpiredException(SerializationInfo info, StreamingContext context) : base(info, context) + { + } + } } \ No newline at end of file diff --git a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/LicenseFileNotFoundException.cs b/src/NServiceBus.Core/Rhino.Licensing/LicenseFileNotFoundException.cs similarity index 97% rename from src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/LicenseFileNotFoundException.cs rename to src/NServiceBus.Core/Rhino.Licensing/LicenseFileNotFoundException.cs index 047fe337259..b77c7de265f 100644 --- a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/LicenseFileNotFoundException.cs +++ b/src/NServiceBus.Core/Rhino.Licensing/LicenseFileNotFoundException.cs @@ -1,50 +1,50 @@ -using System; -using System.Runtime.Serialization; - -namespace Rhino.Licensing -{ - /// - /// Thrown when a valid license file can not be - /// found on the client machine. - /// - [Serializable] - public class LicenseFileNotFoundException : RhinoLicensingException - { - /// - /// Creates a new instance of - /// - public LicenseFileNotFoundException() - { - } - - /// - /// Creates a new instance of - /// - /// error message - public LicenseFileNotFoundException(string message) - : base(message) - { - } - - /// - /// Creates a new instance of - /// - /// error message - /// inner exception - public LicenseFileNotFoundException(string message, Exception inner) - : base(message, inner) - { - } - - /// - /// Creates a new instance of - /// - /// serialization information - /// streaming context - protected LicenseFileNotFoundException( - SerializationInfo info, - StreamingContext context) : base(info, context) - { - } - } +using System; +using System.Runtime.Serialization; + +namespace Rhino.Licensing +{ + /// + /// Thrown when a valid license file can not be + /// found on the client machine. + /// + [Serializable] + public class LicenseFileNotFoundException : RhinoLicensingException + { + /// + /// Creates a new instance of + /// + public LicenseFileNotFoundException() + { + } + + /// + /// Creates a new instance of + /// + /// error message + public LicenseFileNotFoundException(string message) + : base(message) + { + } + + /// + /// Creates a new instance of + /// + /// error message + /// inner exception + public LicenseFileNotFoundException(string message, Exception inner) + : base(message, inner) + { + } + + /// + /// Creates a new instance of + /// + /// serialization information + /// streaming context + protected LicenseFileNotFoundException( + SerializationInfo info, + StreamingContext context) : base(info, context) + { + } + } } \ No newline at end of file diff --git a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/LicenseNotFoundException.cs b/src/NServiceBus.Core/Rhino.Licensing/LicenseNotFoundException.cs similarity index 96% rename from src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/LicenseNotFoundException.cs rename to src/NServiceBus.Core/Rhino.Licensing/LicenseNotFoundException.cs index 6ec3d63078e..f5d6b0117ea 100644 --- a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/LicenseNotFoundException.cs +++ b/src/NServiceBus.Core/Rhino.Licensing/LicenseNotFoundException.cs @@ -1,49 +1,49 @@ -using System; -using System.Runtime.Serialization; - -namespace Rhino.Licensing -{ - /// - /// Thrown when suitable license is not found. - /// - [Serializable] - public class LicenseNotFoundException : RhinoLicensingException - { - /// - /// Creates a new instance of . - /// - public LicenseNotFoundException() - { - } - - /// - /// Creates a new instance of . - /// - /// error message - public LicenseNotFoundException(string message) - : base(message) - { - } - - /// - /// Creates a new instance of . - /// - /// error message - /// inner exception - public LicenseNotFoundException(string message, Exception inner) - : base(message, inner) - { - } - - /// - /// Creates a new instance of . - /// - /// serialization information - /// steaming context - protected LicenseNotFoundException( - SerializationInfo info, - StreamingContext context) : base(info, context) - { - } - } +using System; +using System.Runtime.Serialization; + +namespace Rhino.Licensing +{ + /// + /// Thrown when suitable license is not found. + /// + [Serializable] + public class LicenseNotFoundException : RhinoLicensingException + { + /// + /// Creates a new instance of . + /// + public LicenseNotFoundException() + { + } + + /// + /// Creates a new instance of . + /// + /// error message + public LicenseNotFoundException(string message) + : base(message) + { + } + + /// + /// Creates a new instance of . + /// + /// error message + /// inner exception + public LicenseNotFoundException(string message, Exception inner) + : base(message, inner) + { + } + + /// + /// Creates a new instance of . + /// + /// serialization information + /// steaming context + protected LicenseNotFoundException( + SerializationInfo info, + StreamingContext context) : base(info, context) + { + } + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Rhino.Licensing/LicenseType.cs b/src/NServiceBus.Core/Rhino.Licensing/LicenseType.cs new file mode 100644 index 00000000000..c4b020a2b60 --- /dev/null +++ b/src/NServiceBus.Core/Rhino.Licensing/LicenseType.cs @@ -0,0 +1,28 @@ +namespace Rhino.Licensing +{ + /// + /// License Type + /// + public enum LicenseType + { + /// + /// No type specified + /// + None, + + /// + /// For trial use + /// + Trial, + + /// + /// Standard license + /// + Standard, + + /// + /// For personal use + /// + Personal, + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Rhino.Licensing/LicenseValidator.cs b/src/NServiceBus.Core/Rhino.Licensing/LicenseValidator.cs new file mode 100644 index 00000000000..76747367f42 --- /dev/null +++ b/src/NServiceBus.Core/Rhino.Licensing/LicenseValidator.cs @@ -0,0 +1,63 @@ +using System; +using System.IO; + +namespace Rhino.Licensing +{ + /// + /// License validator validates a license file + /// that can be located on disk. + /// + public class LicenseValidator : AbstractLicenseValidator + { + private readonly string licensePath; + private string inMemoryLicense; + + /// + /// Creates a new instance of . + /// + /// public key + /// path to license file + public LicenseValidator(string publicKey, string licensePath) + : base(publicKey) + { + this.licensePath = licensePath; + } + + /// + /// Gets or Sets the license content + /// + protected override string License + { + get + { + return inMemoryLicense ?? File.ReadAllText(licensePath); + } + set + { + try + { + File.WriteAllText(licensePath, value); + } + catch (Exception e) + { + inMemoryLicense = value; + Log.Warn("Could not write new license value, using in memory model instead", e); + } + } + } + + /// + /// Validates loaded license + /// + public override void AssertValidLicense() + { + if (File.Exists(licensePath) == false) + { + Log.WarnFormat("Could not find license file: {0}", licensePath); + throw new LicenseFileNotFoundException(); + } + + base.AssertValidLicense(); + } + } +} diff --git a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/RhinoLicensingException.cs b/src/NServiceBus.Core/Rhino.Licensing/RhinoLicensingException.cs similarity index 96% rename from src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/RhinoLicensingException.cs rename to src/NServiceBus.Core/Rhino.Licensing/RhinoLicensingException.cs index 0b80a88edb7..6714c5a28a6 100644 --- a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/RhinoLicensingException.cs +++ b/src/NServiceBus.Core/Rhino.Licensing/RhinoLicensingException.cs @@ -1,50 +1,50 @@ -using System; -using System.Runtime.Serialization; - -namespace Rhino.Licensing -{ - /// - /// Base class for all licensing exceptions. - /// - [Serializable] - public class RhinoLicensingException : Exception - { - /// - /// Creates a new instance of . - /// - protected RhinoLicensingException() - { - } - - /// - /// Creates a new instance of . - /// - /// error message - protected RhinoLicensingException(string message) - : base(message) - { - } - - /// - /// Creates a new instance of . - /// - /// error message - /// inner exception - protected RhinoLicensingException(string message, Exception inner) - : base(message, inner) - { - } - - /// - /// Creates a new instance of . - /// - /// serialization information - /// streaming context - protected RhinoLicensingException( - SerializationInfo info, - StreamingContext context) - : base(info, context) - { - } - } +using System; +using System.Runtime.Serialization; + +namespace Rhino.Licensing +{ + /// + /// Base class for all licensing exceptions. + /// + [Serializable] + public class RhinoLicensingException : Exception + { + /// + /// Creates a new instance of . + /// + protected RhinoLicensingException() + { + } + + /// + /// Creates a new instance of . + /// + /// error message + protected RhinoLicensingException(string message) + : base(message) + { + } + + /// + /// Creates a new instance of . + /// + /// error message + /// inner exception + protected RhinoLicensingException(string message, Exception inner) + : base(message, inner) + { + } + + /// + /// Creates a new instance of . + /// + /// serialization information + /// streaming context + protected RhinoLicensingException( + SerializationInfo info, + StreamingContext context) + : base(info, context) + { + } + } } \ No newline at end of file diff --git a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/StringLicenseValidator.cs b/src/NServiceBus.Core/Rhino.Licensing/StringLicenseValidator.cs similarity index 96% rename from src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/StringLicenseValidator.cs rename to src/NServiceBus.Core/Rhino.Licensing/StringLicenseValidator.cs index 0a72a418d46..8f0dc032b8c 100644 --- a/src/impl/licensing/NServiceBus.Licensing/Rhino.Licensing/StringLicenseValidator.cs +++ b/src/NServiceBus.Core/Rhino.Licensing/StringLicenseValidator.cs @@ -1,27 +1,27 @@ -namespace Rhino.Licensing -{ - /// - /// Validates content of a license file - /// - public class StringLicenseValidator : AbstractLicenseValidator - { - /// - /// Creates a new instance of - /// - /// public key - /// license content - public StringLicenseValidator(string publicKey, string license) - : base(publicKey) - { - License = license; - } - - /// - /// License content - /// - protected override string License - { - get; set; - } - } +namespace Rhino.Licensing +{ + /// + /// Validates content of a license file + /// + public class StringLicenseValidator : AbstractLicenseValidator + { + /// + /// Creates a new instance of + /// + /// public key + /// license content + public StringLicenseValidator(string publicKey, string license) + : base(publicKey) + { + License = license; + } + + /// + /// License content + /// + protected override string License + { + get; set; + } + } } \ No newline at end of file diff --git a/src/impl/Sagas/NServiceBus.Sagas.Impl/AutoCorrelateSagaOnReplyMutator.cs b/src/NServiceBus.Core/Sagas/AutoCorrelateSagaOnReplyMutator.cs similarity index 81% rename from src/impl/Sagas/NServiceBus.Sagas.Impl/AutoCorrelateSagaOnReplyMutator.cs rename to src/NServiceBus.Core/Sagas/AutoCorrelateSagaOnReplyMutator.cs index b9a870a508f..21b961159cd 100644 --- a/src/impl/Sagas/NServiceBus.Sagas.Impl/AutoCorrelateSagaOnReplyMutator.cs +++ b/src/NServiceBus.Core/Sagas/AutoCorrelateSagaOnReplyMutator.cs @@ -1,66 +1,59 @@ -namespace NServiceBus.Sagas.Impl -{ - using System; - using Config; - using MessageMutator; - using Unicast.Transport; - - /// - /// Promotes the saga id and type headers on replies(bus.Reply|bus.Return) so that the saga can be - /// correlated without the user having to add mappings for it. This replaces the ISagaMessage feature - /// - public class AutoCorrelateSagaOnReplyMutator : IMutateTransportMessages, INeedInitialization - { - - /// - /// Stores the original saga id and type of the incoming message - /// - /// - public void MutateIncoming(TransportMessage transportMessage) - { - originatingSagaId = null; - originatingSagaType = null; - - if (transportMessage.Headers.ContainsKey(Headers.OriginatingSagaId)) - originatingSagaId = transportMessage.Headers[Headers.OriginatingSagaId]; - - if (transportMessage.Headers.ContainsKey(Headers.OriginatingSagaType)) - originatingSagaType = transportMessage.Headers[Headers.OriginatingSagaType]; - - } - - /// - /// Promotes the id and type of the originating saga if the is a reply - /// - /// - /// - public void MutateOutgoing(object[] messages, TransportMessage transportMessage) - { - //if correlation id is not set this is not a replay so we can just return - if (string.IsNullOrEmpty(transportMessage.CorrelationId)) - return; - - if(string.IsNullOrEmpty(originatingSagaId)) - return; - - transportMessage.Headers[Headers.SagaId] = originatingSagaId; - - //we do this check for bacwards compat since older versions on NSB can set the saga id but not the type - if(!string.IsNullOrEmpty(originatingSagaType)) - transportMessage.Headers[Headers.SagaType] = originatingSagaType; - } - - public void Init() - { - NServiceBus.Configure.Instance.Configurer - .ConfigureComponent(DependencyLifecycle.InstancePerCall); - } - - [ThreadStatic] - static string originatingSagaId; - - - [ThreadStatic] - static string originatingSagaType; - } +namespace NServiceBus.Sagas +{ + using System; + using NServiceBus.MessageMutator; + + /// + /// Promotes the saga id and type headers on replies(bus.Reply|bus.Return) so that the saga can be + /// correlated without the user having to add mappings for it. This replaces the ISagaMessage feature + /// + public class AutoCorrelateSagaOnReplyMutator : IMutateTransportMessages, INeedInitialization + { + /// + /// Stores the original saga id and type of the incoming message + /// + /// + public void MutateIncoming(TransportMessage transportMessage) + { + originatingSagaId = null; + originatingSagaType = null; + + if (transportMessage.Headers.ContainsKey(Headers.OriginatingSagaId)) + originatingSagaId = transportMessage.Headers[Headers.OriginatingSagaId]; + + if (transportMessage.Headers.ContainsKey(Headers.OriginatingSagaType)) + originatingSagaType = transportMessage.Headers[Headers.OriginatingSagaType]; + + } + + /// + /// Promotes the id and type of the originating saga if the is a reply + /// + /// + /// + public void MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + if(string.IsNullOrEmpty(originatingSagaId)) + return; + + transportMessage.Headers[Headers.SagaId] = originatingSagaId; + + //we do this check for backwards compatibility since older versions on NSB can set the saga id but not the type + if(!string.IsNullOrEmpty(originatingSagaType)) + transportMessage.Headers[Headers.SagaType] = originatingSagaType; + } + + public void Init() + { + NServiceBus.Configure.Instance.Configurer + .ConfigureComponent(DependencyLifecycle.InstancePerCall); + } + + [ThreadStatic] + static string originatingSagaId; + + + [ThreadStatic] + static string originatingSagaType; + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Sagas/ConfigureHowToFindSagaWithMessageDispatcher.cs b/src/NServiceBus.Core/Sagas/ConfigureHowToFindSagaWithMessageDispatcher.cs new file mode 100644 index 00000000000..f12499f81f5 --- /dev/null +++ b/src/NServiceBus.Core/Sagas/ConfigureHowToFindSagaWithMessageDispatcher.cs @@ -0,0 +1,37 @@ +namespace NServiceBus.Sagas +{ + using System; + using System.Linq.Expressions; + using System.Reflection; + using NServiceBus.Saga; + using NServiceBus.Utils.Reflection; + + /// + /// Class used to bridge the dependency between Saga{T} in NServiceBus.dll and + /// the Configure class found in this project in NServiceBus.Core.dll. + /// + public class ConfigureHowToFindSagaWithMessageDispatcher : IConfigureHowToFindSagaWithMessage + { + void IConfigureHowToFindSagaWithMessage.ConfigureMapping(Expression> sagaEntityProperty, Expression> messageProperty) + { + var sagaProp = Reflect.GetProperty(sagaEntityProperty, true); + var messageProp = Reflect.GetProperty(messageProperty, false); + + ThrowIfNotPropertyLambdaExpression(sagaEntityProperty, sagaProp); + ThrowIfNotPropertyLambdaExpression(messageProperty, messageProp); + + Features.Sagas.ConfigureHowToFindSagaWithMessage(typeof(TSagaEntity), sagaProp, typeof(TMessage), messageProp); + } + + private static void ThrowIfNotPropertyLambdaExpression(Expression> expression, PropertyInfo propertyInfo) + { + if (propertyInfo == null) + { + throw new ArgumentException( + String.Format( + "Only public properties are supported for mapping Sagas. The lambda expression provided '{0}' is not mapping to a Property!", + expression.Body)); + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Sagas/ConfigureTimeoutAsSystemMessages.cs b/src/NServiceBus.Core/Sagas/ConfigureTimeoutAsSystemMessages.cs new file mode 100644 index 00000000000..e8baca61879 --- /dev/null +++ b/src/NServiceBus.Core/Sagas/ConfigureTimeoutAsSystemMessages.cs @@ -0,0 +1,31 @@ +namespace NServiceBus.Sagas +{ + using System; + using System.Collections.Generic; + using System.Linq; + using NServiceBus.Saga; + + /// + /// Defining as valid system messages + /// + public class ConfigureTimeoutAsSystemMessages : IWantToRunBeforeConfiguration + { + /// + /// Defining as valid system messages + /// + public void Init() + { + var sagas = Configure.TypesToScan.Where(Features.Sagas.IsSagaType).ToList(); + + Configure.Instance.AddSystemMessagesAs(t => IsTypeATimeoutHandledByAnySaga(t, sagas)); + } + + static bool IsTypeATimeoutHandledByAnySaga(Type type, IEnumerable sagas) + { + var timeoutHandler = typeof(IHandleTimeouts<>).MakeGenericType(type); + var messageHandler = typeof(IHandleMessages<>).MakeGenericType(type); + + return sagas.Any(t => timeoutHandler.IsAssignableFrom(t) && !messageHandler.IsAssignableFrom(t)); + } + } +} diff --git a/src/impl/Sagas/NServiceBus.Sagas.Impl/Finders/HeaderSagaIdFinder.cs b/src/NServiceBus.Core/Sagas/Finders/HeaderSagaIdFinder.cs similarity index 83% rename from src/impl/Sagas/NServiceBus.Sagas.Impl/Finders/HeaderSagaIdFinder.cs rename to src/NServiceBus.Core/Sagas/Finders/HeaderSagaIdFinder.cs index 41e0406fda7..ca68c1c17dc 100644 --- a/src/impl/Sagas/NServiceBus.Sagas.Impl/Finders/HeaderSagaIdFinder.cs +++ b/src/NServiceBus.Core/Sagas/Finders/HeaderSagaIdFinder.cs @@ -1,36 +1,36 @@ -namespace NServiceBus.Sagas.Impl.Finders -{ - using System; - using NServiceBus.Saga; - - /// - /// Finds sagas based on the sagaid header - /// - /// - public class HeaderSagaIdFinder : IFindSagas.Using where T : ISagaEntity - { - - /// - /// Injected persister - /// +namespace NServiceBus.Sagas.Finders +{ + using System; + using NServiceBus.Saga; + + /// + /// Finds sagas based on the sagaid header + /// + /// + public class HeaderSagaIdFinder : IFindSagas.Using where T : IContainSagaData + { + + /// + /// Injected persister + /// public ISagaPersister SagaPersister { get; set; } - - /// - /// Returns the saga - /// - /// - /// - public T FindBy(object message) - { - if (SagaPersister == null) - return default(T); - - var sagaIdHeader = message.GetHeader(Headers.SagaId); - - if (string.IsNullOrEmpty(sagaIdHeader)) - return default(T); - - return SagaPersister.Get( Guid.Parse(sagaIdHeader)); - } - } + + /// + /// Returns the saga + /// + /// + /// + public T FindBy(object message) + { + if (SagaPersister == null) + return default(T); + + var sagaIdHeader = Headers.GetMessageHeader(message, Headers.SagaId); + + if (string.IsNullOrEmpty(sagaIdHeader)) + return default(T); + + return SagaPersister.Get( Guid.Parse(sagaIdHeader)); + } + } } \ No newline at end of file diff --git a/src/impl/Sagas/NServiceBus.Sagas.Impl/Finders/NullSagaFinder.cs b/src/NServiceBus.Core/Sagas/Finders/NullSagaFinder.cs similarity index 88% rename from src/impl/Sagas/NServiceBus.Sagas.Impl/Finders/NullSagaFinder.cs rename to src/NServiceBus.Core/Sagas/Finders/NullSagaFinder.cs index 7dee808550a..6d902a46b03 100644 --- a/src/impl/Sagas/NServiceBus.Sagas.Impl/Finders/NullSagaFinder.cs +++ b/src/NServiceBus.Core/Sagas/Finders/NullSagaFinder.cs @@ -1,13 +1,13 @@ -namespace NServiceBus.Sagas.Impl.Finders -{ - using NServiceBus.Saga; - +namespace NServiceBus.Sagas.Finders +{ + using NServiceBus.Saga; + /// /// Catch-all finder to return null - so that we can later check /// for whether a new saga should be created. /// /// - public class NullSagaFinder : IFindSagas.Using where T : ISagaEntity + public class NullSagaFinder : IFindSagas.Using where T : IContainSagaData { /// /// Returns null. @@ -18,5 +18,5 @@ public T FindBy(object message) { return default(T); } - } + } } diff --git a/src/impl/Sagas/NServiceBus.Sagas.Impl/Finders/PropertySagaFinder.cs b/src/NServiceBus.Core/Sagas/Finders/PropertySagaFinder.cs similarity index 78% rename from src/impl/Sagas/NServiceBus.Sagas.Impl/Finders/PropertySagaFinder.cs rename to src/NServiceBus.Core/Sagas/Finders/PropertySagaFinder.cs index 0d00610040c..433f1373322 100644 --- a/src/impl/Sagas/NServiceBus.Sagas.Impl/Finders/PropertySagaFinder.cs +++ b/src/NServiceBus.Core/Sagas/Finders/PropertySagaFinder.cs @@ -1,16 +1,16 @@ -namespace NServiceBus.Sagas.Impl.Finders -{ - using System.Reflection; - using NServiceBus.Saga; - using System; - +namespace NServiceBus.Sagas.Finders +{ + using System; + using System.Reflection; + using NServiceBus.Saga; + /// /// Finds the given type of saga by looking it up based on the given property. /// /// /// public class PropertySagaFinder : IFindSagas.Using - where TSaga : ISagaEntity + where TSaga : IContainSagaData { /// /// Injected persister @@ -33,12 +33,17 @@ public class PropertySagaFinder : IFindSagas.Using /// public TSaga FindBy(TMessage message) - { - if (SagaPersister == null) - throw new InvalidOperationException( + { + if (SagaPersister == null) + throw new InvalidOperationException( "No saga persister configured. Please configure a saga persister if you want to use the nservicebus saga support"); + + var propertyValue = MessageProperty.GetValue(message, null); + + if(SagaProperty.Name.ToLower() == "id") + return SagaPersister.Get((Guid)propertyValue); - return SagaPersister.Get(SagaProperty.Name, MessageProperty.GetValue(message, null)); + return SagaPersister.Get(SagaProperty.Name, propertyValue); } } } diff --git a/src/impl/Sagas/NServiceBus.Sagas.Impl/OriginatingSagaHeaderMutator.cs b/src/NServiceBus.Core/Sagas/OriginatingSagaHeaderMutator.cs similarity index 79% rename from src/impl/Sagas/NServiceBus.Sagas.Impl/OriginatingSagaHeaderMutator.cs rename to src/NServiceBus.Core/Sagas/OriginatingSagaHeaderMutator.cs index d95e99078ed..6e72344d919 100644 --- a/src/impl/Sagas/NServiceBus.Sagas.Impl/OriginatingSagaHeaderMutator.cs +++ b/src/NServiceBus.Core/Sagas/OriginatingSagaHeaderMutator.cs @@ -1,32 +1,30 @@ -namespace NServiceBus.Sagas.Impl -{ - using Config; - using MessageMutator; - using Unicast.Transport; - - /// - /// Adds the originating saga headers to outgoing messages - /// - public class OriginatingSagaHeaderMutator:IMutateOutgoingTransportMessages,INeedInitialization - { - /// - /// Set the header if we run in the context of a saga - /// - /// - /// - public void MutateOutgoing(object[] messages, TransportMessage transportMessage) - { - if (SagaContext.Current == null) - return; - - transportMessage.Headers[Headers.OriginatingSagaId] = SagaContext.Current.Entity.Id.ToString(); - transportMessage.Headers[Headers.OriginatingSagaType] = SagaContext.Current.GetType().AssemblyQualifiedName; - } - - public void Init() - { - NServiceBus.Configure.Instance.Configurer - .ConfigureComponent(DependencyLifecycle.InstancePerCall); - } - } +namespace NServiceBus.Sagas +{ + using NServiceBus.MessageMutator; + + /// + /// Adds the originating saga headers to outgoing messages + /// + public class OriginatingSagaHeaderMutator : IMutateOutgoingTransportMessages, INeedInitialization + { + /// + /// Set the header if we run in the context of a saga + /// + /// + /// + public void MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + if (SagaContext.Current == null) + return; + + transportMessage.Headers[Headers.OriginatingSagaId] = SagaContext.Current.Entity.Id.ToString(); + transportMessage.Headers[Headers.OriginatingSagaType] = SagaContext.Current.GetType().AssemblyQualifiedName; + } + + public void Init() + { + NServiceBus.Configure.Instance.Configurer + .ConfigureComponent(DependencyLifecycle.InstancePerCall); + } + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Sagas/ReplyingToNullOriginatorDispatcher.cs b/src/NServiceBus.Core/Sagas/ReplyingToNullOriginatorDispatcher.cs new file mode 100644 index 00000000000..2af05cd2c2e --- /dev/null +++ b/src/NServiceBus.Core/Sagas/ReplyingToNullOriginatorDispatcher.cs @@ -0,0 +1,24 @@ +namespace NServiceBus.Sagas +{ + using System; + using NServiceBus.Logging; + using NServiceBus.Saga; + + /// + /// Class used to bridge the dependency between Saga{T} in NServiceBus.dll and + /// which doesn't have access to Common.Logging and the level of logging + /// known in the Configure class found in this project in NServiceBus.Core.dll. + /// + public class ReplyingToNullOriginatorDispatcher : IHandleReplyingToNullOriginator + { + void IHandleReplyingToNullOriginator.TriedToReplyToNullOriginator() + { + if (Logger.IsDebugEnabled) + throw new InvalidOperationException + ( + "Originator of saga has not provided a return address - cannot reply."); + } + + static readonly ILog Logger = LogManager.GetLogger(typeof(ReplyingToNullOriginatorDispatcher)); + } +} \ No newline at end of file diff --git a/src/impl/Sagas/NServiceBus.Sagas.Impl/SagaContext.cs b/src/NServiceBus.Core/Sagas/SagaContext.cs similarity index 81% rename from src/impl/Sagas/NServiceBus.Sagas.Impl/SagaContext.cs rename to src/NServiceBus.Core/Sagas/SagaContext.cs index e1116cb13b9..a3e67634062 100644 --- a/src/impl/Sagas/NServiceBus.Sagas.Impl/SagaContext.cs +++ b/src/NServiceBus.Core/Sagas/SagaContext.cs @@ -1,17 +1,17 @@ -namespace NServiceBus.Sagas.Impl -{ - using System; - using Saga; - - /// - /// Context class that holds the current saga beeing processed - /// - public class SagaContext - { - /// - /// The saga - /// - [ThreadStatic] - public static ISaga Current; - } +namespace NServiceBus.Sagas +{ + using System; + using NServiceBus.Saga; + + /// + /// Context class that holds the current saga beeing processed + /// + public class SagaContext + { + /// + /// The saga + /// + [ThreadStatic] + public static ISaga Current; + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Sagas/SagaDispatcherFactory.cs b/src/NServiceBus.Core/Sagas/SagaDispatcherFactory.cs new file mode 100644 index 00000000000..3d689d2d3b8 --- /dev/null +++ b/src/NServiceBus.Core/Sagas/SagaDispatcherFactory.cs @@ -0,0 +1,217 @@ +namespace NServiceBus.Sagas +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + using NServiceBus.IdGeneration; + using NServiceBus.Logging; + using NServiceBus.ObjectBuilder; + using NServiceBus.Saga; + using NServiceBus.Transports; + using NServiceBus.Unicast; + + /// + /// Dispatch factory that can dispatch messages to sagas + /// + public class SagaDispatcherFactory : IMessageDispatcherFactory + { + /// + /// Get Dispatcher + /// + /// Type of the message Handler + /// Builder + /// Message + /// Saga Dispatcher + public IEnumerable GetDispatcher(Type messageHandlerType, IBuilder builder, object message) + { + var entitiesHandled = new List(); + var sagaTypesHandled = new List(); + + foreach (var finder in GetFindersFor(message, builder)) + { + bool sagaEntityIsPersistent = true; + IContainSagaData sagaEntity = UseFinderToFindSaga(finder, message); + Type sagaType; + + if (sagaEntity == null) + { + sagaType = Features.Sagas.GetSagaTypeToStartIfMessageNotFoundByFinder(message, finder); + if (sagaType == null) + continue; + + if (sagaTypesHandled.Contains(sagaType)) + continue; // don't create the same saga type twice for the same message + + sagaEntity = CreateNewSagaEntity(sagaType); + + sagaEntityIsPersistent = false; + } + else + { + if (entitiesHandled.Contains(sagaEntity)) + continue; // don't call the same saga twice + + sagaType = Features.Sagas.GetSagaTypeForSagaEntityType(sagaEntity.GetType()); + } + + if (messageHandlerType.IsAssignableFrom(sagaType)) + yield return () => + { + var saga = (ISaga)builder.Build(sagaType); + + saga.Entity = sagaEntity; + + try + { + SagaContext.Current = saga; + + if (IsTimeoutMessage(message)) + { + HandlerInvocationCache.InvokeTimeout(saga, message); + } + else + { + HandlerInvocationCache.InvokeHandle(saga, message); + } + + if (!saga.Completed) + { + if (!sagaEntityIsPersistent) + { + Persister.Save(saga.Entity); + } + else + { + Persister.Update(saga.Entity); + } + } + else + { + if (sagaEntityIsPersistent) + { + Persister.Complete(saga.Entity); + } + + if (saga.Entity.Id != Guid.Empty) + { + NotifyTimeoutManagerThatSagaHasCompleted(saga); + } + } + + LogIfSagaIsFinished(saga); + + } + finally + { + SagaContext.Current = null; + } + + }; + + sagaTypesHandled.Add(sagaType); + entitiesHandled.Add(sagaEntity); + } + + if (entitiesHandled.Count == 0) + yield return () => + { + logger.InfoFormat("Could not find a saga for the message type {0} with id {1}. Going to invoke SagaNotFoundHandlers.", message.GetType().FullName, Bus.CurrentMessageContext.Id); + foreach (var handler in builder.BuildAll()) + { + logger.DebugFormat("Invoking SagaNotFoundHandler: {0}", + handler.GetType().FullName); + handler.Handle(message); + } + + }; + } + + IContainSagaData CreateNewSagaEntity(Type sagaType) + { + var sagaEntityType = Features.Sagas.GetSagaEntityTypeForSagaType(sagaType); + + if (sagaEntityType == null) + throw new InvalidOperationException("No saga entity type could be found for saga: " + sagaType); + + var sagaEntity = (IContainSagaData)Activator.CreateInstance(sagaEntityType); + + sagaEntity.Id = CombGuid.Generate(); + + if (Bus.CurrentMessageContext.ReplyToAddress != null) + sagaEntity.Originator = Bus.CurrentMessageContext.ReplyToAddress.ToString(); + sagaEntity.OriginalMessageId = Bus.CurrentMessageContext.Id; + + return sagaEntity; + } + + /// + /// Dispatcher factory filters on handler type + /// + /// handler + /// returns true if can be dispatched + public bool CanDispatch(Type handler) + { + return typeof(ISaga).IsAssignableFrom(handler); + } + + IEnumerable GetFindersFor(object message, IBuilder builder) + { + var finders = Features.Sagas.GetFindersFor(message).Select(t => builder.Build(t) as IFinder).ToList(); + + if (logger.IsDebugEnabled) + logger.DebugFormat("The following finders:{0} was allocated to message of type {1}", string.Join(";", finders.Select(t => t.GetType().Name)), message.GetType()); + + return finders; + } + + static IContainSagaData UseFinderToFindSaga(IFinder finder, object message) + { + MethodInfo method = Features.Sagas.GetFindByMethodForFinder(finder, message); + + if (method != null) + return method.Invoke(finder, new [] { message }) as IContainSagaData; + + return null; + } + + void NotifyTimeoutManagerThatSagaHasCompleted(ISaga saga) + { + MessageDeferrer.ClearDeferredMessages(Headers.SagaId, saga.Entity.Id.ToString()); + } + + void LogIfSagaIsFinished(ISaga saga) + { + if (saga.Completed) + logger.Debug(string.Format("{0} {1} has completed.", saga.GetType().FullName, saga.Entity.Id)); + } + + /// + /// True if this is a timeout message + /// + /// + /// + static bool IsTimeoutMessage(object message) + { + return !string.IsNullOrEmpty(Headers.GetMessageHeader(message, Headers.IsSagaTimeoutMessage)); + } + + /// + /// Get or Set Saga Persister + /// + public ISagaPersister Persister { get; set; } + + /// + /// The unicast bus + /// + public IUnicastBus Bus { get; set; } + + /// + /// A way to request the transport to defer the processing of a message + /// + public IDeferMessages MessageDeferrer { get; set; } + + readonly ILog logger = LogManager.GetLogger(typeof(SagaDispatcherFactory)); + + } +} diff --git a/src/NServiceBus.Core/Sagas/Sagas.cs b/src/NServiceBus.Core/Sagas/Sagas.cs new file mode 100644 index 00000000000..a589529b616 --- /dev/null +++ b/src/NServiceBus.Core/Sagas/Sagas.cs @@ -0,0 +1,410 @@ +namespace NServiceBus.Features +{ + using System; + using System.Collections.Generic; + using System.Reflection; + using Config; + using Logging; + using NServiceBus.Sagas; + using NServiceBus.Sagas.Finders; + using Saga; + + public class Sagas : Feature + { + public override void Initialize() + { + Configure.Component(DependencyLifecycle.SingleInstance); + + var sagasFound = FindAndConfigureSagasIn(Configure.TypesToScan); + + if (sagasFound) + { + InfrastructureServices.Enable(); + + Logger.InfoFormat("Sagas found in scanned types, saga persister enabled"); + } + else + { + Logger.InfoFormat("The saga feature was enabled but no saga implementations could be found. No need to enable the configured saga persister"); + } + } + + /// + /// Scans for types relevant to the saga infrastructure. + /// These include implementers of and . + /// + /// + public bool FindAndConfigureSagasIn(IEnumerable types) + { + var sagasWereFound = false; + + foreach (Type t in types) + { + if (IsSagaType(t)) + { + Configure.Component(t, DependencyLifecycle.InstancePerCall); + ConfigureSaga(t); + sagasWereFound = true; + continue; + } + + if (IsFinderType(t)) + { + Configure.Component(t, DependencyLifecycle.InstancePerCall); + ConfigureFinder(t); + continue; + } + + if (IsSagaNotFoundHandler(t)) + { + Configure.Component(t, DependencyLifecycle.InstancePerCall); + continue; + } + } + + CreateAdditionalFindersAsNecessary(); + + return sagasWereFound; + } + + internal static void ConfigureHowToFindSagaWithMessage(Type sagaType, PropertyInfo sagaProp, Type messageType, PropertyInfo messageProp) + { + IDictionary> messageToProperties; + SagaEntityToMessageToPropertyLookup.TryGetValue(sagaType, out messageToProperties); + + if (messageToProperties == null) + { + messageToProperties = new Dictionary>(); + SagaEntityToMessageToPropertyLookup[sagaType] = messageToProperties; + } + + messageToProperties[messageType] = new KeyValuePair(sagaProp, messageProp); + } + + private static readonly IDictionary>> SagaEntityToMessageToPropertyLookup = new Dictionary>>(); + + /// + /// Creates an for each saga type that doesn't have a finder configured. + /// + private void CreateAdditionalFindersAsNecessary() + { + foreach (Type sagaEntityType in SagaEntityToMessageToPropertyLookup.Keys) + foreach (Type messageType in SagaEntityToMessageToPropertyLookup[sagaEntityType].Keys) + { + var pair = SagaEntityToMessageToPropertyLookup[sagaEntityType][messageType]; + CreatePropertyFinder(sagaEntityType, messageType, pair.Key, pair.Value); + } + + foreach (Type sagaType in SagaTypeToSagaEntityTypeLookup.Keys) + { + Type sagaEntityType = SagaTypeToSagaEntityTypeLookup[sagaType]; + + + Type nullFinder = typeof(NullSagaFinder<>).MakeGenericType(sagaEntityType); + Configure.Component(nullFinder, DependencyLifecycle.InstancePerCall); + ConfigureFinder(nullFinder); + + Type sagaHeaderIdFinder = typeof(HeaderSagaIdFinder<>).MakeGenericType(sagaEntityType); + Configure.Component(sagaHeaderIdFinder, DependencyLifecycle.InstancePerCall); + ConfigureFinder(sagaHeaderIdFinder); + } + } + + private void CreatePropertyFinder(Type sagaEntityType, Type messageType, PropertyInfo sagaProperty, PropertyInfo messageProperty) + { + Type finderType = typeof(PropertySagaFinder<,>).MakeGenericType(sagaEntityType, messageType); + + Configure.Component(finderType, DependencyLifecycle.InstancePerCall) + .ConfigureProperty("SagaProperty", sagaProperty) + .ConfigureProperty("MessageProperty", messageProperty); + + ConfigureFinder(finderType); + } + + + /// + /// Gets the saga type to instantiate and invoke if an existing saga couldn't be found by + /// the given finder using the given message. + /// + /// + /// + /// + public static Type GetSagaTypeToStartIfMessageNotFoundByFinder(object message, IFinder finder) + { + Type sagaEntityType; + FinderTypeToSagaEntityTypeLookup.TryGetValue(finder.GetType(), out sagaEntityType); + + if (sagaEntityType == null) + return null; + + Type sagaType; + SagaEntityTypeToSagaTypeLookup.TryGetValue(sagaEntityType, out sagaType); + + if (sagaType == null) + return null; + + List messageTypes; + SagaTypeToMessagTypesRequiringSagaStartLookup.TryGetValue(sagaType, out messageTypes); + + if (messageTypes == null) + return null; + + if (messageTypes.Contains(message.GetType())) + return sagaType; + + foreach (Type msgTypeHandleBySaga in messageTypes) + if (msgTypeHandleBySaga.IsInstanceOfType(message)) + return sagaType; + + return null; + } + + /// + /// Returns the saga type configured for the given entity type. + /// + /// + /// + public static Type GetSagaTypeForSagaEntityType(Type sagaEntityType) + { + Type result; + SagaEntityTypeToSagaTypeLookup.TryGetValue(sagaEntityType, out result); + + return result; + } + + /// + /// Returns the entity type configured for the given saga type. + /// + /// + /// + public static Type GetSagaEntityTypeForSagaType(Type sagaType) + { + Type result; + SagaTypeToSagaEntityTypeLookup.TryGetValue(sagaType, out result); + + return result; + } + + /// + /// Gets a reference to the generic "FindBy" method of the given finder + /// for the given message type using a hashtable lookup rather than reflection. + /// + /// + /// + /// + public static MethodInfo GetFindByMethodForFinder(IFinder finder, object message) + { + MethodInfo result = null; + + IDictionary methods; + FinderTypeToMessageToMethodInfoLookup.TryGetValue(finder.GetType(), out methods); + + if (methods != null) + { + methods.TryGetValue(message.GetType(), out result); + + if (result == null) + foreach (Type messageType in methods.Keys) + if (messageType.IsInstanceOfType(message)) + result = methods[messageType]; + } + + return result; + } + + /// + /// Returns a list of finder object capable of using the given message. + /// + /// + /// + public static IEnumerable GetFindersFor(object m) + { + foreach (Type finderType in FinderTypeToMessageToMethodInfoLookup.Keys) + { + var messageToMethodInfo = FinderTypeToMessageToMethodInfoLookup[finderType]; + if (messageToMethodInfo.ContainsKey(m.GetType())) + { + yield return finderType; + continue; + } + + foreach (Type messageType in messageToMethodInfo.Keys) + if (messageType.IsInstanceOfType(m)) + yield return finderType; + } + } + + /// + /// Returns the list of saga types configured. + /// + /// + public static IEnumerable GetSagaDataTypes() + { + return SagaTypeToSagaEntityTypeLookup.Values; + } + + public static bool IsSagaType(Type t) + { + return IsCompatible(t, typeof(ISaga)); + } + + static bool IsFinderType(Type t) + { + return IsCompatible(t, typeof(IFinder)); + } + + static bool IsSagaNotFoundHandler(Type t) + { + return IsCompatible(t, typeof(IHandleSagaNotFound)); + } + + static bool IsCompatible(Type t, Type source) + { + return source.IsAssignableFrom(t) && t != source && !t.IsAbstract && !t.IsInterface && !t.IsGenericType; + } + + static void ConfigureSaga(Type t) + { + foreach (Type messageType in GetMessageTypesHandledBySaga(t)) + MapMessageTypeToSagaType(messageType, t); + + foreach (Type messageType in GetMessageTypesThatRequireStartingTheSaga(t)) + MessageTypeRequiresStartingSaga(messageType, t); + + PropertyInfo prop = t.GetProperty("Data"); + MapSagaTypeToSagaEntityType(t, prop.PropertyType); + + if (!typeof(IConfigurable).IsAssignableFrom(t)) + return; + + var defaultConstructor = t.GetConstructor(Type.EmptyTypes); + if (defaultConstructor == null) + throw new InvalidOperationException("Sagas which implement IConfigurable, like those which inherit from Saga, must have a default constructor."); + + var saga = Activator.CreateInstance(t) as ISaga; + + var p = t.GetProperty("SagaMessageFindingConfiguration", typeof(IConfigureHowToFindSagaWithMessage)); + if (p != null) + p.SetValue(saga, SagaMessageFindingConfiguration, null); + + if (saga is IConfigurable) + (saga as IConfigurable).Configure(); + } + + + static void ConfigureFinder(Type t) + { + foreach (Type interfaceType in t.GetInterfaces()) + { + Type[] args = interfaceType.GetGenericArguments(); + if (args.Length != 2) + continue; + + Type sagaEntityType = null; + Type messageType = null; + foreach (Type typ in args) + { + if (typeof(IContainSagaData).IsAssignableFrom(typ)) + sagaEntityType = typ; + + if (MessageConventionExtensions.IsMessageType(typ) || typ == typeof(object)) + messageType = typ; + } + + if (sagaEntityType == null || messageType == null) + continue; + + Type finderType = typeof(IFindSagas<>.Using<>).MakeGenericType(sagaEntityType, messageType); + if (!finderType.IsAssignableFrom(t)) + continue; + + FinderTypeToSagaEntityTypeLookup[t] = sagaEntityType; + + MethodInfo method = t.GetMethod("FindBy", new[] { messageType }); + + IDictionary methods; + FinderTypeToMessageToMethodInfoLookup.TryGetValue(t, out methods); + + if (methods == null) + { + methods = new Dictionary(); + FinderTypeToMessageToMethodInfoLookup[t] = methods; + } + + methods[messageType] = method; + } + } + + static IEnumerable GetMessageTypesHandledBySaga(Type sagaType) + { + return GetMessagesCorrespondingToFilterOnSaga(sagaType, typeof(IHandleMessages<>)); + } + + static IEnumerable GetMessageTypesThatRequireStartingTheSaga(Type sagaType) + { + return GetMessagesCorrespondingToFilterOnSaga(sagaType, typeof(IAmStartedByMessages<>)); + } + + static IEnumerable GetMessagesCorrespondingToFilterOnSaga(Type sagaType, Type filter) + { + foreach (Type interfaceType in sagaType.GetInterfaces()) + { + Type[] types = interfaceType.GetGenericArguments(); + foreach (Type arg in types) + if (MessageConventionExtensions.IsMessageType(arg)) + if (filter.MakeGenericType(arg) == interfaceType) + yield return arg; + } + } + + static void MapMessageTypeToSagaType(Type messageType, Type sagaType) + { + List sagas; + MessageTypeToSagaTypesLookup.TryGetValue(messageType, out sagas); + + if (sagas == null) + { + sagas = new List(1); + MessageTypeToSagaTypesLookup[messageType] = sagas; + } + + if (!sagas.Contains(sagaType)) + sagas.Add(sagaType); + } + + static void MapSagaTypeToSagaEntityType(Type sagaType, Type sagaEntityType) + { + SagaTypeToSagaEntityTypeLookup[sagaType] = sagaEntityType; + SagaEntityTypeToSagaTypeLookup[sagaEntityType] = sagaType; + } + + static void MessageTypeRequiresStartingSaga(Type messageType, Type sagaType) + { + List messages; + SagaTypeToMessagTypesRequiringSagaStartLookup.TryGetValue(sagaType, out messages); + + if (messages == null) + { + messages = new List(1); + SagaTypeToMessagTypesRequiringSagaStartLookup[sagaType] = messages; + } + + if (!messages.Contains(messageType)) + messages.Add(messageType); + } + + readonly static IDictionary> MessageTypeToSagaTypesLookup = new Dictionary>(); + + static readonly IDictionary SagaEntityTypeToSagaTypeLookup = new Dictionary(); + static readonly IDictionary SagaTypeToSagaEntityTypeLookup = new Dictionary(); + + static readonly IDictionary FinderTypeToSagaEntityTypeLookup = new Dictionary(); + static readonly IDictionary> FinderTypeToMessageToMethodInfoLookup = new Dictionary>(); + + static readonly IDictionary> SagaTypeToMessagTypesRequiringSagaStartLookup = new Dictionary>(); + + static readonly IConfigureHowToFindSagaWithMessage SagaMessageFindingConfiguration = new ConfigureHowToFindSagaWithMessageDispatcher(); + + static readonly ILog Logger = LogManager.GetLogger(typeof(ReplyingToNullOriginatorDispatcher)); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Satellites/Config/SatelliteContext.cs b/src/NServiceBus.Core/Satellites/Config/SatelliteContext.cs new file mode 100644 index 00000000000..1ee0d544d07 --- /dev/null +++ b/src/NServiceBus.Core/Satellites/Config/SatelliteContext.cs @@ -0,0 +1,16 @@ +namespace NServiceBus.Satellites.Config +{ + using Unicast.Transport; + + public class SatelliteContext + { + internal SatelliteContext() + { + Instance = null; + Transport = null; + } + + public TransportReceiver Transport { get; set; } + public ISatellite Instance { get; set; } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Satellites/IAdvancedSatellite.cs b/src/NServiceBus.Core/Satellites/IAdvancedSatellite.cs new file mode 100644 index 00000000000..16665ba2b49 --- /dev/null +++ b/src/NServiceBus.Core/Satellites/IAdvancedSatellite.cs @@ -0,0 +1,17 @@ +namespace NServiceBus.Satellites +{ + using System; + using Unicast.Transport; + + /// + /// Interface for satellites that needs more control over how the receiver is beeing setup + /// + public interface IAdvancedSatellite : ISatellite + { + /// + /// Gets the customizations to apply to the receiver + /// + /// + Action GetReceiverCustomization(); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Satellites/ISatellite.cs b/src/NServiceBus.Core/Satellites/ISatellite.cs new file mode 100644 index 00000000000..d0bdd7607d1 --- /dev/null +++ b/src/NServiceBus.Core/Satellites/ISatellite.cs @@ -0,0 +1,34 @@ +namespace NServiceBus.Satellites +{ + /// + /// Implement this interface to create a Satellite. + /// + public interface ISatellite + { + /// + /// This method is called when a message is available to be processed. + /// + /// The received. + bool Handle(TransportMessage message); + + /// + /// The for this to use when receiving messages. + /// + Address InputAddress { get; } + + /// + /// Set to true to disable this . + /// + bool Disabled { get; } + + /// + /// Starts the . + /// + void Start(); + + /// + /// Stops the . + /// + void Stop(); + } +} diff --git a/src/NServiceBus.Core/Satellites/SatelliteLauncher.cs b/src/NServiceBus.Core/Satellites/SatelliteLauncher.cs new file mode 100644 index 00000000000..4534ac6d92b --- /dev/null +++ b/src/NServiceBus.Core/Satellites/SatelliteLauncher.cs @@ -0,0 +1,125 @@ +namespace NServiceBus.Satellites +{ + using System; + using System.Linq; + using System.Collections.Generic; + using System.Threading.Tasks; + using Config; + using Logging; + using ObjectBuilder; + using Unicast.Transport; + + public class SatelliteLauncher : IWantToRunWhenBusStartsAndStops + { + public IBuilder Builder { get; set; } + + public void Start() + { + var satellitesList = Configure.Instance.Builder + .BuildAll() + .ToList() + .Where(s => !s.Disabled) + .ToList(); + + var satelliteContexts = new SatelliteContext[satellitesList.Count]; + + Parallel.For(0, satellitesList.Count, index => + { + var satellite = satellitesList[index]; + + Logger.DebugFormat("Starting {1}/{2} '{0}' satellite", satellite.GetType().AssemblyQualifiedName, + index + 1, satellitesList.Count); + + var ctx = new SatelliteContext + { + Instance = satellite + }; + + if (satellite.InputAddress != null) + { + ctx.Transport = Builder.Build(); + + var advancedSatellite = satellite as IAdvancedSatellite; + if (advancedSatellite != null) + { + var receiverCustomization = advancedSatellite.GetReceiverCustomization(); + + receiverCustomization(ctx.Transport); + } + } + + StartSatellite(ctx); + + satelliteContexts[index] = ctx; + + Logger.InfoFormat("Started {1}/{2} '{0}' satellite", satellite.GetType().AssemblyQualifiedName, + index + 1, satellitesList.Count); + + }); + + satellites.AddRange(satelliteContexts); + } + + public void Stop() + { + Parallel.ForEach(satellites, (ctx, state, index) => + { + Logger.DebugFormat("Stopping {1}/{2} '{0}' satellite", ctx.Instance.GetType().AssemblyQualifiedName, + index + 1, satellites.Count); + + if (ctx.Transport != null) + { + ctx.Transport.Stop(); + } + + ctx.Instance.Stop(); + + Logger.InfoFormat("Stopped {1}/{2} '{0}' satellite", ctx.Instance.GetType().AssemblyQualifiedName, + index + 1, satellites.Count); + }); + } + + void HandleMessageReceived(object sender, TransportMessageReceivedEventArgs e, ISatellite satellite) + { + if (!satellite.Handle(e.Message)) + { + ((ITransport) sender).AbortHandlingCurrentMessage(); + } + } + + void StartSatellite(SatelliteContext ctx) + { + Logger.DebugFormat("Starting satellite {0} for {1}.", ctx.Instance.GetType().AssemblyQualifiedName, + ctx.Instance.InputAddress); + + try + { + if (ctx.Transport != null) + { + ctx.Transport.TransportMessageReceived += (o, e) => HandleMessageReceived(o, e, ctx.Instance); + ctx.Transport.Start(ctx.Instance.InputAddress); + } + else + { + Logger.DebugFormat("No input queue configured for {0}", ctx.Instance.GetType().AssemblyQualifiedName); + } + + ctx.Instance.Start(); + } + catch (Exception ex) + { + Logger.Error( + string.Format("Satellite {0} failed to start.", ctx.Instance.GetType().AssemblyQualifiedName), ex); + + if (ctx.Transport != null) + { + ctx.Transport.ChangeMaximumConcurrencyLevel(0); + } + } + } + + static readonly ILog Logger = LogManager.GetLogger(typeof (SatelliteLauncher)); + + readonly List satellites = new List(); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Satellites/SatellitesQueuesCreator.cs b/src/NServiceBus.Core/Satellites/SatellitesQueuesCreator.cs new file mode 100644 index 00000000000..eeabf2e0a50 --- /dev/null +++ b/src/NServiceBus.Core/Satellites/SatellitesQueuesCreator.cs @@ -0,0 +1,42 @@ +namespace NServiceBus.Satellites +{ + using System.Linq; + using Installation; + using Installation.Environments; + using Settings; + using Transports; + + /// + /// Responsible to create a queue, using the registered ICreateQueues for each satellite + /// + public class SatellitesQueuesCreator : INeedToInstallSomething + { + public ICreateQueues QueueCreator { get; set; } + + /// + /// Performs the installation providing permission for the given user. + /// + /// The user for whom permissions will be given. + public void Install(string identity) + { + if (SettingsHolder.Get("Endpoint.SendOnly")) + { + return; + } + + if (ConfigureQueueCreation.DontCreateQueues) + { + return; + } + + var satellites = Configure.Instance.Builder + .BuildAll() + .ToList(); + + foreach (var satellite in satellites.Where(satellite => !satellite.Disabled && satellite.InputAddress != null)) + { + QueueCreator.CreateQueueIfNecessary(satellite.InputAddress, identity); + } + } + } +} diff --git a/src/scheduling/NServiceBus.Scheduling/Schedule.cs b/src/NServiceBus.Core/Schedule.cs similarity index 88% rename from src/scheduling/NServiceBus.Scheduling/Schedule.cs rename to src/NServiceBus.Core/Schedule.cs index 2315e89db90..44e3fda0522 100644 --- a/src/scheduling/NServiceBus.Scheduling/Schedule.cs +++ b/src/NServiceBus.Core/Schedule.cs @@ -1,9 +1,8 @@ -using System; -using NServiceBus.Scheduling; -using ScheduledTask = NServiceBus.Scheduling.ScheduledTask; - namespace NServiceBus { + using System; + using Scheduling; + public class Schedule { private readonly IScheduler scheduler; diff --git a/src/scheduling/NServiceBus.Scheduling/Configuration/ConfigureScheduledTaskAsSystemMessages.cs b/src/NServiceBus.Core/Scheduling/Configuration/ConfigureScheduledTaskAsSystemMessages.cs similarity index 88% rename from src/scheduling/NServiceBus.Scheduling/Configuration/ConfigureScheduledTaskAsSystemMessages.cs rename to src/NServiceBus.Core/Scheduling/Configuration/ConfigureScheduledTaskAsSystemMessages.cs index d8350ccf431..3a44e1c150d 100644 --- a/src/scheduling/NServiceBus.Scheduling/Configuration/ConfigureScheduledTaskAsSystemMessages.cs +++ b/src/NServiceBus.Core/Scheduling/Configuration/ConfigureScheduledTaskAsSystemMessages.cs @@ -1,7 +1,7 @@ -using NServiceBus.Config.Conventions; - namespace NServiceBus.Scheduling.Configuration { + using Config.Conventions; + public class ConfigureScheduledTaskAsSystemMessages : IWantToRunBeforeConfiguration { public void Init() diff --git a/src/scheduling/NServiceBus.Scheduling/Configuration/SchedulerConfiguration.cs b/src/NServiceBus.Core/Scheduling/Configuration/SchedulerConfiguration.cs similarity index 93% rename from src/scheduling/NServiceBus.Scheduling/Configuration/SchedulerConfiguration.cs rename to src/NServiceBus.Core/Scheduling/Configuration/SchedulerConfiguration.cs index f142c741719..518db44bde3 100644 --- a/src/scheduling/NServiceBus.Scheduling/Configuration/SchedulerConfiguration.cs +++ b/src/NServiceBus.Core/Scheduling/Configuration/SchedulerConfiguration.cs @@ -1,5 +1,3 @@ -using NServiceBus.Config; - namespace NServiceBus.Scheduling.Configuration { public class SchedulerConfiguration : INeedInitialization diff --git a/src/NServiceBus.Core/Scheduling/DefaultScheduler.cs b/src/NServiceBus.Core/Scheduling/DefaultScheduler.cs new file mode 100644 index 00000000000..50f2d7b121b --- /dev/null +++ b/src/NServiceBus.Core/Scheduling/DefaultScheduler.cs @@ -0,0 +1,80 @@ +namespace NServiceBus.Scheduling +{ + using System; + using System.Diagnostics; + using System.Threading; + using System.Threading.Tasks; + using Logging; + + public class DefaultScheduler : IScheduler + { + static readonly ILog logger = LogManager.GetLogger(typeof(DefaultScheduler)); + + private readonly IBus bus; + private readonly IScheduledTaskStorage scheduledTaskStorage; + + public DefaultScheduler(IBus bus, IScheduledTaskStorage scheduledTaskStorage) + { + this.bus = bus; + this.scheduledTaskStorage = scheduledTaskStorage; + } + + public void Schedule(ScheduledTask task) + { + scheduledTaskStorage.Add(task); + logger.DebugFormat("Task {0}/{1} scheduled with timespan {2}", task.Name, task.Id, task.Every); + DeferTask(task); + } + + public void Start(Guid taskId) + { + var task = scheduledTaskStorage.Get(taskId); + + if (task == null) + { + logger.InfoFormat("Could not find any scheduled task {0} with with Id. The DefaultScheduler does not persist tasks between restarts.", taskId); + return; + } + + DeferTask(task); + ExecuteTask(task); + } + + private static void ExecuteTask(ScheduledTask scheduledTask) + { + logger.InfoFormat("Start executing scheduled task {0}", scheduledTask.Name); + var sw = new Stopwatch(); + sw.Start(); + + Task.Factory + .StartNew(scheduledTask.Task, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default) + .ContinueWith(task => + { + sw.Stop(); + + if (task.IsFaulted) + { + task.Exception.Handle(ex => + { + logger.Error(String.Format("Failed to execute scheduled task {0}", scheduledTask.Name), ex); + return true; + }); + } + else + { + logger.InfoFormat("Scheduled task {0} run for {1}", scheduledTask.Name, sw.Elapsed.ToString()); + } + }); + } + + private void DeferTask(ScheduledTask task) + { + bus.Defer(task.Every, new Messages.ScheduledTask + { + TaskId = task.Id, + Name = task.Name, + Every = task.Every + }); + } + } +} \ No newline at end of file diff --git a/src/scheduling/NServiceBus.Scheduling/IScheduledTaskStorage.cs b/src/NServiceBus.Core/Scheduling/IScheduledTaskStorage.cs similarity index 80% rename from src/scheduling/NServiceBus.Scheduling/IScheduledTaskStorage.cs rename to src/NServiceBus.Core/Scheduling/IScheduledTaskStorage.cs index 235ab4e5193..f3fd6cd6291 100644 --- a/src/scheduling/NServiceBus.Scheduling/IScheduledTaskStorage.cs +++ b/src/NServiceBus.Core/Scheduling/IScheduledTaskStorage.cs @@ -1,8 +1,8 @@ -using System; -using System.Collections.Generic; - namespace NServiceBus.Scheduling { + using System; + using System.Collections.Generic; + public interface IScheduledTaskStorage { void Add(ScheduledTask scheduledTask); diff --git a/src/scheduling/NServiceBus.Scheduling/IScheduler.cs b/src/NServiceBus.Core/Scheduling/IScheduler.cs similarity index 89% rename from src/scheduling/NServiceBus.Scheduling/IScheduler.cs rename to src/NServiceBus.Core/Scheduling/IScheduler.cs index 6f5bd599017..b0ad0e7c6e6 100644 --- a/src/scheduling/NServiceBus.Scheduling/IScheduler.cs +++ b/src/NServiceBus.Core/Scheduling/IScheduler.cs @@ -1,7 +1,7 @@ -using System; - namespace NServiceBus.Scheduling { + using System; + public interface IScheduler { void Schedule(ScheduledTask task); diff --git a/src/scheduling/NServiceBus.Scheduling/InMemoryScheduledTaskStorage.cs b/src/NServiceBus.Core/Scheduling/InMemoryScheduledTaskStorage.cs similarity index 87% rename from src/scheduling/NServiceBus.Scheduling/InMemoryScheduledTaskStorage.cs rename to src/NServiceBus.Core/Scheduling/InMemoryScheduledTaskStorage.cs index 92816fefb86..08e10994c7b 100644 --- a/src/scheduling/NServiceBus.Scheduling/InMemoryScheduledTaskStorage.cs +++ b/src/NServiceBus.Core/Scheduling/InMemoryScheduledTaskStorage.cs @@ -1,9 +1,9 @@ -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; - namespace NServiceBus.Scheduling { + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + public class InMemoryScheduledTaskStorage : IScheduledTaskStorage { protected readonly IDictionary scheduledTasks = new ConcurrentDictionary(); diff --git a/src/NServiceBus.Core/Scheduling/Messages/ScheduledTask.cs b/src/NServiceBus.Core/Scheduling/Messages/ScheduledTask.cs new file mode 100644 index 00000000000..3e1844e2298 --- /dev/null +++ b/src/NServiceBus.Core/Scheduling/Messages/ScheduledTask.cs @@ -0,0 +1,14 @@ +namespace NServiceBus.Scheduling.Messages +{ + using System; + + [Serializable] + public class ScheduledTask : IMessage + { + public Guid TaskId { get; set; } + + public string Name { get; set; } + + public TimeSpan Every { get; set; } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Scheduling/ScheduledTask.cs b/src/NServiceBus.Core/Scheduling/ScheduledTask.cs new file mode 100644 index 00000000000..894ee3b79b2 --- /dev/null +++ b/src/NServiceBus.Core/Scheduling/ScheduledTask.cs @@ -0,0 +1,17 @@ +namespace NServiceBus.Scheduling +{ + using System; + + public class ScheduledTask + { + public ScheduledTask() + { + Id = Guid.NewGuid(); + } + + public Guid Id { get; private set; } + public string Name { get; set; } + public Action Task { get; set; } + public TimeSpan Every { get; set; } + } +} \ No newline at end of file diff --git a/src/scheduling/NServiceBus.Scheduling/ScheduledTaskMessageHandler.cs b/src/NServiceBus.Core/Scheduling/ScheduledTaskMessageHandler.cs similarity index 91% rename from src/scheduling/NServiceBus.Scheduling/ScheduledTaskMessageHandler.cs rename to src/NServiceBus.Core/Scheduling/ScheduledTaskMessageHandler.cs index 640b61c8ee3..471c6fabefe 100644 --- a/src/scheduling/NServiceBus.Scheduling/ScheduledTaskMessageHandler.cs +++ b/src/NServiceBus.Core/Scheduling/ScheduledTaskMessageHandler.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Scheduling +namespace NServiceBus.Scheduling { public class ScheduledTaskMessageHandler : IHandleMessages { diff --git a/src/NServiceBus.Core/SecondLevelRetries/Config/ConfigureSecondLevelRetriesExtensions.cs b/src/NServiceBus.Core/SecondLevelRetries/Config/ConfigureSecondLevelRetriesExtensions.cs new file mode 100644 index 00000000000..5bdd2cd170c --- /dev/null +++ b/src/NServiceBus.Core/SecondLevelRetries/Config/ConfigureSecondLevelRetriesExtensions.cs @@ -0,0 +1,13 @@ +namespace NServiceBus +{ + public static class ConfigureSecondLevelRetriesExtensions + { + [ObsoleteEx(Replacement = "Configure.Features.Disable()", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public static Configure DisableSecondLevelRetries(this Configure config) + { + Configure.Features.Disable(); + + return config; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/SecondLevelRetries/Config/FeatureSettingsExtensions.cs b/src/NServiceBus.Core/SecondLevelRetries/Config/FeatureSettingsExtensions.cs new file mode 100644 index 00000000000..f8e2708eb05 --- /dev/null +++ b/src/NServiceBus.Core/SecondLevelRetries/Config/FeatureSettingsExtensions.cs @@ -0,0 +1,17 @@ +namespace NServiceBus +{ + using System; + using Features; + using SecondLevelRetries.Config; + + + public static class FeatureSettingsExtensions + { + public static FeatureSettings SecondLevelRetries(this FeatureSettings settings, Action customSettings) + { + customSettings(new SecondLevelRetriesSettings()); + + return settings; + } + } +} \ No newline at end of file diff --git a/src/management/retries/NServiceBus.Management.Retries/Config/SecondLevelRetriesConfig.cs b/src/NServiceBus.Core/SecondLevelRetries/Config/SecondLevelRetriesConfig.cs similarity index 88% rename from src/management/retries/NServiceBus.Management.Retries/Config/SecondLevelRetriesConfig.cs rename to src/NServiceBus.Core/SecondLevelRetries/Config/SecondLevelRetriesConfig.cs index 023be53d6d4..910973b9965 100644 --- a/src/management/retries/NServiceBus.Management.Retries/Config/SecondLevelRetriesConfig.cs +++ b/src/NServiceBus.Core/SecondLevelRetries/Config/SecondLevelRetriesConfig.cs @@ -1,11 +1,11 @@ -using System; -using System.Configuration; - namespace NServiceBus.Config { + using System; + using System.Configuration; + public class SecondLevelRetriesConfig : ConfigurationSection { - [ConfigurationProperty("Enabled", IsRequired = false)] + [ConfigurationProperty("Enabled", IsRequired = false,DefaultValue = true)] public bool Enabled { get @@ -18,7 +18,7 @@ public bool Enabled } } - [ConfigurationProperty("TimeIncrease", IsRequired = false)] + [ConfigurationProperty("TimeIncrease", IsRequired = false,DefaultValue = "00:00:10")] public TimeSpan TimeIncrease { get @@ -39,7 +39,7 @@ public TimeSpan TimeIncrease } } - [ConfigurationProperty("NumberOfRetries", IsRequired = false)] + [ConfigurationProperty("NumberOfRetries", IsRequired = false,DefaultValue=3)] public int NumberOfRetries { get diff --git a/src/NServiceBus.Core/SecondLevelRetries/Config/SecondLevelRetriesSettings.cs b/src/NServiceBus.Core/SecondLevelRetries/Config/SecondLevelRetriesSettings.cs new file mode 100644 index 00000000000..62c3b6d9814 --- /dev/null +++ b/src/NServiceBus.Core/SecondLevelRetries/Config/SecondLevelRetriesSettings.cs @@ -0,0 +1,18 @@ +namespace NServiceBus.SecondLevelRetries.Config +{ + using System; + using NServiceBus.Settings; + + public class SecondLevelRetriesSettings:ISetDefaultSettings + { + public SecondLevelRetriesSettings() + { + SettingsHolder.SetDefault("SecondLevelRetries.RetryPolicy", DefaultRetryPolicy.RetryPolicy); + } + + public void CustomRetryPolicy(Func customPolicy) + { + SettingsHolder.Set("SecondLevelRetries.RetryPolicy",customPolicy); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/SecondLevelRetries/DefaultRetryPolicy.cs b/src/NServiceBus.Core/SecondLevelRetries/DefaultRetryPolicy.cs new file mode 100644 index 00000000000..eb0fbb5a7c9 --- /dev/null +++ b/src/NServiceBus.Core/SecondLevelRetries/DefaultRetryPolicy.cs @@ -0,0 +1,51 @@ +namespace NServiceBus.SecondLevelRetries +{ + using System; + using Helpers; + + public static class DefaultRetryPolicy + { + public static int NumberOfRetries = 3; + public static TimeSpan TimeIncrease = TimeSpan.FromSeconds(10); + public static Func RetryPolicy = Validate; + + + static TimeSpan Validate(TransportMessage message) + { + if (HasReachedMaxTime(message)) + return TimeSpan.MinValue; + + var numberOfRetries = TransportMessageHelpers.GetNumberOfRetries(message); + + var timeToIncreaseInTicks = TimeIncrease.Ticks*(numberOfRetries + 1); + var timeIncrease = TimeSpan.FromTicks(timeToIncreaseInTicks); + + return numberOfRetries >= NumberOfRetries ? TimeSpan.MinValue : timeIncrease; + } + + static bool HasReachedMaxTime(TransportMessage message) + { + var timestampHeader = TransportMessageHelpers.GetHeader(message, SecondLevelRetriesHeaders.RetriesTimestamp); + + if (String.IsNullOrEmpty(timestampHeader)) + { + return false; + } + + try + { + var handledAt = DateTimeExtensions.ToUtcDateTime(timestampHeader); + + if (DateTime.UtcNow > handledAt.AddDays(1)) + { + return true; + } + } + catch (Exception) + { + } + + return false; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/SecondLevelRetries/Helpers/SecondLevelRetriesHeaders.cs b/src/NServiceBus.Core/SecondLevelRetries/Helpers/SecondLevelRetriesHeaders.cs new file mode 100644 index 00000000000..bb94791a2f4 --- /dev/null +++ b/src/NServiceBus.Core/SecondLevelRetries/Helpers/SecondLevelRetriesHeaders.cs @@ -0,0 +1,7 @@ +namespace NServiceBus.SecondLevelRetries.Helpers +{ + public static class SecondLevelRetriesHeaders + { + public const string RetriesTimestamp = "NServiceBus.Retries.Timestamp"; + } +} \ No newline at end of file diff --git a/src/management/retries/NServiceBus.Management.Retries/Helpers/TransportMessageHelpers.cs b/src/NServiceBus.Core/SecondLevelRetries/Helpers/TransportMessageHelpers.cs similarity index 85% rename from src/management/retries/NServiceBus.Management.Retries/Helpers/TransportMessageHelpers.cs rename to src/NServiceBus.Core/SecondLevelRetries/Helpers/TransportMessageHelpers.cs index 23c62129edb..d80690b3166 100644 --- a/src/management/retries/NServiceBus.Management.Retries/Helpers/TransportMessageHelpers.cs +++ b/src/NServiceBus.Core/SecondLevelRetries/Helpers/TransportMessageHelpers.cs @@ -1,62 +1,63 @@ -using System; -using NServiceBus.Unicast.Transport; -using NServiceBus.Utils; - -namespace NServiceBus.Management.Retries.Helpers -{ - public static class TransportMessageHelpers - { - public static Address GetAddressOfFaultingEndpoint(TransportMessage message) - { - var failedQ = GetHeader(message, Faults.FaultsHeaderKeys.FailedQ); - - if (string.IsNullOrEmpty(failedQ)) - { - failedQ = MessageHelpers.GetFailedQueueFromLabel(MsmqUtilities.Convert(message)); - } - - if (string.IsNullOrEmpty(failedQ)) - { - throw new Exception("Could not find address"); - } - - return Address.Parse(failedQ); - } - - public static string GetHeader(TransportMessage message, string key) - { - return message.Headers.ContainsKey(key) ? message.Headers[key] : null; - } - - public static bool HeaderExists(TransportMessage message, string key) - { - return message.Headers.ContainsKey(key); - } - - public static void SetHeader(TransportMessage message, string key, string value) - { - if (message.Headers.ContainsKey(key)) - { - message.Headers[key] = value; - } - else - { - message.Headers.Add(key, value); - } - } - - public static int GetNumberOfRetries(TransportMessage message) - { - string value; - if (message.Headers.TryGetValue(Headers.Retries, out value)) - { - int i; - if (int.TryParse(value, out i)) - { - return i; - } - } - return 0; - } - } -} \ No newline at end of file +namespace NServiceBus.SecondLevelRetries.Helpers +{ + using System; + using Faults; + using Faults.Forwarder; + using Transports.Msmq; + + public static class TransportMessageHelpers + { + public static Address GetAddressOfFaultingEndpoint(TransportMessage message) + { + var failedQ = GetHeader(message, FaultsHeaderKeys.FailedQ); + + if (string.IsNullOrEmpty(failedQ)) + { + failedQ = MessageHelpers.GetFailedQueueFromLabel(MsmqUtilities.Convert(message)); + } + + if (string.IsNullOrEmpty(failedQ)) + { + throw new Exception("Could not find address"); + } + + return Address.Parse(failedQ); + } + + public static string GetHeader(TransportMessage message, string key) + { + return message.Headers.ContainsKey(key) ? message.Headers[key] : null; + } + + public static bool HeaderExists(TransportMessage message, string key) + { + return message.Headers.ContainsKey(key); + } + + public static void SetHeader(TransportMessage message, string key, string value) + { + if (message.Headers.ContainsKey(key)) + { + message.Headers[key] = value; + } + else + { + message.Headers.Add(key, value); + } + } + + public static int GetNumberOfRetries(TransportMessage message) + { + string value; + if (message.Headers.TryGetValue(Headers.Retries, out value)) + { + int i; + if (int.TryParse(value, out i)) + { + return i; + } + } + return 0; + } + } +} diff --git a/src/NServiceBus.Core/SecondLevelRetries/SecondLevelRetries.cs b/src/NServiceBus.Core/SecondLevelRetries/SecondLevelRetries.cs new file mode 100644 index 00000000000..3a820cc6202 --- /dev/null +++ b/src/NServiceBus.Core/SecondLevelRetries/SecondLevelRetries.cs @@ -0,0 +1,93 @@ +namespace NServiceBus.Management.Retries +{ + using System; + using Settings; + + public class SecondLevelRetries + { + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Configure.Features.SecondLevelRetries(s => s.CustomRetryPolicy())")] + public static Func RetryPolicy + { + get { return SettingsHolder.Get("SecondLevelRetries.RetryPolicy") as Func; } + set { SettingsHolder.Set("SecondLevelRetries.RetryPolicy", value); } + } + } +} + +namespace NServiceBus.Features +{ + using System; + using Config; + using Faults.Forwarder; + using NServiceBus.SecondLevelRetries; + using Settings; + + + + public class SecondLevelRetries : Feature + { + public override bool ShouldBeEnabled() + { + // if we're not using the Fault Forwarder, we should act as if SLR is disabled + //this will change when we make SLR a first class citizen + if (!Configure.Instance.Configurer.HasComponent()) + { + return false; + } + var retriesConfig = Configure.GetConfigSection(); + + if (retriesConfig == null) + return true; + + if (retriesConfig.NumberOfRetries == 0) + return false; + + return retriesConfig.Enabled; + } + + public override bool IsEnabledByDefault + { + get + { + return true; + } + } + + public override void Initialize() + { + var retriesConfig = Configure.GetConfigSection(); + + SetUpRetryPolicy(retriesConfig); + + var processorAddress = Address.Parse(Configure.EndpointName).SubScope("Retries"); + + var useRemoteRetryProcessor = SettingsHolder.HasSetting("SecondLevelRetries.AddressOfRetryProcessor"); + if (useRemoteRetryProcessor) + { + processorAddress = SettingsHolder.Get
    ("SecondLevelRetries.AddressOfRetryProcessor"); + } + + Configure.Instance.Configurer.ConfigureProperty(fm => fm.RetriesErrorQueue, processorAddress); + Configure.Instance.Configurer.ConfigureProperty(rs => rs.InputAddress, processorAddress); + Configure.Instance.Configurer.ConfigureProperty(rs => rs.RetryPolicy, SettingsHolder.Get>("SecondLevelRetries.RetryPolicy")); + + if (useRemoteRetryProcessor) + { + Configure.Instance.Configurer.ConfigureProperty(rs => rs.Disabled, true); + } + } + + static void SetUpRetryPolicy(SecondLevelRetriesConfig retriesConfig) + { + if (retriesConfig == null) + return; + + DefaultRetryPolicy.NumberOfRetries = retriesConfig.NumberOfRetries; + + if (retriesConfig.TimeIncrease != TimeSpan.MinValue) + { + DefaultRetryPolicy.TimeIncrease = retriesConfig.TimeIncrease; + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/SecondLevelRetries/SecondLevelRetriesProcessor.cs b/src/NServiceBus.Core/SecondLevelRetries/SecondLevelRetriesProcessor.cs new file mode 100644 index 00000000000..69a4f1fa4b2 --- /dev/null +++ b/src/NServiceBus.Core/SecondLevelRetries/SecondLevelRetriesProcessor.cs @@ -0,0 +1,83 @@ +namespace NServiceBus.SecondLevelRetries +{ + using System; + using Helpers; + using Faults.Forwarder; + using Logging; + using Satellites; + using Transports; + using TransportMessageHelpers = Helpers.TransportMessageHelpers; + + public class SecondLevelRetriesProcessor : ISatellite + { + public ISendMessages MessageSender { get; set; } + public IDeferMessages MessageDeferrer { get; set; } + + public Address InputAddress { get; set; } + + public bool Disabled { get; set; } + + public FaultManager FaultManager { get; set; } + + public Func RetryPolicy { get; set; } + + public void Start() + { + } + + public void Stop() + { + } + + public bool Handle(TransportMessage message) + { + if (Disabled) + { + Logger.DebugFormat("The SecondLevelRetries satellite is invoked, but disabled. Sending message to error queue. Make sure that this behavior is expected!"); + SendToErrorQueue(message); + return true; + } + + var defer = RetryPolicy.Invoke(message); + + if (defer < TimeSpan.Zero) + { + SendToErrorQueue(message); + return true; + } + + Defer(defer, message); + + return true; + } + + void SendToErrorQueue(TransportMessage message) + { + Logger.ErrorFormat("SLR has failed to resolve the issue with message {0} and will be forwarded to the error queue at {1}", message.Id, FaultManager.ErrorQueue); + + message.Headers.Remove(Headers.Retries); + + MessageSender.Send(message, FaultManager.ErrorQueue); + } + + void Defer(TimeSpan defer, TransportMessage message) + { + var retryMessageAt = DateTime.UtcNow + defer; + + TransportMessageHelpers.SetHeader(message, Headers.Retries, (TransportMessageHelpers.GetNumberOfRetries(message) + 1).ToString()); + + var addressOfFaultingEndpoint = TransportMessageHelpers.GetAddressOfFaultingEndpoint(message); + + if (!TransportMessageHelpers.HeaderExists(message, SecondLevelRetriesHeaders.RetriesTimestamp)) + { + TransportMessageHelpers.SetHeader(message, SecondLevelRetriesHeaders.RetriesTimestamp, DateTimeExtensions.ToWireFormattedString(DateTime.UtcNow)); + } + + Logger.DebugFormat("Defer message and send it to {0}", addressOfFaultingEndpoint); + + MessageDeferrer.Defer(message, retryMessageAt, addressOfFaultingEndpoint); + } + + readonly ILog Logger = LogManager.GetLogger(typeof(SecondLevelRetriesProcessor)); + } +} diff --git a/src/NServiceBus.Core/Serializers/Binary/BinaryMessageSerializer.cs b/src/NServiceBus.Core/Serializers/Binary/BinaryMessageSerializer.cs new file mode 100644 index 00000000000..23dc5aae993 --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Binary/BinaryMessageSerializer.cs @@ -0,0 +1,68 @@ +namespace NServiceBus.Serializers.Binary +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Runtime.Serialization; + using System.Runtime.Serialization.Formatters.Binary; + using System.Xml.Linq; + + using Serialization; + + /// + /// Binary implementation of the message serializer. + /// + public class BinaryMessageSerializer : IMessageSerializer + { + public BinaryMessageSerializer() + { + var surrogateSelector = new SurrogateSelector(); + surrogateSelector.AddSurrogate(typeof(XDocument), new StreamingContext(StreamingContextStates.All), new XContainerSurrogate()); + surrogateSelector.AddSurrogate(typeof(XElement), new StreamingContext(StreamingContextStates.All), new XElementSurrogate()); + + binaryFormatter.SurrogateSelector = surrogateSelector; + } + + /// + /// Serializes the given set of messages into the given stream. + /// + /// Messages to serialize. + /// Stream for to be serialized into. + public void Serialize(object[] messages, Stream stream) + { + binaryFormatter.Serialize(stream, new List(messages)); + } + + /// + /// Deserializes from the given stream a set of messages. + /// + /// Stream that contains messages. + /// The list of message types to deserialize. If null the types must be inferred from the serialized data. + /// Deserialized messages. + public object[] Deserialize(Stream stream, IList messageTypes = null) + { + if (stream == null) + return null; + + var body = binaryFormatter.Deserialize(stream) as List; + + if (body == null) + return null; + + var result = new object[body.Count]; + + int i = 0; + foreach (object m in body) + result[i++] = m; + + return result; + } + + /// + /// Gets the content type into which this serializer serializes the content to + /// + public string ContentType { get{ return ContentTypes.Binary;}} + + readonly BinaryFormatter binaryFormatter = new BinaryFormatter(); + } +} diff --git a/src/NServiceBus.Core/Serializers/Binary/Config/BinarySerialization.cs b/src/NServiceBus.Core/Serializers/Binary/Config/BinarySerialization.cs new file mode 100644 index 00000000000..ddf6601181a --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Binary/Config/BinarySerialization.cs @@ -0,0 +1,13 @@ +namespace NServiceBus.Features +{ + using Serializers.Binary; + + public class BinarySerialization : Feature + { + public override void Initialize() + { + Configure.Component(DependencyLifecycle.SingleInstance); + Configure.Component(DependencyLifecycle.SingleInstance); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/Binary/Config/BinarySerializerConfigurationExtensions.cs b/src/NServiceBus.Core/Serializers/Binary/Config/BinarySerializerConfigurationExtensions.cs new file mode 100644 index 00000000000..5891f0b509e --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Binary/Config/BinarySerializerConfigurationExtensions.cs @@ -0,0 +1,20 @@ +namespace NServiceBus +{ + using Features; + using Settings; + + public static class BinarySerializerConfigurationExtensions + { + /// + /// Enables the binary message serializer + /// + /// + /// + public static SerializationSettings Binary(this SerializationSettings settings) + { + Feature.Enable(); + + return settings; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/Binary/Config/ConfigureBinarySerializer.cs b/src/NServiceBus.Core/Serializers/Binary/Config/ConfigureBinarySerializer.cs new file mode 100644 index 00000000000..7661ba09104 --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Binary/Config/ConfigureBinarySerializer.cs @@ -0,0 +1,22 @@ +namespace NServiceBus +{ + /// + /// Contains extension methods to NServiceBus.Configure. + /// + public static class ConfigureBinarySerializer + { + /// + /// Use binary serialization. + /// Note that this does not support interface-based messages. + /// + /// + /// + [ObsoleteEx(Replacement = "Configure.Serialization.Binary()", RemoveInVersion = "6.0", TreatAsErrorFromVersion = "5.0")] + public static Configure BinarySerializer(this Configure config) + { + Configure.Serialization.Binary(); + + return config; + } + } +} diff --git a/src/impl/Serializers/NServiceBus.Serializers.Binary/SimpleMessageMapper.cs b/src/NServiceBus.Core/Serializers/Binary/SimpleMessageMapper.cs similarity index 93% rename from src/impl/Serializers/NServiceBus.Serializers.Binary/SimpleMessageMapper.cs rename to src/NServiceBus.Core/Serializers/Binary/SimpleMessageMapper.cs index 4b2e453878e..a6a1e8fe37c 100644 --- a/src/impl/Serializers/NServiceBus.Serializers.Binary/SimpleMessageMapper.cs +++ b/src/NServiceBus.Core/Serializers/Binary/SimpleMessageMapper.cs @@ -1,9 +1,9 @@ -using System; -using System.Collections.Generic; -using NServiceBus.MessageInterfaces; - namespace NServiceBus.Serializers.Binary { + using System; + using System.Collections.Generic; + using MessageInterfaces; + /// /// Simple implementation of message mapper for binary serialization. /// diff --git a/src/NServiceBus.Core/Serializers/Binary/XContainerSurrogate.cs b/src/NServiceBus.Core/Serializers/Binary/XContainerSurrogate.cs new file mode 100644 index 00000000000..af7504079d6 --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Binary/XContainerSurrogate.cs @@ -0,0 +1,22 @@ +namespace NServiceBus.Serializers.Binary +{ + using System.IO; + using System.Runtime.Serialization; + using System.Xml.Linq; + + internal class XContainerSurrogate : ISerializationSurrogate + { + private const string FieldName = "_XDocument"; + + public void GetObjectData(object obj, SerializationInfo info, StreamingContext context) + { + XDocument document = (XDocument)obj; + info.AddValue(FieldName, document.ToString(SaveOptions.DisableFormatting)); + } + + public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector) + { + return XDocument.Load(new StringReader(info.GetString(FieldName))); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/Binary/XElementSurrogate.cs b/src/NServiceBus.Core/Serializers/Binary/XElementSurrogate.cs new file mode 100644 index 00000000000..1f464806005 --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Binary/XElementSurrogate.cs @@ -0,0 +1,22 @@ +namespace NServiceBus.Serializers.Binary +{ + using System.IO; + using System.Runtime.Serialization; + using System.Xml.Linq; + + internal class XElementSurrogate : ISerializationSurrogate + { + private const string FieldName = "_XElement"; + + public void GetObjectData(object obj, SerializationInfo info, StreamingContext context) + { + XElement document = (XElement)obj; + info.AddValue(FieldName, document.ToString(SaveOptions.DisableFormatting)); + } + + public object SetObjectData(object obj, SerializationInfo info, StreamingContext context, ISurrogateSelector selector) + { + return XElement.Load(new StringReader(info.GetString(FieldName))); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/Json/BsonMessageSerializer.cs b/src/NServiceBus.Core/Serializers/Json/BsonMessageSerializer.cs new file mode 100644 index 00000000000..bf029cde35c --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Json/BsonMessageSerializer.cs @@ -0,0 +1,37 @@ +namespace NServiceBus.Serializers.Json +{ + using System; + using System.IO; + using MessageInterfaces; + using Newtonsoft.Json; + using Newtonsoft.Json.Bson; + + /// + /// BSON message serializer. + /// + public class BsonMessageSerializer : JsonMessageSerializerBase + { + /// + /// Constructor + /// + /// + public BsonMessageSerializer(IMessageMapper messageMapper): base(messageMapper) + { + } + + protected override JsonWriter CreateJsonWriter(Stream stream) + { + return new BsonWriter(stream); + } + + protected override JsonReader CreateJsonReader(Stream stream) + { + return new BsonReader(stream, true, DateTimeKind.Unspecified); + } + + protected override string GetContentType() + { + return ContentTypes.Bson; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/Json/Config/BsonSerialization.cs b/src/NServiceBus.Core/Serializers/Json/Config/BsonSerialization.cs new file mode 100644 index 00000000000..f1c05e2dfad --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Json/Config/BsonSerialization.cs @@ -0,0 +1,14 @@ +namespace NServiceBus.Features +{ + using MessageInterfaces.MessageMapper.Reflection; + using Serializers.Json; + + public class BsonSerialization : Feature + { + public override void Initialize() + { + Configure.Component(DependencyLifecycle.SingleInstance); + Configure.Component(DependencyLifecycle.SingleInstance); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/Json/Config/ConfigureJsonSerializer.cs b/src/NServiceBus.Core/Serializers/Json/Config/ConfigureJsonSerializer.cs new file mode 100644 index 00000000000..e939e1ab8c2 --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Json/Config/ConfigureJsonSerializer.cs @@ -0,0 +1,20 @@ +namespace NServiceBus +{ + public static class ConfigureJsonSerializer + { + [ObsoleteEx(Replacement = "Configure.Serialization.Json()", RemoveInVersion = "6.0", TreatAsErrorFromVersion = "5.0")] + public static Configure JsonSerializer(this Configure config) + { + Configure.Serialization.Json(); + + return config; + } + + [ObsoleteEx(Replacement = "Configure.Serialization.Bson()", RemoveInVersion = "6.0", TreatAsErrorFromVersion = "5.0")] + public static Configure BsonSerializer(this Configure config) + { + Configure.Serialization.Bson(); + return config; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/Json/Config/JsonSerialization.cs b/src/NServiceBus.Core/Serializers/Json/Config/JsonSerialization.cs new file mode 100644 index 00000000000..4fe61858351 --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Json/Config/JsonSerialization.cs @@ -0,0 +1,16 @@ +namespace NServiceBus.Features +{ + using MessageInterfaces.MessageMapper.Reflection; + using Serializers.Json; + using Settings; + + public class JsonSerialization : Feature + { + public override void Initialize() + { + Configure.Component(DependencyLifecycle.SingleInstance); + Configure.Component(DependencyLifecycle.SingleInstance) + .ConfigureProperty(s => s.SkipArrayWrappingForSingleMessages, !SettingsHolder.GetOrDefault("SerializationSettings.WrapSingleMessages")); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/Json/Config/JsonSerializerConfigurationExtensions.cs b/src/NServiceBus.Core/Serializers/Json/Config/JsonSerializerConfigurationExtensions.cs new file mode 100644 index 00000000000..c714b2c4007 --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Json/Config/JsonSerializerConfigurationExtensions.cs @@ -0,0 +1,32 @@ +namespace NServiceBus +{ + using Features; + using Settings; + + public static class JsonSerializerConfigurationExtensions + { + /// + /// Enables the json message serializer + /// + /// + /// + public static SerializationSettings Json(this SerializationSettings settings) + { + Feature.Enable(); + + return settings; + } + + /// + /// Enables the bson message serializer + /// + /// + /// + public static SerializationSettings Bson(this SerializationSettings settings) + { + Feature.Enable(); + + return settings; + } + } +} \ No newline at end of file diff --git a/src/impl/Serializers/NServiceBus.Serializers.Json/Internal/MessageContractResolver.cs b/src/NServiceBus.Core/Serializers/Json/Internal/MessageContractResolver.cs similarity index 90% rename from src/impl/Serializers/NServiceBus.Serializers.Json/Internal/MessageContractResolver.cs rename to src/NServiceBus.Core/Serializers/Json/Internal/MessageContractResolver.cs index 4e59eb1a381..e043bb10eee 100644 --- a/src/impl/Serializers/NServiceBus.Serializers.Json/Internal/MessageContractResolver.cs +++ b/src/NServiceBus.Core/Serializers/Json/Internal/MessageContractResolver.cs @@ -1,9 +1,9 @@ -using System; -using NServiceBus.MessageInterfaces; -using Newtonsoft.Json.Serialization; - namespace NServiceBus.Serializers.Json.Internal { + using System; + using MessageInterfaces; + using Newtonsoft.Json.Serialization; + public class MessageContractResolver : DefaultContractResolver { private readonly IMessageMapper _messageMapper; diff --git a/src/impl/Serializers/NServiceBus.Serializers.Json/Internal/MessageSerializationBinder.cs b/src/NServiceBus.Core/Serializers/Json/Internal/MessageSerializationBinder.cs similarity index 91% rename from src/impl/Serializers/NServiceBus.Serializers.Json/Internal/MessageSerializationBinder.cs rename to src/NServiceBus.Core/Serializers/Json/Internal/MessageSerializationBinder.cs index 8b31fa333f9..fce77c51afc 100644 --- a/src/impl/Serializers/NServiceBus.Serializers.Json/Internal/MessageSerializationBinder.cs +++ b/src/NServiceBus.Core/Serializers/Json/Internal/MessageSerializationBinder.cs @@ -1,9 +1,9 @@ -using System; -using System.Runtime.Serialization; -using NServiceBus.MessageInterfaces; - namespace NServiceBus.Serializers.Json.Internal { + using System; + using System.Runtime.Serialization; + using MessageInterfaces; + public class MessageSerializationBinder : SerializationBinder { private readonly IMessageMapper _messageMapper; diff --git a/src/NServiceBus.Core/Serializers/Json/Internal/XContainerConverter.cs b/src/NServiceBus.Core/Serializers/Json/Internal/XContainerConverter.cs new file mode 100644 index 00000000000..5044434b770 --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Json/Internal/XContainerConverter.cs @@ -0,0 +1,66 @@ +namespace NServiceBus.Serializers.Json.Internal +{ + using System; + using System.Globalization; + using System.IO; + using System.Xml.Linq; + + using Newtonsoft.Json; + + public class XContainerConverter : JsonConverter + { + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + if(value == null) + { + writer.WriteNull(); + } + + var container = (XContainer)value; + + writer.WriteValue(container.ToString(SaveOptions.DisableFormatting)); + } + + public override object ReadJson( + JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + if (reader.TokenType == JsonToken.Null) + { + return null; + } + + if (reader.TokenType != JsonToken.String) + { + throw new Exception( + string.Format( + CultureInfo.InvariantCulture, + "Unexpected token or value when parsing XContainer. Token: {0}, Value: {1}", + reader.TokenType, + reader.Value)); + } + + string value = (string)reader.Value; + if (objectType == typeof(XDocument)) + { + try + { + return XDocument.Load(new StringReader(value)); + } + catch (Exception ex) + { + throw new Exception( + string.Format( + CultureInfo.InvariantCulture, "Error parsing XContainer string: {0}", reader.Value), + ex); + } + } + + return XElement.Load(new StringReader(value)); + } + + public override bool CanConvert(Type objectType) + { + return typeof(XContainer).IsAssignableFrom(objectType); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/Json/JsonMessageSerializer.cs b/src/NServiceBus.Core/Serializers/Json/JsonMessageSerializer.cs new file mode 100644 index 00000000000..38045c010f9 --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Json/JsonMessageSerializer.cs @@ -0,0 +1,55 @@ +namespace NServiceBus.Serializers.Json +{ + using System; + using System.IO; + using System.Text; + using MessageInterfaces; + using Newtonsoft.Json; + + /// + /// JSON message serializer. + /// + public class JsonMessageSerializer : JsonMessageSerializerBase + { + /// + /// Constructor. + /// + /// + public JsonMessageSerializer(IMessageMapper messageMapper) + : base(messageMapper) + { + } + + protected override JsonWriter CreateJsonWriter(Stream stream) + { + var streamWriter = new StreamWriter(stream, Encoding.UTF8); + return new JsonTextWriter(streamWriter) {Formatting = Formatting.None}; + } + + protected override JsonReader CreateJsonReader(Stream stream) + { + var streamReader = new StreamReader(stream, Encoding.UTF8); + return new JsonTextReader(streamReader); + } + + public T DeserializeObject(string value) + { + return JsonConvert.DeserializeObject(value); + } + + public object DeserializeObject(string value, Type type) + { + return JsonConvert.DeserializeObject(value, type); + } + + public string SerializeObject(object value) + { + return JsonConvert.SerializeObject(value); + } + + protected override string GetContentType() + { + return ContentTypes.Json; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/Json/JsonMessageSerializerBase.cs b/src/NServiceBus.Core/Serializers/Json/JsonMessageSerializerBase.cs new file mode 100644 index 00000000000..8f985ba56db --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Json/JsonMessageSerializerBase.cs @@ -0,0 +1,114 @@ +namespace NServiceBus.Serializers.Json +{ + using System.Globalization; + using System.IO; + using System.Runtime.Serialization.Formatters; + using Internal; + using MessageInterfaces; + using Newtonsoft.Json; + using Newtonsoft.Json.Converters; + using Serialization; + using System; + using System.Collections.Generic; + using System.Linq; + + /// + /// JSON and BSON base class for . + /// + public abstract class JsonMessageSerializerBase : IMessageSerializer + { + private readonly IMessageMapper messageMapper; + + readonly JsonSerializerSettings serializerSettings = new JsonSerializerSettings + { + TypeNameAssemblyFormat = FormatterAssemblyStyle.Simple, + TypeNameHandling = TypeNameHandling.Auto, + Converters = { new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.RoundtripKind }, new XContainerConverter() } + }; + + protected JsonMessageSerializerBase(IMessageMapper messageMapper) + { + this.messageMapper = messageMapper; + } + + /// + /// Removes the wrapping array if serializing a single message + /// + public bool SkipArrayWrappingForSingleMessages { get; set; } + + /// + /// Serializes the given set of messages into the given stream. + /// + /// Messages to serialize. + /// Stream for to be serialized into. + public void Serialize(object[] messages, Stream stream) + { + var jsonSerializer = JsonSerializer.Create(serializerSettings); + jsonSerializer.Binder = new MessageSerializationBinder(messageMapper); + + var jsonWriter = CreateJsonWriter(stream); + + if (SkipArrayWrappingForSingleMessages && messages.Length == 1) + jsonSerializer.Serialize(jsonWriter, messages[0]); + else + jsonSerializer.Serialize(jsonWriter, messages); + + jsonWriter.Flush(); + } + + /// + /// Deserializes from the given stream a set of messages. + /// + /// Stream that contains messages. + /// The list of message types to deserialize. If null the types must be inferred from the serialized data. + /// Deserialized messages. + public object[] Deserialize(Stream stream, IList messageTypes = null) + { + var settings = serializerSettings; + + var dynamicTypeToSerializeTo = messageTypes != null ? messageTypes.FirstOrDefault(t => t.IsInterface) : null; + if (dynamicTypeToSerializeTo != null) + { + settings = new JsonSerializerSettings{ + TypeNameAssemblyFormat = FormatterAssemblyStyle.Simple, + TypeNameHandling = TypeNameHandling.None, + Converters = { new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.RoundtripKind }, new XContainerConverter() } + }; + } + + JsonSerializer jsonSerializer = JsonSerializer.Create(settings); + jsonSerializer.ContractResolver = new MessageContractResolver(messageMapper); + + var reader = CreateJsonReader(stream); + reader.Read(); + + var firstTokenType = reader.TokenType; + + if (firstTokenType == JsonToken.StartArray) + { + if (dynamicTypeToSerializeTo != null) + { + return (object[]) jsonSerializer.Deserialize(reader, dynamicTypeToSerializeTo.MakeArrayType()); + } + return jsonSerializer.Deserialize(reader); + } + if (messageTypes != null && messageTypes.Any()) + { + return new[] {jsonSerializer.Deserialize(reader, messageTypes.First())}; + } + + return new[] {jsonSerializer.Deserialize(reader)}; + } + + /// + /// Gets the content type into which this serializer serializes the content to + /// + public string ContentType { get { return GetContentType(); } } + + protected abstract string GetContentType(); + + protected abstract JsonWriter CreateJsonWriter(Stream stream); + + protected abstract JsonReader CreateJsonReader(Stream stream); + } +} diff --git a/src/NServiceBus.Core/Serializers/Serializers.cs b/src/NServiceBus.Core/Serializers/Serializers.cs new file mode 100644 index 00000000000..1d3e23b75d3 --- /dev/null +++ b/src/NServiceBus.Core/Serializers/Serializers.cs @@ -0,0 +1,43 @@ +namespace NServiceBus.Features.Categories +{ + using System; + using System.Collections.Generic; + using System.Configuration; + using System.Linq; + using Serialization; + + /// + /// Category for all serializers + /// + public class Serializers : FeatureCategory + { + //default to xml + static Type DefaultSerializer = typeof(XmlSerialization); + + public override IEnumerable GetFeaturesToInitialize() + { + //has the users already registered his own serializer? (mostly for backwards compatibility) + if (Configure.Instance.Configurer.HasComponent()) + yield break; + + var availableSerializers = GetAllAvailableFeatures(); + + var enabledSerializers = availableSerializers.Where(f => f.Enabled).ToList(); + + if (enabledSerializers.Count() > 1) + throw new ConfigurationErrorsException("Multiple serializers are not supported. Please make sure to only enable one"); + + var serializerToUse = availableSerializers.Single(f => f.GetType() == DefaultSerializer); + + if (enabledSerializers.Any()) + serializerToUse = enabledSerializers.Single(); + + yield return serializerToUse; + } + + public static void SetDefault() where T:Feature + { + DefaultSerializer = typeof(T); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/XML/Config/ConfigureXmlSerializer.cs b/src/NServiceBus.Core/Serializers/XML/Config/ConfigureXmlSerializer.cs new file mode 100644 index 00000000000..d3a48298fad --- /dev/null +++ b/src/NServiceBus.Core/Serializers/XML/Config/ConfigureXmlSerializer.cs @@ -0,0 +1,60 @@ +namespace NServiceBus +{ + /// + /// Contains extension methods to NServiceBus.Configure. + /// + public static class ConfigureXmlSerializer + { + /// + /// Use XML serialization that supports interface-based messages. + /// Optionally set the namespace to be used in the XML. + /// + /// + /// The namespace to use + /// Sanatizes the xml input if set to true + /// Tells the serializer to not wrap single messages with a "messages" element. This will break compatibility with endpoints older thatn 3.4.0 + /// Tells the serializer to not wrap properties which have either XDocument or XElement with a "PropertyName" element. + /// By default the xml serializer serializes the following message + /// + /// interface MyMessage { XDocument Property { get; set; } } + /// + /// into the following structure + /// + /// + /// + /// ... Content of the XDocument + /// + /// + /// + /// This flag allows to omit the property tag wrapping. Which results to + /// + /// + /// ... Content of the XDocument + /// + /// + /// When this feature is enable the root element of the XDocument must match the name of the property. The following would not work and lead to deserialization error: + /// + /// + /// + /// ... + /// + /// + /// + /// + /// + [ObsoleteEx(Replacement = "Configure.Serialization.Xml()", RemoveInVersion = "6.0", TreatAsErrorFromVersion = "5.0")] + public static Configure XmlSerializer(this Configure config, string nameSpace = null, bool sanitizeInput = false) + { + Configure.Serialization.Xml(s => + { + if (sanitizeInput) + s.SanitizeInput(); + + if (!string.IsNullOrEmpty(nameSpace)) + s.Namespace(nameSpace); + }); + + return config; + } + } +} diff --git a/src/NServiceBus.Core/Serializers/XML/Config/MessageTypesInitializer.cs b/src/NServiceBus.Core/Serializers/XML/Config/MessageTypesInitializer.cs new file mode 100644 index 00000000000..d93b784f947 --- /dev/null +++ b/src/NServiceBus.Core/Serializers/XML/Config/MessageTypesInitializer.cs @@ -0,0 +1,32 @@ +namespace NServiceBus.Serializers.XML.Config +{ + using System.Linq; + using MessageInterfaces.MessageMapper.Reflection; + using NServiceBus.Config; + + /// + /// Initializes the mapper and the serializer with the found message types + /// + public class MessageTypesInitializer : IWantToRunWhenConfigurationIsComplete + { + public MessageMapper Mapper { get; set; } + public XmlMessageSerializer Serializer { get; set; } + + public void Run() + { + if (Mapper == null) + { + return; + } + + var messageTypes = Configure.TypesToScan.Where(MessageConventionExtensions.IsMessageType).ToList(); + + Mapper.Initialize(messageTypes); + + if (Serializer != null) + { + Serializer.Initialize(messageTypes); + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/XML/Config/XmlSerialization.cs b/src/NServiceBus.Core/Serializers/XML/Config/XmlSerialization.cs new file mode 100644 index 00000000000..3a1915c18cf --- /dev/null +++ b/src/NServiceBus.Core/Serializers/XML/Config/XmlSerialization.cs @@ -0,0 +1,18 @@ +namespace NServiceBus.Features +{ + using MessageInterfaces.MessageMapper.Reflection; + using Serializers.XML; + using Settings; + + public class XmlSerialization : Feature + { + public override void Initialize() + { + Configure.Component(DependencyLifecycle.SingleInstance); + Configure.Component(DependencyLifecycle.SingleInstance) + .ConfigureProperty(p => p.SkipWrappingElementForSingleMessages, !SettingsHolder.GetOrDefault("SerializationSettings.WrapSingleMessages")); + + SettingsHolder.ApplyTo(); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/XML/Config/XmlSerializationSettings.cs b/src/NServiceBus.Core/Serializers/XML/Config/XmlSerializationSettings.cs new file mode 100644 index 00000000000..7fb30bb3ed6 --- /dev/null +++ b/src/NServiceBus.Core/Serializers/XML/Config/XmlSerializationSettings.cs @@ -0,0 +1,75 @@ +namespace NServiceBus.Serializers.XML.Config +{ + using System.Configuration; + using Settings; + + /// + /// Settings for the xml message serializer + /// + public class XmlSerializationSettings + { + /// + /// Tells the serializer to not wrap properties which have either XDocument or XElement with a "PropertyName" element. + /// By default the xml serializer serializes the following message + /// + /// + /// interface MyMessage { XDocument Property { get; set; } } + /// + /// into the following structure + /// + /// + /// + /// ... Content of the XDocument + /// + /// + /// + /// This flag allows to omit the property tag wrapping. Which results to + /// + /// + /// ... Content of the XDocument + /// + /// + /// When this feature is enable the root element of the XDocument must match the name of the property. The following would not work and lead to deserialization error: + /// + /// + /// + /// ... + /// + /// + /// + /// + /// + public XmlSerializationSettings DontWrapRawXml() + { + SettingsHolder.SetProperty(s => s.SkipWrappingRawXml, true); + + return this; + } + + /// + /// Configures the serializer to use a custom namespace. (http://tempuri.net) is the default + /// + /// + /// + public XmlSerializationSettings Namespace(string namespaceToUse) + { + if(string.IsNullOrEmpty(namespaceToUse)) + throw new ConfigurationErrorsException("Can't use a null or empty string as the xml namespace"); + + SettingsHolder.SetProperty(s => s.Namespace, namespaceToUse); + + return this; + } + + /// + /// Tells the serializer to sanatize the input data from illegal characters + /// + /// + public XmlSerializationSettings SanitizeInput() + { + SettingsHolder.SetProperty(s => s.SanitizeInput, true); + + return this; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/XML/Config/XmlSerializerConfigurationExtensions.cs b/src/NServiceBus.Core/Serializers/XML/Config/XmlSerializerConfigurationExtensions.cs new file mode 100644 index 00000000000..53f794009e3 --- /dev/null +++ b/src/NServiceBus.Core/Serializers/XML/Config/XmlSerializerConfigurationExtensions.cs @@ -0,0 +1,26 @@ +namespace NServiceBus +{ + using System; + using Features; + using Serializers.XML.Config; + using Settings; + + public static class XmlSerializerConfigurationExtensions + { + /// + /// Enables the xml message serializer with the geiven settings + /// + /// + /// + /// + public static SerializationSettings Xml(this SerializationSettings settings, Action customSettings = null) + { + Feature.Enable(); + + if (customSettings != null) + customSettings(new XmlSerializationSettings()); + + return settings; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Serializers/XML/XmlMessageSerializer.cs b/src/NServiceBus.Core/Serializers/XML/XmlMessageSerializer.cs new file mode 100644 index 00000000000..6c802991c2d --- /dev/null +++ b/src/NServiceBus.Core/Serializers/XML/XmlMessageSerializer.cs @@ -0,0 +1,1223 @@ +namespace NServiceBus.Serializers.XML +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Reflection; + using System.Runtime.Serialization; + using System.Text; + using System.Xml; + using System.Xml.Linq; + using System.Xml.Serialization; + using Logging; + using MessageInterfaces; + using Serialization; + using Utils.Reflection; + + /// + /// Implementation of the message serializer over XML supporting interface-based messages. + /// + public class XmlMessageSerializer : IMessageSerializer + { + readonly IMessageMapper mapper; + IList messageTypes; + + /// + /// The namespace to place in outgoing XML. + /// + public string Namespace + { + get { return nameSpace; } + set { nameSpace = value; } + } + + /// + /// If true, then the serializer will use a sanitizing stream to skip invalid characters from the stream before parsing + /// + public bool SanitizeInput { get; set; } + + /// + /// Removes the wrapping "" element if serializing a single message + /// + public bool SkipWrappingElementForSingleMessages { get; set; } + + /// + /// Removes the wrapping of properties containing XDocument or XElement with property name as root element + /// + public bool SkipWrappingRawXml { get; set; } + + /// + /// Scans the given type storing maps to fields and properties to save on reflection at runtime. + /// + /// + public void InitType(Type t) + { + logger.Debug("Initializing type: " + t.AssemblyQualifiedName); + + if (t.IsSimpleType()) + return; + + if (typeof(XContainer).IsAssignableFrom(t)) + { + typesBeingInitialized.Add(t); + + return; + } + + if (typeof(IEnumerable).IsAssignableFrom(t)) + { + if (t.IsArray) + typesToCreateForArrays[t] = typeof(List<>).MakeGenericType(t.GetElementType()); + + + foreach (Type g in t.GetGenericArguments()) + InitType(g); + + //Handle dictionaries - initalize relevant KeyValuePair types. + foreach (Type interfaceType in t.GetInterfaces()) + { + Type[] arr = interfaceType.GetGenericArguments(); + if (arr.Length == 1) + if (typeof(IEnumerable<>).MakeGenericType(arr[0]).IsAssignableFrom(t)) + InitType(arr[0]); + } + + if (t.IsGenericType && t.IsInterface) //handle IEnumerable + { + var g = t.GetGenericArguments(); + var e = typeof(IEnumerable<>).MakeGenericType(g); + + if (e.IsAssignableFrom(t)) + typesToCreateForEnumerables[t] = typeof(List<>).MakeGenericType(g); + } + + if (t.IsGenericType && t.GetGenericArguments().Length == 1) + { + Type setType = typeof(ISet<>).MakeGenericType(t.GetGenericArguments()); + + if (setType.IsAssignableFrom(t)) //handle ISet + { + var g = t.GetGenericArguments(); + var e = typeof(IEnumerable<>).MakeGenericType(g); + + if (e.IsAssignableFrom(t)) + typesToCreateForEnumerables[t] = typeof(List<>).MakeGenericType(g); + } + } + + return; + } + + var isKeyValuePair = false; + + var args = t.GetGenericArguments(); + if (args.Length == 2) + { + isKeyValuePair = (typeof(KeyValuePair<,>).MakeGenericType(args) == t); + } + + if (args.Length == 1 && args[0].IsValueType) + { + if (args[0].GetGenericArguments().Any() || typeof(Nullable<>).MakeGenericType(args) == t) + { + InitType(args[0]); + + if (!args[0].GetGenericArguments().Any()) + return; + } + } + + //already in the process of initializing this type (prevents infinite recursion). + if (typesBeingInitialized.Contains(t)) + return; + + typesBeingInitialized.Add(t); + + var props = GetAllPropertiesForType(t, isKeyValuePair); + typeToProperties[t] = props; + var fields = GetAllFieldsForType(t); + typeToFields[t] = fields; + + + foreach (var p in props) + { + logger.Debug("Handling property: " + p.Name); + + propertyInfoToLateBoundProperty[p] = DelegateFactory.Create(p); + + if (!isKeyValuePair) + propertyInfoToLateBoundPropertySet[p] = DelegateFactory.CreateSet(p); + + InitType(p.PropertyType); + } + + foreach (var f in fields) + { + logger.Debug("Handling field: " + f.Name); + + fieldInfoToLateBoundField[f] = DelegateFactory.Create(f); + + if (!isKeyValuePair) + fieldInfoToLateBoundFieldSet[f] = DelegateFactory.CreateSet(f); + + InitType(f.FieldType); + } + } + + /// + /// Gets a PropertyInfo for each property of the given type. + /// + /// + /// + /// + IEnumerable GetAllPropertiesForType(Type t, bool isKeyValuePair) + { + var result = new List(); + + foreach (var prop in t.GetProperties()) + { + if (!prop.CanWrite && !isKeyValuePair) + { + continue; + } + + if (prop.GetCustomAttributes(typeof(XmlIgnoreAttribute), false).Length > 0) + { + continue; + } + + if (typeof(IList) == prop.PropertyType) + throw new NotSupportedException("IList is not a supported property type for serialization, use List instead. Type: " + t.FullName + " Property: " + prop.Name); + + var args = prop.PropertyType.GetGenericArguments(); + + if (args.Length == 1) + { + if (typeof(IList<>).MakeGenericType(args) == prop.PropertyType) + throw new NotSupportedException("IList is not a supported property type for serialization, use List instead. Type: " + t.FullName + " Property: " + prop.Name); + if (typeof(ISet<>).MakeGenericType(args) == prop.PropertyType) + throw new NotSupportedException("ISet is not a supported property type for serialization, use HashSet instead. Type: " + t.FullName + " Property: " + prop.Name); + } + + if (args.Length == 2) + { + if (typeof(IDictionary<,>).MakeGenericType(args) == prop.PropertyType) + throw new NotSupportedException("IDictionary is not a supported property type for serialization, use Dictionary instead. Type: " + t.FullName + " Property: " + prop.Name + ". Consider using a concrete Dictionary instead, where T and K cannot be of type 'System.Object'"); + + if (args[0].FullName == "System.Object" || args[1].FullName == "System.Object") + throw new NotSupportedException("Dictionary is not a supported when Key or Value is of Type System.Object. Type: " + t.FullName + " Property: " + prop.Name + ". Consider using a concrete Dictionary where T and K are not of type 'System.Object'"); + } + + result.Add(prop); + } + + if (t.IsInterface) + foreach (Type interfaceType in t.GetInterfaces()) + result.AddRange(GetAllPropertiesForType(interfaceType, false)); + + return result.Distinct(); + } + + IEnumerable GetAllFieldsForType(Type t) + { + return t.GetFields(BindingFlags.FlattenHierarchy | BindingFlags.Instance | BindingFlags.Public); + } + + #region Deserialize + + /// + /// Deserializes from the given stream a set of messages. + /// + /// Stream that contains messages. + /// The list of message types to deserialize. If null the types must be inferred from the serialized data. + /// Deserialized messages. + public object[] Deserialize(Stream stream, IList messageTypesToDeserialize = null) + { + if (stream == null) + return null; + + prefixesToNamespaces = new Dictionary(); + messageBaseTypes = new List(); + var result = new List(); + + var doc = new XmlDocument { PreserveWhitespace = true }; + + XmlReader reader = SanitizeInput + ? XmlReader.Create(new XmlSanitizingStream(stream), new XmlReaderSettings { CheckCharacters = false }) + : XmlReader.Create(stream, new XmlReaderSettings { CheckCharacters = false }); + + doc.Load(reader); + + if (doc.DocumentElement == null) + return result.ToArray(); + + foreach (XmlAttribute attr in doc.DocumentElement.Attributes) + { + if (attr.Name == "xmlns") + defaultNameSpace = attr.Value.Substring(attr.Value.LastIndexOf("/") + 1); + else + { + if (attr.Name.Contains("xmlns:")) + { + int colonIndex = attr.Name.LastIndexOf(":"); + string prefix = attr.Name.Substring(colonIndex + 1); + + if (prefix.Contains(BASETYPE)) + { + Type baseType = mapper.GetMappedTypeFor(attr.Value); + if (baseType != null) + messageBaseTypes.Add(baseType); + } + else + prefixesToNamespaces[prefix] = attr.Value; + } + } + } + + if (doc.DocumentElement.Name.ToLower() != "messages") + { + Type nodeType = null; + + if (messageTypesToDeserialize != null) + nodeType = messageTypesToDeserialize.FirstOrDefault(); + + object m = Process(doc.DocumentElement, null, nodeType); + + if (m == null) + throw new SerializationException("Could not deserialize message."); + + result.Add(m); + } + else + { + int position = 0; + foreach (XmlNode node in doc.DocumentElement.ChildNodes) + { + if (node.NodeType == XmlNodeType.Whitespace) + continue; + + + Type nodeType = null; + + if (messageTypesToDeserialize != null && position < messageTypesToDeserialize.Count) + nodeType = messageTypesToDeserialize.ElementAt(position); + + + var m = Process(node, null, nodeType); + + result.Add(m); + + position++; + } + } + + defaultNameSpace = null; + + return result.ToArray(); + } + + private object Process(XmlNode node, object parent, Type nodeType = null) + { + if (nodeType == null) + nodeType = InferNodeType(node, parent); + + return GetObjectOfTypeFromNode(nodeType, node); + } + + Type InferNodeType(XmlNode node, object parent) + { + string name = node.Name; + string typeName = name; + + if (!string.IsNullOrEmpty(defaultNameSpace)) + typeName = defaultNameSpace + "." + typeName; + + if (name.Contains(":")) + { + int colonIndex = node.Name.IndexOf(":"); + name = name.Substring(colonIndex + 1); + string prefix = node.Name.Substring(0, colonIndex); + string ns = prefixesToNamespaces[prefix]; + + typeName = ns.Substring(ns.LastIndexOf("/") + 1) + "." + name; + } + + if (name.Contains("NServiceBus.")) + typeName = name; + + + if (parent != null) + { + if (parent is IEnumerable) + { + if (parent.GetType().IsArray) + return parent.GetType().GetElementType(); + + var listImplementations = parent.GetType().GetInterfaces().Where(interfaceType => interfaceType.IsGenericType && interfaceType.GetGenericTypeDefinition() == typeof(IList<>)).ToList(); + if (listImplementations.Any()) + { + var listImplementation = listImplementations.First(); + return listImplementation.GetGenericArguments().Single(); + } + + var args = parent.GetType().GetGenericArguments(); + + if (args.Length == 1) + return args[0]; + } + + var prop = parent.GetType().GetProperty(name); + + if (prop != null) + return prop.PropertyType; + } + + var mappedType = mapper.GetMappedTypeFor(typeName); + + if (mappedType != null) + return mappedType; + + + logger.Debug("Could not load " + typeName + ". Trying base types..."); + foreach (Type baseType in messageBaseTypes) + try + { + logger.Debug("Trying to deserialize message to " + baseType.FullName); + return baseType; + } + // ReSharper disable EmptyGeneralCatchClause + catch + { + } // intentionally swallow exception + // ReSharper restore EmptyGeneralCatchClause + + throw new TypeLoadException("Could not determine type for node: '" + node.Name + "'."); + } + + private object GetObjectOfTypeFromNode(Type t, XmlNode node) + { + if (t.IsSimpleType() || t == typeof(Uri)) + return GetPropertyValue(t, node); + + if (typeof(IEnumerable).IsAssignableFrom(t)) + return GetPropertyValue(t, node); + + object result = mapper.CreateInstance(t); + + foreach (XmlNode n in node.ChildNodes) + { + Type type = null; + if (n.Name.Contains(":")) + type = Type.GetType("System." + n.Name.Substring(0, n.Name.IndexOf(":")), false, true); + + var prop = GetProperty(t, n.Name); + if (prop != null) + { + var val = GetPropertyValue(type ?? prop.PropertyType, n); + if (val != null) + { + propertyInfoToLateBoundPropertySet[prop].Invoke(result, val); + continue; + } + } + + var field = GetField(t, n.Name); + if (field != null) + { + object val = GetPropertyValue(type ?? field.FieldType, n); + if (val != null) + { + fieldInfoToLateBoundFieldSet[field].Invoke(result, val); + } + } + } + + return result; + } + + private static PropertyInfo GetProperty(Type t, string name) + { + IEnumerable props; + typeToProperties.TryGetValue(t, out props); + + if (props == null) + return null; + + string n = GetNameAfterColon(name); + + foreach (PropertyInfo prop in props) + if (prop.Name == n) + return prop; + + return null; + } + + private static string GetNameAfterColon(string name) + { + var n = name; + if (name.Contains(":")) + n = name.Substring(name.IndexOf(":") + 1, name.Length - name.IndexOf(":") - 1); + + return n; + } + + private FieldInfo GetField(Type t, string name) + { + IEnumerable fields; + typeToFields.TryGetValue(t, out fields); + + if (fields == null) + return null; + + foreach (FieldInfo f in fields) + if (f.Name == name) + return f; + + return null; + } + + private object GetPropertyValue(Type type, XmlNode n) + { + if ((n.ChildNodes.Count == 1) && (n.ChildNodes[0] is XmlCharacterData)) + { + var text = n.ChildNodes[0].InnerText; + + var args = type.GetGenericArguments(); + if (args.Length == 1 && args[0].IsValueType) + { + if (args[0].GetGenericArguments().Any()) + return GetPropertyValue(args[0], n); + + var nullableType = typeof(Nullable<>).MakeGenericType(args); + if (type == nullableType) + { + if (text.ToLower() == "null") + return null; + + return GetPropertyValue(args[0], n); + } + } + + if (type == typeof(string)) + return text; + + if (type == typeof(Boolean)) + return XmlConvert.ToBoolean(text); + + if (type == typeof(Byte)) + return XmlConvert.ToByte(text); + + if (type == typeof(Char)) + return XmlConvert.ToChar(text); + + if (type == typeof(DateTime)) + return XmlConvert.ToDateTime(text, XmlDateTimeSerializationMode.RoundtripKind); + + if (type == typeof(DateTimeOffset)) + return XmlConvert.ToDateTimeOffset(text); + + if (type == typeof(decimal)) + return XmlConvert.ToDecimal(text); + + if (type == typeof(double)) + return XmlConvert.ToDouble(text); + + if (type == typeof(Guid)) + return XmlConvert.ToGuid(text); + + if (type == typeof(Int16)) + return XmlConvert.ToInt16(text); + + if (type == typeof(Int32)) + return XmlConvert.ToInt32(text); + + if (type == typeof(Int64)) + return XmlConvert.ToInt64(text); + + if (type == typeof(sbyte)) + return XmlConvert.ToSByte(text); + + if (type == typeof(Single)) + return XmlConvert.ToSingle(text); + + if (type == typeof(TimeSpan)) + return XmlConvert.ToTimeSpan(text); + + if (type == typeof(UInt16)) + return XmlConvert.ToUInt16(text); + + if (type == typeof(UInt32)) + return XmlConvert.ToUInt32(text); + + if (type == typeof(UInt64)) + return XmlConvert.ToUInt64(text); + + if (type.IsEnum) + return Enum.Parse(type, text); + + if (type == typeof(byte[])) + return Convert.FromBase64String(text); + + if (type == typeof(Uri)) + return new Uri(text); + + if (!typeof(IEnumerable).IsAssignableFrom(type)) + { + if (n.ChildNodes[0] is XmlWhitespace) + return Activator.CreateInstance(type); + + throw new Exception("Type not supported by the serializer: " + type.AssemblyQualifiedName); + } + } + + if (typeof(XContainer).IsAssignableFrom(type)) + { + var reader = new StringReader(SkipWrappingRawXml ? n.OuterXml : n.InnerXml); + + if (type == typeof(XDocument)) + { + return XDocument.Load(reader); + } + + return XElement.Load(reader); + } + + //Handle dictionaries + if (typeof(IDictionary).IsAssignableFrom(type)) + { + var result = Activator.CreateInstance(type) as IDictionary; + + var keyType = typeof(object); + var valueType = typeof(object); + + foreach (var interfaceType in type.GetInterfaces()) + { + var args = interfaceType.GetGenericArguments(); + if (args.Length == 2) + if (typeof(IDictionary<,>).MakeGenericType(args).IsAssignableFrom(type)) + { + keyType = args[0]; + valueType = args[1]; + break; + } + } + + foreach (XmlNode xn in n.ChildNodes) // go over KeyValuePairs + { + object key = null; + object value = null; + + foreach (XmlNode node in xn.ChildNodes) + { + if (node.Name == "Key") + key = GetObjectOfTypeFromNode(keyType, node); + if (node.Name == "Value") + value = GetObjectOfTypeFromNode(valueType, node); + } + + if (result != null && key != null) result[key] = value; + } + + return result; + } + + if (typeof(IEnumerable).IsAssignableFrom(type) && type != typeof(string)) + { + bool isArray = type.IsArray; + + bool isISet = false; + if (type.IsGenericType && type.GetGenericArguments().Length == 1) + { + Type setType = typeof(ISet<>).MakeGenericType(type.GetGenericArguments()); + isISet = setType.IsAssignableFrom(type); + } + + Type typeToCreate = type; + if (isArray) + typeToCreate = typesToCreateForArrays[type]; + + if (typesToCreateForEnumerables.ContainsKey(type)) //handle IEnumerable + typeToCreate = typesToCreateForEnumerables[type]; + + if (typeof(IList).IsAssignableFrom(typeToCreate)) + { + var list = Activator.CreateInstance(typeToCreate) as IList; + if (list != null) + { + foreach (XmlNode xn in n.ChildNodes) + { + if (xn.NodeType == XmlNodeType.Whitespace) + continue; + + object m = Process(xn, list); + list.Add(m); + } + + if (isArray) + return typeToCreate.GetMethod("ToArray").Invoke(list, null); + + if (isISet) + return Activator.CreateInstance(type, typeToCreate.GetMethod("ToArray").Invoke(list, null)); + } + + return list; + } + } + + if (n.ChildNodes.Count == 0) + if (type == typeof(string)) + return string.Empty; + else + return null; + + + return GetObjectOfTypeFromNode(type, n); + } + + #endregion + + #region Serialize + + /// + /// Serializes the given messages to the given stream. + /// + /// + /// + public void Serialize(object[] messages, Stream stream) + { + var namespaces = InitializeNamespaces(messages); + var messageBuilder = SerializeMessages(messages); + + var builder = new StringBuilder(); + + + builder.AppendLine(""); + + if (SkipWrappingElementForSingleMessages && messages.Length == 1) + { + builder.Append(messageBuilder); + } + else + { + List baseTypes = GetBaseTypes(messages); + + WrapMessages(builder, namespaces, baseTypes, messageBuilder); + } + byte[] buffer = Encoding.UTF8.GetBytes(builder.ToString()); + stream.Write(buffer, 0, buffer.Length); + } + + public string ContentType { get { return ContentTypes.Xml; } } + + void WrapMessages(StringBuilder builder, List namespaces, List baseTypes, StringBuilder messageBuilder) + { + CreateStartElementWithNamespaces(namespaces, baseTypes, builder, "Messages"); + + builder.Append(messageBuilder); + + builder.AppendLine(""); + } + + StringBuilder SerializeMessages(object[] messages) + { + var messageBuilder = new StringBuilder(); + + foreach (var m in messages) + { + var t = mapper.GetMappedTypeFor(m.GetType()); + + WriteObject(t.Name, t, m, messageBuilder, SkipWrappingElementForSingleMessages && messages.Length == 1); + } + return messageBuilder; + } + + List InitializeNamespaces(object[] messages) + { + namespacesToPrefix = new Dictionary(); + namespacesToAdd = new List(); + + var namespaces = GetNamespaces(messages); + for (int i = 0; i < namespaces.Count; i++) + { + string prefix = "q" + i; + if (i == 0) + prefix = ""; + + if (namespaces[i] != null) + namespacesToPrefix[namespaces[i]] = prefix; + } + return namespaces; + } + + private void Write(StringBuilder builder, Type t, object obj) + { + if (obj == null) + return; + + if (!typeToProperties.ContainsKey(t)) + throw new InvalidOperationException(string.Format("Type {0} was not registered in the serializer. Check that it appears in the list of configured assemblies/types to scan.", t.FullName)); + + foreach (PropertyInfo prop in typeToProperties[t]) + { + if (IsIndexedProperty(prop)) + { + throw new NotSupportedException(string.Format("Type {0} contains an indexed property named {1}. Indexed properties are not supported on message types.", t.FullName, prop.Name)); + } + WriteEntry(prop.Name, prop.PropertyType, propertyInfoToLateBoundProperty[prop].Invoke(obj), builder); + } + + foreach (FieldInfo field in typeToFields[t]) + WriteEntry(field.Name, field.FieldType, fieldInfoToLateBoundField[field].Invoke(obj), builder); + } + + static bool IsIndexedProperty(PropertyInfo propertyInfo) + { + if (propertyInfo != null) + { + return propertyInfo.GetIndexParameters().Length > 0; + } + + return false; + } + + private void WriteObject(string name, Type type, object value, StringBuilder builder, bool useNS = false) + { + string element = name; + string prefix; + namespacesToPrefix.TryGetValue(type.Namespace, out prefix); + + if (string.IsNullOrEmpty(prefix) && type == typeof(object) && (value.GetType().IsSimpleType())) + { + if (!namespacesToAdd.Contains(value.GetType())) + { + namespacesToAdd.Add(value.GetType()); + } + + builder.AppendFormat("<{0}>{1}\n", + value.GetType().Name.ToLower() + ":" + name, + FormatAsString(value)); + + return; + } + + if (!string.IsNullOrEmpty(prefix)) + element = prefix + ":" + name; + + if (useNS) + { + var namespaces = InitializeNamespaces(new[] {value}); + var baseTypes = GetBaseTypes(new[] {value}); + CreateStartElementWithNamespaces(namespaces, baseTypes, builder, element); + } + else + { + builder.AppendFormat("<{0}>\n", element); + } + + Write(builder, type, value); + + builder.AppendFormat("\n", element); + } + + private void CreateStartElementWithNamespaces(List namespaces, List baseTypes, StringBuilder builder, string element) + { + string prefix; + + builder.AppendFormat( + "<{0} xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"", + element); + + for (int i = 0; i < namespaces.Count; i++) + { + prefix = "q" + i; + if (i == 0) + prefix = ""; + + builder.AppendFormat(" xmlns{0}=\"{1}/{2}\"", (prefix != "" ? ":" + prefix : prefix), nameSpace, + namespaces[i]); + } + + foreach (var t in namespacesToAdd) + builder.AppendFormat(" xmlns:{0}=\"{1}\"", t.Name.ToLower(), t.Name); + + for (int i = 0; i < baseTypes.Count; i++) + { + prefix = BASETYPE; + if (i != 0) + prefix += i; + + builder.AppendFormat(" xmlns:{0}=\"{1}\"", prefix, baseTypes[i]); + } + + builder.Append(">\n"); + } + + private void WriteEntry(string name, Type type, object value, StringBuilder builder) + { + if (value == null) + { + if (typeof(IEnumerable).IsAssignableFrom(type)) + return; + + var args = type.GetGenericArguments(); + if (args.Length == 1 && args[0].IsValueType) + { + var nullableType = typeof(Nullable<>).MakeGenericType(args); + if (type == nullableType) + { + WriteEntry(name, typeof(string), "null", builder); + return; + } + } + + return; + } + + if (typeof(XContainer).IsAssignableFrom(type)) + { + var container = (XContainer)value; + if(SkipWrappingRawXml) + { + builder.AppendFormat("{0}\n", container); + } + else + { + builder.AppendFormat("<{0}>{1}\n", name, container); + } + + return; + } + + if (type.IsValueType || type == typeof(string) || type == typeof(Uri) || type == typeof(char)) + { + builder.AppendFormat("<{0}>{1}\n", name, FormatAsString(value)); + return; + } + + if (typeof(IEnumerable).IsAssignableFrom(type)) + { + builder.AppendFormat("<{0}>\n", name); + + if (type == typeof(byte[])) + { + var str = Convert.ToBase64String((byte[])value); + builder.Append(str); + } + else + { + Type baseType = typeof(object); + + Type[] interfaces = type.GetInterfaces(); + if (type.IsInterface) interfaces = interfaces.Union(new[] { type }).ToArray(); + + //Get generic type from list: T for List, KeyValuePair for IDictionary + foreach (Type interfaceType in interfaces) + { + Type[] arr = interfaceType.GetGenericArguments(); + if (arr.Length == 1) + if (typeof(IEnumerable<>).MakeGenericType(arr[0]).IsAssignableFrom(type)) + { + baseType = arr[0]; + break; + } + } + + + foreach (object obj in ((IEnumerable)value)) + if (obj != null && obj.GetType().IsSimpleType()) + WriteEntry(obj.GetType().Name, obj.GetType(), obj, builder); + else + WriteObject(baseType.SerializationFriendlyName(), baseType, obj, builder); + + } + + builder.AppendFormat("\n", name); + return; + } + + WriteObject(name, type, value, builder); + } + + private static string FormatAsString(object value) + { + if (value is bool) + return XmlConvert.ToString((bool)value); + if (value is byte) + return XmlConvert.ToString((byte)value); + if (value is char) + return Escape((char)value); + if (value is double) + return XmlConvert.ToString((double)value); + if (value is ulong) + return XmlConvert.ToString((ulong)value); + if (value is uint) + return XmlConvert.ToString((uint)value); + if (value is ushort) + return XmlConvert.ToString((ushort)value); + if (value is long) + return XmlConvert.ToString((long)value); + if (value is int) + return XmlConvert.ToString((int)value); + if (value is short) + return XmlConvert.ToString((short)value); + if (value is sbyte) + return XmlConvert.ToString((sbyte)value); + if (value is decimal) + return XmlConvert.ToString((decimal)value); + if (value is float) + return XmlConvert.ToString((float)value); + if (value is Guid) + return XmlConvert.ToString((Guid)value); + if (value is DateTime) + return XmlConvert.ToString((DateTime)value, XmlDateTimeSerializationMode.RoundtripKind); + if (value is DateTimeOffset) + return XmlConvert.ToString((DateTimeOffset)value); + if (value is TimeSpan) + return XmlConvert.ToString((TimeSpan)value); + if (value is string) + return Escape(value as string); + + return value.ToString(); + } + + private static string Escape(char c) + { + if (c == 0x9 || c == 0xA || c == 0xD + || (0x20 <= c && c <= 0xD7FF) + || (0xE000 <= c && c <= 0xFFFD) + || (0x10000 <= c && c <= 0x10ffff) + ) + { + string ss = null; + switch (c) + { + case '<': + ss = "<"; + break; + case '>': + ss = ">"; + break; + case '"': + ss = """; + break; + case '\'': + ss = "'"; + break; + case '&': + ss = "&"; + break; + } + if (ss != null) + { + return ss; + } + } + else + { + return String.Format("&#x{0:X};", (int)c); + } + + //Should not get here but just in case! + return c.ToString(); + } + + private static string Escape(string str) + { + if (string.IsNullOrEmpty(str)) + { + return str; + } + + StringBuilder builder = null; // initialize if we need it + + int startIndex = 0; + for (var i = 0; i < str.Length; ++i) + { + char c = str[i]; + if (c == 0x9 || c == 0xA || c == 0xD + || (0x20 <= c && c <= 0xD7FF) + || (0xE000 <= c && c <= 0xFFFD) + || (0x10000 <= c && c <= 0x10ffff) + ) + { + string ss = null; + switch (c) + { + case '<': + ss = "<"; + break; + case '>': + ss = ">"; + break; + case '"': + ss = """; + break; + case '\'': + ss = "'"; + break; + case '&': + ss = "&"; + break; + } + if (ss != null) + { + if (builder == null) + { + builder = new StringBuilder(str.Length + ss.Length); + } + if (startIndex < i) + { + builder.Append(str, startIndex, i - startIndex); + } + startIndex = i + 1; + builder.Append(ss); + } + + } + else + { + // invalid characters + if (builder == null) + { + builder = new StringBuilder(str.Length + 8); + } + if (startIndex < i) + { + builder.Append(str, startIndex, i - startIndex); + } + startIndex = i + 1; + builder.AppendFormat("&#x{0:X};", (int) c); + } + } + + if (startIndex < str.Length) + { + if (builder == null) + { + return str; + } + builder.Append(str, startIndex, str.Length - startIndex); + } + + if (builder != null) + { + return builder.ToString(); + } + + //Should not get here but just in case! + return str; + } + + List GetNamespaces(object[] messages) + { + var result = new List(); + + foreach (var m in messages) + { + string ns = mapper.GetMappedTypeFor(m.GetType()).Namespace; + if (!result.Contains(ns)) + result.Add(ns); + } + + return result; + } + + List GetBaseTypes(object[] messages) + { + var result = new List(); + + foreach (var m in messages) + { + Type t = mapper.GetMappedTypeFor(m.GetType()); + + Type baseType = t.BaseType; + while (baseType != typeof(object) && baseType != null) + { + if (MessageConventionExtensions.IsMessageType(baseType)) + if (!result.Contains(baseType.FullName)) + result.Add(baseType.FullName); + + baseType = baseType.BaseType; + } + + foreach (Type i in t.GetInterfaces()) + if (MessageConventionExtensions.IsMessageType(i)) + if (!result.Contains(i.FullName)) + result.Add(i.FullName); + } + + return result; + } + + #endregion + + #region members + + private const string BASETYPE = "baseType"; + + private static readonly Dictionary> typeToProperties = new Dictionary>(); + private static readonly Dictionary> typeToFields = new Dictionary>(); + private static readonly Dictionary typesToCreateForArrays = new Dictionary(); + private static readonly Dictionary typesToCreateForEnumerables = new Dictionary(); + private static readonly List typesBeingInitialized = new List(); + + private static readonly Dictionary propertyInfoToLateBoundProperty = new Dictionary(); + private static readonly Dictionary fieldInfoToLateBoundField = new Dictionary(); + private static readonly Dictionary propertyInfoToLateBoundPropertySet = new Dictionary(); + private static readonly Dictionary fieldInfoToLateBoundFieldSet = new Dictionary(); + + [ThreadStatic] + private static string defaultNameSpace; + + /// + /// Used for serialization + /// + [ThreadStatic] + private static IDictionary namespacesToPrefix; + + /// + /// Used for deserialization + /// + [ThreadStatic] + private static IDictionary prefixesToNamespaces; + + [ThreadStatic] + private static List messageBaseTypes; + + [ThreadStatic] + private static List namespacesToAdd; + + private static readonly ILog logger = LogManager.GetLogger(typeof(XmlMessageSerializer)); + + /// + /// Initializes an instace of a NServiceBus.Serializers.XML.XmlMessageSerializer + /// + /// Message Mapper + public XmlMessageSerializer(IMessageMapper mapper) + { + this.mapper = mapper; + } + + #endregion + + /// + /// Initialized the serializer with the given message types + /// + /// + public void Initialize(IEnumerable types) + { + messageTypes = types.ToList(); + + if (!messageTypes.Contains(typeof(EncryptedValue))) + messageTypes.Add(typeof(EncryptedValue)); + + foreach (Type t in messageTypes) + InitType(t); + + } + + string nameSpace = "http://tempuri.net"; + } +} diff --git a/src/impl/Serializers/NServiceBus.Serializers.XML/XmlSanitizingStream.cs b/src/NServiceBus.Core/Serializers/XML/XmlSanitizingStream.cs similarity index 89% rename from src/impl/Serializers/NServiceBus.Serializers.XML/XmlSanitizingStream.cs rename to src/NServiceBus.Core/Serializers/XML/XmlSanitizingStream.cs index b334f5d15db..34de296e818 100644 --- a/src/impl/Serializers/NServiceBus.Serializers.XML/XmlSanitizingStream.cs +++ b/src/NServiceBus.Core/Serializers/XML/XmlSanitizingStream.cs @@ -1,10 +1,9 @@ -using System; -using System.IO; -using System.Xml; -using System.Text; - namespace NServiceBus.Serializers.XML { - /// + using System; + using System.IO; + using System.Text; + + /// /// A StreamReader that excludes XML-illegal characters while reading. /// public class XmlSanitizingStream : StreamReader @@ -21,15 +20,17 @@ public class XmlSanitizingStream : StreamReader public XmlSanitizingStream(Stream streamToSanitize) : base(streamToSanitize, true) { } - - /// - /// Get whether an integer represents a legal XML 1.0 or 1.1 character. See - /// the specification at w3.org for these characters. - /// - /// - /// The version number as a string. Use "1.0" for XML 1.0 character - /// validation, and use "1.1" for XML 1.1 character validation. - /// + + /// + /// Get whether an integer represents a legal XML 1.0 or 1.1 character. See + /// the specification at w3.org for these characters. + /// + /// + /// The version number as a string. Use "1.0" for XML 1.0 character + /// validation, and use "1.1" for XML 1.1 character validation. + /// + /// + /// true if is a legal xml chracter. public static bool IsLegalXmlChar(string xmlVersion, int character) { switch (xmlVersion) diff --git a/src/integration/NServiceBus.Integration.WCF/ServiceAsyncResult.cs b/src/NServiceBus.Core/ServiceAsyncResult.cs similarity index 97% rename from src/integration/NServiceBus.Integration.WCF/ServiceAsyncResult.cs rename to src/NServiceBus.Core/ServiceAsyncResult.cs index baab07ae2c7..475af105563 100644 --- a/src/integration/NServiceBus.Integration.WCF/ServiceAsyncResult.cs +++ b/src/NServiceBus.Core/ServiceAsyncResult.cs @@ -1,8 +1,8 @@ -using System; -using System.Threading; - namespace NServiceBus { + using System; + using System.Threading; + public class ServiceAsyncResult : IAsyncResult { private readonly object state; diff --git a/src/NServiceBus.Core/SetLoggingLibrary.cs b/src/NServiceBus.Core/SetLoggingLibrary.cs new file mode 100644 index 00000000000..96435e5a85c --- /dev/null +++ b/src/NServiceBus.Core/SetLoggingLibrary.cs @@ -0,0 +1,119 @@ +using System.Collections.Generic; +using System.Linq; +using NServiceBus.Logging.Loggers.NLogAdapter; + +namespace NServiceBus +{ + using System; + using Logging; + + /// + /// Class containing extension method to allow users to use Log4Net for logging + /// + public static class SetLoggingLibrary + { + /// + /// Use Log4Net for logging with the Console Appender at the level of All. + /// + public static Configure Log4Net(this Configure config) + { + var appender = Logging.Loggers.Log4NetAdapter.Log4NetAppenderFactory.CreateConsoleAppender("All"); + + return config.Log4Net(appender); + } + + /// + /// Use Log4Net for logging with your own appender type, initializing it as necessary. + /// Will call 'ActivateOptions()' on the appender for you. + /// If you don't specify a threshold, will default to Level.Debug. + /// If you don't specify layout, uses this as a default: %d [%t] %-5p %c [%x] <%X{auth}> - %m%n + /// + public static Configure Log4Net(this Configure config, Action initializeAppender) where TAppender : new() + { + var appender = new TAppender(); + initializeAppender(appender); + + return config.Log4Net(appender); + } + + /// + /// Use Log4Net for logging passing in a pre-configured appender. + /// Will call 'ActivateOptions()' on the appender for you. + /// If you don't specify a threshold, will default to Level.Debug. + /// If you don't specify layout, uses this as a default: %d [%t] %-5p %c [%x] <%X{auth}> - %m%n + /// + public static Configure Log4Net(this Configure config, object appenderSkeleton) + { + string threshold = null; + + var cfg = Configure.GetConfigSection(); + if (cfg != null) + { + threshold = cfg.Threshold; + } + + Logging.Loggers.Log4NetAdapter.Log4NetConfigurator.Configure(appenderSkeleton, threshold); + + return config; + } + + /// + /// Configure NServiceBus to use Log4Net without setting a specific appender. + /// + public static void Log4Net() + { + Logging.Loggers.Log4NetAdapter.Log4NetConfigurator.Configure(); + } + + + + /// + /// Configure NServiceBus to use Log4Net and specify your own configuration. + /// Use 'log4net.Config.XmlConfigurator.Configure' as the parameter to get the configuration from the app.config. + /// + public static void Log4Net(Action config) + { + Log4Net(); + + config(); + } + + public static Configure NLog(this Configure config, params object[] targetsForNServiceBusToLogTo) + { + + if (targetsForNServiceBusToLogTo == null) + { + throw new ArgumentNullException("targetsForNServiceBusToLogTo"); + } + if (targetsForNServiceBusToLogTo.Length == 0) + { + throw new ArgumentException("Must not be empty.", "targetsForNServiceBusToLogTo"); + } + if (targetsForNServiceBusToLogTo.Any(x=>x == null)) + { + throw new ArgumentNullException("targetsForNServiceBusToLogTo", "Must not contain null values."); + } + string threshold = null; + + var cfg = Configure.GetConfigSection(); + if (cfg != null) + { + threshold = cfg.Threshold; + } + + NLogConfigurator.Configure(targetsForNServiceBusToLogTo, threshold); + + return config; + } + + public static void NLog() + { + NLogConfigurator.Configure(); + } + + public static void Custom(ILoggerFactory loggerFactory) + { + LogManager.LoggerFactory = loggerFactory; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Settings/Endpoint.cs b/src/NServiceBus.Core/Settings/Endpoint.cs new file mode 100644 index 00000000000..e36d1421c8a --- /dev/null +++ b/src/NServiceBus.Core/Settings/Endpoint.cs @@ -0,0 +1,95 @@ +namespace NServiceBus.Settings +{ + using System; + using Features; + using Persistence.InMemory; + + class DefaultEndpointSettings: ISetDefaultSettings + { + public DefaultEndpointSettings() + { + SettingsHolder.SetDefault("Endpoint.SendOnly", false); + } + } + + class DefaultEndpointAdvancedSettings : ISetDefaultSettings + { + public DefaultEndpointAdvancedSettings() + { + SettingsHolder.SetDefault("Endpoint.DurableMessages", true); + } + } + + /// + /// Configuration class for Endpoint settings. + /// + public class Endpoint + { + private readonly EndpointAdvancedSettings endpointAdvancedSettings = new EndpointAdvancedSettings(); + + /// + /// Tells the endpoint to not enforce durability (using InMemory storages, non durable messages, ...). + /// + public Endpoint AsVolatile() + { + InMemoryPersistence.UseAsDefault(); + + Configure.Transactions.Disable(); + Configure.Transactions.Advanced(s => s.DoNotWrapHandlersExecutionInATransactionScope() + .DisableDistributedTransactions()); + + Advanced(settings => settings.DisableDurableMessages()); + + return this; + } + + /// + /// Configures this endpoint as a send only endpoint. + /// + /// + /// Use this in endpoints whose only purpose is sending messages, websites are often a good example of send only endpoints. + /// + public Endpoint AsSendOnly() + { + SettingsHolder.Set("Endpoint.SendOnly", true); + Feature.Disable(); + return this; + } + + /// + /// advance settings. + /// + /// A lambda to set the advance settings. + public Endpoint Advanced(Action action) + { + action(endpointAdvancedSettings); + return this; + } + + /// + /// advance settings. + /// + public class EndpointAdvancedSettings + { + /// + /// Configures endpoint with messages guaranteed to be delivered in the event of a computer failure or network problem. + /// + /// + public EndpointAdvancedSettings EnableDurableMessages() + { + SettingsHolder.Set("Endpoint.DurableMessages", true); + return this; + } + + /// + /// Configures endpoint with messages that are not guaranteed to be delivered in the event of a computer failure or network problem. + /// + /// + public EndpointAdvancedSettings DisableDurableMessages() + { + SettingsHolder.Set("Endpoint.DurableMessages", false); + return this; + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Settings/ISetDefaultSettings.cs b/src/NServiceBus.Core/Settings/ISetDefaultSettings.cs new file mode 100644 index 00000000000..08385a0113a --- /dev/null +++ b/src/NServiceBus.Core/Settings/ISetDefaultSettings.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Settings +{ + /// + /// Implement this interface to register default settings. + /// + public interface ISetDefaultSettings + { + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Settings/ScaleOutSettings.cs b/src/NServiceBus.Core/Settings/ScaleOutSettings.cs new file mode 100644 index 00000000000..3f7eb56b907 --- /dev/null +++ b/src/NServiceBus.Core/Settings/ScaleOutSettings.cs @@ -0,0 +1,34 @@ +namespace NServiceBus.Settings +{ + /// + /// Placeholder for the various settings related to how a endpoint is scaled out + /// + public class ScaleOutSettings + { + /// + /// Instructs the broker based transports to use a single queue for the endpoint regardless of which machine its running on. + /// This is suitable for backend processing endpoints and is the default for the As_aServer role. + /// Clients that needs to make use of callbacks needs to make sure that this setting is off since they need to have a unique + /// input queue per machine in order to not miss any of the callbacks. + /// + /// + public ScaleOutSettings UseSingleBrokerQueue() + { + SettingsHolder.Set("ScaleOut.UseSingleBrokerQueue",true); + + return this; + } + + /// + /// Instructs the broker based transports to use a separate queue per endpoint when running on multiple machines. + /// This allows clients to make use of callbacks. This setting is the default. + /// + /// + public ScaleOutSettings UseUniqueBrokerQueuePerMachine() + { + SettingsHolder.Set("ScaleOut.UseSingleBrokerQueue", false); + + return this; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Settings/SerializationSettings.cs b/src/NServiceBus.Core/Settings/SerializationSettings.cs new file mode 100644 index 00000000000..808eac3708c --- /dev/null +++ b/src/NServiceBus.Core/Settings/SerializationSettings.cs @@ -0,0 +1,30 @@ +namespace NServiceBus.Settings +{ + /// + /// Settings related to message serialization + /// + public class SerializationSettings + { + /// + /// Tells the framework to always wrap out going messages as if there was multiple messages beeing sent + /// + /// + public SerializationSettings WrapSingleMessages() + { + SettingsHolder.Set("SerializationSettings.WrapSingleMessages",true); + + return this; + } + + /// + /// Tells the framework to not wrap out going messages as if there was multiple messages beeing sent + /// + /// + public SerializationSettings DontWrapSingleMessages() + { + SettingsHolder.Set("SerializationSettings.WrapSingleMessages", false); + + return this; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Settings/SettingsHolder.cs b/src/NServiceBus.Core/Settings/SettingsHolder.cs new file mode 100644 index 00000000000..cbc81bb0c7c --- /dev/null +++ b/src/NServiceBus.Core/Settings/SettingsHolder.cs @@ -0,0 +1,203 @@ +namespace NServiceBus.Settings +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Configuration; + using System.Linq.Expressions; + using Utils.Reflection; + + /// + /// Setting container. + /// + public static class SettingsHolder + { + static readonly ConcurrentDictionary Overrides = new ConcurrentDictionary(StringComparer.OrdinalIgnoreCase); + static readonly ConcurrentDictionary Defaults = new ConcurrentDictionary(StringComparer.OrdinalIgnoreCase); + + /// + /// Gets the setting value. + /// + /// The value of the setting. + /// The key of the setting to get. + /// The setting value. + public static T Get(string key) + { + return (T) Get(key); + } + + /// + /// Gets the setting value. + /// + /// + /// + public static object Get(string key) + { + object result; + if (Overrides.TryGetValue(key, out result)) + { + return result; + } + + if (Defaults.TryGetValue(key, out result)) + { + return result; + } + + throw new KeyNotFoundException(String.Format("The given key ({0}) was not present in the dictionary.", key)); + } + + /// + /// Sets the setting value. + /// + /// The key to use to store the setting. + /// The setting value. + public static void Set(string key, object value) + { + EnsureWriteEnabled(); + + Overrides[key] = value; + } + /// + /// Sets the value + /// + /// The key to use to store the setting. + /// The setting value. + public static void Set(object value) + { + Set(typeof(T).FullName, value); + } + public static void Set(Action value) + { + Set(typeof(T).FullName, value); + } + + /// + /// Sets the value of the given property + /// + /// + /// + /// + public static void SetProperty(Expression> property, object value) + { + var prop = Reflect.GetProperty(property); + + Set(typeof(T).FullName + "." + prop.Name, value); + } + + + /// + /// Sets the default value of the given property + /// + /// + /// + /// + public static void SetPropertyDefault(Expression> property, object value) + { + var prop = Reflect.GetProperty(property); + + SetDefault(typeof(T).FullName + "." + prop.Name, value); + } + + + /// + /// Sets the default setting value. + /// + /// The key to use to store the setting. + /// The setting value. + public static void SetDefault(object value) + { + SetDefault(typeof(T).FullName, value); + } + public static void SetDefault(Action value) + { + SetDefault(typeof(T).FullName, value); + } + public static void SetDefault(string key, object value) + { + EnsureWriteEnabled(); + + Defaults[key] = value; + } + + public static void Reset() + { + locked = false; + + Overrides.Clear(); + Defaults.Clear(); + } + + public static T GetOrDefault(string key) + { + object result; + if (Overrides.TryGetValue(key, out result)) + { + return (T)result; + } + + if (Defaults.TryGetValue(key, out result)) + { + return (T)result; + } + + return default(T); + } + + public static bool HasSetting(string key) + { + + if (Overrides.ContainsKey(key)) + { + return true; + } + + if (Defaults.ContainsKey(key)) + { + return true; + } + + return false; + } + + public static bool HasSetting() + { + var key = typeof(T).FullName; + + return HasSetting(key); + } + + /// + /// Locks the settings to prevent further modifications + /// + public static void PreventChanges() + { + locked = true; + } + + static void EnsureWriteEnabled() + { + if (locked) + { + throw new ConfigurationErrorsException(string.Format("The settings has been locked for modifications. Please move any configuration code earlier in the configuration pipeline")); + } + } + + static bool locked; + + public static void ApplyTo() + { + var targetType = typeof (T); + + foreach (var property in targetType.GetProperties()) + { + var settingsKey = targetType.FullName + "." + property.Name; + + if (HasSetting(settingsKey)) + { + Configure.Instance.Configurer.ConfigureProperty(property.Name, Get(settingsKey)); + } + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Settings/TransactionSettings.cs b/src/NServiceBus.Core/Settings/TransactionSettings.cs new file mode 100644 index 00000000000..b415ee619ec --- /dev/null +++ b/src/NServiceBus.Core/Settings/TransactionSettings.cs @@ -0,0 +1,175 @@ +namespace NServiceBus.Settings +{ + using System; + using System.Configuration; + using System.Transactions; + using System.Transactions.Configuration; + using Unicast.Transport; + + class DefaultTransactionSettings : ISetDefaultSettings + { + public DefaultTransactionSettings() + { + SettingsHolder.SetDefault("Transactions.Enabled", true); + } + } + + class DefaultTransactionAdvancedSettings : ISetDefaultSettings + { + public DefaultTransactionAdvancedSettings() + { + SettingsHolder.SetDefault("Transactions.IsolationLevel", IsolationLevel.ReadCommitted); + SettingsHolder.SetDefault("Transactions.DefaultTimeout", TransactionManager.DefaultTimeout); + SettingsHolder.SetDefault("Transactions.SuppressDistributedTransactions", false); + SettingsHolder.SetDefault("Transactions.DoNotWrapHandlersExecutionInATransactionScope", false); + } + } + + /// + /// Configuration class for Transaction settings. + /// + public class TransactionSettings + { + private readonly TransactionAdvancedSettings transactionAdvancedSettings = new TransactionAdvancedSettings(); + + /// + /// Configures this endpoint to use transactions. + /// + /// + /// A transactional endpoint means that we don't remove a message from the queue until it has been successfully processed. + /// + public TransactionSettings Enable() + { + SettingsHolder.Set("Transactions.Enabled", true); + return this; + } + + /// + /// Configures this endpoint to not use transactions. + /// + /// + /// Turning transactions off means that the endpoint won't do retries and messages are lost on exceptions. + /// + public TransactionSettings Disable() + { + SettingsHolder.Set("Transactions.Enabled", false); + return this; + } + + /// + /// advance settings. + /// + /// A lambda to set the advance settings. + public TransactionSettings Advanced(Action action) + { + action(transactionAdvancedSettings); + return this; + } + + /// + /// advance settings. + /// + public class TransactionAdvancedSettings + { + private readonly TimeSpan maxTimeout; + + /// + /// Default constructor. + /// + public TransactionAdvancedSettings() + { + maxTimeout = GetMaxTimeout(); + } + + /// + /// Sets the isolation level of the transaction. + /// + /// A enumeration that specifies the isolation level of the transaction. + /// + public TransactionAdvancedSettings IsolationLevel(IsolationLevel isolationLevel) + { + SettingsHolder.Set("Transactions.IsolationLevel", isolationLevel); + + return this; + } + + /// + /// Configures the not to enlist in Distributed Transactions. + /// + /// + public TransactionAdvancedSettings DisableDistributedTransactions() + { + SettingsHolder.Set("Transactions.SuppressDistributedTransactions", true); + return this; + } + + /// + /// Configures the to enlist in Distributed Transactions. + /// + /// + public TransactionAdvancedSettings EnableDistributedTransactions() + { + SettingsHolder.Set("Transactions.SuppressDistributedTransactions", false); + return this; + } + + /// + /// Configures this endpoint so that handlers are not wrapped in a . + /// + /// + public TransactionAdvancedSettings DoNotWrapHandlersExecutionInATransactionScope() + { + SettingsHolder.Set("Transactions.DoNotWrapHandlersExecutionInATransactionScope", true); + return this; + } + + /// + /// Configures this endpoint so that handlers not wrapped in a . + /// + /// + public TransactionAdvancedSettings WrapHandlersExecutionInATransactionScope() + { + SettingsHolder.Set("Transactions.DoNotWrapHandlersExecutionInATransactionScope", false); + return this; + } + + /// + /// Sets the default timeout period for the transaction. + /// + /// A value that specifies the default timeout period for the transaction. + /// + public TransactionAdvancedSettings DefaultTimeout(TimeSpan defaultTimeout) + { + if (defaultTimeout > maxTimeout) + { + throw new ConfigurationErrorsException( + "Timeout requested is longer than the maximum value for this machine. Please override using the maxTimeout setting of the system.transactions section in machine.config"); + } + + SettingsHolder.Set("Transactions.DefaultTimeout", defaultTimeout); + return this; + } + + private static TimeSpan GetMaxTimeout() + { + //default is 10 always 10 minutes + TimeSpan maxTimeout = TimeSpan.FromMinutes(10); + + var systemTransactionsGroup = ConfigurationManager.OpenMachineConfiguration() + .GetSectionGroup("system.transactions"); + + if (systemTransactionsGroup != null) + { + var machineSettings = systemTransactionsGroup.Sections.Get("machineSettings") as MachineSettingsSection; + + if (machineSettings != null) + { + maxTimeout = machineSettings.MaxTimeout; + } + } + + return maxTimeout; + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Settings/TransportSettings.cs b/src/NServiceBus.Core/Settings/TransportSettings.cs new file mode 100644 index 00000000000..1471d33662d --- /dev/null +++ b/src/NServiceBus.Core/Settings/TransportSettings.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Settings +{ + /// + /// Placeholder for the various extensions. Transports will add extension methods to this class. + /// + public class TransportSettings + { + } +} \ No newline at end of file diff --git a/src/impl/ObjectBuilder.Common/ObjectBuilder.Common.Config/SyncConfig.cs b/src/NServiceBus.Core/SyncConfig.cs similarity index 98% rename from src/impl/ObjectBuilder.Common/ObjectBuilder.Common.Config/SyncConfig.cs rename to src/NServiceBus.Core/SyncConfig.cs index da97ba7e859..5fdf63a6eab 100644 --- a/src/impl/ObjectBuilder.Common/ObjectBuilder.Common.Config/SyncConfig.cs +++ b/src/NServiceBus.Core/SyncConfig.cs @@ -1,7 +1,7 @@ -using System; - namespace NServiceBus { + using System; + /// /// Class for holding extension methods to NServiceBus.Configure /// diff --git a/src/NServiceBus.Core/TaskSchedulers/MTATaskScheduler.cs b/src/NServiceBus.Core/TaskSchedulers/MTATaskScheduler.cs new file mode 100644 index 00000000000..34cf256c307 --- /dev/null +++ b/src/NServiceBus.Core/TaskSchedulers/MTATaskScheduler.cs @@ -0,0 +1,133 @@ +//-------------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// File: StaTaskScheduler.cs +// +//-------------------------------------------------------------------------- + +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Linq; + +namespace System.Threading.Tasks.Schedulers +{ + /// Provides a scheduler that uses MTA threads. + public sealed class MTATaskScheduler : TaskScheduler, IDisposable + { + private bool disposed; + /// Stores the queued tasks to be executed by our pool of STA threads. + private BlockingCollection _tasks; + /// The MTA threads used by the scheduler. + private readonly List _threads; + + /// Initializes a new instance of the MTATaskScheduler class with the specified concurrency level. + /// The number of threads that should be created and used by this scheduler. + /// The template name form to use to name threads. + public MTATaskScheduler(int numberOfThreads, string nameFormat) + { + // Validate arguments + if (numberOfThreads < 1) throw new ArgumentOutOfRangeException("numberOfThreads"); + + // Initialize the tasks collection + _tasks = new BlockingCollection(); + + // Create the threads to be used by this scheduler + _threads = Enumerable.Range(0, numberOfThreads).Select(i => + { + var thread = new Thread(() => + { + // Continually get the next task and try to execute it. + // This will continue until the scheduler is disposed and no more tasks remain. + foreach (var t in _tasks.GetConsumingEnumerable()) + { + TryExecuteTask(t); + } + }); + thread.IsBackground = true; + thread.SetApartmentState(ApartmentState.MTA); + thread.Name = String.Format("{0} - {1}", nameFormat, thread.ManagedThreadId); + return thread; + }).ToList(); + + // Start all of the threads + _threads.ForEach(t => t.Start()); + } + + /// Queues a Task to be executed by this scheduler. + /// The task to be executed. + protected override void QueueTask(Task task) + { + // Push it into the blocking collection of tasks + _tasks.Add(task); + } + + /// Provides a list of the scheduled tasks for the debugger to consume. + /// An enumerable of all tasks currently scheduled. + protected override IEnumerable GetScheduledTasks() + { + // Serialize the contents of the blocking collection of tasks for the debugger + return _tasks.ToArray(); + } + + /// Determines whether a Task may be inlined. + /// The task to be executed. + /// Whether the task was previously queued. + /// true if the task was successfully inlined; otherwise, false. + protected override bool TryExecuteTaskInline(Task task, bool taskWasPreviouslyQueued) + { + return false; + } + + /// Gets the maximum concurrency level supported by this scheduler. + public override int MaximumConcurrencyLevel + { + get { return _threads.Count; } + } + + /// + /// Cleans up the scheduler by indicating that no more tasks will be queued. + /// This method blocks until all threads successfully shutdown. + /// + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + // Dispose managed resources. + if (_tasks != null) + { + // Indicate that no new tasks will be coming in + _tasks.CompleteAdding(); + + // Wait for all threads to finish processing tasks + foreach (var thread in _threads) + { + thread.Join(); + } + + // Cleanup + _tasks.Dispose(); + _tasks = null; + } + } + + disposed = true; + } + + ~MTATaskScheduler() + { + Dispose(false); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Timeout/ConfigureTimeoutManager.cs b/src/NServiceBus.Core/Timeout/ConfigureTimeoutManager.cs new file mode 100644 index 00000000000..0e77aecf171 --- /dev/null +++ b/src/NServiceBus.Core/Timeout/ConfigureTimeoutManager.cs @@ -0,0 +1,80 @@ +namespace NServiceBus +{ + using Features; + using Persistence.InMemory.TimeoutPersister; + using Persistence.Raven; + using Persistence.Raven.TimeoutPersister; + + public static class ConfigureTimeoutManager + { + /// + /// Use the in memory timeout persister implementation. + /// + /// + /// + public static Configure UseInMemoryTimeoutPersister(this Configure config) + { + config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + return config; + } + + /// + /// Use the Raven timeout persister implementation. + /// + /// + /// + public static Configure UseRavenTimeoutPersister(this Configure config) + { + if (!config.Configurer.HasComponent()) + config.RavenPersistence(); + + config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + + return config; + } + + + /// + /// As Timeout manager is turned on by default for server roles, use DisableTimeoutManager method to turn off Timeout manager + /// + /// + /// + public static Configure DisableTimeoutManager(this Configure config) + { + Feature.Disable(); + return config; + } + + + [ObsoleteEx(Message = "As Timeout Manager is part of the core NServiceBus functionality, it is not required to call this method any longer.", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public static Configure RunTimeoutManager(this Configure config) + { + Feature.Enable(); + return config; + } + + /// + /// Sets the default persistence to InMemory. + /// + /// + /// + [ObsoleteEx(Replacement = "UseInMemoryTimeoutPersister()", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public static Configure RunTimeoutManagerWithInMemoryPersistence(this Configure config) + { + Feature.Enable(); + + return UseInMemoryTimeoutPersister(config); + } + + /// + /// Sets the default persistence to InMemory. + /// + /// + /// + [ObsoleteEx(Replacement = "UseInMemoryTimeoutPersister()", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public static Configure DefaultToInMemoryTimeoutPersistence(this Configure config) + { + return config; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Timeout/Core/DefaultTimeoutManager.cs b/src/NServiceBus.Core/Timeout/Core/DefaultTimeoutManager.cs new file mode 100644 index 00000000000..4c0242f6901 --- /dev/null +++ b/src/NServiceBus.Core/Timeout/Core/DefaultTimeoutManager.cs @@ -0,0 +1,66 @@ +namespace NServiceBus.Timeout.Core +{ + using System; + using Transports; + + /// + /// Default implementation for + /// + public class DefaultTimeoutManager : IManageTimeouts + { + /// + /// The timeout persister. + /// + public IPersistTimeouts TimeoutsPersister { get; set; } + + /// + /// Messages sender. + /// + public ISendMessages MessageSender { get; set; } + + /// + /// Fires when a timeout is added. + /// + public event EventHandler TimeoutPushed; + + /// + /// Adds a new timeout to be monitored. + /// + /// to be added. + public void PushTimeout(TimeoutData timeout) + { + if (timeout.Time.AddSeconds(-1) <= DateTime.UtcNow) + { + MessageSender.Send(timeout.ToTransportMessage(), timeout.Destination); + return; + } + + TimeoutsPersister.Add(timeout); + + if (TimeoutPushed != null) + { + TimeoutPushed.BeginInvoke(this, timeout, ar => {}, null); + } + } + + /// + /// Removes a timeout from being monitored. + /// + /// The timeout id to be removed. + public void RemoveTimeout(string timeoutId) + { + TimeoutData timeoutData; + + TimeoutsPersister.TryRemove(timeoutId, out timeoutData); + } + + /// + /// Clears the timeout for the given . + /// + /// The sagaId to be removed + public void RemoveTimeoutBy(Guid sagaId) + { + TimeoutsPersister.RemoveTimeoutBy(sagaId); + } + } +} diff --git a/src/timeout/NServiceBus.Timeout.Core/IManageTimeouts.cs b/src/NServiceBus.Core/Timeout/Core/IManageTimeouts.cs similarity index 81% rename from src/timeout/NServiceBus.Timeout.Core/IManageTimeouts.cs rename to src/NServiceBus.Core/Timeout/Core/IManageTimeouts.cs index a43bc9a0f34..f06964b2a63 100644 --- a/src/timeout/NServiceBus.Timeout.Core/IManageTimeouts.cs +++ b/src/NServiceBus.Core/Timeout/Core/IManageTimeouts.cs @@ -1,31 +1,34 @@ -namespace NServiceBus.Timeout.Core -{ - using System; - - /// - /// Manages NSB timeouts. - /// - /// Implementors must be thread-safe. - public interface IManageTimeouts - { - /// - /// Adds a new timeout to be monitored. - /// - /// to be added. - void PushTimeout(TimeoutData timeout); - - /// - /// Removes a timeout from being monitored. - /// - /// The timeout id to be removed. - void RemoveTimeout(string timeoutId); - - /// - /// Clears the timeout for the given . - /// - /// The sagaId to be removed - void RemoveTimeoutBy(Guid sagaId); - - event EventHandler TimeoutPushed; - } -} +namespace NServiceBus.Timeout.Core +{ + using System; + + /// + /// Manages NSB timeouts. + /// + /// Implementors must be thread-safe. + public interface IManageTimeouts + { + /// + /// Adds a new timeout to be monitored. + /// + /// to be added. + void PushTimeout(TimeoutData timeout); + + /// + /// Removes a timeout from being monitored. + /// + /// The timeout id to be removed. + void RemoveTimeout(string timeoutId); + + /// + /// Clears the timeout for the given . + /// + /// The sagaId to be removed + void RemoveTimeoutBy(Guid sagaId); + + /// + /// Fires when a timeout is added. + /// + event EventHandler TimeoutPushed; + } +} diff --git a/src/NServiceBus.Core/Timeout/Core/IPersistTimeouts.cs b/src/NServiceBus.Core/Timeout/Core/IPersistTimeouts.cs new file mode 100644 index 00000000000..be21bea24dd --- /dev/null +++ b/src/NServiceBus.Core/Timeout/Core/IPersistTimeouts.cs @@ -0,0 +1,39 @@ +namespace NServiceBus.Timeout.Core +{ + using System; + using System.Collections.Generic; + + /// + /// Timeout persister contract. + /// + public interface IPersistTimeouts + { + /// + /// Retrieves the next range of timeouts that are due. + /// + /// The time where to start retrieving the next slice, the slice should exclude this date. + /// Returns the next time we should query again. + /// Returns the next range of timeouts that are due. + List> GetNextChunk(DateTime startSlice, out DateTime nextTimeToRunQuery); + + /// + /// Adds a new timeout. + /// + /// Timeout data. + void Add(TimeoutData timeout); + + /// + /// Removes the timeout if it hasn't been previously removed. + /// + /// The timeout id to remove. + /// The timeout data of the removed timeout. + /// true it the timeout was successfully removed. + bool TryRemove(string timeoutId, out TimeoutData timeoutData); + + /// + /// Removes the time by saga id. + /// + /// The saga id of the timeouts to remove. + void RemoveTimeoutBy(Guid sagaId); + } +} diff --git a/src/NServiceBus.Core/Timeout/Core/TimeoutData.cs b/src/NServiceBus.Core/Timeout/Core/TimeoutData.cs new file mode 100644 index 00000000000..ac98f3bb27f --- /dev/null +++ b/src/NServiceBus.Core/Timeout/Core/TimeoutData.cs @@ -0,0 +1,101 @@ +namespace NServiceBus.Timeout.Core +{ + using System; + using System.Collections.Generic; + + /// + /// Holds timeout information. + /// + public class TimeoutData : EventArgs + { + /// + /// Id of this timeout + /// + public string Id { get; set; } + + /// + /// The address of the client who requested the timeout. + /// + public Address Destination { get; set; } + + /// + /// The saga ID. + /// + public Guid SagaId { get; set; } + + /// + /// Additional state. + /// + public byte[] State { get; set; } + + /// + /// The time at which the timeout expires. + /// + public DateTime Time { get; set; } + + /// + /// We store the correlation id in order to preserve it across timeouts + /// + public string CorrelationId { get; set; } + + /// + /// The timeout manager that owns this particular timeout + /// + public string OwningTimeoutManager { get; set; } + + /// + /// Store the headers to preserve them across timeouts + /// + public Dictionary Headers { get; set; } + + /// + /// Returns a that represents the current . + /// + /// + /// A that represents the current . + /// + /// 2 + public override string ToString() + { + return string.Format("Timeout({0}) - Expires:{1}, SagaId:{2}", Id, Time, SagaId); + } + + /// + /// Transforms the timeout to a . + /// + /// Returns a . + public TransportMessage ToTransportMessage() + { + var replyToAddress = Address.Local; + if (Headers != null && Headers.ContainsKey(OriginalReplyToAddress)) + { + replyToAddress = Address.Parse(Headers[OriginalReplyToAddress]); + Headers.Remove(OriginalReplyToAddress); + } + + var transportMessage = new TransportMessage(Id,Headers) + { + ReplyToAddress = replyToAddress, + Recoverable = true, + CorrelationId = CorrelationId, + Body = State + }; + + + if (SagaId != Guid.Empty) + { + transportMessage.Headers[NServiceBus.Headers.SagaId] = SagaId.ToString(); + } + + + transportMessage.Headers["NServiceBus.RelatedToTimeoutId"] = Id; + + return transportMessage; + } + + /// + /// Original ReplyTo address header. + /// + public const string OriginalReplyToAddress = "NServiceBus.Timeout.ReplyToAddress"; + } +} diff --git a/src/NServiceBus.Core/Timeout/Core/TimeoutManagerDefaults.cs b/src/NServiceBus.Core/Timeout/Core/TimeoutManagerDefaults.cs new file mode 100644 index 00000000000..cbd8c6c92d7 --- /dev/null +++ b/src/NServiceBus.Core/Timeout/Core/TimeoutManagerDefaults.cs @@ -0,0 +1,12 @@ +namespace NServiceBus.Timeout.Core +{ + using Config; + + public class TimeoutManagerDefaults : IWantToRunBeforeConfiguration + { + public void Init() + { + InfrastructureServices.SetDefaultFor(typeof(DefaultTimeoutManager), DependencyLifecycle.SingleInstance); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Timeout/Core/TimeoutManagerDeferrer.cs b/src/NServiceBus.Core/Timeout/Core/TimeoutManagerDeferrer.cs new file mode 100644 index 00000000000..8cd27520d12 --- /dev/null +++ b/src/NServiceBus.Core/Timeout/Core/TimeoutManagerDeferrer.cs @@ -0,0 +1,45 @@ +namespace NServiceBus.Timeout +{ + using System; + using Logging; + using Transports; + using Unicast.Transport; + + public class TimeoutManagerDeferrer : IDeferMessages + { + public ISendMessages MessageSender { get; set; } + public Address TimeoutManagerAddress { get; set; } + + + public void Defer(TransportMessage message, DateTime processAt, Address address) + { + message.Headers[TimeoutManagerHeaders.Expire] = DateTimeExtensions.ToWireFormattedString(processAt); + + message.Headers[TimeoutManagerHeaders.RouteExpiredTimeoutTo] = address.ToString(); + + try + { + MessageSender.Send(message, TimeoutManagerAddress); + } + catch (Exception ex) + { + Log.Error( + "There was a problem deferring the message. Make sure that make sure DisableTimeoutManager was not called for your endpoint.", + ex); + throw; + } + } + + public void ClearDeferredMessages(string headerKey, string headerValue) + { + var controlMessage = ControlMessage.Create(Address.Local); + + controlMessage.Headers[headerKey] = headerValue; + controlMessage.Headers[TimeoutManagerHeaders.ClearTimeouts] = Boolean.TrueString; + + MessageSender.Send(controlMessage, TimeoutManagerAddress); + } + + static readonly ILog Log = LogManager.GetLogger(typeof (TimeoutManagerDeferrer)); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Timeout/Core/TimeoutManagerHeaders.cs b/src/NServiceBus.Core/Timeout/Core/TimeoutManagerHeaders.cs new file mode 100644 index 00000000000..f0353e896a3 --- /dev/null +++ b/src/NServiceBus.Core/Timeout/Core/TimeoutManagerHeaders.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Timeout +{ + public class TimeoutManagerHeaders + { + public const string Expire = "NServiceBus.Timeout.Expire"; + public const string RouteExpiredTimeoutTo = "NServiceBus.Timeout.RouteExpiredTimeoutTo"; + public const string ClearTimeouts = "NServiceBus.ClearTimeouts"; + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Timeout/Hosting/Windows/ManageMessageFailuresWithoutSlr.cs b/src/NServiceBus.Core/Timeout/Hosting/Windows/ManageMessageFailuresWithoutSlr.cs new file mode 100644 index 00000000000..589a42cf667 --- /dev/null +++ b/src/NServiceBus.Core/Timeout/Hosting/Windows/ManageMessageFailuresWithoutSlr.cs @@ -0,0 +1,94 @@ +namespace NServiceBus.Timeout.Hosting.Windows +{ + using System; + using Faults; + using Logging; + using Transports; + using Unicast.Queuing; + + internal class ManageMessageFailuresWithoutSlr : IManageMessageFailures + { + static readonly ILog Logger = LogManager.GetLogger(typeof(ManageMessageFailuresWithoutSlr)); + + private Address localAddress; + private readonly Address errorQueue; + + public ManageMessageFailuresWithoutSlr(IManageMessageFailures mainFailureManager) + { + var mainTransportFailureManager = mainFailureManager as Faults.Forwarder.FaultManager; + if (mainTransportFailureManager != null) + { + errorQueue = mainTransportFailureManager.ErrorQueue; + } + } + + public void SerializationFailedForMessage(TransportMessage message, Exception e) + { + SendFailureMessage(message, e, "SerializationFailed"); + } + + public void ProcessingAlwaysFailsForMessage(TransportMessage message, Exception e) + { + SendFailureMessage(message, e, "ProcessingFailed"); + } + + void SendFailureMessage(TransportMessage message, Exception e, string reason) + { + if (errorQueue == null) + { + Logger.Error("Message processing always fails for message with ID " + message.Id + ".", e); + return; + } + + SetExceptionHeaders(message, e, reason); + try + { + var sender = Configure.Instance.Builder.Build(); + + sender.Send(message, errorQueue); + } + catch (Exception exception) + { + var qnfEx = exception as QueueNotFoundException; + string errorMessage; + + if (qnfEx != null) + { + errorMessage = string.Format("Could not forward failed message to error queue '{0}' as it could not be found.", qnfEx.Queue); + Logger.Fatal(errorMessage); + } + else + { + errorMessage = "Could not forward failed message to error queue."; + Logger.Fatal(errorMessage, exception); + } + + throw new InvalidOperationException(errorMessage, exception); + } + } + + public void Init(Address address) + { + localAddress = address; + } + + void SetExceptionHeaders(TransportMessage message, Exception e, string reason) + { + message.Headers["NServiceBus.ExceptionInfo.Reason"] = reason; + message.Headers["NServiceBus.ExceptionInfo.ExceptionType"] = e.GetType().FullName; + + if (e.InnerException != null) + message.Headers["NServiceBus.ExceptionInfo.InnerExceptionType"] = e.InnerException.GetType().FullName; + + message.Headers["NServiceBus.ExceptionInfo.HelpLink"] = e.HelpLink; + message.Headers["NServiceBus.ExceptionInfo.Message"] = e.Message; + message.Headers["NServiceBus.ExceptionInfo.Source"] = e.Source; + message.Headers["NServiceBus.ExceptionInfo.StackTrace"] = e.StackTrace; + + var failedQ = localAddress ?? Address.Local; + + message.Headers[FaultsHeaderKeys.FailedQ] = failedQ.ToString(); + message.Headers["NServiceBus.TimeOfFailure"] = DateTimeExtensions.ToWireFormattedString(DateTime.UtcNow); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Timeout/Hosting/Windows/TimeoutDispatcherProcessor.cs b/src/NServiceBus.Core/Timeout/Hosting/Windows/TimeoutDispatcherProcessor.cs new file mode 100644 index 00000000000..7a453a453cb --- /dev/null +++ b/src/NServiceBus.Core/Timeout/Hosting/Windows/TimeoutDispatcherProcessor.cs @@ -0,0 +1,64 @@ +namespace NServiceBus.Timeout.Hosting.Windows +{ + using System; + using Core; + using Features; + using Satellites; + using Transports; + using Unicast.Transport; + + public class TimeoutDispatcherProcessor : IAdvancedSatellite + { + public ISendMessages MessageSender { get; set; } + + public IPersistTimeouts TimeoutsPersister { get; set; } + + public TimeoutPersisterReceiver TimeoutPersisterReceiver { get; set; } + + public Address InputAddress + { + get + { + return TimeoutManager.DispatcherAddress; + } + } + + public bool Disabled + { + get { return !Feature.IsEnabled(); } + } + + public bool Handle(TransportMessage message) + { + var timeoutId = message.Headers["Timeout.Id"]; + TimeoutData timeoutData; + + if (TimeoutsPersister.TryRemove(timeoutId, out timeoutData)) + { + MessageSender.Send(timeoutData.ToTransportMessage(), timeoutData.Destination); + } + + return true; + } + + public void Start() + { + TimeoutPersisterReceiver.Start(); + } + + public void Stop() + { + TimeoutPersisterReceiver.Stop(); + } + + public Action GetReceiverCustomization() + { + return receiver => + { + //TODO: The line below needs to change when we refactor the slr to be: + // transport.DisableSLR() or similar + receiver.FailureManager = new ManageMessageFailuresWithoutSlr(receiver.FailureManager); + }; + } + } +} diff --git a/src/NServiceBus.Core/Timeout/Hosting/Windows/TimeoutMessageProcessor.cs b/src/NServiceBus.Core/Timeout/Hosting/Windows/TimeoutMessageProcessor.cs new file mode 100644 index 00000000000..6720bc7e54e --- /dev/null +++ b/src/NServiceBus.Core/Timeout/Hosting/Windows/TimeoutMessageProcessor.cs @@ -0,0 +1,145 @@ +namespace NServiceBus.Timeout.Hosting.Windows +{ + using System; + using Core; + using Features; + using Satellites; + using Transports; + using Transports.Msmq; + using Unicast.Transport; + + + public class TimeoutMessageProcessor : IAdvancedSatellite + { + public ISendMessages MessageSender { get; set; } + + public IManageTimeouts TimeoutManager { get; set; } + + public Address InputAddress { get { return Features.TimeoutManager.InputAddress; } } + + public bool Disabled + { + get { return !Feature.IsEnabled(); } + } + + public void Start() + { + + } + + public void Stop() + { + + } + + public Action GetReceiverCustomization() + { + return receiver => + { + //TODO: The line below needs to change when we refactor the slr to be: + // transport.DisableSLR() or similar + receiver.FailureManager = new ManageMessageFailuresWithoutSlr(receiver.FailureManager); + }; + } + + public bool Handle(TransportMessage message) + { + //dispatch request will arrive at the same input so we need to make sure to call the correct handler + if (message.Headers.ContainsKey(TimeoutIdToDispatchHeader)) + HandleBackwardsCompatibility(message); + else + HandleInternal(message); + + return true; + } + + void HandleBackwardsCompatibility(TransportMessage message) + { + var timeoutId = message.Headers[TimeoutIdToDispatchHeader]; + + var destination = Address.Parse(message.Headers[TimeoutDestinationHeader]); + + //clear headers + message.Headers.Remove(TimeoutIdToDispatchHeader); + message.Headers.Remove(TimeoutDestinationHeader); + + if (message.Headers.ContainsKey(TimeoutManagerHeaders.RouteExpiredTimeoutTo)) + { + destination = Address.Parse(message.Headers[TimeoutManagerHeaders.RouteExpiredTimeoutTo]); + } + + TimeoutManager.RemoveTimeout(timeoutId); + MessageSender.Send(message, destination); + } + + void HandleInternal(TransportMessage message) + { + var sagaId = Guid.Empty; + + if (message.Headers.ContainsKey(Headers.SagaId)) + { + sagaId = Guid.Parse(message.Headers[Headers.SagaId]); + } + + if (message.Headers.ContainsKey(TimeoutManagerHeaders.ClearTimeouts)) + { + if (sagaId == Guid.Empty) + throw new InvalidOperationException("Invalid saga id specified, clear timeouts is only supported for saga instances"); + + TimeoutManager.RemoveTimeoutBy(sagaId); + } + else + { + if (!message.Headers.ContainsKey(TimeoutManagerHeaders.Expire)) + throw new InvalidOperationException("Non timeout message arrived at the timeout manager, id:" + message.Id); + + var destination = message.ReplyToAddress; + + if (message.Headers.ContainsKey(TimeoutManagerHeaders.RouteExpiredTimeoutTo)) + { + destination = Address.Parse(message.Headers[TimeoutManagerHeaders.RouteExpiredTimeoutTo]); + } + + var data = new TimeoutData + { + Destination = destination, + SagaId = sagaId, + State = message.Body, + Time = DateTimeExtensions.ToUtcDateTime(message.Headers[TimeoutManagerHeaders.Expire]), + CorrelationId = GetCorrelationIdToStore(message), + Headers = message.Headers, + OwningTimeoutManager = Configure.EndpointName + }; + + //add a temp header so that we can make sure to restore the ReplyToAddress + if (message.ReplyToAddress != null) + { + data.Headers[TimeoutData.OriginalReplyToAddress] = message.ReplyToAddress.ToString(); + } + + TimeoutManager.PushTimeout(data); + } + } + + [ObsoleteEx(Message = "No need for this in v5",RemoveInVersion ="5.0" ,TreatAsErrorFromVersion = "5.0")] + string GetCorrelationIdToStore(TransportMessage message) + { + var correlationIdToStore = message.CorrelationId; + + if (MessageSender is MsmqMessageSender) + { + Guid correlationId; + + if (Guid.TryParse(message.CorrelationId, out correlationId)) + { + correlationIdToStore = message.CorrelationId + "\\0";//msmq required the id's to be in the {guid}\{incrementing number} format so we need to fake a \0 at the end to make it compatible + } + } + + return correlationIdToStore; + } + + const string TimeoutDestinationHeader = "NServiceBus.Timeout.Destination"; + const string TimeoutIdToDispatchHeader = "NServiceBus.Timeout.TimeoutIdToDispatch"; + } +} diff --git a/src/NServiceBus.Core/Timeout/Hosting/Windows/TimeoutPersisterReceiver.cs b/src/NServiceBus.Core/Timeout/Hosting/Windows/TimeoutPersisterReceiver.cs new file mode 100644 index 00000000000..1277a383a10 --- /dev/null +++ b/src/NServiceBus.Core/Timeout/Hosting/Windows/TimeoutPersisterReceiver.cs @@ -0,0 +1,152 @@ +namespace NServiceBus.Timeout.Hosting.Windows +{ + using System; + using System.Threading; + using System.Threading.Tasks; + using CircuitBreakers; + using Core; + using Logging; + using Transports; + using Unicast.Transport; + + public class TimeoutPersisterReceiver + { + public IPersistTimeouts TimeoutsPersister { get; set; } + public ISendMessages MessageSender { get; set; } + public int SecondsToSleepBetweenPolls { get; set; } + public IManageTimeouts TimeoutManager { get; set; } + + public void Start() + { + TimeoutManager.TimeoutPushed += TimeoutsManagerOnTimeoutPushed; + + SecondsToSleepBetweenPolls = 1; + + tokenSource = new CancellationTokenSource(); + + StartPoller(); + } + + public void Stop() + { + tokenSource.Cancel(); + resetEvent.WaitOne(); + } + + void StartPoller() + { + var token = tokenSource.Token; + + Task.Factory + .StartNew(Poll, token, TaskCreationOptions.LongRunning) + .ContinueWith(t => + { + t.Exception.Handle(ex => + { + Logger.Warn("Failed to fetch timeouts from the timeout storage"); + circuitBreaker.Failure(ex); + return true; + }); + + StartPoller(); + }, TaskContinuationOptions.OnlyOnFaulted); + } + + void Poll(object obj) + { + var cancellationToken = (CancellationToken)obj; + + var startSlice = DateTime.UtcNow.AddYears(-10); + + resetEvent.Reset(); + + while (!cancellationToken.IsCancellationRequested) + { + if (nextRetrieval > DateTime.UtcNow) + { + Thread.Sleep(SecondsToSleepBetweenPolls*1000); + continue; + } + + Logger.DebugFormat("Polling for timeouts at {0}.", DateTime.Now); + + DateTime nextExpiredTimeout; + var timeoutDatas = TimeoutsPersister.GetNextChunk(startSlice, out nextExpiredTimeout); + + foreach (var timeoutData in timeoutDatas) + { + if (startSlice < timeoutData.Item2) + { + startSlice = timeoutData.Item2; + } + + MessageSender.Send(CreateTransportMessage(timeoutData.Item1), Features.TimeoutManager.DispatcherAddress); + } + + lock (lockObject) + { + //Check if nextRetrieval has been modified (This means that a push come in) and if it has check if it is earlier than nextExpiredTimeout time + if (!timeoutPushed) + { + nextRetrieval = nextExpiredTimeout; + } + else if (nextExpiredTimeout < nextRetrieval) + { + nextRetrieval = nextExpiredTimeout; + } + + timeoutPushed = false; + } + + // we cap the next retrieval to max 1 minute this will make sure that we trip the circuitbreaker if we + // loose connectivity to our storage. This will also make sure that timeouts added (during migration) direct to storage + // will be picked up after at most 1 minute + var maxNextRetrieval = DateTime.UtcNow + TimeSpan.FromMinutes(1); + + if (nextRetrieval > maxNextRetrieval) + { + nextRetrieval = maxNextRetrieval; + } + + Logger.DebugFormat("Polling next retrieval is at {0}.", nextRetrieval.ToLocalTime()); + circuitBreaker.Success(); + } + + resetEvent.Set(); + } + + static TransportMessage CreateTransportMessage(string timeoutId) + { + //use the dispatcher as the replytoaddress so that retries go back to the dispatcher q + // instead of the main endpoint q + var transportMessage = ControlMessage.Create(Features.TimeoutManager.DispatcherAddress); + + transportMessage.Headers["Timeout.Id"] = timeoutId; + + return transportMessage; + } + + void TimeoutsManagerOnTimeoutPushed(object sender, TimeoutData timeoutData) + { + lock (lockObject) + { + if (nextRetrieval > timeoutData.Time) + { + nextRetrieval = timeoutData.Time; + } + timeoutPushed = true; + } + } + + readonly object lockObject = new object(); + readonly ManualResetEvent resetEvent = new ManualResetEvent(true); + CancellationTokenSource tokenSource; + volatile bool timeoutPushed; + DateTime nextRetrieval = DateTime.UtcNow; + + readonly ICircuitBreaker circuitBreaker = new RepeatedFailuresOverTimeCircuitBreaker("TimeoutStorageConnectivity", TimeSpan.FromMinutes(2), + ex => Configure.Instance.RaiseCriticalError("Repeated failures when fetching timeouts from storage, endpoint will be terminated.", ex)); + + static readonly ILog Logger = LogManager.GetLogger(typeof(TimeoutPersisterReceiver)); + } +} diff --git a/src/NServiceBus.Core/Timeout/TimeoutManager.cs b/src/NServiceBus.Core/Timeout/TimeoutManager.cs new file mode 100644 index 00000000000..52598b085b4 --- /dev/null +++ b/src/NServiceBus.Core/Timeout/TimeoutManager.cs @@ -0,0 +1,54 @@ +namespace NServiceBus.Features +{ + using Config; + using Timeout.Core; + using Timeout.Hosting.Windows; + using Transports; + + /// + /// This feature provides message deferral based on a external timeout manager. + /// + public class TimeoutManager : Feature + { + public override bool IsEnabledByDefault + { + get + { + return true; + } + } + + public override bool ShouldBeEnabled() + { + //has the user already specified a custom deferal method + if (Configure.HasComponent()) + return false; + + //if we have a master node configured we should use that timeout manager instead + if (Configure.Instance.HasMasterNode()) + return false; + + var unicastConfig = Configure.GetConfigSection(); + + //if the user has specified another TM we don't need to run our own + if (unicastConfig != null && !string.IsNullOrWhiteSpace(unicastConfig.TimeoutManagerAddress)) + return false; + + return true; + } + + public override void Initialize() + { + DispatcherAddress = Address.Parse(Configure.EndpointName).SubScope("TimeoutsDispatcher"); + InputAddress = Address.Parse(Configure.EndpointName).SubScope("Timeouts"); + + Configure.Component(DependencyLifecycle.SingleInstance); + + InfrastructureServices.Enable(); + InfrastructureServices.Enable(); + } + + public static Address InputAddress { get; private set; } + public static Address DispatcherAddress { get; private set; } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/TransactionalConfigManager.cs b/src/NServiceBus.Core/TransactionalConfigManager.cs new file mode 100644 index 00000000000..c653743b70d --- /dev/null +++ b/src/NServiceBus.Core/TransactionalConfigManager.cs @@ -0,0 +1,86 @@ +namespace NServiceBus +{ + using System; + using System.Transactions; + + /// + /// Contains extension methods to NServiceBus.Configure + /// + public static class TransactionalConfigManager + { + /// + /// Sets the transactionality of the endpoint. + /// If true, the endpoint will not lose messages when exceptions occur. + /// If false, the endpoint may lose messages when exceptions occur. + /// + /// + /// + /// + [ObsoleteEx(Replacement = "Configure.Transactions.Enable() or Configure.Transactions.Disable()", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + public static Configure IsTransactional(this Configure config, bool value) + { + if (value) + { + Configure.Transactions.Enable(); + } + else + { + Configure.Transactions.Disable(); + } + + return config; + } + + /// + /// Sets the transactionality of the endpoint such that + /// the endpoint will not lose messages when exceptions occur. + /// + /// Is equivalent to IsTransactional(true); + /// + /// + /// + [ObsoleteEx(Replacement = "Configure.Transactions.Disable()", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + public static Configure DontUseTransactions(this Configure config) + { + Configure.Transactions.Disable(); + + return config; + } + + /// + /// Sets the isolation level that database transactions on this endpoint will run at. + /// This value is only relevant when IsTransactional has been set to true. + /// + /// Higher levels like RepeatableRead and Serializable promise a higher level + /// of consistency, but at the cost of lower parallelism and throughput. + /// + /// If you wish to run sagas on this endpoint, RepeatableRead is the suggested value. + /// + /// + /// + /// + [ObsoleteEx(Replacement = "Configure.Transactions.Advanced()", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + public static Configure IsolationLevel(this Configure config, IsolationLevel isolationLevel) + { + Configure.Transactions.Advanced(settings => settings.IsolationLevel(isolationLevel)); + + return config; + } + + /// + /// Sets the time span where a transaction will timeout. + /// + /// Most endpoints should leave it at the default. + /// + /// + /// + /// + [ObsoleteEx(Replacement = "Configure.Transactions.Advanced()", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + public static Configure TransactionTimeout(this Configure config, TimeSpan transactionTimeout) + { + Configure.Transactions.Advanced(settings => settings.DefaultTimeout(transactionTimeout)); + + return config; + } + } +} diff --git a/src/NServiceBus.Core/TransportMessage.cs b/src/NServiceBus.Core/TransportMessage.cs new file mode 100644 index 00000000000..2720a4175ab --- /dev/null +++ b/src/NServiceBus.Core/TransportMessage.cs @@ -0,0 +1,208 @@ +using System; +using System.Collections.Generic; + +namespace NServiceBus +{ + using IdGeneration; + using Support; + + /// + /// An envelope used by NServiceBus to package messages for transmission. + /// + /// + /// All messages sent and received by NServiceBus are wrapped in this class. + /// More than one message can be bundled in the envelope to be transmitted or + /// received by the bus. + /// + [Serializable] + public class TransportMessage + { + /// + /// Initializes the transport message with a CombGuid as identifier + /// + public TransportMessage() + { + id = CombGuid.Generate().ToString(); + Headers[NServiceBus.Headers.MessageId] = id; + CorrelationId = id; + Headers.Add(NServiceBus.Headers.OriginatingEndpoint, Configure.EndpointName); + Headers.Add(NServiceBus.Headers.OriginatingMachine, RuntimeEnvironment.MachineName); + MessageIntent = MessageIntentEnum.Send; + } + + /// + /// Creates a new TransportMessage with the given id and headers + /// + /// + /// + public TransportMessage(string existingId, Dictionary existingHeaders) + { + if (existingHeaders == null) + existingHeaders = new Dictionary(); + + headers = existingHeaders; + + + id = existingId; + + //only update the "stable id" if there isn't one present already + if (!Headers.ContainsKey(NServiceBus.Headers.MessageId)) + { + Headers[NServiceBus.Headers.MessageId] = existingId; + } + } + + /// + /// Gets/sets the identifier of this message bundle. + /// + public string Id + { + get + { + if (!Headers.ContainsKey(NServiceBus.Headers.MessageId)) + { + return id; + } + + return Headers[NServiceBus.Headers.MessageId]; + } + } + + string id; + + /// + /// Use this method to change the stable ID of the given message. + /// + /// + internal void ChangeMessageId(string newId) + { + id = newId; + CorrelationId = newId; + } + + /// + /// Gets/sets the identifier that is copied to . + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Id")] + public string IdForCorrelation + { + get + { + return Id; + } + } + + /// + /// Gets/sets the unique identifier of another message bundle + /// this message bundle is associated with. + /// + public string CorrelationId + { + get { + + string correlationId; + + if (Headers.TryGetValue(NServiceBus.Headers.CorrelationId, out correlationId)) + return correlationId; + + return null; + } + set + { + Headers[NServiceBus.Headers.CorrelationId] = value; + } + } + + /// + /// Gets/sets the reply-to address of the message bundle - replaces 'ReturnAddress'. + /// + public Address ReplyToAddress { get; set; } + + /// + /// Gets/sets whether or not the message is supposed to + /// be guaranteed deliverable. + /// + public bool Recoverable { get; set; } + + /// + /// Indicates to the infrastructure the message intent (publish, or regular send). + /// + public MessageIntentEnum MessageIntent + { + get + { + MessageIntentEnum messageIntent = default(MessageIntentEnum); + + if (Headers.ContainsKey(NServiceBus.Headers.MessageIntent)) + { + MessageIntentEnum.TryParse(Headers[NServiceBus.Headers.MessageIntent], true, out messageIntent); + } + + return messageIntent; + } + set { Headers[NServiceBus.Headers.MessageIntent] = value.ToString(); } + } + + + + private TimeSpan timeToBeReceived = TimeSpan.MaxValue; + + /// + /// Gets/sets the maximum time limit in which the message bundle + /// must be received. + /// + public TimeSpan TimeToBeReceived + { + get { return timeToBeReceived; } + set { timeToBeReceived = value; } + } + + /// + /// Gets/sets other applicative out-of-band information. + /// + public Dictionary Headers + { + get { return headers; } + } + + + readonly Dictionary headers = new Dictionary(); + + /// + /// Gets/sets a byte array to the body content of the message + /// + public byte[] Body + { + get { return body; } + set { UpdateBody(value); } + } + + /// + /// Use this method to update the body if this message + /// + /// + void UpdateBody(byte[] updatedBody) + { + //preserve the original body if needed + if (body != null && originalBody == null) + { + originalBody = new byte[body.Length]; + Buffer.BlockCopy(body, 0, originalBody, 0, body.Length); + } + + body = updatedBody; + } + + /// + /// Makes sure that the body is reset to the exact state as it was when the message was created + /// + internal void RevertToOriginalBodyIfNeeded() + { + if (originalBody != null) + body = originalBody; + } + + byte[] body; + byte[] originalBody; + } +} diff --git a/src/NServiceBus.Core/Transports/IConfigureTransport.cs b/src/NServiceBus.Core/Transports/IConfigureTransport.cs new file mode 100644 index 00000000000..6839d5ab1ae --- /dev/null +++ b/src/NServiceBus.Core/Transports/IConfigureTransport.cs @@ -0,0 +1,66 @@ +namespace NServiceBus.Transports +{ + using System; + using Features; + using Settings; + using Unicast.Transport; + + /// + /// Configures the given transport using the default settings + /// + public interface IConfigureTransport + { + void Configure(Configure config); + } + + + /// + /// The generic counterpart to IConfigureTransports + /// + /// + public interface IConfigureTransport : IConfigureTransport where T : TransportDefinition { } + + public abstract class ConfigureTransport : Feature, IConfigureTransport where T : TransportDefinition + { + public void Configure(Configure config) + { + var connectionString = TransportConnectionString.GetConnectionStringOrNull(); + + if (connectionString == null && RequiresConnectionString) + { + throw new InvalidOperationException(String.Format(Message, GetConfigFileIfExists(), typeof(T).Name, ExampleConnectionStringForErrorMessage)); + } + + SettingsHolder.Set("NServiceBus.Transport.ConnectionString", connectionString); + SettingsHolder.Set("NServiceBus.Transport.SelectedTransport", Activator.CreateInstance()); + + InternalConfigure(config); + } + + protected abstract void InternalConfigure(Configure config); + + protected abstract string ExampleConnectionStringForErrorMessage { get; } + + protected virtual bool RequiresConnectionString + { + get { return true; } + } + + + static string GetConfigFileIfExists() + { + return AppDomain.CurrentDomain.SetupInformation.ConfigurationFile ?? "App.config"; + } + + const string Message = + @"No default connection string found in your config file ({0}) for the {1} Transport. + +To run NServiceBus with {1} Transport you need to specify the database connectionstring. +Here is an example of what is required: + + + + "; + + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/ICreateQueues.cs b/src/NServiceBus.Core/Transports/ICreateQueues.cs new file mode 100644 index 00000000000..32ea15cee6f --- /dev/null +++ b/src/NServiceBus.Core/Transports/ICreateQueues.cs @@ -0,0 +1,15 @@ +namespace NServiceBus.Transports +{ + /// + /// Abstraction of the capability to create queues + /// + public interface ICreateQueues + { + /// + /// Create a messages queue where its name is the address parameter, for the given account. + /// + /// + /// + void CreateQueueIfNecessary(Address address, string account); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/IDeferMessages.cs b/src/NServiceBus.Core/Transports/IDeferMessages.cs new file mode 100644 index 00000000000..a65596837a7 --- /dev/null +++ b/src/NServiceBus.Core/Transports/IDeferMessages.cs @@ -0,0 +1,25 @@ +namespace NServiceBus.Transports +{ + using System; + + /// + /// Called when the bus wants to defer a message + /// + public interface IDeferMessages + { + /// + /// Defers the given message that will be processed at the given time + /// + /// + /// + /// The endpoint of the endpoint who should get the message + void Defer(TransportMessage message, DateTime processAt, Address address); + + /// + /// Clears all timeouts for the given header + /// + /// + /// + void ClearDeferredMessages(string headerKey, string headerValue); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/IDequeueMessages.cs b/src/NServiceBus.Core/Transports/IDequeueMessages.cs new file mode 100644 index 00000000000..48fa5b0004c --- /dev/null +++ b/src/NServiceBus.Core/Transports/IDequeueMessages.cs @@ -0,0 +1,32 @@ +namespace NServiceBus.Transports +{ + using System; + using Unicast.Transport; + using Unicast.Transport.Transactional; + + /// + /// Interface to implement when developing custom dequeuing strategies. + /// + public interface IDequeueMessages + { + /// + /// Initializes the . + /// + /// The address to listen on. + /// The to be used by . + /// Called when a message has been dequeued and is ready for processing. + /// Needs to be called by after the message has been processed regardless if the outcome was successful or not. + void Init(Address address, TransactionSettings transactionSettings, Func tryProcessMessage, Action endProcessMessage); + + /// + /// Starts the dequeuing of message using the specified . + /// + /// Indicates the maximum concurrency level this is able to support. + void Start(int maximumConcurrencyLevel); + + /// + /// Stops the dequeuing of messages. + /// + void Stop(); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/IManageSubscriptions.cs b/src/NServiceBus.Core/Transports/IManageSubscriptions.cs new file mode 100644 index 00000000000..a1dda49d772 --- /dev/null +++ b/src/NServiceBus.Core/Transports/IManageSubscriptions.cs @@ -0,0 +1,10 @@ +namespace NServiceBus.Transports +{ + using System; + + public interface IManageSubscriptions + { + void Subscribe(Type eventType, Address publisherAddress); + void Unsubscribe(Type eventType, Address publisherAddress); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/IPublishMessages.cs b/src/NServiceBus.Core/Transports/IPublishMessages.cs new file mode 100644 index 00000000000..f9beb9a22f3 --- /dev/null +++ b/src/NServiceBus.Core/Transports/IPublishMessages.cs @@ -0,0 +1,18 @@ +namespace NServiceBus.Transports +{ + using System; + using System.Collections.Generic; + + /// + /// Requests a message to be published + /// + public interface IPublishMessages + { + /// + /// Publishes the given messages to all known subscribers + /// + /// + /// + bool Publish(TransportMessage message, IEnumerable eventTypes); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/ISendMessages.cs b/src/NServiceBus.Core/Transports/ISendMessages.cs new file mode 100644 index 00000000000..665cf9702f0 --- /dev/null +++ b/src/NServiceBus.Core/Transports/ISendMessages.cs @@ -0,0 +1,15 @@ +namespace NServiceBus.Transports +{ + /// + /// Abstraction of the capability to send messages. + /// + public interface ISendMessages + { + /// + /// Sends the given to the . + /// + /// to send. + /// Destination . + void Send(TransportMessage message, Address address); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/Msmq/Config/CheckMachineNameForComplianceWithDTCLimitation.cs b/src/NServiceBus.Core/Transports/Msmq/Config/CheckMachineNameForComplianceWithDTCLimitation.cs new file mode 100644 index 00000000000..749f81f6280 --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/Config/CheckMachineNameForComplianceWithDTCLimitation.cs @@ -0,0 +1,52 @@ +namespace NServiceBus.Transports.Msmq.Config +{ + using System.Runtime.InteropServices; + using System.Text; + using Features; + using Logging; + using NServiceBus.Config; + + enum COMPUTER_NAME_FORMAT + { + ComputerNameNetBIOS, + ComputerNameDnsHostname, + ComputerNameDnsDomain, + ComputerNameDnsFullyQualified, + ComputerNamePhysicalNetBIOS, + ComputerNamePhysicalDnsHostname, + ComputerNamePhysicalDnsDomain, + ComputerNamePhysicalDnsFullyQualified + } + + + /// + /// Make sure NETBios name is shorter than 15 characters. + /// See DTCPing warning + /// + public class CheckMachineNameForComplianceWithDtcLimitation : IWantToRunWhenConfigurationIsComplete + { + [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Auto)] + static extern bool GetComputerNameEx(COMPUTER_NAME_FORMAT nameType, [Out] StringBuilder lpBuffer, ref uint lpnSize); + + static readonly ILog Logger = LogManager.GetLogger(typeof(CheckMachineNameForComplianceWithDtcLimitation)); + + /// + /// Method invoked to run custom code. + /// + public void Run() + { + if (!Feature.IsEnabled()) + return; + + uint capacity = 24; + var buffer = new StringBuilder((int)capacity); + if (!GetComputerNameEx(COMPUTER_NAME_FORMAT.ComputerNameNetBIOS, buffer, ref capacity)) + return; + var netbiosName = buffer.ToString(); + if (netbiosName.Length <= 15) return; + + Logger.Warn(string.Format( + "NetBIOS name [{0}] is longer than 15 characters. Shorten it for DTC to work. See: http://particular.net/articles/dtcping-warning-the-cid-values-for-both-test-machines-are-the-same", netbiosName)); + } + } +} diff --git a/src/NServiceBus.Core/Transports/Msmq/Config/ConfigureMsmqMessageQueue.cs b/src/NServiceBus.Core/Transports/Msmq/Config/ConfigureMsmqMessageQueue.cs new file mode 100644 index 00000000000..e6b19413d05 --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/Config/ConfigureMsmqMessageQueue.cs @@ -0,0 +1,19 @@ +namespace NServiceBus +{ + /// + /// Configuration class for MSMQ transport. + /// + public static class ConfigureMsmqMessageQueue + { + /// + /// Use MSMQ for your queuing infrastructure. + /// + /// + /// + [ObsoleteEx(Message = "Please use UsingTransport on your IConfigureThisEndpoint class or the other option is using the fluent API .UseTransport()")] + public static Configure MsmqTransport(this Configure config) + { + return config.UseTransport(); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/Msmq/Config/Msmq.cs b/src/NServiceBus.Core/Transports/Msmq/Config/Msmq.cs new file mode 100644 index 00000000000..44b9b95fcd5 --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/Config/Msmq.cs @@ -0,0 +1,12 @@ +namespace NServiceBus +{ + using Transports; + + /// + /// Transport definition for MSMQ + /// + public class Msmq : TransportDefinition + { + + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/Msmq/Config/MsmqSettings.cs b/src/NServiceBus.Core/Transports/Msmq/Config/MsmqSettings.cs new file mode 100644 index 00000000000..21f0d3c47ed --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/Config/MsmqSettings.cs @@ -0,0 +1,39 @@ +namespace NServiceBus.Transports.Msmq.Config +{ + /// + /// Runtime settings for the Msmq transport + /// + public class MsmqSettings + { + + /// + /// Constructs the settings class with defaults + /// + public MsmqSettings() + { + UseDeadLetterQueue = true; + UseConnectionCache = true; + UseTransactionalQueues = true; + } + + /// + /// Determines if the dead letter queue should be used + /// + public bool UseDeadLetterQueue { get; set; } + + /// + /// Determines if journaling should be activated + /// + public bool UseJournalQueue { get; set; } + + /// + /// Gets or sets a value that indicates whether a cache of connections will be maintained by the application. + /// + public bool UseConnectionCache { get; set; } + + /// + /// Detmines if the system uses transactional queues + /// + public bool UseTransactionalQueues { get; set; } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/Msmq/Config/MsmqTransport.cs b/src/NServiceBus.Core/Transports/Msmq/Config/MsmqTransport.cs new file mode 100644 index 00000000000..8757177c159 --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/Config/MsmqTransport.cs @@ -0,0 +1,75 @@ +namespace NServiceBus.Features +{ + using Config; + using Logging; + using Settings; + using Transports; + using Transports.Msmq; + using Transports.Msmq.Config; + + public class MsmqTransport:ConfigureTransport + { + public override void Initialize() + { + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + NServiceBus.Configure.Component(DependencyLifecycle.SingleInstance); + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(p => p.PurgeOnStartup, ConfigurePurging.PurgeRequested); + + var cfg = NServiceBus.Configure.GetConfigSection(); + + var settings = new MsmqSettings(); + if (cfg != null) + { + settings.UseJournalQueue = cfg.UseJournalQueue; + settings.UseDeadLetterQueue = cfg.UseDeadLetterQueue; + + Logger.Warn(Message); + } + else + { + var connectionString = SettingsHolder.Get("NServiceBus.Transport.ConnectionString"); + + if (connectionString != null) + { + settings = new MsmqConnectionStringBuilder(connectionString).RetrieveSettings(); + } + } + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(t => t.Settings, settings); + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(t => t.Settings, settings); + } + + protected override void InternalConfigure(Configure config) + { + Enable(); + Enable(); + + //for backwards compatibility + SettingsHolder.SetDefault("SerializationSettings.WrapSingleMessages", true); + } + + protected override string ExampleConnectionStringForErrorMessage + { + get { return "cacheSendConnection=true;journal=false;deadLetter=true"; } + } + + protected override bool RequiresConnectionString + { + get { return false; } + } + + private static readonly ILog Logger = LogManager.GetLogger(typeof(ConfigureMsmqMessageQueue)); + + private const string Message = + @" +MsmqMessageQueueConfig section has been deprecated in favor of using a connectionString instead. +Here is an example of what is required: + + + "; + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/Msmq/CorrelationIdMutatorForBackwardsCompatibilityWithV3.cs b/src/NServiceBus.Core/Transports/Msmq/CorrelationIdMutatorForBackwardsCompatibilityWithV3.cs new file mode 100644 index 00000000000..1c865596544 --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/CorrelationIdMutatorForBackwardsCompatibilityWithV3.cs @@ -0,0 +1,27 @@ +namespace NServiceBus.Transports.Msmq +{ + using System; + using MessageMutator; + + [ObsoleteEx(Message = "Remove this in v5",RemoveInVersion ="5.0",TreatAsErrorFromVersion = "5.0")] + public class CorrelationIdMutatorForBackwardsCompatibilityWithV3 : IMutateOutgoingTransportMessages + { + public void MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + if (transportMessage.Headers.ContainsKey(CorrIdHeader)) + return; + + var correlationIdToUse = transportMessage.CorrelationId; + Guid correlationId; + + if (Guid.TryParse(correlationIdToUse, out correlationId)) + { + //msmq requires the id's to be in the {guid}\{incrementing number} format so we need to fake a \0 at the end to make it compatible + correlationIdToUse += "\\0"; + } + transportMessage.Headers[CorrIdHeader] = correlationIdToUse; + } + + static string CorrIdHeader = "CorrId"; + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/Msmq/HeaderInfo.cs b/src/NServiceBus.Core/Transports/Msmq/HeaderInfo.cs new file mode 100644 index 00000000000..dab4dafce67 --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/HeaderInfo.cs @@ -0,0 +1,21 @@ +namespace NServiceBus.Transports.Msmq +{ + using System; + + /// + /// Represents the structure of header information passed in a TransportMessage. + /// + [Serializable] + public class HeaderInfo + { + /// + /// The key used to lookup the value in the header collection. + /// + public string Key { get; set; } + + /// + /// The value stored under the key in the header collection. + /// + public string Value { get; set; } + } +} diff --git a/src/NServiceBus.Core/Transports/Msmq/MsmqDequeueStrategy.cs b/src/NServiceBus.Core/Transports/Msmq/MsmqDequeueStrategy.cs new file mode 100644 index 00000000000..886afd91bb2 --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/MsmqDequeueStrategy.cs @@ -0,0 +1,343 @@ +namespace NServiceBus.Transports.Msmq +{ + using System; + using System.Diagnostics; + using System.Messaging; + using System.Security.Principal; + using System.Threading; + using System.Threading.Tasks; + using System.Transactions; + using CircuitBreakers; + using Logging; + using Support; + using Unicast.Transport; + + /// + /// Default implementation of for MSMQ. + /// + public class MsmqDequeueStrategy : IDequeueMessages + { + /// + /// Purges the queue on startup. + /// + public bool PurgeOnStartup { get; set; } + + /// + /// Msmq unit of work to be used in non DTC mode . + /// + public MsmqUnitOfWork UnitOfWork { get; set; } + + /// + /// Initializes the . + /// + /// The address to listen on. + /// The to be used by . + /// Called when a message has been dequeued and is ready for processing. + /// Needs to be called by after the message has been processed regardless if the outcome was successful or not. + public void Init(Address address, TransactionSettings settings, Func tryProcessMessage, Action endProcessMessage) + { + this.tryProcessMessage = tryProcessMessage; + this.endProcessMessage = endProcessMessage; + endpointAddress = address; + transactionSettings = settings; + + if (address == null) + { + throw new ArgumentException("Input queue must be specified"); + } + + if (!address.Machine.Equals(RuntimeEnvironment.MachineName, StringComparison.OrdinalIgnoreCase)) + { + throw new InvalidOperationException( + string.Format("Input queue [{0}] must be on the same machine as this process [{1}].", + address, RuntimeEnvironment.MachineName)); + } + + transactionOptions = new TransactionOptions { IsolationLevel = transactionSettings.IsolationLevel, Timeout = transactionSettings.TransactionTimeout }; + + queue = new MessageQueue(MsmqUtilities.GetFullPath(address), false, true, QueueAccessMode.Receive); + + if (transactionSettings.IsTransactional && !QueueIsTransactional()) + { + throw new ArgumentException("Queue must be transactional if you configure your endpoint to be transactional (" + address + ")."); + } + + var mpf = new MessagePropertyFilter(); + mpf.SetAll(); + + queue.MessageReadPropertyFilter = mpf; + + if (PurgeOnStartup) + { + queue.Purge(); + } + } + + /// + /// Starts the dequeuing of message using the specified . + /// + /// The maximum concurrency level supported. + public void Start(int maximumConcurrencyLevel) + { + semaphore = new SemaphoreSlim(maximumConcurrencyLevel, maximumConcurrencyLevel); + + queue.PeekCompleted += OnPeekCompleted; + + CallPeekWithExceptionHandling(() => queue.BeginPeek()); + } + + /// + /// Stops the dequeuing of messages. + /// + public void Stop() + { + queue.PeekCompleted -= OnPeekCompleted; + + stopResetEvent.WaitOne(); + + semaphore.Dispose(); + queue.Dispose(); + } + + private bool QueueIsTransactional() + { + try + { + return queue.Transactional; + } + catch (Exception ex) + { + throw new InvalidOperationException( + string.Format( + "There is a problem with the input queue: {0}. See the enclosed exception for details.", + queue.Path), ex); + } + } + + private void OnPeekCompleted(object sender, PeekCompletedEventArgs peekCompletedEventArgs) + { + stopResetEvent.Reset(); + + CallPeekWithExceptionHandling(() => queue.EndPeek(peekCompletedEventArgs.AsyncResult)); + + semaphore.Wait(); + + Task.Factory + .StartNew(Action, CancellationToken.None, TaskCreationOptions.LongRunning, TaskScheduler.Default) + .ContinueWith(task => + { + task.Exception.Handle(ex => + { + Logger.Error("Error processing message.", ex); + return true; + }); + }, TaskContinuationOptions.OnlyOnFaulted); + + //We using an AutoResetEvent here to make sure we do not call another BeginPeek before the Receive has been called + peekResetEvent.WaitOne(); + + CallPeekWithExceptionHandling(() => queue.BeginPeek()); + + stopResetEvent.Set(); + } + + private void Action() + { + Exception exception = null; + TransportMessage transportMessage = null; + try + { + Message message; + if (transactionSettings.IsTransactional) + { + if (transactionSettings.DontUseDistributedTransactions) + { + using (var msmqTransaction = new MessageQueueTransaction()) + { + msmqTransaction.Begin(); + message = ReceiveMessage(() => queue.Receive(receiveTimeout, msmqTransaction)); + + if (message == null) + { + msmqTransaction.Commit(); + return; + } + + UnitOfWork.SetTransaction(msmqTransaction); + + transportMessage = ConvertMessage(message); + + if (ProcessMessage(transportMessage)) + { + msmqTransaction.Commit(); + } + else + { + msmqTransaction.Abort(); + } + + UnitOfWork.ClearTransaction(); + } + } + else + { + using (var scope = new TransactionScope(TransactionScopeOption.Required, transactionOptions)) + { + + message = ReceiveMessage(() => queue.Receive(receiveTimeout, MessageQueueTransactionType.Automatic)); + + if (message == null) + { + scope.Complete(); + return; + } + + transportMessage = ConvertMessage(message); + + if (ProcessMessage(transportMessage)) + { + scope.Complete(); + } + } + + } + } + else + { + message = ReceiveMessage(() => queue.Receive(receiveTimeout, MessageQueueTransactionType.None)); + + if (message == null) + { + return; + } + + transportMessage = ConvertMessage(message); + + ProcessMessage(transportMessage); + } + } + catch (Exception ex) + { + exception = ex; + } + finally + { + endProcessMessage(transportMessage, exception); + + semaphore.Release(); + } + } + + void CallPeekWithExceptionHandling(Action action) + { + try + { + action(); + } + catch (MessageQueueException mqe) + { + string errorException = string.Format("Failed to peek messages from [{0}].", queue.FormatName); + + if (mqe.MessageQueueErrorCode == MessageQueueErrorCode.AccessDenied) + { + WindowsIdentity windowsIdentity = WindowsIdentity.GetCurrent(); + + errorException = + string.Format( + "Do not have permission to access queue [{0}]. Make sure that the current user [{1}] has permission to Send, Receive, and Peek from this queue.", + queue.FormatName, + windowsIdentity != null + ? windowsIdentity.Name + : "Unknown User"); + } + + OnCriticalExceptionEncountered(new InvalidOperationException(errorException, mqe)); + } + } + + bool ProcessMessage(TransportMessage message) + { + if (message != null) + { + return tryProcessMessage(message); + } + + return true; + } + + TransportMessage ConvertMessage(Message message) + { + try + { + return MsmqUtilities.Convert(message); + } + catch (Exception ex) + { + Logger.Error("Error in converting message to TransportMessage.", ex); + + return new TransportMessage(Guid.Empty.ToString(),null); + } + } + + [DebuggerNonUserCode] + Message ReceiveMessage(Func receive) + { + Message message = null; + try + { + message = receive(); + } + catch (MessageQueueException mqe) + { + if (mqe.MessageQueueErrorCode == MessageQueueErrorCode.IOTimeout) + { + //We should only get an IOTimeout exception here if another process removed the message between us peeking and now. + } + + string errorException = string.Format("Failed to peek messages from [{0}].", queue.FormatName); + + if (mqe.MessageQueueErrorCode == MessageQueueErrorCode.AccessDenied) + { + WindowsIdentity windowsIdentity = WindowsIdentity.GetCurrent(); + + errorException = + string.Format( + "Do not have permission to access queue [{0}]. Make sure that the current user [{1}] has permission to Send, Receive, and Peek from this queue.", + queue.FormatName, + windowsIdentity != null + ? windowsIdentity.Name + : "Unknown User"); + } + + OnCriticalExceptionEncountered(new InvalidOperationException(errorException, mqe)); + } + catch (Exception ex) + { + Logger.Error("Error in receiving messages.", ex); + } + finally + { + peekResetEvent.Set(); + } + return message; + } + + void OnCriticalExceptionEncountered(Exception ex) + { + circuitBreaker.Execute(() => Configure.Instance.RaiseCriticalError("Error in receiving messages.", ex)); + } + + readonly CircuitBreaker circuitBreaker = new CircuitBreaker(100, TimeSpan.FromSeconds(30)); + Func tryProcessMessage; + static readonly ILog Logger = LogManager.GetLogger(typeof(MsmqDequeueStrategy)); + readonly ManualResetEvent stopResetEvent = new ManualResetEvent(true); + readonly TimeSpan receiveTimeout = TimeSpan.FromSeconds(1); + readonly AutoResetEvent peekResetEvent = new AutoResetEvent(false); + MessageQueue queue; + SemaphoreSlim semaphore; + TransactionSettings transactionSettings; + Address endpointAddress; + TransactionOptions transactionOptions; + Action endProcessMessage; + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/Msmq/MsmqMessageSender.cs b/src/NServiceBus.Core/Transports/Msmq/MsmqMessageSender.cs new file mode 100644 index 00000000000..9b1b918129a --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/MsmqMessageSender.cs @@ -0,0 +1,110 @@ +namespace NServiceBus.Transports.Msmq +{ + using System; + using System.Messaging; + using System.Threading; + using System.Transactions; + using Config; + using Settings; + using Unicast.Queuing; + + /// + /// Msmq implementation of . + /// + public class MsmqMessageSender : ISendMessages + { + /// + /// The current runtime settings for the transport + /// + public MsmqSettings Settings { get; set; } + + /// + /// Msmq unit of work to be used in non DTC mode . + /// + public MsmqUnitOfWork UnitOfWork { get; set; } + + + + /// + /// Sends the given to the . + /// + /// + /// to send. + /// + /// + /// Destination . + /// + public void Send(TransportMessage message, Address address) + { + string queuePath = MsmqUtilities.GetFullPath(address); + try + { + using (var q = new MessageQueue(queuePath, false, Settings.UseConnectionCache, QueueAccessMode.Send)) + { + using (Message toSend = MsmqUtilities.Convert(message)) + { + toSend.UseDeadLetterQueue = Settings.UseDeadLetterQueue; + toSend.UseJournalQueue = Settings.UseJournalQueue; + + if (message.ReplyToAddress != null) + toSend.ResponseQueue = + new MessageQueue(MsmqUtilities.GetReturnAddress(message.ReplyToAddress.ToString(), + address.ToString())); + + if (UnitOfWork.HasActiveTransaction()) + { + q.Send(toSend, UnitOfWork.Transaction); + } + else + { + q.Send(toSend, GetTransactionTypeForSend()); + } + } + } + } + catch (MessageQueueException ex) + { + if (ex.MessageQueueErrorCode == MessageQueueErrorCode.QueueNotFound) + { + string msg = address == null + ? "Failed to send message. Target address is null." + : string.Format("Failed to send message to address: [{0}]", address); + + throw new QueueNotFoundException(address, msg, ex); + } + + ThrowFailedToSendException(address, ex); + } + catch (Exception ex) + { + ThrowFailedToSendException(address, ex); + } + } + + static void ThrowFailedToSendException(Address address, Exception ex) + { + if (address == null) + throw new FailedToSendMessageException("Failed to send message.", ex); + + throw new FailedToSendMessageException( + string.Format("Failed to send message to address: {0}@{1}", address.Queue, address.Machine), ex); + } + + MessageQueueTransactionType GetTransactionTypeForSend() + { + if (!Settings.UseTransactionalQueues) + { + return MessageQueueTransactionType.None; + } + + if (SettingsHolder.Get("Transactions.SuppressDistributedTransactions")) + { + return MessageQueueTransactionType.Single; + } + + return Transaction.Current != null + ? MessageQueueTransactionType.Automatic + : MessageQueueTransactionType.Single; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/Msmq/MsmqQueueCreator.cs b/src/NServiceBus.Core/Transports/Msmq/MsmqQueueCreator.cs new file mode 100644 index 00000000000..a645f53baf7 --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/MsmqQueueCreator.cs @@ -0,0 +1,116 @@ +namespace NServiceBus.Transports.Msmq +{ + using System; + using System.Messaging; + using System.Security.Principal; + using Config; + using Logging; + using Support; + + public class MsmqQueueCreator : ICreateQueues + { + private static readonly ILog Logger = LogManager.GetLogger(typeof(MsmqQueueCreator)); + private static readonly string LocalAdministratorsGroupName = new SecurityIdentifier(WellKnownSidType.BuiltinAdministratorsSid, null).Translate(typeof(NTAccount)).ToString(); + private static readonly string LocalEveryoneGroupName = new SecurityIdentifier(WellKnownSidType.WorldSid, null).Translate(typeof(NTAccount)).ToString(); + private static readonly string LocalAnonymousLogonName = new SecurityIdentifier(WellKnownSidType.AnonymousSid, null).Translate(typeof(NTAccount)).ToString(); + + /// + /// The current runtime settings + /// + public MsmqSettings Settings { get; set; } + + + /// + /// Utility method for creating a queue if it does not exist. + /// + ///Queue path to create + ///The account to be given permissions to the queue + public void CreateQueueIfNecessary(Address address, string account) + { + if (address == null) + return; + + var q = GetFullPathWithoutPrefix(address); + + var isRemote = address.Machine.ToLower() != RuntimeEnvironment.MachineName.ToLower(); + if (isRemote) + { + Logger.Debug("Queue is on remote machine."); + Logger.Debug("If this does not succeed (like if the remote machine is disconnected), processing will continue."); + } + + Logger.Debug(String.Format("Checking if queue exists: {0}.", address)); + + try + { + if (MessageQueue.Exists(q)) + { + Logger.Debug("Queue exists, going to set permissions."); + SetPermissionsForQueue(q, account); + return; + } + + Logger.Warn("Queue " + q + " does not exist."); + Logger.Debug("Going to create queue: " + q); + + CreateQueue(q, account, Settings.UseTransactionalQueues); + } + catch (MessageQueueException ex) + { + if (isRemote && (ex.MessageQueueErrorCode == MessageQueueErrorCode.IllegalQueuePathName)) + { + return; + } + Logger.Error(String.Format("Could not create queue {0} or check its existence. Processing will still continue.", address), ex); + } + catch (Exception ex) + { + Logger.Error(String.Format("Could not create queue {0} or check its existence. Processing will still continue.", address), ex); + } + } + /// + /// Create named message queue + /// + ///Queue path + ///The account to be given permissions to the queue + /// If volatileQueues is true then create a non-transactional message queue + private static void CreateQueue(string queueName, string account, bool transactional) + { + MessageQueue.Create(queueName, transactional); + + SetPermissionsForQueue(queueName, account); + + Logger.DebugFormat("Created queue, path: [{0}], account: [{1}], transactional: [{2}]", queueName, account, transactional); + } + /// + /// Sets default permissions for queue. + /// + /// + /// + private static void SetPermissionsForQueue(string queue, string account) + { + var q = new MessageQueue(queue); + + q.SetPermissions(LocalAdministratorsGroupName, MessageQueueAccessRights.FullControl, AccessControlEntryType.Allow); + q.SetPermissions(LocalEveryoneGroupName, MessageQueueAccessRights.WriteMessage, AccessControlEntryType.Allow); + q.SetPermissions(LocalAnonymousLogonName, MessageQueueAccessRights.WriteMessage, AccessControlEntryType.Allow); + + q.SetPermissions(account, MessageQueueAccessRights.WriteMessage, AccessControlEntryType.Allow); + q.SetPermissions(account, MessageQueueAccessRights.ReceiveMessage, AccessControlEntryType.Allow); + q.SetPermissions(account, MessageQueueAccessRights.PeekMessage, AccessControlEntryType.Allow); + } + + /// + /// Returns the full path without Format or direct os + /// from an address. + /// + /// + /// + public static string GetFullPathWithoutPrefix(Address address) + { + return address.Machine + MsmqUtilities.PRIVATE + address.Queue; + } + + } + +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/Msmq/MsmqUnitOfWork.cs b/src/NServiceBus.Core/Transports/Msmq/MsmqUnitOfWork.cs new file mode 100644 index 00000000000..edd839a8a6d --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/MsmqUnitOfWork.cs @@ -0,0 +1,29 @@ +namespace NServiceBus.Transports.Msmq +{ + using System.Messaging; + using System.Threading; + + public class MsmqUnitOfWork + { + public void SetTransaction(MessageQueueTransaction msmqTransaction) + { + currentTransaction.Value = msmqTransaction; + } + + public bool HasActiveTransaction() + { + return currentTransaction.IsValueCreated; + } + + public MessageQueueTransaction Transaction + { + get { return currentTransaction.Value; } + } + public void ClearTransaction() + { + currentTransaction.Value = null; + } + + readonly ThreadLocal currentTransaction = new ThreadLocal(); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/Msmq/MsmqUtilities.cs b/src/NServiceBus.Core/Transports/Msmq/MsmqUtilities.cs new file mode 100644 index 00000000000..b0f66d0e28f --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/MsmqUtilities.cs @@ -0,0 +1,293 @@ +namespace NServiceBus.Transports.Msmq +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Messaging; + using System.Net; + using System.Net.NetworkInformation; + using System.Xml; + using System.Xml.Serialization; + using Logging; + + /// + /// MSMQ-related utility functions + /// + public class MsmqUtilities + { + /// + /// Turns a '@' separated value into a full path. + /// Format is 'queue@machine', or 'queue@ipaddress' + /// + /// + /// + public static string GetFullPath(Address value) + { + IPAddress ipAddress; + if (IPAddress.TryParse(value.Machine, out ipAddress)) + return PREFIX_TCP + MsmqQueueCreator.GetFullPathWithoutPrefix(value); + + return PREFIX + MsmqQueueCreator.GetFullPathWithoutPrefix(value); + } + + /// + /// Gets the name of the return address from the provided value. + /// If the target includes a machine name, uses the local machine name in the returned value + /// otherwise uses the local IP address in the returned value. + /// + /// + /// + /// + public static string GetReturnAddress(string value, string target) + { + return GetReturnAddress(Address.Parse(value), Address.Parse(target)); + } + + /// + /// Gets the name of the return address from the provided value. + /// If the target includes a machine name, uses the local machine name in the returned value + /// otherwise uses the local IP address in the returned value. + /// + /// + /// + /// + public static string GetReturnAddress(Address value, Address target) + { + var machine = target.Machine; + + IPAddress targetIpAddress; + + //see if the target is an IP address, if so, get our own local ip address + if (IPAddress.TryParse(machine, out targetIpAddress)) + { + if (string.IsNullOrEmpty(localIp)) + localIp = LocalIpAddress(targetIpAddress); + + return PREFIX_TCP + localIp + PRIVATE + value.Queue; + } + + return PREFIX + MsmqQueueCreator.GetFullPathWithoutPrefix(value); + } + + static string LocalIpAddress(IPAddress targetIpAddress) + { + var networkInterfaces = NetworkInterface.GetAllNetworkInterfaces(); + + var availableAddresses = + networkInterfaces.Where( + ni => + ni.OperationalStatus == OperationalStatus.Up && + ni.NetworkInterfaceType != NetworkInterfaceType.Loopback) + .SelectMany(ni => ni.GetIPProperties().UnicastAddresses).ToList(); + + var firstWithMatchingFamily = + availableAddresses.FirstOrDefault(a => a.Address.AddressFamily == targetIpAddress.AddressFamily); + + if (firstWithMatchingFamily != null) + return firstWithMatchingFamily.Address.ToString(); + + var fallbackToDifferentFamily = availableAddresses.FirstOrDefault(); + + if (fallbackToDifferentFamily != null) + return fallbackToDifferentFamily.Address.ToString(); + + return "127.0.0.1"; + } + + static string localIp; + + /// + /// Gets an independent address for the queue in the form: + /// queue@machine. + /// + /// + /// + public static Address GetIndependentAddressForQueue(MessageQueue q) + { + if (q == null) + return null; + + string[] arr = q.FormatName.Split('\\'); + string queueName = arr[arr.Length - 1]; + + int directPrefixIndex = arr[0].IndexOf(DIRECTPREFIX); + if (directPrefixIndex >= 0) + return new Address(queueName, arr[0].Substring(directPrefixIndex + DIRECTPREFIX.Length)); + + int tcpPrefixIndex = arr[0].IndexOf(DIRECTPREFIX_TCP); + if (tcpPrefixIndex >= 0) + return new Address(queueName, arr[0].Substring(tcpPrefixIndex + DIRECTPREFIX_TCP.Length)); + + try + { + // the pessimistic approach failed, try the optimistic approach + arr = q.QueueName.Split('\\'); + queueName = arr[arr.Length - 1]; + return new Address(queueName, q.MachineName); + } + catch + { + throw new Exception("Could not translate format name to independent name: " + q.FormatName); + } + } + + /// + /// Converts an MSMQ message to a TransportMessage. + /// + /// + /// + public static TransportMessage Convert(Message m) + { + var headers = DeserializeMessageHeaders(m); + + var result = new TransportMessage(m.Id, headers) + { + Recoverable = m.Recoverable, + TimeToBeReceived = m.TimeToBeReceived, + ReplyToAddress = GetIndependentAddressForQueue(m.ResponseQueue) + }; + + result.CorrelationId = GetCorrelationId(m, headers); + + if (Enum.IsDefined(typeof(MessageIntentEnum), m.AppSpecific)) + result.MessageIntent = (MessageIntentEnum)m.AppSpecific; + + m.BodyStream.Position = 0; + result.Body = new byte[m.BodyStream.Length]; + m.BodyStream.Read(result.Body, 0, result.Body.Length); + + return result; + } + + static string GetCorrelationId(Message message, Dictionary headers) + { + string correlationId; + + if (headers.TryGetValue(Headers.CorrelationId, out correlationId)) + return correlationId; + + if (message.CorrelationId == "00000000-0000-0000-0000-000000000000\\0") + return null; + + //msmq required the id's to be in the {guid}\{incrementing number} format so we need to fake a \0 at the end that the sender added to make it compatible + //The replace can be removed in v5 since only v3 messages will need this + return message.CorrelationId.Replace("\\0", ""); + } + + static Dictionary DeserializeMessageHeaders(Message m) + { + var result = new Dictionary(); + + if (m.Extension.Length == 0) + { + return result; + } + + //This is to make us compatible with v3 messages that are affected by this bug: + //http://stackoverflow.com/questions/3779690/xml-serialization-appending-the-0-backslash-0-or-null-character + var extension = System.Text.Encoding.UTF8.GetString(m.Extension).TrimEnd('\0'); + object o; + using (var stream = new StringReader(extension)) + { + using (var reader = XmlReader.Create(stream, new XmlReaderSettings { CheckCharacters = false })) + { + o = headerSerializer.Deserialize(reader); + } + } + + foreach (var pair in o as List) + { + if (pair.Key != null) + { + result.Add(pair.Key, pair.Value); + } + } + + return result; + } + + /// + /// Converts a TransportMessage to an Msmq message. + /// Doesn't set the ResponseQueue of the result. + /// + /// + /// + public static Message Convert(TransportMessage message) + { + var result = new Message(); + + if (message.Body != null) + { + result.BodyStream = new MemoryStream(message.Body); + } + + + AssignMsmqNativeCorrelationId(message, result); + + result.Recoverable = message.Recoverable; + + if (message.TimeToBeReceived < MessageQueue.InfiniteTimeout) + { + result.TimeToBeReceived = message.TimeToBeReceived; + } + + using (var stream = new MemoryStream()) + { + headerSerializer.Serialize(stream, message.Headers.Select(pair => new HeaderInfo { Key = pair.Key, Value = pair.Value }).ToList()); + result.Extension = stream.ToArray(); + } + + result.AppSpecific = (int)message.MessageIntent; + + return result; + } + + static void AssignMsmqNativeCorrelationId(TransportMessage message, Message result) + { + + if (string.IsNullOrEmpty(message.CorrelationId)) + { + return; + } + + Guid correlationId; + + if (Guid.TryParse(message.CorrelationId, out correlationId)) + { + //msmq required the id's to be in the {guid}\{incrementing number} format so we need to fake a \0 at the end to make it compatible + result.CorrelationId = message.CorrelationId + "\\0"; + return; + } + + try + { + if (message.CorrelationId.Contains("\\")) + { + var parts = message.CorrelationId.Split('\\'); + + int number; + + if (parts.Count() == 2 && Guid.TryParse(parts.First(), out correlationId) && + int.TryParse(parts[1], out number)) + { + result.CorrelationId = message.CorrelationId; + } + } + + } + catch (Exception ex) + { + Logger.Warn("Failed to assign a native correlation id for message: " + message.Id, ex); + } + } + + const string DIRECTPREFIX = "DIRECT=OS:"; + static readonly string DIRECTPREFIX_TCP = "DIRECT=TCP:"; + readonly static string PREFIX_TCP = "FormatName:" + DIRECTPREFIX_TCP; + static readonly string PREFIX = "FormatName:" + DIRECTPREFIX; + static readonly XmlSerializer headerSerializer = new XmlSerializer(typeof(List)); + internal const string PRIVATE = "\\private$\\"; + static ILog Logger = LogManager.GetLogger(typeof(MsmqUtilities)); + } +} diff --git a/src/NServiceBus.Core/Transports/Msmq/Scripts/Reset-Msmq.ps1 b/src/NServiceBus.Core/Transports/Msmq/Scripts/Reset-Msmq.ps1 new file mode 100644 index 00000000000..b0bdf5129c7 --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/Scripts/Reset-Msmq.ps1 @@ -0,0 +1,3 @@ +[Reflection.Assembly]::LoadWithPartialName("System.Messaging") + +[System.Messaging.MessageQueue]::GetPrivateQueuesByMachine("localhost") | % {".\" + $_.QueueName} | % {[System.Messaging.MessageQueue]::Delete($_); } \ No newline at end of file diff --git a/src/NServiceBus.Core/Transports/Msmq/WorkerAvailabilityManager/DistributorStorageQueueCreator.cs b/src/NServiceBus.Core/Transports/Msmq/WorkerAvailabilityManager/DistributorStorageQueueCreator.cs new file mode 100644 index 00000000000..37421bfce19 --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/WorkerAvailabilityManager/DistributorStorageQueueCreator.cs @@ -0,0 +1,32 @@ +namespace NServiceBus.Transports.Msmq.WorkerAvailabilityManager +{ + using Unicast.Queuing; + + /// + /// Signal to create the queue to store worker availability information. + /// + public class DistributorStorageQueueCreator : IWantQueueCreated + { + /// + /// Holds storage queue address. + /// + public MsmqWorkerAvailabilityManager MsmqWorkerAvailabilityManager { get; set; } + + /// + /// Address of Distributor storage queue. + /// + public Address Address + { + get { + return MsmqWorkerAvailabilityManager == null ? null : MsmqWorkerAvailabilityManager.StorageQueueAddress; + } + } + /// + /// Disabling the creation of the distributor storage queue + /// + public bool IsDisabled + { + get { return (!Configure.Instance.Configurer.HasComponent()); } + } + } +} diff --git a/src/NServiceBus.Core/Transports/Msmq/WorkerAvailabilityManager/MsmqWorkerAvailabilityManager.cs b/src/NServiceBus.Core/Transports/Msmq/WorkerAvailabilityManager/MsmqWorkerAvailabilityManager.cs new file mode 100644 index 00000000000..920db7c2ddd --- /dev/null +++ b/src/NServiceBus.Core/Transports/Msmq/WorkerAvailabilityManager/MsmqWorkerAvailabilityManager.cs @@ -0,0 +1,153 @@ +namespace NServiceBus.Transports.Msmq.WorkerAvailabilityManager +{ + using System; + using System.Diagnostics; + using System.Linq; + using System.Messaging; + using System.Threading; + using Distributor; + using Settings; + using Msmq; + + /// + /// An implementation of for MSMQ to be used + /// with the class. + /// + public class MsmqWorkerAvailabilityManager : IWorkerAvailabilityManager + { + /// + /// Msmq unit of work to be used in non DTC mode . + /// + public MsmqUnitOfWork UnitOfWork { get; set; } + + /// + /// Sets the path to the queue that will be used for storing + /// worker availability. + /// + /// The queue provided must be transactional. + public Address StorageQueueAddress { get; set; } + + /// + /// Removes all entries from the worker availability queue + /// with the specified address. + /// + /// + /// The address of the worker to remove from the availability list. + /// + public void ClearAvailabilityForWorker(Address address) + { + lock (lockObject) + { + var messages = storageQueue.GetAllMessages(); + + foreach (var m in messages.Where(m => MsmqUtilities.GetIndependentAddressForQueue(m.ResponseQueue) == address)) + { + if (UnitOfWork.HasActiveTransaction()) + { + storageQueue.ReceiveById(m.Id, UnitOfWork.Transaction); + } + else + { + storageQueue.ReceiveById(m.Id, MessageQueueTransactionType.Automatic); + } + + + } + } + } + + /// + /// Pops the next available worker from the available worker queue + /// and returns its address. + /// + [DebuggerNonUserCode] + public Address PopAvailableWorker() + { + if (!Monitor.TryEnter(lockObject)) + { + return null; + } + + try + { + Message availableWorker; + + if (UnitOfWork.HasActiveTransaction()) + { + availableWorker = storageQueue.Receive(MaxTimeToWaitForAvailableWorker, UnitOfWork.Transaction); + } + else + { + availableWorker = storageQueue.Receive(MaxTimeToWaitForAvailableWorker, MessageQueueTransactionType.Automatic); + } + + if (availableWorker == null) + { + return null; + } + + return MsmqUtilities.GetIndependentAddressForQueue(availableWorker.ResponseQueue); + } + catch (Exception) + { + return null; + } + finally + { + Monitor.Exit(lockObject); + } + } + + /// + /// Initializes the object. + /// + public void Start() + { + var path = MsmqUtilities.GetFullPath(StorageQueueAddress); + + storageQueue = new MessageQueue(path); + + if ((!storageQueue.Transactional) && (SettingsHolder.Get("Transactions.Enabled"))) + { + throw new Exception(string.Format("Queue [{0}] must be transactional.", path)); + } + } + + public void Stop() + { + if (storageQueue != null) + { + storageQueue.Dispose(); + } + } + + /// + /// Signal that a worker is available to receive a dispatched message. + /// + /// + /// The address of the worker that will accept the dispatched message. + /// + /// The number of messages that this worker is ready to process + public void WorkerAvailable(Address address, int capacity) + { + var returnAddress = new MessageQueue(MsmqUtilities.GetFullPath(address)); + + for (var i = 0; i < capacity; i++) + { + if (UnitOfWork.HasActiveTransaction()) + { + storageQueue.Send(new Message{ResponseQueue = returnAddress}, UnitOfWork.Transaction); + } + else + { + storageQueue.Send(new Message{ResponseQueue = returnAddress}, MessageQueueTransactionType.Automatic); + } + } + } + + static TimeSpan MaxTimeToWaitForAvailableWorker = TimeSpan.FromSeconds(10); + + MessageQueue storageQueue; + readonly object lockObject = new object(); + } +} diff --git a/src/NServiceBus.Core/Transports/TransportDefinition.cs b/src/NServiceBus.Core/Transports/TransportDefinition.cs new file mode 100644 index 00000000000..4cccaec79d4 --- /dev/null +++ b/src/NServiceBus.Core/Transports/TransportDefinition.cs @@ -0,0 +1,18 @@ +namespace NServiceBus.Transports +{ + /// + /// Defines a transport that can be used by NServiceBus + /// + public abstract class TransportDefinition + { + /// + /// Indicates that the transport is capable of supporting the publish and subscribe pattern natively + /// + public bool HasNativePubSubSupport { get; protected set; } + + /// + /// Indicates that the transport has a central store for subscriptions + /// + public bool HasSupportForCentralizedPubSub { get; protected set; } + } +} \ No newline at end of file diff --git a/src/forms/TrialExpired.Designer.cs b/src/NServiceBus.Core/TrialExpired.Designer.cs similarity index 78% rename from src/forms/TrialExpired.Designer.cs rename to src/NServiceBus.Core/TrialExpired.Designer.cs index 247f72e5940..58fe7464fae 100644 --- a/src/forms/TrialExpired.Designer.cs +++ b/src/NServiceBus.Core/TrialExpired.Designer.cs @@ -1,293 +1,290 @@ -namespace NServiceBus.Forms -{ - partial class TrialExpired - { - /// - /// 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(TrialExpired)); - this.panel1 = new System.Windows.Forms.Panel(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.label1 = new System.Windows.Forms.Label(); - this.browseButton = new System.Windows.Forms.Button(); - this.errorMessageLabel = new System.Windows.Forms.Label(); - this.selectedFileExpirationDateLabel = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.timer = new System.Windows.Forms.Timer(this.components); - this.requestButton = new System.Windows.Forms.Button(); - this.ignoreButton = new System.Windows.Forms.Button(); - this.errorPanel = new System.Windows.Forms.Panel(); - this.pictureBox2 = new System.Windows.Forms.PictureBox(); - this.completePanel = new System.Windows.Forms.Panel(); - this.pictureBox3 = new System.Windows.Forms.PictureBox(); - this.label4 = new System.Windows.Forms.Label(); - this.panel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.errorPanel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); - this.completePanel.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); - this.SuspendLayout(); - // - // panel1 - // - this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.panel1.BackColor = System.Drawing.Color.White; - this.panel1.Controls.Add(this.pictureBox1); - this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(484, 90); - this.panel1.TabIndex = 0; - // - // pictureBox1 - // - this.pictureBox1.Image = global::NServiceBus.Forms.Properties.Resources.logo; - this.pictureBox1.InitialImage = global::NServiceBus.Forms.Properties.Resources.logo; - this.pictureBox1.Location = new System.Drawing.Point(77, 7); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(330, 77); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.pictureBox1.TabIndex = 0; - this.pictureBox1.TabStop = false; - // - // label1 - // - this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.ForeColor = System.Drawing.Color.White; - this.label1.Location = new System.Drawing.Point(7, 97); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(467, 48); - this.label1.TabIndex = 2; - this.label1.Text = "Unfortunately your license has expired. But, you can get a free license that will" + - " allow you to continue working.\r\n"; - // - // browseButton - // - this.browseButton.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.browseButton.BackColor = System.Drawing.Color.White; - this.browseButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.browseButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.browseButton.Location = new System.Drawing.Point(192, 258); - this.browseButton.Name = "browseButton"; - this.browseButton.Size = new System.Drawing.Size(101, 31); - this.browseButton.TabIndex = 2; - this.browseButton.Text = "Browse..."; - this.browseButton.UseVisualStyleBackColor = false; - this.browseButton.Click += new System.EventHandler(this.browseButton_Click); - // - // errorMessageLabel - // - this.errorMessageLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.errorMessageLabel.ForeColor = System.Drawing.Color.White; - this.errorMessageLabel.Location = new System.Drawing.Point(34, 3); - this.errorMessageLabel.Name = "errorMessageLabel"; - this.errorMessageLabel.Size = new System.Drawing.Size(348, 24); - this.errorMessageLabel.TabIndex = 5; - this.errorMessageLabel.Text = "The file you have selected is not valid."; - this.errorMessageLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // selectedFileExpirationDateLabel - // - this.selectedFileExpirationDateLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.selectedFileExpirationDateLabel.ForeColor = System.Drawing.Color.White; - this.selectedFileExpirationDateLabel.Location = new System.Drawing.Point(34, 26); - this.selectedFileExpirationDateLabel.Name = "selectedFileExpirationDateLabel"; - this.selectedFileExpirationDateLabel.Size = new System.Drawing.Size(348, 24); - this.selectedFileExpirationDateLabel.TabIndex = 6; - this.selectedFileExpirationDateLabel.Text = "Expiration Date: "; - // - // label2 - // - this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label2.BackColor = System.Drawing.SystemColors.Info; - this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label2.ForeColor = System.Drawing.Color.Black; - this.label2.Location = new System.Drawing.Point(51, 188); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(387, 21); - this.label2.TabIndex = 8; - this.label2.Text = "This warning will continue to appear until a valid license is provided."; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label3 - // - this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label3.ForeColor = System.Drawing.Color.White; - this.label3.Location = new System.Drawing.Point(47, 233); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(391, 24); - this.label3.TabIndex = 9; - this.label3.Text = "Once you have received your license, enter it here:"; - // - // timer - // - this.timer.Enabled = true; - this.timer.Interval = 2000; - this.timer.Tick += new System.EventHandler(this.timer_Tick); - // - // requestButton - // - this.requestButton.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.requestButton.BackColor = System.Drawing.Color.White; - this.requestButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.requestButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.requestButton.Location = new System.Drawing.Point(51, 148); - this.requestButton.Name = "requestButton"; - this.requestButton.Size = new System.Drawing.Size(165, 31); - this.requestButton.TabIndex = 0; - this.requestButton.Text = "Get a free license"; - this.requestButton.UseVisualStyleBackColor = false; - this.requestButton.Click += new System.EventHandler(this.requestButton_Click); - // - // ignoreButton - // - this.ignoreButton.Anchor = System.Windows.Forms.AnchorStyles.Top; - this.ignoreButton.BackColor = System.Drawing.Color.White; - this.ignoreButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.ignoreButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.ignoreButton.Location = new System.Drawing.Point(273, 148); - this.ignoreButton.Name = "ignoreButton"; - this.ignoreButton.Size = new System.Drawing.Size(165, 31); - this.ignoreButton.TabIndex = 1; - this.ignoreButton.Text = "Ignore"; - this.ignoreButton.UseVisualStyleBackColor = false; - this.ignoreButton.Click += new System.EventHandler(this.ignoreButton_Click); - // - // errorPanel - // - this.errorPanel.Controls.Add(this.pictureBox2); - this.errorPanel.Controls.Add(this.errorMessageLabel); - this.errorPanel.Controls.Add(this.selectedFileExpirationDateLabel); - this.errorPanel.Location = new System.Drawing.Point(19, 293); - this.errorPanel.Name = "errorPanel"; - this.errorPanel.Size = new System.Drawing.Size(419, 54); - this.errorPanel.TabIndex = 12; - this.errorPanel.Visible = false; - // - // pictureBox2 - // - this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image"))); - this.pictureBox2.InitialImage = ((System.Drawing.Image)(resources.GetObject("pictureBox2.InitialImage"))); - this.pictureBox2.Location = new System.Drawing.Point(4, 3); - this.pictureBox2.Name = "pictureBox2"; - this.pictureBox2.Size = new System.Drawing.Size(29, 29); - this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pictureBox2.TabIndex = 7; - this.pictureBox2.TabStop = false; - // - // completePanel - // - this.completePanel.Controls.Add(this.pictureBox3); - this.completePanel.Controls.Add(this.label4); - this.completePanel.Location = new System.Drawing.Point(19, 293); - this.completePanel.Name = "completePanel"; - this.completePanel.Size = new System.Drawing.Size(419, 43); - this.completePanel.TabIndex = 13; - this.completePanel.Visible = false; - // - // pictureBox3 - // - this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image"))); - this.pictureBox3.InitialImage = ((System.Drawing.Image)(resources.GetObject("pictureBox3.InitialImage"))); - this.pictureBox3.Location = new System.Drawing.Point(4, 3); - this.pictureBox3.Name = "pictureBox3"; - this.pictureBox3.Size = new System.Drawing.Size(29, 29); - this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pictureBox3.TabIndex = 7; - this.pictureBox3.TabStop = false; - // - // label4 - // - this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label4.ForeColor = System.Drawing.Color.White; - this.label4.Location = new System.Drawing.Point(34, 3); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(348, 29); - this.label4.TabIndex = 5; - this.label4.Text = "License file installed correctly"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; - // - // TrialExpired - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Gray; - this.ClientSize = new System.Drawing.Size(484, 296); - this.Controls.Add(this.completePanel); - this.Controls.Add(this.ignoreButton); - this.Controls.Add(this.requestButton); - this.Controls.Add(this.label3); - this.Controls.Add(this.label2); - this.Controls.Add(this.browseButton); - this.Controls.Add(this.label1); - this.Controls.Add(this.panel1); - this.Controls.Add(this.errorPanel); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = global::NServiceBus.Forms.Properties.Resources.form_icon; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "TrialExpired"; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; - this.Text = "NServiceBus - Trial Expired"; - this.panel1.ResumeLayout(false); - this.panel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.errorPanel.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); - this.completePanel.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button browseButton; - private System.Windows.Forms.Label errorMessageLabel; - private System.Windows.Forms.Label selectedFileExpirationDateLabel; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Timer timer; - private System.Windows.Forms.Button requestButton; - private System.Windows.Forms.Button ignoreButton; - private System.Windows.Forms.Panel errorPanel; - private System.Windows.Forms.PictureBox pictureBox2; - private System.Windows.Forms.Panel completePanel; - private System.Windows.Forms.PictureBox pictureBox3; - private System.Windows.Forms.Label label4; - } +namespace NServiceBus.Forms +{ + partial class TrialExpired + { + /// + /// 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(TrialExpired)); + this.panel1 = new System.Windows.Forms.Panel(); + this.pictureBox1 = new System.Windows.Forms.PictureBox(); + this.label1 = new System.Windows.Forms.Label(); + this.browseButton = new System.Windows.Forms.Button(); + this.errorMessageLabel = new System.Windows.Forms.Label(); + this.selectedFileExpirationDateLabel = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.timer = new System.Windows.Forms.Timer(this.components); + this.ignoreButton = new System.Windows.Forms.Button(); + this.errorPanel = new System.Windows.Forms.Panel(); + this.pictureBox2 = new System.Windows.Forms.PictureBox(); + this.completePanel = new System.Windows.Forms.Panel(); + this.pictureBox3 = new System.Windows.Forms.PictureBox(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.panel1.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); + this.errorPanel.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); + this.completePanel.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).BeginInit(); + this.SuspendLayout(); + // + // panel1 + // + this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.panel1.BackColor = System.Drawing.Color.Black; + this.panel1.Controls.Add(this.pictureBox1); + this.panel1.Location = new System.Drawing.Point(0, 0); + this.panel1.Name = "panel1"; + this.panel1.Size = new System.Drawing.Size(563, 90); + this.panel1.TabIndex = 0; + // + // pictureBox1 + // + this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); + this.pictureBox1.InitialImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.InitialImage"))); + this.pictureBox1.Location = new System.Drawing.Point(43, 12); + this.pictureBox1.Name = "pictureBox1"; + this.pictureBox1.Size = new System.Drawing.Size(286, 65); + this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.pictureBox1.TabIndex = 0; + this.pictureBox1.TabStop = false; + // + // label1 + // + this.label1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label1.ForeColor = System.Drawing.Color.Black; + this.label1.Location = new System.Drawing.Point(39, 105); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(546, 48); + this.label1.TabIndex = 2; + this.label1.Text = "Thank you for using Particular Software NServiceBus."; + this.label1.Click += new System.EventHandler(this.label1_Click); + // + // browseButton + // + this.browseButton.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.browseButton.BackColor = System.Drawing.Color.Gainsboro; + this.browseButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.browseButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.browseButton.Location = new System.Drawing.Point(174, 256); + this.browseButton.Name = "browseButton"; + this.browseButton.Size = new System.Drawing.Size(101, 31); + this.browseButton.TabIndex = 2; + this.browseButton.Text = "Browse..."; + this.browseButton.UseVisualStyleBackColor = false; + this.browseButton.Click += new System.EventHandler(this.browseButton_Click); + // + // errorMessageLabel + // + this.errorMessageLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.errorMessageLabel.ForeColor = System.Drawing.Color.White; + this.errorMessageLabel.Location = new System.Drawing.Point(34, 3); + this.errorMessageLabel.Name = "errorMessageLabel"; + this.errorMessageLabel.Size = new System.Drawing.Size(348, 24); + this.errorMessageLabel.TabIndex = 5; + this.errorMessageLabel.Text = "The file you have selected is not valid."; + this.errorMessageLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // selectedFileExpirationDateLabel + // + this.selectedFileExpirationDateLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.selectedFileExpirationDateLabel.ForeColor = System.Drawing.Color.White; + this.selectedFileExpirationDateLabel.Location = new System.Drawing.Point(34, 26); + this.selectedFileExpirationDateLabel.Name = "selectedFileExpirationDateLabel"; + this.selectedFileExpirationDateLabel.Size = new System.Drawing.Size(348, 24); + this.selectedFileExpirationDateLabel.TabIndex = 6; + this.selectedFileExpirationDateLabel.Text = "Expiration Date: "; + // + // label3 + // + this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label3.ForeColor = System.Drawing.Color.White; + this.label3.Location = new System.Drawing.Point(47, 233); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(470, 24); + this.label3.TabIndex = 9; + this.label3.Text = "Once you have received your license, enter it here:"; + // + // timer + // + this.timer.Enabled = true; + this.timer.Interval = 2000; + this.timer.Tick += new System.EventHandler(this.timer_Tick); + // + // ignoreButton + // + this.ignoreButton.Anchor = System.Windows.Forms.AnchorStyles.Top; + this.ignoreButton.BackColor = System.Drawing.Color.Gainsboro; + this.ignoreButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; + this.ignoreButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.ignoreButton.Location = new System.Drawing.Point(43, 256); + this.ignoreButton.Name = "ignoreButton"; + this.ignoreButton.Size = new System.Drawing.Size(111, 31); + this.ignoreButton.TabIndex = 1; + this.ignoreButton.Text = "Purchase"; + this.ignoreButton.UseVisualStyleBackColor = false; + this.ignoreButton.Click += new System.EventHandler(this.ignoreButton_Click); + // + // errorPanel + // + this.errorPanel.Controls.Add(this.pictureBox2); + this.errorPanel.Controls.Add(this.errorMessageLabel); + this.errorPanel.Controls.Add(this.selectedFileExpirationDateLabel); + this.errorPanel.Location = new System.Drawing.Point(19, 293); + this.errorPanel.Name = "errorPanel"; + this.errorPanel.Size = new System.Drawing.Size(419, 54); + this.errorPanel.TabIndex = 12; + this.errorPanel.Visible = false; + // + // pictureBox2 + // + this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image"))); + this.pictureBox2.InitialImage = ((System.Drawing.Image)(resources.GetObject("pictureBox2.InitialImage"))); + this.pictureBox2.Location = new System.Drawing.Point(4, 3); + this.pictureBox2.Name = "pictureBox2"; + this.pictureBox2.Size = new System.Drawing.Size(29, 29); + this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.pictureBox2.TabIndex = 7; + this.pictureBox2.TabStop = false; + // + // completePanel + // + this.completePanel.Controls.Add(this.pictureBox3); + this.completePanel.Controls.Add(this.label4); + this.completePanel.Location = new System.Drawing.Point(19, 293); + this.completePanel.Name = "completePanel"; + this.completePanel.Size = new System.Drawing.Size(419, 43); + this.completePanel.TabIndex = 13; + this.completePanel.Visible = false; + // + // pictureBox3 + // + this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image"))); + this.pictureBox3.InitialImage = ((System.Drawing.Image)(resources.GetObject("pictureBox3.InitialImage"))); + this.pictureBox3.Location = new System.Drawing.Point(4, 3); + this.pictureBox3.Name = "pictureBox3"; + this.pictureBox3.Size = new System.Drawing.Size(29, 29); + this.pictureBox3.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.pictureBox3.TabIndex = 7; + this.pictureBox3.TabStop = false; + // + // label4 + // + this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label4.ForeColor = System.Drawing.Color.White; + this.label4.Location = new System.Drawing.Point(34, 3); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(348, 29); + this.label4.TabIndex = 5; + this.label4.Text = "License file installed correctly"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // label5 + // + this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label5.ForeColor = System.Drawing.Color.Black; + this.label5.Location = new System.Drawing.Point(39, 207); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(546, 26); + this.label5.TabIndex = 14; + this.label5.Text = "Please purchase a license online or browse for a license file"; + this.label5.Click += new System.EventHandler(this.label5_Click); + // + // label6 + // + this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.label6.ForeColor = System.Drawing.Color.Black; + this.label6.Location = new System.Drawing.Point(39, 142); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(546, 32); + this.label6.TabIndex = 15; + this.label6.Text = "The trial period has ended and a license is needed to continue"; + // + // TrialExpired + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.BackColor = System.Drawing.Color.White; + this.ClientSize = new System.Drawing.Size(563, 322); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.completePanel); + this.Controls.Add(this.ignoreButton); + this.Controls.Add(this.label3); + this.Controls.Add(this.browseButton); + this.Controls.Add(this.label1); + this.Controls.Add(this.panel1); + this.Controls.Add(this.errorPanel); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "TrialExpired"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "NServiceBus - Trial Expired"; + this.panel1.ResumeLayout(false); + this.panel1.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); + this.errorPanel.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); + this.completePanel.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.pictureBox3)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.Panel panel1; + private System.Windows.Forms.PictureBox pictureBox1; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Button browseButton; + private System.Windows.Forms.Label errorMessageLabel; + private System.Windows.Forms.Label selectedFileExpirationDateLabel; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Timer timer; + private System.Windows.Forms.Button ignoreButton; + private System.Windows.Forms.Panel errorPanel; + private System.Windows.Forms.PictureBox pictureBox2; + private System.Windows.Forms.Panel completePanel; + private System.Windows.Forms.PictureBox pictureBox3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + } } \ No newline at end of file diff --git a/src/forms/TrialExpired.cs b/src/NServiceBus.Core/TrialExpired.cs similarity index 93% rename from src/forms/TrialExpired.cs rename to src/NServiceBus.Core/TrialExpired.cs index 30cccb46bfe..f8ef94abcff 100644 --- a/src/forms/TrialExpired.cs +++ b/src/NServiceBus.Core/TrialExpired.cs @@ -1,110 +1,115 @@ -namespace NServiceBus.Forms -{ - using System; - using System.Diagnostics; - using System.Threading; - using System.Windows.Forms; - - public partial class TrialExpired : Form - { - public TrialExpired() - { - InitializeComponent(); - } - - public Func ValidateLicenseFile { get; set; } - - public DateTime CurrentLicenseExpireDate { get; set; } - - public void DisplayError() - { - errorPanel.Visible = true; - errorMessageLabel.Text = "The file you have selected is not valid."; - selectedFileExpirationDateLabel.Text = String.Empty; - Height = 376; - } - - public void DisplayExpiredLicenseError(DateTime expirationDate) - { - errorPanel.Visible = true; - errorMessageLabel.Text = "The license file you have selected is expired."; - selectedFileExpirationDateLabel.Text = String.Format("Expiration Date: {0}", expirationDate.ToLocalTime().ToShortDateString()); - Height = 376; - } - - private void browseButton_Click(object sender, EventArgs e) - { - var close = false; - - using (var openDialog = new OpenFileDialog()) - { - openDialog.InitializeLifetimeService(); - openDialog.Filter = "License files (*.xml)|*.xml|All files (*.*)|*.*"; - openDialog.Title = "Select License file"; - - if (ShowDialogInSTA(openDialog) == DialogResult.OK) - { - string licenseFileSelected = openDialog.FileName; - - if (ValidateLicenseFile(this, licenseFileSelected)) - { - close = true; - } - } - } - - if (close) - { - browseButton.Enabled = false; - errorPanel.Visible = false; - completePanel.Visible = true; - Height = 376; - - timer.Tick += delegate - { - timer.Enabled = false; - DialogResult = DialogResult.OK; - }; - - timer.Interval = 5000; - timer.Enabled = true; - } - } - - //When calling a OpenFileDialog it needs to be done from an STA thread model otherwise it throws: - //"Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process." - private static DialogResult ShowDialogInSTA(FileDialog dialog) - { - var result = DialogResult.Cancel; - - var thread = new Thread(() => - { - result = dialog.ShowDialog(); - }); - - thread.SetApartmentState(ApartmentState.STA); - thread.Start(); - thread.Join(); - - return result; - } - - private void timer_Tick(object sender, EventArgs e) - { - Activate(); - timer.Enabled = false; - - timer.Tick -= timer_Tick; - } - - private void requestButton_Click(object sender, EventArgs e) - { - Process.Start("http://particular.net/licensing"); - } - - private void ignoreButton_Click(object sender, EventArgs e) - { - DialogResult = DialogResult.Cancel; - } - } -} +namespace NServiceBus.Forms +{ + using System; + using System.Diagnostics; + using System.Threading; + using System.Windows.Forms; + + public partial class TrialExpired : Form + { + public TrialExpired() + { + InitializeComponent(); + } + + public Func ValidateLicenseFile { get; set; } + + public DateTime CurrentLicenseExpireDate { get; set; } + + public void DisplayError() + { + errorPanel.Visible = true; + errorMessageLabel.Text = "The file you have selected is not valid."; + selectedFileExpirationDateLabel.Text = String.Empty; + Height = 376; + } + + public void DisplayExpiredLicenseError(DateTime expirationDate) + { + errorPanel.Visible = true; + errorMessageLabel.Text = "The license file you have selected is expired."; + selectedFileExpirationDateLabel.Text = String.Format("Expiration Date: {0}", expirationDate.ToLocalTime().ToShortDateString()); + Height = 376; + } + + private void browseButton_Click(object sender, EventArgs e) + { + var close = false; + + using (var openDialog = new OpenFileDialog()) + { + openDialog.InitializeLifetimeService(); + openDialog.Filter = "License files (*.xml)|*.xml|All files (*.*)|*.*"; + openDialog.Title = "Select License file"; + + if (ShowDialogInSTA(openDialog) == DialogResult.OK) + { + string licenseFileSelected = openDialog.FileName; + + if (ValidateLicenseFile(this, licenseFileSelected)) + { + close = true; + } + } + } + + if (close) + { + browseButton.Enabled = false; + errorPanel.Visible = false; + completePanel.Visible = true; + Height = 376; + + timer.Tick += delegate + { + timer.Enabled = false; + DialogResult = DialogResult.OK; + }; + + timer.Interval = 5000; + timer.Enabled = true; + } + } + + //When calling a OpenFileDialog it needs to be done from an STA thread model otherwise it throws: + //"Current thread must be set to single thread apartment (STA) mode before OLE calls can be made. Ensure that your Main function has STAThreadAttribute marked on it. This exception is only raised if a debugger is attached to the process." + private static DialogResult ShowDialogInSTA(FileDialog dialog) + { + var result = DialogResult.Cancel; + + var thread = new Thread(() => + { + result = dialog.ShowDialog(); + }); + + thread.SetApartmentState(ApartmentState.STA); + thread.Start(); + thread.Join(); + + return result; + } + + private void timer_Tick(object sender, EventArgs e) + { + Activate(); + timer.Enabled = false; + + timer.Tick -= timer_Tick; + } + + private void ignoreButton_Click(object sender, EventArgs e) + { + Process.Start("http://particular.net/licensing"); + } + + private void label1_Click(object sender, EventArgs e) + { + + } + + private void label5_Click(object sender, EventArgs e) + { + + } + } +} diff --git a/src/NServiceBus.Core/TrialExpired.resx b/src/NServiceBus.Core/TrialExpired.resx new file mode 100644 index 00000000000..e0f2444f1aa --- /dev/null +++ b/src/NServiceBus.Core/TrialExpired.resx @@ -0,0 +1,1443 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + iVBORw0KGgoAAAANSUhEUgAAAR4AAABBCAYAAAAHZstAAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAADJGlUWHRYTUw6Y29tLmFkb2Jl + LnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQi + Pz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENv + cmUgNS4zLWMwMTEgNjYuMTQ1NjYxLCAyMDEyLzAyLzA2LTE0OjU2OjI3ICAgICAgICAiPiA8cmRmOlJE + RiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8 + cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20v + eGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxu + czpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1w + OkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5j + ZUlEPSJ4bXAuaWlkOjgyMTRBQjZGQkQ4QzExRTI5NjBDOUM1M0Q4QTI4OEZFIiB4bXBNTTpEb2N1bWVu + dElEPSJ4bXAuZGlkOjgyMTRBQjcwQkQ4QzExRTI5NjBDOUM1M0Q4QTI4OEZFIj4gPHhtcE1NOkRlcml2 + ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6ODIxNEFCNkRCRDhDMTFFMjk2MEM5QzUzRDhB + Mjg4RkUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6ODIxNEFCNkVCRDhDMTFFMjk2MEM5QzUzRDhB + Mjg4RkUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tl + dCBlbmQ9InIiPz77o+pyAAAPoUlEQVR4Xu1dW88lRRX9XgxKTJBEH5R4CfFFjb7Mi7wa/gK/QEPikzEi + DJeRAaKMRBxIlIiZcBkQhuE2GVEGCRATlMAMGAKRIIxoFERRMgGUO8e1uqr6q65eXd19Tp/++nxnr2Sl + u6tqV1fXqb16d/XlbGx8e9/MuO/QhsFgGBHaEdeNJjwGw6jQjrhuNOExGEaFdsR1owmPwTAqtCOuG014 + DIZRoR1x3WjCYzCMCu2I60YTHoNhVGhHdNx7z2zj2gc0rzikbchzb9A2gRferO3Iy+/SNuTV92qbQGUT + uPuAtnE04TEYRoV2RMdrfjPb2P+w5lW/0jbkeTdqm8Bdt2g78spfahuSAqJsApVN4GW3axtHEx6DYVRo + R3Q04TEYDEuBdkRHEx6DwbAUaEd0NOExGAxLgXZERxMewzbBbDY7EzyP9EmGLYV2RMcVEp6PXbBf2wRu + gfDEg93zdJ/VGbRJ6ujsOKldxN7tWGX4Y45xHJx0H6B96dhppTddEWhHdLzkNnd7W/F7t2ob8pzrtE0g + b7crO5KipGzISw9qG3D3kSdme//4YoWnXXNk0/b8m6Sd57KEhwMiBgf8qT67E1CeAzDGcZ8lgfxTwWuL + knm8Cq7F2d8fa4pJHzvb55rZG8fAs301E4Z2xJUio50Tb77tut3j0FN/kWUbOJbwEPf77E5A+c7CgzyW + VU6WA8v3EsNVA46PzphiuwpPQK9xNj60I64UGe3E+OCD2ezLV9wpyzZwTOEh9vgirUDZTsKDdF6SpaLD + CIttCNwDpjjmq9i2wDHuAOO+OeizJgu0UY0dRrLx7xmofldiwsepHXFl+PGLbp69/tY7vp8dDvzhuCyb + 4djCQ3Q646JcV+G532WXkGc8pFOg4ghgBcLy9QN+FzV2zvTZNSCPl9g80aTY4YtMDNoRV4Z7HnjS968D + o50v7rlDls1wK4SHaBxIASzjipaoCQ/SOOhSZAcc8g+C2z7aWVXgt+klPATyz3bFKpjoJaV2xJUgo503 + 3n7X96/DHNEOuVXCw/A/e3cF+V2E5yyXVcFa3bnabsDvN4/wMJpNca3Pnhi0I64EB4p2yLGER4XC2Ttd + yOsiPEs706EeRlM8jvRSjqLJ9LbIKrYr24718JhADG6n8xWtURnKqMuM0kmxnvaPvFwNQH7TMRNs31m+ + aCNQZtF+S/uGmEd4KvOJ2FZlGutFXtr+RiFDHvtZ3VFlWnJJrx3R8eJb3fMvirt+oW3I71ynbQJzt9P5 + 5rqyIaM3zFW0880Hn9Z25M791f1UOZbw8PJGDajGSUDkdRGetExA50lsBdirtirk2p8OXE70sr3pRDhB + p1aOkXV05KftrIgVtjsLD/K6HjPnyaR4IH2IflN1tAmPinwrDo/twYUHaaxT3TlMwZOD35d2RMcJP0CY + Rjvvvf+Btgmk+MT7qXIs4SkmfLFUZwUpEkjvIjxqjidGIXi+eCegfJdngWLIyATp6cDNOWUhMFimNtm7 + M8hPB33qbJ2EB+npftugfouh+m0e4eHvHKMWTWN7UOHBtoo2c/A3PbQjOk5UeD558S2zN999zx+Hww2P + /UnbBE5IeAisqzNE7Q4T0lqFh0B61wHPgZS9k4V8NejTkJ3tSgdcTdyQ1tWZy/kuLNWZW16OIp0RVAzW + kzpbq/AgTR0zHbmcK8M69xUfTyUSw/aQ/dZZeJDO/kr7mf1Qi8iQNrTwpO2Mopoin30WC6Jvk3ZEx4kK + z1W/fdofgwOjnc9//6C2CZye8DSdKSqDBdtdhYf1dQl3AyoDJABpamDKaAnpLBtfMimnbxKebASG/Fbn + JJCezgnVIkekZYUH2ypibLsM6nIJs0i/KeHpCva5vLnA9KJEFYsITxplNR0zxTHqM+2IjksSnpMuvU3b + kS3C0xjt0FbZBE5MeAhspw+2EdyOz7KdhCcA+X1D/dSBamcwnyWB/NTx0yhACU9WdAiWcUVL1C5JkEbB + SPuv5nBIaxMe5eQywmoCyg/db6pNXcDfvzGiRd6yhSd7WbwJ7YiOSxKeHz9+fHbyeQ0TzC3C0xjt0FbZ + BE5QeAikqcsKRi7FwMeyl/AQKEOH5L5VRJUiFbp0IGUnqJGfHmNFVLCdDtzW9hMop0QljQZTQan1L4H0 + NuGZ03k2QRtnWmLRfptXeALYd7VJeaQNLTyqnRy/TM+It3ZExzmF58MX3axtPB96+cTswede0uKTEZ4P + 7XuwOdohhU3JiQoPgXT14xWDH8vewpMCNqw/dYwY5aDHehexyqFNeCoDNweWdSYl0vmStO6aoxFIbxOe + 9JizoqEAm6H7TY2JnEDwGNWldhpJDS08PEHkjp0CyGNJIlHtiI5X/3q2se8hzR8d1jbgN+56ZPbZO49W + +Ok7NtcfeeW1okW/e+Hl2SnnJ7e5f3hI7w/8wu2PFnYB77z3/uxzl0UfcRc2JfmmfbyfKrdUeAjkqUsk + huMLC08AbDno0oFElGd4rC/qQOml2yLCU5s49lnhWGI09gvy+gpPRQS6ADZD91sv4QlAmbQddPwy8sD6 + oMJDIK1pXKWIBF074tz8yLnXz/7x2v/8fhweQnTDlzZfeeNNn7KJR//6r7r4CH7m0gOztyE0MX72+2dk + 2Tm45cJDIF+dsdK5gLmFh4C9uoQp24X1tA29nTAG7OcWHgLlU/viDI5l2reN7UTeGBHP0P02r/Bk7bA+ + uPAEII8nCu4/J8K+b7Ujzs2d9xz19W/iq1e56GgR8aHIxGC0QzFSZefgVISnLWwlFhIeAnU0DiasLzzf + EQP2iwpPKhrhEjTup8pZPQXy2oRnGXM8i/bbvMKTHisRCw/HWIpBhCcGynE/PIb0JOd/K+2Ic/GjO2+c + /fuNt1z1Hkee+VulzDziQ4Gh0MQYMNohJyE8BMqoO10xhhCexrMz1tOBm3XqNsB2IeEhYBP3B9fTS7Bs + nchvEx7l5L2OGeWH7rd5hUfZpZPyKeTcGIG8RU8cKsI6fVDhyUU7MfuKz5KjHXIywkOgnLrTFVATHqSF + SImDvfFWKoH81GmJ0kG4DsaOTmQvPZBPm6aJ3SGEJ+3HdD6s9qBcDOS3CY9yjsZjRh7Lp5O2Q/dbb+FB + fhgHMcp5sQCkpSce2U6kq/oWPXEQw0U8XaKdmBSfv5/4ry+5iVR8Roh2yEkJD4GyauARSnhSR+TAqgkQ + 08B0ENTmIpjmsirgpUTlzgS2OfEd71vVNYTwKGEI6BJFZoWHQFo6l0bwmCtRC7bjcqn4DNlvvYQHeTxG + dZmu6lbHqo4lHStE5ffDdnySpE3aX+klqP+9tCP25q57H/f1bmLHlZm/OQb5/I0Snydf/M/sE7vc3xyn + 0Q5vp5+2O/Pk83ycnPAQKK/udKVnaxXBdEVje5Cn9t0FqZMtLDwE7Zx5DdkIj2AZV7RETXgIpKdtbYU3 + LYGkofpNCU9fyL5GOoVciUoXlHViXUVEbejwykRHLvLN4ybxeeqlV2dnXH24eEAwBh8gVPUsyEkKDwGb + NCxWZ2uKT3pmaUPtTJgCZVKHzYEDsHbZgLShhCd9rICoXUYooFwn4SGQ17Uf+bvICATpQ/TbIsJDUWm7 + 5Fb9mYK/XdqONOJR0ZMC2xT1l3ZEx44PEKbfPH7h9be0TWDyrlYsPt967M/aBvzK4SeKVyZi2wqFTckJ + P0CYA2x4VonFp9FpCORzn02DNgykXpOe3kZFAxxMzJPzFATyBhEeArapCLeKJ4FynYWHQD6FvKkPs8cb + w5edt9+a9p8DbVojwACUZeSj9sOorWgblhx/cXRU+/2QxjJNx1qMOV80gnZExw7Co6Kdnz/+vLYJFC+J + BvHJCc9pBx6p2VUobEpugfAYDIYmaEd07CA8l9xX/4eHL+09rG0CG95Op/h8/eFntQ3IVyaUXUlhU9KE + x2CYELQjOrYIT+M3jxf4LMYpP71P25DRh8AklU2gCY/BMCFoR3RsEZ7Gbx4v+Xs8jVQ2gSY8BsOEoB3R + MSM8J/3kSPM/PJjwGAyGLLQjOmaEZ8cd1TfFK//wYMJjMBiy0I7oyH+S2H1bjadecffs4ZdPeMlx2H/0 + uU07/suEsCv53eur+4l5wU3ahswJFqlsAimGysbRhMdgGBXaEbPMfgVwNWnCYzCMCu2Ijcx+83h1acJj + MIwK7YiN3IbRDmnCsybAkOUTtnwSt/Ju1DxgHaACn7Du9FR1X6h6kRaeLs6+DT8vUG84zoX7bBPaESU/ + JaKd6x59VpZdMZrwrAkwZPlu0dDCo17w5D7mfj1EgfsB1bt6TN++wjPCd3G2iiY8ht6ACzQ6JNLCS5jZ + bwX1AesCs++ZLQPY59YJz0jfxdkqmvAYegMukHVIpPPN884vbbYBdVHM1kB4fnCne64G/NrhY8ULnIH7 + n/9nc7RzzvWlneTOzPeV+W8Qyoa8/C5tE6hsAi903/dpoAnPmgDOwzfVy68E0JnoUQCjifjtal66tH1a + ok14KnVw3acFVC6NsM23wnmZFr8xTvFq+u5NKUJcByuf6cB2ekwVIUy3A5jGPL/JbXmc2Gb98RcDuK/4 + a5ash58ZKQQTDEAUqB3RMfMA4Rl3H9U2pD1AaJgoMOibhIeCUE7ccr1ITZw5BvIahQdp4ct8RR6WFBU6 + aXHpxSWYCgHLMI3lVJ2NEY+3K9uKddbPY6LjF2Lg0ygO4ZMXcwsP1osyXPrt8PmWcl6LeSDLVNrmoB3R + MSM8J/NlTmVDmvAYJgrvDEp4agKDNDpp44Qt8poigfBxrOydLeaD8X+aUXgoFvJ7SUjvIzwUnOzktreZ + O+JJgfxC7PxmqIcQ4q0d0bHlJVFpQ5rwGCYKOEGT8KgIg0LQ6Ly0oaEAz/w1h07BMmDclrb99REeCljb + R/CHFp6inN+s1VOFdkRHEx7DNoN3hqGFJ+uQASjHCId1xhhceLDkZQ/RJhQLCQ+22R62OZ63MuGp0ITH + AHhnGFV4kB/mPyqXblhP2zKI8BBYJ5YW8WCdbS3mdEI6l6AJT4UmPAbAO8PYwsN9HvObJXz6soSnyxwP + haM2h4U0RmaNwsOl26z9lc1AwkMRoPgo7rlb25Dn3qBtAi/I3NrmLXxlQ+69R9sEKpvAi2/VNo4mPGsC + 7wxjCw8Fg5cjsTCEJ6j7Cg/BSVxGUXH0lAoPyxDx5DXTKDbFpDeXYNkuLFln+JeNnPCwHO3Su4CsewDh + WR+a8KwJvDOMKjwEytAxYxS3tbn0RVr3R3i7gNjxK8JDYDsITQDX0zLp39OwDWxXo/AQWA9iGlDUDaZ3 + tUx4MjThMRhGhXbEdaMJj8EwKrQjrhtNeAyGUaEdcd1owmMwjArtiOtGEx6DYVRoR1w3mvAYDKNhY+P/ + ktPuP4mOj4YAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAR4AAABBCAYAAAAHZstAAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAADJGlUWHRYTUw6Y29tLmFkb2Jl + LnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQi + Pz4gPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iQWRvYmUgWE1QIENv + cmUgNS4zLWMwMTEgNjYuMTQ1NjYxLCAyMDEyLzAyLzA2LTE0OjU2OjI3ICAgICAgICAiPiA8cmRmOlJE + RiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPiA8 + cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20v + eGFwLzEuMC8iIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIiB4bWxu + czpzdFJlZj0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL3NUeXBlL1Jlc291cmNlUmVmIyIgeG1w + OkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChNYWNpbnRvc2gpIiB4bXBNTTpJbnN0YW5j + ZUlEPSJ4bXAuaWlkOjgyMTRBQjZGQkQ4QzExRTI5NjBDOUM1M0Q4QTI4OEZFIiB4bXBNTTpEb2N1bWVu + dElEPSJ4bXAuZGlkOjgyMTRBQjcwQkQ4QzExRTI5NjBDOUM1M0Q4QTI4OEZFIj4gPHhtcE1NOkRlcml2 + ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6ODIxNEFCNkRCRDhDMTFFMjk2MEM5QzUzRDhB + Mjg4RkUiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6ODIxNEFCNkVCRDhDMTFFMjk2MEM5QzUzRDhB + Mjg4RkUiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tl + dCBlbmQ9InIiPz77o+pyAAAPoUlEQVR4Xu1dW88lRRX9XgxKTJBEH5R4CfFFjb7Mi7wa/gK/QEPikzEi + DJeRAaKMRBxIlIiZcBkQhuE2GVEGCRATlMAMGAKRIIxoFERRMgGUO8e1uqr6q65eXd19Tp/++nxnr2Sl + u6tqV1fXqb16d/XlbGx8e9/MuO/QhsFgGBHaEdeNJjwGw6jQjrhuNOExGEaFdsR1owmPwTAqtCOuG014 + DIZRoR1x3WjCYzCMCu2I60YTHoNhVGhHdNx7z2zj2gc0rzikbchzb9A2gRferO3Iy+/SNuTV92qbQGUT + uPuAtnE04TEYRoV2RMdrfjPb2P+w5lW/0jbkeTdqm8Bdt2g78spfahuSAqJsApVN4GW3axtHEx6DYVRo + R3Q04TEYDEuBdkRHEx6DwbAUaEd0NOExGAxLgXZERxMewzbBbDY7EzyP9EmGLYV2RMcVEp6PXbBf2wRu + gfDEg93zdJ/VGbRJ6ujsOKldxN7tWGX4Y45xHJx0H6B96dhppTddEWhHdLzkNnd7W/F7t2ob8pzrtE0g + b7crO5KipGzISw9qG3D3kSdme//4YoWnXXNk0/b8m6Sd57KEhwMiBgf8qT67E1CeAzDGcZ8lgfxTwWuL + knm8Cq7F2d8fa4pJHzvb55rZG8fAs301E4Z2xJUio50Tb77tut3j0FN/kWUbOJbwEPf77E5A+c7CgzyW + VU6WA8v3EsNVA46PzphiuwpPQK9xNj60I64UGe3E+OCD2ezLV9wpyzZwTOEh9vgirUDZTsKDdF6SpaLD + CIttCNwDpjjmq9i2wDHuAOO+OeizJgu0UY0dRrLx7xmofldiwsepHXFl+PGLbp69/tY7vp8dDvzhuCyb + 4djCQ3Q646JcV+G532WXkGc8pFOg4ghgBcLy9QN+FzV2zvTZNSCPl9g80aTY4YtMDNoRV4Z7HnjS968D + o50v7rlDls1wK4SHaBxIASzjipaoCQ/SOOhSZAcc8g+C2z7aWVXgt+klPATyz3bFKpjoJaV2xJUgo503 + 3n7X96/DHNEOuVXCw/A/e3cF+V2E5yyXVcFa3bnabsDvN4/wMJpNca3Pnhi0I64EB4p2yLGER4XC2Ttd + yOsiPEs706EeRlM8jvRSjqLJ9LbIKrYr24718JhADG6n8xWtURnKqMuM0kmxnvaPvFwNQH7TMRNs31m+ + aCNQZtF+S/uGmEd4KvOJ2FZlGutFXtr+RiFDHvtZ3VFlWnJJrx3R8eJb3fMvirt+oW3I71ynbQJzt9P5 + 5rqyIaM3zFW0880Hn9Z25M791f1UOZbw8PJGDajGSUDkdRGetExA50lsBdirtirk2p8OXE70sr3pRDhB + p1aOkXV05KftrIgVtjsLD/K6HjPnyaR4IH2IflN1tAmPinwrDo/twYUHaaxT3TlMwZOD35d2RMcJP0CY + Rjvvvf+Btgmk+MT7qXIs4SkmfLFUZwUpEkjvIjxqjidGIXi+eCegfJdngWLIyATp6cDNOWUhMFimNtm7 + M8hPB33qbJ2EB+npftugfouh+m0e4eHvHKMWTWN7UOHBtoo2c/A3PbQjOk5UeD558S2zN999zx+Hww2P + /UnbBE5IeAisqzNE7Q4T0lqFh0B61wHPgZS9k4V8NejTkJ3tSgdcTdyQ1tWZy/kuLNWZW16OIp0RVAzW + kzpbq/AgTR0zHbmcK8M69xUfTyUSw/aQ/dZZeJDO/kr7mf1Qi8iQNrTwpO2Mopoin30WC6Jvk3ZEx4kK + z1W/fdofgwOjnc9//6C2CZye8DSdKSqDBdtdhYf1dQl3AyoDJABpamDKaAnpLBtfMimnbxKebASG/Fbn + JJCezgnVIkekZYUH2ypibLsM6nIJs0i/KeHpCva5vLnA9KJEFYsITxplNR0zxTHqM+2IjksSnpMuvU3b + kS3C0xjt0FbZBE5MeAhspw+2EdyOz7KdhCcA+X1D/dSBamcwnyWB/NTx0yhACU9WdAiWcUVL1C5JkEbB + SPuv5nBIaxMe5eQywmoCyg/db6pNXcDfvzGiRd6yhSd7WbwJ7YiOSxKeHz9+fHbyeQ0TzC3C0xjt0FbZ + BE5QeAikqcsKRi7FwMeyl/AQKEOH5L5VRJUiFbp0IGUnqJGfHmNFVLCdDtzW9hMop0QljQZTQan1L4H0 + NuGZ03k2QRtnWmLRfptXeALYd7VJeaQNLTyqnRy/TM+It3ZExzmF58MX3axtPB96+cTswede0uKTEZ4P + 7XuwOdohhU3JiQoPgXT14xWDH8vewpMCNqw/dYwY5aDHehexyqFNeCoDNweWdSYl0vmStO6aoxFIbxOe + 9JizoqEAm6H7TY2JnEDwGNWldhpJDS08PEHkjp0CyGNJIlHtiI5X/3q2se8hzR8d1jbgN+56ZPbZO49W + +Ok7NtcfeeW1okW/e+Hl2SnnJ7e5f3hI7w/8wu2PFnYB77z3/uxzl0UfcRc2JfmmfbyfKrdUeAjkqUsk + huMLC08AbDno0oFElGd4rC/qQOml2yLCU5s49lnhWGI09gvy+gpPRQS6ADZD91sv4QlAmbQddPwy8sD6 + oMJDIK1pXKWIBF074tz8yLnXz/7x2v/8fhweQnTDlzZfeeNNn7KJR//6r7r4CH7m0gOztyE0MX72+2dk + 2Tm45cJDIF+dsdK5gLmFh4C9uoQp24X1tA29nTAG7OcWHgLlU/viDI5l2reN7UTeGBHP0P02r/Bk7bA+ + uPAEII8nCu4/J8K+b7Ujzs2d9xz19W/iq1e56GgR8aHIxGC0QzFSZefgVISnLWwlFhIeAnU0DiasLzzf + EQP2iwpPKhrhEjTup8pZPQXy2oRnGXM8i/bbvMKTHisRCw/HWIpBhCcGynE/PIb0JOd/K+2Ic/GjO2+c + /fuNt1z1Hkee+VulzDziQ4Gh0MQYMNohJyE8BMqoO10xhhCexrMz1tOBm3XqNsB2IeEhYBP3B9fTS7Bs + nchvEx7l5L2OGeWH7rd5hUfZpZPyKeTcGIG8RU8cKsI6fVDhyUU7MfuKz5KjHXIywkOgnLrTFVATHqSF + SImDvfFWKoH81GmJ0kG4DsaOTmQvPZBPm6aJ3SGEJ+3HdD6s9qBcDOS3CY9yjsZjRh7Lp5O2Q/dbb+FB + fhgHMcp5sQCkpSce2U6kq/oWPXEQw0U8XaKdmBSfv5/4ry+5iVR8Roh2yEkJD4GyauARSnhSR+TAqgkQ + 08B0ENTmIpjmsirgpUTlzgS2OfEd71vVNYTwKGEI6BJFZoWHQFo6l0bwmCtRC7bjcqn4DNlvvYQHeTxG + dZmu6lbHqo4lHStE5ffDdnySpE3aX+klqP+9tCP25q57H/f1bmLHlZm/OQb5/I0Snydf/M/sE7vc3xyn + 0Q5vp5+2O/Pk83ycnPAQKK/udKVnaxXBdEVje5Cn9t0FqZMtLDwE7Zx5DdkIj2AZV7RETXgIpKdtbYU3 + LYGkofpNCU9fyL5GOoVciUoXlHViXUVEbejwykRHLvLN4ybxeeqlV2dnXH24eEAwBh8gVPUsyEkKDwGb + NCxWZ2uKT3pmaUPtTJgCZVKHzYEDsHbZgLShhCd9rICoXUYooFwn4SGQ17Uf+bvICATpQ/TbIsJDUWm7 + 5Fb9mYK/XdqONOJR0ZMC2xT1l3ZEx44PEKbfPH7h9be0TWDyrlYsPt967M/aBvzK4SeKVyZi2wqFTckJ + P0CYA2x4VonFp9FpCORzn02DNgykXpOe3kZFAxxMzJPzFATyBhEeArapCLeKJ4FynYWHQD6FvKkPs8cb + w5edt9+a9p8DbVojwACUZeSj9sOorWgblhx/cXRU+/2QxjJNx1qMOV80gnZExw7Co6Kdnz/+vLYJFC+J + BvHJCc9pBx6p2VUobEpugfAYDIYmaEd07CA8l9xX/4eHL+09rG0CG95Op/h8/eFntQ3IVyaUXUlhU9KE + x2CYELQjOrYIT+M3jxf4LMYpP71P25DRh8AklU2gCY/BMCFoR3RsEZ7Gbx4v+Xs8jVQ2gSY8BsOEoB3R + MSM8J/3kSPM/PJjwGAyGLLQjOmaEZ8cd1TfFK//wYMJjMBiy0I7oyH+S2H1bjadecffs4ZdPeMlx2H/0 + uU07/suEsCv53eur+4l5wU3ahswJFqlsAimGysbRhMdgGBXaEbPMfgVwNWnCYzCMCu2Ijcx+83h1acJj + MIwK7YiN3IbRDmnCsybAkOUTtnwSt/Ju1DxgHaACn7Du9FR1X6h6kRaeLs6+DT8vUG84zoX7bBPaESU/ + JaKd6x59VpZdMZrwrAkwZPlu0dDCo17w5D7mfj1EgfsB1bt6TN++wjPCd3G2iiY8ht6ACzQ6JNLCS5jZ + bwX1AesCs++ZLQPY59YJz0jfxdkqmvAYegMukHVIpPPN884vbbYBdVHM1kB4fnCne64G/NrhY8ULnIH7 + n/9nc7RzzvWlneTOzPeV+W8Qyoa8/C5tE6hsAi903/dpoAnPmgDOwzfVy68E0JnoUQCjifjtal66tH1a + ok14KnVw3acFVC6NsM23wnmZFr8xTvFq+u5NKUJcByuf6cB2ekwVIUy3A5jGPL/JbXmc2Gb98RcDuK/4 + a5ash58ZKQQTDEAUqB3RMfMA4Rl3H9U2pD1AaJgoMOibhIeCUE7ccr1ITZw5BvIahQdp4ct8RR6WFBU6 + aXHpxSWYCgHLMI3lVJ2NEY+3K9uKddbPY6LjF2Lg0ygO4ZMXcwsP1osyXPrt8PmWcl6LeSDLVNrmoB3R + MSM8J/NlTmVDmvAYJgrvDEp4agKDNDpp44Qt8poigfBxrOydLeaD8X+aUXgoFvJ7SUjvIzwUnOzktreZ + O+JJgfxC7PxmqIcQ4q0d0bHlJVFpQ5rwGCYKOEGT8KgIg0LQ6Ly0oaEAz/w1h07BMmDclrb99REeCljb + R/CHFp6inN+s1VOFdkRHEx7DNoN3hqGFJ+uQASjHCId1xhhceLDkZQ/RJhQLCQ+22R62OZ63MuGp0ITH + AHhnGFV4kB/mPyqXblhP2zKI8BBYJ5YW8WCdbS3mdEI6l6AJT4UmPAbAO8PYwsN9HvObJXz6soSnyxwP + haM2h4U0RmaNwsOl26z9lc1AwkMRoPgo7rlb25Dn3qBtAi/I3NrmLXxlQ+69R9sEKpvAi2/VNo4mPGsC + 7wxjCw8Fg5cjsTCEJ6j7Cg/BSVxGUXH0lAoPyxDx5DXTKDbFpDeXYNkuLFln+JeNnPCwHO3Su4CsewDh + WR+a8KwJvDOMKjwEytAxYxS3tbn0RVr3R3i7gNjxK8JDYDsITQDX0zLp39OwDWxXo/AQWA9iGlDUDaZ3 + tUx4MjThMRhGhXbEdaMJj8EwKrQjrhtNeAyGUaEdcd1owmMwjArtiOtGEx6DYVRoR1w3mvAYDKNhY+P/ + ktPuP4mOj4YAAAAASUVORK5CYII= + + + + 17, 17 + + + + iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAYAAACI7Fo9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAGYktHRAD/AP8A/6C9p5MAAD/wSURBVHhe7d0HfFNV+8Dxv3uP1/HqqyAIDpQhIFNAQJaAyBZl + b8regsyy96bIFoRaVunee+/dNEmTdNOyZIhAGeX8n+fm3tKG05KUnqye5/P5fURos3q+zU1yc/N/fCxv + CCGvQbWhxtA3UBfoB2gINKakuHj67cLCxf9qNOuvZ2RsvZKcvOtaevq+yzExR8qVmLjn78TEHX8nJW27 + oVTa/qPR/Hb32rUJcBqDxdPD020LNYHqQm9CT4sXgw8fPk86AOoF6COoJdQHGlly69acG1lZOy/HxtoX + enu755w8Ga4+dCg1c88elWL79gLZxo1X0lavLk61tSUpy5eXb9my8i1dKpS8ZEn5Fi/Gv7+bunLlNdm6 + dYUZW7aolXZ2KXA+EblnzrhdCAw88nd8/KrbFy+OhcvUC2oF4S+BV8WLzocPH9oAkhehzyC8Bx1WcufO + rzfU6n3ng4Odck+fjsjct08l37TpWuqqVSQNAoTaVqwoHwB/UuRCixaVK+m337QtXFgu+J6bsg0bsjL3 + 7o3MO3vW8VJExBb4BTAKrsN30BfQ6+JV5MOn5g0A+A/UDOoPzSy+fHn7hfBwx9yTJ2OUu3efg3vS+3DP + TIRE3FLmgjxxwQJtv/5avvnzH6TY2l5U7NwZm+fkdBIeFiwn9+/jFgle3/egp8SbgQ8f6xpY3M9Bn0M/ + QvPg8fOe80FB7po//0zL2LbtatqaNaRclotcKGHevHLB9/ybsXFjera9vfPl6Oh1AB83+RtAL4k3ER8+ + ljmwiN+A2kHj7t26teFyXNxpuMeOl+/YcSV93TqSvnatkLUjT5g7V9ucOaXB19+UbdqUlHfmjP01hWIy + 3Eb4hN+74k3Hh495DyxWfDYcnwW3uXXhgl2Rr6+/5uDBLNnGjfcE3FI1GHn87NnaZs2SepC8dGlB5r59 + PhdDQpaI6N8Wb1I+fMxjYFHis+OtoUnFFy/uQtyq/fvzAfcD2fr1BOPIK0SubeZMobgZM/C8Lmbu3etz + MTT0N7hN8Rn918Sbmg8f4w8sQHzpa1BJcfF6WJQe6gMHcgXcGzYQIY7cYOTlmj4dz/s8/NJ0uZqSgs/k + 14f4a/h82A8sNHwZDB93z/k3K+sIPMZMkG/dWlyKmyOvNuRC06Zpmz79fvrq1cl5jo7b7t26hbf/G+KP + hA+f6htYWLhH2A8l9+6tuRQZ6abev78Q7r2JEEfOFrlY7NSpQolz5vyt2rfP6YZCgXvvvS/+iPjwqfrA + QqoFDb/377/bCn18ghU7d/6TsWmTFngFyMsB58irFXnslCmlwdfdydi8OehSVJQN/IzqQfz1eT6GDSya + jyGb4suXf89zcoqFzfM7CJwjNw/kWMzkyULw55LUVasSzvv745N3uK8CfxzPp/KBRYJPsE26e+2aXb6L + CwK/KwHnyCtBXga4MZGXZmNDYm1scI+8xKLg4PnwM/wE4vfwfMoPLIoPoXF3r1+3K3Bzi8rYtq0ccI7c + vJELTZok9QBu05iLYWEz4GdaT/wR86nJAwsB9zkfXlJcvB0eg4fKt28vhsd95YBz5BaFXCh64kT8bwnc + 3mF/Jybiu+z+K/7I+dSkgR887nvetaSkZP2F0FAf5e7dNwTg+iIH4By5+SIXmjBB26RJdzO2bvW4mZOD + +9fzt9LWhIEf9FNQc2jJdbncQbV//4WMLVu0wDly60MuNX48ns411cGDh+7evPk1/PyfEZcEH2sb+OG+ + A025feHC/hwHB7kAnCPXHzkCt1DkWNS4cUJw2XLznZ2XwVqoJS4NPtYw8AN9Gvqu5N69TcLj8G3b7gnA + OfIah7y0sWMfpC5fHnElORkPl/WiuFT4WOrgb21o7g2N5njpZjpHXtORaxszBr//umrfvt2wRuqLS4aP + JQ384J6BeuGz6QVubvh6eImAmyPnyEXkZYPrn3w+JGQorBl+IAxLGfhhvQvNvqFS2av27r0iwObIOfIK + kEeOHi0E/3ZLsXv3Hlg7/LG7uQ/8kNqUlJRsLPT1DYPH4uXvxTlyjrwC5JGjRpWWvHBh1OXExK6wlp4V + lxUfcxn4obwCjbl98eJBzZEjebCpXh44R86R64E8cuRIITidy1nHji2CNfUfcYnxMfXADwN3X11yJSnJ + Wblr1+2aiDwFTi99K1zP/fuI4ugRknnqBFG7OpMsPx+SFehPcsJCSHZYMMmJjiS5cdFiUSQ7NBgKIllB + /kTj601Ubs5EedKByI8cJrI9diQNbqMkuAw1CXnEiBFCkSNGPEhfs+YMKS7mT9SZegB4S9hU33zOyysK + NtUfGIy8LHAzR45fJ9uxnSiPHyMaL3eSExlG8tNTSGFeFjl/sbCCzgkV6XahsgrKVYgV5JA8WQrJjgwl + Kjhv+Z9HSOrmTSQBtgqsEXlpw4fj1kwibMrj8fb5u+KMPXCj47Pqg+7euLEn+/jxLARuVcjh6zLsdhPV + 2TMkJyKUFChk5DwgpGOuqGpCTuv8w/KVMpIVHkKUjqdJ2vatJB42/60FORY+bBiex/mCs2fxfe8vi0uQ + D+uBGxuPtDrz39zcP1X79l21CuTwZ4Sthk3n/JQEUlSUr4PW0IyDnNa5ojySm5ZEMt1cSOr2bSQONvEt + GblUxMiRxUo7u82w9vhhqVkP3MjvQ0uupqefUezaVWzJyPFrlbAJnAv3hkWw+X3hUpEQHa4hmQ554fn8 + cp2DCmCzPwu2SjL+OASb+vMtErnQ0KHYg9TVq/+CNfiRuCT5VPfAjYsHE1hzMSLCR7Fjx31LRI6fnaY8 + Crgjwsj5wrxS3NaK/JHgOmdFhRPZof0kbt5cS0NOwn/5RShx4cIAcuVKY3Fp8qmuAeD4iaKbCzw9o+Xb + tgnA9UUuADcxcvne30lOaDApOpf7CG4pOlxDMnPkGDwkKQ3Qa2BrJnXXDhKD9/KskJcFXg3IpWKmTk25 + Kpd3hHXJj2RTHQM3ZPeSe/e2554+LbMk5GlwemonR3JOmUGFXTY6XEOyMOTlyiN5agVROJ4iCYsXWQTy + sJ9/FooeNy77QmRkP1ij/G2vTzJwA/YpKS7eJTyzbiHIM3bvgsfdoeQ8IKCh1o0O15AoyKmwy2Y+yMuF + 9/JRYSRlyyYSUxa7GSIPGzJECE77AmxpjoS1+py4bPnoO7g5BA26f/OmnebIkQJLQK44cpjkJ8VTMVcU + Ha4hWRFysQKxnLQkkrbvd+FxvLkil4LTuJrv6Dge1uzz4hLm87iBGwvfP/7L3evXf9ccPlxk1sjhv6oT + DuRc5uM3z3WjwzUk60VeNtyslx3/Ex8TmyXysJ9+EoLv+SfL3n4arF3+/vbHjYh85N0rV/apDx68aK7I + 06DMv46TQpWcivhx0eEaUs1AXra8LCWRHTtCom1sHkEuADch8tDBg4XCf/75ZtaRI3NhDfO3u1Y0cOPg + 5vqw25cuHVDt3/+3uSJXHD5EzillVMD6RIdrSDUPeWmFuSQX7uHT9u7R3rObEXIp+Lti1Z49C2AtvyAu + bT7SiMgH3712ba+5Is/YsZ3kxUZR8eobHa4h1WzkZctOiSdJa1ebFfLQQYOEBOz798+BNc2foCs7cIP0 + vX/jxh7VgQOXzA152to1JNvXm1wANDS8+kaHa0gcOa1MPy8SM2O62SAvg/2m5vDhybC2+fvaceCG+B7f + nGKOT7wpDh4ghbCpSINrSHS4hsSR08oXy8vKJKm/25VCNzXy0IEDtf30043s48fxs91r9uvscAO0w9fJ + 1fq8hFYGOGvk6XA6uSFBVLSGRodrSBw5LQl52dSRoSR27myzQB4yYIAQfO/13NOn8SOea+YedHDFG0Fb + ck6eVJgTcuWRP0hRroaK1tDocA2JI6dFQy6Vl6chaQf3a+/ZTYxcCs6r8KK3dwdx6decAeD/gzYUeHjE + mgty/JrsQD8q2KpEh2tIHDktGm5aqtBAEj11qsmRh/TvLxQ1cqSyKDr6S5GA9Q8AfxNafiEkJMBckMvt + dpNCPfZJ1zc6XEMCtBz5I9FAUzuXI5SrziBJG9aZHHlIv35CMTY2oeTmzf+JFKx3APjz0K9Xk5Od5Nu3 + C4d+MjVy9dkz5ML5J3tGvWx0uIYEaDnyR6KCpiUiL5vc2ZFEjBppUuRS8bNnnwYDb4gkrHPgCo66XVR0 + WFnRQSMQuJGQ47/jm08uXj5PBVuV6HANCdBy5I9EBU2LglxKExNBoqdMNiny4L59hVJXr14FFqzzNXa4 + Yh2FZ9hx11YTI5dt307OydM58tKsGzmWB+WoMkj88qUmRR7844/477c1f/yBnwxjXc/EwxWqD23JOXVK + bmrkyj8Ok/MFORx5aTUDeWn5WSR1/14ShthNgFwKzu9cYVBQC5GI5Q8AxyffVhUFBgabGrn6zClyEWCZ + D3LKM+sYFXbZOPLSRMwVVQ55meROZ4TH7KZAjgX16YP76keTf/99T6RiuQPA8d1o029oNPaK7duF47yZ + CjnuxorAOXKpmos871y2UGawP4kYPdokyIN++EEoccGCvWDEst/tBlegBz4uz9y372+TIYfyIsM58nKZ + EDkArSwqaFoAtrLowDEtcilNfBSJHD/OJMgx+Lu7qgMHhoMVy3y8Dhe8DrQlz9ExxWTI4c95sdEcebk4 + 8tIKtGmS40jkxIlGRy7UuzcJGzw452+ZzPJ2pgHgL0CLLyckuJgKOX5NfmIcR14ujlwXuVRWehKJmjLZ + 6MixwF69SOzkya5gxrJeX4cL/EvxlSt7Fbt23TIFcvwzHr+NIy8bR14RcinEHmkzqVqRC8AfgxwL6tXr + gXzjxnlgxzLe6QYXFN+ssjXH3l5lMuRxMRx5uTjyxyHPFdOkJJAIfMxuRORS8P2XzoeFtRYpme8A8Beh + ZRcjIz1NghzKi47gyMvFkeuLvBR7YgwJHzXSqMgDe/YUihozxhcMvSmSMs+BCzjo7rVre5Q7dz7cZDcW + 8lWrSG5YCEdeLo7cUORS6tgIEjZ8uFGRB37/vZBs7Vo8DJV5fkwzXLB60OYcBwe5KZDz18l148irijy3 + IEsIX2fHZ+GNiRwL6du36Ep8vPl9thsAfxZacDkhwckUyIU93jjyMnHkT4pcKsPpjPYe3UjIsYAePUjU + xImOYOpVkZh5DFygbvdv3tyltLP7x9jIlYcPCQdu5MilOPLqQi6VeviAUZGLlci3bh0lEjP9API3oHUF + Tk4JxkYut7MjF87lceSlceTVjVwqceN64yHv3l0ouH9/9c28vA9EaqYdQD4MLswf8NunxJjI0+H0irJU + 1Y68qCCHxNguJeEzppGw6VMf3+RJJGjk8NICdRvxMP9BA4nvjz9QSzt+xOqQZ7g7k6jFC0mkvi1aUC2l + uzhWK3IsJ0dFoufMMhpyqfhZszaBMdM+MQcXAHdz3Zx19Gi2MZHjf6W93mhgq1LZe+bQiePJcbh6xuzk + W2+RHFmy1SDPVWWQM7U+pF5Xlp186z9Ek5pYrciF8rOIJj2JhA0fZjTkAd26kYCePa8VuLl9JZIz/gBw + /HSVmX8nJZ01KnIoy9uL6eb6uRw1cfzoI+pCYplvn95WgRwLmTyReh1Zl2C3kwnyHDFlsL/wDLxRkEP+ + XbuS6LFjT4E103zEE5xx85J797Ypf//9b2Mizzz2J7lIwVrVdJFLyU6fIMefeoq6mFiWvM/O4pEr/LyI + /bPPUq8fyzy7dWGKXCr16B9GQ47Bn+9l7NzZW6RnvAHk+D7z384HBfkZEzkeAgqffKOBrUo04GULHPoz + dUGxTNiEh01EOuyymSfyfIDg0qwp9bqxzOG114g6IZo58px8jVDssiVGQS4VPmRICJh7RSRonIEzbHWv + uHi7cvfuf4yFHP9ckJZMBVuVaLB1K8iUk9PvvUddWCzz6fW9iLmizBM5Fr1mJfU6sS5203qjIceylGkk + bMQIoyD379IFe5C+evVAkSD7AeTPQIuK/P0DjYYcyvJ0p4KtSjTUFZV65BB1YbEu6ffdImrLQa5OjIF7 + 1lep14dl7h3aCceCMxZyKYW/dyl0xsiJ/3ffkZBBgyLBnnF2ooEzanvv1q0d8h07bhoLuWLv7+QCoKOh + NTQa5sfl2+cH6gJj2Yk33yTZqbqb8OaLHF8D9+ndk3pdWObwysskMzK0epADaH2RSyVu22IU5FKptrZD + RYrsBpDjrq5LC318go2FHP/+nEJGRWtoNMT6lJueTE78503qQmNZ+U1480aefNQ0Wz5RK5aZDDmWrVGQ + sFEjjYIcCxkwIBYMviaSZDNwBq1L7t7dCvfm/xoFOZTl4UZFa2g0wPp3jiTt2k5daKxL3L3T7JHj8dLP + fPgB9fKzzLXF1yQ3T2My5FJyPy8SiJvvjJH7de4slL5iBbvH6oAcXzefdyE01MtYyDN27iTnq+Hjkuh4 + 9e3hbq2enTpSFxzLtJvwiWaLHAueNIF62Vn21wsvCK9pmxq5VNzqFUZB7tepE76jLgAsvijSrN6BE/4c + 2qTcs+eyMZCnrlxJ8hPiqHANiY5X38rvu56NTza98gp14bHMq3s3s0Uu9/Uk9s88Q73cLAtfMM9skOfA + VoUmI4UE9e/PHLlQ58735Xv2dBRpVu8AcpurSUmnjYUcP6ecBteQ6Hj1jf4Gldg1q6gLj3UJu3eYHXJ8 + ptvlqybUy8sy58aNSG6OGrDSgGM6oGnBZa8u5Fg2lHxoP3vkYhHDh/8FJp8VeVbPwAl+iPfmmj/+yDYG + cvz7wkw5Fa++0fHqW8XvQisERG6tWlIXIMtOvPEGyU6ONxvkWDRsrtIuK8twj7sMHw/ASgOO6YCmBaCr + G7lQdiYJGzmSOXLfjh3x72/lnT3bSCRaPQPIh/ybl3fIGMgxtZMjFa++0fHq2+PfaqoJDyH2zz9PXYgs + w014c0GOe6GdeNX4D2NCZ0wDrDTgmA5oWgCaCXIxmbszc+RSsZMn4zvbqueDH+CEXoLW5js5xRgDeTqc + 1vlzuVTA+kTHq2+PRy6Fb4ekLUTWJezYCnBpwLEqAsdEzBVVFjnm3bMH9fKx7Oxnn5KcLCWANU/k2Xlq + ociZM5gjx+Ahggpsvi1SfbKBE2pXcvfuFvn27TdZI09dsYJkeXtSAesTHa++6Y8cO1eQS5wbNaQuSJYJ + m/BJsAlvQuTJRw5SLxvL8Ak/fJ+5uSPHFMH+zJH7fvutULKt7U8i1ScbgD77UlSUizGQp2/cQM4XVu1N + K3S8+mYYcqlMfMbZFO/S6vIdQDYNcnzN/PQHxn/NPGjCOABr/siloubNZY7ct0MHEvrTTy5g9Mnewgon + 8BG0UX3wYA5r5MK9ua83FfHjouPVt6ohlw77FDZ9CnVhsi5hu7QJbzzkWDCAo10elp2pU4dkZcoArWUg + xxRhgcI9OkvkmF/HjjcL/fy+EMlWbQD5oNtFRb/DY/MHrJHLNm0k52Hh0iBXFh2vvj0Zcuwc/LAd631M + XaAsO/H66yQrMcaoyPHZbqO/Zv7UUyTlpD2gtRzkUlEL5jNFLhVjY7NcJGv4AHLcr33FOQ+PENbIsWw/ + HyrkyqLj1bcnR47hASIy4LGjKQ5S4fVdZ6MhF14zb9yIejlY5j/sF0BrecgxRXgg8Zc23Rkh92nfHvfI + SwCrVfuARvjGhtAGxa5df7NGjqdj6GNzOl59qz7kUkGjR1IXKuvit2xkjhyLWrmcev4sO/2/90mWPBXg + Wh5yqchZM5ki92nXDiuR7dzZQaRr2ADyX/7JzDzCGjmmdnGiYq4oOl59q37kWJ5GYZInqRxef034rDAq + at0AbGXRgGP4mrkpdv1NOnoI4Fouckzm4cIauVDUqFE7wKxhr6nDNzwHrcpzcopmjRwrzFZRQdOi49U3 + Nsil0uz/pC5Y1nl06qjFSsMthf9eSTTgUl49ulPPl2W+A/oBXMtGLpSrIiEjRzBFjgV06yYHs4ZtvsM3 + NIY2KHbsuMYUua0tyXSwp4KmRcerb2yRS+8b9x80gLpwWRcHm/BU4BhgrSwabqmkw/up58eyk++8TdSp + iYDXwpFDWQA9xeEYU+Q+33wjpNiwobNIWL8B5MOuy+VHWSPHCtJTqKh1o+PVN+Mgx3IzUsmpd96hLmCW + nXjtVaKOj6pW5NmZGfA4+X/U82NZ/O+7Aa91IBfKUpCgfn2fCLkAvBLk3m3bkohhw+zArn6b7/CFeEy4 + FXmOjjGskWfs2klFrRsdr74ZD7lU8l476gJmnWfHb7WAqwE5Fjx+LPV8WOb1fQ/Aa0XIxeI3rWeKHPPr + 0kUJdl8XKVc+8IX1ofWw2f43S+Qpy5eT7EB/KmwpOlxDMj5yKW8TPK7F4javrxbkGV5uRn/NHHfvVSXG + AGDrQo4pY8IegV6dyKUyNmxoI1KufAB5z9sFBb+zRp4KX4efc0YDjtHhGpLpkGPZSXHkxOuvURc0y068 + CpvwcbAJD1griga7bKZ6zTx26yYAbH3IpcImTmCK3LtNGxL6888rRcqVD0CfWejr68MSOaY89icVOEaH + a0imRS4d9il+8wbqgmadR4f2pOBcTpWQY1HLl1BPl2UeHTto8dJQ64ZfVw63+SPH8M1ALJFjQT17BoPh + 50XO9IEveB1apz54UM0SOZYbFWHVyIVgE9q93TfUhc262A1rq4Qcn9Az9mvmwiGbo8PpqHUD0JaIHFOl + JxFf2Hxnhdy7dWv8/5uXEhMr/6hlQN6i5M6djbKNG++yRJ4K30/br50O15DMCDmEB4jQwAJ2eOkl6gJn + GR4UQgXnbQhyzKtbV+rpsQyPVENFrRuAtlTkUuFTJ7NDLhY9fvxwkTR9APrgK0lJf7FEjtE22+lwDcn8 + kEtFL19KXeCs82jfTtiEp4GmlXRwH/V0WObaqgWgw+O/6aDWDUBbOnIs+c8/mCLHQvr1OyiSpg9An5fv + 4hLCEnnKsmUkNzy0xiDHEJspPngQi123mopatxxFOjn9/vvU02AVHrIZ385JhV02AG0NyLHM1ISH0Bkg + 92rVCne5TQTL9Peowz+8Bq1VHzigZokc/1uUl11jkEtlBvoR++eeoy54luHjbdyEp+EuDX4RBY0dTf1+ + lkUsWkCHXTYAbS3IpXCXWFbIMfjz7Uvh4fTH6YC8YUlJyTrZhg3FzJBDcju7GodcOhJM+JxZ1AXPOvd2 + bQXMFSHP8HAx+mvmzk0akRxY9FTcUgDa2pBn5WaSuE3rmSH3atlSKGbixH4i7fID0Hv9o1IdYIkcU7u5 + 1EjkWEFeFnH6/DPqwmddzJpVVOR5uWqjH/tOOGSzvxcdtxSAtkbkmMzXgylyLLh//40i7fID0G2KfH09 + WSJPWbqU5Kcl64CtSpaHXEru7mySTzYRNuGjwsohx6KWLaZ+PctCZ8+g45YC0NaKXChLSfy6d2OGHPPv + 1i0ITJf/gAf4i6ch22x7+0SWyHFvuPMAjo5X3ywXuXQkmOCJ46kAWOfWtk0pcEwVE2H018xxiyYnGw/Z + rINbCkBbNXJIk5NJwmdOZ4bcq0ULPJ1zYLr8p67CX7wDrVHa2RWwQo7J9+/TQWtolo8cw4NUONb5iAqB + ddGrbEuhe3XtQv0aVgmHbHZ3ogPHAHRNQI7F797BDDnm+fXXDzLt7euJxLUDyBsh9PR16+6wQp68ZAnR + uLvqwDUk60AulX7KwSTHmXN4+WWiigwhifv3UP+dZUGTxtOBYwC6piDHZH6eLJELxYwd218krh1A3vVm + fv5ulsixvIRYHbz6Zl3IMXyHWcDQn6kgWOfWsoXRXzN3rFuHZKszOHIxtVom7PfOCjkW2r//MpG4dgD6 + 8IuRkaeeCHlZ4BTkycuWkqJzuTqA9ck6kWM5ijRy6v33qDCsKthyST3jwJHrFDJmNDPkWFDPng4ice0A + 9Ln5Li4BzJBDsh07dADrk/Uil0r64wAdhxUVMHIYR04pdu0qZsg9mzfHPfBiwLZ2Dzn4Ax5RZmX2sWMJ + rJBjSvtjOogfl/Ujl/Lp05sKxBo6/eEHJAu2XDjyR0u2P8oMOebTunUB2NYecQb+8Ba0KnPvXjUr5MmL + FxONj6cO5MqyAORU4JhhyLGstCRy4s03qVAsveRjhznyCpKHBjBD7tGsGfFo3vz+zYyM/0nQP0Ho8q1b + L7NCjuXGx+hgrqiahVwqfuc2KhRLzm/QAI68ktQaubDTDBPkYimLF2sPLQXIWyL01NWr77NCnrxoESnM + UeuAplUzkQsV5hLPzp2oYCyxU+++SzTpeMhmjryyAn8azAw5Fjlq1C8S9G63zp/fxhK5cKAJKuyy1Wzk + GB7rzRSfiMKihH12HLkeRcyfywy5R9OmJHzgwIUS9MFXU1MPs0KOyex266DWjSOXwjef0OBYUt69e3Lk + eha7ZSMz5Fhw7952EvRxF4KCzrBCjuERZejAMY68bPkF2cStVUsqIEsIn1RUJeEhmznyx6XOUZLk40eY + Iff46iv8JFdnMP40Qp+e5+zsxwo5pnJx0sHNkdOQS2WGBgpHX6FBMvdit2/myPUIkWPpPu7MkGO+7dtH + g/HnEfqv2fb2UayQJ/32G8kK9NcBzpFXFr6NNOK3X6mQzDmPzp04cj2SkGOK+ChmyDH4JZIJxl9C6MtV + hw8nPwK8mpBjOZFhHLmUDmrdpPeL58Fidm74JRWUOebw6iskM0Y8ZDOA5sjplUUupExnhlyoefNLYPxV + hL5CuWePkhXypIULSV5SPEeOlQFNq/SgEGJyX0/haCw0WOZW9LpVHPljegR5tjbvdu2YIHdv0oS4f/XV + HTD+JkK3lW/bls8KOVagkHHkALeydJFLhU6bQoVlTrm1aQ24NRx5JVWEHPP7vgcb5FjjxkTz558fCZvu + sg0bLrNCjml3luHIK4oGXCo3O5OcrV+PCswc+uvFF4kiPIgjr6TKkGOBgwczQ47FTZ/eSoCetnr1TVbI + sfMAjSOnR8Otm8z5jEkOUqFPkUsXceSV9DjkWPCY0cyQY1FDh3bVQl+16jYr5IkLFnDkFURDTe1cDgkc + PZIKzZS5NP2K5OSoOPIK0gc5FjpxAjPkWGj//n0F6HBvXsIKeTKcDkf+aFTQtMTju2UrZeTMhx9QwZki + /DAKeYAPR15B+iLHQidPZIbcvVEjEjxgQH+EvowVcixp6RKTI6cCx6jAMfNCLpVy/CgVnSkKmzuLI68g + Q5BjYbOmM0OOBfToMeL/Su7cWcEKeeKvv5JkW1uOvExU0LR0kEvhWz9p8IyZU4PPSU52JkDlyHUzFDlW + Dno1I3dr2JAE9e496v/uXLu2lhVyLGXVKo5cjAqaFgW4VLYsmZx8520qQGOEh2yWeboCVI5ct6ogx/Az + 6FghxwK6dp2shc4IeSl0KuyyceSlUXCXLQ9K2LubitAYBU2aAFA5ct2qihwToFcjcgm4lH+nTlP/7871 + 66tZIddCXyliriiOvDQd1LohcinP7zpTIbLO6/segJUjL9uTIMfC585mhtztyy9JYPfuY/HJuKWskCfO + n0+SliwWQdPiyEsTMVdUWeSa9CRy6r//pUI0RrE7tgJajhx7UuTqbAUJmzmdGXLMt1u3EQh9CSvkQnBa + HPljEjFXVFnkmFf3blSAxgrfc56ZGE3HXFEAmiPXTSEUOnUyM+RYSK9ePwnQU5Yvv8MCecK8ecL/c+SV + BHArSxd57Ia1VHzGzqtbVzpoWgCaI9dNi1wFhYwfyww5Fti7948C9FRb29sskEtx5BUEcCtLF7kyJED4 + 7DQaPFMUu2MLHXbZADRHrttD5FjwuDGGIwfg+iB3++ILEtynT08BetrKlddZIccKC7I5ct0AbmXpIs/N + URHnJo2p4EyVsAkfH0kHjgFojly38sixwCGDmSHHIn75pS1CX5y+fn0hK+QJc+eSgsyMakL+EHhNQo6F + TJtMxWbqPLt14cj17lHkmF+vnsyQuzZoQGLmzPlMgJ6xZYuaFXIsNyWBI5cCtJVFQ5562oHYP/00FZo5 + FLNtM0f+2OjIMe8O7Zkhx65HRr6F0H9T7t6dygp5wpw5JDs6giPHAG1l0ZBnZaSQ0x/8jwrMXDrxxhsP + N+EBNEeuW8XIVeqMR+7NqxM5fM01MP4KQp+pPngwihVyLCvInyMHtJVFQ553Lpt4/9CLisvc8uz6HUdO + rRLkkDI5lhlyDE4rB4y/iNAnZdvbB7BCjqncXejAMSpuqZqNPG7bJioqcw0/jIAjL1vlyFVZCiIL9mWG + XIDetGkyGH8OoQ/Pd3E5ywo5Jj/+J0deQRUhz4wMJidetayPZ8JNeGVcJECtOnI6XEOyHORY8snjzJC7 + fv45HmHWG4w/hdB/vBgWdpgV8vjZs0m63W6OnFJFyHNz1cS1WVMqJnPPo3NHAMuR64Mci9u1nRlyzKdt + 20PSRzJ1vC6Xb2WFHEtevYoj16ki5FjY7BlURJZSzJYNVMiVRYdrSJaHHMN3rrFC7vrZZ8S7Q4cVEvSm + 927eXMoKefysWSQe/r/wXC5HLlYZ8nSn08J7vmmALKUTr79OlDHhVNC06HANyTKRY0HDfmGGHAv47rvR + EvS60MLUZcv+YYJcLDc1UcRcURx5tiKNnK5di4rH0tJuwtNhl40O15AsF7kqS0682rdjhhwLGzSokwT9 + Pwg9fd26XFbIMY2/rwiaFkeO+Q7oR0VjqUVvWkfFLUWHa0iWjVyeGM0UOZayc2ctCfoz0K+KnTuTWSGP + nzmTKBzsRdQcOQ15/O7tVCyWnMNrr1W4CU+Ha0iWjRxLPnuSKXL4u6tg+xUBOg78z0T14cNBrJBjadu3 + irA5cl3kKsCAj2tpWCw9j07fkmyAyZFLaZFjMds2MUPu8umn+EskDWw/JzKHnwYh/fOdnU+zQh43YwZJ + gIcFWtAceVnkubDwXVu1oCKxlqI3PtyEp8M1JOtAjoXYTGKGHPNo2tRNJK4dgN7+SkLCLlbIpXLTkzny + Msix8F/nUnFYU8ImfHSYCPVJsh7kmHenjsyQu3zyCfFs0WKDSFw7AP3zezduLAHgD1ghj5s+nai8PTjy + MqW7OZnkY5GDxo02+kMF92/bkyxARgesT9aFPCM6lClyzLd9+xEice0A9Leg+SnLl1+qDuTlgIvIsfQD + +zhyMfyIJce6dagoWObasgXJhgUfvW419d9ZFr1xrYjW0KwLOZZweD9T5FjowIFNROLaAeRPQbPkW7em + sEIeN20aSVq2lCPHCrKJ/88/UTGwzOHVV4kyKkR8O6laQE/7Olbh+cvh/OmYK8r6kGdCYfPnMEUOf/8v + KSx8WST+cAD6UM2RIz6skEvlq+R04BgVOGb+yOnAsUeRJ+7bQ4XAurhd28odICIjyIfYP/889WtZZdgm + vHUix3x79WSGHHNv1CgOTD8t8n448JcdzwcFHWCJHFP5eNZo5Kr4KOFYazQELPPp92M55FKhs6ZTv55l + UetXi5Ary3qRZ8SGMUXuXL8+8WzadL9Iu/wA9E/vXL26BIA/YIU8dupUkma3u8Yiz83TEPdv2lIXP8tO + 1/qQqGVJVOjZGjlxrF+P+n2scnjllcdswlsvcixu726myDGvli21+7jrDkB/GZqbamtbqBdyAG4ociwe + fomcKwSwNQw5FrH4N+rCZxm+QSb19F9U5FIpZ06Q4089Rf1+Vrl3aFfBJrx1I8eCx49lity5Xj0SNnRo + PZH2owPQxyp2745ghTx2yhSh7NioGoc8w8uN2D/3HHXRsyx42mQq7tJgKwPzG/oz9ftZFrl2lYi75iBX + ZqYTj5YtmCKH78PDRz0rsn504B975Ds727NEjskd7AEuDThmfcizVRnE8ZP61MXOMpevmpBsWLhU4JiI + HA8UoUpLJCffeYd6OqwSNuEjgy0HORU4ph9yLNn5NFPkmHuTJqdF0vQB6A1v5uSsZIkcS1y6BPDWDORY + wMjh1IXOMvxEF3mIPx04Vga5VNyendTTYplbu29gE15ZI5Bj4QvmMUWOeX399QyRNH0A+qvQnNSlSwtZ + IY+ZPFkoJyUBEFs/8qTDB6gLnHXR69fQgWMU5NrUJvk45si1K2sEcqVaRrzgFxtL5NCDkIEDPxVJVzwA + fXjm778HsUSOyR2OA2TrRq5OiiUn336LurhZVukHIALoipBjiqgQ8tcrxv18Nzy/jPBAKmB9sgTkmLDZ + zhY5npYMDD8jcq544IvaFwUG7mGJHEtY9Btgtl7keflZxKPjt9SFzTL83HRVakKVkEtFLFtMPW2WubVr + SzSAjga5siwFORY2ZyZT5M4ff4xHlN0tUq58APqHJbduzUuYO7eYFfIYGxuhrJgI60QORa1YRl3QTHvq + KZJsf+SJkGNZAMAUH+gYsWo5FXNFWRJypTyFeLRowRQ55v3NN71FypUPQH8amixbty6VJfKYSZO0O88A + WGtDLvf3Jn+98AJ1MbMM35X2pMil0r1cyfFnjXuQStyEl4XptwlvScgzNXISf3Avc+Qu9epdVxw69JpI + +fED0Hvmnj17jCVyoWlTSX62yqqQ52gUxOnzz6gLmWV4nlnqjGpBLhU4aTz1vFjm2rbNYzfhLQ055j9w + AFPkTnXrErdGjU6JhPUbgF7/zpUrv8Jj9LvMkIspnM5YDXIsaNwY6gJmGW49yPy9qhU5plakkTMf1aae + J8siVla8CW+JyNOCfYlr2cfmDJBjnm3aDBEJ6zcAHQ8YaZO+dm0KS+TREyeS+PnzSAEgoqLWDYBWFhU0 + LTi/iqIDxwDyY5AnH/vD6LuSYhG2S6sduVQSXifKebJMeBY+NMAqkGMh06YwRw5/d9WgzXZpAHoP2Hw/ + yhK50IQJROXnTYddNgBaWVTQtABtRdGBYwD5Mcg1KQnk1LvvUhcuy9y/7QCg1UyQY7jXmnffPtTzZplr + 61blNuEtFXlGfCRuUjNFjrk3auQg0jVsAPrH965dmweb73dYIscSbZfTcUsB0MqigqYFaCuKDhwDyI9B + ji+leXbrQl2wLDv5nzdJZkIUU+SYMjGanHjzDeplYFn4imUWjRyLtF3CHDnm1abNAJGuYSNuvk9MX78+ + jiVyKU1kqGUih6LXrqIuVNYlHtrHHLlU9OYN1MvAMoeXXyKyED+LRa6QJRKPr79mjhz+7Xyhm9ujR5PR + dwB6pyIfHzvWyKPHjyfJG9dbJHJFsD9xeOkl6kJlmf+wn42GXAjuWd3atqFeFpa5tG6lxWphyLHoTeuZ + I3eqU4d4NGliJ5Kt2gD0/5bcvTsjce7cqyyRY1HjxhFNTIRFIc/JziRODb+kLlCWOdb7mGiUacZDLiYL + 8jXJ/gFhyxbrANYn0yIX7s3hlxRr5JhP586tRbJVH8A+RGln58UaOZa0ZnX1IQewlUUHjgFiPZDnQsGT + J1IXJsvw8NBp7k5GRy4VOm829XKx7C/chA+GTXgqaFqAtqKowLHqQ45FrVtlFORwWgn4MFvkWvWBE2l0 + XalcBrAfsEQupYkIoeKWoqLWDcBWFh04Boj1RJ5y4jixf/pp6sJkWdivc02GHNPAIj5rgh2C8Ii1Kjhv + OuyyAdqKogLHqhe5IjWeuOPuroyRO330EX4ay0yR6pMNQH8empiybFkGa+RRY8eSxBW2VOAYFbVuALay + 6MAxQKwnck16Ejn9/vvUBcky1zathWOymwq5VMrZk6b5JffYTXhAW1FU4Fj1Is/UZJDIlcuNgty5Tp1/ + E6dPf1ek+uQD0L/Ld3bezxq50JgxRBXga7bIMe9ePakLkWX4ySrKqNBKkNMRPy4aZH3yGzGUejlZhpvw + 6UG+FODmg1wWH0ncm37FHDnm+sUXx0Si1TMA/Z27t27NiJ816xpr5FjcvHkkPy/LLJHHblpPXYSsKz0m + uxkgx1Qy3Kp5j3pZWebS4mvKJjygrSgqcKz6kWMh06cYBTnm2bZtR5Fo9Q1g/yFzzx5X1silMk45mB1y + RXgwcTDyQRmw0mOymwlybZkkbr8d9fKy7uEmfCXPrGNU4Bgb5CnertqdY4yAHE43Ckw++gENTzpworVv + nTs3P3bq1LuskUeOHk2i4fRyMzPosMsGYCuLDhwDxAYgz8lRCQdbpC08lp2uVYtoMpLNDrmUZ/eu1MvN + sr9efBE24X3MCnmmWkb8+vc3CnLMo3HjoSLN6h/A/pNs48Zg1siFRo0iqbt30nFLAdjKogPHALEByLHQ + GdOoi45lwjHZz540W+SYPDpM+Ew12uVnGW7CIzCzQA7FH95vNOTwPer4ffueE1lW/wD0z66npy8F2A9Y + IxeCP6sjQ02OPNXxpICOtuBYFjJ9qlkjl95wgm8rpV1+1oUuXmAWyOUpscSzTWvmyM/Wri3k+sUXs0SS + bAYfE0BDU5YvT2KOXCx27hySD4vbVMg1GSnCRxrRFhrLhGOyZynNHrnwphOA5NKsKfV6sAw34dNgE96U + yLFQ+IVsLOTw50vRw4a9LpJkNwC9wd+xsSsB+QPWyCNHjhRKP3LIJMgxn359qYuMZfiEnzzY3yKQS6V5 + uwt77dGuD8tcvm4mPD6mA8fYIk9yOiXsAWcM5Gdr1SJun3++RKTIdsR79V9SbW3jWCOPGDFCCP8d94On + wS4bHTgGiKuAPG7HVuriYl3MxnUWhVwqeKoN9fqwTtiENwFyeVoC8er4rdGQO9epU2SUe3NpAPqnfyck + LAfYD1gjl4qZNZPkZWdSgWN04BggrgLyzKgw4vCa8Z9k8vq+u0Uix1TKNHKmbh3q9WKZsAnv7wWIjYcc + C7aZaDTk4r35fJGgcQagPwUNTl2xIsoYyCOGDxdK3r7VKMhzctXEtcXX1EXFMjwme2ZKAiC1PORSifZH + TXI4LefmTUmmStqEZ48cn2U3JnL49/z4iROr/p7zqg5Ar3ctLW0RPFa/Zwzk4cOGCSk8XZkix8LmGv8d + Wogj6fgRQGq5yKV8Bg2gX0fGhS7CTXj2yNPDAoh706ZGQy7cmzdoME2kZ/wB7D9mbNzoYyzkWCSchiYh + hhnydNezxN7IxzPHgiaMA6SWjxxTJsWSE28Z/6Oo8L3yaX4eTJErMpKId/duRkXuXLduKtPXzR83AP2d + 4osXp8XY2PxTZeQAXF/kQkOHkpgZ00muWiGirj7kWYp0cgZubNoiYtnZLxqQLLUcoFo+cgyPBhO9bRP1 + urLOWdiET2eCHAuaOM6oyKEH7l991UMkZ7oB7N+qDx06aizkQr/8QhJXr9SirSbkmN9Pg6iLh2XCMdn9 + vACq9SCXcuvQnnqdWRe6YB4T5FGbNxgbOXH6+GNXMPaUyM10Axfipft3746OmzUrz1jIpdKOHhaBPzny + eBN8NjiGx2S3RuSYLMQ0x9PDX56psAlPxS1FBY7RkSc6nhA+hKFakJcBXhlyqNitdevHfwSysQawf1Xo + 67sWkD8wFnIsDFK4Oj0x8szYCHLiDeMfztijc0eSnYtYrQ+59BbS0IXzqdeddU5fNSFK2ISvDuRp+ORb + s2bGRf7hh8Tts8/WisTMYwA67kTTP3XVqgCjIf/5ZyH8N2Wwf5WR5xZkkTS3syRmw5rKW68tuhrLTIwB + rNaLXEidQSLXryaRa1dWWkRFramoFY8tPTL4iZHLE6K0O8UYGblznTryyNmzXxKJmc8A9HeLL12yibax + uWIs5GFDhgiFjx5FNCnxVOAYHTiWpV/52nIeSaN/APrRHWGsHPljM6/3k+uGz7D7/dDb6Mih+57Nm38n + 0jK/Aeytc8+c2W5M5FJRUyaTbHkaR65XHPnD6MiVmekkcMQwUyDH098Plkz/BFxFAxfuOWhQ8qJF0cZE + HvbTT0LRM2aQbGU6R15pHPnDKkCulpHgKTZPhhyBVwE5/Ft+5ODBb4mkzHcA+oc3cnKmRU2YcN2YyEMH + DxaKmTOb5KjlAJUGHNPBXFEAmiOnZ9XIodA5M02C3PGDDx64N2v2o0jJ/Aewt83566+dxkZeiv3X+SQH + FhVHXjaO/GEVIw9ftMBUyInrJ58cNutNdt2BC/ss1C95yZJQYyMPHTRIKHbRQh3sOpgrCkBz5PSsHTnu + 02Aq5PDvmqB+/d4UCVnOAPS3b1+8OC564sQLxkYuhffs2cJmvA7migLQHDk9q0YOj8lNeU9+9oMP7rk2 + a1b9h2421gD2RkXe3isiRo68b2zkoQMHCkXPnkWyM9PpsMsGoDlyetaOPHS2yR6TC7l8+ulKkYxlDj7e + gLqnr1/vaArkIQMGCEVNnUI0aYl04BiA5sjpWTVyRQoJnjDOpMjP1qkTKbO1fV4kY7kD0F+6f+fO4Nip + U5WmQC6FO9WookI5cgOyZuTy5Bji17+fSZE71ap1xaV5809EKpY/gP3dawrF5MgxY66aAnlI//5CoXBa + ci83jlyPrBl5elgg8ercyaTIofueX3zRTyRiPQPYPy9wc1sZMWzYPVMgD+nXTxv8OWX/7wBcw5FXkDUj + TzxxTHt0GNMix/NaI9KwvgHs32Rs3fqnyZCLBfftS2IXLyJZmTIAy5GXzVqR4zvZIlcs0x6a2QDk5YBX + E3L4em9ia1v9n5tmLgPQ8fX17xPnzw81JXKhH38kEePGElV0OMDlyDFrRS5PjSMBw34x+KARLJDD32v8 + W7V6WyRhvQPQX75/48bAaBsblSmRS4XA6aT9dYwOmhaA5sh1M1/kyW5niUf7duaC/LJzw4ZfihSsfwD7 + m/9kZo6JGjOmyJTIsaA+fYRwT7qsjBQ6bikAbfXIqZAry0yRZ6Zr93Rr0MA8kH/4YbFrgwaWu1NMVQew + v3cxKmp6xPDh102NPOiHH4TChv5C5D4eHLnemSfy9PBA4vvjD1rgZoAceuD68cfjxKVf8waw1y9wd18M + j9WLTY1cqHdv4b8JG9aJT9Rx5BVnfsjxCbeYHVuJe9OvDEMOwBkix9OyFZd8zR3A/qXm6NH1cI9+z+TI + ocBevYRChw0lMndnjpya+SFPC/IVdoAx+FNNWSOvU2cXrHHLeUcay4Eboolq376tcI9eYg7IS+vZk8Qs + XUI0siRAypFrMy/kSmUqiVy1nLg2bGh+yD/66A+rfhmtKgPYmyl37twdNnjwA3NBLvT99yQYziPlz8Mk + G5DQAOsTHa4hceQP0yJPPGlPvLt2EYCbG3Lnjz46wZFXMIC9hXzTpv2A+yF2EyMvW9jo0UTm6UaFXFl0 + uIbEkT9M+2RbwNAhpcDN8J7cLX7iRNN9hJK5Dz6WgVrJt2zZC/fsJeaEPKBHD23du5PIObOIIjSQilo3 + OlxD4silZLERJGzeHOL65Zdmi/xsnTqnZYMHW/670ViPiL155q5d2+Ee/X61IC8L/AmRlwb/H/3rPKKM + CKECx+hwDYkjx/DY6uELfyVuTRqXA252yOvWPcrvyQ0cwN4kc9++DXCPfs/skGPdugn5Q1FzZpMMHw+O + vLTqQY6b6KFzZxH3Jk2EfdTNGTmcx+/k1KlnxOXLx5AB7F9mHT26Eu7Zi80Sedeu5QobN4aknfyLZMFi + p+PVtydHXg64hSFPcXciQWNHEzfcREfgZo7cpX79DbglKi5bPlUZuAE/zT17dgE8Zv/HnJH7d+mi7bvv + SNCggSRh13aSmRQrwjWkmolcIUsksXt2Ev++PxLXBg20mT/y+86ffjqPI6+mgRuyVpGf3+Twn38+b+7I + y+bX5TsSMXMGSXM6RTQAgQ67bDUPeYqXCwmbNUN4j3gpcAtADv9f7PL558PFJcqnugawv309NXVo5MiR + mTTkAnBzQt65s7ZOnYSC4J4qdu0qkuHnRbIAZE1Gjo+9o9atIj49vyduX3xRHnhVkZcFzhp5rVp/uzZs + aL6fjWbpA9hfvVlU1Dt6woQoS0Iu5duxo1Bg//4kdt0aIgv0EdFbP/KMqBASvWkd8evzg/DYG4FbInLH + 2rWzPJs1qzlvNTXVAPbnye3bHeJmzXKxROSlffutUOAPvUnU4oUk5eRxopIlURE/LrNEnplGkuEhS+TS + RcS3V08tbikLRe5Uu3a0f+vW74lLkQ/rwSc/oIZp69btCOnb946lIvft0KFcPvB3IaNGkpg1K0nqGQei + TImnwi6buSBXZiSTZOfTJGrtShI0chjx+Ppr4tawYXngFoz8bN26hyPbtjW/zyuvCQPYP8w9cWJ66MCB + Fyweefv22tq1K1cAbK2ETbEhMetWk2T7o0QeGkDUmgzTIddoN8MTTxwn0evXkJDJk4hvzx7Ca90C7LJZ + AXL4c7HzJ59MEZccH1MNYH/tampq34iRI5OsDbnPN98Iebdt+7A2bYg3/J0/PNYNHTeGRC78lcRu2UiS + /jxM0jycSUaIP1EkRhOVKl0HtW4U5PgyV1IMkcEvk1Q4rUT4xRK7bTOJWDifBI0ZRfx69yIeLb4m7o0b + P6xRIyFjIBeAGxN5rVp5bg0atBWXGh9TD2B/lty8+XXivHn2gb1737dq5Fjr1uXyatVKW8uW5fLG08XL + A4+RsYB+fUnA4EHQQBIwoD/xhdsBw6/Br/Vo2lTbV1+VC++thcoCt3Lk8Hjc06VRI/543BwHwH+g+eOP + WSEDBhTVdOReLVoIecJj5XI1by7k0axZ+ThyaVP9FpzGTFhLfCcYcx74Ab10LSOja9S4cf4cOUduCHLH + WrVSnBs0aCwuJT7mPvjbGPpEtnbtmuA+fa5y5Bx5ZcjxY4ud69bdGtSp04viEuJjSQPYX7sQE9MjauxY + f46cI6cir1UrCS5DS3HJ8LHUEe/d6yh27lwA9+5FHDlHLgK/Cae1iL9/3MoGsL/0j0LRLnbqVAe4Z79n + TsjLAefImSOHzXQPjwYNPhOXBh9rHAD/3zxHxyHhQ4eGc+Q1Czl8rcz1yy974laeuBz4WPPAD/ppcXN+ + VvCPP2o4citH/tFHf+P7xlXTp78gLgE+NWkA+wt3rlxpnPTbb5sCe/a8wJEbCXkZ4EyR16592/XTT7d5 + dujwrvgj51OTB8C/clOt/jph5sy9Ad27X+PILRu5Y+3ad+G8jnh16lRX/BHz4fNwAPyr11NS2sRMmXIo + oGvXf6oVOQDnyJkjv+dSv/5fPm3bNhB/pHz4VDwA/vULUVHtoidMOOrXpctNjty8kTvVrn3fpV69016t + WzcRf4R8+Og/uEl/KTy8RayNjZ1/t24XOHLzQg7ddP3kkwPuzZt/If7I+PCp+gD454vz8z+NnzdvZeD3 + 36s48scjF4CzQv7xxxedP/10dVCnTu+LPyI+fKpvAPwz0P9Sli0bFzJokC/cuxdz5EZD/gC+N8Lts8/G + x/fp87L4I+HDh+3gZn2Om1vz6IkTN8NmvYYjZ4S8bt0LcO+907tly4biTc+Hj/EHwOPON/9NsbUdFD50 + qL1vp06FHPkTIv/443/gnvsUXJ5BQaNH83eU8TGvAfDPkn//fT9x0aKfQ3/6ycGvY8fzHLl+yOHP/7p8 + 9pmjZ6NGQ1JGjHhFvEn58DHvAfTPQe+lr1jRJ3zEiJ2B3brFAfa7HPlD5ABb4d6woZ17ixY/psybx3Hz + sewB8PhW2dcL/fy+iLWxmRHav/8p32+/1QDsBzUJOXzdebdGjZw8mzad5d+r12dwmzwt3kR8+FjfwAJ/ + HnpLdfBgs4gxYxD+Md+OHVMB+z1rQe5Sv/4DtwYNVHCeDnD5p4X07NkMr7d4E/DhU/MG79mg186HhHwc + NX78kJC+fTcF9Ojh5tOunRyw37EA5CXwfTkejRt7wvlv9mzZcljImDG14Trxzwvnw6eyEfG//G9a2nvR + U6Z0Du3Xb3rg999v9e/S5bTft99GAqZc2AS+a0TkJfB1RXAe8ZAjnPc2z2bNpnu3a9c55rff3uao+fCp + 5gFUz0IvXcvN/U/yggUNQ0eM6Ai/CAYG9uw5MbBLl998O3fe4tup00Hvb7454du+/VnvNm28vNq29Yb/ + hnm3bh3p1apVJDxMwP96Q15eLVo4e7Vu7eDdqtUh+P+tXm3aLPH55pvJfh06DAzo3v3bqCFDvtDs2/cG + nq94EfhY1Pzf//0/7XX2GwmzyMcAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAYAAACI7Fo9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAGYktHRAD/AP8A/6C9p5MAAD/wSURBVHhe7d0HfFNV+8Dxv3uP1/HqqyAIDpQhIFNAQJaAyBZl + b8regsyy96bIFoRaVunee+/dNEmTdNOyZIhAGeX8n+fm3tKG05KUnqye5/P5fURos3q+zU1yc/N/fCxv + CCGvQbWhxtA3UBfoB2gINKakuHj67cLCxf9qNOuvZ2RsvZKcvOtaevq+yzExR8qVmLjn78TEHX8nJW27 + oVTa/qPR/Hb32rUJcBqDxdPD020LNYHqQm9CT4sXgw8fPk86AOoF6COoJdQHGlly69acG1lZOy/HxtoX + enu755w8Ga4+dCg1c88elWL79gLZxo1X0lavLk61tSUpy5eXb9my8i1dKpS8ZEn5Fi/Gv7+bunLlNdm6 + dYUZW7aolXZ2KXA+EblnzrhdCAw88nd8/KrbFy+OhcvUC2oF4S+BV8WLzocPH9oAkhehzyC8Bx1WcufO + rzfU6n3ng4Odck+fjsjct08l37TpWuqqVSQNAoTaVqwoHwB/UuRCixaVK+m337QtXFgu+J6bsg0bsjL3 + 7o3MO3vW8VJExBb4BTAKrsN30BfQ6+JV5MOn5g0A+A/UDOoPzSy+fHn7hfBwx9yTJ2OUu3efg3vS+3DP + TIRE3FLmgjxxwQJtv/5avvnzH6TY2l5U7NwZm+fkdBIeFiwn9+/jFgle3/egp8SbgQ8f6xpY3M9Bn0M/ + QvPg8fOe80FB7po//0zL2LbtatqaNaRclotcKGHevHLB9/ybsXFjera9vfPl6Oh1AB83+RtAL4k3ER8+ + ljmwiN+A2kHj7t26teFyXNxpuMeOl+/YcSV93TqSvnatkLUjT5g7V9ucOaXB19+UbdqUlHfmjP01hWIy + 3Eb4hN+74k3Hh495DyxWfDYcnwW3uXXhgl2Rr6+/5uDBLNnGjfcE3FI1GHn87NnaZs2SepC8dGlB5r59 + PhdDQpaI6N8Wb1I+fMxjYFHis+OtoUnFFy/uQtyq/fvzAfcD2fr1BOPIK0SubeZMobgZM/C8Lmbu3etz + MTT0N7hN8Rn918Sbmg8f4w8sQHzpa1BJcfF6WJQe6gMHcgXcGzYQIY7cYOTlmj4dz/s8/NJ0uZqSgs/k + 14f4a/h82A8sNHwZDB93z/k3K+sIPMZMkG/dWlyKmyOvNuRC06Zpmz79fvrq1cl5jo7b7t26hbf/G+KP + hA+f6htYWLhH2A8l9+6tuRQZ6abev78Q7r2JEEfOFrlY7NSpQolz5vyt2rfP6YZCgXvvvS/+iPjwqfrA + QqoFDb/377/bCn18ghU7d/6TsWmTFngFyMsB58irFXnslCmlwdfdydi8OehSVJQN/IzqQfz1eT6GDSya + jyGb4suXf89zcoqFzfM7CJwjNw/kWMzkyULw55LUVasSzvv745N3uK8CfxzPp/KBRYJPsE26e+2aXb6L + CwK/KwHnyCtBXga4MZGXZmNDYm1scI+8xKLg4PnwM/wE4vfwfMoPLIoPoXF3r1+3K3Bzi8rYtq0ccI7c + vJELTZok9QBu05iLYWEz4GdaT/wR86nJAwsB9zkfXlJcvB0eg4fKt28vhsd95YBz5BaFXCh64kT8bwnc + 3mF/Jybiu+z+K/7I+dSkgR887nvetaSkZP2F0FAf5e7dNwTg+iIH4By5+SIXmjBB26RJdzO2bvW4mZOD + +9fzt9LWhIEf9FNQc2jJdbncQbV//4WMLVu0wDly60MuNX48ns411cGDh+7evPk1/PyfEZcEH2sb+OG+ + A025feHC/hwHB7kAnCPXHzkCt1DkWNS4cUJw2XLznZ2XwVqoJS4NPtYw8AN9Gvqu5N69TcLj8G3b7gnA + OfIah7y0sWMfpC5fHnElORkPl/WiuFT4WOrgb21o7g2N5njpZjpHXtORaxszBr//umrfvt2wRuqLS4aP + JQ384J6BeuGz6QVubvh6eImAmyPnyEXkZYPrn3w+JGQorBl+IAxLGfhhvQvNvqFS2av27r0iwObIOfIK + kEeOHi0E/3ZLsXv3Hlg7/LG7uQ/8kNqUlJRsLPT1DYPH4uXvxTlyjrwC5JGjRpWWvHBh1OXExK6wlp4V + lxUfcxn4obwCjbl98eJBzZEjebCpXh44R86R64E8cuRIITidy1nHji2CNfUfcYnxMfXADwN3X11yJSnJ + Wblr1+2aiDwFTi99K1zP/fuI4ugRknnqBFG7OpMsPx+SFehPcsJCSHZYMMmJjiS5cdFiUSQ7NBgKIllB + /kTj601Ubs5EedKByI8cJrI9diQNbqMkuAw1CXnEiBFCkSNGPEhfs+YMKS7mT9SZegB4S9hU33zOyysK + NtUfGIy8LHAzR45fJ9uxnSiPHyMaL3eSExlG8tNTSGFeFjl/sbCCzgkV6XahsgrKVYgV5JA8WQrJjgwl + Kjhv+Z9HSOrmTSQBtgqsEXlpw4fj1kwibMrj8fb5u+KMPXCj47Pqg+7euLEn+/jxLARuVcjh6zLsdhPV + 2TMkJyKUFChk5DwgpGOuqGpCTuv8w/KVMpIVHkKUjqdJ2vatJB42/60FORY+bBiex/mCs2fxfe8vi0uQ + D+uBGxuPtDrz39zcP1X79l21CuTwZ4Sthk3n/JQEUlSUr4PW0IyDnNa5ojySm5ZEMt1cSOr2bSQONvEt + GblUxMiRxUo7u82w9vhhqVkP3MjvQ0uupqefUezaVWzJyPFrlbAJnAv3hkWw+X3hUpEQHa4hmQ554fn8 + cp2DCmCzPwu2SjL+OASb+vMtErnQ0KHYg9TVq/+CNfiRuCT5VPfAjYsHE1hzMSLCR7Fjx31LRI6fnaY8 + Crgjwsj5wrxS3NaK/JHgOmdFhRPZof0kbt5cS0NOwn/5RShx4cIAcuVKY3Fp8qmuAeD4iaKbCzw9o+Xb + tgnA9UUuADcxcvne30lOaDApOpf7CG4pOlxDMnPkGDwkKQ3Qa2BrJnXXDhKD9/KskJcFXg3IpWKmTk25 + Kpd3hHXJj2RTHQM3ZPeSe/e2554+LbMk5GlwemonR3JOmUGFXTY6XEOyMOTlyiN5agVROJ4iCYsXWQTy + sJ9/FooeNy77QmRkP1ij/G2vTzJwA/YpKS7eJTyzbiHIM3bvgsfdoeQ8IKCh1o0O15AoyKmwy2Y+yMuF + 9/JRYSRlyyYSUxa7GSIPGzJECE77AmxpjoS1+py4bPnoO7g5BA26f/OmnebIkQJLQK44cpjkJ8VTMVcU + Ha4hWRFysQKxnLQkkrbvd+FxvLkil4LTuJrv6Dge1uzz4hLm87iBGwvfP/7L3evXf9ccPlxk1sjhv6oT + DuRc5uM3z3WjwzUk60VeNtyslx3/Ex8TmyXysJ9+EoLv+SfL3n4arF3+/vbHjYh85N0rV/apDx68aK7I + 06DMv46TQpWcivhx0eEaUs1AXra8LCWRHTtCom1sHkEuADch8tDBg4XCf/75ZtaRI3NhDfO3u1Y0cOPg + 5vqw25cuHVDt3/+3uSJXHD5EzillVMD6RIdrSDUPeWmFuSQX7uHT9u7R3rObEXIp+Lti1Z49C2AtvyAu + bT7SiMgH3712ba+5Is/YsZ3kxUZR8eobHa4h1WzkZctOiSdJa1ebFfLQQYOEBOz798+BNc2foCs7cIP0 + vX/jxh7VgQOXzA152to1JNvXm1wANDS8+kaHa0gcOa1MPy8SM2O62SAvg/2m5vDhybC2+fvaceCG+B7f + nGKOT7wpDh4ghbCpSINrSHS4hsSR08oXy8vKJKm/25VCNzXy0IEDtf30043s48fxs91r9uvscAO0w9fJ + 1fq8hFYGOGvk6XA6uSFBVLSGRodrSBw5LQl52dSRoSR27myzQB4yYIAQfO/13NOn8SOea+YedHDFG0Fb + ck6eVJgTcuWRP0hRroaK1tDocA2JI6dFQy6Vl6chaQf3a+/ZTYxcCs6r8KK3dwdx6decAeD/gzYUeHjE + mgty/JrsQD8q2KpEh2tIHDktGm5aqtBAEj11qsmRh/TvLxQ1cqSyKDr6S5GA9Q8AfxNafiEkJMBckMvt + dpNCPfZJ1zc6XEMCtBz5I9FAUzuXI5SrziBJG9aZHHlIv35CMTY2oeTmzf+JFKx3APjz0K9Xk5Od5Nu3 + C4d+MjVy9dkz5ML5J3tGvWx0uIYEaDnyR6KCpiUiL5vc2ZFEjBppUuRS8bNnnwYDb4gkrHPgCo66XVR0 + WFnRQSMQuJGQ47/jm08uXj5PBVuV6HANCdBy5I9EBU2LglxKExNBoqdMNiny4L59hVJXr14FFqzzNXa4 + Yh2FZ9hx11YTI5dt307OydM58tKsGzmWB+WoMkj88qUmRR7844/477c1f/yBnwxjXc/EwxWqD23JOXVK + bmrkyj8Ok/MFORx5aTUDeWn5WSR1/14ShthNgFwKzu9cYVBQC5GI5Q8AxyffVhUFBgabGrn6zClyEWCZ + D3LKM+sYFXbZOPLSRMwVVQ55meROZ4TH7KZAjgX16YP76keTf/99T6RiuQPA8d1o029oNPaK7duF47yZ + CjnuxorAOXKpmos871y2UGawP4kYPdokyIN++EEoccGCvWDEst/tBlegBz4uz9y372+TIYfyIsM58nKZ + EDkArSwqaFoAtrLowDEtcilNfBSJHD/OJMgx+Lu7qgMHhoMVy3y8Dhe8DrQlz9ExxWTI4c95sdEcebk4 + 8tIKtGmS40jkxIlGRy7UuzcJGzw452+ZzPJ2pgHgL0CLLyckuJgKOX5NfmIcR14ujlwXuVRWehKJmjLZ + 6MixwF69SOzkya5gxrJeX4cL/EvxlSt7Fbt23TIFcvwzHr+NIy8bR14RcinEHmkzqVqRC8AfgxwL6tXr + gXzjxnlgxzLe6QYXFN+ssjXH3l5lMuRxMRx5uTjyxyHPFdOkJJAIfMxuRORS8P2XzoeFtRYpme8A8Beh + ZRcjIz1NghzKi47gyMvFkeuLvBR7YgwJHzXSqMgDe/YUihozxhcMvSmSMs+BCzjo7rVre5Q7dz7cZDcW + 8lWrSG5YCEdeLo7cUORS6tgIEjZ8uFGRB37/vZBs7Vo8DJV5fkwzXLB60OYcBwe5KZDz18l148irijy3 + IEsIX2fHZ+GNiRwL6du36Ep8vPl9thsAfxZacDkhwckUyIU93jjyMnHkT4pcKsPpjPYe3UjIsYAePUjU + xImOYOpVkZh5DFygbvdv3tyltLP7x9jIlYcPCQdu5MilOPLqQi6VeviAUZGLlci3bh0lEjP9API3oHUF + Tk4JxkYut7MjF87lceSlceTVjVwqceN64yHv3l0ouH9/9c28vA9EaqYdQD4MLswf8NunxJjI0+H0irJU + 1Y68qCCHxNguJeEzppGw6VMf3+RJJGjk8NICdRvxMP9BA4nvjz9QSzt+xOqQZ7g7k6jFC0mkvi1aUC2l + uzhWK3IsJ0dFoufMMhpyqfhZszaBMdM+MQcXAHdz3Zx19Gi2MZHjf6W93mhgq1LZe+bQiePJcbh6xuzk + W2+RHFmy1SDPVWWQM7U+pF5Xlp186z9Ek5pYrciF8rOIJj2JhA0fZjTkAd26kYCePa8VuLl9JZIz/gBw + /HSVmX8nJZ01KnIoy9uL6eb6uRw1cfzoI+pCYplvn95WgRwLmTyReh1Zl2C3kwnyHDFlsL/wDLxRkEP+ + XbuS6LFjT4E103zEE5xx85J797Ypf//9b2Mizzz2J7lIwVrVdJFLyU6fIMefeoq6mFiWvM/O4pEr/LyI + /bPPUq8fyzy7dWGKXCr16B9GQ47Bn+9l7NzZW6RnvAHk+D7z384HBfkZEzkeAgqffKOBrUo04GULHPoz + dUGxTNiEh01EOuyymSfyfIDg0qwp9bqxzOG114g6IZo58px8jVDssiVGQS4VPmRICJh7RSRonIEzbHWv + uHi7cvfuf4yFHP9ckJZMBVuVaLB1K8iUk9PvvUddWCzz6fW9iLmizBM5Fr1mJfU6sS5203qjIceylGkk + bMQIoyD379IFe5C+evVAkSD7AeTPQIuK/P0DjYYcyvJ0p4KtSjTUFZV65BB1YbEu6ffdImrLQa5OjIF7 + 1lep14dl7h3aCceCMxZyKYW/dyl0xsiJ/3ffkZBBgyLBnnF2ooEzanvv1q0d8h07bhoLuWLv7+QCoKOh + NTQa5sfl2+cH6gJj2Yk33yTZqbqb8OaLHF8D9+ndk3pdWObwysskMzK0epADaH2RSyVu22IU5FKptrZD + RYrsBpDjrq5LC318go2FHP/+nEJGRWtoNMT6lJueTE78503qQmNZ+U1480aefNQ0Wz5RK5aZDDmWrVGQ + sFEjjYIcCxkwIBYMviaSZDNwBq1L7t7dCvfm/xoFOZTl4UZFa2g0wPp3jiTt2k5daKxL3L3T7JHj8dLP + fPgB9fKzzLXF1yQ3T2My5FJyPy8SiJvvjJH7de4slL5iBbvH6oAcXzefdyE01MtYyDN27iTnq+Hjkuh4 + 9e3hbq2enTpSFxzLtJvwiWaLHAueNIF62Vn21wsvCK9pmxq5VNzqFUZB7tepE76jLgAsvijSrN6BE/4c + 2qTcs+eyMZCnrlxJ8hPiqHANiY5X38rvu56NTza98gp14bHMq3s3s0Uu9/Uk9s88Q73cLAtfMM9skOfA + VoUmI4UE9e/PHLlQ58735Xv2dBRpVu8AcpurSUmnjYUcP6ecBteQ6Hj1jf4Gldg1q6gLj3UJu3eYHXJ8 + ptvlqybUy8sy58aNSG6OGrDSgGM6oGnBZa8u5Fg2lHxoP3vkYhHDh/8FJp8VeVbPwAl+iPfmmj/+yDYG + cvz7wkw5Fa++0fHqW8XvQisERG6tWlIXIMtOvPEGyU6ONxvkWDRsrtIuK8twj7sMHw/ASgOO6YCmBaCr + G7lQdiYJGzmSOXLfjh3x72/lnT3bSCRaPQPIh/ybl3fIGMgxtZMjFa++0fHq2+PfaqoJDyH2zz9PXYgs + w014c0GOe6GdeNX4D2NCZ0wDrDTgmA5oWgCaCXIxmbszc+RSsZMn4zvbqueDH+CEXoLW5js5xRgDeTqc + 1vlzuVTA+kTHq2+PRy6Fb4ekLUTWJezYCnBpwLEqAsdEzBVVFjnm3bMH9fKx7Oxnn5KcLCWANU/k2Xlq + ociZM5gjx+Ahggpsvi1SfbKBE2pXcvfuFvn27TdZI09dsYJkeXtSAesTHa++6Y8cO1eQS5wbNaQuSJYJ + m/BJsAlvQuTJRw5SLxvL8Ak/fJ+5uSPHFMH+zJH7fvutULKt7U8i1ScbgD77UlSUizGQp2/cQM4XVu1N + K3S8+mYYcqlMfMbZFO/S6vIdQDYNcnzN/PQHxn/NPGjCOABr/siloubNZY7ct0MHEvrTTy5g9Mnewgon + 8BG0UX3wYA5r5MK9ua83FfHjouPVt6ohlw77FDZ9CnVhsi5hu7QJbzzkWDCAo10elp2pU4dkZcoArWUg + xxRhgcI9OkvkmF/HjjcL/fy+EMlWbQD5oNtFRb/DY/MHrJHLNm0k52Hh0iBXFh2vvj0Zcuwc/LAd631M + XaAsO/H66yQrMcaoyPHZbqO/Zv7UUyTlpD2gtRzkUlEL5jNFLhVjY7NcJGv4AHLcr33FOQ+PENbIsWw/ + HyrkyqLj1bcnR47hASIy4LGjKQ5S4fVdZ6MhF14zb9yIejlY5j/sF0BrecgxRXgg8Zc23Rkh92nfHvfI + SwCrVfuARvjGhtAGxa5df7NGjqdj6GNzOl59qz7kUkGjR1IXKuvit2xkjhyLWrmcev4sO/2/90mWPBXg + Wh5yqchZM5ki92nXDiuR7dzZQaRr2ADyX/7JzDzCGjmmdnGiYq4oOl59q37kWJ5GYZInqRxef034rDAq + at0AbGXRgGP4mrkpdv1NOnoI4Fouckzm4cIauVDUqFE7wKxhr6nDNzwHrcpzcopmjRwrzFZRQdOi49U3 + Nsil0uz/pC5Y1nl06qjFSsMthf9eSTTgUl49ulPPl2W+A/oBXMtGLpSrIiEjRzBFjgV06yYHs4ZtvsM3 + NIY2KHbsuMYUua0tyXSwp4KmRcerb2yRS+8b9x80gLpwWRcHm/BU4BhgrSwabqmkw/up58eyk++8TdSp + iYDXwpFDWQA9xeEYU+Q+33wjpNiwobNIWL8B5MOuy+VHWSPHCtJTqKh1o+PVN+Mgx3IzUsmpd96hLmCW + nXjtVaKOj6pW5NmZGfA4+X/U82NZ/O+7Aa91IBfKUpCgfn2fCLkAvBLk3m3bkohhw+zArn6b7/CFeEy4 + FXmOjjGskWfs2klFrRsdr74ZD7lU8l476gJmnWfHb7WAqwE5Fjx+LPV8WOb1fQ/Aa0XIxeI3rWeKHPPr + 0kUJdl8XKVc+8IX1ofWw2f43S+Qpy5eT7EB/KmwpOlxDMj5yKW8TPK7F4javrxbkGV5uRn/NHHfvVSXG + AGDrQo4pY8IegV6dyKUyNmxoI1KufAB5z9sFBb+zRp4KX4efc0YDjtHhGpLpkGPZSXHkxOuvURc0y068 + CpvwcbAJD1griga7bKZ6zTx26yYAbH3IpcImTmCK3LtNGxL6888rRcqVD0CfWejr68MSOaY89icVOEaH + a0imRS4d9il+8wbqgmadR4f2pOBcTpWQY1HLl1BPl2UeHTto8dJQ64ZfVw63+SPH8M1ALJFjQT17BoPh + 50XO9IEveB1apz54UM0SOZYbFWHVyIVgE9q93TfUhc262A1rq4Qcn9Az9mvmwiGbo8PpqHUD0JaIHFOl + JxFf2Hxnhdy7dWv8/5uXEhMr/6hlQN6i5M6djbKNG++yRJ4K30/br50O15DMCDmEB4jQwAJ2eOkl6gJn + GR4UQgXnbQhyzKtbV+rpsQyPVENFrRuAtlTkUuFTJ7NDLhY9fvxwkTR9APrgK0lJf7FEjtE22+lwDcn8 + kEtFL19KXeCs82jfTtiEp4GmlXRwH/V0WObaqgWgw+O/6aDWDUBbOnIs+c8/mCLHQvr1OyiSpg9An5fv + 4hLCEnnKsmUkNzy0xiDHEJspPngQi123mopatxxFOjn9/vvU02AVHrIZ385JhV02AG0NyLHM1ISH0Bkg + 92rVCne5TQTL9Peowz+8Bq1VHzigZokc/1uUl11jkEtlBvoR++eeoy54luHjbdyEp+EuDX4RBY0dTf1+ + lkUsWkCHXTYAbS3IpXCXWFbIMfjz7Uvh4fTH6YC8YUlJyTrZhg3FzJBDcju7GodcOhJM+JxZ1AXPOvd2 + bQXMFSHP8HAx+mvmzk0akRxY9FTcUgDa2pBn5WaSuE3rmSH3atlSKGbixH4i7fID0Hv9o1IdYIkcU7u5 + 1EjkWEFeFnH6/DPqwmddzJpVVOR5uWqjH/tOOGSzvxcdtxSAtkbkmMzXgylyLLh//40i7fID0G2KfH09 + WSJPWbqU5Kcl64CtSpaHXEru7mySTzYRNuGjwsohx6KWLaZ+PctCZ8+g45YC0NaKXChLSfy6d2OGHPPv + 1i0ITJf/gAf4i6ch22x7+0SWyHFvuPMAjo5X3ywXuXQkmOCJ46kAWOfWtk0pcEwVE2H018xxiyYnGw/Z + rINbCkBbNXJIk5NJwmdOZ4bcq0ULPJ1zYLr8p67CX7wDrVHa2RWwQo7J9+/TQWtolo8cw4NUONb5iAqB + ddGrbEuhe3XtQv0aVgmHbHZ3ogPHAHRNQI7F797BDDnm+fXXDzLt7euJxLUDyBsh9PR16+6wQp68ZAnR + uLvqwDUk60AulX7KwSTHmXN4+WWiigwhifv3UP+dZUGTxtOBYwC6piDHZH6eLJELxYwd218krh1A3vVm + fv5ulsixvIRYHbz6Zl3IMXyHWcDQn6kgWOfWsoXRXzN3rFuHZKszOHIxtVom7PfOCjkW2r//MpG4dgD6 + 8IuRkaeeCHlZ4BTkycuWkqJzuTqA9ck6kWM5ijRy6v33qDCsKthyST3jwJHrFDJmNDPkWFDPng4ice0A + 9Ln5Li4BzJBDsh07dADrk/Uil0r64wAdhxUVMHIYR04pdu0qZsg9mzfHPfBiwLZ2Dzn4Ax5RZmX2sWMJ + rJBjSvtjOogfl/Ujl/Lp05sKxBo6/eEHJAu2XDjyR0u2P8oMOebTunUB2NYecQb+8Ba0KnPvXjUr5MmL + FxONj6cO5MqyAORU4JhhyLGstCRy4s03qVAsveRjhznyCpKHBjBD7tGsGfFo3vz+zYyM/0nQP0Ho8q1b + L7NCjuXGx+hgrqiahVwqfuc2KhRLzm/QAI68ktQaubDTDBPkYimLF2sPLQXIWyL01NWr77NCnrxoESnM + UeuAplUzkQsV5hLPzp2oYCyxU+++SzTpeMhmjryyAn8azAw5Fjlq1C8S9G63zp/fxhK5cKAJKuyy1Wzk + GB7rzRSfiMKihH12HLkeRcyfywy5R9OmJHzgwIUS9MFXU1MPs0KOyex266DWjSOXwjef0OBYUt69e3Lk + eha7ZSMz5Fhw7952EvRxF4KCzrBCjuERZejAMY68bPkF2cStVUsqIEsIn1RUJeEhmznyx6XOUZLk40eY + Iff46iv8JFdnMP40Qp+e5+zsxwo5pnJx0sHNkdOQS2WGBgpHX6FBMvdit2/myPUIkWPpPu7MkGO+7dtH + g/HnEfqv2fb2UayQJ/32G8kK9NcBzpFXFr6NNOK3X6mQzDmPzp04cj2SkGOK+ChmyDH4JZIJxl9C6MtV + hw8nPwK8mpBjOZFhHLmUDmrdpPeL58Fidm74JRWUOebw6iskM0Y8ZDOA5sjplUUupExnhlyoefNLYPxV + hL5CuWePkhXypIULSV5SPEeOlQFNq/SgEGJyX0/haCw0WOZW9LpVHPljegR5tjbvdu2YIHdv0oS4f/XV + HTD+JkK3lW/bls8KOVagkHHkALeydJFLhU6bQoVlTrm1aQ24NRx5JVWEHPP7vgcb5FjjxkTz558fCZvu + sg0bLrNCjml3luHIK4oGXCo3O5OcrV+PCswc+uvFF4kiPIgjr6TKkGOBgwczQ47FTZ/eSoCetnr1TVbI + sfMAjSOnR8Otm8z5jEkOUqFPkUsXceSV9DjkWPCY0cyQY1FDh3bVQl+16jYr5IkLFnDkFURDTe1cDgkc + PZIKzZS5NP2K5OSoOPIK0gc5FjpxAjPkWGj//n0F6HBvXsIKeTKcDkf+aFTQtMTju2UrZeTMhx9QwZki + /DAKeYAPR15B+iLHQidPZIbcvVEjEjxgQH+EvowVcixp6RKTI6cCx6jAMfNCLpVy/CgVnSkKmzuLI68g + Q5BjYbOmM0OOBfToMeL/Su7cWcEKeeKvv5JkW1uOvExU0LR0kEvhWz9p8IyZU4PPSU52JkDlyHUzFDlW + Dno1I3dr2JAE9e496v/uXLu2lhVyLGXVKo5cjAqaFgW4VLYsmZx8520qQGOEh2yWeboCVI5ct6ogx/Az + 6FghxwK6dp2shc4IeSl0KuyyceSlUXCXLQ9K2LubitAYBU2aAFA5ct2qihwToFcjcgm4lH+nTlP/7871 + 66tZIddCXyliriiOvDQd1LohcinP7zpTIbLO6/segJUjL9uTIMfC585mhtztyy9JYPfuY/HJuKWskCfO + n0+SliwWQdPiyEsTMVdUWeSa9CRy6r//pUI0RrE7tgJajhx7UuTqbAUJmzmdGXLMt1u3EQh9CSvkQnBa + HPljEjFXVFnkmFf3blSAxgrfc56ZGE3HXFEAmiPXTSEUOnUyM+RYSK9ePwnQU5Yvv8MCecK8ecL/c+SV + BHArSxd57Ia1VHzGzqtbVzpoWgCaI9dNi1wFhYwfyww5Fti7948C9FRb29sskEtx5BUEcCtLF7kyJED4 + 7DQaPFMUu2MLHXbZADRHrttD5FjwuDGGIwfg+iB3++ILEtynT08BetrKlddZIccKC7I5ct0AbmXpIs/N + URHnJo2p4EyVsAkfH0kHjgFojly38sixwCGDmSHHIn75pS1CX5y+fn0hK+QJc+eSgsyMakL+EHhNQo6F + TJtMxWbqPLt14cj17lHkmF+vnsyQuzZoQGLmzPlMgJ6xZYuaFXIsNyWBI5cCtJVFQ5562oHYP/00FZo5 + FLNtM0f+2OjIMe8O7Zkhx65HRr6F0H9T7t6dygp5wpw5JDs6giPHAG1l0ZBnZaSQ0x/8jwrMXDrxxhsP + N+EBNEeuW8XIVeqMR+7NqxM5fM01MP4KQp+pPngwihVyLCvInyMHtJVFQ553Lpt4/9CLisvc8uz6HUdO + rRLkkDI5lhlyDE4rB4y/iNAnZdvbB7BCjqncXejAMSpuqZqNPG7bJioqcw0/jIAjL1vlyFVZCiIL9mWG + XIDetGkyGH8OoQ/Pd3E5ywo5Jj/+J0deQRUhz4wMJidetayPZ8JNeGVcJECtOnI6XEOyHORY8snjzJC7 + fv45HmHWG4w/hdB/vBgWdpgV8vjZs0m63W6OnFJFyHNz1cS1WVMqJnPPo3NHAMuR64Mci9u1nRlyzKdt + 20PSRzJ1vC6Xb2WFHEtevYoj16ki5FjY7BlURJZSzJYNVMiVRYdrSJaHHMN3rrFC7vrZZ8S7Q4cVEvSm + 927eXMoKefysWSQe/r/wXC5HLlYZ8nSn08J7vmmALKUTr79OlDHhVNC06HANyTKRY0HDfmGGHAv47rvR + EvS60MLUZcv+YYJcLDc1UcRcURx5tiKNnK5di4rH0tJuwtNhl40O15AsF7kqS0682rdjhhwLGzSokwT9 + Pwg9fd26XFbIMY2/rwiaFkeO+Q7oR0VjqUVvWkfFLUWHa0iWjVyeGM0UOZayc2ctCfoz0K+KnTuTWSGP + nzmTKBzsRdQcOQ15/O7tVCyWnMNrr1W4CU+Ha0iWjRxLPnuSKXL4u6tg+xUBOg78z0T14cNBrJBjadu3 + irA5cl3kKsCAj2tpWCw9j07fkmyAyZFLaZFjMds2MUPu8umn+EskDWw/JzKHnwYh/fOdnU+zQh43YwZJ + gIcFWtAceVnkubDwXVu1oCKxlqI3PtyEp8M1JOtAjoXYTGKGHPNo2tRNJK4dgN7+SkLCLlbIpXLTkzny + Msix8F/nUnFYU8ImfHSYCPVJsh7kmHenjsyQu3zyCfFs0WKDSFw7AP3zezduLAHgD1ghj5s+nai8PTjy + MqW7OZnkY5GDxo02+kMF92/bkyxARgesT9aFPCM6lClyzLd9+xEice0A9Leg+SnLl1+qDuTlgIvIsfQD + +zhyMfyIJce6dagoWObasgXJhgUfvW419d9ZFr1xrYjW0KwLOZZweD9T5FjowIFNROLaAeRPQbPkW7em + sEIeN20aSVq2lCPHCrKJ/88/UTGwzOHVV4kyKkR8O6laQE/7Olbh+cvh/OmYK8r6kGdCYfPnMEUOf/8v + KSx8WST+cAD6UM2RIz6skEvlq+R04BgVOGb+yOnAsUeRJ+7bQ4XAurhd28odICIjyIfYP/889WtZZdgm + vHUix3x79WSGHHNv1CgOTD8t8n448JcdzwcFHWCJHFP5eNZo5Kr4KOFYazQELPPp92M55FKhs6ZTv55l + UetXi5Ary3qRZ8SGMUXuXL8+8WzadL9Iu/wA9E/vXL26BIA/YIU8dupUkma3u8Yiz83TEPdv2lIXP8tO + 1/qQqGVJVOjZGjlxrF+P+n2scnjllcdswlsvcixu726myDGvli21+7jrDkB/GZqbamtbqBdyAG4ociwe + fomcKwSwNQw5FrH4N+rCZxm+QSb19F9U5FIpZ06Q4089Rf1+Vrl3aFfBJrx1I8eCx49lity5Xj0SNnRo + PZH2owPQxyp2745ghTx2yhSh7NioGoc8w8uN2D/3HHXRsyx42mQq7tJgKwPzG/oz9ftZFrl2lYi75iBX + ZqYTj5YtmCKH78PDRz0rsn504B975Ds727NEjskd7AEuDThmfcizVRnE8ZP61MXOMpevmpBsWLhU4JiI + HA8UoUpLJCffeYd6OqwSNuEjgy0HORU4ph9yLNn5NFPkmHuTJqdF0vQB6A1v5uSsZIkcS1y6BPDWDORY + wMjh1IXOMvxEF3mIPx04Vga5VNyendTTYplbu29gE15ZI5Bj4QvmMUWOeX399QyRNH0A+qvQnNSlSwtZ + IY+ZPFkoJyUBEFs/8qTDB6gLnHXR69fQgWMU5NrUJvk45si1K2sEcqVaRrzgFxtL5NCDkIEDPxVJVzwA + fXjm778HsUSOyR2OA2TrRq5OiiUn336LurhZVukHIALoipBjiqgQ8tcrxv18Nzy/jPBAKmB9sgTkmLDZ + zhY5npYMDD8jcq544IvaFwUG7mGJHEtY9Btgtl7keflZxKPjt9SFzTL83HRVakKVkEtFLFtMPW2WubVr + SzSAjga5siwFORY2ZyZT5M4ff4xHlN0tUq58APqHJbduzUuYO7eYFfIYGxuhrJgI60QORa1YRl3QTHvq + KZJsf+SJkGNZAMAUH+gYsWo5FXNFWRJypTyFeLRowRQ55v3NN71FypUPQH8amixbty6VJfKYSZO0O88A + WGtDLvf3Jn+98AJ1MbMM35X2pMil0r1cyfFnjXuQStyEl4XptwlvScgzNXISf3Avc+Qu9epdVxw69JpI + +fED0Hvmnj17jCVyoWlTSX62yqqQ52gUxOnzz6gLmWV4nlnqjGpBLhU4aTz1vFjm2rbNYzfhLQ055j9w + AFPkTnXrErdGjU6JhPUbgF7/zpUrv8Jj9LvMkIspnM5YDXIsaNwY6gJmGW49yPy9qhU5plakkTMf1aae + J8siVla8CW+JyNOCfYlr2cfmDJBjnm3aDBEJ6zcAHQ8YaZO+dm0KS+TREyeS+PnzSAEgoqLWDYBWFhU0 + LTi/iqIDxwDyY5AnH/vD6LuSYhG2S6sduVQSXifKebJMeBY+NMAqkGMh06YwRw5/d9WgzXZpAHoP2Hw/ + yhK50IQJROXnTYddNgBaWVTQtABtRdGBYwD5Mcg1KQnk1LvvUhcuy9y/7QCg1UyQY7jXmnffPtTzZplr + 61blNuEtFXlGfCRuUjNFjrk3auQg0jVsAPrH965dmweb73dYIscSbZfTcUsB0MqigqYFaCuKDhwDyI9B + ji+leXbrQl2wLDv5nzdJZkIUU+SYMjGanHjzDeplYFn4imUWjRyLtF3CHDnm1abNAJGuYSNuvk9MX78+ + jiVyKU1kqGUih6LXrqIuVNYlHtrHHLlU9OYN1MvAMoeXXyKyED+LRa6QJRKPr79mjhz+7Xyhm9ujR5PR + dwB6pyIfHzvWyKPHjyfJG9dbJHJFsD9xeOkl6kJlmf+wn42GXAjuWd3atqFeFpa5tG6lxWphyLHoTeuZ + I3eqU4d4NGliJ5Kt2gD0/5bcvTsjce7cqyyRY1HjxhFNTIRFIc/JziRODb+kLlCWOdb7mGiUacZDLiYL + 8jXJ/gFhyxbrANYn0yIX7s3hlxRr5JhP586tRbJVH8A+RGln58UaOZa0ZnX1IQewlUUHjgFiPZDnQsGT + J1IXJsvw8NBp7k5GRy4VOm829XKx7C/chA+GTXgqaFqAtqKowLHqQ45FrVtlFORwWgn4MFvkWvWBE2l0 + XalcBrAfsEQupYkIoeKWoqLWDcBWFh04Boj1RJ5y4jixf/pp6sJkWdivc02GHNPAIj5rgh2C8Ii1Kjhv + OuyyAdqKogLHqhe5IjWeuOPuroyRO330EX4ay0yR6pMNQH8empiybFkGa+RRY8eSxBW2VOAYFbVuALay + 6MAxQKwnck16Ejn9/vvUBcky1zathWOymwq5VMrZk6b5JffYTXhAW1FU4Fj1Is/UZJDIlcuNgty5Tp1/ + E6dPf1ek+uQD0L/Ld3bezxq50JgxRBXga7bIMe9ePakLkWX4ySrKqNBKkNMRPy4aZH3yGzGUejlZhpvw + 6UG+FODmg1wWH0ncm37FHDnm+sUXx0Si1TMA/Z27t27NiJ816xpr5FjcvHkkPy/LLJHHblpPXYSsKz0m + uxkgx1Qy3Kp5j3pZWebS4mvKJjygrSgqcKz6kWMh06cYBTnm2bZtR5Fo9Q1g/yFzzx5X1silMk45mB1y + RXgwcTDyQRmw0mOymwlybZkkbr8d9fKy7uEmfCXPrGNU4Bgb5CnertqdY4yAHE43Ckw++gENTzpworVv + nTs3P3bq1LuskUeOHk2i4fRyMzPosMsGYCuLDhwDxAYgz8lRCQdbpC08lp2uVYtoMpLNDrmUZ/eu1MvN + sr9efBE24X3MCnmmWkb8+vc3CnLMo3HjoSLN6h/A/pNs48Zg1siFRo0iqbt30nFLAdjKogPHALEByLHQ + GdOoi45lwjHZz540W+SYPDpM+Ew12uVnGW7CIzCzQA7FH95vNOTwPer4ffueE1lW/wD0z66npy8F2A9Y + IxeCP6sjQ02OPNXxpICOtuBYFjJ9qlkjl95wgm8rpV1+1oUuXmAWyOUpscSzTWvmyM/Wri3k+sUXs0SS + bAYfE0BDU5YvT2KOXCx27hySD4vbVMg1GSnCRxrRFhrLhGOyZynNHrnwphOA5NKsKfV6sAw34dNgE96U + yLFQ+IVsLOTw50vRw4a9LpJkNwC9wd+xsSsB+QPWyCNHjhRKP3LIJMgxn359qYuMZfiEnzzY3yKQS6V5 + uwt77dGuD8tcvm4mPD6mA8fYIk9yOiXsAWcM5Gdr1SJun3++RKTIdsR79V9SbW3jWCOPGDFCCP8d94On + wS4bHTgGiKuAPG7HVuriYl3MxnUWhVwqeKoN9fqwTtiENwFyeVoC8er4rdGQO9epU2SUe3NpAPqnfyck + LAfYD1gjl4qZNZPkZWdSgWN04BggrgLyzKgw4vCa8Z9k8vq+u0Uix1TKNHKmbh3q9WKZsAnv7wWIjYcc + C7aZaDTk4r35fJGgcQagPwUNTl2xIsoYyCOGDxdK3r7VKMhzctXEtcXX1EXFMjwme2ZKAiC1PORSifZH + TXI4LefmTUmmStqEZ48cn2U3JnL49/z4iROr/p7zqg5Ar3ctLW0RPFa/Zwzk4cOGCSk8XZkix8LmGv8d + Wogj6fgRQGq5yKV8Bg2gX0fGhS7CTXj2yNPDAoh706ZGQy7cmzdoME2kZ/wB7D9mbNzoYyzkWCSchiYh + hhnydNezxN7IxzPHgiaMA6SWjxxTJsWSE28Z/6Oo8L3yaX4eTJErMpKId/duRkXuXLduKtPXzR83AP2d + 4osXp8XY2PxTZeQAXF/kQkOHkpgZ00muWiGirj7kWYp0cgZubNoiYtnZLxqQLLUcoFo+cgyPBhO9bRP1 + urLOWdiET2eCHAuaOM6oyKEH7l991UMkZ7oB7N+qDx06aizkQr/8QhJXr9SirSbkmN9Pg6iLh2XCMdn9 + vACq9SCXcuvQnnqdWRe6YB4T5FGbNxgbOXH6+GNXMPaUyM10Axfipft3746OmzUrz1jIpdKOHhaBPzny + eBN8NjiGx2S3RuSYLMQ0x9PDX56psAlPxS1FBY7RkSc6nhA+hKFakJcBXhlyqNitdevHfwSysQawf1Xo + 67sWkD8wFnIsDFK4Oj0x8szYCHLiDeMfztijc0eSnYtYrQ+59BbS0IXzqdeddU5fNSFK2ISvDuRp+ORb + s2bGRf7hh8Tts8/WisTMYwA67kTTP3XVqgCjIf/5ZyH8N2Wwf5WR5xZkkTS3syRmw5rKW68tuhrLTIwB + rNaLXEidQSLXryaRa1dWWkRFramoFY8tPTL4iZHLE6K0O8UYGblznTryyNmzXxKJmc8A9HeLL12yibax + uWIs5GFDhgiFjx5FNCnxVOAYHTiWpV/52nIeSaN/APrRHWGsHPljM6/3k+uGz7D7/dDb6Mih+57Nm38n + 0jK/Aeytc8+c2W5M5FJRUyaTbHkaR65XHPnD6MiVmekkcMQwUyDH098Plkz/BFxFAxfuOWhQ8qJF0cZE + HvbTT0LRM2aQbGU6R15pHPnDKkCulpHgKTZPhhyBVwE5/Ft+5ODBb4mkzHcA+oc3cnKmRU2YcN2YyEMH + DxaKmTOb5KjlAJUGHNPBXFEAmiOnZ9XIodA5M02C3PGDDx64N2v2o0jJ/Aewt83566+dxkZeiv3X+SQH + FhVHXjaO/GEVIw9ftMBUyInrJ58cNutNdt2BC/ss1C95yZJQYyMPHTRIKHbRQh3sOpgrCkBz5PSsHTnu + 02Aq5PDvmqB+/d4UCVnOAPS3b1+8OC564sQLxkYuhffs2cJmvA7migLQHDk9q0YOj8lNeU9+9oMP7rk2 + a1b9h2421gD2RkXe3isiRo68b2zkoQMHCkXPnkWyM9PpsMsGoDlyetaOPHS2yR6TC7l8+ulKkYxlDj7e + gLqnr1/vaArkIQMGCEVNnUI0aYl04BiA5sjpWTVyRQoJnjDOpMjP1qkTKbO1fV4kY7kD0F+6f+fO4Nip + U5WmQC6FO9WookI5cgOyZuTy5Bji17+fSZE71ap1xaV5809EKpY/gP3dawrF5MgxY66aAnlI//5CoXBa + ci83jlyPrBl5elgg8ercyaTIofueX3zRTyRiPQPYPy9wc1sZMWzYPVMgD+nXTxv8OWX/7wBcw5FXkDUj + TzxxTHt0GNMix/NaI9KwvgHs32Rs3fqnyZCLBfftS2IXLyJZmTIAy5GXzVqR4zvZIlcs0x6a2QDk5YBX + E3L4em9ia1v9n5tmLgPQ8fX17xPnzw81JXKhH38kEePGElV0OMDlyDFrRS5PjSMBw34x+KARLJDD32v8 + W7V6WyRhvQPQX75/48bAaBsblSmRS4XA6aT9dYwOmhaA5sh1M1/kyW5niUf7duaC/LJzw4ZfihSsfwD7 + m/9kZo6JGjOmyJTIsaA+fYRwT7qsjBQ6bikAbfXIqZAry0yRZ6Zr93Rr0MA8kH/4YbFrgwaWu1NMVQew + v3cxKmp6xPDh102NPOiHH4TChv5C5D4eHLnemSfy9PBA4vvjD1rgZoAceuD68cfjxKVf8waw1y9wd18M + j9WLTY1cqHdv4b8JG9aJT9Rx5BVnfsjxCbeYHVuJe9OvDEMOwBkix9OyFZd8zR3A/qXm6NH1cI9+z+TI + ocBevYRChw0lMndnjpya+SFPC/IVdoAx+FNNWSOvU2cXrHHLeUcay4Eboolq376tcI9eYg7IS+vZk8Qs + XUI0siRAypFrMy/kSmUqiVy1nLg2bGh+yD/66A+rfhmtKgPYmyl37twdNnjwA3NBLvT99yQYziPlz8Mk + G5DQAOsTHa4hceQP0yJPPGlPvLt2EYCbG3Lnjz46wZFXMIC9hXzTpv2A+yF2EyMvW9jo0UTm6UaFXFl0 + uIbEkT9M+2RbwNAhpcDN8J7cLX7iRNN9hJK5Dz6WgVrJt2zZC/fsJeaEPKBHD23du5PIObOIIjSQilo3 + OlxD4silZLERJGzeHOL65Zdmi/xsnTqnZYMHW/670ViPiL155q5d2+Ee/X61IC8L/AmRlwb/H/3rPKKM + CKECx+hwDYkjx/DY6uELfyVuTRqXA252yOvWPcrvyQ0cwN4kc9++DXCPfs/skGPdugn5Q1FzZpMMHw+O + vLTqQY6b6KFzZxH3Jk2EfdTNGTmcx+/k1KlnxOXLx5AB7F9mHT26Eu7Zi80Sedeu5QobN4aknfyLZMFi + p+PVtydHXg64hSFPcXciQWNHEzfcREfgZo7cpX79DbglKi5bPlUZuAE/zT17dgE8Zv/HnJH7d+mi7bvv + SNCggSRh13aSmRQrwjWkmolcIUsksXt2Ev++PxLXBg20mT/y+86ffjqPI6+mgRuyVpGf3+Twn38+b+7I + y+bX5TsSMXMGSXM6RTQAgQ67bDUPeYqXCwmbNUN4j3gpcAtADv9f7PL558PFJcqnugawv309NXVo5MiR + mTTkAnBzQt65s7ZOnYSC4J4qdu0qkuHnRbIAZE1Gjo+9o9atIj49vyduX3xRHnhVkZcFzhp5rVp/uzZs + aL6fjWbpA9hfvVlU1Dt6woQoS0Iu5duxo1Bg//4kdt0aIgv0EdFbP/KMqBASvWkd8evzg/DYG4FbInLH + 2rWzPJs1qzlvNTXVAPbnye3bHeJmzXKxROSlffutUOAPvUnU4oUk5eRxopIlURE/LrNEnplGkuEhS+TS + RcS3V08tbikLRe5Uu3a0f+vW74lLkQ/rwSc/oIZp69btCOnb946lIvft0KFcPvB3IaNGkpg1K0nqGQei + TImnwi6buSBXZiSTZOfTJGrtShI0chjx+Ppr4tawYXngFoz8bN26hyPbtjW/zyuvCQPYP8w9cWJ66MCB + Fyweefv22tq1K1cAbK2ETbEhMetWk2T7o0QeGkDUmgzTIddoN8MTTxwn0evXkJDJk4hvzx7Ca90C7LJZ + AXL4c7HzJ59MEZccH1MNYH/tampq34iRI5OsDbnPN98Iebdt+7A2bYg3/J0/PNYNHTeGRC78lcRu2UiS + /jxM0jycSUaIP1EkRhOVKl0HtW4U5PgyV1IMkcEvk1Q4rUT4xRK7bTOJWDifBI0ZRfx69yIeLb4m7o0b + P6xRIyFjIBeAGxN5rVp5bg0atBWXGh9TD2B/lty8+XXivHn2gb1737dq5Fjr1uXyatVKW8uW5fLG08XL + A4+RsYB+fUnA4EHQQBIwoD/xhdsBw6/Br/Vo2lTbV1+VC++thcoCt3Lk8Hjc06VRI/543BwHwH+g+eOP + WSEDBhTVdOReLVoIecJj5XI1by7k0axZ+ThyaVP9FpzGTFhLfCcYcx74Ab10LSOja9S4cf4cOUduCHLH + WrVSnBs0aCwuJT7mPvjbGPpEtnbtmuA+fa5y5Bx5ZcjxY4ud69bdGtSp04viEuJjSQPYX7sQE9MjauxY + f46cI6cir1UrCS5DS3HJ8LHUEe/d6yh27lwA9+5FHDlHLgK/Cae1iL9/3MoGsL/0j0LRLnbqVAe4Z79n + TsjLAefImSOHzXQPjwYNPhOXBh9rHAD/3zxHxyHhQ4eGc+Q1Czl8rcz1yy974laeuBz4WPPAD/ppcXN+ + VvCPP2o4citH/tFHf+P7xlXTp78gLgE+NWkA+wt3rlxpnPTbb5sCe/a8wJEbCXkZ4EyR16592/XTT7d5 + dujwrvgj51OTB8C/clOt/jph5sy9Ad27X+PILRu5Y+3ad+G8jnh16lRX/BHz4fNwAPyr11NS2sRMmXIo + oGvXf6oVOQDnyJkjv+dSv/5fPm3bNhB/pHz4VDwA/vULUVHtoidMOOrXpctNjty8kTvVrn3fpV69016t + WzcRf4R8+Og/uEl/KTy8RayNjZ1/t24XOHLzQg7ddP3kkwPuzZt/If7I+PCp+gD454vz8z+NnzdvZeD3 + 36s48scjF4CzQv7xxxedP/10dVCnTu+LPyI+fKpvAPwz0P9Sli0bFzJokC/cuxdz5EZD/gC+N8Lts8/G + x/fp87L4I+HDh+3gZn2Om1vz6IkTN8NmvYYjZ4S8bt0LcO+907tly4biTc+Hj/EHwOPON/9NsbUdFD50 + qL1vp06FHPkTIv/443/gnvsUXJ5BQaNH83eU8TGvAfDPkn//fT9x0aKfQ3/6ycGvY8fzHLl+yOHP/7p8 + 9pmjZ6NGQ1JGjHhFvEn58DHvAfTPQe+lr1jRJ3zEiJ2B3brFAfa7HPlD5ABb4d6woZ17ixY/psybx3Hz + sewB8PhW2dcL/fy+iLWxmRHav/8p32+/1QDsBzUJOXzdebdGjZw8mzad5d+r12dwmzwt3kR8+FjfwAJ/ + HnpLdfBgs4gxYxD+Md+OHVMB+z1rQe5Sv/4DtwYNVHCeDnD5p4X07NkMr7d4E/DhU/MG79mg186HhHwc + NX78kJC+fTcF9Ojh5tOunRyw37EA5CXwfTkejRt7wvlv9mzZcljImDG14Trxzwvnw6eyEfG//G9a2nvR + U6Z0Du3Xb3rg999v9e/S5bTft99GAqZc2AS+a0TkJfB1RXAe8ZAjnPc2z2bNpnu3a9c55rff3uao+fCp + 5gFUz0IvXcvN/U/yggUNQ0eM6Ai/CAYG9uw5MbBLl998O3fe4tup00Hvb7454du+/VnvNm28vNq29Yb/ + hnm3bh3p1apVJDxMwP96Q15eLVo4e7Vu7eDdqtUh+P+tXm3aLPH55pvJfh06DAzo3v3bqCFDvtDs2/cG + nq94EfhY1Pzf//0/7XX2GwmzyMcAAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAYAAACI7Fo9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAGYktHRAD/AP8A/6C9p5MAAAAHdElNRQfZAg4LMQXZmN/IAABACklEQVR4Xu3dBXwUZ/rA8bur + 3F2v17Ne73/XqwvtlQoVvFBoKVBKcHd3KO4QICQkxN2NCDGIhyhxJU7cE6xAW6SFlDR9/88zmYHN8u6y + m+ys5X0+n98HCJvNsjtfZlZm5jdsdG8IIU9D/4X6Q0Og0dAEaCa0+E777Y0Xf2g5UHe1+ljF5RJbrotF + 7sWted5YUUuuD/5a0JLlUn6xyKbsQqFVxaVio8brNXuu3f52FVzHdP76RkGDoHehl6C/QL/lbwYbNmx6 + OwDqSegF6GPoa2jBnfYftzRfr7Mras0NPFsTGxtZGph9ssC93DfHsd49w/KyU6rpDZvkI/eskgyJZeLB + blkkHuiWecJ+ruMJ+7oXvxe+vu8Xq6RDt+zPGl9xTTdv9MqyOx+Y754dXRYck1oTf6KoJdu47UbLCrhN + 46FPoJehp/ibzoYNG9oAkt9Db0K4Zp7b0fnzjsZrNW5Z9SkRUaVBOX65Tg3O6Wa3bJOPEMwm+TCXddKh + biHw3iLHzOL3dMv0zG6uY2d2dcvszJ52+1STlhO5jrkx5aGnc5pSLS/+0LoE/g2fQf2gp/l/Ihs2fW8A + wN+gAdAkaMPV21ds8psyTkWUBhZ4Zdtdtk8x7rRNMSJcPG5tQ24St5PLOHZHt47Gboefe+C6R5Z1YWx5 + aGjpxQLDX8gvE+Hf+QH0T4ht+rPRz4GF+3HoDQg3wbdcvnnBKbs+OTa0yOe8a4blTbuUo0QyXUaOGcVs + 65Zx3M67TqnHqsIKfaMLmjJM239px+f/b0F/5O8iNmx0c2Ah/jOEL5Qt+fHnH03heXVYRElgkXum1Q2H + syYEnv9y6TvyIzFbu4recj+43F2nNLPS6PKgwJrL59fx99M/+buODRvtHlhY8dVwXGhXfXv7smNaXXxy + QIFbs3Oa2S+IW6gvIz8cvZnrUNQ39zNP2HfpRI5TUkZdoiHcd/gq/z/4u5QNG+0YWCjxhTR85Xnl1dvf + 2qfXJiQF5LlccEozJY6px7gYctnIMcOoTVwHIzfiz7juk+2QlFWfvJe/X9kLemw0N7AA4vvY09o72o/l + NqXFBua7tcKa+1cEzpD3DLlkByI34M+86pfrHF12oXAx3NevQL/j7342bMQbWNBw7T0U2tz6XaN3TFlI + kVuGZbuAmyFXHXJsf8R6Lvh9p03ykfKo0iCbOx138P5/hn9I2LBR3cCC9Vfo647OjqMFzZkxsGl+Gdbe + BGPIxUUutC9iHRdc1w3fHMeo6ssVM+AxeY5/iNiw6fnAgvQfaM6P7bet0mrjU72ybG+5pB/ngDPk6ke+ + L3zt/Q5EbPgZHou0/Kb0NfAY4Sfz2PvzbJQbWGjw+eDK73+67hR3/nSBe4YlLlTkUcglgTPk4iHH9oav + EfoV7pvSs9Wx+OIdfrqQgWcjf2Ahwc+Wr7h554ZD/PnwAtcMiw4BOEOulci59pxezWWZeKA0oy5hJzyG + rzHwbB4aWChwE33p7fab9omVUbnuGVb3JIEz5NqPfPfpVV2Fr8I1fGFmXcpmeExf5h9iNn15YEF4BprX + 3tFunVpzJsMj07rdNd28G3CGXA5yCeBagZxv16mV2K/WyYezS9vylsNjzF6064sDD/wT0BednZ0meU3p + 8d7Zdj8icIZcb5CTnWEruOBrHfD4JdRdq8Ida9iutH1h4IH+LfQhtK/28vnggDzXb+F5OAdcUeQInCHX + DeRCO8KWk72n19z2zXXwuXHvxkfw+D/GLxJs9G3gwf0HtOa729+6RpQEVHPAGfI+gRzbHrqMC27ThZjy + EPxM/fP8osFGHwYe0N9Bozo6O47j83D3TKsOhrxvIhfaFroU77P8otYcA1g2fs8vKmx0dfB/bQgPv+QP + m+lX7wNnyBVGzgHXM+RcIUvwcj/65Do4t7e3v8ovMmx0afi1+Hh8NT2hMvKcW6ZlJ0POkEsil8woZmtF + el3CfFhm/sAvQmy0feDBehbajGtx/1zn77sBZ8gZcinkW0MWc8Hvf3bPsHSFZee//KLERlsHHqRBnZ2d + pmk18ZnwXLz7WpwhZ8hlIN8SvOh+xnE7zhU2ZY+FZYm9Mq9tAw/KU9Di73686h5yzrvNLcOyO3CGnCFX + APnm4IVc28OW/XAy3/0ALFN/4xcxNpoeeDDwBbd9FZeKwz2zbNv7InK8Xrd0SxKQ40pCC3xIVFEQSSiL + JOmVCSS3Jo0rrzadFNXn3q+wPocU1GWR7OqzXGlwWfwe/N7gPG9yIsuJuKZZEIuEAwC8C3pfQP5N0IKu + ghf8apV0KPzqzatv8IsaG00NAP8YNtXNUmvichC4PiO3SjQknhk25PQ5P5JyPpYU1GaRqpYy0na5mVy5 + eklGF7kuS/etvC506xJ04XIL/Kxykl+bSVLKY0lYgS9xTbUgx+J26Sdyvk1B84lh5KbzBY2ZY2BZY0e3 + UffAnf4YNO2ne7cdTxf7NfYEuSRwbUOOl/PNciRxJadIfl0GqWur5BDSMctKNcipXXlQfVs1ya/JILHF + YcQz3YaYwFMCfUGObTw5Dzflr4UXB+LRatnhqdU1cGfjkVY3Xvihxdcvz/mGPiC3TDpIfLIcSFJ5FDnf + VAyY2qTQKpt6kNO6eLmNVDSVkMTSKA7+4ajNOo1cCL5+zy3LyhaWvWf5RZGNWAN38nPQvtpvz4d6Zdtx + z8d1FTl+D24C58Eau/VyE/n22mUuOlxl0hzyS1faunURwqcWuMYPgef9x2J36SRybMPJuWRD0FzcBTbk + 7t27L/KLJBtVDwDHgwkcPdeSFe+RZd2pi8jxsqGAO78uE+C03cetr8gf6nIrOVeXQ4JyPYlxzA7dQo4F + zuE6GrM9/dsf297jF002qhoAjmcUNT9bE5vrnmnFAdcV5JhfjjP3qvfFb1sfwi1Eh6tMWo4cg816oQuA + Hl/c88605zbtdQW50J7wNRWlzXl4Ukx2JBtVDNyRX3R0dljHlIdUKIscgWsKuWOqKYkrPUXq2qqosCWj + w1Um3ULevVbSeKGWxBWfIubx+1WKXBK4KpGvD5zNBT+3LbMhZSoso+zDNb0ZuAO/bv+l3Q5fWdcV5D5Z + 9tzzbkRCQy0dHa4y6TZy6Qprc4hbmhXZdfoBdm1Evi5gFtfmoIXXEipO4wkmHucXWzaKDm4OQVPv3PvJ + IaTQ+4K2I8ffB+d7kbKmQipmWdHhKpN+Icdwkx6rbColgdnuZF/4Oq1FLrQpaN6t06X+eNjpJ/lFmM2j + Bu4s3PNs1u32m05BBR5XtBk5/hpZdJLUX3j05rl0dLjKREFOhS2ZbiCXDDfrTxcEkIMRG7QS+dqAmVxw + mR+Dz3ltgmWX7d/+qOGRL7hx93uXkwXuV7UVORZeFADAq6mIHxUdrjL1DeSSNbXVkVP5J8je02u1Dvka + /xlc6wJm3w3Mc8XDTbMP1sgauHNwc33udz9dcwvIc/1OW5EH53uS2guVVMCKRIerTH0P+f0utZCGthoS + kO3Gbc4LwLUB+YNm3vPOssGTSbA1u/TwyKffunvDWVuRe2RYk6KGXCpeRaPDVaa+jVyy8sZiYpdkpFXI + V/tN5+rCbrcDlukn+EWcDQ7cIZPwc+uB+W7XtA25/dmjJLXiDIeKhlfR6HCViSGnlVGRiDueaA1yobUB + M9pP5Dmth2WbvRqPA3fE2J/abzsGF3he1jbkgXlupP5iDRWuMtHhKhNDTquNrxGev/tlOpMtIV3QNY18 + ld80Lvi7nwJzXFfAMt6332eHO2AYvk8eWuTTpk3InVJNSXbNWSpaZaPDVSaGnJaAXLKC6ixiFL1dK5Cv + PDGVC7735sl8j3n8It/3BpC/A1lElQVXaRNyfD+8+VIDFa2y0eEqE0NOi4ZcqOVCIzmZ40E2hyzUOPIH + 2Gdfj6+MGMEv+n1nAPi/IZPk6pj8RyGXBC4mcge4TEZ1IhVsT6LDVSaGnBYNN63cqnSyP3yDxpGvODGF + C55S1BS15P6PJ6D/A8D/Ch3MbUpL1hbkPtkOpLat52+ZSUeHq0wMOS0aaGoXm7nqW6qJU4qZxpGv8J3M + tSNseV7b9Tb9P0MMAH8S2lF1qeyUR6b1r9qAPLY0lINEA9uT6HCVCdBKR4UtGUN+Px65ZPHF4dwr8ppE + LnQgckMkGHiGJ6GfA//AhVdvXfb0ypJ/0Ah1IMdNddx19Or1K1SwPYkOV5kALUP+UFTQtCjIhQprc2FT + fp1GkS/3ncR1PH6fGVjQz/fY4R82El9hx4+2ahq5e4Y1qWk7z5DfT3+QVzaWkrqWqm7IsVaorrWKWMUf + 0ijyZT4G+Od2/1ynBTwN/RlAjkeH4V5hpyIH4OpCHpTvSdquNDPk99NN5Ag3viiCGEVsJ4vcviKDjF8g + L+76DVdQFjzGUsiF8FX5wCw3QD5HI8iF1vrPvJJaE/cJT0T3B4D/BTqcU3/2rKaRRxcHkyvXLjHk99M9 + 5PnVmWR/2Aby0ZH/uw9bsgk2H8lELtkZeN6OL9BpAjm21Gci2Ry8qLD5WvO/eSq6OwAc90bb0Hq9wd8j + 0/oXjSFPOUJSK89wwLUHOeWVdYwKW7K+iTy1LJ4s85xEXtnzGBW4UGR+0CORt15s4squTCFbQ5ZoBPkS + 76+5jkRt9QQjur23G/wDxuDzcv88l+80hdwOwmOjM+SS6Q7ykroCssZnJnlp92+psCWb7vipwsiFSury + ya6wlRpBjsGfO7yz7JaAFd089hzc8JcgizPnT5VoCrk9/B73OGPIJdMN5IjS+sxh8vbBP1NR08Ln7Mog + b73QVXl9EdlzarXakWOLvSfgz7hQ2lrQn6ejOwPAfw/tPX+xKFxTyPEyJY0FDHm3NIicxywrSeT4Vtg0 + WDvTMMtqtvPoHiEXqmgs5Q5bpW7k2CKvr8jOUytiwcxfeEK6MXCDZ9/46Xtn72y7O5pAjmvy0qZzDHm3 + dAN5aI4v6W/4VypmeSXA2pwOHONxy0AuVNVYDmv2NWpHLmSddHgP2NGNPd3ghuLOKpYRJQG1mkCOvy9q + yGPIu6UbyE2j9jzyxTZauDanA8cAsQLIW/jONxRzz9lVgRyBK4ocW+Zr8H1WXdIQnpL2DgDHTfYDRS25 + MZpBbkQK6rMY8m5pP/KmCw1klc80KmJFwufmqkAuhC8Abg9ZplbkC73Gc20OXpgKhv7Kk9LOgRs47ebd + G07e2bYPNtnVhBzfQsutTWPIu6X9yBvaaslcly+ogBVplsy1OSDuAXKhwppcPGa7WpEv9BzHZZlouAss + aedpmuGGvQKZR5aerFQ78mT2PvnDaT/ymuYKMsl+MBWwotHX5oC4F8jx03NYdmUqWec/S63IMdiEv1bY + mK5953YD4I9DOysvlYRpAnlUcTBD3i3tR17XWk0m2fUOOX1tDohVgFwosSQKnqvDGl1NyLEFnmPx+PW4 + l9ufeGLaMXCDxtz55Y6tT7bDLXUjP5nvQa5cu8iQ30/7kTddqCdzXD6n4lWmh9fmgFiFyIVOZnmoFTk2 + 3+PLXx3OGi/jiWl+ADl+lt0koTL8nLqR4wEj8AylDLmQ9iNvBjjLvCZR4SrTw2tzQCwCciHnFDN1IueC + n9NSc71GOw5UAcjnXr5xwdMt07JTncjx+hov1jLk99N+5Nje0LVUuMrWfW0OiEVEjjW1NpAjkdvUhlxo + X8RaazCm2Rfm4Abgx1zNw4pPNKgTOb6NJnzqjQa2J9HxKhpDLitJ5B5nbRT6zPqj6r42B8QiI+dqaySV + jWXcK/HqQj7PYwxe/lZU6ckPeXLqHwCOZ1fZyL0Ap0bkWEpFLEN+P91AfqYonLy5749UuMr2YG0OiNWE + HGuGsirOkpUnpqgFOTbX/Qs8DNZpsKaZUzzBD/6wo7PDyjfX6Tt1Ig8r8KVi7Wl0vIrGkMtKEnlZfSH5 + 2OjfVLTKhp+BVzdyBC7ZqTw/tSHH4Pe/2Kcfm8TTU98ActzPfFdOY2qCOpG7Z1iRC9+2UMH2JDpeRWPI + ZSWJHFHOdPqMirYnReYHaxR5c1sDFx6SSh3Ihdb6z8gGc0/xBNUz8AMH3uu4Z+WTY39TXcjxeXlFSzEV + bE+i41U0hlxWksix4zH7qWB70gSbj7UCOVbTVMk9X1cH8jlun3OZJeydwxMUfwD5Y9CerPrkZHUhx5LO + R1PB9iQ6XkVjyGUljTy5NJa8uucJKtqeFJTtqRXIhTLKk2ATvgu62Mhnu40mK/2m5oM99XyIBn7QkPaO + dmvPLNvb6kJ+IseJQ0ZDq2wPw1UmhlxW0sjrW2vIp6avUcH2pC8s+nMItQW5kGearVqQC5nG717EUxRv + +LX5/vS6hLPqQo5fr2mroKJVNjpeRWPIZSWNHNsVsooKtqf5pjmKixxAK4scq2+uIdtClqgFObb8xORi + MPg0T1KcgR+Az80tPTNtflQHciyxPJKKVtnoeBWNIZcVDXlSSXSP9iuX1admr5PmCw1ah1wovTwRnqtP + EB35LNdRXGZxu8R7rg7I8X3zbflNGbHqQg7/oZBLAIoGV5noeBWNIZcVDTku+KPN36aC7WluyZZai1zI + IcFYLchnun5GVp+Yjvus/4GnqdqBK+4HHT+R53RVHchtkg+T4sZ8KlxlouNVNIZcVjTkmFHENirWnvbJ + 0f+QxrZ6KnCMDhyTAk0LQKsCeXNrA6lsKAOA00RHzverfbrp5zxN1Q4gX11xqThEXciD8z2pcJWJjlfR + GHJZ0YBjmRUp5LW9T1LB9jSLmANU4BgdOCYFmhaAVhVyDD8Lj+8KqAE51/qTc0LB5OM8T9UMXOHzuDYP + LvRqUgdy/LXuQhUVr6LR8SoaQy4rGnCsBTatv7b5mIq1p+FBIqubKnQCOdbQWku2BS8VHflMl5Hw96Pu + nszzeJ8nqpoB5LOu3Lropg7kWGxpGBWvotHxKhpDLisacCE8BjsNa2/aH7ZeZ5ALJRVHi45caHvoMtyz + TTUnfoAr+iNkHF8RnqsO5Pi9eBJEGmBFouNVNIZcVjTcQudqc8hb+/9ExdrT3tj3B1JWV6RTyJta67mO + RGwVHTkG/6E0gc2/81R7N3BFQzs6O8w9Mq1/FBu5ddIhknI+hgpYkeh4FU3/kFNB0wKs8qLhlmyxxwQq + 1t70jf8CnUSOZVecJfP5tbpYyGe4jOA6FrdzPk+1dwPQNxe35oarA7kTXB8eMYaG+FHR8SoaQy4rGmzJ + IvJPUqH2plf3PAZYUnUSuZBJ9E7RkU93/hR3dokBo0/yXHs2cAUvQGZBBR6NYiPH8EiuNMSPio5X0Rhy + WdFgS4aHhVL1e+YYbiHoMnIstzKdW6OLiRyDr91Nqgj/H0+2ZwPIp1+7/a0jPDf/VWzkzqlm5NLVNipk + edHxKhpDLisabOlszxhRofa2pOIonUYuZBq9W1TkQrtOLTfiySo/gBwP4XwouSomTWzk3Nq8Qvm1OR2v + ojHksqKhlu58Ywl51/BvVKi9CQ8BrQ/IsbyqjPub7mIhn+Y8nCzyHF8GVp/h6So38I14DjVTnxz762Ij + x+9X9oASdLyKxpDLioaa1jcBC6lQe5t/uqteIBc6ErFFVORTnYaRqc7DfrVJPTqKp6vcAPI5LdfrvcRG + jp0pPU3FLCs6XkVjyGVFA00rrSyevLrncSrU3jTU5CUOGB04JgWaFoDWFuRYckmMuMj5NgbNcwKzyr2n + Dt/wBHQ4viI8R2zkWNOlOipoWnS8isaQy4oGmtrFZjLZbggVam+zTzABrDTgmBRoWgBam5ALbQ1aLCpy + DJ4e1IFZ5c6vDt/wLmTqlWX7vZjIrZIMSdi5E1TQtOh4FY0hlxUVNC1AHpjpRkXa29479DdS21wFYPUL + eWNLHYnIOykq8ilOQ7nM4w+M4QkrNoB8XuPVGm+xkWMVLSVU1NLR8SoaQy4rKmhagBxBfXa8HxVqb9sX + th6uX/+QY/UtNWSl71RRkU92HELWB852BbuKbb7DBfEoMoZxFadyxEbumWlLRS0dHa+iMeSyooKmBcgx + 3C+chrS34XHlimrzAK3+IRdySTbvMXIE/ijkGFw/fiT2zzxl+QMXfA065pVte11M5JaJB0lGVSIVtmR0 + vIrGkMuKCpoWj7yxtZYMNP4vFWpvW+k9FdDqL3KssDoHNt2loKsQuZB53N7hPGX5A8jHfXvzkqPYyPHv + H7XzCh2vojHksqKCpsUjx3C/cBpSVYR7fOkzcqE9YWtERT7JcTBZ6zfDhKcsfwD6poy6xDNiIsdC8n2o + uDE6XGViyGVFBU1LAnlNUwV5//A/qEh7m4HdYICr/8ix4GxvUZFj873GZYLhJ3jO9IELPAOZBJ/zrBUT + OZZfm8mQU9Mu5Njh05upSFWRX7or4NV/5FhlQyn3nrpYyCc5DMI/t2e3Jcs/1TIg//jnjp/NXNLNfhYT + uW2yEXUvNTpcZdJl5A8Dx6igaQFQeVFB05JCXl5fRN468DQVaW/75OjzpAnQ9QXkQgdObRQNudCW4MWL + edL0AegzKi6V+ouJHAsteHiznQ5XmRhyWVFB05JCju0IWkFFqopMIncB4L6DHAvN8RUVObbUZ6IvT5o+ + AH1bYmVkqpjILRIPkJzaNIZcB5CXwdpcVac6lg6PIFNaV0RHLR2A1gfk2Pn6Eu55uljIDRwGklmuo3En + F/ppluEvnoaMA/Pd6sVEjr+2XGpkyLm0Fzm2N3QNFakqWuU9jY5aOgCtL8iFtp5cLBpyvnuZrQn/4Wl3 + H0D+Tmdnp4lTutkdsZBj3ll2DLkOIK9sLBXtuTkWXxRBhy0ZgNY35JhrsoVoyCfaf8K1OWjRTJ529wHo + XzV/V+8qJnIsviycIQeotKigaQFQeVFB06IAFzp0+hsqUFU0znoAHbZkAFr/kNdynS09IypybLm3gRVP + u/sA9NWZ9YkxYiI3T9hPzjcVS4HtSQy5rKigaVFwC+H75u8c/AsVqSpySTKn4xYC0PqKHMMTM+JJHsRC + js1z/yIdTD/G8+4a+MLvIMOIEv9CMZHbJB3mwNHxKhpDLisqaFoU3JIZR+ykAlVFuJdaQ2sNHTgGoPUZ + OdbQXMttMYmF/Gv7j8lkhyFXwXT3z73DF56FjvrmOraKhRzzy3aWQqtsDLmsqKBpUWBLVttSRd4T6VNw + 2L7QtXTgGIDuC8gx71QH0ZBjE+w+Ij4Z9m/yxLsGkPdH6I6px9rFQn48YR/3/JwOWJEYcllRQdOiwJas + FTIX8TPteBjngqrMPo8cSytNEBU5tjFofvcX5AD551dvX7YVEzlW3JAvhVfRGHJZUUHTkkItHSLHs5bi + 2UtpSFXRPNcxDDlfXVM1me06WjTk2DJfgyM88a4B6PPOtWQHi4ncPHE/abvcLAVYkRhyWVFB05JCLR0i + x9ySrahAVdXJTA+GXKLtwctFQ44t8BgbyhPvGoC+NbEyMkks5Jh7upUUYEViyGVFBU1LAjQtATn2ucU7 + VKCq6GOj/yONrXUMuUQOicdEQ/6V7YdkusuIYrDd9Qk5+A0eUebw6RK/cz1BLglcFnIsrMBXCvGjYshl + RQVNi8csK0nkYpxaSbKuQ0Ux5JKdyvUXDTlmYD/wCtjuOt47/Obv0JETec71YiE/Hr+XJJ+PkYIsL4Zc + VlTQtHjMspJEjuHzZxpQVfTy7t+R3Mo0hlyq3PNpoiEfbzsAfh3QWdKW3bXLKiDHQ0cdccuwvCYWcqyw + PlcKs6x0ADkVOKabyDPPJ3MYaUhV0VSHYQw5pbrGam7nFjGQCxnHbh8mQP8YodumGHWIhdwsfg9pulgv + BZoWQy4rKmhaAFde0six9SfmUIGqKvcUG4ZcRuv9ZouGHFsfMKfrtMqAfMy1W99aioncBp4S0GFLxpDL + igqaFqCVFw057oqKu4zSgKoi3DGmrqWKIZfR0cgdoiEfZ/MBWeI98YAAfUb1lXIPsZBj3ln2UqilY8hl + RQVNC9DKi4YcOxK+lQpUVa32mc6Qy8ktxVI05NhCr/GuAvRluY2pIWIhx/CIMnTgGEMuKypoWgBWXjTg + GH5ABt/2ogFVVaHZvgy5jHDnljC4f8RCPtbmfTLb/fNoMP47hL4hoSoyXizkWFzpKSncDDkNtmRU0LQA + rLxowLtqIn7pzlScqurDI//iUDHkD4fIsZTiONGQY9Mch50D408i9B3hxQHZYiE3PbObpFcmSAFnyOVF + BU0LwMqLDhxr4sJXw2lAVdWOwGUAlSGXTkCOFdfki4Ycm+gwEM/e8keEfjD4nFexWMixvNp0hlwIgMqL + CpoWgJUXHTjWhRzfUntp92+pQFVVfFEkYGXIJZNEjtU2VoqGHPvKdsD3YPxphH7IL9e5ShK4KpEfO7OL + lHTbmYUhlxUVNC0AKy86cKwLObb15BIqTlU1zPRVwMqQSyaNvL6pqxkuI0VBPtb6Pfj6e50//PDDXxG6 + oWemdYtYyLGqlnKGHIDKiwqaFoCVFx049gB5bUsl+d+BZ6hAVdX+0A0AliEXkoUcW+I1QRTk2JfW7xKb + hCNvcJvuzmlm18RCjnV9WIYhlxUVNC0AKy86cOwBcswh4RgVpypLLIoCtAw5Jg85ts5vlmjIsW3BS4dw + 0O1Sjv4oFnLs0rdtDLmMqKBpAVh50YFj3ZG3XmgiX1j0p+JUVYOOvgBoGXLsUcixHUHLREOOrTwxdQIH + 3TblyF2xkJvE7WTIZUQFTQvAyosOHHsYeVJxFBWnKtvOvdouhfhRAei+iBzbEbxCNOTYUm8DAw66ddKh + e2Ihx79nyB+OCpoWgJUXHTj2MHLsG/8FVJyqLCo/mI5ZVgC6ryLHDp7aIBryMVb9yXzv8fMQ+gGxkGP4 + vQx596igaQFYedGBY3Tkdc1Voh7GGfvg8D+5A0xQQdMC0H0ZObZfCroqkWNz3ccs6AZd1ciNY3cQ8/j9 + DLlEVNC0AKy86MAxOnLMI8WailOVrfebQwdNC0D3deTY0YjtoiH/wuodMt9zzKrf3P751lGxkGM2SUc0 + hpwKHKMCx/QXOTbZfigVpyoLyfaho5YOQDPkXZlE7RQNOTbXZfT639y6e8NYLOT3oVNhS8aQ3w/AyosO + HONxy0CeV5ku+ifh8GlBQ0sNHbZkAJohf5AJQBcLOTbb7bN1v+no/NlQLOSYZcJBHrOsGPL7AVh50YFj + PG4KcCE8ZhsNpypb4TWFDlsyAM2Qd884aofKkEsCxz63/F8XdHiOvl8s5Edjt3PXQweOMeT3A7DyogPH + APIjkDcBMLF3R8VOpDnRcQsBaIZcumpy4PRG0ZBjwotx+2CN3ikGcsz0zB4eNUMuMwArLzpwDCA/AnkL + dDrXnwpTlfXb/xR3ckYqcAxAM+TSVXPh1pZYyLtBt0wyvCsGcqOYbVwMuZwArLzowDGArAByDI/yQsOp + yha4jaMDxwA0Qy5dF3I8Y8vO4JWiIcfmu385+QF0kZA/DJ0hvx+AlRcdOAaQFURe11LNHbeNhlOVuSVb + MuQK9wA5ti1oqWjIR1u+TRZ4jZ/IQbdNMfpeLORYy6VGhlw6ACsvOnAMICuIHPM8a0eFqcpe3fMEqWgo + YcgVqjtybKP/XKWQI3BFkWOr/KeOQOh7ndLMLoiF/EjMVlLTWsGQSwZg5UUHjgFkJZBjc12+oOJUZdMc + PmXIFeph5NhizwmiIR9l8RYxjFr/FgfdPcOqVizkWGnDOYZcCMDKiw4cA8hKIi+tKyKv7HmcilOV4amW + GfJHRUeOzXAeKRpyLLYo+J8IfbdvrmOJWMiPRG8h+bUZvUT+ALg08vLGYpJblU6Sy2JJXNEpklAUQdLL + E0l+dRapaionTRfqqcAxKmhaAFReVNC0AKy86MAxgKwkcswq7jAVpqrLOn+WIZebbOTYV/D8XCzk8Ps7 + YPxPCH1TUL5HtljIMTw4pBjIo88Fk7cVeKHp/UP/IOOs3ieLPSaQ3SGriV38Ue4Ed2UNRXTYkgFQeVFB + 0wKw8qIDxwByD5BjX9t+TL0/VNkQkxcZcrnJR15WWygacgy+vw2M/wGhrwov8U8SCzl2pvQ0HThGxS0k + G7kQrs0/N+/56X4/OPJPMttlNDkasYNEF4aSxgt1WoIcEPcCeVFtrqjnUxPaErCIIZeZfOR47rXMshTR + kGNwveVg/AmEPj+pKipULORYSL63KMi54Pk3bp5v9JtHXRCV7fW9vyczHEcQi9gD8J9IGhU4RgVNC9DK + SwzkeJ4zq1hD6r9P1YVkezPk1B6NHIvMPSka8s8s+uEhqpLA+G8RukFBc5aHWMgPR28mnhm2oiGXzDPV + lry1/0/UBbKnjTJ/ixyL2kUKa3J0BjlmYDeY+u9RZW/u+yMstFUM+UMphhzzTLETDTk22XGwt3BKppGN + 39WZi4Ucs048JDpyofTyBPKJ0X+oC2Zvws3gyfZDiH+mK2kGSFTYkgFaeYmJvKQ2n7yy5zHqv0OVzXIa + pTLkdLjKpHvIMbPovaIh/8z8TTLVeegRAfoHP3fc3Wcav+tXMZAfivqG+7XtUrPoyIVX00vrCsgXFj1/ + 3v6oBhm/QI7H7Cf1rTUPA9cwcszmzBHq7VZ11rGHASlD/iDlkGObAxaKhhyb6TpyhQD9ZWiXZZLhDTGQ + C5U1FvKYZaUa5EJ1rVVklvNo6gKqqgYceY7YnjHiXiPQFuSY2KdaEsqryACoDHlXyiOva6wi050+FQ05 + tsJn0hcC9L8hdMfUY01iIcdSz5/hQdNSLXKhFkDzTYD4B0Mccuwl7sgqNNiSqQN5aV0heVUNm+0jzd4A + qAx5Vz1DXlSVJypyzCrO8GUB+mPQDu9suyKxkBtGbSJh+b48avUgl3wvHN86oy2sqm6512RSVl+kMeSY + Q4IJ9bapuu0nlwNWhrynyLHovBBRkcPXboHtP3HQceAPq0IKvZPEQo65plrwsNWLXMg89oDoh1LC3j/0 + d+6c4JpAjs10HEm9XaruVI4/gGXIe4occ020EA35SPM3yBjr/lVg+wmeOQd9SmJlZJBYyA9GbuSuD9Fq + ArmQXYKxWrDjK95G4du7sKoR+fmGYrV8tv3tA3/mYNAQPyo6XGXSD+TYnpA1oiHHxlp/EMsT7xqAPrzi + UomNWMiFyhuLNIZcyDXFUi1vPWF4MAbcH1wdyDHHRDPq7VB181y/pCJ+VHS4yqQ/yLFZLqNFQz7i+Otk + gv1H5jzxrgHo/X7uuLsHoHeKhfxA5AaSWBalUeRcl1qIV6odeWWv+Gs+7GvbT0hFY6noyLHZIr/LIGR/ + xpgKWV50uMqkX8jzKzJFRY5NdRq6mCfeNQD979B266RDV8RCjp3IctI4ciEOu5rW7J8d70cKa3NERV4J + /5m8tvdJ6s9XdflVWVTMsqLDVSb9Qo4FZriLihxb5mMwgCfeNYD8t9A37hmWJb1FLglcEvn+iPXk+Jl9 + WoFcyCnJTC3P2bFPjj5PMs8niYIc8061p/5cVTfC9HUqZlnR4SqT/iGvhYwitomKHP58p/RK6YNX3IUB + 6HPDinzjxEIuVNtaQQeOUYFjqkcuZBl7kLpAi9G7hn8jcYWnVY4cW+U9jfozVd0m/wVU0LTocJVJP5Fj + izwniIYcG2P1TgmY/h3P+8HAFz/LbUxzERM5llQWrTXIMfw0m1H4NupCLUZ4WOTwvACVIsfPmw84/Bz1 + 56k6/3RXKmrp6HCVSX+RF1Rk41tfoiH/9PhruEecB0+7+wD0N27fvbEXoHeKhXxfxDrikW6jVciF8K0O + 2oItRm/s+wMJzvZWCfKWtkaSWBRJ/TmqDl/TwINA0mBLRoerTPqLHPNJdRAVOTbB7uNlPO3uA9CfgrZa + Jx9qEws5dgiuB5FpE3KhTWr4uKwQHjnVD9aOvUWOHTq9mfozVN0E64+osCWjw1Um/UaObQ9aLiry4Wav + khU+U97kaT88AH2ZT45DxqOQI/CeIN8XvparoDZL65BjuPvpXJcx1IVcjPDDLXg45t4gb4bGWX1AvX5V + dyBsIxW3EB2uMuk/8pr6CjLRbqCoyOFyePiox3nWDw/85dikysgTYiLHwvJPAFwacEwzyIXqWqvJeOsB + 1AVdjHBz2D3FCvD2DHlJTYFaDhmFReQFUoFjdLjKpP/IsdiCMFGRY1/avHuKJ00fgN7/8s02Q6OYLb+K + hRzDw1ZpI3Ih3DFlqMnL1IVdjBC7F7dmlwJNSwI55pxoTr1OVdfvwJ8ATjVD3gvkmHH4DlGRY1/ZfbiZ + J00fgP40tMUi8cAFsZDvDV/DVVyfD4i1D7mwI0pOZSrBHVRoC70Y4a6lJ9Kd6LiFpJBjSz0NqNen6mY5 + je67yKnAMeWQ1zRUkGlOw0VFji31MOjHk5Y9AH2+f75LkpjIsdA8H4CsnciFzhSe5l40oy34YoQ/KyDD + TWHkDQClv+Ffqdel6o5H72PIu6Uccgw328VGPsq8XzUYfoznLHvgQsMLmjNtxUSOmcTu5JDSgGMPYZYV + AJUXFTQtKeRCHinW1AVfrBA7nub4UcixqPxg6nWIUUpJHEN+P+WRY4dPbxEV+TDTV+D5+XuOPGX5A9Cf + 7+ho32oUs+2uWMj3nF7NlVeTrtXIMdwZZU+o+t5jx/BDNbGFp+Qix2OpH1LT22ofHnmOIb9fz5BX1JWR + ifYDRUWOGTgONuApyx+A/jtojWOqabGYyHefXkU88cMzAFabkWP4irg633bD8PUBXIvKQo5NtB1I/V5V + t9xzMkPO1TPktQ1VxD/NRXTkw0xfve2Xa/sMT/nRA9DHJ1VFeomJHNsLl8EjqWozcqHalioy+vhbVAhi + 9bHR/5H8qmwq8uqm82rbW80lyZwhB7C0qLAlA+TYap8ZoiIfavoyfnY+jCes2AD0139sv7XtUNTmn8VC + LhRVGKz1yIXO1eSQ9w8/S8UgVqOO9yMVDaXdkGPBWV7Uy4tRAfxnQ4erTH0XeVppQrfn5mIgxyY6DJzD + E1ZsADoeMHK1Y+qxIjGR7zq1khyJ3kpaLzXRUUsHQOVFBU0L0MqKBryrJq7I/CDuE200EGI13XEEaQAc + ktB3Ba2kXlbVfWr6Gg+1N/Vd5NiB0A2iIx9m9upNpTbbhQHoY5MqozzERI7tDFvB7dFGhS0ZAJUXFTQt + QCsrOnCsC7mQRcwBKgoxw3PLSUIfY9GfejlVt8FvLo+1p/Vt5AWV2dyRXsVEjo2x6h/E01VuAPqrd9p/ + 3HIo6pt2MZFj5mf203ELAVB5UUHTArSyogPHuiMXdi1d4TWFCkPMjoZv55CX1xep7WOvHsk2PNie1LeR + Y3hGH7GRY187DJrO01Vu+M33Vc5pZrliIhfKqjyrM8ix2uZK8rmIp32ihUfDwf3B8TBEtL9Xdfjziqpz + ebTKxpCfryshBvafiI4c/u6qb6nvw0eTUXQA+qic+hQbsZHvCFtO7JKO6gxyofzKDPLeob9RkYgVHmp5 + kftX1L9TdSPM3uDRKhtDjjkmmIqOHM8SNMb6PSeebM8GoD/XSTo3GMVu+05M5Nj20GUkrzpdZ5Bj+P56 + ULa32o47p+42+s3n4SoTQ46V1xYTA7tBoiPHZjiPHMKT7fkA9tn+ec5RYiPHrBMO6RRyoX1h66lQdD3c + o46OWVYMuZBd/FG1IIfrKsKn2TzXng9cSf/W7xv37g9f1ykmcqGsyhQqbiEqaFqAVlZ04BggVhI51tha + TybZDaFi0dVwK6W4Op8HrEgMuVBpTSH52u5j0ZEPPvYiGWf9vvxdUhUdgP4ktNIq6VCZ2Mi3hS4l5vH7 + Oag9Rg5g5UUHjgHiHiAXKq7NIx8c/icVjS6Gx6Kng6alPcipwDEqcEy1yGsbKolVzCG1IB9m+tKPu2M3 + /JOn2vsB6KOTq6MdxUbOFbKEnC2L0ynkwl5m4fmB3EEkaHB0rW/8F/KIHxVD/qBKcq4yG9eyoiPHRlm+ + 5c8TVc0A9Gfvdd5bfyh683diI8cORW3mjt+mS8iFjpzeQoWja+GRSumwJWPIH1TJtS90nVqQYwYOg0bx + RFU3gH1iYL5bmNjIhcLyfHUOOdbYWkcM1LRXmVjhh3FKas7xmGXFkD+oC3lSUXTXh2PUgPzT46+fA5MP + n6ChtwNX+sJ3d65t2R+xvl1s5FtDFpNdYStJVXM5HbZkAFZedOAYIFYxcqH8qgzyzsG/UBHpQp+b/4/H + LCuG/EFdyLHlXlPUghz7wubduTxN1Q9gn+2WYZEkNnJsS/Ai4p5qRcctBGDlRQeOAWKRkAup61xoYrQt + cCkPmpY2IJfzyjpGBY6JhzwgzU1tyOGyTS7nXJ7gWap+APqbjVdr9uw5tbpTbORc8PvsyrM6h5yrrZHb + B5kGSdvzTXXiUTPkdODYA+R4yO3JDoPVgnywyQv49GALT1KcwecE0DybpMP5oiPnw+PWNbXV6xxyrLLx + PBl27BUqJm2Ne/8cFlyGHKICxx4gx/aHbhAfOQDnMn3x2ga/ecrvjqrsAPS3Ky4WH4TN906xkW8OXsjl + n+Wic8iFI8LEF0Wq9UiyvW2k2Zs8bIacXnfk0Xmh3Cfg1IF8kMl/YW3ebz9PUdzh1+pzbFKO5KgD+TdB + C8jmkIUktyqNClsyOnAMEGsAuZBx5E4qKm3s4f3PGfIHdUdeVlNIpjuNUBty+LsralmbCwPQ36y+Ur53 + V9jKTrGQI3DJ9odv4I4vRwOO0YFjgFiDyHH/cXzLbYr9UCosbcstyYoHzpB3rztyDI/yoy7k3NrcvN8O + nqB6BqD/Fpppm2KUoQ7km4LmczmlmOkccqFz1dnkXTWdbKE35VVmMuQP9TByPC6AOpHD31/Y5rug5/uc + 93QA+qt1V6t27T616p46kG88OY8rruiUziEXwk+b0XBpS4ONX2DIH+ph5JmlKWSc9QdqQ46NtnxrPU9P + /QPYDVwzLaPVhRzDt9zO1WTpHHIhdZ0rrSet9JrKkHfrYeTna4vJPNcxakU+1PSlclHfN3/UAPRnb7Z/ + v25f+Nrv1YEc23ByLtl3eh2paa7kUesOcqysrpAMOPwcFZqmsztzlCG/38PIse1By9SKHBtn9/5Ynpzm + BrCPCC3y8egJcgSuLHKuwDnEMv4gB06XkAup65hvyobHH2fIMTpyx3hTtSMfZvZKJBj7Lc9NcwM34qlf + fvll0ZHoLY3qQi50IsOJB647yIVWe0+nYtNU7x96liHnoiOPyDlJRlu8rVbkA03+2z7FdeCbPDXND2B/ + P7cx9TCs0TvVhRxbHzibRBSc1Dnkza0N5Hx9Cfn46H+o6DTRAtdxDDkFOJZRlsy9+KZW5MbP46ftTHhi + 2jEAHT9EM8X+rPEZdSLHNgTOJRnnk3QDOQDHmvhCsny05sCSZlF7qYAVSZ+RF1bmkBlOI1SCvBvwRyCH + y1cZRq18iiemPQPQn7vx0/er9p5ee1VdyNcFzOLaDNddWJNDBY7RgWNSmGUFoFWNXAjPwEKDp+6i80Op + iB+VPiPHI7ku8ZigduSDTJ7/ZaLdh6N5Wto3gH1wQkWE+dbQxb+qC7kQfminoqFEp5DjGUorG8rIJ0bP + U/Gpqzf3/ZGDQIMsL31GXl13nmyC/4TVjRz71Ow1N7Ck+RfgZA3cuCegGRaJBzLUiXxtwEyuvafWkurG + cp1BLqTpV+En2g6iQpaXPiOvqa8gu4NXaQT5IJMXLiwLnvF3npT2DkD/7+WbF9fuOrXye3UiX+M/g+tA + +EZS01wBUGnAMSnMsgLQ6kAupMkP0uwJXk3FLCt9R254apNGkH9i8p9fJ9gNMOApaf8A9qFxZaEWm0MW + /qpO5EKHo7aQuuYqAKsbyLHimjyNfRY+MN2dCpqWXiOHjCN29Ao5Au8RcuP/kE/NX/PS6k126YEb+zg0 + 2SLxQIq6ka/2m85lHL2D1LVIYpfCLCsArW7kQk6JZlSIYtZ1IMgCKmrp9B358eh9GkMOm+wNc/0n/I0n + pDsD0J+9dfeHJbtPrbqkbuRChyM285vxUphlBaA1hRzDHUqmOgynghQrPJEiDbV0eo0cNtc1uSaHOsbb + DhjJ09G9Aez9s+tT9sPme4e6ka/ym8a1//R6UtVYRoctGYDWJHKhzPIU7lVwGkoxWuc7mwpbMn1HfiBs + gyaRw897w4gno5uDzzegL13SzU9qAvnKE1O5doetIiW1BXTgGIDWBuRCtmeMuANVqCO/NBcqbiF9Rl5R + W8od8VaTyIeavpRtGGz4JE9Gdweg//EX8sv0g1EbyzWBXOibkwtIdsVZrUeOPTjCS097sAca+1grHXlR + VR5Z5jVJo8jha99/7fzBGzwV3R/A/s+m7+tXbQ9del0TyFecmMK1Bi5zpug0Q65A+ow8vTSJzHQeqVHk + A03+88vn5m9P5onozwD2t9JrE/ZvCprXoQnkK3wndwW/90yz41Ax5PT0GXlwpnevd1DpLXLsU7PXjvI0 + 9G8A+1DfHAdXjSHnW+47iRhFbiOVjWUAliGXTF+RV9ef53bcweOvaxr5kGMvnjE0NFT9edO0ZQA6vr8+ + 3iRu51lNIseW+RiQzUGLSE5FGsBlyDF9RY7Px9f6zer1QSNUgRy+3jDFfuA/eBL6OwD9qTs/3562L2Ld + eU0iF8LLn8z26MJLQy0dXq4bboZcm5HH5IeSKQ5DlUYuCVyFyK9/bvvO/3gK+j+A/a+Xbl5YsD1sWasm + kWNLfSZy4aZ8eUMxHbcQgGbIpdNO5FXCpjp/FhVNI4c/3x1l+ZbufiimpwPY/1V5uXTNppPzb2oa+RLv + r7nWw23AV+X7LHIqZHlpJ3I8IswSzwkccG1AjjurDDv+yjJ+0e97A9hfT66O3rvh5Jx2TSPHFntP4LKO + P8x9mo4hl5f2IccX3JwTjpOx1u9rD3JoqMnLhvwi33cHsL8TVRZ0eF3g7HvagHyR11dc6/xnkehzIQw5 + Ne1Dfrb4DFnqObHHZzUVC/kQk5fsYBnXnT3SxBy4I94POed1DNboHdqAXGih13hiHLWDlNaeA6QMeVfa + hRw/xno8ej/53PJ/SiNH4KKuyY+95KHXb6P1ZAD7AL9cZ6u1/jM7tQU5l+c4stxnEvHLcCYNLTVUwIpE + h6tMDPmDupCHZfuTWc6fccC1DrnpiycZchkD2D9xz7J2WO0//VdtQS7ZpsD5JPZcGBWyvOhwlYkhf1Al + SS1JIOtPzLoPXNuQDzZ5MXKly0rNnUJJ2wefy0CDvLLsbGHzvVObkC/wHMs13+NLsu/UepJWFk9FLR0d + rjIx5EL5FZnk4KmN3IkUtBX5ENOXQvRibzSxh8f+UUCei9ka/+kd2oZcMsOIb0hmeTIVOEaHq0wMOXau + KoccCd9Kxlj17wZc25APM33Z2/Cs4eP8osxGkQHs7wcXeBrBZvzPvUEuCVyVyOd5jOGa6/4F2Q9r+Pii + CA4nQ46pBnlGaRI5ELaxC7hFP61GPvz4qw7BwcGP8YsvG2UGsL8TURK4Hzbj72grcsk2n1xIQnN8AEEV + j7Wn9W3ksQWhZHPAgq5X0hG4liP/1Pw1U9wS5RdbNj0ZuAPfTKmJ2bLWf+YP2ox8jtvnXLPdRnO3zSX5 + OLfJSYcsr76JvKy6kHgk25BF7hPIKIu3uLQdOe5TPsLijW0MuYoG7sj/FjRlrNwQOOeStiOXbm/YWhKe + F0BqFVrL9x55N+A6gDz+XDjZF7qOjLf54D5wnUBu/Pzd0VZvL+AXUTaqGsD+j/qrNbO2BC+q1AXks1xH + cc10/YxridcEYhF3kCQWR3Gg+jJyfO5tHXuYzHMbQ0Zbvt0NuC4gh69f/9LqHe09N5quD2B/+uZP34/f + E746XRq4NiO/n8tIrqXeE4lV3CGSXBLDgewLyLPKUoltnBFZ5PEV99wbgasKuSRw8ZG/0DDefEDf2dVU + UwPYf9/R0TH8aOy2EF1ELjTDZQTXIs+vyNHI7SQsx5eU1RZRET8qbUReUVdGInJPEpPInWQurLkRt5Cu + IofL5RpYD/oXvyiyEXsAO56Pvb9rusVx2IS/q6vIpzt/2j342vqAOcQ89iAJzTlBCqtzqbAl0xbkZTWF + JDw3kFjGGpI1J2aSr2w+JF9YvdMNuC4jH272ssdir8/+wC+CbNQ5gP35xMqINWv8Z1zUdeTTnIdzTXUa + 1q0FcBu3By2HTX1DEpjpTtJKE0h1Q4XGkOOpi7LKz5KgLC/u6Qfetrlwf3xp/R4HWzL9QP58+6fmb6zm + Fzk2mhrA/ue6a1UTtwYvztc35FOchnJNdhxyv0mOg7lfF3iMJZsCFpBD4ZuJfbwxCUh3JVH5ISSlOI4U + VGaSivpSKdTSPYy8qr6cnKvMIanwn0lsQRg5meFOHBKOkcOnt5CN/vPIfLcvyXibAYD63fvhh1kwfUQ+ + 0OS/LV9YvD2YX9TYaHoA+xP37t370CRul/cSnwkd+oycy2FQtwwcBnJNtP+kW/g9M5xHklkun5GFHnAf + QCt8ppCVPtPgP4rxZIH7ODLbZRSZ5jScTHEYQsbZfMA11ub97sHaGpMErm7kCFydyAeZvBjzuXV/9nxc + Gwc35cOLA9et8pvW1teRf23/MdcEu4+69ZXth1zjbQd0iyHvQg6//jT8+GsbYVliH4LR5oEH6KkLPzSP + 2hW2Mo4hZ8iVQQ5/LvnM5u3+/KLERtsH/zeGXnfLsjq41NfgOkPOkMtH/vy9oWavmG+wHf97fhFio0sD + 2P9c+235mJ2nVsQu8Br7K0POkEsjH3LsxcIxlv0/5hcZNro6/Nr9pRN5zluW+05qY8gZcgQOv/4I17mL + 7T+uZwPY/3jxu+ahByI2+MFmfDtD3neRDzV7OUavTlfM5uEB8M+l1cZN3Ry0IGWuxxe/MuR9B/lQ05fK + x1m8+xVu5fGLAxt9Hnig8SO0Lwfmuq1b4TO5VlPIJYEz5OIhH2L64nejLPptdDnnwg7Y2BcHsP/+9s+3 + +1skGhot9p5wkSHXL+Tw+x/htlgs9Pn8H/xDzqYvD4B/+tqNSx8ax2yzWeA59jpDLh5ySeDiIX/h5xEW + b7rPdR/9Ev8Qs2HzYAD8n1uvN3xiGLXJcZ7HmB8Ycl1D/sK9T81f953mNYK90Mbm0QPgn6m8Ujp4b/ha + V3j+fpMh127kQ4690DHc9LWgGc6fsgNCsFF+APyfKi6WDDCM2mi9wPPLCz1BjsAZcnGQDzn24u2RZm+4 + THEd+Cb/kLFh0/MB8E/ebL/5unnC3j2LvCeUM+SaRQ6XuzLS/M1DC3y/fI5/iNiwUd0A+Megf9snGy9Y + FzArEtbudxjyh5EjcBGQd8J1pH5m+dYiw6iVT/EPCRs24g6Af7qwLfe9fRHrjBd4jqtgyMVBPtz0lctw + veYzHIf14+96NmzUPwAeP3zznHP68UmbgxZ6znYb3cyQ9w75cLNXvodN84Cxlu9OYicsZKN1A+CfgP5l + n2w0ZX3gHO9Zbp+1MuSKIR9+/NUf4GcFwe2d5hJlyDbN2ejGCOjdMq3HbAtZcny+59isKY5D7jLkPHKz + VzpHmfcrhdtkOcN52Bivs17sCKtsdHsAPO4q+0zVtZI3j8RsWbXaf7rfLNfPqgzsP+nsS8jh8m1jrd8N + nmD70Zp1YXNfgvvkd/xdxIaN/g0s4E9Cf4+vPNV/9+nVa9b6TfeY5TqqELC36xHyztGWb1XDbfGZaPfJ + 2nUB097Bfzd/F7Bh0/cGAODbds80XKp4cXfE2qlr/KcfXeQ94dQ05+HlsIb/SduRjzz++i+jLf9X96X1 + e1Fwu4wn2g+eefTMN//Gfxf/T2TDhg1tAAm+mv/UrVu3nj0WvXPoGv8ZK5d4f2UKz/UDZrqMTDNwHFj/ + le2AO+pD3q8Dvq91nM37OeNsPwgab/fhcQO7gavnuo8eEXzO5S8MNRs2Kh5A9Tj+JwD91f2s5es7Q1YM + XR8422Cp78TFizzHb1vg8aXJHNdRztOchvtPdx4RNNVp2KmpTkPPwBbCmUmOgzMnOgzMnuw4JNHAYWCc + gePgKPjaSQPHQYGTHAY5GzgMNoXL7pjlPHLJTPfRE5f6fD1ku//iN85WnH0afy5/E9jo1PzmN/8PpdCW + Fsflsc0AAAAASUVORK5CYII= + + + + + iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAYAAACI7Fo9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAGYktHRAD/AP8A/6C9p5MAAAAHdElNRQfZAg4LMQXZmN/IAABACklEQVR4Xu3dBXwUZ/rA8bur + 3F2v17Ne73/XqwvtlQoVvFBoKVBKcHd3KO4QICQkxN2NCDGIhyhxJU7cE6xAW6SFlDR9/88zmYHN8u6y + m+ys5X0+n98HCJvNsjtfZlZm5jdsdG8IIU9D/4X6Q0Og0dAEaCa0+E777Y0Xf2g5UHe1+ljF5RJbrotF + 7sWted5YUUuuD/5a0JLlUn6xyKbsQqFVxaVio8brNXuu3f52FVzHdP76RkGDoHehl6C/QL/lbwYbNmx6 + OwDqSegF6GPoa2jBnfYftzRfr7Mras0NPFsTGxtZGph9ssC93DfHsd49w/KyU6rpDZvkI/eskgyJZeLB + blkkHuiWecJ+ruMJ+7oXvxe+vu8Xq6RDt+zPGl9xTTdv9MqyOx+Y754dXRYck1oTf6KoJdu47UbLCrhN + 46FPoJehp/ibzoYNG9oAkt9Db0K4Zp7b0fnzjsZrNW5Z9SkRUaVBOX65Tg3O6Wa3bJOPEMwm+TCXddKh + biHw3iLHzOL3dMv0zG6uY2d2dcvszJ52+1STlhO5jrkx5aGnc5pSLS/+0LoE/g2fQf2gp/l/Ihs2fW8A + wN+gAdAkaMPV21ds8psyTkWUBhZ4Zdtdtk8x7rRNMSJcPG5tQ24St5PLOHZHt47Gboefe+C6R5Z1YWx5 + aGjpxQLDX8gvE+Hf+QH0T4ht+rPRz4GF+3HoDQg3wbdcvnnBKbs+OTa0yOe8a4blTbuUo0QyXUaOGcVs + 65Zx3M67TqnHqsIKfaMLmjJM239px+f/b0F/5O8iNmx0c2Ah/jOEL5Qt+fHnH03heXVYRElgkXum1Q2H + syYEnv9y6TvyIzFbu4recj+43F2nNLPS6PKgwJrL59fx99M/+buODRvtHlhY8dVwXGhXfXv7smNaXXxy + QIFbs3Oa2S+IW6gvIz8cvZnrUNQ39zNP2HfpRI5TUkZdoiHcd/gq/z/4u5QNG+0YWCjxhTR85Xnl1dvf + 2qfXJiQF5LlccEozJY6px7gYctnIMcOoTVwHIzfiz7juk+2QlFWfvJe/X9kLemw0N7AA4vvY09o72o/l + NqXFBua7tcKa+1cEzpD3DLlkByI34M+86pfrHF12oXAx3NevQL/j7342bMQbWNBw7T0U2tz6XaN3TFlI + kVuGZbuAmyFXHXJsf8R6Lvh9p03ykfKo0iCbOx138P5/hn9I2LBR3cCC9Vfo647OjqMFzZkxsGl+Gdbe + BGPIxUUutC9iHRdc1w3fHMeo6ssVM+AxeY5/iNiw6fnAgvQfaM6P7bet0mrjU72ybG+5pB/ngDPk6ke+ + L3zt/Q5EbPgZHou0/Kb0NfAY4Sfz2PvzbJQbWGjw+eDK73+67hR3/nSBe4YlLlTkUcglgTPk4iHH9oav + EfoV7pvSs9Wx+OIdfrqQgWcjf2Ahwc+Wr7h554ZD/PnwAtcMiw4BOEOulci59pxezWWZeKA0oy5hJzyG + rzHwbB4aWChwE33p7fab9omVUbnuGVb3JIEz5NqPfPfpVV2Fr8I1fGFmXcpmeExf5h9iNn15YEF4BprX + 3tFunVpzJsMj07rdNd28G3CGXA5yCeBagZxv16mV2K/WyYezS9vylsNjzF6064sDD/wT0BednZ0meU3p + 8d7Zdj8icIZcb5CTnWEruOBrHfD4JdRdq8Ida9iutH1h4IH+LfQhtK/28vnggDzXb+F5OAdcUeQInCHX + DeRCO8KWk72n19z2zXXwuXHvxkfw+D/GLxJs9G3gwf0HtOa729+6RpQEVHPAGfI+gRzbHrqMC27ThZjy + EPxM/fP8osFGHwYe0N9Bozo6O47j83D3TKsOhrxvIhfaFroU77P8otYcA1g2fs8vKmx0dfB/bQgPv+QP + m+lX7wNnyBVGzgHXM+RcIUvwcj/65Do4t7e3v8ovMmx0afi1+Hh8NT2hMvKcW6ZlJ0POkEsil8woZmtF + el3CfFhm/sAvQmy0feDBehbajGtx/1zn77sBZ8gZcinkW0MWc8Hvf3bPsHSFZee//KLERlsHHqRBnZ2d + pmk18ZnwXLz7WpwhZ8hlIN8SvOh+xnE7zhU2ZY+FZYm9Mq9tAw/KU9Di73686h5yzrvNLcOyO3CGnCFX + APnm4IVc28OW/XAy3/0ALFN/4xcxNpoeeDDwBbd9FZeKwz2zbNv7InK8Xrd0SxKQ40pCC3xIVFEQSSiL + JOmVCSS3Jo0rrzadFNXn3q+wPocU1GWR7OqzXGlwWfwe/N7gPG9yIsuJuKZZEIuEAwC8C3pfQP5N0IKu + ghf8apV0KPzqzatv8IsaG00NAP8YNtXNUmvichC4PiO3SjQknhk25PQ5P5JyPpYU1GaRqpYy0na5mVy5 + eklGF7kuS/etvC506xJ04XIL/Kxykl+bSVLKY0lYgS9xTbUgx+J26Sdyvk1B84lh5KbzBY2ZY2BZY0e3 + UffAnf4YNO2ne7cdTxf7NfYEuSRwbUOOl/PNciRxJadIfl0GqWur5BDSMctKNcipXXlQfVs1ya/JILHF + YcQz3YaYwFMCfUGObTw5Dzflr4UXB+LRatnhqdU1cGfjkVY3Xvihxdcvz/mGPiC3TDpIfLIcSFJ5FDnf + VAyY2qTQKpt6kNO6eLmNVDSVkMTSKA7+4ajNOo1cCL5+zy3LyhaWvWf5RZGNWAN38nPQvtpvz4d6Zdtx + z8d1FTl+D24C58Eau/VyE/n22mUuOlxl0hzyS1faunURwqcWuMYPgef9x2J36SRybMPJuWRD0FzcBTbk + 7t27L/KLJBtVDwDHgwkcPdeSFe+RZd2pi8jxsqGAO78uE+C03cetr8gf6nIrOVeXQ4JyPYlxzA7dQo4F + zuE6GrM9/dsf297jF002qhoAjmcUNT9bE5vrnmnFAdcV5JhfjjP3qvfFb1sfwi1Eh6tMWo4cg816oQuA + Hl/c88605zbtdQW50J7wNRWlzXl4Ukx2JBtVDNyRX3R0dljHlIdUKIscgWsKuWOqKYkrPUXq2qqosCWj + w1Um3ULevVbSeKGWxBWfIubx+1WKXBK4KpGvD5zNBT+3LbMhZSoso+zDNb0ZuAO/bv+l3Q5fWdcV5D5Z + 9tzzbkRCQy0dHa4y6TZy6Qprc4hbmhXZdfoBdm1Evi5gFtfmoIXXEipO4wkmHucXWzaKDm4OQVPv3PvJ + IaTQ+4K2I8ffB+d7kbKmQipmWdHhKpN+Icdwkx6rbColgdnuZF/4Oq1FLrQpaN6t06X+eNjpJ/lFmM2j + Bu4s3PNs1u32m05BBR5XtBk5/hpZdJLUX3j05rl0dLjKREFOhS2ZbiCXDDfrTxcEkIMRG7QS+dqAmVxw + mR+Dz3ltgmWX7d/+qOGRL7hx93uXkwXuV7UVORZeFADAq6mIHxUdrjL1DeSSNbXVkVP5J8je02u1Dvka + /xlc6wJm3w3Mc8XDTbMP1sgauHNwc33udz9dcwvIc/1OW5EH53uS2guVVMCKRIerTH0P+f0utZCGthoS + kO3Gbc4LwLUB+YNm3vPOssGTSbA1u/TwyKffunvDWVuRe2RYk6KGXCpeRaPDVaa+jVyy8sZiYpdkpFXI + V/tN5+rCbrcDlukn+EWcDQ7cIZPwc+uB+W7XtA25/dmjJLXiDIeKhlfR6HCViSGnlVGRiDueaA1yobUB + M9pP5Dmth2WbvRqPA3fE2J/abzsGF3he1jbkgXlupP5iDRWuMtHhKhNDTquNrxGev/tlOpMtIV3QNY18 + ld80Lvi7nwJzXFfAMt6332eHO2AYvk8eWuTTpk3InVJNSXbNWSpaZaPDVSaGnJaAXLKC6ixiFL1dK5Cv + PDGVC7735sl8j3n8It/3BpC/A1lElQVXaRNyfD+8+VIDFa2y0eEqE0NOi4ZcqOVCIzmZ40E2hyzUOPIH + 2Gdfj6+MGMEv+n1nAPi/IZPk6pj8RyGXBC4mcge4TEZ1IhVsT6LDVSaGnBYNN63cqnSyP3yDxpGvODGF + C55S1BS15P6PJ6D/A8D/Ch3MbUpL1hbkPtkOpLat52+ZSUeHq0wMOS0aaGoXm7nqW6qJU4qZxpGv8J3M + tSNseV7b9Tb9P0MMAH8S2lF1qeyUR6b1r9qAPLY0lINEA9uT6HCVCdBKR4UtGUN+Px65ZPHF4dwr8ppE + LnQgckMkGHiGJ6GfA//AhVdvXfb0ypJ/0Ah1IMdNddx19Or1K1SwPYkOV5kALUP+UFTQtCjIhQprc2FT + fp1GkS/3ncR1PH6fGVjQz/fY4R82El9hx4+2ahq5e4Y1qWk7z5DfT3+QVzaWkrqWqm7IsVaorrWKWMUf + 0ijyZT4G+Od2/1ynBTwN/RlAjkeH4V5hpyIH4OpCHpTvSdquNDPk99NN5Ag3viiCGEVsJ4vcviKDjF8g + L+76DVdQFjzGUsiF8FX5wCw3QD5HI8iF1vrPvJJaE/cJT0T3B4D/BTqcU3/2rKaRRxcHkyvXLjHk99M9 + 5PnVmWR/2Aby0ZH/uw9bsgk2H8lELtkZeN6OL9BpAjm21Gci2Ry8qLD5WvO/eSq6OwAc90bb0Hq9wd8j + 0/oXjSFPOUJSK89wwLUHOeWVdYwKW7K+iTy1LJ4s85xEXtnzGBW4UGR+0CORt15s4squTCFbQ5ZoBPkS + 76+5jkRt9QQjur23G/wDxuDzcv88l+80hdwOwmOjM+SS6Q7ykroCssZnJnlp92+psCWb7vipwsiFSury + ya6wlRpBjsGfO7yz7JaAFd089hzc8JcgizPnT5VoCrk9/B73OGPIJdMN5IjS+sxh8vbBP1NR08Ln7Mog + b73QVXl9EdlzarXakWOLvSfgz7hQ2lrQn6ejOwPAfw/tPX+xKFxTyPEyJY0FDHm3NIicxywrSeT4Vtg0 + WDvTMMtqtvPoHiEXqmgs5Q5bpW7k2CKvr8jOUytiwcxfeEK6MXCDZ9/46Xtn72y7O5pAjmvy0qZzDHm3 + dAN5aI4v6W/4VypmeSXA2pwOHONxy0AuVNVYDmv2NWpHLmSddHgP2NGNPd3ghuLOKpYRJQG1mkCOvy9q + yGPIu6UbyE2j9jzyxTZauDanA8cAsQLIW/jONxRzz9lVgRyBK4ocW+Zr8H1WXdIQnpL2DgDHTfYDRS25 + MZpBbkQK6rMY8m5pP/KmCw1klc80KmJFwufmqkAuhC8Abg9ZplbkC73Gc20OXpgKhv7Kk9LOgRs47ebd + G07e2bYPNtnVhBzfQsutTWPIu6X9yBvaaslcly+ogBVplsy1OSDuAXKhwppcPGa7WpEv9BzHZZlouAss + aedpmuGGvQKZR5aerFQ78mT2PvnDaT/ymuYKMsl+MBWwotHX5oC4F8jx03NYdmUqWec/S63IMdiEv1bY + mK5953YD4I9DOysvlYRpAnlUcTBD3i3tR17XWk0m2fUOOX1tDohVgFwosSQKnqvDGl1NyLEFnmPx+PW4 + l9ufeGLaMXCDxtz55Y6tT7bDLXUjP5nvQa5cu8iQ30/7kTddqCdzXD6n4lWmh9fmgFiFyIVOZnmoFTk2 + 3+PLXx3OGi/jiWl+ADl+lt0koTL8nLqR4wEj8AylDLmQ9iNvBjjLvCZR4SrTw2tzQCwCciHnFDN1IueC + n9NSc71GOw5UAcjnXr5xwdMt07JTncjx+hov1jLk99N+5Nje0LVUuMrWfW0OiEVEjjW1NpAjkdvUhlxo + X8RaazCm2Rfm4Abgx1zNw4pPNKgTOb6NJnzqjQa2J9HxKhpDLitJ5B5nbRT6zPqj6r42B8QiI+dqaySV + jWXcK/HqQj7PYwxe/lZU6ckPeXLqHwCOZ1fZyL0Ap0bkWEpFLEN+P91AfqYonLy5749UuMr2YG0OiNWE + HGuGsirOkpUnpqgFOTbX/Qs8DNZpsKaZUzzBD/6wo7PDyjfX6Tt1Ig8r8KVi7Wl0vIrGkMtKEnlZfSH5 + 2OjfVLTKhp+BVzdyBC7ZqTw/tSHH4Pe/2Kcfm8TTU98ActzPfFdOY2qCOpG7Z1iRC9+2UMH2JDpeRWPI + ZSWJHFHOdPqMirYnReYHaxR5c1sDFx6SSh3Ihdb6z8gGc0/xBNUz8AMH3uu4Z+WTY39TXcjxeXlFSzEV + bE+i41U0hlxWksix4zH7qWB70gSbj7UCOVbTVMk9X1cH8jlun3OZJeydwxMUfwD5Y9CerPrkZHUhx5LO + R1PB9iQ6XkVjyGUljTy5NJa8uucJKtqeFJTtqRXIhTLKk2ATvgu62Mhnu40mK/2m5oM99XyIBn7QkPaO + dmvPLNvb6kJ+IseJQ0ZDq2wPw1UmhlxW0sjrW2vIp6avUcH2pC8s+nMItQW5kGearVqQC5nG717EUxRv + +LX5/vS6hLPqQo5fr2mroKJVNjpeRWPIZSWNHNsVsooKtqf5pjmKixxAK4scq2+uIdtClqgFObb8xORi + MPg0T1KcgR+Az80tPTNtflQHciyxPJKKVtnoeBWNIZcVDXlSSXSP9iuX1admr5PmCw1ah1wovTwRnqtP + EB35LNdRXGZxu8R7rg7I8X3zbflNGbHqQg7/oZBLAIoGV5noeBWNIZcVDTku+KPN36aC7WluyZZai1zI + IcFYLchnun5GVp+Yjvus/4GnqdqBK+4HHT+R53RVHchtkg+T4sZ8KlxlouNVNIZcVjTkmFHENirWnvbJ + 0f+QxrZ6KnCMDhyTAk0LQKsCeXNrA6lsKAOA00RHzverfbrp5zxN1Q4gX11xqThEXciD8z2pcJWJjlfR + GHJZ0YBjmRUp5LW9T1LB9jSLmANU4BgdOCYFmhaAVhVyDD8Lj+8KqAE51/qTc0LB5OM8T9UMXOHzuDYP + LvRqUgdy/LXuQhUVr6LR8SoaQy4rGnCsBTatv7b5mIq1p+FBIqubKnQCOdbQWku2BS8VHflMl5Hw96Pu + nszzeJ8nqpoB5LOu3Lropg7kWGxpGBWvotHxKhpDLisacCE8BjsNa2/aH7ZeZ5ALJRVHi45caHvoMtyz + TTUnfoAr+iNkHF8RnqsO5Pi9eBJEGmBFouNVNIZcVjTcQudqc8hb+/9ExdrT3tj3B1JWV6RTyJta67mO + RGwVHTkG/6E0gc2/81R7N3BFQzs6O8w9Mq1/FBu5ddIhknI+hgpYkeh4FU3/kFNB0wKs8qLhlmyxxwQq + 1t70jf8CnUSOZVecJfP5tbpYyGe4jOA6FrdzPk+1dwPQNxe35oarA7kTXB8eMYaG+FHR8SoaQy4rGmzJ + IvJPUqH2plf3PAZYUnUSuZBJ9E7RkU93/hR3dokBo0/yXHs2cAUvQGZBBR6NYiPH8EiuNMSPio5X0Rhy + WdFgS4aHhVL1e+YYbiHoMnIstzKdW6OLiRyDr91Nqgj/H0+2ZwPIp1+7/a0jPDf/VWzkzqlm5NLVNipk + edHxKhpDLisabOlszxhRofa2pOIonUYuZBq9W1TkQrtOLTfiySo/gBwP4XwouSomTWzk3Nq8Qvm1OR2v + ojHksqKhlu58Ywl51/BvVKi9CQ8BrQ/IsbyqjPub7mIhn+Y8nCzyHF8GVp/h6So38I14DjVTnxz762Ij + x+9X9oASdLyKxpDLioaa1jcBC6lQe5t/uqteIBc6ErFFVORTnYaRqc7DfrVJPTqKp6vcAPI5LdfrvcRG + jp0pPU3FLCs6XkVjyGVFA00rrSyevLrncSrU3jTU5CUOGB04JgWaFoDWFuRYckmMuMj5NgbNcwKzyr2n + Dt/wBHQ4viI8R2zkWNOlOipoWnS8isaQy4oGmtrFZjLZbggVam+zTzABrDTgmBRoWgBam5ALbQ1aLCpy + DJ4e1IFZ5c6vDt/wLmTqlWX7vZjIrZIMSdi5E1TQtOh4FY0hlxUVNC1AHpjpRkXa29479DdS21wFYPUL + eWNLHYnIOykq8ilOQ7nM4w+M4QkrNoB8XuPVGm+xkWMVLSVU1NLR8SoaQy4rKmhagBxBfXa8HxVqb9sX + th6uX/+QY/UtNWSl71RRkU92HELWB852BbuKbb7DBfEoMoZxFadyxEbumWlLRS0dHa+iMeSyooKmBcgx + 3C+chrS34XHlimrzAK3+IRdySTbvMXIE/ijkGFw/fiT2zzxl+QMXfA065pVte11M5JaJB0lGVSIVtmR0 + vIrGkMuKCpoWj7yxtZYMNP4vFWpvW+k9FdDqL3KssDoHNt2loKsQuZB53N7hPGX5A8jHfXvzkqPYyPHv + H7XzCh2vojHksqKCpsUjx3C/cBpSVYR7fOkzcqE9YWtERT7JcTBZ6zfDhKcsfwD6poy6xDNiIsdC8n2o + uDE6XGViyGVFBU1LAnlNUwV5//A/qEh7m4HdYICr/8ix4GxvUZFj873GZYLhJ3jO9IELPAOZBJ/zrBUT + OZZfm8mQU9Mu5Njh05upSFWRX7or4NV/5FhlQyn3nrpYyCc5DMI/t2e3Jcs/1TIg//jnjp/NXNLNfhYT + uW2yEXUvNTpcZdJl5A8Dx6igaQFQeVFB05JCXl5fRN468DQVaW/75OjzpAnQ9QXkQgdObRQNudCW4MWL + edL0AegzKi6V+ouJHAsteHiznQ5XmRhyWVFB05JCju0IWkFFqopMIncB4L6DHAvN8RUVObbUZ6IvT5o+ + AH1bYmVkqpjILRIPkJzaNIZcB5CXwdpcVac6lg6PIFNaV0RHLR2A1gfk2Pn6Eu55uljIDRwGklmuo3En + F/ppluEvnoaMA/Pd6sVEjr+2XGpkyLm0Fzm2N3QNFakqWuU9jY5aOgCtL8iFtp5cLBpyvnuZrQn/4Wl3 + H0D+Tmdnp4lTutkdsZBj3ll2DLkOIK9sLBXtuTkWXxRBhy0ZgNY35JhrsoVoyCfaf8K1OWjRTJ529wHo + XzV/V+8qJnIsviycIQeotKigaQFQeVFB06IAFzp0+hsqUFU0znoAHbZkAFr/kNdynS09IypybLm3gRVP + u/sA9NWZ9YkxYiI3T9hPzjcVS4HtSQy5rKigaVFwC+H75u8c/AsVqSpySTKn4xYC0PqKHMMTM+JJHsRC + js1z/yIdTD/G8+4a+MLvIMOIEv9CMZHbJB3mwNHxKhpDLisqaFoU3JIZR+ykAlVFuJdaQ2sNHTgGoPUZ + OdbQXMttMYmF/Gv7j8lkhyFXwXT3z73DF56FjvrmOraKhRzzy3aWQqtsDLmsqKBpUWBLVttSRd4T6VNw + 2L7QtXTgGIDuC8gx71QH0ZBjE+w+Ij4Z9m/yxLsGkPdH6I6px9rFQn48YR/3/JwOWJEYcllRQdOiwJas + FTIX8TPteBjngqrMPo8cSytNEBU5tjFofvcX5AD551dvX7YVEzlW3JAvhVfRGHJZUUHTkkItHSLHs5bi + 2UtpSFXRPNcxDDlfXVM1me06WjTk2DJfgyM88a4B6PPOtWQHi4ncPHE/abvcLAVYkRhyWVFB05JCLR0i + x9ySrahAVdXJTA+GXKLtwctFQ44t8BgbyhPvGoC+NbEyMkks5Jh7upUUYEViyGVFBU1LAjQtATn2ucU7 + VKCq6GOj/yONrXUMuUQOicdEQ/6V7YdkusuIYrDd9Qk5+A0eUebw6RK/cz1BLglcFnIsrMBXCvGjYshl + RQVNi8csK0nkYpxaSbKuQ0Ux5JKdyvUXDTlmYD/wCtjuOt47/Obv0JETec71YiE/Hr+XJJ+PkYIsL4Zc + VlTQtHjMspJEjuHzZxpQVfTy7t+R3Mo0hlyq3PNpoiEfbzsAfh3QWdKW3bXLKiDHQ0cdccuwvCYWcqyw + PlcKs6x0ADkVOKabyDPPJ3MYaUhV0VSHYQw5pbrGam7nFjGQCxnHbh8mQP8YodumGHWIhdwsfg9pulgv + BZoWQy4rKmhaAFde0six9SfmUIGqKvcUG4ZcRuv9ZouGHFsfMKfrtMqAfMy1W99aioncBp4S0GFLxpDL + igqaFqCVFw057oqKu4zSgKoi3DGmrqWKIZfR0cgdoiEfZ/MBWeI98YAAfUb1lXIPsZBj3ln2UqilY8hl + RQVNC9DKi4YcOxK+lQpUVa32mc6Qy8ktxVI05NhCr/GuAvRluY2pIWIhx/CIMnTgGEMuKypoWgBWXjTg + GH5ABt/2ogFVVaHZvgy5jHDnljC4f8RCPtbmfTLb/fNoMP47hL4hoSoyXizkWFzpKSncDDkNtmRU0LQA + rLxowLtqIn7pzlScqurDI//iUDHkD4fIsZTiONGQY9Mch50D408i9B3hxQHZYiE3PbObpFcmSAFnyOVF + BU0LwMqLDhxr4sJXw2lAVdWOwGUAlSGXTkCOFdfki4Ycm+gwEM/e8keEfjD4nFexWMixvNp0hlwIgMqL + CpoWgJUXHTjWhRzfUntp92+pQFVVfFEkYGXIJZNEjtU2VoqGHPvKdsD3YPxphH7IL9e5ShK4KpEfO7OL + lHTbmYUhlxUVNC0AKy86cKwLObb15BIqTlU1zPRVwMqQSyaNvL6pqxkuI0VBPtb6Pfj6e50//PDDXxG6 + oWemdYtYyLGqlnKGHIDKiwqaFoCVFx049gB5bUsl+d+BZ6hAVdX+0A0AliEXkoUcW+I1QRTk2JfW7xKb + hCNvcJvuzmlm18RCjnV9WIYhlxUVNC0AKy86cOwBcswh4RgVpypLLIoCtAw5Jg85ts5vlmjIsW3BS4dw + 0O1Sjv4oFnLs0rdtDLmMqKBpAVh50YFj3ZG3XmgiX1j0p+JUVYOOvgBoGXLsUcixHUHLREOOrTwxdQIH + 3TblyF2xkJvE7WTIZUQFTQvAyosOHHsYeVJxFBWnKtvOvdouhfhRAei+iBzbEbxCNOTYUm8DAw66ddKh + e2Ihx79nyB+OCpoWgJUXHTj2MHLsG/8FVJyqLCo/mI5ZVgC6ryLHDp7aIBryMVb9yXzv8fMQ+gGxkGP4 + vQx596igaQFYedGBY3Tkdc1Voh7GGfvg8D+5A0xQQdMC0H0ZObZfCroqkWNz3ccs6AZd1ciNY3cQ8/j9 + DLlEVNC0AKy86MAxOnLMI8WailOVrfebQwdNC0D3deTY0YjtoiH/wuodMt9zzKrf3P751lGxkGM2SUc0 + hpwKHKMCx/QXOTbZfigVpyoLyfaho5YOQDPkXZlE7RQNOTbXZfT639y6e8NYLOT3oVNhS8aQ3w/AyosO + HONxy0CeV5ku+ifh8GlBQ0sNHbZkAJohf5AJQBcLOTbb7bN1v+no/NlQLOSYZcJBHrOsGPL7AVh50YFj + PG4KcCE8ZhsNpypb4TWFDlsyAM2Qd884aofKkEsCxz63/F8XdHiOvl8s5Edjt3PXQweOMeT3A7DyogPH + APIjkDcBMLF3R8VOpDnRcQsBaIZcumpy4PRG0ZBjwotx+2CN3ikGcsz0zB4eNUMuMwArLzpwDCA/AnkL + dDrXnwpTlfXb/xR3ckYqcAxAM+TSVXPh1pZYyLtBt0wyvCsGcqOYbVwMuZwArLzowDGArAByDI/yQsOp + yha4jaMDxwA0Qy5dF3I8Y8vO4JWiIcfmu385+QF0kZA/DJ0hvx+AlRcdOAaQFURe11LNHbeNhlOVuSVb + MuQK9wA5ti1oqWjIR1u+TRZ4jZ/IQbdNMfpeLORYy6VGhlw6ACsvOnAMICuIHPM8a0eFqcpe3fMEqWgo + YcgVqjtybKP/XKWQI3BFkWOr/KeOQOh7ndLMLoiF/EjMVlLTWsGQSwZg5UUHjgFkJZBjc12+oOJUZdMc + PmXIFeph5NhizwmiIR9l8RYxjFr/FgfdPcOqVizkWGnDOYZcCMDKiw4cA8hKIi+tKyKv7HmcilOV4amW + GfJHRUeOzXAeKRpyLLYo+J8IfbdvrmOJWMiPRG8h+bUZvUT+ALg08vLGYpJblU6Sy2JJXNEpklAUQdLL + E0l+dRapaionTRfqqcAxKmhaAFReVNC0AKy86MAxgKwkcswq7jAVpqrLOn+WIZebbOTYV/D8XCzk8Ps7 + YPxPCH1TUL5HtljIMTw4pBjIo88Fk7cVeKHp/UP/IOOs3ieLPSaQ3SGriV38Ue4Ed2UNRXTYkgFQeVFB + 0wKw8qIDxwByD5BjX9t+TL0/VNkQkxcZcrnJR15WWygacgy+vw2M/wGhrwov8U8SCzl2pvQ0HThGxS0k + G7kQrs0/N+/56X4/OPJPMttlNDkasYNEF4aSxgt1WoIcEPcCeVFtrqjnUxPaErCIIZeZfOR47rXMshTR + kGNwveVg/AmEPj+pKipULORYSL63KMi54Pk3bp5v9JtHXRCV7fW9vyczHEcQi9gD8J9IGhU4RgVNC9DK + SwzkeJ4zq1hD6r9P1YVkezPk1B6NHIvMPSka8s8s+uEhqpLA+G8RukFBc5aHWMgPR28mnhm2oiGXzDPV + lry1/0/UBbKnjTJ/ixyL2kUKa3J0BjlmYDeY+u9RZW/u+yMstFUM+UMphhzzTLETDTk22XGwt3BKppGN + 39WZi4Ucs048JDpyofTyBPKJ0X+oC2Zvws3gyfZDiH+mK2kGSFTYkgFaeYmJvKQ2n7yy5zHqv0OVzXIa + pTLkdLjKpHvIMbPovaIh/8z8TTLVeegRAfoHP3fc3Wcav+tXMZAfivqG+7XtUrPoyIVX00vrCsgXFj1/ + 3v6oBhm/QI7H7Cf1rTUPA9cwcszmzBHq7VZ11rGHASlD/iDlkGObAxaKhhyb6TpyhQD9ZWiXZZLhDTGQ + C5U1FvKYZaUa5EJ1rVVklvNo6gKqqgYceY7YnjHiXiPQFuSY2KdaEsqryACoDHlXyiOva6wi050+FQ05 + tsJn0hcC9L8hdMfUY01iIcdSz5/hQdNSLXKhFkDzTYD4B0Mccuwl7sgqNNiSqQN5aV0heVUNm+0jzd4A + qAx5Vz1DXlSVJypyzCrO8GUB+mPQDu9suyKxkBtGbSJh+b48avUgl3wvHN86oy2sqm6512RSVl+kMeSY + Q4IJ9bapuu0nlwNWhrynyLHovBBRkcPXboHtP3HQceAPq0IKvZPEQo65plrwsNWLXMg89oDoh1LC3j/0 + d+6c4JpAjs10HEm9XaruVI4/gGXIe4occ020EA35SPM3yBjr/lVg+wmeOQd9SmJlZJBYyA9GbuSuD9Fq + ArmQXYKxWrDjK95G4du7sKoR+fmGYrV8tv3tA3/mYNAQPyo6XGXSD+TYnpA1oiHHxlp/EMsT7xqAPrzi + UomNWMiFyhuLNIZcyDXFUi1vPWF4MAbcH1wdyDHHRDPq7VB181y/pCJ+VHS4yqQ/yLFZLqNFQz7i+Otk + gv1H5jzxrgHo/X7uuLsHoHeKhfxA5AaSWBalUeRcl1qIV6odeWWv+Gs+7GvbT0hFY6noyLHZIr/LIGR/ + xpgKWV50uMqkX8jzKzJFRY5NdRq6mCfeNQD979B266RDV8RCjp3IctI4ciEOu5rW7J8d70cKa3NERV4J + /5m8tvdJ6s9XdflVWVTMsqLDVSb9Qo4FZriLihxb5mMwgCfeNYD8t9A37hmWJb1FLglcEvn+iPXk+Jl9 + WoFcyCnJTC3P2bFPjj5PMs8niYIc8061p/5cVTfC9HUqZlnR4SqT/iGvhYwitomKHP58p/RK6YNX3IUB + 6HPDinzjxEIuVNtaQQeOUYFjqkcuZBl7kLpAi9G7hn8jcYWnVY4cW+U9jfozVd0m/wVU0LTocJVJP5Fj + izwniIYcG2P1TgmY/h3P+8HAFz/LbUxzERM5llQWrTXIMfw0m1H4NupCLUZ4WOTwvACVIsfPmw84/Bz1 + 56k6/3RXKmrp6HCVSX+RF1Rk41tfoiH/9PhruEecB0+7+wD0N27fvbEXoHeKhXxfxDrikW6jVciF8K0O + 2oItRm/s+wMJzvZWCfKWtkaSWBRJ/TmqDl/TwINA0mBLRoerTPqLHPNJdRAVOTbB7uNlPO3uA9CfgrZa + Jx9qEws5dgiuB5FpE3KhTWr4uKwQHjnVD9aOvUWOHTq9mfozVN0E64+osCWjw1Um/UaObQ9aLiry4Wav + khU+U97kaT88AH2ZT45DxqOQI/CeIN8XvparoDZL65BjuPvpXJcx1IVcjPDDLXg45t4gb4bGWX1AvX5V + dyBsIxW3EB2uMuk/8pr6CjLRbqCoyOFyePiox3nWDw/85dikysgTYiLHwvJPAFwacEwzyIXqWqvJeOsB + 1AVdjHBz2D3FCvD2DHlJTYFaDhmFReQFUoFjdLjKpP/IsdiCMFGRY1/avHuKJ00fgN7/8s02Q6OYLb+K + hRzDw1ZpI3Ih3DFlqMnL1IVdjBC7F7dmlwJNSwI55pxoTr1OVdfvwJ8ATjVD3gvkmHH4DlGRY1/ZfbiZ + J00fgP40tMUi8cAFsZDvDV/DVVyfD4i1D7mwI0pOZSrBHVRoC70Y4a6lJ9Kd6LiFpJBjSz0NqNen6mY5 + je67yKnAMeWQ1zRUkGlOw0VFji31MOjHk5Y9AH2+f75LkpjIsdA8H4CsnciFzhSe5l40oy34YoQ/KyDD + TWHkDQClv+Ffqdel6o5H72PIu6Uccgw328VGPsq8XzUYfoznLHvgQsMLmjNtxUSOmcTu5JDSgGMPYZYV + AJUXFTQtKeRCHinW1AVfrBA7nub4UcixqPxg6nWIUUpJHEN+P+WRY4dPbxEV+TDTV+D5+XuOPGX5A9Cf + 7+ho32oUs+2uWMj3nF7NlVeTrtXIMdwZZU+o+t5jx/BDNbGFp+Qix2OpH1LT22ofHnmOIb9fz5BX1JWR + ifYDRUWOGTgONuApyx+A/jtojWOqabGYyHefXkU88cMzAFabkWP4irg633bD8PUBXIvKQo5NtB1I/V5V + t9xzMkPO1TPktQ1VxD/NRXTkw0xfve2Xa/sMT/nRA9DHJ1VFeomJHNsLl8EjqWozcqHalioy+vhbVAhi + 9bHR/5H8qmwq8uqm82rbW80lyZwhB7C0qLAlA+TYap8ZoiIfavoyfnY+jCes2AD0139sv7XtUNTmn8VC + LhRVGKz1yIXO1eSQ9w8/S8UgVqOO9yMVDaXdkGPBWV7Uy4tRAfxnQ4erTH0XeVppQrfn5mIgxyY6DJzD + E1ZsADoeMHK1Y+qxIjGR7zq1khyJ3kpaLzXRUUsHQOVFBU0L0MqKBryrJq7I/CDuE200EGI13XEEaQAc + ktB3Ba2kXlbVfWr6Gg+1N/Vd5NiB0A2iIx9m9upNpTbbhQHoY5MqozzERI7tDFvB7dFGhS0ZAJUXFTQt + QCsrOnCsC7mQRcwBKgoxw3PLSUIfY9GfejlVt8FvLo+1p/Vt5AWV2dyRXsVEjo2x6h/E01VuAPqrd9p/ + 3HIo6pt2MZFj5mf203ELAVB5UUHTArSyogPHuiMXdi1d4TWFCkPMjoZv55CX1xep7WOvHsk2PNie1LeR + Y3hGH7GRY187DJrO01Vu+M33Vc5pZrliIhfKqjyrM8ix2uZK8rmIp32ihUfDwf3B8TBEtL9Xdfjziqpz + ebTKxpCfryshBvafiI4c/u6qb6nvw0eTUXQA+qic+hQbsZHvCFtO7JKO6gxyofzKDPLeob9RkYgVHmp5 + kftX1L9TdSPM3uDRKhtDjjkmmIqOHM8SNMb6PSeebM8GoD/XSTo3GMVu+05M5Nj20GUkrzpdZ5Bj+P56 + ULa32o47p+42+s3n4SoTQ46V1xYTA7tBoiPHZjiPHMKT7fkA9tn+ec5RYiPHrBMO6RRyoX1h66lQdD3c + o46OWVYMuZBd/FG1IIfrKsKn2TzXng9cSf/W7xv37g9f1ykmcqGsyhQqbiEqaFqAVlZ04BggVhI51tha + TybZDaFi0dVwK6W4Op8HrEgMuVBpTSH52u5j0ZEPPvYiGWf9vvxdUhUdgP4ktNIq6VCZ2Mi3hS4l5vH7 + Oag9Rg5g5UUHjgHiHiAXKq7NIx8c/icVjS6Gx6Kng6alPcipwDEqcEy1yGsbKolVzCG1IB9m+tKPu2M3 + /JOn2vsB6KOTq6MdxUbOFbKEnC2L0ynkwl5m4fmB3EEkaHB0rW/8F/KIHxVD/qBKcq4yG9eyoiPHRlm+ + 5c8TVc0A9Gfvdd5bfyh683diI8cORW3mjt+mS8iFjpzeQoWja+GRSumwJWPIH1TJtS90nVqQYwYOg0bx + RFU3gH1iYL5bmNjIhcLyfHUOOdbYWkcM1LRXmVjhh3FKas7xmGXFkD+oC3lSUXTXh2PUgPzT46+fA5MP + n6ChtwNX+sJ3d65t2R+xvl1s5FtDFpNdYStJVXM5HbZkAFZedOAYIFYxcqH8qgzyzsG/UBHpQp+b/4/H + LCuG/EFdyLHlXlPUghz7wubduTxN1Q9gn+2WYZEkNnJsS/Ai4p5qRcctBGDlRQeOAWKRkAup61xoYrQt + cCkPmpY2IJfzyjpGBY6JhzwgzU1tyOGyTS7nXJ7gWap+APqbjVdr9uw5tbpTbORc8PvsyrM6h5yrrZHb + B5kGSdvzTXXiUTPkdODYA+R4yO3JDoPVgnywyQv49GALT1KcwecE0DybpMP5oiPnw+PWNbXV6xxyrLLx + PBl27BUqJm2Ne/8cFlyGHKICxx4gx/aHbhAfOQDnMn3x2ga/ecrvjqrsAPS3Ky4WH4TN906xkW8OXsjl + n+Wic8iFI8LEF0Wq9UiyvW2k2Zs8bIacXnfk0Xmh3Cfg1IF8kMl/YW3ebz9PUdzh1+pzbFKO5KgD+TdB + C8jmkIUktyqNClsyOnAMEGsAuZBx5E4qKm3s4f3PGfIHdUdeVlNIpjuNUBty+LsralmbCwPQ36y+Ur53 + V9jKTrGQI3DJ9odv4I4vRwOO0YFjgFiDyHH/cXzLbYr9UCosbcstyYoHzpB3rztyDI/yoy7k3NrcvN8O + nqB6BqD/Fpppm2KUoQ7km4LmczmlmOkccqFz1dnkXTWdbKE35VVmMuQP9TByPC6AOpHD31/Y5rug5/uc + 93QA+qt1V6t27T616p46kG88OY8rruiUziEXwk+b0XBpS4ONX2DIH+ph5JmlKWSc9QdqQ46NtnxrPU9P + /QPYDVwzLaPVhRzDt9zO1WTpHHIhdZ0rrSet9JrKkHfrYeTna4vJPNcxakU+1PSlclHfN3/UAPRnb7Z/ + v25f+Nrv1YEc23ByLtl3eh2paa7kUesOcqysrpAMOPwcFZqmsztzlCG/38PIse1By9SKHBtn9/5Ynpzm + BrCPCC3y8egJcgSuLHKuwDnEMv4gB06XkAup65hvyobHH2fIMTpyx3hTtSMfZvZKJBj7Lc9NcwM34qlf + fvll0ZHoLY3qQi50IsOJB647yIVWe0+nYtNU7x96liHnoiOPyDlJRlu8rVbkA03+2z7FdeCbPDXND2B/ + P7cx9TCs0TvVhRxbHzibRBSc1Dnkza0N5Hx9Cfn46H+o6DTRAtdxDDkFOJZRlsy9+KZW5MbP46ftTHhi + 2jEAHT9EM8X+rPEZdSLHNgTOJRnnk3QDOQDHmvhCsny05sCSZlF7qYAVSZ+RF1bmkBlOI1SCvBvwRyCH + y1cZRq18iiemPQPQn7vx0/er9p5ee1VdyNcFzOLaDNddWJNDBY7RgWNSmGUFoFWNXAjPwEKDp+6i80Op + iB+VPiPHI7ku8ZigduSDTJ7/ZaLdh6N5Wto3gH1wQkWE+dbQxb+qC7kQfminoqFEp5DjGUorG8rIJ0bP + U/Gpqzf3/ZGDQIMsL31GXl13nmyC/4TVjRz71Ow1N7Ck+RfgZA3cuCegGRaJBzLUiXxtwEyuvafWkurG + cp1BLqTpV+En2g6iQpaXPiOvqa8gu4NXaQT5IJMXLiwLnvF3npT2DkD/7+WbF9fuOrXye3UiX+M/g+tA + +EZS01wBUGnAMSnMsgLQ6kAupMkP0uwJXk3FLCt9R254apNGkH9i8p9fJ9gNMOApaf8A9qFxZaEWm0MW + /qpO5EKHo7aQuuYqAKsbyLHimjyNfRY+MN2dCpqWXiOHjCN29Ao5Au8RcuP/kE/NX/PS6k126YEb+zg0 + 2SLxQIq6ka/2m85lHL2D1LVIYpfCLCsArW7kQk6JZlSIYtZ1IMgCKmrp9B358eh9GkMOm+wNc/0n/I0n + pDsD0J+9dfeHJbtPrbqkbuRChyM285vxUphlBaA1hRzDHUqmOgynghQrPJEiDbV0eo0cNtc1uSaHOsbb + DhjJ09G9Aez9s+tT9sPme4e6ka/ym8a1//R6UtVYRoctGYDWJHKhzPIU7lVwGkoxWuc7mwpbMn1HfiBs + gyaRw897w4gno5uDzzegL13SzU9qAvnKE1O5doetIiW1BXTgGIDWBuRCtmeMuANVqCO/NBcqbiF9Rl5R + W8od8VaTyIeavpRtGGz4JE9Gdweg//EX8sv0g1EbyzWBXOibkwtIdsVZrUeOPTjCS097sAca+1grHXlR + VR5Z5jVJo8jha99/7fzBGzwV3R/A/s+m7+tXbQ9del0TyFecmMK1Bi5zpug0Q65A+ow8vTSJzHQeqVHk + A03+88vn5m9P5onozwD2t9JrE/ZvCprXoQnkK3wndwW/90yz41Ax5PT0GXlwpnevd1DpLXLsU7PXjvI0 + 9G8A+1DfHAdXjSHnW+47iRhFbiOVjWUAliGXTF+RV9ef53bcweOvaxr5kGMvnjE0NFT9edO0ZQA6vr8+ + 3iRu51lNIseW+RiQzUGLSE5FGsBlyDF9RY7Px9f6zer1QSNUgRy+3jDFfuA/eBL6OwD9qTs/3562L2Ld + eU0iF8LLn8z26MJLQy0dXq4bboZcm5HH5IeSKQ5DlUYuCVyFyK9/bvvO/3gK+j+A/a+Xbl5YsD1sWasm + kWNLfSZy4aZ8eUMxHbcQgGbIpdNO5FXCpjp/FhVNI4c/3x1l+ZbufiimpwPY/1V5uXTNppPzb2oa+RLv + r7nWw23AV+X7LHIqZHlpJ3I8IswSzwkccG1AjjurDDv+yjJ+0e97A9hfT66O3rvh5Jx2TSPHFntP4LKO + P8x9mo4hl5f2IccX3JwTjpOx1u9rD3JoqMnLhvwi33cHsL8TVRZ0eF3g7HvagHyR11dc6/xnkehzIQw5 + Ne1Dfrb4DFnqObHHZzUVC/kQk5fsYBnXnT3SxBy4I94POed1DNboHdqAXGih13hiHLWDlNaeA6QMeVfa + hRw/xno8ej/53PJ/SiNH4KKuyY+95KHXb6P1ZAD7AL9cZ6u1/jM7tQU5l+c4stxnEvHLcCYNLTVUwIpE + h6tMDPmDupCHZfuTWc6fccC1DrnpiycZchkD2D9xz7J2WO0//VdtQS7ZpsD5JPZcGBWyvOhwlYkhf1Al + SS1JIOtPzLoPXNuQDzZ5MXKly0rNnUJJ2wefy0CDvLLsbGHzvVObkC/wHMs13+NLsu/UepJWFk9FLR0d + rjIx5EL5FZnk4KmN3IkUtBX5ENOXQvRibzSxh8f+UUCei9ka/+kd2oZcMsOIb0hmeTIVOEaHq0wMOXau + KoccCd9Kxlj17wZc25APM33Z2/Cs4eP8osxGkQHs7wcXeBrBZvzPvUEuCVyVyOd5jOGa6/4F2Q9r+Pii + CA4nQ46pBnlGaRI5ELaxC7hFP61GPvz4qw7BwcGP8YsvG2UGsL8TURK4Hzbj72grcsk2n1xIQnN8AEEV + j7Wn9W3ksQWhZHPAgq5X0hG4liP/1Pw1U9wS5RdbNj0ZuAPfTKmJ2bLWf+YP2ox8jtvnXLPdRnO3zSX5 + OLfJSYcsr76JvKy6kHgk25BF7hPIKIu3uLQdOe5TPsLijW0MuYoG7sj/FjRlrNwQOOeStiOXbm/YWhKe + F0BqFVrL9x55N+A6gDz+XDjZF7qOjLf54D5wnUBu/Pzd0VZvL+AXUTaqGsD+j/qrNbO2BC+q1AXks1xH + cc10/YxridcEYhF3kCQWR3Gg+jJyfO5tHXuYzHMbQ0Zbvt0NuC4gh69f/9LqHe09N5quD2B/+uZP34/f + E746XRq4NiO/n8tIrqXeE4lV3CGSXBLDgewLyLPKUoltnBFZ5PEV99wbgasKuSRw8ZG/0DDefEDf2dVU + UwPYf9/R0TH8aOy2EF1ELjTDZQTXIs+vyNHI7SQsx5eU1RZRET8qbUReUVdGInJPEpPInWQurLkRt5Cu + IofL5RpYD/oXvyiyEXsAO56Pvb9rusVx2IS/q6vIpzt/2j342vqAOcQ89iAJzTlBCqtzqbAl0xbkZTWF + JDw3kFjGGpI1J2aSr2w+JF9YvdMNuC4jH272ssdir8/+wC+CbNQ5gP35xMqINWv8Z1zUdeTTnIdzTXUa + 1q0FcBu3By2HTX1DEpjpTtJKE0h1Q4XGkOOpi7LKz5KgLC/u6Qfetrlwf3xp/R4HWzL9QP58+6fmb6zm + Fzk2mhrA/ue6a1UTtwYvztc35FOchnJNdhxyv0mOg7lfF3iMJZsCFpBD4ZuJfbwxCUh3JVH5ISSlOI4U + VGaSivpSKdTSPYy8qr6cnKvMIanwn0lsQRg5meFOHBKOkcOnt5CN/vPIfLcvyXibAYD63fvhh1kwfUQ+ + 0OS/LV9YvD2YX9TYaHoA+xP37t370CRul/cSnwkd+oycy2FQtwwcBnJNtP+kW/g9M5xHklkun5GFHnAf + QCt8ppCVPtPgP4rxZIH7ODLbZRSZ5jScTHEYQsbZfMA11ub97sHaGpMErm7kCFydyAeZvBjzuXV/9nxc + Gwc35cOLA9et8pvW1teRf23/MdcEu4+69ZXth1zjbQd0iyHvQg6//jT8+GsbYVliH4LR5oEH6KkLPzSP + 2hW2Mo4hZ8iVQQ5/LvnM5u3+/KLERtsH/zeGXnfLsjq41NfgOkPOkMtH/vy9oWavmG+wHf97fhFio0sD + 2P9c+235mJ2nVsQu8Br7K0POkEsjH3LsxcIxlv0/5hcZNro6/Nr9pRN5zluW+05qY8gZcgQOv/4I17mL + 7T+uZwPY/3jxu+ahByI2+MFmfDtD3neRDzV7OUavTlfM5uEB8M+l1cZN3Ry0IGWuxxe/MuR9B/lQ05fK + x1m8+xVu5fGLAxt9Hnig8SO0Lwfmuq1b4TO5VlPIJYEz5OIhH2L64nejLPptdDnnwg7Y2BcHsP/+9s+3 + +1skGhot9p5wkSHXL+Tw+x/htlgs9Pn8H/xDzqYvD4B/+tqNSx8ax2yzWeA59jpDLh5ySeDiIX/h5xEW + b7rPdR/9Ev8Qs2HzYAD8n1uvN3xiGLXJcZ7HmB8Ycl1D/sK9T81f953mNYK90Mbm0QPgn6m8Ujp4b/ha + V3j+fpMh127kQ4690DHc9LWgGc6fsgNCsFF+APyfKi6WDDCM2mi9wPPLCz1BjsAZcnGQDzn24u2RZm+4 + THEd+Cb/kLFh0/MB8E/ebL/5unnC3j2LvCeUM+SaRQ6XuzLS/M1DC3y/fI5/iNiwUd0A+Megf9snGy9Y + FzArEtbudxjyh5EjcBGQd8J1pH5m+dYiw6iVT/EPCRs24g6Af7qwLfe9fRHrjBd4jqtgyMVBPtz0lctw + veYzHIf14+96NmzUPwAeP3zznHP68UmbgxZ6znYb3cyQ9w75cLNXvodN84Cxlu9OYicsZKN1A+CfgP5l + n2w0ZX3gHO9Zbp+1MuSKIR9+/NUf4GcFwe2d5hJlyDbN2ejGCOjdMq3HbAtZcny+59isKY5D7jLkPHKz + VzpHmfcrhdtkOcN52Bivs17sCKtsdHsAPO4q+0zVtZI3j8RsWbXaf7rfLNfPqgzsP+nsS8jh8m1jrd8N + nmD70Zp1YXNfgvvkd/xdxIaN/g0s4E9Cf4+vPNV/9+nVa9b6TfeY5TqqELC36xHyztGWb1XDbfGZaPfJ + 2nUB097Bfzd/F7Bh0/cGAODbds80XKp4cXfE2qlr/KcfXeQ94dQ05+HlsIb/SduRjzz++i+jLf9X96X1 + e1Fwu4wn2g+eefTMN//Gfxf/T2TDhg1tAAm+mv/UrVu3nj0WvXPoGv8ZK5d4f2UKz/UDZrqMTDNwHFj/ + le2AO+pD3q8Dvq91nM37OeNsPwgab/fhcQO7gavnuo8eEXzO5S8MNRs2Kh5A9Tj+JwD91f2s5es7Q1YM + XR8422Cp78TFizzHb1vg8aXJHNdRztOchvtPdx4RNNVp2KmpTkPPwBbCmUmOgzMnOgzMnuw4JNHAYWCc + gePgKPjaSQPHQYGTHAY5GzgMNoXL7pjlPHLJTPfRE5f6fD1ku//iN85WnH0afy5/E9jo1PzmN/8PpdCW + Fsflsc0AAAAASUVORK5CYII= + + + + + AAABAAEAEBAAAAEAIAAoBQAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAA + AACacADWmm8A7phsAOiabgDpnHEA6ZpuAOmZbQDpm3AA6ZtwAOmZbQDpmm4A6ZxxAOmabgDpmGwA6Jpv + AO6acADWm28A7qJ3AP+ogQ//pX0g/51xAP+kewD/qH8A/6B0AP+gdAD/qH8A/6R7AP+dcQD/o3oA/6h/ + AP+idwD/mm8A7phsAOipghL/x6UA/K2EAP2UZxP9upYA/cqnAP2fdwD9n3cA/cqnAP26lwD9k2UA/bWR + AP3KqgD8qIAA/5hsAOibcBLpoHIA/8qwcf3SwKD+kmEA/q6HFP62kQD+n3MA/p9zAP62kQD+rYYA/phq + AP6qgwD+tpIA/aR6AP+abgDpnXIP6ZlqAP+jglr9+vn6/7KXcf+RXwD/lmoX/5twAP+cchX/lWgH/5dr + BP+dcgD/mGwA/5NlAP2dcQD/nHAA6ZpuAOmogCf/rYIA/ePXwP/k39r/pHYA/7uYI/+geBv/mmwA/7eS + AP+vigX/mGwL/6yGAP+6lgD9pHsA/5puAOmZbQDpqoIN/8ilAP27m0H/9fT1/8yxb//FogD/mWoA/7SY + bP/StlT/uJMA/5NlAP+2kgr/yqgA/amAAP+ZbQDpm3AA6aB0AP+jfCX9kVoA/9jNwv/t597/jU0A/8Cr + k//5+PX/xrOX/+3o4P+jf0X/nHEA/6B4Cf2gdAD/m3AA6ZtwAOmgdAD/n3cM/ZtvAP+lgkr/7unj/8Wx + lP/5+PX/wq+X/4xNAP/t6eH/1sy+/5FZAP+heyP9n3QA/5twAOmZbQDpqYAB/8qnAP21kQv/k2UA/7mU + AP/Stlj/t5ty/5lpAP/EoAD/zLN0//X09f+6mTn/yKUA/amBCv+ZbQDpmm4A6aV8AP+7lwD9rIYA/5dr + DP+wigD/uJIA/5psAP+geBv/vJoh/6Z4AP/m4N3/4dW8/66DAP2ogCf/mW4A6ZxwAOmdcQD/k2UA/Zhs + AP+dcgD/l2sE/5VoCf+cchX/m3AA/5ZqGf+RXQD/tJp2//r5+v+hflP9mmsA/5xyD+mabgDppHoA/7WR + AP2pggD+mGsA/qyFAP60kAD+nnMA/p5zAP60jwD+rYYS/pNiAP7UxKb+ya9y/Z9xAP+bcBLpmGwA6KmB + Af/LqgD8tZEA/ZNlAP27lwD9yqgA/Z93AP2fdwD9yqgA/buXAP2UZxP9roQA/celAPypgQ//mGwA6Jpv + AO6jeAD/qYEB/6R6AP+dcQD/pXwA/6mBAf+gdAD/oHQA/6mBAf+lfAD/nXEA/6Z+H/+pgg//o3cA/5pv + AO6acADWmm8A7phsAOiabgDpnHEA6ZpuAOmZbQDpm3AA6ZtwAOmZbQDpmm4A6ZxxAOmabgDpmGwA6Jpv + AO6acADWAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA + AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA== + + + \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/BackwardCompatibility/MutateMessageContentTypeOfIncomingTransportMessages.cs b/src/NServiceBus.Core/Unicast/BackwardCompatibility/MutateMessageContentTypeOfIncomingTransportMessages.cs new file mode 100644 index 00000000000..249f6dcd4eb --- /dev/null +++ b/src/NServiceBus.Core/Unicast/BackwardCompatibility/MutateMessageContentTypeOfIncomingTransportMessages.cs @@ -0,0 +1,28 @@ +namespace NServiceBus.Unicast.BackwardCompatibility +{ + using MessageMutator; + using Serialization; + using Transport; + + public class MutateMessageContentTypeOfIncomingTransportMessages : IMutateIncomingTransportMessages, INeedInitialization + { + public IMessageSerializer Serializer { get; set; } + + /// + /// Ensure that the content type which is introduced in V4.0.0 and later versions is present in the header. + /// + /// Transport Message to mutate. + public void MutateIncoming(TransportMessage transportMessage) + { + if (!transportMessage.IsControlMessage() && !transportMessage.Headers.ContainsKey(Headers.ContentType)) + { + transportMessage.Headers[Headers.ContentType] = Serializer.ContentType; + } + } + + public void Init() + { + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/BackwardCompatibility/SetIsSagaMessageHeaderForV3XMessages.cs b/src/NServiceBus.Core/Unicast/BackwardCompatibility/SetIsSagaMessageHeaderForV3XMessages.cs new file mode 100644 index 00000000000..106d27aaf8a --- /dev/null +++ b/src/NServiceBus.Core/Unicast/BackwardCompatibility/SetIsSagaMessageHeaderForV3XMessages.cs @@ -0,0 +1,44 @@ +namespace NServiceBus.Unicast.BackwardCompatibility +{ + using System; + using MessageMutator; + using Timeout; + + public class SetIsSagaMessageHeaderForV3XMessages : IMutateIncomingMessages, INeedInitialization + { + public IBus Bus { get; set; } + + public object MutateIncoming(object message) + { + var version = Bus.GetMessageHeader(message, Headers.NServiceBusVersion); + + if (string.IsNullOrEmpty(version)) + return message; + + if (!version.StartsWith("3")) + return message; + + if (!string.IsNullOrEmpty(Bus.GetMessageHeader(message, Headers.IsSagaTimeoutMessage))) + return message; + + //make sure that this a timeout of any kind + if (string.IsNullOrEmpty(Bus.GetMessageHeader(message, TimeoutManagerHeaders.Expire))) + return message; + + //if the message has a target saga id on it this must be a saga timeout + if (string.IsNullOrEmpty(Bus.GetMessageHeader(message, Headers.SagaId))) + return message; + + // this is a little bit of a hack since we can change headers on applicative messages on the fly + // but this will work since saga timeouts will never be bundled with other messages + Bus.CurrentMessageContext.Headers[Headers.IsSagaTimeoutMessage] = Boolean.TrueString; + + return message; + } + + public void Init() + { + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/BuilderExtensions.cs b/src/NServiceBus.Core/Unicast/BuilderExtensions.cs new file mode 100644 index 00000000000..1d7c581e06a --- /dev/null +++ b/src/NServiceBus.Core/Unicast/BuilderExtensions.cs @@ -0,0 +1,25 @@ +namespace NServiceBus.Unicast +{ + using System; + using System.Linq; + using ObjectBuilder; + + /// + /// Extension methods for IBuilder + /// + public static class BuilderExtensions + { + /// + /// Applies the action on the instances of T + /// + /// + /// + /// + public static void ForEach(this IBuilder builder, Action action) + { + var objs = builder.BuildAll().ToList(); + + objs.ForEach(action); + } + } +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast/BusAsyncResult.cs b/src/NServiceBus.Core/Unicast/BusAsyncResult.cs similarity index 95% rename from src/unicast/NServiceBus.Unicast/BusAsyncResult.cs rename to src/NServiceBus.Core/Unicast/BusAsyncResult.cs index 67cab7f219e..5fa30a6c6d4 100644 --- a/src/unicast/NServiceBus.Unicast/BusAsyncResult.cs +++ b/src/NServiceBus.Core/Unicast/BusAsyncResult.cs @@ -1,9 +1,9 @@ -using System; -using System.Threading; -using Common.Logging; - namespace NServiceBus.Unicast { + using System; + using System.Threading; + using Logging; + /// /// Implementation of IAsyncResult returned when registering a callback. /// @@ -47,7 +47,7 @@ public void Complete(int errorCode, params object[] messages) } catch (Exception e) { - log.Error(this.callback, e); + log.Error(this.callback.ToString(), e); } this.sync.Set(); diff --git a/src/NServiceBus.Core/Unicast/Callback.cs b/src/NServiceBus.Core/Unicast/Callback.cs new file mode 100644 index 00000000000..a1a821b58c3 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Callback.cs @@ -0,0 +1,226 @@ +namespace NServiceBus.Unicast +{ + using System; + using System.Globalization; + using System.Linq; + using System.Threading; + using System.Threading.Tasks; + using System.Web; + using System.Web.UI; + + /// + /// Implementation of the ICallback interface for the unicast bus. + /// + public class Callback : ICallback + { + static readonly Type AsyncControllerType; + + private readonly string messageId; + + static Callback() + { + var assemblies = AppDomain.CurrentDomain.GetAssemblies(); + foreach (var assembly in assemblies.Where(assembly => assembly.GetName().Name == "System.Web.Mvc")) + { + AsyncControllerType = assembly.GetType("System.Web.Mvc.AsyncController", false); + } + + if (AsyncControllerType == null) + { + //We just initialize it to any type so we don't need to check for nulls. + AsyncControllerType = typeof(BusAsyncResultEventArgs); + } + } + + /// + /// Creates a new instance of the callback object storing the given message id. + /// + /// + public Callback(string messageId) + { + this.messageId = messageId; + } + + /// + /// Event raised when the Register method is called. + /// + public event EventHandler Registered; + + /// + /// Returns the message id this object was constructed with. + /// + public string MessageId + { + get { return messageId; } + } + + Task ICallback.Register() + { + var asyncResult = ((ICallback) this).Register(null, null); + var task = Task.Factory.FromAsync(asyncResult, x => + { + var cr = ((CompletionResult) x.AsyncState); + + return cr.ErrorCode; + }, TaskCreationOptions.None, TaskScheduler.Default); + + return task; + } + + Task ICallback.Register() + { + if (!typeof (T).IsEnum) + throw new InvalidOperationException( + "Register can only be used with enumerations, use Register() to return an integer instead"); + + var asyncResult = ((ICallback) this).Register(null, null); + var task = Task.Factory.FromAsync(asyncResult, x => + { + var cr = ((CompletionResult) x.AsyncState); + + return (T) Enum.Parse(typeof (T), cr.ErrorCode.ToString(CultureInfo.InvariantCulture)); + }, TaskCreationOptions.None, TaskScheduler.Default); + + return task; + } + + Task ICallback.Register(Func completion) + { + var asyncResult = ((ICallback) this).Register(null, null); + var task = Task.Factory.FromAsync(asyncResult, x => completion((CompletionResult) x.AsyncState), + TaskCreationOptions.None, TaskScheduler.Default); + + return task; + } + + Task ICallback.Register(Action completion) + { + var asyncResult = ((ICallback) this).Register(null, null); + var task = Task.Factory.FromAsync(asyncResult, x => completion((CompletionResult) x.AsyncState), + TaskCreationOptions.None, TaskScheduler.Default); + + return task; + } + + IAsyncResult ICallback.Register(AsyncCallback callback, object state) + { + var result = new BusAsyncResult(callback, state); + + if (Registered != null) + Registered(this, new BusAsyncResultEventArgs { Result = result, MessageId = messageId }); + + return result; + } + + void ICallback.Register(Action callback) + { + var page = callback.Target as Page; + if (page != null) + { + (this as ICallback).Register(callback, page); + return; + } + + if (AsyncControllerType.IsInstanceOfType(callback.Target)) + { + (this as ICallback).Register(callback, callback.Target); + return; + } + + var context = SynchronizationContext.Current; + (this as ICallback).Register(callback, context); + } + + void ICallback.Register(Action callback, object synchronizer) + { + if (!typeof(T).IsEnum && typeof(T) != typeof(int)) + throw new InvalidOperationException("Can only support registering callbacks for integer or enum types. The given type is: " + typeof(T).FullName); + + if (HttpContext.Current != null && synchronizer == null) + throw new ArgumentNullException("synchronizer", "NServiceBus has detected that you're running in a web context but have passed in a null synchronizer. Please pass in a reference to a System.Web.UI.Page or a System.Web.Mvc.AsyncController."); + + if (synchronizer == null) + { + (this as ICallback).Register(GetCallbackInvocationActionFrom(callback), null); + return; + } + + if (synchronizer is Page) + { + (synchronizer as Page).RegisterAsyncTask(new PageAsyncTask( + (sender, e, cb, extraData) => (this as ICallback).Register(cb, extraData), + new EndEventHandler(GetCallbackInvocationActionFrom(callback)), + null, + null + )); + return; + } + + if (AsyncControllerType.IsInstanceOfType(synchronizer)) + { + dynamic asyncController = synchronizer; + asyncController.AsyncManager.OutstandingOperations.Increment(); + + (this as ICallback).Register(GetMvcCallbackInvocationActionFrom(callback, asyncController.AsyncManager), null); + + return; + } + + var synchronizationContext = synchronizer as SynchronizationContext; + if (synchronizationContext != null) + { + (this as ICallback).Register( + ar => synchronizationContext.Post( + x => GetCallbackInvocationActionFrom(callback).Invoke(ar), null), + null + ); + } + } + + static AsyncCallback GetMvcCallbackInvocationActionFrom(Action callback, dynamic am) + { + return asyncResult => + { + HandleAsyncResult(callback, asyncResult); + am.OutstandingOperations.Decrement(); + }; + } + + static AsyncCallback GetCallbackInvocationActionFrom(Action callback) + { + return asyncResult => HandleAsyncResult(callback, asyncResult); + } + + static void HandleAsyncResult(Action callback, IAsyncResult asyncResult) + { + var cr = asyncResult.AsyncState as CompletionResult; + if (cr == null) return; + + var action = callback as Action; + if (action != null) + { + action.Invoke(cr.ErrorCode); + } + else + { + callback((T)Enum.ToObject(typeof(T), cr.ErrorCode)); + } + } + } + + /// + /// Argument passed in the Registered event of the Callback object. + /// + public class BusAsyncResultEventArgs : EventArgs + { + /// + /// Gets/sets the IAsyncResult. + /// + public BusAsyncResult Result { get; set; } + + /// + /// Gets/sets the message id. + /// + public string MessageId { get; set; } + } +} diff --git a/src/NServiceBus.Core/Unicast/Config/ConfigUnicastBus.cs b/src/NServiceBus.Core/Unicast/Config/ConfigUnicastBus.cs new file mode 100644 index 00000000000..535c28a98c6 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Config/ConfigUnicastBus.cs @@ -0,0 +1,441 @@ +namespace NServiceBus.Unicast.Config +{ + using System; + using System.Collections.Generic; + using System.Configuration; + using System.Linq; + using Features; + using Logging; + using Messages; + using NServiceBus.Config; + using ObjectBuilder; + using Settings; + using Routing; + using Utils; + + /// + /// Inherits NServiceBus.Configure providing UnicastBus specific configuration on top of it. + /// + public class ConfigUnicastBus : Configure + { + /// + /// Wrap the given configure object storing its builder and configurer. + /// + /// + public void Configure(Configure config) + { + Builder = config.Builder; + Configurer = config.Configurer; + busConfig = Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance) + .ConfigureProperty(p => p.MasterNodeAddress, config.GetMasterNodeAddress()); + + var knownMessages = TypesToScan + .Where(MessageConventionExtensions.IsMessageType) + .ToList(); + + ConfigureSubscriptionAuthorization(); + + RegisterMessageModules(); + + + RegisterMessageOwnersAndBusAddress(knownMessages); + + + ConfigureMessageRegistry(knownMessages); + } + + void ConfigureMessageRegistry(List knownMessages) + { + var messageRegistry = new MessageMetadataRegistry + { + DefaultToNonPersistentMessages = !SettingsHolder.Get("Endpoint.DurableMessages") + }; + + knownMessages.ForEach(messageRegistry.RegisterMessageType); + + Configurer.RegisterSingleton(messageRegistry); + + if(!Logger.IsInfoEnabled) + return; + + var messageDefinitions = messageRegistry.GetAllMessages().ToList(); + + Logger.InfoFormat("Number of messages found: {0}" , messageDefinitions.Count()); + + if (!Logger.IsDebugEnabled) + return; + + + Logger.DebugFormat("Message definitions: \n {0}",string.Concat(messageDefinitions.Select(md => md.ToString() + "\n"))); + } + + void RegisterMessageModules() + { + TypesToScan + .Where(t => typeof(IMessageModule).IsAssignableFrom(t) && !t.IsInterface) + .ToList() + .ForEach(type => Configurer.ConfigureComponent(type, DependencyLifecycle.InstancePerCall)); + } + + void ConfigureSubscriptionAuthorization() + { + var authType = TypesToScan.FirstOrDefault(t => typeof(IAuthorizeSubscriptions).IsAssignableFrom(t) && !t.IsInterface); + + if (authType != null) + Configurer.ConfigureComponent(authType, DependencyLifecycle.SingleInstance); + } + + + void RegisterMessageOwnersAndBusAddress(IEnumerable knownMessages) + { + var unicastConfig = GetConfigSection(); + var router = new StaticMessageRouter(knownMessages); + + Configurer.RegisterSingleton(router); + + Address forwardAddress = null; + if (unicastConfig != null && !string.IsNullOrWhiteSpace(unicastConfig.ForwardReceivedMessagesTo)) + { + forwardAddress = Address.Parse(unicastConfig.ForwardReceivedMessagesTo); + } + else + { + var forwardQueue = RegistryReader.Read("AuditQueue"); + if (!string.IsNullOrWhiteSpace(forwardQueue)) + { + forwardAddress = Address.Parse(forwardQueue); + } + } + + if (forwardAddress != null) + { + busConfig.ConfigureProperty(b => b.ForwardReceivedMessagesTo, forwardAddress); + } + + if (unicastConfig == null) + { + return; + } + + busConfig.ConfigureProperty(b => b.TimeToBeReceivedOnForwardedMessages, unicastConfig.TimeToBeReceivedOnForwardedMessages); + + var messageEndpointMappings = unicastConfig.MessageEndpointMappings.Cast() + .OrderByDescending(m=>m) + .ToList(); + + foreach (var mapping in messageEndpointMappings) + { + mapping.Configure((messageType, address) => + { + if (!MessageConventionExtensions.IsMessageType(messageType)) + { + return; + } + + router.RegisterRoute(messageType,address); + }); + } + } + + + /// + /// Used to configure the bus. + /// + IComponentConfig busConfig; + + /// + /// + /// Loads all message handler assemblies in the runtime directory. + /// + /// + public ConfigUnicastBus LoadMessageHandlers() + { + var types = new List(); + + TypesToScan.Where(TypeSpecifiesMessageHandlerOrdering) + .ToList().ForEach(t => + { + Logger.DebugFormat("Going to ask for message handler ordering from {0}.", t); + + var order = new Order(); + ((ISpecifyMessageHandlerOrdering)Activator.CreateInstance(t)).SpecifyOrder(order); + + order.Types.ToList().ForEach(ht => + { + if (types.Contains(ht)) + throw new ConfigurationErrorsException(string.Format("The order in which the type {0} should be invoked was already specified by a previous implementor of ISpecifyMessageHandlerOrdering. Check the debug logs to see which other specifiers have been invoked.", ht)); + }); + + types.AddRange(order.Types); + }); + + return LoadMessageHandlers(types); + } + + /// + /// Loads all message handler assemblies in the runtime directory + /// and specifies that handlers in the given assembly should run + /// before all others. + /// + /// Use First{T} to indicate the type to load from. + /// + /// + /// + public ConfigUnicastBus LoadMessageHandlers() + { + Type[] args = typeof(TFirst).GetGenericArguments(); + if (args.Length == 1) + { + if (typeof(First<>).MakeGenericType(args[0]).IsAssignableFrom(typeof(TFirst))) + { + return LoadMessageHandlers(new[] { args[0] }); + } + } + + throw new ArgumentException("TFirst should be of the type First where T is the type to indicate as first."); + } + + /// + /// Loads all message handler assemblies in the runtime directory + /// and specifies that the handlers in the given 'order' are to + /// run before all others and in the order specified. + /// + /// + /// + /// + public ConfigUnicastBus LoadMessageHandlers(First order) + { + return LoadMessageHandlers(order.Types); + } + + ConfigUnicastBus LoadMessageHandlers(IEnumerable orderedTypes) + { + LoadMessageHandlersCalled = true; + var types = new List(TypesToScan); + + foreach (Type t in orderedTypes) + types.Remove(t); + + types.InsertRange(0, orderedTypes); + + return ConfigureMessageHandlersIn(types); + } + + /// + /// Scans the given types for types that are message handlers + /// then uses the Configurer to configure them into the container as single call components, + /// finally passing them to the bus as its MessageHandlerTypes. + /// + /// + /// + ConfigUnicastBus ConfigureMessageHandlersIn(IEnumerable types) + { + var handlerRegistry = new MessageHandlerRegistry(); + var handlers = new List(); + + foreach (Type t in types.Where(IsMessageHandler)) + { + Configurer.ConfigureComponent(t, DependencyLifecycle.InstancePerUnitOfWork); + handlerRegistry.RegisterHandler(t); + handlers.Add(t); + } + + Configurer.RegisterSingleton(handlerRegistry); + + var availableDispatcherFactories = TypesToScan + .Where( + factory => + !factory.IsInterface && typeof(IMessageDispatcherFactory).IsAssignableFrom(factory)) + .ToList(); + + var dispatcherMappings = GetDispatcherFactories(handlers, availableDispatcherFactories); + + //configure the message dispatcher for each handler + busConfig.ConfigureProperty(b => b.MessageDispatcherMappings, dispatcherMappings); + + availableDispatcherFactories.ToList().ForEach(factory => Configurer.ConfigureComponent(factory, DependencyLifecycle.InstancePerUnitOfWork)); + + return this; + } + + IDictionary GetDispatcherFactories(IEnumerable handlers, IEnumerable messageDispatcherFactories) + { + var result = new Dictionary(); + + var customFactories = messageDispatcherFactories + .Where(t => t != defaultDispatcherFactory) + .Select(t => (IMessageDispatcherFactory)Activator.CreateInstance(t)).ToList(); + + + foreach (var handler in handlers) + { + var factory = customFactories.FirstOrDefault(f => f.CanDispatch(handler)); + + var factoryTypeToUse = defaultDispatcherFactory; + + if (factory != null) + factoryTypeToUse = factory.GetType(); + + result.Add(handler, factoryTypeToUse); + } + return result; + } + + /// + /// Set this if you want this endpoint to serve as something of a proxy; + /// recipients of messages sent by this endpoint will see the address + /// of endpoints that sent the incoming messages. + /// + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "PropagateReturnAddressOnSend")] + public ConfigUnicastBus PropogateReturnAddressOnSend(bool value) + { + busConfig.ConfigureProperty(b => b.PropagateReturnAddressOnSend, value); + return this; + } + + /// + /// Set this if you want this endpoint to serve as something of a proxy; + /// recipients of messages sent by this endpoint will see the address + /// of endpoints that sent the incoming messages. + /// + /// + /// + public ConfigUnicastBus PropagateReturnAddressOnSend(bool value) + { + busConfig.ConfigureProperty(b => b.PropagateReturnAddressOnSend, value); + return this; + } + /// + /// Forwards all received messages to a given endpoint (queue@machine). + /// This is useful as an auditing/debugging mechanism. + /// + /// + /// + public ConfigUnicastBus ForwardReceivedMessagesTo(string value) + { + busConfig.ConfigureProperty(b => b.ForwardReceivedMessagesTo, value); + return this; + } + + /// + /// Instructs the bus not to automatically subscribe to messages that + /// it has handlers for (given those messages belong to a different endpoint). + /// + /// This is needed only if you require fine-grained control over the subscribe/unsubscribe process. + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Configure.Features.Disable()")] + public ConfigUnicastBus DoNotAutoSubscribe() + { + Features.Disable(); + + return this; + } + + /// + /// Instructs the bus not to automatically subscribe sagas to messages that + /// it has handlers for (given those messages belong to a different endpoint). + /// + /// This is needed only if you require fine-grained control over the subscribe/unsubscribe process. + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Configure.Features.AutoSubscribe(f=>f.DoNotAutoSubscribeSagas())")] + public ConfigUnicastBus DoNotAutoSubscribeSagas() + { + Features.AutoSubscribe(f => f.DoNotAutoSubscribeSagas()); + //ApplyDefaultAutoSubscriptionStrategy.DoNotAutoSubscribeSagas = true; + return this; + } + + /// + /// Allow the bus to subscribe to itself + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Configure.Features.AutoSubscribe(f=>f.DoNotRequireExplicitRouting())")] + public ConfigUnicastBus AllowSubscribeToSelf() + { + Features.AutoSubscribe(f => f.DoNotRequireExplicitRouting()); + return this; + } + + /// + /// Tells the bus to auto subscribe plain messages in addition to events + /// Commands will NOT be auto subscribed + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Configure.Features.AutoSubscribe(f=>f.AutoSubscribePlainMessages())")] + public ConfigUnicastBus AutoSubscribePlainMessages() + { + Features.AutoSubscribe(f => f.AutoSubscribePlainMessages()); + return this; + } + + /// + /// Causes the bus to not deserialize incoming messages. This means that no handlers are called and + /// you need to be subscribed to the ITransport.TransportMessageReceived event to handle the messages + /// your self. + /// + /// + public ConfigUnicastBus SkipDeserialization() + { + busConfig.ConfigureProperty(b => b.SkipDeserialization, true); + return this; + } + + /// + /// Allow the bus to subscribe to itself + /// + /// + public ConfigUnicastBus DefaultDispatcherFactory() where T : IMessageDispatcherFactory + { + defaultDispatcherFactory = typeof(T); + return this; + } + + Type defaultDispatcherFactory = typeof(DefaultDispatcherFactory); + + /// + /// Returns true if the given type is a message handler. + /// + /// + /// + static bool IsMessageHandler(Type t) + { + if (t.IsAbstract || t.IsGenericType) + return false; + + return t.GetInterfaces().Select(GetMessageTypeFromMessageHandler).Any(messageType => messageType != null); + } + + static bool TypeSpecifiesMessageHandlerOrdering(Type t) + { + return typeof(ISpecifyMessageHandlerOrdering).IsAssignableFrom(t) && !t.IsAbstract && !t.IsInterface; + } + + /// + /// Returns the message type handled by the given message handler type. + /// + /// + /// + static Type GetMessageTypeFromMessageHandler(Type t) + { + if (t.IsGenericType) + { + Type[] args = t.GetGenericArguments(); + if (args.Length != 1) + return null; + + Type handlerType = typeof(IHandleMessages<>).MakeGenericType(args[0]); + if (handlerType.IsAssignableFrom(t)) + return args[0]; + } + + return null; + } + + static readonly ILog Logger = LogManager.GetLogger(typeof(UnicastBus)); + internal bool LoadMessageHandlersCalled { get; private set; } + } +} diff --git a/src/NServiceBus.Core/Unicast/Config/DefaultToTimeoutManagerBasedDeferal.cs b/src/NServiceBus.Core/Unicast/Config/DefaultToTimeoutManagerBasedDeferal.cs new file mode 100644 index 00000000000..2e21eed59ee --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Config/DefaultToTimeoutManagerBasedDeferal.cs @@ -0,0 +1,18 @@ +namespace NServiceBus.Unicast.Config +{ + using NServiceBus.Config; + using Timeout; + using Transports; + + public class DefaultToTimeoutManagerBasedDeferal:IFinalizeConfiguration + { + public void FinalizeConfiguration() + { + if (Configure.HasComponent()) + return; + + Configure.Component(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(p => p.TimeoutManagerAddress, Configure.Instance.GetTimeoutManagerAddress()); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Config/DefaultTransportForHost.cs b/src/NServiceBus.Core/Unicast/Config/DefaultTransportForHost.cs new file mode 100644 index 00000000000..a3928d5b9bc --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Config/DefaultTransportForHost.cs @@ -0,0 +1,27 @@ +namespace NServiceBus.Unicast.Config +{ + using Settings; + using Transports; + + + /// + /// Default to MSMQ transport if no other transport has been configured. This can be removed when we introduce the modules concept + /// + public class DefaultTransportForHost : IWantToRunBeforeConfigurationIsFinalized + { + public void Run() + { + if (Configure.Instance.Configurer.HasComponent()) + { + return; + } + + if(SettingsHolder.GetOrDefault("NServiceBus.Transport.SelectedTransport") != null) + { + return; + } + + Configure.Instance.UseTransport(); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Config/FinalizeUnicastBusConfiguration.cs b/src/NServiceBus.Core/Unicast/Config/FinalizeUnicastBusConfiguration.cs new file mode 100644 index 00000000000..3ffb5bdc3ee --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Config/FinalizeUnicastBusConfiguration.cs @@ -0,0 +1,16 @@ +namespace NServiceBus.Unicast.Config +{ + using AutomaticSubscriptions; + using NServiceBus.Config; + using Settings; + using Subscriptions; + + class FinalizeUnicastBusConfiguration : IFinalizeConfiguration + { + public void FinalizeConfiguration() + { + if (SettingsHolder.GetOrDefault("UnicastBus.AutoSubscribe")) + InfrastructureServices.Enable(); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Config/SetUnicastBusConfigurationDefaults.cs b/src/NServiceBus.Core/Unicast/Config/SetUnicastBusConfigurationDefaults.cs new file mode 100644 index 00000000000..e127d454e4d --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Config/SetUnicastBusConfigurationDefaults.cs @@ -0,0 +1,12 @@ +namespace NServiceBus.Unicast.Config +{ + using Settings; + + class SetUnicastBusConfigurationDefaults : ISetDefaultSettings + { + public SetUnicastBusConfigurationDefaults() + { + SettingsHolder.SetDefault("UnicastBus.AutoSubscribe", true); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Config/StartupRunners.cs b/src/NServiceBus.Core/Unicast/Config/StartupRunners.cs new file mode 100644 index 00000000000..7dce08e4ca8 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Config/StartupRunners.cs @@ -0,0 +1,29 @@ +namespace NServiceBus.Unicast.Config +{ + using System.Linq; + using NServiceBus.Config; + + internal class StartupRunners : NServiceBus.INeedInitialization, IWantToRunWhenConfigurationIsComplete + { + public void Init() + { + Configure.TypesToScan + .Where( + t => + typeof(IWantToRunWhenTheBusStarts).IsAssignableFrom(t) && !t.IsInterface) + .ToList() + .ForEach( + type => Configure.Instance.Configurer.ConfigureComponent(type, DependencyLifecycle.InstancePerCall)); + } + + public void Run() + { + if (!Configure.Instance.Configurer.HasComponent()) + return; + + Configure.Instance.Builder.Build().Started += + (obj, ev) => Configure.Instance.Builder.BuildAll().ToList() + .ForEach(r => r.Run()); + } + } +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast/DefaultDispatcherFactory.cs b/src/NServiceBus.Core/Unicast/DefaultDispatcherFactory.cs similarity index 76% rename from src/unicast/NServiceBus.Unicast/DefaultDispatcherFactory.cs rename to src/NServiceBus.Core/Unicast/DefaultDispatcherFactory.cs index 3ba11bdd736..729d07c0664 100644 --- a/src/unicast/NServiceBus.Unicast/DefaultDispatcherFactory.cs +++ b/src/NServiceBus.Core/Unicast/DefaultDispatcherFactory.cs @@ -1,23 +1,22 @@ -namespace NServiceBus.Unicast -{ - using System; - using System.Collections.Generic; - using ObjectBuilder; - - - /// - /// The default dispatch factory - /// - public class DefaultDispatcherFactory : IMessageDispatcherFactory - { - public IEnumerable GetDispatcher(Type messageHandlerType, IBuilder builder, object toHandle) - { - yield return () => builder.BuildAndDispatch(messageHandlerType, handler => HandlerInvocationCache.Invoke(typeof(IMessageHandler<>),handler, toHandle)); - } - - public bool CanDispatch(Type handler) - { - return true; - } - } -} \ No newline at end of file +namespace NServiceBus.Unicast +{ + using System; + using System.Collections.Generic; + using ObjectBuilder; + + /// + /// The default dispatch factory + /// + public class DefaultDispatcherFactory : IMessageDispatcherFactory + { + public IEnumerable GetDispatcher(Type messageHandlerType, IBuilder builder, object toHandle) + { + yield return () => builder.BuildAndDispatch(messageHandlerType, handler => HandlerInvocationCache.InvokeHandle(handler, toHandle)); + } + + public bool CanDispatch(Type handler) + { + return true; + } + } +} diff --git a/src/NServiceBus.Core/Unicast/HandlerInvocationCache.cs b/src/NServiceBus.Core/Unicast/HandlerInvocationCache.cs new file mode 100644 index 00000000000..b1069ec4f1d --- /dev/null +++ b/src/NServiceBus.Core/Unicast/HandlerInvocationCache.cs @@ -0,0 +1,128 @@ +namespace NServiceBus.Unicast +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Linq.Expressions; + using Saga; + + /// + /// Helper that optimize the invocation of the handle methods + /// + public class HandlerInvocationCache + { + /// + /// Invokes the handle method of the given handler passing the message + /// + /// The handler instance. + /// The message instance. + public static void InvokeHandle(object handler, object message) + { + Invoke(handler, message, HandlerCache); + } + + /// + /// Invokes the timeout method of the given handler passing the message + /// + /// The handler instance. + /// The message instance. + public static void InvokeTimeout(object handler, object state) + { + Invoke(handler, state, TimeoutCache); + } + + /// + /// Registers the method in the cache + /// + /// The object type. + /// the message type. + public static void CacheMethodForHandler(Type handler, Type messageType) + { + CacheMethod(handler, messageType, typeof (IHandleMessages<>), HandlerCache); + CacheMethod(handler, messageType, typeof (IHandleTimeouts<>), TimeoutCache); + } + + /// + /// Clears the cache + /// + public static void Clear() + { + HandlerCache.Clear(); + TimeoutCache.Clear(); + } + + static void Invoke(object handler, object message, Dictionary> dictionary) + { + List methodList; + if (!dictionary.TryGetValue(handler.GetType().TypeHandle, out methodList)) + { + return; + } + foreach (var delegateHolder in methodList.Where(x => x.MessageType.IsInstanceOfType(message))) + { + delegateHolder.MethodDelegate(handler, message); + } + } + + static void CacheMethod(Type handler, Type messageType, Type interfaceGenericType, Dictionary> cache) + { + var handleMethod = GetMethod(handler, messageType, interfaceGenericType); + if (handleMethod == null) + { + return; + } + var delegateHolder = new DelegateHolder + { + MessageType = messageType, + MethodDelegate = handleMethod + }; + List methodList; + if (cache.TryGetValue(handler.TypeHandle, out methodList)) + { + if (methodList.Any(x => x.MessageType == messageType)) + { + return; + } + methodList.Add(delegateHolder); + } + else + { + cache[handler.TypeHandle] = new List + { + delegateHolder + }; + } + } + + static Action GetMethod(Type targetType, Type messageType, Type interfaceGenericType) + { + var interfaceType = interfaceGenericType.MakeGenericType(messageType); + + if (interfaceType.IsAssignableFrom(targetType)) + { + var methodInfo = targetType.GetInterfaceMap(interfaceType).TargetMethods.FirstOrDefault(); + if (methodInfo != null) + { + var target = Expression.Parameter(typeof (object)); + var param = Expression.Parameter(typeof (object)); + + var castTarget = Expression.Convert(target, targetType); + var castParam = Expression.Convert(param, methodInfo.GetParameters().First().ParameterType); + var execute = Expression.Call(castTarget, methodInfo, castParam); + return Expression.Lambda>(execute, target, param).Compile(); + } + } + + return null; + } + + class DelegateHolder + { + public Type MessageType; + public Action MethodDelegate; + } + + static readonly Dictionary> HandlerCache = new Dictionary>(); + static readonly Dictionary> TimeoutCache = new Dictionary>(); + } +} diff --git a/src/unicast/NServiceBus.Unicast/IMessageDispatcherFactory.cs b/src/NServiceBus.Core/Unicast/IMessageDispatcherFactory.cs similarity index 97% rename from src/unicast/NServiceBus.Unicast/IMessageDispatcherFactory.cs rename to src/NServiceBus.Core/Unicast/IMessageDispatcherFactory.cs index b7b57d9f1e3..b3eeb750def 100644 --- a/src/unicast/NServiceBus.Unicast/IMessageDispatcherFactory.cs +++ b/src/NServiceBus.Core/Unicast/IMessageDispatcherFactory.cs @@ -1,28 +1,28 @@ -namespace NServiceBus.Unicast -{ - using System; - using System.Collections.Generic; - using ObjectBuilder; - - /// - /// Returns the action to dispatch the given message to the handler - /// - public interface IMessageDispatcherFactory - { - /// - /// Returns the action that will dipatch this message - /// - /// - /// - /// - /// - IEnumerable GetDispatcher(Type messageHandlerType, IBuilder builder, object toHandle); - - /// - /// Returns true if the factory is able to dispatch this type - /// - /// - /// - bool CanDispatch(Type handler); - } +namespace NServiceBus.Unicast +{ + using System; + using System.Collections.Generic; + using ObjectBuilder; + + /// + /// Returns the action to dispatch the given message to the handler + /// + public interface IMessageDispatcherFactory + { + /// + /// Returns the action that will dipatch this message + /// + /// + /// + /// + /// + IEnumerable GetDispatcher(Type messageHandlerType, IBuilder builder, object toHandle); + + /// + /// Returns true if the factory is able to dispatch this type + /// + /// + /// + bool CanDispatch(Type handler); + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/IMessageHandlerRegistry.cs b/src/NServiceBus.Core/Unicast/IMessageHandlerRegistry.cs new file mode 100644 index 00000000000..7bd73f5ac04 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/IMessageHandlerRegistry.cs @@ -0,0 +1,24 @@ +namespace NServiceBus.Unicast +{ + using System; + using System.Collections.Generic; + + /// + /// The registry that keeps track of all known message handlers + /// + public interface IMessageHandlerRegistry + { + /// + /// Gets the list of messagehandlers for the given message type + /// + /// + /// + IEnumerable GetHandlerTypes(Type messageType); + + /// + /// Lists all message type for which we have handlers + /// + /// + IEnumerable GetMessageTypes(); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/IUnicastBus.cs b/src/NServiceBus.Core/Unicast/IUnicastBus.cs new file mode 100644 index 00000000000..222511f0432 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/IUnicastBus.cs @@ -0,0 +1,35 @@ +namespace NServiceBus.Unicast +{ + using System; + using Subscriptions; + + /// + /// Extension of the IBus interface for working with a distributor. + /// + public interface IUnicastBus : IStartableBus + { + /// + /// Event raised by the Publish method when no subscribers are + /// registered for the message being published. + /// + event EventHandler NoSubscribersForMessage; + + /// + /// Event raised when a client has been subscribed to a message type. + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "MessageDrivenSubscriptionManager.ClientSubscribed")] + event EventHandler ClientSubscribed; + + /// + /// Event raised when the bus sends multiple messages across the wire. + /// + event EventHandler MessagesSent; + + /// + /// Clears any existing timeouts for the given saga + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "IDeferMessages.ClearDeferredMessages")] + void ClearTimeoutsFor(Guid sagaId); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/IWantToRunWhenTheBusStarts.cs b/src/NServiceBus.Core/Unicast/IWantToRunWhenTheBusStarts.cs new file mode 100644 index 00000000000..6ca59c41fa4 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/IWantToRunWhenTheBusStarts.cs @@ -0,0 +1,15 @@ +namespace NServiceBus.Unicast +{ + + /// + /// Implement this interface if you want to be called when the bus starts up + /// + [ObsoleteEx(Replacement = "NServiceBus!NServiceBus.IWantToRunWhenBusStartsAndStops", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public interface IWantToRunWhenTheBusStarts + { + /// + /// Method called on start up + /// + void Run(); + } +} diff --git a/src/NServiceBus.Core/Unicast/MessageContext.cs b/src/NServiceBus.Core/Unicast/MessageContext.cs new file mode 100644 index 00000000000..e51445ce22b --- /dev/null +++ b/src/NServiceBus.Core/Unicast/MessageContext.cs @@ -0,0 +1,50 @@ +namespace NServiceBus.Unicast +{ + using System; + using System.Collections.Generic; + + /// + /// Implementation of IMessageContext + /// + public class MessageContext : IMessageContext + { + private readonly TransportMessage transportMessage; + + /// + /// Initializes message context from the transport message. + /// + /// + public MessageContext(TransportMessage transportMessage) + { + this.transportMessage = transportMessage; + } + + IDictionary IMessageContext.Headers + { + get { return transportMessage.Headers; } + } + + public DateTime TimeSent + { + get + { + if (transportMessage.Headers.ContainsKey(Headers.TimeSent)) + { + return DateTimeExtensions.ToUtcDateTime(transportMessage.Headers[Headers.TimeSent]); + } + + return DateTime.MinValue; + } + } + + string IMessageContext.Id + { + get { return transportMessage.Id; } + } + + Address IMessageContext.ReplyToAddress + { + get { return transportMessage.ReplyToAddress; } + } + } +} diff --git a/src/unicast/NServiceBus.Unicast/MessageEventArgs.cs b/src/NServiceBus.Core/Unicast/MessageEventArgs.cs similarity index 98% rename from src/unicast/NServiceBus.Unicast/MessageEventArgs.cs rename to src/NServiceBus.Core/Unicast/MessageEventArgs.cs index 343a5d693ea..953348e66b4 100644 --- a/src/unicast/NServiceBus.Unicast/MessageEventArgs.cs +++ b/src/NServiceBus.Core/Unicast/MessageEventArgs.cs @@ -1,7 +1,7 @@ -using System; - namespace NServiceBus.Unicast { + using System; + /// /// Data containing a message for raising in events. /// diff --git a/src/NServiceBus.Core/Unicast/MessageHandlerRegistry.cs b/src/NServiceBus.Core/Unicast/MessageHandlerRegistry.cs new file mode 100644 index 00000000000..37a187a8d31 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/MessageHandlerRegistry.cs @@ -0,0 +1,99 @@ +namespace NServiceBus.Unicast +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Logging; + + /// + /// Maintains the message handlers for this endpoint + /// + public class MessageHandlerRegistry : IMessageHandlerRegistry + { + /// + /// Registers the given message handler type + /// + /// + public void RegisterHandler(Type handlerType) + { + if (handlerType.IsAbstract) + return; + + var messageTypesThisHandlerHandles = GetMessageTypesIfIsMessageHandler(handlerType).ToList(); + + + foreach (var messageType in messageTypesThisHandlerHandles) + { + if (!handlerList.ContainsKey(handlerType)) + handlerList.Add(handlerType, new List()); + + if (!(handlerList[handlerType].Contains(messageType))) + { + handlerList[handlerType].Add(messageType); + Log.DebugFormat("Associated '{0}' message with '{1}' handler", messageType, handlerType); + } + + HandlerInvocationCache.CacheMethodForHandler(handlerType, messageType); + } + } + + /// + /// Gets the list of messagehandlers for the given message type + /// + /// + /// + public IEnumerable GetHandlerTypes(Type messageType) + { + foreach (var handlerType in handlerList.Keys) + foreach (var msgTypeHandled in handlerList[handlerType]) + if (msgTypeHandled.IsAssignableFrom(messageType)) + { + yield return handlerType; + break; + } + } + + /// + /// Lists all message type for which we have handlers + /// + /// + public IEnumerable GetMessageTypes() + { + foreach (var handlerType in handlerList.Keys) + foreach (var typeHandled in handlerList[handlerType]) + if (MessageConventionExtensions.IsMessageType(typeHandled)) + yield return typeHandled; + + } + + + /// + /// If the type is a message handler, returns all the message types that it handles + /// + /// + /// + static IEnumerable GetMessageTypesIfIsMessageHandler(Type type) + { + foreach (var t in type.GetInterfaces().Where(t => t.IsGenericType)) + { + + var potentialMessageType = t.GetGenericArguments().SingleOrDefault(); + + if (potentialMessageType == null) + continue; + + + if (MessageConventionExtensions.IsMessageType(potentialMessageType) || + typeof(IHandleMessages<>).MakeGenericType(potentialMessageType).IsAssignableFrom(t)) + yield return potentialMessageType; + } + } + + + + readonly IDictionary> handlerList = new Dictionary>(); + + private readonly static ILog Log = LogManager.GetLogger(typeof(MessageHandlerRegistry)); + + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Messages/MessageMetadata.cs b/src/NServiceBus.Core/Unicast/Messages/MessageMetadata.cs new file mode 100644 index 00000000000..7cbbf2c0ee8 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Messages/MessageMetadata.cs @@ -0,0 +1,17 @@ +namespace NServiceBus.Unicast.Messages +{ + using System; + + public class MessageMetadata + { + public Type MessageType { get; set; } + public bool Recoverable { get; set; } + public TimeSpan TimeToBeReceived { get; set; } + + public override string ToString() + { + return string.Format("MessageType: {0}, Recoverable: {1}, TimeToBeReceived: {2}", MessageType, Recoverable, + TimeToBeReceived == TimeSpan.MaxValue ? "Not set" : TimeToBeReceived.ToString()); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Messages/MessageMetadataRegistry.cs b/src/NServiceBus.Core/Unicast/Messages/MessageMetadataRegistry.cs new file mode 100644 index 00000000000..8b5e28dac99 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Messages/MessageMetadataRegistry.cs @@ -0,0 +1,93 @@ +namespace NServiceBus.Unicast.Messages +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Logging; + + public class MessageMetadataRegistry + { + public MessageMetadata GetMessageDefinition(Type messageType) + { + MessageMetadata metadata; + if (messages.TryGetValue(messageType, out metadata)) + { + return metadata; + } + var message = string.Format("Could not find Metadata for '{0}'. Messages need to implement either 'IMessage', 'IEvent' or 'ICommand'. Alternatively, if you don't want to implement an interface, you can configure 'Unobtrusive Mode Messages' and use convention to configure how messages are mapped.", messageType.FullName); + throw new Exception(message); + } + + public IEnumerable GetMessageTypes(TransportMessage message) + { + var messageMetadatas = new List(); + string header; + + if (!message.Headers.TryGetValue(Headers.EnclosedMessageTypes, out header)) + { + return messageMetadatas; + } + if (string.IsNullOrEmpty(header)) + { + return messageMetadatas; + } + + foreach (var messageTypeString in header.Split(';')) + { + var messageType = Type.GetType(messageTypeString, false); + + if (messageType == null) + { + Logger.InfoFormat("Message type: '{0}' could not be determined by a 'Type.GetType', scanning known messages for a match.MessageId: {1}", messageTypeString, message.Id); + + var messageMetadata = messages.Values.FirstOrDefault(m => m.MessageType.FullName == messageTypeString); + if (messageMetadata == null) + { + continue; + } + messageType = messageMetadata.MessageType; + } + MessageMetadata metadata; + if (messages.TryGetValue(messageType, out metadata)) + { + messageMetadatas.Add(metadata); + continue; + } + Logger.WarnFormat("Message header '{0}' was mapped to type '{1}' but that type was not found in the message registry, please make sure the same message registration conventions are used in all endpoints, specially if you are using unobtrusive mode. MessageId: {2}", messageTypeString, messageType.FullName, message.Id); + } + + if (messageMetadatas.Count == 0 && message.MessageIntent != MessageIntentEnum.Publish) + { + Logger.WarnFormat("Could not determine message type from message header '{0}'. MessageId: {1}", header, message.Id); + } + return messageMetadatas; + } + + public IEnumerable GetAllMessages() + { + return new List(messages.Values); + } + + + public void RegisterMessageType(Type messageType) + { + var metadata = new MessageMetadata + { + MessageType = messageType, + Recoverable = !DefaultToNonPersistentMessages, + TimeToBeReceived = MessageConventionExtensions.TimeToBeReceivedAction(messageType) + }; + + if (MessageConventionExtensions.IsExpressMessageType(messageType)) + metadata.Recoverable = false; + + messages[messageType] = metadata; + } + + readonly Dictionary messages = new Dictionary(); + + public bool DefaultToNonPersistentMessages { get; set; } + + static ILog Logger = LogManager.GetLogger(typeof (DefaultDispatcherFactory)); + } +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast/MessagingBestPractices.cs b/src/NServiceBus.Core/Unicast/MessagingBestPractices.cs similarity index 80% rename from src/unicast/NServiceBus.Unicast/MessagingBestPractices.cs rename to src/NServiceBus.Core/Unicast/MessagingBestPractices.cs index 7386be750bb..dc4cd1ec0b9 100644 --- a/src/unicast/NServiceBus.Unicast/MessagingBestPractices.cs +++ b/src/NServiceBus.Core/Unicast/MessagingBestPractices.cs @@ -1,11 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Common.Logging; -using NServiceBus.Unicast.Transport; - namespace NServiceBus.Unicast { + using System; + using System.Collections.Generic; + using System.Linq; + using Logging; + /// /// Enforce messaging rules /// @@ -18,7 +17,7 @@ public class MessagingBestPractices /// public static void AssertIsValidForSend(Type messageType, MessageIntentEnum messageIntent) { - if (messageType.IsEventType() && messageIntent != MessageIntentEnum.Publish) + if (MessageConventionExtensions.IsEventType(messageType) && messageIntent != MessageIntentEnum.Publish) throw new InvalidOperationException( "Events can have multiple recipient so they should be published"); } @@ -29,7 +28,7 @@ public static void AssertIsValidForSend(Type messageType, MessageIntentEnum mess /// Collection of messages to enforce messaging rules on. public static void AssertIsValidForReply(IEnumerable messages) { - if (messages.Any(m => m.IsCommand() || m.IsEvent())) + if (messages.Any(m => MessageConventionExtensions.IsCommand(m) || MessageConventionExtensions.IsEvent(m))) throw new InvalidOperationException( "Reply is neither supported for Commands nor Events. Commands should be sent to their logical owner using bus.Send and bus. Events should be Published with bus.Publish."); } @@ -39,7 +38,7 @@ public static void AssertIsValidForReply(IEnumerable messages) /// public static void AssertIsValidForReply(Type messageType) { - if (messageType.IsCommandType() || messageType.IsEventType()) + if (MessageConventionExtensions.IsCommandType(messageType) || MessageConventionExtensions.IsEventType(messageType)) throw new InvalidOperationException( "Reply is neither supported for Commands nor Events. Commands should be sent to their logical owner using bus.Send and bus. Events should be Published with bus.Publish."); } @@ -49,11 +48,11 @@ public static void AssertIsValidForReply(Type messageType) /// public static void AssertIsValidForPubSub(Type messageType) { - if (messageType.IsCommandType()) + if (MessageConventionExtensions.IsCommandType(messageType)) throw new InvalidOperationException( "Pub/Sub is not supported for Commands. They should be be sent direct to their logical owner"); - if (!messageType.IsEventType()) + if (!MessageConventionExtensions.IsEventType(messageType)) Log.Info("You are using a basic message to do pub/sub, consider implementing the more specific ICommand and IEvent interfaces to help NServiceBus to enforce messaging best practices for you"); } diff --git a/src/NServiceBus.Core/Unicast/Monitoring/CausationMutator.cs b/src/NServiceBus.Core/Unicast/Monitoring/CausationMutator.cs new file mode 100644 index 00000000000..62e74a177d0 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Monitoring/CausationMutator.cs @@ -0,0 +1,44 @@ +namespace NServiceBus.Unicast.Monitoring +{ + using IdGeneration; + using MessageMutator; + + /// + /// Mutator to set the related to header + /// + public class CausationMutator : IMutateOutgoingTransportMessages, INeedInitialization + { + /// + /// The bus is needed to get access to the current message id + /// + public IBus Bus { get; set; } + + /// + /// Keeps track of related messages to make auditing possible + /// + /// + /// + public void MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + var conversationId = CombGuid.Generate().ToString(); + + if (Bus.CurrentMessageContext != null) + { + transportMessage.Headers[Headers.RelatedTo] = Bus.CurrentMessageContext.Id; + + if (Bus.CurrentMessageContext.Headers.ContainsKey(Headers.ConversationId)) + conversationId = Bus.CurrentMessageContext.Headers[Headers.ConversationId]; + } + + transportMessage.Headers[Headers.ConversationId] = conversationId; + } + + /// + /// Initializes + /// + public void Init() + { + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Monitoring/CriticalTimeCalculator.cs b/src/NServiceBus.Core/Unicast/Monitoring/CriticalTimeCalculator.cs new file mode 100644 index 00000000000..41a2c260658 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Monitoring/CriticalTimeCalculator.cs @@ -0,0 +1,83 @@ +namespace NServiceBus.Unicast.Monitoring +{ + using System; + using System.Diagnostics; + using System.Threading; + + /// + /// Performance counter for the critical time + /// + public class CriticalTimeCalculator : IDisposable + { + PerformanceCounter counter; + bool disposed; + TimeSpan maxDelta = TimeSpan.FromSeconds(2); + DateTime timeOfLastCounter; + Timer timer; + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Updates the counter based on the passed times + /// + /// + /// + /// + public void Update(DateTime sent, DateTime processingStarted, DateTime processingEnded) + { + counter.RawValue = Convert.ToInt32((processingEnded - sent).TotalSeconds); + + timeOfLastCounter = processingEnded; + + maxDelta = (processingEnded - processingStarted).Add(TimeSpan.FromSeconds(1)); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + if (counter != null) + { + counter.Dispose(); + } + } + disposed = true; + } + + ~CriticalTimeCalculator() + { + Dispose(false); + } + + /// + /// Verified that the counter exists + /// + public void Initialize(PerformanceCounter cnt) + { + counter = cnt; + + + timer = new Timer(ClearPerfCounter, null, 0, 2000); + } + + + void ClearPerfCounter(object state) + { + TimeSpan delta = DateTime.UtcNow - timeOfLastCounter; + + if (delta > maxDelta) + { + counter.RawValue = 0; + } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Monitoring/EstimatedTimeToSLABreachCalculator.cs b/src/NServiceBus.Core/Unicast/Monitoring/EstimatedTimeToSLABreachCalculator.cs new file mode 100644 index 00000000000..03d70fe3257 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Monitoring/EstimatedTimeToSLABreachCalculator.cs @@ -0,0 +1,172 @@ +namespace NServiceBus.Unicast.Monitoring +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using System.Linq; + using System.Threading; + + public class EstimatedTimeToSLABreachCalculator : IDisposable + { + const int MaxDatapoints = 10; + readonly List dataPoints = new List(); + PerformanceCounter counter; + bool disposed; + TimeSpan endpointSLA; + Timer timer; + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + if (counter != null) + { + counter.Dispose(); + } + } + disposed = true; + } + + ~EstimatedTimeToSLABreachCalculator() + { + Dispose(false); + } + + /// + /// Verified that the counter exists + /// + /// + /// + public void Initialize(TimeSpan sla, PerformanceCounter slaBreachCounter) + { + endpointSLA = sla; + counter = slaBreachCounter; + + timer = new Timer(RemoveOldDatapoints, null, 0, 2000); + } + + + /// + /// Updates the counter based on the passed times + /// + /// + /// + /// + public void Update(DateTime sent, DateTime processingStarted, DateTime processingEnded) + { + var dataPoint = new DataPoint + { + CriticalTime = processingEnded - sent, + ProcessingTime = processingEnded - processingStarted, + OccuredAt = processingEnded + }; + + lock (dataPoints) + { + dataPoints.Add(dataPoint); + if (dataPoints.Count > MaxDatapoints) + { + dataPoints.RemoveRange(0, dataPoints.Count - MaxDatapoints); + } + } + + UpdateTimeToSLABreach(); + } + + void UpdateTimeToSLABreach() + { + IList snapshots; + + lock (dataPoints) + snapshots = new List(dataPoints); + + double secondsToSLABreach = CalculateTimeToSLABreach(snapshots); + + counter.RawValue = Convert.ToInt32(Math.Min(secondsToSLABreach, Int32.MaxValue)); + } + + double CalculateTimeToSLABreach(IEnumerable snapshots) + { + //need at least 2 datapoints to be able to calculate + if (snapshots.Count() < 2) + { + return double.MaxValue; + } + + DataPoint previous = null; + + TimeSpan criticalTimeDelta = TimeSpan.Zero; + + foreach (DataPoint current in snapshots) + { + if (previous != null) + { + criticalTimeDelta += current.CriticalTime - previous.CriticalTime; + } + + previous = current; + } + + if (criticalTimeDelta.TotalSeconds <= 0.0) + { + return double.MaxValue; + } + + TimeSpan elapsedTime = snapshots.Last().OccuredAt - snapshots.First().OccuredAt; + + if (elapsedTime.TotalSeconds <= 0.0) + { + return double.MaxValue; + } + + + double lastKnownCriticalTime = snapshots.Last().CriticalTime.TotalSeconds; + + double criticalTimeDeltaPerSecond = criticalTimeDelta.TotalSeconds/elapsedTime.TotalSeconds; + + double secondsToSLABreach = (endpointSLA.TotalSeconds - lastKnownCriticalTime)/criticalTimeDeltaPerSecond; + + if (secondsToSLABreach < 0.0) + { + return 0.0; + } + + return secondsToSLABreach; + } + + void RemoveOldDatapoints(object state) + { + lock (dataPoints) + { + DataPoint last = dataPoints.LastOrDefault(); + + if (last != null) + { + DateTime oldestDataToKeep = DateTime.UtcNow - new TimeSpan(last.ProcessingTime.Ticks*3); + + dataPoints.RemoveAll(d => d.OccuredAt < oldestDataToKeep); + } + } + + UpdateTimeToSLABreach(); + } + + class DataPoint + { + public TimeSpan CriticalTime { get; set; } + public DateTime OccuredAt { get; set; } + public TimeSpan ProcessingTime { get; set; } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Monitoring/PerformanceCounterInitializer.cs b/src/NServiceBus.Core/Unicast/Monitoring/PerformanceCounterInitializer.cs new file mode 100644 index 00000000000..c4fb75ca94e --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Monitoring/PerformanceCounterInitializer.cs @@ -0,0 +1,71 @@ +namespace NServiceBus.Unicast.Monitoring +{ + using System; + using System.Diagnostics; + + /// + /// Initializes the performance counters if they are enabled + /// + public class PerformanceCounterInitializer : IWantToRunBeforeConfigurationIsFinalized + { + public void Run() + { + if (!Configure.Instance.PerformanceCountersEnabled()) + return; + + if (!PerformanceCounterCategory.Exists(CategoryName)) + { + return; + } + + SetupCriticalTimePerformanceCounter(); + + SetupSLABreachCounter(); + } + + static void SetupCriticalTimePerformanceCounter() + { + var criticalTimeCalculator = new CriticalTimeCalculator(); + var criticalTimeCounter = InstantiateCounter("Critical Time"); + + criticalTimeCalculator.Initialize(criticalTimeCounter); + + Configure.Instance.Configurer.RegisterSingleton(criticalTimeCalculator); + } + + static void SetupSLABreachCounter() + { + var endpointSla = Configure.Instance.EndpointSLA(); + + if (endpointSla == TimeSpan.Zero) + return; + + var timeToSLABreachCalculator = new EstimatedTimeToSLABreachCalculator(); + var slaBreachCounter = InstantiateCounter("SLA violation countdown"); + + timeToSLABreachCalculator.Initialize(endpointSla, slaBreachCounter); + + Configure.Instance.Configurer.RegisterSingleton(timeToSLABreachCalculator); + } + + static PerformanceCounter InstantiateCounter(string counterName) + { + PerformanceCounter counter; + + try + { + counter = new PerformanceCounter(CategoryName, counterName, Configure.EndpointName, false); + var t = counter.CounterType; //access the counter type to force a exception to be thrown if the counter doesn't exists + } + catch (Exception e) + { + throw new InvalidOperationException( + string.Format("NServiceBus performance counter for {0} is not set up correctly. Please run Install-NServiceBusPerformanceCounters cmdlet to rectify this problem.", counterName), + e); + } + return counter; + } + + const string CategoryName = "NServiceBus"; + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Monitoring/ProcessingStatistics.cs b/src/NServiceBus.Core/Unicast/Monitoring/ProcessingStatistics.cs new file mode 100644 index 00000000000..f953470b585 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Monitoring/ProcessingStatistics.cs @@ -0,0 +1,59 @@ +namespace NServiceBus.Unicast.Monitoring +{ + using System; + using UnitOfWork; + + /// + /// Stores the start and end times for statistic purposes + /// + public class ProcessingStatistics : IManageUnitsOfWork, INeedInitialization + { + /// + /// Needs the bus to set the headers + /// + public IBus Bus { get; set; } + + /// + /// Performance counter for critical time. + /// + public CriticalTimeCalculator CriticalTimeCounter { get; set; } + + + /// + /// Counter that displays the estimated time left to a SLA breach + /// + public EstimatedTimeToSLABreachCalculator EstimatedTimeToSLABreachCalculator { get; set; } + + public void Begin() + { + Bus.CurrentMessageContext.Headers[Headers.ProcessingStarted] = DateTimeExtensions.ToWireFormattedString(DateTime.UtcNow); + } + + public void End(Exception ex = null) + { + var now = DateTime.UtcNow; + + Bus.CurrentMessageContext.Headers[Headers.ProcessingEnded] = DateTimeExtensions.ToWireFormattedString(now); + + if (Bus.CurrentMessageContext.Headers.ContainsKey(Headers.TimeSent)) + { + UpdateCounters(DateTimeExtensions.ToUtcDateTime(Bus.CurrentMessageContext.Headers[Headers.TimeSent]), DateTimeExtensions.ToUtcDateTime(Bus.CurrentMessageContext.Headers[Headers.ProcessingStarted]), now); + } + } + + void UpdateCounters(DateTime timeSent, DateTime processingStarted, DateTime processingEnded) + { + if(CriticalTimeCounter != null) + CriticalTimeCounter.Update(timeSent, processingStarted,processingEnded); + + + if (EstimatedTimeToSLABreachCalculator != null) + EstimatedTimeToSLABreachCalculator.Update(timeSent, processingStarted, processingEnded); + } + + public void Init() + { + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerUnitOfWork); + } + } +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast.Monitoring/SentTimeMutator.cs b/src/NServiceBus.Core/Unicast/Monitoring/SentTimeMutator.cs similarity index 82% rename from src/unicast/NServiceBus.Unicast.Monitoring/SentTimeMutator.cs rename to src/NServiceBus.Core/Unicast/Monitoring/SentTimeMutator.cs index a8bde6755d4..ece702e1518 100644 --- a/src/unicast/NServiceBus.Unicast.Monitoring/SentTimeMutator.cs +++ b/src/NServiceBus.Core/Unicast/Monitoring/SentTimeMutator.cs @@ -1,28 +1,26 @@ -namespace NServiceBus.Unicast.Monitoring -{ - using System; - using MessageMutator; - using NServiceBus.Config; - using Transport; - - /// - /// Set the TimeSent header - /// - public class SentTimeMutator : IMutateOutgoingTransportMessages, INeedInitialization - { - /// - /// Stamps the message with the current time in UTC - /// - /// - /// - public void MutateOutgoing(object[] messages, TransportMessage transportMessage) - { - transportMessage.Headers[Headers.TimeSent] = DateTime.UtcNow.ToWireFormattedString(); - } - - public void Init() - { - Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); - } - } +namespace NServiceBus.Unicast.Monitoring +{ + using System; + using MessageMutator; + + /// + /// Set the TimeSent header + /// + public class SentTimeMutator : IMutateOutgoingTransportMessages, INeedInitialization + { + /// + /// Stamps the message with the current time in UTC + /// + /// + /// + public void MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + transportMessage.Headers[Headers.TimeSent] = DateTimeExtensions.ToWireFormattedString(DateTime.UtcNow); + } + + public void Init() + { + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + } + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Monitoring/VersionMutator.cs b/src/NServiceBus.Core/Unicast/Monitoring/VersionMutator.cs new file mode 100644 index 00000000000..5a3092ea434 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Monitoring/VersionMutator.cs @@ -0,0 +1,25 @@ +namespace NServiceBus.Unicast.Monitoring +{ + using MessageMutator; + + public class VersionMutator : IMutateOutgoingTransportMessages, INeedInitialization + { + /// + /// Keeps track of related messages to make auditing possible + /// + /// + /// + public void MutateOutgoing(object[] messages, TransportMessage transportMessage) + { + transportMessage.Headers[NServiceBus.Headers.NServiceBusVersion] = NServiceBus.NServiceBusVersion.Version; + } + + /// + /// Initializer + /// + public void Init() + { + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Publishing/StorageDrivenPublisher.cs b/src/NServiceBus.Core/Unicast/Publishing/StorageDrivenPublisher.cs new file mode 100644 index 00000000000..0638eb221e5 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Publishing/StorageDrivenPublisher.cs @@ -0,0 +1,55 @@ +namespace NServiceBus.Unicast.Publishing +{ + using System; + using System.Collections.Generic; + using System.Linq; + using IdGeneration; + using Subscriptions; + using Subscriptions.MessageDrivenSubscriptions; + using Transports; + + + /// + /// Published messages based on whats registered in the given subscription storage + /// + public class StorageDrivenPublisher:IPublishMessages + { + /// + /// Subscription storge containing information about events and their subscribers + /// + public ISubscriptionStorage SubscriptionStorage { get; set; } + + /// + /// The message sender to use when sending the events to the different publishers + /// + public ISendMessages MessageSender{ get; set; } + + + /// + /// Pubvlishes the given message to all subscribers + /// + /// + /// + /// + public bool Publish(TransportMessage message, IEnumerable eventTypes) + { + if (SubscriptionStorage == null) + throw new InvalidOperationException("Cannot publish on this endpoint - no subscription storage has been configured. Add either 'MsmqSubscriptionStorage()' or 'DbSubscriptionStorage()' after 'NServiceBus.Configure.With()'."); + + var subscribers = Enumerable.ToList
    (SubscriptionStorage.GetSubscriberAddressesForMessage(eventTypes.Select(t => new MessageType(t)))); + + if (!subscribers.Any()) + return false; + + foreach (var subscriber in subscribers) + { + //this is unicast so we give the message a unique ID + message.ChangeMessageId(CombGuid.Generate().ToString()); + + MessageSender.Send(message,subscriber); + } + + return true; + } + } +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast.Queuing/FailedToSendMessageException.cs b/src/NServiceBus.Core/Unicast/Queuing/FailedToSendMessageException.cs similarity index 96% rename from src/unicast/NServiceBus.Unicast.Queuing/FailedToSendMessageException.cs rename to src/NServiceBus.Core/Unicast/Queuing/FailedToSendMessageException.cs index 378b457f54e..49452d35b12 100644 --- a/src/unicast/NServiceBus.Unicast.Queuing/FailedToSendMessageException.cs +++ b/src/NServiceBus.Core/Unicast/Queuing/FailedToSendMessageException.cs @@ -1,7 +1,7 @@ -using System; - namespace NServiceBus.Unicast.Queuing { + using System; + [Serializable] public class FailedToSendMessageException : Exception { diff --git a/src/NServiceBus.Core/Unicast/Queuing/IWantQueueCreated.cs b/src/NServiceBus.Core/Unicast/Queuing/IWantQueueCreated.cs new file mode 100644 index 00000000000..5bafacce51e --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Queuing/IWantQueueCreated.cs @@ -0,0 +1,17 @@ +namespace NServiceBus.Unicast.Queuing +{ + /// + /// Implementers signal their wish to create a queue, regardless of technology (e.g. MSMQ or SQL Server). + /// + public interface IWantQueueCreated + { + /// + /// Address of queue the implementer requires. + /// + Address Address { get; } + /// + /// True if no need to create queue + /// + bool IsDisabled { get; } + } +} diff --git a/src/NServiceBus.Core/Unicast/Queuing/Installers/EndpointInputQueueCreator.cs b/src/NServiceBus.Core/Unicast/Queuing/Installers/EndpointInputQueueCreator.cs new file mode 100644 index 00000000000..861deaffbe0 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Queuing/Installers/EndpointInputQueueCreator.cs @@ -0,0 +1,21 @@ +namespace NServiceBus.Unicast.Queuing.Installers +{ + public class EndpointInputQueueCreator : IWantQueueCreated + { + /// + /// Endpoint input name + /// + public Address Address + { + get { return Address.Local; } + } + + /// + /// True if no need to create queue + /// + public bool IsDisabled + { + get { return false; } + } + } +} diff --git a/src/NServiceBus.Core/Unicast/Queuing/Installers/ForwardReceivedMessagesToQueueCreator.cs b/src/NServiceBus.Core/Unicast/Queuing/Installers/ForwardReceivedMessagesToQueueCreator.cs new file mode 100644 index 00000000000..804912e3a7e --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Queuing/Installers/ForwardReceivedMessagesToQueueCreator.cs @@ -0,0 +1,51 @@ +namespace NServiceBus.Unicast.Queuing.Installers +{ + using NServiceBus.Config; + using Utils; + + /// + /// Signals to create forward received messages queue. + /// + public class ForwardReceivedMessagesToQueueCreator : IWantQueueCreated + { + private readonly Address address; + private readonly bool disable = true; + + public ForwardReceivedMessagesToQueueCreator() + { + disable = true; + + var unicastConfig = Configure.GetConfigSection(); + + if ((unicastConfig != null) && (!string.IsNullOrEmpty(unicastConfig.ForwardReceivedMessagesTo))) + { + address = Address.Parse(unicastConfig.ForwardReceivedMessagesTo); + disable = false; + return; + } + + var forwardQueue = RegistryReader.Read("AuditQueue"); + if (!string.IsNullOrWhiteSpace(forwardQueue)) + { + address = Address.Parse(forwardQueue); + disable = false; + } + } + + /// + /// Address of queue the implementer requires. + /// + public Address Address + { + get { return address; } + } + + /// + /// True if no need to create queue + /// + public bool IsDisabled + { + get { return disable; } + } + } +} diff --git a/src/unicast/NServiceBus.Unicast.Queuing/QueueNotFoundException.cs b/src/NServiceBus.Core/Unicast/Queuing/QueueNotFoundException.cs similarity index 98% rename from src/unicast/NServiceBus.Unicast.Queuing/QueueNotFoundException.cs rename to src/NServiceBus.Core/Unicast/Queuing/QueueNotFoundException.cs index 4bec5a1837c..95abf1cb764 100644 --- a/src/unicast/NServiceBus.Unicast.Queuing/QueueNotFoundException.cs +++ b/src/NServiceBus.Core/Unicast/Queuing/QueueNotFoundException.cs @@ -1,7 +1,7 @@ -using System; - namespace NServiceBus.Unicast.Queuing { + using System; + [Serializable] public class QueueNotFoundException : Exception { diff --git a/src/NServiceBus.Core/Unicast/Queuing/QueuesCreator.cs b/src/NServiceBus.Core/Unicast/Queuing/QueuesCreator.cs new file mode 100644 index 00000000000..d3f1fc40110 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Queuing/QueuesCreator.cs @@ -0,0 +1,59 @@ +namespace NServiceBus.Unicast.Queuing +{ + using System; + using System.Linq; + using Installation; + using Installation.Environments; + using Logging; + using Settings; + using Transports; + using INeedInitialization = NServiceBus.INeedInitialization; + + /// + /// Iterating over all implementers of IWantQueueCreated and creating queue for each. + /// + public class QueuesCreator : INeedInitialization, INeedToInstallSomething + { + public ICreateQueues QueueCreator { get; set; } + + /// + /// Performs the installation providing permission for the given user. + /// + /// The user for under which the queue will be created. + public void Install(string identity) + { + if (SettingsHolder.Get("Endpoint.SendOnly")) + { + return; + } + + if (ConfigureQueueCreation.DontCreateQueues) + { + return; + } + + var wantQueueCreatedInstances = Configure.Instance.Builder.BuildAll().ToList(); + + foreach (var wantQueueCreatedInstance in wantQueueCreatedInstances.Where(wantQueueCreatedInstance => !wantQueueCreatedInstance.IsDisabled)) + { + if (wantQueueCreatedInstance.Address == null) + { + throw new InvalidOperationException(string.Format("IWantQueueCreated implementation {0} returned a null address",wantQueueCreatedInstance.GetType().FullName)); + } + + QueueCreator.CreateQueueIfNecessary(wantQueueCreatedInstance.Address, identity); + Logger.DebugFormat("Verified that the queue: [{0}] existed", wantQueueCreatedInstance.Address); + } + } + + /// + /// Register all IWantQueueCreated implementers. + /// + public void Init() + { + Configure.Instance.ForAllTypes(type => Configure.Instance.Configurer.ConfigureComponent(type, DependencyLifecycle.InstancePerCall)); + } + + private readonly static ILog Logger = LogManager.GetLogger(typeof(QueuesCreator)); + } +} diff --git a/src/NServiceBus.Core/Unicast/Routing/IRouteMessages.cs b/src/NServiceBus.Core/Unicast/Routing/IRouteMessages.cs new file mode 100644 index 00000000000..c3eed58d4a7 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Routing/IRouteMessages.cs @@ -0,0 +1,17 @@ +namespace NServiceBus.Unicast.Routing +{ + using System; + + /// + /// Keeps track of where a given message should be routed to + /// + public interface IRouteMessages + { + /// + /// Gets the owner/destination for the given message + /// + /// + /// + Address GetDestinationFor(Type messageType); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Routing/StaticMessageRouter.cs b/src/NServiceBus.Core/Unicast/Routing/StaticMessageRouter.cs new file mode 100644 index 00000000000..abd70a051af --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Routing/StaticMessageRouter.cs @@ -0,0 +1,73 @@ +namespace NServiceBus.Unicast.Routing +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using Logging; + + /// + /// The default message router + /// + public class StaticMessageRouter : IRouteMessages + { + /// + /// Initializes the router with all known messages + /// + /// + public StaticMessageRouter(IEnumerable knownMessages) + { + routes = new ConcurrentDictionary(); + foreach (var knownMessage in knownMessages) + { + routes[knownMessage] = Address.Undefined; + } + } + + public Address GetDestinationFor(Type messageType) + { + Address address; + if (!routes.TryGetValue(messageType, out address)) + return Address.Undefined; + + return address; + + } + + public void RegisterRoute(Type messageType, Address endpointAddress) + { + Address currentAddress; + + if (!routes.TryGetValue(messageType, out currentAddress)) + currentAddress = Address.Undefined; + + if(currentAddress == Address.Undefined) + { + Logger.DebugFormat("Routing for message: {0} set to {1}", messageType, endpointAddress); + } + else + { + Logger.InfoFormat("Routing for message: {0} updated from {1} to {2}", messageType, currentAddress, endpointAddress); + } + + routes[messageType] = endpointAddress; + + //go through the existing routes and see if this means that we can route any of those + foreach (var route in routes) + { + if (messageType != route.Key && route.Key.IsAssignableFrom(messageType)) + { + if(route.Value == Address.Undefined) + Logger.DebugFormat("Routing for inherited message: {0}({1}) set to {2}",route.Key, messageType, endpointAddress); + else + Logger.InfoFormat("Routing for inherited message: {0}({1}) updated from {2} to {3}", route.Key, messageType,route.Value,endpointAddress); + + routes[route.Key] = endpointAddress; + } + } + + } + + readonly IDictionary routes; + readonly static ILog Logger = LogManager.GetLogger(typeof(StaticMessageRouter)); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/EnableMessageDrivenPublisherIfStorageIsFound.cs b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/EnableMessageDrivenPublisherIfStorageIsFound.cs new file mode 100644 index 00000000000..5acaa6ab8d8 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/EnableMessageDrivenPublisherIfStorageIsFound.cs @@ -0,0 +1,24 @@ +namespace NServiceBus.Unicast.Subscriptions.MessageDrivenSubscriptions +{ + using Features; + using Logging; + + /// + /// This class handles backwards compatibility. If there is a ISubscription storage registered by the user we should use + /// the message drive´n subscription manager + /// + public class EnableMessageDrivenPublisherIfStorageIsFound:IWantToRunBeforeConfigurationIsFinalized + { + public void Run() + { + if (Configure.Instance.Configurer.HasComponent()) + { + Feature.Enable(); + Logger.InfoFormat("ISubscriptionStorage found in the container. The message driven publisher feature will be activeated"); + } + + } + + static readonly ILog Logger = LogManager.GetLogger(typeof(EnableMessageDrivenPublisherIfStorageIsFound)); + } +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast.Subscriptions/ISubscriptionStorage.cs b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/ISubscriptionStorage.cs similarity index 92% rename from src/unicast/NServiceBus.Unicast.Subscriptions/ISubscriptionStorage.cs rename to src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/ISubscriptionStorage.cs index 5741e770ab5..8f72bede5be 100644 --- a/src/unicast/NServiceBus.Unicast.Subscriptions/ISubscriptionStorage.cs +++ b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/ISubscriptionStorage.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; +namespace NServiceBus.Unicast.Subscriptions.MessageDrivenSubscriptions +{ + using System.Collections.Generic; -namespace NServiceBus.Unicast.Subscriptions -{ /// /// Defines storage for subscriptions /// @@ -12,14 +12,14 @@ public interface ISubscriptionStorage /// Subscribes the given client address to messages of the given types. /// /// - /// + /// void Subscribe(Address client, IEnumerable messageTypes); /// /// Unsubscribes the given client address from messages of the given types. /// /// - /// + /// void Unsubscribe(Address client, IEnumerable messageTypes); /// @@ -27,7 +27,7 @@ public interface ISubscriptionStorage /// of messages of the given message types. /// /// - /// + /// IEnumerable
    GetSubscriberAddressesForMessage(IEnumerable messageTypes); /// @@ -35,5 +35,5 @@ public interface ISubscriptionStorage /// any initialization work /// void Init(); - } + } } diff --git a/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/MessageDrivenSubscriptionManager.cs b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/MessageDrivenSubscriptionManager.cs new file mode 100644 index 00000000000..869c02c4710 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/MessageDrivenSubscriptionManager.cs @@ -0,0 +1,207 @@ +namespace NServiceBus.Unicast.Subscriptions.MessageDrivenSubscriptions +{ + using System; + using System.Diagnostics; + using System.Linq; + using System.Threading; + using Logging; + using MessageMutator; + using ObjectBuilder; + using Queuing; + using Transport; + using Transports; + + /// + /// Implements message driven subscriptions for transports that doesn't have native support for it (MSMQ , SqlServer, Azure Queues etc) + /// + public class MessageDrivenSubscriptionManager : IManageSubscriptions, + IMutateIncomingTransportMessages + + + { + public ISendMessages MessageSender { get; set; } + public IBuilder Builder { get; set; } + public ISubscriptionStorage SubscriptionStorage { get; set; } + public IAuthorizeSubscriptions SubscriptionAuthorizer { get { return subscriptionAuthorizer ?? (subscriptionAuthorizer = new NoopSubscriptionAuthorizer()); } set { subscriptionAuthorizer = value; } } + + public void Subscribe(Type eventType, Address publisherAddress) + { + if (publisherAddress == Address.Undefined) + throw new InvalidOperationException(string.Format("No destination could be found for message type {0}. Check the section of the configuration of this endpoint for an entry either for this specific message type or for its assembly.", eventType)); + + Logger.Info("Subscribing to " + eventType.AssemblyQualifiedName + " at publisher queue " + publisherAddress); + + var subscriptionMessage = CreateControlMessage(eventType); + subscriptionMessage.MessageIntent = MessageIntentEnum.Subscribe; + + ThreadPool.QueueUserWorkItem(state => + SendSubscribeMessageWithRetries(publisherAddress, subscriptionMessage, eventType.AssemblyQualifiedName)); + } + + + public void Unsubscribe(Type eventType, Address publisherAddress) + { + if (publisherAddress == Address.Undefined) + throw new InvalidOperationException(string.Format("No destination could be found for message type {0}. Check the section of the configuration of this endpoint for an entry either for this specific message type or for its assembly.", eventType)); + + Logger.Info("Unsubscribing from " + eventType.AssemblyQualifiedName + " at publisher queue " + publisherAddress); + + var subscriptionMessage = CreateControlMessage(eventType); + subscriptionMessage.MessageIntent = MessageIntentEnum.Unsubscribe; + + SendMessage(publisherAddress, subscriptionMessage); + } + + public event EventHandler ClientSubscribed; + + public void MutateIncoming(TransportMessage transportMessage) + { + string messageTypeString = GetSubscriptionMessageTypeFrom(transportMessage); + + var intent = transportMessage.MessageIntent; + + if (string.IsNullOrEmpty(messageTypeString) && intent != MessageIntentEnum.Subscribe && intent != MessageIntentEnum.Unsubscribe) + return; + + if (string.IsNullOrEmpty(messageTypeString)) + throw new InvalidOperationException("Message intent is Subscribe, but the subscription message type header is missing!"); + + if (intent != MessageIntentEnum.Subscribe && intent != MessageIntentEnum.Unsubscribe) + throw new InvalidOperationException("Subscription messages need to have intent set to Subscribe/Unsubscribe"); + + var subscriberAddress = transportMessage.ReplyToAddress; + + if (subscriberAddress == null || subscriberAddress == Address.Undefined) + throw new InvalidOperationException("Subscription message arrived without a valid ReplyToAddress"); + + + if (SubscriptionStorage == null) + { + var warning = string.Format("Subscription message from {0} arrived at this endpoint, yet this endpoint is not configured to be a publisher. To avoid this warning make this endpoint a publisher by configuring a subscription storage or using the As_aPublisher role.", subscriberAddress); + Logger.WarnFormat(warning); + + if (Debugger.IsAttached) // only under debug, so that we don't expose ourselves to a denial of service + throw new InvalidOperationException(warning); // and cause message to go to error queue by throwing an exception + + return; + } + + //service locate to avoid a circular dependency + Builder.Build().DoNotContinueDispatchingCurrentMessageToHandlers(); + + if (transportMessage.MessageIntent == MessageIntentEnum.Subscribe) + { + if (!SubscriptionAuthorizer.AuthorizeSubscribe(messageTypeString, subscriberAddress.ToString(), transportMessage.Headers)) + { + Logger.Debug(string.Format("Subscription request from {0} on message type {1} was refused.", subscriberAddress, messageTypeString)); + } + else + { + Logger.Info("Subscribing " + subscriberAddress + " to message type " + messageTypeString); + + var mt = new MessageType(messageTypeString); + + SubscriptionStorage.Subscribe(transportMessage.ReplyToAddress, new[] { mt }); + if (ClientSubscribed != null) + ClientSubscribed(this, new SubscriptionEventArgs + { + MessageType = messageTypeString, + SubscriberReturnAddress = subscriberAddress + }); + } + + return; + } + + + if (!SubscriptionAuthorizer.AuthorizeUnsubscribe(messageTypeString, subscriberAddress.ToString(), transportMessage.Headers)) + { + Logger.Debug(string.Format("Unsubscribe request from {0} on message type {1} was refused.", subscriberAddress, messageTypeString)); + return; + } + + Logger.Info("Unsubscribing " + subscriberAddress + " from message type " + messageTypeString); + SubscriptionStorage.Unsubscribe(subscriberAddress, new[] { new MessageType(messageTypeString) }); + } + + + + + static string GetSubscriptionMessageTypeFrom(TransportMessage msg) + { + return (from header in msg.Headers where header.Key == Headers.SubscriptionMessageType select header.Value).FirstOrDefault(); + } + + static TransportMessage CreateControlMessage(Type eventType) + { + var subscriptionMessage = ControlMessage.Create(Address.Local); + + subscriptionMessage.Headers[Headers.SubscriptionMessageType] = eventType.AssemblyQualifiedName; + return subscriptionMessage; + } + + void SendMessage(Address publisherAddress, TransportMessage subscriptionMessage) + { + //todo - not sure that we need to invoke the mutators + InvokeOutgoingTransportMessagesMutators(new object[] { }, subscriptionMessage); + + MessageSender.Send(subscriptionMessage, publisherAddress); + } + + + void SendSubscribeMessageWithRetries(Address destination, TransportMessage subscriptionMessage, string messageType, int retriesCount = 0) + { + try + { + SendMessage(destination, subscriptionMessage); + } + catch (QueueNotFoundException ex) + { + if (retriesCount < 10) + { + Thread.Sleep(TimeSpan.FromSeconds(2)); + SendSubscribeMessageWithRetries(destination, subscriptionMessage, messageType, ++retriesCount); + } + else + { + Logger.ErrorFormat("Failed to subscribe to {0} at publisher queue {1}", ex, messageType, destination); + } + } + } + + void InvokeOutgoingTransportMessagesMutators(object[] messages, TransportMessage result) + { + var mutators = Builder.BuildAll(); + if (mutators != null) + foreach (var mutator in mutators) + { + Logger.DebugFormat("Invoking transport message mutator: {0}", mutator.GetType().FullName); + mutator.MutateOutgoing(messages, result); + } + } + + + + readonly static ILog Logger = LogManager.GetLogger(typeof(MessageDrivenSubscriptionManager)); + + IAuthorizeSubscriptions subscriptionAuthorizer; + + } + + class StorageInitializer : IWantToRunWhenBusStartsAndStops + { + public ISubscriptionStorage SubscriptionStorage { get; set; } + + public void Start() + { + if (SubscriptionStorage != null) + SubscriptionStorage.Init(); + } + + public void Stop() + { + + } + + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/MessageDrivenSubscriptions.cs b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/MessageDrivenSubscriptions.cs new file mode 100644 index 00000000000..1bb9e556fc3 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/MessageDrivenSubscriptions.cs @@ -0,0 +1,15 @@ +namespace NServiceBus.Features +{ + using Unicast.Subscriptions.MessageDrivenSubscriptions; + using Unicast.Subscriptions.MessageDrivenSubscriptions.SubcriberSideFiltering; + + public class MessageDrivenSubscriptions : Feature + { + public override void Initialize() + { + Configure.Component(DependencyLifecycle.SingleInstance); + Configure.Component(DependencyLifecycle.InstancePerCall); + Configure.Component(DependencyLifecycle.SingleInstance); + } + } +} \ No newline at end of file diff --git a/src/unicast/NServiceBus.Unicast.Subscriptions/MessageType.cs b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/MessageType.cs similarity index 96% rename from src/unicast/NServiceBus.Unicast.Subscriptions/MessageType.cs rename to src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/MessageType.cs index b828e8607e3..463893d65ed 100644 --- a/src/unicast/NServiceBus.Unicast.Subscriptions/MessageType.cs +++ b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/MessageType.cs @@ -1,146 +1,146 @@ -namespace NServiceBus.Unicast.Subscriptions -{ - using System; - using System.Linq; - - /// - /// Representation of a message type that clients can be subscribed to - /// - public class MessageType - { - /// - /// Initializes the message type from the given type - /// - /// - public MessageType(Type type) - { - Version = type.Assembly.GetName().Version; - TypeName = type.FullName; - } - - /// - /// Initializes the message type from the given string. - /// - /// - public MessageType(string messageTypeString) - { - var parts = messageTypeString.Split(','); - - - Version = ParseVersion(messageTypeString); - TypeName = parts.First(); - } - - /// - /// Initializes the message type from the given string. - /// - /// - /// - public MessageType(string typeName, string versionString) - { - Version = ParseVersion(versionString); - TypeName = typeName; - } - - /// - /// Initializes the message type from the given string. - /// - /// - /// - public MessageType(string typeName,Version version) - { - Version = version; - TypeName = typeName; - } - - Version ParseVersion(string versionString) - { - const string version = "Version="; - var index = versionString.IndexOf(version); - - if(index >= 0) - versionString = versionString.Substring(index + version.Length) - .Split(',').First(); - return Version.Parse(versionString); - } - - - /// - /// TypeName of the message - /// - public string TypeName { get;private set; } - - /// - /// Version of the message - /// - public Version Version { get; private set; } - - /// - /// Overriden to append Version along with Type Name - /// - /// - public override string ToString() - { - return TypeName + ", Version=" + Version; - } - - /// - /// Equality, only major version is used - /// - /// - /// - public bool Equals(MessageType other) - { - if (ReferenceEquals(null, other)) return false; - if (ReferenceEquals(this, other)) return true; - return Equals(other.TypeName, TypeName) && other.Version.Major == Version.Major; - } - - /// - /// Equality, only Type is same - /// - /// - /// - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != typeof (MessageType)) return false; - return Equals((MessageType) obj); - } - - /// - /// Gets Hash Code - /// - /// - public override int GetHashCode() - { - unchecked - { - return (TypeName.GetHashCode()*397) ^ Version.GetHashCode(); - } - } - - /// - /// Equality - /// - /// - /// - /// - public static bool operator ==(MessageType left, MessageType right) - { - return Equals(left, right); - } - - /// - /// Equality - /// - /// - /// - /// - public static bool operator !=(MessageType left, MessageType right) - { - return !Equals(left, right); - } - } +namespace NServiceBus.Unicast.Subscriptions +{ + using System; + using System.Linq; + + /// + /// Representation of a message type that clients can be subscribed to + /// + public class MessageType + { + /// + /// Initializes the message type from the given type + /// + /// + public MessageType(Type type) + { + Version = type.Assembly.GetName().Version; + TypeName = type.FullName; + } + + /// + /// Initializes the message type from the given string. + /// + /// + public MessageType(string messageTypeString) + { + var parts = messageTypeString.Split(','); + + + Version = ParseVersion(messageTypeString); + TypeName = parts.First(); + } + + /// + /// Initializes the message type from the given string. + /// + /// + /// + public MessageType(string typeName, string versionString) + { + Version = ParseVersion(versionString); + TypeName = typeName; + } + + /// + /// Initializes the message type from the given string. + /// + /// + /// + public MessageType(string typeName,Version version) + { + Version = version; + TypeName = typeName; + } + + Version ParseVersion(string versionString) + { + const string version = "Version="; + var index = versionString.IndexOf(version); + + if(index >= 0) + versionString = versionString.Substring(index + version.Length) + .Split(',').First(); + return Version.Parse(versionString); + } + + + /// + /// TypeName of the message + /// + public string TypeName { get;private set; } + + /// + /// Version of the message + /// + public Version Version { get; private set; } + + /// + /// Overriden to append Version along with Type Name + /// + /// + public override string ToString() + { + return TypeName + ", Version=" + Version; + } + + /// + /// Equality, only major version is used + /// + /// + /// + public bool Equals(MessageType other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return Equals(other.TypeName, TypeName) && other.Version.Major == Version.Major; + } + + /// + /// Equality, only Type is same + /// + /// + /// + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != typeof (MessageType)) return false; + return Equals((MessageType) obj); + } + + /// + /// Gets Hash Code + /// + /// + public override int GetHashCode() + { + unchecked + { + return (TypeName.GetHashCode()*397) ^ Version.GetHashCode(); + } + } + + /// + /// Equality + /// + /// + /// + /// + public static bool operator ==(MessageType left, MessageType right) + { + return Equals(left, right); + } + + /// + /// Equality + /// + /// + /// + /// + public static bool operator !=(MessageType left, MessageType right) + { + return !Equals(left, right); + } + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/NoopSubscriptionAuthorizer.cs b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/NoopSubscriptionAuthorizer.cs new file mode 100644 index 00000000000..7214daf92d3 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/NoopSubscriptionAuthorizer.cs @@ -0,0 +1,17 @@ +namespace NServiceBus.Unicast.Subscriptions.MessageDrivenSubscriptions +{ + using System.Collections.Generic; + + public class NoopSubscriptionAuthorizer : IAuthorizeSubscriptions + { + public bool AuthorizeSubscribe(string messageType, string clientEndpoint, IDictionary headers) + { + return true; + } + + public bool AuthorizeUnsubscribe(string messageType, string clientEndpoint, IDictionary headers) + { + return true; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/StorageDrivenPublisher.cs b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/StorageDrivenPublisher.cs new file mode 100644 index 00000000000..02b4d891713 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/StorageDrivenPublisher.cs @@ -0,0 +1,31 @@ +namespace NServiceBus.Features +{ + using Config; + using Logging; + using Settings; + using Transports; + using Unicast.Subscriptions.MessageDrivenSubscriptions; + + /// + /// Adds support for pub/sub using a external subscription storage. This brings pub/sub to transport that lacks native support. + /// + public class StorageDrivenPublisher : Feature + { + public override void Initialize() + { + var transportDefinition = SettingsHolder.GetOrDefault("NServiceBus.Transport.SelectedTransport"); + + if (transportDefinition != null && transportDefinition.HasNativePubSubSupport) + { + Logger.WarnFormat("The StorageDrivenPublisher feature is enabled but the transport has native pub/sub capabilities. Feature will not be initialized. This is most likely happening because you're specifying the As_a_Publisher role which is only relevant for transports without native pub/sub like Msmq, SqlServer etc"); + return; + } + + Configure.Component(DependencyLifecycle.InstancePerCall); + + InfrastructureServices.Enable(); + } + + static readonly ILog Logger = LogManager.GetLogger(typeof(StorageDrivenPublisher)); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/SubcriberSideFiltering/FilteringMutator.cs b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/SubcriberSideFiltering/FilteringMutator.cs new file mode 100644 index 00000000000..0f782ef5a63 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/SubcriberSideFiltering/FilteringMutator.cs @@ -0,0 +1,32 @@ +namespace NServiceBus.Unicast.Subscriptions.MessageDrivenSubscriptions.SubcriberSideFiltering +{ + using NServiceBus.Logging; + using NServiceBus.MessageMutator; + using NServiceBus.ObjectBuilder; + + public class FilteringMutator:IMutateIncomingMessages + { + public SubscriptionPredicatesEvaluator SubscriptionPredicatesEvaluator { get; set; } + public IBuilder Builder { get; set; } + + public object MutateIncoming(object message) + { + if (SubscriptionPredicatesEvaluator == null) + return message; + + foreach (var condition in SubscriptionPredicatesEvaluator.GetConditionsForMessage(message)) + { + if (condition(message)) continue; + + Logger.Debug(string.Format("Condition {0} failed for message {1}", condition, message.GetType().Name)); + + //service locate to avoid a circular dependency + Builder.Build().DoNotContinueDispatchingCurrentMessageToHandlers(); + break; + } + return message; + } + + readonly static ILog Logger = LogManager.GetLogger(typeof(FilteringMutator)); + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/SubcriberSideFiltering/SubscriptionPredicatesEvaluator.cs b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/SubcriberSideFiltering/SubscriptionPredicatesEvaluator.cs new file mode 100644 index 00000000000..4116e1f507c --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Subscriptions/MessageDrivenSubscriptions/SubcriberSideFiltering/SubscriptionPredicatesEvaluator.cs @@ -0,0 +1,59 @@ +namespace NServiceBus.Unicast.Subscriptions.MessageDrivenSubscriptions.SubcriberSideFiltering +{ + using System; + using System.Collections.Generic; + + /// + /// Manages subscriptions and predicates for messages published by other endpoints + /// and subscribed to by the local bus. + /// + /// + /// Thread safe. + /// + public class SubscriptionPredicatesEvaluator + { + /// + /// Gets the list of conditions associated with a message. + /// + /// The message to get conditions for. + /// A list of conditions that are associated with type of message provided. + public IList> GetConditionsForMessage(object message) + { + var result = new List>(); + + lock (locker) + if (messageTypeToConditionLookup.ContainsKey(message.GetType())) + foreach (Predicate condition in this.messageTypeToConditionLookup[message.GetType()]) + result.Add(condition); + + return result; + } + + /// + /// Adds a condition to a message type. + /// + /// The message type to add a condition to. + /// The condition to add. + /// + /// All conditions added to a message type must be met if the messages of that type + /// are to be published to a subscriber. + public void AddConditionForSubscriptionToMessageType(Type messageType, Predicate condition) + { + if (condition == null) + return; + + lock (locker) + { + if (!messageTypeToConditionLookup.ContainsKey(messageType)) + messageTypeToConditionLookup.Add(messageType, new List>()); + + if (!messageTypeToConditionLookup[messageType].Contains(condition)) + messageTypeToConditionLookup[messageType].Add(condition); + } + } + + private readonly IDictionary>> messageTypeToConditionLookup = new Dictionary>>(); + + private readonly object locker = new object(); + } +} diff --git a/src/NServiceBus.Core/Unicast/Subscriptions/SubscriptionEventArgs.cs b/src/NServiceBus.Core/Unicast/Subscriptions/SubscriptionEventArgs.cs new file mode 100644 index 00000000000..4b4579efe88 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Subscriptions/SubscriptionEventArgs.cs @@ -0,0 +1,20 @@ +namespace NServiceBus.Unicast.Subscriptions +{ + using System; + + /// + /// Contains which client subscribed to which message + /// + public class SubscriptionEventArgs : EventArgs + { + /// + /// The address of the subscriber. + /// + public Address SubscriberReturnAddress { get; set; } + + /// + /// The type of message the client subscribed to. + /// + public string MessageType { get; set; } + } +} diff --git a/src/NServiceBus.Core/Unicast/Transport/Config/AdvancedTransactionalConfig.cs b/src/NServiceBus.Core/Unicast/Transport/Config/AdvancedTransactionalConfig.cs new file mode 100644 index 00000000000..b529e95419e --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Transport/Config/AdvancedTransactionalConfig.cs @@ -0,0 +1,18 @@ +namespace NServiceBus.Unicast.Transport.Transactional.Config +{ + public static class AdvancedTransactionalConfig + { + /// + /// Suppress the use of DTC. Can be combined with IsTransactional to turn off + /// the DTC but still use the retries + /// + /// + /// + [ObsoleteEx(Replacement = "Configure.Transactions.Advanced()", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public static Configure SupressDTC(this Configure config) + { + Configure.Transactions.Advanced(settings => settings.DisableDistributedTransactions()); + return config; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Transport/Config/Bootstrapper.cs b/src/NServiceBus.Core/Unicast/Transport/Config/Bootstrapper.cs new file mode 100644 index 00000000000..87796f64a99 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Transport/Config/Bootstrapper.cs @@ -0,0 +1,62 @@ +namespace NServiceBus.Unicast.Transport.Config +{ + using System; + using System.Configuration; + using Licensing; + using NServiceBus.Config; + using INeedInitialization = INeedInitialization; + + public class Bootstrapper : INeedInitialization + { + public void Init() + { + LoadConfigurationSettings(); + + if (LicenseManager.CurrentLicense.MaxThroughputPerSecond > 0) + { + if (maximumThroughput == 0 || LicenseManager.CurrentLicense.MaxThroughputPerSecond < maximumThroughput) + maximumThroughput = LicenseManager.CurrentLicense.MaxThroughputPerSecond; + } + + var transactionSettings = new TransactionSettings + { + MaxRetries = maximumNumberOfRetries + }; + + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(t => t.TransactionSettings, transactionSettings) + .ConfigureProperty(t => t.MaximumConcurrencyLevel, GetAllowedNumberOfThreads(numberOfWorkerThreadsInAppConfig)) + .ConfigureProperty(t => t.MaxThroughputPerSecond, maximumThroughput); + } + + static int GetAllowedNumberOfThreads(int numberOfWorkerThreadsInConfig) + { + int workerThreadsInLicenseFile = LicenseManager.CurrentLicense.AllowedNumberOfThreads; + + return Math.Min(workerThreadsInLicenseFile, numberOfWorkerThreadsInConfig); + } + + void LoadConfigurationSettings() + { + var transportConfig = Configure.GetConfigSection(); + + if (transportConfig != null) + { + maximumNumberOfRetries = transportConfig.MaxRetries; + maximumThroughput = transportConfig.MaximumMessageThroughputPerSecond; + + numberOfWorkerThreadsInAppConfig = transportConfig.MaximumConcurrencyLevel; + return; + } + + if (Configure.GetConfigSection() != null) + { + throw new ConfigurationErrorsException("'MsmqTransportConfig' section is obsolete. Please update your configuration to use the new 'TransportConfig' section instead. You can use the PowerShell cmdlet 'Add-NServiceBusTransportConfig' in the Package Manager Console to quickly add it for you."); + } + } + + int maximumThroughput; + int maximumNumberOfRetries = 5; + int numberOfWorkerThreadsInAppConfig = 1; + } +} diff --git a/src/NServiceBus.Core/Unicast/Transport/Config/TransportReceiverConfig.cs b/src/NServiceBus.Core/Unicast/Transport/Config/TransportReceiverConfig.cs new file mode 100644 index 00000000000..9d871a1d070 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Transport/Config/TransportReceiverConfig.cs @@ -0,0 +1,91 @@ +namespace NServiceBus +{ + using System; + using System.Linq; + using Transports; + using Unicast.Transport; + + /// + /// Extension methods to configure transport. + /// + public static class TransportReceiverConfig + { + /// + /// Configures NServiceBus to use the given transport. + /// + /// Type of to be configured. + /// The configuration object. + /// The connectionstring name to use to retrieve the connectionstring from. + /// The configuration object. + public static Configure UseTransport(this Configure config, string connectionStringName = null) where T : TransportDefinition + { + return UseTransport(config, typeof(T), connectionStringName); + } + + /// + /// Configures NServiceBus to use the given transport. + /// + /// Type of to be configured. + /// The configuration object. + /// Specifies a callback to call to retrieve the connectionstring to use + /// The configuration object. + public static Configure UseTransport(this Configure config, Func definesConnectionString) where T : TransportDefinition + { + return UseTransport(config, typeof(T), definesConnectionString); + } + + /// + /// Configures NServiceBus to use the given transport. + /// + /// The configuration object. + /// Type of to be configured. + /// The connectionstring name to use to retrieve the connectionstring from. + /// The configuration object. + public static Configure UseTransport(this Configure config, Type transportDefinitionType, string connectionStringName = null) + { + var transportConfigurer = CreateTransportConfigurer(transportDefinitionType); + + if (!string.IsNullOrEmpty(connectionStringName)) + { + TransportConnectionString.DefaultConnectionStringName = connectionStringName; + } + + transportConfigurer.Configure(config); + + return config; + } + + /// + /// Configures NServiceBus to use the given transport. + /// + /// The configuration object. + /// Type of to be configured. + /// Specifies a callback to call to retrieve the connectionstring to use + /// The configuration object. + public static Configure UseTransport(this Configure config, Type transportDefinitionType, Func definesConnectionString) + { + var transportConfigurer = CreateTransportConfigurer(transportDefinitionType); + + TransportConnectionString.Override(definesConnectionString); + + transportConfigurer.Configure(config); + + return config; + } + + private static IConfigureTransport CreateTransportConfigurer(Type transportDefinitionType) + { + var transportConfigurerType = + Configure.TypesToScan.SingleOrDefault( + t => typeof (IConfigureTransport<>).MakeGenericType(transportDefinitionType).IsAssignableFrom(t)); + + if (transportConfigurerType == null) + throw new InvalidOperationException( + "We couldn't find a IConfigureTransport implementation for your selected transport: " + + transportDefinitionType.Name); + + var transportConfigurer = (IConfigureTransport) Activator.CreateInstance(transportConfigurerType); + return transportConfigurer; + } + } +} \ No newline at end of file diff --git a/src/unicastTransport/NServiceBus.Unicast.Transport/ControlMessage.cs b/src/NServiceBus.Core/Unicast/Transport/ControlMessage.cs similarity index 82% rename from src/unicastTransport/NServiceBus.Unicast.Transport/ControlMessage.cs rename to src/NServiceBus.Core/Unicast/Transport/ControlMessage.cs index dc254275d3a..e236e1c4e7f 100644 --- a/src/unicastTransport/NServiceBus.Unicast.Transport/ControlMessage.cs +++ b/src/NServiceBus.Core/Unicast/Transport/ControlMessage.cs @@ -1,46 +1,42 @@ -namespace NServiceBus.Unicast.Transport -{ - using System.Collections.Generic; - - /// - /// Helper for creating control messages - /// - public static class ControlMessage - { - /// - /// Creates Transport Message - /// - /// Transport Message - public static TransportMessage Create(Address replyToAddress) - { - var transportMessage = new TransportMessage - { - ReplyToAddress = replyToAddress, - Headers = new Dictionary(), - Recoverable = true, - MessageIntent = MessageIntentEnum.Send - }; - transportMessage.Headers.Add(Headers.ControlMessageHeader, true.ToString()); - - return transportMessage; - } - } - - /// - /// Extensions to make the usage if control messages easier - /// - public static class TransportMessageExtensions - { - /// - /// True if the transport message is a control message - /// - /// - /// - public static bool IsControlMessage(this TransportMessage transportMessage) - { - return transportMessage.Headers != null && - transportMessage.Headers.ContainsKey(Headers.ControlMessageHeader); - } - - } -} \ No newline at end of file +namespace NServiceBus.Unicast.Transport +{ + /// + /// Helper for creating control messages + /// + public static class ControlMessage + { + /// + /// Creates Transport Message + /// + /// Transport Message + public static TransportMessage Create(Address replyToAddress) + { + var transportMessage = new TransportMessage + { + ReplyToAddress = replyToAddress, + Recoverable = true, + }; + transportMessage.Headers.Add(Headers.ControlMessageHeader, true.ToString()); + + return transportMessage; + } + } + + /// + /// Extensions to make the usage if control messages easier + /// + public static class TransportMessageExtensions + { + /// + /// True if the transport message is a control message + /// + /// + /// + public static bool IsControlMessage(this TransportMessage transportMessage) + { + return transportMessage.Headers != null && + transportMessage.Headers.ContainsKey(Headers.ControlMessageHeader); + } + + } +} diff --git a/src/unicastTransport/NServiceBus.Unicast.Transport/FailedMessageProcessingEventArgs.cs b/src/NServiceBus.Core/Unicast/Transport/FailedMessageProcessingEventArgs.cs similarity index 96% rename from src/unicastTransport/NServiceBus.Unicast.Transport/FailedMessageProcessingEventArgs.cs rename to src/NServiceBus.Core/Unicast/Transport/FailedMessageProcessingEventArgs.cs index eec363cfae5..814b8975b3b 100644 --- a/src/unicastTransport/NServiceBus.Unicast.Transport/FailedMessageProcessingEventArgs.cs +++ b/src/NServiceBus.Core/Unicast/Transport/FailedMessageProcessingEventArgs.cs @@ -1,24 +1,24 @@ -namespace NServiceBus.Unicast.Transport -{ - using System; - - /// - /// Defives the event data for the failed message processing event - /// - public class FailedMessageProcessingEventArgs : EventArgs - { - /// - /// The exception that caused the processing to fail - /// - public Exception Reason { get; private set; } - - /// - /// Initialized the event arg with the actual exception - /// - /// - public FailedMessageProcessingEventArgs(Exception ex) - { - Reason = ex; - } - } +namespace NServiceBus.Unicast.Transport +{ + using System; + + /// + /// Defives the event data for the failed message processing event + /// + public class FailedMessageProcessingEventArgs : EventArgs + { + /// + /// The exception that caused the processing to fail + /// + public Exception Reason { get; private set; } + + /// + /// Initialized the event arg with the actual exception + /// + /// + public FailedMessageProcessingEventArgs(Exception ex) + { + Reason = ex; + } + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Transport/FirstLevelRetries.cs b/src/NServiceBus.Core/Unicast/Transport/FirstLevelRetries.cs new file mode 100644 index 00000000000..56c46a1eab7 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Transport/FirstLevelRetries.cs @@ -0,0 +1,86 @@ +namespace NServiceBus.Unicast.Transport +{ + using System; + using System.Collections.Concurrent; + using NServiceBus.Faults; + + internal class FirstLevelRetries + { + private readonly ConcurrentDictionary> failuresPerMessage = new ConcurrentDictionary>(); + private readonly IManageMessageFailures failureManager; + private readonly int maxRetries; + + public FirstLevelRetries(int maxRetries, IManageMessageFailures failureManager) + { + this.maxRetries = maxRetries; + this.failureManager = failureManager; + } + + public bool HasMaxRetriesForMessageBeenReached(TransportMessage message) + { + string messageId = message.Id; + Tuple e; + + if (failuresPerMessage.TryGetValue(messageId, out e)) + { + if (e.Item1 < maxRetries) + { + return false; + } + + if (TryInvokeFaultManager(message, e.Item2)) + { + ClearFailuresForMessage(message); + } + + return true; + } + + return false; + } + + public void ClearFailuresForMessage(TransportMessage message) + { + string messageId = message.Id; + Tuple e; + failuresPerMessage.TryRemove(messageId, out e); + } + + public void IncrementFailuresForMessage(TransportMessage message, Exception e) + { + failuresPerMessage.AddOrUpdate(message.Id, new Tuple(1, e), + (s, i) => new Tuple(i.Item1 + 1, e)); + } + + private bool TryInvokeFaultManager(TransportMessage message, Exception exception) + { + try + { + Exception e = exception; + + if (e is AggregateException) + { + e = e.GetBaseException(); + } + + if (e is TransportMessageHandlingFailedException) + { + e = e.InnerException; + } + + message.RevertToOriginalBodyIfNeeded(); + + failureManager.ProcessingAlwaysFailsForMessage(message, e); + + return true; + } + catch (Exception ex) + { + Configure.Instance.RaiseCriticalError( + String.Format("Fault manager failed to process the failed message with id {0}", message.Id), ex); + } + + return false; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Transport/ITransport.cs b/src/NServiceBus.Core/Unicast/Transport/ITransport.cs new file mode 100644 index 00000000000..412a57d4102 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Transport/ITransport.cs @@ -0,0 +1,102 @@ +namespace NServiceBus.Unicast.Transport +{ + using System; + + /// + /// Defines the basic functionality of a transport to be used by NServiceBus. + /// + public interface ITransport + { + /// + /// Starts the transport. + /// + /// + /// The adress of a local queue that should be used as input channel for this transport + /// + [ObsoleteEx(Replacement = "Start(Address localAddress)", RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0")] + void Start(string inputqueue); + + /// + /// Starts the transport listening for messages on the given local address. + /// + /// + void Start(Address localAddress); + + /// + /// Gets the number of worker threads currently running in the transport. + /// + [ObsoleteEx(Replacement = "MaximumConcurrencyLevel", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + int NumberOfWorkerThreads { get; } + + /// + /// Gets the maximum concurrency level this is able to support. + /// + int MaximumConcurrencyLevel { get; } + + /// + /// Changes the number of worker threads running in the transport. + /// This may stop active worker threads; those threads will finish + /// processing their current message and then exit. + /// + /// + /// The requested number of active worker threads after + /// the necessary threads have been stopped or started. + /// + [ObsoleteEx(Replacement = "ChangeMaximumConcurrencyLevel(int maximumConcurrencyLevel)", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + void ChangeNumberOfWorkerThreads(int targetNumberOfWorkerThreads); + + /// + /// Updates the maximum concurrency level this is able to support. + /// + /// The new maximum concurrency level for this . + void ChangeMaximumConcurrencyLevel(int maximumConcurrencyLevel); + + /// + /// Throttling receiving messages rate. You can't set the value than the value specified at your license. + /// + [ObsoleteEx(Replacement = "MaximumMessageThroughputPerSecond and ChangeMaximumMessageThroughputPerSecond(int maximumMessageThroughputPerSecond)", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + int MaxThroughputPerSecond { get; set; } + + /// + /// Gets the receiving messages rate. + /// + int MaximumMessageThroughputPerSecond { get; } + + /// + /// Updates the max throughput per second. + /// + /// The new max throughput. + void ChangeMaximumMessageThroughputPerSecond(int maximumMessageThroughputPerSecond); + + /// + /// Raised when a message is received. + /// + event EventHandler TransportMessageReceived; + + /// + /// Raised when a message is available but before is raised. + /// + event EventHandler StartedMessageProcessing; + + /// + /// Raised after message processing was completed, even in case of an exception in message processing. + /// + event EventHandler FinishedMessageProcessing; + + /// + /// Raised if an exception was encountered at any point in the processing - including + /// when the transaction commits. + /// + event EventHandler FailedMessageProcessing; + + /// + /// Causes the current message being handled to return to the queue. + /// + void AbortHandlingCurrentMessage(); + + /// + /// Stops the transport. + /// + void Stop(); + } +} diff --git a/src/NServiceBus.Core/Unicast/Transport/Monitoring/ReceivePerformanceDiagnostics.cs b/src/NServiceBus.Core/Unicast/Transport/Monitoring/ReceivePerformanceDiagnostics.cs new file mode 100644 index 00000000000..8e4ba686dac --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Transport/Monitoring/ReceivePerformanceDiagnostics.cs @@ -0,0 +1,125 @@ +namespace NServiceBus.Unicast.Transport.Monitoring +{ + using System; + using System.Diagnostics; + using Logging; + + internal class ReceivePerformanceDiagnostics : IDisposable + { + const string CategoryName = "NServiceBus"; + static readonly ILog Logger = LogManager.GetLogger(typeof (ReceivePerformanceDiagnostics)); + readonly Address receiveAddress; + bool disposed; + bool enabled; + PerformanceCounter failureRateCounter; + PerformanceCounter successRateCounter; + PerformanceCounter throughputCounter; + + public ReceivePerformanceDiagnostics(Address receiveAddress) + { + this.receiveAddress = receiveAddress; + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + if (successRateCounter != null) + { + successRateCounter.Dispose(); + } + if (throughputCounter != null) + { + throughputCounter.Dispose(); + } + if (failureRateCounter != null) + { + failureRateCounter.Dispose(); + } + } + disposed = true; + } + + ~ReceivePerformanceDiagnostics() + { + Dispose(false); + } + + public void Initialize() + { + if (!InstantiateCounter()) + { + return; + } + + enabled = true; + } + + public void MessageProcessed() + { + if (!enabled) + { + return; + } + + successRateCounter.Increment(); + } + + public void MessageFailed() + { + if (!enabled) + { + return; + } + + failureRateCounter.Increment(); + } + + public void MessageDequeued() + { + if (!enabled) + { + return; + } + + throughputCounter.Increment(); + } + + + bool InstantiateCounter() + { + return SetupCounter("# of msgs successfully processed / sec", ref successRateCounter) + && SetupCounter("# of msgs pulled from the input queue /sec", ref throughputCounter) + && SetupCounter("# of msgs failures / sec", ref failureRateCounter); + } + + bool SetupCounter(string counterName, ref PerformanceCounter counter) + { + try + { + counter = new PerformanceCounter(CategoryName, counterName, receiveAddress.Queue, false); + var t = counter.CounterType; //access the counter type to force a exception to be thrown if the counter doesn't exists + } + catch (Exception) + { + Logger.InfoFormat( + "NServiceBus performance counter for {1} is not set up correctly, no statistics will be emitted for the {0} queue. Execute the Install-NServiceBusPerformanceCounters cmdlet to create the counter.", + receiveAddress.Queue, counterName); + return false; + } + Logger.DebugFormat("'{0}' counter initialized for '{1}'", counterName, receiveAddress); + return true; + } + } +} \ No newline at end of file diff --git a/src/unicastTransport/NServiceBus.Unicast.Transport/StartedMessageProcessingEventArgs.cs b/src/NServiceBus.Core/Unicast/Transport/StartedMessageProcessingEventArgs.cs similarity index 96% rename from src/unicastTransport/NServiceBus.Unicast.Transport/StartedMessageProcessingEventArgs.cs rename to src/NServiceBus.Core/Unicast/Transport/StartedMessageProcessingEventArgs.cs index 73678549c90..f2420a33674 100644 --- a/src/unicastTransport/NServiceBus.Unicast.Transport/StartedMessageProcessingEventArgs.cs +++ b/src/NServiceBus.Core/Unicast/Transport/StartedMessageProcessingEventArgs.cs @@ -1,30 +1,30 @@ -namespace NServiceBus.Unicast.Transport -{ - using System; - - /// - /// Defines the arguments passed to the event handler of the - /// event. - /// - public class StartedMessageProcessingEventArgs : EventArgs - { - /// - /// Initializes a new TransportMessageReceivedEventArgs. - /// - /// The message that was received. - public StartedMessageProcessingEventArgs(TransportMessage m) - { - message = m; - } - - readonly TransportMessage message; - - /// - /// Gets the message received. - /// - public TransportMessage Message - { - get { return message; } - } - } +namespace NServiceBus.Unicast.Transport +{ + using System; + + /// + /// Defines the arguments passed to the event handler of the + /// event. + /// + public class StartedMessageProcessingEventArgs : EventArgs + { + /// + /// Initializes a new TransportMessageReceivedEventArgs. + /// + /// The message that was received. + public StartedMessageProcessingEventArgs(TransportMessage m) + { + message = m; + } + + readonly TransportMessage message; + + /// + /// Gets the message received. + /// + public TransportMessage Message + { + get { return message; } + } + } } \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Transport/ThroughputLimiter.cs b/src/NServiceBus.Core/Unicast/Transport/ThroughputLimiter.cs new file mode 100644 index 00000000000..af5df24e52f --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Transport/ThroughputLimiter.cs @@ -0,0 +1,62 @@ +namespace NServiceBus.Unicast.Transport +{ + using System.Threading; + + /// + /// Support for throughput limitation of the transport + /// + internal class ThroughputLimiter + { + public void Start(int limit) + { + if (limit <= 0) + return; + + througputSemaphore = new SemaphoreSlim(limit, limit); + timer = new Timer(ResetLimit, null, 0, 1000); + } + + public void Stop() + { + if (througputSemaphore == null) + { + return; + } + + timer.Dispose(); + + stopResetEvent.WaitOne(); + + througputSemaphore.Dispose(); + througputSemaphore = null; + } + + public void MessageProcessed() + { + if (througputSemaphore == null) + return; + + througputSemaphore.Wait(); + Interlocked.Increment(ref numberOfMessagesProcessed); + } + + void ResetLimit(object state) + { + stopResetEvent.Reset(); + + var numberOfMessagesProcessedSnapshot = Interlocked.Exchange(ref numberOfMessagesProcessed, 0); + + if (numberOfMessagesProcessedSnapshot > 0) + { + througputSemaphore.Release((int) numberOfMessagesProcessedSnapshot); + } + + stopResetEvent.Set(); + } + + readonly ManualResetEvent stopResetEvent = new ManualResetEvent(true); + Timer timer; + long numberOfMessagesProcessed; + SemaphoreSlim througputSemaphore; + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Transport/TransactionSettings.cs b/src/NServiceBus.Core/Unicast/Transport/TransactionSettings.cs new file mode 100644 index 00000000000..ca45f29524f --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Transport/TransactionSettings.cs @@ -0,0 +1,75 @@ +namespace NServiceBus.Unicast.Transport +{ + using System; + using System.Transactions; + using Settings; + + public class TransactionSettings + { + public TransactionSettings() + { + MaxRetries = 5; + IsTransactional = SettingsHolder.Get("Transactions.Enabled"); + TransactionTimeout = SettingsHolder.Get("Transactions.DefaultTimeout"); + IsolationLevel = SettingsHolder.Get("Transactions.IsolationLevel"); + DontUseDistributedTransactions = SettingsHolder.Get("Transactions.SuppressDistributedTransactions"); + DoNotWrapHandlersExecutionInATransactionScope = SettingsHolder.Get("Transactions.DoNotWrapHandlersExecutionInATransactionScope"); + } + + protected TransactionSettings(bool isTransactional, TimeSpan transactionTimeout, IsolationLevel isolationLevel, int maxRetries, bool dontUseDistributedTransactions, bool doNotWrapHandlersExecutionInATransactionScope) + { + IsTransactional = isTransactional; + TransactionTimeout = transactionTimeout; + IsolationLevel = isolationLevel; + MaxRetries = maxRetries; + DontUseDistributedTransactions = dontUseDistributedTransactions; + DoNotWrapHandlersExecutionInATransactionScope = doNotWrapHandlersExecutionInATransactionScope; + } + + public static TransactionSettings Default + { + get + { + return new TransactionSettings(true, TimeSpan.FromSeconds(30), IsolationLevel.ReadCommitted, 5, false,false); + } + } + + /// + /// Sets whether or not the transport is transactional. + /// + public bool IsTransactional { get; set; } + + /// + /// Property for getting/setting the period of time when the transaction times out. + /// Only relevant when is set to true. + /// + public TimeSpan TransactionTimeout { get; set; } + + /// + /// Property for getting/setting the isolation level of the transaction scope. + /// Only relevant when is set to true. + /// + public IsolationLevel IsolationLevel { get; set; } + + /// + /// Sets the maximum number of times a message will be retried + /// when an exception is thrown as a result of handling the message. + /// This value is only relevant when is true. + /// + /// + /// Default value is 5. + /// + public int MaxRetries { get; set; } + + + /// + /// If true the transport won't enlist in distributed transactions + /// + public bool DontUseDistributedTransactions { get; set; } + + /// + /// Controls if the message handlers should be wrapped in a transactionscope + /// + public bool DoNotWrapHandlersExecutionInATransactionScope { get; set; } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Transport/TransportConnectionString.cs b/src/NServiceBus.Core/Unicast/Transport/TransportConnectionString.cs new file mode 100644 index 00000000000..f84e9c54616 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Transport/TransportConnectionString.cs @@ -0,0 +1,32 @@ +namespace NServiceBus.Unicast.Transport +{ + using System; + using System.Configuration; + + public static class TransportConnectionString + { + public static void Override(Func func) + { + GetValue = _ => func(); + } + + public static string GetConnectionStringOrNull(string connectionStringName = null) + { + return GetValue(connectionStringName ?? DefaultConnectionStringName); + } + + static Func GetValue = connectionStringName => + { + var connectionStringSettings = ConfigurationManager.ConnectionStrings[connectionStringName]; + + if (connectionStringSettings == null) + { + return null; + } + + return connectionStringSettings.ConnectionString; + }; + + public static string DefaultConnectionStringName = "NServiceBus/Transport"; + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Transport/TransportMessageAvailableEventArgs.cs b/src/NServiceBus.Core/Unicast/Transport/TransportMessageAvailableEventArgs.cs new file mode 100644 index 00000000000..d815a59fa26 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Transport/TransportMessageAvailableEventArgs.cs @@ -0,0 +1,31 @@ +namespace NServiceBus.Unicast.Transport +{ + using System; + + /// + /// Provides data for the MessageDequeued event. + /// + public class TransportMessageAvailableEventArgs : EventArgs + { + private readonly TransportMessage message; + + /// + /// Default constructor for . + /// + /// + /// The received . + /// + public TransportMessageAvailableEventArgs(TransportMessage m) + { + message = m; + } + + /// + /// The received . + /// + public TransportMessage Message + { + get { return message; } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Core/Unicast/Transport/TransportMessageHandlingFailedException.cs b/src/NServiceBus.Core/Unicast/Transport/TransportMessageHandlingFailedException.cs new file mode 100644 index 00000000000..97c860a4544 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Transport/TransportMessageHandlingFailedException.cs @@ -0,0 +1,19 @@ +namespace NServiceBus.Unicast.Transport +{ + using System; + + /// + /// Exception used to transport exceptions encountered in message handlers. + /// + public class TransportMessageHandlingFailedException : Exception + { + /// + /// Constructor + /// + /// The exception that got thrown from the message handler. + public TransportMessageHandlingFailedException(Exception originalException) + : base("An exception was thrown by the message handler.", originalException) + { + } + } +} \ No newline at end of file diff --git a/src/unicastTransport/NServiceBus.Unicast.Transport/TransportMessageReceivedEventArgs.cs b/src/NServiceBus.Core/Unicast/Transport/TransportMessageReceivedEventArgs.cs similarity index 97% rename from src/unicastTransport/NServiceBus.Unicast.Transport/TransportMessageReceivedEventArgs.cs rename to src/NServiceBus.Core/Unicast/Transport/TransportMessageReceivedEventArgs.cs index 44af920145c..387a31743e9 100644 --- a/src/unicastTransport/NServiceBus.Unicast.Transport/TransportMessageReceivedEventArgs.cs +++ b/src/NServiceBus.Core/Unicast/Transport/TransportMessageReceivedEventArgs.cs @@ -1,7 +1,7 @@ -using System; - namespace NServiceBus.Unicast.Transport { + using System; + /// /// Defines the arguments passed to the event handler of the /// event. diff --git a/src/NServiceBus.Core/Unicast/Transport/TransportReceiver.cs b/src/NServiceBus.Core/Unicast/Transport/TransportReceiver.cs new file mode 100644 index 00000000000..7051badfc95 --- /dev/null +++ b/src/NServiceBus.Core/Unicast/Transport/TransportReceiver.cs @@ -0,0 +1,490 @@ +namespace NServiceBus.Unicast.Transport +{ + using System; + using System.Diagnostics; + using System.Transactions; + using Faults; + using Logging; + using System.Runtime.Serialization; + using Monitoring; + using Transports; + + /// + /// The default implementation of + /// + public class TransportReceiver : ITransport, IDisposable + { + /// + /// The receiver responsible for notifying the transport when new messages are available + /// + public IDequeueMessages Receiver { get; set; } + + /// + /// Manages failed message processing. + /// + public IManageMessageFailures FailureManager { get; set; } + + /// + /// Event which indicates that message processing has started. + /// + public event EventHandler StartedMessageProcessing; + + /// + /// The current settings for transactions + /// + public TransactionSettings TransactionSettings { get; set; } + + /// + /// Event which indicates that message processing has completed. + /// + public event EventHandler FinishedMessageProcessing; + + /// + /// Event which indicates that message processing failed for some reason. + /// + public event EventHandler FailedMessageProcessing; + + /// + /// Gets/sets the number of concurrent threads that should be + /// created for processing the queue. + /// + /// Get returns the actual number of running worker threads, which may + /// be different than the originally configured value. + /// + /// When used as a setter, this value will be used by the + /// method only and will have no effect if called afterwards. + /// + /// To change the number of worker threads at runtime, call . + /// + public virtual int NumberOfWorkerThreads + { + get { return MaximumConcurrencyLevel; } + } + + /// + /// Gets the maximum concurrency level this is able to support. + /// + public virtual int MaximumConcurrencyLevel + { + get { return maximumConcurrencyLevel; } + set + { + if (isStarted) + { + throw new InvalidOperationException( + "Can't set the number of worker threads after the transport has been started. Use ChangeMaximumConcurrencyLevel(int maximumConcurrencyLevel) instead."); + } + + maximumConcurrencyLevel = value; + } + } + + int maximumConcurrencyLevel; + + /// + /// Updates the maximum concurrency level this is able to support. + /// + /// The new maximum concurrency level for this . + public void ChangeMaximumConcurrencyLevel(int maximumConcurrencyLevel) + { + if (this.maximumConcurrencyLevel == maximumConcurrencyLevel) + { + return; + } + + this.maximumConcurrencyLevel = maximumConcurrencyLevel; + + if (isStarted) + { + Receiver.Stop(); + Receiver.Start(maximumConcurrencyLevel); + Logger.InfoFormat("Maximum concurrency level for '{0}' changed to {1}.", receiveAddress, maximumConcurrencyLevel); + } + } + + /// + /// Gets the receiving messages rate. + /// + public int MaximumMessageThroughputPerSecond + { + get { return maxMessageThroughputPerSecond; } + } + + /// + /// Throttling receiving messages rate. You can't set the value other than the value specified at your license. + /// + public int MaxThroughputPerSecond + { + get { return maxMessageThroughputPerSecond; } + set + { + if (isStarted) + throw new InvalidOperationException("Can't set the maximum throughput per second after the transport has been started. Use ChangeMaximumMessageThroughputPerSecond(int maximumMessageThroughputPerSecond) instead."); + + maxMessageThroughputPerSecond = value; + } + } + + int maxMessageThroughputPerSecond; + + public void ChangeMaximumMessageThroughputPerSecond(int maximumMessageThroughputPerSecond) + { + if (maximumMessageThroughputPerSecond == maxMessageThroughputPerSecond) + { + return; + } + + maxMessageThroughputPerSecond = maximumMessageThroughputPerSecond; + if (throughputLimiter != null) + { + throughputLimiter.Stop(); + throughputLimiter.Start(maximumMessageThroughputPerSecond); + } + if (maximumMessageThroughputPerSecond <= 0) + { + Logger.InfoFormat("Throughput limit for {0} disabled.", receiveAddress); + } + else + { + Logger.InfoFormat("Throughput limit for {0} changed to {1} msg/sec", receiveAddress, + maximumMessageThroughputPerSecond); + } + } + + /// + /// Event raised when a message has been received in the input queue. + /// + public event EventHandler TransportMessageReceived; + + /// + /// Changes the number of worker threads to the given target, + /// stopping or starting worker threads as needed. + /// + /// + public void ChangeNumberOfWorkerThreads(int targetNumberOfWorkerThreads) + { + ChangeMaximumConcurrencyLevel(targetNumberOfWorkerThreads); + } + + public void Start(string inputqueue) + { + Start(Address.Parse(inputqueue)); + } + + public void Start(Address address) + { + if (isStarted) + throw new InvalidOperationException("The transport is already started"); + + receiveAddress = address; + + var returnAddressForFailures = address; + + if (Configure.Instance.WorkerRunsOnThisEndpoint() + && (returnAddressForFailures.Queue.ToLower().EndsWith(".worker")|| address ==Address.Local )) //this is a hack until we can refactor the SLR to be a feature. "Worker" is there to catch the local worker in the distributor + { + returnAddressForFailures = Configure.Instance.GetMasterNodeAddress(); + + Logger.InfoFormat("Worker started, failures will be redirected to {0}",returnAddressForFailures); + } + + FailureManager.Init(returnAddressForFailures); + + firstLevelRetries = new FirstLevelRetries(TransactionSettings.MaxRetries, FailureManager); + + InitializePerformanceCounters(); + + throughputLimiter = new ThroughputLimiter(); + + throughputLimiter.Start(maxMessageThroughputPerSecond); + + StartReceiver(); + + if(maxMessageThroughputPerSecond > 0) + Logger.InfoFormat("Transport: {0} started with its throughput limited to {1} msg/sec", receiveAddress, maxMessageThroughputPerSecond); + + isStarted = true; + } + + void InitializePerformanceCounters() + { + currentReceivePerformanceDiagnostics = new ReceivePerformanceDiagnostics(receiveAddress); + + currentReceivePerformanceDiagnostics.Initialize(); + } + + ReceivePerformanceDiagnostics currentReceivePerformanceDiagnostics; + + void StartReceiver() + { + Receiver.Init(receiveAddress, TransactionSettings, TryProcess, EndProcess); + Receiver.Start(maximumConcurrencyLevel); + } + + [DebuggerNonUserCode] + bool TryProcess(TransportMessage message) + { + currentReceivePerformanceDiagnostics.MessageDequeued(); + + needToAbort = false; + + using (var tx = GetTransactionScope()) + { + ProcessMessage(message); + + tx.Complete(); + } + + return !needToAbort; + } + + TransactionScope GetTransactionScope() + { + if (TransactionSettings.DoNotWrapHandlersExecutionInATransactionScope) + { + return new TransactionScope(TransactionScopeOption.Suppress); + } + + return new TransactionScope(TransactionScopeOption.Required, new TransactionOptions + { + IsolationLevel = TransactionSettings.IsolationLevel, + Timeout = TransactionSettings.TransactionTimeout + }); + } + + + void EndProcess(TransportMessage message, Exception ex) + { + var messageId = message != null ? message.Id : null; + + if (needToAbort) + return; + + throughputLimiter.MessageProcessed(); + + if (ex == null) + { + if (messageId != null) + { + firstLevelRetries.ClearFailuresForMessage(message); + } + + currentReceivePerformanceDiagnostics.MessageProcessed(); + + return; + } + + currentReceivePerformanceDiagnostics.MessageFailed(); + + if (ex is AggregateException) + { + ex = ex.GetBaseException(); + } + + if (TransactionSettings.IsTransactional && messageId != null) + { + firstLevelRetries.IncrementFailuresForMessage(message, ex); + } + + OnFailedMessageProcessing(ex); + + Logger.Info("Failed to process message", ex); + } + + void ProcessMessage(TransportMessage message) + { + if (string.IsNullOrWhiteSpace(message.Id)) + { + Logger.Error("Message without message id detected"); + + FailureManager.SerializationFailedForMessage(message, new SerializationException("Message without message id received.")); + + return; + } + + var exceptionFromStartedMessageHandling = OnStartedMessageProcessing(message); + + if (TransactionSettings.IsTransactional) + { + if (firstLevelRetries.HasMaxRetriesForMessageBeenReached(message)) + { + OnFinishedMessageProcessing(); + + return; + } + } + + if (exceptionFromStartedMessageHandling != null) + throw exceptionFromStartedMessageHandling; //cause rollback + + //care about failures here + var exceptionFromMessageHandling = OnTransportMessageReceived(message); + + //and here + var exceptionFromMessageModules = OnFinishedMessageProcessing(); + + //but need to abort takes precedence - failures aren't counted here, + //so messages aren't moved to the error queue. + if (needToAbort) + { + return; + } + + if (exceptionFromMessageHandling != null) + { + if (exceptionFromMessageHandling is AggregateException) + { + var serializationException = exceptionFromMessageHandling.GetBaseException() as SerializationException; + if (serializationException != null) + { + Logger.Error("Failed to serialize message with ID: " + message.Id, serializationException); + + message.RevertToOriginalBodyIfNeeded(); + + FailureManager.SerializationFailedForMessage(message, serializationException); + } + else + { + throw exceptionFromMessageHandling;//cause rollback + } + } + else + { + throw exceptionFromMessageHandling;//cause rollback + } + } + + if (exceptionFromMessageModules != null) //cause rollback + { + throw exceptionFromMessageModules; + } + } + + + + /// + /// Causes the processing of the current message to be aborted. + /// + public void AbortHandlingCurrentMessage() + { + needToAbort = true; + } + + /// + /// Stops the transport. + /// + public void Stop() + { + if (!isStarted) + { + return; + } + + Receiver.Stop(); + + isStarted = false; + } + + private Exception OnStartedMessageProcessing(TransportMessage msg) + { + try + { + if (StartedMessageProcessing != null) + StartedMessageProcessing(this, new StartedMessageProcessingEventArgs(msg)); + } + catch (Exception e) + { + Logger.Error("Failed raising 'started message processing' event.", e); + return e; + } + + return null; + } + + private Exception OnFinishedMessageProcessing() + { + try + { + if (FinishedMessageProcessing != null) + FinishedMessageProcessing(this, null); + } + catch (Exception e) + { + Logger.Error("Failed raising 'finished message processing' event.", e); + return e; + } + + return null; + } + + private Exception OnTransportMessageReceived(TransportMessage msg) + { + try + { + if (TransportMessageReceived != null) + TransportMessageReceived(this, new TransportMessageReceivedEventArgs(msg)); + } + catch (Exception e) + { + return e; + } + + return null; + } + + private void OnFailedMessageProcessing(Exception originalException) + { + try + { + if (FailedMessageProcessing != null) + FailedMessageProcessing(this, new FailedMessageProcessingEventArgs(originalException)); + } + catch (Exception e) + { + Logger.Warn("Failed raising 'failed message processing' event.", e); + } + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + Stop(); + + if (currentReceivePerformanceDiagnostics != null) + { + currentReceivePerformanceDiagnostics.Dispose(); + } + } + + disposed = true; + } + + ~TransportReceiver() + { + Dispose(false); + } + + Address receiveAddress; + bool isStarted; + ThroughputLimiter throughputLimiter; + FirstLevelRetries firstLevelRetries; + bool disposed; + + [ThreadStatic] + static volatile bool needToAbort; + + static readonly ILog Logger = LogManager.GetLogger(typeof(TransportReceiver)); + } +} diff --git a/src/NServiceBus.Core/Unicast/UnicastBus.cs b/src/NServiceBus.Core/Unicast/UnicastBus.cs new file mode 100644 index 00000000000..b2bec3f115f --- /dev/null +++ b/src/NServiceBus.Core/Unicast/UnicastBus.cs @@ -0,0 +1,1540 @@ +namespace NServiceBus.Unicast +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Configuration; + using System.Diagnostics; + using System.IO; + using System.Linq; + using System.Runtime.Serialization; + using System.Security.Principal; + using System.Text; + using System.Threading; + using System.Threading.Tasks; + using Impersonation; + using Licensing; + using Logging; + using MessageInterfaces; + using MessageMutator; + using Messages; + using ObjectBuilder; + using Queuing; + using Routing; + using Serialization; + using Subscriptions; + using Subscriptions.MessageDrivenSubscriptions.SubcriberSideFiltering; + using Support; + using Transport; + using Transports; + using UnitOfWork; + + /// + /// A unicast implementation of for NServiceBus. + /// + public class UnicastBus : IUnicastBus, IInMemoryOperations + { + + /// + /// Default constructor. + /// + public UnicastBus() + { + _doNotContinueDispatchingCurrentMessageToHandlers = false; + _handleCurrentMessageLaterWasCalled = false; + _messageBeingHandled = null; + } + + + /// + /// Should be used by programmer, not administrator. + /// Disables the handling of incoming messages. + /// + public virtual bool DisableMessageHandling + { + set { disableMessageHandling = value; } + } + private bool disableMessageHandling; + + + /// + /// Should be used by programmer, not administrator. + /// Sets an implementation to use as the + /// listening endpoint for the bus. + /// + public virtual ITransport Transport + { + set + { + transport = value; + + transport.StartedMessageProcessing += TransportStartedMessageProcessing; + transport.TransportMessageReceived += TransportMessageReceived; + transport.FinishedMessageProcessing += TransportFinishedMessageProcessing; + transport.FailedMessageProcessing += TransportFailedMessageProcessing; + } + get { return transport; } + } + + /// + /// Message queue used to send messages. + /// + public ISendMessages MessageSender { get; set; } + + /// + /// Information regarding the current master node + /// + public Address MasterNodeAddress { get; set; } + + /// + /// A delegate for a method that will handle the + /// event. + /// + /// The message received. + public delegate void MessageReceivedDelegate(TransportMessage message); + + /// + /// Event raised when a message is received. + /// + public event MessageReceivedDelegate MessageReceived; + + /// + /// Event raised when messages are sent. + /// + public event EventHandler MessagesSent; + + /// + /// Clear Timeouts For the saga + /// + /// Id of the Saga for clearing the timeouts + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "IDeferMessages.ClearDeferredMessages")] + public void ClearTimeoutsFor(Guid sagaId) + { + if (sagaId == Guid.Empty) + { + throw new ArgumentException("Invalid saga id.", "sagaId"); + } + + MessageDeferrer.ClearDeferredMessages(Headers.SagaId, sagaId.ToString()); + } + + + /// + /// Should be used by the programmer, not the administrator. + /// Gets and sets an implementation to + /// be used for subscription storage for the bus. + /// + public virtual IMessageSerializer MessageSerializer { get; set; } + + + /// + /// The registry of all known messages for this endpoint + /// + public MessageMetadataRegistry MessageMetadataRegistry { get; set; } + + + /// + /// A way to request the transport to defer the processing of a message + /// + public IDeferMessages MessageDeferrer { get; set; } + + /// + /// Should be used by programmer, not administrator. + /// Sets implementation that will be used to + /// dynamically instantiate and execute message handlers. + /// + public IBuilder Builder { get; set; } + + + /// + /// Gets/sets the message mapper. + /// + public virtual IMessageMapper MessageMapper + { + get { return messageMapper; } + set + { + messageMapper = value; + + ExtensionMethods.MessageCreator = value; + ExtensionMethods.Bus = this; + } + } + + /// + /// Should be used by programmer, not administrator. + /// Sets whether or not the return address of a received message + /// should be propagated when the message is forwarded. This field is + /// used primarily for the Distributor. + /// + public bool PropagateReturnAddressOnSend { get; set; } + + + /// + /// Should be used by administrator, not programmer. + /// Sets the address to which all messages received on this bus will be + /// forwarded to (not including subscription messages). + /// This is primarily useful for smart client scenarios + /// where both client and server software are installed on the mobile + /// device. The server software will have this field set to the address + /// of the real server. + /// + public Address ForwardReceivedMessagesTo { get; set; } + + /// + /// The TTR to set on forwarded messages. + /// + public TimeSpan TimeToBeReceivedOnForwardedMessages { get; set; } + + /// + /// The router for this unicastbus + /// + public IRouteMessages MessageRouter { get; set; } + + + /// + /// The handler registry for this unicastbus + /// + public IMessageHandlerRegistry HandlerRegistry { get; set; } + + /// + /// Event raised when no subscribers found for the published message. + /// + public event EventHandler NoSubscribersForMessage; + + /// + /// Event raised when client subscribed to a message type. + /// + public event EventHandler ClientSubscribed; + + + /// + /// Handles the filtering of messages on the subscriber side + /// + public SubscriptionPredicatesEvaluator SubscriptionPredicatesEvaluator { get; set; } + + /// + /// The registered subscription manager for this bus instance + /// + public IManageSubscriptions SubscriptionManager { get; set; } + + /// + /// Publishes the given messages + /// + public IPublishMessages MessagePublisher { get; set; } + + /// + /// Creates an instance of the specified type. + /// Used primarily for instantiating interface-based messages. + /// + /// The type to instantiate. + /// An instance of the specified type. + public T CreateInstance() + { + return messageMapper.CreateInstance(); + } + + /// + /// Creates an instance of the specified type. + /// Used primarily for instantiating interface-based messages. + /// + /// The type to instantiate. + /// An action to perform on the result + /// + public T CreateInstance(Action action) + { + return messageMapper.CreateInstance(action); + } + + /// + /// Creates an instance of the specified type. + /// Used primarily for instantiating interface-based messages. + /// + /// The type to instantiate. + /// An instance of the specified type. + public object CreateInstance(Type messageType) + { + return messageMapper.CreateInstance(messageType); + } + + /// + /// Creates an instance of the requested message type (T), + /// performing the given action on the created message, + /// and then publishing it. + /// + /// + /// + public void Publish(Action messageConstructor) + { + Publish(CreateInstance(messageConstructor)); + } + + /// + /// Publishes the messages to all subscribers of the first message's type. + /// + /// + public virtual void Publish(params T[] messages) + { + + if (messages == null || messages.Length == 0) // Bus.Publish(); + { + Publish(CreateInstance(m => { })); + return; + } + + MessagingBestPractices.AssertIsValidForPubSub(messages[0].GetType()); + + var fullTypes = GetFullTypes(messages as object[]); + + + var eventMessage = new TransportMessage { MessageIntent = MessageIntentEnum.Publish }; + + MapTransportMessageFor(messages as object[], eventMessage); + + if(MessagePublisher == null) + throw new InvalidOperationException("No message publisher has been registered. If you're using a transport without native support for pub/sub please enable the message driven publishing feature by calling: Feature.Enable() in your configuration"); + + var subscribersExisted = MessagePublisher.Publish(eventMessage, fullTypes); + + if (!subscribersExisted && NoSubscribersForMessage != null) + { + NoSubscribersForMessage(this, new MessageEventArgs(messages[0])); + } + } + + /// + /// Subscribes to the given type - T. + /// + /// + public void Subscribe() + { + Subscribe(typeof(T)); + } + + /// + /// Subscribes to receive published messages of the specified type. + /// + /// The type of message to subscribe to. + public virtual void Subscribe(Type messageType) + { + Subscribe(messageType, null); + } + + /// + /// Subscribes to the given type T, registering a condition that all received + /// messages of that type should comply with, otherwise discarding them. + /// + /// + /// + public void Subscribe(Predicate condition) + { + var p = new Predicate(m => + { + if (m is T) + return condition((T)m); + + return true; + } + ); + + Subscribe(typeof(T), p); + } + + /// + /// Subscribes to receive published messages of the specified type if + /// they meet the provided condition. + /// + /// The type of message to subscribe to. + /// The condition under which to receive the message. + public virtual void Subscribe(Type messageType, Predicate condition) + { + MessagingBestPractices.AssertIsValidForPubSub(messageType); + + if (Configure.SendOnlyMode) + throw new InvalidOperationException("It's not allowed for a sendonly endpoint to be a subscriber"); + + AssertHasLocalAddress(); + + var destination = GetAddressForMessageType(messageType); + if (Address.Self == destination) + throw new InvalidOperationException(string.Format("Message {0} is owned by the same endpoint that you're trying to subscribe", messageType)); + + + if (SubscriptionManager == null) + throw new InvalidOperationException("No subscription manager is available"); + + SubscriptionManager.Subscribe(messageType, destination); + + if (SubscriptionPredicatesEvaluator != null) + SubscriptionPredicatesEvaluator.AddConditionForSubscriptionToMessageType(messageType, condition); + } + + /// + /// Unsubscribes from the given type of message - T. + /// + /// + public void Unsubscribe() + { + Unsubscribe(typeof(T)); + } + + /// + /// Unsubscribes from receiving published messages of the specified type. + /// + /// + public virtual void Unsubscribe(Type messageType) + { + MessagingBestPractices.AssertIsValidForPubSub(messageType); + + if (Configure.SendOnlyMode) + throw new InvalidOperationException("It's not allowed for a sendonly endpoint to unsubscribe"); + + AssertHasLocalAddress(); + + var destination = GetAddressForMessageType(messageType); + + if (SubscriptionManager == null) + throw new InvalidOperationException("No subscription manager is available"); + + SubscriptionManager.Unsubscribe(messageType, destination); + } + + + void IBus.Reply(params object[] messages) + { + MessagingBestPractices.AssertIsValidForReply(messages.ToList()); + if (_messageBeingHandled.ReplyToAddress == null) + throw new InvalidOperationException("Reply was called with null reply-to-address field. It can happen if you are using a SendOnly client. See http://particular.net/articles/one-way-send-only-endpoints"); + SendMessage(_messageBeingHandled.ReplyToAddress, _messageBeingHandled.CorrelationId ?? _messageBeingHandled.Id, MessageIntentEnum.Send, messages); + } + + void IBus.Reply(Action messageConstructor) + { + ((IBus)this).Reply(CreateInstance(messageConstructor)); + } + + void IBus.Return(T errorCode) + { + if (_messageBeingHandled.ReplyToAddress == null) + throw new InvalidOperationException("Return was called with null reply-to-address field. It can happen if you are using a SendOnly client. See http://particular.net/articles/one-way-send-only-endpoints"); + + var returnMessage = ControlMessage.Create(Address.Local); + + returnMessage.Headers[Headers.ReturnMessageErrorCodeHeader] = errorCode.GetHashCode().ToString(); + returnMessage.CorrelationId = _messageBeingHandled.CorrelationId ?? _messageBeingHandled.Id; + + InvokeOutgoingTransportMessagesMutators(new object[] { }, returnMessage); + MessageSender.Send(returnMessage, _messageBeingHandled.ReplyToAddress); + } + + void IBus.HandleCurrentMessageLater() + { + if (_handleCurrentMessageLaterWasCalled) + { + return; + } + + //if we're a worker, send to the distributor data bus + if (Configure.Instance.WorkerRunsOnThisEndpoint()) + { + MessageSender.Send(_messageBeingHandled, MasterNodeAddress); + } + else + { + MessageSender.Send(_messageBeingHandled, Address.Local); + } + + _handleCurrentMessageLaterWasCalled = true; + } + + void IBus.ForwardCurrentMessageTo(string destination) + { + MessageSender.Send(_messageBeingHandled, Address.Parse(destination)); + } + + ICallback IBus.SendLocal(Action messageConstructor) + { + return ((IBus)this).SendLocal(CreateInstance(messageConstructor)); + } + + ICallback IBus.SendLocal(params object[] messages) + { + //if we're a worker, send to the distributor data bus + if (Configure.Instance.WorkerRunsOnThisEndpoint()) + { + return ((IBus)this).Send(MasterNodeAddress, messages); + } + + return ((IBus)this).Send(Address.Local, messages); + } + + ICallback IBus.Send(Action messageConstructor) + { + return ((IBus)this).Send(CreateInstance(messageConstructor)); + } + + ICallback IBus.Send(params object[] messages) + { + var destination = GetAddressForMessages(messages); + + return SendMessage(destination, null, MessageIntentEnum.Send, messages); + } + + ICallback IBus.Send(string destination, Action messageConstructor) + { + return SendMessage(destination, null, MessageIntentEnum.Send, CreateInstance(messageConstructor)); + } + + ICallback IBus.Send(Address address, Action messageConstructor) + { + return SendMessage(address, null, MessageIntentEnum.Send, CreateInstance(messageConstructor)); + } + + ICallback IBus.Send(string destination, params object[] messages) + { + return SendMessage(destination, null, MessageIntentEnum.Send, messages); + } + + ICallback IBus.Send(Address address, params object[] messages) + { + return SendMessage(address, null, MessageIntentEnum.Send, messages); + } + + ICallback IBus.Send(string destination, string correlationId, Action messageConstructor) + { + return SendMessage(destination, correlationId, MessageIntentEnum.Send, CreateInstance(messageConstructor)); + } + + ICallback IBus.Send(Address address, string correlationId, Action messageConstructor) + { + return SendMessage(address, correlationId, MessageIntentEnum.Send, CreateInstance(messageConstructor)); + } + + ICallback IBus.Send(string destination, string correlationId, params object[] messages) + { + return SendMessage(destination, correlationId, MessageIntentEnum.Send, messages); + } + + ICallback IBus.Send(Address address, string correlationId, params object[] messages) + { + return SendMessage(address, correlationId, MessageIntentEnum.Send, messages); + } + + ICallback IBus.SendToSites(IEnumerable siteKeys, params object[] messages) + { + if (messages == null || messages.Length == 0) + throw new InvalidOperationException("Cannot send an empty set of messages."); + + Headers.SetMessageHeader(messages[0], Headers.DestinationSites, string.Join(",", siteKeys.ToArray())); + + return SendMessage(MasterNodeAddress.SubScope("gateway"), null, MessageIntentEnum.Send, messages); + } + + /// + /// Defer + /// + /// Delay + /// Messages + /// + public ICallback Defer(TimeSpan delay, params object[] messages) + { + return Defer(DateTime.UtcNow + delay, messages); + } + + /// + /// Defer + /// + /// processAt + /// messages + /// + public ICallback Defer(DateTime processAt, params object[] messages) + { + if (processAt.ToUniversalTime() <= DateTime.UtcNow) + { + return ((IBus)this).SendLocal(messages); + } + + var toSend = new TransportMessage(); + + MapTransportMessageFor(messages, toSend); + + toSend.Headers[Headers.IsDeferredMessage] = Boolean.TrueString; + + MessageDeferrer.Defer(toSend, processAt, Address.Local); + + return SetupCallback(toSend.Id); + } + + private ICallback SendMessage(string destination, string correlationId, MessageIntentEnum messageIntent, params object[] messages) + { + if (messages == null || messages.Length == 0) + throw new InvalidOperationException("Cannot send an empty set of messages."); + + if (destination == null) + throw new InvalidOperationException( + string.Format("No destination specified for message {0}. Message cannot be sent. Check the UnicastBusConfig section in your config file and ensure that a MessageEndpointMapping exists for the message type.", messages[0].GetType().FullName)); + + return SendMessage(Address.Parse(destination), correlationId, messageIntent, messages); + } + + private ICallback SendMessage(Address address, string correlationId, MessageIntentEnum messageIntent, params object[] messages) + { + // loop only happens once + foreach (var id in SendMessage(new List
    { address }, correlationId, messageIntent, messages)) + { + return SetupCallback(id); + } + + return null; + } + + ICallback SetupCallback(string transportMessageId) + { + var result = new Callback(transportMessageId); + result.Registered += delegate(object sender, BusAsyncResultEventArgs args) + { + lock (messageIdToAsyncResultLookup) + messageIdToAsyncResultLookup[args.MessageId] = args.Result; + }; + + return result; + } + + IEnumerable SendMessage(List
    addresses, string correlationId, MessageIntentEnum messageIntent, params object[] messages) + { + if (messages.Length == 0) + { + return Enumerable.Empty(); + } + + messages.ToList() + .ForEach(message => MessagingBestPractices.AssertIsValidForSend(message.GetType(), messageIntent)); + + if (messages.Length > 1) + { + // Users can't send more than one message with a DataBusProperty in the same TransportMessage, Yes this is a limitation for now! + var numberOfMessagesWithDataBusProperties = 0; + foreach (var message in messages) + { + var hasAtLeastOneDataBusProperty = message.GetType().GetProperties().Any(MessageConventionExtensions.IsDataBusProperty); + + if (hasAtLeastOneDataBusProperty) + { + numberOfMessagesWithDataBusProperties++; + } + } + + if (numberOfMessagesWithDataBusProperties > 1) + { + throw new InvalidOperationException("This version of NServiceBus only supports sending up to one message with DataBusProperties per Send()."); + } + } + + addresses + .ForEach(address => + { + if (address == Address.Undefined) + throw new InvalidOperationException("No destination specified for message(s): " + + string.Join(";", messages.Select(m => m.GetType()))); + }); + + + + var result = new List(); + + var toSend = new TransportMessage { MessageIntent = messageIntent }; + + if (!string.IsNullOrEmpty(correlationId)) + { + toSend.CorrelationId = correlationId; + } + + MapTransportMessageFor(messages, toSend); + + foreach (var destination in addresses) + { + try + { + MessageSender.Send(toSend, destination); + } + catch (QueueNotFoundException ex) + { + throw new ConfigurationErrorsException("The destination queue '" + destination + + "' could not be found. You may have misconfigured the destination for this kind of message (" + + messages[0].GetType().FullName + + ") in the MessageEndpointMappings of the UnicastBusConfig section in your configuration file. " + + "It may also be the case that the given queue just hasn't been created yet, or has been deleted." + , ex); + } + + if (Log.IsDebugEnabled) + Log.Debug(string.Format("Sending message {0} with ID {1} to destination {2}.\n" + + "ToString() of the message yields: {3}\n" + + "Message headers:\n{4}", + messages[0].GetType().AssemblyQualifiedName, + toSend.Id, + destination, + messages[0], + string.Join(", ", toSend.Headers.Select(h => h.Key + ":" + h.Value).ToArray()) + )); + + result.Add(toSend.Id); + } + + if (MessagesSent != null) + MessagesSent(this, new MessagesEventArgs(messages)); + + return result; + } + + + + List GetFullTypes(IEnumerable messages) + { + var types = new List(); + + foreach (var m in messages) + { + var s = MessageMapper.GetMappedTypeFor(m.GetType()); + if (types.Contains(s)) + continue; + + types.Add(s); + + foreach (var t in m.GetType().GetInterfaces()) + if (MessageConventionExtensions.IsMessageType(t)) + if (!types.Contains(t)) + types.Add(t); + } + + return types; + } + + /// + /// Implementation of IStartableBus.Started event. + /// + public event EventHandler Started; + + public IBus Start() + { + return Start(() => { }); + } + + public IBus Start(Action startupAction) + { + LicenseManager.PromptUserForLicenseIfTrialHasExpired(); + + if (started) + return this; + + lock (startLocker) + { + if (started) + return this; + + starting = true; + + Address.PreventChanges(); + + ValidateConfiguration(); + + if (startupAction != null) + startupAction(); + + AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal); + + + if (!DoNotStartTransport) + { + transport.Start(InputAddress); + } + + started = true; + } + + if (Started != null) + Started(this, null); + + thingsToRunAtStartup = Builder.BuildAll().ToList(); + + thingsToRunAtStartupTask = thingsToRunAtStartup.Select(toRun => Task.Factory.StartNew(() => + { + var name = toRun.GetType().AssemblyQualifiedName; + + try + { + Log.DebugFormat("Starting {0}.", name); + toRun.Start(); + Log.DebugFormat("Started {0}.", name); + } + catch (Exception ex) + { + Log.ErrorFormat("{0} could not be started.", ex, name); + //don't rethrow so that thread doesn't die before log message is shown. + } + }, TaskCreationOptions.LongRunning)).ToArray(); + + return this; + } + + private void ExecuteIWantToRunAtStartupStopMethods() + { + if (thingsToRunAtStartup == null) + return; + + //Ensure Start has been called on all thingsToRunAtStartup + Log.DebugFormat("Ensuring IWantToRunAtStartup.Start has been called."); + Task.WaitAll(thingsToRunAtStartupTask); + Log.DebugFormat("All IWantToRunAtStartup.Start should have completed now."); + + var mapTaskToThingsToRunAtStartup = new ConcurrentDictionary(); + + var tasks = thingsToRunAtStartup.Select(toRun => + { + var name = toRun.GetType().AssemblyQualifiedName; + + var task = new Task(() => + { + try + { + Log.DebugFormat("Stopping {0}.", name); + toRun.Stop(); + Log.DebugFormat("Stopped {0}.", name); + } + catch (Exception ex) + { + Log.ErrorFormat("{0} could not be stopped.", ex, name); + // no need to rethrow, closing the process anyway + } + }, TaskCreationOptions.LongRunning); + + mapTaskToThingsToRunAtStartup.TryAdd(task.Id, name); + + task.Start(); + + return task; + + }).ToArray(); + + // Wait for a period here otherwise the process may be killed too early! + var timeout = TimeSpan.FromSeconds(20); + if (Task.WaitAll(tasks, timeout)) + { + return; + } + + Log.WarnFormat("Not all IWantToRunWhenBusStartsAndStops.Stop methods were successfully called within {0}secs", timeout.Seconds); + + var sb = new StringBuilder(); + foreach (var task in tasks.Where(task => !task.IsCompleted)) + { + sb.AppendLine(mapTaskToThingsToRunAtStartup[task.Id]); + } + + Log.WarnFormat("List of tasks that did not finish within {0}secs:\n{1}", timeout.Seconds, sb.ToString()); + } + + + /// + /// Allow disabling the unicast bus. + /// + public bool DoNotStartTransport { get; set; } + + /// + /// The address this bus will use as it's main input + /// + public Address InputAddress + { + get + { + if (inputAddress == null) + inputAddress = Address.Local; + + return inputAddress; + } + set { inputAddress = value; } + } + + void AssertHasLocalAddress() + { + if (Address.Local == null) + throw new InvalidOperationException("Cannot start subscriber without a queue configured. Please specify the LocalAddress property of UnicastBusConfig."); + } + + void ValidateConfiguration() + { + if (!SkipDeserialization && MessageSerializer == null) + throw new InvalidOperationException("No message serializer has been configured."); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Tells the transport to dispose. + /// + protected virtual void Dispose(bool disposing) + { + + if (disposed) + { + return; + } + + if (disposing) + { + // free managed resources + + Shutdown(); + + Configure.Instance.Builder.Dispose(); + } + + disposed = true; + } + + ~UnicastBus() + { + Dispose(false); + } + + void IBus.DoNotContinueDispatchingCurrentMessageToHandlers() + { + _doNotContinueDispatchingCurrentMessageToHandlers = true; + } + + + IDictionary IBus.OutgoingHeaders + { + get + { + return ExtensionMethods.GetStaticOutgoingHeadersAction(); + } + } + + public IMessageContext CurrentMessageContext + { + get + { + return _messageBeingHandled == null ? null : new MessageContext(_messageBeingHandled); + } + } + + public IInMemoryOperations InMemory + { + get { return this; } + } + + public void Shutdown() + { + if (!started) + { + return; + } + + Log.Info("Initiating shutdown."); + + ExecuteIWantToRunAtStartupStopMethods(); + + transport.Stop(); + transport.StartedMessageProcessing -= TransportStartedMessageProcessing; + transport.TransportMessageReceived -= TransportMessageReceived; + transport.FinishedMessageProcessing -= TransportFinishedMessageProcessing; + transport.FailedMessageProcessing -= TransportFailedMessageProcessing; + + Log.Info("Shutdown complete."); + + started = false; + } + + void IInMemoryOperations.Raise(T @event) + { + DispatchMessageToHandlersBasedOnType(Builder, @event); + } + + void IInMemoryOperations.Raise(Action messageConstructor) + { + ((IInMemoryOperations)this).Raise(CreateInstance(messageConstructor)); + } + + /// + /// Handles a received message. + /// + /// The builder used to construct the objects necessary to handle the message. + /// The received message. + /// + /// run by multiple threads so must be thread safe + /// public for testing + /// + public void HandleMessage(IBuilder builder, TransportMessage m) + { + var messages = new object[0]; + + if (!m.IsControlMessage() && !SkipDeserialization) + { + messages = Extract(m); + + if (messages == null || messages.Length == 0) + { + Log.Warn("Received an empty message - ignoring."); + return; + } + } + + //apply mutators + messages = messages.Select(msg => + { + //message mutators may need to assume that this has been set (eg. for the purposes of headers). + ExtensionMethods.CurrentMessageBeingHandled = msg; + + return ApplyIncomingMessageMutatorsTo(builder, msg); + }).ToArray(); + + if (_doNotContinueDispatchingCurrentMessageToHandlers) + { + _doNotContinueDispatchingCurrentMessageToHandlers = false; + return; + } + + var callbackInvoked = HandleCorrelatedMessage(m, messages); + + foreach (var messageToHandle in messages) + { + ExtensionMethods.CurrentMessageBeingHandled = messageToHandle; + + var handlers = DispatchMessageToHandlersBasedOnType(builder, messageToHandle).ToList(); + + if (!callbackInvoked && !handlers.Any()) + { + var warning = string.Format("No handlers could be found for message type: {0}", messageToHandle); + + if (Debugger.IsAttached) + throw new InvalidOperationException(warning); + + Log.WarnFormat(warning); + } + + LogPipelineInfo(messageToHandle, handlers); + } + + ExtensionMethods.CurrentMessageBeingHandled = null; + } + + + static object ApplyIncomingMessageMutatorsTo(IBuilder builder, object originalMessage) + { + var mutators = builder.BuildAll().ToList(); + + var mutatedMessage = originalMessage; + mutators.ForEach(m => + { + mutatedMessage = m.MutateIncoming(mutatedMessage); + }); + + return mutatedMessage; + } + + private object[] Extract(TransportMessage m) + { + + if (m.Body == null || m.Body.Length == 0) + { + return null; + } + + try + { + + var messageMetadata = MessageMetadataRegistry.GetMessageTypes(m); + + + using (var stream = new MemoryStream(m.Body)) + { + return MessageSerializer.Deserialize(stream, messageMetadata.Select(metadata => metadata.MessageType).ToList()); + } + } + catch (Exception e) + { + throw new SerializationException("Could not deserialize message.", e); + } + } + + /// + /// Finds the message handlers associated with the message type and dispatches + /// the message to the found handlers. + /// + /// The builder used to construct the handlers. + /// The message to dispatch to the handlers. + /// + /// + /// If during the dispatch, a message handler calls the DoNotContinueDispatchingCurrentMessageToHandlers method, + /// this prevents the message from being further dispatched. + /// This includes generic message handlers (of IMessage), and handlers for the specific messageType. + /// + IEnumerable DispatchMessageToHandlersBasedOnType(IBuilder builder, object toHandle) + { + var invokedHandlers = new List(); + var messageType = toHandle.GetType(); + + foreach (var handlerType in HandlerRegistry.GetHandlerTypes(messageType)) + { + var handlerTypeToInvoke = handlerType; + + var factory = GetDispatcherFactoryFor(handlerTypeToInvoke, builder); + + var dispatchers = factory.GetDispatcher(handlerTypeToInvoke, builder, toHandle).ToList(); + + dispatchers.ForEach(dispatch => + { + Log.DebugFormat("Dispatching message '{0}' to handler '{1}'", messageType, handlerTypeToInvoke); + try + { + dispatch(); + } + catch (Exception e) + { + Log.Warn(handlerType.Name + " failed handling message.", e); + + throw new TransportMessageHandlingFailedException(e); + } + }); + + invokedHandlers.Add(handlerTypeToInvoke); + if (_doNotContinueDispatchingCurrentMessageToHandlers) + { + _doNotContinueDispatchingCurrentMessageToHandlers = false; + break; + } + } + + return invokedHandlers; + } + + IMessageDispatcherFactory GetDispatcherFactoryFor(Type messageHandlerTypeToInvoke, IBuilder builder) + { + Type factoryType; + + MessageDispatcherMappings.TryGetValue(messageHandlerTypeToInvoke, out factoryType); + + if (factoryType == null) + throw new InvalidOperationException("No dispatcher factory type configured for messagehandler " + messageHandlerTypeToInvoke); + + var factory = builder.Build(factoryType) as IMessageDispatcherFactory; + + if (factory == null) + throw new InvalidOperationException(string.Format("Registered dispatcher factory {0} for type {1} does not implement IMessageDispatcherFactory", factoryType, messageHandlerTypeToInvoke)); + + return factory; + } + + /// + /// The list of message dispatcher factories to use + /// + public IDictionary MessageDispatcherMappings { get; set; } + + /// + /// True if no deseralization should be performed. This means that no handlers will be called + /// + public bool SkipDeserialization { get; set; } + + /// + /// If the message contains a correlationId, attempts to + /// invoke callbacks for that Id. Returns true if a callback was invoked + /// + /// The message to evaluate. + /// The logical messages in the transport message. + bool HandleCorrelatedMessage(TransportMessage msg, object[] messages) + { + if (msg.CorrelationId == null) + return false; + + if (msg.CorrelationId == msg.Id) //to make sure that we don't fire callbacks when doing send locals + return false; + + BusAsyncResult busAsyncResult; + + lock (messageIdToAsyncResultLookup) + { + messageIdToAsyncResultLookup.TryGetValue(msg.CorrelationId, out busAsyncResult); + messageIdToAsyncResultLookup.Remove(msg.CorrelationId); + } + + if (busAsyncResult == null) + return false; + + var statusCode = int.MinValue; + + if (msg.IsControlMessage() && msg.Headers.ContainsKey(Headers.ReturnMessageErrorCodeHeader)) + statusCode = int.Parse(msg.Headers[Headers.ReturnMessageErrorCodeHeader]); + + busAsyncResult.Complete(statusCode, messages); + + return true; + } + + /// + /// Handles the event from the used + /// for the bus. + /// + /// The sender of the event. + /// The arguments for the event. + /// + /// When the transport passes up the its received, + /// the bus checks for initialization, + /// sets the message as that which is currently being handled for the current thread + /// and, depending on , attempts to handle the message. + /// + private void TransportMessageReceived(object sender, TransportMessageReceivedEventArgs e) + { + using (var child = Builder.CreateChildBuilder()) + HandleTransportMessage(child, e.Message); + } + + private void HandleTransportMessage(IBuilder childBuilder, TransportMessage msg) + { + Log.Debug("Received message with ID " + msg.Id + " from sender " + msg.ReplyToAddress); + + SetupImpersonation(childBuilder, msg); + + var unitsOfWork = childBuilder.BuildAll().ToList(); + var unitsOfWorkStarted = new List(); + var lastUnitOfWorkThatEndWasInvokedOnIndex = 0; + + try + { + foreach (var uow in unitsOfWork) + { + unitsOfWorkStarted.Add(uow); + uow.Begin(); + } + + var transportMutators = childBuilder.BuildAll(); + + if (transportMutators != null) + foreach (var mutator in transportMutators) + mutator.MutateIncoming(msg); + + _handleCurrentMessageLaterWasCalled = false; + + if (MessageReceived != null) + MessageReceived(msg); + + if (!disableMessageHandling) + HandleMessage(childBuilder, msg); + + for (lastUnitOfWorkThatEndWasInvokedOnIndex = 0; lastUnitOfWorkThatEndWasInvokedOnIndex < unitsOfWorkStarted.Count; ) + { + var uow = unitsOfWorkStarted[unitsOfWorkStarted.Count - 1 - lastUnitOfWorkThatEndWasInvokedOnIndex++]; + uow.End(); + } + + ForwardMessageIfNecessary(msg); + } + catch (Exception ex) + { + var exceptionsToThrow = new List { ex }; + + for (; lastUnitOfWorkThatEndWasInvokedOnIndex < unitsOfWorkStarted.Count; lastUnitOfWorkThatEndWasInvokedOnIndex++) + { + var uow = unitsOfWorkStarted[unitsOfWorkStarted.Count - 1 - lastUnitOfWorkThatEndWasInvokedOnIndex]; + try + { + uow.End(ex); + } + catch (Exception anotherException) + { + exceptionsToThrow.Add(anotherException); + } + } + + throw new AggregateException(exceptionsToThrow); + } + + Log.Debug("Finished handling message."); + } + + static void SetupImpersonation(IBuilder childBuilder, TransportMessage message) + { + if (!ConfigureImpersonation.Impersonate) + return; + var impersonator = childBuilder.Build(); + + if (impersonator == null) + throw new InvalidOperationException("Run handler under incoming principal is configured for this endpoint but no implementation of ExtractIncomingPrincipal has been found. Please register one."); + + var principal = impersonator.GetPrincipal(message); + + if (principal == null) + return; + + Thread.CurrentPrincipal = principal; + } + + + void TransportFinishedMessageProcessing(object sender, EventArgs e) + { + modules.ForEach(module => + { + Log.Debug("Calling 'HandleEndMessage' on " + module.GetType().FullName); + module.HandleEndMessage(); + }); + } + + void TransportFailedMessageProcessing(object sender, FailedMessageProcessingEventArgs e) + { + if (modules == null) + { + return; + } + + modules.ForEach(module => + { + Log.Debug("Calling 'HandleError' on " + module.GetType().FullName); + module.HandleError(); + }); + } + + void TransportStartedMessageProcessing(object sender, StartedMessageProcessingEventArgs e) + { + _messageBeingHandled = e.Message; + + AddProcessingInformationHeaders(_messageBeingHandled); + + modules = Builder.BuildAll().ToList(); + + modules.ForEach(module => + { + Log.Debug("Calling 'HandleBeginMessage' on " + module.GetType().FullName); + module.HandleBeginMessage(); //don't need to call others if one fails + }); + + modules.Reverse();//make sure that the modules are called in reverse order when processing ends + } + + void AddProcessingInformationHeaders(TransportMessage message) + { + message.Headers[Headers.ProcessingEndpoint] = Configure.EndpointName; + message.Headers[Headers.ProcessingMachine] = RuntimeEnvironment.MachineName; + } + + + /// + /// Sends the Msg to the address found in the field + /// if it isn't null. + /// + /// The message to forward + private void ForwardMessageIfNecessary(TransportMessage m) + { + if (ForwardReceivedMessagesTo == null || ForwardReceivedMessagesTo == Address.Undefined) + return; + + m.RevertToOriginalBodyIfNeeded(); + + var toSend = new TransportMessage(m.Id,m.Headers) + { + Body = m.Body, + CorrelationId = m.CorrelationId, + MessageIntent = m.MessageIntent, + Recoverable = m.Recoverable, + ReplyToAddress = Address.Local, + TimeToBeReceived = TimeToBeReceivedOnForwardedMessages == TimeSpan.Zero ? m.TimeToBeReceived : TimeToBeReceivedOnForwardedMessages + }; + if (m.ReplyToAddress != null) + toSend.Headers[Headers.OriginatingAddress] = m.ReplyToAddress.ToString(); + + MessageSender.Send(toSend, ForwardReceivedMessagesTo); + } + + /// + /// Wraps the provided messages in an NServiceBus envelope, does not include destination. + /// Invokes message mutators. + /// + /// The messages to wrap. + /// /// The envelope in which the messages are placed. + /// The envelope containing the messages. + void MapTransportMessageFor(IList rawMessages, TransportMessage result) + { + if (!Configure.SendOnlyMode) + { + result.ReplyToAddress = Address.Local; + + if (PropagateReturnAddressOnSend && _messageBeingHandled != null && _messageBeingHandled.ReplyToAddress != null) + result.ReplyToAddress = _messageBeingHandled.ReplyToAddress; + } + + var messages = ApplyOutgoingMessageMutatorsTo(rawMessages).ToArray(); + + + var messageDefinitions = rawMessages.Select(m => MessageMetadataRegistry.GetMessageDefinition(GetMessageType(m))).ToList(); + + result.TimeToBeReceived = messageDefinitions.Min(md => md.TimeToBeReceived); + result.Recoverable = messageDefinitions.Any(md => md.Recoverable); + + SerializeMessages(result, messages); + + InvokeOutgoingTransportMessagesMutators(messages, result); + } + + Type GetMessageType(object message) + { + var messageType = message.GetType(); + + return MessageMapper.GetMappedTypeFor(messageType); + } + + void SerializeMessages(TransportMessage result, object[] messages) + { + using (var ms = new MemoryStream()) + { + MessageSerializer.Serialize(messages, ms); + + result.Headers[Headers.ContentType] = MessageSerializer.ContentType; + + if (messages.Any()) + result.Headers[Headers.EnclosedMessageTypes] = SerializeEnclosedMessageTypes(messages); + + result.Body = ms.ToArray(); + } + } + + string SerializeEnclosedMessageTypes(IEnumerable messages) + { + var types = messages.Select(m => MessageMapper.GetMappedTypeFor(m.GetType())).ToList(); + + var interfaces = types.SelectMany(t => t.GetInterfaces()) + .Where(MessageConventionExtensions.IsMessageType); + + var distinctTypes = types.Distinct(); + var interfacesOrderedByHierarchy = interfaces.Distinct().OrderByDescending(i => i.GetInterfaces().Count()); // Interfaces with less interfaces are lower in the hierarchy. + + return string.Join(";", distinctTypes.Concat(interfacesOrderedByHierarchy).Select(t => t.AssemblyQualifiedName)); + } + + private void InvokeOutgoingTransportMessagesMutators(object[] messages, TransportMessage result) + { + var mutators = Builder.BuildAll(); + if (mutators != null) + foreach (var mutator in mutators) + { + Log.DebugFormat("Invoking transport message mutator: {0}", mutator.GetType().FullName); + mutator.MutateOutgoing(messages, result); + } + } + + IEnumerable ApplyOutgoingMessageMutatorsTo(IEnumerable messages) + { + foreach (var originalMessage in messages) + { + var mutators = Builder.BuildAll().ToList(); + + var mutatedMessage = originalMessage; + mutators.ForEach(m => + { + mutatedMessage = m.MutateOutgoing(mutatedMessage); + }); + + yield return mutatedMessage; + } + } + + /// + /// Uses the first message in the array to pass to . + /// + /// + /// + Address GetAddressForMessages(object[] messages) + { + if (messages == null || messages.Length == 0) + return Address.Undefined; + + return GetAddressForMessageType(messages[0].GetType()); + } + + /// + /// Gets the destination address for a message type. + /// + /// The message type to get the destination for. + /// The address of the destination associated with the message type. + Address GetAddressForMessageType(Type messageType) + { + var destination = MessageRouter.GetDestinationFor(messageType); + + if (destination != Address.Undefined) + return destination; + + + if (messageMapper != null && !messageType.IsInterface) + { + var t = messageMapper.GetMappedTypeFor(messageType); + if (t != null && t != messageType) + return GetAddressForMessageType(t); + } + + + return destination; + } + + /// + /// Throws an exception if the bus hasn't begun the startup process. + /// + protected void AssertBusIsStarted() + { + if (starting == false) + throw new InvalidOperationException("The bus is not started yet, call Bus.Start() before attempting to use the bus."); + } + + void LogPipelineInfo(object messageToHandle, IEnumerable handlers) + { + var messageType = messageToHandle.GetType(); + + _messageBeingHandled.Headers["NServiceBus.PipelineInfo." + messageType.FullName] = string.Join(";", handlers.Select(t => t.AssemblyQualifiedName)); + } + + Address inputAddress; + + + /// + /// Thread-static list of message modules, needs to be initialized for every transport message + /// + [ThreadStatic] + static List modules; + + /// + /// Map of message IDs to Async Results - useful for cleanup in case of timeouts. + /// + protected readonly IDictionary messageIdToAsyncResultLookup = new Dictionary(); + + /// + /// ThreadStatic + /// + [ThreadStatic] + static TransportMessage _messageBeingHandled; + + private volatile bool started; + private volatile bool starting; + private readonly object startLocker = new object(); + + private readonly static ILog Log = LogManager.GetLogger(typeof(UnicastBus)); + + private IList thingsToRunAtStartup; + + [ThreadStatic] + private static bool _doNotContinueDispatchingCurrentMessageToHandlers; + /// + /// ThreadStatic variable indicating if the current message was already + /// marked to be handled later so we don't do this more than once. + /// + [ThreadStatic] + static bool _handleCurrentMessageLaterWasCalled; + IEnumerable messageHandlerTypes; + protected ITransport transport; + bool autoSubscribe = true; + + IMessageMapper messageMapper; + Task[] thingsToRunAtStartupTask = new Task[0]; + bool disposed; + } +} diff --git a/src/unitofwork/NServiceBus.UnitOfWork/IManageUnitsOfWork.cs b/src/NServiceBus.Core/UnitOfWork/IManageUnitsOfWork.cs similarity index 93% rename from src/unitofwork/NServiceBus.UnitOfWork/IManageUnitsOfWork.cs rename to src/NServiceBus.Core/UnitOfWork/IManageUnitsOfWork.cs index ad86aba6fe9..dcbd7dfb4d6 100644 --- a/src/unitofwork/NServiceBus.UnitOfWork/IManageUnitsOfWork.cs +++ b/src/NServiceBus.Core/UnitOfWork/IManageUnitsOfWork.cs @@ -1,7 +1,7 @@ -namespace NServiceBus.UnitOfWork -{ - using System; - +namespace NServiceBus.UnitOfWork +{ + using System; + /// /// Interface used by NServiceBus to manage units of work as a part of the /// message processing pipeline. diff --git a/src/NServiceBus.Core/Utils/BackOff.cs b/src/NServiceBus.Core/Utils/BackOff.cs new file mode 100644 index 00000000000..698db153bcc --- /dev/null +++ b/src/NServiceBus.Core/Utils/BackOff.cs @@ -0,0 +1,48 @@ +namespace NServiceBus.Utils +{ + using System; + using System.Threading; + + /// + /// A utility class that does a sleep on very call up to a limit based on a condition. + /// + public class BackOff + { + private readonly int maximum; + private int currentDelay = 50; + + /// + /// Initialises a new instance. + /// + /// The maximum number of milliseconds for which the thread is blocked. + public BackOff(int maximum) + { + this.maximum = maximum; + } + + /// + /// It executes the Thread sleep if condition is true, otherwise it resets. + /// + /// If the condition is true then the wait is performed. + public void Wait(Func condition) + { + if (!condition()) + { + currentDelay = 50; + return; + } + + Thread.Sleep(currentDelay); + + if (currentDelay < maximum) + { + currentDelay *= 2; + } + + if (currentDelay > maximum) + { + currentDelay = maximum; + } + } + } +} diff --git a/src/NServiceBus.Core/Utils/FileVersionRetriever.cs b/src/NServiceBus.Core/Utils/FileVersionRetriever.cs new file mode 100644 index 00000000000..b2b1c85de83 --- /dev/null +++ b/src/NServiceBus.Core/Utils/FileVersionRetriever.cs @@ -0,0 +1,41 @@ +namespace NServiceBus.Utils +{ + using System; + using System.Diagnostics; + using System.Reflection; + + /// + /// Helper class to retrieve File version. + /// + public class FileVersionRetriever + { + /// + /// Retrieves a semver compliant version from a . + /// + /// to retrieve version from. + /// SemVer compliant version. + public static string GetFileVersion(Type type) + { + if (!String.IsNullOrEmpty(type.Assembly.Location)) + { + var fileVersion = FileVersionInfo.GetVersionInfo(type.Assembly.Location); + + return new Version(fileVersion.FileMajorPart, fileVersion.FileMinorPart, fileVersion.FileBuildPart).ToString(3); + } + + var customAttributes = type.Assembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute), false); + + if (customAttributes.Length >= 1) + { + var fileVersion = (AssemblyFileVersionAttribute)customAttributes[0]; + Version version; + if (Version.TryParse(fileVersion.Version, out version)) + { + return version.ToString(3); + } + } + + return type.Assembly.GetName().Version.ToString(3); + } + } +} diff --git a/src/utils/NServiceBus.Utils.Reflection/DelegateFactory.cs b/src/NServiceBus.Core/Utils/Reflection/DelegateFactory.cs similarity index 98% rename from src/utils/NServiceBus.Utils.Reflection/DelegateFactory.cs rename to src/NServiceBus.Core/Utils/Reflection/DelegateFactory.cs index c4e64d55de1..39a5817d7a3 100644 --- a/src/utils/NServiceBus.Utils.Reflection/DelegateFactory.cs +++ b/src/NServiceBus.Core/Utils/Reflection/DelegateFactory.cs @@ -1,4 +1,4 @@ -/* +/* Added reflection optimization techniques from Nate Kohari and Jimmy Bogard: http://kohari.org/2009/03/06/fast-late-bound-invocation-with-expression-trees/ @@ -8,13 +8,13 @@ http://www.lostechies.com/blogs/jimmy_bogard/archive/2009/08/05/late-bound-invocations-with-dynamicmethod.aspx */ -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Reflection.Emit; - namespace NServiceBus.Utils.Reflection { + using System.Linq; + using System.Linq.Expressions; + using System.Reflection; + using System.Reflection.Emit; + /// /// Late Bound Method /// diff --git a/src/NServiceBus.Core/Utils/Reflection/ExtensionMethods.cs b/src/NServiceBus.Core/Utils/Reflection/ExtensionMethods.cs new file mode 100644 index 00000000000..bf0fcf0d323 --- /dev/null +++ b/src/NServiceBus.Core/Utils/Reflection/ExtensionMethods.cs @@ -0,0 +1,143 @@ +namespace NServiceBus.Utils.Reflection +{ + using System; + using System.Collections; + using System.Collections.Generic; + + /// + /// Contains extension methods + /// + public static class ExtensionMethods + { + /// + /// Useful for finding if a type is (for example) IMessageHandler{T} where T : IMessage. + /// + /// + /// + /// + /// + public static bool IsGenericallyEquivalent(this Type type, Type openGenericType, Type genericArg) + { + bool result = false; + LoopAndAct(type, openGenericType, genericArg, t => result = true); + + return result; + } + + /// + /// Returns the enclosed generic type given that the type is GenericallyEquivalent. + /// + /// + /// + /// + /// + public static Type GetGenericallyContainedType(this Type type, Type openGenericType, Type genericArg) + { + Type result = null; + LoopAndAct(type, openGenericType, genericArg, t => result = t); + + return result; + } + + private static void LoopAndAct(Type type, Type openGenericType, Type genericArg, Action act) + { + foreach (var i in type.GetInterfaces()) + { + var args = i.GetGenericArguments(); + + if (args.Length == 1) + if (genericArg.IsAssignableFrom(args[0])) + if (openGenericType.MakeGenericType(args[0]) == i) + { + act(args[0]); + break; + } + } + } + + /// + /// Returns true if the type can be serialized as is. + /// + /// + /// + public static bool IsSimpleType(this Type type) + { + return (type == typeof(string) || + type.IsPrimitive || + type == typeof(decimal) || + type == typeof(Guid) || + type == typeof(DateTime) || + type == typeof(TimeSpan) || + type == typeof(DateTimeOffset) || + type.IsEnum); + } + + /// + /// Takes the name of the given type and makes it friendly for serialization + /// by removing problematic characters. + /// + /// + /// + public static string SerializationFriendlyName(this Type t) + { + lock(TypeToNameLookup) + if (TypeToNameLookup.ContainsKey(t)) + return TypeToNameLookup[t]; + + var args = t.GetGenericArguments(); + if (args != null) + { + int index = t.Name.IndexOf('`'); + if (index >= 0) + { + string result = t.Name.Substring(0, index) + "Of"; + for (int i = 0; i < args.Length; i++) + { + result += args[i].SerializationFriendlyName(); + if (i != args.Length - 1) + result += "And"; + } + + if (args.Length == 2) + if (typeof(KeyValuePair<,>).MakeGenericType(args) == t) + result = "NServiceBus." + result; + + lock(TypeToNameLookup) + TypeToNameLookup[t] = result; + + return result; + } + } + + lock(TypeToNameLookup) + TypeToNameLookup[t] = t.Name; + + return t.Name; + } + + private static readonly byte[] MsPublicKeyToken = typeof(string).Assembly.GetName().GetPublicKeyToken(); + + static bool IsClrType(byte[] a1) + { + IStructuralEquatable eqa1 = a1; + return eqa1.Equals(MsPublicKeyToken, StructuralComparisons.StructuralEqualityComparer); + } + + public static bool IsSystemType(this Type type) + { + var nameOfContainingAssembly = type.Assembly.GetName().GetPublicKeyToken(); + + return IsClrType(nameOfContainingAssembly); + } + + + public static bool IsNServiceBusMarkerInterface(this Type type) + { + return type == typeof(IMessage) || + type == typeof(ICommand) || + type == typeof(IEvent); + } + + private static readonly IDictionary TypeToNameLookup = new Dictionary(); + } +} diff --git a/src/utils/NServiceBus.Utils.Reflection/Reflect.cs b/src/NServiceBus.Core/Utils/Reflection/Reflect.cs similarity index 97% rename from src/utils/NServiceBus.Utils.Reflection/Reflect.cs rename to src/NServiceBus.Core/Utils/Reflection/Reflect.cs index b7a9e46ce05..bf761b144d4 100644 --- a/src/utils/NServiceBus.Utils.Reflection/Reflect.cs +++ b/src/NServiceBus.Core/Utils/Reflection/Reflect.cs @@ -1,11 +1,11 @@ -//http://netfx.googlecode.com/svn/trunk/Source/Reflection/Reflect.cs - -using System; -using System.Reflection; -using System.Linq.Expressions; +//http://netfx.googlecode.com/svn/trunk/Source/Reflection/Reflect.cs namespace NServiceBus.Utils.Reflection { + using System; + using System.Linq.Expressions; + using System.Reflection; + /// /// Provides strong-typed reflection for static members of any type or calling /// object constructors (to retrieve the constructor ). @@ -190,7 +190,10 @@ public static MethodInfo GetMethod(ExpressionThe is not a lambda expression or it does not represent a property access. public static PropertyInfo GetProperty(Expression> property) { - return GetProperty(property, false); + var info = GetMemberInfo(property, false) as PropertyInfo; + if (info == null) throw new ArgumentException("Member is not a property"); + + return info; } /// @@ -201,10 +204,7 @@ public static PropertyInfo GetProperty(Expression> propert /// public static PropertyInfo GetProperty(Expression> property, bool checkForSingleDot) { - var info = GetMemberInfo(property, checkForSingleDot) as PropertyInfo; - if (info == null) throw new ArgumentException("Member is not a property"); - - return info; + return GetMemberInfo(property, checkForSingleDot) as PropertyInfo;; } diff --git a/src/NServiceBus.Core/Utils/RegistryReader.cs b/src/NServiceBus.Core/Utils/RegistryReader.cs new file mode 100644 index 00000000000..47262efceb4 --- /dev/null +++ b/src/NServiceBus.Core/Utils/RegistryReader.cs @@ -0,0 +1,61 @@ +namespace NServiceBus.Utils +{ + using System; + using Logging; + using Microsoft.Win32; + + /// + /// Wrapper to read registry keys. + /// + /// The type of the key to retrieve + public class RegistryReader + { + static readonly ILog Logger = LogManager.GetLogger(typeof(RegistryReader)); + + /// + /// Attempts to read the key from the registry. + /// + /// The name of the value to retrieve. This string is not case-sensitive. + /// The value to return if does not exist. + /// + /// The value associated with , with any embedded environment variables left unexpanded, or if is not found. + /// + public static T Read(string name, T defaultValue = default(T)) + { + try + { + return ReadRegistryKeyValue(name, defaultValue); + } + catch (Exception ex) + { + Logger.Warn(string.Format(@"We couldn't read the registry to retrieve the {0}, from 'HKEY_LOCAL_MACHINE\SOFTWARE\ParticularSoftware\ServiceBus'.", name), ex); + } + + return defaultValue; + } + + protected static T ReadRegistryKeyValue(string keyName, object defaultValue) + { + object value; + + if (Environment.Is64BitOperatingSystem) + { + value = ReadRegistry(RegistryView.Registry32, keyName, defaultValue) ?? ReadRegistry(RegistryView.Registry64, keyName, defaultValue); + } + else + { + value = ReadRegistry(RegistryView.Default, keyName, defaultValue); + } + + return (T)value; + } + + protected static object ReadRegistry(RegistryView view, string keyName, object defaultValue) + { + using (var key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, view).OpenSubKey(@"SOFTWARE\ParticularSoftware\ServiceBus")) + { + return key == null ? defaultValue : key.GetValue(keyName, defaultValue); + } + } + } +} \ No newline at end of file diff --git a/src/integration/NServiceBus.Integration.WCF/WcfService.cs b/src/NServiceBus.Core/WcfService.cs similarity index 97% rename from src/integration/NServiceBus.Integration.WCF/WcfService.cs rename to src/NServiceBus.Core/WcfService.cs index 12e4654a6fa..19f22cba9cd 100644 --- a/src/integration/NServiceBus.Integration.WCF/WcfService.cs +++ b/src/NServiceBus.Core/WcfService.cs @@ -1,8 +1,8 @@ -using System; -using System.ServiceModel; - namespace NServiceBus { + using System; + using System.ServiceModel; + /// /// Generic WCF service for exposing a messaging endpoint. /// diff --git a/src/NServiceBus.Core/packages.config b/src/NServiceBus.Core/packages.config new file mode 100644 index 00000000000..e4143666847 --- /dev/null +++ b/src/NServiceBus.Core/packages.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/NServiceBus.Notifications/BusExtensions.cs b/src/NServiceBus.Notifications/BusExtensions.cs new file mode 100644 index 00000000000..26241453548 --- /dev/null +++ b/src/NServiceBus.Notifications/BusExtensions.cs @@ -0,0 +1,28 @@ +namespace NServiceBus +{ + using System; + using Features; + using Notifications; + + /// + /// Extension methods for notifications + /// + public static class BusExtensions + { + /// + /// Sends the specified message via the to an SMTP server for delivery. + /// + /// The that is sending the message. + /// The to send. + public static void SendEmail(this IBus bus, MailMessage message) + { + if (!Feature.IsEnabled()) + throw new InvalidOperationException("Notifications feature is disabled. You need to ensure that this feature is enabled."); + + bus.Send(Configure.Instance.GetMasterNodeAddress().SubScope("Notifications"), new SendEmail + { + Message = message + }); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Notifications/FeatureSettingsExtensions.cs b/src/NServiceBus.Notifications/FeatureSettingsExtensions.cs new file mode 100644 index 00000000000..16d8c32acbb --- /dev/null +++ b/src/NServiceBus.Notifications/FeatureSettingsExtensions.cs @@ -0,0 +1,24 @@ +namespace NServiceBus +{ + using System; + using Features; + + /// + /// Feature extensions for notifications. + /// + public static class FeatureSettingsExtensions + { + /// + /// Customise notifications. + /// + /// + /// + /// + public static FeatureSettings Notifications(this FeatureSettings settings, Action customSettings) + { + customSettings(new NotificationsSettings()); + + return settings; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Notifications/MailMessage.cs b/src/NServiceBus.Notifications/MailMessage.cs new file mode 100644 index 00000000000..4d36c45cce4 --- /dev/null +++ b/src/NServiceBus.Notifications/MailMessage.cs @@ -0,0 +1,238 @@ +namespace NServiceBus +{ + using System; + using System.Collections.Generic; + using System.Net.Mail; + using System.Text; + + + /// + /// Represents an e-mail message that can be sent using the . + /// + [Serializable] + public class MailMessage + { + /// + /// Initializes an empty instance of the class. + /// + public MailMessage() + { + Bcc = new List(); + CC = new List(); + ReplyToList = new List(); + To = new List(); + Headers = new Dictionary(); + } + + /// + /// Initializes a new instance of the class by using the specified class objects. + /// + /// A that contains the address of the sender of the e-mail message. + /// A that contains the addresses of the recipients of the e-mail message. + /// is null.-or- is null. + /// is ("").-or- is (""). + public MailMessage(string from, string to) : this() + { + if (from == null) + throw new ArgumentNullException("from"); + + if (to == null) + throw new ArgumentNullException("to"); + + if (from == String.Empty) + throw new ArgumentException("The parameter 'from' cannot be an empty string.", "from"); + + if (to == String.Empty) + throw new ArgumentException("The parameter 'to' cannot be an empty string.", "to"); + + To.Add(to); + From = from; + } + + /// + /// Initializes a new instance of the class. + /// + /// A that contains the address of the sender of the e-mail message. + /// A that contains the address of the recipient of the e-mail message. + /// A that contains the subject text. + /// A that contains the message body. + /// is null.-or- is null. + /// is ("").-or- is (""). + public MailMessage(string from, string to, string subject, string body) : this(from, to) + { + Subject = subject; + Body = body; + } + + /// + /// Gets the address collection that contains the blind carbon copy (BCC) recipients for this e-mail message. + /// + /// + /// + /// A writable object. + /// + public List Bcc { get; set; } + + /// + /// Gets or sets the message body. + /// + /// + /// + /// A value that contains the body text. + /// + public string Body { get; set; } + + /// + /// Gets the address collection that contains the carbon copy (CC) recipients for this e-mail message. + /// + /// + /// + /// A writable object. + /// + public List CC { get; set; } + + /// + /// Gets or sets the encoding used to encode the message body. + /// + /// + /// + /// An applied to the contents of the . + /// + public Encoding BodyEncoding { get; set; } + + /// + /// Gets or sets the delivery notifications for this e-mail message. + /// + /// + /// + /// A value that contains the delivery notifications for this message. + /// + public DeliveryNotificationOptions DeliveryNotificationOptions { get; set; } + + /// + /// Gets or sets the from address for this e-mail message. + /// + /// + /// + /// The from address information. + /// + public string From { get; set; } + + /// + /// Gets the e-mail headers that are transmitted with this e-mail message. + /// + /// + /// + /// A that contains the e-mail headers. + /// + public Dictionary Headers { get; set; } + + /// + /// Gets or sets the encoding used for the user-defined custom headers for this e-mail message. + /// + /// + /// + /// The encoding used for user-defined custom headers for this e-mail message. + /// + public Encoding HeadersEncoding { get; set; } + + /// + /// Gets or sets a value indicating whether the mail message body is in Html. + /// + /// + /// + /// true if the message body is in Html; else false. The default is false. + /// + public bool IsBodyHtml { get; set; } + + /// + /// Gets or sets the list of addresses to reply to for the mail message. + /// + /// + /// + /// The list of the addresses to reply to for the mail message. + /// + public List ReplyToList { get; set; } + + /// + /// Gets or sets the sender's address for this e-mail message. + /// + /// + /// + /// The sender's address information. + /// + public string Sender { get; set; } + + /// + /// Gets or sets the subject line for this e-mail message. + /// + /// + /// + /// A that contains the subject content. + /// + public string Subject { get; set; } + + /// + /// Gets or sets the encoding used for the subject content for this e-mail message. + /// + /// + /// + /// An that was used to encode the property. + /// + public Encoding SubjectEncoding { get; set; } + + /// + /// Gets the address collection that contains the recipients of this e-mail message. + /// + /// + /// + /// A writable object. + /// + public List To { get; set; } + + /// + /// Gets or sets the priority of this e-mail message. + /// + /// + /// + /// A that contains the priority of this message. + /// + public MailPriority Priority { get; set; } + + + /// + /// Converts to . + /// + /// A . + internal System.Net.Mail.MailMessage ToMailMessage() + { + var mail = new System.Net.Mail.MailMessage(); + if (From != null) + mail.From = new MailAddress(From); + To.ForEach(a => mail.To.Add(new MailAddress(a))); + ReplyToList.ForEach(a => mail.ReplyToList.Add(new MailAddress(a))); + Bcc.ForEach(a => mail.Bcc.Add(new MailAddress(a))); + CC.ForEach(a => mail.CC.Add(new MailAddress(a))); + + foreach (var header in Headers) + { + mail.Headers[header.Key] = header.Value; + } + + mail.Body = Body; + if (BodyEncoding != null) + mail.BodyEncoding = BodyEncoding; + mail.DeliveryNotificationOptions = DeliveryNotificationOptions; + mail.IsBodyHtml = IsBodyHtml; + if (Sender != null) + mail.Sender = new MailAddress(Sender); + mail.Subject = Subject; + if (SubjectEncoding != null) + mail.SubjectEncoding = SubjectEncoding; + + mail.Priority = Priority; + + return mail; + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Notifications/NServiceBus.Notifications.csproj b/src/NServiceBus.Notifications/NServiceBus.Notifications.csproj new file mode 100644 index 00000000000..8657c29b552 --- /dev/null +++ b/src/NServiceBus.Notifications/NServiceBus.Notifications.csproj @@ -0,0 +1,80 @@ + + + + + Debug + AnyCPU + {C97A8937-E7AF-4791-A4A2-0927422DDC2C} + Library + Properties + NServiceBus.Notifications + NServiceBus.Notifications + v4.0 + 512 + + + true + full + false + ..\..\binaries\ + DEBUG;TRACE + prompt + 4 + ..\..\binaries\NServiceBus.Notifications.XML + false + true + + + pdbonly + true + ..\..\binaries\ + TRACE + prompt + 4 + ..\..\binaries\NServiceBus.Notifications.XML + true + + + true + ..\NServiceBus.snk + + + + + + + + + + + + + + + + + + + + + {85e813c0-4a94-4946-8b1f-de1e39aa7d11} + NServiceBus.Hosting.Windows + + + {dd48b2d0-e996-412d-9157-821ed8b17a9d} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + + + + \ No newline at end of file diff --git a/src/NServiceBus.Notifications/NotificationSatellite.cs b/src/NServiceBus.Notifications/NotificationSatellite.cs new file mode 100644 index 00000000000..b0009870db8 --- /dev/null +++ b/src/NServiceBus.Notifications/NotificationSatellite.cs @@ -0,0 +1,119 @@ +namespace NServiceBus.Notifications +{ + using System; + using System.IO; + using System.Linq; + using System.Net.Mail; + using System.Text; + using Features; + using Logging; + using Satellites; + using Serialization; + using Settings; + + /// + /// Satellite implementation to handle messages. + /// + public class NotificationSatellite : ISatellite + { + /// + /// Default constructor + /// + /// + public NotificationSatellite(IMessageSerializer messageSerializer) + { + this.messageSerializer = messageSerializer; + address = Configure.Instance.GetMasterNodeAddress().SubScope("Notifications"); + } + + /// + /// This method is called when a message is available to be processed. + /// + /// + /// The received. + /// + public bool Handle(TransportMessage message) + { + SendEmail sendEmail; + + using (var stream = new MemoryStream(message.Body)) + { + sendEmail = (SendEmail) messageSerializer.Deserialize(stream, new[] {typeof (SendEmail)}).First(); + } + + using (var c = new SmtpClient()) + { + using (MailMessage mailMessage = sendEmail.Message.ToMailMessage()) + { + try + { + c.Send(mailMessage); + } + catch (SmtpFailedRecipientsException ex) + { + int originalRecipientCount = mailMessage.To.Count + mailMessage.Bcc.Count + mailMessage.CC.Count; + if (ex.InnerExceptions.Length == originalRecipientCount) + { + // All messages failed. + // FLR/SLR can handle it. + throw; + } + + var sb = new StringBuilder(); + + foreach (SmtpFailedRecipientException recipientException in ex.InnerExceptions) + { + sb.AppendLine(); + sb.AppendFormat("{0}", recipientException.FailedRecipient); + } + + Logger.WarnFormat( + "NServiceBus failed to send an email to some of its recipients, here is the list of recipients that failed:{0}", sb.ToString()); + + deliveryFailuresCallback(ex); + } + } + } + + return true; + } + + /// + /// Starts the . + /// + public void Start() + { + deliveryFailuresCallback = SettingsHolder.Get>("Notifications.DeliveryFailuresCallback"); + } + + /// + /// Stops the . + /// + public void Stop() + { + //no-op + } + + /// + /// The for this to use when receiving messages. + /// + public Address InputAddress + { + get { return address; } + } + + /// + /// Set to true to disable this . + /// + public bool Disabled + { + get { return !Feature.IsEnabled(); } + } + + static readonly ILog Logger = LogManager.GetLogger(typeof (NotificationSatellite)); + + readonly Address address; + readonly IMessageSerializer messageSerializer; + Action deliveryFailuresCallback; + } +} \ No newline at end of file diff --git a/src/NServiceBus.Notifications/Notifications.cs b/src/NServiceBus.Notifications/Notifications.cs new file mode 100644 index 00000000000..9a7a1a5a673 --- /dev/null +++ b/src/NServiceBus.Notifications/Notifications.cs @@ -0,0 +1,25 @@ +namespace NServiceBus.Features +{ + /// + /// Notifications feature + /// + public class Notifications : Feature + { + /// + /// Returns true if the feature should be enable. This method wont be called if the feature is explicitly disabled + /// + /// + public override bool ShouldBeEnabled() + { + return !Configure.Instance.IsConfiguredAsMasterNode(); + } + + /// + /// Return true if this is a default that needs to be turned on automatically. + /// + public override bool IsEnabledByDefault + { + get { return true; } + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Notifications/NotificationsSettings.cs b/src/NServiceBus.Notifications/NotificationsSettings.cs new file mode 100644 index 00000000000..93408964baf --- /dev/null +++ b/src/NServiceBus.Notifications/NotificationsSettings.cs @@ -0,0 +1,31 @@ +namespace NServiceBus +{ + using System; + using System.Net.Mail; + using Settings; + + /// + /// Custom notification settings + /// + public class NotificationsSettings : ISetDefaultSettings + { + readonly Action defaultCallback = _ => { }; + + /// + /// Default constructor. + /// + public NotificationsSettings() + { + SettingsHolder.SetDefault("Notifications.DeliveryFailuresCallback", defaultCallback); + } + + /// + /// Allows the user to specify a callback to be called when an e-mail is sent using an and cannot be delivered to all recipients. + /// + /// The callback to be used. + public void HandleDeliveryFailures(Action callback) + { + SettingsHolder.Set("Notifications.DeliveryFailuresCallback", callback); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Notifications/Properties/AssemblyInfo.cs b/src/NServiceBus.Notifications/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..b8d9ee9e83f --- /dev/null +++ b/src/NServiceBus.Notifications/Properties/AssemblyInfo.cs @@ -0,0 +1,17 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("NServiceBus Notifications")] +[assembly: AssemblyDescription("Enterprise application framework for publish/subscribe and long-running business processes.")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyProduct("NServiceBus")] +[assembly: AssemblyCompany("NServiceBus")] +[assembly: AssemblyConfiguration("release")] +[assembly: AssemblyInformationalVersion("4.0.0-alpha0")] +[assembly: ComVisible(false)] +[assembly: CLSCompliantAttribute(true)] \ No newline at end of file diff --git a/src/NServiceBus.Notifications/RegisterSystemMessages.cs b/src/NServiceBus.Notifications/RegisterSystemMessages.cs new file mode 100644 index 00000000000..4734e24b224 --- /dev/null +++ b/src/NServiceBus.Notifications/RegisterSystemMessages.cs @@ -0,0 +1,16 @@ +namespace NServiceBus.Notifications +{ + /// + /// Registers send email notifications. + /// + public class RegisterSystemMessages : IWantToRunBeforeConfiguration + { + /// + /// Invoked before configuration starts. + /// + public void Init() + { + MessageConventionExtensions.AddSystemMessagesConventions(t => typeof (SendEmail) == t); + } + } +} \ No newline at end of file diff --git a/src/NServiceBus.Notifications/SendEmail.cs b/src/NServiceBus.Notifications/SendEmail.cs new file mode 100644 index 00000000000..73f9baec1df --- /dev/null +++ b/src/NServiceBus.Notifications/SendEmail.cs @@ -0,0 +1,13 @@ +namespace NServiceBus.Notifications +{ + /// + /// Send email wrapper class to be used internally when sending an email using Bus.SendEmail(). + /// + internal class SendEmail + { + /// + /// The . + /// + public MailMessage Message { get; set; } + } +} \ No newline at end of file diff --git a/src/NServiceBus/Address.cs b/src/NServiceBus/Address.cs new file mode 100644 index 00000000000..731fd11dd60 --- /dev/null +++ b/src/NServiceBus/Address.cs @@ -0,0 +1,255 @@ +using System; +using System.Net; +using System.Runtime.Serialization; + +namespace NServiceBus +{ + using Support; + + /// + /// Abstraction for an address on the NServiceBus network. + /// + [Serializable] + public class Address : ISerializable + { + /// + /// Undefined address. + /// + public static readonly Address Undefined = new Address(String.Empty, String.Empty); + + /// + /// Self address. + /// + public static readonly Address Self = new Address("__self", "localhost"); + + + + /// + /// Get the address of this endpoint. + /// + public static Address Local { get; private set; } + + /// + /// Sets the address of this endpoint. + /// + /// The queue name. + public static void InitializeLocalAddress(string queue) + { + Local = Parse(queue); + + if (preventChanges) + throw new InvalidOperationException("Overwriting a previously set local address is a very dangerous operation. If you think that your scenario warrants it, you can catch this exception and continue."); + } + + /// + /// Sets the address mode, can only be done as long as the local address is not been initialized.By default the default machine equals Environment.MachineName + /// + /// The machine name. + /// + public static void OverrideDefaultMachine(string machineName) + { + defaultMachine = machineName; + + if (preventChanges) + throw new InvalidOperationException("Overwriting a previously set default machine name is a very dangerous operation. If you think that your scenario warrants it, you can catch this exception and continue."); + } + + /// + /// Instructed the address to not consider the machine name + /// + public static void IgnoreMachineName() + { + ignoreMachineName = true; + } + + /// + /// Parses a string and returns an Address. + /// + /// The full address to parse. + /// A new instance of . + public static Address Parse(string destination) + { + if (string.IsNullOrEmpty(destination)) + { + throw new ArgumentException("Invalid destination address specified", "destination"); + } + + var arr = destination.Split('@'); + + var queue = arr[0]; + var machine = defaultMachine; + + if (String.IsNullOrWhiteSpace(queue)) + { + throw new ArgumentException("Invalid destination address specified", "destination"); + } + + if (arr.Length == 2) + if (arr[1] != "." && arr[1].ToLower() != "localhost" && arr[1] != IPAddress.Loopback.ToString()) + machine = arr[1]; + + return new Address(queue, machine); + } + + /// + /// Instantiate a new Address for a known queue on a given machine. + /// + ///The queue name. + ///The machine name. + public Address(string queueName, string machineName) + { + Queue = queueName; + queueLowerCased = queueName.ToLower(); + Machine = machineName ?? defaultMachine; + machineLowerCased = Machine.ToLower(); + } + + /// + /// Deserializes an Address. + /// + /// The to populate with data. + /// The destination (see ) for this serialization. + protected Address(SerializationInfo info, StreamingContext context) + { + Queue = info.GetString("Queue"); + Machine = info.GetString("Machine"); + + if (!String.IsNullOrEmpty(Queue)) + { + queueLowerCased = Queue.ToLower(); + } + + if (!String.IsNullOrEmpty(Machine)) + { + machineLowerCased = Machine.ToLower(); + } + } + + /// + /// Populates a with the data needed to serialize the target object. + /// + /// The to populate with data. + /// The destination (see ) for this serialization. + /// The caller does not have the required permission. + void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) + { + info.AddValue("Queue", Queue); + info.AddValue("Machine", Machine); + } + + /// + /// Creates a new Address whose Queue is derived from the Queue of the existing Address + /// together with the provided qualifier. For example: queue.qualifier@machine + /// + /// + /// + public Address SubScope(string qualifier) + { + return new Address(Queue + "." + qualifier, Machine); + } + + /// + /// Provides a hash code of the Address. + /// + /// + public override int GetHashCode() + { + unchecked + { + return ((queueLowerCased != null ? queueLowerCased.GetHashCode() : 0) * 397) ^ (machineLowerCased != null ? machineLowerCased.GetHashCode() : 0); + } + } + + /// + /// Returns a string representation of the address. + /// + /// + public override string ToString() + { + if (ignoreMachineName) + return Queue; + + return Queue + "@" + Machine; + } + + /// + /// Prevents changes to all addresses. + /// + public static void PreventChanges() + { + preventChanges = true; + } + + /// + /// The (lowercase) name of the queue not including the name of the machine or location depending on the address mode. + /// + public string Queue { get; private set; } + + /// + /// The (lowercase) name of the machine or the (normal) name of the location depending on the address mode. + /// + public string Machine { get; private set; } + + /// + /// Overloading for the == for the class Address + /// + /// Left hand side of == operator + /// Right hand side of == operator + /// true if the LHS is equal to RHS + public static bool operator ==(Address left, Address right) + { + return Equals(left, right); + } + + /// + /// Overloading for the != for the class Address + /// + /// Left hand side of != operator + /// Right hand side of != operator + /// true if the LHS is not equal to RHS + public static bool operator !=(Address left, Address right) + { + return !Equals(left, right); + } + + /// + /// Determines whether the specified is equal to the current . + /// + /// + /// true if the specified is equal to the current ; otherwise, false. + /// + /// The to compare with the current . 2 + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != typeof(Address)) return false; + return Equals((Address)obj); + } + + /// + /// Check this is equal to other Address + /// + /// reference addressed to be checked with this + /// true if this is equal to other + private bool Equals(Address other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + if (!ignoreMachineName && !other.machineLowerCased.Equals(machineLowerCased)) + return false; + + return other.queueLowerCased.Equals(queueLowerCased); + + } + + static string defaultMachine = RuntimeEnvironment.MachineName; + static bool preventChanges; + + readonly string queueLowerCased; + readonly string machineLowerCased; + static bool ignoreMachineName; + + } +} diff --git a/src/core/NServiceBus/AddressMode.cs b/src/NServiceBus/AddressMode.cs similarity index 100% rename from src/core/NServiceBus/AddressMode.cs rename to src/NServiceBus/AddressMode.cs diff --git a/src/core/NServiceBus/CompletionResult.cs b/src/NServiceBus/CompletionResult.cs similarity index 100% rename from src/core/NServiceBus/CompletionResult.cs rename to src/NServiceBus/CompletionResult.cs diff --git a/src/NServiceBus/ContentTypes.cs b/src/NServiceBus/ContentTypes.cs new file mode 100644 index 00000000000..43657dbc9ae --- /dev/null +++ b/src/NServiceBus/ContentTypes.cs @@ -0,0 +1,28 @@ +namespace NServiceBus +{ + /// + /// Contains message body content type definitions. + /// + public static class ContentTypes + { + /// + /// Indicates that the content type is "application/bson" + /// + public const string Bson = "application/bson"; + + /// + /// Indicates that the content type is "application/binary" + /// + public const string Binary = "application/binary"; + + /// + /// Indicates that the content type is "application/json" + /// + public const string Json = "application/json"; + + /// + /// Indicates that the content type is "text/xml" + /// + public const string Xml = "text/xml"; + } +} \ No newline at end of file diff --git a/src/NServiceBus/DataBusProperty.cs b/src/NServiceBus/DataBusProperty.cs new file mode 100644 index 00000000000..e870ee5a74c --- /dev/null +++ b/src/NServiceBus/DataBusProperty.cs @@ -0,0 +1,116 @@ +using System; +using System.Runtime.Serialization; + +namespace NServiceBus +{ + /// + /// Default implementation for . + /// + /// Type of data to store in . + [Serializable] + public class DataBusProperty : IDataBusProperty, ISerializable where T : class + { + T value; + + /// + /// initializes a with the . + /// + /// The value to initialise with. + public DataBusProperty(T value) + { + SetValue(value); + } + + /// + /// For serialization purposes. + /// + /// The to populate with data. The destination (see ) for this serialization. The caller does not have the required permission. + protected DataBusProperty(SerializationInfo info, StreamingContext context) + { + Key = info.GetString("Key"); + HasValue = info.GetBoolean("HasValue"); + } + + /// + /// The key. + /// + public string Key { get; set; } + + /// + /// true if has a value. + /// + public bool HasValue { get; set; } + + /// + /// The value. + /// + public T Value + { + get + { + return value; + } + } + + + /// + /// Populates a with the data needed to serialize the target object. + /// + /// The to populate with data. The destination (see ) for this serialization. The caller does not have the required permission. + public void GetObjectData(SerializationInfo info, StreamingContext context) + { + info.AddValue("Key", Key); + info.AddValue("HasValue", HasValue); + } + + /// + /// Sets the value for . + /// + /// The value to set. + public void SetValue(object valueToSet) + { + value = valueToSet as T; + + if (value != null) + HasValue = true; + } + + /// + /// Gets the value of the . + /// + /// The value + public object GetValue() + { + return Value; + } + + } + + /// + /// The contract to implement a . + /// + public interface IDataBusProperty + { + /// + /// The key. + /// + string Key { get; set; } + + /// + /// Gets the value of the . + /// + /// The value + object GetValue(); + + /// + /// Sets the value for . + /// + /// The value to set. + void SetValue(object value); + + /// + /// true if has a value. + /// + bool HasValue { get; set; } + } +} \ No newline at end of file diff --git a/src/NServiceBus/ExtensionMethods.cs b/src/NServiceBus/ExtensionMethods.cs new file mode 100644 index 00000000000..96c44bee54d --- /dev/null +++ b/src/NServiceBus/ExtensionMethods.cs @@ -0,0 +1,277 @@ +using System; +using System.Collections.Generic; + +namespace NServiceBus +{ + + /// + /// Extension method on message handler. + /// + public static class MessageHandlerExtensionMethods + { + /// + /// Extension method on . Users can avoid declaring an to be injected, and use the bus implicitly. + /// + /// The following is an example on how a might look like using the extension method: + /// + /// public class RequestDataMessageHandler : IHandleMessages<RequestDataMessage> + /// { + /// public void Handle(RequestDataMessage message) + /// { + /// var response = this.Bus().CreateInstance<DataResponseMessage>(m => + /// { + /// m.DataId = message.DataId; + /// m.String = message.String; + /// }); + /// this.Bus().Reply(response); + /// } + /// } + /// + /// + /// The message type to handle. + /// The implementing class. + /// interface. + public static IBus Bus(this IHandleMessages handler) + { + return ExtensionMethods.Bus; + } + } + + /// + /// Class containing extension methods for base class libraries for using interface-based messages. + /// + public static class ExtensionMethods + { + /// + /// Get the header with the given key. Cannot be used to change its value. + /// + /// The . + /// The message to retrieve a header from. + /// The header key. + /// The value assigned to the header. + public static string GetMessageHeader(this IBus bus, object msg, string key) + { + return GetHeaderAction(msg, key); + } + + /// + /// Sets the value of the header for the given key. + /// + /// The . + /// The message to add a header to. + /// The header key. + /// The value to assign to the header. + public static void SetMessageHeader(this IBus bus, object msg, string key, string value) + { + SetHeaderAction(msg, key, value); + } + + /// + /// Get the header with the given key. Cannot be used to change its value. + /// + /// The to retrieve a header from. + /// The header key. + /// The value assigned to the header. + public static string GetHeader(this IMessage msg, string key) + { + return GetHeaderAction(msg, key); + } + + /// + /// Sets the value of the header for the given key. + /// + /// The to add a header to. + /// The header key. + /// The value to assign to the header. + public static void SetHeader(this IMessage msg, string key, string value) + { + SetHeaderAction(msg, key, value); + } + + /// + /// Instantiates an instance of and adds it to the list. + /// + /// The type to instantiate. + /// The list to which to add the new element. + /// An for setting properties of the created instance of . + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "list.Add(Bus.CreateInstance(initializer))")] + public static void Add(this IList list, Action initializer) + { + if (MessageCreator == null) + throw new InvalidOperationException("MessageCreator has not been set."); + + list.Add(MessageCreator.CreateInstance(initializer)); + } + + + + /// + /// Get the header with the given key. Cannot be used to change its value. + /// + /// + /// + /// + [ObsoleteEx(Replacement = "bus.GetMessageHeader(object msg, string key) or Headers.GetMessageHeader(object msg, string key)", RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0")] + public static string GetHeader(this object msg, string key) + { + return GetMessageHeader(null, msg, key); + } + + /// + /// If the source of this message was an Http endpoint, returns its address + /// otherwise returns null. + /// + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Headers.GetMessageHeader(msg, NServiceBus.Headers.HttpFrom)")] + public static string GetHttpFromHeader(this object msg) + { + return GetMessageHeader(null, msg, Headers.HttpFrom); + } + + /// + /// If the target destination of this message is an Http endpoint, + /// return the address of that target, otherwise null. + /// + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Headers.GetMessageHeader(msg, NServiceBus.Headers.HttpTo)")] + public static string GetHttpToHeader(this object msg) + { + return GetMessageHeader(null, msg, Headers.HttpTo); + } + + /// + /// Returns the list of destination sites for this message + /// + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Headers.GetMessageHeader(msg, NServiceBus.Headers.DestinationSites)")] + public static string GetDestinationSitesHeader(this object msg) + { + return GetMessageHeader(null, msg, Headers.DestinationSites); + } + + /// + /// Returns the sitekey for the site for which this message originated, null if this message wasn't sent via the gateway + /// + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Headers.GetMessageHeader(msg, NServiceBus.Headers.OriginatingSite)")] + public static string GetOriginatingSiteHeader(this object msg) + { + return GetMessageHeader(null, msg, Headers.OriginatingSite); + } + + /// + /// Sets the value of the header for the given key. + /// + /// + /// + /// + [ObsoleteEx(Replacement = "bus.SetMessageHeader(object msg, string key, string value) or Headers.SetMessageHeader(object msg, string key, string value)", RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0")] + public static void SetHeader(this object msg, string key, string value) + { + SetMessageHeader(null, msg, key, value); + } + + /// + /// Sets the list of sites to where this message should be routed + /// This method is reserved for the NServiceBus Gateway. + /// + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Headers.SetMessageHeader(msg, NServiceBus.Headers.DestinationSites, value)")] + public static void SetDestinationSitesHeader(this object msg, string value) + { + SetMessageHeader(null, msg, Headers.DestinationSites, value); + } + + + /// + /// Sets the originating site header + /// This method is reserved for the NServiceBus Gateway. + /// + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Headers.SetMessageHeader(msg, NServiceBus.Headers.OriginatingSite, value)")] + public static void SetOriginatingSiteHeader(this object msg, string value) + { + SetMessageHeader(null, msg, Headers.OriginatingSite, value); + } + + /// + /// Sets the Http address from which this message was received. + /// This method is reserved for the NServiceBus Gateway. + /// + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Headers.SetMessageHeader(msg, NServiceBus.Headers.HttpFrom, value)")] + public static void SetHttpFromHeader(this object msg, string value) + { + SetMessageHeader(null, msg, Headers.HttpFrom, value); + } + + /// + /// Sets the Http address to which this message should be sent. + /// Requires the use of the NServiceBus Gateway. + /// + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Headers.SetMessageHeader(msg, NServiceBus.Headers.HttpTo, value)")] + public static void SetHttpToHeader(this object msg, string value) + { + SetMessageHeader(null, msg, Headers.HttpTo, value); + } + + /// + /// Gets the value of the header with the given key and sets it for this message. + /// + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "Headers.SetMessageHeader(msg, key, Bus.CurrentMessageContext.Headers[key])")] + public static void CopyHeaderFromRequest(this object msg, string key) + { + if (msg == CurrentMessageBeingHandled) + throw new InvalidOperationException("This method is not supported on the request message."); + + SetMessageHeader(null, msg, key, GetMessageHeader(null, CurrentMessageBeingHandled, key)); + } + + /// + /// The used by the extention methods to instantiate types. + /// + public static IMessageCreator MessageCreator { get; set; } + + /// + /// The used by the extension methods for accessing headers. + /// + public static IBus Bus { get; set; } + + /// + /// The object used to see whether headers requested are for the handled message. + /// + public static object CurrentMessageBeingHandled { get { return currentMessageBeingHandled; } set { currentMessageBeingHandled = value; } } + + [ThreadStatic] + static object currentMessageBeingHandled; + + /// + /// The used to set the header in the method. + /// + public static Action SetHeaderAction = (x, y, z) => + { + //default to no-op to avoid getting in the way of unittesting + }; + + /// + /// The used to get the header value in the method. + /// + public static Func GetHeaderAction = (x, y) => "No header get header action was defined, please specify one using ExtensionMethods.GetHeaderAction = ..."; + + /// + /// The used to get all the headers for a message. + /// + public static Func> GetStaticOutgoingHeadersAction { get; set; } + } +} diff --git a/src/NServiceBus/Fody.targets b/src/NServiceBus/Fody.targets new file mode 100644 index 00000000000..a668a51fc04 --- /dev/null +++ b/src/NServiceBus/Fody.targets @@ -0,0 +1,89 @@ + + + + + + $(NCrunchOriginalSolutionDir) + + + + + $(SolutionDir) + + + + + $(MSBuildProjectDirectory)\..\ + + + + + + + $(KeyOriginatorFile) + + + + + $(AssemblyOriginatorKeyFile) + + + + + + + + + + $(ProjectDir)$(IntermediateOutputPath) + Low + $(SignAssembly) + $(MSBuildThisFileDirectory) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/NServiceBus/FodyWeavers.xml b/src/NServiceBus/FodyWeavers.xml new file mode 100644 index 00000000000..7b0ab397e86 --- /dev/null +++ b/src/NServiceBus/FodyWeavers.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/NServiceBus/Headers.cs b/src/NServiceBus/Headers.cs new file mode 100644 index 00000000000..333e71bc38f --- /dev/null +++ b/src/NServiceBus/Headers.cs @@ -0,0 +1,239 @@ +namespace NServiceBus +{ + /// + /// Static class containing headers used by NServiceBus. + /// + public static class Headers + { + /// + /// Header for retrieving from which Http endpoint the message arrived. + /// + public const string HttpFrom = "NServiceBus.From"; + + /// + /// Header for specifying to which Http endpoint the message should be delivered. + /// + public const string HttpTo = "NServiceBus.To"; + + /// + /// Header for specifying to which queue behind the http gateway should the message be delivered. + /// This header is considered an applicative header. + /// + public const string RouteTo = "NServiceBus.Header.RouteTo"; + + /// + /// Header for specifying to which sites the gateway should send the message. For multiple + /// sites a comma separated list can be used + /// This header is considered an applicative header. + /// + public const string DestinationSites = "NServiceBus.DestinationSites"; + + /// + /// Header for specifying the key for the site where this message originated. + /// This header is considered an applicative header. + /// + public const string OriginatingSite = "NServiceBus.OriginatingSite"; + + /// + /// Header for time when a message expires in the timeout manager + /// This header is considered an applicative header. + /// + [ObsoleteEx(TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0", Message = "This header is only populated by the timeoutmanager based deferral mechanism and will not be used in future versions")] + public const string Expire = "NServiceBus.Timeout.Expire"; + + /// + /// Header for redirecting the expired timeout to a endpoint other than the one setting the Timeout + /// This header is considered an applicative header. + /// + [ObsoleteEx(TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0", Message = "This header is only populated by the timeoutmanager based deferral mechanism and will not be used in future versions")] + public const string RouteExpiredTimeoutTo = "NServiceBus.Timeout.RouteExpiredTimeoutTo"; + + /// + /// Header containing the id of the saga instance the sent the message + /// This header is considered an applicative header. + /// + public const string SagaId = "NServiceBus.SagaId"; + + /// + /// Header telling the timeout manager to clear previous timeouts + /// This header is considered an applicative header. + /// + [ObsoleteEx(TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0", Message = "This header is only populated by the timeoutmanager based deferral mechanism and will not be used in future versions")] + public const string ClearTimeouts = "NServiceBus.ClearTimeouts"; + + /// + /// Header containing a stable message id for a message. + /// + public const string MessageId = "NServiceBus.MessageId"; + + /// + /// Header containing a correlation id for a message. + /// + public const string CorrelationId = "NServiceBus.CorrelationId"; + + /// + /// Prefix included on the wire when sending applicative headers. + /// + public const string HeaderName = "Header"; + + /// + /// Header containing the windows identity name + /// + public const string WindowsIdentityName = "WinIdName"; + + /// + /// Header telling the NServiceBus Version (beginning NServiceBus V3.0.1). + /// + public const string NServiceBusVersion = "NServiceBus.Version"; + + /// + /// Used in a header when doing a callback (bus.return) + /// + public const string ReturnMessageErrorCodeHeader = "NServiceBus.ReturnMessage.ErrorCode"; + + /// + /// Header that tells if this transport message is a control message + /// + public const string ControlMessageHeader = "NServiceBus.ControlMessage"; + + /// + /// Type of the saga that this message is targeted for + /// + public const string SagaType = "NServiceBus.SagaType"; + + /// + /// Type of the saga that sent this message + /// + [ObsoleteEx(Replacement = "SagaType", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + public const string SagaEntityType = "NServiceBus.SagaDataType"; + + /// + /// Id of the saga that sent this message + /// + public const string OriginatingSagaId = "NServiceBus.OriginatingSagaId"; + + /// + /// Type of the saga that sent this message + /// + public const string OriginatingSagaType = "NServiceBus.OriginatingSagaType"; + + /// + /// The number of retries that has been performed for this message + /// + public const string Retries = "NServiceBus.Retries"; + + /// + /// The time processing of this message started + /// + public const string ProcessingStarted = "NServiceBus.ProcessingStarted"; + + /// + /// The time processing of this message ended + /// + public const string ProcessingEnded = "NServiceBus.ProcessingEnded"; + + /// + /// The time this message was sent from the client + /// + public const string TimeSent = "NServiceBus.TimeSent"; + + /// + /// Id of the message that caused this message to be sent + /// + public const string RelatedTo = "NServiceBus.RelatedTo"; + + /// + /// Header entry key indicating the types of messages contained. + /// + public const string EnclosedMessageTypes = "NServiceBus.EnclosedMessageTypes"; + + /// + /// Header entry key indicating format of the payload + /// + public const string ContentType = "NServiceBus.ContentType"; + + /// + /// Used for correlation id message. + /// + [ObsoleteEx(Message = "The IdForCorrelation header is replaced by Id", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + public const string IdForCorrelation = "CorrId"; + + /// + /// Header entry key for the given message type that is being subscribed to, when message intent is subscribe or unsubscribe. + /// + public const string SubscriptionMessageType = "SubscriptionMessageType"; + + /// + /// Header key for setting/getting the ID of the message as it was when it failed processing. + /// + [ObsoleteEx(Message = "The OriginalId headers is replaced by the Id since they are now equivalent", RemoveInVersion = "6.0", TreatAsErrorFromVersion = "5.0")] + public const string OriginalId = "NServiceBus.OriginalId"; + + /// + /// True if this message is a saga timeout + /// + public const string IsSagaTimeoutMessage = "NServiceBus.IsSagaTimeoutMessage"; + + /// + /// True if this is a deferred message + /// + public const string IsDeferredMessage = "NServiceBus.IsDeferredMessage"; + + /// + /// Name of the endpoint where the given message originated + /// + public const string OriginatingEndpoint = "NServiceBus.OriginatingEndpoint"; + + /// + /// Machine name of the endpoint where the given message originated + /// + public const string OriginatingMachine = "NServiceBus.OriginatingMachine"; + + /// + /// Name of the endpoint where the given message was processed(success or failure) + /// + public const string ProcessingEndpoint = "NServiceBus.ProcessingEndpoint"; + + /// + /// Machine name of the endpoint where the given message was processed(success or failure) + /// + public const string ProcessingMachine = "NServiceBus.ProcessingMachine"; + + /// + /// The original reply to address for successfully processed messages + /// + public const string OriginatingAddress = "NServiceBus.OriginatingAddress"; + + /// + /// The id of the message conversation that this message is part of + /// + public const string ConversationId = "NServiceBus.ConversationId"; + + /// + /// The intent of the current message + /// + public const string MessageIntent = "NServiceBus.MessageIntent"; + + /// + /// Get the header with the given key. Cannot be used to change its value. + /// + /// The message to retrieve a header from. + /// The header key. + /// The value assigned to the header. + public static string GetMessageHeader(object msg, string key) + { + return ExtensionMethods.GetHeaderAction(msg, key); + } + + /// + /// Sets the value of the header for the given key. + /// + /// The message to add a header to. + /// The header key. + /// The value to assign to the header. + public static void SetMessageHeader(object msg, string key, string value) + { + ExtensionMethods.SetHeaderAction(msg, key, value); + } + } +} diff --git a/src/core/NServiceBus/IAuthorizeSubscriptions.cs b/src/NServiceBus/IAuthorizeSubscriptions.cs similarity index 100% rename from src/core/NServiceBus/IAuthorizeSubscriptions.cs rename to src/NServiceBus/IAuthorizeSubscriptions.cs diff --git a/src/core/NServiceBus/IBus.cs b/src/NServiceBus/IBus.cs similarity index 80% rename from src/core/NServiceBus/IBus.cs rename to src/NServiceBus/IBus.cs index 35cd106cb15..00ecfe4c8dd 100644 --- a/src/core/NServiceBus/IBus.cs +++ b/src/NServiceBus/IBus.cs @@ -3,19 +3,19 @@ namespace NServiceBus { - /// - /// Defines a bus to be used with NServiceBus. - /// + /// + /// Defines a bus to be used with NServiceBus. + /// public interface IBus : IMessageCreator { - /// - /// Publishes the list of messages to subscribers. - /// If publishing multiple messages, they should all be of the same type - /// since subscribers are identified by the first message in the list. - /// - /// A list of messages. The first message's type - /// is used for looking up subscribers. - void Publish(params T[] messages); + /// + /// Publishes the list of messages to subscribers. + /// If publishing multiple messages, they should all be of the same type + /// since subscribers are identified by the first message in the list. + /// + /// A list of messages. The first message's type + /// is used for looking up subscribers. + void Publish(params T[] messages); /// /// Instantiates a message of type T and publishes it. @@ -24,11 +24,11 @@ public interface IBus : IMessageCreator /// An action which initializes properties of the message void Publish(Action messageConstructor); - /// - /// Subcribes to recieve published messages of the specified type. + /// + /// Subcribes to recieve published messages of the specified type. /// This method is only necessary if you turned off auto-subscribe. - /// - /// The type of message to subscribe to. + /// + /// The type of message to subscribe to. void Subscribe(Type messageType); /// @@ -38,13 +38,13 @@ public interface IBus : IMessageCreator /// The type of message to subscribe to. void Subscribe(); - /// - /// Subscribes to receive published messages of the specified type. - /// When messages arrive, the condition is evaluated to see if they - /// should be handled. - /// - /// The type of message to subscribe to. - /// The condition with which to evaluate messages. + /// + /// Subscribes to receive published messages of the specified type. + /// When messages arrive, the condition is evaluated to see if they + /// should be handled. + /// + /// The type of message to subscribe to. + /// The condition with which to evaluate messages. void Subscribe(Type messageType, Predicate condition); /// @@ -55,12 +55,12 @@ public interface IBus : IMessageCreator /// The type of message to subscribe to. /// The condition with which to evaluate messages. void Subscribe(Predicate condition); - - /// - /// Unsubscribes from receiving published messages of the specified type. - /// + + /// + /// Unsubscribes from receiving published messages of the specified type. + /// /// The type of message to subscribe to. - void Unsubscribe(Type messageType); + void Unsubscribe(Type messageType); /// /// Unsubscribes from receiving published messages of the specified type. @@ -82,13 +82,13 @@ public interface IBus : IMessageCreator ICallback SendLocal(Action messageConstructor); /// - /// Sends the list of provided messages. - /// - /// The list of messages to send. - /// - /// All the messages will be sent to the destination configured for the - /// first message in the list. - /// + /// Sends the list of provided messages. + /// + /// The list of messages to send. + /// + /// All the messages will be sent to the destination configured for the + /// first message in the list. + /// ICallback Send(params object[] messages); /// @@ -184,28 +184,26 @@ public interface IBus : IMessageCreator /// /// /// - ICallback SendToSites(IEnumerable siteKeys, params object[] messages); - - - /// - /// Defers the processing of the messages for the given delay. This feature is using the timeout manager so make sure that you enable timeouts - /// - /// - /// - /// - ICallback Defer(TimeSpan delay, params object[] messages); - - - /// - /// Defers the processing of the messages until the specified time. This feature is using the timeout manager so make sure that you enable timeouts - /// - /// - /// - /// + ICallback SendToSites(IEnumerable siteKeys, params object[] messages); + + /// + /// Defers the processing of the messages for the given delay. This feature is using the timeout manager so make sure that you enable timeouts + /// + /// + /// + /// + ICallback Defer(TimeSpan delay, params object[] messages); + + /// + /// Defers the processing of the messages until the specified time. This feature is using the timeout manager so make sure that you enable timeouts + /// + /// + /// + /// ICallback Defer(DateTime processAt, params object[] messages); /// - /// Sends all messages to the endpoint which sent the message currently being handled on this thread. + /// Sends all messages to the endpoint which sent the message currently being handled on this thread. /// /// The messages to send. void Reply(params object[] messages); @@ -223,12 +221,12 @@ public interface IBus : IMessageCreator /// /// /// - void Return(T errorEnum); + void Return(T errorEnum); - /// - /// Moves the message being handled to the back of the list of available - /// messages so it can be handled later. - /// + /// + /// Moves the message being handled to the back of the list of available + /// messages so it can be handled later. + /// void HandleCurrentMessageLater(); /// @@ -236,12 +234,12 @@ public interface IBus : IMessageCreator /// all of its transport-level properties and headers. /// /// - void ForwardCurrentMessageTo(string destination); + void ForwardCurrentMessageTo(string destination); - /// - /// Tells the bus to stop dispatching the current message to additional - /// handlers. - /// + /// + /// Tells the bus to stop dispatching the current message to additional + /// handlers. + /// void DoNotContinueDispatchingCurrentMessageToHandlers(); /// @@ -257,5 +255,10 @@ public interface IBus : IMessageCreator /// of the message currently being handled on this thread. /// IMessageContext CurrentMessageContext { get; } + + /// + /// Support for in-memory operations. + /// + IInMemoryOperations InMemory { get; } } } diff --git a/src/NServiceBus/ICallback.cs b/src/NServiceBus/ICallback.cs new file mode 100644 index 00000000000..9557271b580 --- /dev/null +++ b/src/NServiceBus/ICallback.cs @@ -0,0 +1,69 @@ +using System; +using System.Threading.Tasks; + +namespace NServiceBus +{ + /// + /// Objects of this interface are returned from calling IBus.Send. + /// The interface allows the caller to register for a callback when a response + /// is received to their original call to IBus.Send. + /// + public interface ICallback + { + /// + /// Registers a callback to be invoked when a response arrives to the message sent. + /// The return code is returned as an int + /// + Task Register(); + + /// + /// Registers a callback to be invoked when a response arrives to the message sent. + /// The return code is cast to the given enumerated type - T. + /// + /// An enumeration type or an integer. + Task Register(); + + /// + /// Registers a function to be invoked when a response arrives to the message sent. + /// Returns a Task that can be used with async/await operations. + /// + /// A function to call upon completion that returns a value of type T. + /// The type of the value to be returned from the function. + /// A Task that can be used with async/await operations. + Task Register(Func completion); + + /// + /// Registers an action to be invoked when a response arrives to the message sent. + /// Returns a Task that can be used with async/await operations. + /// + /// An action to call upon completion that does not return a value. + /// A Task that can be used with async/await operations. + Task Register(Action completion); + + /// + /// Registers a callback to be invoked when a response arrives to the message sent. + /// + /// The callback to invoke. + /// State that will be passed to the callback method. + /// An IAsyncResult useful for integration with ASP.NET async tasks. + IAsyncResult Register(AsyncCallback callback, object state); + + /// + /// Registers a callback to be invoked when a response arrives to the message sent. + /// The return code is cast to the given enumerated type - T. + /// + /// An enumeration type or an integer. + /// + void Register(Action callback); + + /// + /// Registers a callback to be invoked when a response arrives to the message sent. + /// The return code is cast to the given enumerated type - T. + /// Pass either a System.Web.UI.Page or a System.Web.Mvc.AsyncController as the synchronizer. + /// + /// + /// + /// + void Register(Action callback, object synchronizer); + } +} diff --git a/src/core/NServiceBus/ICommand.cs b/src/NServiceBus/ICommand.cs similarity index 100% rename from src/core/NServiceBus/ICommand.cs rename to src/NServiceBus/ICommand.cs diff --git a/src/core/NServiceBus/IEvent.cs b/src/NServiceBus/IEvent.cs similarity index 100% rename from src/core/NServiceBus/IEvent.cs rename to src/NServiceBus/IEvent.cs diff --git a/src/NServiceBus/IInMemoryOperations.cs b/src/NServiceBus/IInMemoryOperations.cs new file mode 100644 index 00000000000..f727a679a47 --- /dev/null +++ b/src/NServiceBus/IInMemoryOperations.cs @@ -0,0 +1,22 @@ +namespace NServiceBus +{ + /// + /// In memory operations + /// + public interface IInMemoryOperations + { + /// + /// Raises an in memory event + /// + /// The type of message, usually an interface + /// The message to raise + void Raise(T @event); + + /// + /// Instantiates a message of type T and raise it in memory + /// + /// The type of message, usually an interface + /// An action which initializes properties of the message + void Raise(System.Action messageContructor); + } +} \ No newline at end of file diff --git a/src/core/NServiceBus/IMessage.cs b/src/NServiceBus/IMessage.cs similarity index 97% rename from src/core/NServiceBus/IMessage.cs rename to src/NServiceBus/IMessage.cs index 3fc4bb0fd12..0f1e09d3cea 100644 --- a/src/core/NServiceBus/IMessage.cs +++ b/src/NServiceBus/IMessage.cs @@ -1,71 +1,71 @@ -using System; - -namespace NServiceBus -{ - /// - /// Marker interface to indicate that a class is a message suitable - /// for transmission and handling by an NServiceBus. - /// - public interface IMessage - { - } - - /// - /// Attribute to indicate that a message is recoverable - this is now the default. - /// - /// - /// This attribute should be applied to classes that implement - /// to indicate that they should be treated as a recoverable message. A recoverable - /// message is stored locally at every step along the route so that in the event of - /// a failure of a machine along the route a copy of the message will be recovered and - /// delivery will continue when the machine is brought back online. - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)] - public class RecoverableAttribute : Attribute - { - } - - /// - /// Attribute to indicate that the message should not be written to disk. - /// This will make the message vulnerable to server crashes or restarts. - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)] - public class ExpressAttribute : Attribute - { - } - - /// - /// Attribute to indicate that a message has a period of time - /// in which to be received. - /// - [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)] - public class TimeToBeReceivedAttribute : Attribute - { - /// - /// Sets the time to be received to be unlimited. - /// - public TimeToBeReceivedAttribute() { } - - /// - /// Sets the time to be received. - /// - /// A timespan that can be interpreted by . - public TimeToBeReceivedAttribute(string timeSpan) - { - timeToBeReceived = TimeSpan.Parse(timeSpan); - } - - private readonly TimeSpan timeToBeReceived = TimeSpan.MaxValue; - - /// - /// Gets the maximum time in which a message must be received. - /// - /// - /// If the interval specified by the TimeToBeReceived property expires before the message - /// is received by the destination of the message the message will automatically be cancelled. - /// - public TimeSpan TimeToBeReceived - { - get { return timeToBeReceived; } - } - } -} +using System; + +namespace NServiceBus +{ + /// + /// Marker interface to indicate that a class is a message suitable + /// for transmission and handling by an NServiceBus. + /// + public interface IMessage + { + } + + /// + /// Attribute to indicate that a message is recoverable - this is now the default. + /// + /// + /// This attribute should be applied to classes that implement + /// to indicate that they should be treated as a recoverable message. A recoverable + /// message is stored locally at every step along the route so that in the event of + /// a failure of a machine along the route a copy of the message will be recovered and + /// delivery will continue when the machine is brought back online. + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)] + public class RecoverableAttribute : Attribute + { + } + + /// + /// Attribute to indicate that the message should not be written to disk. + /// This will make the message vulnerable to server crashes or restarts. + /// + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)] + public class ExpressAttribute : Attribute + { + } + + /// + /// Attribute to indicate that a message has a period of time + /// in which to be received. + /// + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface)] + public class TimeToBeReceivedAttribute : Attribute + { + /// + /// Sets the time to be received to be unlimited. + /// + public TimeToBeReceivedAttribute() { } + + /// + /// Sets the time to be received. + /// + /// A timespan that can be interpreted by . + public TimeToBeReceivedAttribute(string timeSpan) + { + timeToBeReceived = TimeSpan.Parse(timeSpan); + } + + private readonly TimeSpan timeToBeReceived = TimeSpan.MaxValue; + + /// + /// Gets the maximum time in which a message must be received. + /// + /// + /// If the interval specified by the TimeToBeReceived property expires before the message + /// is received by the destination of the message the message will automatically be cancelled. + /// + public TimeSpan TimeToBeReceived + { + get { return timeToBeReceived; } + } + } +} diff --git a/src/core/NServiceBus/IMessageContext.cs b/src/NServiceBus/IMessageContext.cs similarity index 75% rename from src/core/NServiceBus/IMessageContext.cs rename to src/NServiceBus/IMessageContext.cs index 1f49fba65dd..ad215ccbdfa 100644 --- a/src/core/NServiceBus/IMessageContext.cs +++ b/src/NServiceBus/IMessageContext.cs @@ -1,8 +1,9 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; namespace NServiceBus { + using System; + /// /// Contains out-of-band information on the logical message. /// @@ -13,25 +14,20 @@ public interface IMessageContext /// string Id { get; } - /// - /// Returns the address of the endpoint that sent this message. - /// - [Obsolete("Use ReplyToAddress instead.", true)] - string ReturnAddress { get; } - /// /// The address of the endpoint that sent the current message being handled. /// Address ReplyToAddress { get; } /// - /// Returns the time at which the message was sent. + /// Gets the list of key/value pairs found in the header of the message. /// - DateTime TimeSent { get; } + IDictionary Headers { get; } /// - /// Gets the list of key/value pairs found in the header of the message. + /// Returns the time at which the message was sent. /// - IDictionary Headers { get; } + [ObsoleteEx(Replacement = @"Headers[Headers.TimeSent]", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + DateTime TimeSent { get; } } } diff --git a/src/core/NServiceBus/IMessageCreator.cs b/src/NServiceBus/IMessageCreator.cs similarity index 100% rename from src/core/NServiceBus/IMessageCreator.cs rename to src/NServiceBus/IMessageCreator.cs diff --git a/src/NServiceBus/IMessageHandler.cs b/src/NServiceBus/IMessageHandler.cs new file mode 100644 index 00000000000..478200bd443 --- /dev/null +++ b/src/NServiceBus/IMessageHandler.cs @@ -0,0 +1,25 @@ +namespace NServiceBus +{ + /// + /// Defines a message handler. + /// + /// The type of message to be handled. + public interface IHandleMessages + { + /// + /// Handles a message. + /// + /// The message to handle. + /// + /// This method will be called when a message arrives on the bus and should contain + /// the custom logic to execute when the message is received. + void Handle(T message); + } + + /// + /// Implement this class to be called when messages of the given type arrive at your endpoint. + /// + /// + [ObsoleteEx(Replacement = "IHandleMessages", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public interface IMessageHandler : IHandleMessages { } +} diff --git a/src/core/NServiceBus/IMessageModule.cs b/src/NServiceBus/IMessageModule.cs similarity index 84% rename from src/core/NServiceBus/IMessageModule.cs rename to src/NServiceBus/IMessageModule.cs index 63ef9ccce48..68fa4d42101 100644 --- a/src/core/NServiceBus/IMessageModule.cs +++ b/src/NServiceBus/IMessageModule.cs @@ -3,6 +3,7 @@ namespace NServiceBus /// /// Implementers will be called before and after all message handlers. /// + [ObsoleteEx(Replacement = "NServiceBus.UnitOfWork.IManageUnitsOfWork", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] public interface IMessageModule { /// diff --git a/src/NServiceBus/INeedInitialization.cs b/src/NServiceBus/INeedInitialization.cs new file mode 100644 index 00000000000..96b7becdc3c --- /dev/null +++ b/src/NServiceBus/INeedInitialization.cs @@ -0,0 +1,14 @@ +namespace NServiceBus +{ + /// + /// Implementers will be called after NServiceBus.Configure.With completes and a container + /// has been set. + /// + public interface INeedInitialization + { + /// + /// Implementers will include custom initialization code here. + /// + void Init(); + } +} diff --git a/src/core/NServiceBus/ISpecifyMessageHandlerOrdering.cs b/src/NServiceBus/ISpecifyMessageHandlerOrdering.cs similarity index 94% rename from src/core/NServiceBus/ISpecifyMessageHandlerOrdering.cs rename to src/NServiceBus/ISpecifyMessageHandlerOrdering.cs index ce074bfbcb8..f0839367aa4 100644 --- a/src/core/NServiceBus/ISpecifyMessageHandlerOrdering.cs +++ b/src/NServiceBus/ISpecifyMessageHandlerOrdering.cs @@ -24,7 +24,7 @@ public class Order /// /// Gets the types whose order has been specified. /// - public IEnumerable Types { get; private set; } + public IEnumerable Types { get; set; } /// @@ -40,7 +40,7 @@ public void SpecifyFirst() /// Obselete - use SpecifyFirst instead. /// /// - [Obsolete] + [ObsoleteEx(Replacement = "SpecifyFirst", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] public void Specify() { SpecifyFirst(); diff --git a/src/NServiceBus/IStartableBus.cs b/src/NServiceBus/IStartableBus.cs new file mode 100644 index 00000000000..5d0372a3eda --- /dev/null +++ b/src/NServiceBus/IStartableBus.cs @@ -0,0 +1,33 @@ +namespace NServiceBus +{ + using System; + + /// + /// The interface used for starting and stopping an IBus. + /// + public interface IStartableBus : IBus, IDisposable + { + /// + /// Performs the given startup action, starts the bus, and returns a reference to it. + /// + /// Action to be performed before the bus is started. + /// A reference to the bus. + IBus Start(Action startupAction); + + /// + /// Starts the bus and returns a reference to it. + /// + /// A reference to the bus. + IBus Start(); + + /// + /// Performs the shutdown of the current . + /// + void Shutdown(); + + /// + /// Event raised when the bus is started. + /// + event EventHandler Started; + } +} \ No newline at end of file diff --git a/src/NServiceBus/IWantToRunWhenBusStartsAndStops.cs b/src/NServiceBus/IWantToRunWhenBusStartsAndStops.cs new file mode 100644 index 00000000000..625668124c7 --- /dev/null +++ b/src/NServiceBus/IWantToRunWhenBusStartsAndStops.cs @@ -0,0 +1,19 @@ +namespace NServiceBus +{ + /// + /// Implementers will be invoked when the endpoint starts up. + /// Dependency injection is provided for these types. + /// + public interface IWantToRunWhenBusStartsAndStops + { + /// + /// Method called at startup. + /// + void Start(); + + /// + /// Method called on shutdown. + /// + void Stop(); + } +} diff --git a/src/NServiceBus/IdGeneration/CombGuid.cs b/src/NServiceBus/IdGeneration/CombGuid.cs new file mode 100644 index 00000000000..c6ff6b18466 --- /dev/null +++ b/src/NServiceBus/IdGeneration/CombGuid.cs @@ -0,0 +1,54 @@ +namespace NServiceBus.IdGeneration +{ + using System; + + /// + /// Generates values + /// using a strategy suggested Jimmy Nilsson's + /// article + /// on informit.com. + /// + /// + ///

    + /// The comb algorithm is designed to make the use of GUIDs as Primary Keys, Foreign Keys, + /// and Indexes nearly as efficient as ints. + ///

    + ///

    + /// This code was modifed based on Donald Mull's contributor to the + /// NHibernate source. + ///

    + ///
    + public static class CombGuid + { + /// + /// Generate a new using the comb algorithm. + /// + public static Guid Generate() + { + byte[] guidArray = Guid.NewGuid().ToByteArray(); + + DateTime baseDate = new DateTime(1900, 1, 1); + DateTime now = DateTime.Now; + + // Get the days and milliseconds which will be used to build the byte string + TimeSpan days = new TimeSpan(now.Ticks - baseDate.Ticks); + TimeSpan msecs = now.TimeOfDay; + + // Convert to a byte array + // Note that SQL Server is accurate to 1/300th of a millisecond so we divide by 3.333333 + byte[] daysArray = BitConverter.GetBytes(days.Days); + byte[] msecsArray = BitConverter.GetBytes((long)(msecs.TotalMilliseconds / 3.333333)); + + // Reverse the bytes to match SQL Servers ordering + Array.Reverse(daysArray); + Array.Reverse(msecsArray); + + // Copy the bytes into the guid + Array.Copy(daysArray, daysArray.Length - 2, guidArray, guidArray.Length - 6, 2); + Array.Copy(msecsArray, msecsArray.Length - 4, guidArray, guidArray.Length - 4, 4); + + return new Guid(guidArray); + } + } +} + diff --git a/src/NServiceBus/MessageConventionException.cs b/src/NServiceBus/MessageConventionException.cs new file mode 100644 index 00000000000..486d571dfc9 --- /dev/null +++ b/src/NServiceBus/MessageConventionException.cs @@ -0,0 +1,19 @@ +using System; + +namespace NServiceBus +{ + /// + /// + /// + public class MessageConventionException : Exception + { + /// + /// + /// + /// + /// + public MessageConventionException(string message, Exception innerException) : base(message, innerException) + { + } + } +} \ No newline at end of file diff --git a/src/core/NServiceBus/MessageConventionExtensions.cs b/src/NServiceBus/MessageConventionExtensions.cs similarity index 80% rename from src/core/NServiceBus/MessageConventionExtensions.cs rename to src/NServiceBus/MessageConventionExtensions.cs index 42f320ba48c..248e3244453 100644 --- a/src/core/NServiceBus/MessageConventionExtensions.cs +++ b/src/NServiceBus/MessageConventionExtensions.cs @@ -1,259 +1,259 @@ -namespace NServiceBus -{ - using System; - using System.Collections.Concurrent; - using System.Collections.Generic; - using System.Linq; - using System.Reflection; - using log4net; - - /// - /// Extension methods for message related conventions - /// - public static class MessageConventionExtensions - { - static readonly ILog Logger = LogManager.GetLogger("NServiceBus"); - /// - /// Returns true if the given object is a message. - /// - /// - /// - public static bool IsMessage(this object o) - { - return o.GetType().IsMessageType(); - } - - /// - /// Returns true if the given type is a message type. - /// - /// - /// - public static bool IsMessageType(this Type t) - { - try - { - return MessagesConventionCache.ApplyConvention(t, - type => - IsMessageTypeAction(type) || IsCommandTypeAction(type) || - IsEventTypeAction(type) || (IsInSystemConventionList(type))); - } - catch (Exception ex) - { - Logger.Error("Failed to evaluate Message convention: " + ex); - throw; - } - } - - private static bool IsInSystemConventionList(this Type t) - { - return IsSystemMessageActions.Any(isSystemMessageAction => isSystemMessageAction(t)); - } - - /// - /// Add system message convention - /// - /// Function to define system message convention - public static void AddSystemMessagesConventions(Func definesMessageType) - { - if(!IsSystemMessageActions.Contains(definesMessageType)) - IsSystemMessageActions.Add(definesMessageType); - } - - /// - /// Returns true if the given object is a command. - /// - /// - /// - public static bool IsCommand(this object o) - { - return o.GetType().IsCommandType(); - } - - /// - /// Returns true if the given type is a command type. - /// - /// - /// - public static bool IsCommandType(this Type t) - { - try - { - return CommandsConventionCache.ApplyConvention(t, type => IsCommandTypeAction(type)); - } - catch (Exception ex) - { - Logger.Error("Failed to evaluate Command convention: " + ex); - throw; - } - } - - /// - /// Returns true if the given message should not be written to disk when sent. - /// - /// - /// - public static bool IsExpressMessage(object o) - { - return IsExpressMessageType(o.GetType()); - } - - /// - /// Returns true if the given type should not be written to disk when sent. - /// - /// - /// - public static bool IsExpressMessageType(Type t) - { - try - { - return ExpressConventionCache.ApplyConvention(t, type => IsExpressMessageAction(type)); - } - catch (Exception ex) - { - Logger.Error("Failed to evaluate Express convention: " + ex); - throw; - } - } - - /// - /// Returns true if the given property should be encrypted - /// - /// - /// - public static bool IsEncryptedProperty(this PropertyInfo property) - { - try - { - //the message mutator will cache the whole message so we don't need to cache here - return IsEncryptedPropertyAction(property); - - } - catch (Exception ex) - { - Logger.Error("Failed to evaluate Encrypted Property convention: " + ex); - throw; - } - } - - /// - /// Returns true if the given property should be send via the DataBus - /// - /// - /// - public static bool IsDataBusProperty(this PropertyInfo property) - { - try - { - return IsDataBusPropertyAction(property); - } - catch (Exception ex) - { - Logger.Error("Failed to evaluate DataBus Property convention: " + ex); - throw; - } - } - - /// - /// Returns true if the given object is a event. - /// - /// - /// - public static bool IsEvent(this object o) - { - return o.GetType().IsEventType(); - } - - /// - /// Returns true if the given type is a event type. - /// - /// - /// - public static bool IsEventType(this Type t) - { - try - { - return EventsConventionCache.ApplyConvention(t, type => IsEventTypeAction(type)); - } - catch (Exception ex) - { - Logger.Error("Failed to evaluate Event convention: " + ex); - throw; - } - } - - /// - /// The function used to determine whether a type is a message type. - /// - public static Func IsMessageTypeAction = t => typeof(IMessage).IsAssignableFrom(t) && - typeof(IMessage) != t && - typeof(IEvent) != t && - typeof(ICommand) != t; - - /// - /// The function used to determine whether a type is a command type. - /// - public static Func IsCommandTypeAction = t => typeof(ICommand).IsAssignableFrom(t) && typeof(ICommand) != t; - - /// - /// The function used to determine whether a type is a event type. - /// - public static Func IsEventTypeAction = t => typeof(IEvent).IsAssignableFrom(t) && typeof(IEvent) != t; - - /// - /// The function used to determine whether a property should be encrypted - /// - public static Func IsEncryptedPropertyAction = property => typeof(WireEncryptedString).IsAssignableFrom(property.PropertyType); - - /// - /// The function used to determine whether a property should be treated as a databus property. - /// - public static Func IsDataBusPropertyAction = property => typeof(IDataBusProperty).IsAssignableFrom(property.PropertyType) && typeof(IDataBusProperty) != property.PropertyType; - - /// - /// The function to evaluate wheather the message has a time to be received or not (TimeSpan.MaxValue). - /// - public static Func TimeToBeReceivedAction = t => - { - var attributes = t.GetCustomAttributes(typeof (TimeToBeReceivedAttribute), true) - .Select(s => s as TimeToBeReceivedAttribute) - .ToList(); - - return attributes.Count > 0 ? attributes.Last().TimeToBeReceived : TimeSpan.MaxValue; - }; - - /// - /// The function used to determine if a type is an express message (the message should not be written to disk). - /// - public static Func IsExpressMessageAction = t => t.GetCustomAttributes(typeof(ExpressAttribute), true) - .Any(); - - /// - /// Contains list of System messages' conventions - /// - public static List> IsSystemMessageActions = new List>(); - - static readonly ConventionCache MessagesConventionCache = new ConventionCache(); - static readonly ConventionCache CommandsConventionCache = new ConventionCache(); - static readonly ConventionCache EventsConventionCache = new ConventionCache(); - static readonly ConventionCache ExpressConventionCache = new ConventionCache(); - } - - internal class ConventionCache - { - private readonly IDictionary cache = new ConcurrentDictionary(); - - public bool ApplyConvention(T type, Func action) - { - bool result; - - if (cache.TryGetValue(type, out result)) - return result; - - result = action(type); - - cache[type] = result; - - return result; - } - } -} +namespace NServiceBus +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + + /// + /// Extension methods for message related conventions + /// + public static class MessageConventionExtensions + { + /// + /// Returns true if the given object is a message. + /// + /// + /// + public static bool IsMessage(object o) + { + return IsMessageType(o.GetType()); + } + + /// + /// Returns true if the given type is a message type. + /// + /// + /// + public static bool IsMessageType(Type t) + { + try + { + return MessagesConventionCache.ApplyConvention(t, + type => IsMessageTypeAction(type) || + IsCommandTypeAction(type) || + IsEventTypeAction(type) || + IsInSystemConventionList(type)); + } + catch (Exception ex) + { + throw new MessageConventionException("Failed to evaluate Message convention. See inner exception for details.", ex); + } + } + + /// + /// Returns true is message is a system message type. + /// + /// + /// + public static bool IsInSystemConventionList(Type t) + { + return IsSystemMessageActions.Any(isSystemMessageAction => isSystemMessageAction(t)); + } + + /// + /// Add system message convention + /// + /// Function to define system message convention + public static void AddSystemMessagesConventions(Func definesMessageType) + { + if (!IsSystemMessageActions.Contains(definesMessageType)) + { + IsSystemMessageActions.Add(definesMessageType); + } + } + + /// + /// Returns true if the given object is a command. + /// + /// + /// + public static bool IsCommand(object o) + { + return IsCommandType(o.GetType()); + } + + /// + /// Returns true if the given type is a command type. + /// + /// + /// + public static bool IsCommandType(Type t) + { + try + { + return CommandsConventionCache.ApplyConvention(t, type => IsCommandTypeAction(type)); + } + catch (Exception ex) + { + throw new MessageConventionException("Failed to evaluate Command convention. See inner exception for details.", ex); + } + } + + /// + /// Returns true if the given message should not be written to disk when sent. + /// + /// + /// + public static bool IsExpressMessage(object o) + { + return IsExpressMessageType(o.GetType()); + } + + /// + /// Returns true if the given type should not be written to disk when sent. + /// + /// + /// + public static bool IsExpressMessageType(Type t) + { + try + { + return ExpressConventionCache.ApplyConvention(t, type => IsExpressMessageAction(type)); + } + catch (Exception ex) + { + throw new MessageConventionException("Failed to evaluate Express convention. See inner exception for details.", ex); + } + } + + /// + /// Returns true if the given property should be encrypted + /// + /// + /// + public static bool IsEncryptedProperty(PropertyInfo property) + { + try + { + //the message mutator will cache the whole message so we don't need to cache here + return IsEncryptedPropertyAction(property); + + } + catch (Exception ex) + { + throw new MessageConventionException("Failed to evaluate Encrypted Property convention. See inner exception for details.", ex); + } + } + + /// + /// Returns true if the given property should be send via the DataBus + /// + /// + /// + public static bool IsDataBusProperty(PropertyInfo property) + { + try + { + return IsDataBusPropertyAction(property); + } + catch (Exception ex) + { + throw new MessageConventionException("Failed to evaluate DataBus Property convention. See inner exception for details.", ex); + } + } + + /// + /// Returns true if the given object is a event. + /// + /// + /// + public static bool IsEvent(object o) + { + return IsEventType(o.GetType()); + } + + /// + /// Returns true if the given type is a event type. + /// + /// + /// + public static bool IsEventType(Type t) + { + try + { + return EventsConventionCache.ApplyConvention(t, type => IsEventTypeAction(type)); + } + catch (Exception ex) + { + throw new MessageConventionException("Failed to evaluate Event convention. See inner exception for details.", ex); + } + } + + /// + /// The function used to determine whether a type is a message type. + /// + public static Func IsMessageTypeAction = t => typeof(IMessage).IsAssignableFrom(t) && + typeof(IMessage) != t && + typeof(IEvent) != t && + typeof(ICommand) != t; + + /// + /// The function used to determine whether a type is a command type. + /// + public static Func IsCommandTypeAction = t => typeof(ICommand).IsAssignableFrom(t) && typeof(ICommand) != t; + + /// + /// The function used to determine whether a type is a event type. + /// + public static Func IsEventTypeAction = t => typeof(IEvent).IsAssignableFrom(t) && typeof(IEvent) != t; + + /// + /// The function used to determine whether a property should be encrypted + /// + public static Func IsEncryptedPropertyAction = property => typeof(WireEncryptedString).IsAssignableFrom(property.PropertyType); + + /// + /// The function used to determine whether a property should be treated as a databus property. + /// + public static Func IsDataBusPropertyAction = property => typeof(IDataBusProperty).IsAssignableFrom(property.PropertyType) && typeof(IDataBusProperty) != property.PropertyType; + + /// + /// The function to evaluate wheather the message has a time to be received or not (TimeSpan.MaxValue). + /// + public static Func TimeToBeReceivedAction = t => + { + var attributes = t.GetCustomAttributes(typeof (TimeToBeReceivedAttribute), true) + .Select(s => s as TimeToBeReceivedAttribute) + .ToList(); + + return attributes.Count > 0 ? attributes.Last().TimeToBeReceived : TimeSpan.MaxValue; + }; + + /// + /// The function used to determine if a type is an express message (the message should not be written to disk). + /// + public static Func IsExpressMessageAction = t => t.GetCustomAttributes(typeof(ExpressAttribute), true) + .Any(); + + /// + /// Contains list of System messages' conventions + /// + public static List> IsSystemMessageActions = new List>(); + + static readonly ConventionCache MessagesConventionCache = new ConventionCache(); + static readonly ConventionCache CommandsConventionCache = new ConventionCache(); + static readonly ConventionCache EventsConventionCache = new ConventionCache(); + static readonly ConventionCache ExpressConventionCache = new ConventionCache(); + } + + internal class ConventionCache + { + private readonly IDictionary cache = new ConcurrentDictionary(); + + public bool ApplyConvention(T type, Func action) + { + bool result; + + if (cache.TryGetValue(type, out result)) + return result; + + result = action(type); + + cache[type] = result; + + return result; + } + } +} diff --git a/src/unicastTransport/NServiceBus.Unicast.Transport/MessageIntentEnum.cs b/src/NServiceBus/MessageIntentEnum.cs similarity index 94% rename from src/unicastTransport/NServiceBus.Unicast.Transport/MessageIntentEnum.cs rename to src/NServiceBus/MessageIntentEnum.cs index 2400732b125..d11d4123c0c 100644 --- a/src/unicastTransport/NServiceBus.Unicast.Transport/MessageIntentEnum.cs +++ b/src/NServiceBus/MessageIntentEnum.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Unicast.Transport +namespace NServiceBus { /// /// Enumeration defining different kinds of message intent like Send and Publish. diff --git a/src/messagemutator/NServiceBus.MessageMutator/IMessageMutator.cs b/src/NServiceBus/MessageMutator/IMessageMutator.cs similarity index 100% rename from src/messagemutator/NServiceBus.MessageMutator/IMessageMutator.cs rename to src/NServiceBus/MessageMutator/IMessageMutator.cs diff --git a/src/NServiceBus/NServiceBus.csproj b/src/NServiceBus/NServiceBus.csproj new file mode 100644 index 00000000000..00bb080987b --- /dev/null +++ b/src/NServiceBus/NServiceBus.csproj @@ -0,0 +1,148 @@ + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {73867D40-8CBB-48E9-BFFA-12BBDD48A341} + Library + Properties + NServiceBus + NServiceBus + v4.0 + true + ..\NServiceBus.snk + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + ..\..\ + true + ..\..\packages\Fody.1.13.8.0 + + + true + full + false + ..\..\binaries\ + DEBUG;TRACE + prompt + 4 + ..\..\binaries\NServiceBus.XML + AllRules.ruleset + true + + + pdbonly + true + ..\..\binaries\ + TRACE + prompt + 4 + ..\..\binaries\NServiceBus.XML + AllRules.ruleset + + + + + False + ..\..\packages\Obsolete.Fody.1.6.2.0\Lib\NET35\Obsolete.dll + False + + + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + true + + + False + Windows Installer 3.1 + true + + + + + copy /Y "$(ProjectDir)$(OutDir)*.*" "$(ProjectDir)..\..\build\" + + + + \ No newline at end of file diff --git a/src/NServiceBus/NServiceBusVersion.cs b/src/NServiceBus/NServiceBusVersion.cs new file mode 100644 index 00000000000..c78dc92db5d --- /dev/null +++ b/src/NServiceBus/NServiceBusVersion.cs @@ -0,0 +1,13 @@ +namespace NServiceBus +{ + /// + /// The semver version of NServiceBus + /// + public static class NServiceBusVersion + { + /// + /// The semver version of NServiceBus + /// + public const string Version = "4.0.0"; + } +} diff --git a/src/NServiceBus/Properties/AssemblyInfo.cs b/src/NServiceBus/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..4013b7091a1 --- /dev/null +++ b/src/NServiceBus/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("NServiceBus Core")] +[assembly: AssemblyDescription("Enterprise application framework for publish/subscribe and long-running business processes.")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyProduct("NServiceBus")] +[assembly: AssemblyCompany("NServiceBus")] +[assembly: AssemblyConfiguration("release")] +[assembly: AssemblyInformationalVersion("4.0.0-alpha0")] +[assembly: ComVisible(false)] +[assembly: CLSCompliantAttribute(true)] + diff --git a/src/NServiceBus/Saga/ContainSagaData.cs b/src/NServiceBus/Saga/ContainSagaData.cs new file mode 100644 index 00000000000..ce3f58bbc5d --- /dev/null +++ b/src/NServiceBus/Saga/ContainSagaData.cs @@ -0,0 +1,25 @@ +namespace NServiceBus.Saga +{ + using System; + + /// + /// Base class to make defining saga data easier + /// + public abstract class ContainSagaData : IContainSagaData + { + /// + /// The saga id + /// + public virtual Guid Id { get; set; } + + /// + /// The address io the endpoint that started the saga + /// + public virtual string Originator { get; set; } + + /// + /// The id of the message that started the saga + /// + public virtual string OriginalMessageId { get; set; } + } +} \ No newline at end of file diff --git a/src/core/NServiceBus.Saga/HasCompleted.cs b/src/NServiceBus/Saga/HasCompleted.cs similarity index 100% rename from src/core/NServiceBus.Saga/HasCompleted.cs rename to src/NServiceBus/Saga/HasCompleted.cs diff --git a/src/core/NServiceBus.Saga/IConfigurable.cs b/src/NServiceBus/Saga/IConfigurable.cs similarity index 92% rename from src/core/NServiceBus.Saga/IConfigurable.cs rename to src/NServiceBus/Saga/IConfigurable.cs index 0c784558483..d4f79e49e03 100644 --- a/src/core/NServiceBus.Saga/IConfigurable.cs +++ b/src/NServiceBus/Saga/IConfigurable.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Saga +namespace NServiceBus.Saga { /// /// Implementers of ISaga should implement this interface as well if they want diff --git a/src/core/NServiceBus.Saga/IConfigureHowToFindSagaWithMessage.cs b/src/NServiceBus/Saga/IConfigureHowToFindSagaWithMessage.cs similarity index 94% rename from src/core/NServiceBus.Saga/IConfigureHowToFindSagaWithMessage.cs rename to src/NServiceBus/Saga/IConfigureHowToFindSagaWithMessage.cs index 0df1a10387e..d9517603301 100644 --- a/src/core/NServiceBus.Saga/IConfigureHowToFindSagaWithMessage.cs +++ b/src/NServiceBus/Saga/IConfigureHowToFindSagaWithMessage.cs @@ -1,8 +1,8 @@ -using System; -using System.Linq.Expressions; - namespace NServiceBus.Saga { + using System; + using System.Linq.Expressions; + /// /// Implementation provided by the infrastructure - don't implement this /// or register implementations of it in the container unless you intend @@ -19,6 +19,6 @@ public interface IConfigureHowToFindSagaWithMessage /// /// /// - void ConfigureMapping(Expression> sagaEntityProperty, Expression> messageProperty) where TSagaEntity : ISagaEntity; + void ConfigureMapping(Expression> sagaEntityProperty, Expression> messageProperty) where TSagaEntity : IContainSagaData; } } \ No newline at end of file diff --git a/src/NServiceBus/Saga/IContainSagaData.cs b/src/NServiceBus/Saga/IContainSagaData.cs new file mode 100644 index 00000000000..e0678e7e00b --- /dev/null +++ b/src/NServiceBus/Saga/IContainSagaData.cs @@ -0,0 +1,33 @@ +namespace NServiceBus.Saga +{ + using System; + + /// + /// The saga data that will be persisted. + /// + public interface IContainSagaData + { + /// + /// Gets/sets the Id of the process. Do NOT generate this value in your code. + /// The value of the Id will be generated automatically to provide the + /// best performance for saving in a database. + /// + /// + /// The reason Guid is used for process Id is that messages containing this Id need + /// to be sent by the process even before it is persisted. + /// + Guid Id { get; set; } + + /// + /// Contains the return address of the endpoint that caused the process to run. + /// + string Originator { get; set; } + + /// + /// Contains the Id of the message which caused the saga to start. + /// This is needed so that when we reply to the Originator, any + /// registered callbacks will be fired correctly. + /// + string OriginalMessageId { get; set; } + } +} \ No newline at end of file diff --git a/src/core/NServiceBus.Saga/IFindSagas.cs b/src/NServiceBus/Saga/IFindSagas.cs similarity index 92% rename from src/core/NServiceBus.Saga/IFindSagas.cs rename to src/NServiceBus/Saga/IFindSagas.cs index fd6d9f8808d..a5112cd3869 100644 --- a/src/core/NServiceBus.Saga/IFindSagas.cs +++ b/src/NServiceBus/Saga/IFindSagas.cs @@ -10,7 +10,7 @@ public interface IFinder { } /// Interface indicating that implementers can find sagas of the given type. /// /// - public class IFindSagas where T : ISagaEntity + public abstract class IFindSagas where T : IContainSagaData { /// /// Narrower interface indicating that implementers can find sagas diff --git a/src/core/NServiceBus.Saga/IHandleReplyingToNullOriginator.cs b/src/NServiceBus/Saga/IHandleReplyingToNullOriginator.cs similarity index 100% rename from src/core/NServiceBus.Saga/IHandleReplyingToNullOriginator.cs rename to src/NServiceBus/Saga/IHandleReplyingToNullOriginator.cs diff --git a/src/core/NServiceBus.Saga/IHandleSagaNotFound.cs b/src/NServiceBus/Saga/IHandleSagaNotFound.cs similarity index 94% rename from src/core/NServiceBus.Saga/IHandleSagaNotFound.cs rename to src/NServiceBus/Saga/IHandleSagaNotFound.cs index fe0ca777f9d..63588bd142a 100644 --- a/src/core/NServiceBus.Saga/IHandleSagaNotFound.cs +++ b/src/NServiceBus/Saga/IHandleSagaNotFound.cs @@ -1,4 +1,4 @@ -namespace NServiceBus.Saga +namespace NServiceBus.Saga { /// /// Implementors will be invoked when a message arrives that should have been processed diff --git a/src/core/NServiceBus.Saga/IHandleTimeouts.cs b/src/NServiceBus/Saga/IHandleTimeouts.cs similarity index 96% rename from src/core/NServiceBus.Saga/IHandleTimeouts.cs rename to src/NServiceBus/Saga/IHandleTimeouts.cs index 940fd92ad4b..9003add66d2 100644 --- a/src/core/NServiceBus.Saga/IHandleTimeouts.cs +++ b/src/NServiceBus/Saga/IHandleTimeouts.cs @@ -1,15 +1,15 @@ -namespace NServiceBus.Saga -{ - /// - /// Tells the infrastructure that the user wants to handle a timeout of T - /// - /// - public interface IHandleTimeouts - { - /// - /// Called when the timout has expired - /// - /// - void Timeout(T state); - } +namespace NServiceBus.Saga +{ + /// + /// Tells the infrastructure that the user wants to handle a timeout of T + /// + /// + public interface IHandleTimeouts + { + /// + /// Called when the timout has expired + /// + /// + void Timeout(T state); + } } \ No newline at end of file diff --git a/src/core/NServiceBus.Saga/ISaga.cs b/src/NServiceBus/Saga/ISaga.cs similarity index 88% rename from src/core/NServiceBus.Saga/ISaga.cs rename to src/NServiceBus/Saga/ISaga.cs index 1cf5b70ac73..10e0bfcc110 100644 --- a/src/core/NServiceBus.Saga/ISaga.cs +++ b/src/NServiceBus/Saga/ISaga.cs @@ -10,7 +10,7 @@ public interface ISaga : ITimeoutable, HasCompleted /// /// The saga's data. /// - ISagaEntity Entity { get; set; } + IContainSagaData Entity { get; set; } /// /// Used for retrieving the endpoint which caused the saga to be initiated. @@ -22,7 +22,7 @@ public interface ISaga : ITimeoutable, HasCompleted /// A more strongly typed version of ISaga meant to be implemented by application developers /// /// - public interface ISaga : ISaga where T : ISagaEntity + public interface ISaga : ISaga where T : IContainSagaData { /// /// The saga's data. diff --git a/src/NServiceBus/Saga/ISagaEntity.cs b/src/NServiceBus/Saga/ISagaEntity.cs new file mode 100644 index 00000000000..c6a44a55079 --- /dev/null +++ b/src/NServiceBus/Saga/ISagaEntity.cs @@ -0,0 +1,11 @@ +namespace NServiceBus.Saga +{ + /// + /// Defines the basic data used by long-running processes. + /// + [ObsoleteEx(Replacement = "IContainSagaData", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public interface ISagaEntity:IContainSagaData + { + + } +} diff --git a/src/NServiceBus/Saga/ISagaMessage.cs b/src/NServiceBus/Saga/ISagaMessage.cs new file mode 100644 index 00000000000..6dddd184288 --- /dev/null +++ b/src/NServiceBus/Saga/ISagaMessage.cs @@ -0,0 +1,17 @@ +namespace NServiceBus.Saga +{ + using System; + + /// + /// An interface used to mark messages as requiring the attention of the + /// saga infrastructure. + /// + [ObsoleteEx(Message = "Auto correlation for sagas are now handled by NServiceBus without the need to implement the ISagaMessage interface. You can safely remove this interface and replace it with just IMessage.", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public interface ISagaMessage : IMessage + { + /// + /// Gets/sets the Id of the saga the message is related to. + /// + Guid SagaId { get; set; } + } +} diff --git a/src/core/NServiceBus.Saga/ISagaPersister.cs b/src/NServiceBus/Saga/ISagaPersister.cs similarity index 82% rename from src/core/NServiceBus.Saga/ISagaPersister.cs rename to src/NServiceBus/Saga/ISagaPersister.cs index f8121194e6f..b2ffd321745 100644 --- a/src/core/NServiceBus.Saga/ISagaPersister.cs +++ b/src/NServiceBus/Saga/ISagaPersister.cs @@ -1,7 +1,7 @@ -using System; - namespace NServiceBus.Saga { + using System; + /// /// Defines the basic functionality of a persister for storing /// and retrieving a saga. @@ -12,20 +12,20 @@ public interface ISagaPersister /// Saves the saga entity to the persistence store. /// /// The saga entity to save. - void Save(ISagaEntity saga); + void Save(IContainSagaData saga); /// /// Updates an existing saga entity in the persistence store. /// /// The saga entity to updated. - void Update(ISagaEntity saga); + void Update(IContainSagaData saga); /// /// Gets a saga entity from the persistence store by its Id. /// /// The Id of the saga entity to get. /// - T Get(Guid sagaId) where T : ISagaEntity; + T Get(Guid sagaId) where T : IContainSagaData; /// /// Looks up a saga entity by a given property. @@ -34,14 +34,14 @@ public interface ISagaPersister /// /// /// - T Get(string property, object value) where T : ISagaEntity; + T Get(string property, object value) where T : IContainSagaData; /// /// Sets a saga as completed and removes it from the active saga list /// in the persistence store. /// /// The saga to complete. - void Complete(ISagaEntity saga); + void Complete(IContainSagaData saga); } /// diff --git a/src/NServiceBus/Saga/ISagaStartedBy.cs b/src/NServiceBus/Saga/ISagaStartedBy.cs new file mode 100644 index 00000000000..642e4082c07 --- /dev/null +++ b/src/NServiceBus/Saga/ISagaStartedBy.cs @@ -0,0 +1,24 @@ + +namespace NServiceBus.Saga +{ + /// + /// Use this interface to signify that when a message of the given type is + /// received, if a saga cannot be found by an + /// the saga will be created. + /// + /// + [ObsoleteEx(Replacement = "IAmStartedByMessages", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public interface ISagaStartedBy : IAmStartedByMessages + { + } + + /// + /// Use this interface to signify that when a message of the given type is + /// received, if a saga cannot be found by an + /// the saga will be created. + /// + /// + public interface IAmStartedByMessages : IHandleMessages + { + } +} diff --git a/src/NServiceBus/Saga/ITimeoutState.cs b/src/NServiceBus/Saga/ITimeoutState.cs new file mode 100644 index 00000000000..420899c7a5d --- /dev/null +++ b/src/NServiceBus/Saga/ITimeoutState.cs @@ -0,0 +1,10 @@ +namespace NServiceBus.Saga +{ + /// + /// Marker interface for timeout state messages + /// + [ObsoleteEx(Message = "Timeouts no longer need to inherit from ITimeoutState so this interface can safely be removed", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public interface ITimeoutState : IMessage + { + } +} \ No newline at end of file diff --git a/src/NServiceBus/Saga/ITimeoutable.cs b/src/NServiceBus/Saga/ITimeoutable.cs new file mode 100644 index 00000000000..99c47e0ece1 --- /dev/null +++ b/src/NServiceBus/Saga/ITimeoutable.cs @@ -0,0 +1,16 @@ +namespace NServiceBus.Saga +{ + /// + /// Interface used by the saga infrastructure for notifying sagas about a timeout. + /// + [ObsoleteEx(Message = "2.6 style timeouts has been replaced. Please implement IHandleTimeouts instead.", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public interface ITimeoutable + { + /// + /// Indicates to the saga that a timeout has occurred, + /// passing in the state object previously received from the saga. + /// + /// + void Timeout(object state); + } +} diff --git a/src/NServiceBus/Saga/Saga.cs b/src/NServiceBus/Saga/Saga.cs new file mode 100644 index 00000000000..13ee897cdcf --- /dev/null +++ b/src/NServiceBus/Saga/Saga.cs @@ -0,0 +1,307 @@ +namespace NServiceBus.Saga +{ + using System; + using System.Linq.Expressions; + + /// + /// This class is used to define sagas containing data and handling a message. + /// To handle more message types, implement + /// for the relevant types. + /// To signify that the receipt of a message should start this saga, + /// implement for the relevant message type. + /// + /// A type that implements . + public abstract class + Saga : IConfigurable, ISaga where T : IContainSagaData + { + /// + /// The saga's strongly typed data. + /// + public T Data { get; set; } + + /// + /// A more generic projection on . + /// + public IContainSagaData Entity + { + get { return Data; } + set { Data = (T)value; } + } + + private bool configuring; + void IConfigurable.Configure() + { + configuring = true; + ConfigureHowToFindSaga(); + configuring = false; + } + + /// + /// Override this method in order to configure how this saga's data should be found. + /// Call for each property of each message you want + /// to use for lookup. + /// + public virtual void ConfigureHowToFindSaga() + { + } + + /// + /// When the infrastructure is handling a message of the given type + /// this specifies which message property should be matched to + /// which saga entity property in the persistent saga store. + /// + /// + /// + /// + [ObsoleteEx(Message = "Use the more explicit ConfigureMapping.ToSaga(...) instead. For example 'ConfigureMapping(message => message.MyProp).ToSaga(sagaData => sagaData.MyProp);'.", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + protected virtual void ConfigureMapping(Expression> sagaEntityProperty, Expression> messageProperty) + { + if (!configuring) + throw new InvalidOperationException("Cannot configure mappings outside of 'ConfigureHowToFindSaga'."); + + SagaMessageFindingConfiguration.ConfigureMapping(sagaEntityProperty, messageProperty); + } + + /// + /// When the infrastructure is handling a message of the given type + /// this specifies which message property should be matched to + /// which saga entity property in the persistent saga store. + /// + /// + /// + /// + protected virtual ToSagaExpression ConfigureMapping(Expression> messageProperty) + { + if (!configuring) + throw new InvalidOperationException("Cannot configure mappings outside of 'ConfigureHowToFindSaga'."); + + return new ToSagaExpression(SagaMessageFindingConfiguration, messageProperty); + } + + + /// + /// Called by saga to notify the infrastructure when attempting to reply to message where the originator is null + /// + public IHandleReplyingToNullOriginator HandleReplyingToNullOriginator { get; set; } + + + /// + /// Bus object used for retrieving the sender endpoint which caused this saga to start. + /// Necessary for . + /// + public IBus Bus + { + get + { + if (bus == null) + throw new InvalidOperationException("No IBus instance availble, please configure one and also verify that you're not defining your own Bus property in your saga since that hides the one in the base class"); + + return bus; + } + + set { bus = value; } + } + + IBus bus; + + /// + /// Object used to configure mapping between saga properties and message properties + /// for the purposes of finding sagas when a message arrives. + /// + /// Do NOT use at runtime (handling messages) - it will be null. + /// + public IConfigureHowToFindSagaWithMessage SagaMessageFindingConfiguration { get; set; } + + /// + /// Indicates that the saga is complete. + /// In order to set this value, use the method. + /// + public bool Completed { get; private set; } + + /// + /// Request for a timeout to occur at the given . + /// + /// to send timeout . + protected void RequestTimeout(DateTime at) + { + RequestUtcTimeout(at, Bus.CreateInstance()); + } + + /// + /// Request for a timeout to occur at the given . + /// + /// to send call . + /// Callback to execute after is reached. + protected void RequestTimeout(DateTime at, Action action) + { + RequestUtcTimeout(at, Bus.CreateInstance(action)); + } + + + /// + /// Request for a timeout to occur at the given . + /// + /// to send timeout . + /// The message to send after is reached. + protected void RequestTimeout(DateTime at, TTimeoutmessageType timeoutMessage) + { + if (at.Kind == DateTimeKind.Unspecified) + throw new InvalidOperationException("Kind property of DateTime 'at' must be specified."); + + SetTimeoutHeaders(timeoutMessage); + + Bus.Defer(at, timeoutMessage); + } + + /// + /// Request for a timeout to occur within the give . + /// + /// Given to delay timeout message by. + protected void RequestTimeout(TimeSpan within) + { + RequestUtcTimeout(within, Bus.CreateInstance()); + } + + /// + /// Request for a timeout to occur within the give . + /// + /// Given to delay timeout message by. + /// An which initializes properties of the message that is sent after expires. + protected void RequestTimeout(TimeSpan within, Action messageConstructor) + { + RequestUtcTimeout(within, Bus.CreateInstance(messageConstructor)); + } + + /// + /// Request for a timeout to occur within the given . + /// + /// Given to delay timeout message by. + /// The message to send after expires. + protected void RequestTimeout(TimeSpan within, TTimeoutmessageType timeoutMessage) + { + SetTimeoutHeaders(timeoutMessage); + + Bus.Defer(within, timeoutMessage); + } + + #region Obsoleted RequestUtcTimeout + /// + /// Request for a timeout to occur at the given . + /// + /// to send timeout . + [ObsoleteEx(Replacement = "RequestTimeout(DateTime at)", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + protected void RequestUtcTimeout(DateTime at) + { + RequestTimeout(at, Bus.CreateInstance()); + } + + /// + /// Request for a timeout to occur at the given . + /// + /// to send the message produced by . + /// An which initializes properties of the message that is sent when is reached. + [ObsoleteEx(Replacement = "RequestTimeout(DateTime at, Action messageConstructor)", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + protected void RequestUtcTimeout(DateTime at, Action messageConstructor) + { + RequestTimeout(at, Bus.CreateInstance(messageConstructor)); + } + + + /// + /// Request for a timeout to occur at the given . + /// + /// to send timeout . + /// The message to send after is reached. + [ObsoleteEx(Replacement = "RequestTimeout(DateTime at, TTimeoutmessageType timeoutMessage)", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + protected void RequestUtcTimeout(DateTime at, TTimeoutmessageType timeoutMessage) + { + RequestTimeout(at, timeoutMessage); + } + + /// + /// Request for a timeout to occur within the give . + /// + /// Given to delay timeout message by. + [ObsoleteEx(Replacement = "RequestTimeout(TimeSpan within)", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + protected void RequestUtcTimeout(TimeSpan within) + { + RequestTimeout(within, Bus.CreateInstance()); + } + + /// + /// Request for a timeout to occur within the give . + /// + /// Given to delay timeout message by. + /// An which initializes properties of the message that is sent after expires. + [ObsoleteEx(Replacement = "RequestTimeout(TimeSpan within, Action action)", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + protected void RequestUtcTimeout(TimeSpan within, Action messageConstructor) + { + RequestTimeout(within, Bus.CreateInstance(messageConstructor)); + } + + /// + /// Request for a timeout to occur within the give . + /// + /// Given to delay by. + /// The message to send after expires. + [ObsoleteEx(Replacement = "RequestTimeout(TimeSpan within, TTimeoutmessageType timeoutMessage)", TreatAsErrorFromVersion = "5.0", RemoveInVersion = "6.0")] + protected void RequestUtcTimeout(TimeSpan within, TTimeoutmessageType timeoutMessage) + { + RequestTimeout(within, timeoutMessage); + } + #endregion + + private void SetTimeoutHeaders(object toSend) + { + + Headers.SetMessageHeader(toSend, Headers.SagaId, Data.Id.ToString()); + Headers.SetMessageHeader(toSend, Headers.IsSagaTimeoutMessage, Boolean.TrueString); + Headers.SetMessageHeader(toSend, Headers.SagaType, GetType().AssemblyQualifiedName); + } + + /// + /// Sends the using the bus to the endpoint that caused this saga to start. + /// + /// + protected virtual void ReplyToOriginator(params object[] messages) + { + if (string.IsNullOrEmpty(Data.Originator)) + HandleReplyingToNullOriginator.TriedToReplyToNullOriginator(); + else + Bus.Send(Data.Originator, Data.OriginalMessageId, messages); + } + + /// + /// Instantiates a message of the given type, setting its properties using the given action, + /// and sends it using the bus to the endpoint that caused this saga to start. + /// + /// The type of message to construct. + /// An which initializes properties of the message reply with. + protected virtual void ReplyToOriginator(Action messageConstructor) + { + if (messageConstructor != null) + ReplyToOriginator(Bus.CreateInstance(messageConstructor)); + else + ReplyToOriginator(null); + } + + /// + /// Marks the saga as complete. + /// This may result in the sagas state being deleted by the persister. + /// + protected virtual void MarkAsComplete() + { + Completed = true; + } + + /// + /// Notifies that the timeout it previously requested occurred. + /// + /// The object passed as the "withState" parameter to RequestTimeout. + [ObsoleteEx(Message = "2.6 style timeouts has been replaced. Please implement IHandleTimeouts instead.", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public virtual void Timeout(object state) + { + } + + } +} diff --git a/src/NServiceBus/Saga/ToSagaExpression.cs b/src/NServiceBus/Saga/ToSagaExpression.cs new file mode 100644 index 00000000000..8ba7844c350 --- /dev/null +++ b/src/NServiceBus/Saga/ToSagaExpression.cs @@ -0,0 +1,37 @@ +namespace NServiceBus.Saga +{ + using System; + using System.Linq.Expressions; + + /// + /// Allows a more fluent way to map sagas + /// + /// + /// + public class ToSagaExpression where TSaga : IContainSagaData + { + readonly IConfigureHowToFindSagaWithMessage sagaMessageFindingConfiguration; + readonly Expression> messageProperty; + + /// + /// Constucts the expression + /// + /// + /// + public ToSagaExpression(IConfigureHowToFindSagaWithMessage sagaMessageFindingConfiguration, Expression> messageProperty) + { + this.sagaMessageFindingConfiguration = sagaMessageFindingConfiguration; + this.messageProperty = messageProperty; + } + + + /// + /// Defines the property on the saga data to which the message property should be mapped + /// + /// The property to map + public void ToSaga(Expression> sagaEntityProperty) + { + sagaMessageFindingConfiguration.ConfigureMapping(sagaEntityProperty, messageProperty); + } + } +} \ No newline at end of file diff --git a/src/core/NServiceBus.Saga/UniqueAttribute.cs b/src/NServiceBus/Saga/UniqueAttribute.cs similarity index 90% rename from src/core/NServiceBus.Saga/UniqueAttribute.cs rename to src/NServiceBus/Saga/UniqueAttribute.cs index 8abf2ee38ed..c7fe772e719 100644 --- a/src/core/NServiceBus.Saga/UniqueAttribute.cs +++ b/src/NServiceBus/Saga/UniqueAttribute.cs @@ -1,65 +1,66 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; - namespace NServiceBus.Saga -{ - /// - /// Used to specify that a saga property should be unique across all saga instances. - /// This will ensure that 2 saga instances don't get persisted when using the property to correlate between multiple message types +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + + /// + /// Used to specify that a saga property should be unique across all saga instances. + /// This will ensure that 2 saga instances don't get persisted when using the property to correlate between multiple message types /// - public class UniqueAttribute : Attribute - { - /// - /// Gets a single property that is marked with the UniqueAttribute for a saga entity - /// - /// The type to evaluate - /// A PropertyInfo of the property marked with a UniqAttribute or null if not used - public static PropertyInfo GetUniqueProperty(Type type) - { - var properties = GetUniqueProperties(type); - - if (properties.Count() > 1) - throw new InvalidOperationException( - string.Format("More than one UniqueAttribute property was found on the type '{0}'. However, only one property is supported.", type.FullName)); - - return properties.SingleOrDefault(); - } - - /// - /// Gets a single property that is marked with the UniqueAttribute for a saga entity - /// - /// A saga entity - /// A PropertyInfo of the property marked with a UniqAttribute or null if not used - public static KeyValuePair? GetUniqueProperty(ISagaEntity entity) - { - var prop = GetUniqueProperty(entity.GetType()); - - return prop != null ? - new KeyValuePair(prop.Name, prop.GetValue(entity, null)) : - (KeyValuePair?) null; + [AttributeUsage(AttributeTargets.Property, Inherited = true)] + public sealed class UniqueAttribute : Attribute + { + /// + /// Gets a single property that is marked with the UniqueAttribute for a saga entity + /// + /// The type to evaluate + /// A PropertyInfo of the property marked with a UniqAttribute or null if not used + public static PropertyInfo GetUniqueProperty(Type type) + { + var properties = GetUniqueProperties(type); + + if (properties.Count() > 1) + throw new InvalidOperationException( + string.Format("More than one UniqueAttribute property was found on the type '{0}'. However, only one property is supported.", type.FullName)); + + return properties.SingleOrDefault(); + } + + /// + /// Gets a single property that is marked with the UniqueAttribute for a saga entity + /// + /// A saga entity + /// A PropertyInfo of the property marked with a UniqAttribute or null if not used + public static KeyValuePair? GetUniqueProperty(IContainSagaData entity) + { + var prop = GetUniqueProperty(entity.GetType()); + + return prop != null ? + new KeyValuePair(prop.Name, prop.GetValue(entity, null)) : + (KeyValuePair?) null; } - /// - /// Gets all the properties that are marked with the UniqueAttribute for a saga entity - /// - /// A saga entity + /// + /// Gets all the properties that are marked with the UniqueAttribute for a saga entity + /// + /// A saga entity /// A dictionary of property names and their values - public static IDictionary GetUniqueProperties(ISagaEntity entity) - { - return GetUniqueProperties(entity.GetType()).ToDictionary(p => p.Name, p => p.GetValue(entity, null)); - } - - /// - /// Gets all the properties that are marked with the UniqueAttribute for the given Type - /// - /// The type to evaluate - /// A queryable of PropertyInfo - public static IQueryable GetUniqueProperties(Type type) - { - return type.GetProperties() - .Where(p => p.CanRead && p.GetCustomAttributes(typeof (UniqueAttribute), false).Length > 0).AsQueryable(); + public static IDictionary GetUniqueProperties(IContainSagaData entity) + { + return GetUniqueProperties(entity.GetType()).ToDictionary(p => p.Name, p => p.GetValue(entity, null)); + } + + /// + /// Gets all the properties that are marked with the UniqueAttribute for the given Type + /// + /// The type to evaluate + /// A queryable of PropertyInfo + public static IQueryable GetUniqueProperties(Type type) + { + return type.GetProperties() + .Where(p => p.CanRead && p.GetCustomAttributes(typeof (UniqueAttribute), false).Length > 0).AsQueryable(); } } } \ No newline at end of file diff --git a/src/NServiceBus/Serialization/IMessageSerializer.cs b/src/NServiceBus/Serialization/IMessageSerializer.cs new file mode 100644 index 00000000000..05fd98778df --- /dev/null +++ b/src/NServiceBus/Serialization/IMessageSerializer.cs @@ -0,0 +1,32 @@ +namespace NServiceBus.Serialization +{ + using System; + using System.IO; + using System.Collections.Generic; + + /// + /// Interface used for serializing and deserializing messages. + /// + public interface IMessageSerializer + { + /// + /// Serializes the given set of messages into the given stream. + /// + /// Messages to serialize. + /// Stream for to be serialized into. + void Serialize(object[] messages, Stream stream); + + /// + /// Deserializes from the given stream a set of messages. + /// + /// Stream that contains messages. + /// The list of message types to deserialize. If null the types must be inferred from the serialized data. + /// Deserialized messages. + object[] Deserialize(Stream stream, IList messageTypes = null); + + /// + /// Gets the content type into which this serializer serializes the content to + /// + string ContentType { get; } + } +} diff --git a/src/NServiceBus/Support/RuntimeEnvironment.cs b/src/NServiceBus/Support/RuntimeEnvironment.cs new file mode 100644 index 00000000000..1efd65dc00f --- /dev/null +++ b/src/NServiceBus/Support/RuntimeEnvironment.cs @@ -0,0 +1,29 @@ +namespace NServiceBus.Support +{ + using System; + + /// + /// Abstracts the runtime environment + /// + public static class RuntimeEnvironment + { + static RuntimeEnvironment() + { + MachineNameAction = () => Environment.MachineName; + } + + /// + /// Returns the machine name where this endpoint is currently running + /// + public static string MachineName + { + get { return MachineNameAction(); } + } + + + /// + /// Get the machine name, allows for overrides + /// + public static Func MachineNameAction { get; set; } + } +} \ No newline at end of file diff --git a/src/core/NServiceBus/WireEncryptedString.cs b/src/NServiceBus/WireEncryptedString.cs similarity index 98% rename from src/core/NServiceBus/WireEncryptedString.cs rename to src/NServiceBus/WireEncryptedString.cs index 7292b693d13..ab7716ef2bb 100644 --- a/src/core/NServiceBus/WireEncryptedString.cs +++ b/src/NServiceBus/WireEncryptedString.cs @@ -32,45 +32,45 @@ public WireEncryptedString(SerializationInfo info, StreamingContext context) /// /// The encrypted value of this string /// - public EncryptedValue EncryptedValue - { - get - { - if (encryptedValue != null) - return encryptedValue; - - if(EncryptedBase64Value != null) - return new EncryptedValue - { - EncryptedBase64Value = EncryptedBase64Value, - Base64Iv = Base64Iv - }; - return null; - } - set - { - encryptedValue = value; - - if(encryptedValue != null) - { - EncryptedBase64Value = encryptedValue.EncryptedBase64Value; - Base64Iv = encryptedValue.Base64Iv; - } - } - } + public EncryptedValue EncryptedValue + { + get + { + if (encryptedValue != null) + return encryptedValue; + + if(EncryptedBase64Value != null) + return new EncryptedValue + { + EncryptedBase64Value = EncryptedBase64Value, + Base64Iv = Base64Iv + }; + return null; + } + set + { + encryptedValue = value; + + if(encryptedValue != null) + { + EncryptedBase64Value = encryptedValue.EncryptedBase64Value; + Base64Iv = encryptedValue.Base64Iv; + } + } + } EncryptedValue encryptedValue; - - //**** we need to duplicate to make versions > 3.2.7 backwards compatible with 2.X - - /// - /// Only keept for backwards compatibility reasons - /// - public string EncryptedBase64Value { get; set; } - - /// - /// Only keept for backwards compatibility reasons - /// - public string Base64Iv { get; set; } + + //**** we need to duplicate to make versions > 3.2.7 backwards compatible with 2.X + + /// + /// Only keept for backwards compatibility reasons + /// + public string EncryptedBase64Value { get; set; } + + /// + /// Only keept for backwards compatibility reasons + /// + public string Base64Iv { get; set; } //**** @@ -101,7 +101,7 @@ public static implicit operator WireEncryptedString(string s) /// public void GetObjectData(SerializationInfo info, StreamingContext context) { - info.AddValue("EncryptedValue", EncryptedValue); + info.AddValue("EncryptedValue", EncryptedValue); } } diff --git a/src/NServiceBus/packages.config b/src/NServiceBus/packages.config new file mode 100644 index 00000000000..f41ba0dfaee --- /dev/null +++ b/src/NServiceBus/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/src/ObjectBuilder/ComponentCallModelEnum.cs b/src/ObjectBuilder/ComponentCallModelEnum.cs deleted file mode 100644 index bd0e945438c..00000000000 --- a/src/ObjectBuilder/ComponentCallModelEnum.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace NServiceBus.ObjectBuilder -{ - /// - /// Represent the various call models for a component. - /// - public enum ComponentCallModelEnum - { - /// - /// Accept the default call model of the underlying technology. This rougly maps to the - /// InstancePerUnitOfWork lifecycle in our new lifycycle definitions - /// - None, - - /// - /// Only one instance of the component will ever be called. This maps to the - /// SingleInstance lifecycle in our new lifycycle definitions - /// - Singleton, - - /// - /// Each call on the component will be performed on a new instance. This maps to the - /// InstancePerCall lifecycle in our new lifycycle definitions - /// - Singlecall - } -} diff --git a/src/ObjectBuilder/IBuilder.cs b/src/ObjectBuilder/IBuilder.cs deleted file mode 100644 index 40f915cfd33..00000000000 --- a/src/ObjectBuilder/IBuilder.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace NServiceBus.ObjectBuilder -{ - /// - /// Used to instantiate types, so that all configured dependencies - /// and property values are set. - /// An abstraction on top of dependency injection frameworks. - /// - public interface IBuilder : IDisposable - { - /// - /// Creates an instance of the given type, injecting it with all defined dependencies. - /// - /// - /// - object Build(Type typeToBuild); - - /// - /// Creates an instance of a child builder which is used to facilitate deterministic - /// disposal of all resources created by the child builder. - /// - /// - IBuilder CreateChildBuilder(); - - /// - /// Creates an instance of the given type, injecting it with all defined dependencies. - /// - /// - /// - T Build(); - - /// - /// For each type that is compatible with T, an instance is created with all dependencies injected, and yeilded to the caller. - /// - /// - /// - IEnumerable BuildAll(); - - /// - /// For each type that is compatible with the given type, an instance is created with all dependencies injected. - /// - /// - /// - IEnumerable BuildAll(Type typeToBuild); - - /// - /// Builds an instance of the defined type injecting it with all defined dependencies - /// and invokes the given action on the instance. - /// - /// - /// - void BuildAndDispatch(Type typeToBuild, Action action); - } -} diff --git a/src/ObjectBuilder/ObjectBuilder.csproj b/src/ObjectBuilder/ObjectBuilder.csproj deleted file mode 100644 index 9635cdc8c10..00000000000 --- a/src/ObjectBuilder/ObjectBuilder.csproj +++ /dev/null @@ -1,100 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C831B94E-6D08-404C-BA80-B8E8442EA9DE} - Library - Properties - NServiceBus.ObjectBuilder - NServiceBus.ObjectBuilder - true - ..\NServiceBus.snk - v4.0 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\NServiceBus.ObjectBuilder.xml - true - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\NServiceBus.ObjectBuilder.xml - AllRules.ruleset - - - - ..\..\build\output\NServiceBus.dll - - - - 3.5 - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - copy /Y "$(OutDir)*.*" "$(ProjectDir)..\..\build\ - - \ No newline at end of file diff --git a/src/ObjectBuilder/ObjectBuilder.sln b/src/ObjectBuilder/ObjectBuilder.sln deleted file mode 100644 index 6301fe547a4..00000000000 --- a/src/ObjectBuilder/ObjectBuilder.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ObjectBuilder", "ObjectBuilder.csproj", "{C831B94E-6D08-404C-BA80-B8E8442EA9DE}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C831B94E-6D08-404C-BA80-B8E8442EA9DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C831B94E-6D08-404C-BA80-B8E8442EA9DE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C831B94E-6D08-404C-BA80-B8E8442EA9DE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C831B94E-6D08-404C-BA80-B8E8442EA9DE}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ObjectBuilder/Properties/AssemblyInfo.cs b/src/ObjectBuilder/Properties/AssemblyInfo.cs deleted file mode 100644 index bceb6d73f79..00000000000 Binary files a/src/ObjectBuilder/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/PowerShell/NServiceBus.PowerShell.Tests/NServiceBus.PowerShell.Tests.csproj b/src/PowerShell/NServiceBus.PowerShell.Tests/NServiceBus.PowerShell.Tests.csproj new file mode 100644 index 00000000000..018201c8fd3 --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell.Tests/NServiceBus.PowerShell.Tests.csproj @@ -0,0 +1,58 @@ + + + + + Debug + AnyCPU + {04121C4B-EB4F-4508-8760-5818185F4403} + Library + Properties + NServiceBus.PowerShell.Tests + NServiceBus.PowerShell.Tests + v4.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\..\packages\NUnit.2.6.2\lib\nunit.framework.dll + + + + + + + + + + + + + + + + + + {5E51EFBF-329F-4D3A-B86E-CC111697746F} + NServiceBus.PowerShell + + + + + \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell.Tests/Properties/AssemblyInfo.cs b/src/PowerShell/NServiceBus.PowerShell.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..5197a16419d --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("NServiceBus.Core")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyProduct("NServiceBus.Core")] +[assembly: AssemblyCompany("NServiceBus")] +[assembly: AssemblyConfiguration("release")] +[assembly: AssemblyInformationalVersion("4.0.0-alpha0")] +[assembly: ComVisible(false)] +[assembly: CLSCompliantAttribute(true)] + diff --git a/src/PowerShell/NServiceBus.PowerShell.Tests/RavenDBSetupTests.cs b/src/PowerShell/NServiceBus.PowerShell.Tests/RavenDBSetupTests.cs new file mode 100644 index 00000000000..eea8e980326 --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell.Tests/RavenDBSetupTests.cs @@ -0,0 +1,33 @@ +namespace NServiceBus.PowerShell.Tests +{ + using System.IO; + using NUnit.Framework; + using Setup.Windows.RavenDB; + + [TestFixture] + public class RavenDBSetupTests + { + [Explicit] + [Test] + public void Install() + { + RavenDBSetup.Install(); + } + + [Test] + public void EnsureGetRavenResourcesIsNotEmpty() + { + var combine = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + try + { + Directory.CreateDirectory(combine); + RavenDBSetup.ExportRavenResources(combine); + Assert.IsNotEmpty(Directory.GetFiles(combine)); + } + finally + { + Directory.Delete(combine, true); + } + } + } +} diff --git a/src/PowerShell/NServiceBus.PowerShell.Tests/packages.config b/src/PowerShell/NServiceBus.PowerShell.Tests/packages.config new file mode 100644 index 00000000000..62adf5a59ac --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell.Tests/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/AddConfigSection.cs b/src/PowerShell/NServiceBus.PowerShell/AddConfigSection.cs new file mode 100644 index 00000000000..6961c80a74f --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/AddConfigSection.cs @@ -0,0 +1,143 @@ +namespace NServiceBus.PowerShell +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Management.Automation; + using System.Xml; + using System.Xml.Linq; + using System.Xml.XPath; + + public abstract class AddConfigSection : PSCmdlet + { + [Parameter(Position = 0, Mandatory = true, HelpMessage = "Specifies the project containing the project to update.", ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string ProjectName { get; set; } + + protected override void BeginProcessing() + { + InitialiseProject(); + } + + protected override void ProcessRecord() + { + IEnumerable items = project.ProjectItems; + var configExistsInProject = items.Cast().Any(item => + { + var name = (string)item.Name; + return name.Equals("App.config", StringComparison.OrdinalIgnoreCase) || + name.Equals("Web.config", StringComparison.OrdinalIgnoreCase); + }); + + string projectPath = Path.GetDirectoryName(project.FullName); + var configFilePath = Path.Combine(projectPath, GetConfigFileForProjectType()); + + // I would have liked to use: + //( Get-Project).DTE.ItemOperations.AddNewItem("Visual C# Items\General\Application Configuration File") + // but for some reason it doesn't work! + + XDocument doc = GetOrCreateDocument(configFilePath); + + CreateConfigSectionIfRequired(doc); + + ModifyConfig(doc); + + doc.Save(configFilePath); + + if (!configExistsInProject) + { + project.ProjectItems.AddFromFile(configFilePath); + } + } + + void InitialiseProject() + { + var getProjectResults = InvokeCommand.InvokeScript(string.Format("Get-Project {0}", ProjectName)).ToList(); + project = getProjectResults.Count == 1 ? getProjectResults.Single().BaseObject : null; + } + + public abstract void ModifyConfig(XDocument doc); + + static void CreateConfigSectionIfRequired(XDocument doc) + { + if (doc.Root == null) + { + doc.Add(new XElement("/configuration")); + } + if (doc.XPathSelectElement("/configuration/configSections") == null) + { + doc.Root.AddFirst(new XElement("configSections")); + } + } + + static XDocument GetOrCreateDocument(string path) + { + if (File.Exists(path)) + { + try + { + return GetDocument(path); + } + catch (FileNotFoundException) + { + return CreateDocument(path); + } + catch (XmlException) + { + return CreateDocument(path); + } + } + return CreateDocument(path); + } + + static XDocument CreateDocument(string path) + { + var document = new XDocument(new XElement("configuration")) + { + Declaration = new XDeclaration("1.0", "utf-8", "yes") + }; + + document.Save(path); + + return document; + } + + static XDocument GetDocument(string path) + { + using (Stream configStream = File.Open(path, FileMode.Open)) + { + return XDocument.Load(configStream); + } + } + + private dynamic project; + + string GetConfigFileForProjectType() + { + if (IsWebProject()) + { + return "Web.config"; + } + + return "App.config"; + } + + bool IsWebProject() + { + var types = new HashSet(GetProjectTypeGuids(), StringComparer.OrdinalIgnoreCase); + return types.Contains(VsConstants.WebSiteProjectTypeGuid) || types.Contains(VsConstants.WebApplicationProjectTypeGuid); + } + + IEnumerable GetProjectTypeGuids() + { + string projectTypeGuids = Microsoft.Build.Evaluation.ProjectCollection.GlobalProjectCollection.GetLoadedProjects((string)project.FullName).Single().GetPropertyValue("ProjectTypeGuids"); + + if (String.IsNullOrEmpty(projectTypeGuids)) + return Enumerable.Empty(); + + return projectTypeGuids.Split(';'); + } + } +} \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/AddLoggingConfig.cs b/src/PowerShell/NServiceBus.PowerShell/AddLoggingConfig.cs new file mode 100644 index 00000000000..d3a3cead2af --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/AddLoggingConfig.cs @@ -0,0 +1,33 @@ +namespace NServiceBus.PowerShell +{ + using System.Management.Automation; + using System.Xml.Linq; + using System.Xml.XPath; + + [Cmdlet(VerbsCommon.Add, "NServiceBusLoggingConfig")] + public class AddLoggingConfig : AddConfigSection + { + const string Instructions = @""; + + public override void ModifyConfig(XDocument doc) + { + var sectionElement = doc.XPathSelectElement("/configuration/configSections/section[@name='Logging' and @type='NServiceBus.Config.Logging, NServiceBus.Core']"); + if (sectionElement == null) + { + + doc.XPathSelectElement("/configuration/configSections").Add(new XElement("section", + new XAttribute("name", "Logging"), + new XAttribute("type", "NServiceBus.Config.Logging, NServiceBus.Core"))); + } + + var forwardingElement = doc.XPathSelectElement("/configuration/Logging"); + if (forwardingElement == null) + { + doc.Root.LastNode.AddAfterSelf(new XComment(Instructions), + new XElement("Logging", + new XAttribute("Threshold", "INFO"))); + } + } + } +} \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/AddMasterNodeConfig.cs b/src/PowerShell/NServiceBus.PowerShell/AddMasterNodeConfig.cs new file mode 100644 index 00000000000..000260101ca --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/AddMasterNodeConfig.cs @@ -0,0 +1,33 @@ +namespace NServiceBus.PowerShell +{ + using System.Management.Automation; + using System.Xml.Linq; + using System.Xml.XPath; + + [Cmdlet(VerbsCommon.Add, "NServiceBusMasterNodeConfig")] + public class AddMasterNodeConfig : AddConfigSection + { + const string Instructions = @""; + + public override void ModifyConfig(XDocument doc) + { + var sectionElement = doc.XPathSelectElement("/configuration/configSections/section[@name='MasterNodeConfig' and @type='NServiceBus.Config.MasterNodeConfig, NServiceBus.Core']"); + if (sectionElement == null) + { + + doc.XPathSelectElement("/configuration/configSections").Add(new XElement("section", + new XAttribute("name", "MasterNodeConfig"), + new XAttribute("type", "NServiceBus.Config.MasterNodeConfig, NServiceBus.Core"))); + } + + var forwardingElement = doc.XPathSelectElement("/configuration/MasterNodeConfig"); + if (forwardingElement == null) + { + doc.Root.LastNode.AddAfterSelf(new XComment(Instructions), + new XElement("MasterNodeConfig", + new XAttribute("Node", "SERVER_NAME_HERE"))); + } + } + } +} \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/AddMessageForwardingInCaseOfFaultConfig.cs b/src/PowerShell/NServiceBus.PowerShell/AddMessageForwardingInCaseOfFaultConfig.cs new file mode 100644 index 00000000000..a938ef0644a --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/AddMessageForwardingInCaseOfFaultConfig.cs @@ -0,0 +1,36 @@ +namespace NServiceBus.PowerShell +{ + using System.Management.Automation; + using System.Xml.Linq; + using System.Xml.XPath; + + [Cmdlet(VerbsCommon.Add, "NServiceBusMessageForwardingInCaseOfFaultConfig")] + public class AddMessageForwardingInCaseOfFaultConfig : AddConfigSection + { + public override void ModifyConfig(XDocument doc) + { + const string Instructions = @""; + + var sectionElement = doc.XPathSelectElement("/configuration/configSections/section[@name='MessageForwardingInCaseOfFaultConfig' and @type='NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core']"); + if (sectionElement == null) + { + + doc.XPathSelectElement("/configuration/configSections").Add(new XElement("section", + new XAttribute("name", + "MessageForwardingInCaseOfFaultConfig"), + new XAttribute("type", + "NServiceBus.Config.MessageForwardingInCaseOfFaultConfig, NServiceBus.Core"))); + + } + + var forwardingElement = doc.XPathSelectElement("/configuration/MessageForwardingInCaseOfFaultConfig"); + if (forwardingElement == null) + { + doc.Root.LastNode.AddAfterSelf(new XComment(Instructions), + new XElement("MessageForwardingInCaseOfFaultConfig", + new XAttribute("ErrorQueue", "error"))); + } + } + } +} \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/AddNHibernateConfig.cs b/src/PowerShell/NServiceBus.PowerShell/AddNHibernateConfig.cs new file mode 100644 index 00000000000..aca014e1a30 --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/AddNHibernateConfig.cs @@ -0,0 +1,40 @@ +namespace NServiceBus.PowerShell +{ + using System.Management.Automation; + using System.Xml.Linq; + + [Cmdlet(VerbsCommon.Add, "NServiceBusNHibernateConfig")] + public class AddNHibernateConfig : AddConfigSection + { + private const string Instructions = + @" +To run NServiceBus with NHibernate you need to at least specify the database connectionstring. +Here is an example of what is required: + + + + + + + + + + + + + + + + + + + + + "; + + public override void ModifyConfig(XDocument doc) + { + doc.Root.LastNode.AddAfterSelf(new XComment(Instructions)); + } + } +} \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/AddSecondLevelRetriesConfig.cs b/src/PowerShell/NServiceBus.PowerShell/AddSecondLevelRetriesConfig.cs new file mode 100644 index 00000000000..24500a94557 --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/AddSecondLevelRetriesConfig.cs @@ -0,0 +1,37 @@ +namespace NServiceBus.PowerShell +{ + using System.Management.Automation; + using System.Xml.Linq; + using System.Xml.XPath; + + [Cmdlet(VerbsCommon.Add, "NServiceBusSecondLevelRetriesConfig")] + public class AddSecondLevelRetriesConfig : AddConfigSection + { + const string Instructions = @""; + + public override void ModifyConfig(XDocument doc) + { + var sectionElement = doc.XPathSelectElement("/configuration/configSections/section[@name='SecondLevelRetriesConfig' and @type='NServiceBus.Config.SecondLevelRetriesConfig, NServiceBus.Core']"); + if (sectionElement == null) + { + + doc.XPathSelectElement("/configuration/configSections").Add(new XElement("section", + new XAttribute("name", "SecondLevelRetriesConfig"), + new XAttribute("type", "NServiceBus.Config.SecondLevelRetriesConfig, NServiceBus.Core"))); + } + + var forwardingElement = doc.XPathSelectElement("/configuration/SecondLevelRetriesConfig"); + if (forwardingElement == null) + { + doc.Root.LastNode.AddAfterSelf(new XComment(Instructions), + new XElement("SecondLevelRetriesConfig", + new XAttribute("Enabled", "true"), + new XAttribute("NumberOfRetries", "3"), + new XAttribute("TimeIncrease", "00:00:10"))); + } + } + } +} \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/AddTransportConfig.cs b/src/PowerShell/NServiceBus.PowerShell/AddTransportConfig.cs new file mode 100644 index 00000000000..d6e8b490677 --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/AddTransportConfig.cs @@ -0,0 +1,37 @@ +namespace NServiceBus.PowerShell +{ + using System.Management.Automation; + using System.Xml.Linq; + using System.Xml.XPath; + + [Cmdlet(VerbsCommon.Add, "NServiceBusTransportConfig")] + public class AddTransportConfig : AddConfigSection + { + const string Instructions = @""; + + public override void ModifyConfig(XDocument doc) + { + var sectionElement = doc.XPathSelectElement("/configuration/configSections/section[@name='TransportConfig' and @type='NServiceBus.Config.TransportConfig, NServiceBus.Core']"); + if (sectionElement == null) + { + + doc.XPathSelectElement("/configuration/configSections").Add(new XElement("section", + new XAttribute("name", "TransportConfig"), + new XAttribute("type", "NServiceBus.Config.TransportConfig, NServiceBus.Core"))); + } + + var forwardingElement = doc.XPathSelectElement("/configuration/TransportConfig"); + if (forwardingElement == null) + { + doc.Root.LastNode.AddAfterSelf(new XComment(Instructions), + new XElement("TransportConfig", + new XAttribute("MaxRetries", "5"), + new XAttribute("MaximumConcurrencyLevel", "1"), + new XAttribute("MaximumMessageThroughputPerSecond", "0"))); + } + } + } +} \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/AddUnicastBusConfig.cs b/src/PowerShell/NServiceBus.PowerShell/AddUnicastBusConfig.cs new file mode 100644 index 00000000000..5b40570646d --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/AddUnicastBusConfig.cs @@ -0,0 +1,53 @@ +namespace NServiceBus.PowerShell +{ + using System.Management.Automation; + using System.Xml.Linq; + using System.Xml.XPath; + + [Cmdlet(VerbsCommon.Add, "NServiceBusUnicastBusConfig")] + public class AddUnicastBusConfig : AddConfigSection + { + const string Instructions = @" + + To register all message types defined in an assembly: + + + To register all message types defined in an assembly with a specific namespace (it does not include sub namespaces): + + + To register a specific type in an assembly: + + + "; + + public override void ModifyConfig(XDocument doc) + { + var sectionElement = doc.XPathSelectElement("/configuration/configSections/section[@name='UnicastBusConfig' and @type='NServiceBus.Config.UnicastBusConfig, NServiceBus.Core']"); + if (sectionElement == null) + { + + doc.XPathSelectElement("/configuration/configSections").Add(new XElement("section", + new XAttribute("name", + "UnicastBusConfig"), + new XAttribute("type", + "NServiceBus.Config.UnicastBusConfig, NServiceBus.Core"))); + + } + + var forwardingElement = doc.XPathSelectElement("/configuration/UnicastBusConfig"); + if (forwardingElement == null) + { + doc.Root.LastNode.AddAfterSelf( + new XComment(Instructions), + new XElement("UnicastBusConfig", + new XAttribute("ForwardReceivedMessagesTo", "audit"), + new XElement("MessageEndpointMappings"))); + } + } + } +} \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/CmdletBase.cs b/src/PowerShell/NServiceBus.PowerShell/CmdletBase.cs index 75e619cb987..59238a64d7c 100644 --- a/src/PowerShell/NServiceBus.PowerShell/CmdletBase.cs +++ b/src/PowerShell/NServiceBus.PowerShell/CmdletBase.cs @@ -1,28 +1,19 @@ -namespace NServiceBus.PowerShell -{ - using System; - using System.ComponentModel; - using System.Management.Automation; - using System.Runtime.InteropServices; - using System.Security; - using System.Security.Principal; - using Setup.Windows; - - - public abstract class CmdletBase : PSCmdlet - { - protected abstract void Process(); - - protected override void ProcessRecord() - { - if (ProcessUtil.IsRunningWithElevatedPriviliges()) - { - Process(); - } - else - { - throw new SecurityException("You need to run this command with administrative rights."); - } - } - } +namespace NServiceBus.PowerShell +{ + using System.Management.Automation; + using System.Security; + using Setup.Windows; + + + public abstract class CmdletBase : PSCmdlet + { + protected override void BeginProcessing() + { + if (!ProcessUtil.IsRunningWithElevatedPrivileges()) + { + var exception = new SecurityException("NServiceBus was unable to perform some infrastructure operations. You need to run this command with elevated privileges. If you are running this command from Visual Studio please close Visual Studio and re-open with elevated privileges. For more information see: http://particular.net/articles/preparing-your-machine-to-run-nservicebus"); + ThrowTerminatingError(new ErrorRecord(exception, "NotAuthorized", ErrorCategory.SecurityError, null)); + } + } + } } \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/CodeTemplates/Scaffolders/EndpointConfig/EndpointConfig.ps1 b/src/PowerShell/NServiceBus.PowerShell/CodeTemplates/Scaffolders/EndpointConfig/EndpointConfig.ps1 new file mode 100644 index 00000000000..f419b9c307e --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/CodeTemplates/Scaffolders/EndpointConfig/EndpointConfig.ps1 @@ -0,0 +1,14 @@ +[T4Scaffolding.Scaffolder(Description = "Creates a EndpointConfig code file")][CmdletBinding()] +param( + [string]$Project, + [string[]]$TemplateFolders, + [switch]$Force = $false +) + +$outputPath = "EndpointConfig" # The filename extension will be added based on the template's <#@ Output Extension="..." #> directive +$namespace = (Get-Project $Project).Properties.Item("DefaultNamespace").Value + +Add-ProjectItemViaTemplate $outputPath -Template EndpointConfigTemplate ` + -Model @{ Namespace = $namespace; } ` + -SuccessMessage "Added EndpointConfig output at {0}" ` + -TemplateFolders $TemplateFolders -Project $Project -CodeLanguage $CodeLanguage -Force:$Force \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/CodeTemplates/Scaffolders/EndpointConfig/EndpointConfigTemplate.cs.t4 b/src/PowerShell/NServiceBus.PowerShell/CodeTemplates/Scaffolders/EndpointConfig/EndpointConfigTemplate.cs.t4 new file mode 100644 index 00000000000..30282c13912 --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/CodeTemplates/Scaffolders/EndpointConfig/EndpointConfigTemplate.cs.t4 @@ -0,0 +1,15 @@ +<#@ Template Language="C#" HostSpecific="True" Inherits="DynamicTransform" #> +<#@ Output Extension="cs" #> + +namespace <#= Model.Namespace #> +{ + using NServiceBus; + + /* + This class configures this endpoint as a Server. More information about how to configure the NServiceBus host + can be found here: http://particular.net/articles/the-nservicebus-host + */ + public class EndpointConfig : IConfigureThisEndpoint, AsA_Server + { + } +} \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/CodeTemplates/Scaffolders/EndpointConfig/EndpointConfigTemplate.vb.t4 b/src/PowerShell/NServiceBus.PowerShell/CodeTemplates/Scaffolders/EndpointConfig/EndpointConfigTemplate.vb.t4 new file mode 100644 index 00000000000..e98d2bc6575 --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/CodeTemplates/Scaffolders/EndpointConfig/EndpointConfigTemplate.vb.t4 @@ -0,0 +1,15 @@ +<#@ Template Language="VB" HostSpecific="True" Inherits="DynamicTransform" #> +<#@ Output Extension="vb" #> + +Imports NServiceBus +Namespace <#= Model.Namespace #> + + ' + ' This class configures this endpoint as a Server. More information about how to configure the NServiceBus host + ' can be found here: http://particular.net/articles/the-nservicebus-host + ' + Public Class EndpointConfig + Implements IConfigureThisEndpoint + Inherits AsA_Server + End Class +End Namespace \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/Dtc/DtcSetup.cs b/src/PowerShell/NServiceBus.PowerShell/Dtc/DtcSetup.cs new file mode 100644 index 00000000000..e97fba8a9d1 --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/Dtc/DtcSetup.cs @@ -0,0 +1,77 @@ +namespace NServiceBus.Setup.Windows.Dtc +{ + using System; + using System.Collections.Generic; + using System.ServiceProcess; + using Microsoft.Win32; + + public class DtcSetup + { + /// + /// Checks that the MSDTC service is running and configured correctly, and if not + /// takes the necessary corrective actions to make it so. + /// + public static void StartDtcIfNecessary() + { + if (DoesSecurityConfigurationRequireRestart(true)) + { + ProcessUtil.ChangeServiceStatus(Controller, ServiceControllerStatus.Stopped, Controller.Stop); + } + + ProcessUtil.ChangeServiceStatus(Controller, ServiceControllerStatus.Running, Controller.Start); + } + + public static bool IsDtcWorking() + { + if (DoesSecurityConfigurationRequireRestart(false)) + { + return false; + } + + if (Controller.Status != ServiceControllerStatus.Running) + { + + Console.Out.WriteLine("MSDTC isn't currently running and needs to be started"); + return false; + } + + return true; + } + + static bool DoesSecurityConfigurationRequireRestart(bool doChanges) + { + Console.WriteLine("Checking if DTC is configured correctly."); + + bool needToChange; + using (var key = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\MSDTC\Security", doChanges)) + { + if (key == null) + { + throw new InvalidOperationException("MSDTC could not be found in the registry. Cannot continue."); + } + + needToChange = false; + foreach (var val in RegValues) + if ((int)key.GetValue(val) == 0) + if (doChanges) + { + Console.WriteLine( + "DTC not configured correctly. Going to fix. This will require a restart of the DTC service."); + + key.SetValue(val, 1, RegistryValueKind.DWord); + + Console.WriteLine("DTC configuration fixed."); + } + else + { + needToChange = true; + } + } + + return needToChange; + } + + static readonly ServiceController Controller = new ServiceController { ServiceName = "MSDTC", MachineName = "." }; + static readonly List RegValues = new List(new[] { "NetworkDtcAccess", "NetworkDtcAccessOutbound", "NetworkDtcAccessTransactions", "XaTransactions" }); + } +} \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/Examples/Install-PerformanceCounters.ps1 b/src/PowerShell/NServiceBus.PowerShell/Examples/Install-PerformanceCounters.ps1 index 2f22f512b3e..35f6314dd69 100644 --- a/src/PowerShell/NServiceBus.PowerShell/Examples/Install-PerformanceCounters.ps1 +++ b/src/PowerShell/NServiceBus.PowerShell/Examples/Install-PerformanceCounters.ps1 @@ -1,11 +1,11 @@ -Import-Module ..\bin\debug\nservicebus.powershell.dll - -Get-Help Install-PerformanceCounters - -#Checks the status of the NServiceBus PerformanceCounters on this box -$countersIsGood = Install-PerformanceCounters -WhatIf -"PerformanceCounters is good: " + $countersIsGood - -#Setup the NServiceBus perfcounters -$countersIsGood = Install-PerformanceCounters +Import-Module ..\..\..\..\binaries\nservicebus.powershell.dll + +Get-Help Install-NServiceBusPerformanceCounters + +#Checks the status of the NServiceBus PerformanceCounters on this box +#$countersIsGood = Install-NServiceBusPerformanceCounters -WhatIf +#"PerformanceCounters is good: " + $countersIsGood + +#Setup the NServiceBus perfcounters +$countersIsGood = Install-NServiceBusPerformanceCounters "PerformanceCounters is good: " + $countersIsGood \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/GetMessage.cs b/src/PowerShell/NServiceBus.PowerShell/GetMessage.cs index 2919b8fc771..63b6db4f717 100644 --- a/src/PowerShell/NServiceBus.PowerShell/GetMessage.cs +++ b/src/PowerShell/NServiceBus.PowerShell/GetMessage.cs @@ -1,72 +1,77 @@ -namespace NServiceBus.PowerShell -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Management.Automation; - using System.Messaging; - using System.Xml.Serialization; - - [Cmdlet("Get", "Message")] - public class GetMessage : PSCmdlet - { - [Parameter(HelpMessage = "The name of the privage queue to search")] - public string QueueName { get; set; } - - protected override void ProcessRecord() - { - var queueAddress = string.Format("FormatName:DIRECT=OS:{0}\\private$\\{1}", Environment.MachineName,QueueName); - - - var queue = new MessageQueue(queueAddress); - var mpf = new MessagePropertyFilter(); - mpf.SetAll(); - - queue.MessageReadPropertyFilter = mpf; - - var output = queue.GetAllMessages().Select(m => new - { - m.Id, - Headers = ParseHeaders(m), - m.ArrivedTime - }); - - - WriteObject(output,true); - } - - IEnumerable ParseHeaders(Message message) - { - - IEnumerable result = new List(); - - if(message.Extension.Length > 0) - { - var stream = new MemoryStream(message.Extension); - result = headerSerializer.Deserialize(stream) as IEnumerable; - } - - return result; - } - - private static readonly XmlSerializer headerSerializer = new XmlSerializer(typeof(List)); - - /// - /// Represents the structure of header information passed in a TransportMessage. - /// - [Serializable] - public class HeaderInfo - { - /// - /// The key used to lookup the value in the header collection. - /// - public string Key { get; set; } - - /// - /// The value stored under the key in the header collection. - /// - public string Value { get; set; } - } - } +namespace NServiceBus.PowerShell +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Management.Automation; + using System.Messaging; + using System.Xml; + using System.Xml.Serialization; + + [Cmdlet(VerbsCommon.Get, "NServiceBusMSMQMessage")] + public class GetMessage : PSCmdlet + { + [Parameter(HelpMessage = "The name of the private queue to search", ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)] + public string QueueName { get; set; } + + protected override void ProcessRecord() + { + var queueAddress = string.Format("FormatName:DIRECT=OS:{0}\\private$\\{1}", Environment.MachineName,QueueName); + + + var queue = new MessageQueue(queueAddress); + var mpf = new MessagePropertyFilter(); + mpf.SetAll(); + + queue.MessageReadPropertyFilter = mpf; + + var output = queue.GetAllMessages().Select(m => new + { + m.Id, + Headers = ParseHeaders(m), + m.ArrivedTime + }); + + + WriteObject(output, true); + } + + IEnumerable ParseHeaders(Message message) + { + + IEnumerable result = new List(); + + if(message.Extension.Length > 0) + { + using (var stream = new MemoryStream(message.Extension)) + using (var reader = XmlReader.Create(stream, new XmlReaderSettings { CheckCharacters = false })) + + { + result = headerSerializer.Deserialize(reader) as IEnumerable; + } + } + + return result; + } + + private static readonly XmlSerializer headerSerializer = new XmlSerializer(typeof(List)); + + /// + /// Represents the structure of header information passed in a TransportMessage. + /// + [Serializable] + public class HeaderInfo + { + /// + /// The key used to lookup the value in the header collection. + /// + public string Key { get; set; } + + /// + /// The value stored under the key in the header collection. + /// + public string Value { get; set; } + } + } } \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/GetNServiceBusLocalMachineSettings.cs b/src/PowerShell/NServiceBus.PowerShell/GetNServiceBusLocalMachineSettings.cs new file mode 100644 index 00000000000..fceec92391e --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/GetNServiceBusLocalMachineSettings.cs @@ -0,0 +1,31 @@ +namespace NServiceBus.PowerShell +{ + using System.Management.Automation; + using Microsoft.Win32; + + [Cmdlet(VerbsCommon.Get, "NServiceBusLocalMachineSettings")] + public class GetNServiceBusLocalMachineSettings : PSCmdlet + { + protected override void ProcessRecord() + { + using (var registryKey = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\ParticularSoftware\ServiceBus")) + { + if (registryKey == null) + { + WriteObject(new + { + ErrorQueue = (string) null, + AuditQueue = (string) null, + }); + return; + } + + WriteObject(new + { + ErrorQueue = (string) registryKey.GetValue("ErrorQueue"), + AuditQueue = (string) registryKey.GetValue("AuditQueue"), + }); + } + } + } +} \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/GetNServiceBusVersion.cs b/src/PowerShell/NServiceBus.PowerShell/GetNServiceBusVersion.cs index e16dd2a3d63..23d5b20dd73 100644 --- a/src/PowerShell/NServiceBus.PowerShell/GetNServiceBusVersion.cs +++ b/src/PowerShell/NServiceBus.PowerShell/GetNServiceBusVersion.cs @@ -1,24 +1,24 @@ -namespace NServiceBus.PowerShell -{ - using System; - using System.Management.Automation; - using System.Reflection; - - [Cmdlet("Get", "NServiceBusVersion")] - public class GetNServiceBusVersion : PSCmdlet - { - protected override void ProcessRecord() - { - - var appName = Assembly.GetAssembly(typeof(GetNServiceBusVersion)).Location; - var assembyVersion = AssemblyName.GetAssemblyName(appName).Version; - - //build a semver compliant version - var version = new Version(assembyVersion.Major, assembyVersion.Minor,assembyVersion.Build); - - - WriteObject(version); - } - } - +namespace NServiceBus.PowerShell +{ + using System; + using System.Management.Automation; + using System.Reflection; + + [Cmdlet(VerbsCommon.Get, "NServiceBusVersion")] + public class GetNServiceBusVersion : PSCmdlet + { + protected override void ProcessRecord() + { + + var appName = Assembly.GetAssembly(typeof(GetNServiceBusVersion)).Location; + var assemblyVersion = AssemblyName.GetAssemblyName(appName).Version; + + //build a semver compliant version + var version = new Version(assemblyVersion.Major, assemblyVersion.Minor,assemblyVersion.Build); + + + WriteObject(version); + } + } + } \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/InstallDtc.cs b/src/PowerShell/NServiceBus.PowerShell/InstallDtc.cs index 267114eeb1d..d464010955d 100644 --- a/src/PowerShell/NServiceBus.PowerShell/InstallDtc.cs +++ b/src/PowerShell/NServiceBus.PowerShell/InstallDtc.cs @@ -1,29 +1,32 @@ -namespace NServiceBus.PowerShell -{ - using System; - using System.Management.Automation; - using Setup.Windows.Dtc; - - [Cmdlet(VerbsLifecycle.Install, "Dtc", SupportsShouldProcess = true)] - public class InstallDtc : CmdletBase - { - protected override void Process() - { - bool dtcIsGood; - if (!ShouldProcess(Environment.MachineName)) - { - dtcIsGood = DtcSetup.StartDtcIfNecessary(); - Host.UI.WriteLine(dtcIsGood - ? "DTC is setup and ready for use with NServiceBus" - : "DTC is not properly configured"); - - WriteObject(dtcIsGood); - return; - } - - dtcIsGood = DtcSetup.StartDtcIfNecessary(true); - - WriteObject(dtcIsGood); - } - } -} +namespace NServiceBus.PowerShell +{ + using System; + using System.Management.Automation; + using Setup.Windows.Dtc; + + [Cmdlet(VerbsLifecycle.Install, "NServiceBusDTC", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)] + public class InstallDtc : CmdletBase + { + protected override void ProcessRecord() + { + if (ShouldProcess(Environment.MachineName)) + { + DtcSetup.StartDtcIfNecessary(); + } + } + } + + [Cmdlet(VerbsDiagnostic.Test, "NServiceBusDTCInstallation")] + public class ValidateDtc : CmdletBase + { + protected override void ProcessRecord() + { + var dtcIsGood = DtcSetup.IsDtcWorking(); + WriteVerbose(dtcIsGood + ? "DTC is setup and ready for use with NServiceBus." + : "DTC is not properly configured."); + + WriteObject(dtcIsGood); + } + } +} diff --git a/src/PowerShell/NServiceBus.PowerShell/InstallLicense.cs b/src/PowerShell/NServiceBus.PowerShell/InstallLicense.cs index 6e2c9a4e5b5..34cf391d977 100644 --- a/src/PowerShell/NServiceBus.PowerShell/InstallLicense.cs +++ b/src/PowerShell/NServiceBus.PowerShell/InstallLicense.cs @@ -1,46 +1,71 @@ -namespace NServiceBus.PowerShell -{ - using System; - using System.IO; - using System.Management.Automation; - using System.Reflection; - using Microsoft.Win32; - - [Cmdlet(VerbsLifecycle.Install, "License")] - public class InstallLicense : PSCmdlet - { - [Parameter(Mandatory = true, HelpMessage = "License file path")] - public string Path { get; set; } - - protected override void ProcessRecord() - { - string selectedLicenseText = ReadAllTextWithoutLocking(Path); - - using (var registryKey = Registry.CurrentUser.CreateSubKey(String.Format(@"SOFTWARE\NServiceBus\{0}", GetNServiceBusVersion().ToString(2)))) - { - if (registryKey == null) - { - Host.UI.WriteErrorLine("License file could not be installed."); - return; - } - registryKey.SetValue("License", selectedLicenseText, RegistryValueKind.String); - } - } - - static string ReadAllTextWithoutLocking(string path) - { - using (var fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) - using (var textReader = new StreamReader(fileStream)) - { - return textReader.ReadToEnd(); - } - } - - static Version GetNServiceBusVersion() - { - var assembyVersion = Assembly.GetExecutingAssembly().GetName().Version; - - return new Version(assembyVersion.Major, assembyVersion.Minor); - } - } +namespace NServiceBus.PowerShell +{ + using System; + using System.IO; + using System.Management.Automation; + using System.Reflection; + using System.Security; + using Microsoft.Win32; + + [Cmdlet(VerbsLifecycle.Install, "NServiceBusLicense")] + public class InstallLicense : PSCmdlet + { + [Parameter(Mandatory = true, Position = 0, HelpMessage = "License file path", ValueFromPipeline = true)] + public string Path { get; set; } + + [Parameter(Mandatory = false, HelpMessage = @"Installs license in HKEY_CURRENT_USER\SOFTWARE\NServiceBus, by default if not specified the license is installed in HKEY_LOCAL_MACHINE\SOFTWARE\NServiceBus")] + public bool UseHKCU { get; set; } + + protected override void ProcessRecord() + { + string selectedLicenseText = ReadAllTextWithoutLocking(Path); + + if (Environment.Is64BitOperatingSystem) + { + TryToWriteToRegistry(selectedLicenseText, RegistryView.Registry32); + + TryToWriteToRegistry(selectedLicenseText, RegistryView.Registry64); + } + else + { + TryToWriteToRegistry(selectedLicenseText, RegistryView.Default); + } + } + + void TryToWriteToRegistry(string selectedLicenseText, RegistryView view) + { + var rootKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, view); + + if (UseHKCU) + { + rootKey = RegistryKey.OpenBaseKey(RegistryHive.CurrentUser, view); + } + + using (var registryKey = rootKey.CreateSubKey(String.Format(@"SOFTWARE\NServiceBus\{0}", GetNServiceBusVersion().ToString(2)))) + { + if (registryKey == null) + { + ThrowTerminatingError(new ErrorRecord(new SecurityException("License file could not be installed."), "NotAuthorized", ErrorCategory.SecurityError, null)); + } + + registryKey.SetValue("License", selectedLicenseText, RegistryValueKind.String); + } + } + + static string ReadAllTextWithoutLocking(string path) + { + using (var fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) + using (var textReader = new StreamReader(fileStream)) + { + return textReader.ReadToEnd(); + } + } + + static Version GetNServiceBusVersion() + { + var assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version; + + return new Version(assemblyVersion.Major, assemblyVersion.Minor); + } + } } \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/InstallMsmq.cs b/src/PowerShell/NServiceBus.PowerShell/InstallMsmq.cs index 5427d6b987e..5a3ffcaf248 100644 --- a/src/PowerShell/NServiceBus.PowerShell/InstallMsmq.cs +++ b/src/PowerShell/NServiceBus.PowerShell/InstallMsmq.cs @@ -1,34 +1,42 @@ -namespace NServiceBus.PowerShell -{ - using System; - using System.Management.Automation; - using Setup.Windows.Msmq; - - [Cmdlet(VerbsLifecycle.Install, "Msmq", SupportsShouldProcess = true)] - public class InstallMsmq : CmdletBase - { - public SwitchParameter Force { get; set; } - - protected override void Process() - { - bool msmqIsGood; - if (!ShouldProcess(Environment.MachineName)) - { - msmqIsGood = MsmqSetup.IsInstallationGood(); - Host.UI.WriteLine(msmqIsGood - ? "Msmq is installed and setup for use with NServiceBus" - : "Msmq is not installed"); - - WriteObject(msmqIsGood); - return; - } - - msmqIsGood = MsmqSetup.StartMsmqIfNecessary(Force); - - if (!msmqIsGood && !Force) - WriteWarning("Msmq needs to reinstalled, Please rerun the command with -Force set. NOTE: This will remove all local queues!"); - - WriteObject(msmqIsGood); - } - } -} +namespace NServiceBus.PowerShell +{ + using System; + using System.Management.Automation; + using Setup.Windows.Msmq; + + [Cmdlet(VerbsLifecycle.Install, "NServiceBusMSMQ", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.High)] + public class InstallMsmq : CmdletBase + { + [Parameter(Mandatory = false, HelpMessage = "Force reinstall of MSMQ")] + public SwitchParameter Force { get; set; } + + protected override void ProcessRecord() + { + if (ShouldProcess(Environment.MachineName)) + { + bool msmqIsGood = MsmqSetup.StartMsmqIfNecessary(Force); + + if (!msmqIsGood && !Force) + { + WriteWarning( + "Msmq needs to be reinstalled. Please re-run the command with -Force set. NOTE: This will remove all local queues!"); + } + } + } + } + + [Cmdlet(VerbsDiagnostic.Test, "NServiceBusMSMQInstallation")] + public class ValidateMsmq : CmdletBase + { + protected override void ProcessRecord() + { + var msmqIsGood = MsmqSetup.IsInstallationGood(); + + WriteVerbose(msmqIsGood + ? "MSMQ is installed and setup for use with NServiceBus." + : "MSMQ is not installed."); + + WriteObject(msmqIsGood); + } + } +} diff --git a/src/PowerShell/NServiceBus.PowerShell/InstallPerformanceCounters.cs b/src/PowerShell/NServiceBus.PowerShell/InstallPerformanceCounters.cs index db39dc397dc..47752125f14 100644 --- a/src/PowerShell/NServiceBus.PowerShell/InstallPerformanceCounters.cs +++ b/src/PowerShell/NServiceBus.PowerShell/InstallPerformanceCounters.cs @@ -1,30 +1,33 @@ -namespace NServiceBus.PowerShell -{ - using System; - using System.Management.Automation; - using Setup.Windows.PerformanceCounters; - - [Cmdlet(VerbsLifecycle.Install, "PerformanceCounters", SupportsShouldProcess = true)] - public class InstallPerformanceCounters : CmdletBase - { - protected override void Process() - { - bool coutersIsGood; - if (!ShouldProcess(Environment.MachineName)) - { - coutersIsGood = PerformanceCounterSetup.SetupCounters(); - - Host.UI.WriteLine(coutersIsGood - ? "Performance Counters is setup and ready for use with NServiceBus" - : "Performance Counters is not properly configured"); - - WriteObject(coutersIsGood); - return; - } - - coutersIsGood = PerformanceCounterSetup.SetupCounters(true); - - WriteObject(coutersIsGood); - } - } -} +namespace NServiceBus.PowerShell +{ + using System; + using System.Management.Automation; + using Setup.Windows.PerformanceCounters; + + [Cmdlet(VerbsLifecycle.Install, "NServiceBusPerformanceCounters", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)] + public class InstallPerformanceCounters : CmdletBase + { + protected override void ProcessRecord() + { + if (ShouldProcess(Environment.MachineName)) + { + PerformanceCounterSetup.SetupCounters(); + } + } + } + + [Cmdlet(VerbsDiagnostic.Test, "NServiceBusPerformanceCountersInstallation")] + public class ValidatePerformanceCounters : CmdletBase + { + protected override void ProcessRecord() + { + var countersAreGood = PerformanceCounterSetup.CheckCounters(); + + WriteVerbose(countersAreGood + ? "NServiceBus Performance Counters are setup and ready for use with NServiceBus." + : "NServiceBus Performance Counters are not properly configured."); + + WriteObject(countersAreGood); + } + } +} diff --git a/src/PowerShell/NServiceBus.PowerShell/InstallRavenDB.cs b/src/PowerShell/NServiceBus.PowerShell/InstallRavenDB.cs index 13dad159ad3..5f8b4011518 100644 --- a/src/PowerShell/NServiceBus.PowerShell/InstallRavenDB.cs +++ b/src/PowerShell/NServiceBus.PowerShell/InstallRavenDB.cs @@ -1,29 +1,38 @@ -namespace NServiceBus.PowerShell -{ - using System; - using System.Management.Automation; - - [Cmdlet(VerbsLifecycle.Install, "RavenDB", SupportsShouldProcess = true)] - public class InstallRavenDB : CmdletBase - { - [Parameter(HelpMessage = "Port number to be used, Default: 8080")] - public int Port { get; set; } - - [Parameter(HelpMessage = "Path to install RavenDB into, default is %ProgramFiles%\\NServiceBus.Persistence")] - public string Path { get; set; } - - protected override void Process() - { - if (Port == 0) - { - Port = 8080; - } - - var setup = new Setup.Windows.RavenDB.RavenDBSetup(); - - var isGood = setup.Install(null, Port, Path, ShouldProcess(Environment.MachineName)); - - WriteObject(isGood); - } - } -} +namespace NServiceBus.PowerShell +{ + using System; + using System.Management.Automation; + using Setup.Windows.RavenDB; + + [Cmdlet(VerbsLifecycle.Install, "NServiceBusRavenDB", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.Medium)] + public class InstallRavenDB : CmdletBase + { + [Parameter(HelpMessage = "Port number to be used, default is 8080", ValueFromPipelineByPropertyName = true)] + public int Port { get; set; } + + [Parameter(HelpMessage = "Path to install RavenDB into, default is %ProgramFiles%\\NServiceBus.Persistence.v4", ValueFromPipelineByPropertyName = true)] + public string Path { get; set; } + + protected override void ProcessRecord() + { + if (ShouldProcess(Environment.MachineName)) + { + RavenDBSetup.Install(Port, Path); + } + } + } + + [Cmdlet(VerbsDiagnostic.Test, "NServiceBusRavenDBInstallation")] + public class ValidateRavenDB : CmdletBase + { + [Parameter(HelpMessage = "Port number to be used, default is 8080", ValueFromPipelineByPropertyName = true)] + public int Port { get; set; } + + protected override void ProcessRecord() + { + var isGood = RavenDBSetup.Check(Port); + + WriteObject(isGood); + } + } +} diff --git a/src/PowerShell/NServiceBus.PowerShell/Msmq/MsmqSetup.cs b/src/PowerShell/NServiceBus.PowerShell/Msmq/MsmqSetup.cs new file mode 100644 index 00000000000..5c3de56787c --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/Msmq/MsmqSetup.cs @@ -0,0 +1,326 @@ +namespace NServiceBus.Setup.Windows.Msmq +{ + using System; + using System.Collections.Generic; + using System.Diagnostics; + using System.IO; + using System.Runtime.InteropServices; + using System.ServiceProcess; + using Microsoft.Win32; + + /// + /// Utility class for starting and installing MSMQ. + /// + public static class MsmqSetup + { + /// + /// Checks that MSMQ is installed, configured correctly, and started, and if not + /// takes the necessary corrective actions to make it so. + /// + public static bool StartMsmqIfNecessary(bool allowReinstall = false) + { + if(!InstallMsmqIfNecessary(allowReinstall)) + { + return false; + } + + var controller = new ServiceController { ServiceName = "MSMQ", MachineName = "." }; + + if (IsStopped(controller)) + { + ProcessUtil.ChangeServiceStatus(controller, ServiceControllerStatus.Running, controller.Start); + } + + return true; + } + + private static bool IsStopped(ServiceController controller) + { + return controller.Status == ServiceControllerStatus.Stopped || controller.Status == ServiceControllerStatus.StopPending; + } + + private static bool IsMsmqInstalled() + { + var dll = LoadLibraryW("Mqrt.dll"); + return (dll != IntPtr.Zero); + } + + /// + /// Determines if the msmq installation on the current machine is ok + /// + /// + public static bool IsInstallationGood() + { + var msmqSetup = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\MSMQ\Setup"); + if (msmqSetup == null) + return false; + + var installedComponents = new List(msmqSetup.GetValueNames()); + msmqSetup.Close(); + + return HasOnlyNeededComponents(installedComponents); + } + + private static bool InstallMsmqIfNecessary(bool allowReinstall) + { + Console.WriteLine("Checking if MSMQ is installed."); + + var os = GetOperatingSystem(); + Func process = null; + + if (IsMsmqInstalled()) + { + Console.WriteLine("MSMQ is installed."); + Console.WriteLine("Checking that only needed components are active."); + + if (IsInstallationGood()) + { + Console.WriteLine("Installation is good."); + return true; + } + + Console.WriteLine("Installation isn't good."); + + if (!allowReinstall) + { + return false; + } + + Console.WriteLine("Going to re-install MSMQ. A reboot may be required."); + + switch (os) + { + case OperatingSystemEnum.XpOrServer2003: + process = InstallMsmqOnXpOrServer2003; + break; + + case OperatingSystemEnum.Vista: + process = () => Process.Start(OcSetup, OcSetupVistaUninstallCommand); + break; + + case OperatingSystemEnum.Windows7: + case OperatingSystemEnum.Windows8: + case OperatingSystemEnum.Server2008: + process = () => Process.Start(OcSetup, OcSetupUninstallCommand); + break; + + case OperatingSystemEnum.Server2012: + process = () => Process.Start(Powershell, PowershellUninstallCommand); + break; + + default: + Console.WriteLine("OS not supported."); + break; + } + + Console.WriteLine("Uninstalling MSMQ."); + RunSetup(process); + } + else + { + Console.WriteLine("MSMQ is not installed. Going to install."); + } + + switch (os) + { + case OperatingSystemEnum.XpOrServer2003: + process = InstallMsmqOnXpOrServer2003; + break; + + case OperatingSystemEnum.Vista: + process = () => Process.Start(OcSetup, OcSetupVistaInstallCommand); + break; + + case OperatingSystemEnum.Windows7: + case OperatingSystemEnum.Windows8: + case OperatingSystemEnum.Server2008: + process = () => Process.Start(OcSetup, OcSetupInstallCommand); + break; + + case OperatingSystemEnum.Server2012: + process = () => Process.Start(Powershell, PowershellInstallCommand); + break; + + default: + Console.WriteLine("OS not supported."); + break; + } + + RunSetup(process); + + Console.WriteLine("Installation of MSMQ successful."); + + return true; + } + + private static void RunSetup(Func action) + { + using (var process = action()) + { + if (process == null) return; + + Console.WriteLine("Waiting for process to complete."); + process.WaitForExit(); + } + } + + private static Process InstallMsmqOnXpOrServer2003() + { + var p = Path.GetTempFileName(); + + Console.WriteLine("Creating installation instruction file."); + + using (var sw = File.CreateText(p)) + { + sw.WriteLine("[Version]"); + sw.WriteLine("Signature = \"$Windows NT$\""); + sw.WriteLine(); + sw.WriteLine("[Global]"); + sw.WriteLine("FreshMode = Custom"); + sw.WriteLine("MaintenanceMode = RemoveAll"); + sw.WriteLine("UpgradeMode = UpgradeOnly"); + sw.WriteLine(); + sw.WriteLine("[Components]"); + + foreach (var s in RequiredMsmqComponentsXp) + sw.WriteLine(s + " = ON"); + + foreach (var s in UndesirableMsmqComponentsXp) + sw.WriteLine(s + " = OFF"); + + sw.Flush(); + } + + Console.WriteLine("Installation instruction file created."); + Console.WriteLine("Invoking MSMQ installation."); + + return Process.Start("sysocmgr", "/i:sysoc.inf /x /q /w /u:%temp%\\" + Path.GetFileName(p)); + } + + // Based on http://msdn.microsoft.com/en-us/library/windows/desktop/ms724833(v=vs.85).aspx + private static OperatingSystemEnum GetOperatingSystem() + { + var osvi = new OSVersionInfoEx {OSVersionInfoSize = (UInt32) Marshal.SizeOf(typeof (OSVersionInfoEx))}; + + GetVersionEx(osvi); + + switch (Environment.OSVersion.Version.Major) + { + case 6: + switch (Environment.OSVersion.Version.Minor) + { + case 0: + + if (osvi.ProductType == VER_NT_WORKSTATION) + { + return OperatingSystemEnum.Vista; + } + + return OperatingSystemEnum.Server2008; + + case 1: + if (osvi.ProductType == VER_NT_WORKSTATION) + { + return OperatingSystemEnum.Windows7; + } + + return OperatingSystemEnum.Server2008; + + case 2: + if (osvi.ProductType == VER_NT_WORKSTATION) + { + return OperatingSystemEnum.Windows8; + } + + return OperatingSystemEnum.Server2012; + } + break; + + case 5: + return OperatingSystemEnum.XpOrServer2003; + } + + return OperatingSystemEnum.DontCare; + } + + private static bool HasOnlyNeededComponents(IEnumerable installedComponents) + { + var needed = new List(RequiredMsmqComponentsXp); + + foreach (var i in installedComponents) + { + if (UndesirableMsmqComponentsXp.Contains(i)) + { + Console.WriteLine("Undesirable MSMQ component installed: " + i); + return false; + } + + if (UndesirableMsmqComponentsV4.Contains(i)) + { + Console.WriteLine("Undesirable MSMQ component installed: " + i); + return false; + } + + needed.Remove(i); + } + + if (needed.Count == 0) + return true; + + return false; + } + + /// Return Type: HMODULE->HINSTANCE->HINSTANCE__* + ///lpLibFileName: LPCWSTR->WCHAR* + [DllImportAttribute("kernel32.dll", EntryPoint = "LoadLibraryW")] + static extern IntPtr LoadLibraryW([InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string lpLibFileName); + + + [DllImport("Kernel32", CharSet = CharSet.Auto)] + static extern Boolean GetVersionEx([Out][In]OSVersionInfo versionInformation); + + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + class OSVersionInfoEx : OSVersionInfo + { + public UInt16 ServicePackMajor; + public UInt16 ServicePackMinor; + public UInt16 SuiteMask; + public byte ProductType; + public byte Reserved; + } + + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] + class OSVersionInfo + { + public UInt32 OSVersionInfoSize = + (UInt32)Marshal.SizeOf(typeof(OSVersionInfo)); + public UInt32 MajorVersion = 0; + public UInt32 MinorVersion = 0; + public UInt32 BuildNumber = 0; + public UInt32 PlatformId = 0; + // Attribute used to indicate marshalling for String field + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] + public String CSDVersion = null; + } + + const byte VER_NT_WORKSTATION = 1; + const byte VER_NT_SERVER = 3; + + static readonly List RequiredMsmqComponentsXp = new List(new[] { "msmq_Core", "msmq_LocalStorage" }); + static readonly List UndesirableMsmqComponentsXp = new List(new[] { "msmq_ADIntegrated", "msmq_TriggersService", "msmq_HTTPSupport", "msmq_RoutingSupport", "msmq_MQDSService" }); + static readonly List UndesirableMsmqComponentsV4 = new List(new[] { "msmq_DCOMProxy", "msmq_MQDSServiceInstalled", "msmq_MulticastInstalled", "msmq_RoutingInstalled", "msmq_TriggersInstalled" }); + + enum OperatingSystemEnum { DontCare, XpOrServer2003, Vista, Server2008, Windows7, Windows8, Server2012 } + + const string OcSetup = "OCSETUP"; + const string Powershell = "PowerShell"; + const string OcSetupInstallCommand = "MSMQ-Server /passive"; + const string OcSetupUninstallCommand = "MSMQ-Server /passive /uninstall"; + const string OcSetupVistaInstallCommand = "MSMQ-Container;MSMQ-Server /passive"; + const string OcSetupVistaUninstallCommand = "MSMQ-Container;MSMQ-Server /passive /uninstall"; + const string PowershellInstallCommand = @"-Command ""& {Install-WindowsFeature –Name MSMQ-Server}"""; + const string PowershellUninstallCommand = @"-Command ""& {Uninstall-WindowsFeature –Name MSMQ-Server}"""; + + } +} diff --git a/src/PowerShell/NServiceBus.PowerShell/NServiceBus.PowerShell.csproj b/src/PowerShell/NServiceBus.PowerShell/NServiceBus.PowerShell.csproj index 4f7897b60ca..ac243abf453 100644 --- a/src/PowerShell/NServiceBus.PowerShell/NServiceBus.PowerShell.csproj +++ b/src/PowerShell/NServiceBus.PowerShell/NServiceBus.PowerShell.csproj @@ -1,80 +1,108 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {5E51EFBF-329F-4D3A-B86E-CC111697746F} - Library - Properties - NServiceBus.PowerShell - NServiceBus.PowerShell - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - False - ..\..\..\lib\System.Management.Automation.dll - - - - - - - - - - - - - - - - - - - - - - {54dab047-c30d-4507-a304-766ddd29bb28} - NServiceBus.Setup.Windows - - - - - - - - - - - - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {5E51EFBF-329F-4D3A-B86E-CC111697746F} + Library + true + ..\..\NServiceBus.snk + Properties + NServiceBus.PowerShell + NServiceBus.PowerShell + v4.0 + 512 + ..\..\..\ + true + + + true + full + false + ..\..\..\binaries\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\..\..\binaries\ + TRACE + prompt + 4 + + + + + + + + False + ..\..\..\lib\System.Management.Automation.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + false + + + + + + + + + + + + PreserveNewest + + + + \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/PerformanceCounters/PerformanceCounterSetup.cs b/src/PowerShell/NServiceBus.PowerShell/PerformanceCounters/PerformanceCounterSetup.cs new file mode 100644 index 00000000000..bb7383b410a --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/PerformanceCounters/PerformanceCounterSetup.cs @@ -0,0 +1,75 @@ +namespace NServiceBus.Setup.Windows.PerformanceCounters +{ + using System; + using System.ComponentModel; + using System.Diagnostics; + + public class PerformanceCounterSetup + { + const string categoryName = "NServiceBus"; + + public static bool CheckCounters() + { + if (PerformanceCounterCategory.Exists(categoryName)) + { + bool needToRecreateCategory = false; + + foreach (CounterCreationData counter in Counters) + { + if (!PerformanceCounterCategory.CounterExists(counter.CounterName, categoryName)) + { + needToRecreateCategory = true; + } + + } + + if (!needToRecreateCategory) + { + return true; + } + } + + return false; + } + + public static void SetupCounters() + { + try + { + PerformanceCounterCategory.Delete(categoryName); + } + catch (Win32Exception) + { + //Making sure this won't stop the process. + } + catch (Exception) + { + //Ignore exception. + //We need to ensure that we attempt to delete category before recreating it. + } + + PerformanceCounterCategory.Create(categoryName, "NServiceBus statistics", + PerformanceCounterCategoryType.MultiInstance, Counters); + PerformanceCounter.CloseSharedResources(); // http://blog.dezfowler.com/2007/08/net-performance-counter-problems.html + } + + static readonly CounterCreationDataCollection Counters = new CounterCreationDataCollection + { + new CounterCreationData("Critical Time", + "Age of the oldest message in the queue.", + PerformanceCounterType.NumberOfItems32), + new CounterCreationData("SLA violation countdown", + "Seconds until the SLA for this endpoint is breached.", + PerformanceCounterType.NumberOfItems32), + new CounterCreationData("# of msgs successfully processed / sec", + "The current number of messages processed successfully by the transport per second.", + PerformanceCounterType.RateOfCountsPerSecond32), + new CounterCreationData("# of msgs pulled from the input queue /sec", + "The current number of messages pulled from the input queue by the transport per second.", + PerformanceCounterType.RateOfCountsPerSecond32), + new CounterCreationData("# of msgs failures / sec", + "The current number of failed processed messages by the transport per second.", + PerformanceCounterType.RateOfCountsPerSecond32) + }; + } +} \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/PortUtils.cs b/src/PowerShell/NServiceBus.PowerShell/PortUtils.cs new file mode 100644 index 00000000000..70350ce3257 --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/PortUtils.cs @@ -0,0 +1,36 @@ +namespace NServiceBus.PowerShell +{ + using System.Linq; + using System.Net.NetworkInformation; + + public class PortUtils + { + public static int FindAvailablePort(int startPort) + { + var activeTcpListeners = IPGlobalProperties + .GetIPGlobalProperties() + .GetActiveTcpListeners(); + + for (var port = startPort; port < startPort + 1024; port++) + { + var portCopy = port; + if (activeTcpListeners.All(endPoint => endPoint.Port != portCopy)) + { + return port; + } + } + + return startPort; + } + + public static bool IsPortAvailable(int port) + { + var activeTcpListeners = IPGlobalProperties + .GetIPGlobalProperties() + .GetActiveTcpListeners(); + + + return !activeTcpListeners.Any(ip => ip.Port == port); + } + } +} \ No newline at end of file diff --git a/src/Setup/NServiceBus.Setup.Windows/ProcessUtil.cs b/src/PowerShell/NServiceBus.PowerShell/ProcessUtil.cs similarity index 97% rename from src/Setup/NServiceBus.Setup.Windows/ProcessUtil.cs rename to src/PowerShell/NServiceBus.PowerShell/ProcessUtil.cs index b78f76ca5aa..ccf009dd6e4 100644 --- a/src/Setup/NServiceBus.Setup.Windows/ProcessUtil.cs +++ b/src/PowerShell/NServiceBus.PowerShell/ProcessUtil.cs @@ -1,20 +1,20 @@ namespace NServiceBus.Setup.Windows -{ - using System; - using System.Security.Principal; - using System.ServiceProcess; - using System.ComponentModel; - +{ + using System; + using System.Security.Principal; + using System.ServiceProcess; + using System.ComponentModel; + /// /// Utility class for changing a windows service's status. /// public static class ProcessUtil { - public static bool IsRunningWithElevatedPriviliges() - { - return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator); - } - + public static bool IsRunningWithElevatedPrivileges() + { + return new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator); + } + /// /// Checks the status of the given controller, and if it isn't the requested state, /// performs the given action, and checks the state again. @@ -70,4 +70,4 @@ private static void ThrowUnableToChangeStatus(string serviceName, ServiceControl throw new InvalidOperationException(message, exception); } } -} \ No newline at end of file +} diff --git a/src/PowerShell/NServiceBus.PowerShell/Properties/AssemblyInfo.cs b/src/PowerShell/NServiceBus.PowerShell/Properties/AssemblyInfo.cs index ec266bd2149..180eea3c43d 100644 --- a/src/PowerShell/NServiceBus.PowerShell/Properties/AssemblyInfo.cs +++ b/src/PowerShell/NServiceBus.PowerShell/Properties/AssemblyInfo.cs @@ -1,11 +1,18 @@ -using System; -using System.Reflection; - -[assembly: AssemblyTitle("NServiceBus.PowerShell")] -[assembly: AssemblyVersion("3.0.0.0")] -[assembly: AssemblyFileVersion("3.0.2.0")] -[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2007-2011")] -[assembly: AssemblyProduct("NServiceBus")] -[assembly: AssemblyCompany("NServiceBus")] -[assembly: AssemblyInformationalVersion("3.0.2-build0")] -[assembly: CLSCompliantAttribute(true)] \ No newline at end of file +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("NServiceBus.PowerShell")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyProduct("NServiceBus")] +[assembly: AssemblyCompany("NServiceBus")] +[assembly: AssemblyConfiguration("release")] +[assembly: AssemblyInformationalVersion("4.0.0-alpha0")] +[assembly: ComVisible(false)] +[assembly: CLSCompliantAttribute(false)] + diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenDB/RavenDBSetup.cs b/src/PowerShell/NServiceBus.PowerShell/RavenDB/RavenDBSetup.cs new file mode 100644 index 00000000000..31d4459745c --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/RavenDB/RavenDBSetup.cs @@ -0,0 +1,275 @@ +namespace NServiceBus.Setup.Windows.RavenDB +{ + using System; + using System.Diagnostics; + using System.Globalization; + using System.IO; + using System.Linq; + using System.Net; + using System.ServiceProcess; + using System.Xml; + using Microsoft.Win32; + using Persistence.Raven.Installation; + using PowerShell; + + public class RavenDBSetup + { + public const int DefaultPort = 8080; + + public static bool Check(int port = 0) + { + if (port == 0) + { + port = DefaultPort; + } + + var url = String.Format("http://localhost:{0}", port); + + Console.Out.WriteLine("Checking if Raven is listening on {0}.", url); + + var result = IsRavenDBv2RunningOn(port); + + return result; + } + + public static int FindRavenDBPort() + { + var port = ReadRavenPortFromRegistry(); + + if (port == 0) + port = DefaultPort; + + if (Check(port)) + return port; + + return 0; + } + + + private static bool IsRavenDBv2RunningOn(int port) + { + var webRequest = WebRequest.Create(String.Format("http://localhost:{0}", port)); + webRequest.Timeout = 2000; + + try + { + var webResponse = webRequest.GetResponse(); + var serverBuildHeader = webResponse.Headers["Raven-Server-Build"]; + + if (serverBuildHeader == null) + { + return false; + } + + int serverBuild; + + if (!int.TryParse(serverBuildHeader, out serverBuild)) + { + return false; + } + + return serverBuild >= 2000;//at least raven v2 + } + catch (Exception) + { + return false; + } + } + + public static void Install(int port = 0, string installPath = null) + { + if (string.IsNullOrEmpty(installPath)) + installPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles).Replace(" (x86)", String.Empty), DefaultDirectoryName); + + if (Directory.Exists(installPath)) + { + Console.Out.WriteLine("Path '{0}' already exists please update RavenDB manually if needed.", installPath); + return; + } + + var serviceName = "RavenDB"; + + var service = ServiceController.GetServices().FirstOrDefault(s => s.ServiceName == serviceName); + if(service != null) + { + Console.Out.WriteLine("There is already a RavenDB service installed on this computer, the RavenDB service status is {0}.", service.Status); + + if (IsRavenDBv2RunningOn(8080)) //todo: we can improve this in the future by looking into the config file to try to figure out the port + { + Console.Out.WriteLine("Existing Raven is v2, NServiceBus will be configured to use it"); + + SavePortToBeUsedForRavenInRegistry(8080); + + return; + } + + serviceName = serviceName + "-v2"; + + } + + int availablePort; + + //Check if the port is available, if so let the installer setup raven if its being run + if (port > 0) + { + availablePort = PortUtils.FindAvailablePort(port); + if (availablePort != port) + { + if (IsRavenDBv2RunningOn(port)) + { + Console.Out.WriteLine("A compatible(v2) version of Raven has been found on port {0} and will be used", port); + + SavePortToBeUsedForRavenInRegistry(port); + } + else + { + Console.Out.WriteLine("Port '{0}' isn't available, please specify a different port and rerun the command.", port); + } + + return; + } + } + else + { + availablePort = PortUtils.FindAvailablePort(DefaultPort); + + //is there already a Raven2 on the default port? + if (availablePort != DefaultPort && IsRavenDBv2RunningOn(DefaultPort)) + { + Console.Out.WriteLine("A compatible(v2) version of Raven has been found on port {0} and will be used", DefaultPort); + + SavePortToBeUsedForRavenInRegistry(DefaultPort); + return; + } + } + + if (!RavenHelpers.EnsureCanListenToWhenInNonAdminContext(availablePort)) + { + Console.WriteLine("Failed to grant rights for listening to http on port {0}, please specify a different port and rerun the command.", availablePort); + return; + } + + if (!Directory.Exists(installPath)) + { + Directory.CreateDirectory(installPath); + } + + Console.WriteLine("Unpacking resources..."); + + ExportRavenResources(installPath); + + var ravenConfigPath = Path.Combine(installPath, "Raven.Server.exe.config"); + var ravenConfig = new XmlDocument(); + + ravenConfig.Load(ravenConfigPath); + + var key = (XmlElement) ravenConfig.DocumentElement.SelectSingleNode("//add[@key='Raven/Port']"); + + key.SetAttribute("value", availablePort.ToString(CultureInfo.InvariantCulture)); + + ravenConfig.Save(ravenConfigPath); + Console.Out.WriteLine("Updated Raven configuration to use port {0}.", availablePort); + + SavePortToBeUsedForRavenInRegistry(availablePort); + + Console.WriteLine("Installing RavenDB as a windows service."); + + var startInfo = new ProcessStartInfo + { + CreateNoWindow = true, + UseShellExecute = false, + RedirectStandardOutput = true, + WorkingDirectory = installPath, + Arguments = "--install --service-name=" + serviceName, + FileName = Path.Combine(installPath, "Raven.Server.exe") + }; + + using (var process = Process.Start(startInfo)) + { + process.WaitForExit(20000); + + var line = process.StandardOutput.ReadToEnd(); + Console.WriteLine(line); + + if (process.ExitCode != 0) + { + Console.WriteLine("The RavenDB service failed to start, Raven.Server.exe exit code was {0}.", process.ExitCode); + return; + } + } + + Console.WriteLine("{0} service started, listening on port: {1}",serviceName,availablePort); + } + + public static void ExportRavenResources(string directoryPath) + { + var assembly = typeof (RavenDBSetup).Assembly; + var enumerable = assembly.GetManifestResourceNames().Where(x => x.Contains("RavenResources")); + foreach (var resourceName in enumerable) + { + using (var resourceStream = assembly.GetManifestResourceStream(resourceName)) + { + var fileName = resourceName.Replace(assembly.GetName().Name + ".RavenResources.", ""); + var destinationPath = Path.Combine(directoryPath, fileName); + Console.WriteLine("Unpacking '{0}' to '{1}'...", fileName, destinationPath); + using (Stream file = File.OpenWrite(destinationPath)) + { + resourceStream.CopyTo(file); + file.Flush(); + } + } + } + } + + private static void SavePortToBeUsedForRavenInRegistry(int availablePort) + { + if (Environment.Is64BitOperatingSystem) + { + WriteRegistry(availablePort, RegistryView.Registry32); + + WriteRegistry(availablePort, RegistryView.Registry64); + } + else + { + WriteRegistry(availablePort, RegistryView.Default); + } + } + + static int ReadRavenPortFromRegistry() + { + object portValue = null; + + if (Environment.Is64BitOperatingSystem) + { + portValue = ReadRegistry(RegistryView.Registry32) ?? ReadRegistry(RegistryView.Registry64); + } + else + { + portValue = ReadRegistry(RegistryView.Default); + } + + if (portValue == null) + return 0; + + return (int)portValue; + } + + static void WriteRegistry(int availablePort, RegistryView view) + { + using (var key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, view).CreateSubKey(@"SOFTWARE\ParticularSoftware\ServiceBus")) + { + key.SetValue("RavenPort", availablePort, RegistryValueKind.DWord); + } + } + + static object ReadRegistry(RegistryView view) + { + using (var key = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, view).CreateSubKey(@"SOFTWARE\ParticularSoftware\ServiceBus")) + { + return key.GetValue("RavenPort"); + } + } + + const string DefaultDirectoryName = "NServiceBus.Persistence.v4"; + } +} \ No newline at end of file diff --git a/src/Setup/NServiceBus.Setup.Windows/RavenDB/RavenHelpers.cs b/src/PowerShell/NServiceBus.PowerShell/RavenDB/RavenHelpers.cs similarity index 90% rename from src/Setup/NServiceBus.Setup.Windows/RavenDB/RavenHelpers.cs rename to src/PowerShell/NServiceBus.PowerShell/RavenDB/RavenHelpers.cs index 8d06ff150ff..4c6e5d1eb32 100644 --- a/src/Setup/NServiceBus.Setup.Windows/RavenDB/RavenHelpers.cs +++ b/src/PowerShell/NServiceBus.PowerShell/RavenDB/RavenHelpers.cs @@ -1,92 +1,91 @@ -namespace NServiceBus.Persistence.Raven.Installation -{ - using System; - using System.Diagnostics; - using System.Net; - using System.Security.Principal; - - - /// - /// Copied from RavenDB and modified for out needs - /// - public static class RavenHelpers - { - public static bool EnsureCanListenToWhenInNonAdminContext(int port) - { - try - { - if (CanStartHttpListener(port)) - return true; - - TryGrantingHttpPrivileges(port); - - return CanStartHttpListener(port); - } - catch (Exception) - { - return false; - } - } - - private static void GetArgsForHttpAclCmd(int port, out string args, out string cmd) - { - if (Environment.OSVersion.Version.Major > 5) - { - cmd = "netsh"; - args = string.Format(@"http add urlacl url=http://+:{0}/ user=""{1}""", port, - WindowsIdentity.GetCurrent().Name); - } - else - { - cmd = "httpcfg"; - args = string.Format(@"set urlacl /u http://+:{0}/ /a D:(A;;GX;;;""{1}"")", port, - WindowsIdentity.GetCurrent().User); - } - } - - - private static bool CanStartHttpListener(int port) - { - try - { - var httpListener = new HttpListener(); - httpListener.Prefixes.Add("http://+:" + port + "/"); - httpListener.Start(); - httpListener.Stop(); - return true; - } - catch (HttpListenerException e) - { - if (e.ErrorCode != 5) //access denies - throw; - } - return false; - } - - private static int TryGrantingHttpPrivileges(int port) - { - string args; - string cmd; - GetArgsForHttpAclCmd(port, out args, out cmd); - - Console.WriteLine("Trying to grant rights for http.sys"); - try - { - Console.WriteLine("runas {0} {1}", cmd, args); - var process = Process.Start(new ProcessStartInfo - { - Verb = "runas", - Arguments = args, - FileName = cmd, - }); - process.WaitForExit(); - return process.ExitCode; - } - catch (Exception) - { - return -144; - } - } +namespace NServiceBus.Persistence.Raven.Installation +{ + using System; + using System.Diagnostics; + using System.Net; + using System.Security.Principal; + + + /// + /// Copied from RavenDB and modified for out needs + /// + public static class RavenHelpers + { + public static bool EnsureCanListenToWhenInNonAdminContext(int port) + { + try + { + if (CanStartHttpListener(port)) + return true; + + TryGrantingHttpPrivileges(port); + + return CanStartHttpListener(port); + } + catch (Exception) + { + return false; + } + } + + private static void GetArgsForHttpAclCmd(int port, out string args, out string cmd) + { + if (Environment.OSVersion.Version.Major > 5) + { + cmd = "netsh"; + args = string.Format(@"http add urlacl url=http://+:{0}/ user=""{1}""", port, + WindowsIdentity.GetCurrent().Name); + } + else + { + cmd = "httpcfg"; + args = string.Format(@"set urlacl /u http://+:{0}/ /a D:(A;;GX;;;""{1}"")", port, + WindowsIdentity.GetCurrent().User); + } + } + + private static bool CanStartHttpListener(int port) + { + try + { + var httpListener = new HttpListener(); + httpListener.Prefixes.Add("http://+:" + port + "/"); + httpListener.Start(); + httpListener.Stop(); + + return true; + } + catch (HttpListenerException e) + { + if (e.ErrorCode != 5) //access denies + throw; + } + + return false; + } + + private static void TryGrantingHttpPrivileges(int port) + { + string args; + string cmd; + GetArgsForHttpAclCmd(port, out args, out cmd); + + Console.WriteLine("Trying to grant rights for http.sys"); + try + { + Console.WriteLine("runas {0} {1}", cmd, args); + var process = Process.Start(new ProcessStartInfo + { + Verb = "runas", + Arguments = args, + FileName = cmd, + }); + process.WaitForExit(); + } + catch + { + } + } } - + } \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/AWS.Extensions.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/AWS.Extensions.dll new file mode 100644 index 00000000000..5b592cab769 Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/AWS.Extensions.dll differ diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/AWSSDK.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/AWSSDK.dll new file mode 100644 index 00000000000..0c8573d0573 Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/AWSSDK.dll differ diff --git a/lib/RavenDB/RavenDB.Database.992/Esent.Interop.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Esent.Interop.dll similarity index 100% rename from lib/RavenDB/RavenDB.Database.992/Esent.Interop.dll rename to src/PowerShell/NServiceBus.PowerShell/RavenResources/Esent.Interop.dll diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/GeoAPI.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/GeoAPI.dll new file mode 100644 index 00000000000..d163cb7138e Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/GeoAPI.dll differ diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/ICSharpCode.NRefactory.CSharp.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/ICSharpCode.NRefactory.CSharp.dll new file mode 100644 index 00000000000..5cc0c113edb Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/ICSharpCode.NRefactory.CSharp.dll differ diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/ICSharpCode.NRefactory.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/ICSharpCode.NRefactory.dll new file mode 100644 index 00000000000..aefe1529cf5 Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/ICSharpCode.NRefactory.dll differ diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/Jint.Raven.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Jint.Raven.dll new file mode 100644 index 00000000000..1784b18041c Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Jint.Raven.dll differ diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/Lucene.Net.Contrib.Spatial.NTS.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Lucene.Net.Contrib.Spatial.NTS.dll new file mode 100644 index 00000000000..065704f4616 Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Lucene.Net.Contrib.Spatial.NTS.dll differ diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/Lucene.Net.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Lucene.Net.dll new file mode 100644 index 00000000000..243490173fe Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Lucene.Net.dll differ diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/Mono.Cecil.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Mono.Cecil.dll new file mode 100644 index 00000000000..d22da172abe Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Mono.Cecil.dll differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/NLog.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/NLog.dll similarity index 100% rename from src/Setup/NServiceBus.Setup.Windows/Resources/NLog.dll rename to src/PowerShell/NServiceBus.PowerShell/RavenResources/NLog.dll diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/NetTopologySuite.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/NetTopologySuite.dll new file mode 100644 index 00000000000..973de5c3fa3 Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/NetTopologySuite.dll differ diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/PowerCollections.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/PowerCollections.dll new file mode 100644 index 00000000000..b6d5ff5e9ab Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/PowerCollections.dll differ diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/Raven.Abstractions.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Raven.Abstractions.dll new file mode 100644 index 00000000000..94d8417b1d4 Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Raven.Abstractions.dll differ diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/Raven.Database.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Raven.Database.dll new file mode 100644 index 00000000000..97fbc0b7d64 Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Raven.Database.dll differ diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/Raven.Server.exe b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Raven.Server.exe new file mode 100644 index 00000000000..1a383bcee45 Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Raven.Server.exe differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Server.exe.config b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Raven.Server.exe.config similarity index 76% rename from src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Server.exe.config rename to src/PowerShell/NServiceBus.PowerShell/RavenResources/Raven.Server.exe.config index 1a2b4407532..4ae09ca3168 100644 --- a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Server.exe.config +++ b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Raven.Server.exe.config @@ -1,14 +1,14 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/RavenResources/Spatial4n.Core.NTS.dll b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Spatial4n.Core.NTS.dll new file mode 100644 index 00000000000..a7140dc241b Binary files /dev/null and b/src/PowerShell/NServiceBus.PowerShell/RavenResources/Spatial4n.Core.NTS.dll differ diff --git a/src/PowerShell/NServiceBus.PowerShell/SetNServiceBusLocalMachineSettings.cs b/src/PowerShell/NServiceBus.PowerShell/SetNServiceBusLocalMachineSettings.cs new file mode 100644 index 00000000000..26e0fed9493 --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/SetNServiceBusLocalMachineSettings.cs @@ -0,0 +1,61 @@ +namespace NServiceBus.PowerShell +{ + using System; + using System.Management.Automation; + using System.Security; + using Microsoft.Win32; + + [Cmdlet(VerbsCommon.Set, "NServiceBusLocalMachineSettings", SupportsShouldProcess = true, ConfirmImpact = ConfirmImpact.High)] + public class SetNServiceBusLocalMachineSettings : PSCmdlet + { + [Parameter(Mandatory = false, HelpMessage = "Error queue to use for all endpoints in this machine.")] + public string ErrorQueue { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Audit queue to use for all endpoints in this machine.")] + public string AuditQueue { get; set; } + + protected override void ProcessRecord() + { + if (!ShouldProcess(Environment.MachineName)) + { + return; + } + + if (Environment.Is64BitOperatingSystem) + { + WriteRegistry(RegistryView.Registry32); + + WriteRegistry(RegistryView.Registry64); + } + else + { + WriteRegistry(RegistryView.Default); + } + } + + void WriteRegistry(RegistryView view) + { + using (var registryKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, view).CreateSubKey(@"SOFTWARE\ParticularSoftware\ServiceBus")) + { + if (registryKey == null) + { + ThrowTerminatingError( + new ErrorRecord( + new SecurityException( + @"Could not create/open 'HKEY_LOCAL_MACHINE\SOFTWARE\ParticularSoftware\ServiceBus' for writing."), + "NotAuthorized", ErrorCategory.SecurityError, null)); + } + + if (!String.IsNullOrWhiteSpace(ErrorQueue)) + { + registryKey.SetValue("ErrorQueue", ErrorQueue, RegistryValueKind.String); + } + + if (!String.IsNullOrWhiteSpace(AuditQueue)) + { + registryKey.SetValue("AuditQueue", AuditQueue, RegistryValueKind.String); + } + } + } + } +} \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/VsConstants.cs b/src/PowerShell/NServiceBus.PowerShell/VsConstants.cs new file mode 100644 index 00000000000..c755917d93c --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/VsConstants.cs @@ -0,0 +1,20 @@ +namespace NServiceBus.PowerShell +{ + internal static class VsConstants + { + // Project type guids + internal const string WebApplicationProjectTypeGuid = "{349C5851-65DF-11DA-9384-00065B846F21}"; + internal const string WebSiteProjectTypeGuid = "{E24C65DC-7377-472B-9ABA-BC803B73C61A}"; + internal const string CsharpProjectTypeGuid = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}"; + internal const string VbProjectTypeGuid = "{F184B08F-C81C-45F6-A57F-5ABD9991F28F}"; + + internal const string Mvc1ProjectTypeGuid = "{603C0E0B-DB56-11DC-BE95-000D561079B0}"; + internal const string Mvc2ProjectTypeGuid = "{F85E285D-A4E0-4152-9332-AB1D724D3325}"; + internal const string Mvc3ProjectTypeGuid = "{E53F8FEA-EAE0-44A6-8774-FFD645390401}"; + + internal const string CsharpCodeModelLanguageGuid = "{B5E9BD34-6D3E-4B5D-925E-8A43B79820B4}"; + internal const string VbCodeModelLanguageGuid = "{B5E9BD33-6D3E-4B5D-925E-8A43B79820B4}"; + + internal const int S_OK = 0; + } +} \ No newline at end of file diff --git a/src/PowerShell/NServiceBus.PowerShell/about_NServiceBus.help.txt b/src/PowerShell/NServiceBus.PowerShell/about_NServiceBus.help.txt new file mode 100644 index 00000000000..d8827794718 --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/about_NServiceBus.help.txt @@ -0,0 +1,110 @@ +TOPIC + about_NServiceBus + +SHORT DESCRIPTION + Provides information about NServiceBus commands. + +LONG DESCRIPTION + This topic describes the NServiceBus commands. NServiceBus is a developer friendly + .NET ESB framework. + + The following NServiceBus cmdlets are included: + + Cmdlet Description + ------------------------------------------------------------------------------------------------- + Install-NServiceBusLicense Install a NServiceBus license file. + + Get-NServiceBusMSMQMessage Displays all messages in a queue. + + Get-NServiceBusVersion Displays the NServiceBus installed version. + + Install-NServiceBusDTC Install DTC on the machine. + + Install-NServiceBusRavenDB Install RavenDB on the machine. + + Install-NServiceBusPerformanceCounters Install NServiceBus performance counters + on the machine. + + Install-NServiceBusMSMQ Install MSMQ on the machine. + + Test-NServiceBusDTCInstallation Validates if DTC is installed and running + on the machine. + + Test-NServiceBusRavenDBInstallation Ensures RavenDB is on the machine. + + Test-NServiceBusPerformanceCountersInstallation Validates that NServiceBus performance + counters are correctly installed on + the machine. + + Test-NServiceBusMSMQInstallation Validates MSMQ is correctly installed on + the machine. + + Add-NServiceBusMessageForwardingInCaseOfFaultConfig Adds the required configuration section to + the config file. + + Add-NServiceBusUnicastBusConfig Adds the required configuration section to + the config file. + + Add-NServiceBusTransportConfig Adds the required configuration section to + the config file. + + Add-NServiceBusSecondLevelRetriesConfig Adds the required configuration section to + the config file. + + Add-NServiceBusLoggingConfig Adds the required configuration section to + the config file. + + Add-NServiceBusMasterNodeConfig Adds the required configuration section to + the config file. + + Add-NServiceBusNHibernateConfig Adds the NHibernate supported config settings + as a comment. + + Set-NServiceBusLocalMachineSettings Allows to specify the default Error and Audit + queues. + + Get-NServiceBusLocalMachineSettings Shows the default Error and Audit queues. + +Sample Commands + + To checks the status of the NServiceBus performance counters on this box: + + C:\PS> $countersAreInstalled = Test-NServiceBusPerformanceCountersInstallation + C:\PS> "PerformanceCounters are correctly installed: " + $countersAreInstalled + + To install RavenDB onto a specific path and listening on a different port: + + C:\PS> Install-NServiceBusRavenDB -Port 8888 -Installpath "C:\MyPath\Nservicebus.Persistence" + + To configure all endpoints Error and Audit queues on this machine: + + C:\PS> Set-NServiceBusLocalMachineSettings -ErrorQueue "error@centralserver" -AuditQueue "audit@centralserver" + + A slight more complex NServiceBus retrieve message commands might resemble + the following command: + + C:\PS> Get-NServiceBusMSMQMessage -QueueName result | select -ExpandProperty Headers | Where-Object{$_.Key -eq "NServiceBus.RelatedToTimeoutId" } + + The above command lists all messages that have a header with key "NServiceBus.RelatedToTimeoutId" + +SEE ALSO + Install-NServiceBusLicense + Get-NServiceBusMSMQMessage + Get-NServiceBusVersion + Install-NServiceBusDTC + Install-NServiceBusRavenDB + Install-NServiceBusPerformanceCounters + Install-NServiceBusMSMQ + Test-NServiceBusDTCInstallation + Test-NServiceBusRavenDBInstallation + Test-NServiceBusPerformanceCountersInstallation + Test-NServiceBusMSMQInstallation + Add-NServiceBusMessageForwardingInCaseOfFaultConfig + Add-NServiceBusUnicastBusConfig + Add-NServiceBusTransportConfig + Add-NServiceBusSecondLevelRetriesConfig + Add-NServiceBusLoggingConfig + Add-NServiceBusMasterNodeConfig + Add-NServiceBusNHibernateConfig + Set-NServiceBusLocalMachineSettings + Get-NServiceBusLocalMachineSettings diff --git a/src/PowerShell/NServiceBus.PowerShell/packages.config b/src/PowerShell/NServiceBus.PowerShell/packages.config new file mode 100644 index 00000000000..3eb5d615d1f --- /dev/null +++ b/src/PowerShell/NServiceBus.PowerShell/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/ClusteredTestContext.cs b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/ClusteredTestContext.cs new file mode 100644 index 00000000000..dd32089eab6 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/ClusteredTestContext.cs @@ -0,0 +1,267 @@ +namespace NServiceBus.Transports.RabbitMQ.Tests.ClusteringTests +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Diagnostics; + using System.Globalization; + using System.IO; + using System.Linq; + using Config; + using EasyNetQ; + using Logging.Loggers.NLogAdapter; + using NLog; + using NLog.Targets; + using NUnit.Framework; + using Support; + using Unicast.Transport; + + public abstract class ClusteredTestContext + { + protected const string QueueName = "testreceiver"; + const string ErlangProcessName = "erl"; + protected static Logger Logger = LogManager.GetCurrentClassLogger(); + + protected Dictionary RabbitNodes = new Dictionary + { + {1, new RabbitNode {Number = 1, Port = 5673, MgmtPort = 15673, ShouldBeRunning=true}}, + {2, new RabbitNode {Number = 2, Port = 5674, MgmtPort = 15674, ShouldBeRunning=true}}, + {3, new RabbitNode {Number = 3, Port = 5675, MgmtPort = 15675, ShouldBeRunning=true}} + }; + + readonly string rabbitMqCtl = "rabbitmqctl.bat";//make sure that you have the PATH environment variable setup + readonly string rabbitMqServer = "rabbitmq-server.bat";//make sure that you have the PATH environment variable setup + + RabbitMqConnectionManager connectionManager; + RabbitMqDequeueStrategy dequeueStrategy; + protected int[] erlangProcessesRunningBeforeTheTest; + BlockingCollection receivedMessages; + RabbitMqMessageSender sender; + RabbitMqUnitOfWork unitOfWork; + + protected class RabbitNode + { + public static readonly string LocalHostName = RuntimeEnvironment.MachineName; + public int MgmtPort; + public int Number; + public int Port; + public bool ShouldBeRunning = true; + + /// + /// The FQ node name (eg rabbit1@JUSTINT). + /// + public string Name { + get { return string.Format("rabbit{0}@{1}", Number, LocalHostName); } + } + } + + protected Process[] GetExistingErlangProcesses() { + return Process.GetProcessesByName(ErlangProcessName); + } + + void StartRabbitMqServer(RabbitNode node) { + Dictionary envVars = new Dictionary + { + {"RABBITMQ_NODENAME", node.Name}, + {"RABBITMQ_NODE_PORT", node.Port.ToString(CultureInfo.InvariantCulture)}, + {"RABBITMQ_SERVER_START_ARGS", string.Format("-rabbitmq_management listener [{{port,{0}}}]", node.MgmtPort)}, + }; + + InvokeExternalProgram(rabbitMqServer, "-detached", envVars); + } + + protected void InvokeRabbitMqCtl(RabbitNode node, string cmd) { + var args = (string.Format("-n {0} {1}", node.Name, cmd)); + InvokeExternalProgram(rabbitMqCtl, args); + } + + static void InvokeExternalProgram(string program, string args, Dictionary customEnvVars = null) { + ProcessStartInfo startInfo = new ProcessStartInfo {UseShellExecute = false, RedirectStandardOutput = true, FileName = program, Arguments = args,CreateNoWindow = true,WindowStyle = ProcessWindowStyle.Hidden}; + var environmentVariables = startInfo.EnvironmentVariables; + + if (customEnvVars != null) { + foreach (KeyValuePair customEnvVar in customEnvVars) { + Logger.Debug("Setting env var {0} to '{1}'", customEnvVar.Key, customEnvVar.Value); + if (environmentVariables.ContainsKey(customEnvVar.Key)) { + environmentVariables[customEnvVar.Key] = customEnvVar.Value; + } + else { + environmentVariables.Add(customEnvVar.Key, customEnvVar.Value); + } + } + } + + string programName = Path.GetFileName(program); + Logger.Debug("Running {0} with args: '{1}'", programName, args); + Process p = Process.Start(startInfo); + string output = p.StandardOutput.ReadToEnd(); + output = output.Replace("\n", " "); // replace line breaks for more terse logging output + p.WaitForExit(); + Logger.Debug("Result: {0}", output); + } + + [TestFixtureSetUp] + public void TestContextFixtureSetup() { + SetupNLog(LogLevel.Trace); + Logger.Trace("Running TestContextFixtureSetup"); + CaptureExistingErlangProcesses(); + StartUpRabbitNodes(); + ClusterRabbitNodes(); + SetHAPolicy(); + Logger.Fatal("RabbitMQ cluster setup complete"); + } + + [TestFixtureTearDown] + public void TestContextFixtureTearDown() { + Logger.Trace("Running TestContextFixtureTearDown"); + if (dequeueStrategy != null) { + dequeueStrategy.Stop(); + } + + connectionManager.Dispose(); + + var erlangProcessesToKill = GetExistingErlangProcesses().Select(p => p.Id).Except(erlangProcessesRunningBeforeTheTest).ToList(); + erlangProcessesToKill.ForEach(id => Process.GetProcessById(id).Kill()); + } + + void ClusterRabbitNodes() { + ClusterRabbitNode(2, 1); + ClusterRabbitNode(3, 1); + } + + void ResetCluster() { + StartNode(1); + ClusterRabbitNode(2, 1, withReset: true); + ClusterRabbitNode(3, 1, withReset: true); + } + + void SetHAPolicy() { + const string cmd = @"set_policy ha-all ""^(?!amq\.).*"" ""{""""ha-mode"""": """"all""""}"""; + InvokeRabbitMqCtl(RabbitNodes[1], cmd); + } + + void CaptureExistingErlangProcesses() { + erlangProcessesRunningBeforeTheTest = GetExistingErlangProcesses().Select(p => p.Id).ToArray(); + } + + void StartUpRabbitNodes() { + foreach (var node in RabbitNodes.Values.Where(node => node.ShouldBeRunning)) { + StartRabbitMqServer(node); + } + } + + void ClusterRabbitNode(int fromNodeNumber, int toNodeNumber, bool withReset = false) { + var node = RabbitNodes[fromNodeNumber]; + var clusterToNode = RabbitNodes[toNodeNumber]; + InvokeRabbitMqCtl(node, "stop_app"); + if (withReset) { + InvokeRabbitMqCtl(node, "reset"); + } + InvokeRabbitMqCtl(node, string.Format("join_cluster {0}", clusterToNode.Name)); + InvokeRabbitMqCtl(node, "start_app"); + } + + protected TransportMessage SendAndReceiveAMessage() { + TransportMessage message; + return SendAndReceiveAMessage(out message); + } + + protected TransportMessage SendAndReceiveAMessage(out TransportMessage sentMessage) { + Logger.Info("Sending a message"); + var message = new TransportMessage(); + sender.Send(message, Address.Parse(QueueName)); + sentMessage = message; + var receivedMessage = WaitForMessage(); + return receivedMessage; + } + + static ColoredConsoleTarget GetConsoleLoggingTarget() { + return new ColoredConsoleTarget {Layout = "${longdate:universalTime=true} | ${logger:shortname=true} | ${message} | ${exception:format=tostring}"}; + } + + static NLogViewerTarget GetNLogViewerLoggingTarget() { + var log4View = new NLogViewerTarget {Address = "udp://127.0.0.1:12345", IncludeCallSite = true, AppInfo = "IntegrationTest"}; + log4View.Parameters.Add(new NLogViewerParameterInfo {Layout = "${exception:format=tostring}", Name = "Exception"}); + log4View.Parameters.Add(new NLogViewerParameterInfo {Layout = "${stacktrace}", Name = "StackTrace"}); + return log4View; + } + + protected void SetupNLog(LogLevel logLevel) { + var nLogViewerTarget = GetNLogViewerLoggingTarget(); + var consoleTarget = GetConsoleLoggingTarget(); + NLogConfigurator.Configure(new object[] {nLogViewerTarget, consoleTarget}, logLevel.ToString()); + } + + protected void SetupQueueAndSenderAndListener(string connectionString) { + connectionManager = SetupRabbitMqConnectionManager(connectionString); + EnsureRabbitQueueExists(QueueName); + SetupMessageSender(); + SetupQueueListener(QueueName); + } + + void SetupQueueListener(string queueName) { + receivedMessages = new BlockingCollection(); + dequeueStrategy = new RabbitMqDequeueStrategy {ConnectionManager = connectionManager, PurgeOnStartup = true}; + dequeueStrategy.Init(Address.Parse(queueName), TransactionSettings.Default, m => + { + receivedMessages.Add(m); + return true; + }, (s, exception) => + { + }); + + dequeueStrategy.Start(1); + } + + void EnsureRabbitQueueExists(string queueName) { + using (var channel = connectionManager.GetConnection(ConnectionPurpose.Administration).CreateModel()) { + channel.QueueDeclare(queueName, true, false, false, null); + channel.QueuePurge(queueName); + } + } + + void SetupMessageSender() { + unitOfWork = new RabbitMqUnitOfWork {ConnectionManager = connectionManager}; + sender = new RabbitMqMessageSender {UnitOfWork = unitOfWork}; + } + + static RabbitMqConnectionManager SetupRabbitMqConnectionManager(string connectionString) { + var config = new ConnectionStringParser().Parse(connectionString); +// config.OverrideClientProperties(); + var selectionStrategy = new DefaultClusterHostSelectionStrategy(); + var connectionFactory = new ConnectionFactoryWrapper(config, selectionStrategy); + var newConnectionManager = new RabbitMqConnectionManager(connectionFactory, config); + return newConnectionManager; + } + + TransportMessage WaitForMessage() { + var waitTime = TimeSpan.FromSeconds(1); + + if (Debugger.IsAttached) { + waitTime = TimeSpan.FromMinutes(10); + } + + TransportMessage transportMessage; + receivedMessages.TryTake(out transportMessage, waitTime); + + return transportMessage; + } + + protected string GetConnectionString() { + var hosts = RabbitNodes.Values.OrderBy(n => n.Port).Select(n => string.Format("{0}:{1}", RabbitNode.LocalHostName, n.Port)); + string connectionString = string.Concat("host=" ,string.Join(",", hosts)); + Logger.Info("Connection string is: '{0}'", connectionString); + return connectionString; + } + + protected void StopNode(int nodeNumber) { + Logger.Warn("Stopping node {0}",nodeNumber); + InvokeRabbitMqCtl(RabbitNodes[nodeNumber], "stop_app"); + } + + protected void StartNode(int nodeNumber) { + Logger.Info("Starting node {0}",nodeNumber); + InvokeRabbitMqCtl(RabbitNodes[nodeNumber], "start_app"); + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/readme.txt b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/readme.txt new file mode 100644 index 00000000000..ca628acf18d --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/readme.txt @@ -0,0 +1,14 @@ + +clustering tests require the following setup in advance (my particular versions also listed): + install erlang (otp_win64_R16B.exe) + install rabbitmq (rabbitmq-server-3.0.2) + at the rabbitmq cmd prompt: rabbitmq-plugins enable rabbitmq_management + +test assumptions: + the ports 5673-5676 are available - new rabbit nodes will be created listening on these ports + the ports 15673-15676 are available - the new rabbit node mgmt sites will listen on these ports + the rabbitmq utilities are located at "C:\Program Files (x86)\RabbitMQ Server\rabbitmq_server-3.0.2\sbin" + machine is x64 + +other stuff: + using NLog to output both NServiceBus and test debug logs to NLog (console and UDP listeners) diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/when_connected_to_local_cluster_and_all_nodes_are_up.cs b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/when_connected_to_local_cluster_and_all_nodes_are_up.cs new file mode 100644 index 00000000000..ea3cb195f7b --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/when_connected_to_local_cluster_and_all_nodes_are_up.cs @@ -0,0 +1,30 @@ +namespace NServiceBus.Transports.RabbitMQ.Tests.ClusteringTests +{ + using FluentAssertions; + using NUnit.Framework; + + [TestFixture] + [Category(TestCategory.Integration)] + [Explicit("Long running test")] + public class when_connected_to_local_cluster_and_all_nodes_are_up : ClusteredTestContext + { + TransportMessage sentMessage; + TransportMessage receivedMessage; + + [TestFixtureSetUp] + public void TestFixtureSetup() { + // arrange + var connectionString = GetConnectionString(); + SetupQueueAndSenderAndListener(connectionString); + + // act + receivedMessage = SendAndReceiveAMessage(out sentMessage); + } + + [Test] + public void it_should_be_able_to_roundtrip_a_message() { + receivedMessage.Should().NotBeNull(); + receivedMessage.Id.Should().Be(sentMessage.Id); + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/when_connected_to_local_cluster_and_first_node_is_unavailable.cs b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/when_connected_to_local_cluster_and_first_node_is_unavailable.cs new file mode 100644 index 00000000000..738943c6dd7 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/when_connected_to_local_cluster_and_first_node_is_unavailable.cs @@ -0,0 +1,31 @@ +namespace NServiceBus.Transports.RabbitMQ.Tests.ClusteringTests +{ + using FluentAssertions; + using NUnit.Framework; + + [TestFixture] + [Category(TestCategory.Integration)] + [Explicit("Long running test")] + public class when_connected_to_local_cluster_and_first_node_is_unavailable : ClusteredTestContext + { + TransportMessage sentMessage; + TransportMessage receivedMessage; + + [TestFixtureSetUp] + public void TestFixtureSetup() { + // arrange + var connectionString = GetConnectionString(); + SetupQueueAndSenderAndListener(connectionString); + StopNode(1); + + // act + receivedMessage = SendAndReceiveAMessage(out sentMessage); + } + + [Test] + public void it_should_be_able_to_roundtrip_a_message() { + receivedMessage.Should().NotBeNull(); + receivedMessage.Id.Should().Be(sentMessage.Id); + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/when_connected_to_local_cluster_and_nodes_start_going_down.cs b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/when_connected_to_local_cluster_and_nodes_start_going_down.cs new file mode 100644 index 00000000000..41397f328da --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ClusteringTests/when_connected_to_local_cluster_and_nodes_start_going_down.cs @@ -0,0 +1,51 @@ +namespace NServiceBus.Transports.RabbitMQ.Tests.ClusteringTests +{ + using FluentAssertions; + using NUnit.Framework; + + [TestFixture] + [Category(TestCategory.Integration)] + [Explicit("Long running test")] + public class when_connected_to_local_cluster_and_nodes_start_going_down : ClusteredTestContext + { + TransportMessage messageSentWhenAllNodesUp; + TransportMessage messageSentWhen1NodeIsDown; + TransportMessage messageSentWhen2NodesAreDown; + TransportMessage messageReceivedWhenAllNodesUp; + TransportMessage messageReceivedWhen1NodeIsDown; + TransportMessage messageReceivedWhen2NodesAreDown; + + [TestFixtureSetUp] + public void TestFixtureSetup() { + // arrange + var connectionString = GetConnectionString(); + SetupQueueAndSenderAndListener(connectionString); + + // act + SendAndReceiveAMessage(); + messageReceivedWhenAllNodesUp = SendAndReceiveAMessage(out messageSentWhenAllNodesUp); + StopNode(1); + messageReceivedWhen1NodeIsDown = SendAndReceiveAMessage(out messageSentWhen1NodeIsDown); + StopNode(2); + messageReceivedWhen2NodesAreDown = SendAndReceiveAMessage(out messageSentWhen2NodesAreDown); + } + + [Test] + public void it_should_be_able_to_roundtrip_a_message_when_all_nodes_are_up() { + messageReceivedWhenAllNodesUp.Should().NotBeNull(); + messageReceivedWhenAllNodesUp.Id.Should().Be(messageSentWhenAllNodesUp.Id); + } + + [Test] + public void it_should_be_able_to_roundtrip_a_message_when_node_1_is_down() { + messageReceivedWhen1NodeIsDown.Should().NotBeNull(); + messageReceivedWhen1NodeIsDown.Id.Should().Be(messageSentWhen1NodeIsDown.Id); + } + + [Test] + public void it_should_be_able_to_roundtrip_a_message_when_nodes_1_and_2_are_down() { + messageReceivedWhen2NodesAreDown.Should().NotBeNull(); + messageReceivedWhen2NodesAreDown.Id.Should().Be(messageSentWhen2NodesAreDown.Id); + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ConnectionString/ConnectionConfigurationTests.cs b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ConnectionString/ConnectionConfigurationTests.cs new file mode 100644 index 00000000000..79023e91f4a --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ConnectionString/ConnectionConfigurationTests.cs @@ -0,0 +1,66 @@ +namespace NServiceBus.Transports.RabbitMQ.Tests.ConnectionString +{ + using System.Linq; + using Config; + using NUnit.Framework; + + [TestFixture] + public class ConnectionConfigurationTests + { + #region Setup/Teardown + + [SetUp] + public void Setup() { + parser = new ConnectionStringParser(); + defaults = new ConnectionConfiguration(); + } + + #endregion + + ConnectionConfiguration defaults; + ConnectionStringParser parser; + string connectionString; + IConnectionConfiguration connectionConfiguration; + + [Test] + public void Should_default_the_port_if_not_set() { + connectionString = ("host=myHost"); + connectionConfiguration = parser.Parse(connectionString); + Assert.AreEqual(ConnectionConfiguration.DefaultPort, connectionConfiguration.Hosts.First().Port); + } + + [Test] + public void Should_default_the_prefetch_count() { + connectionString = ("host=localhost"); + connectionConfiguration = parser.Parse(connectionString); + Assert.AreEqual(ConnectionConfiguration.DefaultPrefetchCount, connectionConfiguration.PrefetchCount); + } + + [Test] + public void Should_default_the_requested_heartbeat() { + connectionString = ("host=localhost"); + connectionConfiguration = parser.Parse(connectionString); + Assert.AreEqual(ConnectionConfiguration.DefaultHeartBeatInSeconds, connectionConfiguration.RequestedHeartbeat); + } + + [Test] + public void Should_set_default_password() { +Assert.AreEqual( defaults.Password,"guest"); + } + + [Test] + public void Should_set_default_port() { +Assert.AreEqual( defaults.Port,5672); + } + + [Test] + public void Should_set_default_username() { +Assert.AreEqual( defaults.UserName,"guest"); + } + + [Test] + public void Should_set_default_virtual_host() { +Assert.AreEqual( defaults.VirtualHost,"/"); + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ConnectionString/ConnectionStringParserTests.cs b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ConnectionString/ConnectionStringParserTests.cs new file mode 100644 index 00000000000..d3ea70e8b2e --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/ConnectionString/ConnectionStringParserTests.cs @@ -0,0 +1,152 @@ +namespace NServiceBus.Transports.RabbitMQ.Tests.ConnectionString +{ + using System; + using System.Linq; + using Config; + using NUnit.Framework; + + [TestFixture] + public class ConnectionStringParserTests + { + #region Setup/Teardown + + [SetUp] + public void Setup() { + parser = new ConnectionStringParser(); + } + + #endregion + + ConnectionStringParser parser; + IConnectionConfiguration connectionConfiguration; + + const string connectionString = + "virtualHost=Copa;username=Copa;host=192.168.1.1:1234,192.168.1.2:2345;password=abc_xyz;port=12345;requestedHeartbeat=3;prefetchcount=2;maxRetries=4;usePublisherConfirms=true;maxWaitTimeForConfirms=02:03:39;retryDelay=01:02:03"; + + [Test] + public void Should_correctly_parse_full_connection_string() { + connectionConfiguration = parser.Parse(connectionString); + + Assert.AreEqual(connectionConfiguration.Hosts.First().Host, "192.168.1.1"); + Assert.AreEqual(connectionConfiguration.Hosts.First().Port, 1234); + Assert.AreEqual(connectionConfiguration.Hosts.Last().Host, "192.168.1.2"); + Assert.AreEqual(connectionConfiguration.Hosts.Last().Port, 2345); + Assert.AreEqual(connectionConfiguration.VirtualHost, "Copa"); + Assert.AreEqual(connectionConfiguration.UserName, "Copa"); + Assert.AreEqual(connectionConfiguration.Password, "abc_xyz"); + Assert.AreEqual(connectionConfiguration.Port, 12345); + Assert.AreEqual(connectionConfiguration.RequestedHeartbeat, 3); + Assert.AreEqual(connectionConfiguration.PrefetchCount, 2); + Assert.AreEqual(connectionConfiguration.UsePublisherConfirms, true); + Assert.AreEqual(connectionConfiguration.MaxWaitTimeForConfirms, new TimeSpan(2, 3, 39)); //02:03:39 + Assert.AreEqual(connectionConfiguration.RetryDelay, new TimeSpan(1, 2, 3)); //01:02:03 + } + + [Test] + [ExpectedException(typeof(Exception))] + public void Should_fail_if_host_is_not_present() { + parser.Parse("virtualHost=Copa;username=Copa;password=abc_xyz;port=12345;requestedHeartbeat=3"); + } + + [Test] + public void Should_parse_list_of_hosts() { + connectionConfiguration = parser.Parse("host=host.one:1001,host.two:1002,host.three:1003"); + var hosts = connectionConfiguration.Hosts; + + Assert.AreEqual(hosts.Count(), 3); + Assert.AreEqual(hosts.ElementAt(0).Host, "host.one"); + Assert.AreEqual(hosts.ElementAt(0).Port, 1001); + Assert.AreEqual(hosts.ElementAt(1).Host, "host.two"); + Assert.AreEqual(hosts.ElementAt(1).Port, 1002); + Assert.AreEqual(hosts.ElementAt(2).Host, "host.three"); + Assert.AreEqual(hosts.ElementAt(2).Port, 1003); + } + + [Test] + public void Should_parse_list_of_hosts_with_single_port() { + connectionConfiguration = parser.Parse("host=my.host.com,my.host2.com;port=1234"); + + Assert.AreEqual(connectionConfiguration.Hosts.First().Host, "my.host.com"); + Assert.AreEqual(connectionConfiguration.Hosts.Last().Host, "my.host2.com"); + Assert.AreEqual(connectionConfiguration.Hosts.First().Port, 1234); + Assert.AreEqual(connectionConfiguration.Hosts.Last().Port, 1234); + } + + [Test] + public void Should_parse_list_of_hosts_without_ports() { + connectionConfiguration = parser.Parse("host=my.host.com,my.host2.com"); + + Assert.AreEqual(connectionConfiguration.Hosts.First().Host, "my.host.com"); + Assert.AreEqual(connectionConfiguration.Hosts.Last().Host, "my.host2.com"); + Assert.AreEqual(connectionConfiguration.Hosts.First().Port, 5672); + Assert.AreEqual(connectionConfiguration.Hosts.Last().Port, 5672); + } + + [Test] + public void Should_parse_the_hostname() { + connectionConfiguration = parser.Parse("host=myHost"); + Assert.AreEqual("myHost", connectionConfiguration.Hosts.First().Host); + } + + + [Test] + public void Should_parse_the_password() { + connectionConfiguration = parser.Parse("host=localhost;password=test"); + Assert.AreEqual("test", connectionConfiguration.Password); + } + + [Test] + public void Should_parse_the_port() { + connectionConfiguration = parser.Parse("host=localhost;port=8181"); + Assert.AreEqual(8181, connectionConfiguration.Hosts.First().Port); + } + + [Test] + public void Should_parse_the_prefetch_count() { + connectionConfiguration = parser.Parse("host=localhost;prefetchcount=10"); + Assert.AreEqual(10, connectionConfiguration.PrefetchCount); + } + + [Test] + public void Should_parse_the_requestedHeartbeat() { + connectionConfiguration = parser.Parse("host=localhost;requestedHeartbeat=5"); + Assert.AreEqual(5, connectionConfiguration.RequestedHeartbeat); + } + + [Test] + public void Should_parse_the_retry_delay() { + connectionConfiguration = parser.Parse("host=localhost;retryDelay=00:00:10"); + Assert.AreEqual(TimeSpan.FromSeconds(10), connectionConfiguration.RetryDelay); + } + + [Test] + public void Should_parse_the_username() { + connectionConfiguration = parser.Parse("host=localhost;username=test"); + Assert.AreEqual("test", connectionConfiguration.UserName); + } + + [Test] + public void Should_parse_the_virtual_hostname() { + connectionConfiguration = parser.Parse("host=localhost;virtualHost=myVirtualHost"); + Assert.AreEqual("myVirtualHost", connectionConfiguration.VirtualHost); + } + + [Test] + [ExpectedException(typeof(Exception))] + public void Should_throw_if_given_badly_formatted_max_wait_time_for_confirms() { + parser.Parse("host=localhost;maxWaitTimeForConfirms=00:0d0:10"); + } + + [Test] + [ExpectedException(typeof(Exception))] + public void Should_throw_if_given_badly_formatted_retry_delay() { + parser.Parse("host=localhost;retryDelay=00:0d0:10"); + } + + [Test] + [ExpectedException(typeof(ArgumentException))] + public void Should_throw_on_malformed_string() { + parser.Parse("not a well formed name value pair;"); + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/NServiceBus.Transports.RabbitMQ.Tests.csproj b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/NServiceBus.Transports.RabbitMQ.Tests.csproj new file mode 100644 index 00000000000..4fb0897afcc --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/NServiceBus.Transports.RabbitMQ.Tests.csproj @@ -0,0 +1,105 @@ + + + + + Debug + AnyCPU + {8B773CFD-E0F8-402F-AABC-04580289C76A} + Library + Properties + NServiceBus.Transports.RabbitMQ.Tests + NServiceBus.Transports.RabbitMQ.Tests + v4.0 + 512 + ..\..\..\ + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\..\packages\FluentAssertions.2.0.1\lib\net40\FluentAssertions.dll + + + False + ..\..\..\packages\NLog.2.0.1.2\lib\net40\NLog.dll + + + ..\..\..\packages\NUnit.2.6.2\lib\nunit.framework.dll + + + False + ..\..\..\packages\RabbitMQ.Client.3.0.0\lib\net30\RabbitMQ.Client.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {dd48b2d0-e996-412d-9157-821ed8b17a9d} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + + {ba731749-22c7-4025-8a4d-465ae8e02e61} + NServiceBus.Transports.RabbitMQ + + + + + + + + + + \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/Properties/AssemblyInfo.cs b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..30f6cc91d44 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("NServiceBus.RabbitMQ.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyProduct("NServiceBus.RabbitMQ.Tests")] +[assembly: AssemblyCompany("NServiceBus")] +[assembly: AssemblyConfiguration("release")] +[assembly: AssemblyInformationalVersion("4.0.0-alpha0")] +[assembly: ComVisible(false)] +[assembly: CLSCompliantAttribute(true)] + diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/RabbitMqContext.cs b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/RabbitMqContext.cs new file mode 100644 index 00000000000..8982b10d242 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/RabbitMqContext.cs @@ -0,0 +1,151 @@ +namespace NServiceBus.Transports.RabbitMQ.Tests +{ + using System; + using System.Collections.Concurrent; + using Config; + using EasyNetQ; + using NServiceBus; + using NUnit.Framework; + using RabbitMQ; + using Routing; + using global::RabbitMQ.Client; + using TransactionSettings = Unicast.Transport.TransactionSettings; + + public class RabbitMqContext + { + protected void MakeSureQueueExists(string queueName) + { + using (var channel = connectionManager.GetConnection(ConnectionPurpose.Administration).CreateModel()) + { + channel.QueueDeclare(queueName, true, false, false, null); + channel.QueuePurge(queueName); + } + } + + protected void MakeSureExchangeExists(string exchangeName) + { + if (exchangeName == "amq.topic") + return; + + var connection = connectionManager.GetConnection(ConnectionPurpose.Administration); + DeleteExchange(exchangeName); + + using (var channel = connection.CreateModel()) + { + try + { + channel.ExchangeDeclare(exchangeName, "topic", true); + } + catch (Exception) + { + + } + + } + } + + void DeleteExchange(string exchangeName) + { + var connection = connectionManager.GetConnection(ConnectionPurpose.Administration); + using (var channel = connection.CreateModel()) + { + try + { + channel.ExchangeDelete(exchangeName); + } + catch (Exception) + { + } + } + } + + + [SetUp] + public void SetUp() + { + var routingTopology = new ConventionalRoutingTopology(); + receivedMessages = new BlockingCollection(); + + var config = new ConnectionConfiguration(); + config.ParseHosts("localhost:5672"); + + var selectionStrategy = new DefaultClusterHostSelectionStrategy(); + var connectionFactory = new ConnectionFactoryWrapper(config, selectionStrategy); + connectionManager = new RabbitMqConnectionManager(connectionFactory, config); + + unitOfWork = new RabbitMqUnitOfWork { ConnectionManager = connectionManager,UsePublisherConfirms = true,MaxWaitTimeForConfirms = TimeSpan.FromSeconds(10) }; + + sender = new RabbitMqMessageSender { UnitOfWork = unitOfWork, RoutingTopology = routingTopology }; + + + dequeueStrategy = new RabbitMqDequeueStrategy { ConnectionManager = connectionManager, PurgeOnStartup = true }; + + MakeSureQueueExists(MYRECEIVEQUEUE); + + DeleteExchange(MYRECEIVEQUEUE); + MakeSureExchangeExists(ExchangeNameConvention(Address.Parse(MYRECEIVEQUEUE),null)); + + + + MessagePublisher = new RabbitMqMessagePublisher + { + UnitOfWork = unitOfWork, + RoutingTopology = routingTopology + }; + subscriptionManager = new RabbitMqSubscriptionManager + { + ConnectionManager = connectionManager, + EndpointQueueName = MYRECEIVEQUEUE, + RoutingTopology = routingTopology + }; + + dequeueStrategy.Init(Address.Parse(MYRECEIVEQUEUE), TransactionSettings.Default, (m) => + { + receivedMessages.Add(m); + return true; + }, (s, exception) => { }); + + dequeueStrategy.Start(1); + } + + + [TearDown] + public void TearDown() + { + if (dequeueStrategy != null) + dequeueStrategy.Stop(); + + connectionManager.Dispose(); + } + + protected virtual string ExchangeNameConvention(Address address,Type eventType) + { + return "amq.topic"; + } + + + protected TransportMessage WaitForMessage() + { + var waitTime = TimeSpan.FromSeconds(1); + + if (System.Diagnostics.Debugger.IsAttached) + waitTime = TimeSpan.FromMinutes(10); + + TransportMessage message; + receivedMessages.TryTake(out message, waitTime); + + return message; + + } + + BlockingCollection receivedMessages; + + protected const string MYRECEIVEQUEUE = "testreceiver"; + protected RabbitMqDequeueStrategy dequeueStrategy; + protected RabbitMqConnectionManager connectionManager; + protected RabbitMqMessageSender sender; + protected RabbitMqMessagePublisher MessagePublisher; + protected RabbitMqSubscriptionManager subscriptionManager; + protected RabbitMqUnitOfWork unitOfWork; + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/TestCategory.cs b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/TestCategory.cs new file mode 100644 index 00000000000..f126b08504d --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/TestCategory.cs @@ -0,0 +1,8 @@ +namespace NServiceBus.Transports.RabbitMQ.Tests +{ + public static class TestCategory + { + public const string Integration = "Integration"; + public const string UnitTest = "UnitTest"; + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/TransportMessageBuilder.cs b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/TransportMessageBuilder.cs new file mode 100644 index 00000000000..bf89d30660e --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/TransportMessageBuilder.cs @@ -0,0 +1,46 @@ +namespace NServiceBus.Transports.RabbitMQ.Tests +{ + using System; + using NServiceBus; + + public class TransportMessageBuilder + { + readonly TransportMessage message = new TransportMessage{Recoverable = true}; + + public TransportMessageBuilder WithBody(byte[] body) + { + message.Body = body; + return this; + } + + public TransportMessage Build() + { + return message; + } + + public TransportMessageBuilder WithHeader(string key,string value) + { + message.Headers[key] = value; + return this; + } + + public TransportMessageBuilder TimeToBeReceived(TimeSpan timeToBeReceived) + { + + message.TimeToBeReceived = timeToBeReceived; + return this; + } + + public TransportMessageBuilder ReplyToAddress(Address address) + { + message.ReplyToAddress = address; + return this; + } + + public TransportMessageBuilder CorrelationId(string correlationId) + { + message.CorrelationId = correlationId; + return this; + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/When_consuming_messages.cs b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/When_consuming_messages.cs new file mode 100644 index 00000000000..a1e2544d000 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/When_consuming_messages.cs @@ -0,0 +1,112 @@ +namespace NServiceBus.Transports.RabbitMQ.Tests +{ + using System; + using NServiceBus; + using NUnit.Framework; + + [TestFixture, Category("Integration")] + [Explicit("requires rabbit node")] + public class When_consuming_messages : RabbitMqContext + { + [SetUp] + public void SetUp() + { + + } + + [Test] + public void Should_block_until_a_message_is_available() + { + var address = Address.Parse(MYRECEIVEQUEUE); + + + var message = new TransportMessage(); + + sender.Send(message, address); + + + var received = WaitForMessage(); + + + Assert.AreEqual(message.Id, received.Id); + } + + + [Test] + public void Should_be_able_to_receive_messages_without_headers() + { + var address = Address.Parse(MYRECEIVEQUEUE); + + var message = new TransportMessage(); + + + using (var channel = this.connectionManager.GetConnection(ConnectionPurpose.Publish).CreateModel()) + { + var properties = channel.CreateBasicProperties(); + + properties.MessageId = message.Id; + + channel.BasicPublish(string.Empty, address.Queue, true, false, properties, message.Body); + } + + var received = WaitForMessage(); + + + Assert.AreEqual(message.Id, received.Id); + } + + [Test] + public void Should_be_able_to_receive_a_blank_message() + { + var address = Address.Parse(MYRECEIVEQUEUE); + + var message = new TransportMessage(); + + + using (var channel = this.connectionManager.GetConnection(ConnectionPurpose.Publish).CreateModel()) + { + var properties = channel.CreateBasicProperties(); + + properties.MessageId = message.Id; + + channel.BasicPublish(string.Empty, address.Queue, true, false, properties, message.Body); + } + + var received = WaitForMessage(); + + + Assert.NotNull(received.Id,"The message id should be defaulted to a new guid if not set"); + } + + + [Test] + public void Should_upconvert_the_native_type_to_the_enclosed_message_types_header_if_empty() + { + var address = Address.Parse(MYRECEIVEQUEUE); + + var message = new TransportMessage(); + + var typeName = typeof(MyMessage).FullName; + + using (var channel = this.connectionManager.GetConnection(ConnectionPurpose.Publish).CreateModel()) + { + var properties = channel.CreateBasicProperties(); + + properties.MessageId = message.Id; + properties.Type = typeName; + + channel.BasicPublish(string.Empty, address.Queue, true, false, properties, message.Body); + } + + var received = WaitForMessage(); + + Assert.AreEqual(typeName, received.Headers[Headers.EnclosedMessageTypes]); + Assert.AreEqual(typeof(MyMessage), Type.GetType(received.Headers[Headers.EnclosedMessageTypes])); + } + + class MyMessage + { + + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/When_sending_a_message_over_rabbitmq.cs b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/When_sending_a_message_over_rabbitmq.cs new file mode 100644 index 00000000000..239f116da6e --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/When_sending_a_message_over_rabbitmq.cs @@ -0,0 +1,219 @@ +namespace NServiceBus.Transports.RabbitMQ.Tests +{ + using System; + using System.Text; + using System.Transactions; + using NServiceBus; + using NServiceBus.Transports.RabbitMQ; + using NServiceBus.Unicast.Queuing; + using NUnit.Framework; + using global::RabbitMQ.Client; + using global::RabbitMQ.Client.Events; + + [TestFixture, Category("Integration")] + [Explicit("requires rabbit node")] + public class When_sending_a_message_over_rabbitmq : RabbitMqContext + { + const string TESTQUEUE = "testendpoint"; + + [Test] + public void Should_populate_the_body() + { + var body = Encoding.UTF8.GetBytes(""); + + Verify(new TransportMessageBuilder().WithBody(body), + received => Assert.AreEqual(body, received.Body)); + } + + + [Test] + public void Should_set_the_content_type() + { + VerifyRabbit(new TransportMessageBuilder().WithHeader(Headers.ContentType, "application/json"), + received => Assert.AreEqual("application/json", received.BasicProperties.ContentType)); + + } + + + [Test] + public void Should_default_the_content_type_to_octet_stream_when_no_content_type_is_specified() + { + VerifyRabbit(new TransportMessageBuilder(), + received => Assert.AreEqual("application/octet-stream", received.BasicProperties.ContentType)); + + } + + + + [Test] + public void Should_set_the_message_type_based_on_the_encloded_message_types_header() + { + var messageType = typeof (MyMessage); + + VerifyRabbit(new TransportMessageBuilder().WithHeader(Headers.EnclosedMessageTypes, messageType.AssemblyQualifiedName), + received => Assert.AreEqual(messageType.FullName, received.BasicProperties.Type)); + + } + + [Test] + public void Should_set_the_time_to_be_received() + { + + var timeToBeReceived = TimeSpan.FromDays(1); + + + VerifyRabbit(new TransportMessageBuilder().TimeToBeReceived(timeToBeReceived), + received => Assert.AreEqual(timeToBeReceived.TotalMilliseconds.ToString(), received.BasicProperties.Expiration)); + } + + [Test] + public void Should_set_the_reply_to_address() + { + var address = Address.Parse("myAddress"); + + Verify(new TransportMessageBuilder().ReplyToAddress(address), + (t, r) => + { + Assert.AreEqual(address, t.ReplyToAddress); + Assert.AreEqual(address.Queue, r.BasicProperties.ReplyTo); + }); + + } + + + [Test] + public void Should_set_correlation_id_if_present() + { + var correlationId = Guid.NewGuid().ToString(); + + Verify(new TransportMessageBuilder().CorrelationId(correlationId), + result => Assert.AreEqual(correlationId, result.CorrelationId)); + + } + + [Test] + public void Should_transmitt_all_transportmessage_headers() + { + + Verify(new TransportMessageBuilder().WithHeader("h1", "v1").WithHeader("h2", "v2"), + result => + { + Assert.AreEqual("v1", result.Headers["h1"]); + Assert.AreEqual("v2", result.Headers["h2"]); + }); + + } + [Test] + public void Should_defer_the_send_until_tx_commit_if_ambient_tx_exists() + { + var body = Encoding.UTF8.GetBytes(""); + var body2 = Encoding.UTF8.GetBytes(""); + + var message = new TransportMessageBuilder().WithBody(body).Build(); + var message2 = new TransportMessageBuilder().WithBody(body2).Build(); + + using (var tx = new TransactionScope()) + { + SendMessage(message); + SendMessage(message2); + Assert.Throws(()=>Consume(message.Id)); + + tx.Complete(); + } + + Assert.AreEqual(body, Consume(message.Id).Body,"Message should be in the queue"); + Assert.AreEqual(body2, Consume(message2.Id).Body, "Message2 should be in the queue"); + } + + [Test] + public void Should_not_send_message_if_ambient_tx_is_rolled_back() + { + var body = Encoding.UTF8.GetBytes(""); + + var message = new TransportMessageBuilder().WithBody(body).Build(); + + using (var tx = new TransactionScope()) + { + SendMessage(message); + Assert.Throws(() => Consume(message.Id)); + } + + Assert.Throws(() => Consume(message.Id)); + + } + + + + [Test, Ignore("Not sure we should enforce this")] + public void Should_throw_when_sending_to_a_nonexisting_queue() + { + Assert.Throws(() => + sender.Send(new TransportMessage + { + + }, Address.Parse("NonExistingQueue@localhost"))); + } + + void Verify(TransportMessageBuilder builder, Action assertion) + { + var message = builder.Build(); + + SendMessage(message); + + var result = Consume(message.Id); + + assertion(RabbitMqTransportMessageExtensions.ToTransportMessage(result), result); + } + void Verify(TransportMessageBuilder builder, Action assertion) + { + Verify(builder, (t, r) => assertion(t)); + } + + void VerifyRabbit(TransportMessageBuilder builder, Action assertion) + { + Verify(builder, (t, r) => assertion(r)); + } + + + + void SendMessage(TransportMessage message) + { + MakeSureQueueExists(TESTQUEUE); + + sender.Send(message, Address.Parse(TESTQUEUE)); + } + + BasicDeliverEventArgs Consume(string id) + { + + using (var channel = connectionManager.GetConnection(ConnectionPurpose.Consume).CreateModel()) + { + var consumer = new QueueingBasicConsumer(channel); + + channel.BasicConsume(TESTQUEUE, false, consumer); + + object message; + + if (!consumer.Queue.Dequeue(1000, out message)) + throw new InvalidOperationException("No message found in queue"); + + var e = (BasicDeliverEventArgs)message; + + if (e.BasicProperties.MessageId != id) + throw new InvalidOperationException("Unexpected message found in queue"); + + channel.BasicAck(e.DeliveryTag,false); + + return e; + } + } + + + + class MyMessage + { + + } + + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/When_subscribed_to_a_event.cs b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/When_subscribed_to_a_event.cs new file mode 100644 index 00000000000..e71e457464a --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/When_subscribed_to_a_event.cs @@ -0,0 +1,231 @@ +namespace NServiceBus.Transports.RabbitMQ.Tests +{ + using System; + using NServiceBus; + using NUnit.Framework; + + [TestFixture, Category("Integration")] + [Explicit("requires rabbit node")] + public class When_subscribed_to_a_event : RabbitMqContext + { + + [Test] + public void Should_receive_published_events_of_that_type() + { + Subscribe(); + + Publish(); + + AssertReceived(); + } + + + [Test] + public void Should_receive_the_event_if_subscribed_to_the_base_class() + { + Subscribe(); + + Publish(); + Publish(); + + AssertReceived(); + AssertReceived(); + } + + + [Test] + public void Should_not_receive_the_event_if_subscribed_to_the_specific_class() + { + Subscribe(); + + Publish(); + AsserNoEventReceived(); + } + + + + [Test] + public void Should_receive_the_event_if_subscribed_to_the_base_interface() + { + Subscribe(); + + Publish(); + Publish(); + + AssertReceived(); + AssertReceived(); + } + + [Test] + public void Should_not_receive_the_event_if_subscribed_to_specific_interface() + { + Subscribe(); + + Publish(); + AsserNoEventReceived(); + } + + + [Test] + public void Should_not_receive_events_of_other_types() + { + Subscribe(); + + //publish a event that that this publisher isn't subscribed to + Publish(); + Publish(); + + AssertReceived(); + } + + [Test] + public void Subscribing_to_IEvent_should_subscribe_to_all_published_messages() + { + Subscribe(); + + Publish(); + Publish(); + + AssertReceived(); + AssertReceived(); + } + + [Test] + public void Subscribing_to_Object_should_subscribe_to_all_published_messages() + { + Subscribe(); + + Publish(); + Publish(); + + AssertReceived(); + AssertReceived(); + } + + [Test] + public void Subscribing_to_a_class_implementing_a_interface_should_only_give_the_concrete_class() + { + Subscribe(); + + Publish(); + Publish(); + + AssertReceived(); + AsserNoEventReceived(); + } + + + [Test] + public void Subscribing_to_a_interface_that_is_implemented_be_a_class_should_give_the_event_if_the_class_is_published() + { + Subscribe(); + + Publish(); + Publish(); + + AssertReceived(); + AssertReceived(); + } + + + [Test] + public void Should_not_receive_events_after_unsubscribing() + { + Subscribe(); + + subscriptionManager.Unsubscribe(typeof(MyEvent), Address.Parse(ExchangeNameConvention(null, null))); + + //publish a event that that this publisher isn't subscribed to + Publish(); + + AsserNoEventReceived(); + } + + void Subscribe() + { + subscriptionManager.Subscribe(typeof(T), Address.Parse(ExchangeNameConvention(null,null))); + } + + void Publish() + { + var type = typeof(T); + MessagePublisher.Publish(new TransportMessage { CorrelationId = type.FullName }, new[] { type }); + + } + + + void AssertReceived() + { + var receivedEvent = WaitForMessage(); + + AssertReceived(receivedEvent); + } + + void AssertReceived(TransportMessage receivedEvent) + { + Assert.AreEqual(typeof(T).FullName, receivedEvent.CorrelationId); + + } + + void AsserNoEventReceived() + { + var receivedEvent = WaitForMessage(); + + Assert.Null(receivedEvent); + } + + protected override string ExchangeNameConvention(Address address,Type eventType) + { + return "nservicebus.events"; + } + + } + + + public class MyOtherEvent + { + } + + public class MyEvent : IMessage + { + } + + public class EventBase : IEvent + { + + } + + public class SubEvent1 : EventBase + { + + } + + public class SubEvent2 : EventBase + { + + } + + + public interface IMyEvent : IEvent + { + + } + + public interface MyEvent1 : IMyEvent + { + + } + + public interface MyEvent2 : IMyEvent + { + + } + + + public class CombinedClassAndInterface : IMyEvent + { + + } + + +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/packages.config b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/packages.config new file mode 100644 index 00000000000..5b532c2d909 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ.Tests/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/Config/ConnectionConfiguration.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/ConnectionConfiguration.cs new file mode 100644 index 00000000000..9e72ae1fa1a --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/ConnectionConfiguration.cs @@ -0,0 +1,105 @@ +using IHostConfiguration = EasyNetQ.IHostConfiguration; + +namespace NServiceBus.Transports.RabbitMQ.Config +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Reflection; + using EasyNetQ; + using Settings; + using Support; + + public class ConnectionConfiguration : IConnectionConfiguration + { + public const ushort DefaultHeartBeatInSeconds = 5; + public const ushort DefaultPrefetchCount = 1; + public const ushort DefaultPort = 5672; + public static TimeSpan DefaultWaitTimeForConfirms = TimeSpan.FromSeconds(30); + IDictionary clientProperties = new Dictionary(); + IEnumerable hosts= new List(); + + public ushort Port { get; set; } + public string VirtualHost { get; set; } + public string UserName { get; set; } + public string Password { get; set; } + public ushort RequestedHeartbeat { get; set; } + public ushort PrefetchCount { get; set; } + public ushort MaxRetries { get; set; } + public bool UsePublisherConfirms { get; set; } + public TimeSpan MaxWaitTimeForConfirms { get; set; } + public TimeSpan RetryDelay { get; set; } + public IDictionary ClientProperties { + get { return clientProperties; } + private set { clientProperties = value; } + } + + public IEnumerable Hosts { + get { return hosts; } + private set { hosts = value; } + } + + public ConnectionConfiguration() + { + // set default values + Port = DefaultPort; + VirtualHost = "/"; + UserName = "guest"; + Password = "guest"; + RequestedHeartbeat = DefaultHeartBeatInSeconds; + PrefetchCount = DefaultPrefetchCount; + UsePublisherConfirms = SettingsHolder.GetOrDefault("Endpoint.DurableMessages"); + MaxWaitTimeForConfirms = DefaultWaitTimeForConfirms; + MaxRetries = 5; + RetryDelay = TimeSpan.FromSeconds(10); + SetDefaultClientProperties(); + } + + private void SetDefaultClientProperties() + { + var version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); + var applicationNameAndPath = Environment.GetCommandLineArgs()[0]; + var applicationName = Path.GetFileName(applicationNameAndPath); + var applicationPath = Path.GetDirectoryName(applicationNameAndPath); + var hostname = RuntimeEnvironment.MachineName; + + clientProperties.Add("client_api", "NServiceBus"); + clientProperties.Add("nservicebus_version", version); + clientProperties.Add("application", applicationName); + clientProperties.Add("application_location", applicationPath); + clientProperties.Add("machine_name", hostname); + clientProperties.Add("endpoint_name", Configure.EndpointName); + clientProperties.Add("user", UserName); + clientProperties.Add("connected", DateTime.Now.ToString("G")); + + } + + public void Validate() + { + if (!Hosts.Any()) + { + throw new Exception("Invalid connection string. 'host' value must be supplied. e.g: \"host=myserver\""); + } + foreach (var hostConfiguration in Hosts) + { + if (hostConfiguration.Port == 0) + { + ((HostConfiguration)hostConfiguration).Port = Port; + } + } + } + + public void ParseHosts(string hostsConnectionString) + { + var hostsAndPorts = hostsConnectionString.Split(','); + hosts = (from hostAndPort in hostsAndPorts + select hostAndPort.Split(':') into hostParts + let host = hostParts.ElementAt(0) + let portString = hostParts.ElementAtOrDefault(1) + let port = (portString == null) ? Port : ushort.Parse(portString) + select new HostConfiguration { Host = host, Port = port }).ToList(); + } + + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/Config/ConnectionStringParser.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/ConnectionStringParser.cs new file mode 100644 index 00000000000..14c409266b1 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/ConnectionStringParser.cs @@ -0,0 +1,43 @@ +using IHostConfiguration = EasyNetQ.IHostConfiguration; + +namespace NServiceBus.Transports.RabbitMQ.Config +{ + using System; + using System.Collections.Generic; + using System.ComponentModel; + using System.Data.Common; + using System.Text.RegularExpressions; + using EasyNetQ; + using System.Linq; + + public class ConnectionStringParser : DbConnectionStringBuilder, IConnectionStringParser + { + ConnectionConfiguration connectionConfiguration; + public IConnectionConfiguration Parse(string connectionString) + { + ConnectionString = connectionString; + + try + { + connectionConfiguration = new ConnectionConfiguration(); + + foreach(var pair in + (from property in typeof(ConnectionConfiguration).GetProperties() + let match = Regex.Match(connectionString, string.Format("[^\\w]*{0}=(?<{0}>[^;]+)", property.Name), RegexOptions.IgnoreCase) + where match.Success + select new { Property = property, match.Groups[property.Name].Value })) + pair.Property.SetValue(connectionConfiguration, TypeDescriptor.GetConverter(pair.Property.PropertyType).ConvertFromString(pair.Value),null); + + if (ContainsKey("host")) + connectionConfiguration.ParseHosts(this["host"] as string); + + connectionConfiguration.Validate(); + return connectionConfiguration; + } + catch (Exception parseException) + { + throw new Exception(string.Format("Connection String parsing exception {0}", parseException.Message)); + } + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/Config/IConnectionConfiguration.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/IConnectionConfiguration.cs new file mode 100644 index 00000000000..654f2dc4d86 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/IConnectionConfiguration.cs @@ -0,0 +1,23 @@ +using IHostConfiguration = EasyNetQ.IHostConfiguration; + +namespace NServiceBus.Transports.RabbitMQ.Config +{ + using System.Collections.Generic; + using System; + + public interface IConnectionConfiguration + { + ushort Port { get; } + string VirtualHost { get; } + string UserName { get; } + string Password { get; } + ushort RequestedHeartbeat { get; } + ushort PrefetchCount { get; } + IDictionary ClientProperties { get; } + + IEnumerable Hosts { get; } + TimeSpan RetryDelay { get; set; } + bool UsePublisherConfirms { get; set; } + TimeSpan MaxWaitTimeForConfirms { get; set; } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/Config/IConnectionStringParser.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/IConnectionStringParser.cs new file mode 100644 index 00000000000..3b1fbe846ec --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/IConnectionStringParser.cs @@ -0,0 +1,7 @@ +namespace NServiceBus.Transports.RabbitMQ.Config +{ + public interface IConnectionStringParser + { + IConnectionConfiguration Parse(string connectionString); + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/Config/RabbitMQ.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/RabbitMQ.cs new file mode 100644 index 00000000000..bd2622f4d14 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/RabbitMQ.cs @@ -0,0 +1,13 @@ +namespace NServiceBus +{ + using Transports; + + public class RabbitMQ : TransportDefinition + { + public RabbitMQ() + { + HasNativePubSubSupport = true; + HasSupportForCentralizedPubSub = true; + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/Config/RabbitMqSettings.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/RabbitMqSettings.cs new file mode 100644 index 00000000000..10ee02c8814 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/RabbitMqSettings.cs @@ -0,0 +1,86 @@ +namespace NServiceBus.Transports.RabbitMQ.Config +{ + using System; + using EasyNetQ; + using NServiceBus.Config; + using Settings; + using RabbitMQ; + using Routing; + + /// + /// The custom settings available for the RabbitMq transport + /// + public class RabbitMqSettings : ISetDefaultSettings + { + + /// + /// Setup the defaults + /// + public RabbitMqSettings() + { + InfrastructureServices.SetDefaultFor(typeof(ConventionalRoutingTopology),DependencyLifecycle.SingleInstance); + InfrastructureServices.SetDefaultFor(ConfigureDefaultConnectionManager); + } + + /// + /// Use the direct routing topology with the given conventions + /// + /// + /// + /// + public RabbitMqSettings UseDirectRoutingTopology(Func routingKeyConvention = null, Func exchangeNameConvention = null) + { + if (routingKeyConvention == null) + { + routingKeyConvention = DefaultRoutingKeyConvention.GenerateRoutingKey; + } + + if (exchangeNameConvention == null) + { + exchangeNameConvention = (address, eventType) => "amq.topic"; + } + + InfrastructureServices.RegisterServiceFor(() => + { + var router = new DirectRoutingTopology + { + ExchangeNameConvention = exchangeNameConvention, + RoutingKeyConvention = routingKeyConvention + }; + + Configure.Instance.Configurer.RegisterSingleton(router); + }); + return this; + } + + /// + /// Register a custom routing topology + /// + /// + /// + public RabbitMqSettings UseRoutingTopology() + { + InfrastructureServices.RegisterServiceFor(typeof(T), DependencyLifecycle.SingleInstance); + return this; + } + + /// + /// Registers a custom connection manager te be used + /// + /// + /// + public RabbitMqSettings UseConnectionManager() + { + InfrastructureServices.RegisterServiceFor(typeof(T), DependencyLifecycle.SingleInstance); + return this; + } + + + void ConfigureDefaultConnectionManager() + { + Configure.Component(DependencyLifecycle.SingleInstance); + + Configure.Instance.Configurer.ConfigureComponent(builder =>new ConnectionFactoryWrapper(builder.Build(), new DefaultClusterHostSelectionStrategy()), DependencyLifecycle.InstancePerCall); + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/Config/RabbitMqSettingsExtensions.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/RabbitMqSettingsExtensions.cs new file mode 100644 index 00000000000..419d6cd652d --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/RabbitMqSettingsExtensions.cs @@ -0,0 +1,24 @@ +namespace NServiceBus +{ + using System; + using Settings; + using Transports.RabbitMQ.Config; + + /// + /// Adds access to the RabbitMQ transport config to the global Transports object + /// + public static class RabbitMqSettingsExtensions + { + /// + /// RabbitMq settings. + /// + /// + /// The actual setting + /// + public static TransportSettings RabbitMq(this TransportSettings configuration, Action action) + { + action(new RabbitMqSettings()); + return configuration; + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/Config/RabbitMqTransport.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/RabbitMqTransport.cs new file mode 100644 index 00000000000..634e48eeb7c --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/Config/RabbitMqTransport.cs @@ -0,0 +1,58 @@ +namespace NServiceBus.Features +{ + using Config; + using Settings; + using Transports; + using Transports.RabbitMQ; + using Transports.RabbitMQ.Config; + using Transports.RabbitMQ.Routing; + using Unicast.Queuing.Installers; + + public class RabbitMqTransport : ConfigureTransport + { + public override void Initialize() + { + if (!SettingsHolder.GetOrDefault("ScaleOut.UseSingleBrokerQueue")) + { + Address.InitializeLocalAddress(Address.Local.Queue + "." + Address.Local.Machine); + } + + var connectionString = SettingsHolder.Get("NServiceBus.Transport.ConnectionString"); + var connectionConfiguration = new ConnectionStringParser().Parse(connectionString); + + NServiceBus.Configure.Instance.Configurer.RegisterSingleton(connectionConfiguration); + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(p => p.PurgeOnStartup, ConfigurePurging.PurgeRequested) + .ConfigureProperty(p => p.PrefetchCount, connectionConfiguration.PrefetchCount); + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(p => p.UsePublisherConfirms, connectionConfiguration.UsePublisherConfirms) + .ConfigureProperty(p => p.MaxWaitTimeForConfirms, connectionConfiguration.MaxWaitTimeForConfirms); + + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + + NServiceBus.Configure.Component(DependencyLifecycle.SingleInstance) + .ConfigureProperty(p => p.EndpointQueueName, Address.Local.Queue); + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + + InfrastructureServices.Enable(); + InfrastructureServices.Enable(); + } + + + protected override void InternalConfigure(Configure config) + { + Enable(); + } + + protected override string ExampleConnectionStringForErrorMessage + { + get { return "host=localhost"; } + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/DefaultRoutingKeyConvention.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/DefaultRoutingKeyConvention.cs new file mode 100644 index 00000000000..7e38370e0c0 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/DefaultRoutingKeyConvention.cs @@ -0,0 +1,38 @@ +namespace NServiceBus.Transports.RabbitMQ +{ + using System; + using System.Linq; + using Utils.Reflection; + + public class DefaultRoutingKeyConvention + { + public static string GenerateRoutingKey(Type eventType) + { + return GetRoutingKey(eventType); + } + + static string GetRoutingKey(Type type, string key = "") + { + var baseType = type.BaseType; + + + if (baseType != null && !baseType.IsSystemType()) + key = GetRoutingKey(baseType, key); + + + var interfaces = type.GetInterfaces() + .Where(i => !ExtensionMethods.IsSystemType(i) && !ExtensionMethods.IsNServiceBusMarkerInterface(i)).ToList(); + + var implementedInterface = interfaces.FirstOrDefault(); + + if (implementedInterface != null) + key = GetRoutingKey(implementedInterface, key); + + + if (!string.IsNullOrEmpty(key)) + key += "."; + + return key + type.FullName.Replace(".", "-"); + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/ConnectionFactoryInfo.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/ConnectionFactoryInfo.cs new file mode 100644 index 00000000000..c7c4a830ffc --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/ConnectionFactoryInfo.cs @@ -0,0 +1,16 @@ +namespace EasyNetQ +{ + using RabbitMQ.Client; + + public class ConnectionFactoryInfo + { + public ConnectionFactoryInfo(ConnectionFactory connectionFactory, IHostConfiguration hostConfiguration) + { + ConnectionFactory = connectionFactory; + HostConfiguration = hostConfiguration; + } + + public ConnectionFactory ConnectionFactory { get; private set; } + public IHostConfiguration HostConfiguration { get; private set; } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/ConnectionFactoryWrapper.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/ConnectionFactoryWrapper.cs new file mode 100644 index 00000000000..1afac317c6a --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/ConnectionFactoryWrapper.cs @@ -0,0 +1,85 @@ +namespace EasyNetQ +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using NServiceBus.Transports.RabbitMQ.Config; + using RabbitMQ.Client; + + public class ConnectionFactoryWrapper : IConnectionFactory + { + public virtual IConnectionConfiguration Configuration { get; private set; } + private readonly IClusterHostSelectionStrategy clusterHostSelectionStrategy; + + public ConnectionFactoryWrapper(IConnectionConfiguration connectionConfiguration, IClusterHostSelectionStrategy clusterHostSelectionStrategy) + { + this.clusterHostSelectionStrategy = clusterHostSelectionStrategy; + if(connectionConfiguration == null) + { + throw new ArgumentNullException("connectionConfiguration"); + } + if (!connectionConfiguration.Hosts.Any()) + { + throw new EasyNetQException("At least one host must be defined in connectionConfiguration"); + } + + Configuration = connectionConfiguration; + + foreach (var hostConfiguration in Configuration.Hosts) + { + clusterHostSelectionStrategy.Add(new ConnectionFactoryInfo(new ConnectionFactory + { + HostName = hostConfiguration.Host, + Port = hostConfiguration.Port, + VirtualHost = Configuration.VirtualHost, + UserName = Configuration.UserName, + Password = Configuration.Password, + RequestedHeartbeat = Configuration.RequestedHeartbeat, + ClientProperties = ConvertToHashtable(Configuration.ClientProperties) + }, hostConfiguration)); + } + } + + private static IDictionary ConvertToHashtable(IDictionary clientProperties) + { + var dictionary = new Hashtable(); + foreach (var clientProperty in clientProperties) + { + dictionary.Add(clientProperty.Key, clientProperty.Value); + } + return dictionary; + } + + public virtual IConnection CreateConnection() { + var connectionFactoryInfo = clusterHostSelectionStrategy.Current(); + var connectionFactory = connectionFactoryInfo.ConnectionFactory; + return connectionFactory.CreateConnection(); + } + + public virtual IHostConfiguration CurrentHost + { + get { return clusterHostSelectionStrategy.Current().HostConfiguration; } + } + + public virtual bool Next() + { + return clusterHostSelectionStrategy.Next(); + } + + public virtual void Reset() + { + clusterHostSelectionStrategy.Reset(); + } + + public virtual void Success() + { + clusterHostSelectionStrategy.Success(); + } + + public virtual bool Succeeded + { + get { return clusterHostSelectionStrategy.Succeeded; } + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/DefaultClusterHostSelectionStrategy.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/DefaultClusterHostSelectionStrategy.cs new file mode 100644 index 00000000000..e3d7b9ee1f2 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/DefaultClusterHostSelectionStrategy.cs @@ -0,0 +1,86 @@ +using System.Collections; +using System.Collections.Generic; + +namespace EasyNetQ +{ + /// + /// A collection that hands out the next item until success, or until every item has been tried. + /// + public class DefaultClusterHostSelectionStrategy : IClusterHostSelectionStrategy, IEnumerable + { + private readonly IList items = new List(); + private int currentIndex = 0; + private int startIndex = 0; + + public virtual void Add(T item) + { + items.Add(item); + startIndex = items.Count-1; + } + + public virtual T Current() + { + if (items.Count == 0) + { + throw new EasyNetQException("No items in collection"); + } + + return items[currentIndex]; + } + + public virtual bool Next() + { + if (currentIndex == startIndex) return false; + if (Succeeded) return false; + + IncrementIndex(); + + return true; + } + + public virtual IEnumerator GetEnumerator() + { + return items.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public virtual void Success() + { + Succeeded = true; + startIndex = currentIndex; + } + + public virtual bool Succeeded { get; private set; } + + private bool firstUse = true; + + public DefaultClusterHostSelectionStrategy() + { + Succeeded = false; + } + + public virtual void Reset() + { + Succeeded = false; + if (firstUse) + { + firstUse = false; + return; + } + IncrementIndex(); + } + + private void IncrementIndex() + { + currentIndex++; + if (currentIndex == items.Count) + { + currentIndex = 0; + } + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/EasyNetQException.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/EasyNetQException.cs new file mode 100644 index 00000000000..91d5030f3f8 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/EasyNetQException.cs @@ -0,0 +1,28 @@ +using System; +using System.Runtime.Serialization; + +namespace EasyNetQ +{ + [Serializable] + public class EasyNetQException : Exception + { + public EasyNetQException() {} + public EasyNetQException(string message) : base(message) {} + public EasyNetQException(string format, params string[] args) : base(string.Format(format, args)) {} + public EasyNetQException(string message, Exception inner) : base(message, inner) {} + + protected EasyNetQException( + SerializationInfo info, + StreamingContext context) : base(info, context) {} + } + + [Serializable] + public class EasyNetQInvalidMessageTypeException : EasyNetQException + { + public EasyNetQInvalidMessageTypeException() {} + public EasyNetQInvalidMessageTypeException(string message) : base(message) {} + public EasyNetQInvalidMessageTypeException(string format, params string[] args) : base(format, args) {} + public EasyNetQInvalidMessageTypeException(string message, Exception inner) : base(message, inner) {} + protected EasyNetQInvalidMessageTypeException(SerializationInfo info, StreamingContext context) : base(info, context) {} + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/HostConfiguration.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/HostConfiguration.cs new file mode 100644 index 00000000000..959f1a4b05c --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/HostConfiguration.cs @@ -0,0 +1,8 @@ +namespace EasyNetQ +{ + public class HostConfiguration : IHostConfiguration + { + public string Host { get; set; } + public ushort Port { get; set; } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/IClusterHostSelectionStrategy.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/IClusterHostSelectionStrategy.cs new file mode 100644 index 00000000000..a651a037ee4 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/IClusterHostSelectionStrategy.cs @@ -0,0 +1,42 @@ +namespace EasyNetQ +{ + /// + /// Provides a strategy for selecting a host from a list of nodes in a cluster + /// + /// + public interface IClusterHostSelectionStrategy + { + /// + /// Add a cluster node + /// + /// + void Add(T item); + + /// + /// Get the currently selected node + /// + /// + T Current(); + + /// + /// Move to the next node + /// + /// + bool Next(); + + /// + /// Mark the current node as successfully connected + /// + void Success(); + + /// + /// Did the current node successfully connect? + /// + bool Succeeded { get; } + + /// + /// The current node has disconnected and we want to run the strategy again + /// + void Reset(); + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/IConnectionFactory.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/IConnectionFactory.cs new file mode 100644 index 00000000000..2c5cec79188 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/IConnectionFactory.cs @@ -0,0 +1,17 @@ +using RabbitMQ.Client; + +namespace EasyNetQ +{ + using NServiceBus.Transports.RabbitMQ.Config; + + public interface IConnectionFactory + { + IConnection CreateConnection(); + IConnectionConfiguration Configuration { get; } + IHostConfiguration CurrentHost { get; } + bool Next(); + void Success(); + void Reset(); + bool Succeeded { get; } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/IHostConfiguration.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/IHostConfiguration.cs new file mode 100644 index 00000000000..5f423744018 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/IHostConfiguration.cs @@ -0,0 +1,8 @@ +namespace EasyNetQ +{ + public interface IHostConfiguration + { + string Host { get; } + ushort Port { get; } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/licence.txt b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/licence.txt new file mode 100644 index 00000000000..d51787d8ca7 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/licence.txt @@ -0,0 +1,21 @@ +The MIT License + +Copyright (c) 2011 Mike Hadlow + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/readme.txt b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/readme.txt new file mode 100644 index 00000000000..c72222848ef --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/EasyNetQ/readme.txt @@ -0,0 +1,2 @@ +As the NServiceBus team want to keep external dependencies to a minimum (see http://tech.groups.yahoo.com/group/nservicebus/message/18588), EasyNetQ +code has been copied into this project rather than pulled in via nuget. \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/IManageRabbitMqConnections.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/IManageRabbitMqConnections.cs new file mode 100644 index 00000000000..025cab4e4d3 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/IManageRabbitMqConnections.cs @@ -0,0 +1,16 @@ +namespace NServiceBus.Transports.RabbitMQ +{ + using global::RabbitMQ.Client; + + public interface IManageRabbitMqConnections + { + IConnection GetConnection(ConnectionPurpose purpose); + } + + public enum ConnectionPurpose + { + Publish=1, + Consume=2, + Administration = 3 + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/IPersistentConnection.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/IPersistentConnection.cs new file mode 100644 index 00000000000..46ba352b15e --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/IPersistentConnection.cs @@ -0,0 +1,13 @@ +namespace NServiceBus.Transports.RabbitMQ +{ + using System; + using global::RabbitMQ.Client; + + public interface IPersistentConnection + { + event Action Connected; + event Action Disconnected; + bool IsConnected { get; } + IModel CreateModel(); + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/NServiceBus.Transports.RabbitMQ.csproj b/src/RabbitMQ/NServiceBus.RabbitMQ/NServiceBus.Transports.RabbitMQ.csproj new file mode 100644 index 00000000000..c5d77c20997 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/NServiceBus.Transports.RabbitMQ.csproj @@ -0,0 +1,111 @@ + + + + + Debug + AnyCPU + {BA731749-22C7-4025-8A4D-465AE8E02E61} + Library + Properties + NServiceBus.Transports.RabbitMQ + NServiceBus.Transports.RabbitMQ + v4.0 + 512 + true + ..\..\NServiceBus.snk + ..\..\..\ + true + + + true + full + false + ..\..\..\binaries\ + DEBUG;TRACE + prompt + 4 + ..\..\..\binaries\NServiceBus.Transports.RabbitMQ.XML + 1591 + + + pdbonly + true + ..\..\..\binaries\ + TRACE + prompt + 4 + ..\..\..\binaries\NServiceBus.Transports.RabbitMQ.xml + + + + ..\..\..\packages\RabbitMQ.Client.3.0.0\lib\net30\RabbitMQ.Client.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {DD48B2D0-E996-412D-9157-821ED8B17A9D} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + + + + + + + + + \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/PersistentConnection.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/PersistentConnection.cs new file mode 100644 index 00000000000..6bce841cb53 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/PersistentConnection.cs @@ -0,0 +1,306 @@ +namespace NServiceBus.Transports.RabbitMQ +{ + using System; + using System.Threading; + using EasyNetQ; + using System.Collections; + using Logging; + using global::RabbitMQ.Client; + using global::RabbitMQ.Client.Events; + using global::RabbitMQ.Client.Exceptions; + + /// + /// A connection that attempts to reconnect if the inner connection is closed. + /// + public class PersistentConnection : IPersistentConnection, IConnection + { + public PersistentConnection(IConnectionFactory connectionFactory, TimeSpan retryDelay) + { + this.connectionFactory = connectionFactory; + this.retryDelay = retryDelay; + + TryToConnect(null); + } + + public event Action Connected; + public event Action Disconnected; + + public IModel CreateModel() + { + if (!IsConnected) + { + throw new InvalidOperationException("Rabbit server is not connected."); + } + return connection.CreateModel(); + } + + public bool IsConnected + { + get { return connection != null && connection.IsOpen && !disposed; } + } + + public void Close() + { + connection.ConnectionShutdown -= OnConnectionShutdown; + connection.Close(); + } + + public void Close(int timeout) + { + connection.ConnectionShutdown -= OnConnectionShutdown; + connection.Close(timeout); + } + + + void StartTryToConnect() + { + var timer = new Timer(TryToConnect); + timer.Change(Convert.ToInt32(retryDelay.TotalMilliseconds), Timeout.Infinite); + } + + void TryToConnect(object timer) + { + if (timer != null) + { + ((Timer) timer).Dispose(); + } + + Logger.Debug("Trying to connect"); + if (disposed) + { + return; + } + + connectionFactory.Reset(); + do + { + try + { + connection = connectionFactory.CreateConnection(); + connectionFactory.Success(); + } + catch (System.Net.Sockets.SocketException socketException) + { + LogException(socketException); + } + catch (BrokerUnreachableException brokerUnreachableException) + { + LogException(brokerUnreachableException); + } + } while (connectionFactory.Next()); + + if (connectionFactory.Succeeded) + { + connection.ConnectionShutdown += OnConnectionShutdown; + + OnConnected(); + Logger.InfoFormat("Connected to RabbitMQ. Broker: '{0}', Port: {1}, VHost: '{2}'", + connectionFactory.CurrentHost.Host, + connectionFactory.CurrentHost.Port, + connectionFactory.Configuration.VirtualHost); + } + else + { + Logger.ErrorFormat("Failed to connected to any Broker. Retrying in {0}", retryDelay); + StartTryToConnect(); + } + } + + void LogException(Exception exception) + { + Logger.ErrorFormat("Failed to connect to Broker: '{0}', Port: {1} VHost: '{2}'. " + + "ExceptionMessage: '{3}'", + connectionFactory.CurrentHost.Host, + connectionFactory.CurrentHost.Port, + connectionFactory.Configuration.VirtualHost, + exception.Message); + } + + void OnConnectionShutdown(IConnection _, ShutdownEventArgs reason) + { + if (disposed) + { + return; + } + OnDisconnected(); + + Logger.InfoFormat("Disconnected from RabbitMQ Broker, reason: {0} , going to reconnect", reason); + + TryToConnect(null); + } + + public void OnConnected() + { + Logger.Debug("OnConnected event fired"); + if (Connected != null) + { + Connected(); + } + } + + public void OnDisconnected() + { + if (Disconnected != null) + { + Disconnected(); + } + } + + + public void Abort() + { + connection.Abort(); + } + + public void Abort(ushort reasonCode, string reasonText) + { + connection.Abort(reasonCode, reasonText); + } + + public void Abort(int timeout) + { + connection.Abort(timeout); + } + + public void Abort(ushort reasonCode, string reasonText, int timeout) + { + connection.Abort(reasonCode, reasonText, timeout); + } + + public AmqpTcpEndpoint Endpoint + { + get { return connection.Endpoint; } + } + + public IProtocol Protocol + { + get { return connection.Protocol; } + } + + public ushort ChannelMax + { + get { return connection.ChannelMax; } + } + + public uint FrameMax + { + get { return connection.FrameMax; } + } + + public ushort Heartbeat + { + get { return connection.Heartbeat; } + } + + public IDictionary ClientProperties + { + get { return connection.ClientProperties; } + } + + public IDictionary ServerProperties + { + get { return connection.ServerProperties; } + } + + public AmqpTcpEndpoint[] KnownHosts + { + get { return connection.KnownHosts; } + } + + public ShutdownEventArgs CloseReason + { + get { return connection.CloseReason; } + } + + public bool IsOpen + { + get { return connection.IsOpen; } + } + + public bool AutoClose + { + get { return connection.AutoClose; } + set { connection.AutoClose = value; } + } + + public IList ShutdownReport + { + get { return connection.ShutdownReport; } + } + + public event ConnectionShutdownEventHandler ConnectionShutdown + { + add { connection.ConnectionShutdown += value; } + remove { connection.ConnectionShutdown -= value; } + } + + public event CallbackExceptionEventHandler CallbackException + { + add { connection.CallbackException += value; } + remove { connection.CallbackException -= value; } + } + + public void Close(ushort reasonCode, string reasonText, int timeout) + { + connection.Close(reasonCode, reasonText, timeout); + } + + public void Close(ushort reasonCode, string reasonText) + { + connection.Close(reasonCode, reasonText); + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + // Dispose managed resources. + if (connection == null) + { + return; + } + + try + { + if (connection.IsOpen) + { + Close(5000); + } + + connection.Dispose(); + } + catch (Exception ex) + { + Logger.Error("Failure when disposing RabbitMq connection", ex); + } + + connection = null; + } + + disposed = true; + } + + ~PersistentConnection() + { + Dispose(false); + } + + bool disposed; + IConnection connection; + readonly IConnectionFactory connectionFactory; + readonly TimeSpan retryDelay; + + static readonly ILog Logger = LogManager.GetLogger(typeof (RabbitMqConnectionManager)); + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/Properties/AssemblyInfo.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..ee23e683e67 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("NServiceBus.RabbitMQ")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyProduct("NServiceBus.RabbitMQ")] +[assembly: AssemblyCompany("NServiceBus")] +[assembly: AssemblyConfiguration("release")] +[assembly: AssemblyInformationalVersion("4.0.0-alpha0")] +[assembly: ComVisible(false)] +[assembly: CLSCompliantAttribute(true)] + diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqConnectionManager.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqConnectionManager.cs new file mode 100644 index 00000000000..bc0db9dff24 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqConnectionManager.cs @@ -0,0 +1,72 @@ +namespace NServiceBus.Transports.RabbitMQ +{ + using System; + using Config; + using EasyNetQ; + using Logging; + using global::RabbitMQ.Client; + + public class RabbitMqConnectionManager : IDisposable, IManageRabbitMqConnections + { + public RabbitMqConnectionManager(IConnectionFactory connectionFactory,IConnectionConfiguration connectionConfiguration) + { + this.connectionFactory = connectionFactory; + this.connectionConfiguration = connectionConfiguration; + } + + public IConnection GetConnection(ConnectionPurpose purpose) + { + //note: The purpose is there so that we/users can add more advanced connection managers in the future + + lock (connectionFactory) + { + if (connectionFailed) + throw connectionFailedReason; + + return connection ?? (connection = new PersistentConnection(connectionFactory, connectionConfiguration.RetryDelay)); + } + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + // Dispose managed resources. + if (connection == null) + { + return; + } + + connection.Dispose(); + connection = null; + } + + disposed = true; + } + + ~RabbitMqConnectionManager() + { + Dispose(false); + } + + readonly IConnectionFactory connectionFactory; + readonly IConnectionConfiguration connectionConfiguration; + PersistentConnection connection; + bool connectionFailed; + Exception connectionFailedReason; + bool disposed; + + static readonly ILog Logger = LogManager.GetLogger(typeof(RabbitMqConnectionManager)); + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqDequeueStrategy.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqDequeueStrategy.cs new file mode 100644 index 00000000000..3dd52e95719 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqDequeueStrategy.cs @@ -0,0 +1,198 @@ +namespace NServiceBus.Transports.RabbitMQ +{ + using System; + using System.Threading; + using System.Threading.Tasks; + using CircuitBreakers; + using Logging; + using Unicast.Transport; + using global::RabbitMQ.Client; + using global::RabbitMQ.Client.Events; + + /// + /// Default implementation of for RabbitMQ. + /// + public class RabbitMqDequeueStrategy : IDequeueMessages + { + /// + /// The connection to the RabbitMQ broker + /// + public IManageRabbitMqConnections ConnectionManager { get; set; } + + + /// + /// Determines if the queue should be purged when the transport starts + /// + public bool PurgeOnStartup { get; set; } + + /// + /// The number of messages to allow the RabbitMq client to pre-fetch from the broker + /// + public ushort PrefetchCount { get; set; } + + /// + /// Initializes the . + /// + /// The address to listen on. + /// The to be used by . + /// Called when a message has been dequeued and is ready for processing. + /// Needs to be called by after the message has been processed regardless if the outcome was successful or not. + public void Init(Address address, TransactionSettings transactionSettings, Func tryProcessMessage, Action endProcessMessage) + { + this.tryProcessMessage = tryProcessMessage; + this.endProcessMessage = endProcessMessage; + workQueue = address.Queue; + autoAck = !transactionSettings.IsTransactional; + } + + /// + /// Starts the dequeuing of message using the specified . + /// + /// Indicates the maximum concurrency level this is able to support. + public void Start(int maximumConcurrencyLevel) + { + if (PurgeOnStartup) + { + Purge(); + } + + for (int i = 0; i < maximumConcurrencyLevel; i++) + { + StartConsumer(); + } + } + + /// + /// Stops the dequeuing of messages. + /// + public void Stop() + { + tokenSource.Cancel(); + } + + void StartConsumer() + { + var token = tokenSource.Token; + + Task.Factory + .StartNew(Action, token, token, TaskCreationOptions.LongRunning, TaskScheduler.Default) + .ContinueWith(t => + { + t.Exception.Handle(ex => + { + circuitBreaker.Failure(ex); + return true; + }); + + StartConsumer(); + }, TaskContinuationOptions.OnlyOnFaulted); + } + + private void Action(object obj) + { + var cancellationToken = (CancellationToken)obj; + var connection = ConnectionManager.GetConnection(ConnectionPurpose.Consume); + + using (var channel = connection.CreateModel()) + { + channel.BasicQos(0, PrefetchCount, false); + + var consumer = new QueueingBasicConsumer(channel); + + channel.BasicConsume(workQueue, autoAck, consumer); + + circuitBreaker.Success(); + + while (!cancellationToken.IsCancellationRequested) + { + Exception exception = null; + BasicDeliverEventArgs message = null; + + message = DequeueMessage(consumer); + + if (message == null) + { + continue; + } + + TransportMessage transportMessage = null; + + try + { + var messageProcessedOk = false; + + try + { + transportMessage = RabbitMqTransportMessageExtensions.ToTransportMessage(message); + } + catch (Exception ex) + { + Logger.Error("Poison message detected, deliveryTag: " + message.DeliveryTag, ex); + + //just ack the poison message to avoid getting stuck + messageProcessedOk = true; + } + + if (transportMessage != null) + { + messageProcessedOk = tryProcessMessage(transportMessage); + } + + if (!autoAck) + { + if (messageProcessedOk) + channel.BasicAck(message.DeliveryTag, false); + else + channel.BasicReject(message.DeliveryTag, true); + } + } + catch (Exception ex) + { + exception = ex; + + if (!autoAck) + channel.BasicReject(message.DeliveryTag, true); + } + finally + { + endProcessMessage(transportMessage, exception); + } + } + } + } + + static BasicDeliverEventArgs DequeueMessage(QueueingBasicConsumer consumer) + { + object rawMessage; + + if (!consumer.Queue.Dequeue(1000, out rawMessage)) + { + return null; + } + + return (BasicDeliverEventArgs)rawMessage; + } + + void Purge() + { + using (var channel = ConnectionManager.GetConnection(ConnectionPurpose.Administration).CreateModel()) + { + channel.QueuePurge(workQueue); + } + } + + readonly ICircuitBreaker circuitBreaker = new RepeatedFailuresOverTimeCircuitBreaker("RabbitMqConnectivity", + TimeSpan.FromMinutes(2), + ex => Configure.Instance.RaiseCriticalError("Repeated failures when communicating with the RabbitMq broker", ex), + TimeSpan.FromSeconds(5)); + + Func tryProcessMessage; + bool autoAck; + //MTATaskScheduler scheduler; + readonly CancellationTokenSource tokenSource = new CancellationTokenSource(); + string workQueue; + Action endProcessMessage; + + static ILog Logger = LogManager.GetLogger(typeof(RabbitMqDequeueStrategy)); + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqMessagePublisher.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqMessagePublisher.cs new file mode 100644 index 00000000000..ebd7e21d3e9 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqMessagePublisher.cs @@ -0,0 +1,33 @@ +namespace NServiceBus.Transports.RabbitMQ +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Routing; + + public class RabbitMqMessagePublisher : IPublishMessages + { + public IRoutingTopology RoutingTopology { get; set; } + + + public bool Publish(TransportMessage message, IEnumerable eventTypes) + { + var eventType = eventTypes.First();//we route on the first event for now + + + + UnitOfWork.Add(channel => + { + var properties = RabbitMqTransportMessageExtensions.FillRabbitMqProperties(message, + channel.CreateBasicProperties()); + + RoutingTopology.Publish(channel, eventType, message, properties); + }); + + //we don't know if there was a subscriber so we just return true + return true; + } + + public RabbitMqUnitOfWork UnitOfWork { get; set; } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqMessageSender.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqMessageSender.cs new file mode 100644 index 00000000000..6c9c868ce3c --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqMessageSender.cs @@ -0,0 +1,19 @@ +namespace NServiceBus.Transports.RabbitMQ +{ + using Routing; + + public class RabbitMqMessageSender : ISendMessages + { + public IRoutingTopology RoutingTopology { get; set; } + public void Send(TransportMessage message, Address address) + { + UnitOfWork.Add(channel => + { + var properties = RabbitMqTransportMessageExtensions.FillRabbitMqProperties(message,channel.CreateBasicProperties()); + RoutingTopology.Send(channel, address, message, properties); + }); + } + + public RabbitMqUnitOfWork UnitOfWork { get; set; } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqQueueCreator.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqQueueCreator.cs new file mode 100644 index 00000000000..886217c76e8 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqQueueCreator.cs @@ -0,0 +1,20 @@ +namespace NServiceBus.Transports.RabbitMQ +{ + using Settings; + + public class RabbitMqQueueCreator : ICreateQueues + { + public IManageRabbitMqConnections ConnectionManager { get; set; } + + public void CreateQueueIfNecessary(Address address, string account) + { + var durable = SettingsHolder.Get("Endpoint.DurableMessages"); + + using (var channel = ConnectionManager.GetConnection(ConnectionPurpose.Administration).CreateModel()) + { + channel.QueueDeclare(address.Queue, durable, false, false, null); + } + + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqSubscriptionManager.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqSubscriptionManager.cs new file mode 100644 index 00000000000..061d5980db6 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqSubscriptionManager.cs @@ -0,0 +1,30 @@ +namespace NServiceBus.Transports.RabbitMQ +{ + using System; + using Routing; + + public class RabbitMqSubscriptionManager : IManageSubscriptions + { + public IManageRabbitMqConnections ConnectionManager { get; set; } + + public string EndpointQueueName { get; set; } + + public IRoutingTopology RoutingTopology { get; set; } + + public void Subscribe(Type eventType, Address publisherAddress) + { + using (var channel = ConnectionManager.GetConnection(ConnectionPurpose.Administration).CreateModel()) + { + RoutingTopology.SetupSubscription(channel, eventType, EndpointQueueName); + } + } + + public void Unsubscribe(Type eventType, Address publisherAddress) + { + using (var channel = ConnectionManager.GetConnection(ConnectionPurpose.Administration).CreateModel()) + { + RoutingTopology.TeardownSubscription(channel, eventType, EndpointQueueName); + } + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqTransportMessageExtensions.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqTransportMessageExtensions.cs new file mode 100644 index 00000000000..c1d36cf4c27 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqTransportMessageExtensions.cs @@ -0,0 +1,90 @@ +namespace NServiceBus.Transports.RabbitMQ +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Text; + using IdGeneration; + using global::RabbitMQ.Client; + using global::RabbitMQ.Client.Events; + + public static class RabbitMqTransportMessageExtensions + { + public static IBasicProperties FillRabbitMqProperties(TransportMessage message, IBasicProperties properties) + { + properties.MessageId = message.Id; + + properties.CorrelationId = message.CorrelationId; + + if (message.TimeToBeReceived < TimeSpan.MaxValue) + properties.Expiration = message.TimeToBeReceived.TotalMilliseconds.ToString(); + + properties.SetPersistent(message.Recoverable); + + properties.Headers = message.Headers; + + if (message.Headers.ContainsKey(Headers.EnclosedMessageTypes)) + { + properties.Type = message.Headers[Headers.EnclosedMessageTypes].Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault(); + } + + if (message.Headers.ContainsKey(Headers.ContentType)) + properties.ContentType = message.Headers[Headers.ContentType]; + else + { + properties.ContentType = "application/octet-stream"; + } + + + if (message.ReplyToAddress != null && message.ReplyToAddress != Address.Undefined) + properties.ReplyTo = message.ReplyToAddress.Queue; + + return properties; + } + + public static TransportMessage ToTransportMessage(BasicDeliverEventArgs message) + { + var properties = message.BasicProperties; + + if (!properties.IsMessageIdPresent() || string.IsNullOrWhiteSpace(properties.MessageId)) + throw new InvalidOperationException("A non empty message_id property is required when running NServiceBus on top of RabbitMq. If this is a interop message please make sure to set the message_id property before publishing the message"); + + var headers = DeserializeHeaders(message); + + var result = new TransportMessage(properties.MessageId, headers) + { + Body = message.Body, + }; + + if (properties.IsReplyToPresent()) + result.ReplyToAddress = Address.Parse(properties.ReplyTo); + + if (properties.IsCorrelationIdPresent()) + result.CorrelationId = properties.CorrelationId; + + //When doing native interop we only require the type to be set the "fullname" of the message + if (!result.Headers.ContainsKey(Headers.EnclosedMessageTypes) && properties.IsTypePresent()) + { + result.Headers[Headers.EnclosedMessageTypes] = properties.Type; + } + + return result; + } + + static Dictionary DeserializeHeaders(BasicDeliverEventArgs message) + { + if (message.BasicProperties.Headers == null) + { + return new Dictionary(); + } + + return message.BasicProperties.Headers.Cast() + .ToDictionary( + kvp => (string)kvp.Key, + kvp => kvp.Value == null ? null : Encoding.UTF8.GetString((byte[])kvp.Value)); + + } + } + +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqUnitOfWork.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqUnitOfWork.cs new file mode 100644 index 00000000000..037f946bf4d --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/RabbitMqUnitOfWork.cs @@ -0,0 +1,104 @@ +namespace NServiceBus.Transports.RabbitMQ +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Transactions; + using global::RabbitMQ.Client; + + public class RabbitMqUnitOfWork + { + public IManageRabbitMqConnections ConnectionManager { get; set; } + + /// + /// If set to true pulisher confirms will be used to make sure that messages are acked by the broker before considered to be published + /// + public bool UsePublisherConfirms { get; set; } + + /// + /// The maximum time to wait for all publisher confirms to be received + /// + public TimeSpan MaxWaitTimeForConfirms { get; set; } + + public void Add(Action action) + { + var transaction = Transaction.Current; + + if (transaction == null) + { + ExecuteRabbitMqActions(new[] { action }); + + return; + } + + var transactionId = transaction.TransactionInformation.LocalIdentifier; + + if (!OutstandingOperations.ContainsKey(transactionId)) + { + transaction.TransactionCompleted += ExecuteActionsAgainstRabbitMq; + OutstandingOperations.Add(transactionId, new List> { action }); + return; + } + + OutstandingOperations[transactionId].Add(action); + } + + void ExecuteActionsAgainstRabbitMq(object sender, TransactionEventArgs transactionEventArgs) + { + var transactionInfo = transactionEventArgs.Transaction.TransactionInformation; + + if (transactionInfo.Status != TransactionStatus.Committed) + { + OutstandingOperations.Clear(); + return; + } + + var transactionId = transactionInfo.LocalIdentifier; + + if (!OutstandingOperations.ContainsKey(transactionId)) + return; + + var actions = OutstandingOperations[transactionId]; + + if (!actions.Any()) + return; + + ExecuteRabbitMqActions(actions); + + OutstandingOperations.Clear(); + } + + void ExecuteRabbitMqActions(IList> actions) + { + using (var channel = ConnectionManager.GetConnection(ConnectionPurpose.Publish).CreateModel()) + { + if (UsePublisherConfirms) + { + channel.ConfirmSelect(); + } + + + foreach (var action in actions) + { + action(channel); + } + + channel.WaitForConfirmsOrDie(MaxWaitTimeForConfirms); + } + } + + + IDictionary>> OutstandingOperations + { + get + { + return outstandingOperations ?? (outstandingOperations = new Dictionary>>()); + } + } + + + //we use a dictionary to make sure that actions from other tx doesn't spill over if threads are getting reused by the hosting infrastrcture + [ThreadStatic] + static IDictionary>> outstandingOperations; + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/Routing/ConventionalRoutingTopology.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/Routing/ConventionalRoutingTopology.cs new file mode 100644 index 00000000000..a4a3759eae9 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/Routing/ConventionalRoutingTopology.cs @@ -0,0 +1,146 @@ +namespace NServiceBus.Transports.RabbitMQ.Routing +{ + using System; + using System.Collections.Concurrent; + using System.Linq; + using Settings; + using global::RabbitMQ.Client; + + /// + /// Implements the RabbitMQ routing topology as described at http://codebetter.com/drusellers/2011/05/08/brain-dump-conventional-routing-in-rabbitmq/ + /// take 4: + /// + /// we generate an exchange for each queue so that we can do direct sends to the queue. it is bound as a fanout exchange + /// for each message published we generate series of exchanges that go from concrete class to each of its subclass + /// / interfaces these are linked together from most specific to least specific. This way if you subscribe to the base interface you get + /// all the messages. or you can be more selective. all exchanges in this situation are bound as fanouts. + /// the subscriber declares his own queue and his queue exchange – + /// he then also declares/binds his exchange to each of the message type exchanges desired + /// the publisher discovers all of the exchanges needed for a given message, binds them all up + /// and then pushes the message into the most specific queue letting RabbitMQ do the fanout for him. (One publish, multiple receivers!) + /// we generate an exchange for each queue so that we can do direct sends to the queue. it is bound as a fanout exchange + /// + /// + public class ConventionalRoutingTopology : IRoutingTopology + { + public void SetupSubscription(IModel channel, Type type, string subscriberName) + { + CreateQueueAndExchangeForSubscriber(channel, subscriberName); + if (type == typeof(IEvent)) + { + // Make handlers for IEvent handle all events whether they extend IEvent or not + type = typeof(object); + } + SetupTypeSubscriptions(channel, type); + channel.ExchangeBind(subscriberName, ExchangeName(type), string.Empty); + } + + void CreateQueueAndExchangeForSubscriber(IModel channel, string subscriberName) + { + if (endpointSubscriptionConfiguredSet.ContainsKey(subscriberName)) + { + return; + } + CreateQueue(channel, subscriberName); + CreateExchange(channel, subscriberName); + channel.QueueBind(subscriberName, subscriberName, string.Empty); + endpointSubscriptionConfiguredSet[subscriberName] = null; + } + + public void TeardownSubscription(IModel channel, Type type, string subscriberName) + { + try + { + channel.ExchangeUnbind(subscriberName, ExchangeName(type), string.Empty, null); + } + catch + { + // TODO: Any better way to make this idempotent? + } + } + + public void Publish(IModel channel, Type type, TransportMessage message, IBasicProperties properties) + { + SetupTypeSubscriptions(channel, type); + channel.BasicPublish(ExchangeName(type), String.Empty, true, false, properties, message.Body); + } + + public void Send(IModel channel, Address address, TransportMessage message, IBasicProperties properties) + { + var subscriberName = address.Queue; + CreateQueueAndExchangeForSubscriber(channel, subscriberName); + channel.BasicPublish(subscriberName, String.Empty, true, false, properties, message.Body); + } + + private readonly ConcurrentDictionary typeTopologyConfiguredSet = new ConcurrentDictionary(); + private readonly ConcurrentDictionary endpointSubscriptionConfiguredSet = new ConcurrentDictionary(); + + private static string ExchangeName(Type type) + { + return type.Namespace + ":" + type.Name; + } + + private static void CreateQueue(IModel channel, string queueName) + { + try + { + var durable = SettingsHolder.Get("Endpoint.DurableMessages"); + channel.QueueDeclare(queueName, durable, false, false, null); + } + catch (Exception) + { + // TODO: Any better way to make this idempotent? + } + } + + private static void CreateExchange(IModel channel, string exchangeName) + { + try + { + channel.ExchangeDeclare(exchangeName, ExchangeType.Fanout, true); + } + catch (Exception) + { + // TODO: Any better way to make this idempotent? + } + } + + private void SetupTypeSubscriptions(IModel channel, Type type) + { + if (type == typeof(Object) || IsTypeTopologyKnownConfigured(type)) + { + return; + } + { + var typeToProcess = type; + CreateExchange(channel, ExchangeName(typeToProcess)); + var baseType = typeToProcess.BaseType; + while (baseType != null) + { + CreateExchange(channel, ExchangeName(baseType)); + channel.ExchangeBind(ExchangeName(baseType), ExchangeName(typeToProcess), string.Empty); + typeToProcess = baseType; + baseType = typeToProcess.BaseType; + } + } + + foreach (var exchangeName in type.GetInterfaces().Select(ExchangeName)) + { + CreateExchange(channel, exchangeName); + channel.ExchangeBind(exchangeName, ExchangeName(type), string.Empty); + + } + MarkTypeConfigured(type); + } + + private void MarkTypeConfigured(Type eventType) + { + typeTopologyConfiguredSet[eventType] = null; + } + + private bool IsTypeTopologyKnownConfigured(Type eventType) + { + return typeTopologyConfiguredSet.ContainsKey(eventType); + } + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/Routing/DirectRoutingTopology.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/Routing/DirectRoutingTopology.cs new file mode 100644 index 00000000000..2d3cffa858b --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/Routing/DirectRoutingTopology.cs @@ -0,0 +1,73 @@ +namespace NServiceBus.Transports.RabbitMQ.Routing +{ + using System; + using global::RabbitMQ.Client; + + /// + /// Route using a static routing convention for routing messages from publishers to subscribers using routing keys + /// + public class DirectRoutingTopology:IRoutingTopology + { + public Func ExchangeNameConvention { get; set; } + + public Func RoutingKeyConvention { get; set; } + + public void SetupSubscription(IModel channel, Type type, string subscriberName) + { + CreateExchange(channel, ExchangeName()); + channel.QueueBind(subscriberName, ExchangeName(), GetRoutingKeyForBinding(type)); + } + + public void TeardownSubscription(IModel channel, Type type, string subscriberName) + { + channel.QueueUnbind(subscriberName, ExchangeName(), GetRoutingKeyForBinding(type), null); + } + + public void Publish(IModel channel, Type type, TransportMessage message, IBasicProperties properties) + { + channel.BasicPublish(ExchangeName(), GetRoutingKeyForPublish(type), true, false, properties, message.Body); + } + + public void Send(IModel channel, Address address, TransportMessage message, IBasicProperties properties) + { + channel.BasicPublish(string.Empty, address.Queue, true, false, properties, message.Body); + } + + string ExchangeName() + { + return ExchangeNameConvention(null,null); + } + + static void CreateExchange(IModel channel, string exchangeName) + { + if (exchangeName == AmqpTopicExchange) + return; + try + { + channel.ExchangeDeclare(exchangeName, ExchangeType.Topic, true); + } + catch (Exception) + { + + } + } + + string GetRoutingKeyForPublish(Type eventType) + { + return RoutingKeyConvention(eventType); + } + + string GetRoutingKeyForBinding(Type eventType) + { + if (eventType == typeof(IEvent) || eventType == typeof(object)) + return "#"; + + + return RoutingKeyConvention(eventType) + ".#"; + } + + const string AmqpTopicExchange = "amq.topic"; + + + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/Routing/IRoutingTopology.cs b/src/RabbitMQ/NServiceBus.RabbitMQ/Routing/IRoutingTopology.cs new file mode 100644 index 00000000000..a87c1076f24 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/Routing/IRoutingTopology.cs @@ -0,0 +1,42 @@ +namespace NServiceBus.Transports.RabbitMQ.Routing +{ + using System; + using global::RabbitMQ.Client; + + /// + /// Topology for routing messages on the transport + /// + public interface IRoutingTopology + { + /// + /// Set up subscription for subscriber to the specified type + /// + /// RabbitMQ channel to operate on + /// Type to handle with subscriber + /// Subscriber name + void SetupSubscription(IModel channel, Type type, string subscriberName); + /// + /// Stop subscription for subscriber to the specified type + /// + /// RabbitMQ channel to operate on + /// Type to handle with subscriber + /// Subscriber name + void TeardownSubscription(IModel channel, Type type, string subscriberName); + /// + /// Publish message of the specified type + /// + /// RabbitMQ channel to operate on + /// Type to handle with subscriber + /// Message to publish + /// RabbitMQ properties of the message to publish + void Publish(IModel channel, Type type, TransportMessage message, IBasicProperties properties); + /// + /// Send message to the specified endpoint + /// + /// + /// + /// + /// + void Send(IModel channel, Address address, TransportMessage message, IBasicProperties properties); + } +} \ No newline at end of file diff --git a/src/RabbitMQ/NServiceBus.RabbitMQ/packages.config b/src/RabbitMQ/NServiceBus.RabbitMQ/packages.config new file mode 100644 index 00000000000..7354fcfaa79 --- /dev/null +++ b/src/RabbitMQ/NServiceBus.RabbitMQ/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/RabbitMQ/Scripts/Reset-RabbitMQ.ps1 b/src/RabbitMQ/Scripts/Reset-RabbitMQ.ps1 new file mode 100644 index 00000000000..3b79e566159 --- /dev/null +++ b/src/RabbitMQ/Scripts/Reset-RabbitMQ.ps1 @@ -0,0 +1,3 @@ +rabbitmqctl stop_app +rabbitmqctl reset +rabbitmqctl start_app \ No newline at end of file diff --git a/src/Setup/NServiceBus.Setup.Windows/Dtc/DtcSetup.cs b/src/Setup/NServiceBus.Setup.Windows/Dtc/DtcSetup.cs deleted file mode 100644 index 51f718aa849..00000000000 --- a/src/Setup/NServiceBus.Setup.Windows/Dtc/DtcSetup.cs +++ /dev/null @@ -1,66 +0,0 @@ -namespace NServiceBus.Setup.Windows.Dtc -{ - using System; - using System.Collections.Generic; - using System.ServiceProcess; - using Microsoft.Win32; - - public class DtcSetup - { - /// - /// Checks that the MSDTC service is running and configured correctly, and if not - /// takes the necessary corrective actions to make it so. - /// - public static bool StartDtcIfNecessary(bool allowReconfiguration = false) - { - if (DoesSecurityConfigurationRequireRestart(allowReconfiguration)) - { - if (!allowReconfiguration) - return false; - - ProcessUtil.ChangeServiceStatus(Controller, ServiceControllerStatus.Stopped, Controller.Stop); - } - - if (!allowReconfiguration && Controller.Status != ServiceControllerStatus.Running) - { - Console.Out.WriteLine("MSDTC isn't currently running and needs to be started"); - return false; - } - - ProcessUtil.ChangeServiceStatus(Controller, ServiceControllerStatus.Running, Controller.Start); - - return true; - } - - static bool DoesSecurityConfigurationRequireRestart(bool doChanges) - { - Console.WriteLine("Checking if DTC is configured correctly."); - - var key = Registry.LocalMachine.OpenSubKey(@"Software\Microsoft\MSDTC\Security", doChanges); - if (key == null) - throw new InvalidOperationException("MSDTC could not be found in the registry. Cannot continue."); - - var needToChange = false; - foreach (var val in RegValues) - if ((int)key.GetValue(val) == 0) - if (doChanges) - { - - Console.WriteLine("DTC not configured correctly. Going to fix. This will require a restart of the DTC service."); - - key.SetValue(val, 1, RegistryValueKind.DWord); - - Console.WriteLine("DTC configuration fixed."); - } - else - needToChange = true; - - key.Close(); - - return needToChange; - } - - static readonly ServiceController Controller = new ServiceController { ServiceName = "MSDTC", MachineName = "." }; - static readonly List RegValues = new List(new[] { "NetworkDtcAccess", "NetworkDtcAccessOutbound", "NetworkDtcAccessTransactions", "XaTransactions" }); - } -} \ No newline at end of file diff --git a/src/Setup/NServiceBus.Setup.Windows/Msmq/MsmqSetup.cs b/src/Setup/NServiceBus.Setup.Windows/Msmq/MsmqSetup.cs deleted file mode 100644 index a1c4848ff42..00000000000 --- a/src/Setup/NServiceBus.Setup.Windows/Msmq/MsmqSetup.cs +++ /dev/null @@ -1,274 +0,0 @@ -namespace NServiceBus.Setup.Windows.Msmq -{ - using System; - using System.Collections.Generic; - using System.Diagnostics; - using System.IO; - using System.Runtime.InteropServices; - using System.ServiceProcess; - using Microsoft.Win32; - - /// - /// Utility class for starting and installing MSMQ. - /// - public static class MsmqSetup - { - /// - /// Checks that MSMQ is installed, configured correctly, and started, and if not - /// takes the necessary corrective actions to make it so. - /// - public static bool StartMsmqIfNecessary(bool allowReinstall = false) - { - if(!InstallMsmqIfNecessary(allowReinstall)) - { - return false; - } - - var controller = new ServiceController { ServiceName = "MSMQ", MachineName = "." }; - - if (IsStopped(controller)) - { - ProcessUtil.ChangeServiceStatus(controller, ServiceControllerStatus.Running, controller.Start); - } - - return true; - } - - private static bool IsStopped(ServiceController controller) - { - return controller.Status == ServiceControllerStatus.Stopped || controller.Status == ServiceControllerStatus.StopPending; - } - - private static bool IsMsmqInstalled() - { - var dll = LoadLibraryW("Mqrt.dll"); - return (dll != IntPtr.Zero); - } - - /// - /// Determines if the msmq installation on the current machine is ok - /// - /// - public static bool IsInstallationGood() - { - var msmqSetup = Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\MSMQ\Setup"); - if (msmqSetup == null) - return false; - - var installedComponents = new List(msmqSetup.GetValueNames()); - msmqSetup.Close(); - - return HasOnlyNeededComponents(installedComponents); - } - - private static bool InstallMsmqIfNecessary(bool allowReinstall) - { - Console.WriteLine("Checking if MSMQ is installed."); - if (IsMsmqInstalled()) - { - Console.WriteLine("MSMQ is installed."); - Console.WriteLine("Checking that only needed components are active."); - - if (IsInstallationGood()) - { - Console.WriteLine("Installation is good."); - return true; - } - - Console.WriteLine("Installation isn't good."); - - if (!allowReinstall) - return false; - - Console.WriteLine("Going to re-install MSMQ. A reboot may be required."); - - PerformFunctionDependingOnOS( - () => Process.Start(OcSetup, VistaOcSetupParams + Uninstall), - () => Process.Start(OcSetup, Server2008OcSetupParams + Uninstall), - InstallMsmqOnXpOrServer2003 - ); - - Console.WriteLine("Installation of MSMQ successful."); - - return true; - } - - Console.WriteLine("MSMQ is not installed. Going to install."); - - PerformFunctionDependingOnOS( - () => Process.Start(OcSetup, VistaOcSetupParams), - () => Process.Start(OcSetup, Server2008OcSetupParams), - InstallMsmqOnXpOrServer2003 - ); - - Console.WriteLine("Installation of MSMQ successful."); - - return true; - } - - private static void PerformFunctionDependingOnOS(Func vistaFunc, Func server2008Func, Func xpAndServer2003Func) - { - var os = GetOperatingSystem(); - - Process process = null; - switch (os) - { - case OperatingSystemEnum.Vista: - - process = vistaFunc(); - break; - - case OperatingSystemEnum.Server2008: - - process = server2008Func(); - break; - - case OperatingSystemEnum.XpOrServer2003: - - process = xpAndServer2003Func(); - break; - - default: - - Console.WriteLine("OS not supported."); - break; - } - - if (process == null) return; - - Console.WriteLine("Waiting for process to complete."); - process.WaitForExit(); - } - - private static Process InstallMsmqOnXpOrServer2003() - { - var p = Path.GetTempFileName(); - - Console.WriteLine("Creating installation instruction file."); - - using (var sw = File.CreateText(p)) - { - sw.WriteLine("[Version]"); - sw.WriteLine("Signature = \"$Windows NT$\""); - sw.WriteLine(); - sw.WriteLine("[Global]"); - sw.WriteLine("FreshMode = Custom"); - sw.WriteLine("MaintenanceMode = RemoveAll"); - sw.WriteLine("UpgradeMode = UpgradeOnly"); - sw.WriteLine(); - sw.WriteLine("[Components]"); - - foreach (var s in RequiredMsmqComponentsXp) - sw.WriteLine(s + " = ON"); - - foreach (var s in UndesirableMsmqComponentsXp) - sw.WriteLine(s + " = OFF"); - - sw.Flush(); - } - - Console.WriteLine("Installation instruction file created."); - Console.WriteLine("Invoking MSMQ installation."); - - return Process.Start("sysocmgr", "/i:sysoc.inf /x /q /w /u:%temp%\\" + Path.GetFileName(p)); - } - - private static OperatingSystemEnum GetOperatingSystem() - { - var osvi = new OSVersionInfoEx(); - osvi.OSVersionInfoSize = (UInt32)Marshal.SizeOf(typeof(OSVersionInfoEx)); - - GetVersionEx(osvi); - - switch (Environment.OSVersion.Version.Major) - { - case 6: - - if (osvi.ProductType == VER_NT_WORKSTATION) - return OperatingSystemEnum.Vista; - - return OperatingSystemEnum.Server2008; - - case 5: - return OperatingSystemEnum.XpOrServer2003; - } - - return OperatingSystemEnum.DontCare; - } - - private static bool HasOnlyNeededComponents(IEnumerable installedComponents) - { - var needed = new List(RequiredMsmqComponentsXp); - - foreach (var i in installedComponents) - { - if (UndesirableMsmqComponentsXp.Contains(i)) - { - Console.WriteLine("Undesirable MSMQ component installed: " + i); - return false; - } - - if (UndesirableMsmqComponentsV4.Contains(i)) - { - Console.WriteLine("Undesirable MSMQ component installed: " + i); - return false; - } - - needed.Remove(i); - } - - if (needed.Count == 0) - return true; - - return false; - } - - /// Return Type: HMODULE->HINSTANCE->HINSTANCE__* - ///lpLibFileName: LPCWSTR->WCHAR* - [DllImportAttribute("kernel32.dll", EntryPoint = "LoadLibraryW")] - static extern IntPtr LoadLibraryW([InAttribute()] [MarshalAsAttribute(UnmanagedType.LPWStr)] string lpLibFileName); - - - [DllImport("Kernel32", CharSet = CharSet.Auto)] - static extern Boolean GetVersionEx([Out][In]OSVersionInfo versionInformation); - - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - class OSVersionInfoEx : OSVersionInfo - { - public UInt16 ServicePackMajor; - public UInt16 ServicePackMinor; - public UInt16 SuiteMask; - public byte ProductType; - public byte Reserved; - } - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Auto)] - class OSVersionInfo - { - public UInt32 OSVersionInfoSize = - (UInt32)Marshal.SizeOf(typeof(OSVersionInfo)); - public UInt32 MajorVersion = 0; - public UInt32 MinorVersion = 0; - public UInt32 BuildNumber = 0; - public UInt32 PlatformId = 0; - // Attribute used to indicate marshalling for String field - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - public String CSDVersion = null; - } - - const byte VER_NT_WORKSTATION = 1; - const byte VER_NT_SERVER = 3; - - static readonly List RequiredMsmqComponentsXp = new List(new[] { "msmq_Core", "msmq_LocalStorage" }); - static readonly List UndesirableMsmqComponentsXp = new List(new[] { "msmq_ADIntegrated", "msmq_TriggersService", "msmq_HTTPSupport", "msmq_RoutingSupport", "msmq_MQDSService" }); - static readonly List UndesirableMsmqComponentsV4 = new List(new[] { "msmq_DCOMProxy", "msmq_MQDSServiceInstalled", "msmq_MulticastInstalled", "msmq_RoutingInstalled", "msmq_TriggersInstalled" }); - - enum OperatingSystemEnum { DontCare, XpOrServer2003, Vista, Server2008 } - - const string OcSetup = "OCSETUP"; - const string Uninstall = " /uninstall"; - const string Server2008OcSetupParams = "MSMQ-Server /passive"; - const string VistaOcSetupParams = "MSMQ-Container;" + Server2008OcSetupParams; - } -} \ No newline at end of file diff --git a/src/Setup/NServiceBus.Setup.Windows/NServiceBus.Setup.Windows.csproj b/src/Setup/NServiceBus.Setup.Windows/NServiceBus.Setup.Windows.csproj deleted file mode 100644 index 06dfe493a14..00000000000 --- a/src/Setup/NServiceBus.Setup.Windows/NServiceBus.Setup.Windows.csproj +++ /dev/null @@ -1,123 +0,0 @@ - - - - - Debug - AnyCPU - {54DAB047-C30D-4507-A304-766DDD29BB28} - Library - Properties - NServiceBus.Setup.Windows - NServiceBus.Setup.Windows - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - True - True - RavenServer.resx - - - - - - ResXFileCodeGenerator - RavenServer.Designer.cs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Setup/NServiceBus.Setup.Windows/PerformanceCounters/PerformanceCounterSetup.cs b/src/Setup/NServiceBus.Setup.Windows/PerformanceCounters/PerformanceCounterSetup.cs deleted file mode 100644 index b265c42b3c7..00000000000 --- a/src/Setup/NServiceBus.Setup.Windows/PerformanceCounters/PerformanceCounterSetup.cs +++ /dev/null @@ -1,51 +0,0 @@ -namespace NServiceBus.Setup.Windows.PerformanceCounters -{ - using System; - using System.Diagnostics; - - public class PerformanceCounterSetup - { - public static bool SetupCounters(bool allowModifications = false) - { - var categoryName = "NServiceBus"; - - if (PerformanceCounterCategory.Exists(categoryName)) - { - bool needToRecreateCategory = false; - - foreach (CounterCreationData counter in Counters) - { - if (!PerformanceCounterCategory.CounterExists(counter.CounterName, categoryName)) - needToRecreateCategory = true; - - } - - if (!needToRecreateCategory) - return true; - - if (!allowModifications) - return false; - - Console.WriteLine("Category " + categoryName + " already exist, going to delete first"); - PerformanceCounterCategory.Delete(categoryName); - } - - if (!allowModifications) - return false; - - PerformanceCounterCategory.Create(categoryName, "NServiceBus statistics", - PerformanceCounterCategoryType.MultiInstance, Counters); - - return true; - } - - static CounterCreationDataCollection Counters = new CounterCreationDataCollection - { - new CounterCreationData("Critical Time", "Age of the oldest message in the queue", - PerformanceCounterType.NumberOfItems32), - new CounterCreationData("SLA violation countdown", - "Seconds until the SLA for this endpoint is breached", - PerformanceCounterType.NumberOfItems32) - }; - } -} \ No newline at end of file diff --git a/src/Setup/NServiceBus.Setup.Windows/Properties/AssemblyInfo.cs b/src/Setup/NServiceBus.Setup.Windows/Properties/AssemblyInfo.cs deleted file mode 100644 index 3d4e484664e..00000000000 --- a/src/Setup/NServiceBus.Setup.Windows/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; -using System.Reflection; - -[assembly: AssemblyTitle("NServiceBus.Setup.Windows")] -[assembly: AssemblyVersion("3.0.0.0")] -[assembly: AssemblyFileVersion("3.0.2.0")] -[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2007-2011")] -[assembly: AssemblyProduct("NServiceBus")] -[assembly: AssemblyCompany("NServiceBus")] -[assembly: AssemblyInformationalVersion("3.0.2-build0")] -[assembly: CLSCompliantAttribute(true)] \ No newline at end of file diff --git a/src/Setup/NServiceBus.Setup.Windows/RavenDB/RavenDBSetup.cs b/src/Setup/NServiceBus.Setup.Windows/RavenDB/RavenDBSetup.cs deleted file mode 100644 index 8660ae36275..00000000000 --- a/src/Setup/NServiceBus.Setup.Windows/RavenDB/RavenDBSetup.cs +++ /dev/null @@ -1,137 +0,0 @@ -namespace NServiceBus.Setup.Windows.RavenDB -{ - using System; - using System.Collections; - using System.Diagnostics; - using System.Globalization; - using System.IO; - using System.Linq; - using System.Security.Principal; - using System.ServiceProcess; - using System.Xml; - using Persistence.Raven.Installation; - - public class RavenDBSetup - { - public bool Install(WindowsIdentity identity, int port = 0, string installPath = null, bool allowInstall = false) - { - if (string.IsNullOrEmpty(installPath)) - installPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), DefaultDirectoryName); - - if (Directory.Exists(installPath)) - { - Console.Out.WriteLine("Path {0} already exists please update RavenDB manually if needed",installPath); - return true; - } - - var service = ServiceController.GetServices().FirstOrDefault(s => s.ServiceName == "RavenDB"); - if(service != null) - { - Console.Out.WriteLine("There is already a RavenDB service installed on this computer, current status:{0}",service.Status); - return true; - } - - if (!allowInstall) - return false; - - //Check if the port is available, if so let the installer setup raven if its beeing run - if (port > 0 && !RavenHelpers.EnsureCanListenToWhenInNonAdminContext(port)) - { - Console.Out.WriteLine("Port {0} isn't available please choose a different port an rerun the command",port); - return false; - - } - - if (!Directory.Exists(installPath)) - Directory.CreateDirectory(installPath); - - Console.WriteLine("Unpacking resources"); - string ravenConfigData = null; - - foreach (DictionaryEntry entry in RavenServer.ResourceManager.GetResourceSet(CultureInfo.CurrentUICulture, true, true)) - { - var fileName = entry.Key.ToString().Replace("_", "."); - - var data = entry.Value as byte[]; - - switch (fileName) - { - case "Raven.Studio": - fileName += ".xap"; - break; - - case "Raven.Server": - fileName += ".exe"; - break; - - case "Raven.Server.exe": - fileName += ".config"; - ravenConfigData = (string)entry.Value; - data = null; - break; - - default: - fileName += ".dll"; - break; - - } - - var destinationPath = Path.Combine(installPath, fileName); - - if(data == null) - continue; - - Console.WriteLine("Unpacking {0} to {1}", entry.Key, destinationPath); - - - File.WriteAllBytes(destinationPath, data); - } - - if(port > 0) - { - var ravenConfigPath = Path.Combine(installPath, "Raven.Server.exe.config"); - var ravenConfig = new XmlDocument(); - - ravenConfig.LoadXml(ravenConfigData); - - var key = (XmlElement) ravenConfig.DocumentElement.SelectSingleNode("//add[@key='Raven/Port']"); - - key.SetAttribute("value", port.ToString()); - - ravenConfig.Save(ravenConfigPath); - Console.Out.WriteLine("Updated Raven configuration to use port: {0}",port); - } - - Console.WriteLine("Installing RavenDB as a windows service"); - - var startInfo = new ProcessStartInfo - { - CreateNoWindow = true, - UseShellExecute = false, - RedirectStandardOutput = true, - WorkingDirectory = installPath, - Arguments = "/install", - FileName = Path.Combine(installPath, "Raven.Server.exe") - }; - - using (var process = Process.Start(startInfo)) - { - process.WaitForExit(20000); - - var line = process.StandardOutput.ReadToEnd(); - Console.WriteLine(line); - - if (process.ExitCode != 0) - { - Console.WriteLine("The RavenDB service failed to start service, exit code: {0}", process.ExitCode); - return false; - } - } - - Console.WriteLine("RavenDB service started"); - return true; - } - - const string DefaultDirectoryName = "NServiceBus.Persistence"; - } -} \ No newline at end of file diff --git a/src/Setup/NServiceBus.Setup.Windows/RavenDB/RavenServer.Designer.cs b/src/Setup/NServiceBus.Setup.Windows/RavenDB/RavenServer.Designer.cs deleted file mode 100644 index 409319906de..00000000000 --- a/src/Setup/NServiceBus.Setup.Windows/RavenDB/RavenServer.Designer.cs +++ /dev/null @@ -1,245 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.17929 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NServiceBus.Setup.Windows.RavenDB { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class RavenServer { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal RavenServer() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NServiceBus.Setup.Windows.RavenDB.RavenServer", typeof(RavenServer).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] BouncyCastle_Crypto { - get { - object obj = ResourceManager.GetObject("BouncyCastle_Crypto", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] Esent_Interop { - get { - object obj = ResourceManager.GetObject("Esent_Interop", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] ICSharpCode_NRefactory { - get { - object obj = ResourceManager.GetObject("ICSharpCode_NRefactory", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] Lucene_Net { - get { - object obj = ResourceManager.GetObject("Lucene_Net", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] Lucene_Net_Contrib_Spatial { - get { - object obj = ResourceManager.GetObject("Lucene_Net_Contrib_Spatial", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] Lucene_Net_Contrib_SpellChecker { - get { - object obj = ResourceManager.GetObject("Lucene_Net_Contrib_SpellChecker", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] Newtonsoft_Json { - get { - object obj = ResourceManager.GetObject("Newtonsoft_Json", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] NLog { - get { - object obj = ResourceManager.GetObject("NLog", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] Raven_Abstractions { - get { - object obj = ResourceManager.GetObject("Raven_Abstractions", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] Raven_Database { - get { - object obj = ResourceManager.GetObject("Raven_Database", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] Raven_Munin { - get { - object obj = ResourceManager.GetObject("Raven_Munin", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] Raven_Server { - get { - object obj = ResourceManager.GetObject("Raven_Server", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized string similar to <?xml version="1.0" encoding="utf-8" ?> - ///<configuration> - /// <appSettings> - /// <add key="Raven/Port" value="*"/> - /// <add key="Raven/DataDir" value="~\Data"/> - /// <add key="Raven/AnonymousAccess" value="Get"/> - /// </appSettings> - /// <runtime> - /// <loadFromRemoteSources enabled="true"/> - /// <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> - /// <probing privatePath="Analyzers"/> - /// </assemblyBinding> - /// </runtime> - ///</configuration>. - /// - internal static string Raven_Server_exe { - get { - return ResourceManager.GetString("Raven_Server_exe", resourceCulture); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] Raven_Storage_Esent { - get { - object obj = ResourceManager.GetObject("Raven_Storage_Esent", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] Raven_Storage_Managed { - get { - object obj = ResourceManager.GetObject("Raven_Storage_Managed", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] Raven_Studio { - get { - object obj = ResourceManager.GetObject("Raven_Studio", resourceCulture); - return ((byte[])(obj)); - } - } - - /// - /// Looks up a localized resource of type System.Byte[]. - /// - internal static byte[] Spatial4n_Core { - get { - object obj = ResourceManager.GetObject("Spatial4n_Core", resourceCulture); - return ((byte[])(obj)); - } - } - } -} diff --git a/src/Setup/NServiceBus.Setup.Windows/RavenDB/RavenServer.resx b/src/Setup/NServiceBus.Setup.Windows/RavenDB/RavenServer.resx deleted file mode 100644 index bdd9b8c124e..00000000000 --- a/src/Setup/NServiceBus.Setup.Windows/RavenDB/RavenServer.resx +++ /dev/null @@ -1,172 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\Resources\BouncyCastle.Crypto.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Esent.Interop.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\ICSharpCode.NRefactory.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Lucene.Net.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Lucene.Net.Contrib.Spatial.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Lucene.Net.Contrib.SpellChecker.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Newtonsoft.Json.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\NLog.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Raven.Abstractions.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Raven.Database.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Raven.Munin.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Raven.Server.exe;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Raven.Server.exe.config;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8 - - - ..\Resources\Raven.Storage.Esent.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Raven.Storage.Managed.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Raven.Studio.xap;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ..\Resources\Spatial4n.Core.dll;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/BouncyCastle.Crypto.dll b/src/Setup/NServiceBus.Setup.Windows/Resources/BouncyCastle.Crypto.dll deleted file mode 100644 index a078d27b4c9..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/BouncyCastle.Crypto.dll and /dev/null differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/Esent.Interop.dll b/src/Setup/NServiceBus.Setup.Windows/Resources/Esent.Interop.dll deleted file mode 100644 index 375b9df4b84..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/Esent.Interop.dll and /dev/null differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/ICSharpCode.NRefactory.dll b/src/Setup/NServiceBus.Setup.Windows/Resources/ICSharpCode.NRefactory.dll deleted file mode 100644 index 1c97b850b98..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/ICSharpCode.NRefactory.dll and /dev/null differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/Lucene.Net.Contrib.Spatial.dll b/src/Setup/NServiceBus.Setup.Windows/Resources/Lucene.Net.Contrib.Spatial.dll deleted file mode 100644 index 45e8f325e39..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/Lucene.Net.Contrib.Spatial.dll and /dev/null differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/Lucene.Net.Contrib.SpellChecker.dll b/src/Setup/NServiceBus.Setup.Windows/Resources/Lucene.Net.Contrib.SpellChecker.dll deleted file mode 100644 index b4ce631fbb4..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/Lucene.Net.Contrib.SpellChecker.dll and /dev/null differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/Lucene.Net.dll b/src/Setup/NServiceBus.Setup.Windows/Resources/Lucene.Net.dll deleted file mode 100644 index 3ca1517f5f0..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/Lucene.Net.dll and /dev/null differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/Newtonsoft.Json.dll b/src/Setup/NServiceBus.Setup.Windows/Resources/Newtonsoft.Json.dll deleted file mode 100644 index 09560c1b313..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/Newtonsoft.Json.dll and /dev/null differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Abstractions.dll b/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Abstractions.dll deleted file mode 100644 index 8e6f261bf4e..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Abstractions.dll and /dev/null differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Database.dll b/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Database.dll deleted file mode 100644 index 793aa69c04c..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Database.dll and /dev/null differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Munin.dll b/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Munin.dll deleted file mode 100644 index e0a2ef26016..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Munin.dll and /dev/null differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Server.exe b/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Server.exe deleted file mode 100644 index d24d00014ad..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Server.exe and /dev/null differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Storage.Esent.dll b/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Storage.Esent.dll deleted file mode 100644 index 914d0cd6b24..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Storage.Esent.dll and /dev/null differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Storage.Managed.dll b/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Storage.Managed.dll deleted file mode 100644 index 3eced2c3c5e..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Storage.Managed.dll and /dev/null differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Studio.xap b/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Studio.xap deleted file mode 100644 index 598b7e9bffe..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/Raven.Studio.xap and /dev/null differ diff --git a/src/Setup/NServiceBus.Setup.Windows/Resources/Spatial4n.Core.dll b/src/Setup/NServiceBus.Setup.Windows/Resources/Spatial4n.Core.dll deleted file mode 100644 index fb7942f03e5..00000000000 Binary files a/src/Setup/NServiceBus.Setup.Windows/Resources/Spatial4n.Core.dll and /dev/null differ diff --git a/src/Setup/Setup.sln b/src/Setup/Setup.sln deleted file mode 100644 index df033502600..00000000000 --- a/src/Setup/Setup.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Setup.Windows", "NServiceBus.Setup.Windows\NServiceBus.Setup.Windows.csproj", "{54DAB047-C30D-4507-A304-766DDD29BB28}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {54DAB047-C30D-4507-A304-766DDD29BB28}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {54DAB047-C30D-4507-A304-766DDD29BB28}.Debug|Any CPU.Build.0 = Debug|Any CPU - {54DAB047-C30D-4507-A304-766DDD29BB28}.Release|Any CPU.ActiveCfg = Release|Any CPU - {54DAB047-C30D-4507-A304-766DDD29BB28}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/SqlServer/NServiceBus.SqlServer/Config/SqlServer.cs b/src/SqlServer/NServiceBus.SqlServer/Config/SqlServer.cs new file mode 100644 index 00000000000..79aef603c1f --- /dev/null +++ b/src/SqlServer/NServiceBus.SqlServer/Config/SqlServer.cs @@ -0,0 +1,11 @@ +namespace NServiceBus +{ + using Transports; + + /// + /// TransportDefinition for SqlServer + /// + public class SqlServer : TransportDefinition + { + } +} \ No newline at end of file diff --git a/src/SqlServer/NServiceBus.SqlServer/Config/SqlServerTransport.cs b/src/SqlServer/NServiceBus.SqlServer/Config/SqlServerTransport.cs new file mode 100644 index 00000000000..f2be6dadc04 --- /dev/null +++ b/src/SqlServer/NServiceBus.SqlServer/Config/SqlServerTransport.cs @@ -0,0 +1,60 @@ +namespace NServiceBus.Features +{ + using System; + using Settings; + using Transports; + using Transports.SQLServer; + using Unicast.Queuing.Installers; + + /// + /// Configures NServiceBus to use SqlServer as the default transport + /// + public class SqlServerTransport : ConfigureTransport + { + protected override string ExampleConnectionStringForErrorMessage + { + get { return @"Data Source=.\SQLEXPRESS;Initial Catalog=nservicebus;Integrated Security=True"; } + } + + protected override void InternalConfigure(Configure config) + { + + Enable(); + Enable(); + } + + public override void Initialize() + { + //Until we refactor the whole address system + CustomizeAddress(); + + var connectionString = SettingsHolder.Get("NServiceBus.Transport.ConnectionString"); + + if (String.IsNullOrEmpty(connectionString)) + { + throw new ArgumentException("Sql Transport connection string cannot be empty or null."); + } + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(p => p.ConnectionString, connectionString); + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(p => p.ConnectionString, connectionString); + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(p => p.ConnectionString, connectionString) + .ConfigureProperty(p => p.PurgeOnStartup, ConfigurePurging.PurgeRequested); + } + + static void CustomizeAddress() + { + Address.IgnoreMachineName(); + + if (!SettingsHolder.GetOrDefault("ScaleOut.UseSingleBrokerQueue")) + { + Address.InitializeLocalAddress(Address.Local.Queue + "." + Address.Local.Machine); + } + + } + } +} \ No newline at end of file diff --git a/src/SqlServer/NServiceBus.SqlServer/NServiceBus.Transports.SQLServer.csproj b/src/SqlServer/NServiceBus.SqlServer/NServiceBus.Transports.SQLServer.csproj new file mode 100644 index 00000000000..1aaa3e27d1d --- /dev/null +++ b/src/SqlServer/NServiceBus.SqlServer/NServiceBus.Transports.SQLServer.csproj @@ -0,0 +1,74 @@ + + + + + Debug + AnyCPU + {FA1193BF-325C-4201-BB78-484032E09809} + Library + Properties + NServiceBus.Transports.SQLServer + NServiceBus.Transports.SQLServer + v4.0 + 512 + true + ..\..\NServiceBus.snk + + + true + full + false + ..\..\..\binaries\ + DEBUG;TRACE + prompt + 4 + ..\..\..\binaries\NServiceBus.Transports.SQLServer.xml + + + pdbonly + true + ..\..\..\binaries\ + TRACE + prompt + 4 + ..\..\..\binaries\NServiceBus.Transports.SQLServer.xml + + + + + + + + + + + + + + + + + + + + + + + {dd48b2d0-e996-412d-9157-821ed8b17a9d} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + + + + + \ No newline at end of file diff --git a/src/SqlServer/NServiceBus.SqlServer/Properties/AssemblyInfo.cs b/src/SqlServer/NServiceBus.SqlServer/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..e06c6c35e20 --- /dev/null +++ b/src/SqlServer/NServiceBus.SqlServer/Properties/AssemblyInfo.cs @@ -0,0 +1,19 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("NServiceBus.SQL")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyProduct("NServiceBus.SQL")] +[assembly: AssemblyCompany("NServiceBus")] +[assembly: AssemblyConfiguration("release")] +[assembly: AssemblyInformationalVersion("4.0.0-alpha0")] +[assembly: ComVisible(false)] +[assembly: CLSCompliantAttribute(true)] + + diff --git a/src/SqlServer/NServiceBus.SqlServer/SqlServerMessageSender.cs b/src/SqlServer/NServiceBus.SqlServer/SqlServerMessageSender.cs new file mode 100644 index 00000000000..b135d7e6c09 --- /dev/null +++ b/src/SqlServer/NServiceBus.SqlServer/SqlServerMessageSender.cs @@ -0,0 +1,179 @@ +namespace NServiceBus.Transports.SQLServer +{ + using System; + using System.Data; + using System.Data.SqlClient; + using System.Threading; + using NServiceBus.Serializers.Json; + using Unicast.Queuing; + + /// + /// SqlServer implementation of . + /// + public class SqlServerMessageSender : ISendMessages, IDisposable + { + private const string SqlSend = + @"INSERT INTO [{0}] ([Id],[CorrelationId],[ReplyToAddress],[Recoverable],[Expires],[Headers],[Body]) + VALUES (@Id,@CorrelationId,@ReplyToAddress,@Recoverable,@Expires,@Headers,@Body)"; + + private static readonly JsonMessageSerializer Serializer = new JsonMessageSerializer(null); + private readonly ThreadLocal currentTransaction = new ThreadLocal(); + private bool disposed; + + public string ConnectionString { get; set; } + + /// + /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. + /// + /// 2 + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + /// + /// Sends the given to the . + /// + /// + /// to send. + /// + /// + /// Destination . + /// + public void Send(TransportMessage message, Address address) + { + try + { + + if (currentTransaction.IsValueCreated) + { + using ( + var command = new SqlCommand(string.Format(SqlSend, address.Queue), + currentTransaction.Value.Connection, currentTransaction.Value) + { + CommandType = CommandType.Text + }) + { + ExecuteQuery(message, command); + } + } + else + { + using (var connection = new SqlConnection(ConnectionString)) + { + connection.Open(); + using (var command = new SqlCommand(string.Format(SqlSend, address.Queue), connection) + { + CommandType = CommandType.Text + }) + { + ExecuteQuery(message, command); + } + } + } + } + catch (SqlException ex) + { + if (ex.Number == 208) + { + string msg = address == null + ? "Failed to send message. Target address is null." + : string.Format("Failed to send message to address: [{0}]", address); + + throw new QueueNotFoundException(address, msg, ex); + } + + ThrowFailedToSendException(address, ex); + } + catch (Exception ex) + { + ThrowFailedToSendException(address, ex); + } + } + + /// + /// Sets the native transaction. + /// + /// + /// Native . + /// + public void SetTransaction(SqlTransaction transaction) + { + currentTransaction.Value = transaction; + } + + private static void ThrowFailedToSendException(Address address, Exception ex) + { + if (address == null) + throw new FailedToSendMessageException("Failed to send message.", ex); + + throw new FailedToSendMessageException( + string.Format("Failed to send message to address: {0}@{1}", address.Queue, address.Machine), ex); + } + + private static void ExecuteQuery(TransportMessage message, SqlCommand command) + { + command.Parameters.Add("Id", SqlDbType.UniqueIdentifier).Value = Guid.Parse(message.Id); + command.Parameters.Add("CorrelationId", SqlDbType.VarChar).Value = + GetValue(message.CorrelationId); + if (message.ReplyToAddress == null) // Sendonly endpoint + { + command.Parameters.Add("ReplyToAddress", SqlDbType.VarChar).Value = DBNull.Value; + } + else + { + command.Parameters.Add("ReplyToAddress", SqlDbType.VarChar).Value = + message.ReplyToAddress.ToString(); + } + command.Parameters.Add("Recoverable", SqlDbType.Bit).Value = message.Recoverable; + if (message.TimeToBeReceived == TimeSpan.MaxValue) + { + command.Parameters.Add("Expires", SqlDbType.DateTime).Value = DBNull.Value; + } + else + { + command.Parameters.Add("Expires", SqlDbType.DateTime).Value = + DateTime.UtcNow.Add(message.TimeToBeReceived); + } + command.Parameters.Add("Headers", SqlDbType.VarChar).Value = + Serializer.SerializeObject(message.Headers); + if (message.Body == null) + { + command.Parameters.Add("Body", SqlDbType.VarBinary).Value = DBNull.Value; + } + else + { + command.Parameters.Add("Body", SqlDbType.VarBinary).Value = message.Body; + } + + command.ExecuteNonQuery(); + } + + private static object GetValue(object value) + { + return value ?? DBNull.Value; + } + + protected virtual void Dispose(bool disposing) + { + if (disposed) + { + return; + } + + if (disposing) + { + // Dispose managed resources. + currentTransaction.Dispose(); + } + + disposed = true; + } + + ~SqlServerMessageSender() + { + Dispose(false); + } + } +} \ No newline at end of file diff --git a/src/SqlServer/NServiceBus.SqlServer/SqlServerPollingDequeueStrategy.cs b/src/SqlServer/NServiceBus.SqlServer/SqlServerPollingDequeueStrategy.cs new file mode 100644 index 00000000000..125ce9c707d --- /dev/null +++ b/src/SqlServer/NServiceBus.SqlServer/SqlServerPollingDequeueStrategy.cs @@ -0,0 +1,406 @@ +namespace NServiceBus.Transports.SQLServer +{ + using System; + using System.Collections.Generic; + using System.Data; + using System.Data.SqlClient; + using System.Threading; + using System.Threading.Tasks; + using System.Transactions; + using CircuitBreakers; + using Logging; + using Serializers.Json; + using Utils; + using Unicast.Transport; + using IsolationLevel = System.Data.IsolationLevel; + + /// + /// A polling implementation of . + /// + public class SqlServerPollingDequeueStrategy : IDequeueMessages + { + /// + /// The connection used to open the SQL Server database. + /// + public string ConnectionString { get; set; } + + /// + /// Determines if the queue should be purged when the transport starts. + /// + public bool PurgeOnStartup { get; set; } + + /// + /// SqlServer . + /// + public SqlServerMessageSender MessageSender { get; set; } + + /// + /// Initializes the . + /// + /// The address to listen on. + /// + /// The to be used by . + /// + /// Called when a message has been dequeued and is ready for processing. + /// + /// Needs to be called by after the message has been processed regardless if the outcome was successful or not. + /// + public void Init(Address address, TransactionSettings transactionSettings, + Func tryProcessMessage, Action endProcessMessage) + { + this.tryProcessMessage = tryProcessMessage; + this.endProcessMessage = endProcessMessage; + + settings = transactionSettings; + transactionOptions = new TransactionOptions + { + IsolationLevel = transactionSettings.IsolationLevel, + Timeout = transactionSettings.TransactionTimeout + }; + + tableName = address.Queue; + + sql = string.Format(SqlReceive, tableName); + + if (PurgeOnStartup) + { + PurgeTable(); + } + } + + /// + /// Starts the dequeuing of message using the specified . + /// + /// + /// Indicates the maximum concurrency level this is able to support. + /// + public void Start(int maximumConcurrencyLevel) + { + tokenSource = new CancellationTokenSource(); + + for (int i = 0; i < maximumConcurrencyLevel; i++) + { + StartThread(); + } + } + + /// + /// Stops the dequeuing of messages. + /// + public void Stop() + { + tokenSource.Cancel(); + } + + private void PurgeTable() + { + using (var connection = new SqlConnection(ConnectionString)) + { + connection.Open(); + + using (var command = new SqlCommand(string.Format(SqlPurge, tableName), connection) + { + CommandType = CommandType.Text + }) + { + int numberOfPurgedRows = command.ExecuteNonQuery(); + + Logger.InfoFormat("{0} messages was purged from table {1}", numberOfPurgedRows, tableName); + } + } + } + + private void StartThread() + { + CancellationToken token = tokenSource.Token; + + Task.Factory + .StartNew(Action, token, token, TaskCreationOptions.LongRunning, TaskScheduler.Default) + .ContinueWith(t => + { + t.Exception.Handle(ex => + { + Logger.Warn("Failed to connect to the configured SqlServer"); + circuitBreaker.Failure(ex); + return true; + }); + + StartThread(); + }, TaskContinuationOptions.OnlyOnFaulted); + } + + private void Action(object obj) + { + var cancellationToken = (CancellationToken)obj; + var backOff = new BackOff(1000); + + while (!cancellationToken.IsCancellationRequested) + { + var result = new ReceiveResult(); + + try + { + if (settings.IsTransactional) + { + if (settings.DontUseDistributedTransactions) + { + result = TryReceiveWithNativeTransaction(); + } + else + { + result = TryReceiveWithDTCTransaction(); + } + } + else + { + result = TryReceiveWithNoTransaction(); + } + } + finally + { + //since we're polling the message will be null when there was nothing in the queue + if (result.Message != null) + endProcessMessage(result.Message, result.Exception); + } + + circuitBreaker.Success(); + backOff.Wait(() => result.Message == null); + } + } + + ReceiveResult TryReceiveWithNoTransaction() + { + var result = new ReceiveResult(); + + var message = Receive(); + + if (message == null) + return result; + + result.Message = message; + try + { + tryProcessMessage(message); + + } + catch (Exception ex) + { + result.Exception = ex; + } + + return result; + } + + ReceiveResult TryReceiveWithDTCTransaction() + { + var result = new ReceiveResult(); + + using (var scope = new TransactionScope(TransactionScopeOption.Required, transactionOptions)) + { + var message = Receive(); + + if (message == null) + { + scope.Complete(); + return result; + } + + result.Message = message; + + try + { + if (tryProcessMessage(message)) + { + scope.Complete(); + scope.Dispose(); // We explicitly calling Dispose so that we force any exception to not bubble, eg Concurrency/Deadlock exception. + } + } + catch (Exception ex) + { + result.Exception = ex; + } + + return result; + } + } + + ReceiveResult TryReceiveWithNativeTransaction() + { + var result = new ReceiveResult(); + + using (var connection = new SqlConnection(ConnectionString)) + { + connection.Open(); + + using (var transaction = connection.BeginTransaction(GetSqlIsolationLevel(settings.IsolationLevel))) + { + TransportMessage message; + try + { + message = ReceiveWithNativeTransaction(connection, transaction); + } + catch (Exception) + { + transaction.Rollback(); + throw; + } + + if (message == null) + { + transaction.Commit(); + return result; + } + + result.Message = message; + + try + { + if (MessageSender != null) + { + MessageSender.SetTransaction(transaction); + } + + if (tryProcessMessage(message)) + { + transaction.Commit(); + } + else + { + transaction.Rollback(); + } + + } + catch (Exception ex) + { + result.Exception = ex; + transaction.Rollback(); + } + + return result; + } + } + + } + + TransportMessage Receive() + { + using (var connection = new SqlConnection(ConnectionString)) + { + connection.Open(); + + using (var command = new SqlCommand(sql, connection) { CommandType = CommandType.Text }) + { + return ExecuteReader(command); + } + } + } + + TransportMessage ReceiveWithNativeTransaction(SqlConnection connection, SqlTransaction transaction) + { + using (var command = new SqlCommand(sql, connection, transaction) { CommandType = CommandType.Text }) + { + return ExecuteReader(command); + } + } + + static TransportMessage ExecuteReader(SqlCommand command) + { + using (var dataReader = command.ExecuteReader(CommandBehavior.SingleRow)) + { + if (dataReader.Read()) + { + var id = dataReader.GetGuid(0).ToString(); + + DateTime? expireDateTime = null; + if (!dataReader.IsDBNull(4)) + { + expireDateTime = dataReader.GetDateTime(4); + } + + //Has message expired? + if (expireDateTime.HasValue && expireDateTime.Value < DateTime.UtcNow) + { + Logger.InfoFormat("Message with ID={0} has expired. Removing it from queue.", id); + return null; + } + + var headers = Serializer.DeserializeObject>(dataReader.GetString(5)); + var correlationId = dataReader.IsDBNull(1) ? null : dataReader.GetString(1); + var recoverable = dataReader.GetBoolean(3); + var body = dataReader.IsDBNull(6) ? null : dataReader.GetSqlBinary(6).Value; + var replyToAddress = dataReader.IsDBNull(2) ? null : Address.Parse(dataReader.GetString(2)); + + var message = new TransportMessage(id,headers) + { + CorrelationId = correlationId, + ReplyToAddress = replyToAddress, + Recoverable = recoverable, + Body = body + }; + + if (expireDateTime.HasValue) + { + message.TimeToBeReceived = TimeSpan.FromTicks(expireDateTime.Value.Ticks - DateTime.UtcNow.Ticks); + } + + return message; + } + } + + return null; + } + + IsolationLevel GetSqlIsolationLevel(System.Transactions.IsolationLevel isolationLevel) + { + switch (isolationLevel) + { + case System.Transactions.IsolationLevel.Serializable: + return IsolationLevel.Serializable; + case System.Transactions.IsolationLevel.RepeatableRead: + return IsolationLevel.RepeatableRead; + case System.Transactions.IsolationLevel.ReadCommitted: + return IsolationLevel.ReadCommitted; + case System.Transactions.IsolationLevel.ReadUncommitted: + return IsolationLevel.ReadUncommitted; + case System.Transactions.IsolationLevel.Snapshot: + return IsolationLevel.Snapshot; + case System.Transactions.IsolationLevel.Chaos: + return IsolationLevel.Chaos; + case System.Transactions.IsolationLevel.Unspecified: + return IsolationLevel.Unspecified; + } + + return IsolationLevel.ReadCommitted; + } + + class ReceiveResult + { + public Exception Exception { get; set; } + public TransportMessage Message { get; set; } + } + + const string SqlReceive = + @"WITH message AS (SELECT TOP(1) * FROM [{0}] WITH (UPDLOCK, READPAST, ROWLOCK) ORDER BY [RowVersion] ASC) + DELETE FROM message + OUTPUT deleted.Id, deleted.CorrelationId, deleted.ReplyToAddress, + deleted.Recoverable, deleted.Expires, deleted.Headers, deleted.Body;"; + const string SqlPurge = @"DELETE FROM [{0}]"; + + static readonly JsonMessageSerializer Serializer = new JsonMessageSerializer(null); + static readonly ILog Logger = LogManager.GetLogger(typeof(SqlServerPollingDequeueStrategy)); + + readonly ICircuitBreaker circuitBreaker = new RepeatedFailuresOverTimeCircuitBreaker("SqlTransportConnectivity", + TimeSpan.FromMinutes(2), + ex => Configure.Instance.RaiseCriticalError("Repeated failures when communicating with SqlServer", ex), + TimeSpan.FromSeconds(10)); + + Action endProcessMessage; + TransactionSettings settings; + string sql; + string tableName; + CancellationTokenSource tokenSource; + TransactionOptions transactionOptions; + Func tryProcessMessage; + + } +} \ No newline at end of file diff --git a/src/SqlServer/NServiceBus.SqlServer/SqlServerQueueCreator.cs b/src/SqlServer/NServiceBus.SqlServer/SqlServerQueueCreator.cs new file mode 100644 index 00000000000..efc489c2aca --- /dev/null +++ b/src/SqlServer/NServiceBus.SqlServer/SqlServerQueueCreator.cs @@ -0,0 +1,45 @@ +namespace NServiceBus.Transports.SQLServer +{ + using System.Data; + using System.Data.SqlClient; + + public class SqlServerQueueCreator : ICreateQueues + { + const string Ddl = + @"IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[{0}]') AND type in (N'U')) + BEGIN + CREATE TABLE [dbo].[{0}]( + [Id] [uniqueidentifier] NOT NULL, + [CorrelationId] [varchar](255) NULL, + [ReplyToAddress] [varchar](255) NULL, + [Recoverable] [bit] NOT NULL, + [Expires] [datetime] NULL, + [Headers] [varchar](max) NOT NULL, + [Body] [varbinary](max) NULL, + [RowVersion] [bigint] IDENTITY(1,1) NOT NULL + ) ON [PRIMARY]; + + CREATE CLUSTERED INDEX [Index_RowVersion] ON [dbo].[{0}] + ( + [RowVersion] ASC + )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + + END"; + + public void CreateQueueIfNecessary(Address address, string account) + { + using (var connection = new SqlConnection(ConnectionString)) + { + var sql = string.Format(Ddl, address.Queue); + connection.Open(); + + using (var command = new SqlCommand(sql, connection) {CommandType = CommandType.Text}) + { + command.ExecuteNonQuery(); + } + } + } + + public string ConnectionString { get; set; } + } +} \ No newline at end of file diff --git a/src/SqlServer/Scripts/Reset-Database.sql b/src/SqlServer/Scripts/Reset-Database.sql new file mode 100644 index 00000000000..dd9451aedcb --- /dev/null +++ b/src/SqlServer/Scripts/Reset-Database.sql @@ -0,0 +1,101 @@ +/* Drop all non-system stored procs */ +DECLARE @name VARCHAR(128) +DECLARE @SQL VARCHAR(254) + +SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'P' AND category = 0 ORDER BY [name]) + +WHILE @name is not null +BEGIN + SELECT @SQL = 'DROP PROCEDURE [dbo].[' + RTRIM(@name) +']' + EXEC (@SQL) + PRINT 'Dropped Procedure: ' + @name + SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'P' AND category = 0 AND [name] > @name ORDER BY [name]) +END +GO + +/* Drop all views */ +DECLARE @name VARCHAR(128) +DECLARE @SQL VARCHAR(254) + +SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'V' AND category = 0 ORDER BY [name]) + +WHILE @name IS NOT NULL +BEGIN + SELECT @SQL = 'DROP VIEW [dbo].[' + RTRIM(@name) +']' + EXEC (@SQL) + PRINT 'Dropped View: ' + @name + SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'V' AND category = 0 AND [name] > @name ORDER BY [name]) +END +GO + +/* Drop all functions */ +DECLARE @name VARCHAR(128) +DECLARE @SQL VARCHAR(254) + +SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] IN (N'FN', N'IF', N'TF', N'FS', N'FT') AND category = 0 ORDER BY [name]) + +WHILE @name IS NOT NULL +BEGIN + SELECT @SQL = 'DROP FUNCTION [dbo].[' + RTRIM(@name) +']' + EXEC (@SQL) + PRINT 'Dropped Function: ' + @name + SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] IN (N'FN', N'IF', N'TF', N'FS', N'FT') AND category = 0 AND [name] > @name ORDER BY [name]) +END +GO + +/* Drop all Foreign Key constraints */ +DECLARE @name VARCHAR(128) +DECLARE @constraint VARCHAR(254) +DECLARE @SQL VARCHAR(254) + +SELECT @name = (SELECT TOP 1 TABLE_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE constraint_catalog=DB_NAME() AND CONSTRAINT_TYPE = 'FOREIGN KEY' ORDER BY TABLE_NAME) + +WHILE @name is not null +BEGIN + SELECT @constraint = (SELECT TOP 1 CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE constraint_catalog=DB_NAME() AND CONSTRAINT_TYPE = 'FOREIGN KEY' AND TABLE_NAME = @name ORDER BY CONSTRAINT_NAME) + WHILE @constraint IS NOT NULL + BEGIN + SELECT @SQL = 'ALTER TABLE [dbo].[' + RTRIM(@name) +'] DROP CONSTRAINT [' + RTRIM(@constraint) +']' + EXEC (@SQL) + PRINT 'Dropped FK Constraint: ' + @constraint + ' on ' + @name + SELECT @constraint = (SELECT TOP 1 CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE constraint_catalog=DB_NAME() AND CONSTRAINT_TYPE = 'FOREIGN KEY' AND CONSTRAINT_NAME <> @constraint AND TABLE_NAME = @name ORDER BY CONSTRAINT_NAME) + END +SELECT @name = (SELECT TOP 1 TABLE_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE constraint_catalog=DB_NAME() AND CONSTRAINT_TYPE = 'FOREIGN KEY' ORDER BY TABLE_NAME) +END +GO + +/* Drop all Primary Key constraints */ +DECLARE @name VARCHAR(128) +DECLARE @constraint VARCHAR(254) +DECLARE @SQL VARCHAR(254) + +SELECT @name = (SELECT TOP 1 TABLE_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE constraint_catalog=DB_NAME() AND CONSTRAINT_TYPE = 'PRIMARY KEY' ORDER BY TABLE_NAME) + +WHILE @name IS NOT NULL +BEGIN + SELECT @constraint = (SELECT TOP 1 CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE constraint_catalog=DB_NAME() AND CONSTRAINT_TYPE = 'PRIMARY KEY' AND TABLE_NAME = @name ORDER BY CONSTRAINT_NAME) + WHILE @constraint is not null + BEGIN + SELECT @SQL = 'ALTER TABLE [dbo].[' + RTRIM(@name) +'] DROP CONSTRAINT [' + RTRIM(@constraint)+']' + EXEC (@SQL) + PRINT 'Dropped PK Constraint: ' + @constraint + ' on ' + @name + SELECT @constraint = (SELECT TOP 1 CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE constraint_catalog=DB_NAME() AND CONSTRAINT_TYPE = 'PRIMARY KEY' AND CONSTRAINT_NAME <> @constraint AND TABLE_NAME = @name ORDER BY CONSTRAINT_NAME) + END +SELECT @name = (SELECT TOP 1 TABLE_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE constraint_catalog=DB_NAME() AND CONSTRAINT_TYPE = 'PRIMARY KEY' ORDER BY TABLE_NAME) +END +GO + +/* Drop all tables */ +DECLARE @name VARCHAR(128) +DECLARE @SQL VARCHAR(254) + +SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'U' AND category = 0 ORDER BY [name]) + +WHILE @name IS NOT NULL +BEGIN + SELECT @SQL = 'DROP TABLE [dbo].[' + RTRIM(@name) +']' + EXEC (@SQL) + PRINT 'Dropped Table: ' + @name + SELECT @name = (SELECT TOP 1 [name] FROM sysobjects WHERE [type] = 'U' AND category = 0 AND [name] > @name ORDER BY [name]) +END +GO \ No newline at end of file diff --git a/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/BlobStorageDataBus.cs b/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/BlobStorageDataBus.cs deleted file mode 100644 index 340dd73807d..00000000000 --- a/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/BlobStorageDataBus.cs +++ /dev/null @@ -1,248 +0,0 @@ -namespace NServiceBus.DataBus.Azure.BlobStorage -{ - using System; - using System.Collections.Generic; - using System.Globalization; - using System.IO; - using System.Linq; - using System.Net; - using System.Threading; - using Microsoft.WindowsAzure.StorageClient; - using Microsoft.WindowsAzure.StorageClient.Protocol; - using log4net; - - public class BlobStorageDataBus : IDataBus - { - private readonly ILog logger = LogManager.GetLogger(typeof(IDataBus)); - private readonly CloudBlobContainer container; - private readonly Timer timer; - - public int MaxRetries { get; set; } - public int NumberOfIOThreads { get; set; } - public string BasePath { get; set; } - public int BlockSize { get; set; } - - public BlobStorageDataBus(CloudBlobContainer container) - { - this.container = container; - timer = new Timer(o => DeleteExpiredBlobs()); - } - - public Stream Get(string key) - { - var stream = new MemoryStream(); - var blob = container.GetBlockBlobReference(Path.Combine(BasePath, key)); - DownloadBlobInParallel(blob, stream); - return stream; - } - - public string Put(Stream stream, TimeSpan timeToBeReceived) - { - var key = Guid.NewGuid().ToString(); - var blob = container.GetBlockBlobReference(Path.Combine(BasePath, key)); - blob.Attributes.Metadata["ValidUntil"] = (DateTime.Now + timeToBeReceived).ToString(); - UploadBlobInParallel(blob, stream); - return key; - } - - public void Start() - { - ServicePointManager.DefaultConnectionLimit = NumberOfIOThreads; - container.CreateIfNotExist(); - timer.Change(0, 300000); - logger.Info("Blob storage data bus started. Location: " + BasePath); - } - - public void Dispose() - { - timer.Dispose(); - - DeleteExpiredBlobs(); - - logger.Info("Blob storage data bus stopped"); - } - - private void DeleteExpiredBlobs() - { - try - { - var blobs = container.ListBlobs(); - foreach (var blockBlob in blobs.Select(blob => blob as CloudBlockBlob)) - { - if (blockBlob == null) continue; - - blockBlob.FetchAttributes(); - DateTime validUntil; - DateTime.TryParse(blockBlob.Attributes.Metadata["ValidUntil"], out validUntil); - if (validUntil == default(DateTime) || validUntil < DateTime.Now) - blockBlob.DeleteIfExists(); - } - } - catch (StorageClientException ex) // to handle race conditions between multiple active instances. - { - logger.Warn(ex.Message); - } - catch (StorageServerException ex) // prevent azure hickups from hurting us. - { - logger.Warn(ex.Message); - } - } - - private void UploadBlobInParallel(CloudBlockBlob blob, Stream stream) - { - var blocksToUpload = new Queue(); - var order = new List(); - CalculateBlocks(blocksToUpload, (int)stream.Length, order); - - ExecuteInParallel(() => AsLongAsThereAre(blocksToUpload, block => - { - try - { - var buffer = new byte[BlockSize]; - lock (stream) - { - stream.Position = block.Offset; - stream.Read(buffer, 0, block.Length); - } - using (var memoryStream = new MemoryStream(buffer, 0, block.Length)) - { - blob.PutBlock(block.Name, memoryStream, null); - } - } - catch - { - if (++block.Attempt > MaxRetries) throw; - - lock (blocksToUpload) blocksToUpload.Enqueue(block); - } - })); - - Commit(blob, order); - - } - - private void Commit(CloudBlockBlob blob, List originalOrder) - { - var commitAttempt = 0; - while (commitAttempt <= MaxRetries) - { - try - { - blob.PutBlockList(originalOrder); - break; - } - catch (Exception) - { - commitAttempt++; - if (commitAttempt > MaxRetries) throw; - } - } - } - - private void DownloadBlobInParallel(CloudBlob blob, Stream stream) - { - try - { - blob.FetchAttributes(); - var order = new List(); - var blocksToDownload = new Queue(); - CalculateBlocks(blocksToDownload, (int)blob.Properties.Length, order); - ExecuteInParallel(() => AsLongAsThereAre(blocksToDownload, block => - { - var s = DownloadBlockFromBlob(blob, block, blocksToDownload); if (s == null) return; - var buffer = new byte[BlockSize]; - ExtractBytesFromBlockIntoBuffer(buffer, s, block); - lock (stream) - { - stream.Position = block.Offset; - stream.Write(buffer, 0,block.Length); - } - })); - stream.Seek(0, SeekOrigin.Begin); - } - catch (StorageClientException ex) // to handle race conditions between multiple active instances. - { - logger.Warn(ex.Message); - } - catch (StorageServerException ex) // prevent azure hickups from hurting us. - { - logger.Warn(ex.Message); - } - } - - private void CalculateBlocks(Queue blocksToUpload, int blobLength, ICollection order) - { - var offset = 0; - while (blobLength > 0) - { - var blockLength = Math.Min(BlockSize, blobLength); - var block = new Block { Offset = offset, Length = blockLength }; - blocksToUpload.Enqueue(block); - order.Add(block.Name); - offset += blockLength; - blobLength -= blockLength; - } - } - - private void ExecuteInParallel(Action action) - { - var threads = new List(); - for (var i = 0; i < NumberOfIOThreads; i++) - { - var t = new Thread(new ThreadStart(action)); - t.Start(); - threads.Add(t); - } - foreach (var t in threads) t.Join(); - } - - private static void AsLongAsThereAre(Queue blocks, Action action) - { - while (true) - { - Block block; - lock (blocks) - { - if (blocks.Count == 0) - break; - - block = blocks.Dequeue(); - } - - action(block); - } - } - - private static void ExtractBytesFromBlockIntoBuffer(byte[] buffer, Stream s, Block block) - { - var offsetInBlock = 0; - var remaining = block.Length; - while (remaining > 0) - { - var read = s.Read(buffer, offsetInBlock, remaining); - offsetInBlock += read; - remaining -= read; - } - } - - private Stream DownloadBlockFromBlob(CloudBlob blob, Block block, Queue blocksToDownload) - { - try - { - var blobGetRequest = BlobRequest.Get(blob.Uri, 60, null, null); - blobGetRequest.Headers.Add("x-ms-range", string.Format(CultureInfo.InvariantCulture, "bytes={0}-{1}", block.Offset, block.Offset + block.Length - 1)); - var credentials = blob.ServiceClient.Credentials; - credentials.SignRequest(blobGetRequest); - var response = blobGetRequest.GetResponse() as HttpWebResponse; - return response != null ? response.GetResponseStream() : null; - } - catch - { - if (++block.Attempt > MaxRetries) throw; - - lock (blocksToDownload) blocksToDownload.Enqueue(block); - } - return null; - } - } -} diff --git a/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/NServiceBus.DataBus.Azure.BlobStorage.csproj b/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/NServiceBus.DataBus.Azure.BlobStorage.csproj deleted file mode 100644 index a416ca19ca5..00000000000 --- a/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/NServiceBus.DataBus.Azure.BlobStorage.csproj +++ /dev/null @@ -1,78 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {BF761591-5BAE-4CA1-96D5-CB70DBD4B71B} - Library - Properties - NServiceBus.DataBus.Azure.BlobStorage - NServiceBus.DataBus.Azure.BlobStorage - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - False - ..\..\..\..\build\output\NServiceBus.dll - - - ..\..\..\..\build\output\NServiceBus.Core.dll - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/Properties/AssemblyInfo.cs b/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/Properties/AssemblyInfo.cs deleted file mode 100644 index b38ea60b4eb..00000000000 Binary files a/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/packages.config b/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/packages.config deleted file mode 100644 index 05a937d0b47..00000000000 --- a/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/azure/DataBus/NServiceBus.DataBus.sln b/src/azure/DataBus/NServiceBus.DataBus.sln deleted file mode 100644 index 3ede16f6cbb..00000000000 --- a/src/azure/DataBus/NServiceBus.DataBus.sln +++ /dev/null @@ -1,28 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.DataBus.Azure.BlobStorage", "NServiceBus.DataBus.Azure.BlobStorage\NServiceBus.DataBus.Azure.BlobStorage.csproj", "{BF761591-5BAE-4CA1-96D5-CB70DBD4B71B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A24998E6-306D-4727-B3F3-21189DD64F55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A24998E6-306D-4727-B3F3-21189DD64F55}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A24998E6-306D-4727-B3F3-21189DD64F55}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A24998E6-306D-4727-B3F3-21189DD64F55}.Release|Any CPU.Build.0 = Release|Any CPU - {1E69B249-00AD-4B93-9B28-D5193357FED0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1E69B249-00AD-4B93-9B28-D5193357FED0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1E69B249-00AD-4B93-9B28-D5193357FED0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1E69B249-00AD-4B93-9B28-D5193357FED0}.Release|Any CPU.Build.0 = Release|Any CPU - {BF761591-5BAE-4CA1-96D5-CB70DBD4B71B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF761591-5BAE-4CA1-96D5-CB70DBD4B71B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF761591-5BAE-4CA1-96D5-CB70DBD4B71B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF761591-5BAE-4CA1-96D5-CB70DBD4B71B}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/NServiceBus.Hosting.Azure.HostProcess.csproj b/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/NServiceBus.Hosting.Azure.HostProcess.csproj index 65fb377c871..5dc81148f3d 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/NServiceBus.Hosting.Azure.HostProcess.csproj +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/NServiceBus.Hosting.Azure.HostProcess.csproj @@ -2,7 +2,6 @@ Debug - x86 8.0.30703 2.0 {11B81F23-64C6-4341-94AC-38B3C4C6B1E7} @@ -14,59 +13,75 @@ 512 + true + ..\..\..\NServiceBus.snk + ..\..\..\..\ + true - - x86 + true - full - false - bin\Debug\ + ..\..\..\..\binaries\ DEBUG;TRACE + ..\..\..\..\binaries\NServiceBus.Hosting.Azure.HostProcess.XML + full + AnyCPU prompt - 4 + MinimumRecommendedRules.ruleset - - x86 - pdbonly - true + bin\Release\ TRACE + ..\..\..\..\binaries\NServiceBus.Hosting.Azure.HostProcess.XML + true + pdbonly + AnyCPU prompt - 4 + MinimumRecommendedRules.ruleset - ..\..\..\..\lib\log4net.dll + ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - ..\..\..\..\lib\Topshelf\Magnum.dll + + False + ..\..\..\..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\..\..\..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll - ..\..\..\..\lib\ServiceLocation\Microsoft.Practices.ServiceLocation.dll + ..\..\..\..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll - + False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + ..\..\..\..\packages\WindowsAzure.ServiceBus.2.1.0.0\lib\net40-full\Microsoft.ServiceBus.dll - - False - ..\..\..\..\build\output\NServiceBus.dll + + ..\..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.1.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - + False - ..\..\..\..\build\output\NServiceBus.Azure.dll + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - + False - ..\..\..\..\build\output\NServiceBus.Core.dll + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - False - ..\..\..\..\build\output\NServiceBus.Hosting.Azure.dll + + ..\..\..\..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + + + False + ..\..\..\..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + @@ -84,6 +99,31 @@ + + + + + + + {dd48b2d0-e996-412d-9157-821ed8b17a9d} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + + {12f1d9f1-0a2c-4442-8d18-67dd096c6300} + NServiceBus.Azure + + + {6591ed91-f9a1-4cc3-813e-a33e07439d49} + NServiceBus.Hosting.Azure + + + + + + \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/Properties/AssemblyInfo.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/Properties/AssemblyInfo.cs index 79946e67887..ce6afd8c8ec 100644 Binary files a/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/Properties/AssemblyInfo.cs and b/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/Properties/AssemblyInfo.cs differ diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/WindowsHost.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/WindowsHost.cs index 1e321e5d42f..1e7fc7a13bb 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/WindowsHost.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/WindowsHost.cs @@ -1,63 +1,63 @@ -using System; -using System.Collections.Generic; -using NServiceBus.Config; - -namespace NServiceBus.Hosting.Azure.HostProcess -{ - /// - /// A windows implementation of the NServiceBus hosting solution - /// - public class WindowsHost : MarshalByRefObject - { - private readonly GenericHost genericHost; - - /// - /// Accepts the type which will specify the users custom configuration. - /// This type should implement . - /// - /// - /// - public WindowsHost(Type endpointType, string[] args) - { - var specifier = (IConfigureThisEndpoint)Activator.CreateInstance(endpointType); - - Program.EndpointId = Program.GetEndpointId(specifier); - - args = AddProfilesFromConfiguration(args); - - genericHost = new GenericHost(specifier, args, new[] { typeof(Development), typeof(OnAzureTableStorage), typeof(WithAzureStorageQueues) }, Program.EndpointId); - } - - /// - /// Does startup work. - /// - public void Start() - { - genericHost.Start(); - } - - /// - /// Does shutdown work. - /// - public void Stop() - { - genericHost.Stop(); - } - - - private static string[] AddProfilesFromConfiguration(IEnumerable args) - { - var list = new List(args); - - var configSection = Configure.GetConfigSection(); - - if (configSection != null) - { - var configuredProfiles = configSection.Profiles.Split(','); - Array.ForEach(configuredProfiles, s => list.Add(s.Trim())); - } - - return list.ToArray(); - } - } +using System; +using System.Collections.Generic; +using NServiceBus.Config; + +namespace NServiceBus.Hosting.Azure.HostProcess +{ + /// + /// A windows implementation of the NServiceBus hosting solution + /// + public class WindowsHost : MarshalByRefObject + { + private readonly GenericHost genericHost; + + /// + /// Accepts the type which will specify the users custom configuration. + /// This type should implement . + /// + /// + /// + public WindowsHost(Type endpointType, string[] args) + { + var specifier = (IConfigureThisEndpoint)Activator.CreateInstance(endpointType); + + Program.EndpointId = Program.GetEndpointId(specifier); + + args = AddProfilesFromConfiguration(args); + + genericHost = new GenericHost(specifier, args, new List { typeof(Development) }, Program.EndpointId); + } + + /// + /// Does startup work. + /// + public void Start() + { + genericHost.Start(); + } + + /// + /// Does shutdown work. + /// + public void Stop() + { + genericHost.Stop(); + } + + + private static string[] AddProfilesFromConfiguration(IEnumerable args) + { + var list = new List(args); + + var configSection = Configure.GetConfigSection(); + + if (configSection != null) + { + var configuredProfiles = configSection.Profiles.Split(','); + Array.ForEach(configuredProfiles, s => list.Add(s.Trim())); + } + + return list.ToArray(); + } + } } \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/app.config b/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/app.config new file mode 100644 index 00000000000..c93123dfb25 --- /dev/null +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/app.config @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/packages.config b/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/packages.config new file mode 100644 index 00000000000..183f7496b9d --- /dev/null +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure.HostProcess/packages.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointLoader.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointLoader.cs index 120816fd11f..cd77f5c4544 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointLoader.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointLoader.cs @@ -1,12 +1,13 @@ using System; using System.Collections.Generic; using System.Linq; -using Common.Logging; using Microsoft.WindowsAzure; -using Microsoft.WindowsAzure.StorageClient; namespace NServiceBus.Hosting { + using Microsoft.WindowsAzure.Storage; + using Microsoft.WindowsAzure.Storage.Blob; + internal class DynamicEndpointLoader { private CloudBlobClient client; @@ -24,7 +25,7 @@ public IEnumerable LoadEndpoints() } var blobContainer = client.GetContainerReference(Container); - blobContainer.CreateIfNotExist(); + blobContainer.CreateIfNotExists(); return from b in blobContainer.ListBlobs() where b.Uri.AbsolutePath.EndsWith(".zip") diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointProvisioner.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointProvisioner.cs index ef2ebbf3fd3..e51e25f2299 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointProvisioner.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointProvisioner.cs @@ -1,6 +1,8 @@ +using System; using System.Collections.Generic; using System.IO; using Microsoft.WindowsAzure.ServiceRuntime; +using NServiceBus.Logging; namespace NServiceBus.Hosting { @@ -8,15 +10,28 @@ internal class DynamicEndpointProvisioner { public string LocalResource { get; set; } + private readonly ILog logger = LogManager.GetLogger(typeof(DynamicEndpointRunner)); + + public bool RecycleRoleOnError { get; set; } + public void Provision(IEnumerable endpoints) { - var localResource = RoleEnvironment.GetLocalResource(LocalResource); + try + { + var localResource = RoleEnvironment.GetLocalResource(LocalResource); - foreach (var endpoint in endpoints) + foreach (var endpoint in endpoints) + { + endpoint.ExtractTo(localResource.RootPath); + + endpoint.EntryPoint = Path.Combine(localResource.RootPath, endpoint.EndpointName, "NServiceBus.Hosting.Azure.HostProcess.exe"); + } + } + catch (Exception e) { - endpoint.ExtractTo(localResource.RootPath); + logger.Error(e.Message); - endpoint.EntryPoint = Path.Combine(localResource.RootPath, endpoint.EndpointName, "NServiceBus.Hosting.Azure.HostProcess.exe"); + if (RecycleRoleOnError) RoleEnvironment.RequestRecycle(); } } diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointRunner.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointRunner.cs index d9eb46b819b..2c9b8848d90 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointRunner.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicEndpointRunner.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Threading; -using Common.Logging; +using NServiceBus.Logging; using Microsoft.WindowsAzure.ServiceRuntime; namespace NServiceBus.Hosting diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicHostController.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicHostController.cs index 0eb938caf6a..02f5d08aa37 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicHostController.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicHostController.cs @@ -1,138 +1,141 @@ -using System; -using System.Collections.Generic; -using NServiceBus.Config; -using NServiceBus.Hosting.Configuration; -using NServiceBus.Hosting.Profiles; -using NServiceBus.ObjectBuilder; - -namespace NServiceBus.Hosting -{ - using Installation; - - public class DynamicHostController : IHost - { - private readonly IConfigureThisEndpoint specifier; - private readonly ConfigManager configManager; - private readonly ProfileManager profileManager; - - private DynamicEndpointLoader loader; - private DynamicEndpointProvisioner provisioner; - private DynamicEndpointRunner runner; - private DynamicHostMonitor monitor; - private List runningServices; - - public DynamicHostController(IConfigureThisEndpoint specifier, string[] requestedProfiles,IEnumerable defaultProfiles) - { - this.specifier = specifier; - - var assembliesToScan = new[] {GetType().Assembly}; - - profileManager = new ProfileManager(assembliesToScan, specifier, requestedProfiles, defaultProfiles); - configManager = new ConfigManager(assembliesToScan, specifier); - } - - public void Start() - { - if (specifier is IWantCustomInitialization) - { - try - { - (specifier as IWantCustomInitialization).Init(); - } - catch (NullReferenceException ex) - { - throw new NullReferenceException("NServiceBus has detected a null reference in your initalization code." + - " This could be due to trying to use NServiceBus.Configure before it was ready." + - " One possible solution is to inherit from IWantCustomInitialization in a different class" + - " than the one that inherits from IConfigureThisEndpoint, and put your code there.", ex); - } - } - - if (!Configure.WithHasBeenCalled()) - Configure.With(GetType().Assembly); - - if (!Configure.BuilderIsConfigured()) - Configure.Instance.DefaultBuilder(); - - Configure.Instance.AzureConfigurationSource(); - Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - - var configSection = Configure.GetConfigSection() ?? new DynamicHostControllerConfig(); - - Configure.Instance.Configurer.ConfigureProperty(t => t.ConnectionString, configSection.ConnectionString); - Configure.Instance.Configurer.ConfigureProperty(t => t.Container, configSection.Container); - Configure.Instance.Configurer.ConfigureProperty(t => t.LocalResource, configSection.LocalResource); - Configure.Instance.Configurer.ConfigureProperty(t => t.RecycleRoleOnError, configSection.RecycleRoleOnError); - Configure.Instance.Configurer.ConfigureProperty(t => t.TimeToWaitUntilProcessIsKilled, configSection.TimeToWaitUntilProcessIsKilled); - Configure.Instance.Configurer.ConfigureProperty(t => t.Interval, configSection.UpdateInterval); - - configManager.ConfigureCustomInitAndStartup(); - profileManager.ActivateProfileHandlers(); - - loader = Configure.Instance.Builder.Build(); - provisioner = Configure.Instance.Builder.Build(); - runner = Configure.Instance.Builder.Build(); - - var endpointsToHost = loader.LoadEndpoints(); - if (endpointsToHost == null) return; - - runningServices = new List(endpointsToHost); - - provisioner.Provision(runningServices); - - runner.Start(runningServices); - - - if (!configSection.AutoUpdate) return; - - monitor = Configure.Instance.Builder.Build(); - monitor.UpdatedEndpoints += UpdatedEndpoints; - monitor.NewEndpoints += NewEndpoints; - monitor.RemovedEndpoints += RemovedEndpoints; - monitor.Monitor(runningServices); - monitor.Start(); - } - - public void Stop() - { - if (monitor != null) - monitor.Stop(); - - if (runner != null) - runner.Stop(runningServices); - } - - public void Install() where TEnvironment : IEnvironment - { - //todo -yves - } - - public void UpdatedEndpoints(object sender, EndpointsEventArgs e) - { - runner.Stop(e.Endpoints); - provisioner.Remove(e.Endpoints); - provisioner.Provision(e.Endpoints); - runner.Start(e.Endpoints); - } - - public void NewEndpoints(object sender, EndpointsEventArgs e) - { - provisioner.Provision(e.Endpoints); - runner.Start(e.Endpoints); - monitor.Monitor(e.Endpoints); - runningServices.AddRange(e.Endpoints); - } - - public void RemovedEndpoints(object sender, EndpointsEventArgs e) - { - monitor.StopMonitoring(e.Endpoints); - runner.Stop(e.Endpoints); - provisioner.Remove(e.Endpoints); - foreach (var endpoint in e.Endpoints) - runningServices.Remove(endpoint); - } - } -} +using System; +using System.Collections.Generic; +using System.Reflection; +using NServiceBus.Config; +using NServiceBus.Hosting.Configuration; +using NServiceBus.Hosting.Profiles; + +namespace NServiceBus.Hosting +{ + using Installation; + + public class DynamicHostController : IHost + { + private readonly IConfigureThisEndpoint specifier; + private readonly ConfigManager configManager; + private readonly ProfileManager profileManager; + + private DynamicEndpointLoader loader; + private DynamicEndpointProvisioner provisioner; + private DynamicEndpointRunner runner; + private DynamicHostMonitor monitor; + private List runningServices; + + public DynamicHostController(IConfigureThisEndpoint specifier, string[] requestedProfiles, List defaultProfiles, string endpointName) + { + this.specifier = specifier; + Configure.GetEndpointNameAction = (Func)(() => endpointName); + + var assembliesToScan = new List {GetType().Assembly}; + + profileManager = new ProfileManager(assembliesToScan, specifier, requestedProfiles, defaultProfiles); + configManager = new ConfigManager(assembliesToScan, specifier); + + } + + public void Start() + { + if (specifier is IWantCustomInitialization) + { + try + { + (specifier as IWantCustomInitialization).Init(); + } + catch (NullReferenceException ex) + { + throw new NullReferenceException("NServiceBus has detected a null reference in your initalization code." + + " This could be due to trying to use NServiceBus.Configure before it was ready." + + " One possible solution is to inherit from IWantCustomInitialization in a different class" + + " than the one that inherits from IConfigureThisEndpoint, and put your code there.", ex); + } + } + + if (!Configure.WithHasBeenCalled()) + Configure.With(GetType().Assembly); + + if (!Configure.BuilderIsConfigured()) + Configure.Instance.DefaultBuilder(); + + Configure.Instance.AzureConfigurationSource(); + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + + var configSection = Configure.GetConfigSection() ?? new DynamicHostControllerConfig(); + + Configure.Instance.Configurer.ConfigureProperty(t => t.ConnectionString, configSection.ConnectionString); + Configure.Instance.Configurer.ConfigureProperty(t => t.Container, configSection.Container); + Configure.Instance.Configurer.ConfigureProperty(t => t.LocalResource, configSection.LocalResource); + Configure.Instance.Configurer.ConfigureProperty(t => t.RecycleRoleOnError, configSection.RecycleRoleOnError); + Configure.Instance.Configurer.ConfigureProperty(t => t.RecycleRoleOnError, configSection.RecycleRoleOnError); + Configure.Instance.Configurer.ConfigureProperty(t => t.TimeToWaitUntilProcessIsKilled, configSection.TimeToWaitUntilProcessIsKilled); + Configure.Instance.Configurer.ConfigureProperty(t => t.Interval, configSection.UpdateInterval); + + configManager.ConfigureCustomInitAndStartup(); + profileManager.ActivateProfileHandlers(); + + loader = Configure.Instance.Builder.Build(); + provisioner = Configure.Instance.Builder.Build(); + runner = Configure.Instance.Builder.Build(); + + var endpointsToHost = loader.LoadEndpoints(); + if (endpointsToHost == null) return; + + runningServices = new List(endpointsToHost); + + provisioner.Provision(runningServices); + + runner.Start(runningServices); + + + if (!configSection.AutoUpdate) return; + + monitor = Configure.Instance.Builder.Build(); + monitor.UpdatedEndpoints += UpdatedEndpoints; + monitor.NewEndpoints += NewEndpoints; + monitor.RemovedEndpoints += RemovedEndpoints; + monitor.Monitor(runningServices); + monitor.Start(); + } + + public void Stop() + { + if (monitor != null) + monitor.Stop(); + + if (runner != null) + runner.Stop(runningServices); + } + + public void Install(string username) where TEnvironment : IEnvironment + { + //todo -yves + } + + public void UpdatedEndpoints(object sender, EndpointsEventArgs e) + { + runner.Stop(e.Endpoints); + provisioner.Remove(e.Endpoints); + provisioner.Provision(e.Endpoints); + runner.Start(e.Endpoints); + } + + public void NewEndpoints(object sender, EndpointsEventArgs e) + { + provisioner.Provision(e.Endpoints); + runner.Start(e.Endpoints); + monitor.Monitor(e.Endpoints); + runningServices.AddRange(e.Endpoints); + } + + public void RemovedEndpoints(object sender, EndpointsEventArgs e) + { + monitor.StopMonitoring(e.Endpoints); + runner.Stop(e.Endpoints); + provisioner.Remove(e.Endpoints); + foreach (var endpoint in e.Endpoints) + runningServices.Remove(endpoint); + } + } +} diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicHostMonitor.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicHostMonitor.cs index 9c7288b161f..b22d2b40cfa 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicHostMonitor.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/DynamicHostMonitor.cs @@ -2,11 +2,12 @@ using System.Collections.Generic; using System.Linq; using System.Threading; -using Common.Logging; -using Microsoft.WindowsAzure.StorageClient; +using NServiceBus.Logging; namespace NServiceBus.Hosting { + using Microsoft.WindowsAzure.Storage; + internal class DynamicHostMonitor { private Thread monitorThread; @@ -110,7 +111,7 @@ private void CheckForUpdates() if (removedEndpoints.Count > 0) OnRemovedEndpoints(new EndpointsEventArgs {Endpoints = removedEndpoints}); } - catch(StorageServerException ex) //prevent azure storage hickups from hurting us + catch(StorageException ex) //prevent azure storage hickups from hurting us { logger.Warn(ex.Message); } diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/EndpointToHost.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/EndpointToHost.cs index 36296afb119..b3a3aa41d02 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/EndpointToHost.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/DynamicHost/EndpointToHost.cs @@ -1,10 +1,11 @@ using System; using System.IO; using Ionic.Zip; -using Microsoft.WindowsAzure.StorageClient; namespace NServiceBus.Hosting { + using Microsoft.WindowsAzure.Storage.Blob; + public class EndpointToHost { private readonly CloudBlockBlob blob; @@ -14,7 +15,7 @@ public EndpointToHost(CloudBlockBlob blob) this.blob = blob; this.blob.FetchAttributes(); EndpointName = Path.GetFileNameWithoutExtension(blob.Uri.AbsolutePath); - LastUpdated = blob.Properties.LastModifiedUtc; + LastUpdated = blob.Properties.LastModified.HasValue ? blob.Properties.LastModified.Value.DateTime : default(DateTime); } public string EndpointName { get; private set; } @@ -30,9 +31,12 @@ public string ExtractTo(string rootPath) { var localDirectory = Path.Combine(rootPath, EndpointName); var localFileName = Path.Combine(rootPath, Path.GetFileName(blob.Uri.AbsolutePath)); - - blob.DownloadToFile(localFileName); - + + using (var fs = new FileStream(localFileName, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.Read)) + { + blob.DownloadToStream(fs); + } + using(var zip = new ZipFile(localFileName)) { zip.ExtractAll(localDirectory, ExtractExistingFileAction.OverwriteSilently); diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Fody.targets b/src/azure/Hosting/NServiceBus.Hosting.Azure/Fody.targets new file mode 100644 index 00000000000..a668a51fc04 --- /dev/null +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Fody.targets @@ -0,0 +1,89 @@ + + + + + + $(NCrunchOriginalSolutionDir) + + + + + $(SolutionDir) + + + + + $(MSBuildProjectDirectory)\..\ + + + + + + + $(KeyOriginatorFile) + + + + + $(AssemblyOriginatorKeyFile) + + + + + + + + + + $(ProjectDir)$(IntermediateOutputPath) + Low + $(SignAssembly) + $(MSBuildThisFileDirectory) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/FodyWeavers.xml b/src/azure/Hosting/NServiceBus.Hosting.Azure/FodyWeavers.xml new file mode 100644 index 00000000000..7b0ab397e86 --- /dev/null +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/FodyWeavers.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/IsHostedIn.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/IsHostedIn.cs deleted file mode 100644 index 252b3648c3d..00000000000 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/IsHostedIn.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Diagnostics; - -namespace NServiceBus.Hosting.Azure -{ - public static class IsHostedIn - { - public static bool ChildHostProcess() - { - var currentProcess = Process.GetCurrentProcess(); - return currentProcess.ProcessName == "NServiceBus.Hosting.Azure.HostProcess"; - } - } -} \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/NServiceBus.Hosting.Azure.csproj b/src/azure/Hosting/NServiceBus.Hosting.Azure/NServiceBus.Hosting.Azure.csproj index 08c18c3eeea..0529ad4e512 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/NServiceBus.Hosting.Azure.csproj +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/NServiceBus.Hosting.Azure.csproj @@ -12,90 +12,107 @@ NServiceBus.Hosting.Azure v4.0 512 + true + ..\..\..\NServiceBus.snk + ..\..\..\..\ + true + ..\..\..\..\packages\Fody.1.13.8.0 true full false - bin\Debug\ - DEBUG;TRACE + ..\..\..\..\binaries\ + TRACE;DEBUG prompt 4 + ..\..\..\..\binaries\NServiceBus.Hosting.Azure.XML pdbonly true - bin\Release\ + ..\..\..\..\binaries\ TRACE prompt 4 + ..\..\..\..\binaries\NServiceBus.Hosting.Azure.XML - - False - ..\..\..\..\build\azure\NServiceBus.Azure\Common.Logging.dll - - - False - ..\..\..\..\build\azure\NServiceBus.Azure\Iesi.Collections.dll + + ..\..\..\..\packages\Iesi.Collections.3.3.3.4000\lib\Net35\Iesi.Collections.dll ..\..\..\..\lib\Ionic.Zip.dll - + False - ..\..\..\..\lib\log4net.dll + ..\..\..\..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll - + False - ..\..\..\..\build\azure\NServiceBus.Azure\Microsoft.ServiceBus.dll + ..\..\..\..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll - + False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + ..\..\..\..\packages\WindowsAzure.ServiceBus.2.1.0.0\lib\net40-full\Microsoft.ServiceBus.dll - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - True + + ..\..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.1.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll - + False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - + False - ..\..\..\..\build\azure\NServiceBus.Azure\NHibernate.dll + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.StorageUtility.dll - + False - ..\..\..\..\build\azure\NServiceBus.Azure\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\build\output\NServiceBus.dll + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - ..\..\..\..\build\output\NServiceBus.Azure.dll + + ..\..\..\..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll - - False - ..\..\..\..\build\output\NServiceBus.Core.dll + + ..\..\..\..\packages\NHibernate.3.3.3.4000\lib\Net35\NHibernate.dll - - ..\..\..\..\build\hosting\NServiceBus.Hosting.dll + + ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - + False - ..\..\..\..\build\azure\NServiceBus.Azure\NServiceBus.NHibernate.dll + ..\..\..\..\packages\Obsolete.Fody.1.6.2.0\Lib\NET35\Obsolete.dll + False 3.5 + + + + + + False + ..\..\..\..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + Roles\Handlers\TransportRoleHandler.cs + + + Roles\UsingTransport.cs + @@ -122,19 +139,33 @@ - - - + + + + + + + {281646e3-32e0-4f4d-bcf6-1dc5efc6c268} + NServiceBus.NHibernate + + + {dd48b2d0-e996-412d-9157-821ed8b17a9d} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + + {12F1D9F1-0A2C-4442-8D18-67DD096C6300} + NServiceBus.Azure + + - + + \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/DevelopmentProfileHandler.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/DevelopmentProfileHandler.cs index 18de410988c..8b3bb824377 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/DevelopmentProfileHandler.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/DevelopmentProfileHandler.cs @@ -1,15 +1,17 @@ using NServiceBus.Hosting.Profiles; -using log4net.Appender; +using NServiceBus.Azure; +using NServiceBus.Logging; namespace NServiceBus.Hosting.Azure.Profiles.Handlers { + using Logging.Loggers; + internal class DevelopmentProfileHandler : IHandleProfile { void IHandleProfile.ProfileActivated() { - Configure.Instance - .Log4Net( a => { }); - + if (!(LogManager.LoggerFactory is NullLoggerFactory)) + Configure.Instance.AzureDiagnosticsLogger(false, !IsHostedIn.ChildHostProcess()); } } } \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/OnAzureStorageProfileHandler.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/OnAzureStorageProfileHandler.cs index eea4c72eb52..ccbbd41121c 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/OnAzureStorageProfileHandler.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/OnAzureStorageProfileHandler.cs @@ -2,16 +2,20 @@ namespace NServiceBus.Hosting.Azure.Profiles.Handlers { + using System; + internal class OnAzureTableStorageProfileHandler : IHandleProfile, IWantTheEndpointConfig { void IHandleProfile.ProfileActivated() { - if (Config is AsA_Worker) - { - Configure.Instance - .AzureSubcriptionStorage() - .AzureSagaPersister().NHibernateUnitOfWork(); - } + throw new NotSupportedException("Registering the storage infrastructure using a profile is no longer supported, please use UsingTransport or UseTransport instead and override the storage infrastructure using IWantCustomInitialization instead."); + + //if (Config is AsA_Worker) + //{ + // Configure.Instance + // .AzureSagaPersister() + // .NHibernateUnitOfWork(); + //} } diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/OnSqlAzureProfileHandler.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/OnSqlAzureProfileHandler.cs index 81a57683a49..bc6c6b506ee 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/OnSqlAzureProfileHandler.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/OnSqlAzureProfileHandler.cs @@ -2,17 +2,13 @@ namespace NServiceBus.Hosting.Azure.Profiles.Handlers { + using System; + internal class OnSqlAzureProfileHandler : IHandleProfile, IWantTheEndpointConfig { void IHandleProfile.ProfileActivated() { - if (Config is AsA_Worker) - { - Configure.Instance - .DBSubcriptionStorage() - .Sagas().NHibernateSagaPersister().NHibernateUnitOfWork(); - } - + throw new NotSupportedException("Registering the storage infrastructure using a profile is no longer supported, please use UsingTransport or UseTransport instead and override the storage infrastructure using IWantCustomInitialization instead."); } public IConfigureThisEndpoint Config { get; set; } diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/ProductionProfileHandler.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/ProductionProfileHandler.cs index b56b6c4ba5e..d08fefa5805 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/ProductionProfileHandler.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/ProductionProfileHandler.cs @@ -1,13 +1,17 @@ using NServiceBus.Hosting.Profiles; -using NServiceBus.Integration.Azure; +using NServiceBus.Azure; +using NServiceBus.Logging; namespace NServiceBus.Hosting.Azure.Profiles.Handlers { + using Logging.Loggers; + internal class ProductionProfileHandler : IHandleProfile { void IHandleProfile.ProfileActivated() { - Configure.Instance.Log4Net(a =>{a.InitializeDiagnostics = !IsHostedIn.ChildHostProcess();}); + if (!(LogManager.LoggerFactory is NullLoggerFactory)) + Configure.Instance.AzureDiagnosticsLogger(true, !IsHostedIn.ChildHostProcess()); } } } \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/WithAzureServiceBusQueuesProfileHandler.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/WithAzureServiceBusQueuesProfileHandler.cs index e895d6ef514..83dd4fbeaa6 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/WithAzureServiceBusQueuesProfileHandler.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/WithAzureServiceBusQueuesProfileHandler.cs @@ -2,13 +2,13 @@ namespace NServiceBus.Hosting.Azure.Profiles.Handlers { + using System; + internal class WithAzureServiceBusQueuesProfileHandler : IHandleProfile { void IHandleProfile.ProfileActivated() { - Configure.Instance - .AzureServiceBusMessageQueue(); - + throw new NotSupportedException("Registering the transport using a profile is no longer supported, please use UsingTransport or UseTransport instead."); } } } \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/WithStorageQueuesProfileHandler.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/WithStorageQueuesProfileHandler.cs index 3ede58fafc4..76d963ce864 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/WithStorageQueuesProfileHandler.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/Handler/WithStorageQueuesProfileHandler.cs @@ -2,13 +2,13 @@ namespace NServiceBus.Hosting.Azure.Profiles.Handlers { + using System; + internal class WithAzureStorageQueuesProfileHandler : IHandleProfile { void IHandleProfile.ProfileActivated() { - Configure.Instance - .AzureMessageQueue(); - + throw new NotSupportedException("Registering the transport using a profile is no longer supported, please use UsingTransport or UseTransport instead."); } } } \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/OnAzureTableStorage.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/OnAzureTableStorage.cs index 18ea98048ba..3b954eafa4d 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/OnAzureTableStorage.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/OnAzureTableStorage.cs @@ -3,6 +3,7 @@ namespace NServiceBus /// /// Indicates that the infrastructure should configure to run on top of azure table storage /// + [ObsoleteEx(Replacement = "UsingTransport or UseTransport", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] public class OnAzureTableStorage : IProfile { } diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/OnSqlAzure.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/OnSqlAzure.cs index 43d00e05ad2..595d7cbb92b 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/OnSqlAzure.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/OnSqlAzure.cs @@ -3,6 +3,7 @@ namespace NServiceBus /// /// Indicates that the infrastructure should configure to run on top of sql azure /// + [ObsoleteEx(Replacement = "UsingTransport or UseTransport", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] public class OnSqlAzure : IProfile { } diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/WithAzureServiceBusQueues.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/WithAzureServiceBusQueues.cs index 5e775d2dadd..bc1a4c75aab 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/WithAzureServiceBusQueues.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/WithAzureServiceBusQueues.cs @@ -1,5 +1,6 @@ namespace NServiceBus { + [ObsoleteEx(Replacement = "UsingTransport or UseTransport", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] public class WithAzureServiceBusQueues : IProfile { } diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/WithAzureStorageQueues.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/WithAzureStorageQueues.cs index 6cc0b4742db..05a007a6b36 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/WithAzureStorageQueues.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Profiles/WithAzureStorageQueues.cs @@ -1,5 +1,6 @@ namespace NServiceBus { + [ObsoleteEx(Replacement = "UsingTransport or UseTransport", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] public class WithAzureStorageQueues : IProfile { } diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Properties/AssemblyInfo.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Properties/AssemblyInfo.cs index db23f3585b9..61d5df9b588 100644 Binary files a/src/azure/Hosting/NServiceBus.Hosting.Azure/Properties/AssemblyInfo.cs and b/src/azure/Hosting/NServiceBus.Hosting.Azure/Properties/AssemblyInfo.cs differ diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/RoleHost/Entrypoint.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/RoleHost/Entrypoint.cs index 05a75f49af5..0812eae329a 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/RoleHost/Entrypoint.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/RoleHost/Entrypoint.cs @@ -1,162 +1,155 @@ -using Microsoft.WindowsAzure.ServiceRuntime; -using NServiceBus.Config; -using NServiceBus.Config.Conventions; -using NServiceBus.Hosting.Helpers; -using NServiceBus.Integration.Azure; -using System.Threading; -using System; -using System.Linq; -using System.Collections.Generic; -using System.Configuration; -using System.Diagnostics; - -namespace NServiceBus.Hosting.Azure -{ - /// - /// A host implementation for the Azure cloud platform - /// - public class RoleEntryPoint : Microsoft.WindowsAzure.ServiceRuntime.RoleEntryPoint - { - private const string ProfileSetting = "AzureProfileConfig.Profiles"; - private IHost host; - private readonly ManualResetEvent waitForStop = new ManualResetEvent(false); - private bool doNotReturnFromRun = true; - - public RoleEntryPoint() : this(true) - { - } - - public RoleEntryPoint(bool doNotReturnFromRun) - { - this.doNotReturnFromRun = doNotReturnFromRun; - AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException; - AppDomain.CurrentDomain.AssemblyResolve += CurrentDomainAssemblyResolve; - } - - public override bool OnStart() - { - var azureSettings = new AzureConfigurationSettings(); - var requestedProfileSetting = azureSettings.GetSetting(ProfileSetting); - - var endpointConfigurationType = GetEndpointConfigurationType(azureSettings); - - AssertThatEndpointConfigurationTypeHasDefaultConstructor(endpointConfigurationType); - - var specifier = (IConfigureThisEndpoint)Activator.CreateInstance(endpointConfigurationType); - var requestedProfiles = requestedProfileSetting.Split(' '); - requestedProfiles = AddProfilesFromConfiguration(requestedProfiles); - - if (specifier is AsA_Host) - { - host = new DynamicHostController(specifier, requestedProfiles, new[] { typeof(Development) }); - } - else - { - - //var endpointName = "Put somethingt smart here Yves"; // wonder if I live up to the expectations :) - var endpointName = RoleEnvironment.IsAvailable ? RoleEnvironment.CurrentRoleInstance.Role.Name : GetType().Name; - host = new GenericHost(specifier, requestedProfiles, new[] { typeof(Development), typeof(OnAzureTableStorage) }, endpointName); - } - - return true; - } - - private static void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e) - { - Trace.WriteLine("Unhandled exception occured: " + e.ExceptionObject.ToString()); - } - - static System.Reflection.Assembly CurrentDomainAssemblyResolve(object sender, ResolveEventArgs args) - { - Trace.WriteLine("Couldn't load assembly: " + args.Name); - return null; - } - - public override void Run() - { - host.Start(); - if(doNotReturnFromRun) waitForStop.WaitOne(); - } - - public override void OnStop() - { - host.Stop(); - waitForStop.Set(); - } - - private static void AssertThatEndpointConfigurationTypeHasDefaultConstructor(Type type) - { - var constructor = type.GetConstructor(Type.EmptyTypes); - - if (constructor == null) - throw new InvalidOperationException("Endpoint configuration type needs to have a default constructor: " + type.FullName); - } - - private static Type GetEndpointConfigurationType(AzureConfigurationSettings settings) - { - string endpoint = settings.GetSetting("EndpointConfigurationType"); - if (!String.IsNullOrEmpty(endpoint)) - { - var endpointType = Type.GetType(endpoint, false); - if (endpointType == null) - throw new ConfigurationErrorsException(string.Format("The 'EndpointConfigurationType' entry in the role config has specified to use the type '{0}' but that type could not be loaded.", endpoint)); - - return endpointType; - } - - IEnumerable endpoints = ScanAssembliesForEndpoints(); - - ValidateEndpoints(endpoints); - - return endpoints.First(); - } - - private static IEnumerable ScanAssembliesForEndpoints() - { - return AssemblyScanner.GetScannableAssemblies().Assemblies.SelectMany( - assembly => assembly.GetTypes().Where( - t => typeof(IConfigureThisEndpoint).IsAssignableFrom(t) - && t != typeof(IConfigureThisEndpoint) - && !t.IsAbstract)); - } - - private static void ValidateEndpoints(IEnumerable endpointConfigurationTypes) - { - if (endpointConfigurationTypes.Count() == 0) - { - throw new InvalidOperationException("No endpoint configuration found in scanned assemlies. " + - "This usually happens when NServiceBus fails to load your assembly containing IConfigureThisEndpoint." + - " Try specifying the type explicitly in the roles config using the appsetting key: EndpointConfigurationType, " + - "Scanned path: " + AppDomain.CurrentDomain.BaseDirectory); - } - - if (endpointConfigurationTypes.Count() > 1) - { - throw new InvalidOperationException("Host doesn't support hosting of multiple endpoints. " + - "Endpoint classes found: " + - string.Join(", ", - endpointConfigurationTypes.Select( - e => e.AssemblyQualifiedName).ToArray()) + - " You may have some old assemblies in your runtime directory." + - " Try right-clicking your VS project, and selecting 'Clean'." - ); - - } - } - - private static string[] AddProfilesFromConfiguration(IEnumerable args) - { - var list = new List(args); - - var configSection = Configure.GetConfigSection(); - - if (configSection != null) - { - var configuredProfiles = configSection.Profiles.Split(','); - Array.ForEach(configuredProfiles, s => list.Add(s.Trim())); - } - - return list.ToArray(); - } - } +using Microsoft.WindowsAzure.ServiceRuntime; +using NServiceBus.Config; +using NServiceBus.Config.Conventions; +using NServiceBus.Hosting.Helpers; +using NServiceBus.Integration.Azure; +using System.Threading; +using System; +using System.Linq; +using System.Collections.Generic; +using System.Configuration; +using System.Diagnostics; + +namespace NServiceBus.Hosting.Azure +{ + /// + /// A host implementation for the Azure cloud platform + /// + public class RoleEntryPoint : Microsoft.WindowsAzure.ServiceRuntime.RoleEntryPoint + { + private const string ProfileSetting = "AzureProfileConfig.Profiles"; + private IHost host; + private readonly ManualResetEvent waitForStop = new ManualResetEvent(false); + private bool doNotReturnFromRun = true; + + public RoleEntryPoint() : this(true) + { + } + + public RoleEntryPoint(bool doNotReturnFromRun) + { + this.doNotReturnFromRun = doNotReturnFromRun; + AppDomain.CurrentDomain.UnhandledException += CurrentDomainUnhandledException; + } + + public override bool OnStart() + { + var azureSettings = new AzureConfigurationSettings(); + var requestedProfileSetting = azureSettings.GetSetting(ProfileSetting); + + var endpointConfigurationType = GetEndpointConfigurationType(azureSettings); + + AssertThatEndpointConfigurationTypeHasDefaultConstructor(endpointConfigurationType); + + var specifier = (IConfigureThisEndpoint)Activator.CreateInstance(endpointConfigurationType); + var requestedProfiles = requestedProfileSetting.Split(' '); + requestedProfiles = AddProfilesFromConfiguration(requestedProfiles); + + //var endpointName = "Put somethingt smart here Yves"; // wonder if I live up to the expectations :) + var endpointName = RoleEnvironment.IsAvailable ? RoleEnvironment.CurrentRoleInstance.Role.Name : GetType().Name; + + if (specifier is AsA_Host) + { + host = new DynamicHostController(specifier, requestedProfiles, new List { typeof(Development) }, endpointName); + } + else + { + host = new GenericHost(specifier, requestedProfiles, new List { typeof(Development), typeof(OnAzureTableStorage) }, endpointName); + } + + return true; + } + + private static void CurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e) + { + Trace.WriteLine("Unhandled exception occured: " + e.ExceptionObject.ToString()); + } + + public override void Run() + { + host.Start(); + if(doNotReturnFromRun) waitForStop.WaitOne(); + } + + public override void OnStop() + { + host.Stop(); + waitForStop.Set(); + } + + private static void AssertThatEndpointConfigurationTypeHasDefaultConstructor(Type type) + { + var constructor = type.GetConstructor(Type.EmptyTypes); + + if (constructor == null) + throw new InvalidOperationException("Endpoint configuration type needs to have a default constructor: " + type.FullName); + } + + private static Type GetEndpointConfigurationType(AzureConfigurationSettings settings) + { + string endpoint = settings.GetSetting("EndpointConfigurationType"); + if (!String.IsNullOrEmpty(endpoint)) + { + var endpointType = Type.GetType(endpoint, false); + if (endpointType == null) + throw new ConfigurationErrorsException(string.Format("The 'EndpointConfigurationType' entry in the role config has specified to use the type '{0}' but that type could not be loaded.", endpoint)); + + return endpointType; + } + + IEnumerable endpoints = ScanAssembliesForEndpoints(); + + ValidateEndpoints(endpoints); + + return endpoints.First(); + } + + private static IEnumerable ScanAssembliesForEndpoints() + { + return AssemblyScanner.GetScannableAssemblies().Assemblies.SelectMany( + assembly => assembly.GetTypes().Where( + t => typeof(IConfigureThisEndpoint).IsAssignableFrom(t) + && t != typeof(IConfigureThisEndpoint) + && !t.IsAbstract)); + } + + private static void ValidateEndpoints(IEnumerable endpointConfigurationTypes) + { + if (endpointConfigurationTypes.Count() == 0) + { + throw new InvalidOperationException("No endpoint configuration found in scanned assemlies. " + + "This usually happens when NServiceBus fails to load your assembly containing IConfigureThisEndpoint." + + " Try specifying the type explicitly in the roles config using the appsetting key: EndpointConfigurationType, " + + "Scanned path: " + AppDomain.CurrentDomain.BaseDirectory); + } + + if (endpointConfigurationTypes.Count() > 1) + { + throw new InvalidOperationException("Host doesn't support hosting of multiple endpoints. " + + "Endpoint classes found: " + + string.Join(", ", + endpointConfigurationTypes.Select( + e => e.AssemblyQualifiedName).ToArray()) + + " You may have some old assemblies in your runtime directory." + + " Try right-clicking your VS project, and selecting 'Clean'." + ); + + } + } + + private static string[] AddProfilesFromConfiguration(IEnumerable args) + { + var list = new List(args); + + var configSection = Configure.GetConfigSection(); + + if (configSection != null) + { + var configuredProfiles = configSection.Profiles.Split(','); + Array.ForEach(configuredProfiles, s => list.Add(s.Trim())); + } + + return list.ToArray(); + } + } } \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/AsA_Listener.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/AsA_Listener.cs deleted file mode 100644 index c8e628e09c0..00000000000 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/AsA_Listener.cs +++ /dev/null @@ -1,9 +0,0 @@ -using NServiceBus.Hosting.Roles; - -namespace NServiceBus -{ - /// - /// Indicates this endpoint is a listener. - /// - public interface AsA_Listener : IRole { } -} \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/DefaultTransportForHost.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/DefaultTransportForHost.cs new file mode 100644 index 00000000000..4fdeec104b8 --- /dev/null +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/DefaultTransportForHost.cs @@ -0,0 +1,24 @@ +namespace NServiceBus.Hosting.Azure.Roles.Handlers +{ + using Settings; + using Transports; + + public class DefaultTransportForHost : IWantToRunBeforeConfigurationIsFinalized + { + public void Run() + { + + if (Configure.Instance.Configurer.HasComponent()) + { + return; + } + + if (SettingsHolder.GetOrDefault("NServiceBus.Transport.SelectedTransport") != null) + { + return; + } + + Configure.Instance.UseTransport(); + } + } +} \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/ListenerRoleHandler.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/ListenerRoleHandler.cs deleted file mode 100644 index 9a5144c2722..00000000000 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/ListenerRoleHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.WindowsAzure.ServiceRuntime; -using NServiceBus.Config; -using NServiceBus.Hosting.Roles; -using NServiceBus.Serialization; -using NServiceBus.Unicast.Config; - -namespace NServiceBus.Hosting.Azure.Roles.Handlers -{ - /// - /// Handles configuration related to the listener role - /// - public class ListenerRoleHandler : IConfigureRole - { - /// - /// Configures the UnicastBus with typical settings for a listener on azure - /// - /// - /// - public ConfigUnicastBus ConfigureRole(IConfigureThisEndpoint specifier) - { - var instance = Configure.Instance; - - if (RoleEnvironment.IsAvailable && !IsHostedIn.ChildHostProcess()) - { - instance.AzureConfigurationSource(); - } - - if (!instance.Configurer.HasComponent()) - instance.JsonSerializer(); - - return instance - .IsTransactional(true) - .UnicastBus() - .ImpersonateSender(false); - } - } -} \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/WorkerRoleHandler.cs b/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/WorkerRoleHandler.cs index c7e18713e28..21be9610838 100644 --- a/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/WorkerRoleHandler.cs +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/Roles/Handlers/WorkerRoleHandler.cs @@ -1,7 +1,4 @@ -using Microsoft.WindowsAzure.ServiceRuntime; -using NServiceBus.Config; using NServiceBus.Hosting.Roles; -using NServiceBus.Serialization; using NServiceBus.Unicast.Config; namespace NServiceBus.Hosting.Azure.Roles.Handlers @@ -9,7 +6,7 @@ namespace NServiceBus.Hosting.Azure.Roles.Handlers /// /// Handles configuration related to the server role /// - public class WorkerRoleHandler : IConfigureRole, IWantTheEndpointConfig + public class WorkerRoleHandler : IConfigureRole { /// /// Configures the UnicastBus with typical settings for a server on azure @@ -18,24 +15,12 @@ public class WorkerRoleHandler : IConfigureRole, IWantTheEndpointCon /// public ConfigUnicastBus ConfigureRole(IConfigureThisEndpoint specifier) { - var instance = Configure.Instance; + Configure.Transactions.Enable(); + Configure.Features.Enable(); - if (RoleEnvironment.IsAvailable && !IsHostedIn.ChildHostProcess()) - { - instance.AzureConfigurationSource(); - } - - if (!instance.Configurer.HasComponent()) - instance.JsonSerializer(); - - return instance - .IsTransactional(true) - .Sagas() - .UnicastBus() - .ImpersonateSender(false); + return Configure.Instance.UnicastBus() + .RunHandlersUnderIncomingPrincipal(false); } - - - public IConfigureThisEndpoint Config { get; set; } } -} \ No newline at end of file +} + \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/app.config b/src/azure/Hosting/NServiceBus.Hosting.Azure/app.config new file mode 100644 index 00000000000..f53d06f032c --- /dev/null +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/app.config @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.Azure/packages.config b/src/azure/Hosting/NServiceBus.Hosting.Azure/packages.config new file mode 100644 index 00000000000..6065c3b9302 --- /dev/null +++ b/src/azure/Hosting/NServiceBus.Hosting.Azure/packages.config @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/azure/Hosting/NServiceBus.Hosting.HostProcess.sln b/src/azure/Hosting/NServiceBus.Hosting.HostProcess.sln deleted file mode 100644 index d3e2032a86d..00000000000 --- a/src/azure/Hosting/NServiceBus.Hosting.HostProcess.sln +++ /dev/null @@ -1,30 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Hosting.Azure.HostProcess", "NServiceBus.Hosting.Azure.HostProcess\NServiceBus.Hosting.Azure.HostProcess.csproj", "{11B81F23-64C6-4341-94AC-38B3C4C6B1E7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Debug|Any CPU.ActiveCfg = Debug|x86 - {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Debug|x86.ActiveCfg = Debug|x86 - {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Debug|x86.Build.0 = Debug|x86 - {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Release|Any CPU.ActiveCfg = Release|x86 - {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Release|Mixed Platforms.Build.0 = Release|x86 - {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Release|x86.ActiveCfg = Release|x86 - {11B81F23-64C6-4341-94AC-38B3C4C6B1E7}.Release|x86.Build.0 = Release|x86 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/azure/Hosting/NServiceBus.Hosting.sln b/src/azure/Hosting/NServiceBus.Hosting.sln deleted file mode 100644 index 4afc58ccbd5..00000000000 --- a/src/azure/Hosting/NServiceBus.Hosting.sln +++ /dev/null @@ -1,30 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Hosting.Azure", "NServiceBus.Hosting.Azure\NServiceBus.Hosting.Azure.csproj", "{6591ED91-F9A1-4CC3-813E-A33E07439D49}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Debug|x86.ActiveCfg = Debug|Any CPU - {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Release|Any CPU.Build.0 = Release|Any CPU - {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {6591ED91-F9A1-4CC3-813E-A33E07439D49}.Release|x86.ActiveCfg = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/azure/Integration/NServiceBus.Integration.Azure.Tests/NServiceBus.Integration.Azure.Tests.csproj b/src/azure/Integration/NServiceBus.Integration.Azure.Tests/NServiceBus.Integration.Azure.Tests.csproj index ded197ab2e8..7df352c7b0e 100644 --- a/src/azure/Integration/NServiceBus.Integration.Azure.Tests/NServiceBus.Integration.Azure.Tests.csproj +++ b/src/azure/Integration/NServiceBus.Integration.Azure.Tests/NServiceBus.Integration.Azure.Tests.csproj @@ -12,6 +12,8 @@ NServiceBus.Integration.Azure.Tests v4.0 512 + ..\..\..\..\ + true true @@ -34,41 +36,65 @@ ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - ..\..\..\..\build\output\NServiceBus.dll + + False + ..\..\..\..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll - - ..\..\..\..\build\output\NServiceBus.Core.dll + + False + ..\..\..\..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + ..\..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.1.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + ..\..\..\..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll - ..\..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll + ..\..\..\..\packages\NUnit.2.6.2\lib\nunit.framework.dll - ..\..\..\..\packages\RhinoMocks.3.6\lib\Rhino.Mocks.dll + ..\..\..\..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll 3.5 + + + + False + ..\..\..\..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + - - - - {641D0198-FE99-42F4-B6CB-A14D0E9F639E} - NServiceBus.Integration.Azure - - + + + {dd48b2d0-e996-412d-9157-821ed8b17a9d} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + + {12F1D9F1-0A2C-4442-8D18-67DD096C6300} + NServiceBus.Azure + + + \ No newline at end of file diff --git a/src/azure/Integration/NServiceBus.Integration.Azure.Tests/Properties/AssemblyInfo.cs b/src/azure/Integration/NServiceBus.Integration.Azure.Tests/Properties/AssemblyInfo.cs index 431a4c8c227..be2f1477242 100644 Binary files a/src/azure/Integration/NServiceBus.Integration.Azure.Tests/Properties/AssemblyInfo.cs and b/src/azure/Integration/NServiceBus.Integration.Azure.Tests/Properties/AssemblyInfo.cs differ diff --git a/src/azure/Integration/NServiceBus.Integration.Azure.Tests/When_using_the_azure_configuration_source.cs b/src/azure/Integration/NServiceBus.Integration.Azure.Tests/When_using_the_azure_configuration_source.cs index a101b98f4ea..de13a18df0f 100644 --- a/src/azure/Integration/NServiceBus.Integration.Azure.Tests/When_using_the_azure_configuration_source.cs +++ b/src/azure/Integration/NServiceBus.Integration.Azure.Tests/When_using_the_azure_configuration_source.cs @@ -5,6 +5,7 @@ namespace NServiceBus.Integration.Azure.Tests { [TestFixture] + [Category("Azure")] public class When_using_the_azure_configuration_source { private IAzureConfigurationSettings azureSettings; @@ -34,8 +35,8 @@ public void Overrides_should_be_possible_for_non_existing_sections() Assert.AreEqual(configSource.GetConfiguration().SomeSetting,"test"); } - [Test,Ignore("Check this one Yves")] - public void No_section_should_be_returned_if_both_azure_and_app_confis_are_empty() + [Test] + public void No_section_should_be_returned_if_both_azure_and_app_configs_are_empty() { Assert.Null(configSource.GetConfiguration()); } diff --git a/src/azure/Integration/NServiceBus.Integration.Azure.Tests/packages.config b/src/azure/Integration/NServiceBus.Integration.Azure.Tests/packages.config index a64a4b268fa..de7a990ac47 100644 --- a/src/azure/Integration/NServiceBus.Integration.Azure.Tests/packages.config +++ b/src/azure/Integration/NServiceBus.Integration.Azure.Tests/packages.config @@ -1,5 +1,11 @@  - + + + + + + + \ No newline at end of file diff --git a/src/azure/Integration/NServiceBus.Integration.Azure/AzureAppender.cs b/src/azure/Integration/NServiceBus.Integration.Azure/AzureAppender.cs deleted file mode 100644 index fd332e4e6df..00000000000 --- a/src/azure/Integration/NServiceBus.Integration.Azure/AzureAppender.cs +++ /dev/null @@ -1,193 +0,0 @@ -using System; -using System.Diagnostics; -using log4net.Appender; -using log4net.Core; -using log4net.Repository.Hierarchy; -using Microsoft.WindowsAzure; -using Microsoft.WindowsAzure.Diagnostics; -using Microsoft.WindowsAzure.Diagnostics.Management; -using Microsoft.WindowsAzure.ServiceRuntime; - -namespace NServiceBus.Integration.Azure -{ - public sealed class AzureAppender : AppenderSkeleton - { - private const string ConnectionStringKey = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString"; - private const string LevelKey = "Microsoft.WindowsAzure.Plugins.Diagnostics.Level"; - private const string LayoutKey = "Microsoft.WindowsAzure.Plugins.Diagnostics.Layout"; - private const string ScheduledTransferPeriodKey = "Microsoft.WindowsAzure.Plugins.Diagnostics.ScheduledTransferPeriod"; - private const string EventLogsKey = "Microsoft.WindowsAzure.Plugins.Diagnostics.EventLogs"; - - public AzureAppender() : this(true) - { - } - - public AzureAppender(bool initializeDiagnostics) - { - this.InitializeDiagnostics = initializeDiagnostics; - ScheduledTransferPeriod = GetScheduledTransferPeriod(); - Layout = new log4net.Layout.PatternLayout(GetLayout()); - Level = GetLevel(); - } - - public int ScheduledTransferPeriod { get; set; } - - public string Level { get; set; } - - public bool InitializeDiagnostics { get; set; } - - protected override void Append(LoggingEvent loggingEvent) - { - var logString = RenderLoggingEvent(loggingEvent); - - if (loggingEvent.Level == log4net.Core.Level.Critical || loggingEvent.Level == log4net.Core.Level.Error || loggingEvent.Level == log4net.Core.Level.Emergency || loggingEvent.Level == log4net.Core.Level.Fatal || loggingEvent.Level == log4net.Core.Level.Severe) - { - Trace.TraceError(logString); - } - else if (loggingEvent.Level == log4net.Core.Level.Warn || loggingEvent.Level == log4net.Core.Level.Alert) - { - Trace.TraceWarning(logString); - } - else if (loggingEvent.Level == log4net.Core.Level.Info) - { - Trace.TraceInformation(logString); - } - else - { - Trace.WriteLine(logString); - } - } - - public override void ActivateOptions() - { - ConfigureThreshold(); - - base.ActivateOptions(); - - ConfigureAzureDiagnostics(); - } - - private void ConfigureThreshold() - { - var rootRepository = (Hierarchy)log4net.LogManager.GetRepository(); - Threshold = rootRepository.LevelMap[Level]; - } - - private void ConfigureAzureDiagnostics() - { - if (!RoleEnvironment.IsAvailable) return; - - Trace.Listeners.Add(new DiagnosticMonitorTraceListener()); - - if (!InitializeDiagnostics) return; - - var cloudStorageAccount = CloudStorageAccount.Parse(GetConnectionString()); - - var roleInstanceDiagnosticManager = cloudStorageAccount.CreateRoleInstanceDiagnosticManager( - RoleEnvironment.DeploymentId, - RoleEnvironment.CurrentRoleInstance.Role.Name, - RoleEnvironment.CurrentRoleInstance.Id); - - var configuration = roleInstanceDiagnosticManager.GetCurrentConfiguration(); - - if (configuration == null) // to remain backward compatible with sdk 1.2 - { - configuration = DiagnosticMonitor.GetDefaultInitialConfiguration(); - - ConfigureDiagnostics(configuration); - - DiagnosticMonitor.Start(cloudStorageAccount, configuration); - } - } - - private void ConfigureDiagnostics(DiagnosticMonitorConfiguration configuration) - { - //set threshold to verbose, what gets logged is controled by the log4net level - configuration.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose; - - ScheduleTransfer(configuration); - - ConfigureWindowsEventLogsToBeTransferred(configuration); - } - - private void ScheduleTransfer(DiagnosticMonitorConfiguration dmc) - { - var transferPeriod = TimeSpan.FromMinutes(ScheduledTransferPeriod); - dmc.Logs.ScheduledTransferPeriod = transferPeriod; - dmc.WindowsEventLog.ScheduledTransferPeriod = transferPeriod; - } - - private static void ConfigureWindowsEventLogsToBeTransferred(DiagnosticMonitorConfiguration dmc) - { - var eventLogs = GetEventLogs().Split(';'); - foreach (var log in eventLogs) - { - dmc.WindowsEventLog.DataSources.Add(log); - } - } - - private static string GetConnectionString() - { - try - { - return RoleEnvironment.GetConfigurationSettingValue(ConnectionStringKey); - } - catch (Exception) - { - return "UseDevelopmentStorage=true"; - } - } - - - private static string GetLevel() - { - try - { - return RoleEnvironment.GetConfigurationSettingValue(LevelKey); - } - catch (Exception) - { - return "Warn"; - } - } - - private static string GetLayout() - { - try - { - return RoleEnvironment.GetConfigurationSettingValue(LayoutKey); - } - catch (Exception) - { - return "%d [%t] %-5p %c [%x] <%X{auth}> - %m%n"; - } - } - - private static int GetScheduledTransferPeriod() - { - try - { - return int.Parse(RoleEnvironment.GetConfigurationSettingValue(ScheduledTransferPeriodKey)); - } - catch (Exception) - { - return 10; - } - } - - private static string GetEventLogs() - { - try - { - return RoleEnvironment.GetConfigurationSettingValue(EventLogsKey); - } - catch (Exception) - { - return "Application!*;System!*"; - } - } - - } -} - - \ No newline at end of file diff --git a/src/azure/Integration/NServiceBus.Integration.Azure/AzureConfigurationSettings.cs b/src/azure/Integration/NServiceBus.Integration.Azure/AzureConfigurationSettings.cs deleted file mode 100644 index be36dd1e166..00000000000 --- a/src/azure/Integration/NServiceBus.Integration.Azure/AzureConfigurationSettings.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using Microsoft.WindowsAzure.ServiceRuntime; - -namespace NServiceBus.Integration.Azure -{ - public class AzureConfigurationSettings : IAzureConfigurationSettings - { - public string GetSetting(string name) - { - if (!RoleEnvironment.IsAvailable) - return ""; - - //hack: the azure runtime throws if a setting doesn't exists and there is no way of - //checking that a setting is defined. Therefor we have to do this ugly stuff - try - { - return RoleEnvironment.GetConfigurationSettingValue(name); - } - catch (Exception) - { - return ""; - } - - } - } -} \ No newline at end of file diff --git a/src/azure/Integration/NServiceBus.Integration.Azure/NServiceBus.Integration.Azure.csproj b/src/azure/Integration/NServiceBus.Integration.Azure/NServiceBus.Integration.Azure.csproj deleted file mode 100644 index 67e22a13e96..00000000000 --- a/src/azure/Integration/NServiceBus.Integration.Azure/NServiceBus.Integration.Azure.csproj +++ /dev/null @@ -1,85 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {641D0198-FE99-42F4-B6CB-A14D0E9F639E} - Library - Properties - NServiceBus.Integration.Azure - NServiceBus.Integration.Azure - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - False - ..\..\..\..\build\output\NServiceBus.dll - - - ..\..\..\..\build\output\NServiceBus.Core.dll - - - - - 3.5 - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/azure/Integration/NServiceBus.Integration.Azure/Properties/AssemblyInfo.cs b/src/azure/Integration/NServiceBus.Integration.Azure/Properties/AssemblyInfo.cs deleted file mode 100644 index 57def95133a..00000000000 Binary files a/src/azure/Integration/NServiceBus.Integration.Azure/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/azure/Integration/NServiceBus.Integration.Azure/packages.config b/src/azure/Integration/NServiceBus.Integration.Azure/packages.config deleted file mode 100644 index b9267ea4f1c..00000000000 --- a/src/azure/Integration/NServiceBus.Integration.Azure/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/azure/Integration/integration.sln b/src/azure/Integration/integration.sln deleted file mode 100644 index 8d7387119b8..00000000000 --- a/src/azure/Integration/integration.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Integration.Azure", "NServiceBus.Integration.Azure\NServiceBus.Integration.Azure.csproj", "{641D0198-FE99-42F4-B6CB-A14D0E9F639E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Integration.Azure.Tests", "NServiceBus.Integration.Azure.Tests\NServiceBus.Integration.Azure.Tests.csproj", "{CA59C36D-FA35-42B4-99B5-5725C6AF1B01}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4BAFD4CB-59CC-49D6-B1FE-D5D27525D593}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4BAFD4CB-59CC-49D6-B1FE-D5D27525D593}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4BAFD4CB-59CC-49D6-B1FE-D5D27525D593}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4BAFD4CB-59CC-49D6-B1FE-D5D27525D593}.Release|Any CPU.Build.0 = Release|Any CPU - {8CF614E1-FEAC-4C92-9F64-EF809C0BBC0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8CF614E1-FEAC-4C92-9F64-EF809C0BBC0A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8CF614E1-FEAC-4C92-9F64-EF809C0BBC0A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8CF614E1-FEAC-4C92-9F64-EF809C0BBC0A}.Release|Any CPU.Build.0 = Release|Any CPU - {641D0198-FE99-42F4-B6CB-A14D0E9F639E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {641D0198-FE99-42F4-B6CB-A14D0E9F639E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {641D0198-FE99-42F4-B6CB-A14D0E9F639E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {641D0198-FE99-42F4-B6CB-A14D0E9F639E}.Release|Any CPU.Build.0 = Release|Any CPU - {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/azure/NServiceBus.Azure.sln b/src/azure/NServiceBus.Azure.sln deleted file mode 100644 index 17f65080323..00000000000 --- a/src/azure/NServiceBus.Azure.sln +++ /dev/null @@ -1,96 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.DataBus.Azure.BlobStorage", "DataBus\NServiceBus.DataBus.Azure.BlobStorage\NServiceBus.DataBus.Azure.BlobStorage.csproj", "{BF761591-5BAE-4CA1-96D5-CB70DBD4B71B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Integration.Azure", "Integration\NServiceBus.Integration.Azure\NServiceBus.Integration.Azure.csproj", "{641D0198-FE99-42F4-B6CB-A14D0E9F639E}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Integration.Azure.Tests", "Integration\NServiceBus.Integration.Azure.Tests\NServiceBus.Integration.Azure.Tests.csproj", "{CA59C36D-FA35-42B4-99B5-5725C6AF1B01}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing.AppFabric", "Queueing\NServiceBus.Unicast.Queuing.AppFabric\NServiceBus.Unicast.Queuing.AppFabric.csproj", "{911C5871-B059-4F8D-99B3-86F13CDEFC86}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing.AppFabric.Config", "Queueing\NServiceBus.Unicast.Queuing.AppFabric.Config\NServiceBus.Unicast.Queuing.AppFabric.Config.csproj", "{350CA11F-E647-47F6-B9A3-1E1653B8D4B0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing.Azure", "Queueing\NServiceBus.Unicast.Queuing.Azure\NServiceBus.Unicast.Queuing.Azure.csproj", "{D12E0534-9C6F-4E39-AC68-4212FF13E7F1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing.Azure.Config", "Queueing\NServiceBus.Unicast.Queuing.Azure.Config\NServiceBus.Unicast.Queuing.Azure.Config.csproj", "{87C365D3-7D4A-4686-A042-5E7B83869CBF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing.Azure.Tests", "Queueing\NServiceBus.Unicast.Queuing.Azure.Tests\NServiceBus.Unicast.Queuing.Azure.Tests.csproj", "{D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Databus", "Databus", "{0D1DC6CA-F387-46ED-8381-79FDF0137F69}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Integration", "Integration", "{A49ABF3E-AD05-46C2-9CD4-7E41B2E535FB}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Queuing", "Queuing", "{A009A68C-EA1E-4969-A9AB-BC246CDE7380}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.SagaPersisters.Azure.Config", "SagaPersister\NServiceBus.SagaPersisters.Azure.Config\NServiceBus.SagaPersisters.Azure.Config.csproj", "{E9BCCCDC-5D5D-48AB-BF7A-5A2FE669D353}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Subscriptions.Azure.TableStorage", "SubscriptionStorage\NServiceBus.Unicast.Subscriptions.Azure.TableStorage.csproj", "{FB2ACC79-1E04-47CA-8F4B-31327E10B5E3}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SagaPersister", "SagaPersister", "{601970BF-3F3A-4ABE-B5D9-B8053E54D9EE}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SubscriptionStorage", "SubscriptionStorage", "{3CD9D1E6-35E1-472C-AA72-E4051D78BC00}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BF761591-5BAE-4CA1-96D5-CB70DBD4B71B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BF761591-5BAE-4CA1-96D5-CB70DBD4B71B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BF761591-5BAE-4CA1-96D5-CB70DBD4B71B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BF761591-5BAE-4CA1-96D5-CB70DBD4B71B}.Release|Any CPU.Build.0 = Release|Any CPU - {641D0198-FE99-42F4-B6CB-A14D0E9F639E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {641D0198-FE99-42F4-B6CB-A14D0E9F639E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {641D0198-FE99-42F4-B6CB-A14D0E9F639E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {641D0198-FE99-42F4-B6CB-A14D0E9F639E}.Release|Any CPU.Build.0 = Release|Any CPU - {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CA59C36D-FA35-42B4-99B5-5725C6AF1B01}.Release|Any CPU.Build.0 = Release|Any CPU - {911C5871-B059-4F8D-99B3-86F13CDEFC86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {911C5871-B059-4F8D-99B3-86F13CDEFC86}.Debug|Any CPU.Build.0 = Debug|Any CPU - {911C5871-B059-4F8D-99B3-86F13CDEFC86}.Release|Any CPU.ActiveCfg = Release|Any CPU - {911C5871-B059-4F8D-99B3-86F13CDEFC86}.Release|Any CPU.Build.0 = Release|Any CPU - {350CA11F-E647-47F6-B9A3-1E1653B8D4B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {350CA11F-E647-47F6-B9A3-1E1653B8D4B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {350CA11F-E647-47F6-B9A3-1E1653B8D4B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {350CA11F-E647-47F6-B9A3-1E1653B8D4B0}.Release|Any CPU.Build.0 = Release|Any CPU - {D12E0534-9C6F-4E39-AC68-4212FF13E7F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D12E0534-9C6F-4E39-AC68-4212FF13E7F1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D12E0534-9C6F-4E39-AC68-4212FF13E7F1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D12E0534-9C6F-4E39-AC68-4212FF13E7F1}.Release|Any CPU.Build.0 = Release|Any CPU - {87C365D3-7D4A-4686-A042-5E7B83869CBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {87C365D3-7D4A-4686-A042-5E7B83869CBF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {87C365D3-7D4A-4686-A042-5E7B83869CBF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {87C365D3-7D4A-4686-A042-5E7B83869CBF}.Release|Any CPU.Build.0 = Release|Any CPU - {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Release|Any CPU.Build.0 = Release|Any CPU - {E9BCCCDC-5D5D-48AB-BF7A-5A2FE669D353}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E9BCCCDC-5D5D-48AB-BF7A-5A2FE669D353}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E9BCCCDC-5D5D-48AB-BF7A-5A2FE669D353}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E9BCCCDC-5D5D-48AB-BF7A-5A2FE669D353}.Release|Any CPU.Build.0 = Release|Any CPU - {FB2ACC79-1E04-47CA-8F4B-31327E10B5E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FB2ACC79-1E04-47CA-8F4B-31327E10B5E3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FB2ACC79-1E04-47CA-8F4B-31327E10B5E3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FB2ACC79-1E04-47CA-8F4B-31327E10B5E3}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {BF761591-5BAE-4CA1-96D5-CB70DBD4B71B} = {0D1DC6CA-F387-46ED-8381-79FDF0137F69} - {641D0198-FE99-42F4-B6CB-A14D0E9F639E} = {A49ABF3E-AD05-46C2-9CD4-7E41B2E535FB} - {CA59C36D-FA35-42B4-99B5-5725C6AF1B01} = {A49ABF3E-AD05-46C2-9CD4-7E41B2E535FB} - {911C5871-B059-4F8D-99B3-86F13CDEFC86} = {A009A68C-EA1E-4969-A9AB-BC246CDE7380} - {350CA11F-E647-47F6-B9A3-1E1653B8D4B0} = {A009A68C-EA1E-4969-A9AB-BC246CDE7380} - {D12E0534-9C6F-4E39-AC68-4212FF13E7F1} = {A009A68C-EA1E-4969-A9AB-BC246CDE7380} - {87C365D3-7D4A-4686-A042-5E7B83869CBF} = {A009A68C-EA1E-4969-A9AB-BC246CDE7380} - {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD} = {A009A68C-EA1E-4969-A9AB-BC246CDE7380} - {E9BCCCDC-5D5D-48AB-BF7A-5A2FE669D353} = {601970BF-3F3A-4ABE-B5D9-B8053E54D9EE} - {FB2ACC79-1E04-47CA-8F4B-31327E10B5E3} = {3CD9D1E6-35E1-472C-AA72-E4051D78BC00} - EndGlobalSection -EndGlobal diff --git a/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/Config/AzureDataBusConfig.cs b/src/azure/NServiceBus.Azure/Config/AzureDataBusConfig.cs similarity index 100% rename from src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/Config/AzureDataBusConfig.cs rename to src/azure/NServiceBus.Azure/Config/AzureDataBusConfig.cs diff --git a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/AzureSagaPersisterConfig.cs b/src/azure/NServiceBus.Azure/Config/AzureSagaPersisterConfig.cs similarity index 94% rename from src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/AzureSagaPersisterConfig.cs rename to src/azure/NServiceBus.Azure/Config/AzureSagaPersisterConfig.cs index c9fd8b25228..26d261e832b 100644 --- a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/AzureSagaPersisterConfig.cs +++ b/src/azure/NServiceBus.Azure/Config/AzureSagaPersisterConfig.cs @@ -1,8 +1,7 @@ -using System.Collections.Generic; -using System.Configuration; - namespace NServiceBus.Config { + using System.Configuration; + /// /// Config section for the Azure Saga Persister /// diff --git a/src/azure/NServiceBus.Azure/Config/AzureServiceBusPersistence.cs b/src/azure/NServiceBus.Azure/Config/AzureServiceBusPersistence.cs new file mode 100644 index 00000000000..8484392511a --- /dev/null +++ b/src/azure/NServiceBus.Azure/Config/AzureServiceBusPersistence.cs @@ -0,0 +1,14 @@ +namespace NServiceBus.Config +{ + using Saga; + using Timeout.Core; + + public class AzureServiceBusPersistence + { + public static void UseAsDefault() + { + InfrastructureServices.SetDefaultFor(() => Configure.Instance.AzureSagaPersister()); + InfrastructureServices.SetDefaultFor(() => Configure.Instance.UseAzureTimeoutPersister()); + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Config/AzureStoragePersistence.cs b/src/azure/NServiceBus.Azure/Config/AzureStoragePersistence.cs new file mode 100644 index 00000000000..7a8135c372c --- /dev/null +++ b/src/azure/NServiceBus.Azure/Config/AzureStoragePersistence.cs @@ -0,0 +1,16 @@ +namespace NServiceBus.Config +{ + using Saga; + using Timeout.Core; + using Unicast.Subscriptions.MessageDrivenSubscriptions; + + public class AzureStoragePersistence + { + public static void UseAsDefault() + { + InfrastructureServices.SetDefaultFor(() => Configure.Instance.AzureSagaPersister()); + InfrastructureServices.SetDefaultFor(() => Configure.Instance.UseAzureTimeoutPersister()); + InfrastructureServices.SetDefaultFor(() => Configure.Instance.AzureSubcriptionStorage()); + } + } +} \ No newline at end of file diff --git a/src/azure/SubscriptionStorage/Config/AzureSubscriptionStorageConfig.cs b/src/azure/NServiceBus.Azure/Config/AzureSubscriptionStorageConfig.cs similarity index 95% rename from src/azure/SubscriptionStorage/Config/AzureSubscriptionStorageConfig.cs rename to src/azure/NServiceBus.Azure/Config/AzureSubscriptionStorageConfig.cs index c414eab8471..5edda7351fd 100644 --- a/src/azure/SubscriptionStorage/Config/AzureSubscriptionStorageConfig.cs +++ b/src/azure/NServiceBus.Azure/Config/AzureSubscriptionStorageConfig.cs @@ -36,8 +36,7 @@ public string TableName { get { - - return (string)this["TableName"]; + return this["TableName"] as string; } set { @@ -46,4 +45,4 @@ public string TableName } } -} \ No newline at end of file +} diff --git a/src/azure/NServiceBus.Azure/Config/AzureTimeoutPersisterConfig.cs b/src/azure/NServiceBus.Azure/Config/AzureTimeoutPersisterConfig.cs new file mode 100644 index 00000000000..e6085050730 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Config/AzureTimeoutPersisterConfig.cs @@ -0,0 +1,63 @@ +using System.Configuration; + +namespace NServiceBus.Config +{ + /// + /// + /// + public class AzureTimeoutPersisterConfig : ConfigurationSection + { + /// + /// + /// + [ConfigurationProperty("ConnectionString", IsRequired = false, DefaultValue = "UseDevelopmentStorage=true")] + public string ConnectionString + { + get { return (string)this["ConnectionString"]; } + set { this["ConnectionString"] = value; } + } + + /// + /// + /// + [ConfigurationProperty("TimeoutManagerDataTableName", IsRequired = false, DefaultValue = "TimeoutManagerDataTable")] + public string TimeoutManagerDataTableName + { + get { return (string)this["TimeoutManagerDataTableName"]; } + set { this["TimeoutManagerDataTableName"] = value; } + } + + /// + /// + /// + [ConfigurationProperty("TimeoutDataTableName", IsRequired = false, DefaultValue = "TimeoutDataTableName")] + public string TimeoutDataTableName + { + get { return (string)this["TimeoutDataTableName"]; } + set { this["TimeoutDataTableName"] = value; } + } + + /// + /// + /// + [ConfigurationProperty("CatchUpInterval", IsRequired = false, DefaultValue = 3600)] + public int CatchUpInterval + { + get { return (int)this["CatchUpInterval"]; } + set { this["CatchUpInterval"] = value; } + } + + /// + /// + /// + [ConfigurationProperty("PartitionKeyScope", IsRequired = false, DefaultValue = "yyyMMddHH")] + public string PartitionKeyScope + { + get { return (string)this["PartitionKeyScope"]; } + set { this["PartitionKeyScope"] = value; } + } + + + + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Config/QueueAutoCreation.cs b/src/azure/NServiceBus.Azure/Config/QueueAutoCreation.cs new file mode 100644 index 00000000000..774581dedaf --- /dev/null +++ b/src/azure/NServiceBus.Azure/Config/QueueAutoCreation.cs @@ -0,0 +1,34 @@ +namespace NServiceBus.Features +{ + using System; + using System.Linq; + using Config; + using Transports; + using Unicast.Queuing; + + /// + /// Makes sure that all queues are created + /// + public class QueueAutoCreation:Feature,IWantToRunWhenConfigurationIsComplete + { + public ICreateQueues QueueCreator { get; set; } + + public void Run() + { + if (!IsEnabled()) + return; + + var wantQueueCreatedInstances = Configure.Instance.Builder.BuildAll().ToList(); + + foreach (var wantQueueCreatedInstance in wantQueueCreatedInstances.Where(wantQueueCreatedInstance => !wantQueueCreatedInstance.IsDisabled)) + { + if (wantQueueCreatedInstance.Address == null) + { + throw new InvalidOperationException(string.Format("IWantQueueCreated implementation {0} returned a null address", wantQueueCreatedInstance.GetType().FullName)); + } + + QueueCreator.CreateQueueIfNecessary(wantQueueCreatedInstance.Address, null); + } + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Config/QueueIndividualizer.cs b/src/azure/NServiceBus.Azure/Config/QueueIndividualizer.cs new file mode 100644 index 00000000000..0578d48329b --- /dev/null +++ b/src/azure/NServiceBus.Azure/Config/QueueIndividualizer.cs @@ -0,0 +1,47 @@ +namespace NServiceBus.Config +{ + using System.Globalization; + using Microsoft.WindowsAzure.ServiceRuntime; + + internal class QueueIndividualizer + { + public static string Individualize(string queueName) + { + var individualQueueName = queueName; + if (RoleEnvironment.IsAvailable) + { + var index = ParseIndexFrom(RoleEnvironment.CurrentRoleInstance.Id); + individualQueueName = ParseQueueNameFrom(queueName) + + (index > 0 ? "-" : "") + + (index > 0 ? index.ToString(CultureInfo.InvariantCulture) : ""); + + if (queueName.Contains("@")) + individualQueueName += "@" + ParseMachineNameFrom(queueName); + } + + return individualQueueName; + } + + private static string ParseMachineNameFrom(string inputQueue) + { + return inputQueue.Contains("@") ? inputQueue.Substring(inputQueue.IndexOf("@", System.StringComparison.Ordinal) + 1) : string.Empty; + } + + private static object ParseQueueNameFrom(string inputQueue) + { + return inputQueue.Contains("@") ? inputQueue.Substring(0, inputQueue.IndexOf("@", System.StringComparison.Ordinal)) : inputQueue; + } + + private static int ParseIndexFrom(string id) + { + var idArray = id.Split('.'); + int index; + if (!int.TryParse((idArray[idArray.Length - 1]), out index)) + { + idArray = id.Split('_'); + index = int.Parse((idArray[idArray.Length - 1])); + } + return index; + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/ConfigurationSource/Azure/AzureConfigurationSettings.cs b/src/azure/NServiceBus.Azure/ConfigurationSource/Azure/AzureConfigurationSettings.cs new file mode 100644 index 00000000000..2d2314cb8d0 --- /dev/null +++ b/src/azure/NServiceBus.Azure/ConfigurationSource/Azure/AzureConfigurationSettings.cs @@ -0,0 +1,44 @@ +namespace NServiceBus.Integration.Azure +{ + using System; + using Microsoft.WindowsAzure.ServiceRuntime; + //using Microsoft.WindowsAzure.ServiceRuntime.Internal; + + public class AzureConfigurationSettings : IAzureConfigurationSettings + { + public string GetSetting(string name) + { + if (!RoleEnvironment.IsAvailable) + return ""; + + return TryGetSetting(name); + } + + static string TryGetSetting(string name) + { + try + { + return RoleEnvironment.GetConfigurationSettingValue(name); + } + catch (Exception) + { + return ""; + } + + // code left in comments here, until build server has sdk installed + + //hack: the azure runtime throws if a setting doesn't exists and this seems to be a way of + //checking that a setting is defined. Still ugly stuff though because of the dep on msshrtmi + + //string ret; + //var hr = InteropRoleManager.GetConfigurationSetting(name, out ret); + + //if (HResult.Failed(hr)) + //{ + // return ""; + //} + + //return ret; + } + } +} \ No newline at end of file diff --git a/src/azure/Integration/NServiceBus.Integration.Azure/AzureConfigurationSource.cs b/src/azure/NServiceBus.Azure/ConfigurationSource/Azure/AzureConfigurationSource.cs similarity index 87% rename from src/azure/Integration/NServiceBus.Integration.Azure/AzureConfigurationSource.cs rename to src/azure/NServiceBus.Azure/ConfigurationSource/Azure/AzureConfigurationSource.cs index a5c0036ce33..bd930642778 100644 --- a/src/azure/Integration/NServiceBus.Integration.Azure/AzureConfigurationSource.cs +++ b/src/azure/NServiceBus.Azure/ConfigurationSource/Azure/AzureConfigurationSource.cs @@ -1,12 +1,12 @@ -using System; -using System.Configuration; -using System.Linq; -using System.Web.Configuration; -using System.Web.Hosting; -using NServiceBus.Config.ConfigurationSource; - namespace NServiceBus.Integration.Azure { + using System; + using System.Configuration; + using System.Linq; + using System.Web.Configuration; + using System.Web.Hosting; + using Config.ConfigurationSource; + public class AzureConfigurationSource : IConfigurationSource { private readonly IAzureConfigurationSettings azureConfigurationSettings; @@ -44,7 +44,7 @@ T IConfigurationSource.GetConfiguration() private static Configuration GetConfigurationHandler() { - if (IsWebsite()) return WebConfigurationManager.OpenWebConfiguration("/"); + if (IsWebsite()) return WebConfigurationManager.OpenWebConfiguration(HostingEnvironment.ApplicationVirtualPath); return ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None); } diff --git a/src/azure/Integration/NServiceBus.Integration.Azure/IAzureConfigurationSettings.cs b/src/azure/NServiceBus.Azure/ConfigurationSource/Azure/IAzureConfigurationSettings.cs similarity index 100% rename from src/azure/Integration/NServiceBus.Integration.Azure/IAzureConfigurationSettings.cs rename to src/azure/NServiceBus.Azure/ConfigurationSource/Azure/IAzureConfigurationSettings.cs diff --git a/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/Config/ConfigureAzureBlobStorageDataBus.cs b/src/azure/NServiceBus.Azure/ConfigureAzureBlobStorageDataBus.cs similarity index 88% rename from src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/Config/ConfigureAzureBlobStorageDataBus.cs rename to src/azure/NServiceBus.Azure/ConfigureAzureBlobStorageDataBus.cs index 2a9e0bf4f24..0a8291bd688 100644 --- a/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/Config/ConfigureAzureBlobStorageDataBus.cs +++ b/src/azure/NServiceBus.Azure/ConfigureAzureBlobStorageDataBus.cs @@ -1,12 +1,12 @@ -using Microsoft.WindowsAzure; -using Microsoft.WindowsAzure.StorageClient; -using NServiceBus.DataBus; -using NServiceBus.DataBus.Azure.BlobStorage; -using NServiceBus.Config; - namespace NServiceBus { - /// + using Config; + using DataBus; + using DataBus.Azure.BlobStorage; + using Microsoft.WindowsAzure.Storage.Blob; + using CloudStorageAccount = Microsoft.WindowsAzure.Storage.CloudStorageAccount; + + /// /// Contains extension methods to NServiceBus.Configure for the azure blob storage data bus /// public static class ConfigureAzureBlobStorageDataBus diff --git a/src/azure/Integration/NServiceBus.Integration.Azure/Config/ConfigureAzureIntegration.cs b/src/azure/NServiceBus.Azure/ConfigureAzureIntegration.cs similarity index 95% rename from src/azure/Integration/NServiceBus.Integration.Azure/Config/ConfigureAzureIntegration.cs rename to src/azure/NServiceBus.Azure/ConfigureAzureIntegration.cs index d7b7fcc9cd7..333a1f89f25 100644 --- a/src/azure/Integration/NServiceBus.Integration.Azure/Config/ConfigureAzureIntegration.cs +++ b/src/azure/NServiceBus.Azure/ConfigureAzureIntegration.cs @@ -1,6 +1,6 @@ using NServiceBus.Integration.Azure; -namespace NServiceBus.Config +namespace NServiceBus { public static class ConfigureAzureIntegration { diff --git a/src/azure/NServiceBus.Azure/ConfigureAzureSagaPersister.cs b/src/azure/NServiceBus.Azure/ConfigureAzureSagaPersister.cs new file mode 100644 index 00000000000..6375a157fd5 --- /dev/null +++ b/src/azure/NServiceBus.Azure/ConfigureAzureSagaPersister.cs @@ -0,0 +1,57 @@ +using System; +using NServiceBus.Config; + +namespace NServiceBus +{ + using Microsoft.WindowsAzure.Storage; + using SagaPersisters.Azure; + + /// + /// Contains extension methods to NServiceBus.Configure for the NHibernate saga persister on top of Azure table storage. + /// + public static class ConfigureAzureSagaPersister + { + /// + /// Use the NHibernate backed saga persister implementation. + /// Be aware that this implementation deletes sagas that complete so as not to have the database fill up. + /// SagaData classes are automatically mapped using Fluent NHibernate Conventions. + /// + /// + /// + public static Configure AzureSagaPersister(this Configure config) + { + string connectionstring = string.Empty; + bool updateSchema = false; + + var configSection = Configure.GetConfigSection(); + + if (configSection != null) + { + connectionstring = configSection.ConnectionString; + updateSchema = configSection.CreateSchema; + } + + return AzureSagaPersister(config, connectionstring, updateSchema); + } + + /// + /// Use the NHibernate backed saga persister implementation on top of Azure table storage. + /// SagaData classes are automatically mapped using Fluent NHibernate conventions + /// and there persistence schema is automatically generated if requested. + /// + /// + /// + /// + /// + public static Configure AzureSagaPersister(this Configure config, + string connectionString, + bool autoUpdateSchema) + { + var account = CloudStorageAccount.Parse(connectionString); + + config.Configurer.ConfigureComponent(() => new AzureSagaPersister(account, autoUpdateSchema), DependencyLifecycle.InstancePerCall); + + return config; + } + } +} diff --git a/src/azure/NServiceBus.Azure/ConfigureAzureSubscriptionStorage.cs b/src/azure/NServiceBus.Azure/ConfigureAzureSubscriptionStorage.cs new file mode 100644 index 00000000000..87d1d84ab4f --- /dev/null +++ b/src/azure/NServiceBus.Azure/ConfigureAzureSubscriptionStorage.cs @@ -0,0 +1,80 @@ +namespace NServiceBus +{ + using Config; + using Microsoft.WindowsAzure.Storage; + using Unicast.Subscriptions; + + /// + /// Configuration extensions for the subscription storage + /// + public static class ConfigureAzureSubscriptionStorage + { + /// + /// Configures NHibernate Azure Subscription Storage , Settings etc are read from custom config section + /// + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "AzureSubscriptionStorage")] + public static Configure AzureSubcriptionStorage(this Configure config) + { + return AzureSubscriptionStorage(config); + } + + /// + /// Configures NHibernate Azure Subscription Storage , Settings etc are read from custom config section + /// + /// + /// + public static Configure AzureSubscriptionStorage(this Configure config) + { + var configSection = Configure.GetConfigSection(); + if (configSection == null) { return config; } + + return config.AzureSubcriptionStorage(configSection.ConnectionString, configSection.CreateSchema, configSection.TableName); + } + + /// + /// Configures the storage with the user supplied persistence configuration + /// Azure tables are created if requested by the user + /// + /// + /// + /// + /// + /// + [ObsoleteEx(RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0", Replacement = "AzureSubscriptionStorage")] + public static Configure AzureSubcriptionStorage(this Configure config, + string connectionString, + bool createSchema, + string tableName) + { + return config.AzureSubscriptionStorage(connectionString, createSchema, tableName); + } + + /// + /// Configures the storage with the user supplied persistence configuration + /// Azure tables are created if requested by the user + /// + /// + /// + /// + /// + /// + public static Configure AzureSubscriptionStorage(this Configure config, + string connectionString, + bool createSchema, + string tableName) + { + SubscriptionServiceContext.SubscriptionTableName = tableName; + SubscriptionServiceContext.CreateIfNotExist = createSchema; + + var account = CloudStorageAccount.Parse(connectionString); + SubscriptionServiceContext.Init(account.CreateCloudTableClient()); + + config.Configurer.ConfigureComponent(() => new AzureSubscriptionStorage(account), DependencyLifecycle.InstancePerCall); + + return config; + + } + } +} diff --git a/src/azure/NServiceBus.Azure/DataBus/Azure/BlobStorage/BlobStorageDataBus.cs b/src/azure/NServiceBus.Azure/DataBus/Azure/BlobStorage/BlobStorageDataBus.cs new file mode 100644 index 00000000000..e7f7c2625ba --- /dev/null +++ b/src/azure/NServiceBus.Azure/DataBus/Azure/BlobStorage/BlobStorageDataBus.cs @@ -0,0 +1,120 @@ +using NServiceBus.Logging; + +namespace NServiceBus.DataBus.Azure.BlobStorage +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.IO; + using System.Linq; + using System.Net; + using System.Threading; + using Microsoft.WindowsAzure.Storage; + using Microsoft.WindowsAzure.Storage.Blob; + using Microsoft.WindowsAzure.Storage.Blob.Protocol; + + public class BlobStorageDataBus : IDataBus + { + private readonly ILog logger = LogManager.GetLogger(typeof(IDataBus)); + private readonly CloudBlobContainer container; + private readonly Timer timer; + + public int MaxRetries { get; set; } + public int NumberOfIOThreads { get; set; } + public string BasePath { get; set; } + public int BlockSize { get; set; } + + public BlobStorageDataBus(CloudBlobContainer container) + { + this.container = container; + timer = new Timer(o => DeleteExpiredBlobs()); + } + + public Stream Get(string key) + { + var stream = new MemoryStream(); + var blob = container.GetBlockBlobReference(Path.Combine(BasePath, key)); + DownloadBlobInParallel(blob, stream); + return stream; + } + + + + public string Put(Stream stream, TimeSpan timeToBeReceived) + { + var key = Guid.NewGuid().ToString(); + var blob = container.GetBlockBlobReference(Path.Combine(BasePath, key)); + blob.Metadata["ValidUntil"] = (DateTime.Now + timeToBeReceived).ToString(); + UploadBlobInParallel(blob, stream); + return key; + } + + public void Start() + { + ServicePointManager.DefaultConnectionLimit = NumberOfIOThreads; + container.CreateIfNotExists(); + timer.Change(0, 300000); + logger.Info("Blob storage data bus started. Location: " + BasePath); + } + + public void Dispose() + { + timer.Dispose(); + + DeleteExpiredBlobs(); + + logger.Info("Blob storage data bus stopped"); + } + + private void DeleteExpiredBlobs() + { + try + { + var blobs = container.ListBlobs(); + foreach (var blockBlob in blobs.Select(blob => blob as CloudBlockBlob)) + { + if (blockBlob == null) continue; + + blockBlob.FetchAttributes(); + DateTime validUntil; + DateTime.TryParse(blockBlob.Metadata["ValidUntil"], out validUntil); + if (validUntil == default(DateTime) || validUntil < DateTime.Now) + blockBlob.DeleteIfExists(); + } + } + catch (StorageException ex) + { + logger.Warn(ex.Message); + } + } + + private void UploadBlobInParallel(CloudBlockBlob blob, Stream stream) + { + try + { + blob.ServiceClient.ParallelOperationThreadCount = NumberOfIOThreads; + blob.UploadFromStream(stream); + } + catch (StorageException ex) + { + logger.Warn(ex.Message); + } + } + + private void DownloadBlobInParallel(CloudBlockBlob blob, Stream stream) + { + try + { + blob.FetchAttributes(); + blob.ServiceClient.ParallelOperationThreadCount = NumberOfIOThreads; + blob.DownloadToStream(stream); + stream.Seek(0, SeekOrigin.Begin); + } + catch (StorageException ex) + { + logger.Warn(ex.Message); + } + } + + } +} diff --git a/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/Block.cs b/src/azure/NServiceBus.Azure/DataBus/Azure/BlobStorage/Block.cs similarity index 94% rename from src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/Block.cs rename to src/azure/NServiceBus.Azure/DataBus/Azure/BlobStorage/Block.cs index 19fe6f43fb7..ca5688d25d7 100644 --- a/src/azure/DataBus/NServiceBus.DataBus.Azure.BlobStorage/Block.cs +++ b/src/azure/NServiceBus.Azure/DataBus/Azure/BlobStorage/Block.cs @@ -1,7 +1,7 @@ -using System; - namespace NServiceBus.DataBus.Azure.BlobStorage { + using System; + public class Block { public int Offset { get; set; } diff --git a/src/azure/NServiceBus.Azure/Fody.targets b/src/azure/NServiceBus.Azure/Fody.targets new file mode 100644 index 00000000000..a668a51fc04 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Fody.targets @@ -0,0 +1,89 @@ + + + + + + $(NCrunchOriginalSolutionDir) + + + + + $(SolutionDir) + + + + + $(MSBuildProjectDirectory)\..\ + + + + + + + $(KeyOriginatorFile) + + + + + $(AssemblyOriginatorKeyFile) + + + + + + + + + + $(ProjectDir)$(IntermediateOutputPath) + Low + $(SignAssembly) + $(MSBuildThisFileDirectory) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/FodyWeavers.xml b/src/azure/NServiceBus.Azure/FodyWeavers.xml new file mode 100644 index 00000000000..7b0ab397e86 --- /dev/null +++ b/src/azure/NServiceBus.Azure/FodyWeavers.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Logging/Azure/AzureDiagnosticsLogger.cs b/src/azure/NServiceBus.Azure/Logging/Azure/AzureDiagnosticsLogger.cs new file mode 100644 index 00000000000..e161b4053c4 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Logging/Azure/AzureDiagnosticsLogger.cs @@ -0,0 +1,176 @@ +using System; +using System.Diagnostics; +using Microsoft.WindowsAzure.Diagnostics; +using NServiceBus.Logging; + +namespace NServiceBus.Integration.Azure +{ + /// + /// + /// + public class AzureDiagnosticsLogger : ILog + { + /// + /// + /// + public bool IsDebugEnabled + { + get { return true; } + } + + /// + /// + /// + public bool IsInfoEnabled + { + get { return true; } + } + + public bool IsWarnEnabled + { + get { return true; } + } + + public bool IsErrorEnabled + { + get { return true; } + } + + public bool IsFatalEnabled + { + get { return true; } + } + + public LogLevel Level { get; set; } + + public void Debug(string message) + { + Info(message); + } + + public void Debug(string message, Exception exception) + { + Info(message, exception); + } + + public void DebugFormat(string format, params object[] args) + { + InfoFormat(format, args); + } + + public void Info(string message) + { + if (TracingInfo) + { + Trace.TraceInformation(message); + } + } + + public void Info(string message, Exception exception) + { + if (TracingInfo) + { + Trace.TraceInformation(message); + Trace.TraceInformation(exception.ToString()); + } + } + + public void InfoFormat(string format, params object[] args) + { + if (TracingInfo) + { + Trace.TraceInformation(format, args); + } + } + + public void Warn(string message) + { + if (TracingWarnings) + { + Trace.TraceWarning(message); + } + } + + public void Warn(string message, Exception exception) + { + if (TracingWarnings) + { + Trace.TraceWarning(message); + Trace.TraceWarning(exception.ToString()); + } + } + + public void WarnFormat(string format, params object[] args) + { + if (TracingWarnings) + { + Trace.TraceWarning(format, args); + } + } + + public void Error(string message) + { + if (TracingErrors) + { + Trace.TraceError(message); + } + } + + public void Error(string message, Exception exception) + { + if (TracingErrors) + { + Trace.TraceError(message); + Trace.TraceError(exception.ToString()); + } + } + + public void ErrorFormat(string format, params object[] args) + { + if (TracingErrors) + { + Trace.TraceError(format, args); + } + } + + public void Fatal(string message) + { + if (TracingErrors) + { + Trace.TraceError(message); + } + } + + public void Fatal(string message, Exception exception) + { + if (TracingErrors) + { + Trace.TraceError(message); + Trace.TraceError(exception.ToString()); + } + } + + public void FatalFormat(string format, params object[] args) + { + if (TracingErrors) + { + Trace.TraceError(format, args); + } + } + + private bool TracingErrors + { + get { return Level == LogLevel.Critical || Level == LogLevel.Error ||Level == LogLevel.Warning || Level == LogLevel.Undefined || Level == LogLevel.Verbose ||Level == LogLevel.Information; } + } + + private bool TracingWarnings + { + get { return Level == LogLevel.Warning || Level == LogLevel.Undefined || Level == LogLevel.Verbose || Level == LogLevel.Information; } + } + + private bool TracingInfo + { + get { return Level == LogLevel.Undefined || Level == LogLevel.Verbose || Level == LogLevel.Information; } + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Logging/Azure/AzureDiagnosticsLoggerFactory.cs b/src/azure/NServiceBus.Azure/Logging/Azure/AzureDiagnosticsLoggerFactory.cs new file mode 100644 index 00000000000..96dbbf22c96 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Logging/Azure/AzureDiagnosticsLoggerFactory.cs @@ -0,0 +1,167 @@ +using System; +using System.Diagnostics; +using System.Linq; +using Microsoft.WindowsAzure; +using Microsoft.WindowsAzure.Diagnostics; +using Microsoft.WindowsAzure.Diagnostics.Management; +using Microsoft.WindowsAzure.ServiceRuntime; +using NServiceBus.Logging; + +namespace NServiceBus.Integration.Azure +{ + using System.Security; + using Microsoft.WindowsAzure.Storage; + + /// + /// + /// + public class AzureDiagnosticsLoggerFactory : ILoggerFactory + { + private const string ConnectionStringKey = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString"; + private const string LevelKey = "Microsoft.WindowsAzure.Plugins.Diagnostics.Level"; + private const string ScheduledTransferPeriodKey = "Microsoft.WindowsAzure.Plugins.Diagnostics.ScheduledTransferPeriod"; + private const string EventLogsKey = "Microsoft.WindowsAzure.Plugins.Diagnostics.EventLogs"; + + public int ScheduledTransferPeriod { get; set; } + + public string Level { get; set; } + + public bool InitializeDiagnostics { get; set; } + + public bool Enable { get; set; } + + public ILog GetLogger(Type type) + { + var logger = new AzureDiagnosticsLogger(); + logger.Level = GetLevel(); + return logger; + } + + public ILog GetLogger(string name) + { + var logger = new AzureDiagnosticsLogger(); + logger.Level = GetLevel(); + return logger; + } + + public void ConfigureAzureDiagnostics() + { + if (Enable) + { + var exists = Trace.Listeners.Cast().Count(tracelistener => tracelistener.GetType().IsAssignableFrom(typeof(DiagnosticMonitorTraceListener))) > 0; + if (!exists) + { + try + { + var listener = new DiagnosticMonitorTraceListener(); + Trace.Listeners.Add(listener); + } + catch (SecurityException) + { + return; + } + + } + } + else + { + var exists = Trace.Listeners.Cast().Count(tracelistener => tracelistener.GetType().IsAssignableFrom(typeof(ConsoleTraceListener))) > 0; + if (!exists) Trace.Listeners.Add(new ConsoleTraceListener()); + } + + if (!RoleEnvironment.IsAvailable || !InitializeDiagnostics) return; + + var roleInstanceDiagnosticManager = CloudAccountDiagnosticMonitorExtensions.CreateRoleInstanceDiagnosticManager( + GetConnectionString(), + RoleEnvironment.DeploymentId, + RoleEnvironment.CurrentRoleInstance.Role.Name, + RoleEnvironment.CurrentRoleInstance.Id); + + var configuration = roleInstanceDiagnosticManager.GetCurrentConfiguration(); + + if (configuration == null) + { + configuration = DiagnosticMonitor.GetDefaultInitialConfiguration(); + + ConfigureDiagnostics(configuration); + + DiagnosticMonitor.Start(ConnectionStringKey, configuration); + } + + } + + private void ConfigureDiagnostics(DiagnosticMonitorConfiguration configuration) + { + configuration.Logs.ScheduledTransferLogLevelFilter = GetLevel(); + + ScheduleTransfer(configuration); + + ConfigureWindowsEventLogsToBeTransferred(configuration); + } + + private void ScheduleTransfer(DiagnosticMonitorConfiguration dmc) + { + ScheduledTransferPeriod = GetScheduledTransferPeriod(); + var transferPeriod = TimeSpan.FromMinutes(ScheduledTransferPeriod); + dmc.Logs.ScheduledTransferPeriod = transferPeriod; + dmc.WindowsEventLog.ScheduledTransferPeriod = transferPeriod; + } + + private static void ConfigureWindowsEventLogsToBeTransferred(DiagnosticMonitorConfiguration dmc) + { + var eventLogs = GetEventLogs().Split(';'); + foreach (var log in eventLogs) + { + dmc.WindowsEventLog.DataSources.Add(log); + } + } + + private static string GetConnectionString() + { + try + { + return RoleEnvironment.GetConfigurationSettingValue(ConnectionStringKey); + } + catch (Exception) + { + return "UseDevelopmentStorage=true"; + } + } + + private static LogLevel GetLevel() + { + try + { + return (LogLevel)Enum.Parse(typeof(LogLevel), RoleEnvironment.GetConfigurationSettingValue(LevelKey)); + } + catch (Exception) + { + return LogLevel.Information; + } + } + + private static int GetScheduledTransferPeriod() + { + try + { + return int.Parse(RoleEnvironment.GetConfigurationSettingValue(ScheduledTransferPeriodKey)); + } + catch (Exception) + { + return 10; + } + } + + private static string GetEventLogs() + { + try + { + return RoleEnvironment.GetConfigurationSettingValue(EventLogsKey); + } + catch (Exception) + { + return "Application!*;System!*"; + } + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Logging/Azure/SetLoggingLibrary.cs b/src/azure/NServiceBus.Azure/Logging/Azure/SetLoggingLibrary.cs new file mode 100644 index 00000000000..01d47bb6b63 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Logging/Azure/SetLoggingLibrary.cs @@ -0,0 +1,24 @@ +using NServiceBus.Logging; +using NServiceBus.Logging.Loggers; + +namespace NServiceBus +{ + using Integration.Azure; + + public static class SetLoggingLibraryForAzure + { + public static Configure ConsoleLogger(this Configure config) + { + LogManager.LoggerFactory = new ConsoleLoggerFactory(); + return config; + } + + public static Configure AzureDiagnosticsLogger(this Configure config, bool enable = true, bool initialize = true) + { + var factory = new AzureDiagnosticsLoggerFactory {Enable = enable, InitializeDiagnostics = initialize}; + factory.ConfigureAzureDiagnostics(); + LogManager.LoggerFactory = factory; + return config; + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/NServiceBus.Azure.csproj b/src/azure/NServiceBus.Azure/NServiceBus.Azure.csproj new file mode 100644 index 00000000000..b7e306c6988 --- /dev/null +++ b/src/azure/NServiceBus.Azure/NServiceBus.Azure.csproj @@ -0,0 +1,192 @@ + + + + + Debug + AnyCPU + {12F1D9F1-0A2C-4442-8D18-67DD096C6300} + Library + Properties + NServiceBus + NServiceBus.Azure + v4.0 + 512 + ..\..\..\ + true + true + ..\..\NServiceBus.snk + ..\..\..\packages\Fody.1.13.8.0 + + + true + full + false + ..\..\..\binaries\ + DEBUG;TRACE + prompt + 4 + ..\..\..\binaries\NServiceBus.Azure.XML + + + pdbonly + true + ..\..\..\binaries\ + TRACE + prompt + 4 + ..\..\..\binaries\NServiceBus.Azure.XML + + + + ..\..\..\packages\Iesi.Collections.3.3.3.4000\lib\Net35\Iesi.Collections.dll + + + False + ..\..\..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\..\..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + False + ..\..\..\packages\WindowsAzure.ServiceBus.2.1.0.0\lib\net40-full\Microsoft.ServiceBus.dll + + + ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.1.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + False + ..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + + + False + ..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + + + ..\..\..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + ..\..\..\packages\Obsolete.Fody.1.6.2.0\Lib\NET35\Obsolete.dll + + + + + + + + + False + ..\..\..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {dd48b2d0-e996-412d-9157-821ed8b17a9d} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Properties/AssemblyInfo.cs b/src/azure/NServiceBus.Azure/Properties/AssemblyInfo.cs new file mode 100644 index 00000000000..034b3b6f35d --- /dev/null +++ b/src/azure/NServiceBus.Azure/Properties/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using System.Security; +using System.Runtime.CompilerServices; + +[assembly: AssemblyTitle("NServiceBus.Azure")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyVersion("4.0.0.0")] +[assembly: AssemblyFileVersion("4.0.0.0")] +[assembly: AssemblyCopyright("Copyright (C) NServiceBus 2010-2012")] +[assembly: AssemblyProduct("NServiceBus.Azure")] +[assembly: AssemblyCompany("NServiceBus")] +[assembly: AssemblyConfiguration("release")] +[assembly: AssemblyInformationalVersion("4.0.0-alpha0")] +[assembly: ComVisible(false)] +[assembly: CLSCompliantAttribute(true)] + diff --git a/src/azure/NServiceBus.Azure/SagaPersisters/Azure/AzureSagaPersister.cs b/src/azure/NServiceBus.Azure/SagaPersisters/Azure/AzureSagaPersister.cs new file mode 100644 index 00000000000..b8ec9ecaa78 --- /dev/null +++ b/src/azure/NServiceBus.Azure/SagaPersisters/Azure/AzureSagaPersister.cs @@ -0,0 +1,312 @@ +namespace NServiceBus.SagaPersisters.Azure +{ + using System; + using System.Collections.Concurrent; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Reflection; + using Microsoft.WindowsAzure.Storage; + using Microsoft.WindowsAzure.Storage.Table; + using Saga; + + /// + /// Saga persister implementation using NHibernate. + /// + public class AzureSagaPersister : ISagaPersister + { + readonly bool autoUpdateSchema; + readonly CloudTableClient client; + readonly ConcurrentDictionary tableCreated = new ConcurrentDictionary(); + + /// + /// + /// + /// + /// + public AzureSagaPersister(CloudStorageAccount account, bool autoUpdateSchema) + { + this.autoUpdateSchema = autoUpdateSchema; + client = account.CreateCloudTableClient(); + } + + /// + /// Saves the given saga entity using the current session of the + /// injected session factory. + /// + /// the saga entity that will be saved. + public void Save(IContainSagaData saga) + { + Persist(saga); + } + + /// + /// Updates the given saga entity using the current session of the + /// injected session factory. + /// + /// the saga entity that will be updated. + public void Update(IContainSagaData saga) + { + Persist(saga); + } + + /// + /// Gets a saga entity from the injected session factory's current session + /// using the given saga id. + /// + /// The saga id to use in the lookup. + /// The saga entity if found, otherwise null. + public T Get(Guid sagaId) where T : IContainSagaData + { + var tableName = typeof(T).Name; + var table = client.GetTableReference(tableName); + + var query = new TableQuery().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, sagaId.ToString())); + + return ToEntity(table.ExecuteQuery(query).FirstOrDefault()); + } + + + T ISagaPersister.Get(string property, object value) + { + var type = typeof (T); + var tableName = type.Name; + var table = client.GetTableReference(tableName); + + TableQuery query; + + var propertyInfo = type.GetProperty(property); + + if (propertyInfo.PropertyType == typeof(byte[])) + { + query = new TableQuery().Where(TableQuery.GenerateFilterConditionForBinary(property, QueryComparisons.Equal, (byte[])value)); + } + else if (propertyInfo.PropertyType == typeof(bool)) + { + query = new TableQuery().Where(TableQuery.GenerateFilterConditionForBool(property, QueryComparisons.Equal, (bool) value)); + } + else if (propertyInfo.PropertyType == typeof(DateTime)) + { + query = new TableQuery().Where(TableQuery.GenerateFilterConditionForDate(property, QueryComparisons.Equal, (DateTime)value)); + } + else if (propertyInfo.PropertyType == typeof(Guid)) + { + query = new TableQuery().Where(TableQuery.GenerateFilterConditionForGuid(property, QueryComparisons.Equal, (Guid)value)); + } + else if (propertyInfo.PropertyType == typeof(Int32)) + { + query = new TableQuery().Where(TableQuery.GenerateFilterConditionForInt(property, QueryComparisons.Equal, (int)value)); + } + else if (propertyInfo.PropertyType == typeof(Int64)) + { + query = new TableQuery().Where(TableQuery.GenerateFilterConditionForLong(property, QueryComparisons.Equal, (long)value)); + } + else if (propertyInfo.PropertyType == typeof(Double)) + { + query = new TableQuery().Where(TableQuery.GenerateFilterConditionForDouble(property, QueryComparisons.Equal, (double)value)); + } + else if (propertyInfo.PropertyType == typeof(string)) + { + query = new TableQuery().Where(TableQuery.GenerateFilterCondition(property, QueryComparisons.Equal, (string)value)); + } + else + { + throw new NotSupportedException( + string.Format("The property type '{0}' is not supported in windows azure table storage", + propertyInfo.PropertyType.Name)); + } + + try + { + return ToEntity(table.ExecuteQuery(query).FirstOrDefault()); + } + catch (WebException ex) + { + // occurs when table has not yet been created, but already looking for absence of instance + if (ex.Status == WebExceptionStatus.ProtocolError && ex.Response != null) + { + var response = (HttpWebResponse) ex.Response; + if (response.StatusCode == HttpStatusCode.NotFound) + { + return default(T); + } + } + + throw; + } + + } + + /// + /// Deletes the given saga from the injected session factory's + /// current session. + /// + /// The saga entity that will be deleted. + public void Complete(IContainSagaData saga) + { + try + { + var tableName = saga.GetType().Name; + var table = client.GetTableReference(tableName); + + var query = new TableQuery().Where(TableQuery.GenerateFilterCondition("PartitionKey", QueryComparisons.Equal, saga.Id.ToString())); + + var entity = table.ExecuteQuery(query).FirstOrDefault(); + + table.Execute(TableOperation.Delete(entity)); + } + catch (StorageException) + { + throw; + } + + } + + void Persist(IContainSagaData saga) + { + var tableName = saga.GetType().Name; + var table = client.GetTableReference(tableName); + if (autoUpdateSchema && !tableCreated.ContainsKey(tableName)) + { + table.CreateIfNotExists(); + tableCreated[tableName] = true; + } + + var partitionKey = saga.Id.ToString(); + + var batch = new TableBatchOperation(); + + AddObjectToBatch(batch, saga, partitionKey); + + table.ExecuteBatch(batch); + } + + static void AddObjectToBatch(TableBatchOperation batch, object entity, string partitionKey, string rowkey = "") + { + if (rowkey == "") rowkey = partitionKey; // just to be backward compat with original implementation + + var type = entity.GetType(); + + var properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance); + + var toPersist = ToDictionaryTableEntity(entity, partitionKey, rowkey, properties); + + batch.Add(TableOperation.InsertOrReplace(toPersist)); + } + + static DictionaryTableEntity ToDictionaryTableEntity(object entity, string partitionKey, string rowkey, IEnumerable properties) + { + var toPersist = new DictionaryTableEntity + { + PartitionKey = partitionKey, + RowKey = rowkey + }; + + foreach (var propertyInfo in properties) + { + if (propertyInfo.PropertyType == typeof (byte[])) + { + toPersist.Add(propertyInfo.Name, (byte[]) propertyInfo.GetValue(entity, null)); + } + else if (propertyInfo.PropertyType == typeof (bool)) + { + toPersist.Add(propertyInfo.Name, (bool) propertyInfo.GetValue(entity, null)); + } + else if (propertyInfo.PropertyType == typeof (DateTime)) + { + toPersist.Add(propertyInfo.Name, (DateTime) propertyInfo.GetValue(entity, null)); + } + else if (propertyInfo.PropertyType == typeof (Guid)) + { + toPersist.Add(propertyInfo.Name, (Guid) propertyInfo.GetValue(entity, null)); + } + else if (propertyInfo.PropertyType == typeof (Int32)) + { + toPersist.Add(propertyInfo.Name, (Int32) propertyInfo.GetValue(entity, null)); + } + else if (propertyInfo.PropertyType == typeof (Int64)) + { + toPersist.Add(propertyInfo.Name, (Int64) propertyInfo.GetValue(entity, null)); + } + else if (propertyInfo.PropertyType == typeof(Double)) + { + toPersist.Add(propertyInfo.Name, (Double)propertyInfo.GetValue(entity, null)); + } + else if (propertyInfo.PropertyType == typeof (string)) + { + toPersist.Add(propertyInfo.Name, (string) propertyInfo.GetValue(entity, null)); + } + else + { + throw new NotSupportedException( + string.Format("The property type '{0}' is not supported in windows azure table storage", + propertyInfo.PropertyType.Name)); + } + } + return toPersist; + } + + T ToEntity(DictionaryTableEntity entity) + { + if (entity == null) return default(T); + + var toCreate = Activator.CreateInstance(); + var entityType = typeof (T); + + foreach(var propertyInfo in entityType.GetProperties()) + { + if (entity.ContainsKey(propertyInfo.Name)) + { + if (propertyInfo.PropertyType == typeof(byte[])) + { + propertyInfo.SetValue(toCreate, entity[propertyInfo.Name].BinaryValue, null); + } + else if (propertyInfo.PropertyType == typeof(bool)) + { + var boolean = entity[propertyInfo.Name].BooleanValue; + propertyInfo.SetValue(toCreate, boolean.HasValue && boolean.Value, null); + } + else if (propertyInfo.PropertyType == typeof(DateTime)) + { + var dateTimeOffset = entity[propertyInfo.Name].DateTimeOffsetValue; + propertyInfo.SetValue(toCreate, dateTimeOffset.HasValue ? dateTimeOffset.Value.DateTime : default(DateTime), null); + } + else if (propertyInfo.PropertyType == typeof(Guid)) + { + var guid = entity[propertyInfo.Name].GuidValue; + propertyInfo.SetValue(toCreate, guid.HasValue ? guid.Value : default(Guid), null); + } + else if (propertyInfo.PropertyType == typeof(Int32)) + { + var int32 = entity[propertyInfo.Name].Int32Value; + propertyInfo.SetValue(toCreate, int32.HasValue ? int32.Value : default(Int32), null); + } + else if (propertyInfo.PropertyType == typeof(Double)) + { + var d = entity[propertyInfo.Name].DoubleValue; + propertyInfo.SetValue(toCreate, d.HasValue ? d.Value : default(Int64), null); + } + else if (propertyInfo.PropertyType == typeof(Int64)) + { + var int64 = entity[propertyInfo.Name].Int64Value; + propertyInfo.SetValue(toCreate, int64.HasValue ? int64.Value : default(Int64), null); + } + else if (propertyInfo.PropertyType == typeof(string)) + { + propertyInfo.SetValue(toCreate, entity[propertyInfo.Name].StringValue, null); + } + else + { + throw new NotSupportedException( + string.Format("The property type '{0}' is not supported in windows azure table storage", + propertyInfo.PropertyType.Name)); + } + + + } + } + + return toCreate; + } + } +} diff --git a/src/azure/NServiceBus.Azure/SagaPersisters/Azure/DictionaryTableEntity.cs b/src/azure/NServiceBus.Azure/SagaPersisters/Azure/DictionaryTableEntity.cs new file mode 100644 index 00000000000..bdce95d5f37 --- /dev/null +++ b/src/azure/NServiceBus.Azure/SagaPersisters/Azure/DictionaryTableEntity.cs @@ -0,0 +1,205 @@ +namespace NServiceBus.SagaPersisters.Azure +{ + using System; + using System.Collections; + using System.Collections.Generic; + using Microsoft.WindowsAzure.Storage; + using Microsoft.WindowsAzure.Storage.Table; + + /// + /// + /// + public class DictionaryTableEntity : TableEntity, IDictionary + { + private IDictionary properties; + + /// + /// + /// + public DictionaryTableEntity() + { + properties = new Dictionary(); + } + + public override void ReadEntity(IDictionary entityProperties, OperationContext operationContext) + { + properties = entityProperties; + } + + public override IDictionary WriteEntity(OperationContext operationContext) + { + return properties; + } + + public void Add(string key, EntityProperty value) + { + properties.Add(key, value); + } + + /// + /// + /// + /// + /// + public void Add(string key, bool value) + { + properties.Add(key, new EntityProperty(value)); + } + + /// + /// + /// + /// + /// + public void Add(string key, byte[] value) + { + properties.Add(key, new EntityProperty(value)); + } + + /// + /// + /// + /// + /// + public void Add(string key, DateTime? value) + { + properties.Add(key, new EntityProperty(value)); + } + + /// + /// + /// + /// + /// + public void Add(string key, DateTimeOffset? value) + { + properties.Add(key, new EntityProperty(value)); + } + + /// + /// + /// + /// + /// + public void Add(string key, double value) + { + properties.Add(key, new EntityProperty(value)); + } + + /// + /// + /// + /// + /// + public void Add(string key, Guid value) + { + properties.Add(key, new EntityProperty(value)); + } + + /// + /// + /// + /// + /// + public void Add(string key, int value) + { + properties.Add(key, new EntityProperty(value)); + } + + /// + /// + /// + /// + /// + public void Add(string key, long value) + { + properties.Add(key, new EntityProperty(value)); + } + + /// + /// + /// + /// + /// + public void Add(string key, string value) + { + properties.Add(key, new EntityProperty(value)); + } + + public bool ContainsKey(string key) + { + return properties.ContainsKey(key); + } + + public ICollection Keys + { + get { return properties.Keys; } + } + + public bool Remove(string key) + { + return properties.Remove(key); + } + + public bool TryGetValue(string key, out EntityProperty value) + { + return properties.TryGetValue(key, out value); + } + + public ICollection Values + { + get { return properties.Values; } + } + + public EntityProperty this[string key] + { + get { return properties[key]; } + set { properties[key] = value; } + } + + public void Add(KeyValuePair item) + { + properties.Add(item); + } + + public void Clear() + { + properties.Clear(); + } + + public bool Contains(KeyValuePair item) + { + return properties.Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int arrayIndex) + { + properties.CopyTo(array, arrayIndex); + } + + public int Count + { + get { return properties.Count; } + } + + public bool IsReadOnly + { + get { return properties.IsReadOnly; } + } + + public bool Remove(KeyValuePair item) + { + return properties.Remove(item); + } + + public IEnumerator> GetEnumerator() + { + return properties.GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return properties.GetEnumerator(); + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Subscriptions/Azure/AzureSubscriptionStorage.cs b/src/azure/NServiceBus.Azure/Subscriptions/Azure/AzureSubscriptionStorage.cs new file mode 100644 index 00000000000..50b38ea25a1 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Subscriptions/Azure/AzureSubscriptionStorage.cs @@ -0,0 +1,114 @@ +using System; + +namespace NServiceBus.Unicast.Subscriptions +{ + using System.Collections.Generic; + using System.Data.Services.Client; + using System.Linq; + using MessageDrivenSubscriptions; + using Microsoft.WindowsAzure.Storage; + using Microsoft.WindowsAzure.Storage.Table; + + /// + /// + /// + public class AzureSubscriptionStorage : ISubscriptionStorage + { + readonly CloudTableClient client; + + /// + /// + /// + /// + public AzureSubscriptionStorage(CloudStorageAccount account) + { + client = account.CreateCloudTableClient(); + } + + void ISubscriptionStorage.Subscribe(Address address, IEnumerable messageTypes) + { + using (var context = new SubscriptionServiceContext(client)) + { + foreach (var messageType in messageTypes) + { + try + { + var subscription = new Subscription + { + RowKey = EncodeTo64(address.ToString()), + PartitionKey = messageType.ToString() + }; + + context.AddObject(SubscriptionServiceContext.SubscriptionTableName, subscription); + context.SaveChangesWithRetries(); + } + catch (StorageException ex) + { + if (ex.RequestInformation.HttpStatusCode != 409) throw; + } + + } + } + } + + void ISubscriptionStorage.Unsubscribe(Address address, IEnumerable messageTypes) + { + using (var context = new SubscriptionServiceContext(client)) + { + var encodedAddress = EncodeTo64(address.ToString()); + foreach (var messageType in messageTypes) + { + var type = messageType; + var query = from s in context.Subscriptions + where s.PartitionKey == type.ToString() && s.RowKey == encodedAddress + select s; + + var subscription = query.FirstOrDefault(); + if(subscription != null) context.DeleteObject(subscription); + context.SaveChangesWithRetries(); + } + } + } + + + + IEnumerable
    ISubscriptionStorage.GetSubscriberAddressesForMessage(IEnumerable messageTypes) + { + var subscribers = new List
    (); + + using (var context = new SubscriptionServiceContext(client)) + { + foreach (var messageType in messageTypes) + { + var type = messageType; + var query = from s in context.Subscriptions + where s.PartitionKey == type.ToString() + select s; + + subscribers.AddRange(query.ToList().Select(s => Address.Parse(DecodeFrom64(s.RowKey)))); + } + } + + return subscribers; + } + + public void Init() + { + //No-op + } + + static string EncodeTo64(string toEncode) + { + var toEncodeAsBytes = System.Text.Encoding.ASCII.GetBytes(toEncode); + var returnValue = System.Convert.ToBase64String(toEncodeAsBytes); + return returnValue; + } + + static string DecodeFrom64(string encodedData) + { + var encodedDataAsBytes = System.Convert.FromBase64String(encodedData); + var returnValue = System.Text.Encoding.ASCII.GetString(encodedDataAsBytes); + return returnValue; + } + } +} diff --git a/src/azure/NServiceBus.Azure/Subscriptions/Azure/Subscription.cs b/src/azure/NServiceBus.Azure/Subscriptions/Azure/Subscription.cs new file mode 100644 index 00000000000..e8068201f4a --- /dev/null +++ b/src/azure/NServiceBus.Azure/Subscriptions/Azure/Subscription.cs @@ -0,0 +1,33 @@ +namespace NServiceBus.Unicast.Subscriptions +{ + using Microsoft.WindowsAzure.Storage.Table.DataServices; + + /// + /// Enity containing subscription data + /// + public class Subscription : TableServiceEntity + { + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + if (obj.GetType() != typeof(Subscription)) return false; + return Equals((Subscription)obj); + } + + public virtual bool Equals(Subscription other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + return Equals(other.RowKey, RowKey) && Equals(other.PartitionKey, PartitionKey); + } + + public override int GetHashCode() + { + unchecked + { + return ((RowKey != null ? RowKey.GetHashCode() : 0) * 397) ^ (PartitionKey != null ? PartitionKey.GetHashCode() : 0); + } + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Subscriptions/Azure/SubscriptionServiceContext.cs b/src/azure/NServiceBus.Azure/Subscriptions/Azure/SubscriptionServiceContext.cs new file mode 100644 index 00000000000..d6ba9156c57 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Subscriptions/Azure/SubscriptionServiceContext.cs @@ -0,0 +1,53 @@ +namespace NServiceBus.Unicast.Subscriptions +{ + using System.Linq; + using Microsoft.WindowsAzure.Storage.Table; + using Microsoft.WindowsAzure.Storage.Table.DataServices; + + /// + /// + /// + public class SubscriptionServiceContext : TableServiceContext + { + /// + /// + /// + /// + public SubscriptionServiceContext(CloudTableClient client) + : base(client) + { + } + + /// + /// + /// + public static void Init(CloudTableClient client) + { + var table = client.GetTableReference(SubscriptionTableName); + table.CreateIfNotExists(); + } + + /// + /// + /// + public static string SubscriptionTableName = "Subscription"; + + /// + /// + /// + public static bool CreateIfNotExist = true; + + /// + /// + /// + public IQueryable Subscriptions + { + get + { + return this.CreateQuery(SubscriptionTableName); + } + } + + + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Timeout/Config/ConfigureTimeoutManager.cs b/src/azure/NServiceBus.Azure/Timeout/Config/ConfigureTimeoutManager.cs new file mode 100644 index 00000000000..1fd0dee5bfc --- /dev/null +++ b/src/azure/NServiceBus.Azure/Timeout/Config/ConfigureTimeoutManager.cs @@ -0,0 +1,33 @@ +using NServiceBus.Timeout.Core; +using NServiceBus.Timeout.Hosting.Windows; + +namespace NServiceBus +{ + using Azure; + using Config; + + public static class ConfigureTimeoutManager + { + /// + /// Use the in azure timeout persister implementation. + /// + /// + /// + public static Configure UseAzureTimeoutPersister(this Configure config) + { + var configSection = Configure.GetConfigSection() ?? new AzureTimeoutPersisterConfig(); + + config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + + ServiceContext.TimeoutDataTableName = configSection.TimeoutDataTableName; + ServiceContext.TimeoutManagerDataTableName = configSection.TimeoutManagerDataTableName; + + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(tp => tp.ConnectionString, configSection.ConnectionString) + .ConfigureProperty(tp => tp.CatchUpInterval, configSection.CatchUpInterval) + .ConfigureProperty(tp => tp.PartitionKeyScope, configSection.PartitionKeyScope); + return config; + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/AutoRenewLease.cs b/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/AutoRenewLease.cs new file mode 100644 index 00000000000..861d7961eda --- /dev/null +++ b/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/AutoRenewLease.cs @@ -0,0 +1,69 @@ +using System; +using System.Threading; +using System.Net; + +namespace NServiceBus.Azure +{ + using Microsoft.WindowsAzure.Storage; + using Microsoft.WindowsAzure.Storage.Blob; + + public class AutoRenewLease : IDisposable + { + public bool HasLease { get { return leaseId != null; } } + + private readonly CloudBlockBlob blob; + private readonly string leaseId; + private Thread renewalThread; + private bool disposed; + + public AutoRenewLease(CloudBlockBlob blob) + { + this.blob = blob; + blob.Container.CreateIfNotExists(); + leaseId = blob.TryAcquireLease(); + if (HasLease) + { + renewalThread = new Thread(() => + { + Thread.Sleep(TimeSpan.FromSeconds(40)); + blob.RenewLease(new AccessCondition() + { + LeaseId = leaseId + }); + }); + renewalThread.Start(); + } + } + + public void Dispose() + { + Dispose(true); + GC.SuppressFinalize(this); + } + + protected virtual void Dispose(bool disposing) + { + if (!disposed) + { + if (disposing) + { + if (renewalThread != null) + { + renewalThread.Abort(); + blob.ReleaseLease(new AccessCondition() + { + LeaseId = leaseId + }); + renewalThread = null; + } + } + disposed = true; + } + } + + ~AutoRenewLease() + { + Dispose(false); + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/IDetermineWhoCanSend.cs b/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/IDetermineWhoCanSend.cs new file mode 100644 index 00000000000..1155be865e7 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/IDetermineWhoCanSend.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Azure +{ + using Timeout.Core; + + public interface IDetermineWhoCanSend + { + bool CanSend(TimeoutData data); + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/LeaseExtensions.cs b/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/LeaseExtensions.cs new file mode 100644 index 00000000000..82b34dd7d28 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/LeaseExtensions.cs @@ -0,0 +1,36 @@ +using System; +using System.Net; + +namespace NServiceBus.Azure +{ + using Microsoft.WindowsAzure.Storage; + using Microsoft.WindowsAzure.Storage.Blob; + using Microsoft.WindowsAzure.Storage.Blob.Protocol; + + public static class LeaseBlobExtensions + { + public static string TryAcquireLease(this CloudBlockBlob blob) + { + try { return blob.AcquireLease(TimeSpan.FromSeconds(90), null); } + catch (WebException e) + { + if (((HttpWebResponse)e.Response).StatusCode != HttpStatusCode.Conflict) // 409, already leased + { + throw; + } + e.Response.Close(); + return null; + } + } + + public static bool TryRenewLease(this CloudBlockBlob blob, string leaseId) + { + try { blob.RenewLease(new AccessCondition() + { + LeaseId = leaseId + }); return true; } + catch { return false; } + } + + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/ServiceContext.cs b/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/ServiceContext.cs new file mode 100644 index 00000000000..20881fc2653 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/ServiceContext.cs @@ -0,0 +1,38 @@ +using System.Linq; + + +namespace NServiceBus.Azure +{ + using Microsoft.WindowsAzure.Storage.Auth; + using Microsoft.WindowsAzure.Storage.Table; + using Microsoft.WindowsAzure.Storage.Table.DataServices; + + public class ServiceContext : TableServiceContext + { + public ServiceContext(CloudTableClient client) + : base(client) + { + } + + public static string TimeoutManagerDataTableName = "TimeoutManagerData"; + + public IQueryable TimeoutManagerData + { + get + { + return this.CreateQuery(TimeoutManagerDataTableName); + } + } + + public static string TimeoutDataTableName = "TimeoutData"; + + public IQueryable TimeoutData + { + get + { + return this.CreateQuery(TimeoutDataTableName); + } + } + + } +} \ No newline at end of file diff --git a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/TimeoutDataEntity.cs b/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/TimeoutDataEntity.cs similarity index 94% rename from src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/TimeoutDataEntity.cs rename to src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/TimeoutDataEntity.cs index d819de3443a..edabd52bb92 100644 --- a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/TimeoutDataEntity.cs +++ b/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/TimeoutDataEntity.cs @@ -1,8 +1,9 @@ using System; -using Microsoft.WindowsAzure.StorageClient; -namespace NServiceBus.Timeout.Hosting.Azure +namespace NServiceBus.Azure { + using Microsoft.WindowsAzure.Storage.Table.DataServices; + public class TimeoutDataEntity : TableServiceEntity { public TimeoutDataEntity(){} diff --git a/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/TimeoutPersister.cs b/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/TimeoutPersister.cs new file mode 100644 index 00000000000..2d0f8d5113c --- /dev/null +++ b/src/azure/NServiceBus.Azure/Timeout/TimeoutLogic/TimeoutPersister.cs @@ -0,0 +1,470 @@ +using System.Globalization; +using System.Threading; +using Microsoft.WindowsAzure.ServiceRuntime; + +namespace NServiceBus.Azure +{ + using System; + using System.Collections.Generic; + using System.Data.Services.Client; + using System.IO; + using System.Linq; + using System.Security.Cryptography; + using System.Text; + using System.Web.Script.Serialization; + using Logging; + using Microsoft.WindowsAzure.Storage; + using Microsoft.WindowsAzure.Storage.Blob; + using Support; + using Timeout.Core; + + public class TimeoutPersister : IPersistTimeouts, IDetermineWhoCanSend + { + public List> GetNextChunk(DateTime startSlice, out DateTime nextTimeToRunQuery) + { + List> results = new List>(); + try + { + var now = DateTime.UtcNow; + var context = new ServiceContext(account.CreateCloudTableClient()); + TimeoutManagerDataEntity lastSuccessfullReadEntity; + var lastSuccessfullRead = TryGetLastSuccessfullRead(context, out lastSuccessfullReadEntity) + ? lastSuccessfullReadEntity.LastSuccessfullRead + : default(DateTime?); + + IOrderedEnumerable result; + + if (lastSuccessfullRead.HasValue) + { + result = (from c in context.TimeoutData + where c.PartitionKey.CompareTo(lastSuccessfullRead.Value.ToString(PartitionKeyScope)) >= 0 + && c.PartitionKey.CompareTo(now.ToString(PartitionKeyScope)) <= 0 + && c.OwningTimeoutManager == Configure.EndpointName + select c).ToList().OrderBy(c => c.Time); + } + else + { + result = (from c in context.TimeoutData + where c.OwningTimeoutManager == Configure.EndpointName + select c).ToList().OrderBy(c => c.Time); + } + + var allTimeouts = result.ToList(); + if (allTimeouts.Count == 0) + { + nextTimeToRunQuery = now.AddSeconds(1); + return results; + } + + var pastTimeouts = allTimeouts.Where(c => c.Time > startSlice && c.Time <= now).ToList(); + var futureTimeouts = allTimeouts.Where(c => c.Time > now).ToList(); + + if (lastSuccessfullReadEntity != null && lastSuccessfullRead.HasValue) + { + var catchingUp = lastSuccessfullRead.Value.AddSeconds(CatchUpInterval); + lastSuccessfullRead = catchingUp > now ? now : catchingUp; + lastSuccessfullReadEntity.LastSuccessfullRead = lastSuccessfullRead.Value; + } + + var future = futureTimeouts.FirstOrDefault(); + nextTimeToRunQuery = lastSuccessfullRead.HasValue ? lastSuccessfullRead.Value + : (future != null ? future.Time : now.AddSeconds(1)); + + results = pastTimeouts + .Where(c => !string.IsNullOrEmpty(c.RowKey)) + .Select(c => new Tuple(c.RowKey, c.Time)) + .Distinct() + .ToList(); + + UpdateSuccesfullRead(context, lastSuccessfullReadEntity); + } + catch (DataServiceQueryException) + { + nextTimeToRunQuery = DateTime.UtcNow.AddMinutes(1); + results = new List>(); + } + return results; + } + + public void Add(TimeoutData timeout) + { + var context = new ServiceContext(account.CreateCloudTableClient()); + var hash = Hash(timeout); + TimeoutDataEntity timeoutDataEntity; + if (TryGetTimeoutData(context, hash, string.Empty, out timeoutDataEntity)) return; + + var stateAddress = Upload(timeout.State, hash); + var headers = Serialize(timeout.Headers); + + if (!TryGetTimeoutData(context, timeout.Time.ToString(PartitionKeyScope), stateAddress, out timeoutDataEntity)) + context.AddObject(ServiceContext.TimeoutDataTableName, + new TimeoutDataEntity(timeout.Time.ToString(PartitionKeyScope), stateAddress) + { + Destination = timeout.Destination.ToString(), + SagaId = timeout.SagaId, + StateAddress = stateAddress, + Time = timeout.Time, + CorrelationId = timeout.CorrelationId, + OwningTimeoutManager = timeout.OwningTimeoutManager, + Headers = headers + }); + + timeout.Id = stateAddress; + + if (timeout.SagaId != default(Guid) && !TryGetTimeoutData(context, timeout.SagaId.ToString(), stateAddress, out timeoutDataEntity)) + context.AddObject(ServiceContext.TimeoutDataTableName, + new TimeoutDataEntity(timeout.SagaId.ToString(), stateAddress) + { + Destination = timeout.Destination.ToString(), + SagaId = timeout.SagaId, + StateAddress = stateAddress, + Time = timeout.Time, + CorrelationId = timeout.CorrelationId, + OwningTimeoutManager = timeout.OwningTimeoutManager, + Headers = headers + }); + + context.AddObject(ServiceContext.TimeoutDataTableName, + new TimeoutDataEntity(stateAddress, string.Empty) + { + Destination = timeout.Destination.ToString(), + SagaId = timeout.SagaId, + StateAddress = stateAddress, + Time = timeout.Time, + CorrelationId = timeout.CorrelationId, + OwningTimeoutManager = timeout.OwningTimeoutManager, + Headers = headers + }); + + context.SaveChanges(); + } + + public bool TryRemove(string timeoutId, out TimeoutData timeoutData) + { + timeoutData = null; + + var context = new ServiceContext(account.CreateCloudTableClient()); + try + { + TimeoutDataEntity timeoutDataEntity; + if (!TryGetTimeoutData(context, timeoutId, string.Empty, out timeoutDataEntity)) + { + return false; + } + + timeoutData = new TimeoutData + { + Destination = Address.Parse(timeoutDataEntity.Destination), + SagaId = timeoutDataEntity.SagaId, + State = Download(timeoutDataEntity.StateAddress), + Time = timeoutDataEntity.Time, + CorrelationId = timeoutDataEntity.CorrelationId, + Id = timeoutDataEntity.RowKey, + OwningTimeoutManager = timeoutDataEntity.OwningTimeoutManager, + Headers = Deserialize(timeoutDataEntity.Headers) + }; + + TimeoutDataEntity timeoutDataEntityBySaga; + if (TryGetTimeoutData(context, timeoutDataEntity.SagaId.ToString(), timeoutId, out timeoutDataEntityBySaga)) + { + context.DeleteObject(timeoutDataEntityBySaga); + } + + TimeoutDataEntity timeoutDataEntityByTime; + if (TryGetTimeoutData(context, timeoutDataEntity.Time.ToString(PartitionKeyScope), timeoutId, out timeoutDataEntityByTime)) + { + context.DeleteObject(timeoutDataEntityByTime); + } + + RemoveState(timeoutDataEntity.StateAddress); + + context.DeleteObject(timeoutDataEntity); + + context.SaveChanges(); + } + catch (Exception ex) + { + Logger.Debug(string.Format("Failed to clean up timeout {0}", timeoutId), ex); + } + + return true; + } + + public void RemoveTimeoutBy(Guid sagaId) + { + var context = new ServiceContext(account.CreateCloudTableClient()); + try + { + var results = (from c in context.TimeoutData + where c.PartitionKey == sagaId.ToString() + select c).ToList(); + + foreach (var timeoutDataEntityBySaga in results) + { + RemoveState(timeoutDataEntityBySaga.StateAddress); + + TimeoutDataEntity timeoutDataEntityByTime; + if (TryGetTimeoutData(context, timeoutDataEntityBySaga.Time.ToString(PartitionKeyScope), timeoutDataEntityBySaga.RowKey, out timeoutDataEntityByTime)) + context.DeleteObject(timeoutDataEntityByTime); + + TimeoutDataEntity timeoutDataEntity; + if (TryGetTimeoutData(context, timeoutDataEntityBySaga.RowKey, string.Empty, out timeoutDataEntity)) + context.DeleteObject(timeoutDataEntity); + + context.DeleteObject(timeoutDataEntityBySaga); + } + context.SaveChanges(); + } + catch (Exception ex) + { + Logger.Debug(string.Format("Failed to clean up timeouts for saga {0}", sagaId), ex); + } + + } + + private bool TryGetTimeoutData(ServiceContext context, string partitionkey, string rowkey, out TimeoutDataEntity result) + { + try + { + result = (from c in context.TimeoutData + where c.PartitionKey == partitionkey && c.RowKey == rowkey + select c).FirstOrDefault(); + } + catch (Exception) + { + result = null; + } + + return result != null; + + } + + public bool CanSend(TimeoutData data) + { + var context = new ServiceContext(account.CreateCloudTableClient()); + TimeoutDataEntity timeoutDataEntity; + if (!TryGetTimeoutData(context, data.Id, string.Empty, out timeoutDataEntity)) return false; + + var leaseBlob = container.GetBlockBlobReference(timeoutDataEntity.StateAddress); + + using (var lease = new AutoRenewLease(leaseBlob)) + { + return lease.HasLease; + } + } + + public string ConnectionString + { + get + { + return connectionString; + } + set + { + connectionString = value; + Init(connectionString); + } + } + + public int CatchUpInterval { get; set; } + public string PartitionKeyScope { get; set; } + + private void Init(string connectionstring) + { + account = CloudStorageAccount.Parse(connectionstring); + var context = new ServiceContext(account.CreateCloudTableClient()); + var tableClient = account.CreateCloudTableClient(); + var table = tableClient.GetTableReference(ServiceContext.TimeoutManagerDataTableName); + table.CreateIfNotExists(); + table = tableClient.GetTableReference(ServiceContext.TimeoutDataTableName); + table.CreateIfNotExists(); + container = account.CreateCloudBlobClient().GetContainerReference("timeoutstate"); + container.CreateIfNotExists(); + + MigrateExistingTimeouts(context); + } + + private void MigrateExistingTimeouts(ServiceContext context) + { + var existing = (from c in context.TimeoutData + where c.PartitionKey == "TimeoutData" + select c).ToList(); + + foreach (var timeout in existing) + { + TimeoutDataEntity timeoutDataEntity; + + if (!TryGetTimeoutData(context, timeout.Time.ToString(PartitionKeyScope), timeout.RowKey, out timeoutDataEntity)) + context.AddObject(ServiceContext.TimeoutDataTableName, + new TimeoutDataEntity(timeout.Time.ToString(PartitionKeyScope), timeout.RowKey) + { + Destination = timeout.Destination, + SagaId = timeout.SagaId, + StateAddress = timeout.RowKey, + Time = timeout.Time, + CorrelationId = timeout.CorrelationId, + OwningTimeoutManager = timeout.OwningTimeoutManager + }); + + if (!TryGetTimeoutData(context, timeout.SagaId.ToString(), timeout.RowKey, out timeoutDataEntity)) + context.AddObject(ServiceContext.TimeoutDataTableName, + new TimeoutDataEntity(timeout.SagaId.ToString(), timeout.RowKey) + { + Destination = timeout.Destination, + SagaId = timeout.SagaId, + StateAddress = timeout.RowKey, + Time = timeout.Time, + CorrelationId = timeout.CorrelationId, + OwningTimeoutManager = timeout.OwningTimeoutManager + }); + + if (!TryGetTimeoutData(context, timeout.RowKey, string.Empty, out timeoutDataEntity)) + context.AddObject(ServiceContext.TimeoutDataTableName, + new TimeoutDataEntity(timeout.RowKey, string.Empty) + { + Destination = timeout.Destination, + SagaId = timeout.SagaId, + StateAddress = timeout.RowKey, + Time = timeout.Time, + CorrelationId = timeout.CorrelationId, + OwningTimeoutManager = timeout.OwningTimeoutManager + }); + + context.DeleteObject(timeout); + context.SaveChanges(); + } + } + + private string Upload(byte[] state, string stateAddress) + { + var blob = container.GetBlockBlobReference(stateAddress); + using (var stream = new MemoryStream(state)) + { + blob.UploadFromStream(stream); + } + return stateAddress; + } + + private byte[] Download(string stateAddress) + { + var blob = container.GetBlockBlobReference(stateAddress); + using (var stream = new MemoryStream()) + { + blob.DownloadToStream(stream); + stream.Position = 0; + + var buffer = new byte[16*1024]; + using (var ms = new MemoryStream()) + { + int read; + while ((read = stream.Read(buffer, 0, buffer.Length)) > 0) + { + ms.Write(buffer, 0, read); + } + return ms.ToArray(); + } + } + } + + private string Serialize(Dictionary headers) + { + var serializer = new JavaScriptSerializer(); + return serializer.Serialize(headers); + } + + private Dictionary Deserialize(string state) + { + if (string.IsNullOrEmpty(state)) return new Dictionary(); + + var serializer = new JavaScriptSerializer(); + return serializer.Deserialize>(state); + } + + private void RemoveState(string stateAddress) + { + var blob = container.GetBlockBlobReference(stateAddress); + blob.DeleteIfExists(); + } + + private static string Hash(TimeoutData timeout) + { + var s = timeout.SagaId + timeout.Destination.ToString() + timeout.Time.Ticks; + var sha1 = SHA1.Create(); + var bytes = sha1.ComputeHash(Encoding.UTF8.GetBytes(s)); + + var hash = new StringBuilder(); + for (var i = 0; i < bytes.Length; i++) + { + hash.Append(bytes[i].ToString("X2")); + } + return hash.ToString(); + } + + private string GetUniqueEndpointName() + { + var identifier = RoleEnvironment.IsAvailable ? RoleEnvironment.CurrentRoleInstance.Id : RuntimeEnvironment.MachineName; + + return Configure.EndpointName + "_" + identifier; + } + + private bool TryGetLastSuccessfullRead(ServiceContext context, out TimeoutManagerDataEntity lastSuccessfullReadEntity) + { + try + { + lastSuccessfullReadEntity = (from m in context.TimeoutManagerData + where m.PartitionKey == GetUniqueEndpointName() + select m).FirstOrDefault(); + } + catch + { + + lastSuccessfullReadEntity = null; + } + + + return lastSuccessfullReadEntity != null; + } + + private void UpdateSuccesfullRead(ServiceContext context, TimeoutManagerDataEntity read) + { + try + { + if (read == null) + { + read = new TimeoutManagerDataEntity(GetUniqueEndpointName(), string.Empty){LastSuccessfullRead = DateTime.UtcNow}; + + context.AddObject(ServiceContext.TimeoutManagerDataTableName, read); + } + else + { + context.Detach(read); + context.AttachTo(ServiceContext.TimeoutManagerDataTableName, read, "*"); + context.UpdateObject(read); + } + context.SaveChangesWithRetries(SaveChangesOptions.ReplaceOnUpdate); + } + catch (DataServiceRequestException ex) // handle concurrency issues + { + var response = ex.Response.FirstOrDefault(); + //Concurrency Exception - PreCondition Failed or Entity Already Exists + if (response != null && (response.StatusCode == 412 || response.StatusCode == 409)) + { + return; + // I assume we can ignore this condition? + // Time between read and update is very small, meaning that another instance has sent + // the timeout messages that this node intended to send and if not we will resend + // anything after the other node's last read value anyway on next request. + } + + throw; + } + + } + + private string connectionString; + private CloudStorageAccount account; + private CloudBlobContainer container; + + static readonly ILog Logger = LogManager.GetLogger(typeof(TimeoutPersister)); + } +} diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBus.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBus.cs new file mode 100644 index 00000000000..d109febb563 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBus.cs @@ -0,0 +1,16 @@ +namespace NServiceBus +{ + using Transports; + + /// + /// Transport definition for WindowsAzureServiceBus + /// + public class AzureServiceBus : TransportDefinition + { + public AzureServiceBus() + { + HasNativePubSubSupport = true; + HasSupportForCentralizedPubSub = true; + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusDequeueStrategy.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusDequeueStrategy.cs new file mode 100644 index 00000000000..356b905cc9a --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusDequeueStrategy.cs @@ -0,0 +1,225 @@ +using System; +using System.Collections.Generic; +using System.Transactions; +using Microsoft.ServiceBus.Messaging; + +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + using System.Collections; + using System.Threading; + using System.Threading.Tasks; + using CircuitBreakers; + using Transport; + using Transports; + + /// + /// Azure service bus implementation if . + /// + public class AzureServiceBusDequeueStrategy : IDequeueMessages + { + private Address address; + private TransactionSettings settings; + private Func tryProcessMessage; + private Action endProcessMessage; + private TransactionOptions transactionOptions; + private readonly Queue pendingMessages = Queue.Synchronized(new Queue()); + private readonly IList notifiers = new List(); + private CancellationTokenSource tokenSource; + private readonly CircuitBreaker circuitBreaker = new CircuitBreaker(100, TimeSpan.FromSeconds(30)); + + private const int PeekInterval = 50; + private const int MaximumWaitTimeWhenIdle = 1000; + private int timeToDelayNextPeek; + + private static int maximumConcurrencyLevel; + + /// + /// + /// + public Func CreateNotifier = () => + { + var notifier = Configure.Instance.Builder.Build(); + notifier.BatchSize = maximumConcurrencyLevel; + return notifier; + }; + + + /// + /// Initializes the . + /// + /// The address to listen on. + /// The to be used by . + /// Called when a message has been dequeued and is ready for processing. + /// Needs to be called by after the message has been processed regardless if the outcome was successful or not. + public virtual void Init(Address address, TransactionSettings transactionSettings, Func tryProcessMessage, Action endProcessMessage) + { + settings = transactionSettings; + this.tryProcessMessage = tryProcessMessage; + this.endProcessMessage = endProcessMessage; + this.address = address; + + transactionOptions = new TransactionOptions { IsolationLevel = transactionSettings.IsolationLevel, Timeout = transactionSettings.TransactionTimeout }; + } + + /// + /// Starts the dequeuing of message using the specified . + /// + /// Indicates the maximum concurrency level this is able to support. + public virtual void Start(int maximumConcurrencyLevel) + { + AzureServiceBusDequeueStrategy.maximumConcurrencyLevel = maximumConcurrencyLevel; + + CreateAndStartNotifier(); + + tokenSource = new CancellationTokenSource(); + + for (int i = 0; i < maximumConcurrencyLevel; i++) + { + StartThread(); + } + } + + void StartThread() + { + var token = tokenSource.Token; + + Task.Factory + .StartNew(TryProcessMessage, token, token, TaskCreationOptions.LongRunning, TaskScheduler.Default) + .ContinueWith(t => + { + if (t.Exception != null) + { + t.Exception.Handle(ex => + { + circuitBreaker.Execute(() => Configure.Instance.RaiseCriticalError("Failed to receive message!" /* from?*/, ex)); + return true; + }); + } + + StartThread(); + }, TaskContinuationOptions.OnlyOnFaulted); + } + + + private void TryProcessMessage(object obj) + { + var cancellationToken = (CancellationToken)obj; + + while (!cancellationToken.IsCancellationRequested) + { + BrokeredMessage brokeredMessage = null; + + if (pendingMessages.Count > 0) brokeredMessage = pendingMessages.Dequeue() as BrokeredMessage; + + if (brokeredMessage == null) + { + if (timeToDelayNextPeek < MaximumWaitTimeWhenIdle) timeToDelayNextPeek += PeekInterval; + + Thread.Sleep(timeToDelayNextPeek); + continue; + } + + timeToDelayNextPeek = 0; + Exception exception = null; + + if (!RenewLockIfNeeded(brokeredMessage)) continue; + + var transportMessage = new BrokeredMessageConverter().ToTransportMessage(brokeredMessage); + + try + { + if (settings.IsTransactional) + { + using (var scope = new TransactionScope(TransactionScopeOption.Required, transactionOptions)) + { + Transaction.Current.EnlistVolatile(new ReceiveResourceManager(brokeredMessage), EnlistmentOptions.None); + + if (transportMessage != null) + { + if (tryProcessMessage(transportMessage)) + { + scope.Complete(); + } + } + } + } + else + { + if (transportMessage != null) + { + tryProcessMessage(transportMessage); + } + + brokeredMessage.SafeComplete(); + } + } + catch (Exception ex) + { + exception = ex; + } + finally + { + endProcessMessage(transportMessage, exception); + } + } + } + + static bool RenewLockIfNeeded(BrokeredMessage brokeredMessage) + { + if (brokeredMessage.LockedUntilUtc <= DateTime.UtcNow) return false; + + if (brokeredMessage.LockedUntilUtc <= DateTime.UtcNow.AddSeconds(10)) + { + try + { + brokeredMessage.RenewLock(); + } + catch (Exception) + { + return false; + } + } + return true; + } + + /// + /// Stops the dequeuing of messages. + /// + public virtual void Stop() + { + foreach (var notifier in notifiers) + { + notifier.Stop(); + } + + notifiers.Clear(); + + tokenSource.Cancel(); + } + + void CreateAndStartNotifier() + { + var notifier = CreateNotifier(); + TrackNotifier(address, notifier); + } + + /// + /// + /// + /// + public void TrackNotifier(Address address, INotifyReceivedMessages notifier) + { + notifier.Start(address, EnqueueMessage); + notifiers.Add(notifier); + } + + void EnqueueMessage(BrokeredMessage brokeredMessage) + { + while (pendingMessages.Count > 2 * maximumConcurrencyLevel){Thread.Sleep(10);} + + if (brokeredMessage.LockedUntilUtc <= DateTime.UtcNow){return;} + + pendingMessages.Enqueue(brokeredMessage); + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusMessageQueueSender.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusMessageQueueSender.cs new file mode 100644 index 00000000000..0f3d9790953 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusMessageQueueSender.cs @@ -0,0 +1,130 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Transactions; +using Microsoft.ServiceBus; +using Microsoft.ServiceBus.Messaging; + +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + using Transports; + + /// + /// + /// + public class AzureServiceBusMessageQueueSender : ISendMessages + { + public const int DefaultBackoffTimeInSeconds = 10; + + private readonly Dictionary senders = new Dictionary(); + private static readonly object SenderLock = new Object(); + + public TimeSpan LockDuration { get; set; } + public long MaxSizeInMegabytes { get; set; } + public bool RequiresDuplicateDetection { get; set; } + public bool RequiresSession { get; set; } + public TimeSpan DefaultMessageTimeToLive { get; set; } + public bool EnableDeadLetteringOnMessageExpiration { get; set; } + public TimeSpan DuplicateDetectionHistoryTimeWindow { get; set; } + public int MaxDeliveryCount { get; set; } + public bool EnableBatchedOperations { get; set; } + + public MessagingFactory Factory { get; set; } + public NamespaceManager NamespaceClient { get; set; } + + public void Init(string address, bool transactional) + { + Init(Address.Parse(address), transactional); + } + + public void Init(Address address, bool transactional) + { + + } + + public void Send(TransportMessage message, string destination) + { + Send(message, Address.Parse(destination)); + } + + public void Send(TransportMessage message, Address address) + { + var destination = address.Queue; + + QueueClient sender; + if (!senders.TryGetValue(destination, out sender)) + { + lock (SenderLock) + { + if (!senders.TryGetValue(destination, out sender)) + { + sender = Factory.CreateQueueClient(destination); + senders[destination] = sender; + } + } + } + + if (Transaction.Current == null) + Send(message, sender,address); + else + Transaction.Current.EnlistVolatile(new SendResourceManager(() => Send(message, sender, address)), EnlistmentOptions.None); + + } + + void Send(TransportMessage message, QueueClient sender, Address address) + { + var numRetries = 0; + var sent = false; + + while (!sent) + { + try + { + using (var brokeredMessage = message.Body != null ? new BrokeredMessage(message.Body) : new BrokeredMessage()) + { + brokeredMessage.CorrelationId = message.CorrelationId; + if (message.TimeToBeReceived < TimeSpan.MaxValue) brokeredMessage.TimeToLive = message.TimeToBeReceived; + + foreach (var header in message.Headers) + { + brokeredMessage.Properties[header.Key] = header.Value; + } + + brokeredMessage.Properties[Headers.MessageIntent] = message.MessageIntent.ToString(); + brokeredMessage.MessageId = message.Id; + if (message.ReplyToAddress != null) + { + brokeredMessage.ReplyTo = message.ReplyToAddress.ToString(); + } + + sender.Send(brokeredMessage); + sent = true; + } + } + catch (MessagingEntityNotFoundException) + { + throw new QueueNotFoundException { Queue = address }; + } + // todo: outbox + catch (MessagingEntityDisabledException) + { + numRetries++; + + if (numRetries >= MaxDeliveryCount) throw; + + Thread.Sleep(TimeSpan.FromSeconds(numRetries * DefaultBackoffTimeInSeconds)); + } + // back off when we're being throttled + catch (ServerBusyException) + { + numRetries++; + + if (numRetries >= MaxDeliveryCount) throw; + + Thread.Sleep(TimeSpan.FromSeconds(numRetries * DefaultBackoffTimeInSeconds)); + } + } + } + + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusPublisherAddressConvention.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusPublisherAddressConvention.cs new file mode 100644 index 00000000000..3d853c48c72 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusPublisherAddressConvention.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + using System; + + public static class AzureServiceBusPublisherAddressConvention + { + public static Func Create = address => address.Queue + ".events"; + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusPublisherAddressConventionForSubscriptions.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusPublisherAddressConventionForSubscriptions.cs new file mode 100644 index 00000000000..83a586c5bb9 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusPublisherAddressConventionForSubscriptions.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + using System; + + public static class AzureServiceBusPublisherAddressConventionForSubscriptions + { + public static Func Create = AzureServiceBusPublisherAddressConvention.Create; + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusQueueCreator.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusQueueCreator.cs new file mode 100644 index 00000000000..a1bd6e5b4e4 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusQueueCreator.cs @@ -0,0 +1,17 @@ +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + using Transports; + + /// + /// Creates the queues. Note that this class will only be invoked when running the windows host and not when running in the fabric + /// + public class AzureServiceBusQueueCreator:ICreateQueues + { + public ICreateQueueClients CreateQueueClients { get; set; } + + public void CreateQueueIfNecessary(Address address, string account) + { + CreateQueueClients.Create(address); + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusQueueNotifier.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusQueueNotifier.cs new file mode 100644 index 00000000000..047417cba57 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusQueueNotifier.cs @@ -0,0 +1,89 @@ +using System; +using System.Threading; +using Microsoft.ServiceBus.Messaging; +using NServiceBus.Unicast.Transport.Transactional; +using NServiceBus.Utils; + +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + /// + /// + /// + public class AzureServiceBusQueueNotifier : INotifyReceivedMessages + { + private QueueClient _queueClient; + private Action _tryProcessMessage; + private bool cancelRequested; + + /// + /// + /// + public ICreateQueueClients QueueClientCreator { get; set; } + + /// + /// + /// + public int ServerWaitTime { get; set; } + /// + /// + /// + public int BatchSize { get; set; } + /// + /// + /// + public int BackoffTimeInSeconds { get; set; } + + /// + /// + /// + /// + /// + public void Start(Address address, Action tryProcessMessage) + { + cancelRequested = false; + + _tryProcessMessage = tryProcessMessage; + + _queueClient = QueueClientCreator.Create(address); + + _queueClient.BeginReceiveBatch(BatchSize, TimeSpan.FromSeconds(ServerWaitTime), OnMessage, null); + } + + /// + /// + /// + public void Stop() + { + cancelRequested = true; + } + + private void OnMessage(IAsyncResult ar) + { + try + { + var receivedMessages = _queueClient.EndReceiveBatch(ar); + + if (cancelRequested) return; + + foreach (var receivedMessage in receivedMessages) + { + _tryProcessMessage(receivedMessage); + } + } + catch (MessagingEntityDisabledException) + { + if (cancelRequested) return; + + Thread.Sleep(TimeSpan.FromSeconds(BackoffTimeInSeconds)); + } + catch (ServerBusyException) + { + if (cancelRequested) return; + + Thread.Sleep(TimeSpan.FromSeconds(BackoffTimeInSeconds)); + } + + _queueClient.BeginReceiveBatch(BatchSize, TimeSpan.FromSeconds(ServerWaitTime), OnMessage, null); + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusSubscriptionNameConvention.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusSubscriptionNameConvention.cs new file mode 100644 index 00000000000..9ad28938722 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusSubscriptionNameConvention.cs @@ -0,0 +1,9 @@ +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + using System; + + public static class AzureServiceBusSubscriptionNameConvention + { + public static Func Create = eventType => eventType != null ? Configure.EndpointName + "." + eventType.Name : Configure.EndpointName; + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusTopicNotifier.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusTopicNotifier.cs new file mode 100644 index 00000000000..4739c071b6d --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusTopicNotifier.cs @@ -0,0 +1,94 @@ +using System; +using System.Threading; +using Microsoft.ServiceBus.Messaging; + +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + /// + /// + /// + public class AzureServiceBusTopicNotifier : INotifyReceivedMessages + { + private SubscriptionClient _subscriptionClient; + private Action _tryProcessMessage; + private bool _cancelRequested; + + /// + /// + /// + public int ServerWaitTime { get; set; } + + /// + /// + /// + public int BatchSize { get; set; } + + /// + /// + /// + public int BackoffTimeInSeconds { get; set; } + + /// + /// + /// + public ICreateSubscriptionClients SubscriptionClientCreator { get; set; } + + /// + /// + /// + public Type EventType { get; set; } + + /// + /// + /// + /// + /// + public void Start(Address address, Action tryProcessMessage) + { + _cancelRequested = false; + + _tryProcessMessage = tryProcessMessage; + + _subscriptionClient = SubscriptionClientCreator.Create(address, EventType); + + if (_subscriptionClient != null) _subscriptionClient.BeginReceiveBatch(BatchSize, TimeSpan.FromSeconds(ServerWaitTime), OnMessage, null); + } + + /// + /// + /// + public void Stop() + { + _cancelRequested = true; + } + + private void OnMessage(IAsyncResult ar) + { + try + { + var receivedMessages = _subscriptionClient.EndReceiveBatch(ar); + + if (_cancelRequested) return; + + foreach (var receivedMessage in receivedMessages) + { + _tryProcessMessage(receivedMessage); + } + } + catch (MessagingEntityDisabledException) + { + if (_cancelRequested) return; + + Thread.Sleep(TimeSpan.FromSeconds(BackoffTimeInSeconds)); + } + catch (ServerBusyException) + { + if (_cancelRequested) return; + + Thread.Sleep(TimeSpan.FromSeconds(BackoffTimeInSeconds)); + } + + _subscriptionClient.BeginReceiveBatch(BatchSize, TimeSpan.FromSeconds(ServerWaitTime), OnMessage, null); + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusTopicPublisher.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusTopicPublisher.cs new file mode 100644 index 00000000000..76c5657b141 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusTopicPublisher.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using System.Transactions; +using Microsoft.ServiceBus; +using Microsoft.ServiceBus.Messaging; + + +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + using Transports; + + /// + /// + /// + public class AzureServiceBusTopicPublisher : IPublishMessages + { + public const int DefaultBackoffTimeInSeconds = 10; + public int MaxDeliveryCount { get; set; } + + public MessagingFactory Factory { get; set; } + public NamespaceManager NamespaceClient { get; set; } + private readonly Dictionary senders = new Dictionary(); + private static readonly object SenderLock = new Object(); + + public bool Publish(TransportMessage message, IEnumerable eventTypes) + { + var sender = GetTopicClientForDestination(AzureServiceBusPublisherAddressConvention.Create(Address.Local)); + + if (sender == null) return false; + + if (Transaction.Current == null) + Send(message, sender); + else + Transaction.Current.EnlistVolatile(new SendResourceManager(() => Send(message, sender)), EnlistmentOptions.None); + + return true; + } + + // todo, factor out... to bad IMessageSender is internal + private void Send(TransportMessage message, TopicClient sender) + { + var numRetries = 0; + var sent = false; + + while (!sent) + { + try + { + SendTo(message, sender); + sent = true; + } + // todo, outbox + catch (MessagingEntityDisabledException) + { + numRetries++; + + if (numRetries >= MaxDeliveryCount) throw; + + Thread.Sleep(TimeSpan.FromSeconds(numRetries * DefaultBackoffTimeInSeconds)); + } + // back off when we're being throttled + catch (ServerBusyException) + { + numRetries++; + + if (numRetries >= MaxDeliveryCount) throw; + + Thread.Sleep(TimeSpan.FromSeconds(numRetries * DefaultBackoffTimeInSeconds)); + } + } + } + + // todo, factor out... to bad IMessageSender is internal + private void SendTo(TransportMessage message, TopicClient sender) + { + using (var brokeredMessage = message.Body != null ? new BrokeredMessage(message.Body) : new BrokeredMessage()) + { + brokeredMessage.CorrelationId = message.CorrelationId; + if (message.TimeToBeReceived < TimeSpan.MaxValue) brokeredMessage.TimeToLive = message.TimeToBeReceived; + + foreach (var header in message.Headers) + { + brokeredMessage.Properties[header.Key] = header.Value; + } + + brokeredMessage.Properties[Headers.MessageIntent] = message.MessageIntent.ToString(); + brokeredMessage.MessageId = message.Id; + brokeredMessage.ReplyTo = message.ReplyToAddress.ToString(); + + sender.Send(brokeredMessage); + } + } + + // todo, factor out... + private TopicClient GetTopicClientForDestination(string destination) + { + TopicClient sender; + if (!senders.TryGetValue(destination, out sender)) + { + lock (SenderLock) + { + if (!senders.TryGetValue(destination, out sender)) + { + try + { + sender = Factory.CreateTopicClient(destination); + senders[destination] = sender; + + NamespaceClient.CreateTopic(destination); + } + catch (MessagingEntityNotFoundException) + { + // TopicNotFoundException? + //throw new QueueNotFoundException { Queue = Address.Parse(destination) }; + } + catch (MessagingEntityAlreadyExistsException) + { + // is ok. + } + } + } + } + return sender; + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusTopicSubscriptionManager.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusTopicSubscriptionManager.cs new file mode 100644 index 00000000000..167a0ebb8b9 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServiceBusTopicSubscriptionManager.cs @@ -0,0 +1,69 @@ +using System; +using Microsoft.ServiceBus; +using NServiceBus.Unicast.Transport.Transactional; + +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + using Transport; + using Transports; + + public class AzureServiceBusTopicSubscriptionManager : IManageSubscriptions + { + /// + /// + /// + public NamespaceManager NamespaceClient { get; set; } + + /// + /// + /// + public ICreateSubscriptionClients ClientCreator { get; set; } + + /// + /// + /// + /// + /// + public void Subscribe(Type eventType, Address original) + { + var publisherAddress = Address.Parse(AzureServiceBusPublisherAddressConventionForSubscriptions.Create(original)); + var subscriptionname = AzureServiceBusSubscriptionNameConvention.Create(eventType); + + ClientCreator.Create(eventType, publisherAddress.Queue, subscriptionname); + + // how to make the correct strategy listen to this subscription + + var theBus = Configure.Instance.Builder.Build(); + + var transport = theBus.Transport as TransportReceiver; + + if (transport == null) return; + + var strategy = transport.Receiver as AzureServiceBusDequeueStrategy; + + if (strategy == null) return; + + var notifier = Configure.Instance.Builder.Build(); + notifier.EventType = eventType; + strategy.TrackNotifier(publisherAddress, notifier); + } + + /// + /// + /// + /// + /// + public void Unsubscribe(Type eventType, Address original) + { + var publisherAddress = Address.Parse(AzureServiceBusPublisherAddressConvention.Create(original)); + var subscriptionname = AzureServiceBusSubscriptionNameConvention.Create(eventType); + + if (NamespaceClient.SubscriptionExists(publisherAddress.Queue, subscriptionname)) + { + NamespaceClient.DeleteSubscription(publisherAddress.Queue, subscriptionname); + } + + // unhook the listener + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServicebusDefaults.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServicebusDefaults.cs new file mode 100644 index 00000000000..c54426add56 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServicebusDefaults.cs @@ -0,0 +1,93 @@ +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + /// + /// + /// + public class AzureServicebusDefaults + { + /// + /// + /// + public const string DefaultIssuerName = "owner"; + + /// + /// + /// + public const int DefaultLockDuration = 30000; + + /// + /// + /// + public const long DefaultMaxSizeInMegabytes = 1024; + + /// + /// + /// + public const bool DefaultRequiresDuplicateDetection = false; + + /// + /// + /// + public const bool DefaultRequiresSession = false; + + /// + /// + /// + public const long DefaultDefaultMessageTimeToLive = 92233720368547; + + /// + /// + /// + public const bool DefaultEnableDeadLetteringOnMessageExpiration = false; + + /// + /// + /// + public const bool EnableDeadLetteringOnFilterEvaluationExceptions = false; + + /// + /// + /// + public const int DefaultDuplicateDetectionHistoryTimeWindow = 600000; + + /// + /// + /// + public const int DefaultMaxDeliveryCount = 6; + + /// + /// + /// + public const bool DefaultEnableBatchedOperations = true; + + /// + /// + /// + public const bool DefaultQueuePerInstance = false; + + /// + /// + /// + public const int DefaultBackoffTimeInSeconds = 10; + + /// + /// + /// + public const int DefaultServerWaitTime = 300; + + /// + /// + /// + public const string DefaultConnectivityMode = "Tcp"; + + /// + /// + /// + public const string DefaultConnectionString = ""; + + /// + /// + /// + public const int DefaultBatchSize = 1000; + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServicebusSubscriptionClientCreator.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServicebusSubscriptionClientCreator.cs new file mode 100644 index 00000000000..c234b834dd0 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/AzureServicebusSubscriptionClientCreator.cs @@ -0,0 +1,77 @@ +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + using System; + using Microsoft.ServiceBus; + using Microsoft.ServiceBus.Messaging; + + /// + /// + /// + public class AzureServicebusSubscriptionClientCreator : ICreateSubscriptionClients + { + public MessagingFactory Factory { get; set; } + public NamespaceManager NamespaceClient { get; set; } + + public TimeSpan LockDuration { get; set; } + public bool RequiresSession { get; set; } + public TimeSpan DefaultMessageTimeToLive { get; set; } + public bool EnableDeadLetteringOnMessageExpiration { get; set; } + public int MaxDeliveryCount { get; set; } + public bool EnableBatchedOperations { get; set; } + public bool EnableDeadLetteringOnFilterEvaluationExceptions { get; set; } + + public SubscriptionClient Create(Address address, Type eventType) + { + var topicPath = address.Queue; + var subscriptionname = AzureServiceBusSubscriptionNameConvention.Create(eventType); + return Create(eventType, topicPath, subscriptionname); + } + + public SubscriptionClient Create(Type eventType, string topicPath, string subscriptionname) + { + if (NamespaceClient.TopicExists(topicPath)) + { + try + { + if (!NamespaceClient.SubscriptionExists(topicPath, subscriptionname)) + { + var description = new SubscriptionDescription(topicPath, subscriptionname) + { + LockDuration = LockDuration, + RequiresSession = RequiresSession, + DefaultMessageTimeToLive = DefaultMessageTimeToLive, + EnableDeadLetteringOnMessageExpiration = EnableDeadLetteringOnMessageExpiration, + MaxDeliveryCount = MaxDeliveryCount, + EnableBatchedOperations = EnableBatchedOperations, + EnableDeadLetteringOnFilterEvaluationExceptions = + EnableDeadLetteringOnFilterEvaluationExceptions + }; + + if (eventType != null) + { + var filter = + string.Format( + "[{0}] LIKE '{1}%' OR [{0}] LIKE '%{1}%' OR [{0}] LIKE '%{1}' OR [{0}] = '{1}'", + Headers.EnclosedMessageTypes, eventType.AssemblyQualifiedName); + var typefilter = new SqlFilter(filter); + + NamespaceClient.CreateSubscription(description, typefilter); + } + else + { + NamespaceClient.CreateSubscription(description); + } + } + } + catch (MessagingEntityAlreadyExistsException) + { + // the queue already exists or another node beat us to it, which is ok + } + + return Factory.CreateSubscriptionClient(topicPath, subscriptionname, ReceiveMode.PeekLock); + + } + return null; + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/BrokeredMessageConverter.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/BrokeredMessageConverter.cs new file mode 100644 index 00000000000..b970259cbe9 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/BrokeredMessageConverter.cs @@ -0,0 +1,60 @@ +using System; +using System.IO; +using System.Runtime.Serialization; +using System.Runtime.Serialization.Formatters.Binary; +using Microsoft.ServiceBus.Messaging; + +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + using System.Linq; + + public class BrokeredMessageConverter + { + public TransportMessage ToTransportMessage(BrokeredMessage message) + { + TransportMessage t; + var rawMessage = message.GetBody(); + + if (message.Properties.Count == 0) + { + t = DeserializeMessage(rawMessage); + } + else + { + t = new TransportMessage(message.MessageId, message.Properties.ToDictionary(kvp=>kvp.Key,kvp=>kvp.Value.ToString())) + { + CorrelationId = message.CorrelationId, + TimeToBeReceived = message.TimeToLive + }; + + t.MessageIntent = + (MessageIntentEnum) + Enum.Parse(typeof(MessageIntentEnum), message.Properties[Headers.MessageIntent].ToString()); + + if ( !String.IsNullOrWhiteSpace( message.ReplyTo ) ) + { + t.ReplyToAddress = Address.Parse( message.ReplyTo ); // Will this work? + } + + t.Body = rawMessage; + } + + return t; + } + + private static TransportMessage DeserializeMessage(byte[] rawMessage) + { + var formatter = new BinaryFormatter(); + + using (var stream = new MemoryStream(rawMessage)) + { + var message = formatter.Deserialize(stream) as TransportMessage; + + if (message == null) + throw new SerializationException("Failed to deserialize message"); + + return message; + } + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/BrokeredMessageExtensions.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/BrokeredMessageExtensions.cs new file mode 100644 index 00000000000..ffe2bb32744 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/BrokeredMessageExtensions.cs @@ -0,0 +1,78 @@ +using System; +using System.Transactions; +using Microsoft.ServiceBus.Messaging; + +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + /// + /// + /// + public static class BrokeredMessageExtensions + { + /// + /// + /// + /// + /// + public static bool SafeComplete(this BrokeredMessage msg) + { + try + { + msg.Complete(); + + return true; + } + catch (MessageLockLostException) + { + // It's too late to compensate the loss of a message lock. We should just ignore it so that it does not break the receive loop. + } + catch (MessagingException) + { + // There is nothing we can do as the connection may have been lost, or the underlying queue may have been removed. + // If Abandon() fails with this exception, the only recourse is to receive another message. + } + catch (ObjectDisposedException) + { + // There is nothing we can do as the object has already been disposed elsewhere + } + catch (TransactionException) + { + // + } + return false; + } + + /// + /// + /// + /// + /// + public static bool SafeAbandon(this BrokeredMessage msg) + { + try + { + msg.Abandon(); + + return true; + } + catch (MessageLockLostException) + { + // It's too late to compensate the loss of a message lock. We should just ignore it so that it does not break the receive loop. + } + catch (MessagingException) + { + // There is nothing we can do as the connection may have been lost, or the underlying queue may have been removed. + // If Abandon() fails with this exception, the only recourse is to receive another message. + } + catch (ObjectDisposedException) + { + // There is nothing we can do as the object has already been disposed elsewhere + } + catch (TransactionException) + { + // + } + return false; + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/Config/AzureServiceBusQueueConfig.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/Config/AzureServiceBusQueueConfig.cs new file mode 100644 index 00000000000..27c21c08105 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/Config/AzureServiceBusQueueConfig.cs @@ -0,0 +1,272 @@ +namespace NServiceBus.Config +{ + using System.Configuration; + using Unicast.Queuing.Azure.ServiceBus; + + public class AzureServiceBusQueueConfig : ConfigurationSection + { + [ConfigurationProperty("QueueName", IsRequired = false, DefaultValue = null)] + public string QueueName + { + get + { + return (string)this["QueueName"]; + } + set + { + this["QueueName"] = value; + } + } + + [ConfigurationProperty("IssuerKey", IsRequired = false)] + public string IssuerKey + { + get + { + return (string)this["IssuerKey"]; + } + set + { + this["IssuerKey"] = value; + } + } + + [ConfigurationProperty("ServiceNamespace", IsRequired = false)] + public string ServiceNamespace + { + get + { + return (string)this["ServiceNamespace"]; + } + set + { + this["ServiceNamespace"] = value; + } + } + + [ConfigurationProperty("IssuerName", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultIssuerName)] + public string IssuerName + { + get + { + return (string)this["IssuerName"]; + } + set + { + this["IssuerName"] = value; + } + } + + [ConfigurationProperty("ConnectionString", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultConnectionString)] + public string ConnectionString + { + get + { + return (string)this["ConnectionString"]; + } + set + { + this["ConnectionString"] = value; + } + } + + + [ConfigurationProperty("LockDuration", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultLockDuration)] + public int LockDuration + { + get + { + return (int)this["LockDuration"]; + } + set + { + this["LockDuration"] = value; + } + } + + [ConfigurationProperty("MaxSizeInMegabytes", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultMaxSizeInMegabytes)] + public long MaxSizeInMegabytes + { + get + { + return (long)this["MaxSizeInMegabytes"]; + } + set + { + this["MaxSizeInMegabytes"] = value; + } + } + + [ConfigurationProperty("RequiresDuplicateDetection", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultRequiresDuplicateDetection)] + public bool RequiresDuplicateDetection + { + get + { + return (bool)this["RequiresDuplicateDetection"]; + } + set + { + this["RequiresDuplicateDetection"] = value; + } + } + + [ConfigurationProperty("RequiresSession", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultRequiresSession)] + public bool RequiresSession + { + get + { + return (bool)this["RequiresSession"]; + } + set + { + this["RequiresSession"] = value; + } + } + + [ConfigurationProperty("DefaultMessageTimeToLive", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultDefaultMessageTimeToLive)] + public long DefaultMessageTimeToLive + { + get + { + return (long)this["DefaultMessageTimeToLive"]; + } + set + { + this["DefaultMessageTimeToLive"] = value; + } + } + + [ConfigurationProperty("EnableDeadLetteringOnMessageExpiration", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultEnableDeadLetteringOnMessageExpiration)] + public bool EnableDeadLetteringOnMessageExpiration + { + get + { + return (bool)this["EnableDeadLetteringOnMessageExpiration"]; + } + set + { + this["EnableDeadLetteringOnMessageExpiration"] = value; + } + } + + [ConfigurationProperty("EnableDeadLetteringOnFilterEvaluationExceptions", IsRequired = false, DefaultValue = AzureServicebusDefaults.EnableDeadLetteringOnFilterEvaluationExceptions)] + public bool EnableDeadLetteringOnFilterEvaluationExceptions + { + get + { + return (bool)this["EnableDeadLetteringOnFilterEvaluationExceptions"]; + } + set + { + this["EnableDeadLetteringOnFilterEvaluationExceptions"] = value; + } + } + + + + + [ConfigurationProperty("DuplicateDetectionHistoryTimeWindow", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultDuplicateDetectionHistoryTimeWindow)] + public int DuplicateDetectionHistoryTimeWindow + { + get + { + return (int)this["DuplicateDetectionHistoryTimeWindow"]; + } + set + { + this["DuplicateDetectionHistoryTimeWindow"] = value; + } + } + + [ConfigurationProperty("MaxDeliveryCount", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultMaxDeliveryCount)] + public int MaxDeliveryCount + { + get + { + return (int)this["MaxDeliveryCount"]; + } + set + { + this["MaxDeliveryCount"] = value; + } + } + + [ConfigurationProperty("EnableBatchedOperations", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultEnableBatchedOperations)] + public bool EnableBatchedOperations + { + get + { + return (bool)this["EnableBatchedOperations"]; + } + set + { + this["EnableBatchedOperations"] = value; + } + } + + [ConfigurationProperty("QueuePerInstance", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultQueuePerInstance)] + public bool QueuePerInstance + { + get + { + return (bool)this["QueuePerInstance"]; + } + set + { + this["QueuePerInstance"] = value; + } + } + + [ConfigurationProperty("ServerWaitTime", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultServerWaitTime)] + public int ServerWaitTime + { + get + { + return (int)this["ServerWaitTime"]; + } + set + { + this["ServerWaitTime"] = value; + } + } + + [ConfigurationProperty("ConnectivityMode", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultConnectivityMode)] + public string ConnectivityMode + { + get + { + return (string)this["ConnectivityMode"]; + } + set + { + this["ConnectivityMode"] = value; + } + } + + [ConfigurationProperty("BatchSize", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultBatchSize)] + public int BatchSize + { + get + { + return (int)this["BatchSize"]; + } + set + { + this["BatchSize"] = value; + } + } + + [ConfigurationProperty("BackoffTimeInSeconds", IsRequired = false, DefaultValue = AzureServicebusDefaults.DefaultBackoffTimeInSeconds)] + public int BackoffTimeInSeconds + { + get + { + return (int)this["BackoffTimeInSeconds"]; + } + set + { + this["BackoffTimeInSeconds"] = value; + } + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/Config/AzureServiceBusTransport.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/Config/AzureServiceBusTransport.cs new file mode 100644 index 00000000000..8e4843cd077 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/Config/AzureServiceBusTransport.cs @@ -0,0 +1,173 @@ +namespace NServiceBus.Features +{ + using System; + using System.Configuration; + using System.Transactions; + using Azure; + using Config; + using Microsoft.ServiceBus; + using Microsoft.ServiceBus.Messaging; + using Microsoft.WindowsAzure.ServiceRuntime; + using Settings; + using Transports; + using Unicast.Queuing.Azure.ServiceBus; + + public class AzureServiceBusTransport : ConfigureTransport + { + protected override void InternalConfigure(Configure config) + { + Categories.Serializers.SetDefault(); + + if (IsRoleEnvironmentAvailable()) + { + EnableByDefault(); + + if (!IsHostedIn.ChildHostProcess()) + config.AzureConfigurationSource(); + } + + var configSection = NServiceBus.Configure.GetConfigSection(); + + if (configSection != null && !string.IsNullOrEmpty(configSection.QueueName)) + { + NServiceBus.Configure.Instance.DefineEndpointName(configSection.QueuePerInstance ? QueueIndividualizer.Individualize(configSection.QueueName) : configSection.QueueName); + Address.InitializeLocalAddress(NServiceBus.Configure.EndpointName); + } + else if (IsRoleEnvironmentAvailable()) + { + NServiceBus.Configure.Instance.DefineEndpointName(RoleEnvironment.CurrentRoleInstance.Role.Name); + Address.InitializeLocalAddress(NServiceBus.Configure.EndpointName); + } + + var serverWaitTime = AzureServicebusDefaults.DefaultServerWaitTime; + + if (configSection != null) + serverWaitTime = configSection.ServerWaitTime; + + // make sure the transaction stays open a little longer than the long poll. + NServiceBus.Configure.Transactions.Advanced(settings => settings.DefaultTimeout(TimeSpan.FromSeconds(serverWaitTime * 1.1)).IsolationLevel(IsolationLevel.Serializable)); + + + Enable(); + EnableByDefault(); + AzureServiceBusPersistence.UseAsDefault(); + } + + + + static bool IsRoleEnvironmentAvailable() + { + try + { + return RoleEnvironment.IsAvailable; + } + catch (Exception) + { + return false; + } + } + + public override void Initialize() + { + var configSection = NServiceBus.Configure.GetConfigSection(); + + ServiceBusEnvironment.SystemConnectivity.Mode = configSection == null ? ConnectivityMode.Tcp : (ConnectivityMode)Enum.Parse(typeof(ConnectivityMode), configSection.ConnectivityMode); + + var connectionString = SettingsHolder.Get("NServiceBus.Transport.ConnectionString"); + + if (string.IsNullOrEmpty(connectionString) && configSection != null) + connectionString = configSection.ConnectionString; + + if (string.IsNullOrEmpty(connectionString) && (configSection == null || string.IsNullOrEmpty(configSection.IssuerKey) || string.IsNullOrEmpty(configSection.ServiceNamespace))) + { + throw new ConfigurationErrorsException("No Servicebus Connection information specified, either set the ConnectionString or set the IssuerKey and ServiceNamespace properties"); + } + + NamespaceManager namespaceClient; + MessagingFactory factory; + Uri serviceUri; + if (!string.IsNullOrEmpty(connectionString)) + { + namespaceClient = NamespaceManager.CreateFromConnectionString(connectionString); + serviceUri = namespaceClient.Address; + factory = MessagingFactory.CreateFromConnectionString(connectionString); + } + else + { + var credentials = TokenProvider.CreateSharedSecretTokenProvider(configSection.IssuerName, configSection.IssuerKey); + serviceUri = ServiceBusEnvironment.CreateServiceUri("sb", configSection.ServiceNamespace, string.Empty); + namespaceClient = new NamespaceManager(serviceUri, credentials); + factory = MessagingFactory.Create(serviceUri, credentials); + } + Address.OverrideDefaultMachine(serviceUri.ToString()); + + + NServiceBus.Configure.Instance.Configurer.RegisterSingleton(namespaceClient); + NServiceBus.Configure.Instance.Configurer.RegisterSingleton(factory); + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + + var config = NServiceBus.Configure.Instance; + + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + + if (configSection == null) + { + //hack: just to get the defaults, we should refactor this to support specifying the values on the NServiceBus/Transport connection string as well + configSection = new AzureServiceBusQueueConfig(); + } + + if (!config.Configurer.HasComponent()) + { + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + config.Configurer.ConfigureProperty(t => t.MaxDeliveryCount, configSection.MaxDeliveryCount); + + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + config.Configurer.ConfigureProperty(t => t.LockDuration, TimeSpan.FromMilliseconds(configSection.LockDuration)); + config.Configurer.ConfigureProperty(t => t.MaxSizeInMegabytes, configSection.MaxSizeInMegabytes); + config.Configurer.ConfigureProperty(t => t.RequiresDuplicateDetection, configSection.RequiresDuplicateDetection); + config.Configurer.ConfigureProperty(t => t.RequiresSession, configSection.RequiresSession); + config.Configurer.ConfigureProperty(t => t.DefaultMessageTimeToLive, TimeSpan.FromMilliseconds(configSection.DefaultMessageTimeToLive)); + config.Configurer.ConfigureProperty(t => t.EnableDeadLetteringOnMessageExpiration, configSection.EnableDeadLetteringOnMessageExpiration); + config.Configurer.ConfigureProperty(t => t.DuplicateDetectionHistoryTimeWindow, TimeSpan.FromMilliseconds(configSection.DuplicateDetectionHistoryTimeWindow)); + config.Configurer.ConfigureProperty(t => t.MaxDeliveryCount, configSection.MaxDeliveryCount); + config.Configurer.ConfigureProperty(t => t.EnableBatchedOperations, configSection.EnableBatchedOperations); + config.Configurer.ConfigureProperty(t => t.ServerWaitTime, configSection.ServerWaitTime); + config.Configurer.ConfigureProperty(t => t.BatchSize, configSection.BatchSize); + config.Configurer.ConfigureProperty(t => t.BackoffTimeInSeconds, configSection.BackoffTimeInSeconds); + + } + + if (!config.Configurer.HasComponent() && + !config.Configurer.HasComponent()) + { + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); + + config.Configurer.ConfigureProperty(t => t.MaxDeliveryCount, configSection.MaxDeliveryCount); + config.Configurer.ConfigureProperty(t => t.LockDuration, TimeSpan.FromMilliseconds(configSection.LockDuration)); + config.Configurer.ConfigureProperty(t => t.RequiresSession, configSection.RequiresSession); + config.Configurer.ConfigureProperty(t => t.DefaultMessageTimeToLive, TimeSpan.FromMilliseconds(configSection.DefaultMessageTimeToLive)); + config.Configurer.ConfigureProperty(t => t.EnableDeadLetteringOnMessageExpiration, configSection.EnableDeadLetteringOnMessageExpiration); + config.Configurer.ConfigureProperty(t => t.EnableDeadLetteringOnFilterEvaluationExceptions, configSection.EnableDeadLetteringOnFilterEvaluationExceptions); + config.Configurer.ConfigureProperty(t => t.MaxDeliveryCount, configSection.MaxDeliveryCount); + config.Configurer.ConfigureProperty(t => t.EnableBatchedOperations, configSection.EnableBatchedOperations); + config.Configurer.ConfigureProperty(t => t.ServerWaitTime, configSection.ServerWaitTime); + config.Configurer.ConfigureProperty(t => t.BatchSize, configSection.BatchSize); + config.Configurer.ConfigureProperty(t => t.BackoffTimeInSeconds, configSection.BackoffTimeInSeconds); + } + } + + protected override bool RequiresConnectionString + { + get { return false; } + } + + protected override string ExampleConnectionStringForErrorMessage + { + get { return "todo - refactor the transport to use a connection string instead of a custom section"; } + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/Config/ConfigureAzureServiceBusMessageQueue.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/Config/ConfigureAzureServiceBusMessageQueue.cs new file mode 100644 index 00000000000..adb50bd75f9 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/Config/ConfigureAzureServiceBusMessageQueue.cs @@ -0,0 +1,18 @@ +using System; +using System.Configuration; +using System.Transactions; +using Microsoft.ServiceBus; +using Microsoft.ServiceBus.Messaging; +using Microsoft.WindowsAzure.ServiceRuntime; +using NServiceBus.Config; + +namespace NServiceBus +{ + public static class ConfigureAzureServiceBusMessageQueue + { + public static Configure AzureServiceBusMessageQueue(this Configure config) + { + return config.UseTransport(); + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/Config/IsHostedIn.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/Config/IsHostedIn.cs new file mode 100644 index 00000000000..5feea7c7a90 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/Config/IsHostedIn.cs @@ -0,0 +1,15 @@ +namespace NServiceBus.Azure +{ + using System.Diagnostics; + + public static class IsHostedIn + { + public static string HostProcessName = "NServiceBus.Hosting.Azure.HostProcess"; + + public static bool ChildHostProcess() + { + var currentProcess = Process.GetCurrentProcess(); + return currentProcess.ProcessName == HostProcessName; + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/ICreateQueueClients.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/ICreateQueueClients.cs new file mode 100644 index 00000000000..d614f269765 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/ICreateQueueClients.cs @@ -0,0 +1,17 @@ +using Microsoft.ServiceBus.Messaging; + +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + /// + /// + /// + public interface ICreateQueueClients + { + /// + /// + /// + /// + /// + QueueClient Create(Address address); + } +} diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/ICreateSubscriptionClients.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/ICreateSubscriptionClients.cs new file mode 100644 index 00000000000..f8ab41c14a6 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/ICreateSubscriptionClients.cs @@ -0,0 +1,28 @@ +using System; +using Microsoft.ServiceBus.Messaging; + +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + /// + /// + /// + public interface ICreateSubscriptionClients + { + /// + /// + /// + /// + /// + /// + SubscriptionClient Create(Address address, Type type); + + /// + /// + /// + /// + /// + /// + /// + SubscriptionClient Create(Type eventType, string topicPath, string subscriptionname); + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/INotifyReceivedMessages.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/INotifyReceivedMessages.cs new file mode 100644 index 00000000000..e7b187b09f9 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/INotifyReceivedMessages.cs @@ -0,0 +1,12 @@ +using System; +using Microsoft.ServiceBus.Messaging; +using NServiceBus.Unicast.Transport.Transactional; + +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + public interface INotifyReceivedMessages + { + void Start(Address address, Action tryProcessMessage); + void Stop(); + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/QueueClientCreator.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/QueueClientCreator.cs new file mode 100644 index 00000000000..72b9e804db2 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/QueueClientCreator.cs @@ -0,0 +1,55 @@ +using System; +using Microsoft.ServiceBus; +using Microsoft.ServiceBus.Messaging; + +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + public class AzureServicebusQueueClientCreator : ICreateQueueClients + { + public MessagingFactory Factory { get; set; } + public NamespaceManager NamespaceClient { get; set; } + + public TimeSpan LockDuration { get; set; } + public long MaxSizeInMegabytes { get; set; } + public bool RequiresDuplicateDetection { get; set; } + public bool RequiresSession { get; set; } + public TimeSpan DefaultMessageTimeToLive { get; set; } + public bool EnableDeadLetteringOnMessageExpiration { get; set; } + public TimeSpan DuplicateDetectionHistoryTimeWindow { get; set; } + public int MaxDeliveryCount { get; set; } + public bool EnableBatchedOperations { get; set; } + + public QueueClient Create(Address address) + { + var queueName = address.Queue; + try + { + if (!NamespaceClient.QueueExists(queueName)) + { + var description = new QueueDescription(queueName) + { + LockDuration = LockDuration, + MaxSizeInMegabytes = MaxSizeInMegabytes, + RequiresDuplicateDetection = RequiresDuplicateDetection, + RequiresSession = RequiresSession, + DefaultMessageTimeToLive = DefaultMessageTimeToLive, + EnableDeadLetteringOnMessageExpiration = EnableDeadLetteringOnMessageExpiration, + DuplicateDetectionHistoryTimeWindow = DuplicateDetectionHistoryTimeWindow, + MaxDeliveryCount = MaxDeliveryCount, + EnableBatchedOperations = EnableBatchedOperations + }; + + NamespaceClient.CreateQueue(description); + } + } + catch (MessagingEntityAlreadyExistsException) + { + // the queue already exists or another node beat us to it, which is ok + } + + var client = Factory.CreateQueueClient(queueName, ReceiveMode.PeekLock); + client.PrefetchCount = 100; // todo make configurable + return client; + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/ReceiveResourceManager.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/ReceiveResourceManager.cs new file mode 100644 index 00000000000..33b361d623c --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/ReceiveResourceManager.cs @@ -0,0 +1,41 @@ +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + using System.Transactions; + using Microsoft.ServiceBus.Messaging; + + public class ReceiveResourceManager : IEnlistmentNotification + { + private readonly BrokeredMessage receivedMessage; + + public ReceiveResourceManager(BrokeredMessage receivedMessage) + { + this.receivedMessage = receivedMessage; + } + + public void Prepare(PreparingEnlistment preparingEnlistment) + { + preparingEnlistment.Prepared(); + } + + public void Commit(Enlistment enlistment) + { + receivedMessage.SafeComplete(); + + enlistment.Done(); + } + + public void Rollback(Enlistment enlistment) + { + receivedMessage.SafeAbandon(); + + enlistment.Done(); + } + + public void InDoubt(Enlistment enlistment) + { + enlistment.Done(); + } + + + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/ServiceBus/SendResourceManager.cs b/src/azure/NServiceBus.Azure/Transports/ServiceBus/SendResourceManager.cs new file mode 100644 index 00000000000..644244005dd --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/ServiceBus/SendResourceManager.cs @@ -0,0 +1,36 @@ +namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus +{ + using System; + using System.Transactions; + + public class SendResourceManager : IEnlistmentNotification + { + private readonly Action onCommit; + + public SendResourceManager(Action onCommit ) + { + this.onCommit = onCommit; + } + + public void Prepare(PreparingEnlistment preparingEnlistment) + { + preparingEnlistment.Prepared(); + } + + public void Commit(Enlistment enlistment) + { + onCommit(); + enlistment.Done(); + } + + public void Rollback(Enlistment enlistment) + { + enlistment.Done(); + } + + public void InDoubt(Enlistment enlistment) + { + enlistment.Done(); + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureMessageQueueCreator.cs b/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureMessageQueueCreator.cs new file mode 100644 index 00000000000..bcccb57cdbc --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureMessageQueueCreator.cs @@ -0,0 +1,31 @@ +namespace NServiceBus.Transports.StorageQueues +{ + using System; + using Microsoft.WindowsAzure.Storage.Queue; + using Transports; + + /// + /// Creates the queues. Note that this class will only be invoked when running the windows host and not when running in the fabric + /// + public class AzureMessageQueueCreator : ICreateQueues + { + public CloudQueueClient Client { get; set; } + + public void CreateQueueIfNecessary(Address address, string account) + { + var queueName = AzureMessageQueueUtils.GetQueueName(address); + + try + { + var queue = Client.GetQueueReference(queueName); + + queue.CreateIfNotExists(); + + } + catch (Exception ex) + { + throw new InvalidOperationException("Failed to create queue: " + queueName,ex); + } + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureMessageQueueReceiver.cs b/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureMessageQueueReceiver.cs new file mode 100644 index 00000000000..990e35ac35d --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureMessageQueueReceiver.cs @@ -0,0 +1,202 @@ +namespace NServiceBus.Unicast.Queuing.Azure +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Runtime.Serialization; + using System.Threading; + using System.Transactions; + using Microsoft.WindowsAzure.Storage; + using Microsoft.WindowsAzure.Storage.Queue; + using Serialization; + using Transports.StorageQueues; + + public class AzureMessageQueueReceiver + { + public const int DefaultMessageInvisibleTime = 30000; + public const int DefaultPeekInterval = 50; + public const int DefaultMaximumWaitTimeWhenIdle = 1000; + public const int DefaultBatchSize = 10; + public const bool DefaultPurgeOnStartup = false; + public const string DefaultConnectionString = "UseDevelopmentStorage=true"; + public const bool DefaultQueuePerInstance = false; + + private CloudQueue queue; + private int timeToDelayNextPeek; + private readonly Queue messages = new Queue(); + + /// + /// Sets the amount of time, in milliseconds, to add to the time to wait before checking for a new message + /// + public int PeekInterval{ get; set; } + + /// + /// Sets the maximum amount of time, in milliseconds, that the queue will wait before checking for a new message + /// + public int MaximumWaitTimeWhenIdle { get; set; } + + /// + /// Sets whether or not the transport should purge the input + /// queue when it is started. + /// + public bool PurgeOnStartup { get; set; } + + /// + /// Controls how long messages should be invisible to other callers when receiving messages from the queue + /// + public int MessageInvisibleTime { get; set; } + + /// + /// Controls the number of messages that will be read in bulk from the queue + /// + public int BatchSize { get; set; } + + /// + /// Gets or sets the message serializer + /// + public IMessageSerializer MessageSerializer { get; set; } + + public CloudQueueClient Client { get; set; } + + public AzureMessageQueueReceiver() + { + MessageInvisibleTime = DefaultMessageInvisibleTime; + PeekInterval = DefaultPeekInterval; + MaximumWaitTimeWhenIdle = DefaultMaximumWaitTimeWhenIdle; + BatchSize = DefaultBatchSize; + } + + public void Init(string address, bool transactional) + { + Init(Address.Parse(address), transactional); + } + + public void Init(Address address, bool transactional) + { + useTransactions = transactional; + + var queueName = AzureMessageQueueUtils.GetQueueName(address); + + queue = Client.GetQueueReference(queueName); + queue.CreateIfNotExists(); + + if (PurgeOnStartup) + queue.Clear(); + } + + public TransportMessage Receive() + { + var rawMessage = GetMessage(); + + if (rawMessage == null) + { + + if (timeToDelayNextPeek < MaximumWaitTimeWhenIdle) timeToDelayNextPeek += PeekInterval; + + Thread.Sleep(timeToDelayNextPeek); + + return null; + } + + timeToDelayNextPeek = 0; + try + { + return DeserializeMessage(rawMessage); + + } + catch (Exception ex) + { + throw new EnvelopeDeserializationFailed(rawMessage,ex); + } + finally + { + if (!useTransactions || Transaction.Current == null) + DeleteMessage(rawMessage); + else + Transaction.Current.EnlistVolatile(new ReceiveResourceManager(queue, rawMessage), EnlistmentOptions.None); + } + } + + private CloudQueueMessage GetMessage() + { + if (messages.Count == 0) + { + var callback = new AsyncCallback(ar =>{ + var receivedMessages = queue.EndGetMessages(ar); + foreach (var receivedMessage in receivedMessages) + { + messages.Enqueue(receivedMessage); + } + }); + queue.BeginGetMessages(BatchSize, TimeSpan.FromMilliseconds(MessageInvisibleTime * BatchSize), null, null, callback, null); + } + + return messages.Count != 0 ? messages.Dequeue() : null; + } + + private void DeleteMessage(CloudQueueMessage message) + { + try + { + queue.DeleteMessage(message); + } + catch (StorageException ex) + { + if (ex.RequestInformation.HttpStatusCode != 404) throw; + } + } + + private TransportMessage DeserializeMessage(CloudQueueMessage rawMessage) + { + using (var stream = new MemoryStream(rawMessage.AsBytes)) + { + object[] deserializedObjects; + try + { + deserializedObjects = MessageSerializer.Deserialize(stream, new List { typeof(MessageWrapper) }); + } + catch (Exception) + { + throw new SerializationException("Failed to deserialize message with id: " + rawMessage.Id); + } + + var m = deserializedObjects.FirstOrDefault() as MessageWrapper; + + if (m == null) + throw new SerializationException("Failed to deserialize message with id: " + rawMessage.Id); + + var message = new TransportMessage(m.Id,m.Headers) + { + Body = m.Body, + CorrelationId = m.CorrelationId, + Recoverable = m.Recoverable, + ReplyToAddress = Address.Parse(m.ReplyToAddress), + TimeToBeReceived = m.TimeToBeReceived, + MessageIntent = m.MessageIntent + }; + + return message; + } + } + + bool useTransactions; + } + + public class EnvelopeDeserializationFailed:SerializationException + { + CloudQueueMessage message; + + + public EnvelopeDeserializationFailed(CloudQueueMessage message, Exception ex) + : base("Failed to deserialize message envelope", ex) + { + this.message = message; + } + + public CloudQueueMessage Message + { + get { return message; } + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureMessageQueueSender.cs b/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureMessageQueueSender.cs new file mode 100644 index 00000000000..578d649c56a --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureMessageQueueSender.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Transactions; +using Microsoft.WindowsAzure; +using NServiceBus.Serialization; + +namespace NServiceBus.Unicast.Queuing.Azure +{ + using Microsoft.WindowsAzure.Storage; + using Microsoft.WindowsAzure.Storage.Queue; + using Transports; + using Transports.StorageQueues; + + /// + /// + /// + public class AzureMessageQueueSender : ISendMessages + { + private readonly Dictionary destinationQueueClients = new Dictionary(); + private static readonly object SenderLock = new Object(); + /// + /// Gets or sets the message serializer + /// + public IMessageSerializer MessageSerializer { get; set; } + + public CloudQueueClient Client { get; set; } + + public void Init(string address, bool transactional) + { + Init(Address.Parse(address), transactional); + } + + public void Init(Address address, bool transactional) + { + + } + + public void Send(TransportMessage message, string destination) + { + Send(message, Address.Parse(destination)); + } + + public void Send(TransportMessage message, Address address) + { + var sendClient = GetClientForConnectionString(address.Machine) ?? Client; + + var sendQueue = sendClient.GetQueueReference(AzureMessageQueueUtils.GetQueueName(address)); + + if (!sendQueue.Exists()) + throw new QueueNotFoundException(); + + var rawMessage = SerializeMessage(message); + + if (Transaction.Current == null) + { + sendQueue.AddMessage(rawMessage); + } + else + Transaction.Current.EnlistVolatile(new SendResourceManager(sendQueue, rawMessage), EnlistmentOptions.None); + } + + private CloudQueueClient GetClientForConnectionString(string connectionString) + { + CloudQueueClient sendClient; + + if (!destinationQueueClients.TryGetValue(connectionString, out sendClient)) + { + lock (SenderLock) + { + if (!destinationQueueClients.TryGetValue(connectionString, out sendClient)) + { + CloudStorageAccount account; + + if (CloudStorageAccount.TryParse(connectionString, out account)) + { + sendClient = account.CreateCloudQueueClient(); + } + + // sendClient could be null, this is intentional + // so that it remembers a connectionstring was invald + // and doesn't try to parse it again. + + destinationQueueClients.Add(connectionString, sendClient); + } + } + } + + return sendClient; + } + + private CloudQueueMessage SerializeMessage(TransportMessage message) + { + using (var stream = new MemoryStream()) + { + var toSend = new MessageWrapper + { + Id = message.Id, + Body = message.Body, + CorrelationId = message.CorrelationId, + Recoverable = message.Recoverable, + ReplyToAddress = message.ReplyToAddress == null ? Address.Self.ToString() : message.ReplyToAddress.ToString(), + TimeToBeReceived = message.TimeToBeReceived, + Headers = message.Headers, + MessageIntent = message.MessageIntent + }; + + + MessageSerializer.Serialize(new IMessage[] { toSend }, stream); + return new CloudQueueMessage(stream.ToArray()); + } + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureMessageQueueUtils.cs b/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureMessageQueueUtils.cs new file mode 100644 index 00000000000..3a73fada72f --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureMessageQueueUtils.cs @@ -0,0 +1,42 @@ +namespace NServiceBus.Transports.StorageQueues +{ + using System; + using System.Security.Cryptography; + using System.Text; + + /// + /// Helper class + /// + public class AzureMessageQueueUtils + { + + public static string GetQueueName(Address address) + { + // The auto queue name generation uses namespaces which includes dots, + // yet dots are not supported in azure storage names + // that's why we replace them here. + + var name = address.Queue.Replace('.', '-').ToLowerInvariant(); + + if (name.Length > 63) + { + var nameGuid = DeterministicGuidBuilder(name).ToString(); + name = name.Substring(0, 63 - nameGuid.Length - 1) + "-" + nameGuid; + } + + return name; + } + + static Guid DeterministicGuidBuilder(string input) + { + //use MD5 hash to get a 16-byte hash of the string + using (var provider = new MD5CryptoServiceProvider()) + { + byte[] inputBytes = Encoding.Default.GetBytes(input); + byte[] hashBytes = provider.ComputeHash(inputBytes); + //generate a guid from the hash: + return new Guid(hashBytes); + } + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureStorageQueue.cs b/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureStorageQueue.cs new file mode 100644 index 00000000000..664ba796d10 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/StorageQueues/AzureStorageQueue.cs @@ -0,0 +1,12 @@ +namespace NServiceBus +{ + using Transports; + + /// + /// Transport definition for AzureStorageQueue + /// + public class AzureStorageQueue : TransportDefinition + { + + } +} \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/AzureQueueConfig.cs b/src/azure/NServiceBus.Azure/Transports/StorageQueues/Config/AzureQueueConfig.cs similarity index 81% rename from src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/AzureQueueConfig.cs rename to src/azure/NServiceBus.Azure/Transports/StorageQueues/Config/AzureQueueConfig.cs index 62b01add902..70675a43fa0 100644 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/AzureQueueConfig.cs +++ b/src/azure/NServiceBus.Azure/Transports/StorageQueues/Config/AzureQueueConfig.cs @@ -1,8 +1,8 @@ -using System.Configuration; -using NServiceBus.Unicast.Queuing.Azure; - namespace NServiceBus.Config { + using System.Configuration; + using Unicast.Queuing.Azure; + public class AzureQueueConfig : ConfigurationSection { [ConfigurationProperty("QueueName", IsRequired = false, DefaultValue = null)] @@ -18,7 +18,7 @@ public string QueueName } } - [ConfigurationProperty("ConnectionString", IsRequired = false, DefaultValue = AzureMessageQueue.DefaultConnectionString)] + [ConfigurationProperty("ConnectionString", IsRequired = false, DefaultValue = AzureMessageQueueReceiver.DefaultConnectionString)] public string ConnectionString { get @@ -31,7 +31,7 @@ public string ConnectionString } } - [ConfigurationProperty("PeekInterval", IsRequired = false, DefaultValue = AzureMessageQueue.DefaultPeekInterval)] + [ConfigurationProperty("PeekInterval", IsRequired = false, DefaultValue = AzureMessageQueueReceiver.DefaultPeekInterval)] public int PeekInterval { get @@ -44,7 +44,7 @@ public int PeekInterval } } - [ConfigurationProperty("MaximumWaitTimeWhenIdle", IsRequired = false, DefaultValue = AzureMessageQueue.DefaultMaximumWaitTimeWhenIdle)] + [ConfigurationProperty("MaximumWaitTimeWhenIdle", IsRequired = false, DefaultValue = AzureMessageQueueReceiver.DefaultMaximumWaitTimeWhenIdle)] public int MaximumWaitTimeWhenIdle { get @@ -57,7 +57,7 @@ public int MaximumWaitTimeWhenIdle } } - [ConfigurationProperty("PurgeOnStartup", IsRequired = false, DefaultValue = AzureMessageQueue.DefaultPurgeOnStartup)] + [ConfigurationProperty("PurgeOnStartup", IsRequired = false, DefaultValue = AzureMessageQueueReceiver.DefaultPurgeOnStartup)] public bool PurgeOnStartup { get @@ -70,7 +70,7 @@ public bool PurgeOnStartup } } - [ConfigurationProperty("MessageInvisibleTime", IsRequired = false, DefaultValue = AzureMessageQueue.DefaultMessageInvisibleTime)] + [ConfigurationProperty("MessageInvisibleTime", IsRequired = false, DefaultValue = AzureMessageQueueReceiver.DefaultMessageInvisibleTime)] public int MessageInvisibleTime { get @@ -83,7 +83,7 @@ public int MessageInvisibleTime } } - [ConfigurationProperty("BatchSize", IsRequired = false, DefaultValue = AzureMessageQueue.DefaultBatchSize)] + [ConfigurationProperty("BatchSize", IsRequired = false, DefaultValue = AzureMessageQueueReceiver.DefaultBatchSize)] public int BatchSize { get @@ -96,7 +96,7 @@ public int BatchSize } } - [ConfigurationProperty("QueuePerInstance", IsRequired = false, DefaultValue = AzureMessageQueue.DefaultQueuePerInstance)] + [ConfigurationProperty("QueuePerInstance", IsRequired = false, DefaultValue = AzureMessageQueueReceiver.DefaultQueuePerInstance)] public bool QueuePerInstance { get diff --git a/src/azure/NServiceBus.Azure/Transports/StorageQueues/Config/AzureStorageQueueTransport.cs b/src/azure/NServiceBus.Azure/Transports/StorageQueues/Config/AzureStorageQueueTransport.cs new file mode 100644 index 00000000000..8c0bb6ec1eb --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/StorageQueues/Config/AzureStorageQueueTransport.cs @@ -0,0 +1,133 @@ +namespace NServiceBus.Features +{ + using System; + using Azure; + using Config; + using Microsoft.WindowsAzure.ServiceRuntime; + using Microsoft.WindowsAzure.Storage; + using Microsoft.WindowsAzure.Storage.Queue; + using Settings; + using Transports; + using Transports.StorageQueues; + using Unicast.Queuing.Azure; + + public class AzureStorageQueueTransport : ConfigureTransport + { + protected override void InternalConfigure(Configure config) + { + Enable(); + EnableByDefault(); + EnableByDefault(); + EnableByDefault(); + Categories.Serializers.SetDefault(); + + if (IsRoleEnvironmentAvailable()) + { + EnableByDefault(); + + if (!IsHostedIn.ChildHostProcess()) + config.AzureConfigurationSource(); + } + + + + AzureStoragePersistence.UseAsDefault(); + + var configSection = NServiceBus.Configure.GetConfigSection(); + + if(configSection == null) + return; + + SettingsHolder.SetPropertyDefault(t => t.PurgeOnStartup, configSection.PurgeOnStartup); + SettingsHolder.SetPropertyDefault(t => t.MaximumWaitTimeWhenIdle, configSection.MaximumWaitTimeWhenIdle); + SettingsHolder.SetPropertyDefault(t => t.MessageInvisibleTime, configSection.MessageInvisibleTime); + SettingsHolder.SetPropertyDefault(t => t.PeekInterval, configSection.PeekInterval); + SettingsHolder.SetPropertyDefault(t => t.BatchSize, configSection.BatchSize); + } + + public override void Initialize() + { + CloudQueueClient queueClient; + + var configSection = NServiceBus.Configure.GetConfigSection(); + + var connectionString = TryGetConnectionString(configSection); + + if (string.IsNullOrEmpty(connectionString)) + { + queueClient = CloudStorageAccount.DevelopmentStorageAccount.CreateCloudQueueClient(); + } + else + { + queueClient = CloudStorageAccount.Parse(connectionString).CreateCloudQueueClient(); + + Address.OverrideDefaultMachine(connectionString); + } + + NServiceBus.Configure.Instance.Configurer.RegisterSingleton(queueClient); + + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall) + .ConfigureProperty(p => p.PurgeOnStartup, ConfigurePurging.PurgeRequested); + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + NServiceBus.Configure.Component(DependencyLifecycle.InstancePerCall); + + + SettingsHolder.ApplyTo(); + + if (configSection != null && !string.IsNullOrEmpty(configSection.QueueName)) + { + var queueName = configSection.QueueName; + + if (SettingsHolder.GetOrDefault("AzureMessageQueueReceiver.QueuePerInstance")) + queueName = QueueIndividualizer.Individualize(queueName); + + NServiceBus.Configure.Instance.DefineEndpointName(queueName); + } + else if (IsRoleEnvironmentAvailable()) + { + NServiceBus.Configure.Instance.DefineEndpointName(RoleEnvironment.CurrentRoleInstance.Role.Name); + } + Address.InitializeLocalAddress(NServiceBus.Configure.EndpointName); + + } + + static string TryGetConnectionString(AzureQueueConfig configSection) + { + var connectionString = SettingsHolder.Get("NServiceBus.Transport.ConnectionString"); + + if (string.IsNullOrEmpty(connectionString)) + { + if (configSection != null) + { + connectionString = configSection.ConnectionString; + } + } + + return connectionString; + } + + protected override bool RequiresConnectionString + { + get { return false; } + } + + protected override string ExampleConnectionStringForErrorMessage + { + get { return "todo - refactor the transport to use a connection string instead of a custom section"; } + } + + + static bool IsRoleEnvironmentAvailable() + { + try + { + return RoleEnvironment.IsAvailable; + } + catch (Exception) + { + return false; + } + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/StorageQueues/Config/ConfigureAzureMessageQueue.cs b/src/azure/NServiceBus.Azure/Transports/StorageQueues/Config/ConfigureAzureMessageQueue.cs new file mode 100644 index 00000000000..a541ba52118 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/StorageQueues/Config/ConfigureAzureMessageQueue.cs @@ -0,0 +1,78 @@ +using NServiceBus.Config; +using NServiceBus.Unicast.Queuing.Azure; + +namespace NServiceBus +{ + using Settings; + + public static class ConfigureAzureMessageQueue + { + public static Configure AzureMessageQueue(this Configure config) + { + return config.UseTransport(); + } + + /// + /// Sets the amount of time, in milliseconds, to add to the time to wait before checking for a new message + /// + /// + /// + /// + public static Configure PeekInterval(this Configure config, int value) + { + SettingsHolder.SetProperty(t=>t.PeekInterval,value); + + return config; + } + + /// + /// Sets the maximum amount of time, in milliseconds, that the queue will wait before checking for a new message + /// + /// + /// + /// + public static Configure MaximumWaitTimeWhenIdle(this Configure config, int value) + { + SettingsHolder.SetProperty(t => t.MaximumWaitTimeWhenIdle, value); + + return config; + } + + /// + /// Controls how long messages should be invisible to other callers when receiving messages from the queue + /// + /// + /// + /// + public static Configure MessageInvisibleTime(this Configure config, int value) + { + SettingsHolder.SetProperty(t => t.MessageInvisibleTime, value); + + return config; + } + + /// + /// Controls how many messages should be read from the queue at once + /// + /// + /// + /// + public static Configure BatchSize(this Configure config, int value) + { + SettingsHolder.SetProperty(t => t.BatchSize, value); + + return config; + } + + /// + /// Configures a queue per instance + /// + /// + /// + public static Configure QueuePerInstance(this Configure config) + { + SettingsHolder.Set("AzureMessageQueueReceiver.QueuePerInstance", true); + return config; + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/StorageQueues/MessageWrapper.cs b/src/azure/NServiceBus.Azure/Transports/StorageQueues/MessageWrapper.cs new file mode 100644 index 00000000000..9200d1bdedc --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/StorageQueues/MessageWrapper.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; + +namespace NServiceBus.Unicast.Queuing.Azure +{ + [Serializable] + internal class MessageWrapper : IMessage + { + public string IdForCorrelation { get; set; } + public string Id { get; set; } + public MessageIntentEnum MessageIntent { get; set; } + public string ReplyToAddress { get; set; } + public TimeSpan TimeToBeReceived { get; set; } + public Dictionary Headers { get; set; } + public byte[] Body { get; set; } + public string CorrelationId { get; set; } + public bool Recoverable { get; set; } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/StorageQueues/PollingDequeueStrategy.cs b/src/azure/NServiceBus.Azure/Transports/StorageQueues/PollingDequeueStrategy.cs new file mode 100644 index 00000000000..d003603b8f2 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/StorageQueues/PollingDequeueStrategy.cs @@ -0,0 +1,146 @@ +namespace NServiceBus.Unicast.Queuing.Azure +{ + using System; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Transactions; + using CircuitBreakers; + using Logging; + using Transport; + using Transports; + + /// + /// A polling implementation of . + /// + public class PollingDequeueStrategy : IDequeueMessages + { + /// + /// See . + /// + public AzureMessageQueueReceiver MessageReceiver { get; set; } + + /// + /// Initializes the . + /// + /// The address to listen on. + /// The to be used by . + /// Called when a message has been dequeued and is ready for processing. + /// Needs to be called by after the message has been processed regardless if the outcome was successful or not. + public void Init(Address address, TransactionSettings transactionSettings, Func tryProcessMessage, Action endProcessMessage) + { + this.tryProcessMessage = tryProcessMessage; + this.endProcessMessage = endProcessMessage; + + addressToPoll = address; + settings = transactionSettings; + transactionOptions = new TransactionOptions { IsolationLevel = transactionSettings.IsolationLevel, Timeout = transactionSettings.TransactionTimeout }; + + MessageReceiver.Init(addressToPoll, settings.IsTransactional); + } + + /// + /// Starts the dequeuing of message using the specified . + /// + /// Indicates the maximum concurrency level this is able to support. + public void Start(int maximumConcurrencyLevel) + { + tokenSource = new CancellationTokenSource(); + + for (int i = 0; i < maximumConcurrencyLevel; i++) + { + StartThread(); + } + } + + /// + /// Stops the dequeuing of messages. + /// + public void Stop() + { + tokenSource.Cancel(); + } + + void StartThread() + { + var token = tokenSource.Token; + + Task.Factory + .StartNew(Action, token, token, TaskCreationOptions.LongRunning, TaskScheduler.Default) + .ContinueWith(t => + { + t.Exception.Handle(ex => + { + circuitBreaker.Execute(() => Configure.Instance.RaiseCriticalError(string.Format("Failed to receive message from '{0}'.", MessageReceiver), ex)); + return true; + }); + + StartThread(); + }, TaskContinuationOptions.OnlyOnFaulted); + } + + private void Action(object obj) + { + var cancellationToken = (CancellationToken)obj; + + while (!cancellationToken.IsCancellationRequested) + { + Exception exception = null; + TransportMessage message = null; + + try + { + if (settings.IsTransactional) + { + using (var scope = new TransactionScope(TransactionScopeOption.Required, transactionOptions)) + { + message = MessageReceiver.Receive(); + + if (message != null) + { + if (tryProcessMessage(message)) + { + scope.Complete(); + } + } + } + } + else + { + message = MessageReceiver.Receive(); + + if (message != null) + { + tryProcessMessage(message); + } + } + } + catch (EnvelopeDeserializationFailed ex) + { + //if we failed to deserialize the envlope there isn't much we can do so we just swallow the message to avoid a infinite loop + message = new TransportMessage(ex.Message.Id,new Dictionary()); + exception = ex; + + Logger.Error("Failed to deserialize the envelope of the incoming message. Message will be discarded. MessageId: " + ex.Message.Id,exception); + } + catch (Exception ex) + { + exception = ex; + } + finally + { + endProcessMessage(message, exception); + } + } + } + + readonly CircuitBreaker circuitBreaker = new CircuitBreaker(100, TimeSpan.FromSeconds(30)); + Func tryProcessMessage; + CancellationTokenSource tokenSource; + Address addressToPoll; + TransactionSettings settings; + TransactionOptions transactionOptions; + Action endProcessMessage; + static ILog Logger = LogManager.GetLogger(typeof (PollingDequeueStrategy)); + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/StorageQueues/ReceiveResourceManager.cs b/src/azure/NServiceBus.Azure/Transports/StorageQueues/ReceiveResourceManager.cs new file mode 100644 index 00000000000..0e2ee809b07 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/StorageQueues/ReceiveResourceManager.cs @@ -0,0 +1,48 @@ +namespace NServiceBus.Unicast.Queuing.Azure +{ + using System.Transactions; + using Microsoft.WindowsAzure.Storage; + using Microsoft.WindowsAzure.Storage.Queue; + + public class ReceiveResourceManager : IEnlistmentNotification + { + private readonly CloudQueue queue; + private readonly CloudQueueMessage receivedMessage; + + public ReceiveResourceManager(CloudQueue queue, CloudQueueMessage receivedMessage) + { + this.queue = queue; + this.receivedMessage = receivedMessage; + } + + public void Prepare(PreparingEnlistment preparingEnlistment) + { + preparingEnlistment.Prepared(); + } + + public void Commit(Enlistment enlistment) + { + try + { + queue.DeleteMessage(receivedMessage); + } + catch (StorageException ex) + { + if (ex.RequestInformation.HttpStatusCode != 404) throw; + } + enlistment.Done(); + } + + public void Rollback(Enlistment enlistment) + { + enlistment.Done(); + } + + public void InDoubt(Enlistment enlistment) + { + enlistment.Done(); + } + + + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/Transports/StorageQueues/SendResourceManager.cs b/src/azure/NServiceBus.Azure/Transports/StorageQueues/SendResourceManager.cs new file mode 100644 index 00000000000..c1451aef4a1 --- /dev/null +++ b/src/azure/NServiceBus.Azure/Transports/StorageQueues/SendResourceManager.cs @@ -0,0 +1,38 @@ +namespace NServiceBus.Unicast.Queuing.Azure +{ + using System.Transactions; + using Microsoft.WindowsAzure.Storage.Queue; + + public class SendResourceManager : IEnlistmentNotification + { + private readonly CloudQueue queue; + private readonly CloudQueueMessage message; + + public SendResourceManager(CloudQueue queue, CloudQueueMessage message) + { + this.queue = queue; + this.message = message; + } + + public void Prepare(PreparingEnlistment preparingEnlistment) + { + preparingEnlistment.Prepared(); + } + + public void Commit(Enlistment enlistment) + { + queue.AddMessage(message); + enlistment.Done(); + } + + public void Rollback(Enlistment enlistment) + { + enlistment.Done(); + } + + public void InDoubt(Enlistment enlistment) + { + enlistment.Done(); + } + } +} \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/app.config b/src/azure/NServiceBus.Azure/app.config new file mode 100644 index 00000000000..f53d06f032c --- /dev/null +++ b/src/azure/NServiceBus.Azure/app.config @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/azure/NServiceBus.Azure/packages.config b/src/azure/NServiceBus.Azure/packages.config new file mode 100644 index 00000000000..7d9287538c0 --- /dev/null +++ b/src/azure/NServiceBus.Azure/packages.config @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/AzureServiceBusQueueConfig.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/AzureServiceBusQueueConfig.cs deleted file mode 100644 index 8bfec19478e..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/AzureServiceBusQueueConfig.cs +++ /dev/null @@ -1,191 +0,0 @@ -using System.Configuration; -using NServiceBus.Unicast.Queuing.Azure.ServiceBus; - -namespace NServiceBus.Config -{ - public class AzureServiceBusQueueConfig : ConfigurationSection - { - [ConfigurationProperty("QueueName", IsRequired = false, DefaultValue = null)] - public string QueueName - { - get - { - return (string)this["QueueName"]; - } - set - { - this["QueueName"] = value; - } - } - - [ConfigurationProperty("IssuerKey", IsRequired = true)] - public string IssuerKey - { - get - { - return (string)this["IssuerKey"]; - } - set - { - this["IssuerKey"] = value; - } - } - - [ConfigurationProperty("ServiceNamespace", IsRequired = true)] - public string ServiceNamespace - { - get - { - return (string)this["ServiceNamespace"]; - } - set - { - this["ServiceNamespace"] = value; - } - } - - [ConfigurationProperty("IssuerName", IsRequired = false, DefaultValue = AzureServiceBusMessageQueue.DefaultIssuerName)] - public string IssuerName - { - get - { - return (string)this["IssuerName"]; - } - set - { - this["IssuerName"] = value; - } - } - - - [ConfigurationProperty("LockDuration", IsRequired = false, DefaultValue = AzureServiceBusMessageQueue.DefaultLockDuration)] - public int LockDuration - { - get - { - return (int)this["LockDuration"]; - } - set - { - this["LockDuration"] = value; - } - } - - [ConfigurationProperty("MaxSizeInMegabytes", IsRequired = false, DefaultValue = AzureServiceBusMessageQueue.DefaultMaxSizeInMegabytes)] - public long MaxSizeInMegabytes - { - get - { - return (long)this["MaxSizeInMegabytes"]; - } - set - { - this["MaxSizeInMegabytes"] = value; - } - } - - [ConfigurationProperty("RequiresDuplicateDetection", IsRequired = false, DefaultValue = AzureServiceBusMessageQueue.DefaultRequiresDuplicateDetection)] - public bool RequiresDuplicateDetection - { - get - { - return (bool)this["RequiresDuplicateDetection"]; - } - set - { - this["RequiresDuplicateDetection"] = value; - } - } - - [ConfigurationProperty("RequiresSession", IsRequired = false, DefaultValue = AzureServiceBusMessageQueue.DefaultRequiresSession)] - public bool RequiresSession - { - get - { - return (bool)this["RequiresSession"]; - } - set - { - this["RequiresSession"] = value; - } - } - - [ConfigurationProperty("DefaultMessageTimeToLive", IsRequired = false, DefaultValue = AzureServiceBusMessageQueue.DefaultDefaultMessageTimeToLive)] - public long DefaultMessageTimeToLive - { - get - { - return (long)this["DefaultMessageTimeToLive"]; - } - set - { - this["DefaultMessageTimeToLive"] = value; - } - } - - [ConfigurationProperty("EnableDeadLetteringOnMessageExpiration", IsRequired = false, DefaultValue = AzureServiceBusMessageQueue.DefaultEnableDeadLetteringOnMessageExpiration)] - public bool EnableDeadLetteringOnMessageExpiration - { - get - { - return (bool)this["EnableDeadLetteringOnMessageExpiration"]; - } - set - { - this["EnableDeadLetteringOnMessageExpiration"] = value; - } - } - - [ConfigurationProperty("DuplicateDetectionHistoryTimeWindow", IsRequired = false, DefaultValue = AzureServiceBusMessageQueue.DefaultDuplicateDetectionHistoryTimeWindow)] - public int DuplicateDetectionHistoryTimeWindow - { - get - { - return (int)this["DuplicateDetectionHistoryTimeWindow"]; - } - set - { - this["DuplicateDetectionHistoryTimeWindow"] = value; - } - } - - [ConfigurationProperty("MaxDeliveryCount", IsRequired = false, DefaultValue = AzureServiceBusMessageQueue.DefaultMaxDeliveryCount)] - public int MaxDeliveryCount - { - get - { - return (int)this["MaxDeliveryCount"]; - } - set - { - this["MaxDeliveryCount"] = value; - } - } - - [ConfigurationProperty("EnableBatchedOperations", IsRequired = false, DefaultValue = AzureServiceBusMessageQueue.DefaultEnableBatchedOperations)] - public bool EnableBatchedOperations - { - get - { - return (bool)this["EnableBatchedOperations"]; - } - set - { - this["EnableBatchedOperations"] = value; - } - } - - [ConfigurationProperty("QueuePerInstance", IsRequired = false, DefaultValue = AzureServiceBusMessageQueue.DefaultQueuePerInstance)] - public bool QueuePerInstance - { - get - { - return (bool)this["QueuePerInstance"]; - } - set - { - this["QueuePerInstance"] = value; - } - } - } -} \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/ConfigureAzureServiceBusMessageQueue.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/ConfigureAzureServiceBusMessageQueue.cs deleted file mode 100644 index 1dcc880db5b..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/ConfigureAzureServiceBusMessageQueue.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Configuration; -using Microsoft.ServiceBus; -using Microsoft.ServiceBus.Messaging; -using Microsoft.WindowsAzure.ServiceRuntime; -using NServiceBus.Config; -using NServiceBus.Config.Conventions; -using NServiceBus.Unicast.Queuing.Azure.ServiceBus; - -namespace NServiceBus -{ - public static class ConfigureAzureServiceBusMessageQueue - { - public static Configure AzureServiceBusMessageQueue(this Configure config) - { - var configSection = Configure.GetConfigSection(); - - if (configSection == null) - throw new ConfigurationErrorsException("No AzureServiceBusQueueConfig configuration section found"); - - Address.InitializeAddressMode(AddressMode.Remote); - - var credentials = TokenProvider.CreateSharedSecretTokenProvider(configSection.IssuerName, configSection.IssuerKey); - var serviceUri = ServiceBusEnvironment.CreateServiceUri("sb", configSection.ServiceNamespace, string.Empty); - var namespaceClient = new NamespaceManager(serviceUri, credentials); - var factory = MessagingFactory.Create(serviceUri, credentials); - - Address.OverrideDefaultMachine(serviceUri.ToString()); - - config.Configurer.RegisterSingleton(namespaceClient); - config.Configurer.RegisterSingleton(factory); - - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - - Configure.Instance.Configurer.ConfigureProperty(t => t.LockDuration, TimeSpan.FromMilliseconds(configSection.LockDuration)); - Configure.Instance.Configurer.ConfigureProperty(t => t.MaxSizeInMegabytes, configSection.MaxSizeInMegabytes); - Configure.Instance.Configurer.ConfigureProperty(t => t.RequiresDuplicateDetection, configSection.RequiresDuplicateDetection); - Configure.Instance.Configurer.ConfigureProperty(t => t.RequiresSession, configSection.RequiresSession); - Configure.Instance.Configurer.ConfigureProperty(t => t.DefaultMessageTimeToLive, TimeSpan.FromMilliseconds(configSection.DefaultMessageTimeToLive)); - Configure.Instance.Configurer.ConfigureProperty(t => t.EnableDeadLetteringOnMessageExpiration, configSection.EnableDeadLetteringOnMessageExpiration); - Configure.Instance.Configurer.ConfigureProperty(t => t.DuplicateDetectionHistoryTimeWindow, TimeSpan.FromMilliseconds(configSection.DuplicateDetectionHistoryTimeWindow)); - Configure.Instance.Configurer.ConfigureProperty(t => t.MaxDeliveryCount, configSection.MaxDeliveryCount); - Configure.Instance.Configurer.ConfigureProperty(t => t.EnableBatchedOperations, configSection.EnableBatchedOperations); - - if (!string.IsNullOrEmpty(configSection.QueueName)) - { - Configure.Instance.DefineEndpointName(configSection.QueuePerInstance - ? QueueIndividualizer.Individualize(configSection.QueueName) - : configSection.QueueName); - } - else if (RoleEnvironment.IsAvailable) - { - Configure.Instance.DefineEndpointName(RoleEnvironment.CurrentRoleInstance.Role.Name); - } - Address.InitializeLocalAddress(Configure.EndpointName); - - - return config; - } - } -} \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/NServiceBus.Unicast.Queuing.AppFabric.Config.csproj b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/NServiceBus.Unicast.Queuing.AppFabric.Config.csproj deleted file mode 100644 index 547d0ad33ee..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/NServiceBus.Unicast.Queuing.AppFabric.Config.csproj +++ /dev/null @@ -1,83 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {350CA11F-E647-47F6-B9A3-1E1653B8D4B0} - Library - Properties - NServiceBus.Unicast.Queuing.AppFabric.Config - NServiceBus.Unicast.Queuing.AppFabric.Config - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\..\lib\Azure\Microsoft.ServiceBus.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - ..\..\..\..\build\output\NServiceBus.dll - - - ..\..\..\..\build\output\NServiceBus.Core.dll - - - - - - - - - - - - - - - - - - - - - - - - - {911C5871-B059-4F8D-99B3-86F13CDEFC86} - NServiceBus.Unicast.Queuing.AppFabric - - - - - \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/Properties/AssemblyInfo.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/Properties/AssemblyInfo.cs deleted file mode 100644 index 3aab32bc48c..00000000000 Binary files a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/QueueIndividualizer.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/QueueIndividualizer.cs deleted file mode 100644 index 6878478048b..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/QueueIndividualizer.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Globalization; -using Microsoft.WindowsAzure.ServiceRuntime; -using NServiceBus.Config.ConfigurationSource; - -namespace NServiceBus.Config -{ - internal class QueueIndividualizer - { - public static string Individualize(string queueName) - { - var individualQueueName = queueName; - if (RoleEnvironment.IsAvailable) - { - var index = ParseIndexFrom(RoleEnvironment.CurrentRoleInstance.Id); - individualQueueName = ParseQueueNameFrom(queueName) - + (index > 0 ? "-" : "") - + (index > 0 ? index.ToString(CultureInfo.InvariantCulture) : ""); - - if (queueName.Contains("@")) - individualQueueName += "@" + ParseMachineNameFrom(queueName); - } - - return individualQueueName; - } - - private static string ParseMachineNameFrom(string inputQueue) - { - return inputQueue.Contains("@") ? inputQueue.Substring(inputQueue.IndexOf("@", System.StringComparison.Ordinal) + 1) : string.Empty; - } - - private static object ParseQueueNameFrom(string inputQueue) - { - return inputQueue.Contains("@") ? inputQueue.Substring(0, inputQueue.IndexOf("@", System.StringComparison.Ordinal)) : inputQueue; - } - - private static int ParseIndexFrom(string id) - { - var idArray = id.Split('.'); - int index; - if (!int.TryParse((idArray[idArray.Length - 1]), out index)) - { - idArray = id.Split('_'); - index = int.Parse((idArray[idArray.Length - 1])); - } - return index; - } - } -} \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/app.config b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/app.config deleted file mode 100644 index 296f244cdf6..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/app.config +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/packages.config b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/packages.config deleted file mode 100644 index f308d534c26..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric.Config/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/AzureServiceBusMessageQueue.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/AzureServiceBusMessageQueue.cs deleted file mode 100644 index e4fc0c39a98..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/AzureServiceBusMessageQueue.cs +++ /dev/null @@ -1,250 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Runtime.Serialization; -using System.Runtime.Serialization.Formatters.Binary; -using System.Threading; -using System.Transactions; -using Microsoft.ServiceBus; -using Microsoft.ServiceBus.Messaging; -using NServiceBus.Unicast.Transport; - -namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus -{ - public class AzureServiceBusMessageQueue : IReceiveMessages, ISendMessages - { - public const string DefaultIssuerName = "owner"; - public const int DefaultLockDuration = 30000; - public const long DefaultMaxSizeInMegabytes = 1024; - public const bool DefaultRequiresDuplicateDetection = false; - public const bool DefaultRequiresSession = false; - public const long DefaultDefaultMessageTimeToLive = 92233720368547; - public const bool DefaultEnableDeadLetteringOnMessageExpiration = false; - public const int DefaultDuplicateDetectionHistoryTimeWindow = 600000; - public const int DefaultMaxDeliveryCount = 6; - public const bool DefaultEnableBatchedOperations = false; - public const bool DefaultQueuePerInstance = false; - public const int DefaultBackoffTimeInSeconds = 10; - - private readonly Dictionary senders = new Dictionary(); - private static readonly object SenderLock = new Object(); - - - private bool useTransactions; - private QueueClient queueClient; - private string queueName; - - public TimeSpan LockDuration { get; set; } - public long MaxSizeInMegabytes { get; set; } - public bool RequiresDuplicateDetection { get; set; } - public bool RequiresSession { get; set; } - public TimeSpan DefaultMessageTimeToLive { get; set; } - public bool EnableDeadLetteringOnMessageExpiration { get; set; } - public TimeSpan DuplicateDetectionHistoryTimeWindow { get; set; } - public int MaxDeliveryCount { get; set; } - public bool EnableBatchedOperations { get; set; } - - public MessagingFactory Factory { get; set; } - public NamespaceManager NamespaceClient { get; set; } - - public void Init(string address, bool transactional) - { - Init(Address.Parse(address), transactional); - } - - public void Init(Address address, bool transactional) - { - try - { - queueName = address.Queue; - var description = new QueueDescription(queueName) - { - LockDuration= LockDuration, - MaxSizeInMegabytes = MaxSizeInMegabytes, - RequiresDuplicateDetection = RequiresDuplicateDetection, - RequiresSession = RequiresSession, - DefaultMessageTimeToLive = DefaultMessageTimeToLive, - EnableDeadLetteringOnMessageExpiration = EnableDeadLetteringOnMessageExpiration, - DuplicateDetectionHistoryTimeWindow = DuplicateDetectionHistoryTimeWindow, - MaxDeliveryCount = MaxDeliveryCount, - EnableBatchedOperations = EnableBatchedOperations - }; - - NamespaceClient.CreateQueue(description); - } - catch (MessagingEntityAlreadyExistsException) - { - // the queue already exists, which is ok - } - - queueClient = Factory.CreateQueueClient(queueName, ReceiveMode.PeekLock); - - useTransactions = transactional; - } - - public bool HasMessage() - { - return true; - } - - public TransportMessage Receive() - { - BrokeredMessage message = null; - - try{ - message= queueClient.Receive(TimeSpan.FromSeconds(30)); - } - // back off when we're being throttled - catch (ServerBusyException) - { - Thread.Sleep(TimeSpan.FromSeconds(DefaultBackoffTimeInSeconds)); - } - - if(message != null) - { - var rawMessage = message.GetBody(); - var t = DeserializeMessage(rawMessage); - - if (!useTransactions || Transaction.Current == null) - { - try - { - message.Complete(); - } - catch (MessageLockLostException) - { - // message has been completed by another thread or worker - } - } - else - Transaction.Current.EnlistVolatile(new ReceiveResourceManager(message), EnlistmentOptions.None); - - return t; - } - return null; - } - - public void Send(TransportMessage message, string destination) - { - Send(message, Address.Parse(destination)); - } - - public void Send(TransportMessage message, Address address) - { - var destination = address.Queue; - - QueueClient sender; - if (!senders.TryGetValue(destination, out sender) ) - { - lock (SenderLock) - { - if (!senders.TryGetValue(destination, out sender) ) - { - try - { - sender = Factory.CreateQueueClient(destination); - senders[destination] = sender; - } - catch (MessagingEntityNotFoundException) - { - throw new QueueNotFoundException { Queue = Address.Parse(destination) }; - } - } - } - } - - message.Id = Guid.NewGuid().ToString(); - var rawMessage = SerializeMessage(message); - - if (Transaction.Current == null) - Send(rawMessage, sender); - else - Transaction.Current.EnlistVolatile(new SendResourceManager(() => Send(rawMessage, sender)), EnlistmentOptions.None); - - } - - private void Send(Byte[] rawMessage, QueueClient sender) - { - var numRetries = 0; - var sent = false; - - while(!sent) - { - try - { - var brokeredMessage = new BrokeredMessage(rawMessage); - - sender.Send(brokeredMessage); - - sent = true; - } - // back off when we're being throttled - catch (ServerBusyException) - { - numRetries++; - - if (numRetries >= MaxDeliveryCount) throw; - - Thread.Sleep(TimeSpan.FromSeconds(numRetries * DefaultBackoffTimeInSeconds)); - } - } - - } - - private static byte[] SerializeMessage(TransportMessage message) - { - if (message.Headers == null) - message.Headers = new Dictionary(); - - if (!message.Headers.ContainsKey(Idforcorrelation)) - message.Headers.Add(Idforcorrelation, null); - - if (String.IsNullOrEmpty(message.Headers[Idforcorrelation])) - message.Headers[Idforcorrelation] = message.IdForCorrelation; - - using (var stream = new MemoryStream()) - { - var formatter = new BinaryFormatter(); - formatter.Serialize(stream, message); - return stream.ToArray(); - } - } - - private static TransportMessage DeserializeMessage(byte[] rawMessage) - { - var formatter = new BinaryFormatter(); - - using (var stream = new MemoryStream(rawMessage)) - { - var message = formatter.Deserialize(stream) as TransportMessage; - - if (message == null) - throw new SerializationException("Failed to deserialize message"); - - message.Id = GetRealId(message.Headers) ?? message.Id; - - message.IdForCorrelation = GetIdForCorrelation(message.Headers) ?? message.Id; - - return message; - } - } - - private static string GetRealId(IDictionary headers) - { - if (headers.ContainsKey(TransportHeaderKeys.OriginalId)) - return headers[TransportHeaderKeys.OriginalId]; - - return null; - } - - private static string GetIdForCorrelation(IDictionary headers) - { - if (headers.ContainsKey(Idforcorrelation)) - return headers[Idforcorrelation]; - - return null; - } - - private const string Idforcorrelation = "CorrId"; - } -} diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/NServiceBus.Unicast.Queuing.AppFabric.csproj b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/NServiceBus.Unicast.Queuing.AppFabric.csproj deleted file mode 100644 index 0ea281aeaaf..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/NServiceBus.Unicast.Queuing.AppFabric.csproj +++ /dev/null @@ -1,90 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {911C5871-B059-4F8D-99B3-86F13CDEFC86} - Library - Properties - NServiceBus.Unicast.Queuing.AppFabric - NServiceBus.Unicast.Queuing.AppFabric - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\..\lib\Azure\Microsoft.ServiceBus.dll - - - ..\..\..\..\build\output\NServiceBus.dll - - - ..\..\..\..\build\output\NServiceBus.Core.dll - - - False - - - False - - - False - - - False - - - - False - - - False - - - False - - - False - - - False - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/Properties/AssemblyInfo.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/Properties/AssemblyInfo.cs deleted file mode 100644 index c63ad379d35..00000000000 Binary files a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/ReceiveResourceManager.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/ReceiveResourceManager.cs deleted file mode 100644 index 8032c29e08e..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/ReceiveResourceManager.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Transactions; -using Microsoft.ServiceBus.Messaging; - -namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus -{ - public class ReceiveResourceManager : IEnlistmentNotification - { - private readonly BrokeredMessage receivedMessage; - - public ReceiveResourceManager(BrokeredMessage receivedMessage) - { - this.receivedMessage = receivedMessage; - } - - public void Prepare(PreparingEnlistment preparingEnlistment) - { - preparingEnlistment.Prepared(); - } - - public void Commit(Enlistment enlistment) - { - try - { - receivedMessage.Complete(); - } - catch (MessageLockLostException) - { - // message has been completed by another thread or worker - } - - enlistment.Done(); - } - - public void Rollback(Enlistment enlistment) - { - enlistment.Done(); - } - - public void InDoubt(Enlistment enlistment) - { - enlistment.Done(); - } - - - } -} \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/SendResourceManager.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/SendResourceManager.cs deleted file mode 100644 index 380f8e36a57..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/SendResourceManager.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Transactions; - -namespace NServiceBus.Unicast.Queuing.Azure.ServiceBus -{ - public class SendResourceManager : IEnlistmentNotification - { - private readonly Action onCommit; - - public SendResourceManager(Action onCommit ) - { - this.onCommit = onCommit; - } - - public void Prepare(PreparingEnlistment preparingEnlistment) - { - preparingEnlistment.Prepared(); - } - - public void Commit(Enlistment enlistment) - { - onCommit(); - enlistment.Done(); - } - - public void Rollback(Enlistment enlistment) - { - enlistment.Done(); - } - - public void InDoubt(Enlistment enlistment) - { - enlistment.Done(); - } - } -} \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/app.config b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/app.config deleted file mode 100644 index 296f244cdf6..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/app.config +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/packages.config b/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/packages.config deleted file mode 100644 index f308d534c26..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.AppFabric/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/ConfigureAzureMessageQueue.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/ConfigureAzureMessageQueue.cs deleted file mode 100644 index 39c29295e05..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/ConfigureAzureMessageQueue.cs +++ /dev/null @@ -1,125 +0,0 @@ -using Microsoft.WindowsAzure; -using Microsoft.WindowsAzure.ServiceRuntime; -using Microsoft.WindowsAzure.StorageClient; -using NServiceBus; -using NServiceBus.Config; -using NServiceBus.Config.Conventions; -using NServiceBus.Unicast.Queuing.Azure; - -namespace NServiceBus -{ - public static class ConfigureAzureMessageQueue - { - public static Configure AzureMessageQueue(this Configure config) - { - CloudQueueClient queueClient; - - var configSection = Configure.GetConfigSection(); - - Address.InitializeAddressMode(AddressMode.Remote); - - if (configSection != null) - { - queueClient = CloudStorageAccount.Parse(configSection.ConnectionString).CreateCloudQueueClient(); - Address.OverrideDefaultMachine(configSection.ConnectionString); - } - else - { - queueClient = CloudStorageAccount.DevelopmentStorageAccount.CreateCloudQueueClient(); - Address.OverrideDefaultMachine(NServiceBus.Unicast.Queuing.Azure.AzureMessageQueue.DefaultConnectionString); - } - - config.Configurer.RegisterSingleton(queueClient); - - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance) - .ConfigureProperty(p=>p.PurgeOnStartup,ConfigurePurging.PurgeRequested); - - if (configSection != null) - { - Configure.Instance.Configurer.ConfigureProperty(t => t.PurgeOnStartup, configSection.PurgeOnStartup); - Configure.Instance.Configurer.ConfigureProperty(t => t.MaximumWaitTimeWhenIdle, configSection.MaximumWaitTimeWhenIdle); - Configure.Instance.Configurer.ConfigureProperty(t => t.MessageInvisibleTime, configSection.MessageInvisibleTime); - Configure.Instance.Configurer.ConfigureProperty(t => t.PeekInterval, configSection.PeekInterval); - } - - if (configSection != null && !string.IsNullOrEmpty(configSection.QueueName)) - { - Configure.Instance.DefineEndpointName(configSection.QueuePerInstance - ? QueueIndividualizer.Individualize(configSection.QueueName) - : configSection.QueueName); - } - else if (RoleEnvironment.IsAvailable) - { - Configure.Instance.DefineEndpointName(RoleEnvironment.CurrentRoleInstance.Role.Name); - } - Address.InitializeLocalAddress(Configure.EndpointName); - - - return config; - } - - /// - /// Sets the amount of time, in milliseconds, to add to the time to wait before checking for a new message - /// - /// - /// - /// - public static Configure PeekInterval(this Configure config, int value) - { - Configure.Instance.Configurer.ConfigureProperty(t => t.PeekInterval, value); - - return config; - } - - /// - /// Sets the maximum amount of time, in milliseconds, that the queue will wait before checking for a new message - /// - /// - /// - /// - public static Configure MaximumWaitTimeWhenIdle(this Configure config, int value) - { - Configure.Instance.Configurer.ConfigureProperty(t => t.MaximumWaitTimeWhenIdle, value); - - return config; - } - - /// - /// Controls how long messages should be invisible to other callers when receiving messages from the queue - /// - /// - /// - /// - public static Configure MessageInvisibleTime(this Configure config, int value) - { - Configure.Instance.Configurer.ConfigureProperty(t => t.MessageInvisibleTime, value); - - return config; - } - - /// - /// Controls how many messages should be read from the queue at once - /// - /// - /// - /// - public static Configure BatchSize(this Configure config, int value) - { - Configure.Instance.Configurer.ConfigureProperty(t => t.BatchSize, value); - - return config; - } - - /// - /// Configures a queue per instance - /// - /// - /// - public static Configure QueuePerInstance(this Configure config) - { - Configure.Instance.DefineEndpointName(QueueIndividualizer.Individualize(Configure.EndpointName)); - Address.InitializeLocalAddress(Configure.EndpointName); - return config; - } - } -} \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/NServiceBus.Unicast.Queuing.Azure.Config.csproj b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/NServiceBus.Unicast.Queuing.Azure.Config.csproj deleted file mode 100644 index d36c7774b36..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/NServiceBus.Unicast.Queuing.Azure.Config.csproj +++ /dev/null @@ -1,80 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {87C365D3-7D4A-4686-A042-5E7B83869CBF} - Library - Properties - NServiceBus.Unicast.Queuing.Azure.Config - NServiceBus.Unicast.Queuing.Azure.Config - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - False - ..\..\..\..\build\output\NServiceBus.dll - - - ..\..\..\..\build\output\NServiceBus.Core.dll - - - - - 3.5 - - - - - - - - - - - - {D12E0534-9C6F-4E39-AC68-4212FF13E7F1} - NServiceBus.Unicast.Queuing.Azure - - - - - - - - \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/Properties/AssemblyInfo.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/Properties/AssemblyInfo.cs deleted file mode 100644 index 185acf47bd6..00000000000 Binary files a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/QueueIndividualizer.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/QueueIndividualizer.cs deleted file mode 100644 index 54a51546837..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/QueueIndividualizer.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System.Globalization; -using Microsoft.WindowsAzure.ServiceRuntime; - -namespace NServiceBus.Config -{ - internal class QueueIndividualizer - { - public static string Individualize(string queueName) - { - var individualQueueName = queueName; - if (RoleEnvironment.IsAvailable) - { - var index = ParseIndexFrom(RoleEnvironment.CurrentRoleInstance.Id); - individualQueueName = ParseQueueNameFrom(queueName) - + (index > 0 ? "-" : "") - + (index > 0 ? index.ToString(CultureInfo.InvariantCulture) : ""); - - if (queueName.Contains("@")) - individualQueueName += "@" + ParseMachineNameFrom(queueName); - } - - return individualQueueName; - } - - private static string ParseMachineNameFrom(string inputQueue) - { - return inputQueue.Contains("@") ? inputQueue.Substring(inputQueue.IndexOf("@", System.StringComparison.Ordinal) + 1) : string.Empty; - } - - private static object ParseQueueNameFrom(string inputQueue) - { - return inputQueue.Contains("@") ? inputQueue.Substring(0, inputQueue.IndexOf("@", System.StringComparison.Ordinal)) : inputQueue; - } - - private static int ParseIndexFrom(string id) - { - var idArray = id.Split('.'); - int index; - if (!int.TryParse((idArray[idArray.Length - 1]), out index)) - { - idArray = id.Split('_'); - index = int.Parse((idArray[idArray.Length - 1])); - } - return index; - } - } -} \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/packages.config b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/packages.config deleted file mode 100644 index 1fa99cef020..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Config/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/App.config b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/App.config index d297ba480c5..d7fd54e4cff 100644 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/App.config +++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/App.config @@ -1,8 +1,8 @@ -
    +
    - + diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/AzureQueueFixture.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/AzureQueueFixture.cs index e9bba47ce42..f20a4a26d44 100644 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/AzureQueueFixture.cs +++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/AzureQueueFixture.cs @@ -1,13 +1,17 @@ -using Microsoft.WindowsAzure; -using Microsoft.WindowsAzure.StorageClient; -using NServiceBus.Unicast.Transport; using NUnit.Framework; namespace NServiceBus.Unicast.Queuing.Azure.Tests { + using System; + using MessageInterfaces.MessageMapper.Reflection; + using Microsoft.WindowsAzure.Storage; + using Microsoft.WindowsAzure.Storage.Queue; + using Serializers.Json; + public abstract class AzureQueueFixture { - protected AzureMessageQueue queue; + protected AzureMessageQueueSender sender; + protected AzureMessageQueueReceiver receiver; protected CloudQueueClient client; protected CloudQueue nativeQueue; @@ -26,20 +30,28 @@ protected virtual string QueueName public void Setup() { client = CloudStorageAccount.DevelopmentStorageAccount.CreateCloudQueueClient(); - + client.ServerTimeout = TimeSpan.FromSeconds(10); nativeQueue = client.GetQueueReference(QueueName); - nativeQueue.CreateIfNotExist(); + nativeQueue.CreateIfNotExists(); nativeQueue.Clear(); - queue = new AzureMessageQueue + sender = new AzureMessageQueueSender { - PurgeOnStartup = PurgeOnStartup, - Client = client + Client = client, + MessageSerializer = new JsonMessageSerializer(new MessageMapper()) }; - queue.Init(QueueName,true); + sender.Init(QueueName, true); + + receiver = new AzureMessageQueueReceiver + { + Client = client, + MessageSerializer = new JsonMessageSerializer(new MessageMapper()), + }; + + receiver.Init(QueueName, true); } protected void AddTestMessage() @@ -49,8 +61,7 @@ protected void AddTestMessage() protected void AddTestMessage(TransportMessage messageToAdd) { - queue.Send(messageToAdd, QueueName); + sender.Send(messageToAdd, QueueName); } - } } \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/NServiceBus.Unicast.Queuing.Azure.Tests.csproj b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/NServiceBus.Unicast.Queuing.Azure.Tests.csproj index e10b7f82ec4..5827906f3a7 100644 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/NServiceBus.Unicast.Queuing.Azure.Tests.csproj +++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/NServiceBus.Unicast.Queuing.Azure.Tests.csproj @@ -13,6 +13,8 @@ v4.0 512 + ..\..\..\..\ + true true @@ -32,56 +34,70 @@ 4 - + False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + ..\..\..\..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll - + False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + ..\..\..\..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll - + + ..\..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.1.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll - + False - ..\..\..\..\build\output\NServiceBus.dll + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - ..\..\..\..\build\output\NServiceBus.Core.dll + + ..\..\..\..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll - ..\..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll + ..\..\..\..\packages\NUnit.2.6.2\lib\nunit.framework.dll - ..\..\..\..\packages\RhinoMocks.3.6\lib\Rhino.Mocks.dll + ..\..\..\..\packages\RhinoMocks.3.6.1\lib\net\Rhino.Mocks.dll 3.5 + + + False + ..\..\..\..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + - - - {87C365D3-7D4A-4686-A042-5E7B83869CBF} - NServiceBus.Unicast.Queuing.Azure.Config + + {dd48b2d0-e996-412d-9157-821ed8b17a9d} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 - - {D12E0534-9C6F-4E39-AC68-4212FF13E7F1} - NServiceBus.Unicast.Queuing.Azure + + {12F1D9F1-0A2C-4442-8D18-67DD096C6300} + NServiceBus.Azure @@ -96,4 +112,5 @@ --> + \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/Properties/AssemblyInfo.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/Properties/AssemblyInfo.cs index ce48e2704d1..db8e6d64faf 100644 Binary files a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/Properties/AssemblyInfo.cs and b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/Properties/AssemblyInfo.cs differ diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_configuring_the_azure_queue.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_configuring_the_azure_queue.cs index ca098f0654e..d36418e6bf8 100644 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_configuring_the_azure_queue.cs +++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_configuring_the_azure_queue.cs @@ -1,17 +1,27 @@ -using Microsoft.WindowsAzure.StorageClient; using NServiceBus.Config.ConfigurationSource; using NUnit.Framework; namespace NServiceBus.Unicast.Queuing.Azure.Tests { + using Microsoft.WindowsAzure.Storage.Queue; + [TestFixture] + [Category("Azure")] public class When_configuring_the_azure_queue { + private Configure configure; + + [SetUp] + public void Setup() + { + configure = Configure.With() + .DefineEndpointName("Test") + .DefaultBuilder(); + } [Test] public void The_storage_should_default_to_dev_settings_if_no_config_section_is_found() { - Configure.With() - .DefaultBuilder() + configure .CustomConfigurationSource(new NullSource()) .AzureMessageQueue(); @@ -23,8 +33,7 @@ public void The_storage_should_default_to_dev_settings_if_no_config_section_is_f [Test] public void Storage_setting_should_be_read_from_configuration_source() { - Configure.With() - .DefaultBuilder() + configure .AzureMessageQueue(); var storage = Configure.Instance.Builder.Build(); @@ -33,13 +42,12 @@ public void Storage_setting_should_be_read_from_configuration_source() } [Test] - public void The_azurequeue_should_be_singleton() + public void The_azurequeue_should_not_be_singleton() { - Configure.With() - .DefaultBuilder() + configure .AzureMessageQueue(); - Assert.AreEqual(Configure.Instance.Builder.Build(),Configure.Instance.Builder.Build()); + Assert.AreNotEqual(Configure.Instance.Builder.Build(), Configure.Instance.Builder.Build()); } } diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_creating_a_queue.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_creating_a_queue.cs deleted file mode 100644 index 8aad16f8379..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_creating_a_queue.cs +++ /dev/null @@ -1,16 +0,0 @@ -using NUnit.Framework; - -namespace NServiceBus.Unicast.Queuing.Azure.Tests -{ - [TestFixture] - public class When_creating_a_queue:AzureQueueFixture - { - [Test] - public void A_native_azure_queue_should_be_created() - { - queue.CreateQueue(QueueName); - - Assert.True(nativeQueue.Exists()); - } - } -} \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_initializing_the_queue.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_initializing_the_queue.cs index 0170538752c..7849c2ecc6a 100644 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_initializing_the_queue.cs +++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_initializing_the_queue.cs @@ -3,9 +3,9 @@ namespace NServiceBus.Unicast.Queuing.Azure.Tests { [TestFixture] - public class When_initializing_the_queue:AzureQueueFixture + [Category("Azure")] + public class When_initializing_the_queue : AzureQueueFixture { - [Test] public void A_purge_can_be_requested() { @@ -13,11 +13,11 @@ public void A_purge_can_be_requested() AddTestMessage(); AddTestMessage(); - queue.PurgeOnStartup = true; + receiver.PurgeOnStartup = true; - queue.Init(QueueName,false); + receiver.Init(QueueName, false); - Assert.Null(queue.Receive()); + Assert.Null(receiver.Receive()); } } } \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_receiving_messages.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_receiving_messages.cs index fc658c04eb7..02b4b19b25d 100644 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_receiving_messages.cs +++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_receiving_messages.cs @@ -4,44 +4,35 @@ using System.Runtime.Serialization.Formatters.Binary; using System.Threading; using System.Transactions; -using Microsoft.WindowsAzure.StorageClient; -using NServiceBus.Unicast.Transport; using NUnit.Framework; namespace NServiceBus.Unicast.Queuing.Azure.Tests { + using Microsoft.WindowsAzure.Storage.Queue; + [TestFixture] + [Category("Azure")] public class When_receiving_messages : AzureQueueFixture { - [Test] - public void Has_messages_should_indicate_if_messages_exists_int_the_queue() - { - Assert.False(queue.HasMessage()); - - - AddTestMessage(); - - Assert.True(queue.HasMessage()); - - } + [Test] public void Should_throw_if_non_nservicebus_messages_are_received() { nativeQueue.AddMessage(new CloudQueueMessage("whatever")); - Assert.Throws(() => queue.Receive()); + Assert.Throws(() => receiver.Receive()); } [Test] public void Should_default_to_non_transactionable_if_no_ambient_transaction_exists() { AddTestMessage(); - queue.MessageInvisibleTime = 1; + receiver.MessageInvisibleTime = 1; - Assert.NotNull(queue.Receive()); + Assert.NotNull(receiver.Receive()); Thread.Sleep(1000); - Assert.Null(queue.Receive()); + Assert.Null(receiver.Receive()); } [Test] @@ -49,17 +40,17 @@ public void Messages_should_not_reapper_in_the_queue_if_transaction_is_committed { AddTestMessage(); - queue.MessageInvisibleTime = 1; + receiver.MessageInvisibleTime = 1; using (var scope = new TransactionScope()) { - Assert.NotNull(queue.Receive()); + Assert.NotNull(receiver.Receive()); scope.Complete(); } Thread.Sleep(1000); - Assert.Null(queue.Receive()); + Assert.Null(receiver.Receive()); } [Test] @@ -67,16 +58,16 @@ public void The_received_message_should_reappear_in_the_queue_if_transaction_is_ { AddTestMessage(); - queue.MessageInvisibleTime = 2; + receiver.MessageInvisibleTime = 2; using (new TransactionScope()) { - Assert.NotNull(queue.Receive()); + Assert.NotNull(receiver.Receive()); //rollback } Thread.Sleep(1000); - - Assert.NotNull(queue.Receive()); + + Assert.NotNull(receiver.Receive()); } [Test] @@ -84,13 +75,13 @@ public void Received_messages_should_be_removed_from_the_queue() { AddTestMessage(); - queue.MessageInvisibleTime = 1; + receiver.MessageInvisibleTime = 1; - queue.Receive(); + receiver.Receive(); Thread.Sleep(1000); - Assert.Null(queue.Receive()); + Assert.Null(receiver.Receive()); } [Test] @@ -98,7 +89,7 @@ public void Send_messages_without_body_should_be_ok() { AddTestMessage(); - var message = queue.Receive(); + var message = receiver.Receive(); Assert.Null(message.Body); } @@ -121,12 +112,11 @@ public void All_properties_should_be_preserved() //Id = "11111", Recoverable = true, ReplyToAddress= Address.Parse("response"), - TimeSent = DateTime.Now, TimeToBeReceived = TimeSpan.FromHours(1) }; AddTestMessage(original); - var result = queue.Receive(); + var result = receiver.Receive(); var resultMessage = formatter.Deserialize(new MemoryStream(result.Body)) as TestMessage; Assert.AreEqual(resultMessage.TestProperty,"Test"); @@ -137,7 +127,6 @@ public void All_properties_should_be_preserved() Assert.NotNull(result.Id); Assert.AreEqual(result.Recoverable,original.Recoverable); Assert.AreEqual(result.ReplyToAddress,original.ReplyToAddress); - Assert.AreEqual(result.TimeSent,original.TimeSent); Assert.AreEqual(result.TimeToBeReceived,original.TimeToBeReceived); } diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_sending_messages.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_sending_messages.cs index 4be3a96c244..f2037b34aab 100644 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_sending_messages.cs +++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/When_sending_messages.cs @@ -1,11 +1,12 @@ using System.Transactions; -using Microsoft.WindowsAzure.StorageClient; -using NServiceBus.Unicast.Transport; using NUnit.Framework; namespace NServiceBus.Unicast.Queuing.Azure.Tests { + using Microsoft.WindowsAzure.Storage.Queue; + [TestFixture] + [Category("Azure")] public class When_sending_messages : AzureQueueFixture { const string destinationQueueName = "destination"; @@ -16,7 +17,7 @@ public void Should_not_appear_at_destination_if_transaction_rollbacks() var destinationQueue = GetDestinationQueue(); using (new TransactionScope()) { - queue.Send(new TransportMessage(), destinationQueueName); + sender.Send(new TransportMessage(), destinationQueueName); } Assert.Null(destinationQueue.GetMessage()); } @@ -25,7 +26,7 @@ private CloudQueue GetDestinationQueue() { var destinationQueue = client.GetQueueReference(destinationQueueName); - destinationQueue.CreateIfNotExist(); + destinationQueue.CreateIfNotExists(); destinationQueue.Clear(); return destinationQueue; @@ -36,7 +37,7 @@ public void The_message_should_appear_in_the_destination_queue() { var destinationQueue = GetDestinationQueue(); - queue.Send(new TransportMessage(), destinationQueueName); + sender.Send(new TransportMessage(), destinationQueueName); Assert.NotNull(destinationQueue.GetMessage()); } @@ -47,14 +48,14 @@ public void The_message_id_should_be_updated_with_the_native_id() GetDestinationQueue(); var message = new TransportMessage(); - queue.Send(message, destinationQueueName); + sender.Send(message, destinationQueueName); Assert.NotNull(message.Id); } [Test] public void A_QueueNotFoundException_should_be_thrown_if_the_desitnation_queue_does_not_exists() { - Assert.Throws(() => queue.Send(new TransportMessage(), "whatever")); + Assert.Throws(() => sender.Send(new TransportMessage(), "whatever")); } } } \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/packages.config b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/packages.config index e747499f914..b95cb7c4fcd 100644 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/packages.config +++ b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure.Tests/packages.config @@ -1,5 +1,10 @@  - - + + + + + + + \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/AzureMessageQueue.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/AzureMessageQueue.cs deleted file mode 100644 index d325cad92a3..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/AzureMessageQueue.cs +++ /dev/null @@ -1,324 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.Serialization; -using System.Threading; -using System.Transactions; -using Microsoft.WindowsAzure; -using Microsoft.WindowsAzure.StorageClient; -using NServiceBus.Serialization; -using NServiceBus.Unicast.Transport; - -namespace NServiceBus.Unicast.Queuing.Azure -{ - public class AzureMessageQueue : IReceiveMessages,ISendMessages - { - public const int DefaultMessageInvisibleTime = 30000; - public const int DefaultPeekInterval = 50; - public const int DefaultMaximumWaitTimeWhenIdle = 1000; - public const int DefaultBatchSize = 10; - public const bool DefaultPurgeOnStartup = false; - public const string DefaultConnectionString = "UseDevelopmentStorage=true"; - public const bool DefaultQueuePerInstance = false; - - private CloudQueue queue; - private int timeToDelayNextPeek; - private readonly Queue messages = new Queue(); - private readonly Dictionary destinationQueueClients = new Dictionary(); - - /// - /// Sets the amount of time, in milliseconds, to add to the time to wait before checking for a new message - /// - public int PeekInterval{ get; set; } - - /// - /// Sets the maximum amount of time, in milliseconds, that the queue will wait before checking for a new message - /// - public int MaximumWaitTimeWhenIdle { get; set; } - - /// - /// Sets whether or not the transport should purge the input - /// queue when it is started. - /// - public bool PurgeOnStartup { get; set; } - - /// - /// Controls how long messages should be invisible to other callers when receiving messages from the queue - /// - public int MessageInvisibleTime { get; set; } - - /// - /// Controls the number of messages that will be read in bulk from the queue - /// - public int BatchSize { get; set; } - - /// - /// Gets or sets the message serializer - /// - public IMessageSerializer MessageSerializer { get; set; } - - public CloudQueueClient Client { get; set; } - - public AzureMessageQueue() - { - MessageInvisibleTime = DefaultMessageInvisibleTime; - PeekInterval = DefaultPeekInterval; - MaximumWaitTimeWhenIdle = DefaultMaximumWaitTimeWhenIdle; - BatchSize = DefaultBatchSize; - } - - public void Init(string address, bool transactional) - { - Init(Address.Parse(address), transactional); - } - - public void Init(Address address, bool transactional) - { - useTransactions = transactional; - queue = Client.GetQueueReference(SanitizeQueueName(address.Queue)); - queue.CreateIfNotExist(); - - if (PurgeOnStartup) - queue.Clear(); - } - - public void Send(TransportMessage message, string destination) - { - Send(message, Address.Parse(destination)); - } - - public void Send(TransportMessage message, Address address) - { - var sendClient = GetClientForConnectionString(address.Machine) ?? Client; - - var sendQueue = sendClient.GetQueueReference(SanitizeQueueName(address.Queue)); - - if (!sendQueue.Exists()) - throw new QueueNotFoundException(); - - if(string.IsNullOrEmpty(message.Id)) message.Id = Guid.NewGuid().ToString(); - - var rawMessage = SerializeMessage(message); - - if (Transaction.Current == null) - { - sendQueue.AddMessage(rawMessage); - } - else - Transaction.Current.EnlistVolatile(new SendResourceManager(sendQueue, rawMessage), EnlistmentOptions.None); - } - - private CloudQueueClient GetClientForConnectionString(string connectionString) - { - CloudQueueClient sendClient; - - if (!destinationQueueClients.TryGetValue(connectionString, out sendClient)) - { - lock (SenderLock) - { - if (!destinationQueueClients.TryGetValue(connectionString, out sendClient)) - { - CloudStorageAccount account; - - if (CloudStorageAccount.TryParse(connectionString, out account)) - { - sendClient = account.CreateCloudQueueClient(); - } - - // sendClient could be null, this is intentional - // so that it remembers a connectionstring was invald - // and doesn't try to parse it again. - - destinationQueueClients.Add(connectionString, sendClient); - } - } - } - - return sendClient; - } - - public bool HasMessage() - { - if (messages.Count > 0) return true; - - var hasMessage = queue.PeekMessage() != null; - - DelayNextPeekWhenThereIsNoMessage(hasMessage); - - return hasMessage; - } - - private void DelayNextPeekWhenThereIsNoMessage(bool hasMessage) - { - if (hasMessage) - { - timeToDelayNextPeek = 0; - } - else - { - if (timeToDelayNextPeek < MaximumWaitTimeWhenIdle) timeToDelayNextPeek += PeekInterval; - - Thread.Sleep(timeToDelayNextPeek); - } - } - - public TransportMessage Receive() - { - var rawMessage = GetMessage(); - - if (rawMessage == null) - return null; - - return DeserializeMessage(rawMessage); - } - - private CloudQueueMessage GetMessage() - { - if (messages.Count == 0) - { - var receivedMessages = queue.GetMessages(BatchSize, TimeSpan.FromMilliseconds(MessageInvisibleTime * BatchSize)); - - foreach(var receivedMessage in receivedMessages) - { - if (!useTransactions || Transaction.Current == null) - DeleteMessage(receivedMessage); - else - Transaction.Current.EnlistVolatile(new ReceiveResourceManager(queue, receivedMessage), - EnlistmentOptions.None); - - messages.Enqueue(receivedMessage); - } - } - - return messages.Count != 0 ? messages.Dequeue() : null; - } - - private void DeleteMessage(CloudQueueMessage message) - { - try - { - queue.DeleteMessage(message); - } - catch (StorageClientException ex) - { - if (ex.ErrorCode != StorageErrorCode.ResourceNotFound ) throw; - } - } - - private CloudQueueMessage SerializeMessage(TransportMessage message) - { - using (var stream = new MemoryStream()) - { - - if (message.Headers == null) - message.Headers = new Dictionary(); - - if (!message.Headers.ContainsKey(Idforcorrelation)) - message.Headers.Add(Idforcorrelation, null); - - if (String.IsNullOrEmpty(message.Headers[Idforcorrelation])) - message.Headers[Idforcorrelation] = message.IdForCorrelation; - - var toSend = new MessageWrapper - { - Id = message.Id, - Body = message.Body, - CorrelationId = message.CorrelationId, - Recoverable = message.Recoverable, - ReplyToAddress = message.ReplyToAddress.ToString(), - TimeToBeReceived = message.TimeToBeReceived, - Headers = message.Headers, - MessageIntent = message.MessageIntent, - TimeSent = message.TimeSent, - IdForCorrelation = message.IdForCorrelation - }; - - - MessageSerializer.Serialize(new IMessage[] { toSend }, stream); - return new CloudQueueMessage(stream.ToArray()); - } - } - - private TransportMessage DeserializeMessage(CloudQueueMessage rawMessage) - { - using (var stream = new MemoryStream(rawMessage.AsBytes)) - { - var m = MessageSerializer.Deserialize(stream).FirstOrDefault() as MessageWrapper; - - if (m == null) - throw new SerializationException("Failed to deserialize message with id: " + rawMessage.Id); - - var message = new TransportMessage - { - Id = m.Id, - Body = m.Body, - CorrelationId = m.CorrelationId, - Recoverable = m.Recoverable, - ReplyToAddress = Address.Parse(m.ReplyToAddress), - TimeToBeReceived = m.TimeToBeReceived, - Headers = m.Headers, - MessageIntent = m.MessageIntent, - TimeSent = m.TimeSent, - IdForCorrelation = m.IdForCorrelation - }; - - message.Id = GetRealId(message.Headers) ?? message.Id; - - message.IdForCorrelation = GetIdForCorrelation(message.Headers) ?? message.Id; - - return message; - } - } - - public void CreateQueue(string queueName) - { - Client.GetQueueReference(SanitizeQueueName(queueName)).CreateIfNotExist(); - } - - private string SanitizeQueueName(string queueName) - { - // The auto queue name generation uses namespaces which includes dots, - // yet dots are not supported in azure storage names - // that's why we replace them here. - - return queueName.Replace('.', '-'); - } - - private static string GetRealId(IDictionary headers) - { - if (headers.ContainsKey(TransportHeaderKeys.OriginalId)) - return headers[TransportHeaderKeys.OriginalId]; - - return null; - } - - private static string GetIdForCorrelation(IDictionary headers) - { - if (headers.ContainsKey(Idforcorrelation)) - return headers[Idforcorrelation]; - - return null; - } - - private bool useTransactions; - private const string Idforcorrelation = "CorrId"; - private static readonly object SenderLock = new Object(); - - } - - [Serializable] - internal class MessageWrapper : IMessage - { - public string IdForCorrelation { get; set; } - public DateTime TimeSent { get; set; } - public string Id { get; set; } - public MessageIntentEnum MessageIntent { get; set; } - public string ReplyToAddress { get; set; } - public TimeSpan TimeToBeReceived { get; set; } - public Dictionary Headers { get; set; } - public byte[] Body { get; set; } - public string CorrelationId { get; set; } - public bool Recoverable { get; set; } - } -} \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/NServiceBus.Unicast.Queuing.Azure.csproj b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/NServiceBus.Unicast.Queuing.Azure.csproj deleted file mode 100644 index 529dbe386e5..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/NServiceBus.Unicast.Queuing.Azure.csproj +++ /dev/null @@ -1,79 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D12E0534-9C6F-4E39-AC68-4212FF13E7F1} - Library - Properties - NServiceBus.Unicast.Queuing.Azure - NServiceBus.Unicast.Queuing.Azure - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - False - ..\..\..\..\build\output\NServiceBus.dll - - - ..\..\..\..\build\output\NServiceBus.Core.dll - - - - - 3.5 - - - - - 3.5 - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/Properties/AssemblyInfo.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/Properties/AssemblyInfo.cs deleted file mode 100644 index 2c501926e70..00000000000 Binary files a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/ReceiveResourceManager.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/ReceiveResourceManager.cs deleted file mode 100644 index 77a5103c322..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/ReceiveResourceManager.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Transactions; -using Microsoft.WindowsAzure.StorageClient; - -namespace NServiceBus.Unicast.Queuing.Azure -{ - public class ReceiveResourceManager : IEnlistmentNotification - { - private readonly CloudQueue queue; - private readonly CloudQueueMessage receivedMessage; - - public ReceiveResourceManager(CloudQueue queue, CloudQueueMessage receivedMessage) - { - this.queue = queue; - this.receivedMessage = receivedMessage; - } - - public void Prepare(PreparingEnlistment preparingEnlistment) - { - preparingEnlistment.Prepared(); - } - - public void Commit(Enlistment enlistment) - { - try - { - queue.DeleteMessage(receivedMessage); - } - catch (StorageClientException ex) - { - if (ex.ErrorCode != StorageErrorCode.ResourceNotFound ) throw; - } - - enlistment.Done(); - } - - public void Rollback(Enlistment enlistment) - { - enlistment.Done(); - } - - public void InDoubt(Enlistment enlistment) - { - enlistment.Done(); - } - - - } -} \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/SendResourceManager.cs b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/SendResourceManager.cs deleted file mode 100644 index c017c2d624a..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/SendResourceManager.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Transactions; -using Microsoft.WindowsAzure.StorageClient; - -namespace NServiceBus.Unicast.Queuing.Azure -{ - public class SendResourceManager : IEnlistmentNotification - { - private readonly CloudQueue queue; - private readonly CloudQueueMessage message; - - public SendResourceManager(CloudQueue queue, CloudQueueMessage message) - { - this.queue = queue; - this.message = message; - } - - public void Prepare(PreparingEnlistment preparingEnlistment) - { - preparingEnlistment.Prepared(); - } - - public void Commit(Enlistment enlistment) - { - queue.AddMessage(message); - enlistment.Done(); - } - - public void Rollback(Enlistment enlistment) - { - enlistment.Done(); - } - - public void InDoubt(Enlistment enlistment) - { - enlistment.Done(); - } - } -} \ No newline at end of file diff --git a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/packages.config b/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/packages.config deleted file mode 100644 index 1fa99cef020..00000000000 --- a/src/azure/Queueing/NServiceBus.Unicast.Queuing.Azure/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/azure/Queueing/queuing.sln b/src/azure/Queueing/queuing.sln deleted file mode 100644 index 4720fbd4320..00000000000 --- a/src/azure/Queueing/queuing.sln +++ /dev/null @@ -1,55 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Storage", "Storage", "{A46EEB01-F4EE-4842-9B23-2EA81EA82114}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AppFabric", "AppFabric", "{AADC7038-53DD-416B-8DEC-3FDA4D15DAED}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing.Azure", "NServiceBus.Unicast.Queuing.Azure\NServiceBus.Unicast.Queuing.Azure.csproj", "{D12E0534-9C6F-4E39-AC68-4212FF13E7F1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing.Azure.Config", "NServiceBus.Unicast.Queuing.Azure.Config\NServiceBus.Unicast.Queuing.Azure.Config.csproj", "{87C365D3-7D4A-4686-A042-5E7B83869CBF}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing.Azure.Tests", "NServiceBus.Unicast.Queuing.Azure.Tests\NServiceBus.Unicast.Queuing.Azure.Tests.csproj", "{D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing.AppFabric", "NServiceBus.Unicast.Queuing.AppFabric\NServiceBus.Unicast.Queuing.AppFabric.csproj", "{911C5871-B059-4F8D-99B3-86F13CDEFC86}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Queuing.AppFabric.Config", "NServiceBus.Unicast.Queuing.AppFabric.Config\NServiceBus.Unicast.Queuing.AppFabric.Config.csproj", "{350CA11F-E647-47F6-B9A3-1E1653B8D4B0}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D12E0534-9C6F-4E39-AC68-4212FF13E7F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D12E0534-9C6F-4E39-AC68-4212FF13E7F1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D12E0534-9C6F-4E39-AC68-4212FF13E7F1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D12E0534-9C6F-4E39-AC68-4212FF13E7F1}.Release|Any CPU.Build.0 = Release|Any CPU - {87C365D3-7D4A-4686-A042-5E7B83869CBF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {87C365D3-7D4A-4686-A042-5E7B83869CBF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {87C365D3-7D4A-4686-A042-5E7B83869CBF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {87C365D3-7D4A-4686-A042-5E7B83869CBF}.Release|Any CPU.Build.0 = Release|Any CPU - {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD}.Release|Any CPU.Build.0 = Release|Any CPU - {911C5871-B059-4F8D-99B3-86F13CDEFC86}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {911C5871-B059-4F8D-99B3-86F13CDEFC86}.Debug|Any CPU.Build.0 = Debug|Any CPU - {911C5871-B059-4F8D-99B3-86F13CDEFC86}.Release|Any CPU.ActiveCfg = Release|Any CPU - {911C5871-B059-4F8D-99B3-86F13CDEFC86}.Release|Any CPU.Build.0 = Release|Any CPU - {350CA11F-E647-47F6-B9A3-1E1653B8D4B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {350CA11F-E647-47F6-B9A3-1E1653B8D4B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {350CA11F-E647-47F6-B9A3-1E1653B8D4B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {350CA11F-E647-47F6-B9A3-1E1653B8D4B0}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {D12E0534-9C6F-4E39-AC68-4212FF13E7F1} = {A46EEB01-F4EE-4842-9B23-2EA81EA82114} - {87C365D3-7D4A-4686-A042-5E7B83869CBF} = {A46EEB01-F4EE-4842-9B23-2EA81EA82114} - {D917D6B0-53F0-4D21-BCBD-35BFE19FB4FD} = {A46EEB01-F4EE-4842-9B23-2EA81EA82114} - {911C5871-B059-4F8D-99B3-86F13CDEFC86} = {AADC7038-53DD-416B-8DEC-3FDA4D15DAED} - {350CA11F-E647-47F6-B9A3-1E1653B8D4B0} = {AADC7038-53DD-416B-8DEC-3FDA4D15DAED} - EndGlobalSection -EndGlobal diff --git a/src/azure/SagaPersister/NServiceBus.Azure.SagaPersister.sln b/src/azure/SagaPersister/NServiceBus.Azure.SagaPersister.sln deleted file mode 100644 index ddf149e1085..00000000000 --- a/src/azure/SagaPersister/NServiceBus.Azure.SagaPersister.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.SagaPersisters.Azure.Config", "NServiceBus.SagaPersisters.Azure.Config\NServiceBus.SagaPersisters.Azure.Config.csproj", "{E9BCCCDC-5D5D-48AB-BF7A-5A2FE669D353}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E9BCCCDC-5D5D-48AB-BF7A-5A2FE669D353}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E9BCCCDC-5D5D-48AB-BF7A-5A2FE669D353}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E9BCCCDC-5D5D-48AB-BF7A-5A2FE669D353}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E9BCCCDC-5D5D-48AB-BF7A-5A2FE669D353}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/ConfigureAzureSagaPersister.cs b/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/ConfigureAzureSagaPersister.cs deleted file mode 100644 index 87dad5880eb..00000000000 --- a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/ConfigureAzureSagaPersister.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using NHibernate; -using NHibernate.Drivers.Azure.TableStorage; -using NServiceBus.Config; -using NServiceBus.ObjectBuilder; -using NServiceBus.SagaPersisters.NHibernate; -using NServiceBus.SagaPersisters.Azure.Config.Internal; - -namespace NServiceBus -{ - /// - /// Contains extension methods to NServiceBus.Configure for the NHibernate saga persister on top of Azure table storage. - /// - public static class ConfigureAzureSagaPersister - { - /// - /// Use the NHibernate backed saga persister implementation. - /// Be aware that this implementation deletes sagas that complete so as not to have the database fill up. - /// SagaData classes are automatically mapped using Fluent NHibernate Conventions. - /// - /// - /// - public static Configure AzureSagaPersister(this Configure config) - { - string connectionstring = string.Empty; - bool updateSchema = false; - - var configSection = Configure.GetConfigSection(); - - if (configSection != null) - { - connectionstring = configSection.ConnectionString; - updateSchema = configSection.CreateSchema; - } - - return AzureSagaPersister(config, connectionstring, updateSchema); - } - - /// - /// Use the NHibernate backed saga persister implementation on top of Azure table storage. - /// SagaData classes are automatically mapped using Fluent NHibernate conventions - /// and there persistence schema is automatically generated if requested. - /// - /// - /// - /// - /// - public static Configure AzureSagaPersister(this Configure config, - string connectionString, - bool autoUpdateSchema) - { - if (!Sagas.Impl.Configure.SagasWereFound) - return config; //no sagas - don't need to do anything - - var nhibernateProperties = MsSqlConfiguration.Azure(connectionString); - - var builder = new SessionFactoryBuilder(Configure.TypesToScan); - - var sessionFactory = builder.Build(nhibernateProperties, autoUpdateSchema); - - if (sessionFactory == null) - throw new InvalidOperationException("Could not create session factory for saga persistence."); - - config.Configurer.RegisterSingleton(sessionFactory); - config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); - - return config; - } - } -} diff --git a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/BaseImmutableUserType.cs b/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/BaseImmutableUserType.cs deleted file mode 100644 index ab64e1e8902..00000000000 --- a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/BaseImmutableUserType.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Data; -using NHibernate.SqlTypes; -using NHibernate.UserTypes; - -namespace NServiceBus.SagaPersisters.Azure.Config.Internal -{ - public abstract class BaseImmutableUserType : IUserType - { - public abstract object NullSafeGet(IDataReader rs, string[] names, object owner); - public abstract void NullSafeSet(IDbCommand cmd, object value, int index); - public abstract SqlType[] SqlTypes { get; } - - public new bool Equals(object x, object y) - { - if (ReferenceEquals(x, y)) - { - return true; - } - - if (x == null || y == null) - { - return false; - } - - return x.Equals(y); - } - - public int GetHashCode(object x) - { - return x.GetHashCode(); - } - - public object DeepCopy(object value) - { - return value; - } - - public object Replace(object original, object target, object owner) - { - return original; - } - - public object Assemble(object cached, object owner) - { - return DeepCopy(cached); - } - - public object Disassemble(object value) - { - return DeepCopy(value); - } - - public Type ReturnedType - { - get { return typeof(T); } - } - - public bool IsMutable - { - get { return false; } - } - } -} \ No newline at end of file diff --git a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/MsSqlConfiguration.cs b/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/MsSqlConfiguration.cs deleted file mode 100644 index 9b8607b5f32..00000000000 --- a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/MsSqlConfiguration.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections.Generic; -using NHibernate.Cfg; -using NHibernate.Drivers.Azure.TableStorage; - -namespace NServiceBus.SagaPersisters.Azure.Config.Internal -{ - public static class MsSqlConfiguration - { - public static IDictionary Azure(string connectionString) - { - return new Dictionary - { - { Environment.ConnectionProvider, typeof(TableStorageConnectionProvider).AssemblyQualifiedName }, - { Environment.ConnectionDriver, typeof(TableStorageDriver).AssemblyQualifiedName }, - { Environment.Dialect, typeof(TableStorageDialect).AssemblyQualifiedName }, - { Environment.ConnectionString, connectionString }, - }; - } - } -} \ No newline at end of file diff --git a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/SessionFactoryBuilder.cs b/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/SessionFactoryBuilder.cs deleted file mode 100644 index 7a16d53e1ba..00000000000 --- a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/SessionFactoryBuilder.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Globalization; -using System.Linq; -using System.Reflection; -using NHibernate; -using NHibernate.Context; -using NHibernate.Drivers.Azure.TableStorage.Mapping; -using NHibernate.Mapping.ByCode; -using NHibernate.Tool.hbm2ddl; -using NServiceBus.SagaPersisters.NHibernate.AutoPersistence; -using Configuration=NHibernate.Cfg.Configuration; - -namespace NServiceBus.SagaPersisters.Azure.Config.Internal -{ - /// - /// Builder class for the NHibernate Session Factory - /// - public class SessionFactoryBuilder - { - private readonly IEnumerable typesToScan; - - /// - /// Constructor that accepts the types to scan for saga data classes - /// - /// - public SessionFactoryBuilder(IEnumerable typesToScan) - { - this.typesToScan = typesToScan; - } - - /// - /// Builds the session factory with the given properties. Database is updated if updateSchema is set - /// - /// - /// - /// - public ISessionFactory Build(IDictionary nhibernateProperties, bool updateSchema) - { - var scannedAssemblies = typesToScan.Select(t => t.Assembly).Distinct(); - - var nhibernateConfiguration = new Configuration().SetProperties(nhibernateProperties); - - foreach (var assembly in scannedAssemblies) - nhibernateConfiguration.AddAssembly(assembly); - - var mapping = new SagaModelMapper(typesToScan.Except(nhibernateConfiguration.ClassMappings.Select(x => x.MappedClass))); - - ApplyConventions(mapping); - - nhibernateConfiguration.AddMapping(mapping.Compile()); - - ApplyDefaultsTo(nhibernateConfiguration); - - if (updateSchema) - UpdateDatabaseSchemaUsing(nhibernateConfiguration); - - try - { - return nhibernateConfiguration.BuildSessionFactory(); - } - catch (Exception e) - { - if (e.InnerException != null) - throw new ConfigurationErrorsException(e.InnerException.Message, e); - - throw; - } - } - - private static void ApplyConventions(SagaModelMapper hbmMapping) - { - var hbmIdField = typeof(global::NHibernate.Mapping.ByCode.Impl.IdMapper).GetField("hbmId", BindingFlags.Instance | BindingFlags.NonPublic); - - hbmMapping.Mapper.AfterMapClass += (mi, t, map) => - { - map.Id(idmap => - { - var hbmId = (global::NHibernate.Cfg.MappingSchema.HbmId)hbmIdField.GetValue(idmap); - hbmId.type1 = typeof(GuidToPartitionKeyAndRowKey).AssemblyQualifiedName; - hbmId.type = null; - hbmId.column1 = null; - hbmId.column = new[] - { - new global::NHibernate.Cfg.MappingSchema.HbmColumn {name = "RowKey"}, - new global::NHibernate.Cfg.MappingSchema.HbmColumn {name = "PartitionKey"}, - }; - }); - }; - - hbmMapping.Mapper.AfterMapManyToOne += (mi, type, map) => MapIdColumns(map, type.LocalMember); - hbmMapping.Mapper.AfterMapBag += (mi, type, map) => map.Key(km => MapIdColumns(km, type.LocalMember)); - hbmMapping.Mapper.AfterMapJoinedSubclass += (mi, type, map) => map.Key(km => MapIdColumns(km, type.BaseType)); - - hbmMapping.Mapper.BeforeMapProperty += (mi, type, map) => { - var info = type.LocalMember as PropertyInfo; - if (info != null && info.PropertyType == typeof(DateTime)) map.Type(); - }; - } - - private static void MapIdColumns(IColumnsMapper map, MemberInfo type) - { - map.Columns(cm => cm.Name(type.Name + "_RowKey"), - cm => cm.Name(type.Name + "_PartitionKey")); - } - - private static void UpdateDatabaseSchemaUsing(Configuration configuration) - { - new SchemaUpdate(configuration) - .Execute(false, true); - } - - private static void ApplyDefaultsTo(Configuration configuration) - { - configuration.SetProperty("current_session_context_class", typeof(ThreadStaticSessionContext).AssemblyQualifiedName); - } - } -} \ No newline at end of file diff --git a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/UtcDateTimeUserType.cs b/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/UtcDateTimeUserType.cs deleted file mode 100644 index 1d50fb0af3b..00000000000 --- a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Internal/UtcDateTimeUserType.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Data; -using System.Globalization; -using NHibernate; -using NHibernate.SqlTypes; - -namespace NServiceBus.SagaPersisters.Azure.Config.Internal -{ - - public class UtcDateTimeUserType : BaseImmutableUserType - { - public override object NullSafeGet(IDataReader rs, string[] names, object owner) - { - var value = (string) NHibernateUtil.String.NullSafeGet(rs, names[0]); - var date = DateTime.SpecifyKind(DateTime.Parse(value, CultureInfo.InvariantCulture, DateTimeStyles.AdjustToUniversal), DateTimeKind.Utc); - return date; - } - - public override void NullSafeSet(IDbCommand cmd, object value, int index) - { - var date = ((DateTime)value).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); - NHibernateUtil.String.NullSafeSet(cmd, date, index); - } - - public override SqlType[] SqlTypes - { - get { return new [] { SqlTypeFactory.DateTime }; } - } - } -} \ No newline at end of file diff --git a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/NServiceBus.SagaPersisters.Azure.Config.csproj b/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/NServiceBus.SagaPersisters.Azure.Config.csproj deleted file mode 100644 index 37decdb4c7e..00000000000 --- a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/NServiceBus.SagaPersisters.Azure.Config.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {E9BCCCDC-5D5D-48AB-BF7A-5A2FE669D353} - Library - Properties - NServiceBus.SagaPersisters.Azure.Config - NServiceBus.SagaPersisters.Azure.Config - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\..\packages\Common.Logging.2.0.0\lib\2.0\Common.Logging.dll - - - ..\..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - ..\..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\..\build\output\NServiceBus.dll - - - ..\..\..\..\build\output\NServiceBus.Core.dll - - - ..\..\..\..\build\output\NServiceBus.NHibernate.dll - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Properties/AssemblyInfo.cs b/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Properties/AssemblyInfo.cs deleted file mode 100644 index c1f989797f8..00000000000 Binary files a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/packages.config b/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/packages.config deleted file mode 100644 index 03af46c2170..00000000000 --- a/src/azure/SagaPersister/NServiceBus.SagaPersisters.Azure.Config/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/azure/SubscriptionStorage/Config/ConfigureNHibernateAzureSubscriptionStorage.cs b/src/azure/SubscriptionStorage/Config/ConfigureNHibernateAzureSubscriptionStorage.cs deleted file mode 100644 index 5ea601ff60e..00000000000 --- a/src/azure/SubscriptionStorage/Config/ConfigureNHibernateAzureSubscriptionStorage.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Reflection; -using NHibernate.Cfg; -using NHibernate.Cfg.MappingSchema; -using NHibernate.Mapping.ByCode; -using NHibernate.Tool.hbm2ddl; -using NServiceBus.ObjectBuilder; -using NServiceBus.Unicast.Subscriptions.Azure.TableStorage; -using NServiceBus.Unicast.Subscriptions.Azure.TableStorage.Config; -using NHibernate.Drivers.Azure.TableStorage; -using NServiceBus.Config; - -namespace NServiceBus -{ - /// - /// Configuration extensions for the NHibernate subscription storage - /// - public static class ConfigureNHibernateAzureSubscriptionStorage - { - /// - /// Configures NHibernate Azure Subscription Storage , Settings etc are read from custom config section - /// - /// - /// - public static Configure AzureSubcriptionStorage(this Configure config) - { - - var configSection = Configure.GetConfigSection(); - - if (configSection == null) - { - throw new InvalidOperationException("No configuration section for NHibernate Azure Subscription Storage found. Please add a NHibernateAzureSubscriptionStorageConfig section to you configuration file"); - } - - return AzureSubcriptionStorage(config, configSection.ConnectionString, configSection.CreateSchema, configSection.TableName); - } - - /// - /// Configures the storage with the user supplied persistence configuration - /// Azure tables are created if requested by the user - /// - /// - /// - /// - /// - public static Configure AzureSubcriptionStorage(this Configure config, - string connectionString, - bool createSchema, - string tableName) - { - - var cfg = new Configuration() - .DataBaseIntegration(x => - { - x.ConnectionString = connectionString; - x.ConnectionProvider(); - x.Dialect(); - x.Driver(); - }); - - SubscriptionMap.TableName = tableName; - - var mapper = new ModelMapper(); - mapper.AddMappings(Assembly.GetExecutingAssembly().GetExportedTypes()); - var faultMappings = mapper.CompileMappingForAllExplicitlyAddedEntities(); - - cfg.AddMapping(faultMappings); - - if (createSchema) - { - new SchemaExport(cfg).Execute(true, true, false); - } - - var sessionSource = new SubscriptionStorageSessionProvider(cfg.BuildSessionFactory()); - - config.Configurer.RegisterSingleton(sessionSource); - - config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); - - return config; - - } - } -} \ No newline at end of file diff --git a/src/azure/SubscriptionStorage/Config/SubscriptionMap.cs b/src/azure/SubscriptionStorage/Config/SubscriptionMap.cs deleted file mode 100644 index 933653a0509..00000000000 --- a/src/azure/SubscriptionStorage/Config/SubscriptionMap.cs +++ /dev/null @@ -1,19 +0,0 @@ -using NHibernate.Mapping.ByCode.Conformist; - -namespace NServiceBus.Unicast.Subscriptions.Azure.TableStorage.Config -{ - public sealed class SubscriptionMap : ClassMapping - { - public static string TableName { get; set; } - - public SubscriptionMap() - { - Table(TableName); - ComposedId(id => - { - id.Property(x => x.SubscriberEndpoint, m => m.Column("RowKey")); - id.Property(x => x.MessageType, m => m.Column("PartitionKey")); - }); - } - } -} \ No newline at end of file diff --git a/src/azure/SubscriptionStorage/ISubscriptionStorageSessionProvider.cs b/src/azure/SubscriptionStorage/ISubscriptionStorageSessionProvider.cs deleted file mode 100644 index 0a40fee96eb..00000000000 --- a/src/azure/SubscriptionStorage/ISubscriptionStorageSessionProvider.cs +++ /dev/null @@ -1,10 +0,0 @@ -using NHibernate; - -namespace NServiceBus.Unicast.Subscriptions.Azure.TableStorage -{ - public interface ISubscriptionStorageSessionProvider - { - ISession OpenSession(); - IStatelessSession OpenStatelessSession(); - } -} \ No newline at end of file diff --git a/src/azure/SubscriptionStorage/NServiceBus.Unicast.Subscriptions.Azure.TableStorage.csproj b/src/azure/SubscriptionStorage/NServiceBus.Unicast.Subscriptions.Azure.TableStorage.csproj deleted file mode 100644 index 7ca856eb62a..00000000000 --- a/src/azure/SubscriptionStorage/NServiceBus.Unicast.Subscriptions.Azure.TableStorage.csproj +++ /dev/null @@ -1,130 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {FB2ACC79-1E04-47CA-8F4B-31327E10B5E3} - library - Properties - NServiceBus.Unicast.Subscriptions.Azure.TableStorage - NServiceBus.Unicast.Subscriptions.Azure.TableStorage - v4.0 - 512 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - ..\..\..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll - - - ..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - ..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - ..\..\..\packages\NHibernate.3.3.0.4000\lib\Net35\NHibernate.dll - - - ..\..\..\lib\NHibernate.Drivers.Azure.TableStorage.dll - - - ..\..\..\build\output\NServiceBus.dll - - - ..\..\..\build\output\NServiceBus.Core.dll - - - ..\..\..\build\output\NServiceBus.NHibernate.dll - - - - - 3.5 - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - xcopy /Y "$(ProjectDir)$(OutDir)*.*" "$(ProjectDir)..\..\..\..\build\nhibernate\" - - \ No newline at end of file diff --git a/src/azure/SubscriptionStorage/NServiceBus.Unicast.Subscriptions.Azure.TableStorage.sln b/src/azure/SubscriptionStorage/NServiceBus.Unicast.Subscriptions.Azure.TableStorage.sln deleted file mode 100644 index 2b79cc9dac4..00000000000 --- a/src/azure/SubscriptionStorage/NServiceBus.Unicast.Subscriptions.Azure.TableStorage.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Subscriptions.Azure.TableStorage", "NServiceBus.Unicast.Subscriptions.Azure.TableStorage.csproj", "{FB2ACC79-1E04-47CA-8F4B-31327E10B5E3}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {FB2ACC79-1E04-47CA-8F4B-31327E10B5E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FB2ACC79-1E04-47CA-8F4B-31327E10B5E3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FB2ACC79-1E04-47CA-8F4B-31327E10B5E3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FB2ACC79-1E04-47CA-8F4B-31327E10B5E3}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/azure/SubscriptionStorage/Properties/AssemblyInfo.cs b/src/azure/SubscriptionStorage/Properties/AssemblyInfo.cs deleted file mode 100644 index f4f3d41b2e0..00000000000 Binary files a/src/azure/SubscriptionStorage/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/azure/SubscriptionStorage/Subscription.cs b/src/azure/SubscriptionStorage/Subscription.cs deleted file mode 100644 index 98d87aa1374..00000000000 --- a/src/azure/SubscriptionStorage/Subscription.cs +++ /dev/null @@ -1,34 +0,0 @@ -namespace NServiceBus.Unicast.Subscriptions.Azure.TableStorage -{ - /// - /// Enity containing subscription data - /// - public class Subscription - { - public virtual string SubscriberEndpoint { get; set; } - public virtual string MessageType { get; set; } - - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != typeof (Subscription)) return false; - return Equals((Subscription) obj); - } - - public virtual bool Equals(Subscription other) - { - if (ReferenceEquals(null, other)) return false; - if (ReferenceEquals(this, other)) return true; - return Equals(other.SubscriberEndpoint, SubscriberEndpoint) && Equals(other.MessageType, MessageType); - } - - public override int GetHashCode() - { - unchecked - { - return ((SubscriberEndpoint != null ? SubscriberEndpoint.GetHashCode() : 0)*397) ^ (MessageType != null ? MessageType.GetHashCode() : 0); - } - } - } -} \ No newline at end of file diff --git a/src/azure/SubscriptionStorage/SubscriptionStorage.cs b/src/azure/SubscriptionStorage/SubscriptionStorage.cs deleted file mode 100644 index ba6f3684dba..00000000000 --- a/src/azure/SubscriptionStorage/SubscriptionStorage.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Transactions; -using NHibernate.Criterion; - -namespace NServiceBus.Unicast.Subscriptions.Azure.TableStorage -{ - /// - /// Subscription storage using NHibernate for persistence - /// - public class SubscriptionStorage : ISubscriptionStorage - { - readonly ISubscriptionStorageSessionProvider sessionSource; - - public SubscriptionStorage(ISubscriptionStorageSessionProvider sessionSource) - { - this.sessionSource = sessionSource; - } - - - void ISubscriptionStorage.Subscribe(Address address, IEnumerable messageTypes) - { - using (var session = sessionSource.OpenSession()) - using (var transaction = new TransactionScope()) - { - foreach (var messageType in messageTypes) - { - var subscription = new Subscription - { - SubscriberEndpoint = EncodeTo64(address.ToString()), - MessageType = messageType.ToString() - }; - - if (session.Get(subscription) == null) - session.Save(subscription); - } - - transaction.Complete(); - session.Flush(); - } - } - - void ISubscriptionStorage.Unsubscribe(Address address, IEnumerable messageTypes) - { - var encodedAddress = EncodeTo64(address.ToString()); - using (var session = sessionSource.OpenSession()) - using (var transaction = new TransactionScope()) - { - foreach (var messageType in messageTypes) - session.Delete(string.Format("from Subscription where SubscriberEndpoint = '{0}' AND MessageType = '{1}'", encodedAddress, messageType.ToString())); - - transaction.Complete(); - session.Flush(); - } - } - - - - IEnumerable
    ISubscriptionStorage.GetSubscriberAddressesForMessage(IEnumerable messageTypes) - { - var subscribers = new List
    (); - - using (var session = sessionSource.OpenSession()) - { - subscribers.AddRange(from messageType in messageTypes - from subscription in session.CreateCriteria(typeof(Subscription)) - .Add(Restrictions.Eq("MessageType", messageType.ToString())) - .List() - select Address.Parse(DecodeFrom64(subscription.SubscriberEndpoint))); - } - - return subscribers; - } - - public void Init() - { - //No-op - } - - static public string EncodeTo64(string toEncode) - { - var toEncodeAsBytes = System.Text.Encoding.ASCII.GetBytes(toEncode); - var returnValue = System.Convert.ToBase64String(toEncodeAsBytes); - return returnValue; - } - - static public string DecodeFrom64(string encodedData) - { - var encodedDataAsBytes = System.Convert.FromBase64String(encodedData); - var returnValue = System.Text.Encoding.ASCII.GetString(encodedDataAsBytes); - return returnValue; - } - } -} diff --git a/src/azure/SubscriptionStorage/SubscriptionStorageSessionProvider.cs b/src/azure/SubscriptionStorage/SubscriptionStorageSessionProvider.cs deleted file mode 100644 index 17294d454d3..00000000000 --- a/src/azure/SubscriptionStorage/SubscriptionStorageSessionProvider.cs +++ /dev/null @@ -1,24 +0,0 @@ -using NHibernate; - -namespace NServiceBus.Unicast.Subscriptions.Azure.TableStorage -{ - public class SubscriptionStorageSessionProvider:ISubscriptionStorageSessionProvider - { - readonly ISessionFactory sessionFactory; - - public SubscriptionStorageSessionProvider(ISessionFactory sessionFactory) - { - this.sessionFactory = sessionFactory; - } - - public ISession OpenSession() - { - return this.sessionFactory.OpenSession(); - } - - public IStatelessSession OpenStatelessSession() - { - return this.sessionFactory.OpenStatelessSession(); - } - } -} \ No newline at end of file diff --git a/src/azure/SubscriptionStorage/packages.config b/src/azure/SubscriptionStorage/packages.config deleted file mode 100644 index 43993b71cb6..00000000000 --- a/src/azure/SubscriptionStorage/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/Config/AzureTimeoutPersisterConfig.cs b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/Config/AzureTimeoutPersisterConfig.cs deleted file mode 100644 index 9ca8a2188ea..00000000000 --- a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/Config/AzureTimeoutPersisterConfig.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Configuration; - -namespace NServiceBus.Timeout.Hosting.Azure -{ - public class AzureTimeoutPersisterConfig : ConfigurationSection - { - [ConfigurationProperty("ConnectionString", IsRequired = false, DefaultValue = "UseDevelopmentStorage=true")] - public string ConnectionString - { - get { return (string)this["ConnectionString"]; } - set { this["ConnectionString"] = value; } - } - } -} \ No newline at end of file diff --git a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/Config/ConfigureTimeoutManager.cs b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/Config/ConfigureTimeoutManager.cs deleted file mode 100644 index 344ff54d3d9..00000000000 --- a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/Config/ConfigureTimeoutManager.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Microsoft.ServiceBus; -using Microsoft.ServiceBus.Messaging; -using Microsoft.WindowsAzure.StorageClient; -using NServiceBus.Timeout.Hosting.Windows; -using NServiceBus.Timeout.Hosting.Windows.Persistence; -using NServiceBus.Unicast.Queuing.Azure; -using NServiceBus.Unicast.Queuing.Azure.ServiceBus; -using NServiceBus.Unicast.Transport.Transactional; - -namespace NServiceBus.Timeout.Hosting.Azure -{ - public static class ConfigureTimeoutManager - { - /// - /// Use the in azure timeout persister implementation. - /// - /// - /// - public static Configure UseAzureTimeoutPersister(this Configure config) - { - var configSection = Configure.GetConfigSection() ?? new AzureTimeoutPersisterConfig(); - - config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall).ConfigureProperty(tp => tp.ConnectionString, configSection.ConnectionString); - return config; - } - - /// - /// Listen on azure storage. - /// - /// - /// - public static Configure ListenOnAzureStorageQueues(this Configure config) - { - TimeoutMessageProcessor.MessageReceiverFactory = () =>{ - var queue = config.Builder.Build(); - return new AzureMessageQueue - { - Client = queue.Client, - PeekInterval = queue.PeekInterval, - MaximumWaitTimeWhenIdle = queue.MaximumWaitTimeWhenIdle, - PurgeOnStartup = queue.PurgeOnStartup, - MessageInvisibleTime = queue.MessageInvisibleTime, - BatchSize = queue.BatchSize, - MessageSerializer = queue.MessageSerializer - }; - }; - return config; - } - - /// - /// Listen on azure servicebus. - /// - /// - /// - public static Configure ListenOnAzureServiceBusQueues(this Configure config) - { - TimeoutMessageProcessor.MessageReceiverFactory = () =>{ - var queue = config.Builder.Build(); - return new AzureServiceBusMessageQueue{ - LockDuration = queue.LockDuration, - MaxSizeInMegabytes =queue.MaxSizeInMegabytes, - RequiresDuplicateDetection = queue.RequiresDuplicateDetection, - RequiresSession = queue.RequiresSession, - DefaultMessageTimeToLive = queue.DefaultMessageTimeToLive, - EnableDeadLetteringOnMessageExpiration = queue.EnableDeadLetteringOnMessageExpiration, - DuplicateDetectionHistoryTimeWindow = queue.DuplicateDetectionHistoryTimeWindow, - MaxDeliveryCount = queue.MaxDeliveryCount, - EnableBatchedOperations = queue.EnableBatchedOperations, - Factory = queue.Factory, - NamespaceClient = queue.NamespaceClient - }; - }; - return config; - } - } -} \ No newline at end of file diff --git a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/NServiceBus.Timeout.Hosting.Azure.csproj b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/NServiceBus.Timeout.Hosting.Azure.csproj index b7c077b2a8c..775b0113e90 100644 --- a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/NServiceBus.Timeout.Hosting.Azure.csproj +++ b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/NServiceBus.Timeout.Hosting.Azure.csproj @@ -1,105 +1,127 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {046FC5EF-EAE3-4306-BA3D-973197F32EB6} - Library - Properties - NServiceBus.Timeout.Hosting.Azure - NServiceBus.Timeout.Hosting.Azure - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.ServiceBus.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll - - - False - ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.StorageClient.dll - - - ..\..\..\..\packages\Newtonsoft.Json.4.0.8\lib\net40\Newtonsoft.Json.dll - - - False - ..\..\..\..\build\output\NServiceBus.dll - - - False - ..\..\..\..\build\output\NServiceBus.Azure.dll - - - False - ..\..\..\..\build\output\NServiceBus.Core.dll - - - False - ..\..\..\..\build\output\NServiceBus.Hosting.Azure.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {046FC5EF-EAE3-4306-BA3D-973197F32EB6} + Library + Properties + NServiceBus.Timeout.Hosting.Azure + NServiceBus.Timeout.Hosting.Azure + v4.0 + 512 + + true + ..\..\..\NServiceBus.snk + ..\..\..\..\ + true + + + true + full + false + ..\..\..\..\binaries\ + DEBUG;TRACE + prompt + 4 + ..\..\..\..\binaries\NServiceBus.Timeout.Hosting.Azure.XML + + + pdbonly + true + ..\..\..\..\binaries\ + TRACE + prompt + 4 + ..\..\..\..\binaries\NServiceBus.Timeout.Hosting.Azure.XML + + + + False + ..\..\..\..\packages\Microsoft.Data.Edm.5.2.0\lib\net40\Microsoft.Data.Edm.dll + + + False + ..\..\..\..\packages\Microsoft.Data.OData.5.2.0\lib\net40\Microsoft.Data.OData.dll + + + False + ..\..\..\..\packages\WindowsAzure.ServiceBus.2.1.0.0\lib\net40-full\Microsoft.ServiceBus.dll + + + ..\..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.1.0\lib\net40\Microsoft.WindowsAzure.Configuration.dll + + + False + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.Diagnostics.dll + + + False + ..\..\..\..\lib\Azure\Microsoft.WindowsAzure.ServiceRuntime.dll + + + ..\..\..\..\packages\WindowsAzure.Storage.2.0.5.1\lib\net40\Microsoft.WindowsAzure.Storage.dll + + + False + ..\..\..\..\packages\Newtonsoft.Json.4.5.11\lib\net40\Newtonsoft.Json.dll + + + + + + + + + False + ..\..\..\..\packages\System.Spatial.5.2.0\lib\net40\System.Spatial.dll + + + + + + + + + + + + + + + + + + Designer + + + + + {dd48b2d0-e996-412d-9157-821ed8b17a9d} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + + {6591ED91-F9A1-4CC3-813E-A33E07439D49} + NServiceBus.Hosting.Azure + + + {12F1D9F1-0A2C-4442-8D18-67DD096C6300} + NServiceBus.Azure + + + + --> + \ No newline at end of file diff --git a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/Properties/AssemblyInfo.cs b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/Properties/AssemblyInfo.cs index 0258af857b7..e757a4aef46 100644 Binary files a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/Properties/AssemblyInfo.cs and b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/Properties/AssemblyInfo.cs differ diff --git a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/Roles/Handlers/TimeoutManagerRoleHandler.cs b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/Roles/Handlers/TimeoutManagerRoleHandler.cs index bafdfc25f33..879fabe7cf6 100644 --- a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/Roles/Handlers/TimeoutManagerRoleHandler.cs +++ b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/Roles/Handlers/TimeoutManagerRoleHandler.cs @@ -1,45 +1,39 @@ -using Microsoft.WindowsAzure.ServiceRuntime; -using NServiceBus.Config; -using NServiceBus.Hosting.Azure; -using NServiceBus.Hosting.Roles; -using NServiceBus.Sagas.Impl; -using NServiceBus.Unicast.Config; - - -namespace NServiceBus.Timeout.Hosting.Azure -{ - using Core; - - /// - /// Handles configuration related to the timeout manager role - /// - public class TimeoutManagerRoleHandler : IConfigureRole, IWantTheEndpointConfig - { - /// - /// Configures the UnicastBus with typical settings for a timeout manager on azure - /// - /// - /// - public ConfigUnicastBus ConfigureRole(IConfigureThisEndpoint specifier) - { - var instance = Configure.Instance; - - if (RoleEnvironment.IsAvailable && !IsHostedIn.ChildHostProcess()) - { - instance.AzureConfigurationSource(); - } - - return instance - .JsonSerializer() - .RunTimeoutManager() - .UseAzureTimeoutPersister() - .IsTransactional(true) - .Sagas() - .UnicastBus() - .ImpersonateSender(false); - } - - - public IConfigureThisEndpoint Config { get; set; } - } -} +using Microsoft.WindowsAzure.ServiceRuntime; +using NServiceBus.Config; +using NServiceBus.Hosting.Azure; +using NServiceBus.Hosting.Roles; +using NServiceBus.Unicast.Config; + + +namespace NServiceBus.Timeout.Hosting.Azure +{ + using NServiceBus.Azure; + + /// + /// Handles configuration related to the timeout manager role + /// + public class TimeoutManagerRoleHandler : IConfigureRole + { + /// + /// Configures the UnicastBus with typical settings for a timeout manager on azure + /// + /// + /// + public ConfigUnicastBus ConfigureRole(IConfigureThisEndpoint specifier) + { + if (RoleEnvironment.IsAvailable && !IsHostedIn.ChildHostProcess()) + { + Configure.Instance.AzureConfigurationSource(); + } + + Configure.Transactions.Enable(); + Configure.Features.Enable(); + Configure.Serialization.Json(); + + return Configure.Instance + .UseAzureTimeoutPersister() + .UnicastBus() + .RunHandlersUnderIncomingPrincipal(false); + } + } +} diff --git a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/AutoRenewLease.cs b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/AutoRenewLease.cs deleted file mode 100644 index f93cca18b61..00000000000 --- a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/AutoRenewLease.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Microsoft.WindowsAzure.StorageClient; -using System; -using System.Threading; -using System.Net; - -namespace NServiceBus.Timeout.Hosting.Azure -{ - public class AutoRenewLease : IDisposable - { - public bool HasLease { get { return leaseId != null; } } - - private readonly CloudBlob blob; - private readonly string leaseId; - private Thread renewalThread; - private bool disposed; - - public AutoRenewLease(CloudBlob blob) - { - this.blob = blob; - blob.Container.CreateIfNotExist(); - try - { - blob.UploadByteArray(new byte[0], new BlobRequestOptions { AccessCondition = AccessCondition.IfNoneMatch("*") }); - } - catch (StorageClientException e) - { - if (e.ErrorCode != StorageErrorCode.BlobAlreadyExists - && e.StatusCode != HttpStatusCode.PreconditionFailed) // 412 from trying to modify a blob that's leased - { - throw; - } - } - leaseId = blob.TryAcquireLease(); - if (HasLease) - { - renewalThread = new Thread(() => - { - Thread.Sleep(TimeSpan.FromSeconds(40)); - blob.RenewLease(leaseId); - }); - renewalThread.Start(); - } - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (!disposed) - { - if (disposing) - { - if (renewalThread != null) - { - renewalThread.Abort(); - blob.ReleaseLease(leaseId); - renewalThread = null; - } - } - disposed = true; - } - } - - ~AutoRenewLease() - { - Dispose(false); - } - } -} \ No newline at end of file diff --git a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/ExistenceExtensions.cs b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/ExistenceExtensions.cs deleted file mode 100644 index 43746f0ef86..00000000000 --- a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/ExistenceExtensions.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.WindowsAzure.StorageClient; - -namespace NServiceBus.Timeout.Hosting.Azure -{ - public static class ExistenceExtensions - { - public static bool Exists(this CloudBlob blob) - { - try - { - blob.FetchAttributes(); - return true; - } - catch (StorageClientException e) - { - if (e.ErrorCode == StorageErrorCode.ResourceNotFound) - { - return false; - } - throw; - } - } - } -} \ No newline at end of file diff --git a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/IDetermineWhoCanSend.cs b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/IDetermineWhoCanSend.cs deleted file mode 100644 index eb5d743a055..00000000000 --- a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/IDetermineWhoCanSend.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace NServiceBus.Timeout.Hosting.Azure -{ - using Core; - - public interface IDetermineWhoCanSend - { - bool CanSend(TimeoutData data); - } -} \ No newline at end of file diff --git a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/LeaseExtensions.cs b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/LeaseExtensions.cs deleted file mode 100644 index e2b56914ea5..00000000000 --- a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/LeaseExtensions.cs +++ /dev/null @@ -1,76 +0,0 @@ -using Microsoft.WindowsAzure.StorageClient; -using Microsoft.WindowsAzure.StorageClient.Protocol; -using System; -using System.Net; - -namespace NServiceBus.Timeout.Hosting.Azure -{ - public static class LeaseBlobExtensions - { - public static string TryAcquireLease(this CloudBlob blob) - { - try { return blob.AcquireLease(); } - catch (WebException e) - { - if (((HttpWebResponse)e.Response).StatusCode != HttpStatusCode.Conflict) // 409, already leased - { - throw; - } - e.Response.Close(); - return null; - } - } - - public static string AcquireLease(this CloudBlob blob) - { - var creds = blob.ServiceClient.Credentials; - var transformedUri = new Uri(creds.TransformUri(blob.Uri.AbsoluteUri)); - var req = BlobRequest.Lease(transformedUri, 90, LeaseAction.Acquire, null); - blob.ServiceClient.Credentials.SignRequest(req); - using (var response = req.GetResponse()) { - return response.Headers["x-ms-lease-id"]; - } - } - - private static void DoLeaseOperation(CloudBlob blob, string leaseId, LeaseAction action) - { - var creds = blob.ServiceClient.Credentials; - var transformedUri = new Uri(creds.TransformUri(blob.Uri.AbsoluteUri)); - var req = BlobRequest.Lease(transformedUri, 90, action, leaseId); - creds.SignRequest(req); - req.GetResponse().Close(); - } - - public static void ReleaseLease(this CloudBlob blob, string leaseId) - { - DoLeaseOperation(blob, leaseId, LeaseAction.Release); - } - - public static bool TryRenewLease(this CloudBlob blob, string leaseId) - { - try { blob.RenewLease(leaseId); return true; } - catch { return false; } - } - - public static void RenewLease(this CloudBlob blob, string leaseId) - { - DoLeaseOperation(blob, leaseId, LeaseAction.Renew); - } - - public static void BreakLease(this CloudBlob blob) - { - DoLeaseOperation(blob, null, LeaseAction.Break); - } - - public static void SetMetadata(this CloudBlob blob, string leaseId) - { - var req = BlobRequest.SetMetadata(new Uri(blob.ServiceClient.Credentials.TransformUri(blob.Uri.AbsoluteUri)), 90, leaseId); - foreach (string key in blob.Metadata.Keys) - { - req.Headers.Add("x-ms-meta-" + key, blob.Metadata[key]); - } - blob.ServiceClient.Credentials.SignRequest(req); - req.GetResponse().Close(); - } - } -} \ No newline at end of file diff --git a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/ServiceContext.cs b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/ServiceContext.cs deleted file mode 100644 index 4d756f45dec..00000000000 --- a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/ServiceContext.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Linq; -using Microsoft.WindowsAzure; -using Microsoft.WindowsAzure.StorageClient; - -namespace NServiceBus.Timeout.Hosting.Azure -{ - public class ServiceContext : TableServiceContext - { - public ServiceContext(string baseAddress, StorageCredentials credentials) - : base(baseAddress, credentials) - { - } - - public const string TimeoutManagerDataEntityTableName = "TimeoutManagerData"; - - public IQueryable TimeoutManagerData - { - get - { - return this.CreateQuery(TimeoutManagerDataEntityTableName); - } - } - - public const string TimeoutDataEntityTableName = "TimeoutData"; - - public IQueryable TimeoutData - { - get - { - return this.CreateQuery(TimeoutDataEntityTableName); - } - } - - } -} \ No newline at end of file diff --git a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/TimeoutPersister.cs b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/TimeoutPersister.cs deleted file mode 100644 index 06bc9e42e7c..00000000000 --- a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/TimeoutLogic/TimeoutPersister.cs +++ /dev/null @@ -1,385 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Data.Services.Client; -using System.Linq; -using System.Security.Cryptography; -using System.Text; -using System.Web.Script.Serialization; -using Microsoft.WindowsAzure; -using Microsoft.WindowsAzure.StorageClient; -using log4net; - -namespace NServiceBus.Timeout.Hosting.Azure -{ - using Core; - - public class TimeoutPersister : IPersistTimeouts, IDetermineWhoCanSend - { - private const string partitionKeyScope = "yyyMMddHH"; - - public List> GetNextChunk(DateTime startSlice, out DateTime nextTimeToRunQuery) - { - var context = new ServiceContext(account.TableEndpoint.ToString(), account.Credentials); - TimeoutManagerDataEntity lastSuccessfullReadEntity; - var lastSuccessfullRead = TryGetLastSuccessfullRead(context, out lastSuccessfullReadEntity) - ? lastSuccessfullReadEntity.LastSuccessfullRead - : DateTime.UtcNow; - - - var result = (from c in context.TimeoutData - where c.PartitionKey == lastSuccessfullRead.ToString(partitionKeyScope) - && c.OwningTimeoutManager == Configure.EndpointName - select c).ToList().OrderBy(c => c.Time); - - var allTimeouts = result.ToList(); - var pastTimeouts = allTimeouts.Where(c => c.Time > startSlice && c.Time <= DateTime.UtcNow).ToList(); - var futureTimeouts = allTimeouts.Where(c => c.Time > DateTime.UtcNow).ToList(); - - nextTimeToRunQuery = futureTimeouts.Count == 0 ? lastSuccessfullRead.AddHours(1) : futureTimeouts.First().Time; - - var results = pastTimeouts - .Select(c => new Tuple(c.RowKey, c.Time)) - .ToList(); - - UpdateSuccesfullRead(context, lastSuccessfullReadEntity); - - return results; - } - - public void Add(TimeoutData timeout) - { - var context = new ServiceContext(account.TableEndpoint.ToString(), account.Credentials); - var hash = Hash(timeout); - TimeoutDataEntity timeoutDataEntity; - if (TryGetTimeoutData(context, hash, string.Empty, out timeoutDataEntity)) return; - - var stateAddress = Upload(timeout.State, hash); - var headers = Serialize(timeout.Headers); - - if (!TryGetTimeoutData(context, timeout.Time.ToString(partitionKeyScope), stateAddress, out timeoutDataEntity)) - context.AddObject(ServiceContext.TimeoutDataEntityTableName, - new TimeoutDataEntity(timeout.Time.ToString(partitionKeyScope), stateAddress) - { - Destination = timeout.Destination.ToString(), - SagaId = timeout.SagaId, - StateAddress = stateAddress, - Time = timeout.Time, - CorrelationId = timeout.CorrelationId, - OwningTimeoutManager = timeout.OwningTimeoutManager, - Headers = headers - }); - - - if (timeout.SagaId != default(Guid) && !TryGetTimeoutData(context, timeout.SagaId.ToString(), stateAddress, out timeoutDataEntity)) - context.AddObject(ServiceContext.TimeoutDataEntityTableName, - new TimeoutDataEntity(timeout.SagaId.ToString(), stateAddress) - { - Destination = timeout.Destination.ToString(), - SagaId = timeout.SagaId, - StateAddress = stateAddress, - Time = timeout.Time, - CorrelationId = timeout.CorrelationId, - OwningTimeoutManager = timeout.OwningTimeoutManager, - Headers = headers - }); - - context.AddObject(ServiceContext.TimeoutDataEntityTableName, - new TimeoutDataEntity(stateAddress, string.Empty) - { - Destination = timeout.Destination.ToString(), - SagaId = timeout.SagaId, - StateAddress = stateAddress, - Time = timeout.Time, - CorrelationId = timeout.CorrelationId, - OwningTimeoutManager = timeout.OwningTimeoutManager, - Headers = headers - }); - - context.SaveChanges(); - } - - public bool TryRemove(string timeoutId, out TimeoutData timeoutData) - { - timeoutData = null; - - var context = new ServiceContext(account.TableEndpoint.ToString(), account.Credentials); - try - { - TimeoutDataEntity timeoutDataEntity; - if (!TryGetTimeoutData(context, timeoutId, string.Empty, out timeoutDataEntity)) - { - return false; - } - - timeoutData = new TimeoutData - { - Destination = Address.Parse(timeoutDataEntity.Destination), - SagaId = timeoutDataEntity.SagaId, - State = Download(timeoutDataEntity.StateAddress), - Time = timeoutDataEntity.Time, - CorrelationId = timeoutDataEntity.CorrelationId, - Id = timeoutDataEntity.RowKey, - OwningTimeoutManager = timeoutDataEntity.OwningTimeoutManager, - Headers = Deserialize(timeoutDataEntity.Headers) - }; - - TimeoutDataEntity timeoutDataEntityBySaga; - if (TryGetTimeoutData(context, timeoutDataEntity.SagaId.ToString(), timeoutId, out timeoutDataEntityBySaga)) - { - context.DeleteObject(timeoutDataEntityBySaga); - } - - TimeoutDataEntity timeoutDataEntityByTime; - if (TryGetTimeoutData(context, timeoutDataEntity.Time.ToString(partitionKeyScope), timeoutId, out timeoutDataEntityByTime)) - { - context.DeleteObject(timeoutDataEntityByTime); - } - - RemoveState(timeoutDataEntity.StateAddress); - - context.DeleteObject(timeoutDataEntity); - - context.SaveChanges(); - } - catch(Exception ex) - { - Logger.Debug(string.Format("Failed to clean up timeout {0}", timeoutId), ex); - } - - return true; - } - - public void RemoveTimeoutBy(Guid sagaId) - { - var context = new ServiceContext(account.TableEndpoint.ToString(), account.Credentials); - try - { - var results = (from c in context.TimeoutData - where c.PartitionKey == sagaId.ToString() - select c).ToList(); - - foreach (var timeoutDataEntityBySaga in results) - { - RemoveState(timeoutDataEntityBySaga.StateAddress); - - TimeoutDataEntity timeoutDataEntityByTime; - if (TryGetTimeoutData(context, timeoutDataEntityBySaga.Time.ToString(partitionKeyScope), timeoutDataEntityBySaga.RowKey, out timeoutDataEntityByTime)) - context.DeleteObject(timeoutDataEntityByTime); - - TimeoutDataEntity timeoutDataEntity; - if (TryGetTimeoutData(context, timeoutDataEntityBySaga.RowKey, string.Empty, out timeoutDataEntity)) - context.DeleteObject(timeoutDataEntity); - - context.DeleteObject(timeoutDataEntityBySaga); - } - context.SaveChanges(); - } - catch(Exception ex) - { - Logger.Debug(string.Format("Failed to clean up timeouts for saga {0}", sagaId), ex); - } - - } - - private bool TryGetTimeoutData(ServiceContext context, string partitionkey, string rowkey, out TimeoutDataEntity result) - { - try - { - result = (from c in context.TimeoutData - where c.PartitionKey == partitionkey && c.RowKey == rowkey - select c).FirstOrDefault(); - } - catch (Exception) - { - result = null; - } - - return result != null; - - } - - public bool CanSend(TimeoutData data) - { - var context = new ServiceContext(account.TableEndpoint.ToString(), account.Credentials); - TimeoutDataEntity timeoutDataEntity; - if (!TryGetTimeoutData(context, data.Id, string.Empty, out timeoutDataEntity)) return false; - - var leaseBlob = container.GetBlockBlobReference(timeoutDataEntity.StateAddress); - - using (var lease = new AutoRenewLease(leaseBlob)) - { - return lease.HasLease; - } - } - - public string ConnectionString - { - get - { - return connectionString; - } - set - { - connectionString = value; - Init(connectionString); - } - } - - private void Init(string connectionstring) - { - account = CloudStorageAccount.Parse(connectionstring); - var context = new ServiceContext(account.TableEndpoint.ToString(), account.Credentials); - var tableClient = account.CreateCloudTableClient(); - tableClient.CreateTableIfNotExist(ServiceContext.TimeoutManagerDataEntityTableName); - tableClient.CreateTableIfNotExist(ServiceContext.TimeoutDataEntityTableName); - container = account.CreateCloudBlobClient().GetContainerReference("timeoutstate"); - container.CreateIfNotExist(); - - MigrateExistingTimeouts(context); - } - - private void MigrateExistingTimeouts(ServiceContext context) - { - var existing = (from c in context.TimeoutData - where c.PartitionKey == "TimeoutData" - select c).ToList(); - - foreach(var timeout in existing) - { - TimeoutDataEntity timeoutDataEntity; - - if (!TryGetTimeoutData(context, timeout.Time.ToString(partitionKeyScope), timeout.RowKey, out timeoutDataEntity)) - context.AddObject(ServiceContext.TimeoutDataEntityTableName, - new TimeoutDataEntity(timeout.Time.ToString(partitionKeyScope), timeout.RowKey) - { - Destination = timeout.Destination, - SagaId = timeout.SagaId, - StateAddress = timeout.RowKey, - Time = timeout.Time, - CorrelationId = timeout.CorrelationId, - OwningTimeoutManager = timeout.OwningTimeoutManager - }); - - if (!TryGetTimeoutData(context, timeout.SagaId.ToString(), timeout.RowKey, out timeoutDataEntity)) - context.AddObject(ServiceContext.TimeoutDataEntityTableName, - new TimeoutDataEntity(timeout.SagaId.ToString(), timeout.RowKey) - { - Destination = timeout.Destination, - SagaId = timeout.SagaId, - StateAddress = timeout.RowKey, - Time = timeout.Time, - CorrelationId = timeout.CorrelationId, - OwningTimeoutManager = timeout.OwningTimeoutManager - }); - - if (!TryGetTimeoutData(context, timeout.RowKey, string.Empty, out timeoutDataEntity)) - context.AddObject(ServiceContext.TimeoutDataEntityTableName, - new TimeoutDataEntity(timeout.RowKey, string.Empty) - { - Destination = timeout.Destination, - SagaId = timeout.SagaId, - StateAddress = timeout.RowKey, - Time = timeout.Time, - CorrelationId = timeout.CorrelationId, - OwningTimeoutManager = timeout.OwningTimeoutManager - }); - - context.DeleteObject(timeout); - context.SaveChanges(); - } - } - - private string Upload(byte[] state, string stateAddress) - { - var blob = container.GetBlockBlobReference(stateAddress); - blob.UploadByteArray(state); - return stateAddress; - } - - - private byte[] Download(string stateAddress) - { - var blob = container.GetBlockBlobReference(stateAddress); - return blob.DownloadByteArray(); - } - - private string Serialize(Dictionary headers ) - { - var serializer = new JavaScriptSerializer(); - return serializer.Serialize(headers); - } - - private Dictionary Deserialize(string state) - { - if(string.IsNullOrEmpty(state)) return new Dictionary(); - - var serializer = new JavaScriptSerializer(); - return serializer.Deserialize>(state); - } - - private void RemoveState(string stateAddress) - { - var blob = container.GetBlobReference(stateAddress); - blob.DeleteIfExists(); - } - - private static string Hash(TimeoutData timeout) - { - var s = timeout.SagaId + timeout.Destination.ToString() + timeout.Time.Ticks; - var sha1 = SHA1.Create(); - var bytes = sha1.ComputeHash(Encoding.UTF8.GetBytes(s)); - - var hash = new StringBuilder(); - for (var i = 0; i < bytes.Length; i++) - { - hash.Append(bytes[i].ToString("X2")); - } - return hash.ToString(); - } - - private bool TryGetLastSuccessfullRead(ServiceContext context, out TimeoutManagerDataEntity lastSuccessfullReadEntity) - { - try - { - lastSuccessfullReadEntity = (from m in context.TimeoutManagerData - where m.PartitionKey == Configure.EndpointName - select m).FirstOrDefault(); - } - catch - { - - lastSuccessfullReadEntity = null; - } - - - return lastSuccessfullReadEntity != null; - } - - private void UpdateSuccesfullRead(ServiceContext context, TimeoutManagerDataEntity read) - { - if (read == null) - { - read = new TimeoutManagerDataEntity(Configure.EndpointName, string.Empty){ - LastSuccessfullRead = DateTime.UtcNow - }; - - context.AddObject(ServiceContext.TimeoutManagerDataEntityTableName, read); - } - else - { - read.LastSuccessfullRead = DateTime.UtcNow; - context.UpdateObject(read); - } - - context.SaveChanges(SaveChangesOptions.ReplaceOnUpdate); - } - - private string connectionString; - private CloudStorageAccount account; - private CloudBlobContainer container; - - static readonly ILog Logger = LogManager.GetLogger("AzureTimeoutPersistence"); - - } - -} diff --git a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/app.config b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/app.config new file mode 100644 index 00000000000..f53d06f032c --- /dev/null +++ b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/app.config @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/packages.config b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/packages.config index 19ded81e2ba..a20e870692b 100644 --- a/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/packages.config +++ b/src/azure/Timeout/NServiceBus.Timeout.Hosting.Azure/packages.config @@ -1,4 +1,10 @@ - - - + + + + + + + + + \ No newline at end of file diff --git a/src/azure/Timeout/Timeout.sln b/src/azure/Timeout/Timeout.sln deleted file mode 100644 index b1f40e4060c..00000000000 --- a/src/azure/Timeout/Timeout.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Timeout.Hosting.Azure", "NServiceBus.Timeout.Hosting.Azure\NServiceBus.Timeout.Hosting.Azure.csproj", "{046FC5EF-EAE3-4306-BA3D-973197F32EB6}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {046FC5EF-EAE3-4306-BA3D-973197F32EB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {046FC5EF-EAE3-4306-BA3D-973197F32EB6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {046FC5EF-EAE3-4306-BA3D-973197F32EB6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {046FC5EF-EAE3-4306-BA3D-973197F32EB6}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/azure/Timeout/nuget.config b/src/azure/Timeout/nuget.config deleted file mode 100644 index d05bd9c5c20..00000000000 --- a/src/azure/Timeout/nuget.config +++ /dev/null @@ -1,4 +0,0 @@ - - - ../../../packages - \ No newline at end of file diff --git a/src/azure/nuget.config b/src/azure/nuget.config deleted file mode 100644 index cd17f414bd4..00000000000 --- a/src/azure/nuget.config +++ /dev/null @@ -1,4 +0,0 @@ - - - ../../packages - \ No newline at end of file diff --git a/src/claims/NServiceBus.Claims.sln b/src/claims/NServiceBus.Claims.sln deleted file mode 100644 index 95e1a2be4f6..00000000000 --- a/src/claims/NServiceBus.Claims.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Claims", "NServiceBus.Claims\NServiceBus.Claims.csproj", "{15348C06-037F-43C4-BB44-8B0BE41697DA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {15348C06-037F-43C4-BB44-8B0BE41697DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {15348C06-037F-43C4-BB44-8B0BE41697DA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {15348C06-037F-43C4-BB44-8B0BE41697DA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {15348C06-037F-43C4-BB44-8B0BE41697DA}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/claims/NServiceBus.Claims/CertificateUtilities.cs b/src/claims/NServiceBus.Claims/CertificateUtilities.cs deleted file mode 100644 index 78a48b1b15e..00000000000 --- a/src/claims/NServiceBus.Claims/CertificateUtilities.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Globalization; -using System.Linq; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Security.Permissions; - -namespace NServiceBus.Claims -{ - public static class FindCertificates - { - [SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] - public static X509Certificate2 ByThumbPrint(StoreName name, StoreLocation location, string thumbprint) - { - var store = new X509Store(name, location); - X509Certificate2Collection certificates = null; - store.Open(OpenFlags.ReadOnly); - - try - { - certificates = store.Certificates; - - var result = (from X509Certificate2 cert in certificates - where cert.SubjectName.Name != null - where cert.Thumbprint != null && cert.Thumbprint.Equals(thumbprint, StringComparison.OrdinalIgnoreCase) - select cert) - .Select(cert => new X509Certificate2(cert)) - .FirstOrDefault(); - - if (result == null) - { - throw new CryptographicException(string.Format(CultureInfo.CurrentUICulture, "No certificate was found for thumbprint {0}", thumbprint)); - } - - return result; - } - finally - { - if (certificates != null) - { - foreach (var cert in certificates) cert.Reset(); - } - - store.Close(); - } - } - } -} \ No newline at end of file diff --git a/src/claims/NServiceBus.Claims/ClaimManager.cs b/src/claims/NServiceBus.Claims/ClaimManager.cs deleted file mode 100644 index e99cf6c347b..00000000000 --- a/src/claims/NServiceBus.Claims/ClaimManager.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.IdentityModel.Selectors; -using System.IdentityModel.Tokens; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Xml; -using Microsoft.IdentityModel.Claims; -using Microsoft.IdentityModel.Tokens; -using Microsoft.IdentityModel.Tokens.Saml2; -using NServiceBus.Config; -using NServiceBus.MessageMutator; -using NServiceBus.ObjectBuilder; -using NServiceBus.Unicast.Transport; - -namespace NServiceBus.Claims -{ - /// - /// Manages all aspects of flowing claims between nodes - /// - public class ClaimManager : INeedInitialization, IMutateOutgoingTransportMessages - { - void INeedInitialization.Init() - { - Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - - Configure.ConfigurationComplete += () => { - Configure.Instance.Builder.Build().TransportMessageReceived += TransportTransportMessageReceived; - }; - } - - static void TransportTransportMessageReceived(object sender, TransportMessageReceivedEventArgs e) - { - if (!ConfigureClaimFlow.Flow) return; - if (!e.Message.Headers.ContainsKey(SecurityTokenKey)) return; - - var serializedToken = e.Message.Headers[SecurityTokenKey]; - var certificate = ExtractCertificate(serializedToken); - var handler = new Saml2SecurityTokenHandler(new SamlSecurityTokenRequirement()); - var tokens = new List {new X509SecurityToken(certificate)}; - var resolver = SecurityTokenResolver.CreateDefaultSecurityTokenResolver(tokens.AsReadOnly(), false); - handler.Configuration = new SecurityTokenHandlerConfiguration - { - IssuerTokenResolver = resolver, - IssuerNameRegistry = new InternalIssuerNameRegistry(), - CertificateValidator = X509CertificateValidator.None - }; - using (var reader = XmlReader.Create(new StringReader(serializedToken))) - { - var bootstrapToken = handler.ReadToken(reader); - handler.Configuration.AudienceRestriction.AudienceMode = AudienceUriMode.Never; - handler.Configuration.MaxClockSkew = TimeSpan.MaxValue; - var collection = handler.ValidateToken(bootstrapToken); - Thread.CurrentPrincipal = new ClaimsPrincipal(collection); - } - - } - - private static X509Certificate2 ExtractCertificate(string serializedToken) - { - var doc = new XmlDocument(); - doc.LoadXml(serializedToken); - - var xmlnsManager = new XmlNamespaceManager(doc.NameTable); - xmlnsManager.AddNamespace("ds", "http://www.w3.org/2000/09/xmldsig#"); - xmlnsManager.AddNamespace("n", "urn:oasis:names:tc:SAML:2.0:assertion"); - - var node = doc.SelectSingleNode("/n:Assertion/ds:Signature/ds:KeyInfo/ds:X509Data/ds:X509Certificate/text()", xmlnsManager); - // not sure how I should handle absence of certificate yet, blow up? or try another cert? - var certificatecontent = Encoding.UTF8.GetBytes(node.Value); - - return new X509Certificate2(certificatecontent); - } - - void IMutateOutgoingTransportMessages.MutateOutgoing(object[] messages, TransportMessage transportMessage) - { - if (transportMessage.Headers.ContainsKey(SecurityTokenKey)) - transportMessage.Headers.Remove(SecurityTokenKey); - - var claimsPrincipal = Thread.CurrentPrincipal as IClaimsPrincipal; - if (claimsPrincipal == null) return; - - var bootstrapToken = claimsPrincipal.Identities[0].BootstrapToken; - if (bootstrapToken == null) return; - - var handler = new Saml2SecurityTokenHandler(new SamlSecurityTokenRequirement()); - var stringBuilder = new StringBuilder(); - using (var writer = XmlWriter.Create(stringBuilder)) - { - handler.WriteToken(writer, bootstrapToken); - } - var serializedToken = stringBuilder.ToString(); - - transportMessage.Headers.Add(SecurityTokenKey, serializedToken); - } - - private const string SecurityTokenKey = "SecurityToken"; - - internal class InternalIssuerNameRegistry : IssuerNameRegistry - { - public override string GetIssuerName(SecurityToken securityToken) - { - return "DoNotcareAboutTheIssuer"; - } - } - - } -} diff --git a/src/claims/NServiceBus.Claims/ConfigureClaimFlow.cs b/src/claims/NServiceBus.Claims/ConfigureClaimFlow.cs deleted file mode 100644 index 5ca694681ab..00000000000 --- a/src/claims/NServiceBus.Claims/ConfigureClaimFlow.cs +++ /dev/null @@ -1,44 +0,0 @@ -using NServiceBus.Unicast.Config; - -namespace NServiceBus -{ - /// - /// Contains extension methods for the purpose of configuring claim flow. - /// - public static class ConfigureClaimFlow - { - /// - /// Do not flow claims by default - /// - static ConfigureClaimFlow() - { - Flow = false; - } - - /// - /// Instructs the bus to flow claims across the nodes. - /// - /// - /// - /// - public static ConfigUnicastBus FlowIdentityClaims(this ConfigUnicastBus config) - { - return FlowIdentityClaims(config, true); - } - - /// - /// Instructs the bus to flow claims across the nodes. - /// - /// - /// - /// - public static ConfigUnicastBus FlowIdentityClaims(this ConfigUnicastBus config, bool value) - { - Flow = value; - - return config; - } - - public static bool Flow { get; private set; } - } -} \ No newline at end of file diff --git a/src/claims/NServiceBus.Claims/NServiceBus.Claims.csproj b/src/claims/NServiceBus.Claims/NServiceBus.Claims.csproj deleted file mode 100644 index 985abf2c3d7..00000000000 --- a/src/claims/NServiceBus.Claims/NServiceBus.Claims.csproj +++ /dev/null @@ -1,69 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {15348C06-037F-43C4-BB44-8B0BE41697DA} - Library - Properties - NServiceBus.Claims - NServiceBus.Claims - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\lib\Microsoft.IdentityModel.dll - - - ..\..\..\build\output\NServiceBus.dll - - - ..\..\..\build\output\NServiceBus.Core.dll - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/claims/NServiceBus.Claims/Properties/AssemblyInfo.cs b/src/claims/NServiceBus.Claims/Properties/AssemblyInfo.cs deleted file mode 100644 index 9bb32465517..00000000000 Binary files a/src/claims/NServiceBus.Claims/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/config/NServiceBus.Config.UnitTests/App.config b/src/config/NServiceBus.Config.UnitTests/App.config deleted file mode 100644 index e238a277b2f..00000000000 --- a/src/config/NServiceBus.Config.UnitTests/App.config +++ /dev/null @@ -1,57 +0,0 @@ - - - -
    -
    -
    -
    - - -
    - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/config/NServiceBus.Config.UnitTests/MessageConventionSpecs.cs b/src/config/NServiceBus.Config.UnitTests/MessageConventionSpecs.cs deleted file mode 100644 index 27e44b06711..00000000000 --- a/src/config/NServiceBus.Config.UnitTests/MessageConventionSpecs.cs +++ /dev/null @@ -1,107 +0,0 @@ -namespace NServiceBus.Config.UnitTests -{ - using System; - using System.Collections.Generic; - using System.Diagnostics; - using NUnit.Framework; - - [TestFixture] - public class When_applying_message_conventions_to_types - { - [Test] - public void Should_cache_the_message_convention() - { - var timesCalled = 0; - ExtensionMethods.IsMessageTypeAction = (t)=> - { - timesCalled++; - return false; - }; - - this.IsMessage(); - Assert.AreEqual(1,timesCalled); - - this.IsMessage(); - Assert.AreEqual(1, timesCalled); - } - } - - [TestFixture] - public class When_applying_message_conventions_to_events - { - [Test] - public void Should_cache_the_message_convention() - { - var timesCalled = 0; - ExtensionMethods.IsEventTypeAction = (t) => - { - timesCalled++; - return false; - }; - - this.IsEvent(); - Assert.AreEqual(1, timesCalled); - - this.IsEvent(); - Assert.AreEqual(1, timesCalled); - } - - [Test,Explicit("Perfromance test")] - public void Check_performance() - { - var sw = new Stopwatch(); - int numIterations = 1000000; - sw.Start(); - for (int i = 0; i < numIterations; i++) - { - i.IsMessage(); - } - sw.Stop(); - - Console.WriteLine("Not cached: " + sw.ElapsedMilliseconds); - sw.Reset(); - var hashTable = new Dictionary(); - sw.Start(); - for (int i = 0; i < numIterations; i++) - { - hashTable[i.GetType()] = i.IsMessage(); - } - - sw.Stop(); - - Console.WriteLine("Set dictionary: " + sw.ElapsedMilliseconds); - sw.Reset(); - sw.Start(); - for (int i = 0; i < numIterations; i++) - { - var r = hashTable[i.GetType()]; - } - - sw.Stop(); - - Console.WriteLine("Get dictionary: " + sw.ElapsedMilliseconds); - } - } - - - [TestFixture] - public class When_applying_message_conventions_to_commands - { - [Test] - public void Should_cache_the_message_convention() - { - var timesCalled = 0; - ExtensionMethods.IsCommandTypeAction = (t) => - { - timesCalled++; - return false; - }; - - this.IsCommand(); - Assert.AreEqual(1, timesCalled); - - this.IsCommand(); - Assert.AreEqual(1, timesCalled); - } - } -} \ No newline at end of file diff --git a/src/config/NServiceBus.Config.UnitTests/NServiceBus.Config.UnitTests.csproj b/src/config/NServiceBus.Config.UnitTests/NServiceBus.Config.UnitTests.csproj deleted file mode 100644 index b5ed6b75c45..00000000000 --- a/src/config/NServiceBus.Config.UnitTests/NServiceBus.Config.UnitTests.csproj +++ /dev/null @@ -1,87 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {3F2577A6-D767-4A02-92A6-725B0FA7A9C5} - Library - Properties - NServiceBus.Config.UnitTests - NServiceBus.Config.UnitTests - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\lib\Common.Logging.dll - - - False - ..\..\..\lib\Common.Logging.Log4Net.dll - - - ..\..\..\build\output\NServiceBus.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.dll - - - False - ..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll - - - False - ..\..\..\lib\Rhino.Mocks\Rhino.Mocks.dll - - - - - 3.5 - - - - - - - - - - - - - {444FAA3D-D5E1-498E-9AE1-201DB619CAF0} - NServiceBus.Config - - - - - - - - \ No newline at end of file diff --git a/src/config/NServiceBus.Config.UnitTests/Properties/AssemblyInfo.cs b/src/config/NServiceBus.Config.UnitTests/Properties/AssemblyInfo.cs deleted file mode 100644 index de1424b8b5e..00000000000 Binary files a/src/config/NServiceBus.Config.UnitTests/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/config/NServiceBus.Config.UnitTests/When_loading_types.cs b/src/config/NServiceBus.Config.UnitTests/When_loading_types.cs deleted file mode 100644 index 783ff5bad4d..00000000000 --- a/src/config/NServiceBus.Config.UnitTests/When_loading_types.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace NServiceBus.Config.UnitTests -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Reflection; - using NUnit.Framework; - - [TestFixture] - public class When_loading_types - { - List loadedTypes; - - [SetUp] - public void SetUp() - { - Configure.With(Assembly.GetExecutingAssembly()); - loadedTypes = Configure.TypesToScan.ToList(); - } - - [Test] - public void Should_exclude_the_raven_types() - { - Assert.False( - loadedTypes.Any(a => a.Namespace.StartsWith("Raven"))); - } - - [Test] - public void Should_always_include_the_core_nservicebus_types() - { - Assert.True( - loadedTypes.Any(a => a.Assembly.GetName().Name.Equals("NServiceBus.Config"))); - } - } -} - -namespace Raven -{ - public class TestClass - { } -} \ No newline at end of file diff --git a/src/config/NServiceBus.Config.UnitTests/When_scanning_assemblies.cs b/src/config/NServiceBus.Config.UnitTests/When_scanning_assemblies.cs deleted file mode 100644 index 19aba987b49..00000000000 --- a/src/config/NServiceBus.Config.UnitTests/When_scanning_assemblies.cs +++ /dev/null @@ -1,43 +0,0 @@ -namespace NServiceBus.Config.UnitTests -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Reflection; - using NUnit.Framework; - - [TestFixture] - public class When_finding_assemblies_to_scan - { - List foundAssemblies; - - [SetUp] - public void SetUp() - { - foundAssemblies = Configure.GetAssembliesInDirectory(AppDomain.CurrentDomain.BaseDirectory) - .ToList(); - } - - [Test] - public void Should_exclude_system_assemblies() - { - Assert.False( - foundAssemblies.Any(a => a.FullName.StartsWith("System"))); - } - - [Test] - public void Should_exclude_nhibernate_assemblies() - { - Assert.False( - foundAssemblies.Any(a => a.FullName.ToLower().StartsWith("nhibernate"))); - } - - [Test] - public void Should_exclude_log4net() - { - Assert.False( - foundAssemblies.Any(a => a.FullName.ToLower().StartsWith("log4net"))); - } - - } -} \ No newline at end of file diff --git a/src/config/NServiceBus.Config.sln b/src/config/NServiceBus.Config.sln deleted file mode 100644 index 57a14768efc..00000000000 --- a/src/config/NServiceBus.Config.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Config", "NServiceBus.Config\NServiceBus.Config.csproj", "{444FAA3D-D5E1-498E-9AE1-201DB619CAF0}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Config.UnitTests", "NServiceBus.Config.UnitTests\NServiceBus.Config.UnitTests.csproj", "{3F2577A6-D767-4A02-92A6-725B0FA7A9C5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {444FAA3D-D5E1-498E-9AE1-201DB619CAF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {444FAA3D-D5E1-498E-9AE1-201DB619CAF0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {444FAA3D-D5E1-498E-9AE1-201DB619CAF0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {444FAA3D-D5E1-498E-9AE1-201DB619CAF0}.Release|Any CPU.Build.0 = Release|Any CPU - {3F2577A6-D767-4A02-92A6-725B0FA7A9C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3F2577A6-D767-4A02-92A6-725B0FA7A9C5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3F2577A6-D767-4A02-92A6-725B0FA7A9C5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3F2577A6-D767-4A02-92A6-725B0FA7A9C5}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/config/NServiceBus.Config/AddressInitializer.cs b/src/config/NServiceBus.Config/AddressInitializer.cs deleted file mode 100644 index 101cfccbfc1..00000000000 --- a/src/config/NServiceBus.Config/AddressInitializer.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace NServiceBus.Config -{ - /// - /// Initializes the local address - /// - public class AddressInitializer:IWantToRunBeforeConfiguration - { - /// - /// Initialize the local address - /// - public void Init() - { - if (Address.Local == null) - Address.InitializeLocalAddress(Advanced.ConfigureSettingLocalAddressNameAction.GetLocalAddressName()); - } - } -} \ No newline at end of file diff --git a/src/config/NServiceBus.Config/AllAssemblies.cs b/src/config/NServiceBus.Config/AllAssemblies.cs deleted file mode 100644 index 36c30f826d0..00000000000 --- a/src/config/NServiceBus.Config/AllAssemblies.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Reflection; -using System.Web; - -namespace NServiceBus -{ - /// - /// Class for specifying which assemblies not to load. - /// - public class AllAssemblies : IEnumerable - { - /// - /// Indicate that the given assembly is not to be used. - /// Use the 'And' method to indicate other assemblies to be skipped. - /// - /// - /// - public static AllAssemblies Except(string assembly) - { - return new AllAssemblies { assembliesToSkip = new List(new[] { assembly })}; - } - - /// - /// Indicate that the given assembly should not be used. - /// You can call this method multiple times. - /// - /// - /// - public AllAssemblies And(string assembly) - { - if (!assembliesToSkip.Contains(assembly)) - assembliesToSkip.Add(assembly); - - return this; - } - - /// - /// Returns an enumerator for looping over the assemblies to be loaded. - /// - /// - public IEnumerator GetEnumerator() - { - return Configure.GetAssembliesInDirectory(directory, assembliesToSkip.ToArray()).GetEnumerator(); - } - - /// - /// Return a non-generic enumerator. - /// - /// - IEnumerator IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - private AllAssemblies() - { - if (HttpContext.Current != null) - directory = HttpRuntime.BinDirectory; - else - directory = AppDomain.CurrentDomain.BaseDirectory; - } - - private List assembliesToSkip; - private readonly string directory; - } -} diff --git a/src/config/NServiceBus.Config/Configure.cs b/src/config/NServiceBus.Config/Configure.cs deleted file mode 100644 index b2700c3cf22..00000000000 --- a/src/config/NServiceBus.Config/Configure.cs +++ /dev/null @@ -1,473 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Web; -using Common.Logging; -using NServiceBus.Config; -using NServiceBus.Config.ConfigurationSource; -using NServiceBus.ObjectBuilder; -using System.IO; -using System.Reflection; - -namespace NServiceBus -{ - using Config.Conventions; - - /// - /// Central configuration entry point for NServiceBus. - /// - public class Configure - { - static Configure() - { - ConfigurationSource = new DefaultConfigurationSource(); - } - - /// - /// Provides static access to the configuration object. - /// - public static Configure Instance - { - get - { - //we can't check for null here since that would break the way we do extension methods (the must be on a instance) - return instance; - } - } - - /// - /// True if any of the Configure.With() has been called - /// - /// - public static bool WithHasBeenCalled() - { - return instance != null; - } - - /// - /// Event raised when configuration is complete - /// - public static event Action ConfigurationComplete; - - /// - /// Gets/sets the builder. - /// Setting the builder should only be done by NServiceBus framework code. - /// - public IBuilder Builder - { - get - { - if (builder == null) - throw new InvalidOperationException("You can't access Configure.Instance.Builder before calling specifying a builder. Please add a call to Configure.DefaultBuilder() or any of the other supported builders to set one up"); - - return builder; - - } - set { builder = value; } - } - - /// - /// True if a builder has been defined - /// - /// - public static bool BuilderIsConfigured() - { - if (!WithHasBeenCalled()) - return false; - - return Instance.HasBuilder(); - } - - bool HasBuilder() - { - return builder != null && configurer != null; - } - - - IBuilder builder; - - static bool initialized { get; set; } - - /// - /// Gets/sets the configuration source to be used by NServiceBus. - /// - public static IConfigurationSource ConfigurationSource { get; set; } - - /// - /// Sets the current configuration source - /// - /// - /// - public Configure CustomConfigurationSource(IConfigurationSource configurationSource) - { - ConfigurationSource = configurationSource; - return this; - } - - /// - /// Gets/sets the object used to configure components. - /// This object should eventually reference the same container as the Builder. - /// - public IConfigureComponents Configurer - { - get - { - if (configurer == null) - throw new InvalidOperationException("You can't access Configure.Instance.Configurer before calling specifying a builder. Please add a call to Configure.DefaultBuilder() or any of the other supported builders to set one up"); - - return configurer; - } - set - { - bool invoke = configurer == null; - configurer = value; - WireUpConfigSectionOverrides(); - if (invoke) - InvokeBeforeConfigurationInitializers(); - } - } - - private void InvokeBeforeConfigurationInitializers() - { - TypesToScan.Where(t => typeof(IWantToRunBeforeConfiguration).IsAssignableFrom(t) && !(t.IsAbstract || t.IsInterface)) - .ToList().ForEach(t => - { - var ini = (IWantToRunBeforeConfiguration)Activator.CreateInstance(t); - ini.Init(); - }); - } - - private IConfigureComponents configurer; - - void WireUpConfigSectionOverrides() - { - TypesToScan - .Where(t => t.GetInterfaces().Any(IsGenericConfigSource)) - .ToList().ForEach(t => configurer.ConfigureComponent(t, DependencyLifecycle.InstancePerCall)); - } - - /// - /// Protected constructor to enable creation only via the With method. - /// - protected Configure() - { - } - - /// - /// Creates a new configuration object scanning assemblies - /// in the regular runtime directory. - /// - /// - public static Configure With() - { - if (HttpRuntime.AppDomainAppId != null) - return With(HttpRuntime.BinDirectory); - - return With(AppDomain.CurrentDomain.BaseDirectory); - } - - /// - /// Configures NServiceBus to scan for assemblies - /// in the relevant web directory instead of regular - /// runtime directory. - /// - /// - [Obsolete("This method is obsolete, it has been replaced by NServiceBus.Configure.With.", false)] - public static Configure WithWeb() - { - return With(); - } - - /// - /// Configures NServiceBus to scan for assemblies - /// in the given directory rather than the regular - /// runtime directory. - /// - /// - /// - public static Configure With(string probeDirectory) - { - lastProbeDirectory = probeDirectory; - return With(GetAssembliesInDirectory(probeDirectory)); - } - - /// - /// Configures NServiceBus to use the types found in the given assemblies. - /// - /// - /// - public static Configure With(IEnumerable assemblies) - { - return With(assemblies.ToArray()); - } - - /// - /// Configures nServiceBus to scan the given assemblies only. - /// - /// - /// - public static Configure With(params Assembly[] assemblies) - { - var types = GetAllowedTypes(assemblies); - - return With(types); - } - - /// - /// Configures nServiceBus to scan the given types. - /// - /// - /// - public static Configure With(IEnumerable typesToScan) - { - if (instance == null) - instance = new Configure(); - - TypesToScan = typesToScan.Union(GetAllowedTypes(Assembly.GetExecutingAssembly())); - - if (HttpRuntime.AppDomainAppId == null) - { - var hostPath = Path.Combine(lastProbeDirectory ?? AppDomain.CurrentDomain.BaseDirectory, "NServiceBus.Host.exe"); - if (File.Exists(hostPath)) - { - TypesToScan = TypesToScan.Union(GetAllowedTypes(Assembly.LoadFrom(hostPath))); - } - } - - Logger.DebugFormat("Number of types to scan: {0}", TypesToScan.Count()); - - return instance; - } - - /// - /// Run a custom action at configuration time - useful for performing additional configuration not exposed by the fluent interface. - /// - /// - /// - public Configure RunCustomAction(Action action) - { - action(); - - return this; - } - - /// - /// Provides an instance to a startable bus. - /// - /// - public IStartableBus CreateBus() - { - Initialize(); - - if (Configurer.HasComponent()) - return Builder.Build(); - - return null; - } - - - /// - /// Finalizes the configuration by invoking all initializers. - /// - public void Initialize() - { - if (initialized) - return; - - ForAllTypes(t => Configurer.ConfigureComponent(t, DependencyLifecycle.InstancePerCall)); - - - ForAllTypes(t => - { - var ini = (IWantToRunBeforeConfiguration)Activator.CreateInstance(t); - ini.Init(); - }); - - ForAllTypes(t => - { - var ini = (INeedInitialization)Activator.CreateInstance(t); - ini.Init(); - }); - - ForAllTypes(t => - { - var ini = (IWantToRunBeforeConfigurationIsFinalized)Activator.CreateInstance(t); - ini.Run(); - }); - - initialized = true; - - if (ConfigurationComplete != null) - ConfigurationComplete(); - - Builder.BuildAll() - .ToList().ForEach(o => o.Run()); - } - - /// - /// Applies the given action to all the scanned types that can be assigned to T - /// - /// - /// - public void ForAllTypes(Action action) where T : class - { - TypesToScan.Where(t => typeof(T).IsAssignableFrom(t) && !(t.IsAbstract || t.IsInterface)) - .ToList().ForEach(action); - } - - /// - /// Returns types in assemblies found in the current directory. - /// - public static IEnumerable TypesToScan { get; private set; } - - /// - /// Returns the requested config section using the current configuration source - /// - /// - /// - public static T GetConfigSection() where T : class,new() - { - if (instance != null) - if (instance.configurer != null) - if (instance.configurer.HasComponent>()) - { - var configSource = instance.Builder.Build>(); - if (configSource != null) - return configSource.GetConfiguration(); - } - - return ConfigurationSource.GetConfiguration(); - } - - /// - /// Load and return all assemblies in the given directory except the given ones to exclude - /// - /// - /// - /// - public static IEnumerable GetAssembliesInDirectory(string path, params string[] assembliesToSkip) - { - foreach (var a in GetAssembliesInDirectoryWithExtension(path, "*.exe", assembliesToSkip)) - yield return a; - foreach (var a in GetAssembliesInDirectoryWithExtension(path, "*.dll", assembliesToSkip)) - yield return a; - } - - /// - /// Initialized the bus in send only mode - /// - /// - public IBus SendOnly() - { - SendOnlyMode = true; - Initialize(); - - return Builder.Build(); - } - - /// - /// True if this endpoint is operating in send only mode - /// - public static bool SendOnlyMode { get; private set; } - - /// - /// The name of this endpoint - /// - public static string EndpointName - { - get { return GetEndpointNameAction(); } - } - - /// - /// The function used to get the name of this endpoint - /// - public static Func GetEndpointNameAction = () => DefaultEndpointName.Get(); - - - private static IEnumerable GetAllowedTypes(params Assembly[] assemblies) - { - var types = new List(); - Array.ForEach( - assemblies, - a => - { - try - { - types.AddRange(a.GetTypes() - .Where(t => !t.IsValueType && - (t.FullName == null || - !defaultTypeExclusions.Any( - exclusion => t.FullName.ToLower().StartsWith(exclusion))))); - } - catch (ReflectionTypeLoadException e) - { - var sb = new StringBuilder(); - sb.Append(string.Format("Could not scan assembly: {0}. Exception message {1}.", a.FullName, e)); - if (e.LoaderExceptions.Any()) - { - sb.Append(Environment.NewLine + "Scanned type errors: "); - foreach (var ex in e.LoaderExceptions) - sb.Append(Environment.NewLine + ex.Message); - } - LogManager.GetLogger(typeof(Configure)).Warn(sb.ToString()); - //intentionally swallow exception - } - }); - return types; - } - - private static IEnumerable GetAssembliesInDirectoryWithExtension(string path, string extension, params string[] assembliesToSkip) - { - var result = new List(); - - foreach (FileInfo file in new DirectoryInfo(path).GetFiles(extension, SearchOption.AllDirectories)) - { - try - { - if (defaultAssemblyExclusions.Any(exclusion => file.Name.ToLower().StartsWith(exclusion))) - continue; - - if (assembliesToSkip.Contains(file.Name, StringComparer.InvariantCultureIgnoreCase)) - continue; - - result.Add(Assembly.LoadFrom(file.FullName)); - } - catch (BadImageFormatException bif) - { - if (bif.FileName.ToLower().Contains("system.data.sqlite.dll")) - throw new BadImageFormatException( - "You've installed the wrong version of System.Data.SQLite.dll on this machine. If this machine is x86, this dll should be roughly 800KB. If this machine is x64, this dll should be roughly 1MB. You can find the x86 file under /binaries and the x64 version under /binaries/x64. *If you're running the samples, a quick fix would be to copy the file from /binaries/x64 over the file in /binaries - you should 'clean' your solution and rebuild after.", - bif.FileName, bif); - - throw new InvalidOperationException( - "Could not load " + file.FullName + - ". Consider using 'Configure.With(AllAssemblies.Except(\"" + file.Name + "\"))' to tell NServiceBus not to load this file.", - bif); - } - } - - return result; - } - - private static bool IsGenericConfigSource(Type t) - { - if (!t.IsGenericType) - return false; - - var args = t.GetGenericArguments(); - if (args.Length != 1) - return false; - - return typeof(IProvideConfiguration<>).MakeGenericType(args).IsAssignableFrom(t); - } - - static string lastProbeDirectory; - static Configure instance; - static ILog Logger = LogManager.GetLogger("NServiceBus.Config"); - static readonly IEnumerable defaultAssemblyExclusions = new[] { "system.", "nhibernate.", "log4net.", "raven.server.", - "raven.client.", "raven.database", "raven.munin.", "raven.storage.", "raven.abstractions.", "lucene.net.", "bouncycastle.crypto", - "esent.interop.", "asyncctplibrary."}; - static readonly IEnumerable defaultTypeExclusions = new[] { "raven.", "system.", "lucene.", "magnum." }; - } -} \ No newline at end of file diff --git a/src/config/NServiceBus.Config/ConfigureSettingLocalAddressNameAction.cs b/src/config/NServiceBus.Config/ConfigureSettingLocalAddressNameAction.cs deleted file mode 100644 index 5e83bb89730..00000000000 --- a/src/config/NServiceBus.Config/ConfigureSettingLocalAddressNameAction.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; - -namespace NServiceBus.Config.Advanced -{ - /// - /// Allow overriding local address name. - /// - public static class ConfigureSettingLocalAddressNameAction - { - /// - /// By default local address should equal endpoint name. - /// See: Here for more details. - /// - private static Func defineLocalAddressNameFunc = Configure.GetEndpointNameAction; - - /// - /// Set a function that overrides the default naming of NServiceBus local addresses. - /// See: Here for more details. - /// - /// - /// - /// - public static Configure DefineLocalAddressNameFunc(this Configure config, Func setLocalAddressNameFunc) - { - defineLocalAddressNameFunc = setLocalAddressNameFunc; - return config; - } - /// - /// Execute function that returns the NServiceBus local addresses name. If not override by the user, NServiceBus defaults will be used. - /// See: Here for more details. - /// - /// - public static string GetLocalAddressName() - { - return defineLocalAddressNameFunc(); - } - } -} diff --git a/src/config/NServiceBus.Config/Conventions/DefaultEndpointName.cs b/src/config/NServiceBus.Config/Conventions/DefaultEndpointName.cs deleted file mode 100644 index d290ef2428b..00000000000 --- a/src/config/NServiceBus.Config/Conventions/DefaultEndpointName.cs +++ /dev/null @@ -1,44 +0,0 @@ -namespace NServiceBus.Config.Conventions -{ - using System; - using System.Diagnostics; - using System.Linq; - using System.Reflection; - using System.Web; - - /// - /// The default name for a endpoint - /// - public static class DefaultEndpointName - { - /// - /// Gets the name of this endpoint - /// - /// - public static string Get() - { - var entryAssembly = Assembly.GetEntryAssembly(); - if (entryAssembly != null && entryAssembly.EntryPoint != null) - { - return entryAssembly.EntryPoint.ReflectedType.Namespace ?? - entryAssembly.EntryPoint.ReflectedType.Assembly.GetName().Name; - } - - var stackFrames = new StackTrace().GetFrames(); - StackFrame targetFrame = null; - if (stackFrames != null) - { - targetFrame = - stackFrames.FirstOrDefault( - f => typeof (HttpApplication).IsAssignableFrom(f.GetMethod().DeclaringType)); - } - - if (targetFrame != null) - return targetFrame.GetMethod().ReflectedType.Namespace ?? - targetFrame.GetMethod().ReflectedType.Assembly.GetName().Name; - - throw new InvalidOperationException( - "No endpoint name could be generated, please specify your own convention using Configure.DefineEndpointName(...)"); - } - } -} \ No newline at end of file diff --git a/src/config/NServiceBus.Config/Conventions/MessageConventions.cs b/src/config/NServiceBus.Config/Conventions/MessageConventions.cs deleted file mode 100644 index 537f19608c6..00000000000 --- a/src/config/NServiceBus.Config/Conventions/MessageConventions.cs +++ /dev/null @@ -1,88 +0,0 @@ -namespace NServiceBus -{ - using System; - using System.Reflection; - - /// - /// Static extension methods to Configure. - /// - public static class MessageConventions - { - /// - /// Sets the function to be used to evaluate whether a type is a message. - /// - /// - /// - public static Configure DefiningMessagesAs(this Configure config, Func definesMessageType) - { - MessageConventionExtensions.IsMessageTypeAction = definesMessageType; - return config; - } - - /// - /// Sets the function to be used to evaluate whether a type is a commands. - /// - /// - /// - public static Configure DefiningCommandsAs(this Configure config, Func definesCommandType) - { - MessageConventionExtensions.IsCommandTypeAction = definesCommandType; - return config; - } - - /// - /// Sets the function to be used to evaluate whether a type is a event. - /// - /// - /// - public static Configure DefiningEventsAs(this Configure config, Func definesEventType) - { - MessageConventionExtensions.IsEventTypeAction = definesEventType; - return config; - } - - /// - /// Sets the function to be used to evaluate whether a property should be encrypted or not. - /// - /// - /// - public static Configure DefiningEncryptedPropertiesAs(this Configure config, Func definesEncryptedProperty) - { - MessageConventionExtensions.IsEncryptedPropertyAction = definesEncryptedProperty; - return config; - } - - /// - /// Sets the function to be used to evaluate whether a property should be sent via the DataBus or not. - /// - /// - /// - public static Configure DefiningDataBusPropertiesAs(this Configure config, Func definesDataBusProperty) - { - MessageConventionExtensions.IsDataBusPropertyAction = definesDataBusProperty; - return config; - } - - /// - /// Sets the function to be used to evaluate whether a message has a time to be received. - /// - /// - /// - public static Configure DefiningTimeToBeReceivedAs(this Configure config, Func retrieveTimeToBeReceived) - { - MessageConventionExtensions.TimeToBeReceivedAction = retrieveTimeToBeReceived; - return config; - } - - /// - /// Sets the function to be used to evaluate whether a type is an express message or not. - /// - /// - /// - public static Configure DefiningExpressMessagesAs(this Configure config, Func definesExpressMessageType) - { - MessageConventionExtensions.IsExpressMessageAction = definesExpressMessageType; - return config; - } - } -} diff --git a/src/config/NServiceBus.Config/Conventions/SystemMessageConventions.cs b/src/config/NServiceBus.Config/Conventions/SystemMessageConventions.cs deleted file mode 100644 index c4123b7e9ec..00000000000 --- a/src/config/NServiceBus.Config/Conventions/SystemMessageConventions.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace NServiceBus.Config.Conventions -{ - /// - /// Define system message convention - /// - public static class SystemMessageConventions - { - /// - /// Add system messages convention - /// - /// - /// - public static Configure AddSystemMessagesAs(this Configure config, Func definesMessageType) - { - MessageConventionExtensions.AddSystemMessagesConventions(definesMessageType); - return config; - } - } -} diff --git a/src/config/NServiceBus.Config/INeedInitialization.cs b/src/config/NServiceBus.Config/INeedInitialization.cs deleted file mode 100644 index 83eaa89edf8..00000000000 --- a/src/config/NServiceBus.Config/INeedInitialization.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace NServiceBus.Config -{ - /// - /// Implementers will be called after NServiceBus.Configure.With completes and a container - /// has been set. - /// - public interface INeedInitialization - { - /// - /// Implementers will include custom initialization code here. - /// - void Init(); - } -} diff --git a/src/config/NServiceBus.Config/NServiceBus.Config.csproj b/src/config/NServiceBus.Config/NServiceBus.Config.csproj deleted file mode 100644 index cdd61b92138..00000000000 --- a/src/config/NServiceBus.Config/NServiceBus.Config.csproj +++ /dev/null @@ -1,125 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {444FAA3D-D5E1-498E-9AE1-201DB619CAF0} - Library - Properties - NServiceBus.Config - NServiceBus.Config - v4.0 - 512 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\NServiceBus.Config.XML - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\NServiceBus.Config.XML - AllRules.ruleset - - - - False - ..\..\..\lib\Common.Logging.dll - False - - - False - ..\..\..\build\output\NServiceBus.dll - False - - - False - ..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.dll - False - - - - - 3.5 - - - - 3.0 - - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - copy /Y "$(ProjectDir)$(OutDir)*.*" "$(ProjectDir)..\..\..\build\" - - \ No newline at end of file diff --git a/src/config/NServiceBus.Config/Properties/AssemblyInfo.cs b/src/config/NServiceBus.Config/Properties/AssemblyInfo.cs deleted file mode 100644 index 4e950c0a3e7..00000000000 Binary files a/src/config/NServiceBus.Config/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/core/NServiceBus.Saga/ISagaEntity.cs b/src/core/NServiceBus.Saga/ISagaEntity.cs deleted file mode 100644 index eb7353d7dd2..00000000000 --- a/src/core/NServiceBus.Saga/ISagaEntity.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; - -namespace NServiceBus.Saga -{ - /// - /// Defines the basic data used by long-running processes. - /// - public interface ISagaEntity - { - /// - /// Gets/sets the Id of the process. Do NOT generate this value in your code. - /// The value of the Id will be generated automatically to provide the - /// best performance for saving in a database. - /// - /// - /// The reason Guid is used for process Id is that messages containing this Id need - /// to be sent by the process even before it is persisted. - /// - Guid Id { get; set; } - - /// - /// Contains the return address of the endpoint that caused the process to run. - /// - string Originator { get; set; } - - /// - /// Contains the Id of the message which caused the saga to start. - /// This is needed so that when we reply to the Originator, any - /// registered callbacks will be fired correctly. - /// - string OriginalMessageId { get; set; } - } - - /// - /// The saga data that will be persisted. - /// - public interface IContainSagaData : ISagaEntity {} -} diff --git a/src/core/NServiceBus.Saga/ISagaMessage.cs b/src/core/NServiceBus.Saga/ISagaMessage.cs deleted file mode 100644 index 9c03c705de7..00000000000 --- a/src/core/NServiceBus.Saga/ISagaMessage.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -namespace NServiceBus.Saga -{ - /// - /// An interface used to mark messages as requiring the attention of the - /// saga infrastructure. - /// - [Obsolete("Auto correlation for sagas are now handled by NServiceBus without the need to implement the ISagaMessage interface. You can safely remove this interface",false)] - public interface ISagaMessage : IMessage - { - /// - /// Gets/sets the Id of the saga the message is related to. - /// - Guid SagaId { get; set; } - } -} diff --git a/src/core/NServiceBus.Saga/ISagaStartedBy.cs b/src/core/NServiceBus.Saga/ISagaStartedBy.cs deleted file mode 100644 index 9c863b32ac6..00000000000 --- a/src/core/NServiceBus.Saga/ISagaStartedBy.cs +++ /dev/null @@ -1,21 +0,0 @@ - -namespace NServiceBus.Saga -{ - /// - /// Use this interface to signify that when a message of the given type is - /// received, if a saga cannot be found by an - /// the saga will be created. - /// - /// - public interface ISagaStartedBy : IMessageHandler - { - } - - /// - /// Use this interface to signify that when a message of the given type is - /// received, if a saga cannot be found by an - /// the saga will be created. - /// - /// - public interface IAmStartedByMessages : ISagaStartedBy {} -} diff --git a/src/core/NServiceBus.Saga/ITimeoutState.cs b/src/core/NServiceBus.Saga/ITimeoutState.cs deleted file mode 100644 index 1f7b90b8682..00000000000 --- a/src/core/NServiceBus.Saga/ITimeoutState.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace NServiceBus.Saga -{ - using System; - - /// - /// Marker interface for timeout state messages - /// - [Obsolete("Timeouts no longer need to inherit from ITimeoutState so this interface can safely be removed",false)] - public interface ITimeoutState : IMessage - { - } -} \ No newline at end of file diff --git a/src/core/NServiceBus.Saga/ITimeoutable.cs b/src/core/NServiceBus.Saga/ITimeoutable.cs deleted file mode 100644 index 99ff2084889..00000000000 --- a/src/core/NServiceBus.Saga/ITimeoutable.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NServiceBus.Saga -{ - /// - /// Interface used by the saga infrastructure for notifying sagas about a timeout. - /// - public interface ITimeoutable - { - /// - /// Indicates to the saga that a timeout has occurred, - /// passing in the state object previously received from the saga. - /// - /// - void Timeout(object state); - } -} diff --git a/src/core/NServiceBus.Saga/NServiceBus.Saga.csproj b/src/core/NServiceBus.Saga/NServiceBus.Saga.csproj deleted file mode 100644 index 547dea4a258..00000000000 --- a/src/core/NServiceBus.Saga/NServiceBus.Saga.csproj +++ /dev/null @@ -1,124 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {C1DE5465-4694-475A-8D06-E17733C41D69} - Library - Properties - NServiceBus.Saga - NServiceBus.Saga - - - - - v4.0 - true - ..\..\NServiceBus.snk - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\NServiceBus.Saga.XML - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\NServiceBus.Saga.XML - AllRules.ruleset - - - - - - 3.5 - - - - - - - - - - - - - - Code - - - - - - - - - - - - - - - {73867D40-8CBB-48E9-BFFA-12BBDD48A341} - NServiceBus - False - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - copy /Y "$(ProjectDir)$(OutDir)*.*" "$(ProjectDir)..\..\..\build\" - - \ No newline at end of file diff --git a/src/core/NServiceBus.Saga/Properties/AssemblyInfo.cs b/src/core/NServiceBus.Saga/Properties/AssemblyInfo.cs deleted file mode 100644 index d4822f0194c..00000000000 Binary files a/src/core/NServiceBus.Saga/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/core/NServiceBus.Saga/Saga.cs b/src/core/NServiceBus.Saga/Saga.cs deleted file mode 100644 index 6e372b90666..00000000000 --- a/src/core/NServiceBus.Saga/Saga.cs +++ /dev/null @@ -1,242 +0,0 @@ -using System; -using System.Linq.Expressions; - -namespace NServiceBus.Saga -{ - using System.Linq; - - /// - /// This class is used to define sagas containing data and handling a message. - /// To handle more message types, implement - /// for the relevant types. - /// To signify that the receipt of a message should start this saga, - /// implement for the relevant message type. - /// - /// A type that implements . - public abstract class - Saga : IConfigurable, ISaga, IHandleMessages where T : ISagaEntity - { - /// - /// The saga's strongly typed data. - /// - public T Data { get; set; } - - /// - /// A more generic projection on . - /// - public ISagaEntity Entity - { - get { return Data; } - set { Data = (T)value; } - } - - private bool configuring; - void IConfigurable.Configure() - { - configuring = true; - ConfigureHowToFindSaga(); - configuring = false; - } - - /// - /// Override this method in order to configure how this saga's data should be found. - /// Call ConfigureMapping<TMessage> for each property of each message you want - /// to use for lookup. - /// - public virtual void ConfigureHowToFindSaga() - { - } - - /// - /// When the infrastructure is handling a message of the given type - /// this specifies which message property should be matched to - /// which saga entity property in the persistent saga store. - /// - /// - /// - /// - protected virtual void ConfigureMapping(Expression> sagaEntityProperty, Expression> messageProperty) - { - if (!configuring) - throw new InvalidOperationException("Cannot configure mappings outside of 'ConfigureHowToFindSaga'."); - - SagaMessageFindingConfiguration.ConfigureMapping(sagaEntityProperty, messageProperty); - } - - - /// - /// Called by saga to notify the infrastructure when attempting to reply to message where the originator is null - /// - public IHandleReplyingToNullOriginator HandleReplyingToNullOriginator { get; set; } - - - /// - /// Bus object used for retrieving the sender endpoint which caused this saga to start. - /// Necessary for . - /// - public IBus Bus - { - get - { - if (bus == null) - throw new InvalidOperationException("No IBus instance availble, please configure one and also verify that you're not defining your own Bus property in your saga since that hides the one in the base class"); - - return bus; - } - - set { bus = value; } - } - - IBus bus; - - /// - /// Object used to configure mapping between saga properties and message properties - /// for the purposes of finding sagas when a message arrives. - /// - /// Do NOT use at runtime (handling messages) - it will be null. - /// - public IConfigureHowToFindSagaWithMessage SagaMessageFindingConfiguration { get; set; } - - /// - /// Indicates that the saga is complete. - /// In order to set this value, use the method. - /// - public bool Completed { get; private set; } - - - /// - /// Request for a timeout to occur at the given time - /// - /// - protected void RequestUtcTimeout(DateTime at) - { - RequestUtcTimeout(at, Bus.CreateInstance()); - } - - /// - /// Request for a timeout to occur at the given time - /// - /// - /// - protected void RequestUtcTimeout(DateTime at, Action action) - { - RequestUtcTimeout(at, Bus.CreateInstance(action)); - } - - - /// - /// Request for a timeout to occur at the given time - /// - /// - /// - protected void RequestUtcTimeout(DateTime at, TTimeoutmessageType timeoutMessage) - { - if (at.Kind == DateTimeKind.Unspecified) - throw new InvalidOperationException("Kind property of DateTime 'at' must be specified."); - - object toSend = timeoutMessage; - - if (!typeof(TTimeoutmessageType).IsMessageType()) - toSend = new TimeoutMessage(at, Data, toSend); - - SetHeaders(toSend); - - Bus.Defer(at, toSend); - } - - /// - /// Request for a timeout to occur within the give timespan - /// - /// - protected void RequestUtcTimeout(TimeSpan within) - { - RequestUtcTimeout(within, Bus.CreateInstance()); - } - - /// - /// Request for a timeout to occur within the give timespan - /// - /// - /// - protected void RequestUtcTimeout(TimeSpan within,Action action) - { - RequestUtcTimeout(within, Bus.CreateInstance(action)); - } - - /// - /// Request for a timeout to occur within the give timespan - /// - /// - /// - protected void RequestUtcTimeout(TimeSpan within, TTimeoutmessageType timeoutMessage) - { - object toSend = timeoutMessage; - - if (!typeof(TTimeoutmessageType).IsMessageType()) - toSend = new TimeoutMessage(within, Data, toSend); - - SetHeaders(toSend); - - Bus.Defer(within, toSend); - } - - private void SetHeaders(object toSend) - { - toSend.SetHeader(Headers.SagaId, Data.Id.ToString()); - toSend.SetHeader(Headers.SagaType, this.GetType().AssemblyQualifiedName); - } - - /// - /// Sends the given messages using the bus to the endpoint that caused this saga to start. - /// - /// - protected virtual void ReplyToOriginator(params object[] messages) - { - if (string.IsNullOrEmpty(Data.Originator)) - HandleReplyingToNullOriginator.TriedToReplyToNullOriginator(); - else - Bus.Send(Data.Originator, Data.OriginalMessageId, messages); - } - - /// - /// Instantiates a message of the given type, setting its properties using the given action, - /// and sends it using the bus to the endpoint that caused this saga to start. - /// - /// - /// - protected virtual void ReplyToOriginator(Action messageConstructor) - { - if (messageConstructor != null) - ReplyToOriginator(Bus.CreateInstance(messageConstructor)); - else - ReplyToOriginator(null); - } - - /// - /// Marks the saga as complete. - /// This may result in the sagas state being deleted by the persister. - /// - protected virtual void MarkAsComplete() - { - Completed = true; - } - - /// - /// Notifies that the timeout it previously requested occurred. - /// - /// The object passed as the "withState" parameter to RequestTimeout. - [Obsolete("2.6 style timeouts has been replaced. Please implement IHandleTimeouts instead",false)] - public virtual void Timeout(object state) - { - } - - /// - /// Message handler for Timeout Message - /// - /// Timeout Message - public void Handle(TimeoutMessage message) - { - Timeout(message.State); - } - } -} diff --git a/src/core/NServiceBus.Saga/TimeoutMessage.cs b/src/core/NServiceBus.Saga/TimeoutMessage.cs deleted file mode 100644 index c160501fc45..00000000000 --- a/src/core/NServiceBus.Saga/TimeoutMessage.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; - -namespace NServiceBus.Saga -{ - /// - /// A message to signal a saga that a reminder was set. - /// - [Serializable] - [Recoverable] - public class TimeoutMessage - { - /// - /// Default constructor for serialization purposes. - /// - public TimeoutMessage() { } - - /// - /// Indicate a timeout at the expiration time for the given saga maintaining the given state. - /// - /// - /// - /// - public TimeoutMessage(DateTime expiration, ISagaEntity saga, object state) - { - expires = DateTime.SpecifyKind(expiration, DateTimeKind.Utc); - SagaId = saga.Id; - State = state; - } - - /// - /// Indicate a timeout within the given time for the given saga maintaing the given state. - /// - /// - /// - /// - public TimeoutMessage(TimeSpan expireIn, ISagaEntity saga, object state) : - this(DateTime.UtcNow + expireIn, saga, state) - { - - } - - /// - /// Signal to the timeout manager that all other - /// objects can be cleared for the given . - /// - /// - /// - public TimeoutMessage(ISagaEntity saga, bool clear) - { - SagaId = saga.Id; - ClearTimeout = clear; - } - - private DateTime expires; - - /// - /// Gets/sets the date and time at which the timeout message is due to expire. - /// Values are stored as . - /// - public DateTime Expires - { - get { return expires; } - set { expires = DateTime.SpecifyKind(value, DateTimeKind.Utc); } - } - - /// - /// Gets/sets the Id of the workflow the TimeoutMessage is connected to. - /// - public Guid SagaId { get; set; } - - /// - /// Should be used for data to differentiate between various - /// timeout occurrences. - /// - public object State { get; set; } - - /// - /// When true, signals to the timeout manager that all other objects - /// can be cleared for the given . - /// - public bool ClearTimeout { get; set; } - - /// - /// Gets whether or not the TimeoutMessage has expired. - /// - /// true if the message has expired, otherwise false. - public bool HasNotExpired() - { - return DateTime.UtcNow < expires; - } - } -} diff --git a/src/core/NServiceBus.sln b/src/core/NServiceBus.sln deleted file mode 100644 index 8ac5194365b..00000000000 --- a/src/core/NServiceBus.sln +++ /dev/null @@ -1,32 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus", "NServiceBus\NServiceBus.csproj", "{73867D40-8CBB-48E9-BFFA-12BBDD48A341}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Saga", "NServiceBus.Saga\NServiceBus.Saga.csproj", "{C1DE5465-4694-475A-8D06-E17733C41D69}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Core.Tests", "..\..\tests\core\NServiceBus.Core.Tests\NServiceBus.Core.Tests.csproj", "{76212654-6B5B-4DDA-8F52-0EA6EF554B3D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Debug|Any CPU.Build.0 = Debug|Any CPU - {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Release|Any CPU.ActiveCfg = Release|Any CPU - {73867D40-8CBB-48E9-BFFA-12BBDD48A341}.Release|Any CPU.Build.0 = Release|Any CPU - {C1DE5465-4694-475A-8D06-E17733C41D69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C1DE5465-4694-475A-8D06-E17733C41D69}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C1DE5465-4694-475A-8D06-E17733C41D69}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C1DE5465-4694-475A-8D06-E17733C41D69}.Release|Any CPU.Build.0 = Release|Any CPU - {76212654-6B5B-4DDA-8F52-0EA6EF554B3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {76212654-6B5B-4DDA-8F52-0EA6EF554B3D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {76212654-6B5B-4DDA-8F52-0EA6EF554B3D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {76212654-6B5B-4DDA-8F52-0EA6EF554B3D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/core/NServiceBus/Address.cs b/src/core/NServiceBus/Address.cs deleted file mode 100644 index babdb585c1b..00000000000 --- a/src/core/NServiceBus/Address.cs +++ /dev/null @@ -1,232 +0,0 @@ -using System; -using System.Net; -using System.Runtime.Serialization; - -namespace NServiceBus -{ - /// - /// Abstraction for an address on the NServiceBus network. - /// - [Serializable] - public class Address : ISerializable - { - private static AddressMode addressMode = AddressMode.Local; - private static string defaultMachine = Environment.MachineName; - private static bool preventChanges; - - /// - /// Get the address of this endpoint. - /// - public static Address Local { get; private set; } - - /// - /// Get the address of this endpoint. - /// - public static Address Self - { - get - { - return new Address("__self", "localhost"); - } - } - - /// - /// Get the address of this endpoint. - /// - public static Address Undefined - { - get - { - return new Address("", ""); - } - } - - /// - /// Sets the address of this endpoint. - /// Will throw an exception if overwriting a previous value (but value will still be set). - /// - /// - public static void InitializeLocalAddress(string queue) - { - Local = Parse(queue); - - if (preventChanges) - throw new InvalidOperationException("Overwriting a previously set local address is a very dangerous operation. If you think that your scenario warrants it, you can catch this exception and continue."); - } - - /// - /// Sets the address mode, can only be done as long as the local address is not been initialized.By default the default machine equals Environment.MachineName - /// - /// - /// - public static void OverrideDefaultMachine(string machineName) - { - defaultMachine = machineName; - - if (preventChanges) - throw new InvalidOperationException("Overwriting a previously set default machine name is a very dangerous operation. If you think that your scenario warrants it, you can catch this exception and continue."); - } - - /// - /// Sets the name of the machine to be used when none is specified in the address. - /// - /// - /// - public static void InitializeAddressMode(AddressMode mode) - { - addressMode = mode; - - if (preventChanges) - throw new InvalidOperationException("Overwriting a previously set address mode is a very dangerous operation. If you think that your scenario warrants it, you can catch this exception and continue."); - } - - /// - /// Parses a string and returns an Address. - /// - /// - /// - public static Address Parse(string destination) - { - if (string.IsNullOrEmpty(destination)) - throw new InvalidOperationException("Invalid destination address specified"); - - var arr = destination.Split('@'); - - var queue = arr[0]; - var machine = defaultMachine; - - if (arr.Length == 2) - if (arr[1] != "." && arr[1].ToLower() != "localhost" && arr[1] != IPAddress.Loopback.ToString()) - machine = arr[1]; - - return new Address(queue, machine); - } - - /// - /// Instantiate a new Address for a known queue on a given machine. - /// - /// - /// - public Address(string queueName, string machineName) - { - Queue = queueName.ToLower(); - Machine = addressMode == AddressMode.Local ? machineName.ToLower() : machineName; - } - - /// - /// Deserializes an Address. - /// - /// - /// - protected Address(SerializationInfo info, StreamingContext context) - { - Queue = info.GetString("Queue"); - Machine = info.GetString("Machine"); - } - - void ISerializable.GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("Queue", Queue); - info.AddValue("Machine", Machine); - } - - /// - /// Creates a new Address whose Queue is derived from the Queue of the existing Address - /// together with the provided qualifier. For example: queue.qualifier@machine - /// - /// - /// - public Address SubScope(string qualifier) - { - return new Address(Queue + "." + qualifier, Machine); - } - - /// - /// Provides a hash code of the Address. - /// - /// - public override int GetHashCode() - { - unchecked - { - return ((Queue != null ? Queue.GetHashCode() : 0) * 397) ^ (Machine != null ? Machine.GetHashCode() : 0); - } - } - - /// - /// Returns a string representation of the address. - /// - /// - public override string ToString() - { - return Queue + "@" + Machine; - } - - /// - /// Prevents changes to all addresses. - /// - public static void PreventChanges() - { - preventChanges = true; - } - - /// - /// The (lowercase) name of the queue not including the name of the machine or location depending on the address mode. - /// - public string Queue { get; private set; } - - /// - /// The (lowercase) name of the machine or the (normal) name of the location depending on the address mode. - /// - public string Machine { get; private set; } - - /// - /// Overloading for the == for the class Address - /// - /// Left hand side of == operator - /// Right hand side of == operator - /// true if the LHS is equal to RHS - public static bool operator ==(Address left, Address right) - { - return Equals(left, right); - } - - /// - /// Overloading for the != for the class Address - /// - /// Left hand side of != operator - /// Right hand side of != operator - /// true if the LHS is not equal to RHS - public static bool operator !=(Address left, Address right) - { - return !Equals(left, right); - } - - /// - /// Determines whether the specified is equal to the current . - /// - /// - /// true if the specified is equal to the current ; otherwise, false. - /// - /// The to compare with the current . 2 - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) return false; - if (ReferenceEquals(this, obj)) return true; - if (obj.GetType() != typeof(Address)) return false; - return Equals((Address)obj); - } - - /// - /// Check this is equal to other Address - /// - /// refrence addressed to be checked with this - /// true if this is equal to other - public bool Equals(Address other) - { - if (ReferenceEquals(null, other)) return false; - if (ReferenceEquals(this, other)) return true; - return Equals(other.Queue, Queue) && Equals(other.Machine, Machine); - } - } -} diff --git a/src/core/NServiceBus/DataBusProperty.cs b/src/core/NServiceBus/DataBusProperty.cs deleted file mode 100644 index 8b2a6192690..00000000000 --- a/src/core/NServiceBus/DataBusProperty.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Runtime.Serialization; - -namespace NServiceBus -{ - [Serializable] - public class DataBusProperty : IDataBusProperty, ISerializable where T : class - { - T value; - - public DataBusProperty(T value) - { - SetValue(value); - } - - public DataBusProperty(SerializationInfo info, StreamingContext context) - { - Key = info.GetString("Key"); - HasValue = info.GetBoolean("HasValue"); - } - - public string Key { get; set; } - public bool HasValue { get; set; } - - public T Value - { - get - { - return value; - } - } - - - public void GetObjectData(SerializationInfo info, StreamingContext context) - { - info.AddValue("Key", Key); - info.AddValue("HasValue", HasValue); - } - - public void SetValue(object valueToSet) - { - value = valueToSet as T; - - if (value != null) - HasValue = true; - } - - - public object GetValue() - { - return Value; - } - - } - - public interface IDataBusProperty - { - string Key { get; set; } - object GetValue(); - void SetValue(object value); - bool HasValue { get; set; } - } -} \ No newline at end of file diff --git a/src/core/NServiceBus/ExtensionMethods.cs b/src/core/NServiceBus/ExtensionMethods.cs deleted file mode 100644 index eb7b626b602..00000000000 --- a/src/core/NServiceBus/ExtensionMethods.cs +++ /dev/null @@ -1,218 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace NServiceBus -{ - /// - /// Extension method on message handler. - /// - public static class MessageHandlerExtensionMethods - { - /// - /// Extension method on MessageHandler. Users can avoid declaring an IBus to be injected, and use the bus implicitly. - /// - /// The following is an example on how a message handler might look like using the Bus() extension method: - /// - /// public class RequestDataMessageHandler : IHandleMessages<RequestDataMessage> - /// { - /// public void Handle(RequestDataMessage message) - /// { - /// var response = this.Bus().CreateInstance<DataResponseMessage>(m => - /// { - /// m.DataId = message.DataId; - /// m.String = message.String; - /// }); - /// this.Bus().Reply(response); - /// } - /// } - /// - /// - /// The message type to handle - /// The implementing class - /// IBus interface - public static IBus Bus(this IMessageHandler handler) - { - return ExtensionMethods.Bus; - } - } - - /// - /// Class containing extension methods for base class libraries for using interface-based messages. - /// - public static class ExtensionMethods - { - /// - /// Instantiates an instance of T and adds it to the list. - /// - /// The type to instantiate. - /// The list to which to add the new element - /// An action for setting properties of the created instance. - public static void Add(this IList list, Action initializer) - { - if (MessageCreator == null) - throw new InvalidOperationException("MessageCreator has not been set."); - - list.Add(MessageCreator.CreateInstance(initializer)); - } - - - - /// - /// Get the header with the given key. Cannot be used to change its value. - /// - /// - /// - /// - public static string GetHeader(this object msg, string key) - { - return GetHeaderAction(msg, key); - } - - /// - /// If the source of this message was an Http endpoint, returns its address - /// otherwise returns null. - /// - /// - /// - public static string GetHttpFromHeader(this object msg) - { - return msg.GetHeader(Headers.HttpFrom); - } - - /// - /// If the target destination of this message is an Http endpoint, - /// return the address of that target, otherwise null. - /// - /// - /// - public static string GetHttpToHeader(this object msg) - { - return msg.GetHeader(Headers.HttpTo); - } - - /// - /// Returns the list of destination sites for this message - /// - /// - /// - public static string GetDestinationSitesHeader(this object msg) - { - return msg.GetHeader(Headers.DestinationSites); - } - - /// - /// Returns the sitekey for the site for which this message originated, null if this message wasn't sent via the gateway - /// - /// - /// - public static string GetOriginatingSiteHeader(this object msg) - { - return msg.GetHeader(Headers.OriginatingSite); - } - - /// - /// Sets the value of the header for the given key. - /// - /// - /// - /// - public static void SetHeader(this object msg, string key, string value) - { - SetHeaderAction(msg, key, value); - } - - /// - /// Sets the list of sites to where this message should be routed - /// This method is reserved for the NServiceBus Gateway. - /// - /// - /// - public static void SetDestinationSitesHeader(this object msg, string value) - { - msg.SetHeader(Headers.DestinationSites, value); - } - - - /// - /// Sets the originating site header - /// This method is reserved for the NServiceBus Gateway. - /// - /// - /// - public static void SetOriginatingSiteHeader(this object msg, string value) - { - msg.SetHeader(Headers.OriginatingSite, value); - } - - /// - /// Sets the Http address from which this message was received. - /// This method is reserved for the NServiceBus Gateway. - /// - /// - /// - public static void SetHttpFromHeader(this object msg, string value) - { - msg.SetHeader(Headers.HttpFrom, value); - } - - /// - /// Sets the Http address to which this message should be sent. - /// Requires the use of the NServiceBus Gateway. - /// - /// - /// - public static void SetHttpToHeader(this object msg, string value) - { - msg.SetHeader(Headers.HttpTo, value); - } - - /// - /// Gets the value of the header with the given key and sets it for this message. - /// - /// - /// - public static void CopyHeaderFromRequest(this object msg, string key) - { - if (msg == CurrentMessageBeingHandled) - throw new InvalidOperationException("This method is not supported on the request message."); - - msg.SetHeader(key, CurrentMessageBeingHandled.GetHeader(key)); - } - - /// - /// The object used by the extention methods to instantiate types. - /// - public static IMessageCreator MessageCreator { get; set; } - - /// - /// The object used by the extension methods for accessing headers. - /// - public static IBus Bus { get; set; } - - /// - /// The object used to see whether headers requested are for the handled message. - /// - public static object CurrentMessageBeingHandled { get { return currentMessageBeingHandled; } set { currentMessageBeingHandled = value; } } - - [ThreadStatic] - static object currentMessageBeingHandled; - - /// - /// The action used to set the header in the method. - /// - public static Action SetHeaderAction = (x, y, z) => - { - //default to no-op to avoid getting in the way of unittesting - }; - - /// - /// The action used to get the header value in the method. - /// - public static Func GetHeaderAction = (x, y) => "No header get header action was defined, please spicify one using ExtensionMethods.GetHeaderAction = ..."; - - /// - /// The action used to get all the headers for a message. - /// - public static Func> GetStaticOutgoingHeadersAction { get; set; } - } -} diff --git a/src/core/NServiceBus/Headers.cs b/src/core/NServiceBus/Headers.cs deleted file mode 100644 index 7adbccc45c6..00000000000 --- a/src/core/NServiceBus/Headers.cs +++ /dev/null @@ -1,115 +0,0 @@ -namespace NServiceBus -{ - using System; - - /// - /// Static class containing headers used by NServiceBus. - /// - public static class Headers - { - /// - /// Header for retrieving from which Http endpoint the message arrived. - /// - public const string HttpFrom = "NServiceBus.From"; - - /// - /// Header for specifying to which Http endpoint the message should be delivered. - /// - public const string HttpTo = "NServiceBus.To"; - - /// - /// Header for specifying to which queue behind the http gateway should the message be delivered. - /// This header is considered an applicative header. - /// - public const string RouteTo = "NServiceBus.Header.RouteTo"; - - /// - /// Header for specifying to which sites the gateway should send the message. For multiple - /// sites a comma separated list can be used - /// This header is considered an applicative header. - /// - public const string DestinationSites = "NServiceBus.DestinationSites"; - - /// - /// Header for specifying the key for the site where this message originated. - /// This header is considered an applicative header. - /// - public const string OriginatingSite = "NServiceBus.OriginatingSite"; - - /// - /// Header for time when a message expires in the timeout manager - /// This header is considered an applicative header. - /// - public const string Expire = "NServiceBus.Timeout.Expire"; - - /// - /// Header for redirecting the expired timeout to a endpoint other than the one setting the Timeout - /// This header is considered an applicative header. - /// - public const string RouteExpiredTimeoutTo = "NServiceBus.Timeout.RouteExpiredTimeoutTo"; - - /// - /// Header containing the id of the saga instance the sent the message - /// This header is considered an applicative header. - /// - public const string SagaId = "NServiceBus.SagaId"; - - /// - /// Header telling the timeout manager to clear previous timeouts - /// This header is considered an applicative header. - /// - public const string ClearTimeouts = "NServiceBus.ClearTimeouts"; - - - /// - /// Prefix included on the wire when sending applicative headers. - /// - public const string HeaderName = "Header"; - - /// - /// Header containing the windows identity name - /// - public const string WindowsIdentityName = "WinIdName"; - - /// - /// Header telling the NServiceBus Version (beginning NServiceBus V3.0.1). - /// - public const string NServiceBusVersion = "NServiceBus.Version"; - - /// - /// Used in a header when doing a callback (bus.return) - /// - public const string ReturnMessageErrorCodeHeader = "NServiceBus.ReturnMessage.ErrorCode"; - - /// - /// Header that tells if this transport message is a control message - /// - public const string ControlMessageHeader = "NServiceBus.ControlMessage"; - - /// - /// Type of the saga that this message is targeted for - /// - public const string SagaType = "NServiceBus.SagaType"; - - /// - /// Type of the saga that sent this message - /// - [Obsolete("Only included for backwards compatibility with < 3.0.4, please use SagaType instead", false)] - public const string SagaEntityType = "NServiceBus.SagaDataType"; - - /// - /// Id of the saga that sent this message - /// - public const string OriginatingSagaId = "NServiceBus.OriginatingSagaId"; - - /// - /// Type of the saga that sent this message - /// - public const string OriginatingSagaType = "NServiceBus.OriginatingSagaType"; - - /// - /// The number of retries that has been performed for this message - /// - public const string Retries = "NServiceBus.Retries"; - } -} diff --git a/src/core/NServiceBus/ICallback.cs b/src/core/NServiceBus/ICallback.cs deleted file mode 100644 index a51b76f59a6..00000000000 --- a/src/core/NServiceBus/ICallback.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; - -namespace NServiceBus -{ - /// - /// Objects of this interface are returned from calling IBus.Send. - /// The interface allows the caller to register for a callback when a response - /// is received to their original call to IBus.Send. - /// - public interface ICallback - { - /// - /// Registers a callback to be invoked when a response arrives to the message sent. - /// - /// The callback to invoke. - /// State that will be passed to the callback method. - /// An IAsyncResult useful for integration with ASP.NET async tasks. - IAsyncResult Register(AsyncCallback callback, object state); - - /// - /// Registers a callback to be invoked when a response arrives to the message sent. - /// The return code is cast to the given enumerated type - T. - /// - /// An enumeration type or an integer. - /// - void Register(Action callback); - - /// - /// Registers a callback to be invoked when a response arrives to the message sent. - /// The return code is cast to the given enumerated type - T. - /// Pass either a System.Web.UI.Page or a System.Web.Mvc.AsyncController as the synchronizer. - /// - /// - /// - /// - void Register(Action callback, object synchronizer); - } -} diff --git a/src/core/NServiceBus/IMessageHandler.cs b/src/core/NServiceBus/IMessageHandler.cs deleted file mode 100644 index a8c10ea911b..00000000000 --- a/src/core/NServiceBus/IMessageHandler.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace NServiceBus -{ - /// - /// Defines a message handler. - /// - /// The type of message to be handled. - public interface IMessageHandler - { - /// - /// Handles a message. - /// - /// The message to handle. - /// - /// This method will be called when a message arrives on the bus and should contain - /// the custom logic to execute when the message is received. - void Handle(T message); - } - - /// - /// Implement this class to be called when messages of the given type arrive at your endpoint. - /// - /// - public interface IHandleMessages : IMessageHandler {} -} diff --git a/src/core/NServiceBus/IMessageSerializer.cs b/src/core/NServiceBus/IMessageSerializer.cs deleted file mode 100644 index 924ec558345..00000000000 --- a/src/core/NServiceBus/IMessageSerializer.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.IO; - -namespace NServiceBus.Serialization -{ - /// - /// Interface used for serializing and deserializing messages. - /// - public interface IMessageSerializer - { - /// - /// Serializes the given set of messages into the given stream. - /// - /// - /// - void Serialize(object[] messages, Stream stream); - - /// - /// Deserializes from the given stream a set of messages. - /// - /// - /// - object[] Deserialize(Stream stream); - } -} diff --git a/src/core/NServiceBus/IStartableBus.cs b/src/core/NServiceBus/IStartableBus.cs deleted file mode 100644 index 885767ea90c..00000000000 --- a/src/core/NServiceBus/IStartableBus.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; - -namespace NServiceBus -{ - /// - /// The interface used for starting and stopping an IBus. - /// - public interface IStartableBus : IDisposable - { - /// - /// Performs the given startup action, starts the bus, and returns a reference to it. - /// - /// Action to be performed before the bus is started. - /// A reference to the bus. - IBus Start(Action startupAction); - - /// - /// Starts the bus and returns a reference to it. - /// - /// - IBus Start(); - - /// - /// Event raised when the bus is started. - /// - event EventHandler Started; - } -} diff --git a/src/core/NServiceBus/NServiceBus.csproj b/src/core/NServiceBus/NServiceBus.csproj deleted file mode 100644 index 5add6e329fd..00000000000 --- a/src/core/NServiceBus/NServiceBus.csproj +++ /dev/null @@ -1,119 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {73867D40-8CBB-48E9-BFFA-12BBDD48A341} - Library - Properties - NServiceBus - NServiceBus - - - - - v4.0 - true - ..\..\NServiceBus.snk - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\NServiceBus.XML - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\NServiceBus.XML - AllRules.ruleset - - - - ..\..\..\lib\log4net.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - copy /Y "$(ProjectDir)$(OutDir)*.*" "$(ProjectDir)..\..\..\build\" - - \ No newline at end of file diff --git a/src/core/NServiceBus/Properties/AssemblyInfo.cs b/src/core/NServiceBus/Properties/AssemblyInfo.cs deleted file mode 100644 index 138472518f7..00000000000 Binary files a/src/core/NServiceBus/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/core/nuget.config b/src/core/nuget.config deleted file mode 100644 index cd17f414bd4..00000000000 --- a/src/core/nuget.config +++ /dev/null @@ -1,4 +0,0 @@ - - - ../../packages - \ No newline at end of file diff --git a/src/databus/NServiceBus.Databus.Tests/InMemoryDataBus.cs b/src/databus/NServiceBus.Databus.Tests/InMemoryDataBus.cs deleted file mode 100644 index 7208192f703..00000000000 --- a/src/databus/NServiceBus.Databus.Tests/InMemoryDataBus.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System; - -namespace NServiceBus.DataBus.Tests -{ - public class InMemoryDataBus : IDataBus - { - private readonly IDictionary storage = new Dictionary(); - - public Stream Get(string key) - { - lock (storage) - return new MemoryStream(storage[key]); - } - - public string Put(Stream stream, TimeSpan timeToBeReceived) - { - var key = Guid.NewGuid().ToString(); - - var data = new byte[stream.Length]; - stream.Read(data, 0, (int) stream.Length); - - lock (storage) - storage.Add(key, data); - return key; - } - - public void Start() - { - //no-op - } - - public void Dispose() - { - //no-op - } - } -} \ No newline at end of file diff --git a/src/databus/NServiceBus.Databus.Tests/MessageWithoutDataBusProperty.cs b/src/databus/NServiceBus.Databus.Tests/MessageWithoutDataBusProperty.cs deleted file mode 100644 index 1ce18a427a9..00000000000 --- a/src/databus/NServiceBus.Databus.Tests/MessageWithoutDataBusProperty.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace NServiceBus.DataBus.Tests -{ - public class MessageWithoutDataBusProperty - { - public string SomeProperty { get; set; } - } -} \ No newline at end of file diff --git a/src/databus/NServiceBus.Databus.Tests/NServiceBus.DataBus.Tests.csproj b/src/databus/NServiceBus.Databus.Tests/NServiceBus.DataBus.Tests.csproj deleted file mode 100644 index 8c8ca9ea6c2..00000000000 --- a/src/databus/NServiceBus.Databus.Tests/NServiceBus.DataBus.Tests.csproj +++ /dev/null @@ -1,146 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {DC1AC444-4F80-41D6-A320-99D37F5EA644} - Library - Properties - NServiceBus.DataBus.Tests - NServiceBus.DataBus.Tests - v4.0 - 512 - - - 3.5 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\lib\log4net.dll - - - ..\..\..\build\output\NServiceBus.dll - - - False - ..\..\..\build\nservicebus.core\NServiceBus.Config.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.MessageHeaders.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.MessageInterfaces.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.MessageInterfaces.MessageMapper.Reflection.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.MessageMutator.dll - - - False - ..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.DefaultBuilder.dll - - - ..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll - - - ..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll - - - ..\..\..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll - - - ..\..\..\packages\RhinoMocks.3.6\lib\Rhino.Mocks.dll - - - - - - - - - - - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - {EDFCAFE5-9C1D-4339-9DC5-2CD899E9E605} - NServiceBus.DataBus - - - - - - - - \ No newline at end of file diff --git a/src/databus/NServiceBus.Databus.Tests/Properties/AssemblyInfo.cs b/src/databus/NServiceBus.Databus.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 54e3640aab6..00000000000 Binary files a/src/databus/NServiceBus.Databus.Tests/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/databus/NServiceBus.Databus.Tests/When_nservicebus_is_initalizing.cs b/src/databus/NServiceBus.Databus.Tests/When_nservicebus_is_initalizing.cs deleted file mode 100644 index 1a21552eb75..00000000000 --- a/src/databus/NServiceBus.Databus.Tests/When_nservicebus_is_initalizing.cs +++ /dev/null @@ -1,64 +0,0 @@ -using NServiceBus.DataBus.Config; -using NServiceBus.DataBus.Tests; -using NUnit.Framework; -using log4net; - -namespace NServiceBus.DataBus.Tests -{ - using System; - using NUnit.Framework; - - [TestFixture] - public class When_nservicebus_is_initalizing - { - [Test] - public void Databus_mutators_should_be_registered_if_a_databus_property_is_found() - { - Configure.With(new[] {typeof (MessageWithDataBusProperty)}) - .DefineEndpointName("xyz") - .DefaultBuilder(); - - - var bootStrapper = new Bootstrapper(); - - Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - - bootStrapper.Init(); - - Assert.True(Configure.Instance.Configurer.HasComponent()); - } - - [Test] - public void Databus_mutators_should_not_be_registered_if_no_databus_property_is_found() - { - Configure.With(new[] { typeof(MessageWithoutDataBusProperty) }) - .DefineEndpointName("xyz") - .DefaultBuilder(); - - var bootStrapper = new Bootstrapper(); - - bootStrapper.Init(); - - Assert.False(Configure.Instance.Configurer.HasComponent()); - } - - [Test] - public void Should_throw_if_propertytype_is_not_serializable() - { - if (!System.Diagnostics.Debugger.IsAttached) - { - Assert.Ignore("This only work in debug mode."); - } - - Configure.With(new[] { typeof(MessageWithNonSerializableDataBusProperty) }) - .DefineEndpointName("xyz") - .DefiningDataBusPropertiesAs(p => p.Name.EndsWith("DataBus")) - .DefaultBuilder() - .Configurer.RegisterSingleton(new InMemoryDataBus()); - - var bootStrapper = new Bootstrapper(); - - Assert.Throws(bootStrapper.Init); - } - } -} diff --git a/src/databus/NServiceBus.Databus.Tests/packages.config b/src/databus/NServiceBus.Databus.Tests/packages.config deleted file mode 100644 index 246b9de3281..00000000000 --- a/src/databus/NServiceBus.Databus.Tests/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/databus/NServiceBus.Databus.sln b/src/databus/NServiceBus.Databus.sln deleted file mode 100644 index 331589a379a..00000000000 --- a/src/databus/NServiceBus.Databus.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.DataBus", "NServiceBus.Databus\NServiceBus.DataBus.csproj", "{EDFCAFE5-9C1D-4339-9DC5-2CD899E9E605}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.DataBus.Tests", "NServiceBus.Databus.Tests\NServiceBus.DataBus.Tests.csproj", "{DC1AC444-4F80-41D6-A320-99D37F5EA644}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EDFCAFE5-9C1D-4339-9DC5-2CD899E9E605}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EDFCAFE5-9C1D-4339-9DC5-2CD899E9E605}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EDFCAFE5-9C1D-4339-9DC5-2CD899E9E605}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EDFCAFE5-9C1D-4339-9DC5-2CD899E9E605}.Release|Any CPU.Build.0 = Release|Any CPU - {DC1AC444-4F80-41D6-A320-99D37F5EA644}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DC1AC444-4F80-41D6-A320-99D37F5EA644}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DC1AC444-4F80-41D6-A320-99D37F5EA644}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DC1AC444-4F80-41D6-A320-99D37F5EA644}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/databus/NServiceBus.Databus/Config/Bootstrapper.cs b/src/databus/NServiceBus.Databus/Config/Bootstrapper.cs deleted file mode 100644 index 250edf79a80..00000000000 --- a/src/databus/NServiceBus.Databus/Config/Bootstrapper.cs +++ /dev/null @@ -1,66 +0,0 @@ -namespace NServiceBus.DataBus.Config -{ - using System; - using System.Linq; - using NServiceBus.Config; - - public class Bootstrapper : INeedInitialization, IWantToRunWhenConfigurationIsComplete - { - public void Init() - { - if (System.Diagnostics.Debugger.IsAttached) - { - var properties = Configure.TypesToScan - .Where(t => t.IsMessageType()) - .SelectMany(messageType => messageType.GetProperties()) - .Where(p => p.IsDataBusProperty()); - - foreach (var property in properties) - { - dataBusPropertyFound = true; - - if (!property.PropertyType.IsSerializable) - { - throw new InvalidOperationException( - String.Format( - @"The property type for '{0}' is not serializable. -In order to use the databus feature for transporting the data stored in the property types defined in the call '.DefiningDataBusPropertiesAs()', need to be serializable. -To fix this, please mark the property type '{0}' as serializable, see http://msdn.microsoft.com/en-us/library/system.runtime.serialization.iserializable.aspx on how to do this.", - String.Format("{0}.{1}", property.DeclaringType.FullName, property.Name))); - } - } - } - else - { - dataBusPropertyFound = Configure.TypesToScan - .Where(t => t.IsMessageType()) - .SelectMany(messageType => messageType.GetProperties()) - .Any(t => t.IsDataBusProperty()); - } - - if (!dataBusPropertyFound) - return; - - if (!Configure.Instance.Configurer.HasComponent()) - throw new InvalidOperationException("Messages containing databus properties found, please configure a databus!"); - - Configure.Instance.Configurer.ConfigureComponent( - DependencyLifecycle.InstancePerCall); - - Configure.Instance.Configurer.ConfigureComponent( - DependencyLifecycle.SingleInstance); - } - - public void Run() - { - if (!dataBusPropertyFound) - return; - - Bus.Started += (sender, eventargs) => Configure.Instance.Builder.Build().Start(); - } - - public IStartableBus Bus { get; set; } - - private static bool dataBusPropertyFound; - } -} diff --git a/src/databus/NServiceBus.Databus/DefaultDatabusSerializer.cs b/src/databus/NServiceBus.Databus/DefaultDatabusSerializer.cs deleted file mode 100644 index d7f87b58292..00000000000 --- a/src/databus/NServiceBus.Databus/DefaultDatabusSerializer.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace NServiceBus.DataBus -{ - using System.IO; - using System.Runtime.Serialization.Formatters.Binary; - - public class DefaultDataBusSerializer : IDataBusSerializer - { - private static readonly BinaryFormatter formatter = new BinaryFormatter(); - - public void Serialize(object databusProperty, Stream stream) - { - formatter.Serialize(stream, databusProperty); - } - - public object Deserialize(Stream stream) - { - return formatter.Deserialize(stream); - } - } -} \ No newline at end of file diff --git a/src/databus/NServiceBus.Databus/IDataBus.cs b/src/databus/NServiceBus.Databus/IDataBus.cs deleted file mode 100644 index a152bca0f7c..00000000000 --- a/src/databus/NServiceBus.Databus/IDataBus.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.IO; - -namespace NServiceBus.DataBus -{ - using System; - - /// - /// The main interface for interactions with the databus - /// - public interface IDataBus : IDisposable - { - /// - /// Gets a data item from the bus - /// - /// - /// - Stream Get(string key); - - /// - /// Adds a data item to the bus and returns the assigned key - /// - /// A create containing the data to be sent on the databus - /// The time to be received specified on the message type. TimeSpan.MaxValue is the default - string Put(Stream stream, TimeSpan timeToBeReceived); - - /// - /// Called when the bus starts up to allow the data bus to active background tasks - /// - void Start(); - } -} \ No newline at end of file diff --git a/src/databus/NServiceBus.Databus/IDatabusSerializer.cs b/src/databus/NServiceBus.Databus/IDatabusSerializer.cs deleted file mode 100644 index a2f90645cfe..00000000000 --- a/src/databus/NServiceBus.Databus/IDatabusSerializer.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace NServiceBus.DataBus -{ - using System.IO; - - /// - /// Interface used for serializing and deserializing of databus properties. - /// - public interface IDataBusSerializer - { - /// - /// Serializes the property into the given stream. - /// - /// - /// - void Serialize(object databusProperty, Stream stream); - - /// - /// Deserializes a property from the given stream. - /// - /// - /// - object Deserialize(Stream stream); - } -} \ No newline at end of file diff --git a/src/databus/NServiceBus.Databus/NServiceBus.DataBus.csproj b/src/databus/NServiceBus.Databus/NServiceBus.DataBus.csproj deleted file mode 100644 index 0cf4bd33bc6..00000000000 --- a/src/databus/NServiceBus.Databus/NServiceBus.DataBus.csproj +++ /dev/null @@ -1,76 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EDFCAFE5-9C1D-4339-9DC5-2CD899E9E605} - Library - Properties - NServiceBus.DataBus - NServiceBus.DataBus - v4.0 - 512 - - - 3.5 - - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\build\output\NServiceBus.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Config.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.MessageMutator.dll - - - False - ..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.dll - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/databus/NServiceBus.Databus/Properties/AssemblyInfo.cs b/src/databus/NServiceBus.Databus/Properties/AssemblyInfo.cs deleted file mode 100644 index 5ebc4243d16..00000000000 Binary files a/src/databus/NServiceBus.Databus/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/databus/nuget.config b/src/databus/nuget.config deleted file mode 100644 index cd17f414bd4..00000000000 --- a/src/databus/nuget.config +++ /dev/null @@ -1,4 +0,0 @@ - - - ../../packages - \ No newline at end of file diff --git a/src/distributor/NServiceBus.Distributor.MsmqWorkerAvailabilityManager/MsmqWorkerAvailabilityManager.cs b/src/distributor/NServiceBus.Distributor.MsmqWorkerAvailabilityManager/MsmqWorkerAvailabilityManager.cs deleted file mode 100644 index 2c2cb6534aa..00000000000 --- a/src/distributor/NServiceBus.Distributor.MsmqWorkerAvailabilityManager/MsmqWorkerAvailabilityManager.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; -using NServiceBus.Unicast.Distributor; -using System.Messaging; -using NServiceBus.Utils; - -namespace NServiceBus.Distributor.MsmqWorkerAvailabilityManager -{ - /// - /// An implementation of for MSMQ to be used - /// with the class. - /// - public class MsmqWorkerAvailabilityManager : IWorkerAvailabilityManager - { - MessageQueue storageQueue; - - /// - /// Sets the path to the queue that will be used for storing - /// worker availability. - /// - /// The queue provided must be transactional. - public Address StorageQueueAddress { get; set; } - - /// - /// Removes all entries from the worker availability queue - /// with the specified address. - /// - /// - /// The address of the worker to remove from the availability list. - /// - public void ClearAvailabilityForWorker(Address address) - { - var existing = storageQueue.GetAllMessages(); - - foreach (var m in existing) - if (MsmqUtilities.GetIndependentAddressForQueue(m.ResponseQueue) == address) - storageQueue.ReceiveById(m.Id, MessageQueueTransactionType.Automatic); - } - - /// - /// Pops the next available worker from the available worker queue - /// and returns its address. - /// - public Address PopAvailableWorker() - { - try - { - var m = storageQueue.Receive(TimeSpan.Zero, MessageQueueTransactionType.Automatic); - - if (m == null) - return null; - - return MsmqUtilities.GetIndependentAddressForQueue(m.ResponseQueue); - } - catch (Exception) - { - return null; - } - } - - /// - /// Initializes the object. - /// - public void Start() - { - var path = MsmqUtilities.GetFullPath(StorageQueueAddress); - - storageQueue = new MessageQueue(path); - - if (!storageQueue.Transactional) - throw new Exception("Queue must be transactional."); - } - - /// - /// Signal that a worker is available to receive a dispatched message. - /// - /// - /// The address of the worker that will accept the dispatched message. - /// - /// The number of messages that this worker is ready to process - public void WorkerAvailable(Address address, int capacity) - { - for (var i = 0; i < capacity; i++) - storageQueue.Send(new Message - { - ResponseQueue = new MessageQueue(MsmqUtilities.GetFullPath(address)) - }, MessageQueueTransactionType.Automatic); - } - } -} diff --git a/src/distributor/NServiceBus.Distributor.MsmqWorkerAvailabilityManager/NServiceBus.Distributor.MsmqWorkerAvailabilityManager.csproj b/src/distributor/NServiceBus.Distributor.MsmqWorkerAvailabilityManager/NServiceBus.Distributor.MsmqWorkerAvailabilityManager.csproj deleted file mode 100644 index 47808050196..00000000000 --- a/src/distributor/NServiceBus.Distributor.MsmqWorkerAvailabilityManager/NServiceBus.Distributor.MsmqWorkerAvailabilityManager.csproj +++ /dev/null @@ -1,134 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {A60CA2C3-0B28-4D03-9F0B-19FE56D27689} - Library - Properties - NServiceBus.Distributor.MsmqWorkerAvailabilityManager - NServiceBus.Distributor.MsmqWorkerAvailabilityManager - - - - - v4.0 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\MsmqWorkerAvailabilityManager.XML - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\MsmqWorkerAvailabilityManager.XML - AllRules.ruleset - - - - False - ..\..\..\build\output\NServiceBus.dll - False - - - False - ..\..\..\build\nservicebus.core\NServiceBus.Config.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Installation.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Installation.Windows.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.MasterNode.dll - - - False - ..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Utils.dll - False - - - - 3.5 - - - - - - - - - - - - {D142D372-C9FA-4505-A6EB-E919746F0FF1} - NServiceBus.Unicast.Distributor - False - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - copy /Y "$(ProjectDir)$(OutDir)*.*" "$(ProjectDir)..\build" - - \ No newline at end of file diff --git a/src/distributor/NServiceBus.Distributor.MsmqWorkerAvailabilityManager/Properties/AssemblyInfo.cs b/src/distributor/NServiceBus.Distributor.MsmqWorkerAvailabilityManager/Properties/AssemblyInfo.cs deleted file mode 100644 index ec9626c95ad..00000000000 Binary files a/src/distributor/NServiceBus.Distributor.MsmqWorkerAvailabilityManager/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/distributor/NServiceBus.Distributor.MsmqWorkerAvailabilityManager/StorageQueueInstaller.cs b/src/distributor/NServiceBus.Distributor.MsmqWorkerAvailabilityManager/StorageQueueInstaller.cs deleted file mode 100644 index 9d0a64e9522..00000000000 --- a/src/distributor/NServiceBus.Distributor.MsmqWorkerAvailabilityManager/StorageQueueInstaller.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System.Security.Principal; -using NServiceBus.Installation; -using NServiceBus.Utils; - -namespace NServiceBus.Distributor.MsmqWorkerAvailabilityManager -{ - /// - /// Creates the queue to store worker availability information. - /// - public class StorageQueueInstaller : INeedToInstallSomething - { - /// - /// Implementation of INeedToInstallSomething.Install - /// - /// - public void Install(WindowsIdentity identity) - { - if (!Configure.Instance.Configurer.HasComponent()) - return; - - var m = Configure.Instance.Builder.Build(); - - MsmqUtilities.CreateQueueIfNecessary(m.StorageQueueAddress, identity.Name); - } - } -} diff --git a/src/distributor/NServiceBus.Distributor.sln b/src/distributor/NServiceBus.Distributor.sln deleted file mode 100644 index 93a33830337..00000000000 --- a/src/distributor/NServiceBus.Distributor.sln +++ /dev/null @@ -1,36 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Distributor", "NServiceBus.Distributor\NServiceBus.Distributor.csproj", "{B14659D0-9371-420B-A82A-1E06AFF04624}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Unicast.Distributor", "NServiceBus.Unicast.Distributor\NServiceBus.Unicast.Distributor.csproj", "{D142D372-C9FA-4505-A6EB-E919746F0FF1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Distributor.MsmqWorkerAvailabilityManager", "NServiceBus.Distributor.MsmqWorkerAvailabilityManager\NServiceBus.Distributor.MsmqWorkerAvailabilityManager.csproj", "{A60CA2C3-0B28-4D03-9F0B-19FE56D27689}" -EndProject -Global - GlobalSection(SubversionScc) = preSolution - Svn-Managed = True - Manager = AnkhSVN - Subversion Support for Visual Studio - EndGlobalSection - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B14659D0-9371-420B-A82A-1E06AFF04624}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B14659D0-9371-420B-A82A-1E06AFF04624}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B14659D0-9371-420B-A82A-1E06AFF04624}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B14659D0-9371-420B-A82A-1E06AFF04624}.Release|Any CPU.Build.0 = Release|Any CPU - {D142D372-C9FA-4505-A6EB-E919746F0FF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D142D372-C9FA-4505-A6EB-E919746F0FF1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D142D372-C9FA-4505-A6EB-E919746F0FF1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D142D372-C9FA-4505-A6EB-E919746F0FF1}.Release|Any CPU.Build.0 = Release|Any CPU - {A60CA2C3-0B28-4D03-9F0B-19FE56D27689}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A60CA2C3-0B28-4D03-9F0B-19FE56D27689}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A60CA2C3-0B28-4D03-9F0B-19FE56D27689}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A60CA2C3-0B28-4D03-9F0B-19FE56D27689}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/distributor/NServiceBus.Distributor/App.config b/src/distributor/NServiceBus.Distributor/App.config deleted file mode 100644 index 3c2a794a104..00000000000 --- a/src/distributor/NServiceBus.Distributor/App.config +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/src/distributor/NServiceBus.Distributor/Config/DistributorInitializer.cs b/src/distributor/NServiceBus.Distributor/Config/DistributorInitializer.cs deleted file mode 100644 index aa7cd895593..00000000000 --- a/src/distributor/NServiceBus.Distributor/Config/DistributorInitializer.cs +++ /dev/null @@ -1,61 +0,0 @@ -namespace NServiceBus.Distributor.Config -{ - using NServiceBus.Config; - using Unicast; - using log4net; - - public class DistributorInitializer - { - public static void Init(bool withWorker) - { - var config = Configure.Instance; - - var masterNodeAddress = config.GetMasterNodeAddress(); - var applicativeInputQueue = masterNodeAddress.SubScope("worker"); - - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance) - .ConfigureProperty(r => r.InputAddress, masterNodeAddress.SubScope("worker")) - .ConfigureProperty(r => r.DoNotStartTransport, !withWorker); - - config.Configurer.ConfigureComponent( - DependencyLifecycle.SingleInstance) - .ConfigureProperty(r => r.StorageQueueAddress, masterNodeAddress.SubScope("distributor.storage")); - - var numberOfWorkerThreads = GetNumberOfWorkerThreads(); - - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance) - .ConfigureProperty(r => r.NumberOfWorkerThreads, numberOfWorkerThreads) - .ConfigureProperty(r => r.ControlQueue, masterNodeAddress.SubScope("distributor.control")); - - - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance) - .ConfigureProperty(r => r.NumberOfWorkerThreads, numberOfWorkerThreads) - .ConfigureProperty(r => r.InputQueue, masterNodeAddress); - - Logger.InfoFormat("Endpoint configured to host the distributor, applicative input queue re routed to {0}", - applicativeInputQueue); - } - - - - static int GetNumberOfWorkerThreads() - { - var numberOfWorkerThreads = 1; - var msmqTransport = Configure.GetConfigSection(); - - if (msmqTransport == null) - { - Logger.Warn( - "No transport configuration found so the distributor will default to one thread, for production scenarios you would want to adjust this setting"); - } - else - { - numberOfWorkerThreads = msmqTransport.NumberOfWorkerThreads; - } - return numberOfWorkerThreads; - } - - static readonly ILog Logger = LogManager.GetLogger("Distributor." + Configure.EndpointName); - - } -} \ No newline at end of file diff --git a/src/distributor/NServiceBus.Distributor/DistributorBootstrapper.cs b/src/distributor/NServiceBus.Distributor/DistributorBootstrapper.cs deleted file mode 100644 index 01846aa099e..00000000000 --- a/src/distributor/NServiceBus.Distributor/DistributorBootstrapper.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using NServiceBus.Unicast.Distributor; -using NServiceBus.Unicast.Queuing.Msmq; -using NServiceBus.Unicast.Transport.Transactional; - -namespace NServiceBus.Distributor -{ - using Faults; - using ObjectBuilder; - using Unicast; - - public class DistributorBootstrapper : IDisposable, IWantToRunWhenTheBusStarts - { - - public IWorkerAvailabilityManager WorkerAvailabilityManager { get; set; } - public int NumberOfWorkerThreads { get; set; } - public IManageMessageFailures MessageFailureManager { get; set; } - public IBuilder Builder { get; set; } - - public Address InputQueue { get; set; } - - public void Dispose() - { - if (distributor != null) - distributor.Stop(); - } - - public void Run() - { - if (!Configure.Instance.DistributorConfiguredToRunOnThisEndpoint()) - return; - - var dataTransport = new TransactionalTransport - { - NumberOfWorkerThreads = NumberOfWorkerThreads, - IsTransactional = true, - MessageReceiver = new MsmqMessageReceiver(), - MaxRetries = 5, - FailureManager = Builder.Build(MessageFailureManager.GetType()) as IManageMessageFailures - }; - - distributor = new Unicast.Distributor.Distributor - { - MessageBusTransport = dataTransport, - MessageSender = new MsmqMessageSender(), - WorkerManager = WorkerAvailabilityManager, - DataTransportInputQueue = InputQueue - }; - - LicenseConfig.CheckForLicenseLimitationOnNumberOfWorkerNodes(); - - distributor.Start(); - } - - Unicast.Distributor.Distributor distributor; - - - } -} diff --git a/src/distributor/NServiceBus.Distributor/DistributorReadyMessageProcessor.cs b/src/distributor/NServiceBus.Distributor/DistributorReadyMessageProcessor.cs deleted file mode 100644 index 5912101d1b7..00000000000 --- a/src/distributor/NServiceBus.Distributor/DistributorReadyMessageProcessor.cs +++ /dev/null @@ -1,75 +0,0 @@ -namespace NServiceBus.Distributor -{ - using ReadyMessages; - using Unicast; - using Unicast.Distributor; - using Unicast.Transport.Transactional; - using Unicast.Queuing.Msmq; - using Faults; - using Unicast.Transport; - using log4net; - - public class DistributorReadyMessageProcessor : IWantToRunWhenTheBusStarts - { - public IWorkerAvailabilityManager WorkerAvailabilityManager { get; set; } - public IManageMessageFailures MessageFailureManager { get; set; } - public int NumberOfWorkerThreads { get; set; } - - public Address ControlQueue { get; set; } - - public void Run() - { - if (!Configure.Instance.DistributorConfiguredToRunOnThisEndpoint()) - return; - - controlTransport = new TransactionalTransport - { - IsTransactional = true, - FailureManager = MessageFailureManager, - MessageReceiver = new MsmqMessageReceiver(), - MaxRetries = 5, - NumberOfWorkerThreads = NumberOfWorkerThreads, - }; - - controlTransport.TransportMessageReceived += - (obj, ev) => - { - var transportMessage = ev.Message; - - if (!transportMessage.IsControlMessage()) - return; - - HandleControlMessage(transportMessage); - }; - - controlTransport.Start(ControlQueue); - } - - - void HandleControlMessage(TransportMessage controlMessage) - { - var replyToAddress = controlMessage.ReplyToAddress; - - if (LicenseConfig.LimitNumberOfWorkers(replyToAddress)) - return; - - if (controlMessage.Headers.ContainsKey(Headers.WorkerStarting)) - { - WorkerAvailabilityManager.ClearAvailabilityForWorker(replyToAddress); - Logger.InfoFormat("Worker {0} has started up, clearing previous reported capacity", replyToAddress); - } - - if(controlMessage.Headers.ContainsKey(Headers.WorkerCapacityAvailable)) - { - var capacity = int.Parse(controlMessage.Headers[Headers.WorkerCapacityAvailable]); - - WorkerAvailabilityManager.WorkerAvailable(replyToAddress,capacity); - - Logger.InfoFormat("Worker {0} checked in with available capacity: {1}", replyToAddress, capacity); - } - } - - ITransport controlTransport; - static readonly ILog Logger = LogManager.GetLogger("Distributor."+Configure.EndpointName); - } -} diff --git a/src/distributor/NServiceBus.Distributor/Installers/ControlQueueInstaller.cs b/src/distributor/NServiceBus.Distributor/Installers/ControlQueueInstaller.cs deleted file mode 100644 index a5144d5c087..00000000000 --- a/src/distributor/NServiceBus.Distributor/Installers/ControlQueueInstaller.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace NServiceBus.Distributor.Installers -{ - using System.Security.Principal; - using NServiceBus.Installation; - using NServiceBus.Utils; - - public class ControlQueueInstaller : INeedToInstallSomething - { - public void Install(WindowsIdentity identity) - { - if (!Configure.Instance.DistributorConfiguredToRunOnThisEndpoint()) - return; - - //create the control queue - var m = Configure.Instance.Builder.Build(); - - MsmqUtilities.CreateQueueIfNecessary(m.ControlQueue, identity.Name); - - } - } -} \ No newline at end of file diff --git a/src/distributor/NServiceBus.Distributor/Installers/WorkerInputInstaller.cs b/src/distributor/NServiceBus.Distributor/Installers/WorkerInputInstaller.cs deleted file mode 100644 index b1b8fbe5692..00000000000 --- a/src/distributor/NServiceBus.Distributor/Installers/WorkerInputInstaller.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace NServiceBus.Distributor.Installers -{ - using System.Security.Principal; - using NServiceBus.Installation; - using NServiceBus.Utils; - - public class WorkerInputInstaller : INeedToInstallSomething - { - /// - /// Install queue for Worker message handler. Will not install if Distributor is not configured to run on this endpoint or if the worker should not run on this endpoint. - /// - /// - public void Install(WindowsIdentity identity) - { - if ((!Configure.Instance.DistributorConfiguredToRunOnThisEndpoint()) || (!Configure.Instance.WorkerRunsOnThisEndpoint())) - return; - - //create the worker queue - MsmqUtilities.CreateQueueIfNecessary(Address.Local.SubScope("Worker"), identity.Name); - } - } -} diff --git a/src/distributor/NServiceBus.Distributor/LicenseConfig.cs b/src/distributor/NServiceBus.Distributor/LicenseConfig.cs deleted file mode 100644 index 1fd94861ad2..00000000000 --- a/src/distributor/NServiceBus.Distributor/LicenseConfig.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.Collections.Concurrent; -using System.Linq; -using NServiceBus.Licensing; -using log4net; - -namespace NServiceBus.Distributor -{ - /// - /// Limit number of workers in accordance with Licensing policy - /// - public static class LicenseConfig - { - private static readonly ILog Logger = LogManager.GetLogger("Distributor." + Configure.EndpointName); - private static int allowedWorkerNodes; - private static readonly ConcurrentBag
    WorkersList = new ConcurrentBag
    (); - - internal static void CheckForLicenseLimitationOnNumberOfWorkerNodes() - { - allowedWorkerNodes = LicenseManager.CurrentLicense.AllowedNumberOfWorkerNodes; - } - - internal static bool LimitNumberOfWorkers(Address workerAddress) - { - if (WorkersList.Contains(workerAddress)) - return false; - - if (WorkersList.Count < allowedWorkerNodes) - { - WorkersList.Add(workerAddress); - return false; - } - Logger.WarnFormat( - "License limitation for [{0}] workers per distributor reached. To obtain a license that allows to add more workers, please visit http://particular.net/licensing.", - allowedWorkerNodes); - return true; - } - } -} diff --git a/src/distributor/NServiceBus.Distributor/NServiceBus.Distributor.csproj b/src/distributor/NServiceBus.Distributor/NServiceBus.Distributor.csproj deleted file mode 100644 index f8ecdf59e21..00000000000 --- a/src/distributor/NServiceBus.Distributor/NServiceBus.Distributor.csproj +++ /dev/null @@ -1,154 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {B14659D0-9371-420B-A82A-1E06AFF04624} - Library - Properties - NServiceBus.Distributor - NServiceBus.Distributor - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\lib\log4net.dll - False - - - False - ..\..\..\build\output\NServiceBus.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Config.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Faults.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Installation.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Installation.Windows.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Licensing.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.MasterNode.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.MessageMutator.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Config.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Queuing.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Queuing.Msmq.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Transport.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Transport.Msmq.Config.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Transport.Transactional.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Utils.dll - - - - - 3.5 - - - - - - - - - - - - - - - - - - - Designer - - - - - {A60CA2C3-0B28-4D03-9F0B-19FE56D27689} - NServiceBus.Distributor.MsmqWorkerAvailabilityManager - False - - - {D142D372-C9FA-4505-A6EB-E919746F0FF1} - NServiceBus.Unicast.Distributor - False - - - - - - Program - $(ProjectDir)$(OutputPath)NServiceBus.Host.exe - - \ No newline at end of file diff --git a/src/distributor/NServiceBus.Distributor/Properties/AssemblyInfo.cs b/src/distributor/NServiceBus.Distributor/Properties/AssemblyInfo.cs deleted file mode 100644 index d5b2ea31171..00000000000 Binary files a/src/distributor/NServiceBus.Distributor/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/distributor/NServiceBus.Distributor/ReadyMessages/Headers.cs b/src/distributor/NServiceBus.Distributor/ReadyMessages/Headers.cs deleted file mode 100644 index 1d18df9f2f2..00000000000 --- a/src/distributor/NServiceBus.Distributor/ReadyMessages/Headers.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace NServiceBus.Distributor.ReadyMessages -{ - public struct Headers - { - public static string WorkerCapacityAvailable = "NServiceBus.Distributor.WorkerCapacityAvailable"; - public static string WorkerStarting = "NServiceBus.Distributor.WorkerStarting"; - } -} \ No newline at end of file diff --git a/src/distributor/NServiceBus.Distributor/ReadyMessages/ReadyMessageSender.cs b/src/distributor/NServiceBus.Distributor/ReadyMessages/ReadyMessageSender.cs deleted file mode 100644 index bc3448dab4d..00000000000 --- a/src/distributor/NServiceBus.Distributor/ReadyMessages/ReadyMessageSender.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace NServiceBus.Distributor.ReadyMessages -{ - using Unicast; - using Unicast.Transport; - using Unicast.Queuing; - using log4net; - - public class ReadyMessageSender : IWantToRunWhenTheBusStarts - { - public ITransport EndpointTransport { get; set; } - - public ISendMessages MessageSender { get; set; } - - public UnicastBus Bus { get; set; } - - public Address DistributorControlAddress { get; set; } - - public void Run() - { - if (!Configure.Instance.WorkerRunsOnThisEndpoint()) - return; - - var capacityAvailable = EndpointTransport.NumberOfWorkerThreads; - SendReadyMessage(capacityAvailable, true); - - EndpointTransport.FinishedMessageProcessing += (a, b) => - { - SendReadyMessage(); - }; - } - - void SendReadyMessage(int capacityAvailable = 1, bool isStarting = false) - { - //we use the actual address to make sure that the worker inside the masternode will check in correctly - var readyMessage = ControlMessage.Create(Bus.InputAddress); - - readyMessage.Headers.Add(Headers.WorkerCapacityAvailable, capacityAvailable.ToString()); - - if (isStarting) - readyMessage.Headers.Add(Headers.WorkerStarting, true.ToString()); - - - MessageSender.Send(readyMessage, DistributorControlAddress); - } - } -} diff --git a/src/distributor/NServiceBus.Unicast.Distributor/Distributor.cs b/src/distributor/NServiceBus.Unicast.Distributor/Distributor.cs deleted file mode 100644 index 919a0861a51..00000000000 --- a/src/distributor/NServiceBus.Unicast.Distributor/Distributor.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System.Threading; -using log4net; -using NServiceBus.Unicast.Transport; -using NServiceBus.Unicast.Queuing; - -namespace NServiceBus.Unicast.Distributor -{ - /// - /// Provides functionality for distributing messages from a bus - /// to multiple workers when using a unicast transport. - /// - public class Distributor - { - private int millisToWaitIfCannotDispatchToWorker = 10; - - /// - /// Sets the address of the datainput queue for this distributor - /// - public Address DataTransportInputQueue { get; set; } - - - /// - /// Sets the transport that will be used - /// to access the bus containing messages to distribute. - /// - public ITransport MessageBusTransport { get; set; } - - /// - /// Object used to send messages. - /// - public ISendMessages MessageSender { get; set; } - - /// - /// Sets the implementation that will be - /// used to determine whether or not a worker is available. - /// - public IWorkerAvailabilityManager WorkerManager { get; set; } - - - /// - /// Milliseconds to sleep if no workers are available. - /// Prevents needless CPU churn. - /// - public int MillisToWaitIfCannotDispatchToWorker - { - get { return millisToWaitIfCannotDispatchToWorker; } - set { millisToWaitIfCannotDispatchToWorker = value; } - } - - /// - /// Starts the Distributor. - /// - public void Start() - { - MessageBusTransport.TransportMessageReceived += messageBusTransport_TransportMessageReceived; - MessageBusTransport.Start(DataTransportInputQueue); - - WorkerManager.Start(); - } - - /// - /// Stops the Distributor. - /// - public void Stop() - { - MessageBusTransport.TransportMessageReceived -= messageBusTransport_TransportMessageReceived; - } - - /// - /// Handles reciept of a message on the bus to distribute for. - /// - /// - /// - /// - /// This method checks whether a worker is available to handle the message and - /// forwards it if one is found. - /// - private void messageBusTransport_TransportMessageReceived(object sender, TransportMessageReceivedEventArgs e) - { - var destination = WorkerManager.PopAvailableWorker(); - - if (destination == null) - Rollback(); - else - { - logger.Debug("Sending message to: " + destination); - MessageSender.Send(e.Message, destination); - } - } - - /// - /// Rolls back the message that arrived on the MessageBusTransport. - /// - private void Rollback() - { - Thread.Sleep(millisToWaitIfCannotDispatchToWorker); - - MessageBusTransport.AbortHandlingCurrentMessage(); - } - - static readonly ILog logger = LogManager.GetLogger(typeof (Distributor)); - } -} \ No newline at end of file diff --git a/src/distributor/NServiceBus.Unicast.Distributor/NServiceBus.Unicast.Distributor.csproj b/src/distributor/NServiceBus.Unicast.Distributor/NServiceBus.Unicast.Distributor.csproj deleted file mode 100644 index dfe67cba17c..00000000000 --- a/src/distributor/NServiceBus.Unicast.Distributor/NServiceBus.Unicast.Distributor.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {D142D372-C9FA-4505-A6EB-E919746F0FF1} - Library - Properties - NServiceBus.Unicast.Distributor - NServiceBus.Unicast.Distributor - - - - - v4.0 - - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\NServiceBus.Unicast.Distributor.XML - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\NServiceBus.Unicast.Distributor.XML - AllRules.ruleset - - - - False - ..\..\..\lib\log4net.dll - False - - - False - ..\..\..\build\output\NServiceBus.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Config.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Queuing.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Transport.dll - False - - - - 3.5 - - - - - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - copy /Y "$(ProjectDir)$(OutDir)*.*" "$(ProjectDir)..\build" - - \ No newline at end of file diff --git a/src/distributor/NServiceBus.Unicast.Distributor/Properties/AssemblyInfo.cs b/src/distributor/NServiceBus.Unicast.Distributor/Properties/AssemblyInfo.cs deleted file mode 100644 index 323d803165e..00000000000 Binary files a/src/distributor/NServiceBus.Unicast.Distributor/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/encryption/NServiceBus.Encryption/Bootstrapper.cs b/src/encryption/NServiceBus.Encryption/Bootstrapper.cs deleted file mode 100644 index 47354b5a374..00000000000 --- a/src/encryption/NServiceBus.Encryption/Bootstrapper.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace NServiceBus.Encryption -{ - using NServiceBus.Config; - - class Bootstrapper : INeedInitialization - { - public void Init() - { - Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); - } - } -} diff --git a/src/encryption/NServiceBus.Encryption/Config/ConfigureEncryption.cs b/src/encryption/NServiceBus.Encryption/Config/ConfigureEncryption.cs deleted file mode 100644 index 2d1459e4351..00000000000 --- a/src/encryption/NServiceBus.Encryption/Config/ConfigureEncryption.cs +++ /dev/null @@ -1,22 +0,0 @@ -namespace NServiceBus.Encryption.Config -{ - public static class ConfigureEncryption - { - static ConfigureEncryption() - { - EnsureCompatibilityWithNSB2 = true; - } - - /// - /// Causes the endpoint to no longer send extra data to make encryption compatible with NSB 2.X - /// - /// - public static Configure DisableCompatibilityWithNSB2(this Configure config) - { - EnsureCompatibilityWithNSB2 = false; - return config; - } - - public static bool EnsureCompatibilityWithNSB2 { get; set; } - } -} \ No newline at end of file diff --git a/src/encryption/NServiceBus.Encryption/NServiceBus.Encryption.csproj b/src/encryption/NServiceBus.Encryption/NServiceBus.Encryption.csproj deleted file mode 100644 index 6867064f27b..00000000000 --- a/src/encryption/NServiceBus.Encryption/NServiceBus.Encryption.csproj +++ /dev/null @@ -1,77 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {5F4AD8CE-D651-4891-BBAD-116F341163C1} - Library - Properties - NServiceBus.Encryption - NServiceBus.Encryption - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\lib\Common.Logging.dll - - - False - ..\..\..\build\output\NServiceBus.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Config.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.MessageMutator.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.dll - False - - - - 3.5 - - - - - - - - - - - - - - xcopy /Y "$(ProjectDir)$(OutDir)*.*" "$(ProjectDir)..\..\..\build\" - - \ No newline at end of file diff --git a/src/encryption/NServiceBus.Encryption/Properties/AssemblyInfo.cs b/src/encryption/NServiceBus.Encryption/Properties/AssemblyInfo.cs deleted file mode 100644 index 8d7aa8d67d2..00000000000 Binary files a/src/encryption/NServiceBus.Encryption/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/encryption/encryption.sln b/src/encryption/encryption.sln deleted file mode 100644 index 8a47dd88a49..00000000000 --- a/src/encryption/encryption.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Encryption", "NServiceBus.Encryption\NServiceBus.Encryption.csproj", "{5F4AD8CE-D651-4891-BBAD-116F341163C1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Encryption.Tests", "..\..\tests\encryption\NServiceBus.Encryption.Tests\NServiceBus.Encryption.Tests.csproj", "{15A80980-AA9F-48A0-B20A-5F7D8A2263CE}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5F4AD8CE-D651-4891-BBAD-116F341163C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5F4AD8CE-D651-4891-BBAD-116F341163C1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5F4AD8CE-D651-4891-BBAD-116F341163C1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5F4AD8CE-D651-4891-BBAD-116F341163C1}.Release|Any CPU.Build.0 = Release|Any CPU - {15A80980-AA9F-48A0-B20A-5F7D8A2263CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {15A80980-AA9F-48A0-B20A-5F7D8A2263CE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {15A80980-AA9F-48A0-B20A-5F7D8A2263CE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {15A80980-AA9F-48A0-B20A-5F7D8A2263CE}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/encryption/nuget.config b/src/encryption/nuget.config deleted file mode 100644 index cd17f414bd4..00000000000 --- a/src/encryption/nuget.config +++ /dev/null @@ -1,4 +0,0 @@ - - - ../../packages - \ No newline at end of file diff --git a/src/faults/NServiceBus.Faults.sln b/src/faults/NServiceBus.Faults.sln deleted file mode 100644 index 155ff044ce0..00000000000 --- a/src/faults/NServiceBus.Faults.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Faults", "NServiceBus.Faults\NServiceBus.Faults.csproj", "{EF79596C-0636-4CE0-945C-966F95F3909F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EF79596C-0636-4CE0-945C-966F95F3909F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EF79596C-0636-4CE0-945C-966F95F3909F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EF79596C-0636-4CE0-945C-966F95F3909F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EF79596C-0636-4CE0-945C-966F95F3909F}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/faults/NServiceBus.Faults/Configuration/ConfigureCriticalErrorAction.cs b/src/faults/NServiceBus.Faults/Configuration/ConfigureCriticalErrorAction.cs deleted file mode 100644 index 1fcdab47ba5..00000000000 --- a/src/faults/NServiceBus.Faults/Configuration/ConfigureCriticalErrorAction.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using NServiceBus.Unicast.Transport; - -namespace NServiceBus -{ - /// - /// Allow override critical error action - /// - public static class ConfigureCriticalErrorAction - { - /// - /// Set default behavior to zeroing the number of receiving worker threads. - /// - private static Action onCriticalErrorAction = () => Configure.Instance.Builder.Build().ChangeNumberOfWorkerThreads(0); - - /// - /// Sets the function to be used when critical error occurs - /// - /// - /// - /// - public static Configure DefineCriticalErrorAction(this Configure config, Action onCriticalError) - { - onCriticalErrorAction = onCriticalError; - return config; - } - /// - /// Execute the configured Critical error action - /// - /// - /// - public static Configure OnCriticalError(this Configure config) - { - onCriticalErrorAction(); - return config; - } - } -} diff --git a/src/faults/NServiceBus.Faults/NServiceBus.Faults.csproj b/src/faults/NServiceBus.Faults/NServiceBus.Faults.csproj deleted file mode 100644 index 5cf7cc3ad76..00000000000 --- a/src/faults/NServiceBus.Faults/NServiceBus.Faults.csproj +++ /dev/null @@ -1,71 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {EF79596C-0636-4CE0-945C-966F95F3909F} - Library - Properties - NServiceBus.Faults - NServiceBus.Faults - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\NServiceBus.Faults.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\lib\Common.Logging.dll - - - ..\..\..\build\output\NServiceBus.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Config.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Transport.dll - - - - 3.5 - - - - - - - - - - - - \ No newline at end of file diff --git a/src/faults/NServiceBus.Faults/Properties/AssemblyInfo.cs b/src/faults/NServiceBus.Faults/Properties/AssemblyInfo.cs deleted file mode 100644 index 377dd6c3507..00000000000 Binary files a/src/faults/NServiceBus.Faults/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/forms/Confirm.Designer.cs b/src/forms/Confirm.Designer.cs deleted file mode 100644 index 2d5a7db7973..00000000000 --- a/src/forms/Confirm.Designer.cs +++ /dev/null @@ -1,129 +0,0 @@ -namespace NServiceBus.Forms -{ - partial class Confirm - { - /// - /// 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.panel1 = new System.Windows.Forms.Panel(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.label1 = new System.Windows.Forms.Label(); - this.okButton = new System.Windows.Forms.Button(); - this.cancelButton = new System.Windows.Forms.Button(); - this.panel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.SuspendLayout(); - // - // panel1 - // - this.panel1.BackColor = System.Drawing.Color.White; - this.panel1.Controls.Add(this.pictureBox1); - this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(404, 90); - this.panel1.TabIndex = 0; - // - // pictureBox1 - // - this.pictureBox1.Image = global::NServiceBus.Forms.Properties.Resources.logo; - this.pictureBox1.InitialImage = global::NServiceBus.Forms.Properties.Resources.logo; - this.pictureBox1.Location = new System.Drawing.Point(36, 5); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(330, 77); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.pictureBox1.TabIndex = 0; - this.pictureBox1.TabStop = false; - // - // label1 - // - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.ForeColor = System.Drawing.Color.White; - this.label1.Location = new System.Drawing.Point(27, 93); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(352, 106); - this.label1.TabIndex = 2; - this.label1.Text = "The thing we need to confirm"; - // - // okButton - // - this.okButton.BackColor = System.Drawing.Color.White; - this.okButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.okButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.okButton.Location = new System.Drawing.Point(31, 215); - this.okButton.Name = "okButton"; - this.okButton.Size = new System.Drawing.Size(128, 31); - this.okButton.TabIndex = 4; - this.okButton.Text = "Ok"; - this.okButton.UseVisualStyleBackColor = false; - this.okButton.Click += new System.EventHandler(this.okButton_Click); - // - // cancelButton - // - this.cancelButton.BackColor = System.Drawing.Color.White; - this.cancelButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.cancelButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.cancelButton.Location = new System.Drawing.Point(226, 215); - this.cancelButton.Name = "cancelButton"; - this.cancelButton.Size = new System.Drawing.Size(140, 31); - this.cancelButton.TabIndex = 5; - this.cancelButton.Text = "Cancel"; - this.cancelButton.UseVisualStyleBackColor = false; - this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click); - // - // Confirm - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Gray; - this.ClientSize = new System.Drawing.Size(406, 258); - this.Controls.Add(this.cancelButton); - this.Controls.Add(this.okButton); - this.Controls.Add(this.label1); - this.Controls.Add(this.panel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = global::NServiceBus.Forms.Properties.Resources.form_icon; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "Confirm"; - this.Text = "NServiceBus - Please confirm"; - this.TopMost = true; - this.Load += new System.EventHandler(this.Confirm_Load); - this.panel1.ResumeLayout(false); - this.panel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button okButton; - private System.Windows.Forms.Button cancelButton; - } -} \ No newline at end of file diff --git a/src/forms/Confirm.cs b/src/forms/Confirm.cs deleted file mode 100644 index f4c29966b38..00000000000 --- a/src/forms/Confirm.cs +++ /dev/null @@ -1,54 +0,0 @@ -namespace NServiceBus.Forms -{ - using System; - using System.Diagnostics; - using System.Drawing; - using System.Windows.Forms; - - public partial class Confirm : Form - { - public Confirm() - { - InitializeComponent(); - } - - public string ConfirmText{ get; set; } - - public bool Ok { get; set; } - public bool OkOnly { get; set; } - - public bool Cancel - { - get { return !Ok; } - } - - - private void Confirm_Load(object sender, EventArgs e) - { - label1.Text = ConfirmText; - - if(OkOnly) - { - cancelButton.Visible = !OkOnly; - okButton.Location = new Point(135,215); - } - - } - - private void okButton_Click(object sender, EventArgs e) - { - Ok = true; - Close(); - } - - private void cancelButton_Click(object sender, EventArgs e) - { - Close(); - } - - - - - - } -} diff --git a/src/forms/Confirm.resx b/src/forms/Confirm.resx deleted file mode 100644 index 29dcb1b3a35..00000000000 --- a/src/forms/Confirm.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/forms/NServiceBus.Forms.csproj b/src/forms/NServiceBus.Forms.csproj deleted file mode 100644 index 74b7b0b6b44..00000000000 --- a/src/forms/NServiceBus.Forms.csproj +++ /dev/null @@ -1,117 +0,0 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {2F247865-A4AB-4C70-B584-25E22A988091} - Library - Properties - NServiceBus.Forms - NServiceBus.Forms - v4.0 - - - 512 - - - - - - true - bin\Debug\ - DEBUG;TRACE - full - AnyCPU - false - prompt - false - false - false - - - bin\Release\ - TRACE - true - pdbonly - AnyCPU - prompt - - - - - - - - - - - - - - - - Form - - - Confirm.cs - - - Form - - - PrepareMachine.cs - - - - Form - - - TrialExpired.cs - - - Confirm.cs - Designer - - - PrepareMachine.cs - Designer - - - ResXFileCodeGenerator - Resources.Designer.cs - Designer - - - True - Resources.resx - True - - - TrialExpired.cs - Designer - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/forms/NServiceBus.Forms.sln b/src/forms/NServiceBus.Forms.sln deleted file mode 100644 index 192fa19e7ef..00000000000 --- a/src/forms/NServiceBus.Forms.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Forms", "NServiceBus.Forms.csproj", "{2F247865-A4AB-4C70-B584-25E22A988091}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2F247865-A4AB-4C70-B584-25E22A988091}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2F247865-A4AB-4C70-B584-25E22A988091}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2F247865-A4AB-4C70-B584-25E22A988091}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2F247865-A4AB-4C70-B584-25E22A988091}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/forms/PrepareMachine.Designer.cs b/src/forms/PrepareMachine.Designer.cs deleted file mode 100644 index 9046b32c9b5..00000000000 --- a/src/forms/PrepareMachine.Designer.cs +++ /dev/null @@ -1,147 +0,0 @@ -namespace NServiceBus.Forms -{ - partial class PrepareMachine - { - /// - /// 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.panel1 = new System.Windows.Forms.Panel(); - this.pictureBox1 = new System.Windows.Forms.PictureBox(); - this.moreInfoLink = new System.Windows.Forms.LinkLabel(); - this.label1 = new System.Windows.Forms.Label(); - this.prepareMachineButton = new System.Windows.Forms.Button(); - this.dontBotherMeAgainButton = new System.Windows.Forms.Button(); - this.panel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); - this.SuspendLayout(); - // - // panel1 - // - this.panel1.BackColor = System.Drawing.Color.White; - this.panel1.Controls.Add(this.pictureBox1); - this.panel1.Location = new System.Drawing.Point(0, 0); - this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(404, 90); - this.panel1.TabIndex = 0; - // - // pictureBox1 - // - this.pictureBox1.Image = global::NServiceBus.Forms.Properties.Resources.logo; - this.pictureBox1.InitialImage = global::NServiceBus.Forms.Properties.Resources.logo; - this.pictureBox1.Location = new System.Drawing.Point(36, 5); - this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(330, 77); - this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; - this.pictureBox1.TabIndex = 0; - this.pictureBox1.TabStop = false; - // - // moreInfoLink - // - this.moreInfoLink.Anchor = System.Windows.Forms.AnchorStyles.Bottom; - this.moreInfoLink.AutoSize = true; - this.moreInfoLink.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.moreInfoLink.ForeColor = System.Drawing.Color.White; - this.moreInfoLink.LinkColor = System.Drawing.Color.Blue; - this.moreInfoLink.Location = new System.Drawing.Point(57, 229); - this.moreInfoLink.Name = "moreInfoLink"; - this.moreInfoLink.Size = new System.Drawing.Size(264, 20); - this.moreInfoLink.TabIndex = 1; - this.moreInfoLink.TabStop = true; - this.moreInfoLink.Text = "I need more info before I can decide"; - this.moreInfoLink.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.requestLink_LinkClicked); - // - // label1 - // - this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.label1.ForeColor = System.Drawing.Color.White; - this.label1.Location = new System.Drawing.Point(27, 93); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(348, 60); - this.label1.TabIndex = 2; - this.label1.Text = "It looks like this machine isn\'t setup to run NServiceBus"; - // - // prepareMachineButton - // - this.prepareMachineButton.BackColor = System.Drawing.Color.White; - this.prepareMachineButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.prepareMachineButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.prepareMachineButton.Location = new System.Drawing.Point(31, 146); - this.prepareMachineButton.Name = "prepareMachineButton"; - this.prepareMachineButton.Size = new System.Drawing.Size(346, 31); - this.prepareMachineButton.TabIndex = 4; - this.prepareMachineButton.Text = "Let NServiceBus prepare my machine"; - this.prepareMachineButton.UseVisualStyleBackColor = false; - this.prepareMachineButton.Click += new System.EventHandler(this.prepareMachineButton_Click); - // - // dontBotherMeAgainButton - // - this.dontBotherMeAgainButton.BackColor = System.Drawing.Color.White; - this.dontBotherMeAgainButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.dontBotherMeAgainButton.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.dontBotherMeAgainButton.Location = new System.Drawing.Point(31, 183); - this.dontBotherMeAgainButton.Name = "dontBotherMeAgainButton"; - this.dontBotherMeAgainButton.Size = new System.Drawing.Size(346, 31); - this.dontBotherMeAgainButton.TabIndex = 5; - this.dontBotherMeAgainButton.Text = "Don\'t bother me again"; - this.dontBotherMeAgainButton.UseVisualStyleBackColor = false; - this.dontBotherMeAgainButton.Click += new System.EventHandler(this.dontBotherMeAgainButton_Click); - // - // PrepareMachine - // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.BackColor = System.Drawing.Color.Gray; - this.ClientSize = new System.Drawing.Size(406, 258); - this.Controls.Add(this.dontBotherMeAgainButton); - this.Controls.Add(this.prepareMachineButton); - this.Controls.Add(this.label1); - this.Controls.Add(this.moreInfoLink); - this.Controls.Add(this.panel1); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; - this.Icon = global::NServiceBus.Forms.Properties.Resources.form_icon; - this.MaximizeBox = false; - this.MinimizeBox = false; - this.Name = "PrepareMachine"; - this.Text = "NServiceBus - You machine needs to be prepared"; - this.TopMost = true; - this.panel1.ResumeLayout(false); - this.panel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); - this.ResumeLayout(false); - this.PerformLayout(); - - } - - #endregion - - private System.Windows.Forms.Panel panel1; - private System.Windows.Forms.PictureBox pictureBox1; - private System.Windows.Forms.LinkLabel moreInfoLink; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Button prepareMachineButton; - private System.Windows.Forms.Button dontBotherMeAgainButton; - } -} \ No newline at end of file diff --git a/src/forms/PrepareMachine.cs b/src/forms/PrepareMachine.cs deleted file mode 100644 index 6f802cb32db..00000000000 --- a/src/forms/PrepareMachine.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace NServiceBus.Forms -{ - using System; - using System.Diagnostics; - using System.Windows.Forms; - - public partial class PrepareMachine : Form - { - public PrepareMachine() - { - InitializeComponent(); - } - - public bool AllowPrepare{ get; set; } - - public bool DontBotherMeAgain { get; set; } - - - private void requestLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) - { - Process.Start("http://particular.net/articles/running-nservicebus-on-windows"); - } - - - - - private void prepareMachineButton_Click(object sender, EventArgs e) - { - AllowPrepare = true; - - Close(); - } - - private void dontBotherMeAgainButton_Click(object sender, EventArgs e) - { - DontBotherMeAgain = true; - - Close(); - } - } -} diff --git a/src/forms/PrepareMachine.resx b/src/forms/PrepareMachine.resx deleted file mode 100644 index 29dcb1b3a35..00000000000 --- a/src/forms/PrepareMachine.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/src/forms/Properties/AssemblyInfo.cs b/src/forms/Properties/AssemblyInfo.cs deleted file mode 100644 index 328ce542595..00000000000 --- a/src/forms/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("NServiceBus.Forms")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NServiceBus.Forms")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("26420a94-196a-4d83-99df-b3f4fb8cae37")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/forms/Properties/Resources.Designer.cs b/src/forms/Properties/Resources.Designer.cs deleted file mode 100644 index 68356375e56..00000000000 --- a/src/forms/Properties/Resources.Designer.cs +++ /dev/null @@ -1,91 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.269 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace NServiceBus.Forms.Properties { - using System; - - - /// - /// A strongly-typed resource class, for looking up localized strings, etc. - /// - // This class was auto-generated by the StronglyTypedResourceBuilder - // class via a tool like ResGen or Visual Studio. - // To add or remove a member, edit your .ResX file then rerun ResGen - // with the /str option, or rebuild your VS project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - internal class Resources { - - private static global::System.Resources.ResourceManager resourceMan; - - private static global::System.Globalization.CultureInfo resourceCulture; - - [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] - internal Resources() { - } - - /// - /// Returns the cached ResourceManager instance used by this class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Resources.ResourceManager ResourceManager { - get { - if (object.ReferenceEquals(resourceMan, null)) { - global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("NServiceBus.Forms.Properties.Resources", typeof(Resources).Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - internal static System.Drawing.Bitmap complete { - get { - object obj = ResourceManager.GetObject("complete", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - internal static System.Drawing.Bitmap error { - get { - object obj = ResourceManager.GetObject("error", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - - internal static System.Drawing.Icon form_icon { - get { - object obj = ResourceManager.GetObject("form_icon", resourceCulture); - return ((System.Drawing.Icon)(obj)); - } - } - - internal static System.Drawing.Bitmap logo { - get { - object obj = ResourceManager.GetObject("logo", resourceCulture); - return ((System.Drawing.Bitmap)(obj)); - } - } - } -} diff --git a/src/forms/Properties/Resources.resx b/src/forms/Properties/Resources.resx deleted file mode 100644 index 7de08628379..00000000000 --- a/src/forms/Properties/Resources.resx +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - - ..\Resources\complete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\error.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\formicon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - - ..\Resources\logo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - - \ No newline at end of file diff --git a/src/forms/Resources/logo.png b/src/forms/Resources/logo.png deleted file mode 100644 index e34e692d654..00000000000 Binary files a/src/forms/Resources/logo.png and /dev/null differ diff --git a/src/forms/Tests/Test-PrepareMachine.ps1 b/src/forms/Tests/Test-PrepareMachine.ps1 deleted file mode 100644 index ce8c08d6241..00000000000 --- a/src/forms/Tests/Test-PrepareMachine.ps1 +++ /dev/null @@ -1,9 +0,0 @@ -$path = "C:\dev\NServiceBus\src\forms\bin\Debug\nservicebus.forms.dll" - -[void] [System.Reflection.Assembly]::LoadFile($path) - -$form = New-Object NServiceBus.Forms.PrepareMachine -#$form.Add_Shown({$form.Activate()}) -[void] $form.ShowDialog() - -"Allow prepare: " + $form.AllowPrepare diff --git a/src/forms/TrialExpired.resx b/src/forms/TrialExpired.resx deleted file mode 100644 index 3c63b7a4c3c..00000000000 --- a/src/forms/TrialExpired.resx +++ /dev/null @@ -1,1442 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - 17, 17 - - - - - iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAYAAACI7Fo9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAGYktHRAD/AP8A/6C9p5MAAEyTSURBVHhe7Z0HeBRV18c/fe39tbwWEBAVC6CAVAEBARUQAamC - gALSlA5K7713AQFBCKGFJKQX0ntvm81ms+kkFKUoIP1+58zO3cxutu/MbBuf5zhLypbJ/OZ/7rmn/N// - Sf853RkghDwN9jpYU7CPwbqCfQk2GOz7ezdvTvq3qmreNZVq9dX8/I2XsrK2XcnL2/1ncvIBLcvI2PlX - RsaWvzIzN/2jUCz+W6Wac/vKlR/gOQayz4fP2w7sA7AGYM+BPeh0J0x6w9IZcNQzAEA9ClYPrBVYb7AR - 927cmP5PcfHWP1NSPKqCg/1Ljx2LK9q3L6dw505lwebNlbK1ay/lLl9+M2fxYpK9aJG2LVxIsrm2YAHJ - BsuaP1/b5s3Dr9/OWbr0imzVqqr8DRuKFDt2ZMPrxJedPOl3PiLiwF9pacv+vXBhFLynnmCt2ZvAU456 - LqX3JZ0BhzgDAMpjYI1YZR5279atn/8pKtp9LirKu+zEifjC3buV8nXrruQsW0ZywQBCtS1Zom0AuK2Q - ZwHoWXPnalnmnDmEsdmztQxuEtdla9YUF+7alVB+6pTXxfj4DXADGAmf41Ow98CecYgTLL0J6QzY4wwA - AP8Faw7WD2zKzT//3Hw+Ls6r7NixZMX27WdBSe+CMhPGWLjp0VEgz/jlF8LYzz9r26xZ97MXL75QsHVr - Srm39zFYFiwid++iR4Kf92WwB+xxzqXXlM6A4GcALu6Hwd4B+wpsJqyfd56LjPRX/fFHbv6mTZdzV6wg - Wua8kJOMWbNI+syZWgaewLX8tWvzSjw8fP5MSloF4KPL/y7Y44KffOkFpDMg5BmAi/hZsPZgo+/cuLHm - z9TUE6DYafItWy7lrVpF8lauZMzVIU+fMYMwNn26xsALuC5bty6z/ORJjysFBRPgHGHA7yUh/x7Sc0tn - gLczABcrRsMxCj7+xvnzO6pDQ8NVe/cWQ5DsDgM3NTeGPG3aNMLY1KnU7mctWFAJcYiQC9HR81noX+Dt - jyI9kXQG+DgDcGFidLwN2LibFy5sQ7iVe/ZUANz3ZatXEzQJcrWa64FcDfuUKYylTp6Mwb4LENwLuRAT - MwfOKUb0n+bj7yQ9h3QGrDoDcAHi1tcA2LNeDRdlQNFvv5UxcK9ZQxiTINdy182BHEHX2KRJCP05uGn6 - Xs7OHgnn+k0waQ/fqqtV+iWLzgBcaLgNhuvu6deKiw/AGjNdvnHjTQ3cEuTq9bjOmtwayFMB9NSfflLb - pEl385Yvzyr38toE8Q48/89a9IeTflg6A+acAbiwMCPsy3t37qy4mJDgV7RnTxWoN2GMwi1BLgzkLOwp - P/5I0DKmT/9LuXu39z8FBZi994o5fz/pZ6QzYPQMwIVUF+zbO9eubaoKCYmCveG/89etUwNuAHKt9bib - R9dtVnIdyFMmTiTUQOVv5a9fH3kxMXE8/I0agkn78xLPlp0BuGjewMg5JLL8CkkfKeCe30LAJchn6d0n - F8RdNwI5wp48YQJj8PgeZAymnwsPx+Ad5ipI63jLLnf3+2k2wDYOCjt2VPj6IuC3KeAS5EYg5+yRmxtd - 1w28aa3JzYScwp48fjxJGT8eM/IyqqOiZsHf8S1J4d2PX5OfGC6KOmCjb1+9uqPSzy8RstW0AJcgd2zI - EfTkceOo3Yd04eQLsbGT0aU3+ceXfsD1zwBcCJhz/i1skW2GNXiMfPPmm7DuY1x0ScnZHHZIadWX1qob - WbeXkutAzsCeNHYsHu9BrUAslOFild3/XP9qlj5hrTMAf3jMPe9279691edjYkKgkOQfBnBzIde3R+5u - gTcHcNcNQY6gJ/3wg9rGjbudv3FjwPXSUsyvl0pp3eF+gOs2sBZg86/K5Z6QjHEe6q3VgEuQ61ahOaWS - a0FOYR8zBoN2V5R79+67ff36R/D3/487XO9u+Rnhj/si2MR/z5/fU+rpKWcAlyA3VGpaG3I9iTCO5q4b - gjwJQE8cPZoxSLktq/DxWYhbp24Jgqt+aNxuAfsUkl3WMevwTZvuSJDPVgOuv57cZSGnsCeOGnU/Z9Gi - eGixhe23HnPVa99tPheb8DLjH5XqsMZNl5Tc3SEnADpJ/P57DNhdhSy77XCdvOk2ULjSB8U1GFhPjKbD - dhnuh9/TqLjkrruzkmsgR9CpQX181rno6KFwzUiNMJzlRgB/rJfApv2jVHood+26pAW4BLkEOQdwBD3h - u+8YA5W/UbB9+05p7e4EpMMfqS1sma2tCg2NhbW4topLkEuQG4A8YeRIQi1r9uzEPzMyusG19JATXPLu - 9Rbhj/Ik2PfQgXSv6sCBcnDV1RF1rklbaPoaObpD4E2vu06VnAt5wogRBA2i9H8WHzo0FxOq3IskB/60 - bPrq/EuZmT6Kbdv+dUfIIceb5G2EG9ue3aTg4AFSePwoKTrtQ4rDQkhxRDgpjY0mJbFRpDQpgZSlJrGW - SEpiosAiSXFkOFGFBhOlnw9RHPMk8gP7iWznDpILGYKZ0PtdyCo0boEKN3fdrGQYzj45dwuNE123GPL4 - 4cMJWsLw4ffzVqw4SW7elAJ19uYfIG8Frvr6s0FBieCq37cYcnNqyR0k4w0HMsi2bCaKw4eIKsiflCbE - koq8bFJVXkzOXagyYGfh62dJta6dh68ZtEr4Xo1VweOqylJSLssmJQkxRAmvLf/jAMlZv46kQ6tnreIU - 7BCDDSO4TSOsKFCxN+QU9vhvv8UuORngyuPEGqkqTmzg2aj6gNv//LOz5PDhYgTcpSAHhc7fsZ0oT50k - pfExpLJARs4BmIaB1gc6T5Aj6Lp2Dr7GWoVCRorjoonC6wTJ3byRpEGrZ01nGCeHHEGPGzYMXflzladO - Yd37E2Jf6277enCysdPqlGtlZX/AHuhll4Ac1BrBLgLXuSI7nVRXV1gItS7o4kBOYecez1aXk7LcTFLo - 50tyNm8iqdD8kekOw2ka4ajuOlfJKeQIOlr8iBE3YTTVetzVcVv4xPrgcJJfwTz1y3l5Jwu2bbvpzJDj - xBUFuMBloIbV4H6fv1jNmGWqbT8l1wd51bkKUPoaOwuPK8HtLwavJP/3feDqz2KA16zF2eYRjKuuXWqq - qUIzJ62VjzW5McgZ2IcORbufs3z5EbgG64l1zbvd68DJxWYCKy7Ex4cUbNly1xkhx9lpCgiWlcXHknNV - 5Rq4XRVyBF3L4DMXJ8YR2b49JHXmDDXwzgM5ifvmG8YyZs8+Qy5daup2EAr9gTHoBra+MjAwCYJuzHrc - 3DW5RU0cBQq8yXf9Skohwl19tqwW3G4DOUIPSxKNAfQq8GZytm0hyajyNY0jmHpy3pScs0fObKWxW2ga - BWej7Oiq67rrHCXXQE5hT/7xx+zLcnknuC6lXnV83ADgRH4GBSmbYaqozJkgz4WbRpG3FzmryDcIt9tC - zgUe1vTlRQWkwOs4SZ831ykgjx0yhKAljR5dcj4hoS8Gh/m41t32OeAE9oZ89W1MZN1JlDx/+zZYd8eQ - cxCVpiAbOwqyJje6fYZba3q20ExE181dk9dy13WVXAdyDN5pDFU+MZZkb1hHkrnNI6DM1OJ9coGUnEIe - O3gwQQMv4Tx4miPgWn3YbUG19oOjOwQ24O716zsg063SGSAvgCSTisw0s+AWVMmdFXIW+Eo4opVC5D53 - 96/MOt5RIaewg8t/ucLLawxcs49Ye8273e9hYgLYN9Co8VfV/v3VDg05RM6VRz3J2ULT7rmuqktKzlFy - Hcgp7HhEt152+A8Ca2JN8wimzJQtNeVWoTFprSIpOYU8dtAgggYR+b+LPTx+gmtXqm83dddiIR9x+9Kl - 3UV7915wVMhzAfDCI4dJlVJukYJLSo7BuNqA49e4cOt7XF6sILJDB0gSROl1Idebt85j4E3XXdeFPGbg - QIIWN2TI9eIDB2bAdSyVuxqCnXXXh/178eJv0CTiL0eFvGD/PgiwyawCXLB9chdx103BXllVRspA4XN3 - 7VSrO6fM1F5KTiGnR1D3m8qdO3+B6/lRU8Lmdt9nIR8IgxN2OSrk+ZBnXp6SaDXgEuTWKbkGfoAcQadW - kp1GMlcuV9eT28ld14U8ZsAAgsbAvmfPdClAp3MrgxPS5y7krSt/++2ioyl57soVpAQqu86DapoTRTf0 - M9Ka3Lw1uV5V14GcC3xhWBBJnjypBnae9snNddc1sLOQc2C/DjGmCXBtS3XtyDuciC+wOMURA28Fe38j - VeAq2gK4pOT8KjkX8gq4AaCVFxeSnF93qGEH0G1NhrEV8pj+/Qljgwb9A1vDI91+nx1OQHvcJy8yZwvN - gukpMhiwYMtU0zwoXy2LjrQZcAly4SGnsOOxCMpoU2ZM0wbdwow3viCP/vprggaBu6uQ7IUjnt0zgw4+ - eBOwDaXHjhWYdNdFhFxx4HdSXaaSINdToGJTMoyRLTRL3XUu3LqPy8tVJHfvHrWy2xlyCjtsvVVdCA7u - 6I7Bt1cB8jWVAQEpjgJ53sqVpCQijBfAJSUXV8n1ga+MiSBJsPdOy0w1R3UVWq3cdb6VnEIe3a8fQUsc - MUJRnZT0vtvADoA/B7bofHT0GUeBXA614FVm5KSbu1bnI/BmWVcYB05rFUnJtWA/W0oqwMqK8knmmlU1 - sNsJ8ui+fQkaVOrFkOvXX3V52DFFEOzny1lZ3jC5lGn9ZLAKTSR3vQi6uJw/Z1tEnXsDkCAXJrpuzF3X - BzmCTk3u40XiR46wi5JTyOkR+u+dAAaedWnY4QOO/Le6ej80cdTfNMKSTq3Y782GqaboqmPxyYU/zzmU - uy4pufZ+OUbZbYGcwq5KjidJEydouexCu+u6kEf16UPQoHnFMpfdY4cP1omJsGNqqz4lFxFy2ebN5Kw8 - T4Jc0/utdmcYZwi8mVJyrqqXg8KXKvNJ2qIFDOz2gjzqq69wzf6v6vffcTKMa0Xi4QO9yUTYjx+X2xty - xe/7yTlobyQpOW3w6B6QI+iMVRSTnD27SCzCzpaaGspdN5QMQ/fJNQE3diuNBt4MKTlCTg1e82xVZGRL - l3Hh2eDbsuqIiCh7Q1508ji5AK2RHQdya5o4SoE3S5VcAzmFHY5y75PMmt0ekCPskb17Y65+Erl27WWn - h52tRpsE00w9CjZvZvq8WT09xcY1OaaxIuAS5G6q5BzIy8+WgLqXkMKocBIPufK01NRQ7jpNa+VDySnk - kV9+SdBgdPUup692gw/wOa7LC3fv/stukC9fTsoT4iTIOb3Y9XVrFW1NbiRvna/AG67N9am4+mtqyKmp - 0hJJwpjRTJmplunkrgsBOYIO4N+GGo9vnXa9Dm+8Pq7Ly728su0G+YoVUHGWJEEuQc6Crw15eSX8G0yV - lUoSoHWVkGtyXSWnih7ZqxeJHTiw9C+ZzPmSabAWF2zen+npvvaCHHPdKzJSJcglyI1CTmEvzsskibD9 - pnHTqaKzBSq2BN6MQY6gR/TsSVImTDjtdPvr8Ia/uXnp0i4YsnDDLmtyUHLs3yatyWtGJ0nuOkfNWSWn - kHNhTxg/rgZ2HiDHoBtj7Jqcq+QUcgQ9smfP+/K1a2c6TaUbW6yysdTDQ2k3yFOTJcglJTdLySnkZQA/ - mgpGYsXjml1EyBF0NEimuXguNraNw0fhAfLHwBZeSEgItAvkGHhLipcglyC3CnIN7BnJJA5SZm1x181V - cgp5RI8eBA223EJxS9qhYYc3OADaQe1UbN1a47KLmPFWBnPAJXddctf1Rdd13XRdJaeQ02NRSjyJhTJX - 3So0c5JhrIU84osvCJps5UpsQ+WYY5rhjTUEW1/q6SnXqLmIkEv75FzA8bEdM94cbAvNUsjLKovBjS9m - 9tkxEm9JxputkCPo0X36VF9KS3O82W4A+ENgv0CU3dsekDMZb1IyjGZmuQS56cCbroLX/FsNObV8yKBj - VJ0tNaVHWqDCTWvlA3IE/cznn5PEsWO9gKmnHMqFhzfUHaaqbIP50X8zoIuo5Apov4yNG6WMNwfIeHMR - JeeCjo9z9v+mBbrQkCPoYPdga3qkw4COe39gqyq9vdPFhly+Ywc5f7ZcgtwRqtBcFHIKfcba1QzsokD+ - 2WfkDFhUv35F18vLX3MI2AHyYfBmfoe7zz0xlTxv7VpSXazkHfJqqGxLXgyljJN/IrGTfjRtE8aRyBHf - aiwCHmvZcPg3a+ED+pPQr77Ua7mHDzDDD6sMmVYkXXc97phr8nx/H5I4bzZJMNfm/kISeLA8Xy8m403X - zHXXdRUd/11aqiRJ06eqQedUofHprjNKzkJOj2lTp66ze2COTXNdX3zwYImYkOfCNhrNejO3vZOpn+N2 - hokZO4Ychk7UYtqx558npbIs/aA7IeRlUPt9sm4dUc8h/r2OPf9fosrJ4BVyBnwob1VB9lzst8M0oAsN - +Znu3cmZHj2uVPr5fWg3VcckfLApf2VmnhIV8mXLSHFwEO9KzgX9bGkR8apXT/SLNLR3r9qgOyHkWJwS - PWGs6OcPQU/fsVUQyEsBdDQFROIxCi8K5AB6eLduJGnUqOOYVm4X2OGFW9y7c2eT4tdf/2JAF6nHW+Gh - P8iFi9WCt3+SnThKDj/wgOgXa9buHTWwOynkBTA9xeOhh0Q/d4HduwoKOYU95+DvZqW16ibD0H1yemSD - brXcdUbJWcgRdHh8J3/r1l6ig45rBrA55yIjw8SEHFtAYfDNlBtu7vdNNXKMGDpE9IuVceHBRaxyUsgr - QPV8mzcT/bx5Pv00KUpP0gLdljU5ddcp3DVHFSi7iqQsnK+dvw7FKdzcdb4gR9DR4gYPjgbmnhQVdnjB - 1ndu3tys2L79b7GUHNfllblZokGON4HKQjk58fLLol+0IT2/MAG64ybDJK1YKvr5Qpc9Zd1q0SBH0IsV - uSR2+HA17AJDHt61KwG7n7d8eX/RQMfqGrC51eHhEaJBjuvyQH9RIadqn3Ngn10u3Mxfode8XlV3XMiL - IEfc8+mnRD9f/h3bM73gTKW16oum6/0aux7XVnO1knOtIDxYA7pGwdkCFZq7bq27TpWchZyEf/opiR4w - IEG0JBp4oXZ3btzYIt+y5ToXdBlsdzGGLZ+4ZkNL5lwAHK1g16/kPCisuS65sZ8z5a7r+35o7y9Fv3iP - PvccKcnRdeEdF3Ls4xbSq4fo58nzySdIIcxc4wVyAByj64bcdV3Q8d8ZmzYwlWdaxhao8Ak5go6Ws3jx - UMFVnU11XVAVEhIlFuS5UFt+tkBmN8gR/LK8LHL0v8+JfhFru/CODXnWQft4PolLFtoNcgS9RFVAYqHS - je81OVfJKeSMqn/9dQpw+LSgsMMLtLl3+/ZGUPNrFHQhlRzVvDjAz66QqxX+LMnctll00HHtmbF9q8MX - qGC/9JN1XhP9/Jxu+REpg6GKqOY2Bd6sUHKuusthlyECO8UIqOQIeViXLozlLVki3Fqd3TefeT4mJkgs - yGFLgZzjYVySNe56ze/UtGQO7NxJ9ItZ7cJnaGDX28QRKtXOVhsyGwYempnWGjXuB9HPy5FHH2X2tO0N - OQU+dfkSNehsqamlW2j61uRcJaeQh3XujBV1Z4DHxwRRdXjid8DWKXbu/BNBF1rJc5YuJRXpqTarOV+Q - 46ikEgw2Pfmk6Bd10GfdGdAdEXJ5aCDx+M9/RD8ncb/MdBjIS8GrUOVnk0hIpOGCbu4+uSWQI+gA/V35 - zp2dhAJ9/OXMzBNiQY5zym0NvvEJOZ2JlrJimegXNZPxtX2LftDtqOQY6fb98APRz4dP0yakDLIX7emu - a1x3gBxBLwHL2rdHA7pgkCPoYDD7/QjGzHiFHZ6wDqo5zIsqEUPJcc+8CvawbQFdCMiroRy2CsDya91K - 9Iv76LPPkpKsNG3Y7Qg5RtmTwF0Vsx4AXwsz7vJDAhwOcgS9pKSQxI4YwdST6ytQ0c14s1jJWchDO3VC - Vb9RfupUE75BH3ytvHyfGJCjy17k7eWQkCPoaKq4aOLxyCOiX+TowmvcdztDjlloR58SfxkTA1WFjqbk - DOSsyaBiT2jIEXQ0aBGNlW38DGqEJ3ocbGWFt3eyUPvkGF1HwNHyYN/93Nkyq0EXSskp5PSI5ZRiqxnj - wm/ZaFHgrbK6nJhlZgbe6Nyz4B6fi/75TzV6m5QWKwyArt0ZxlAijKX75Pr2ztFVp+46F/KS8iIAvogk - TJmsnb+uk7tui5JTyPEI8QAlsPkCL6oOT9QettQ2yDdvvi5EMgwX8pwlS6AyLdDhIUfYz1aWEZ8mjUW/ - 2BkXHnrW146y146umwU43ggshDzrwF7RPzcG/LDOXL+aOw7kCHoB7AZo6soFgjz0k08IWtbixYP4An3a - xcREXzEgz1u7hpyrsq5oRSwl5yp7IUac7VGl1fVTHdDFgxz3zE+8Jv6eeeQPo50CcqrqiTNnMBVo3Co0 - vpScQh7asSOJGTTI1+YSVniCemBri/buLeU7rVVXyRk1h4mn1gTg7AE5doNBi500UXR1Y1z4zdSFFw9y - dNujADixlywn69cnxYUyPaA7lpJTyBlVj41gVF0DN1uFZijjjbtPzmyhcQJvXHedCzmCHtap0/WqsLD3 - bFJ1gHzAv9XVv8La/L4GdB5y1/VBLlu3lpyDAJOloNsTcgT9LKzXvBq+IfrFf/SZZ0gx7OufBdeba0K5 - 6wg5RrtF3zOHngDZxzycCnKNqv8ySxt0dRUak7NuKBnGEsgRdLTk8eMXWQ06m9e+5GxAQLTQkKOal4SF - OB3ktMdbPqwd7dGkIujTLqJBzuyZw/612GoePuwbp4ScUfW4CBJOG0gIBHlIhw6YkZcOvD5rFezwi43B - 1sCgxL8Y0AVScoQcJ59auja3t5LrNnKM/G6E6BAgdGkb1jKwC6nkqOaJSxeJ/vlOvPoKKZbn6IDuuO46 - 13XXROCnTlGruABKjpCHtG+Pdk+2dWtHa0H/5u/CwgNCQ46gF/l6W6TmjgY5dm4thyomewSpPJ95mqjA - hTcLdAuj63QrDffM7ZH6mwkVcdpRdueCHGGXBfgKDTkDe+LIkVss3lOHX3gYbFm5t3eSkEqOkKNVlSjN - Bt0RIactmnM9/hBd9VDVA6DYhtkiM6bsVkKOsAd9/pnonyv0675ODzmj6mVKEj1iOK9rco6SU0XH6L7c - YvcdfqEp47Zv2XIFQUfXWstWriR5YFgrrmWQuorpq7RhBD3SZBgKtua4eDEp9PRwCchpN5jwAV+LDgXC - ngouvEHQbYA8c/8e0T/PsRdfIEVQsWdoTJI9k2H0uefGvlYMoGd7HtKAbm10nQbe9EEe8vHHBK1gzZou - FrnvAPmwq3L5QaEhh24ZpDIv2yzQHVnJuS2fyvJzyPEXXxQdjqPQwqkoLbE27DZAXlIIe+avvir6Z0mD - NlquAjmCXlxcQCL79tHUk3Mj6/hYa/sM01vZZBgKNx4ZwGvW5Bolp5AHt2tH4ocN22G2+w4/iD3hlpR7 - eSULqeQIef62rS4FOQU+a9cO0eFAVQ/s9Im2C28D5Mye+ZhRon+OoC8+dy3IEXSwNGheyag5Z4+cT8gR - 9LCuXRXA7jNmqTr84Jtgq8Ft/0sodx0hz160iJREhBsF3TYVV3eGQaMlppojW5yim79e8291Mgw1a8Yk - BdthXcu48OtXq1XdRsjzg/xE3zPH9F4lBBbVau58gTfqwjMqrmOK5NhaoPOl5Ag5tfw1a9qaC3qPfysr - fxUa8hwoZME5Z4YSZJwZclT2ksxUchQi4mLvOx99Clz4VHDhjYBOo+mGjvbaM0/ZuM4lIafQx479weyM - N3PddS7kwW3bkpghQ5aaC/qUqtDQEA3oPAbeqJKjmitg4oqrQk7nk6etXyM66EwUvmMHUnm2VC/spiBn - 9swXzRf9fQd06sh0YHU1JecqOxYD8e2ua0AHyBH0yB49osAjf8Qo7Ojfg62C3PYiBnSBIEfQyxLj9YLu - 7EpOIWeO4EL7t/9YdGiYgQZrVtYC3RzIMaAn9p4507I5Kc6lIUfglTCBJxTW6cZy161VcoQ8uE0bdOGv - X8zIMD5qGSBvee/WrbWQ235bSMhzYAtOX167S0HO9nhTwQXs+fjjosOOTSGU8NrUhTcHcmbPvHs30d8r - dqpxZSXnqnrcjxNqQLcyuq7rrmsgR9DBksaM+daUog+8lJl5REjIDbntrgg57QaTtGiB6PAwLnyH9owL - by7kmXt3i/4+T7duCU0csP+bCbfdxpbM+nq86WsaYc0+ub7gm6GvZf3xuxp0gSBH0KP79t1rCvSZFb6+ - 0Xwlw3DX5Ag4YwsXkrK4GC233ZUhR9gRNnsMHmRc+FUwSx6U2pSVFuSRE6+8Iiro2LIZyzndBXKEvzAn - vQZ0tvrMZnedVXKEPKh1a0y5zTBYow7feBpbRhX99lsRHxlvhiBH2KvLSzSguzrkVNULI8KIx8MPiwoS - go7rbXThjYION6LIUd+J/t7ioR2XO0FOVR5TYi1NhjHlrlPIEXR4/O/FuDj963SsVrt3794qKGK5aWta - q0HIQc3lO3a4HeS07VPc9Kmiw4Sw+7dvRyoMufDw9XwovBC7ztzngyakFBTOKOgu4q5ru/GFJBWSZ7RS - Wk1kvFkCeVCrVgQteezYvnrddwC9599K5W9CQo5ue5GfLwO6uyg5t7dbZXkx8X6nkV1gT4Z+9LVUHSAv - LysSvfcd07I5PMgtIS8uKySy0AAGdHPSWq2BHEGP6tdvrSHQx1eHhgZqQLeiQMWYkiPk2QsWkAqYce6O - kFPg5dAOWGz11LjwibE1sKPCgyUunCf6jSdm2mS3hRxBL4ZOtmHQuttU7rq1kCPo0PAiEpvHaMEOX3gQ - bHGJh0cGA7pAkGM23DlIP7UNdPultapz2W2Zaqpu+xQ1dozocCHsfu3aql141pTJ8aLvmaNHU1qCLZsN - RNld1F1nAGdNVVpI4qZMqilMUTePYCrQ0LQAx/RWNhmG2SfXCbzhmpy665pjy5b4PGcx7qYL+ovwxRWK - HTsqhYIc1Vy+Z7fbQ46gY5MKr/r17AJ70rLFGtCDunUV9T0wLZv9vd0ecgQ9DUZssd1heIc8CEAP/Oij - +4UeHg11QW+CoEM23C1L68nNcdcR8qz584nK/7QNoDu/knObOOYd97RLnznPJ54gyoRokrFnp6iQo0cR - OW6MBDlAjqDLwgL1lpra4q4j4CzkCDpJHjWqny7o3a5XVGwXEnIEvTw9xUrQXQty2uPtzNAhosPGuPCt - Woq+Z+7VoD4pKcrXD7qbuOsIOLWiIhmT986nu86FHEGP6ddvoS7o315ISDhuSWeYWkqOwTaugYpTJUfI - sxYuINUwasny9blrQo6lpKUFueT4Ky/bBXZRq+qgZXPOSU8Jcg7oCHz099/xtibXhRxBhwIXT13QZ0BG - 3Bku6MbaP1kMOYAu27JFglxPT7fM339zedDPjBgmQa4DOYKesnIZL4E3fZAHtmiBGXjJmgw5tqPM0pJD - h9LN6fFmDeSo6AqPQxaC7rpKrtvbLaR3L5eF/USd10gxeC61ouxu6K5zXXd8nOVxUBt0K6LrhiBH0EPa - tKnUdJyBB89jx9fCXbuK9E1Q4TZytBbyrHnziCok0ALQnQByHscWF+dmkqPPPeeSsGcd2i9BrkfNEXR5 - zJka0HmGPKB5cxLQosXd6/n5rzLuO0D+FoIu37jxT77ddWZtDpCjlaUlmwm6e0FO1T1t6yaXAz0MOuJK - Sl4TgNNV9CKVnEmasWaf3JiSM5Czlj1vnrq1FEDeCkGHGvG7DOhsr3W+lJwBfe5cUlVaZAbo7gk57fEW - 2KWzy8B+/KWXiCoPWzZzEmMkd10TdafQRwwaqAbdgmQYcyFH2BNGjvyGgt79xrlzm4SEnGk0cQGbNRoz - 94YcG0Rgrzexu7sIFX1P371DgtyAy85V9vhZMwSDPKBZMxLXv/9sCvrAyzk5+4VSclRz2Y7tEuSGpqjo - NHHE4hOh4BPreYN79ZAgNwNyJvIOgzfMTWu1RMkRcrSoXr12UNBHn4+MPKkFOrRjtiXwRt11hBwNG0Ea - VnNJybkdWyug1bFf61ZOCzsGFZWZ2LKZddkld72Wu65JmilVkKzDBzSgM3nrBnLXrYE84MMPcWyzD9ay - 4Bp9UrmPTxjfa3IKOR6VMERRP+gS5PraMhfGRBDsviKWAvP5Oimb10uQm6HmRQA5Wl6IPwO6EJAj6KEd - OiQxXWHhfz9D1VoiAzrPSo6QZ86ZQ4phUENt0CXIDfVex7rx+Dk/Ox3oARBMlJTccJSdq+QU9ALouisU - 5Ag63EQKgfHHEfRFyv37s0wWp7D15Fpprbh9xtlC46o4hRxBL02I1QFdgtwY5Ah6ebmK+DR+32lg94Su - s4XJbMtmyV036q5TyJmjIo93dx0B11iLFheB8acQ9CWKnTsVmuaNnCaORnPXzYQ8c/ZsUp6ZxgFdgtwU - 5LQTjDw0kGA3Fj5da6GeK2nVMrWaS5CbDznU5ReBBUMtulZNuU4VGuatMwbZbmjcfXLmMRt40wIcYPf/ - 4APi/+GHt4Dx5xD0xfJNmyq0QDdVoGIB5Ah6ZYGMBV2C3FzIKewxP010eND92rYBwFUS5EbW5loqjkrO - Qo7HMBgsyW0aYW3gjQs6Azla06ZE9ccf9RjXHRpC/sltx8yXkiPkaOpkGQlySyFH2MtKCsmpNxs6LOxH - HnuMFMRFSpBbCTmCHjFwoBp0PpWchRxBT500qTUDOtShX6c91/mGHEE/By2Y7DXV1Oz2TzzmrmsVrdg4 - 1RRhl/mctEuTCnPc/IQFcyXIbYAcQY+CclWhIEfQE4cO7aYGfdmyf7UAtyHwRlWcHjN++UWC3ADspoYq - aL4PPd4ivhvhcKru2+xDUloKLZthXV5ay1TwNQsMgo+lYNrTU/DfRVaZJdNTav9sTX837POmm6Nu7r+N - uetc1z0Gpqzy7a4j4NSgAUUfBnRQ83tCKDlCngUNKOwxn9wVlJwBnW3kWKKQkZNQ8mmOyorxMziMQn4m - RILcgJqbCzkCHzNhrDrYxjVrAm8cd10DepMmJOrrr/sh6AuFghxBz1wwXxt06AJbbdQq4fs1VgWP9RrT - kdWY1XRrpdNSah0d2F3nQk5hzz580GFAj50xVYKcB8gR9NipkwSD3B9AP/P558P/D6anLtGArtv+ycLo - OtddR8gzfv6ZZEESjkbRJchNzkDjuuvc1sz0MZZ+iqHYxl7D+913oGVzoeSu6wHdEiWn7rsW6DwqOULu - 17gxiezVa+T/3bpyZSUdrmBNMoy+NTmFHEHPhl7uDOgS5DZDjrCXyLLIsRdfsBvs2LJZFnhagpwnyBF2 - nEFn9T65AXedQo6gn+nWbYIadAGUHCHXgC5BzgvkCHo5WPqu7XYDPXLcDxLkPEKuAZ1HJUe4uRbeufOP - /3fr6tXlQih5DehLpTW5GWOL9a3JdV13hJxa4Kdd7AJ7ECR3aEfYLYisYxTejaPr3Eg793HcjGmWZ7wZ - UHJdyP3ef59EfPbZKAzGLWDy1bnGtn8ylLtuyl2nkGfMmkUy588zAroUeDO1JqewcyFX5WWS4//7n11A - Z2aub9nIwi5Bbs2aXBv4AhIL45ksSmu1AHIEPbR79+EI+nyhIEfQM+CmoX99LkFuDeQIfBAM6LNnQA5r - zgszkqR9crbUVAM7J63VkHrrQl5UUkBifpygDbqx3HULIUfQo3v2HMSADvvot8ypQrNEyRHy9JkzmXV6 - bdAlyK2FPGXNSrtCTm8wQd27mQ+65K5r5barYS9gTAkWPWZUDeg8Q8647r16fcWADiWq/9JurXy46xRy - BB1NG3QJcmshV0SfITg7zZ5qzn3tlC0bTMMuQW4UcgQ9avT3atAtgRy2zriRdc3aHMBGuDX23nskqnfv - HgzouUuXXtVt/8StJ7dGySnkeKyC9khq2CXIrYW8DFJNfT5o6jCQI/CMC5+WYBh2CXKTkCPoEYMHCga5 - H4Ae/8037RD0eXmrV1cJoeQM7DNmkMrCfJ4gt2U2eQUzm1yf6U5OMfhvHgpULI2u0yBc9E8THApyquyB - 3bvqB12C3CzIEfSwnj3UoHMbRtB6ct01uQVKjpCffvddkjx9eiMG9PwNG4q4oGNXGMbYMlN9GW+ayDru - l2PQjV2Tc5UcIUcry07nIa3VfSHPOeFJPB580CFBR+CTN63Xhl2C3GzIEfTgjh0EgxxBv5qQ8DyCPkex - fXsOBZ1vyNOnTyclSfEa0K3LXXdfyIvzs8mJ1151WMgZF/7ZZ2tceAlyiyBXwihpXTXnNo3gFqeYuyan - So6Qw9r9CjD+JII+pWjv3kQ+1+RUyRFytOLIcAZ0CfJSTTWasWSYmj3zEhL8ZU+Hhlzjwnf7VEqG0bu9 - VhNdR/XWNUVWipaa8wk5gg7PVwqMP4agj4MusGeEUHIKutLfV4KcLTfVV6jCTYbhQp66aZ1TQE5hx2EE - 7lhPbnjP3DjkyuICIosK1YDON+QM6M2aZQHjDyPo38Js9FN8rskp4PQoP/yHFaWm7uuul58tIYUJUeQo - dFZ1lK00c94HuvCK1AQO7JY3jbCtYYSSYKMIrpnbJKLWAESekmH0qTjzNYAcLevYYQZ0ISA//c472GE2 - GBh/AEH/6kJs7H6+Am+6kKdNm0byYCRTLbfdzFryqnMQLTdkTlZPbq67XlZWRE43b+ZUkNMbQUCXTizo - EuSmIEfQU7dtFgxyBD2kXbt9dCRTp6ty+UYu6EyZKVtPbkl0XR/kCHrW8mXaoEuQa4pTtN32Evh6CYmd - NtkpIaewJ29YY3H7J3dTcqroWKJKu7XaGnhDV50xAJyxRo0got9xCQW92Z3r1xfYuoVmCPK0qVNJGgTk - qs6WqWGXIDcKeZ73CYI13+a4yo76M0efeYYoYJiDuf3e3BVyhD1y2Dea3m4M6Fbsk2sA14EcQT/z6aff - UdAbgPs+O2fhwr/5VnIGctbKcjIkyDllpvqUvKQgl5x4va5TQ67twpt2390ZcmWxnAR1aF8DOs+QI+ix - AwZ0pqD/F0HPW7WqjE93nQs5PlaFhxoB3b0Db+iuo4V+3dclIKewJ61bZVTV3R1yOVQACuGuI+DUsrdu - rUtB/w8OWizYujVLaz1uRsabUXedo+ZpU6aQAk8PA6BLkCPkads3uxTkCLvn008bdOHdHXJU86xTx9Sg - C6DkDOjvvHOZSZah/8E/xhbt3x/JR+BNV8kRcrTczRv1gC5BjpArYT2L61pHXXPb8r4COn9CSsqUWsou - QS6HrTU5pA6vEwxy37ffxptILrOHzgG9X4WPzwluZxhjueuWKDlCnjp5MkmHKD5uldUE4yTIEfIyGFBw - unVLl4Rc48KvrXHhJcjVkKNFjx9ndqkpN61VX3Sd664j5GiQWuungRwfAPUdLqWnb2NAN1GgYg3kCDpa - WV4WC7oEOV2Xx/08w6Uh17jwSbGQyIIJLbaYcyXD0C009bEGcPo4uHMnrSaOTE25nnpyayD3festEtiy - 5Rpd0N+5888/8wHy+3wrOYUcBr0RZXAAq+quN1zB3GQYCjge8/y87TIWOXL0d6IvFfw/6UCKoXuq9aC7 - FuT5STGCQo6gh3boMFwX9OdB1WdBS6mLWmWmbD05U6TCFqjQIybCMMYNuuFj1lXXAI5qDpCj5f22Wwt0 - d8t440KOI5a8GtQXXc1Pt2pJSgC4pFXLRX/tpLUrrQTdtSBHRU/fv0cbdB6VHCFHi+nf/wNd0B8A0KfK - N27M1ldPzgfkqT/9RDIXLtCA7s6Ql0PHnfAhg0QHzfOpp4giMVpdO46xAYDelkCbpb+Lry+H17dM1V0P - 8kIAPXbW9BrQBYAc1uzXSFXVE1qgs+v0oaoDB0I0oLNNI/iCHEFHq1DKXTJ3XX8FGvZhV++Rawwgz9i9 - U1TAKJCp2zZpNYjIjwwhHo88Iup7scyFd03IEfRQ6CrD95qcKjkeYcsuFcT7QX2gdzoXGfkbbf/El7tO - AadHZUigftCduEDFEsiVaYlMrzVL1dDWnw/p+5Xelk8xMODP1ue29PcTVy83Q9VdF/L8lFhBIfd5800S - 2KzZnlqQs4r+9q3Ll+cD4PeFgjzlxx9JLlSyOftUU27gzRLIy6D7iv/H7UQH60TdOqRIlqkX9BKVnHi9 - 2VDU9+T55JMmXHjXhRzVPBVGavEZXecqOUKOFtSqlTrHXfc/kPknwGZA6+cqs9x1NhFGK+jGCbzpKjlC - jpYGS4KzVdCkkZaeuomS47o8ft4cUYFCpcUCmZwTR4y2Zc4+eZQcfuABUd+bf8f2BqLwrg05gh4Ffdx1 - WzJbu4WmD3Kfhg1J7NChDfWCzqr6qILt2+O5oOuNrlsJecrEiQStJCVRDbobQZ4f5Ec8Hn5YVJgQ9Cjo - HssE3wwZ2+MtbOgQ0d9bwsplOi6860OuKMwjARAE5fZd5xtySH3F9lEPGQP9c8iQ8zC6hWYj5Ai6HPLe - 3QnyEmU+8XrrTdFB8v3wA1ICfcxMQY7tn5S5GTCO+UVR3yPjwkMnHXUU3gkgZ7vCaCfC6E+GwS00VG9d - y/I5ISjkqOZQ337CIOSsoje+Xlq6FEEXQsmpomcsmG8AdMfvu27JmhzddbQzI74VFSAmGw0musijw82C - nPZ5S925VfT36df+Y3DhFY7f/okHyBH6uF9mqkGHnut8KzlCjhb00UeTTYH+FEj+9JwFC6pqJcPwoOQI - evKECYyVQq93bVV3Tcgz9/8mOjwIetLqFRZBroa9iNhjHHPCyqUa0B2yxxtPkCuKZCQIbmxCQg6g34/u - 3/9to6Czqv5t4a+/RmplvPEMOYIu9zzMAd01IS/KTCHHXnhedNCNDkA00Xe9ABJajjwp7nw3fL38uAji - ypCjmjNuu4BKjmoOBS8yEOv/mAN6h+qIiJ0a0AWAHEFPnzuHBd01IS+vKCYBnT4RHXKcm67MSbdpTFL8 - wnmiv2+/9u2ICuIJlsLOx3xyOtW0VjNHnpScrtNjp08RzF1n3PY33sCOsttNQs4qep17N27MhL30m7SW - 3NItNLoWp0fqrmuO48eTZLDi5HiHn4VmzZoc1+WJSxaKDgtukWV5HLAJcnTfiwE4ewx0jF+2yCLQnQly - hTybBLRsqW7eyDVOI0d9pabc7TN8TPfJ6XpccwTIEfTgjz/uZS7oD4L0T5CtWpVjrEDF0D65uZAnjxun - Tp7RGXzoSAMPrYVcHh5Mjjz6qOigY1Wa3gi7FWOS8oJOk8MPidukEl14Wax5LrwzQV4ISUlpe3cJDrlv - w4ZXC/bte9os0FlV71F26tQhoZQcIWfspx9JRYlSA7srQF6qKiDe7zQSHXJ8zWKY41ULdCsgp91bI8aN - Ef1znG7X1qQL72yQI+jh/b8WVMm9GzQgfk2aHDcbchb0N29duvQzrNNvc+vJmXJTtjiFHmnGmyVKrgEd - YC/wPsmA7gqQo8seCUPtLc39tvXn0XuQhQfxCjnCXgRdaU/We130zxO/1LAL74yQ58LYpdPsCGPdvut8 - uOsIOVpg27aDLQUdG0aOz1u5MpsBna0n5xvypLFjSdqsmaQS2iCbBboI88mtddcR8qxDv4ueSoo3ifjF - C3iHnKp6Jn4meA0xjYnCx5yptV53RshRzaN/mlij5jyvySnksFa/bJHbTu8IAPrn4L4fFBJyBD3phx+I - MizYNOgODrkK8gKOv/SSqEAgfP6fdGRqy7Vcdhvcdd2hC5i1Ftynt+if63Sb1louvLNCnp+WgC51rQkq - fCo5wg5lqZ4WqTkH9DfuXLkyE9z3W0IoOYUcQc9YvMg46A4OOW6lBXbvKjoMx/77HClMTxQUcgRdAf3H - jz73rOifLw52LnC7zVkhRzVPWDxfcMgR9KC2bb+2FnR038fmrV6dygXd1jU5Azir5Ag5NVVCjH7YHR1y - cNmToDhDTNeWvlbGvt2CQ067wSStXyP6Z/R84nEiiw7TBl3vDHIFsWp0Mc/75Ag21wpkGSTgo4+0ZqHx - reQIObjt56r8/Gp3kzGXfAC9c3VIyA6+Am+GIE8aM4ZkrV1dG3QngLwgKpx4Pv646BCEDxsiGuQM7KCs - fhARF/uG5gsuPCa0MKruRJAj8EnrVgsOuXf9+iTggw92mMu0oRr1/927fXtyxowZl4VScoQcLXH0aKKC - BBpNUM4JIC8tKSTejd8X/eL3avgGUSlya0DneU1uqKebLDLULvkBsZCp52yQM2oONyk61VQIJUfI0UK6 - dGljE+jsVttgxY4dQQzobD25qYw37vYZPjam5BRyBD1zxXI16HxADpF83RbM1naGoVVo3GMZuOxRE8aK - DrnHQw+RXH9v0SGn8MfMnCb6Zz6CLnwUuPBmKzqUjoIXoNcEdtep6564apkokMOghnSzcttN3QngSZpc - VSgWAtz3uaAbSmu1FnIEnVH1+GijoFfATcCkiQB59tHDxOPBB0W/6GNh4IMmwi6SknMVXgUu6Sk7JARh - x1olvLZp2O0PeUFOGvHHdFfOsEN8TCeoWJrWSrfQNEdWyb3r1cNpLFNMMWzW9wH0RzAol71wYb5QSk4h - Txw1imQsWWwQdJOA401ABMhVeZnkxCuviA756bZtmJ7s6nbNaqO15DVH06OK9W2hWdKCORuGA9rlJmfS - hbc/5IWqfJIACT9iQO5Tv/61jEmTXjILZHN+CED/FDrP7OHWk+sWqNiq5Ag5Y99/T5RnQmvB7iiQo8se - DK16xQ5K4RBGRWKMEcgtB5wpYLFyRFLY8KGinwN04fMgTqBf1R0Dchnsm/s3+1ALdCGUHNUcsu0OmcOv - 2T8DoL94+8aNybCnfkXLZWer0PiEHEFPhQkxFeXFGtgdCfIUiKSKDTm+nqYnu14lFxdyvDkooavsiVde - Fv1c+Lb8SI8L7xiQo5pHT4IsOI7LLhTkCHpgu3adzIbY3B8E2L8s3LnztJBKjpBTyz/uyYDuSJAXxEUR - T5GbMiDkmp7sDgI57fGWumeH6KDj+aiJwsO2m6GgG35dpMAbAo6WHXxanRzDgi4k5PDciXoHNJgLtKGf - gyd9/cbZs7Mg+n4ba8kZo1Vo7NHc6Dp3TU7ddS7kCd99R5LgOcsK802DLsKaHN310lIlwWaLYqv5ibp1 - iSo/y8CaXHwl123kGPhZN9HPyZHHHgMXPsShIC+ENlFh/fqJAjkThGvadKitTBv8fYB9kGzt2iihIUfQ - E0aOJDnbtxoHXSTIEfSYyT+JfkEzPdkh8KU/8GZ/yLFzqxzGIeNMNbFvgOjCo4racwuNKjke02BoohhK - jpBDJlxR2u7dDwsJeqOreXkLQMnvc9WcTyWnkCPo+LgIUmP1uu8iQp7jBVFmgE7sizl60o8ODTlt+4Rl - pWKfG3y9mHm/1AZdZHcdIZdnp0CJaBsGdCHd9VOvv07QIAg3VTDI2eQZ7D4zFMYrZ1LQBYMcQQdLmTEd - AnMqbdhFhFyVn01wpJHYFzLTk70YerLX2kJzDCXn9nYrArh8mzcT/RyhC58LLrxG1e0AOYIeAzdksSAH - Rb+YNGzYM4KCzsL+7l8pKUtR1YWGPGHECIKWd2BfDegiQo4ue0jfPqJfwBjwk0MOvTNAToHPDfYnmLUn - +g3xo+YE18diB96o257pfZzJgBNDyU9BvMbvnXfmCw45R9W/gRltqfqq0Li565qgG2a9cfbJdQNvWu46 - q+QIePzw4Yzh9zEPXoxkGISbWuqWjaJfuAhK8tpVTgU5hT3qx/F2OV+MC69XzeXw9dqmb4KK1td0qtBq - KtLU0XVq8tx0EgSdfsWCHBJkqkVRc06t+tt/pacvghLT+9xSUyEgp7AnT51CyqGIxBDstnSGwRx2LuD4 - uDARgkxPix9kCvriM6eEHGFXQqHNyQb1RYedceGhlZY27MJCjrBHjR8rGuSsms8SRc05oD8Aa/WBOUuW - JGpA51Sh8aXkFPL4b78laFmbN+oFnW/IS8uKyGmI6orthmJP9kLoVKOd1up4a3JjvdczPA7apZ2WT4tm - pFBJXXjhIccou1hKjpBDlVpF2tix1tecW3uHANAbXsnNnQtr9TtCKjmFPG7YMIJWEHhaC3a+IUc1j50h - foUW9mTPPHzAqSGnN4CQAV+LfpNkovBz0YUXHvK82DOQ5tpMDTr0Wjc0ulir9zrbd91YgQpunaHR6DoC - Ts3v3Xd/spZVm38PYP8qf+3aEG6pqTnJMKbW5LpKTiHHYwJkz6nSkxnYhYA87/QpCCqJv5UW+cNol4Ac - YVfAKKqjz4s/igq74eaGBdSCna81ObrrBfmZJPiz7qJC7tOgQY6g++am7gSYA3/zwoWfIIHmb6vddTay - roGbDcDpKrkG9qFDSfLkSaSsqMAA6DDB9CzH2ImmujXlumty/HdxQR60N64nuhqdeu9d6Mku54DuXO66 - riuP3WCSNq0T/Tyiqqtd+DwN7HxCjqBHjh0tKuSg6Pf9P/zwc1MsCv59gP2Ton37Dlql5FZAHgegx33z - DclYvpQZSayt6tZDjqCHDRog+sXJ9GQPC3IpyGkzR7+OHUQ/n4wLD6OJDc0ntya6TqPsidA3T0x3nVmb - v/HGaWDsAcFBNvUC8CYev3v79nepU6eWW7SFZgPkCDpa7sH9HNBtgzzNDrPBaU92W2rJbSk1rSlRLRRk - PrkM5rPbo58e3jxzwIU3quZmbqFRyDO8jjJDGHhZk7NrcWNrcnZtftOvTRvTI5BNQcrX9wH2D6tCQ1cC - 6Pe5e+T4mFmPs7nrTForGg+QI+ixYAWnvbVddXTbLXDXma20lHhy9Fnx2xkHdOlESiDCT2eT6zaEMOff - 1taTCw05rRmPmT3LLqruDZmFCnDh9cJuIeS5GHxr3lxcyOvUIX6NGq3ki1FengfL5cD65SxbdsZkMgxf - kA8ZQmLB0JVXQBaZZl1uIeRllcUk1+8USV6zwrithu+DJfFohRnJLg05AzvMg0tYvZwkrFxq1OLh+3pt - BXxdry2Brxu3vISo2qBbCLkc+uYzSTF8RNfNVXKAHJJj5AnTpj3OC6B8PgmA/tLNixfHJ40ff0lwJWch - jx08mKDFfTeSqLLTLFZyhNwsgwENZWCltQzaOWFbJ3OMx9ZPjuyum+7pxm3b7Fj15NysNxphD/uyl+iQ - n6pT525gixaf8sknr88FsLcpO3lys6Duug7kFPbEiRNIiTy3Fuz6ouvqr0mQY5kpmrEEGGPfs22CimND - rijMIxHDh9kDcpyBvschAnBGmlM8DG9wQNbcuUma9Tifa3IDkMcOGkTQkmAgZIkiTwO7BDkMXqjVE06Y - wJsrKbkCimSiJo63DXJOp1YadDOUDMME3sBdZ+z11ysSBg58nlcFFuLJAPQ6/5SW/pT4ww9XeQ28mYA8 - ZuBAgpY8fRophT1pCXIJciYQZ+GaXIFlp9On2AVyr9deuw9Bv6+E4FKQ5wTY25UeObKVt+i6mZBrYP95 - FimFQFBt2CV3XXLXEX7tKjT6b4Q8DtJobQq8WankADk5/dZb+x3aZde9W8CbfQisb9b8+TGWZLzRZBi6 - T85soVkIecyAAQQtZe5sHdglyCXIjUOOc+btBTm47KrIvn2fE0R5hXxSAP2Ffy9cGA016+eN5a4zqa2Y - 7cZmvPEBOYU9GZS9hHHjJcglyI1ADmtyeyr5qddeu3O6eXP+WzcLCTj3uXGcU3Vw8JL4ESPuGstdFwLy - mP79CVrStKmkBCKoJmGXttAMRt9dOroOkMdMs9uanKDLDmm1S8ViUpDXwfUG2GcwY90LQedWoQmp5BTy - 6K+/JmiJP04kqtwMw7BLkLsn5AXZJAqqBu3lriPkp+rXT5AtXvyIIACK+aRMLvytWwOhH7xCC3SB3HVd - yCnsmFSjhJFGtZRdgtwtIZdnJUMf9r52hdy7bt1Lvi1avCUmj4K+FmbNXSkomAC15JfFVHIKeTQ01keL - gSw6eZBfDewS5G4JeV5sBAnq0tmukIOa3w18772+goJnjycH2N+p9PNbGj9s2B0h1+QauFm3nUIe3bcv - YQyAz97zK6S0qqS0VmgSoS/zzZXX5BlHD6m7w9iSu27DFhq662iQ/bbCHhyK8poA+8f5Gzf+wY2s27KF - RqPrhtz1WpCzsEf16UNS5s0lxYUynfx1M/PWeR5bLOWuC9/+CSvZEpYsVLdmtgByc1o/mZPxRgHHI/x8 - MFm8+EFRoLPHi7D7619kzJoVQ2G3dp/cFsgR9KivviLxo0cRZVIcC7sEuasquTwnlZwZ9o3FTSOEgBzS - XVXhrVu/YA/+RH1NgP2Ju//80x+q3JT2hBxBR4uG5JrcI4fMq0CTlNzgbHJHmmrKzXzLghLkgA7tHQXy - P30aN35fVODs+WIA+3N/FxZ+D+Ws1bT6THNkC1RoOqvmyGa88aHkFHI8RvbuzRhm0hXD+CWjJafuUGqK - NeQWmYNWoUHuBJPpBmOMLW3/JIiS16lzE0YqO29SjLU3DID95QuJiZNgf/2qvSGP/PJLghY79BsiDwnQ - D7sEuZ4bgGNCnhcXQUK/+tKqvutCQI7FKqffeGO0taw4/e8B7G9W+vvPg/X6TVpqKraSU8iZY69eDPDp - a1axgTp23S5B7hSQY8AtGcZo+Tf70DLILei5bmngjQm+NWiw2OlhtfUDAOzvqw4eXA2qfsfukAPoET17 - MhYzbCiR+fsYGFusghZQzt+SWRN8s8hVR9fe8ZQ8NzKUSYCxeKqp0JDXr7/NqSrSbAXa2O/DifhAuXv3 - RlD1e2KtyWspOQdyCntEjx4kecF8opJlusxwBdw314quOznkCkUOSVi2iJxu3NjxIK9X73eX3kaz5qYA - sDdXbN26PXbgwPuagBsNwLEFKiaTYTj75HQLTV/gzVzIEfSIL74gUZhk88d+UgKQSEpeUDOPHJRdM5sc - H4s8nzzjmAcJ7taVAdzRlNynXr2jEuQG7gQAe0v5unV7APQa2O0MOYJOLRbaVssC/SyG3SFbMjuxkmOw - 7czQwRrAHQ1yWMf7wUDEh60RPLf4HbbarbV8w4ZdoOz3rMl441PJuZCf+fxzwthnn5GE6VNJQUyEWcBL - kPM3n1wG/fdjZ04np99/32Ehh2q0E7KBA52/Gk3oOw4Le4vCbds2g7Lf5cVdZ7fPNC47RtcNrMmpu24I - cgSdMYA+6eeZRBEfbRB4CXJ+IMfe6nGzfyZ+HzTVAtzRlPxUgwYHJSW38A6BAbrC3bvXgKrf0a1C0xSo - mLMmFwJyBL17d8bCwRKhIWU+7L9z1+8S5LZDji56zIypxP+DD5gcdboWd8g1ecOGv5Ljx/9j4WUu/Tie - Adx6Kz54cCko+01jBSoG3XWhIe/WjYRzLHb09yT32BFSDEEp20C3vSWzbXnr9t1Cy/b3JpGjviN+6KIj - 4A4Oue+bb66RttBsvGfBCXy77NSpX2DN/rdDKbkO5OFduxLGPv2URA7oT9K3bSaFMCfccuDdE/ICWQZJ - gUGX4X2+IpAqqjbHh/yuz9tvz5QgtxFy+utwIutWh4VNiBsy5ByFnVFxtgqt1haayErOhRxBpxbW9VMS - P2UyyfU+TlRmqbz7QZ4d5Etip05masQ1gDsB5DBs4abvO+98y9MlLj0NB/YXrubkDIVe8YX6IKfFKVp7 - 5DSt1dbAG3dNbkTJtSDv0oWEoXXuzFgkKFXKymUkH2ahF8N+vBATVJzFXce1d+KqZSSkxxfED0YRawFu - LeQNGxIfrgmY8Qalpn9Bgo7jzkZz9tsGKPtT16ureyX98EOiyUQYB4Kcwh7aqRNBi4AEnJRVK4gsIoSF - 3vWVPD8xmiStW0XCen/JrL0RcGeE3Ov114sDmzd3n1JTe900APZHyL//dkydOtWXW2bqqEquCzmFPfST - TwhaBEzrTJw3m2QfO0yUkGprzcBDh1TywlySBUuWhAVzSWjPHmq4qTkp5N6vv54U3qbNy/a69t3uddm9 - 9sa5q1Ztie7T55azQh7asSPhWgiAHz1yBEmGeeA5Jz2JAkZBmwLfUSBX5GeRLJ8TJBHmnEeOGEYCPvqI - +EH+uRbgTqzksEe+P6FdO8ebV+4O9APwdcqOHp0Ee+3neU2G4WFNbkrJa0HeoQMJQWvfXsvOQFOMWJjs - mbxqOcnyOEjkMWdIEcwIq1WcUmppwwgrt9BgaCG64RlHD5Ok1StI9IRxJLTH58xeNwM217gq7qSQY9DN - 5623JroDTw79GQH2py/n5PSBaTCZTD25AwTe+II85OOPCVpwu3Y11rYtCYavhcNaNwb27RMgYyxlw1qS - CUU3uQE+JD86nBRkJBEl1GYb7xSjp9QUIC7ITCYyuJnkwHNlwI0lZdN6Ej97Fon8fiQJ69WTBLT8iPg3 - bVpjTZoQfzAxIIfOqdg9VTvohgE4gQJvEHQr93v33XYODYA7vTmm6eT16x9lzJzpEdGr111NmSnWlmMF - GluFZjKt1YGU3CDkCHqbNloW1Lo1YaxVKy0LRg8Bo/6wRkY707cPOTNwAFh/cubrfiQUCnbQ8GfwZwNg - i4uxDz/UMlRrxriA42MXhhzW44G+TZpI63FHvJEA8K+pfv99KqTMVjOwuzHkQS1bErRAWCtrWYsWJBAs - oHlzbZMgZ/qtg6t+AzrCTJGSYByRcM57whFQV/LzuyWOHh3urkouQV4fe6drGYwlJozVrattdeog3Azk - XnXrZvu8+25TB7/EpbfHSa7B4Y5vyVauXBHVu/dl6rJzS001VWgu5q5LkFsOOY4t9mnQYGNk586PSRQ5 - 4RnAQN355OTPE0eNCpcgl9x1LTVnlRy+lgnVcK2c8PKW3jL3DLB77vULtm79BdS9WlJydm3u7mvyunWv - Q7R+rlQ/7mL3C1y7/11Q0B7GN3uCut/R1JNbmbvO5xaa1vYZbqVhZN2C6LrkrlvmroObHhDw7ruNXOwS - lz6OjsL/r9zLazBMdI3j1pIzjzmlpsYKVCTIhcl4E3qf3Lt+fRm0oeohRdTd5J4Af+gHwdCdnwr58ioJ - chffJ69X7y+sG1dOmvSom1zi0sfUUfdHb1261DRzzpx1sBV3nqvi+JgpM+WUmkpKzpOSWzC2GLPerB6T - 9Prr/55+++1NgR07viRd+dIZwJZVT14vKvoofcqUXRCsuyJBLmBaqwiQQynpbRiseCCoc+cG0uUtnYFa - ZwDr3a9mZ7dNnjhx35lu3f6mCs6LkuvLW3e3wJvwkN+B/m1HQtq1e1e6vKUzYPIMAPDPnE9MbA8NLg6G - de16HUHX1JGzzSNoPblZVWgS5MRXQMghL/2ub8OGJ4LatPnA5B9X+gHpDOieAXTpL8bFtUwZP34HtHU+ - r9s0QoKcbeJoqv2TQJBDmuv102+99Zt/ixbvSVevdAZsPgPY1eZmRcXbaTNnLoV0WiWj5rpNI/TVk7ux - ksMaWT26WAjI33jjAkTRl0PK6is2/3GlJ5DOgB6F/w9A/2r2woWjowcMCAWFv4nAMw0jdJtGSJDzDfl9 - 2GeP92vUaExa795PSFendAZEOQPo1pf6+bVIGjt2Pbj1Kq3OMBLk/EHeoMF5UO+twa1aNRblDyu9iHQG - 9J0BNvnmf9mLFw+AbDuP0M6dq2p1hXGT6Dpv7vobb/wNyn0cutYMiPzuO6miTELPsc4A0+nm2rVXMubO - HRIzaJBnWKdO55g8djfIXbcVckiMuebbqJFXYJMmg7OHD3/Ssf6y0ruRzoCBMwDQPwz2ct6SJb3jhg/f - GtG9eyoAf5u2gTLU/skZC1SshRzALvBv3HiHf8uWX2XPnCnBLdHk3GeALZV9pios7D3Yqpsc06/fcYjc - q6DH232tPm9O2P7JEsjhZ8/5NWniHdis2dTwnj0b4bLHuf+y0ruXzoCRM8AMoSDkeeXevc3jv/8ewT8E - EfwcgP6OM/V4MwY5ZKjdhw6qSmgg6Qk96n6K7tGjOX5u6cKQzoDbngE2oPf0uejoNxLHjBkMQynWQc28 - H0Ty5QD+LUds5KgD+T0Yr1Qa0LRpIHSLXR/YqtWw6O+/fx0+lzQv3G2vaumDm3UGWPifuJab+3LSxIld - Yvr2nQTJOhuhZv5E2CefJABMZeAC36atmUVoyXwPpq5Uw+ukgXnBa2+CGWSTgtu375I8Z84LEtRm/Vml - H5LOgPlngInuY7fbsrL/Zv3yS+OY4cM7wY2gP5Tajo3o2nVOaJcuG2Cbby8Mejga2qHDKQgCBgW1axcM - x1gIBiZAIDABlgl4DAYLggCgD+SJewa3br0P/r0xqG3b+bBFOCGsY8f+UM33SeLgwe+pdu9+Fl/X/Hcp - /aQjnYH/B+119hvKHdsiAAAAAElFTkSuQmCC - - - - - iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAYAAACI7Fo9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAGYktHRAD/AP8A/6C9p5MAAEyTSURBVHhe7Z0HeBRV18c/fe39tbwWEBAVC6CAVAEBARUQAamC - gALSlA5K7713AQFBCKGFJKQX0ntvm81ms+kkFKUoIP1+58zO3cxutu/MbBuf5zhLypbJ/OZ/7rmn/N// - Sf853RkghDwN9jpYU7CPwbqCfQk2GOz7ezdvTvq3qmreNZVq9dX8/I2XsrK2XcnL2/1ncvIBLcvI2PlX - RsaWvzIzN/2jUCz+W6Wac/vKlR/gOQayz4fP2w7sA7AGYM+BPeh0J0x6w9IZcNQzAEA9ClYPrBVYb7AR - 927cmP5PcfHWP1NSPKqCg/1Ljx2LK9q3L6dw505lwebNlbK1ay/lLl9+M2fxYpK9aJG2LVxIsrm2YAHJ - BsuaP1/b5s3Dr9/OWbr0imzVqqr8DRuKFDt2ZMPrxJedPOl3PiLiwF9pacv+vXBhFLynnmCt2ZvAU456 - LqX3JZ0BhzgDAMpjYI1YZR5279atn/8pKtp9LirKu+zEifjC3buV8nXrruQsW0ZywQBCtS1Zom0AuK2Q - ZwHoWXPnalnmnDmEsdmztQxuEtdla9YUF+7alVB+6pTXxfj4DXADGAmf41Ow98CecYgTLL0J6QzY4wwA - AP8Faw7WD2zKzT//3Hw+Ls6r7NixZMX27WdBSe+CMhPGWLjp0VEgz/jlF8LYzz9r26xZ97MXL75QsHVr - Srm39zFYFiwid++iR4Kf92WwB+xxzqXXlM6A4GcALu6Hwd4B+wpsJqyfd56LjPRX/fFHbv6mTZdzV6wg - Wua8kJOMWbNI+syZWgaewLX8tWvzSjw8fP5MSloF4KPL/y7Y44KffOkFpDMg5BmAi/hZsPZgo+/cuLHm - z9TUE6DYafItWy7lrVpF8lauZMzVIU+fMYMwNn26xsALuC5bty6z/ORJjysFBRPgHGHA7yUh/x7Sc0tn - gLczABcrRsMxCj7+xvnzO6pDQ8NVe/cWQ5DsDgM3NTeGPG3aNMLY1KnU7mctWFAJcYiQC9HR81noX+Dt - jyI9kXQG+DgDcGFidLwN2LibFy5sQ7iVe/ZUANz3ZatXEzQJcrWa64FcDfuUKYylTp6Mwb4LENwLuRAT - MwfOKUb0n+bj7yQ9h3QGrDoDcAHi1tcA2LNeDRdlQNFvv5UxcK9ZQxiTINdy182BHEHX2KRJCP05uGn6 - Xs7OHgnn+k0waQ/fqqtV+iWLzgBcaLgNhuvu6deKiw/AGjNdvnHjTQ3cEuTq9bjOmtwayFMB9NSfflLb - pEl385Yvzyr38toE8Q48/89a9IeTflg6A+acAbiwMCPsy3t37qy4mJDgV7RnTxWoN2GMwi1BLgzkLOwp - P/5I0DKmT/9LuXu39z8FBZi994o5fz/pZ6QzYPQMwIVUF+zbO9eubaoKCYmCveG/89etUwNuAHKt9bib - R9dtVnIdyFMmTiTUQOVv5a9fH3kxMXE8/I0agkn78xLPlp0BuGjewMg5JLL8CkkfKeCe30LAJchn6d0n - F8RdNwI5wp48YQJj8PgeZAymnwsPx+Ad5ipI63jLLnf3+2k2wDYOCjt2VPj6IuC3KeAS5EYg5+yRmxtd - 1w28aa3JzYScwp48fjxJGT8eM/IyqqOiZsHf8S1J4d2PX5OfGC6KOmCjb1+9uqPSzy8RstW0AJcgd2zI - EfTkceOo3Yd04eQLsbGT0aU3+ceXfsD1zwBcCJhz/i1skW2GNXiMfPPmm7DuY1x0ScnZHHZIadWX1qob - WbeXkutAzsCeNHYsHu9BrUAslOFild3/XP9qlj5hrTMAf3jMPe9279691edjYkKgkOQfBnBzIde3R+5u - gTcHcNcNQY6gJ/3wg9rGjbudv3FjwPXSUsyvl0pp3eF+gOs2sBZg86/K5Z6QjHEe6q3VgEuQ61ahOaWS - a0FOYR8zBoN2V5R79+67ff36R/D3/487XO9u+Rnhj/si2MR/z5/fU+rpKWcAlyA3VGpaG3I9iTCO5q4b - gjwJQE8cPZoxSLktq/DxWYhbp24Jgqt+aNxuAfsUkl3WMevwTZvuSJDPVgOuv57cZSGnsCeOGnU/Z9Gi - eGixhe23HnPVa99tPheb8DLjH5XqsMZNl5Tc3SEnADpJ/P57DNhdhSy77XCdvOk2ULjSB8U1GFhPjKbD - dhnuh9/TqLjkrruzkmsgR9CpQX181rno6KFwzUiNMJzlRgB/rJfApv2jVHood+26pAW4BLkEOQdwBD3h - u+8YA5W/UbB9+05p7e4EpMMfqS1sma2tCg2NhbW4topLkEuQG4A8YeRIQi1r9uzEPzMyusG19JATXPLu - 9Rbhj/Ik2PfQgXSv6sCBcnDV1RF1rklbaPoaObpD4E2vu06VnAt5wogRBA2i9H8WHzo0FxOq3IskB/60 - bPrq/EuZmT6Kbdv+dUfIIceb5G2EG9ue3aTg4AFSePwoKTrtQ4rDQkhxRDgpjY0mJbFRpDQpgZSlJrGW - SEpiosAiSXFkOFGFBhOlnw9RHPMk8gP7iWznDpILGYKZ0PtdyCo0boEKN3fdrGQYzj45dwuNE123GPL4 - 4cMJWsLw4ffzVqw4SW7elAJ19uYfIG8Frvr6s0FBieCq37cYcnNqyR0k4w0HMsi2bCaKw4eIKsiflCbE - koq8bFJVXkzOXagyYGfh62dJta6dh68ZtEr4Xo1VweOqylJSLssmJQkxRAmvLf/jAMlZv46kQ6tnreIU - 7BCDDSO4TSOsKFCxN+QU9vhvv8UuORngyuPEGqkqTmzg2aj6gNv//LOz5PDhYgTcpSAHhc7fsZ0oT50k - pfExpLJARs4BmIaB1gc6T5Aj6Lp2Dr7GWoVCRorjoonC6wTJ3byRpEGrZ01nGCeHHEGPGzYMXflzladO - Yd37E2Jf6277enCysdPqlGtlZX/AHuhll4Ac1BrBLgLXuSI7nVRXV1gItS7o4kBOYecez1aXk7LcTFLo - 50tyNm8iqdD8kekOw2ka4ajuOlfJKeQIOlr8iBE3YTTVetzVcVv4xPrgcJJfwTz1y3l5Jwu2bbvpzJDj - xBUFuMBloIbV4H6fv1jNmGWqbT8l1wd51bkKUPoaOwuPK8HtLwavJP/3feDqz2KA16zF2eYRjKuuXWqq - qUIzJ62VjzW5McgZ2IcORbufs3z5EbgG64l1zbvd68DJxWYCKy7Ex4cUbNly1xkhx9lpCgiWlcXHknNV - 5Rq4XRVyBF3L4DMXJ8YR2b49JHXmDDXwzgM5ifvmG8YyZs8+Qy5daup2EAr9gTHoBra+MjAwCYJuzHrc - 3DW5RU0cBQq8yXf9Skohwl19tqwW3G4DOUIPSxKNAfQq8GZytm0hyajyNY0jmHpy3pScs0fObKWxW2ga - BWej7Oiq67rrHCXXQE5hT/7xx+zLcnknuC6lXnV83ADgRH4GBSmbYaqozJkgz4WbRpG3FzmryDcIt9tC - zgUe1vTlRQWkwOs4SZ831ykgjx0yhKAljR5dcj4hoS8Gh/m41t32OeAE9oZ89W1MZN1JlDx/+zZYd8eQ - cxCVpiAbOwqyJje6fYZba3q20ExE181dk9dy13WVXAdyDN5pDFU+MZZkb1hHkrnNI6DM1OJ9coGUnEIe - O3gwQQMv4Tx4miPgWn3YbUG19oOjOwQ24O716zsg063SGSAvgCSTisw0s+AWVMmdFXIW+Eo4opVC5D53 - 96/MOt5RIaewg8t/ucLLawxcs49Ye8273e9hYgLYN9Co8VfV/v3VDg05RM6VRz3J2ULT7rmuqktKzlFy - Hcgp7HhEt152+A8Ca2JN8wimzJQtNeVWoTFprSIpOYU8dtAgggYR+b+LPTx+gmtXqm83dddiIR9x+9Kl - 3UV7915wVMhzAfDCI4dJlVJukYJLSo7BuNqA49e4cOt7XF6sILJDB0gSROl1Idebt85j4E3XXdeFPGbg - QIIWN2TI9eIDB2bAdSyVuxqCnXXXh/178eJv0CTiL0eFvGD/PgiwyawCXLB9chdx103BXllVRspA4XN3 - 7VSrO6fM1F5KTiGnR1D3m8qdO3+B6/lRU8Lmdt9nIR8IgxN2OSrk+ZBnXp6SaDXgEuTWKbkGfoAcQadW - kp1GMlcuV9eT28ld14U8ZsAAgsbAvmfPdClAp3MrgxPS5y7krSt/++2ioyl57soVpAQqu86DapoTRTf0 - M9Ka3Lw1uV5V14GcC3xhWBBJnjypBnae9snNddc1sLOQc2C/DjGmCXBtS3XtyDuciC+wOMURA28Fe38j - VeAq2gK4pOT8KjkX8gq4AaCVFxeSnF93qGEH0G1NhrEV8pj+/Qljgwb9A1vDI91+nx1OQHvcJy8yZwvN - gukpMhiwYMtU0zwoXy2LjrQZcAly4SGnsOOxCMpoU2ZM0wbdwow3viCP/vprggaBu6uQ7IUjnt0zgw4+ - eBOwDaXHjhWYdNdFhFxx4HdSXaaSINdToGJTMoyRLTRL3XUu3LqPy8tVJHfvHrWy2xlyCjtsvVVdCA7u - 6I7Bt1cB8jWVAQEpjgJ53sqVpCQijBfAJSUXV8n1ga+MiSBJsPdOy0w1R3UVWq3cdb6VnEIe3a8fQUsc - MUJRnZT0vtvADoA/B7bofHT0GUeBXA614FVm5KSbu1bnI/BmWVcYB05rFUnJtWA/W0oqwMqK8knmmlU1 - sNsJ8ui+fQkaVOrFkOvXX3V52DFFEOzny1lZ3jC5lGn9ZLAKTSR3vQi6uJw/Z1tEnXsDkCAXJrpuzF3X - BzmCTk3u40XiR46wi5JTyOkR+u+dAAaedWnY4QOO/Le6ej80cdTfNMKSTq3Y782GqaboqmPxyYU/zzmU - uy4pufZ+OUbZbYGcwq5KjidJEydouexCu+u6kEf16UPQoHnFMpfdY4cP1omJsGNqqz4lFxFy2ebN5Kw8 - T4Jc0/utdmcYZwi8mVJyrqqXg8KXKvNJ2qIFDOz2gjzqq69wzf6v6vffcTKMa0Xi4QO9yUTYjx+X2xty - xe/7yTlobyQpOW3w6B6QI+iMVRSTnD27SCzCzpaaGspdN5QMQ/fJNQE3diuNBt4MKTlCTg1e82xVZGRL - l3Hh2eDbsuqIiCh7Q1508ji5AK2RHQdya5o4SoE3S5VcAzmFHY5y75PMmt0ekCPskb17Y65+Erl27WWn - h52tRpsE00w9CjZvZvq8WT09xcY1OaaxIuAS5G6q5BzIy8+WgLqXkMKocBIPufK01NRQ7jpNa+VDySnk - kV9+SdBgdPUup692gw/wOa7LC3fv/stukC9fTsoT4iTIOb3Y9XVrFW1NbiRvna/AG67N9am4+mtqyKmp - 0hJJwpjRTJmplunkrgsBOYIO4N+GGo9vnXa9Dm+8Pq7Ly728su0G+YoVUHGWJEEuQc6Crw15eSX8G0yV - lUoSoHWVkGtyXSWnih7ZqxeJHTiw9C+ZzPmSabAWF2zen+npvvaCHHPdKzJSJcglyI1CTmEvzsskibD9 - pnHTqaKzBSq2BN6MQY6gR/TsSVImTDjtdPvr8Ia/uXnp0i4YsnDDLmtyUHLs3yatyWtGJ0nuOkfNWSWn - kHNhTxg/rgZ2HiDHoBtj7Jqcq+QUcgQ9smfP+/K1a2c6TaUbW6yysdTDQ2k3yFOTJcglJTdLySnkZQA/ - mgpGYsXjml1EyBF0NEimuXguNraNw0fhAfLHwBZeSEgItAvkGHhLipcglyC3CnIN7BnJJA5SZm1x181V - cgp5RI8eBA223EJxS9qhYYc3OADaQe1UbN1a47KLmPFWBnPAJXddctf1Rdd13XRdJaeQ02NRSjyJhTJX - 3So0c5JhrIU84osvCJps5UpsQ+WYY5rhjTUEW1/q6SnXqLmIkEv75FzA8bEdM94cbAvNUsjLKovBjS9m - 9tkxEm9JxputkCPo0X36VF9KS3O82W4A+ENgv0CU3dsekDMZb1IyjGZmuQS56cCbroLX/FsNObV8yKBj - VJ0tNaVHWqDCTWvlA3IE/cznn5PEsWO9gKmnHMqFhzfUHaaqbIP50X8zoIuo5Apov4yNG6WMNwfIeHMR - JeeCjo9z9v+mBbrQkCPoYPdga3qkw4COe39gqyq9vdPFhly+Ywc5f7ZcgtwRqtBcFHIKfcba1QzsokD+ - 2WfkDFhUv35F18vLX3MI2AHyYfBmfoe7zz0xlTxv7VpSXazkHfJqqGxLXgyljJN/IrGTfjRtE8aRyBHf - aiwCHmvZcPg3a+ED+pPQr77Ua7mHDzDDD6sMmVYkXXc97phr8nx/H5I4bzZJMNfm/kISeLA8Xy8m403X - zHXXdRUd/11aqiRJ06eqQedUofHprjNKzkJOj2lTp66ze2COTXNdX3zwYImYkOfCNhrNejO3vZOpn+N2 - hokZO4Ychk7UYtqx558npbIs/aA7IeRlUPt9sm4dUc8h/r2OPf9fosrJ4BVyBnwob1VB9lzst8M0oAsN - +Znu3cmZHj2uVPr5fWg3VcckfLApf2VmnhIV8mXLSHFwEO9KzgX9bGkR8apXT/SLNLR3r9qgOyHkWJwS - PWGs6OcPQU/fsVUQyEsBdDQFROIxCi8K5AB6eLduJGnUqOOYVm4X2OGFW9y7c2eT4tdf/2JAF6nHW+Gh - P8iFi9WCt3+SnThKDj/wgOgXa9buHTWwOynkBTA9xeOhh0Q/d4HduwoKOYU95+DvZqW16ibD0H1yemSD - brXcdUbJWcgRdHh8J3/r1l6ig45rBrA55yIjw8SEHFtAYfDNlBtu7vdNNXKMGDpE9IuVceHBRaxyUsgr - QPV8mzcT/bx5Pv00KUpP0gLdljU5ddcp3DVHFSi7iqQsnK+dvw7FKdzcdb4gR9DR4gYPjgbmnhQVdnjB - 1ndu3tys2L79b7GUHNfllblZokGON4HKQjk58fLLol+0IT2/MAG64ybDJK1YKvr5Qpc9Zd1q0SBH0IsV - uSR2+HA17AJDHt61KwG7n7d8eX/RQMfqGrC51eHhEaJBjuvyQH9RIadqn3Ngn10u3Mxfode8XlV3XMiL - IEfc8+mnRD9f/h3bM73gTKW16oum6/0aux7XVnO1knOtIDxYA7pGwdkCFZq7bq27TpWchZyEf/opiR4w - IEG0JBp4oXZ3btzYIt+y5ToXdBlsdzGGLZ+4ZkNL5lwAHK1g16/kPCisuS65sZ8z5a7r+35o7y9Fv3iP - PvccKcnRdeEdF3Ls4xbSq4fo58nzySdIIcxc4wVyAByj64bcdV3Q8d8ZmzYwlWdaxhao8Ak5go6Ws3jx - UMFVnU11XVAVEhIlFuS5UFt+tkBmN8gR/LK8LHL0v8+JfhFru/CODXnWQft4PolLFtoNcgS9RFVAYqHS - je81OVfJKeSMqn/9dQpw+LSgsMMLtLl3+/ZGUPNrFHQhlRzVvDjAz66QqxX+LMnctll00HHtmbF9q8MX - qGC/9JN1XhP9/Jxu+REpg6GKqOY2Bd6sUHKuusthlyECO8UIqOQIeViXLozlLVki3Fqd3TefeT4mJkgs - yGFLgZzjYVySNe56ze/UtGQO7NxJ9ItZ7cJnaGDX28QRKtXOVhsyGwYempnWGjXuB9HPy5FHH2X2tO0N - OQU+dfkSNehsqamlW2j61uRcJaeQh3XujBV1Z4DHxwRRdXjid8DWKXbu/BNBF1rJc5YuJRXpqTarOV+Q - 46ikEgw2Pfmk6Bd10GfdGdAdEXJ5aCDx+M9/RD8ncb/MdBjIS8GrUOVnk0hIpOGCbu4+uSWQI+gA/V35 - zp2dhAJ9/OXMzBNiQY5zym0NvvEJOZ2JlrJimegXNZPxtX2LftDtqOQY6fb98APRz4dP0yakDLIX7emu - a1x3gBxBLwHL2rdHA7pgkCPoYDD7/QjGzHiFHZ6wDqo5zIsqEUPJcc+8CvawbQFdCMiroRy2CsDya91K - 9Iv76LPPkpKsNG3Y7Qg5RtmTwF0Vsx4AXwsz7vJDAhwOcgS9pKSQxI4YwdST6ytQ0c14s1jJWchDO3VC - Vb9RfupUE75BH3ytvHyfGJCjy17k7eWQkCPoaKq4aOLxyCOiX+TowmvcdztDjlloR58SfxkTA1WFjqbk - DOSsyaBiT2jIEXQ0aBGNlW38DGqEJ3ocbGWFt3eyUPvkGF1HwNHyYN/93Nkyq0EXSskp5PSI5ZRiqxnj - wm/ZaFHgrbK6nJhlZgbe6Nyz4B6fi/75TzV6m5QWKwyArt0ZxlAijKX75Pr2ztFVp+46F/KS8iIAvogk - TJmsnb+uk7tui5JTyPEI8QAlsPkCL6oOT9QettQ2yDdvvi5EMgwX8pwlS6AyLdDhIUfYz1aWEZ8mjUW/ - 2BkXHnrW146y146umwU43ggshDzrwF7RPzcG/LDOXL+aOw7kCHoB7AZo6soFgjz0k08IWtbixYP4An3a - xcREXzEgz1u7hpyrsq5oRSwl5yp7IUac7VGl1fVTHdDFgxz3zE+8Jv6eeeQPo50CcqrqiTNnMBVo3Co0 - vpScQh7asSOJGTTI1+YSVniCemBri/buLeU7rVVXyRk1h4mn1gTg7AE5doNBi500UXR1Y1z4zdSFFw9y - dNujADixlywn69cnxYUyPaA7lpJTyBlVj41gVF0DN1uFZijjjbtPzmyhcQJvXHedCzmCHtap0/WqsLD3 - bFJ1gHzAv9XVv8La/L4GdB5y1/VBLlu3lpyDAJOloNsTcgT9LKzXvBq+IfrFf/SZZ0gx7OufBdeba0K5 - 6wg5RrtF3zOHngDZxzycCnKNqv8ySxt0dRUak7NuKBnGEsgRdLTk8eMXWQ06m9e+5GxAQLTQkKOal4SF - OB3ktMdbPqwd7dGkIujTLqJBzuyZw/612GoePuwbp4ScUfW4CBJOG0gIBHlIhw6YkZcOvD5rFezwi43B - 1sCgxL8Y0AVScoQcJ59auja3t5LrNnKM/G6E6BAgdGkb1jKwC6nkqOaJSxeJ/vlOvPoKKZbn6IDuuO46 - 13XXROCnTlGruABKjpCHtG+Pdk+2dWtHa0H/5u/CwgNCQ46gF/l6W6TmjgY5dm4thyomewSpPJ95mqjA - hTcLdAuj63QrDffM7ZH6mwkVcdpRdueCHGGXBfgKDTkDe+LIkVss3lOHX3gYbFm5t3eSkEqOkKNVlSjN - Bt0RIactmnM9/hBd9VDVA6DYhtkiM6bsVkKOsAd9/pnonyv0675ODzmj6mVKEj1iOK9rco6SU0XH6L7c - YvcdfqEp47Zv2XIFQUfXWstWriR5YFgrrmWQuorpq7RhBD3SZBgKtua4eDEp9PRwCchpN5jwAV+LDgXC - ngouvEHQbYA8c/8e0T/PsRdfIEVQsWdoTJI9k2H0uefGvlYMoGd7HtKAbm10nQbe9EEe8vHHBK1gzZou - FrnvAPmwq3L5QaEhh24ZpDIv2yzQHVnJuS2fyvJzyPEXXxQdjqPQwqkoLbE27DZAXlIIe+avvir6Z0mD - NlquAjmCXlxcQCL79tHUk3Mj6/hYa/sM01vZZBgKNx4ZwGvW5Bolp5AHt2tH4ocN22G2+w4/iD3hlpR7 - eSULqeQIef62rS4FOQU+a9cO0eFAVQ/s9Im2C28D5Mye+ZhRon+OoC8+dy3IEXSwNGheyag5Z4+cT8gR - 9LCuXRXA7jNmqTr84Jtgq8Ft/0sodx0hz160iJREhBsF3TYVV3eGQaMlppojW5yim79e8291Mgw1a8Yk - BdthXcu48OtXq1XdRsjzg/xE3zPH9F4lBBbVau58gTfqwjMqrmOK5NhaoPOl5Ag5tfw1a9qaC3qPfysr - fxUa8hwoZME5Z4YSZJwZclT2ksxUchQi4mLvOx99Clz4VHDhjYBOo+mGjvbaM0/ZuM4lIafQx479weyM - N3PddS7kwW3bkpghQ5aaC/qUqtDQEA3oPAbeqJKjmitg4oqrQk7nk6etXyM66EwUvmMHUnm2VC/spiBn - 9swXzRf9fQd06sh0YHU1JecqOxYD8e2ua0AHyBH0yB49osAjf8Qo7Ojfg62C3PYiBnSBIEfQyxLj9YLu - 7EpOIWeO4EL7t/9YdGiYgQZrVtYC3RzIMaAn9p4507I5Kc6lIUfglTCBJxTW6cZy161VcoQ8uE0bdOGv - X8zIMD5qGSBvee/WrbWQ235bSMhzYAtOX167S0HO9nhTwQXs+fjjosOOTSGU8NrUhTcHcmbPvHs30d8r - dqpxZSXnqnrcjxNqQLcyuq7rrmsgR9DBksaM+daUog+8lJl5REjIDbntrgg57QaTtGiB6PAwLnyH9owL - by7kmXt3i/4+T7duCU0csP+bCbfdxpbM+nq86WsaYc0+ub7gm6GvZf3xuxp0gSBH0KP79t1rCvSZFb6+ - 0Xwlw3DX5Ag4YwsXkrK4GC233ZUhR9gRNnsMHmRc+FUwSx6U2pSVFuSRE6+8Iiro2LIZyzndBXKEvzAn - vQZ0tvrMZnedVXKEPKh1a0y5zTBYow7feBpbRhX99lsRHxlvhiBH2KvLSzSguzrkVNULI8KIx8MPiwoS - go7rbXThjYION6LIUd+J/t7ioR2XO0FOVR5TYi1NhjHlrlPIEXR4/O/FuDj963SsVrt3794qKGK5aWta - q0HIQc3lO3a4HeS07VPc9Kmiw4Sw+7dvRyoMufDw9XwovBC7ztzngyakFBTOKOgu4q5ru/GFJBWSZ7RS - Wk1kvFkCeVCrVgQteezYvnrddwC9599K5W9CQo5ue5GfLwO6uyg5t7dbZXkx8X6nkV1gT4Z+9LVUHSAv - LysSvfcd07I5PMgtIS8uKySy0AAGdHPSWq2BHEGP6tdvrSHQx1eHhgZqQLeiQMWYkiPk2QsWkAqYce6O - kFPg5dAOWGz11LjwibE1sKPCgyUunCf6jSdm2mS3hRxBL4ZOtmHQuttU7rq1kCPo0PAiEpvHaMEOX3gQ - bHGJh0cGA7pAkGM23DlIP7UNdPultapz2W2Zaqpu+xQ1dozocCHsfu3aql141pTJ8aLvmaNHU1qCLZsN - RNld1F1nAGdNVVpI4qZMqilMUTePYCrQ0LQAx/RWNhmG2SfXCbzhmpy665pjy5b4PGcx7qYL+ovwxRWK - HTsqhYIc1Vy+Z7fbQ46gY5MKr/r17AJ70rLFGtCDunUV9T0wLZv9vd0ecgQ9DUZssd1heIc8CEAP/Oij - +4UeHg11QW+CoEM23C1L68nNcdcR8qz584nK/7QNoDu/knObOOYd97RLnznPJ54gyoRokrFnp6iQo0cR - OW6MBDlAjqDLwgL1lpra4q4j4CzkCDpJHjWqny7o3a5XVGwXEnIEvTw9xUrQXQty2uPtzNAhosPGuPCt - Woq+Z+7VoD4pKcrXD7qbuOsIOLWiIhmT986nu86FHEGP6ddvoS7o315ISDhuSWeYWkqOwTaugYpTJUfI - sxYuINUwasny9blrQo6lpKUFueT4Ky/bBXZRq+qgZXPOSU8Jcg7oCHz099/xtibXhRxBhwIXT13QZ0BG - 3Bku6MbaP1kMOYAu27JFglxPT7fM339zedDPjBgmQa4DOYKesnIZL4E3fZAHtmiBGXjJmgw5tqPM0pJD - h9LN6fFmDeSo6AqPQxaC7rpKrtvbLaR3L5eF/USd10gxeC61ouxu6K5zXXd8nOVxUBt0K6LrhiBH0EPa - tKnUdJyBB89jx9fCXbuK9E1Q4TZytBbyrHnziCok0ALQnQByHscWF+dmkqPPPeeSsGcd2i9BrkfNEXR5 - zJka0HmGPKB5cxLQosXd6/n5rzLuO0D+FoIu37jxT77ddWZtDpCjlaUlmwm6e0FO1T1t6yaXAz0MOuJK - Sl4TgNNV9CKVnEmasWaf3JiSM5Czlj1vnrq1FEDeCkGHGvG7DOhsr3W+lJwBfe5cUlVaZAbo7gk57fEW - 2KWzy8B+/KWXiCoPWzZzEmMkd10TdafQRwwaqAbdgmQYcyFH2BNGjvyGgt79xrlzm4SEnGk0cQGbNRoz - 94YcG0Rgrzexu7sIFX1P371DgtyAy85V9vhZMwSDPKBZMxLXv/9sCvrAyzk5+4VSclRz2Y7tEuSGpqjo - NHHE4hOh4BPreYN79ZAgNwNyJvIOgzfMTWu1RMkRcrSoXr12UNBHn4+MPKkFOrRjtiXwRt11hBwNG0Ea - VnNJybkdWyug1bFf61ZOCzsGFZWZ2LKZddkld72Wu65JmilVkKzDBzSgM3nrBnLXrYE84MMPcWyzD9ay - 4Bp9UrmPTxjfa3IKOR6VMERRP+gS5PraMhfGRBDsviKWAvP5Oimb10uQm6HmRQA5Wl6IPwO6EJAj6KEd - OiQxXWHhfz9D1VoiAzrPSo6QZ86ZQ4phUENt0CXIDfVex7rx+Dk/Ox3oARBMlJTccJSdq+QU9ALouisU - 5Ag63EQKgfHHEfRFyv37s0wWp7D15Fpprbh9xtlC46o4hRxBL02I1QFdgtwY5Ah6ebmK+DR+32lg94Su - s4XJbMtmyV036q5TyJmjIo93dx0B11iLFheB8acQ9CWKnTsVmuaNnCaORnPXzYQ8c/ZsUp6ZxgFdgtwU - 5LQTjDw0kGA3Fj5da6GeK2nVMrWaS5CbDznU5ReBBUMtulZNuU4VGuatMwbZbmjcfXLmMRt40wIcYPf/ - 4APi/+GHt4Dx5xD0xfJNmyq0QDdVoGIB5Ah6ZYGMBV2C3FzIKewxP010eND92rYBwFUS5EbW5loqjkrO - Qo7HMBgsyW0aYW3gjQs6Azla06ZE9ccf9RjXHRpC/sltx8yXkiPkaOpkGQlySyFH2MtKCsmpNxs6LOxH - HnuMFMRFSpBbCTmCHjFwoBp0PpWchRxBT500qTUDOtShX6c91/mGHEE/By2Y7DXV1Oz2TzzmrmsVrdg4 - 1RRhl/mctEuTCnPc/IQFcyXIbYAcQY+CclWhIEfQE4cO7aYGfdmyf7UAtyHwRlWcHjN++UWC3ADspoYq - aL4PPd4ivhvhcKru2+xDUloKLZthXV5ay1TwNQsMgo+lYNrTU/DfRVaZJdNTav9sTX837POmm6Nu7r+N - uetc1z0Gpqzy7a4j4NSgAUUfBnRQ83tCKDlCngUNKOwxn9wVlJwBnW3kWKKQkZNQ8mmOyorxMziMQn4m - RILcgJqbCzkCHzNhrDrYxjVrAm8cd10DepMmJOrrr/sh6AuFghxBz1wwXxt06AJbbdQq4fs1VgWP9RrT - kdWY1XRrpdNSah0d2F3nQk5hzz580GFAj50xVYKcB8gR9NipkwSD3B9AP/P558P/D6anLtGArtv+ycLo - OtddR8gzfv6ZZEESjkbRJchNzkDjuuvc1sz0MZZ+iqHYxl7D+913oGVzoeSu6wHdEiWn7rsW6DwqOULu - 17gxiezVa+T/3bpyZSUdrmBNMoy+NTmFHEHPhl7uDOgS5DZDjrCXyLLIsRdfsBvs2LJZFnhagpwnyBF2 - nEFn9T65AXedQo6gn+nWbYIadAGUHCHXgC5BzgvkCHo5WPqu7XYDPXLcDxLkPEKuAZ1HJUe4uRbeufOP - /3fr6tXlQih5DehLpTW5GWOL9a3JdV13hJxa4Kdd7AJ7ECR3aEfYLYisYxTejaPr3Eg793HcjGmWZ7wZ - UHJdyP3ef59EfPbZKAzGLWDy1bnGtn8ylLtuyl2nkGfMmkUy588zAroUeDO1JqewcyFX5WWS4//7n11A - Z2aub9nIwi5Bbs2aXBv4AhIL45ksSmu1AHIEPbR79+EI+nyhIEfQM+CmoX99LkFuDeQIfBAM6LNnQA5r - zgszkqR9crbUVAM7J63VkHrrQl5UUkBifpygDbqx3HULIUfQo3v2HMSADvvot8ypQrNEyRHy9JkzmXV6 - bdAlyK2FPGXNSrtCTm8wQd27mQ+65K5r5barYS9gTAkWPWZUDeg8Q8647r16fcWADiWq/9JurXy46xRy - BB1NG3QJcmshV0SfITg7zZ5qzn3tlC0bTMMuQW4UcgQ9avT3atAtgRy2zriRdc3aHMBGuDX23nskqnfv - HgzouUuXXtVt/8StJ7dGySnkeKyC9khq2CXIrYW8DFJNfT5o6jCQI/CMC5+WYBh2CXKTkCPoEYMHCga5 - H4Ae/8037RD0eXmrV1cJoeQM7DNmkMrCfJ4gt2U2eQUzm1yf6U5OMfhvHgpULI2u0yBc9E8THApyquyB - 3bvqB12C3CzIEfSwnj3UoHMbRtB6ct01uQVKjpCffvddkjx9eiMG9PwNG4q4oGNXGMbYMlN9GW+ayDru - l2PQjV2Tc5UcIUcry07nIa3VfSHPOeFJPB580CFBR+CTN63Xhl2C3GzIEfTgjh0EgxxBv5qQ8DyCPkex - fXsOBZ1vyNOnTyclSfEa0K3LXXdfyIvzs8mJ1151WMgZF/7ZZ2tceAlyiyBXwihpXTXnNo3gFqeYuyan - So6Qw9r9CjD+JII+pWjv3kQ+1+RUyRFytOLIcAZ0CfJSTTWasWSYmj3zEhL8ZU+Hhlzjwnf7VEqG0bu9 - VhNdR/XWNUVWipaa8wk5gg7PVwqMP4agj4MusGeEUHIKutLfV4KcLTfVV6jCTYbhQp66aZ1TQE5hx2EE - 7lhPbnjP3DjkyuICIosK1YDON+QM6M2aZQHjDyPo38Js9FN8rskp4PQoP/yHFaWm7uuul58tIYUJUeQo - dFZ1lK00c94HuvCK1AQO7JY3jbCtYYSSYKMIrpnbJKLWAESekmH0qTjzNYAcLevYYQZ0ISA//c472GE2 - GBh/AEH/6kJs7H6+Am+6kKdNm0byYCRTLbfdzFryqnMQLTdkTlZPbq67XlZWRE43b+ZUkNMbQUCXTizo - EuSmIEfQU7dtFgxyBD2kXbt9dCRTp6ty+UYu6EyZKVtPbkl0XR/kCHrW8mXaoEuQa4pTtN32Evh6CYmd - NtkpIaewJ29YY3H7J3dTcqroWKJKu7XaGnhDV50xAJyxRo0got9xCQW92Z3r1xfYuoVmCPK0qVNJGgTk - qs6WqWGXIDcKeZ73CYI13+a4yo76M0efeYYoYJiDuf3e3BVyhD1y2Dea3m4M6Fbsk2sA14EcQT/z6aff - UdAbgPs+O2fhwr/5VnIGctbKcjIkyDllpvqUvKQgl5x4va5TQ67twpt2390ZcmWxnAR1aF8DOs+QI+ix - AwZ0pqD/F0HPW7WqjE93nQs5PlaFhxoB3b0Db+iuo4V+3dclIKewJ61bZVTV3R1yOVQACuGuI+DUsrdu - rUtB/w8OWizYujVLaz1uRsabUXedo+ZpU6aQAk8PA6BLkCPkads3uxTkCLvn008bdOHdHXJU86xTx9Sg - C6DkDOjvvHOZSZah/8E/xhbt3x/JR+BNV8kRcrTczRv1gC5BjpArYT2L61pHXXPb8r4COn9CSsqUWsou - QS6HrTU5pA6vEwxy37ffxptILrOHzgG9X4WPzwluZxhjueuWKDlCnjp5MkmHKD5uldUE4yTIEfIyGFBw - unVLl4Rc48KvrXHhJcjVkKNFjx9ndqkpN61VX3Sd664j5GiQWuungRwfAPUdLqWnb2NAN1GgYg3kCDpa - WV4WC7oEOV2Xx/08w6Uh17jwSbGQyIIJLbaYcyXD0C009bEGcPo4uHMnrSaOTE25nnpyayD3festEtiy - 5Rpd0N+5888/8wHy+3wrOYUcBr0RZXAAq+quN1zB3GQYCjge8/y87TIWOXL0d6IvFfw/6UCKoXuq9aC7 - FuT5STGCQo6gh3boMFwX9OdB1WdBS6mLWmWmbD05U6TCFqjQIybCMMYNuuFj1lXXAI5qDpCj5f22Wwt0 - d8t440KOI5a8GtQXXc1Pt2pJSgC4pFXLRX/tpLUrrQTdtSBHRU/fv0cbdB6VHCFHi+nf/wNd0B8A0KfK - N27M1ldPzgfkqT/9RDIXLtCA7s6Ql0PHnfAhg0QHzfOpp4giMVpdO46xAYDelkCbpb+Lry+H17dM1V0P - 8kIAPXbW9BrQBYAc1uzXSFXVE1qgs+v0oaoDB0I0oLNNI/iCHEFHq1DKXTJ3XX8FGvZhV++Rawwgz9i9 - U1TAKJCp2zZpNYjIjwwhHo88Iup7scyFd03IEfRQ6CrD95qcKjkeYcsuFcT7QX2gdzoXGfkbbf/El7tO - AadHZUigftCduEDFEsiVaYlMrzVL1dDWnw/p+5Xelk8xMODP1ue29PcTVy83Q9VdF/L8lFhBIfd5800S - 2KzZnlqQs4r+9q3Ll+cD4PeFgjzlxx9JLlSyOftUU27gzRLIy6D7iv/H7UQH60TdOqRIlqkX9BKVnHi9 - 2VDU9+T55JMmXHjXhRzVPBVGavEZXecqOUKOFtSqlTrHXfc/kPknwGZA6+cqs9x1NhFGK+jGCbzpKjlC - jpYGS4KzVdCkkZaeuomS47o8ft4cUYFCpcUCmZwTR4y2Zc4+eZQcfuABUd+bf8f2BqLwrg05gh4Ffdx1 - WzJbu4WmD3Kfhg1J7NChDfWCzqr6qILt2+O5oOuNrlsJecrEiQStJCVRDbobQZ4f5Ec8Hn5YVJgQ9Cjo - HssE3wwZ2+MtbOgQ0d9bwsplOi6860OuKMwjARAE5fZd5xtySH3F9lEPGQP9c8iQ8zC6hWYj5Ai6HPLe - 3QnyEmU+8XrrTdFB8v3wA1ICfcxMQY7tn5S5GTCO+UVR3yPjwkMnHXUU3gkgZ7vCaCfC6E+GwS00VG9d - y/I5ISjkqOZQ337CIOSsoje+Xlq6FEEXQsmpomcsmG8AdMfvu27JmhzddbQzI74VFSAmGw0musijw82C - nPZ5S925VfT36df+Y3DhFY7f/okHyBH6uF9mqkGHnut8KzlCjhb00UeTTYH+FEj+9JwFC6pqJcPwoOQI - evKECYyVQq93bVV3Tcgz9/8mOjwIetLqFRZBroa9iNhjHHPCyqUa0B2yxxtPkCuKZCQIbmxCQg6g34/u - 3/9to6Czqv5t4a+/RmplvPEMOYIu9zzMAd01IS/KTCHHXnhedNCNDkA00Xe9ABJajjwp7nw3fL38uAji - ypCjmjNuu4BKjmoOBS8yEOv/mAN6h+qIiJ0a0AWAHEFPnzuHBd01IS+vKCYBnT4RHXKcm67MSbdpTFL8 - wnmiv2+/9u2ICuIJlsLOx3xyOtW0VjNHnpScrtNjp08RzF1n3PY33sCOsttNQs4qep17N27MhL30m7SW - 3NItNLoWp0fqrmuO48eTZLDi5HiHn4VmzZoc1+WJSxaKDgtukWV5HLAJcnTfiwE4ewx0jF+2yCLQnQly - hTybBLRsqW7eyDVOI0d9pabc7TN8TPfJ6XpccwTIEfTgjz/uZS7oD4L0T5CtWpVjrEDF0D65uZAnjxun - Tp7RGXzoSAMPrYVcHh5Mjjz6qOigY1Wa3gi7FWOS8oJOk8MPidukEl14Wax5LrwzQV4ISUlpe3cJDrlv - w4ZXC/bte9os0FlV71F26tQhoZQcIWfspx9JRYlSA7srQF6qKiDe7zQSHXJ8zWKY41ULdCsgp91bI8aN - Ef1znG7X1qQL72yQI+jh/b8WVMm9GzQgfk2aHDcbchb0N29duvQzrNNvc+vJmXJTtjiFHmnGmyVKrgEd - YC/wPsmA7gqQo8seCUPtLc39tvXn0XuQhQfxCjnCXgRdaU/We130zxO/1LAL74yQ58LYpdPsCGPdvut8 - uOsIOVpg27aDLQUdG0aOz1u5MpsBna0n5xvypLFjSdqsmaQS2iCbBboI88mtddcR8qxDv4ueSoo3ifjF - C3iHnKp6Jn4meA0xjYnCx5yptV53RshRzaN/mlij5jyvySnksFa/bJHbTu8IAPrn4L4fFBJyBD3phx+I - MizYNOgODrkK8gKOv/SSqEAgfP6fdGRqy7Vcdhvcdd2hC5i1Ftynt+if63Sb1louvLNCnp+WgC51rQkq - fCo5wg5lqZ4WqTkH9DfuXLkyE9z3W0IoOYUcQc9YvMg46A4OOW6lBXbvKjoMx/77HClMTxQUcgRdAf3H - jz73rOifLw52LnC7zVkhRzVPWDxfcMgR9KC2bb+2FnR038fmrV6dygXd1jU5Azir5Ag5NVVCjH7YHR1y - cNmToDhDTNeWvlbGvt2CQ067wSStXyP6Z/R84nEiiw7TBl3vDHIFsWp0Mc/75Ag21wpkGSTgo4+0ZqHx - reQIObjt56r8/Gp3kzGXfAC9c3VIyA6+Am+GIE8aM4ZkrV1dG3QngLwgKpx4Pv646BCEDxsiGuQM7KCs - fhARF/uG5gsuPCa0MKruRJAj8EnrVgsOuXf9+iTggw92mMu0oRr1/927fXtyxowZl4VScoQcLXH0aKKC - BBpNUM4JIC8tKSTejd8X/eL3avgGUSlya0DneU1uqKebLDLULvkBsZCp52yQM2oONyk61VQIJUfI0UK6 - dGljE+jsVttgxY4dQQzobD25qYw37vYZPjam5BRyBD1zxXI16HxADpF83RbM1naGoVVo3GMZuOxRE8aK - DrnHQw+RXH9v0SGn8MfMnCb6Zz6CLnwUuPBmKzqUjoIXoNcEdtep6564apkokMOghnSzcttN3QngSZpc - VSgWAtz3uaAbSmu1FnIEnVH1+GijoFfATcCkiQB59tHDxOPBB0W/6GNh4IMmwi6SknMVXgUu6Sk7JARh - x1olvLZp2O0PeUFOGvHHdFfOsEN8TCeoWJrWSrfQNEdWyb3r1cNpLFNMMWzW9wH0RzAol71wYb5QSk4h - Txw1imQsWWwQdJOA401ABMhVeZnkxCuviA756bZtmJ7s6nbNaqO15DVH06OK9W2hWdKCORuGA9rlJmfS - hbc/5IWqfJIACT9iQO5Tv/61jEmTXjILZHN+CED/FDrP7OHWk+sWqNiq5Ag5Y99/T5RnQmvB7iiQo8se - DK16xQ5K4RBGRWKMEcgtB5wpYLFyRFLY8KGinwN04fMgTqBf1R0Dchnsm/s3+1ALdCGUHNUcsu0OmcOv - 2T8DoL94+8aNybCnfkXLZWer0PiEHEFPhQkxFeXFGtgdCfIUiKSKDTm+nqYnu14lFxdyvDkooavsiVde - Fv1c+Lb8SI8L7xiQo5pHT4IsOI7LLhTkCHpgu3adzIbY3B8E2L8s3LnztJBKjpBTyz/uyYDuSJAXxEUR - T5GbMiDkmp7sDgI57fGWumeH6KDj+aiJwsO2m6GgG35dpMAbAo6WHXxanRzDgi4k5PDciXoHNJgLtKGf - gyd9/cbZs7Mg+n4ba8kZo1Vo7NHc6Dp3TU7ddS7kCd99R5LgOcsK802DLsKaHN310lIlwWaLYqv5ibp1 - iSo/y8CaXHwl123kGPhZN9HPyZHHHgMXPsShIC+ENlFh/fqJAjkThGvadKitTBv8fYB9kGzt2iihIUfQ - E0aOJDnbtxoHXSTIEfSYyT+JfkEzPdkh8KU/8GZ/yLFzqxzGIeNMNbFvgOjCo4racwuNKjke02BoohhK - jpBDJlxR2u7dDwsJeqOreXkLQMnvc9WcTyWnkCPo+LgIUmP1uu8iQp7jBVFmgE7sizl60o8ODTlt+4Rl - pWKfG3y9mHm/1AZdZHcdIZdnp0CJaBsGdCHd9VOvv07QIAg3VTDI2eQZ7D4zFMYrZ1LQBYMcQQdLmTEd - AnMqbdhFhFyVn01wpJHYFzLTk70YerLX2kJzDCXn9nYrArh8mzcT/RyhC58LLrxG1e0AOYIeAzdksSAH - Rb+YNGzYM4KCzsL+7l8pKUtR1YWGPGHECIKWd2BfDegiQo4ue0jfPqJfwBjwk0MOvTNAToHPDfYnmLUn - +g3xo+YE18diB96o257pfZzJgBNDyU9BvMbvnXfmCw45R9W/gRltqfqq0Li565qgG2a9cfbJdQNvWu46 - q+QIePzw4Yzh9zEPXoxkGISbWuqWjaJfuAhK8tpVTgU5hT3qx/F2OV+MC69XzeXw9dqmb4KK1td0qtBq - KtLU0XVq8tx0EgSdfsWCHBJkqkVRc06t+tt/pacvghLT+9xSUyEgp7AnT51CyqGIxBDstnSGwRx2LuD4 - uDARgkxPix9kCvriM6eEHGFXQqHNyQb1RYedceGhlZY27MJCjrBHjR8rGuSsms8SRc05oD8Aa/WBOUuW - JGpA51Sh8aXkFPL4b78laFmbN+oFnW/IS8uKyGmI6orthmJP9kLoVKOd1up4a3JjvdczPA7apZ2WT4tm - pFBJXXjhIccou1hKjpBDlVpF2tix1tecW3uHANAbXsnNnQtr9TtCKjmFPG7YMIJWEHhaC3a+IUc1j50h - foUW9mTPPHzAqSGnN4CQAV+LfpNkovBz0YUXHvK82DOQ5tpMDTr0Wjc0ulir9zrbd91YgQpunaHR6DoC - Ts3v3Xd/spZVm38PYP8qf+3aEG6pqTnJMKbW5LpKTiHHYwJkz6nSkxnYhYA87/QpCCqJv5UW+cNol4Ac - YVfAKKqjz4s/igq74eaGBdSCna81ObrrBfmZJPiz7qJC7tOgQY6g++am7gSYA3/zwoWfIIHmb6vddTay - roGbDcDpKrkG9qFDSfLkSaSsqMAA6DDB9CzH2ImmujXlumty/HdxQR60N64nuhqdeu9d6Mku54DuXO66 - riuP3WCSNq0T/Tyiqqtd+DwN7HxCjqBHjh0tKuSg6Pf9P/zwc1MsCv59gP2Ton37Dlql5FZAHgegx33z - DclYvpQZSayt6tZDjqCHDRog+sXJ9GQPC3IpyGkzR7+OHUQ/n4wLD6OJDc0ntya6TqPsidA3T0x3nVmb - v/HGaWDsAcFBNvUC8CYev3v79nepU6eWW7SFZgPkCDpa7sH9HNBtgzzNDrPBaU92W2rJbSk1rSlRLRRk - PrkM5rPbo58e3jxzwIU3quZmbqFRyDO8jjJDGHhZk7NrcWNrcnZtftOvTRvTI5BNQcrX9wH2D6tCQ1cC - 6Pe5e+T4mFmPs7nrTForGg+QI+ixYAWnvbVddXTbLXDXma20lHhy9Fnx2xkHdOlESiDCT2eT6zaEMOff - 1taTCw05rRmPmT3LLqruDZmFCnDh9cJuIeS5GHxr3lxcyOvUIX6NGq3ki1FengfL5cD65SxbdsZkMgxf - kA8ZQmLB0JVXQBaZZl1uIeRllcUk1+8USV6zwrithu+DJfFohRnJLg05AzvMg0tYvZwkrFxq1OLh+3pt - BXxdry2Brxu3vISo2qBbCLkc+uYzSTF8RNfNVXKAHJJj5AnTpj3OC6B8PgmA/tLNixfHJ40ff0lwJWch - jx08mKDFfTeSqLLTLFZyhNwsgwENZWCltQzaOWFbJ3OMx9ZPjuyum+7pxm3b7Fj15NysNxphD/uyl+iQ - n6pT525gixaf8sknr88FsLcpO3lys6Duug7kFPbEiRNIiTy3Fuz6ouvqr0mQY5kpmrEEGGPfs22CimND - rijMIxHDh9kDcpyBvschAnBGmlM8DG9wQNbcuUma9Tifa3IDkMcOGkTQkmAgZIkiTwO7BDkMXqjVE06Y - wJsrKbkCimSiJo63DXJOp1YadDOUDMME3sBdZ+z11ysSBg58nlcFFuLJAPQ6/5SW/pT4ww9XeQ28mYA8 - ZuBAgpY8fRophT1pCXIJciYQZ+GaXIFlp9On2AVyr9deuw9Bv6+E4FKQ5wTY25UeObKVt+i6mZBrYP95 - FimFQFBt2CV3XXLXEX7tKjT6b4Q8DtJobQq8WankADk5/dZb+x3aZde9W8CbfQisb9b8+TGWZLzRZBi6 - T85soVkIecyAAQQtZe5sHdglyCXIjUOOc+btBTm47KrIvn2fE0R5hXxSAP2Ffy9cGA016+eN5a4zqa2Y - 7cZmvPEBOYU9GZS9hHHjJcglyI1ADmtyeyr5qddeu3O6eXP+WzcLCTj3uXGcU3Vw8JL4ESPuGstdFwLy - mP79CVrStKmkBCKoJmGXttAMRt9dOroOkMdMs9uanKDLDmm1S8ViUpDXwfUG2GcwY90LQedWoQmp5BTy - 6K+/JmiJP04kqtwMw7BLkLsn5AXZJAqqBu3lriPkp+rXT5AtXvyIIACK+aRMLvytWwOhH7xCC3SB3HVd - yCnsmFSjhJFGtZRdgtwtIZdnJUMf9r52hdy7bt1Lvi1avCUmj4K+FmbNXSkomAC15JfFVHIKeTQ01keL - gSw6eZBfDewS5G4JeV5sBAnq0tmukIOa3w18772+goJnjycH2N+p9PNbGj9s2B0h1+QauFm3nUIe3bcv - YQyAz97zK6S0qqS0VmgSoS/zzZXX5BlHD6m7w9iSu27DFhq662iQ/bbCHhyK8poA+8f5Gzf+wY2s27KF - RqPrhtz1WpCzsEf16UNS5s0lxYUynfx1M/PWeR5bLOWuC9/+CSvZEpYsVLdmtgByc1o/mZPxRgHHI/x8 - MFm8+EFRoLPHi7D7619kzJoVQ2G3dp/cFsgR9KivviLxo0cRZVIcC7sEuasquTwnlZwZ9o3FTSOEgBzS - XVXhrVu/YA/+RH1NgP2Ju//80x+q3JT2hBxBR4uG5JrcI4fMq0CTlNzgbHJHmmrKzXzLghLkgA7tHQXy - P30aN35fVODs+WIA+3N/FxZ+D+Ws1bT6THNkC1RoOqvmyGa88aHkFHI8RvbuzRhm0hXD+CWjJafuUGqK - NeQWmYNWoUHuBJPpBmOMLW3/JIiS16lzE0YqO29SjLU3DID95QuJiZNgf/2qvSGP/PJLghY79BsiDwnQ - D7sEuZ4bgGNCnhcXQUK/+tKqvutCQI7FKqffeGO0taw4/e8B7G9W+vvPg/X6TVpqKraSU8iZY69eDPDp - a1axgTp23S5B7hSQY8AtGcZo+Tf70DLILei5bmngjQm+NWiw2OlhtfUDAOzvqw4eXA2qfsfukAPoET17 - MhYzbCiR+fsYGFusghZQzt+SWRN8s8hVR9fe8ZQ8NzKUSYCxeKqp0JDXr7/NqSrSbAXa2O/DifhAuXv3 - RlD1e2KtyWspOQdyCntEjx4kecF8opJlusxwBdw314quOznkCkUOSVi2iJxu3NjxIK9X73eX3kaz5qYA - sDdXbN26PXbgwPuagBsNwLEFKiaTYTj75HQLTV/gzVzIEfSIL74gUZhk88d+UgKQSEpeUDOPHJRdM5sc - H4s8nzzjmAcJ7taVAdzRlNynXr2jEuQG7gQAe0v5unV7APQa2O0MOYJOLRbaVssC/SyG3SFbMjuxkmOw - 7czQwRrAHQ1yWMf7wUDEh60RPLf4HbbarbV8w4ZdoOz3rMl441PJuZCf+fxzwthnn5GE6VNJQUyEWcBL - kPM3n1wG/fdjZ04np99/32Ehh2q0E7KBA52/Gk3oOw4Le4vCbds2g7Lf5cVdZ7fPNC47RtcNrMmpu24I - cgSdMYA+6eeZRBEfbRB4CXJ+IMfe6nGzfyZ+HzTVAtzRlPxUgwYHJSW38A6BAbrC3bvXgKrf0a1C0xSo - mLMmFwJyBL17d8bCwRKhIWU+7L9z1+8S5LZDji56zIypxP+DD5gcdboWd8g1ecOGv5Ljx/9j4WUu/Tie - Adx6Kz54cCko+01jBSoG3XWhIe/WjYRzLHb09yT32BFSDEEp20C3vSWzbXnr9t1Cy/b3JpGjviN+6KIj - 4A4Oue+bb66RttBsvGfBCXy77NSpX2DN/rdDKbkO5OFduxLGPv2URA7oT9K3bSaFMCfccuDdE/ICWQZJ - gUGX4X2+IpAqqjbHh/yuz9tvz5QgtxFy+utwIutWh4VNiBsy5ByFnVFxtgqt1haayErOhRxBpxbW9VMS - P2UyyfU+TlRmqbz7QZ4d5Etip05masQ1gDsB5DBs4abvO+98y9MlLj0NB/YXrubkDIVe8YX6IKfFKVp7 - 5DSt1dbAG3dNbkTJtSDv0oWEoXXuzFgkKFXKymUkH2ahF8N+vBATVJzFXce1d+KqZSSkxxfED0YRawFu - LeQNGxIfrgmY8Qalpn9Bgo7jzkZz9tsGKPtT16ureyX98EOiyUQYB4Kcwh7aqRNBi4AEnJRVK4gsIoSF - 3vWVPD8xmiStW0XCen/JrL0RcGeE3Ov114sDmzd3n1JTe900APZHyL//dkydOtWXW2bqqEquCzmFPfST - TwhaBEzrTJw3m2QfO0yUkGprzcBDh1TywlySBUuWhAVzSWjPHmq4qTkp5N6vv54U3qbNy/a69t3uddm9 - 9sa5q1Ztie7T55azQh7asSPhWgiAHz1yBEmGeeA5Jz2JAkZBmwLfUSBX5GeRLJ8TJBHmnEeOGEYCPvqI - +EH+uRbgTqzksEe+P6FdO8ebV+4O9APwdcqOHp0Ee+3neU2G4WFNbkrJa0HeoQMJQWvfXsvOQFOMWJjs - mbxqOcnyOEjkMWdIEcwIq1WcUmppwwgrt9BgaCG64RlHD5Ok1StI9IRxJLTH58xeNwM217gq7qSQY9DN - 5623JroDTw79GQH2py/n5PSBaTCZTD25AwTe+II85OOPCVpwu3Y11rYtCYavhcNaNwb27RMgYyxlw1qS - CUU3uQE+JD86nBRkJBEl1GYb7xSjp9QUIC7ITCYyuJnkwHNlwI0lZdN6Ej97Fon8fiQJ69WTBLT8iPg3 - bVpjTZoQfzAxIIfOqdg9VTvohgE4gQJvEHQr93v33XYODYA7vTmm6eT16x9lzJzpEdGr111NmSnWlmMF - GluFZjKt1YGU3CDkCHqbNloW1Lo1YaxVKy0LRg8Bo/6wRkY707cPOTNwAFh/cubrfiQUCnbQ8GfwZwNg - i4uxDz/UMlRrxriA42MXhhzW44G+TZpI63FHvJEA8K+pfv99KqTMVjOwuzHkQS1bErRAWCtrWYsWJBAs - oHlzbZMgZ/qtg6t+AzrCTJGSYByRcM57whFQV/LzuyWOHh3urkouQV4fe6drGYwlJozVrattdeog3Azk - XnXrZvu8+25TB7/EpbfHSa7B4Y5vyVauXBHVu/dl6rJzS001VWgu5q5LkFsOOY4t9mnQYGNk586PSRQ5 - 4RnAQN355OTPE0eNCpcgl9x1LTVnlRy+lgnVcK2c8PKW3jL3DLB77vULtm79BdS9WlJydm3u7mvyunWv - Q7R+rlQ/7mL3C1y7/11Q0B7GN3uCut/R1JNbmbvO5xaa1vYZbqVhZN2C6LrkrlvmroObHhDw7ruNXOwS - lz6OjsL/r9zLazBMdI3j1pIzjzmlpsYKVCTIhcl4E3qf3Lt+fRm0oeohRdTd5J4Af+gHwdCdnwr58ioJ - chffJ69X7y+sG1dOmvSom1zi0sfUUfdHb1261DRzzpx1sBV3nqvi+JgpM+WUmkpKzpOSWzC2GLPerB6T - 9Prr/55+++1NgR07viRd+dIZwJZVT14vKvoofcqUXRCsuyJBLmBaqwiQQynpbRiseCCoc+cG0uUtnYFa - ZwDr3a9mZ7dNnjhx35lu3f6mCs6LkuvLW3e3wJvwkN+B/m1HQtq1e1e6vKUzYPIMAPDPnE9MbA8NLg6G - de16HUHX1JGzzSNoPblZVWgS5MRXQMghL/2ub8OGJ4LatPnA5B9X+gHpDOieAXTpL8bFtUwZP34HtHU+ - r9s0QoKcbeJoqv2TQJBDmuv102+99Zt/ixbvSVevdAZsPgPY1eZmRcXbaTNnLoV0WiWj5rpNI/TVk7ux - ksMaWT26WAjI33jjAkTRl0PK6is2/3GlJ5DOgB6F/w9A/2r2woWjowcMCAWFv4nAMw0jdJtGSJDzDfl9 - 2GeP92vUaExa795PSFendAZEOQPo1pf6+bVIGjt2Pbj1Kq3OMBLk/EHeoMF5UO+twa1aNRblDyu9iHQG - 9J0BNvnmf9mLFw+AbDuP0M6dq2p1hXGT6Dpv7vobb/wNyn0cutYMiPzuO6miTELPsc4A0+nm2rVXMubO - HRIzaJBnWKdO55g8djfIXbcVckiMuebbqJFXYJMmg7OHD3/Ssf6y0ruRzoCBMwDQPwz2ct6SJb3jhg/f - GtG9eyoAf5u2gTLU/skZC1SshRzALvBv3HiHf8uWX2XPnCnBLdHk3GeALZV9pios7D3Yqpsc06/fcYjc - q6DH232tPm9O2P7JEsjhZ8/5NWniHdis2dTwnj0b4bLHuf+y0ruXzoCRM8AMoSDkeeXevc3jv/8ewT8E - EfwcgP6OM/V4MwY5ZKjdhw6qSmgg6Qk96n6K7tGjOX5u6cKQzoDbngE2oPf0uejoNxLHjBkMQynWQc28 - H0Ty5QD+LUds5KgD+T0Yr1Qa0LRpIHSLXR/YqtWw6O+/fx0+lzQv3G2vaumDm3UGWPifuJab+3LSxIld - Yvr2nQTJOhuhZv5E2CefJABMZeAC36atmUVoyXwPpq5Uw+ukgXnBa2+CGWSTgtu375I8Z84LEtRm/Vml - H5LOgPlngInuY7fbsrL/Zv3yS+OY4cM7wY2gP5Tajo3o2nVOaJcuG2Cbby8Mejga2qHDKQgCBgW1axcM - x1gIBiZAIDABlgl4DAYLggCgD+SJewa3br0P/r0xqG3b+bBFOCGsY8f+UM33SeLgwe+pdu9+Fl/X/Hcp - /aQjnYH/B+119hvKHdsiAAAAAElFTkSuQmCC - - - - - iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAYAAACI7Fo9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAGYktHRAD/AP8A/6C9p5MAAAAHdElNRQfZAg4LMQXZmN/IAABK9klEQVR4Xu2dB3wUZfrHr6h3 - 5/Xm/e88ez+xKwioCIqACEjvXXqTjtTQEhJCeu8JhJCQQEIgkEp6JZ30ntAEVIoCgvj+n2ey72Z2s2V2 - d2Z2Njt+Ps9nVrJ1dr/ze96nvb/4hfyfxZ0BQsgfwP4L1gusL9ggsOFgE8Bm3bpzc/n579q2Nlyu3VN1 - scyNsfMlAaXtBSFoJW35oXgsasvxrTxf4lpxrti56kLpruardRuv3Px6ATzHOMXzDYRjH7BXwJ4A+zPY - Ly3uhMlvWD4DUj0DANRDYI+BvQ32Gdj0W3e+X9V6tcG9pD0/4nRdQsKx8ojcQ0UBlWF5Xo0BWU4XvdPt - r7mm7rzrnGJDnJK3qdi+5K2EbY5JWwja3qTNqpa4Cf5980/OKdtveJy2veSX6dgcnON+NqIwIPd4RdSJ - 9LrE/SVtubYd19rmwXsaBvYO2JNgD0v1XMrvSz4DkjgDAMlvwJ5XKPOUe/d/XNd8pc4/pzEtLr48Mu9A - vneTT6bDDbfUnQTNNXUHYy4p21UMATcV8r0AukPiRhWzP/UVQdtzaoOKOZzaeMcj3a5tf75X/onK6KN5 - LelO579rnw2f40OwF9DzkMQJlt+EfAbMcQYAgL+CvQE2CmzZ5ZuXXAtbso7ElUcUBee6X/RIs73vlraL - MKaAW2qQ251cT9BsE9ap2O6EteBJbL0amONSnFAZHV1+vsjmJ/LTCPicr4P9U3b9zfGLk19TlDMAP+4H - wJ5TuOCrLl4/553bmJoQXRJ61i/L6bp72m7CNkuGHEHfdWKNitmeXH/bO31PTUxx2PGiliz7Oz/dwXjC - i2C/E+ULkF9EPgNCnQH4Ef8RDANls7//8Xt7WFfHxJVFlARkO1/zPG1HYP3LWE+HfOeJ1YSx46uUBheD - 294ZDuXHKyMj6i6eXaI4T/8U6ruQn1c+A7yeAVyTKn60C76+edEroyEx9WCRf6tPhsNPCDc1a4Z8x/GV - BG17/JdKg+Dfhf153ilZDck2cP4wyv93Xr8Y+cnkM2DqGVAE0jDyPP/yza89MuuTUg4W+J7zzrAnXul7 - GJMh71RzTZAj8DbxKxjbdmw5rvuvhuZ6puQ0pm5SRPTlgJ6pP1L58cafAfgRYh577J17d/bkt2QkRBT6 - t4Ny/4yAy5B3d9e5QI6gU9t6bBlCf/lAvs9xyPPPgnP9FNivjP/G5EfKZ4DjGVCodz84rmz/pjnkRMXh - Ev8spzsUbhnyNZ3rcbU1uTGQI+hb4pYyBrfvQ31AJaQaXW/du4Xn/08cvzL5bvIZ4H4G4If1F4yY37t/ - b3dRa/YJcM0vgnoTNBnyrgi7EJBT2DfHLSFocNG4BgVC8bUXq8bDd/II929Rvqd8BrScAfgh/Qds8vd3 - bjpn1CemB+e43fDN3MsALkOumkITA/LNsYsJta1xy36E7yKjsCVzEXxHWJknl+bKJBt2BhTrwfnf/nDV - ++TZo0VQXoo/KqIPcnbQzdpTaKa66+pKzoYcb2+KXUTtZ6gGLD9dm4DBO6wulIE37OduffeGHwnWls+7 - fuuaZ+LZ2CK/rH33KOAy5GuJpmIYsZVcDXIG9o1HFzIGFXnlWQ1J6+E7fEYG3vr41fuJFS76nJt3rnsk - V8fnB2Q532UDLkMufci/OrqAMBa7ABW+OLshbSW69Hq/fPkOPf8MYPQWbCqkyFzS605lBWa73IFuLcZF - l5W8s4YdVVyrkrOq3bjmydVTaOzougHuuoqSKyFXwL7hyHwC9rNL6o7c8o6CL+SgXc9nWeMnhC/+QbCP - 79+/b1fQkpkYkuv+PQIuQ969QcVCISfrY+YxBheBexA4TWq4UoONNXIrrTUwj+s2sDfBNtdfPBt1sMDv - a1iHM4BzhVxTtZvVBd6kreRKyCns62K+IJuOLroZlu8Zeu3utbfg+/+1NfzerfIzwpf7d7BF39z82i+u - 7GAtA7gMudZWU0tXcjbkCPra6LmMQantuROVh7Gm/lGrBKGnfmj4Qn8FNhCKXfbiOhy6x+7JkG9gANfW - T95TIaewr4meg1N1Ckva80bCb+M3PfW3bzWfC6/aYDh+KRzc9MtKwGUl5wy5pvSZBANvGt11tpKzIUfQ - 1xyejY/5PjTf0+fOnTtPWw0UPemDKlR8GEbTk6qPnfHPdrovQ945BsoQJe/JkCPo1HadWF2V2ZA0DX43 - v+1JHPTozwJf1j/AVqKKh+f7fKsCuKzkspKzAEfQVx+exRjc/hEqIP3gt/PfHg1IT/hw8CX1gZSZfUZd - YjasxVVVXIZchlwL5KuiZhJqtifXnSluyR0iR+YleEXA/CjYrG++vxxw+ExIB7SOdkbU2San0DQOclQP - vFmLu06VnA35yqgZBG1tzNzvDhUGbIXf1F8l+HO3zrekCLhthg0IYoNy3O5YI+Q49tk/04kczPMj0UWh - JL4kkiRVHCOZ1Ukkvy6DsYL6TFLSmK+04sY8UtSQQ3JrTzOWAffFx+BjowpCyP4cb+KXsY/sS9oKraGd - 02HY45/UJ8OIWPFmVOCNvSbXBfmXkdMJY1HToZR2e+zl65efs06yJPSpAfK3wVV3SK87mYeA92TInWGc - WlCWKzl65gBJO5tAiupzSE1bBem42EouXb6gxc7Dv58nF9Xta/g3rXYO/tZlF+D2uYtt8FqVpLA+m6RV - JpCYojDil76P7Dm5QTkRhj0ZRsCyVnEgV8C+InIasTm24mxRc/ZgDPBK6KdvHW8F109gY3+4e9PraOmB - ZmMg5zIwwlwVb7gJQ1iOFzlZdoQUNmSRho5qBkztQGsCnR/IEfRudgn+TWGNHbWksC6LJJTGkKBMV2IH - 9fG0Zp3n2nXRIUfQlx+aiq78ldjSCJxWK4+nFusSAycbJ60uP/ddW9iBAp9rPQFyp5RtJDTHk6RUxpOz - LaUAVoeBUKuDLg7kFHb28fzFDlLVUkaSy+MZ8HfEr2Qmw+joJ+fSoGI2yBF0NHDn7/rnOLthVkes37rV - vg6c5EeYOvWvz0bDjibMetxQd10qSo47r6ALXACK3X6xhXx95SJjhqm2+ZRcE+QXLnWA0nfZebiNSwtU - /MOw7t+TsIEBnjU0wiIgR9CXHZpClkVOwRbYw7dv337caiEU+oMD4DhMYPeZtpxE2O7nviVCjnBHA9yF - DdmMalO4eyrkCLqKXWwnZxrySGR+ELE9sc6yIEfQIyYztvvE2syvv+94VejfvNU9PwbdwBxhB9F8yI8z - Km4pSo7r7QN5PkzU+/zX7d3gthrIEXpw66mdA+gxuBeS7cG49uyeckU/udnddaWSsyCnsG+MXVRV3lqA - 21XLo6v4uCLBifwYGlJcoOOoylDIDRniyHfgzSvdnpwsPwKBtBqtcFsr5GzgzwPwzefqycnSI8QxcQsO - jGCMdp9p60LTVLuunkJj58jxNs2TK1NorOg6DbzRNbkuyJdGTCJoUDPfkd2UNkYurjGRdDiBn8GGfO4Y - WbcUyENzPJh1N0aq1V1zTf/f09bk3dx1NSVXhxxBZ1txfR7xz3AmG452wY7NKfoaVMSGfMnBiQRtZeSM - K0lVR3GDiQdM/Llb38PRHQIbc+vuD56Hi0POSR1y3Ks8qjCYVLQUc4JbVnJ04VUBp/+PLj1adUs5icgN - gODdEslCTmFfETn1xtHycBw7/ZD10WrkJ8bCBLCJMKjRO7Io8JKUIUfAj5UcIo3n9LvnogTedBbCYJFM - 92IYfXlyrtF1U5UcQaeQs4/o1h8tOki2xS1TDo9g2kwVrabmUnIK+eKDEwgarN2/jzoTvAJ+u3J/uz72 - FZBPv3b7W99DRQGXpQo5Ah5bchAArzVIwQVV8h4IORv4lo4GcqRwP4yEWiw5yBeFjydoSw5Ouh1R4Ifj - puXCGm2wK9z1Kd/8cMUfhkR8I1XIowqDSP25aqMAFyxP3sMhVwJ/oY00ddSRg7n+jDvPbjMVOvBGFVxd - ySnkXccJd0NyXHEzCVnZ1WFXQD7uxu1rPlKFPDDLhZQ05RsNuAy57jW5Jrdd5d8A8nMsq2wuJe4pu5he - cqlAvvDAOIK2KBxhd18Hv+sH9XmxVvV3OCGjsG4dth6+IjUl9zi9m6RXnWIaQ7hE0bXdR5DouhUpORty - 9u2sqmRsPFHCzncKjauSU8jpcfHB8Xf2F3gvlaPxiksZnIghP9y56RVVFHRRapBHFPiTxvN1JgEuKzm/ - Ss6GvAMUHq0Z1u8Hsn3IqsOduXK+8uTGQr7gwFiCBu78DxF5fvOsPs8OJ6A/5smjS0I7pAS5NxS75Nad - NhlwGXLhIaew47GoNofsOr5WBXQshDGmGMZUyOfvH0PQ4HmuHyoMnGpVLjr7wwLkL4Pti6+IqpES5JgP - b73QJEOuoUFFqBSaxvW52ppck5KzIae32841k0N5gWTl4RkM4OaEvAv2SVcTq+M+sDrYAfB/g9ml1p4o - 1Ae5Ifug4S4qxm5d7HnalmTVJvMCuKzk4iq5JuDzazLJlthlTIupIWWtfCk5hXze/tEEDZYUdSVt+f+z - GtgB8L+AbctvyUiVCuShuZ6kHoY7mBJsYz9WDrx1B11vVJ0WzBip5Cqwn28lHWCNbbXEO81BCTrTaqqh - QYXWrgsF+bywzwkapAQLOq529PwdYrBEEGxdzYWKI7Bz6c+6utDEUvKE8miTI+p8Q27Y6CfLrHjj013X - BDmCTi2xNJaJypsTcgo7jNk6Bgz8qUcrO3zAGZdvXAwKztE9NEIMyNFVx9bRy1cvSUrJZchV8+W4Ntfk - mmv8NxbcbNDxdnF9PrjyS5Q95dhuKpaSU8i/CBtF0PYmbnbosTl2+GADMMKOpa3mVvIAKH6p6zgrQ66c - /dZ9MowlBN40KXl1czlpaKtRqjkFvh1gb2ivIc6J2xnYzQX53NCR6MbfCc/3nt7jVB0gx+kwTIRdI+QG - zFzHUVCmbF0cCSWsHZdaZcgtHHIEN7EkjuyKW0tm+n9K+tg+Rh7f8AvGInPgO2apO96XGkblI3L8AfTJ - TJsp22iDinpZq3oxDM2T04CbeuCNKri6kiPk1BaHT7gE04vf6TGwA+B/BtuR13j6tLkhP14aRS5duSBD - bsGQF9Zmky0xy8hbO/9PCTYFHI/DXd/SCjkb+FOwbsdovL7adSEgR9jnhI6ASPzM4tYrrf+2eNgV3WjL - 2q82hUPw7adu45/EUvK0nSS9+hQDuHTW5MZMarXewFt6RSKZGzSKPLXx1xoBp7AfK4xUgs4GW/V2Cyh8 - C8mtToNa+dlMmymaGEpOIZ8d8hlB2xm/Osjiu93gAwzGdXl4ge835oLcPW0XMxtdhrxrFrumaa1SXZOX - NRSRRaETyBNf/VIn4Aj6OK/3OUOOoKOVNRSSDTHzzQI5gg7Kfg8aYGZjY5dFKju88SdwXX7q7JEyc0Hu - kbab6TiTIbc8yFGBXU7tIC9t+6NewKma45od1+b6lJxC3n4OYAerbCwhG48sVMIupLtOlZweZ4UMx463 - c+XtRb0sDnTsxQXbdPZ8Say5IMcKubLmIhly1q4qZlVyHYUw6ik0TIWNBXVmr7313Z7kM8goyCnsVRCt - x7FVYkOOoM8M/pSsPzIvAeNZFgU7vOFJ13741ick1/2WsTuamhJdRyUvbzkjQ26BkEfnhZFeNn8xCHK8 - CCSBmhuq5BRyeqxprgRlX6SEnY/ouvqanK3kFHIEHc0lZcdGi+l0UzSrOMWVHaw3B+TujLteIENugZDb - x2/UG2zTpOyo5qZC3gYuPNrZplJmzc4H5BhZR9PkrqtDjqDPDRv5bU5DSl/Jq7rCZd8KxfsnzAP5LlLU - mCNDbmGQt5xrIgtCxxqs4uy1uWbQOwNu6mtydSWnkNMjBgDXHp7LtJmyjTaocMmTGwr5jOBhBA2aX9Kx - H0TSsMMbHHv99jXvkFy3LpddxBRafn2GDLmFQd7UUU+m+H5sNOQTtaq5cZBT2Ivr8nFmuxJ0MSCfETSU - oDkl22zA1LQkYYc39hSY47HyQ9VKNRcLctjTTM6TsyPreNuMZa0cA291rVVklMe7RkOOio6R9u5qbhrk - WD2HlludTpaET2TaTBlTdKHpqngzVskp5HgEF/5KcXOm9PZ2A8AfAFtffaEsxhyQx0PFm5xCk0gKjSPk - De21ZJS7aZBrVnN+IKewJ5fFw3p9jGiQI+jTg4bgDHvscvu9pFQdC2Nu/XTLDfq6bzCgi6jkMKYHylrP - yxVvUihr5Qh5y7lGMtn3I5OUXLOa8ws5hf1QTqAK6LQLjV27zoeSU8gR9GmBn/wMHZZzJQO6opbdLqk6 - 9ozYkOPACNyhVC5rpWoufXe9FVziucGjTIa8u5oLAzmF3QcGWKDLLhLkCDq+Vlvd1TppDKoA0KdcvHYu - yD/b6b6YSo47pTafr5chtyAlx7bSTdGLTYa8u5oLCznC3tLeRHYeW8OALrCSM5BT2xy32MXsgTlFmatj - TOn+JjEhx/p1WvUmjfFPVtygwtFdR8gDT7tyqlnXVwWnqubCQ86oekczqW6uYCLxFHQB3HUVyKcGDsaU - 24348kNvms2FxyJ8sOVMAE7ENbkbRNjTqhJkJbcwJT9VEkue3/w7ntVcPMgR9FawnKrTkHIbzRTCGFIM - Q/Pk7Oi62pq8G+QI+pSAj3EM1lGsUTEL7PDCb967f885LN/7GwRdjPFPCHlMURhvo59Mn9YqK7m2HVTY - 018qGovJ27v+zQvkWAPfmU4TD3IEnG1HCg6IBjmCDsD/5JG5Z5TooCv6zDfkNacniQl5QJYzOfd1G2+g - mzatVYacC+QI5QTvD3mBHF36Y4VRZoW8taMJoG9iRlKxS1uxpFVTWaspSo6QU1scPj4XuHtYVNjhBXvf - vXfXOTTP47pYSo7r8qq2UhlyxmWXfnSdKvreE1t4g3y469uSgBxBr2upZtbrCLvQkE/2/4igOSRtmiwa - 6NhdA7YxpzE1VSzI0WVPOXtchtzCIE8tTyBPb3yQN9Ajc4OMql3vqmXvrHjTa2queqfb3qnkbMuqTAEX - vhN02oFGj3wpOYV8kv8gMv/AmELRimjghfreuXfHJSjH7SYbdEx3oWF7KdtMGeSIgKPtz/Mm6GbzEWGX - 3XUjN1cwILqOat7YXkfet3+GN8g/3teLAdTQBhWhIKfAB2W4iQI5go5mn/jVTMFVXaHmWzIbkk6LBTm2 - ndZ1VMmQW5C7jqBvOLyAN8hxbR6W4SUs5KDaNLKuGnzrruRsVW9srSNrYO6ckEpOIcfjF/s/LwUO/yAo - 7Iq1uVNQtuv3FHQhlRzVPLnymAy5hUGeUnbcqL5ybfnz9x2eJa3QysqouWL8k75WU4OU3EjIKfCZlcmw - Vh/OtJkypuhCo0csaVWUtWpNobEDb2x3nQ35RL+BBM3h5Abh1uqKvPmawpasBLEghwsKuXD5vMmgy+66 - OO46Kjn++Ac5vsSrmvunOkkWcgq7Z5KtKJBP8PuQLNw/DnvWfyuIqsMTvwC2d3+B92UEXWgld03dQUqb - C2XIWWqucVIr/P38RW1mwq6mBq7JaZR9V9waXiF/Z/d/SHNHoySVXOnCQ3lsdVMFADhWRc35VnKEXGE/ - e2TafyQU6AurLpQeFgvyKNhRxdTgm6zk4ik5gp5dlUae2fQQr6DvO7FV8pC3AuhYC49ZAaHcdRbkDOxL - D02OxvZwXmGHJ3wU1TyqOLhFDCXHtXnDuRqTQJchFxfyNlg/fwZ5bn116ob8HYdE1rZUaQRdffyTmGty - tpJTyBH0pvZ6siZqDrMe53NNrg75BN8BEIEfePtQQeBrfIM+8dKN8/5iQI4ue0J5jAy5wmW3BHcd1Rxn - sBsCMZf7bolZajGQI+hoKaXHBYccQUeD4RTY2cbPxg/wRL8Ds02sis0XKk+OCo6Ao+E8dtwE0Vi3XVZy - cZUcIT9Tn0de3PJ7XkF/bvNvSUVDSTfQpajkFPKW9kaAvZHsjFvNS3Rdk5JTyPEIXkMLsPk3XlQdnqgf - NK84wt5p3wtRDMOG3CVlO0k7e0KGHANs2syAwNu5i+2EkxkZeKMBuFmBw3mFHNX+y/DpFgk5gp4LHW7T - OqfEYEMKY+z0Gd7Wl0LTB/l43w8I2p6T66fxBfrK0vb8WDEg907fw0yMMUbNZSVXVXJOgOOFwETI4woP - 8Q7507CRYm5VugrolqDkVNHxaHd8veCQj/N5n0CzywkQ44dMgh2e4DEwh8iiwGa+y1rVlRzVHCe5ypBr - UXMJKjmOheI7Z45qjh4CuyDG0iBH0POrMxlFF0rJEXI0cOFvp1TF/s9U0Mddufm1F6zNf6ag81G7rgly - n3QHKI7pMBh0WcnNo+Totrud2sW7miPoKaXxStAtEXKq7PbHv1IBnS93nUJOjxuOfLHLaNAxRwe2PbXm - RIbQkDNqXmW4msuQmw/ys81l5BWbv/IOOo6ApmpuyZAj7AU1Wcr1uVCQj/V5j8wMGlYBrP7JKNjhgS+D - 2UPP+VVTNjykHWj0SKPrCDc1j9O2Bg+UkCE3H+So5l8enME75Kjm4Zl+DOiWDnlXBH4Vb4E3dSVHyMd4 - 9ydjfPr/7Jq+e6CxoE9uu9oYLDTkCPup8qMGuewy5OaFPKMiEfrMH+Ad9H52TzC18j0FcoQ9tewEAzq7 - OQVv0wYVrtF1rZAj6GDLI6d6G5xThwc8CLYDcud5Qq3J2YrecqGBM+gy5OaFvANGQ33u3pd3yFHNPZLs - ehTkVNVXR85SAZ1vyBF0CPo1ALOG7a8OD3gF3fbgHLdvEXQsYmEbutpo2CvONjcY98SYYmCELncdQXdO - sSExZ/bLkLNz5hKMrisHPQLkEdn+gkD+6va/kvrWGi2gc5sKY0w/ebfJMVDdxi5rVS+GYafQuNxubmsg - cQWHlKALAflo734EzTFx62CD3HeAfGrz5boQoSFH0KvayjiBLiu5+ZUcJ7x8uPcFQUDfDOWuml12y4Yc - QW9sqyPzw8bw7q6jklPIP/fqS5ZGTPLj7L7DHXEmnM3JqiN5Qio5Qh6U7SZDTtVc4kqOLjv2hXOpUTf0 - PjhXrqS+QAPolg85go7mm+rIgG7MmhyDbsrAm2JNrg45gg7PjyWxf+Sk6nDHZ8D2BOe6XRXKXUfInZK3 - kayaZL2gy0pufiVHyJuhM6u37X8FAX1+yJgeDTmCXlybhx1nqqArmlNo/Tota2UH3rhCjqCjOZ7c9B5X - 0Id+ff2Cl9CQY5pNX/OKDLk0IEfQsS/cUKXmen/s+FJ123uOklNFx+PGmEVdoAsA+Sivd8niA+PtuIK+ - Iqsh+RQFnc/AG1VyVPPDhaFa1dw0wC/AxNiet7mCWLXr7MAbAo5WBz3hr+34uyCgj4QCGWuAHEGPyg3p - BF0gyBH0acFDszFrphN2rK4Bs4s6E1SPoAsFOYJeWJ+tEXQZciPbTHloUNEEOYK+4+hKQSBHxT8ABTJS - GBrBR3Sdrd6ablc3lTM5dTbofLjrCDhjnn3Qfb+T25Gqe6tlgPztH+/96OCb6fCjkJC7pe7S2KVm3ZCb - MN9NQMgrG0vIi1v/IAjo7+x+lLQoC2R6pruuDvzWI8uVoPMNOYKOtipq1ix9ij6+6kJ5uJCQo5pHF3V3 - 22XIpafkqObrIucJAjmqud2xDQo1tw7IEfrovDAGdKEgR9Bhl9cwfaCvSa4+ls5XMQx7TY6Ao+1L3kry - 6jNU3HYZcmlCXgFqztdWx+qBOZwgUw4TZPRuj6TYm1yqxTD63HX1v59tLGPW6Qi6KdF1trtOlRyPIz17 - Q5ptEDa5aN5mGf7wBxwZFVHo38hHxZs2yBH2tgvNStBlyKUJOar5puhFgqn5gpCxVgc5hX71oVmCQY6g - g93Nbk/6j0ZVx261+/fv23lnOtwytaxVG+So5iE57jLkTHGMNNfkNNJe3Vwu2Noc1T2xJE4/6CbuoKJt - WqsYgTddSu+Xuk8JuqF5cl1KjpCP8HiHsZWRMydoA/3T1m8a/YSEHEFPrIhlQJeVXLpKjrBvP/qlYGo+ - 1OUNK4W8Hqrk6snp8lMM6EJBjqB/ETLSWRvoC7Mbk09Q0I1pUNGl5Ai5Y9IWcralVIZcg5qbM09OVZyd - N395258FA903xVE36D1SyTshR8ONGXGjBy5lrbTijauSU0WfGvBxJpazq8AO//ArrG+PKwsvRtCFgtw1 - ZQe5+DUWs2BRi7FmycUw0nbXKei2cesFgxy71JpgS2WtQbgeDjmC3tRaz3hMzNAIHbXrxkL+mcfb5HPP - vpe71b3DP/wDbHdYvle7UJCjmh/I9TEBcEuveLMMyOvbasirAlXB4dp8c/Riq4ccQQ9J9xQMcgR9uPtb - JDTL43l1Re+FoENb6h1D+8m5uOsI+d6kzcz6XFbyLuCl5K6jmreDOQpY045jnItqsjWDbiVKjpCjZZQn - KUFnt5pSFcejoe46Ak4hR9CXR05TDcgB5B9dvnnRTUjIEfTSpkIjQZfddW3z15VlqzDHTedtRd26+nqc - /j9CjruW4u6lXJtRDL3fVL/BMuQK0Btaaskkv0Eq/eR8Qo6gzw0buVNd0aeeacuNMmQyjCFKjpA7Jm8h - HRdbjQBdhlwMyBF0/1RnwSDHi8Kh7MDuoFuZklNFx+PaqC8Y0NmA86HkCDna9MAh0eqgr4aKuBQ26Jqm - tdLxT4ZCjqAHZDrLkHPdIknA2nV1RUfAqX2072XBQH971/9BT3uDKuhWDDmC7pm8RzDIP3V7k4zz/aBU - WSGnmCiz42jZgTNcZrypQ45pM7bhepyuyRFwajFFYQaCLiu5WEqOoAuxtRLbte8cFcWqabdyyBH0I/nh - KqCbuianSo6Qo4306H0JO1IZVYcbfwPbub/Ap1HTDip0WisCbizkexM3kVTYPJF7IE6GXEzIEXRcPxu6 - 5uZ6/ye/+hVsUZTRBboMOROQyz+boQSdb8iHub0BsL9xv6wjt7NlVTE6aqd/ltMVQ9x1rkqOkKMVN+Zz - BN0CIDdgvhuWukoxus522bPPphKEkSu4ht5vjGd/GXJFEI69Rm9ormWaW4SAHEFHs01Y25+C/jYqOkTc - 7yHo7Hnr2tbkhkLukLiRtJxv5AC6DLnYSo7AL90/WTDI8aIQkObaCbqs5IySs23pgUnKoRHqXWjs2nVa - 8aaeQlN31yng9Lj04OTObZUB8sFXbnztJCTkrjDnXb/bLkNuDsixFRVbRg1Vaa73x6EVDVCEI0OuCjiF - ffexdcywCCEgH+r6OpkdMmIrBX187aXKQKGUHNU8JMdDD+gy5OaAHNV8Z+xqwSDHi8HC0HEy5Brcdgq6 - f5qTYJAj6DOCh/lR0OfmN6cfZoNuauAN1+QIODWcKKNd0WXIzQU5Fshg2ourOhtzv+jcMAb01m4GO6LA - GCnOJsAOKoYOjei6f1eDCq1dV3fJufw/NrfEwPmhaq7oJVe2mhrrriPgaENcXyOTAj46jr0s6LovS6o5 - lshXdF0dcoT9ZPkRLaDLkJsL8vbzLTCY0UdQyN/c+S+C2xbJkHd32xFytLTSkwzoQkCOoI/16n8GGH8I - QV8XW3owl8/AG1vN7U99RTKrkzSALkNuTsgRdIyGG6PSXB+zLmKuDLkGt51CjsfSukLBIEfQR3j2bgHG - f4egb4s6E1zKt7uOsCPkaAX1mWqgy5CbG3JMqT3x1S8FBT2x5Jga6Aa46ujW91B3nQ16fXM1Azp10/lw - 1xFwapBL/xbHxCHo2w/k+9TQ4Y3sIY5cKt5onpyt4mzI95zaQMpUmllkyM0NOar56kOzBYW8v/3TMuRq - as4GnLnd0mnjYSosG3RDU2jsNTkb8iEur8Ja/dX733333V8QdJugbJc2NujG5MnV3XVUcoQcraatUqHo - MuRSgLy+rZr8b+ufBAV9S/QyFuiykmuDHEGfHTxcCTqfkCPon7i8QlyTdj7HuO4+GQ5XhFByCnpnsYwM - uRQgRzX3TNojKOS4hk8uiVeALkOuC3IEfcmBiQzoQkCOoK+JmtOXAR3GR31PZ67z5a5TyPF44esOBvSL - 6gZjpXC0lHY7B3/rsgtwW6Ndgn/XaR3w9y47T7cqZh97WFlrV4lrC3SnsexcC/l4Xy9BQe+z+zEZcoXb - rg9yBH1d5FzBIEfQ5+8fM5wB3S1t522+3XUKut3J9TLkMBRCk5rzOTSCXbuuC/KU0nhBIUc1X8tE22Ul - 5wI5A3rUPJXJMPrKWnWtyam7joBTmxMyciQDOqTW7gqh5Ag5rt1lJe8Oujkgbwc1/zJ8uuCgxxdGGQa6 - FUTXaeBN03HbkWXMoAi20VZT9dp1QyEf7NyLTAsZNhVB3yoU5Ag69qOrgC6767pHPrFHQnEY/8RVyRHy - htYaIuQYZ1Tz13f8kxkwwVnRrRxyBH+LGuh8Qo6gTwkYPF0FdG1DI7ik0NhrcgQczTZhHXFM3NIFugy5 - 2SBH0APTXARX86UHJsuQK6re2Ck0XYq+O26tUs35hvxj55fJtKDBC35x88cbu+nmCpomw5gCOYLumrKz - E3QzQK4x6IYBOCsKvCHg1D736Cc46IdzQ7mBLiu5Mo9uF7+eAV0IyBH0Kb6Dlv7ixu1rtkIoOUKuBF2G - 3KxKjqAXVGcKXgmHy4Kmtjr9oMuQKyFHpUfQhYIcQZ/k/+GSX9y7/6ONEEpOQXdK2iZ6Cs2qlZyl4Gw1 - x5ltXGvUjb3fvODRMuSsijdd7jr7b7bx6xjQ+Qi8Idhs+8jpf52gQzBuC3uII3NbMf5JV1mrtjU5BRyP - uxPWMs8lZp5chrzLVaegt0CqS+h2VLw47M/w1g26rOQqSt4Jey3ZenS5YJAj6DQYtxkU/b4Sdh4hR9Dt - T0F6TaPrzn8xjAx5d8jbQOGPwrRRY1Wa6+Ne2PIwqWup0g66DLlGyBF09LbYam5MCk2TkiPkKqA7pdjc - 5lvJEfJdJ9Yw1h10GXJlHp2PFJoWdx0hR8MpL1yBNfZ+0/2HypArmlS4uey1jJrjji3ro+YrQecbcgR9 - WsAnn6PrvpkBnWclp5B3B12GXEzIG9pqCc5tMxZgro/zT3XSDLqs5FqVHCFHWxM5hwFdCMgHOb1EpgcP - G8GADhNgv9U0GYb2k7PX43ibnSdXX5OzlZzC3nahWaHqMuRiQo5qHnTaXXDIn974IKlqKusOugy5XsgR - 9OXhUwyCHItg0HS566jkCDnagvAxHyDom7wzHM7xEXjTBPnOE6tJXXuVSnMKNqrw0aAir8k1r8mpy47H - Kb4fCw76WM/3Zcg5ue1d7jpVczzOChqunPGm3k+uXrtuKOQD971IbOKXvsiAHpDlXK+rn5zdoEIr3rgo - OUKOVt50hvcuNBly/ZCXN5SQpzY+IDjouNWySsmrrOSclJzCPt5ngHIijBJ06CXnA3IEPaEk6p8I+ldh - +V5lFHS+3HUK+c7jq0hhfZYSdOOUXHubaWVzKcmvySSpFQnkZMkRklQSRzIrk0lhbQ6paakkLecaoRKu - a09y9m2p76CisQtNT+CNrebOJ3cIDjmu4XPOnu4CXYbcIMgRdhj3pAo6j5CD634LGP89gr4isjAwV338 - E9c8uTZ3nQEdIEfD4ZDGu+vaIT9+Joq8xCHQ9Nr2v5Ohzq+RWYHDyVeHFxL3xN3MBncVTSX6t0vS0mJK - 205F7UIzAHIE/jO3twUHva/d4zLkOt12ze46VfOK+mLBIEc1h1bVDmD8twj6gtiy8BQhlJyCfqr8qJFr - cv0DI1DNP3I0frvf13f+k0zyHUR2x60jx4ujSfO5hi74zQp594ER7Eo3eput4OzbJfX5gu6nRqPxqw7O - 7ARdVnKDlRz3XsuuSOsCnUclR8jRYClQCYw/iKBPS6mJj2bPeDN1TU4Bp8fDhSFGTIbRDzmzTocGFXTP - lx+Yyot6PbvpN2S81wdkX8JWWBJkaBwYgWourJKbBjnuc+acYMPL+dCXXjucGyJDrlHRdSs5Qo52LP9Q - J+gCQP7hvhdwRFUKMP5LBH1kUWtOoKkpNPaanA36juMrSVCWW3fQTR39pKELLSjdjby45fe8/sAHOr5I - 9sRvIMV1eUropQ45gj7S/V1ez4Mm4J/f/DvIA9cwoLd0s0Zm8wZDzfjdUxoI7prCNi67pWi6D9fJMNoL - Y7hBjqAHpbkLBjmC/rnXuyF0S6YBzd80OPK5JqegI+RoLsnbVUEXAHLaeppZmUTe2fUf3n/kuK3w5x59 - SXi2H2kFkPTCblTFm+lKjpCX1RdCtP3XvJ8Dddgneg/kDXLTALdMyBF0h+ObeIuuU3cdAWfM8Xkyxqff - Tgr66z/eu73ZPnHDz8YUw+hScoR8e/yXDOwdF1o7YRcQchpRL28oggGIxq/b9bmrfWwfI3tPbCGN7XWa - gTcj5Ai666mdgkOO58glYQcvSm6tkCPoKw/OUM52wxlvxuTJKeB4ZEOOoE/wGzCPgv4kuO8boAz2mqEV - b1wgR9DRKpqLRYGcwt7QXkMm+gwS9Af/xs5HiNupXUyMwLSKN36UnNmDHEzorZbohbCgKksNdLFddctV - 8s41eg0Z5/2+EnS+IUfQ54WO+piC/lcE3St9T4sxxTDqgTfqrlPA6TH97CkdoHMPvGmeDqM5T94GY46/ - PCj8MMS+e54gOFmlw8xKjpCXNxSTp0Vw2wc4PCdDrgzCcV+T0yAcQl5SUyAo5Ai680mbJynov8aNFkNy - 3UvY1W60n5xLnlx9Ta4OuU38ChJTGKYFdGEgZxfDYOpMnzvOx9+/CP6cVDSWaATekCGO6mk0bSk0quDs - o2eSnSifde2hL1igy0rOLmlVua2IrncB3qnkaMcLDjOgC6HkCDm48TeYYhn6H+bSDxeHpBhS1spVyRFy - NL/0fRpAFx5yCrwjpMuE3lQQLxavbf8bwT3B2eouFuQI/ASvAaKAfiQvXAG6DLkxkCPofsn7BIN8gONz - ZLBLrxomh84CfXRy9bFICjqqOF9KjpBvO7aceT7Me3cF48SDnMLunmQrCuwY8d4Vu7ZzKCO4892N3zU5 - VfSzTaWi1La/tPWPzN7ehqbO8P7WHHijSk6PGw8vMqgLjR100xR4Y1QcDCFHG+LyeoIScrwB1L9XdaHM - lW93nUKOoKNVNpcoQBcfcgq7X5qTKKknVHccxoD94KqgCwM5wu6V7CCKmk/1+0SGXNFLrlHNdbjrbNgn - QkUm11ZTQyH/YO+zZLjHW47qoL8AKbaNAPp9vpWcQr712DKSXBGvsgca7odmji604HR38tQm4bu6EPbP - 3N4hVc3lCtiFgxxBnyRwloHGMTxO2RoMuqzknetyaoVV2YJCjqCP8e43Sx30v4Gqr4WtmS6xJ8PgbUNS - aBiEo2tyCjgeEXK0/Tne+jc7FGnuOgO7CNFphOPDvS+Q4vq8bpsdGlK7rinwxv63ariYPLPpIVEUvbAm - xyDQZchVIUfYI7ICuk1rpTPe2EMjjFFyhBxtbujIN9RB/yWA/mVAllMZG3RjIGcDzoZ8S9xSsvfUZiXo - 5lBy9Y0OvVMcRFmzI+zv7H6UZJ9N6YTdwC40fZDj30PSPUSB/AP7Z2XINbntHN11hLwebFfcGiXobMD5 - ghzW6LfKL5V3RdxZAbkpMSVhJynofEOOoKPVw7QZKUBOoXdK2CYKIAj7KzZ/JSeLj2oE3ZAUmibwF4SM - FeVzrIBNGrkG4WQl767kCDnaTJgqg+tzISBHNR/s/HIZiPevVBRdEZD7ML85w9dYd12XklPI8ZhScVwz - 6GbcJmlX7BpRIEHYcSxybMFBFdhNhRybSt7Y8YgonyE8048T6DLk2iEvqsrF1JdgkL+/9xnsiAvsBrkC - 9Odu3r62CUC/zx4awaUYhivkm+OWkMBM1+6gmxFyWrqKqQ4+ima4PMdzm39LoqC9E114UyFv62gmySXH - RHnvGNPAIZD6FF2GXDvkqOah6Z6CQo6gD3d/e6420B8GqV/tkrq9w5BiGEMgR9C3Q4MLus1K910CkFPY - V4hQLksvBDg59QCoo2bQO2vW9RpAjqBvP7pSFNCHu7wlQ07X5wauyanLjse1kV+ogE6ntZoSeEN3HQFH - e8/haahxH/28RtAVqj43NM8zS72fnHah0dJWTZF19cAb211HwBmLXcxYUX1OJ+gSghxhx/bTKb6DRYEG - gcfBjTiOWRV2DoDjRUABeSschzq/Lsp73hqzXCfospLrVnKEvK6xioxw760EXQjIoWgGx0c9oAv0ISnV - x/brctdNhRxBjyncLznIqao3tNeSYS5viAJOJ+y/JgFpzgrYDYe8rK5IlJFR+F7jCiK0gi5Drh9yBD2h - KEZQyFHNP3F95YhWyBWK3uvi9Q6bXSdW/aypC40PyBF0HFtlSBea2NNasTGln92TosIezCg7B9BZSo5q - 7pPsKMr7fGHr76HstVYj6DLk3CBH0G1j1zGgC6HkCDnap+5vrtQH+h9A8lftS956jm93nbrtm2IXEbTS - xkI12KU1kjmvOp1pUOESXOPjPthauj/TWzfsapAj6HOCRoryHid6D7JeyDWux7u60NRr2NnrcfbtuqYq - Mtb7PUEhR9DnBI58QSfoClWfFl7om8JuNeVLySnkeIwuCGWBLi3IaefZKch5Y9CMD5C5PAe+1sEsf82w - a4C8qa2B9LL5iyjvb+/xzd1Atwol5wly6rYLqeQI+UDHF2pBrH/NBfT3ilqz3fgKvKkrOYXdLmE9M1ZZ - 6psrBKa5iAISOxqP2xyruPEaIEc1jy+MEu29pZWdVAFdhpy7u05VfcfRVYya8xldp+46HvvbPwXr81e9 - 9EKuUPRH7927sxry6beFUHIEfePRhYwV1GVqBF3sNbmuyTDYebYxWrwcOy2qSSg+0gm7FshxlrpYabU3 - YWQWO3cuQ2445FUNFTB6ubegkCPoI73eHckV9F+B9C/ySrcvVW8zNSSFpk3JKeRfHV1AgrB4Rk3VpQY5 - gt65WaF4aTc6wAJVFEFH9VY12DABQB/h1lsURf8i6HMl6DLkhkNe31RDwjN8BYe8v/3TNw/ku/2JE+gK - VR+WUnMs2NBiGAo3F8gR9E0QgcdJqhR2KUJOe8nr22rIoL0vigIWdePf3vV/pLAmVyPktS1nRetW801x - ZECXITcOcgR9Yeh4FdDVp7WqD42gHWj0yC6GUXfXUcn72T+JtfMxnCFXgP7s93durNkev/JHdj85tpqy - C2HwtnoxDFfIEXS0+OIoBnQpQ05hPwObOLy24x+iwj4QWlyrmsoVsHcqOVpUTrBo76MILjYy5MZDnlGe - pLI2FwJyBH2EZ+/JhoKOAyMXwmTYEr7ddQo4HjccmQ+bMK4m7RdauIEuwl5omkc/4TiozqERxwojRRnX - xI7Sj4MtoppgFxL21sQbIueLAvr79s/IkLMGRtBUmrYUmvLfQcVRydG2Ri9TqrlQkPd3ePq6QW47q20V - quTiA+nQCL6VHCFHWx8zj+lo06voEoCcwr4P9gPnki7j8z64txwb9MH7eonyHpYdmGIi6BawTRKPKTQG - dBbkRdW5zKRXLjPejHHXUcnRYJJspEFqzgL96Vt3vl8FabY7QkKOoDue2qIbdAlBTodGzAseLQpo7IvF - bhg4ibBXQuUebhHF54VE23MFprqaALp1Q47A444+QkOOoH/m2WecsaCj+77AJ8MhX1eDiqFrcraSI+TU - cqpPa4ZdgpAj7PWt1eQjAbd90gQejqvGfnAcQyQG5Ph6JbX5RoIuQ362oYyM9Hin2zZJfATeqJLjEYJz - l8PKw7pPk+FKPoA+MK8xzZWCbmrgTRvk62K+IO4pu7uDLlHIqaoXVmeRV7f/VRToKNg4anlmwKeivOYH - sBuLcUE4GXJUc68ke8Ehx12CBru86s2VaW096o/cJ/eX7UpY842QkCPoa6PnkoLazC7YJQ45HRoRCQMk - xNgYQgwFV3+N5QemGQG6DDlCXllfCltX91HuakpVnD133ZQ1OSo5Qo423mdAX5NAV6TaJoUX+MSz+8n5 - ctcRcAo5gu6StL0TdAuBnPaRb45ZKorCig07dtQZpugy5DQQ5564WxTIYQhkCafadn1XAniSXu3fNm/a - ErvkPrsght2gwi5rZafPaAqNRtfZa3J1yBF0tJzqNJ2g692XHC4SzH10bHioL4VGo+tcp7U2QzHJKPe+ - PQp29FJKawsNAF2GnEJeXldMPnN/m9k1RUglf3fP42Soy2u6W1L1Ac6Kvj8EsM93TtleIZSSU8jXRM8h - jolbGFA1qTonyI3a0bQrT24o5FTVS+sLyOs7/tljYMdZ9NzVXDqQG7YPmuGtppry5Ox0Wn1TNXE+sV0U - yPvbP/H9VwnL/smVZb33A9AHpdYe90LQhVJyhJyxw7PJ6YqT3UCXMuS00yy2MEK0TSGEduO/DJ/BEXQZ - 8i7Qq8kZyJuDygqu5KjmA51eDNcLryF3AND/cff+3aUw2PEbNujsBhX1ijdD3HU25Ag6lN4y89uoqlsC - 5BT2ndCKKDSEYjw/TirVr+gy5GzIUc03Ry8RBXIEfaRnn4GGcMzpvgD7iIhC/xgKulCQI+hoMQVhDOiW - BDnC3tzeQEaK1FUmFPBYjFNWd0YP6DLk6pCnlBzvLI5R29WUr+g6wk3t/b3PntG4QQMnmnXcCZ70sW9u - XVkFOfU7QkO++vAssiFmPqlprdQPupnW5LrmuxXWZJGXt/3ZYpX9I8f/yZArdlThsiZHJUf7AqolxYAc - Yf/Y9ZUppjKt9fEA+yT/rH0pCLqp0XV1d50qOUKOtipqJglId9YNugQhpxcAsfZCE0LV10TM0QG6FJS8 - ljQavG2xMIE3CvnBDH/RIIe21BbfM74PCgn6882X6zZuPLLwPp9rck2QI+irAPhcKI3V6L5LGHI6GQZ7 - kIUAUejnDEv31gK6DLm6u46g48jtzz3fZUCHvDZjQrjrjNtu9xguD1YJBrmieAanz0x1TdlRSEHXVdbK - LoZhp9BodJ0Cjke2kjOQKwxn17V0NKrCbgGQ42SY6uazpP+epywKdiZ/Dj/c7oE4GXJNkCPoW6ANVXDI - AXCE/F37x68sOzCV+xQZY68IAPpLVedLt4H7fl9oyFdGzSBo4Tm+XaBbCOR09FMi7Ism5iRZU9V+gMPz - MuRqrabqeXLqruPxeEE0UwEnqJIrIO9j919Q8xe2GMuuQY/DSB/YZNe0nXmmpNC0uusKJaeQfxk5naw8 - PIPk12TorHbDSji+K966tkrisLGCjkGOtsfWW4yqd+8/l5Vcm5JXQAXcOO8PRIMc6toviaLmrGq552sv - VW6CyPh9LmWtXAJvbHcdIUfA2bYldhkzX05baatUIcf+cUy5jfboZxGw+6c4sxRdhlwb5KjmOOVHLCVn - 1NzxhXUGqbKpdwZF/yXYBLe0XVkUdG2163xAviJyGkHzTnPQCLqUIadTYc7U5pJXRNpswRT3vaA6WwG6 - DLkuyHEugJiQg5qfWxM23fiec2OhB9Cfbrhcs+GrIwvuigH58kNTCdrJkiMqsFsC5BR2rDYzBUKhH/uu - 7WMy5KwxUJ2gd+bI2ZZdngZlrq8LF11nrclRydEGOb241FhWTX4cwD7SL9vpOB/RdU3uOlVyCjkeMeV2 - pi6Hgd2SIKewi7VXmjEXhfnBYwB0Wcl1KflZ6DOf6jdYVMj72T9RKWjeXN+VAGvgr9/5dgk0u3xL02d4 - 5NNdZ0OOt5cdmkI2H11C6mCUk2bQO6e1GtuFxmlHUz07qLCHOKrfrmgoJm/seESSyu5+arcK6E2t9cQY - a2ytg51XWdYCtzmb9Iph2Gq+NnKuqJCjmg91f22IPhYF/zvA/kF0SWigMXlydmSdHXjTpOQUcgR9WcRk - 4pS4jdmySBV2aUNOoRdr5puhqo7zx6miGwM4PqYnQ+6VaC865P0dnjqGMTHBQdb3AvAmHv7pp59m7jy+ - qtkQJTcFcgQdbX+WNwt0y4Ccwr4wZJykVP217f+QIdeyJkdFj8s7RAbte0mYijcNa3JU8t52/70z2q/3 - 8/oYFO3vAPtr+c3pO0DV77Or3bRVvPEBOYK+NGISiSs6pOqqo9sOU1o1WVdevIXZT42vPLkuV13j39qb - yNnGMvL27v9IBvbpfkMZ0GUl7x58y6pIZYJvgpS1aoPc9lGstrMTDWIuL6Qoohntcdr2lL6yVj4hR9CX - RUwhWWdTJLsmVwEdAG8Fa1HY4ZxQyQyWdIjfJEOuIcJeXJ1HxkNRDB+Qs9tMad06lrXSyDo99gbIIZ1W - YxM//2Eu/Il6H4D9kWs/fLtg09HFl8VQcoR8ycGJjK2Earpi2BdN0kquBjmFHXdgMXQtLcT9jxdGGwV6 - T16T4yTX2YHDRYe8j92jP41wf3OQqAAb8mIA+7tJVXGOq6Nn/UxbTWnFG99KTiGnRyzcqWoq6wa7JNx1 - LZDjDqXVTRXknV2PmhX25zf/jmDftaFue0+GvLbhLFkBF2GxlRzV/H2HZ/wlEYDTBj+8uQfBxu9L3pql - XtLKNU+uHl2ngTe6JmcrOYV88cEJBG3TkcWktrlSCbvUIUfQ0cwdhR/h1keGnOW21zVWka+iFpgF8j52 - j52bGzX+b4YIrFnuC6D/9+L184uh4eVbhF1oJaeQLwofT9C2xi6HHHuVWrDNTIE3HUpOIadHcxbSbIxa - aBDoPVnJEXKbIyvMAvk7dv/5ebj7GyPNAq4xLwqw9ztZEb0Pus5+FkPJKeT0uCN+FWlordEAu2ldaAZF - 1w2AHGEvrSswWy18RGYAZ9B7NOSg6rZx60yCnO6eYkjgDd31d2z/Q953fCZY0i67+sUA3uwDYJ+DC5+m - 3oXGpRjGEHddHfKFB8YRNNvj60hDGxt26UJOVd072UH0tXrnIMgiTqD3dMj3Ht9sNsjBZW+aEj78r8YI - q1kfg+WxN25/NxuaXi5Q2MWCnMK+I26lwo2XPuQIO051GeP5nqiw40aKXIJwPRpycNfNqeSg5veGub0x - wKzAmvLiAHuv3Ma0LeC+3xMb8gUHxhK0LUeXkprmCqZcVqfB6Ccc/0Qnw3QdIfcNPeWczEB3XX2djv+f - XZlGMAouRApN03MuCZukF/SeDvnWmGVmU3J02T/Y+9wuUzgz+2MVfeuf+GY6HkLQNTWo0Np1Ptx1quQU - 8vn7xxC0r2IWkLL6Iu2gSwRyCr7bqV3MoAox7ECGr07QezLkVfXlBCfempJCM2VNjpBDZ1quTZTNQ2aH - 1dQ3ALD/7ify07ht8csr2aAzgCsaVISEnML+5aHpJLfqdHfYJQY5deH175LSII9kZs9e79ZHjr3kmvvJ - sXa9pKaAzA0eZVbIoRLu2898Xn/OVMYk83iA/Z8t3zYuWBs956opeXJtgTdtSk4hn7d/NEFbBEG6UyVH - u2CXIdeq5j1ZyTPLU8gEnwFmhby33X9++sjxpc8lAylfbwRgfzGzPmnLisip98RUcgr5vLDPCWMAfFCG - O1OoIoU1OXudbpqKo8LLQyN0DY1AJY/KDjG5QcVUd51JpTk8s5svtiT3PJhfD8vz9GO76lwq3kxVciXk - Cti/CBtFdh1bA3PXK9SCbxyDbhic4yHwJkOOu6cIu4MKHRpR23iWYOMOzl8355ocIe+75/FTNjY2v5Ic - oHy9IUV+fZjdyfWnKexY0qqrrFUIyBH0uaEjycrImSSvKkMBuwx5T3XXcT2++MBEk4dG8KHksC5vGu3R - ++98MSXZ58FBFbd+vDl2c9ySs+aEHEFHw3X8odzAToXmkkaTlVzDWCjpjn86AV15oz37GQx5P/snISLe - ZTxBfvUjt5f/J1k4+X5jAPtfLlw/N31tzNx29S409dp1qug04MY18KbJXadKTiHH45zQEYyhK1/ZVKob - dhlyi4G8hrrqil1UDHHXhYAcylxvD3R60XKLYoy9CADs/6q+WL5oxaFp19W70IR01zVBPjvkM4K2FHrb - MSqvbSoMe2gE7SfXVPTC5d8kGXjjPMCRDnuUppLjRJjZQcONmrsuBOTYrNJ/71NzjWXF4h8HsD+bWnt8 - 07JDk++YS8kp5HicFTKcMZfEHUw1nRJ4a1DyHgA5Btx8kvaSIS6vSQdyLIqxe9LG4mE19QMA7C/HV0Tu - WBIx6a65lJwN+czgTwnakvCJ5PiZw9YRXe8BkJ8uPUXmBI0weldTQZQcI+x2T7hbVEeaqUDrejwOlzx8 - JngPqPo9sdbkmpScQk6PM4KHEdv4daS8/oxyzluny945MMJQk931GkinqRpOttFpeiresIx17/Et5COn - /xkMeX/7pwiaUJD32/NEYI9OoxlzUQDY3ziQ7+O8OHzCfaEDb1whR9BnBA0lX4SOIgeyfEhTW53BcNOL - gQw5/5DH5IaTiT4fMoAbuj+54JDbP35IhlzLlQBgfycgx8VzYfi4n4WKrhsKOYJObUXENJJwJsZg2GXI - +YU8vSyJLN0/UQm41CB/1+7xY/N95z9ojOBZxWMU3W59gnPc3cCFv6/ehaZeu25oCs0UyKcHDSFo0wI/ - IZuPLCUZFYmcgJch5w/ywqpssu3IcmYjBariUoO8r/0Th3tEN5rQVxwF7G8dLPB1WBQ+7h6FWyqQI+jU - bOK+hP7xVK3Ay5DzA/mZmjyyM3Y1GezcSwVwqUHe3/7JEJvTNg8IzUiPen4M0EUVBe0CN/5HUyBnq7im - 6Do78EbX5Gx3na3kbMinBg4maFMCPiZbQOETS+KYtlF5Tc5f7XoWdJltjVneCTgUvrBVXGqQv7f3ac+o - qKhf9ygIxfowmHqLK4vYAm78rW5daKwGFW0Vb2JAjqBTW3loBonOCyUNLTU6esV19ZHTvwnQhWZBKbSE - omiy8uD0zkg6Ai5xyGGoo72cQjPxqgAn8Pm0uhOrIBr/nSFrcrEhn+z/EUGb5D+IaYf1Td1L0OU03H23 - TsgraotJYKormRkwnAzc9yJjUocce8o/2PfcGhlyEyGnD8dZ8UUtWfOh4+0ChR1VXCpKzoYcQWfbppjF - JLbgIKnnpPKmQ25aBxqWtopb1pp4JpZsjl5Chrm+rgTcIiCH2vVBzi9N5+knLj8NC/a/N16umwibQlRb - AuQT/QYStAl+HzI2O3g42XdyG0kujWcaQ7orvfVAjmtvl4QdZKr/YDLI6SUVwC0Bcmg1vfqJ88vS3RvN - 0i8boOx/uP7Dt8M2xi7M1NWcQt12WruuqeLN2MAbe02uTcnVIaewT/AdQNDmhIwgzie3k9SyEwQVmI/J - MFJX8pyKdOJ2cheZGfgps/ZGwPmC/D2HpwnbhCyGwfnrwxzfsJ5WU3NdNAD239y7d++93QlrDrPbTM25 - Jme76vogp7CP9/2AoM0M+pTsPraWxOSFkYr6Er2jlzXNYJci5FUNFSQu/xCxO7aeTAHlRripWSrksMVx - /kiXPv8y12/f6l4XYP8Vzoz3y9y3F9z425YK+Tif94mKAfhLD04mjgnbIHq/nxTX5usFXyqQV9QVk9j8 - COKUYEMW7Z9APnV9k3zs/LIK4Jas5O85PBk4K/jD31odbFL4wAD7o8nVcYsg/XZe6u66upKrQz7W5z2C - Nsa7v4pNhxLctZFfgKtvQyKyA0hGeRKpbapiLgDmgLwOBizmVJ4mkTnBzPID39sUyDZ84vIqAzbb2Cpu - uZA/eud9x+cWSuH3btXvAWD/Y8OVmhGro2YVSnVNbizko71hEwewz736Km2U17vM7emBQ8gKyDVvj11J - PBJtycFMPxJfeJiklZ4kRdXZpKqxXMM0GDowQnN0vaaxkpypziPpcDFJKIohh7ICiGfSHrLj6CqyPHwq - meb/CUTH3wCoX1EaFrOg9UTIe9v9t+3jfS+9a9WASenDA+wP3r179027kxtCZocOv8cOvjFBN0UXmqEV - b3wE3viGHEEf5dlHxUZ69iZoIzzeUTG8IIyH+eUTfT8kMwLhPIDNCx1N5oeOhQvFMDI9YCiZ5DuQjPV+ - D+aq9SVDIcWFNsT1NVUDtR4CxgYcb4sJ+ft7nyFoYgXe+tg9fuIjl17yelxKoLNScI/GlkYsgWaYDoTd - miH/zONtgjbc/S0V+9TtTYIGm/qpmAx559bFMNvth/f2PrNcLoKRIuGs94RTZs991zpwQ8z8k9aq5DLk - TxBj9ieH/HjZh64v9ZL4T1x+eyxl/yXOo/PPcd42J2zkVeqyc2lQsXR3XYbcGMgfvdvP4SnHZW7DfiNT - ZIFnAAN19V9XDl5/ZF7C9OAhP9N+cm1daDLkirW5Fa3JYdeU4sFOvd62wJ+3/JbZZ0DR3/7E/gKfVZBz - 75Ah71ybW/uaHNz07yGwt0HuH+9h1wsA/nfnv2nttzVu2QFw5e+w+8llJbcuJe/n8OSJHrVdcQ9jlZeP - A8A/klF/cszKyOlpUwI//lmG3Hog72f/ROXQfa98KkfUeUFJ+k+iKKF9MiLff8m80M/rEXZjG1RMyZOz - C2HwNpMjNyBPLgfeuAXe+to//s3AfS8s9z3jKw9slD6e/L9DbJC5+ePNXvuSbXZBVd159V5yQxtUuJa1 - qle7yZALUwwDTSjfQ9vrvhmhH/X83Uv5x6PnPSO2v165duFN2xNrXCEyfxWBlyEXpqzVkM0Ojd9c4bEf - P9j3fMCUgEFP9Lxfq/yJTD4DmI5rv9r0jk38Ci8I1n2n7CNXDI+gbrrsrhvXTy485I/dfd/x2bCxwR88 - Z/KPQX6Cnn8GAPg/VV8qf3dT7GI/WL9fZ4BXDI2QIZce5H33PHbvPftnIsf7vC8PhOj5ePL/CQH431ed - L3vDJn65y/SgT84ZA7mmDjRrW5MLpeRQ7HJzgMNzvqP9ej/P/7cvP6PVnQEA/qHrd64/65i0aePMkOGV - OBmGS+BNhvw5IgTksHa/NMDx+e3Twz55xOp+jPIHFv4MAPC/Bvu3R6rt9CUHJx4Dhb+FwGsaGmHNkA9w - fI7Zn5xnyO/D86V/6PTiTJv4+Q8L/23LryCfATgDGKkv7sh/dXPcEluYAlPFngwjQ84f5O/ZP3URdmVx - HO/V/wX5hyefAbOdAUXxzSM+mXtHrYycEQSpuVZrzZPzpeTvOTz1LbjmB4c4vTJK3rDQbD9t+YW1nQGc - dAP2L4/UXaOXRkwOmej/Ybu1BN5MhRz2LvsOpsNGwiSbsb7xNrJrLmNmGWeAQu+f7TJ4zeHZe6cFDckZ - 7dX3Nh0DpW38kyWWtRoFucNT9wc6vlAOI6mcxvv0Hxx8OliesGoZP235XepQehyE8aeaK2XP7zyxagHs - EHtgot+HNSM93rnPnvPW0yGHtXbHEJdXooa7vbVoScyUJ3DZI/9q5DPQY88ApuvA/pZYfaTXV0cXLlp8 - YFwglNwWA/R3LGnGmx4lvz/I6cVacMVDR7i/s3jJwbEv4+fusV+q/MHkM6DvDCjSdn9qulD1+Fdxi8cs - Ch+3G/L1RyBtVwkq/4MUBzmyIR+w99mfBjn9rwFmu8fDQAvbER7vTth96st/4+fS99nlv8tnwKrPgCKa - //CNGzf+sef4+n6wScX82SGf2sNa/yDk7zNGevVu/NTtjVvK0cyCj3964R7Mbm8f6vpa3lC31yOHub+5 - d6R774XQOPJB1BnfP8tQW/XPVf7wQpwBgOoBsIfB/hJw2unZ9Yfn9VsaMWnknLARs2YGDVszPfATu8l+ - A31gXnv4OJ8PIiHHf2SMd79T4CGcgn737BGevXMhG5AMAcGTI73ejYd/OzTSq08EBAp9Rnq+aw/3XTfR - Z8DsCQGDRswJ/azv2vBZz52uOv0HfF0hPo/8nMKfgf8HpdCWFrRPWuAAAAAASUVORK5CYII= - - - - - iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6CAYAAACI7Fo9AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAGYktHRAD/AP8A/6C9p5MAAAAHdElNRQfZAg4LMQXZmN/IAABK9klEQVR4Xu2dB3wUZfrHr6h3 - 5/Xm/e88ez+xKwioCIqACEjvXXqTjtTQEhJCeu8JhJCQQEIgkEp6JZ30ntAEVIoCgvj+n2ey72Z2s2V2 - d2Z2Njt+Ps9nVrJ1dr/ze96nvb/4hfyfxZ0BQsgfwP4L1gusL9ggsOFgE8Bm3bpzc/n579q2Nlyu3VN1 - scyNsfMlAaXtBSFoJW35oXgsasvxrTxf4lpxrti56kLpruardRuv3Px6ATzHOMXzDYRjH7BXwJ4A+zPY - Ly3uhMlvWD4DUj0DANRDYI+BvQ32Gdj0W3e+X9V6tcG9pD0/4nRdQsKx8ojcQ0UBlWF5Xo0BWU4XvdPt - r7mm7rzrnGJDnJK3qdi+5K2EbY5JWwja3qTNqpa4Cf5980/OKdtveJy2veSX6dgcnON+NqIwIPd4RdSJ - 9LrE/SVtubYd19rmwXsaBvYO2JNgD0v1XMrvSz4DkjgDAMlvwJ5XKPOUe/d/XNd8pc4/pzEtLr48Mu9A - vneTT6bDDbfUnQTNNXUHYy4p21UMATcV8r0AukPiRhWzP/UVQdtzaoOKOZzaeMcj3a5tf75X/onK6KN5 - LelO579rnw2f40OwF9DzkMQJlt+EfAbMcQYAgL+CvQE2CmzZ5ZuXXAtbso7ElUcUBee6X/RIs73vlraL - MKaAW2qQ251cT9BsE9ap2O6EteBJbL0amONSnFAZHV1+vsjmJ/LTCPicr4P9U3b9zfGLk19TlDMAP+4H - wJ5TuOCrLl4/553bmJoQXRJ61i/L6bp72m7CNkuGHEHfdWKNitmeXH/bO31PTUxx2PGiliz7Oz/dwXjC - i2C/E+ULkF9EPgNCnQH4Ef8RDANls7//8Xt7WFfHxJVFlARkO1/zPG1HYP3LWE+HfOeJ1YSx46uUBheD - 294ZDuXHKyMj6i6eXaI4T/8U6ruQn1c+A7yeAVyTKn60C76+edEroyEx9WCRf6tPhsNPCDc1a4Z8x/GV - BG17/JdKg+Dfhf153ilZDck2cP4wyv93Xr8Y+cnkM2DqGVAE0jDyPP/yza89MuuTUg4W+J7zzrAnXul7 - GJMh71RzTZAj8DbxKxjbdmw5rvuvhuZ6puQ0pm5SRPTlgJ6pP1L58cafAfgRYh577J17d/bkt2QkRBT6 - t4Ny/4yAy5B3d9e5QI6gU9t6bBlCf/lAvs9xyPPPgnP9FNivjP/G5EfKZ4DjGVCodz84rmz/pjnkRMXh - Ev8spzsUbhnyNZ3rcbU1uTGQI+hb4pYyBrfvQ31AJaQaXW/du4Xn/08cvzL5bvIZ4H4G4If1F4yY37t/ - b3dRa/YJcM0vgnoTNBnyrgi7EJBT2DfHLSFocNG4BgVC8bUXq8bDd/II929Rvqd8BrScAfgh/Qds8vd3 - bjpn1CemB+e43fDN3MsALkOumkITA/LNsYsJta1xy36E7yKjsCVzEXxHWJknl+bKJBt2BhTrwfnf/nDV - ++TZo0VQXoo/KqIPcnbQzdpTaKa66+pKzoYcb2+KXUTtZ6gGLD9dm4DBO6wulIE37OduffeGHwnWls+7 - fuuaZ+LZ2CK/rH33KOAy5GuJpmIYsZVcDXIG9o1HFzIGFXnlWQ1J6+E7fEYG3vr41fuJFS76nJt3rnsk - V8fnB2Q532UDLkMufci/OrqAMBa7ABW+OLshbSW69Hq/fPkOPf8MYPQWbCqkyFzS605lBWa73IFuLcZF - l5W8s4YdVVyrkrOq3bjmydVTaOzougHuuoqSKyFXwL7hyHwC9rNL6o7c8o6CL+SgXc9nWeMnhC/+QbCP - 79+/b1fQkpkYkuv+PQIuQ969QcVCISfrY+YxBheBexA4TWq4UoONNXIrrTUwj+s2sDfBNtdfPBt1sMDv - a1iHM4BzhVxTtZvVBd6kreRKyCns62K+IJuOLroZlu8Zeu3utbfg+/+1NfzerfIzwpf7d7BF39z82i+u - 7GAtA7gMudZWU0tXcjbkCPra6LmMQantuROVh7Gm/lGrBKGnfmj4Qn8FNhCKXfbiOhy6x+7JkG9gANfW - T95TIaewr4meg1N1Ckva80bCb+M3PfW3bzWfC6/aYDh+KRzc9MtKwGUl5wy5pvSZBANvGt11tpKzIUfQ - 1xyejY/5PjTf0+fOnTtPWw0UPemDKlR8GEbTk6qPnfHPdrovQ945BsoQJe/JkCPo1HadWF2V2ZA0DX43 - v+1JHPTozwJf1j/AVqKKh+f7fKsCuKzkspKzAEfQVx+exRjc/hEqIP3gt/PfHg1IT/hw8CX1gZSZfUZd - YjasxVVVXIZchlwL5KuiZhJqtifXnSluyR0iR+YleEXA/CjYrG++vxxw+ExIB7SOdkbU2San0DQOclQP - vFmLu06VnA35yqgZBG1tzNzvDhUGbIXf1F8l+HO3zrekCLhthg0IYoNy3O5YI+Q49tk/04kczPMj0UWh - JL4kkiRVHCOZ1Ukkvy6DsYL6TFLSmK+04sY8UtSQQ3JrTzOWAffFx+BjowpCyP4cb+KXsY/sS9oKraGd - 02HY45/UJ8OIWPFmVOCNvSbXBfmXkdMJY1HToZR2e+zl65efs06yJPSpAfK3wVV3SK87mYeA92TInWGc - WlCWKzl65gBJO5tAiupzSE1bBem42EouXb6gxc7Dv58nF9Xta/g3rXYO/tZlF+D2uYtt8FqVpLA+m6RV - JpCYojDil76P7Dm5QTkRhj0ZRsCyVnEgV8C+InIasTm24mxRc/ZgDPBK6KdvHW8F109gY3+4e9PraOmB - ZmMg5zIwwlwVb7gJQ1iOFzlZdoQUNmSRho5qBkztQGsCnR/IEfRudgn+TWGNHbWksC6LJJTGkKBMV2IH - 9fG0Zp3n2nXRIUfQlx+aiq78ldjSCJxWK4+nFusSAycbJ60uP/ddW9iBAp9rPQFyp5RtJDTHk6RUxpOz - LaUAVoeBUKuDLg7kFHb28fzFDlLVUkaSy+MZ8HfEr2Qmw+joJ+fSoGI2yBF0NHDn7/rnOLthVkes37rV - vg6c5EeYOvWvz0bDjibMetxQd10qSo47r6ALXACK3X6xhXx95SJjhqm2+ZRcE+QXLnWA0nfZebiNSwtU - /MOw7t+TsIEBnjU0wiIgR9CXHZpClkVOwRbYw7dv337caiEU+oMD4DhMYPeZtpxE2O7nviVCjnBHA9yF - DdmMalO4eyrkCLqKXWwnZxrySGR+ELE9sc6yIEfQIyYztvvE2syvv+94VejfvNU9PwbdwBxhB9F8yI8z - Km4pSo7r7QN5PkzU+/zX7d3gthrIEXpw66mdA+gxuBeS7cG49uyeckU/udnddaWSsyCnsG+MXVRV3lqA - 21XLo6v4uCLBifwYGlJcoOOoylDIDRniyHfgzSvdnpwsPwKBtBqtcFsr5GzgzwPwzefqycnSI8QxcQsO - jGCMdp9p60LTVLuunkJj58jxNs2TK1NorOg6DbzRNbkuyJdGTCJoUDPfkd2UNkYurjGRdDiBn8GGfO4Y - WbcUyENzPJh1N0aq1V1zTf/f09bk3dx1NSVXhxxBZ1txfR7xz3AmG452wY7NKfoaVMSGfMnBiQRtZeSM - K0lVR3GDiQdM/Llb38PRHQIbc+vuD56Hi0POSR1y3Ks8qjCYVLQUc4JbVnJ04VUBp/+PLj1adUs5icgN - gODdEslCTmFfETn1xtHycBw7/ZD10WrkJ8bCBLCJMKjRO7Io8JKUIUfAj5UcIo3n9LvnogTedBbCYJFM - 92IYfXlyrtF1U5UcQaeQs4/o1h8tOki2xS1TDo9g2kwVrabmUnIK+eKDEwgarN2/jzoTvAJ+u3J/uz72 - FZBPv3b7W99DRQGXpQo5Ah5bchAArzVIwQVV8h4IORv4lo4GcqRwP4yEWiw5yBeFjydoSw5Ouh1R4Ifj - puXCGm2wK9z1Kd/8cMUfhkR8I1XIowqDSP25aqMAFyxP3sMhVwJ/oY00ddSRg7n+jDvPbjMVOvBGFVxd - ySnkXccJd0NyXHEzCVnZ1WFXQD7uxu1rPlKFPDDLhZQ05RsNuAy57jW5Jrdd5d8A8nMsq2wuJe4pu5he - cqlAvvDAOIK2KBxhd18Hv+sH9XmxVvV3OCGjsG4dth6+IjUl9zi9m6RXnWIaQ7hE0bXdR5DouhUpORty - 9u2sqmRsPFHCzncKjauSU8jpcfHB8Xf2F3gvlaPxiksZnIghP9y56RVVFHRRapBHFPiTxvN1JgEuKzm/ - Ss6GvAMUHq0Z1u8Hsn3IqsOduXK+8uTGQr7gwFiCBu78DxF5fvOsPs8OJ6A/5smjS0I7pAS5NxS75Nad - NhlwGXLhIaew47GoNofsOr5WBXQshDGmGMZUyOfvH0PQ4HmuHyoMnGpVLjr7wwLkL4Pti6+IqpES5JgP - b73QJEOuoUFFqBSaxvW52ppck5KzIae32841k0N5gWTl4RkM4OaEvAv2SVcTq+M+sDrYAfB/g9ml1p4o - 1Ae5Ifug4S4qxm5d7HnalmTVJvMCuKzk4iq5JuDzazLJlthlTIupIWWtfCk5hXze/tEEDZYUdSVt+f+z - GtgB8L+AbctvyUiVCuShuZ6kHoY7mBJsYz9WDrx1B11vVJ0WzBip5Cqwn28lHWCNbbXEO81BCTrTaqqh - QYXWrgsF+bywzwkapAQLOq529PwdYrBEEGxdzYWKI7Bz6c+6utDEUvKE8miTI+p8Q27Y6CfLrHjj013X - BDmCTi2xNJaJypsTcgo7jNk6Bgz8qUcrO3zAGZdvXAwKztE9NEIMyNFVx9bRy1cvSUrJZchV8+W4Ntfk - mmv8NxbcbNDxdnF9PrjyS5Q95dhuKpaSU8i/CBtF0PYmbnbosTl2+GADMMKOpa3mVvIAKH6p6zgrQ66c - /dZ9MowlBN40KXl1czlpaKtRqjkFvh1gb2ivIc6J2xnYzQX53NCR6MbfCc/3nt7jVB0gx+kwTIRdI+QG - zFzHUVCmbF0cCSWsHZdaZcgtHHIEN7EkjuyKW0tm+n9K+tg+Rh7f8AvGInPgO2apO96XGkblI3L8AfTJ - TJsp22iDinpZq3oxDM2T04CbeuCNKri6kiPk1BaHT7gE04vf6TGwA+B/BtuR13j6tLkhP14aRS5duSBD - bsGQF9Zmky0xy8hbO/9PCTYFHI/DXd/SCjkb+FOwbsdovL7adSEgR9jnhI6ASPzM4tYrrf+2eNgV3WjL - 2q82hUPw7adu45/EUvK0nSS9+hQDuHTW5MZMarXewFt6RSKZGzSKPLXx1xoBp7AfK4xUgs4GW/V2Cyh8 - C8mtToNa+dlMmymaGEpOIZ8d8hlB2xm/Osjiu93gAwzGdXl4ge835oLcPW0XMxtdhrxrFrumaa1SXZOX - NRSRRaETyBNf/VIn4Aj6OK/3OUOOoKOVNRSSDTHzzQI5gg7Kfg8aYGZjY5dFKju88SdwXX7q7JEyc0Hu - kbab6TiTIbc8yFGBXU7tIC9t+6NewKma45od1+b6lJxC3n4OYAerbCwhG48sVMIupLtOlZweZ4UMx463 - c+XtRb0sDnTsxQXbdPZ8Say5IMcKubLmIhly1q4qZlVyHYUw6ik0TIWNBXVmr7313Z7kM8goyCnsVRCt - x7FVYkOOoM8M/pSsPzIvAeNZFgU7vOFJ13741ick1/2WsTuamhJdRyUvbzkjQ26BkEfnhZFeNn8xCHK8 - CCSBmhuq5BRyeqxprgRlX6SEnY/ouvqanK3kFHIEHc0lZcdGi+l0UzSrOMWVHaw3B+TujLteIENugZDb - x2/UG2zTpOyo5qZC3gYuPNrZplJmzc4H5BhZR9PkrqtDjqDPDRv5bU5DSl/Jq7rCZd8KxfsnzAP5LlLU - mCNDbmGQt5xrIgtCxxqs4uy1uWbQOwNu6mtydSWnkNMjBgDXHp7LtJmyjTaocMmTGwr5jOBhBA2aX9Kx - H0TSsMMbHHv99jXvkFy3LpddxBRafn2GDLmFQd7UUU+m+H5sNOQTtaq5cZBT2Ivr8nFmuxJ0MSCfETSU - oDkl22zA1LQkYYc39hSY47HyQ9VKNRcLctjTTM6TsyPreNuMZa0cA291rVVklMe7RkOOio6R9u5qbhrk - WD2HlludTpaET2TaTBlTdKHpqngzVskp5HgEF/5KcXOm9PZ2A8AfAFtffaEsxhyQx0PFm5xCk0gKjSPk - De21ZJS7aZBrVnN+IKewJ5fFw3p9jGiQI+jTg4bgDHvscvu9pFQdC2Nu/XTLDfq6bzCgi6jkMKYHylrP - yxVvUihr5Qh5y7lGMtn3I5OUXLOa8ws5hf1QTqAK6LQLjV27zoeSU8gR9GmBn/wMHZZzJQO6opbdLqk6 - 9ozYkOPACNyhVC5rpWoufXe9FVziucGjTIa8u5oLAzmF3QcGWKDLLhLkCDq+Vlvd1TppDKoA0KdcvHYu - yD/b6b6YSo47pTafr5chtyAlx7bSTdGLTYa8u5oLCznC3tLeRHYeW8OALrCSM5BT2xy32MXsgTlFmatj - TOn+JjEhx/p1WvUmjfFPVtygwtFdR8gDT7tyqlnXVwWnqubCQ86oekczqW6uYCLxFHQB3HUVyKcGDsaU - 24348kNvms2FxyJ8sOVMAE7ENbkbRNjTqhJkJbcwJT9VEkue3/w7ntVcPMgR9FawnKrTkHIbzRTCGFIM - Q/Pk7Oi62pq8G+QI+pSAj3EM1lGsUTEL7PDCb967f885LN/7GwRdjPFPCHlMURhvo59Mn9YqK7m2HVTY - 018qGovJ27v+zQvkWAPfmU4TD3IEnG1HCg6IBjmCDsD/5JG5Z5TooCv6zDfkNacniQl5QJYzOfd1G2+g - mzatVYacC+QI5QTvD3mBHF36Y4VRZoW8taMJoG9iRlKxS1uxpFVTWaspSo6QU1scPj4XuHtYVNjhBXvf - vXfXOTTP47pYSo7r8qq2UhlyxmWXfnSdKvreE1t4g3y469uSgBxBr2upZtbrCLvQkE/2/4igOSRtmiwa - 6NhdA7YxpzE1VSzI0WVPOXtchtzCIE8tTyBPb3yQN9Ajc4OMql3vqmXvrHjTa2queqfb3qnkbMuqTAEX - vhN02oFGj3wpOYV8kv8gMv/AmELRimjghfreuXfHJSjH7SYbdEx3oWF7KdtMGeSIgKPtz/Mm6GbzEWGX - 3XUjN1cwILqOat7YXkfet3+GN8g/3teLAdTQBhWhIKfAB2W4iQI5go5mn/jVTMFVXaHmWzIbkk6LBTm2 - ndZ1VMmQW5C7jqBvOLyAN8hxbR6W4SUs5KDaNLKuGnzrruRsVW9srSNrYO6ckEpOIcfjF/s/LwUO/yAo - 7Iq1uVNQtuv3FHQhlRzVPLnymAy5hUGeUnbcqL5ybfnz9x2eJa3QysqouWL8k75WU4OU3EjIKfCZlcmw - Vh/OtJkypuhCo0csaVWUtWpNobEDb2x3nQ35RL+BBM3h5Abh1uqKvPmawpasBLEghwsKuXD5vMmgy+66 - OO46Kjn++Ac5vsSrmvunOkkWcgq7Z5KtKJBP8PuQLNw/DnvWfyuIqsMTvwC2d3+B92UEXWgld03dQUqb - C2XIWWqucVIr/P38RW1mwq6mBq7JaZR9V9waXiF/Z/d/SHNHoySVXOnCQ3lsdVMFADhWRc35VnKEXGE/ - e2TafyQU6AurLpQeFgvyKNhRxdTgm6zk4ik5gp5dlUae2fQQr6DvO7FV8pC3AuhYC49ZAaHcdRbkDOxL - D02OxvZwXmGHJ3wU1TyqOLhFDCXHtXnDuRqTQJchFxfyNlg/fwZ5bn116ob8HYdE1rZUaQRdffyTmGty - tpJTyBH0pvZ6siZqDrMe53NNrg75BN8BEIEfePtQQeBrfIM+8dKN8/5iQI4ue0J5jAy5wmW3BHcd1Rxn - sBsCMZf7bolZajGQI+hoKaXHBYccQUeD4RTY2cbPxg/wRL8Ds02sis0XKk+OCo6Ao+E8dtwE0Vi3XVZy - cZUcIT9Tn0de3PJ7XkF/bvNvSUVDSTfQpajkFPKW9kaAvZHsjFvNS3Rdk5JTyPEIXkMLsPk3XlQdnqgf - NK84wt5p3wtRDMOG3CVlO0k7e0KGHANs2syAwNu5i+2EkxkZeKMBuFmBw3mFHNX+y/DpFgk5gp4LHW7T - OqfEYEMKY+z0Gd7Wl0LTB/l43w8I2p6T66fxBfrK0vb8WDEg907fw0yMMUbNZSVXVXJOgOOFwETI4woP - 8Q7507CRYm5VugrolqDkVNHxaHd8veCQj/N5n0CzywkQ44dMgh2e4DEwh8iiwGa+y1rVlRzVHCe5ypBr - UXMJKjmOheI7Z45qjh4CuyDG0iBH0POrMxlFF0rJEXI0cOFvp1TF/s9U0Mddufm1F6zNf6ag81G7rgly - n3QHKI7pMBh0WcnNo+Totrud2sW7miPoKaXxStAtEXKq7PbHv1IBnS93nUJOjxuOfLHLaNAxRwe2PbXm - RIbQkDNqXmW4msuQmw/ys81l5BWbv/IOOo6ApmpuyZAj7AU1Wcr1uVCQj/V5j8wMGlYBrP7JKNjhgS+D - 2UPP+VVTNjykHWj0SKPrCDc1j9O2Bg+UkCE3H+So5l8enME75Kjm4Zl+DOiWDnlXBH4Vb4E3dSVHyMd4 - 9ydjfPr/7Jq+e6CxoE9uu9oYLDTkCPup8qMGuewy5OaFPKMiEfrMH+Ad9H52TzC18j0FcoQ9tewEAzq7 - OQVv0wYVrtF1rZAj6GDLI6d6G5xThwc8CLYDcud5Qq3J2YrecqGBM+gy5OaFvANGQ33u3pd3yFHNPZLs - ehTkVNVXR85SAZ1vyBF0CPo1ALOG7a8OD3gF3fbgHLdvEXQsYmEbutpo2CvONjcY98SYYmCELncdQXdO - sSExZ/bLkLNz5hKMrisHPQLkEdn+gkD+6va/kvrWGi2gc5sKY0w/ebfJMVDdxi5rVS+GYafQuNxubmsg - cQWHlKALAflo734EzTFx62CD3HeAfGrz5boQoSFH0KvayjiBLiu5+ZUcJ7x8uPcFQUDfDOWuml12y4Yc - QW9sqyPzw8bw7q6jklPIP/fqS5ZGTPLj7L7DHXEmnM3JqiN5Qio5Qh6U7SZDTtVc4kqOLjv2hXOpUTf0 - PjhXrqS+QAPolg85go7mm+rIgG7MmhyDbsrAm2JNrg45gg7PjyWxf+Sk6nDHZ8D2BOe6XRXKXUfInZK3 - kayaZL2gy0pufiVHyJuhM6u37X8FAX1+yJgeDTmCXlybhx1nqqArmlNo/Tota2UH3rhCjqCjOZ7c9B5X - 0Id+ff2Cl9CQY5pNX/OKDLk0IEfQsS/cUKXmen/s+FJ123uOklNFx+PGmEVdoAsA+Sivd8niA+PtuIK+ - Iqsh+RQFnc/AG1VyVPPDhaFa1dw0wC/AxNiet7mCWLXr7MAbAo5WBz3hr+34uyCgj4QCGWuAHEGPyg3p - BF0gyBH0acFDszFrphN2rK4Bs4s6E1SPoAsFOYJeWJ+tEXQZciPbTHloUNEEOYK+4+hKQSBHxT8ABTJS - GBrBR3Sdrd6ablc3lTM5dTbofLjrCDhjnn3Qfb+T25Gqe6tlgPztH+/96OCb6fCjkJC7pe7S2KVm3ZCb - MN9NQMgrG0vIi1v/IAjo7+x+lLQoC2R6pruuDvzWI8uVoPMNOYKOtipq1ix9ij6+6kJ5uJCQo5pHF3V3 - 22XIpafkqObrIucJAjmqud2xDQo1tw7IEfrovDAGdKEgR9Bhl9cwfaCvSa4+ls5XMQx7TY6Ao+1L3kry - 6jNU3HYZcmlCXgFqztdWx+qBOZwgUw4TZPRuj6TYm1yqxTD63HX1v59tLGPW6Qi6KdF1trtOlRyPIz17 - Q5ptEDa5aN5mGf7wBxwZFVHo38hHxZs2yBH2tgvNStBlyKUJOar5puhFgqn5gpCxVgc5hX71oVmCQY6g - g93Nbk/6j0ZVx261+/fv23lnOtwytaxVG+So5iE57jLkTHGMNNfkNNJe3Vwu2Noc1T2xJE4/6CbuoKJt - WqsYgTddSu+Xuk8JuqF5cl1KjpCP8HiHsZWRMydoA/3T1m8a/YSEHEFPrIhlQJeVXLpKjrBvP/qlYGo+ - 1OUNK4W8Hqrk6snp8lMM6EJBjqB/ETLSWRvoC7Mbk09Q0I1pUNGl5Ai5Y9IWcralVIZcg5qbM09OVZyd - N395258FA903xVE36D1SyTshR8ONGXGjBy5lrbTijauSU0WfGvBxJpazq8AO//ArrG+PKwsvRtCFgtw1 - ZQe5+DUWs2BRi7FmycUw0nbXKei2cesFgxy71JpgS2WtQbgeDjmC3tRaz3hMzNAIHbXrxkL+mcfb5HPP - vpe71b3DP/wDbHdYvle7UJCjmh/I9TEBcEuveLMMyOvbasirAlXB4dp8c/Riq4ccQQ9J9xQMcgR9uPtb - JDTL43l1Re+FoENb6h1D+8m5uOsI+d6kzcz6XFbyLuCl5K6jmreDOQpY045jnItqsjWDbiVKjpCjZZQn - KUFnt5pSFcejoe46Ak4hR9CXR05TDcgB5B9dvnnRTUjIEfTSpkIjQZfddW3z15VlqzDHTedtRd26+nqc - /j9CjruW4u6lXJtRDL3fVL/BMuQK0Btaaskkv0Eq/eR8Qo6gzw0buVNd0aeeacuNMmQyjCFKjpA7Jm8h - HRdbjQBdhlwMyBF0/1RnwSDHi8Kh7MDuoFuZklNFx+PaqC8Y0NmA86HkCDna9MAh0eqgr4aKuBQ26Jqm - tdLxT4ZCjqAHZDrLkHPdIknA2nV1RUfAqX2072XBQH971/9BT3uDKuhWDDmC7pm8RzDIP3V7k4zz/aBU - WSGnmCiz42jZgTNcZrypQ45pM7bhepyuyRFwajFFYQaCLiu5WEqOoAuxtRLbte8cFcWqabdyyBH0I/nh - KqCbuianSo6Qo4306H0JO1IZVYcbfwPbub/Ap1HTDip0WisCbizkexM3kVTYPJF7IE6GXEzIEXRcPxu6 - 5uZ6/ye/+hVsUZTRBboMOROQyz+boQSdb8iHub0BsL9xv6wjt7NlVTE6aqd/ltMVQ9x1rkqOkKMVN+Zz - BN0CIDdgvhuWukoxus522bPPphKEkSu4ht5vjGd/GXJFEI69Rm9ormWaW4SAHEFHs01Y25+C/jYqOkTc - 7yHo7Hnr2tbkhkLukLiRtJxv5AC6DLnYSo7AL90/WTDI8aIQkObaCbqs5IySs23pgUnKoRHqXWjs2nVa - 8aaeQlN31yng9Lj04OTObZUB8sFXbnztJCTkrjDnXb/bLkNuDsixFRVbRg1Vaa73x6EVDVCEI0OuCjiF - ffexdcywCCEgH+r6OpkdMmIrBX187aXKQKGUHNU8JMdDD+gy5OaAHNV8Z+xqwSDHi8HC0HEy5Brcdgq6 - f5qTYJAj6DOCh/lR0OfmN6cfZoNuauAN1+QIODWcKKNd0WXIzQU5Fshg2ourOhtzv+jcMAb01m4GO6LA - GCnOJsAOKoYOjei6f1eDCq1dV3fJufw/NrfEwPmhaq7oJVe2mhrrriPgaENcXyOTAj46jr0s6LovS6o5 - lshXdF0dcoT9ZPkRLaDLkJsL8vbzLTCY0UdQyN/c+S+C2xbJkHd32xFytLTSkwzoQkCOoI/16n8GGH8I - QV8XW3owl8/AG1vN7U99RTKrkzSALkNuTsgRdIyGG6PSXB+zLmKuDLkGt51CjsfSukLBIEfQR3j2bgHG - f4egb4s6E1zKt7uOsCPkaAX1mWqgy5CbG3JMqT3x1S8FBT2x5Jga6Aa46ujW91B3nQ16fXM1Azp10/lw - 1xFwapBL/xbHxCHo2w/k+9TQ4Y3sIY5cKt5onpyt4mzI95zaQMpUmllkyM0NOar56kOzBYW8v/3TMuRq - as4GnLnd0mnjYSosG3RDU2jsNTkb8iEur8Ja/dX733333V8QdJugbJc2NujG5MnV3XVUcoQcraatUqHo - MuRSgLy+rZr8b+ufBAV9S/QyFuiykmuDHEGfHTxcCTqfkCPon7i8QlyTdj7HuO4+GQ5XhFByCnpnsYwM - uRQgRzX3TNojKOS4hk8uiVeALkOuC3IEfcmBiQzoQkCOoK+JmtOXAR3GR31PZ67z5a5TyPF44esOBvSL - 6gZjpXC0lHY7B3/rsgtwW6Ndgn/XaR3w9y47T7cqZh97WFlrV4lrC3SnsexcC/l4Xy9BQe+z+zEZcoXb - rg9yBH1d5FzBIEfQ5+8fM5wB3S1t522+3XUKut3J9TLkMBRCk5rzOTSCXbuuC/KU0nhBIUc1X8tE22Ul - 5wI5A3rUPJXJMPrKWnWtyam7joBTmxMyciQDOqTW7gqh5Ag5rt1lJe8Oujkgbwc1/zJ8uuCgxxdGGQa6 - FUTXaeBN03HbkWXMoAi20VZT9dp1QyEf7NyLTAsZNhVB3yoU5Ag69qOrgC6767pHPrFHQnEY/8RVyRHy - htYaIuQYZ1Tz13f8kxkwwVnRrRxyBH+LGuh8Qo6gTwkYPF0FdG1DI7ik0NhrcgQczTZhHXFM3NIFugy5 - 2SBH0APTXARX86UHJsuQK6re2Ck0XYq+O26tUs35hvxj55fJtKDBC35x88cbu+nmCpomw5gCOYLumrKz - E3QzQK4x6IYBOCsKvCHg1D736Cc46IdzQ7mBLiu5Mo9uF7+eAV0IyBH0Kb6Dlv7ixu1rtkIoOUKuBF2G - 3KxKjqAXVGcKXgmHy4Kmtjr9oMuQKyFHpUfQhYIcQZ/k/+GSX9y7/6ONEEpOQXdK2iZ6Cs2qlZyl4Gw1 - x5ltXGvUjb3fvODRMuSsijdd7jr7b7bx6xjQ+Qi8Idhs+8jpf52gQzBuC3uII3NbMf5JV1mrtjU5BRyP - uxPWMs8lZp5chrzLVaegt0CqS+h2VLw47M/w1g26rOQqSt4Jey3ZenS5YJAj6DQYtxkU/b4Sdh4hR9Dt - T0F6TaPrzn8xjAx5d8jbQOGPwrRRY1Wa6+Ne2PIwqWup0g66DLlGyBF09LbYam5MCk2TkiPkKqA7pdjc - 5lvJEfJdJ9Yw1h10GXJlHp2PFJoWdx0hR8MpL1yBNfZ+0/2HypArmlS4uey1jJrjji3ro+YrQecbcgR9 - WsAnn6PrvpkBnWclp5B3B12GXEzIG9pqCc5tMxZgro/zT3XSDLqs5FqVHCFHWxM5hwFdCMgHOb1EpgcP - G8GADhNgv9U0GYb2k7PX43ibnSdXX5OzlZzC3nahWaHqMuRiQo5qHnTaXXDIn974IKlqKusOugy5XsgR - 9OXhUwyCHItg0HS566jkCDnagvAxHyDom7wzHM7xEXjTBPnOE6tJXXuVSnMKNqrw0aAir8k1r8mpy47H - Kb4fCw76WM/3Zcg5ue1d7jpVczzOChqunPGm3k+uXrtuKOQD971IbOKXvsiAHpDlXK+rn5zdoEIr3rgo - OUKOVt50hvcuNBly/ZCXN5SQpzY+IDjouNWySsmrrOSclJzCPt5ngHIijBJ06CXnA3IEPaEk6p8I+ldh - +V5lFHS+3HUK+c7jq0hhfZYSdOOUXHubaWVzKcmvySSpFQnkZMkRklQSRzIrk0lhbQ6paakkLecaoRKu - a09y9m2p76CisQtNT+CNrebOJ3cIDjmu4XPOnu4CXYbcIMgRdhj3pAo6j5CD634LGP89gr4isjAwV338 - E9c8uTZ3nQEdIEfD4ZDGu+vaIT9+Joq8xCHQ9Nr2v5Ohzq+RWYHDyVeHFxL3xN3MBncVTSX6t0vS0mJK - 205F7UIzAHIE/jO3twUHva/d4zLkOt12ze46VfOK+mLBIEc1h1bVDmD8twj6gtiy8BQhlJyCfqr8qJFr - cv0DI1DNP3I0frvf13f+k0zyHUR2x60jx4ujSfO5hi74zQp594ER7Eo3eput4OzbJfX5gu6nRqPxqw7O - 7ARdVnKDlRz3XsuuSOsCnUclR8jRYClQCYw/iKBPS6mJj2bPeDN1TU4Bp8fDhSFGTIbRDzmzTocGFXTP - lx+Yyot6PbvpN2S81wdkX8JWWBJkaBwYgWourJKbBjnuc+acYMPL+dCXXjucGyJDrlHRdSs5Qo52LP9Q - J+gCQP7hvhdwRFUKMP5LBH1kUWtOoKkpNPaanA36juMrSVCWW3fQTR39pKELLSjdjby45fe8/sAHOr5I - 9sRvIMV1eUropQ45gj7S/V1ez4Mm4J/f/DvIA9cwoLd0s0Zm8wZDzfjdUxoI7prCNi67pWi6D9fJMNoL - Y7hBjqAHpbkLBjmC/rnXuyF0S6YBzd80OPK5JqegI+RoLsnbVUEXAHLaeppZmUTe2fUf3n/kuK3w5x59 - SXi2H2kFkPTCblTFm+lKjpCX1RdCtP3XvJ8Dddgneg/kDXLTALdMyBF0h+ObeIuuU3cdAWfM8Xkyxqff - Tgr66z/eu73ZPnHDz8YUw+hScoR8e/yXDOwdF1o7YRcQchpRL28oggGIxq/b9bmrfWwfI3tPbCGN7XWa - gTcj5Ai666mdgkOO58glYQcvSm6tkCPoKw/OUM52wxlvxuTJKeB4ZEOOoE/wGzCPgv4kuO8boAz2mqEV - b1wgR9DRKpqLRYGcwt7QXkMm+gwS9Af/xs5HiNupXUyMwLSKN36UnNmDHEzorZbohbCgKksNdLFddctV - 8s41eg0Z5/2+EnS+IUfQ54WO+piC/lcE3St9T4sxxTDqgTfqrlPA6TH97CkdoHMPvGmeDqM5T94GY46/ - PCj8MMS+e54gOFmlw8xKjpCXNxSTp0Vw2wc4PCdDrgzCcV+T0yAcQl5SUyAo5Ai680mbJynov8aNFkNy - 3UvY1W60n5xLnlx9Ta4OuU38ChJTGKYFdGEgZxfDYOpMnzvOx9+/CP6cVDSWaATekCGO6mk0bSk0quDs - o2eSnSifde2hL1igy0rOLmlVua2IrncB3qnkaMcLDjOgC6HkCDm48TeYYhn6H+bSDxeHpBhS1spVyRFy - NL/0fRpAFx5yCrwjpMuE3lQQLxavbf8bwT3B2eouFuQI/ASvAaKAfiQvXAG6DLkxkCPofsn7BIN8gONz - ZLBLrxomh84CfXRy9bFICjqqOF9KjpBvO7aceT7Me3cF48SDnMLunmQrCuwY8d4Vu7ZzKCO4892N3zU5 - VfSzTaWi1La/tPWPzN7ehqbO8P7WHHijSk6PGw8vMqgLjR100xR4Y1QcDCFHG+LyeoIScrwB1L9XdaHM - lW93nUKOoKNVNpcoQBcfcgq7X5qTKKknVHccxoD94KqgCwM5wu6V7CCKmk/1+0SGXNFLrlHNdbjrbNgn - QkUm11ZTQyH/YO+zZLjHW47qoL8AKbaNAPp9vpWcQr712DKSXBGvsgca7odmji604HR38tQm4bu6EPbP - 3N4hVc3lCtiFgxxBnyRwloHGMTxO2RoMuqzknetyaoVV2YJCjqCP8e43Sx30v4Gqr4WtmS6xJ8PgbUNS - aBiEo2tyCjgeEXK0/Tne+jc7FGnuOgO7CNFphOPDvS+Q4vq8bpsdGlK7rinwxv63ariYPLPpIVEUvbAm - xyDQZchVIUfYI7ICuk1rpTPe2EMjjFFyhBxtbujIN9RB/yWA/mVAllMZG3RjIGcDzoZ8S9xSsvfUZiXo - 5lBy9Y0OvVMcRFmzI+zv7H6UZJ9N6YTdwC40fZDj30PSPUSB/AP7Z2XINbntHN11hLwebFfcGiXobMD5 - ghzW6LfKL5V3RdxZAbkpMSVhJynofEOOoKPVw7QZKUBOoXdK2CYKIAj7KzZ/JSeLj2oE3ZAUmibwF4SM - FeVzrIBNGrkG4WQl767kCDnaTJgqg+tzISBHNR/s/HIZiPevVBRdEZD7ML85w9dYd12XklPI8ZhScVwz - 6GbcJmlX7BpRIEHYcSxybMFBFdhNhRybSt7Y8YgonyE8048T6DLk2iEvqsrF1JdgkL+/9xnsiAvsBrkC - 9Odu3r62CUC/zx4awaUYhivkm+OWkMBM1+6gmxFyWrqKqQ4+ima4PMdzm39LoqC9E114UyFv62gmySXH - RHnvGNPAIZD6FF2GXDvkqOah6Z6CQo6gD3d/e6420B8GqV/tkrq9w5BiGEMgR9C3Q4MLus1K910CkFPY - V4hQLksvBDg59QCoo2bQO2vW9RpAjqBvP7pSFNCHu7wlQ07X5wauyanLjse1kV+ogE6ntZoSeEN3HQFH - e8/haahxH/28RtAVqj43NM8zS72fnHah0dJWTZF19cAb211HwBmLXcxYUX1OJ+gSghxhx/bTKb6DRYEG - gcfBjTiOWRV2DoDjRUABeSschzq/Lsp73hqzXCfospLrVnKEvK6xioxw760EXQjIoWgGx0c9oAv0ISnV - x/brctdNhRxBjyncLznIqao3tNeSYS5viAJOJ+y/JgFpzgrYDYe8rK5IlJFR+F7jCiK0gi5Drh9yBD2h - KEZQyFHNP3F95YhWyBWK3uvi9Q6bXSdW/aypC40PyBF0HFtlSBea2NNasTGln92TosIezCg7B9BZSo5q - 7pPsKMr7fGHr76HstVYj6DLk3CBH0G1j1zGgC6HkCDnap+5vrtQH+h9A8lftS956jm93nbrtm2IXEbTS - xkI12KU1kjmvOp1pUOESXOPjPthauj/TWzfsapAj6HOCRoryHid6D7JeyDWux7u60NRr2NnrcfbtuqYq - Mtb7PUEhR9DnBI58QSfoClWfFl7om8JuNeVLySnkeIwuCGWBLi3IaefZKch5Y9CMD5C5PAe+1sEsf82w - a4C8qa2B9LL5iyjvb+/xzd1Atwol5wly6rYLqeQI+UDHF2pBrH/NBfT3ilqz3fgKvKkrOYXdLmE9M1ZZ - 6psrBKa5iAISOxqP2xyruPEaIEc1jy+MEu29pZWdVAFdhpy7u05VfcfRVYya8xldp+46HvvbPwXr81e9 - 9EKuUPRH7927sxry6beFUHIEfePRhYwV1GVqBF3sNbmuyTDYebYxWrwcOy2qSSg+0gm7FshxlrpYabU3 - YWQWO3cuQ2445FUNFTB6ubegkCPoI73eHckV9F+B9C/ySrcvVW8zNSSFpk3JKeRfHV1AgrB4Rk3VpQY5 - gt65WaF4aTc6wAJVFEFH9VY12DABQB/h1lsURf8i6HMl6DLkhkNe31RDwjN8BYe8v/3TNw/ku/2JE+gK - VR+WUnMs2NBiGAo3F8gR9E0QgcdJqhR2KUJOe8nr22rIoL0vigIWdePf3vV/pLAmVyPktS1nRetW801x - ZECXITcOcgR9Yeh4FdDVp7WqD42gHWj0yC6GUXfXUcn72T+JtfMxnCFXgP7s93durNkev/JHdj85tpqy - C2HwtnoxDFfIEXS0+OIoBnQpQ05hPwObOLy24x+iwj4QWlyrmsoVsHcqOVpUTrBo76MILjYy5MZDnlGe - pLI2FwJyBH2EZ+/JhoKOAyMXwmTYEr7ddQo4HjccmQ+bMK4m7RdauIEuwl5omkc/4TiozqERxwojRRnX - xI7Sj4MtoppgFxL21sQbIueLAvr79s/IkLMGRtBUmrYUmvLfQcVRydG2Ri9TqrlQkPd3ePq6QW47q20V - quTiA+nQCL6VHCFHWx8zj+lo06voEoCcwr4P9gPnki7j8z64txwb9MH7eonyHpYdmGIi6BawTRKPKTQG - dBbkRdW5zKRXLjPejHHXUcnRYJJspEFqzgL96Vt3vl8FabY7QkKOoDue2qIbdAlBTodGzAseLQpo7IvF - bhg4ibBXQuUebhHF54VE23MFprqaALp1Q47A444+QkOOoH/m2WecsaCj+77AJ8MhX1eDiqFrcraSI+TU - cqpPa4ZdgpAj7PWt1eQjAbd90gQejqvGfnAcQyQG5Ph6JbX5RoIuQ362oYyM9Hin2zZJfATeqJLjEYJz - l8PKw7pPk+FKPoA+MK8xzZWCbmrgTRvk62K+IO4pu7uDLlHIqaoXVmeRV7f/VRToKNg4anlmwKeivOYH - sBuLcUE4GXJUc68ke8Ehx12CBru86s2VaW096o/cJ/eX7UpY842QkCPoa6PnkoLazC7YJQ45HRoRCQMk - xNgYQgwFV3+N5QemGQG6DDlCXllfCltX91HuakpVnD133ZQ1OSo5Qo423mdAX5NAV6TaJoUX+MSz+8n5 - ctcRcAo5gu6StL0TdAuBnPaRb45ZKorCig07dtQZpugy5DQQ5564WxTIYQhkCafadn1XAniSXu3fNm/a - ErvkPrsght2gwi5rZafPaAqNRtfZa3J1yBF0tJzqNJ2g692XHC4SzH10bHioL4VGo+tcp7U2QzHJKPe+ - PQp29FJKawsNAF2GnEJeXldMPnN/m9k1RUglf3fP42Soy2u6W1L1Ac6Kvj8EsM93TtleIZSSU8jXRM8h - jolbGFA1qTonyI3a0bQrT24o5FTVS+sLyOs7/tljYMdZ9NzVXDqQG7YPmuGtppry5Ox0Wn1TNXE+sV0U - yPvbP/H9VwnL/smVZb33A9AHpdYe90LQhVJyhJyxw7PJ6YqT3UCXMuS00yy2MEK0TSGEduO/DJ/BEXQZ - 8i7Qq8kZyJuDygqu5KjmA51eDNcLryF3AND/cff+3aUw2PEbNujsBhX1ijdD3HU25Ag6lN4y89uoqlsC - 5BT2ndCKKDSEYjw/TirVr+gy5GzIUc03Ry8RBXIEfaRnn4GGcMzpvgD7iIhC/xgKulCQI+hoMQVhDOiW - BDnC3tzeQEaK1FUmFPBYjFNWd0YP6DLk6pCnlBzvLI5R29WUr+g6wk3t/b3PntG4QQMnmnXcCZ70sW9u - XVkFOfU7QkO++vAssiFmPqlprdQPupnW5LrmuxXWZJGXt/3ZYpX9I8f/yZArdlThsiZHJUf7AqolxYAc - Yf/Y9ZUppjKt9fEA+yT/rH0pCLqp0XV1d50qOUKOtipqJglId9YNugQhpxcAsfZCE0LV10TM0QG6FJS8 - ljQavG2xMIE3CvnBDH/RIIe21BbfM74PCgn6882X6zZuPLLwPp9rck2QI+irAPhcKI3V6L5LGHI6GQZ7 - kIUAUejnDEv31gK6DLm6u46g48jtzz3fZUCHvDZjQrjrjNtu9xguD1YJBrmieAanz0x1TdlRSEHXVdbK - LoZhp9BodJ0Cjke2kjOQKwxn17V0NKrCbgGQ42SY6uazpP+epywKdiZ/Dj/c7oE4GXJNkCPoW6ANVXDI - AXCE/F37x68sOzCV+xQZY68IAPpLVedLt4H7fl9oyFdGzSBo4Tm+XaBbCOR09FMi7Ism5iRZU9V+gMPz - MuRqrabqeXLqruPxeEE0UwEnqJIrIO9j919Q8xe2GMuuQY/DSB/YZNe0nXmmpNC0uusKJaeQfxk5naw8 - PIPk12TorHbDSji+K966tkrisLGCjkGOtsfWW4yqd+8/l5Vcm5JXQAXcOO8PRIMc6toviaLmrGq552sv - VW6CyPh9LmWtXAJvbHcdIUfA2bYldhkzX05baatUIcf+cUy5jfboZxGw+6c4sxRdhlwb5KjmOOVHLCVn - 1NzxhXUGqbKpdwZF/yXYBLe0XVkUdG2163xAviJyGkHzTnPQCLqUIadTYc7U5pJXRNpswRT3vaA6WwG6 - DLkuyHEugJiQg5qfWxM23fiec2OhB9Cfbrhcs+GrIwvuigH58kNTCdrJkiMqsFsC5BR2rDYzBUKhH/uu - 7WMy5KwxUJ2gd+bI2ZZdngZlrq8LF11nrclRydEGOb241FhWTX4cwD7SL9vpOB/RdU3uOlVyCjkeMeV2 - pi6Hgd2SIKewi7VXmjEXhfnBYwB0Wcl1KflZ6DOf6jdYVMj72T9RKWjeXN+VAGvgr9/5dgk0u3xL02d4 - 5NNdZ0OOt5cdmkI2H11C6mCUk2bQO6e1GtuFxmlHUz07qLCHOKrfrmgoJm/seESSyu5+arcK6E2t9cQY - a2ytg51XWdYCtzmb9Iph2Gq+NnKuqJCjmg91f22IPhYF/zvA/kF0SWigMXlydmSdHXjTpOQUcgR9WcRk - 4pS4jdmySBV2aUNOoRdr5puhqo7zx6miGwM4PqYnQ+6VaC865P0dnjqGMTHBQdb3AvAmHv7pp59m7jy+ - qtkQJTcFcgQdbX+WNwt0y4Ccwr4wZJykVP217f+QIdeyJkdFj8s7RAbte0mYijcNa3JU8t52/70z2q/3 - 8/oYFO3vAPtr+c3pO0DV77Or3bRVvPEBOYK+NGISiSs6pOqqo9sOU1o1WVdevIXZT42vPLkuV13j39qb - yNnGMvL27v9IBvbpfkMZ0GUl7x58y6pIZYJvgpS1aoPc9lGstrMTDWIuL6Qoohntcdr2lL6yVj4hR9CX - RUwhWWdTJLsmVwEdAG8Fa1HY4ZxQyQyWdIjfJEOuIcJeXJ1HxkNRDB+Qs9tMad06lrXSyDo99gbIIZ1W - YxM//2Eu/Il6H4D9kWs/fLtg09HFl8VQcoR8ycGJjK2Earpi2BdN0kquBjmFHXdgMXQtLcT9jxdGGwV6 - T16T4yTX2YHDRYe8j92jP41wf3OQqAAb8mIA+7tJVXGOq6Nn/UxbTWnFG99KTiGnRyzcqWoq6wa7JNx1 - LZDjDqXVTRXknV2PmhX25zf/jmDftaFue0+GvLbhLFkBF2GxlRzV/H2HZ/wlEYDTBj+8uQfBxu9L3pql - XtLKNU+uHl2ngTe6JmcrOYV88cEJBG3TkcWktrlSCbvUIUfQ0cwdhR/h1keGnOW21zVWka+iFpgF8j52 - j52bGzX+b4YIrFnuC6D/9+L184uh4eVbhF1oJaeQLwofT9C2xi6HHHuVWrDNTIE3HUpOIadHcxbSbIxa - aBDoPVnJEXKbIyvMAvk7dv/5ebj7GyPNAq4xLwqw9ztZEb0Pus5+FkPJKeT0uCN+FWlordEAu2ldaAZF - 1w2AHGEvrSswWy18RGYAZ9B7NOSg6rZx60yCnO6eYkjgDd31d2z/Q953fCZY0i67+sUA3uwDYJ+DC5+m - 3oXGpRjGEHddHfKFB8YRNNvj60hDGxt26UJOVd072UH0tXrnIMgiTqD3dMj3Ht9sNsjBZW+aEj78r8YI - q1kfg+WxN25/NxuaXi5Q2MWCnMK+I26lwo2XPuQIO051GeP5nqiw40aKXIJwPRpycNfNqeSg5veGub0x - wKzAmvLiAHuv3Ma0LeC+3xMb8gUHxhK0LUeXkprmCqZcVqfB6Ccc/0Qnw3QdIfcNPeWczEB3XX2djv+f - XZlGMAouRApN03MuCZukF/SeDvnWmGVmU3J02T/Y+9wuUzgz+2MVfeuf+GY6HkLQNTWo0Np1Ptx1quQU - 8vn7xxC0r2IWkLL6Iu2gSwRyCr7bqV3MoAox7ECGr07QezLkVfXlBCfempJCM2VNjpBDZ1quTZTNQ2aH - 1dQ3ALD/7ify07ht8csr2aAzgCsaVISEnML+5aHpJLfqdHfYJQY5deH175LSII9kZs9e79ZHjr3kmvvJ - sXa9pKaAzA0eZVbIoRLu2898Xn/OVMYk83iA/Z8t3zYuWBs956opeXJtgTdtSk4hn7d/NEFbBEG6UyVH - u2CXIdeq5j1ZyTPLU8gEnwFmhby33X9++sjxpc8lAylfbwRgfzGzPmnLisip98RUcgr5vLDPCWMAfFCG - O1OoIoU1OXudbpqKo8LLQyN0DY1AJY/KDjG5QcVUd51JpTk8s5svtiT3PJhfD8vz9GO76lwq3kxVciXk - Cti/CBtFdh1bA3PXK9SCbxyDbhic4yHwJkOOu6cIu4MKHRpR23iWYOMOzl8355ocIe+75/FTNjY2v5Ic - oHy9IUV+fZjdyfWnKexY0qqrrFUIyBH0uaEjycrImSSvKkMBuwx5T3XXcT2++MBEk4dG8KHksC5vGu3R - ++98MSXZ58FBFbd+vDl2c9ySs+aEHEFHw3X8odzAToXmkkaTlVzDWCjpjn86AV15oz37GQx5P/snISLe - ZTxBfvUjt5f/J1k4+X5jAPtfLlw/N31tzNx29S409dp1qug04MY18KbJXadKTiHH45zQEYyhK1/ZVKob - dhlyi4G8hrrqil1UDHHXhYAcylxvD3R60XKLYoy9CADs/6q+WL5oxaFp19W70IR01zVBPjvkM4K2FHrb - MSqvbSoMe2gE7SfXVPTC5d8kGXjjPMCRDnuUppLjRJjZQcONmrsuBOTYrNJ/71NzjWXF4h8HsD+bWnt8 - 07JDk++YS8kp5HicFTKcMZfEHUw1nRJ4a1DyHgA5Btx8kvaSIS6vSQdyLIqxe9LG4mE19QMA7C/HV0Tu - WBIx6a65lJwN+czgTwnakvCJ5PiZw9YRXe8BkJ8uPUXmBI0weldTQZQcI+x2T7hbVEeaqUDrejwOlzx8 - JngPqPo9sdbkmpScQk6PM4KHEdv4daS8/oxyzluny945MMJQk931GkinqRpOttFpeiresIx17/Et5COn - /xkMeX/7pwiaUJD32/NEYI9OoxlzUQDY3ziQ7+O8OHzCfaEDb1whR9BnBA0lX4SOIgeyfEhTW53BcNOL - gQw5/5DH5IaTiT4fMoAbuj+54JDbP35IhlzLlQBgfycgx8VzYfi4n4WKrhsKOYJObUXENJJwJsZg2GXI - +YU8vSyJLN0/UQm41CB/1+7xY/N95z9ojOBZxWMU3W59gnPc3cCFv6/ehaZeu25oCs0UyKcHDSFo0wI/ - IZuPLCUZFYmcgJch5w/ywqpssu3IcmYjBariUoO8r/0Th3tEN5rQVxwF7G8dLPB1WBQ+7h6FWyqQI+jU - bOK+hP7xVK3Ay5DzA/mZmjyyM3Y1GezcSwVwqUHe3/7JEJvTNg8IzUiPen4M0EUVBe0CN/5HUyBnq7im - 6Do78EbX5Gx3na3kbMinBg4maFMCPiZbQOETS+KYtlF5Tc5f7XoWdJltjVneCTgUvrBVXGqQv7f3ac+o - qKhf9ygIxfowmHqLK4vYAm78rW5daKwGFW0Vb2JAjqBTW3loBonOCyUNLTU6esV19ZHTvwnQhWZBKbSE - omiy8uD0zkg6Ai5xyGGoo72cQjPxqgAn8Pm0uhOrIBr/nSFrcrEhn+z/EUGb5D+IaYf1Td1L0OU03H23 - TsgraotJYKormRkwnAzc9yJjUocce8o/2PfcGhlyEyGnD8dZ8UUtWfOh4+0ChR1VXCpKzoYcQWfbppjF - JLbgIKnnpPKmQ25aBxqWtopb1pp4JpZsjl5Chrm+rgTcIiCH2vVBzi9N5+knLj8NC/a/N16umwibQlRb - AuQT/QYStAl+HzI2O3g42XdyG0kujWcaQ7orvfVAjmtvl4QdZKr/YDLI6SUVwC0Bcmg1vfqJ88vS3RvN - 0i8boOx/uP7Dt8M2xi7M1NWcQt12WruuqeLN2MAbe02uTcnVIaewT/AdQNDmhIwgzie3k9SyEwQVmI/J - MFJX8pyKdOJ2cheZGfgps/ZGwPmC/D2HpwnbhCyGwfnrwxzfsJ5WU3NdNAD239y7d++93QlrDrPbTM25 - Jme76vogp7CP9/2AoM0M+pTsPraWxOSFkYr6Er2jlzXNYJci5FUNFSQu/xCxO7aeTAHlRripWSrksMVx - /kiXPv8y12/f6l4XYP8Vzoz3y9y3F9z425YK+Tif94mKAfhLD04mjgnbIHq/nxTX5usFXyqQV9QVk9j8 - COKUYEMW7Z9APnV9k3zs/LIK4Jas5O85PBk4K/jD31odbFL4wAD7o8nVcYsg/XZe6u66upKrQz7W5z2C - Nsa7v4pNhxLctZFfgKtvQyKyA0hGeRKpbapiLgDmgLwOBizmVJ4mkTnBzPID39sUyDZ84vIqAzbb2Cpu - uZA/eud9x+cWSuH3btXvAWD/Y8OVmhGro2YVSnVNbizko71hEwewz736Km2U17vM7emBQ8gKyDVvj11J - PBJtycFMPxJfeJiklZ4kRdXZpKqxXMM0GDowQnN0vaaxkpypziPpcDFJKIohh7ICiGfSHrLj6CqyPHwq - meb/CUTH3wCoX1EaFrOg9UTIe9v9t+3jfS+9a9WASenDA+wP3r179027kxtCZocOv8cOvjFBN0UXmqEV - b3wE3viGHEEf5dlHxUZ69iZoIzzeUTG8IIyH+eUTfT8kMwLhPIDNCx1N5oeOhQvFMDI9YCiZ5DuQjPV+ - D+aq9SVDIcWFNsT1NVUDtR4CxgYcb4sJ+ft7nyFoYgXe+tg9fuIjl17yelxKoLNScI/GlkYsgWaYDoTd - miH/zONtgjbc/S0V+9TtTYIGm/qpmAx559bFMNvth/f2PrNcLoKRIuGs94RTZs991zpwQ8z8k9aq5DLk - TxBj9ieH/HjZh64v9ZL4T1x+eyxl/yXOo/PPcd42J2zkVeqyc2lQsXR3XYbcGMgfvdvP4SnHZW7DfiNT - ZIFnAAN19V9XDl5/ZF7C9OAhP9N+cm1daDLkirW5Fa3JYdeU4sFOvd62wJ+3/JbZZ0DR3/7E/gKfVZBz - 75Ah71ybW/uaHNz07yGwt0HuH+9h1wsA/nfnv2nttzVu2QFw5e+w+8llJbcuJe/n8OSJHrVdcQ9jlZeP - A8A/klF/cszKyOlpUwI//lmG3Hog72f/ROXQfa98KkfUeUFJ+k+iKKF9MiLff8m80M/rEXZjG1RMyZOz - C2HwNpMjNyBPLgfeuAXe+to//s3AfS8s9z3jKw9slD6e/L9DbJC5+ePNXvuSbXZBVd159V5yQxtUuJa1 - qle7yZALUwwDTSjfQ9vrvhmhH/X83Uv5x6PnPSO2v165duFN2xNrXCEyfxWBlyEXpqzVkM0Ojd9c4bEf - P9j3fMCUgEFP9Lxfq/yJTD4DmI5rv9r0jk38Ci8I1n2n7CNXDI+gbrrsrhvXTy485I/dfd/x2bCxwR88 - Z/KPQX6Cnn8GAPg/VV8qf3dT7GI/WL9fZ4BXDI2QIZce5H33PHbvPftnIsf7vC8PhOj5ePL/CQH431ed - L3vDJn65y/SgT84ZA7mmDjRrW5MLpeRQ7HJzgMNzvqP9ej/P/7cvP6PVnQEA/qHrd64/65i0aePMkOGV - OBmGS+BNhvw5IgTksHa/NMDx+e3Twz55xOp+jPIHFv4MAPC/Bvu3R6rt9CUHJx4Dhb+FwGsaGmHNkA9w - fI7Zn5xnyO/D86V/6PTiTJv4+Q8L/23LryCfATgDGKkv7sh/dXPcEluYAlPFngwjQ84f5O/ZP3URdmVx - HO/V/wX5hyefAbOdAUXxzSM+mXtHrYycEQSpuVZrzZPzpeTvOTz1LbjmB4c4vTJK3rDQbD9t+YW1nQGc - dAP2L4/UXaOXRkwOmej/Ybu1BN5MhRz2LvsOpsNGwiSbsb7xNrJrLmNmGWeAQu+f7TJ4zeHZe6cFDckZ - 7dX3Nh0DpW38kyWWtRoFucNT9wc6vlAOI6mcxvv0Hxx8OliesGoZP235XepQehyE8aeaK2XP7zyxagHs - EHtgot+HNSM93rnPnvPW0yGHtXbHEJdXooa7vbVoScyUJ3DZI/9q5DPQY88ApuvA/pZYfaTXV0cXLlp8 - YFwglNwWA/R3LGnGmx4lvz/I6cVacMVDR7i/s3jJwbEv4+fusV+q/MHkM6DvDCjSdn9qulD1+Fdxi8cs - Ch+3G/L1RyBtVwkq/4MUBzmyIR+w99mfBjn9rwFmu8fDQAvbER7vTth96st/4+fS99nlv8tnwKrPgCKa - //CNGzf+sef4+n6wScX82SGf2sNa/yDk7zNGevVu/NTtjVvK0cyCj3964R7Mbm8f6vpa3lC31yOHub+5 - d6R774XQOPJB1BnfP8tQW/XPVf7wQpwBgOoBsIfB/hJw2unZ9Yfn9VsaMWnknLARs2YGDVszPfATu8l+ - A31gXnv4OJ8PIiHHf2SMd79T4CGcgn737BGevXMhG5AMAcGTI73ejYd/OzTSq08EBAp9Rnq+aw/3XTfR - Z8DsCQGDRswJ/azv2vBZz52uOv0HfF0hPo/8nMKfgf8HpdCWFrRPWuAAAAAASUVORK5CYII= - - - \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/App.config b/src/gateway/NServiceBus.Gateway.Tests/App.config deleted file mode 100644 index 66384297872..00000000000 --- a/src/gateway/NServiceBus.Gateway.Tests/App.config +++ /dev/null @@ -1,24 +0,0 @@ - - - -
    - - - - - - - - - - - - - - - - - - - - diff --git a/src/gateway/NServiceBus.Gateway.Tests/Config/When_routing_using_the_configuration_source.cs b/src/gateway/NServiceBus.Gateway.Tests/Config/When_routing_using_the_configuration_source.cs deleted file mode 100644 index 04b0007c392..00000000000 --- a/src/gateway/NServiceBus.Gateway.Tests/Config/When_routing_using_the_configuration_source.cs +++ /dev/null @@ -1,50 +0,0 @@ -using NUnit.Framework; - -namespace NServiceBus.Gateway.Tests.Routing -{ - using System.Collections.Generic; - using System.Linq; - using Channels; - using Receiving; - - [TestFixture] - public class When_using_the_configuration_bases_channel_manager - { - IMangageReceiveChannels config; - IEnumerable activeChannels; - Channel defaultChannel; - - [SetUp] - public void SetUp() - { - config = new ConfigurationBasedChannelManager(); - activeChannels = config.GetReceiveChannels(); - defaultChannel = config.GetDefaultChannel(); - - } - - [Test] - public void Should_read_the_channels_from_the_configsource() - { - Assert.AreEqual(activeChannels.Count(), 3); - } - - [Test] - public void Should_default_the_number_of_worker_threads_to_1() - { - Assert.AreEqual(activeChannels.First().NumberOfWorkerThreads, 1); - } - - [Test] - public void Should_allow_number_of_worker_threads_to_be_specified() - { - Assert.AreEqual(activeChannels.Last().NumberOfWorkerThreads, 3); - } - - [Test] - public void Should_default_to_the_first_channel_if_no_default_is_set() - { - Assert.AreEqual(activeChannels.First(), defaultChannel); - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/FakeDispatcherSettings.cs b/src/gateway/NServiceBus.Gateway.Tests/FakeDispatcherSettings.cs deleted file mode 100644 index 7da88ff1b0b..00000000000 --- a/src/gateway/NServiceBus.Gateway.Tests/FakeDispatcherSettings.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace NServiceBus.Gateway.Tests -{ - using Config; - using Faults; - using Unicast.Queuing; - - public class FakeDispatcherSettings : IMainEndpointSettings - { - public IReceiveMessages Receiver{ get; set;} - - - public int NumberOfWorkerThreads - { - get { return 1; } - } - - public int MaxRetries - { - get { return 1; } - } - - public IManageMessageFailures FailureManager { get; set; } - - public Address AddressOfAuditStore - { - get { return Address.Undefined; } - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/FakeMessageSender.cs b/src/gateway/NServiceBus.Gateway.Tests/FakeMessageSender.cs deleted file mode 100644 index 206e3bb0491..00000000000 --- a/src/gateway/NServiceBus.Gateway.Tests/FakeMessageSender.cs +++ /dev/null @@ -1,41 +0,0 @@ -namespace NServiceBus.Gateway.Tests -{ - using System; - using System.Threading; - using Unicast.Queuing; - using Unicast.Transport; - - public class FakeMessageSender:ISendMessages - { - public FakeMessageSender() - { - messageReceived = new ManualResetEvent(false); - } - - void ISendMessages.Send(TransportMessage message, Address address) - { - details = new SendDetails - { - Destination = address, - Message = message - }; - - messageReceived.Set(); - } - - public SendDetails GetResultingMessage() - { - messageReceived.WaitOne(TimeSpan.FromSeconds(200)); - return details; - } - - SendDetails details; - readonly ManualResetEvent messageReceived; - - public class SendDetails - { - public TransportMessage Message { get; set; } - public Address Destination { get; set; } - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/Idempotency/Persistenstester.cs b/src/gateway/NServiceBus.Gateway.Tests/Idempotency/Persistenstester.cs deleted file mode 100644 index 505e7d5b1cf..00000000000 --- a/src/gateway/NServiceBus.Gateway.Tests/Idempotency/Persistenstester.cs +++ /dev/null @@ -1,72 +0,0 @@ -namespace NServiceBus.Gateway.Tests.Idempotency -{ - using System; - using System.Collections.Generic; - using System.Collections.Specialized; - using System.Configuration; - using System.Diagnostics; - using System.IO; - using System.Transactions; - using Persistence; - using Persistence.Sql; - - public class Persistenstester - { - public void Loop() - { - for(int i=0; i < 100; i++) - TestPersistence(); - } - - public void TestPersistence() - { - var connectionString = ConfigurationManager.AppSettings["ConnectionString"]; - var p = new SqlPersistence - { - ConnectionString = connectionString - }; - - var clientId = Guid.NewGuid().ToString(); - var msg = new byte[] {8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8}; - var headers = new Dictionary {{"hello", "world"}}; - - var sw = new Stopwatch(); - sw.Start(); - using (var scope = new TransactionScope()) - using(var msgStream = new MemoryStream(msg)) - { - p.InsertMessage(clientId,DateTime.UtcNow, msgStream, headers); - scope.Complete(); - } - - Trace.WriteLine("insert:" + sw.ElapsedTicks); - sw.Reset(); - - IDictionary outHeaders; - byte[] outMessage; - - - sw.Start(); - using (var scope = new TransactionScope()) - { - p.AckMessage(clientId, out outMessage, out outHeaders); - scope.Complete(); - } - Trace.WriteLine("ack:" + sw.ElapsedTicks); - sw.Reset(); - - sw.Start(); - int deleted; - using (var scope = new TransactionScope()) - { - deleted = p.DeleteDeliveredMessages(DateTime.UtcNow - TimeSpan.FromSeconds(2)); - scope.Complete(); - } - sw.Stop(); - Trace.WriteLine("delete:" + sw.ElapsedTicks); - - if (deleted > 0) - Trace.WriteLine("DELETED ROWS:" + deleted); - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/Idempotency/Raven/When_acking_an_existing_message.cs b/src/gateway/NServiceBus.Gateway.Tests/Idempotency/Raven/When_acking_an_existing_message.cs deleted file mode 100644 index 30670dadd0f..00000000000 --- a/src/gateway/NServiceBus.Gateway.Tests/Idempotency/Raven/When_acking_an_existing_message.cs +++ /dev/null @@ -1,86 +0,0 @@ -namespace NServiceBus.Gateway.Tests.Idempotency.Raven -{ - using System.Collections.Generic; - using System.IO; - using System.Messaging; - using System.Threading; - using System.Transactions; - using NUnit.Framework; - using Persistence.Raven; - - [TestFixture] - public class When_acking_an_existing_message : in_the_raven_storage - { - const string QueueAddress = "FormatName:DIRECT=OS:win2008r2\\private$\\headquarter.gateway"; - - - [Test] - public void Should_return_the_message_and_headers() - { - var message = CreateTestMessage(); - - Store(message); - - byte[] msg; - - IDictionary headers; - - using (var tx = new TransactionScope()) - { - ravenPersister.AckMessage(message.ClientId, out msg, out headers); - tx.Complete(); - } - - Assert.AreEqual(message.Headers, headers); - Assert.AreEqual(message.OriginalMessage, msg); - } - - [Test] - public void Should_mark_the_message_as_acked() - { - var message = CreateTestMessage(); - - Store(message); - - byte[] msg; - - IDictionary headers; - - ravenPersister.AckMessage(message.ClientId, out msg, out headers); - - Assert.True(GetStoredMessage(message.ClientId).Acknowledged); - } - - [Test] - public void Raven_dtc_bug() - { - new MessageQueue(QueueAddress, QueueAccessMode.ReceiveAndAdmin) - .Purge(); - - using (var tx = new TransactionScope()) - { - - using (var session = store.OpenSession()) - { - session.Store(new GatewayMessage()); - session.SaveChanges(); - } - - using (var q = new MessageQueue(QueueAddress, QueueAccessMode.Send)) - { - var toSend = new Message { BodyStream = new MemoryStream(new byte[8]) }; - - //sending a message to a msmq queue causes raven to promote the tx - q.Send(toSend, MessageQueueTransactionType.Automatic); - } - - //when we complete raven commits it tx but the DTC tx is never commited and eventually times out - tx.Complete(); - } - Thread.Sleep(1000); - - Assert.AreEqual(1,new MessageQueue(QueueAddress, QueueAccessMode.ReceiveAndAdmin) - .GetAllMessages().Length); - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/InMemoryDataBus.cs b/src/gateway/NServiceBus.Gateway.Tests/InMemoryDataBus.cs deleted file mode 100644 index e7c1132274b..00000000000 --- a/src/gateway/NServiceBus.Gateway.Tests/InMemoryDataBus.cs +++ /dev/null @@ -1,58 +0,0 @@ -namespace NServiceBus.Gateway.Tests -{ - using System.Collections.Generic; - using System.IO; - using System; - using DataBus; - - //todo add this to the databus project - public class InMemoryDataBus:IDataBus - { - readonly IDictionary storage = new Dictionary(); - - public Stream Get(string key) - { - lock(storage) - return new MemoryStream(storage[key].Data); - } - - public string Put(Stream stream, TimeSpan timeToBeReceived) - { - var key = Guid.NewGuid().ToString(); - - var data = new byte[stream.Length]; - stream.Read(data, 0, (int)stream.Length); - - lock(storage) - storage.Add(key,new Entry - { - Data = data, - ExpireAt = DateTime.Now + timeToBeReceived - }); - return key; - } - - public void Start() - { - //no-op - } - - public void Dispose() - { - //no-op - } - - //used for test purposes - public Entry Peek(string key) - { - lock (storage) - return storage[key]; - } - - public class Entry - { - public byte[] Data; - public DateTime ExpireAt; - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/InMemoryReceiver.cs b/src/gateway/NServiceBus.Gateway.Tests/InMemoryReceiver.cs deleted file mode 100644 index c8d3029bd2b..00000000000 --- a/src/gateway/NServiceBus.Gateway.Tests/InMemoryReceiver.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace NServiceBus.Gateway.Tests -{ - using System.Collections.Generic; - using Unicast.Queuing; - using Unicast.Transport; - - internal class InMemoryReceiver:IReceiveMessages - { - Queue queue; - - void IReceiveMessages.Init(Address address, bool transactional) - { - queue = new Queue(); - } - - public bool HasMessage() - { - lock (queue) - return queue.Count > 0; - } - - public TransportMessage Receive() - { - - lock (queue) - return queue.Dequeue(); - } - - public void Add(TransportMessage message) - { - lock (queue) - queue.Enqueue(message); - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/NServiceBus.Gateway.Tests.csproj b/src/gateway/NServiceBus.Gateway.Tests/NServiceBus.Gateway.Tests.csproj deleted file mode 100644 index abd7b2a79d0..00000000000 --- a/src/gateway/NServiceBus.Gateway.Tests/NServiceBus.Gateway.Tests.csproj +++ /dev/null @@ -1,184 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {33632B71-0CAA-4245-A4E3-BA94B563D679} - Library - Properties - NServiceBus.Gateway.Tests - NServiceBus.Gateway.Tests - v4.0 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\lib\RavenDB\RavenDB.Database.992\BouncyCastle.Crypto.dll - - - ..\..\..\lib\RavenDB\RavenDB.Database.992\Esent.Interop.dll - - - ..\..\..\lib\RavenDB\RavenDB.Database.992\ICSharpCode.NRefactory.dll - - - ..\..\..\lib\RavenDB\RavenDB.Database.992\Lucene.Net.dll - - - ..\..\..\lib\RavenDB\RavenDB.Database.992\Lucene.Net.Contrib.Spatial.dll - - - ..\..\..\lib\RavenDB\RavenDB.Database.992\Lucene.Net.Contrib.SpellChecker.dll - - - ..\..\..\packages\Newtonsoft.Json.4.0.8\lib\net40\Newtonsoft.Json.dll - - - ..\..\..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll - - - ..\..\..\build\output\NServiceBus.dll - - - False - ..\..\..\build\nservicebus.core\NServiceBus.Config.dll - - - False - ..\..\..\build\nservicebus.core\NServiceBus.DataBus.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Faults.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.MasterNode.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.MessageHeaders.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.MessageMutator.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Queuing.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Queuing.Msmq.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Transport.dll - - - ..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll - - - ..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll - - - ..\..\..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll - - - ..\..\..\lib\RavenDB\RavenDB.Client.992\Raven.Abstractions.dll - - - ..\..\..\lib\RavenDB\RavenDB.Embedded.992\Raven.Client.Embedded.dll - - - ..\..\..\lib\RavenDB\RavenDB.Client.992\Raven.Client.Lightweight.dll - - - ..\..\..\lib\RavenDB\RavenDB.Database.992\Raven.Database.dll - - - ..\..\..\lib\RavenDB\RavenDB.Database.992\Raven.Munin.dll - - - ..\..\..\lib\RavenDB\RavenDB.Database.992\Raven.Storage.Esent.dll - - - ..\..\..\lib\RavenDB\RavenDB.Database.992\Raven.Storage.Managed.dll - - - ..\..\..\lib\rhino.mocks\Rhino.Mocks.dll - - - ..\..\..\lib\RavenDB\RavenDB.Database.992\Spatial4n.Core.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {1BBA08E8-EC86-4BA3-B6B7-88C6D241AE18} - NServiceBus.Gateway - - - - - Designer - - - Designer - - - - - \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/Properties/AssemblyInfo.cs b/src/gateway/NServiceBus.Gateway.Tests/Properties/AssemblyInfo.cs deleted file mode 100644 index 9d1cbe0d4b1..00000000000 Binary files a/src/gateway/NServiceBus.Gateway.Tests/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/gateway/NServiceBus.Gateway.Tests/Routing/When_routing_using_the_configuration_source.cs b/src/gateway/NServiceBus.Gateway.Tests/Routing/When_routing_using_the_configuration_source.cs deleted file mode 100644 index 2e927aa74f0..00000000000 --- a/src/gateway/NServiceBus.Gateway.Tests/Routing/When_routing_using_the_configuration_source.cs +++ /dev/null @@ -1,38 +0,0 @@ -using NUnit.Framework; - -namespace NServiceBus.Gateway.Tests.Routing -{ - using System.Collections.Generic; - using System.Linq; - using System.Reflection; - using Channels; - using Gateway.Routing; - using Gateway.Routing.Sites; - using Unicast.Transport; - - [TestFixture] - public class When_routing_using_the_configuration_source - { - IRouteMessagesToSites router; - - [SetUp] - public void SetUp() - { - Configure.With(new Assembly[] {}); - router = new ConfigurationBasedSiteRouter(); - } - - [Test] - public void Should_read_sites_and_their_keys_from_the_configsource() - { - - var message = new TransportMessage { Headers = new Dictionary() }; - - message.Headers.Add(Headers.DestinationSites, "SiteA"); - - var sites = router.GetDestinationSitesFor(message); - - Assert.AreEqual(new Channel{ Address = "http://sitea.com",Type = "http"},sites.First().Channel); - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/Web.config b/src/gateway/NServiceBus.Gateway.Tests/Web.config deleted file mode 100644 index ed947fc3580..00000000000 --- a/src/gateway/NServiceBus.Gateway.Tests/Web.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/packages.config b/src/gateway/NServiceBus.Gateway.Tests/packages.config deleted file mode 100644 index 5da7e15fb8f..00000000000 --- a/src/gateway/NServiceBus.Gateway.Tests/packages.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway.Tests/via_the_gateway.cs b/src/gateway/NServiceBus.Gateway.Tests/via_the_gateway.cs deleted file mode 100644 index 284cd58fe3b..00000000000 --- a/src/gateway/NServiceBus.Gateway.Tests/via_the_gateway.cs +++ /dev/null @@ -1,140 +0,0 @@ -namespace NServiceBus.Gateway.Tests -{ - using System; - using System.Collections.Generic; - using Channels; - using Channels.Http; - using Faults; - using Gateway.Routing; - using Gateway.Routing.Endpoints; - using Gateway.Routing.Sites; - using Notifications; - using NUnit.Framework; - using ObjectBuilder; - using Persistence; - using Receiving; - using Rhino.Mocks; - using Sending; - using Unicast.Queuing; - using Unicast.Transport; - - public class via_the_gateway - { - protected Address GatewayAddressForSiteA = Address.Parse("SiteAEndpoint.gateway@masternode_in_site_a"); - protected const string HttpAddressForSiteA = "http://localhost:8090/Gateway/"; - - protected Address EndpointAddressForSiteB = Address.Parse("SiteBEndpoint@masternode_in_site_b"); - protected Address GatewayAddressForSiteB = Address.Parse("SiteBEndpoint.gateway@masternode_in_site_b"); - protected const string HttpAddressForSiteB = "http://localhost:8092/Gateway/"; - - protected InMemoryDataBus databusForSiteA; - protected InMemoryDataBus databusForSiteB; - - protected Channel defaultChannelForSiteA = new Channel {Address = HttpAddressForSiteA, Type = "http"}; - - - [TearDown] - public void TearDown() - { - dispatcherInSiteA.Dispose(); - receiverInSiteB.Dispose(); - } - [SetUp] - public void SetUp() - { - databusForSiteA = new InMemoryDataBus(); - databusForSiteB = new InMemoryDataBus(); - - inMemoryReceiver = new InMemoryReceiver(); - - var builder = MockRepository.GenerateStub(); - - var channelFactory = new ChannelFactory(); - - channelFactory.RegisterReceiver(typeof(HttpChannelReceiver)); - - channelFactory.RegisterSender(typeof(HttpChannelSender)); - - - var channelManager = MockRepository.GenerateStub(); - channelManager.Stub(x => x.GetReceiveChannels()).Return(new[] {new ReceiveChannel() - { - Address = HttpAddressForSiteB, - Type = "http", - NumberOfWorkerThreads = 1 - }}); - channelManager.Stub(x => x.GetDefaultChannel()).Return(defaultChannelForSiteA); - - - builder.Stub(x => x.Build()).Return(new IdempotentChannelForwarder(channelFactory) - { - DataBus = databusForSiteA - }); - - builder.Stub(x => x.Build()).Return(new IdempotentChannelReceiver(channelFactory, new InMemoryPersistence()) - { - DataBus = databusForSiteB - }); - - - builder.Stub(x => x.BuildAll()).Return(new[] { new KeyPrefixConventionSiteRouter() }); - - messageSender = new FakeMessageSender(); - receiverInSiteB = new GatewayReceiver(channelManager,new DefaultEndpointRouter - { - MainInputAddress = EndpointAddressForSiteB - },builder,messageSender); - - dispatcherInSiteA = new GatewaySender(builder, - channelManager, - MockRepository.GenerateStub(), - MockRepository.GenerateStub(), - new FakeDispatcherSettings - { - Receiver = inMemoryReceiver, - FailureManager = MockRepository.GenerateStub() - }); - - dispatcherInSiteA.Start(GatewayAddressForSiteA); - receiverInSiteB.Start(GatewayAddressForSiteB); - } - - protected void SendMessage(string destinationSites) - { - SendMessage(destinationSites, new Dictionary()); - } - - protected void SendMessage(string destinationSites,Dictionary headers) - { - var message = new TransportMessage - { - Id = Guid.NewGuid().ToString(), - Headers = headers, - Body = new byte[500], - TimeToBeReceived = TimeSpan.FromDays(1), - ReplyToAddress = GatewayAddressForSiteA - }; - - message.Headers[Headers.DestinationSites] = destinationSites; - - SendMessage(message); - } - - protected void SendMessage(TransportMessage message) - { - inMemoryReceiver.Add(message); - } - - protected FakeMessageSender.SendDetails GetDetailsForReceivedMessage() - { - return messageSender.GetResultingMessage(); - } - - - - GatewaySender dispatcherInSiteA; - GatewayReceiver receiverInSiteB; - InMemoryReceiver inMemoryReceiver; - FakeMessageSender messageSender; - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Channels/Http/HttpChannelReceiver.cs b/src/gateway/NServiceBus.Gateway/Channels/Http/HttpChannelReceiver.cs deleted file mode 100644 index 1764e9848ef..00000000000 --- a/src/gateway/NServiceBus.Gateway/Channels/Http/HttpChannelReceiver.cs +++ /dev/null @@ -1,188 +0,0 @@ -namespace NServiceBus.Gateway.Channels.Http -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - using System.Web; - using HeaderManagement; - using log4net; - using System.Net; - using System.Text; - using System.Threading; - using Utils; - - public class HttpChannelReceiver:IChannelReceiver - { - public event EventHandler DataReceived; - - - public void Start(string address, int numWorkerThreads) - { - listener = new HttpListener(); - - listener.Prefixes.Add(address); - - ThreadPool.SetMaxThreads(numWorkerThreads, numWorkerThreads); - - try - { - listener.Start(); - } - catch (Exception ex) - { - throw new Exception(string.Format("Failed to start listener for {0} make sure that you have admin priviliges",address),ex); - } - - new Thread(HttpServer).Start(); - } - - public void Dispose() - { - listener.Stop(); - } - - public void Handle(HttpListenerContext ctx) - { - try - { - if(!IsGatewayRequest(ctx.Request)) - { - //there will always be a responder - Configure.Instance.Builder.Build().Handle(ctx); - return; - } - - DataReceived(this, new DataReceivedOnChannelArgs - { - Headers = GetHeaders(ctx), - Data = GetMessageStream(ctx) - }); - ReportSuccess(ctx); - - Logger.Debug("Http request processing complete."); - } - catch (HttpChannelException ex) - { - CloseResponseAndWarn(ctx, ex.Message, ex.StatusCode); - } - catch (Exception ex) - { - Logger.Error("Unexpected error", ex); - CloseResponseAndWarn(ctx, "Unexpected server error", 502); - } - } - - static MemoryStream GetMessageStream(HttpListenerContext ctx) - { - if(ctx.Request.QueryString.AllKeys.Contains("Message")) - { - var message = HttpUtility.UrlDecode(ctx.Request.QueryString["Message"]); - - return new MemoryStream(Encoding.UTF8.GetBytes(message)); - } - - var streamToReturn = new MemoryStream(); - - ctx.Request.InputStream.CopyTo_net35(streamToReturn, MaximumBytesToRead); - streamToReturn.Position = 0; - return streamToReturn; - } - - bool IsGatewayRequest(HttpListenerRequest request) - { - return request.Headers.AllKeys.Contains(GatewayHeaders.CallTypeHeader) || - request.Headers.AllKeys.Contains(GatewayHeaders.CallTypeHeader.ToLower()) || - request.QueryString[GatewayHeaders.CallTypeHeader] != null; - } - - - static IDictionary GetHeaders(HttpListenerContext ctx) - { - var headers = new Dictionary(StringComparer.CurrentCultureIgnoreCase); - - foreach (string header in ctx.Request.Headers.Keys) - headers.Add(HttpUtility.UrlDecode(header), HttpUtility.UrlDecode(ctx.Request.Headers[header])); - - foreach (string header in ctx.Request.QueryString.Keys) - headers[HttpUtility.UrlDecode(header)] = HttpUtility.UrlDecode(ctx.Request.QueryString[header]); - - return headers; - } - - - void HttpServer() - { - while (true) - { - try - { - var ctx = listener.GetContext(); - ThreadPool.QueueUserWorkItem(x => Handle(ctx)); - } - catch (HttpListenerException) - { - break; - } - catch (InvalidOperationException) - { - break; - } - } - - hasStopped.Set(); - } - - static void ReportSuccess(HttpListenerContext ctx) - { - Logger.Debug("Sending HTTP 200 response."); - - ctx.Response.StatusCode = 200; - ctx.Response.StatusDescription = "OK"; - - - WriteData(ctx,"OK"); - } - - static void WriteData(HttpListenerContext ctx,string status) - { - var str = status; - - var jsonp = ctx.Request.QueryString["callback"]; - if (string.IsNullOrEmpty(jsonp) == false) - { - str = jsonp + "({ status: '" + str + "'})"; - ctx.Response.AddHeader("Content-Type", "application/javascript; charset=utf-8"); - } - else - { - ctx.Response.AddHeader("Content-Type", "application/json; charset=utf-8"); - } - ctx.Response.Close(Encoding.ASCII.GetBytes(str), false); - } - - static void CloseResponseAndWarn(HttpListenerContext ctx, string warning, int statusCode) - { - try - { - Logger.WarnFormat("Cannot process HTTP request from {0}. Reason: {1}.", ctx.Request.RemoteEndPoint, warning); - ctx.Response.StatusCode = statusCode; - ctx.Response.StatusDescription = warning; - - WriteData(ctx, warning); - } - catch (Exception e) - { - Logger.Error("Could not return warning to client.", e); - } - } - - readonly ManualResetEvent hasStopped = new ManualResetEvent(false); - - HttpListener listener; - - const int MaximumBytesToRead = 100000; - - static readonly ILog Logger = LogManager.GetLogger("NServiceBus.Gateway"); - } -} diff --git a/src/gateway/NServiceBus.Gateway/Config/ConfigureGateway.cs b/src/gateway/NServiceBus.Gateway/Config/ConfigureGateway.cs deleted file mode 100644 index 9cc50144b6e..00000000000 --- a/src/gateway/NServiceBus.Gateway/Config/ConfigureGateway.cs +++ /dev/null @@ -1,144 +0,0 @@ -namespace NServiceBus -{ - using System; - using System.Linq; - using Config; - using Gateway.Channels; - using Gateway.Config; - using Gateway.Notifications; - using Gateway.Persistence; - using Gateway.Persistence.Raven; - using Gateway.Receiving; - using Gateway.Routing.Endpoints; - using Gateway.Routing.Sites; - using Gateway.Sending; - using Raven.Client; - - public static class ConfigureGateway - { - public static Address GatewayInputAddress { get; private set; } - - /// - /// Configuring to run the Gateway. By default Gateway will use RavenPersistence (see GatewayDefaults class). - /// - /// - /// - public static Configure RunGateway(this Configure config) - { - return SetupGateway(config); - } - - public static Configure RunGatewayWithInMemoryPersistence(this Configure config) - { - return RunGateway(config, typeof(InMemoryPersistence)); - } - public static Configure RunGatewayWithRavenPersistence(this Configure config) - { - return RunGateway(config, typeof(RavenDbPersistence)); - } - public static Configure RunGateway(this Configure config, Type persistence) - { - config.Configurer.ConfigureComponent(persistence, DependencyLifecycle.SingleInstance); - - return SetupGateway(config); - } - - /// - /// Use the in memory messages persistence by the gateway. - /// - /// - /// - public static Configure UseInMemoryGatewayPersister(this Configure config) - { - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - return config; - } - - /// - /// Sets the default persistence to inmemory - /// - /// - /// - public static Configure DefaultToInMemoryGatewayPersistence(this Configure config) - { - GatewayDefaults.DefaultPersistence = () => UseInMemoryGatewayPersister(config); - - return config; - } - /// - /// Use RavenDB messages persistence by the gateway. - /// - /// - /// - public static Configure UseRavenGatewayPersister(this Configure config) - { - if (!config.Configurer.HasComponent()) - config.RavenPersistence(); - - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - return config; - } - - static Configure SetupGateway(this Configure config) - { - GatewayInputAddress = Address.Parse(Configure.EndpointName).SubScope("gateway"); - - ConfigureChannels(config); - - ConfigureReceiver(config); - - ConfigureSender(config); - - return config; - } - - static void ConfigureChannels(Configure config) - { - var channelFactory = new ChannelFactory(); - - foreach (var type in Configure.TypesToScan.Where(t => typeof(IChannelReceiver).IsAssignableFrom(t) && !t.IsInterface)) - channelFactory.RegisterReceiver(type); - - foreach (var type in Configure.TypesToScan.Where(t => typeof(IChannelSender).IsAssignableFrom(t) && !t.IsInterface)) - channelFactory.RegisterSender(type); - - config.Configurer.RegisterSingleton(channelFactory); - } - - static void ConfigureSender(Configure config) - { - config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); - - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - - var configSection = Configure.ConfigurationSource.GetConfiguration(); - - if (configSection != null && configSection.GetChannels().Any()) - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - else - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - - ConfigureSiteRouters(config); - } - - static void ConfigureSiteRouters(Configure config) - { - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - } - - static void ConfigureReceiver(Configure config) - { - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - config.Configurer.ConfigureComponent(DependencyLifecycle.InstancePerCall); - - config.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance) - .ConfigureProperty(x => x.MainInputAddress, Address.Parse(Configure.EndpointName)); - - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Config/GatewayBootstrapper.cs b/src/gateway/NServiceBus.Gateway/Config/GatewayBootstrapper.cs deleted file mode 100644 index fb7d1be9fef..00000000000 --- a/src/gateway/NServiceBus.Gateway/Config/GatewayBootstrapper.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace NServiceBus -{ - using Gateway.Receiving; - using Gateway.Sending; - using Unicast; - - public class GatewayBootstrapper : IWantToRunWhenTheBusStarts - { - public void Run() - { - if (!Configure.Instance.Configurer.HasComponent()) - return; - - Configure.Instance.Builder.Build().Start(ConfigureGateway.GatewayInputAddress); - Configure.Instance.Builder.Build().Start(ConfigureGateway.GatewayInputAddress); - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Config/GatewayDefaults.cs b/src/gateway/NServiceBus.Gateway/Config/GatewayDefaults.cs deleted file mode 100644 index f16d53c4f98..00000000000 --- a/src/gateway/NServiceBus.Gateway/Config/GatewayDefaults.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace NServiceBus.Gateway.Config -{ - using System; - using NServiceBus.Config; - using Persistence; - using Sending; - - public class GatewayDefaults : IWantToRunBeforeConfigurationIsFinalized - { - public static Action DefaultPersistence = () => Configure.Instance.UseRavenGatewayPersister(); - - public void Run() - { - if (!Configure.Instance.Configurer.HasComponent() || Configure.Instance.Configurer.HasComponent()) - return; - - DefaultPersistence(); - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Config/IMainEndpointSettings.cs b/src/gateway/NServiceBus.Gateway/Config/IMainEndpointSettings.cs deleted file mode 100644 index f7764f25438..00000000000 --- a/src/gateway/NServiceBus.Gateway/Config/IMainEndpointSettings.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace NServiceBus.Gateway.Config -{ - using Faults; - using Unicast.Queuing; - - public interface IMainEndpointSettings - { - IReceiveMessages Receiver { get;} - int NumberOfWorkerThreads { get;} - int MaxRetries { get;} - IManageMessageFailures FailureManager { get;} - Address AddressOfAuditStore { get; } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Config/MainEndpointSettings.cs b/src/gateway/NServiceBus.Gateway/Config/MainEndpointSettings.cs deleted file mode 100644 index e19cc98831f..00000000000 --- a/src/gateway/NServiceBus.Gateway/Config/MainEndpointSettings.cs +++ /dev/null @@ -1,68 +0,0 @@ -namespace NServiceBus.Gateway.Config -{ - using Faults; - using ObjectBuilder; - using Unicast; - using Unicast.Queuing; - using Unicast.Queuing.Msmq; - using Unicast.Transport.Transactional; - - public class MainEndpointSettings:IMainEndpointSettings - { - readonly TransactionalTransport masterNodeTransport; - readonly UnicastBus unicastBus; - - public IBuilder Builder { get; set; } - - - public MainEndpointSettings(TransactionalTransport masterNodeTransport,UnicastBus unicastBus) - { - this.masterNodeTransport = masterNodeTransport; - this.unicastBus = unicastBus; - } - - public IReceiveMessages Receiver - { - get - { - //todo - use the type + IBuilder to get a fresh instance. This requires the MsmqMessageReceiver to be configured as singlecall, check with Udi - return new MsmqMessageReceiver(); - } - } - - public int NumberOfWorkerThreads - { - get - { - if (masterNodeTransport.NumberOfWorkerThreads == 0) - return 1; - - return masterNodeTransport.NumberOfWorkerThreads; - } - } - - public int MaxRetries - { - get - { - return masterNodeTransport.MaxRetries; - } - } - - public IManageMessageFailures FailureManager - { - get - { - return Builder.Build(masterNodeTransport.FailureManager.GetType()) as IManageMessageFailures; - } - } - - public Address AddressOfAuditStore - { - get - { - return unicastBus.ForwardReceivedMessagesTo; - } - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/HeaderManagement/Bootstrapper.cs b/src/gateway/NServiceBus.Gateway/HeaderManagement/Bootstrapper.cs deleted file mode 100644 index 6aa2d055536..00000000000 --- a/src/gateway/NServiceBus.Gateway/HeaderManagement/Bootstrapper.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace NServiceBus.Gateway.HeaderManagement -{ - using NServiceBus.Config; - using NServiceBus.ObjectBuilder; - - public class Bootstrapper : INeedInitialization - { - public void Init() - { - Configure.Instance.Configurer.ConfigureComponent( - DependencyLifecycle.SingleInstance); - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/HeaderManagement/GatewayReturnInfo.cs b/src/gateway/NServiceBus.Gateway/HeaderManagement/GatewayReturnInfo.cs deleted file mode 100644 index 9a00bf234e3..00000000000 --- a/src/gateway/NServiceBus.Gateway/HeaderManagement/GatewayReturnInfo.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace NServiceBus.Gateway.HeaderManagement -{ - public class GatewayReturnInfo - { - public string From { get; set; } - public string ReplyToAddress { get; set; } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/HeaderManagement/HeaderMapper.cs b/src/gateway/NServiceBus.Gateway/HeaderManagement/HeaderMapper.cs deleted file mode 100644 index 42808887e15..00000000000 --- a/src/gateway/NServiceBus.Gateway/HeaderManagement/HeaderMapper.cs +++ /dev/null @@ -1,64 +0,0 @@ -namespace NServiceBus.Gateway.HeaderManagement -{ - using System; - using System.Collections.Generic; - using System.Linq; - using NServiceBus.Unicast.Transport; - - public class HeaderMapper - { - public static void Map(IDictionary from, TransportMessage to) - { - to.Id = from[NServiceBus + Id]; - to.IdForCorrelation = from[NServiceBus + IdForCorrelation]; - to.CorrelationId = from[NServiceBus + CorrelationId]; - - if (String.IsNullOrEmpty(to.IdForCorrelation)) - to.IdForCorrelation = to.Id; - - bool recoverable; - if(bool.TryParse(from[NServiceBus + Recoverable], out recoverable)) - to.Recoverable = recoverable; - - TimeSpan timeToBeReceived; - TimeSpan.TryParse(from[NServiceBus + TimeToBeReceived], out timeToBeReceived); - to.TimeToBeReceived = timeToBeReceived; - - if (to.TimeToBeReceived < TimeSpan.FromSeconds(1)) - to.TimeToBeReceived = TimeSpan.FromSeconds(1); - - foreach (string header in from.Keys) - if (header.Contains(NServiceBus + Headers.HeaderName)) - to.Headers.Add(header.Replace(NServiceBus + Headers.HeaderName + ".", ""), from[header]); - } - - public static void Map(TransportMessage from, IDictionary to) - { - if (!String.IsNullOrEmpty(from.IdForCorrelation)) - from.IdForCorrelation = from.Id; - - to[NServiceBus + Id] = from.Id; - to[NServiceBus + IdForCorrelation] = from.IdForCorrelation; - to[NServiceBus + CorrelationId] = from.CorrelationId; - to[NServiceBus + Recoverable] = from.Recoverable.ToString(); - to[NServiceBus + TimeToBeReceived] = from.TimeToBeReceived.ToString(); - - to[NServiceBus + ReplyToAddress] = from.ReplyToAddress.ToString(); - - if (from.Headers.ContainsKey(ReplyToAddress)) - to[Headers.RouteTo] = from.Headers[ReplyToAddress]; - - from.Headers.ToList() - .ForEach(header =>to[NServiceBus + Headers.HeaderName + "." + header.Key] = header.Value); - } - - public const string NServiceBus = "NServiceBus."; - public const string Id = "Id"; - public const string CallType = "CallType"; - private const string IdForCorrelation = "IdForCorrelation"; - private const string CorrelationId = "CorrelationId"; - private const string Recoverable = "Recoverable"; - private const string ReplyToAddress = "ReplyToAddress"; - private const string TimeToBeReceived = "TimeToBeReceived"; - } -} diff --git a/src/gateway/NServiceBus.Gateway/Installation/Installer.cs b/src/gateway/NServiceBus.Gateway/Installation/Installer.cs deleted file mode 100644 index 7a6d7e483d5..00000000000 --- a/src/gateway/NServiceBus.Gateway/Installation/Installer.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NServiceBus.Gateway.Installation -{ - using System.Security.Principal; - using NServiceBus.Installation; - using NServiceBus.Utils; - - public class Installer : INeedToInstallSomething - { - public void Install(WindowsIdentity identity) - { - if (ConfigureGateway.GatewayInputAddress != null) - MsmqUtilities.CreateQueueIfNecessary(ConfigureGateway.GatewayInputAddress, identity.Name); - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/NServiceBus.Gateway.csproj b/src/gateway/NServiceBus.Gateway/NServiceBus.Gateway.csproj deleted file mode 100644 index d88a586dd2a..00000000000 --- a/src/gateway/NServiceBus.Gateway/NServiceBus.Gateway.csproj +++ /dev/null @@ -1,187 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {1BBA08E8-EC86-4BA3-B6B7-88C6D241AE18} - Library - Properties - NServiceBus.Gateway - NServiceBus.Gateway - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - False - ..\..\..\lib\log4net.dll - - - ..\..\..\packages\Newtonsoft.Json.4.0.8\lib\net40\Newtonsoft.Json.dll - - - ..\..\..\packages\NLog.2.0.0.2000\lib\net40\NLog.dll - - - False - ..\..\..\build\output\NServiceBus.dll - - - False - ..\..\..\build\nservicebus.core\NServiceBus.Config.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.DataBus.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Faults.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Installation.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Installation.Windows.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.MasterNode.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.MessageMutator.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Config.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Queuing.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Queuing.Msmq.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Transport.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Transport.Msmq.Config.dll - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Transport.Transactional.dll - - - False - ..\..\..\build\nservicebus.core\NServiceBus.Utils.dll - - - ..\..\..\lib\RavenDB\RavenDB.Client.992\Raven.Abstractions.dll - - - ..\..\..\lib\RavenDB\RavenDB.Client.992\Raven.Client.Lightweight.dll - - - - - - 3.5 - - - - 3.5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {37CB5DE9-013D-4779-9D35-342F902E8DE1} - NServiceBus.Persistence.Raven - - - - - - - \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Notifications/IMessageNotifier.cs b/src/gateway/NServiceBus.Gateway/Notifications/IMessageNotifier.cs deleted file mode 100644 index 5b8eed68df3..00000000000 --- a/src/gateway/NServiceBus.Gateway/Notifications/IMessageNotifier.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace NServiceBus.Gateway.Notifications -{ - using System; - using Unicast.Transport; - - public interface IMessageNotifier : INotifyAboutMessages - { - void RaiseMessageForwarded(string fromChannel,string toChannel, TransportMessage message); - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Persistence/IPersistMessages.cs b/src/gateway/NServiceBus.Gateway/Persistence/IPersistMessages.cs deleted file mode 100644 index fc9ca7b0497..00000000000 --- a/src/gateway/NServiceBus.Gateway/Persistence/IPersistMessages.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NServiceBus.Gateway.Persistence -{ - using System; - using System.Collections.Generic; - using System.IO; - - public interface IPersistMessages - { - bool InsertMessage(string clientId,DateTime timeReceived, Stream message, IDictionary headers); - - bool AckMessage(string clientId, out byte[] message, out IDictionary headers); - - void UpdateHeader(string clientId, string headerKey, string newValue); - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Persistence/InMemoryPersistence.cs b/src/gateway/NServiceBus.Gateway/Persistence/InMemoryPersistence.cs deleted file mode 100644 index 901e360412d..00000000000 --- a/src/gateway/NServiceBus.Gateway/Persistence/InMemoryPersistence.cs +++ /dev/null @@ -1,90 +0,0 @@ -namespace NServiceBus.Gateway.Persistence -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.Linq; - - public class InMemoryPersistence : IPersistMessages - { - readonly IList storage = new List(); - - public bool InsertMessage(string clientId, DateTime timeReceived, Stream messageData, IDictionary headers) - { - lock(storage) - { - if (storage.Any(m => m.ClientId == clientId)) - return false; - - var messageInfo = new MessageInfo - { - ClientId = clientId, - At = timeReceived, - Message = new byte[messageData.Length], - Headers = headers - }; - - messageData.Read(messageInfo.Message, 0, messageInfo.Message.Length); - storage.Add(messageInfo); - } - - return true; - } - - public bool AckMessage(string clientId, out byte[] message, out IDictionary headers) - { - message = null; - headers = null; - - lock(storage) - { - var messageToAck = - storage.FirstOrDefault(m => !m.Acknowledged && m.ClientId == clientId); - - if (messageToAck == null || messageToAck.Acknowledged) - return false; - - messageToAck.Acknowledged = true; - - message = messageToAck.Message; - headers = messageToAck.Headers; - - return true; - } - } - - public void UpdateHeader(string clientId, string headerKey, string newValue) - { - lock (storage) - { - var message = storage.First(m => m.ClientId == clientId); - - - message.Headers[headerKey] = newValue; - } - } - - public int DeleteDeliveredMessages(DateTime until) - { - lock(storage) - { - var toDelete = storage.Where(m => m.At < until).ToList(); - - return toDelete.Count(m => storage.Remove(m)); - } - } - } - - public class MessageInfo - { - public string ClientId { get; set; } - - public DateTime At { get; set; } - - public byte[] Message { get; set; } - - public IDictionary Headers { get; set; } - - public bool Acknowledged { get; set; } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Persistence/Raven/GatewayMessage.cs b/src/gateway/NServiceBus.Gateway/Persistence/Raven/GatewayMessage.cs deleted file mode 100644 index c304dd67861..00000000000 --- a/src/gateway/NServiceBus.Gateway/Persistence/Raven/GatewayMessage.cs +++ /dev/null @@ -1,18 +0,0 @@ -namespace NServiceBus.Gateway.Persistence.Raven -{ - using System; - using System.Collections.Generic; - - public class GatewayMessage - { - public IDictionary Headers { get; set; } - - public DateTime TimeReceived { get; set; } - - public string Id { get; set; } - - public byte[] OriginalMessage { get; set; } - - public bool Acknowledged { get; set; } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Properties/AssemblyInfo.cs b/src/gateway/NServiceBus.Gateway/Properties/AssemblyInfo.cs deleted file mode 100644 index 0efebbfbd88..00000000000 Binary files a/src/gateway/NServiceBus.Gateway/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/gateway/NServiceBus.Gateway/Receiving/GatewayReceiver.cs b/src/gateway/NServiceBus.Gateway/Receiving/GatewayReceiver.cs deleted file mode 100644 index fe77ab216f4..00000000000 --- a/src/gateway/NServiceBus.Gateway/Receiving/GatewayReceiver.cs +++ /dev/null @@ -1,86 +0,0 @@ -namespace NServiceBus.Gateway.Receiving -{ - using System; - using System.Collections.Generic; - using log4net; - using Notifications; - using ObjectBuilder; - using Routing; - using Unicast.Queuing; - - public class GatewayReceiver : IDisposable - { - public GatewayReceiver( IMangageReceiveChannels channelManager, - IRouteMessagesToEndpoints endpointRouter, - IBuilder builder, - ISendMessages messageSender) - - { - this.messageSender = messageSender; - this.channelManager = channelManager; - this.endpointRouter = endpointRouter; - this.builder = builder; - - activeReceivers = new List(); - } - - public void Start(Address localAddress) - { - returnAddress = localAddress; - - foreach (var receiveChannel in channelManager.GetReceiveChannels()) - { - - var receiver = builder.Build(); - - receiver.MessageReceived += MessageReceivedOnChannel; - receiver.Start(receiveChannel,receiveChannel.NumberOfWorkerThreads); - activeReceivers.Add(receiver); - - Logger.InfoFormat("Receive channel started: {0}", receiveChannel); - } - } - - public void Dispose() - { - Logger.InfoFormat("Receiver is shutting down"); - - foreach (var channelReceiver in activeReceivers) - { - Logger.InfoFormat("Stopping channel - {0}",channelReceiver.GetType()); - - channelReceiver.MessageReceived -= MessageReceivedOnChannel; - - channelReceiver.Dispose(); - } - - activeReceivers.Clear(); - - Logger.InfoFormat("Receiver shutdown complete"); - - } - - public void MessageReceivedOnChannel(object sender, MessageReceivedOnChannelArgs e) - { - var messageToSend = e.Message; - - messageToSend.ReplyToAddress = returnAddress; - - var destination = endpointRouter.GetDestinationFor(messageToSend); - - Logger.Info("Sending message to " + destination); - - messageSender.Send(messageToSend, destination); - } - - - readonly ISendMessages messageSender; - readonly IMangageReceiveChannels channelManager; - readonly IRouteMessagesToEndpoints endpointRouter; - readonly IBuilder builder; - readonly ICollection activeReceivers; - Address returnAddress; - - static readonly ILog Logger = LogManager.GetLogger("NServiceBus.Gateway"); - } -} diff --git a/src/gateway/NServiceBus.Gateway/Receiving/IMangageReceiveChannels.cs b/src/gateway/NServiceBus.Gateway/Receiving/IMangageReceiveChannels.cs deleted file mode 100644 index 1039c6aec7b..00000000000 --- a/src/gateway/NServiceBus.Gateway/Receiving/IMangageReceiveChannels.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace NServiceBus.Gateway.Receiving -{ - using System.Collections.Generic; - using Channels; - - public interface IMangageReceiveChannels - { - IEnumerable GetReceiveChannels(); - Channel GetDefaultChannel(); - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Routing/Endpoints/DefaultEndpointRouter.cs b/src/gateway/NServiceBus.Gateway/Routing/Endpoints/DefaultEndpointRouter.cs deleted file mode 100644 index 41245bfcb9d..00000000000 --- a/src/gateway/NServiceBus.Gateway/Routing/Endpoints/DefaultEndpointRouter.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace NServiceBus.Gateway.Routing.Endpoints -{ - using Routing; - using Unicast.Transport; - - public class DefaultEndpointRouter : IRouteMessagesToEndpoints - { - public Address MainInputAddress { get; set; } - - public Address GetDestinationFor(TransportMessage messageToSend) - { - return MainInputAddress; - } - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Routing/IRouteMessagesToEndpoints.cs b/src/gateway/NServiceBus.Gateway/Routing/IRouteMessagesToEndpoints.cs deleted file mode 100644 index d3f3486cab6..00000000000 --- a/src/gateway/NServiceBus.Gateway/Routing/IRouteMessagesToEndpoints.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace NServiceBus.Gateway.Routing -{ - using Unicast.Transport; - - public interface IRouteMessagesToEndpoints - { - Address GetDestinationFor(TransportMessage messageToSend); - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Routing/IRouteMessagesToSites.cs b/src/gateway/NServiceBus.Gateway/Routing/IRouteMessagesToSites.cs deleted file mode 100644 index 498b084be9c..00000000000 --- a/src/gateway/NServiceBus.Gateway/Routing/IRouteMessagesToSites.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace NServiceBus.Gateway.Routing -{ - using System.Collections.Generic; - using Unicast.Transport; - - public interface IRouteMessagesToSites - - { - IEnumerable GetDestinationSitesFor(TransportMessage messageToDispatch); - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Routing/Sites/LegacySiteRouter.cs b/src/gateway/NServiceBus.Gateway/Routing/Sites/LegacySiteRouter.cs deleted file mode 100644 index b2b7e16c87e..00000000000 --- a/src/gateway/NServiceBus.Gateway/Routing/Sites/LegacySiteRouter.cs +++ /dev/null @@ -1,40 +0,0 @@ -namespace NServiceBus.Gateway.Routing.Sites -{ - using System.Collections.Generic; - using System.Configuration; - using Channels; - using Unicast.Transport; - - public class LegacySiteRouter : IRouteMessagesToSites - { - private readonly string remoteUrl; - - public LegacySiteRouter() - { - remoteUrl = ConfigurationManager.AppSettings["RemoteUrl"]; - } - - public IEnumerable GetDestinationSitesFor(TransportMessage messageToDispatch) - { - var address = GetRemoteAddress(messageToDispatch); - - return new[] - { - new Site - { - Channel = new Channel {Address = address, Type = "Http"}, - Key = address - } - }; - } - - private string GetRemoteAddress(TransportMessage msg) - { - if (msg.Headers.ContainsKey(Headers.HttpTo)) - return msg.Headers[Headers.HttpTo]; - - return remoteUrl; - } - - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Sending/GatewaySender.cs b/src/gateway/NServiceBus.Gateway/Sending/GatewaySender.cs deleted file mode 100644 index ed2c1a41395..00000000000 --- a/src/gateway/NServiceBus.Gateway/Sending/GatewaySender.cs +++ /dev/null @@ -1,129 +0,0 @@ -namespace NServiceBus.Gateway.Sending -{ - using System; - using System.Collections.Generic; - using System.Linq; - using NServiceBus.Gateway.Config; - using NServiceBus.Gateway.Channels; - using log4net; - using NServiceBus.Gateway.Notifications; - using NServiceBus.ObjectBuilder; - using NServiceBus.Gateway.Routing; - using NServiceBus.Unicast.Queuing; - using NServiceBus.Unicast.Transport; - using NServiceBus.Unicast.Transport.Transactional; - using Receiving; - - public class GatewaySender:IDisposable - { - - public GatewaySender( IBuilder builder, - IMangageReceiveChannels channelManager, - IMessageNotifier notifier, - ISendMessages messageSender, - IMainEndpointSettings settings) - { - this.settings = settings; - this.builder = builder; - this.channelManager = channelManager; - this.notifier = notifier; - this.messageSender = messageSender; - } - - public void Start(Address inputAddress) - { - localAddress = inputAddress; - addressOfAuditStore = settings.AddressOfAuditStore; - - transport = new TransactionalTransport - { - MessageReceiver = settings.Receiver, - IsTransactional = true, - NumberOfWorkerThreads = settings.NumberOfWorkerThreads, - MaxRetries = settings.MaxRetries, - FailureManager = settings.FailureManager - }; - - transport.TransportMessageReceived += OnTransportMessageReceived; - - transport.Start(localAddress); - - Logger.InfoFormat("Gateway started listening on inputs on - {0}", localAddress); - } - - public void Dispose() - { - transport.Dispose(); - Logger.InfoFormat("Gateway stopped"); - } - void OnTransportMessageReceived(object sender, TransportMessageReceivedEventArgs e) - { - var messageToDispatch = e.Message; - - var destinationSites = GetDestinationSitesFor(messageToDispatch); - - //if there is more than 1 destination we break it up into multiple messages - if (destinationSites.Count() > 1) - { - foreach (var destinationSite in destinationSites) - CloneAndSendLocal(messageToDispatch, destinationSite); - - return; - } - - var destination = destinationSites.FirstOrDefault(); - - if (destination == null) - throw new InvalidOperationException("No destination found for message"); - - - SendToSite(messageToDispatch, destination); - } - - IEnumerable GetDestinationSitesFor(TransportMessage messageToDispatch) - { - return builder.BuildAll() - .SelectMany(r => r.GetDestinationSitesFor(messageToDispatch)); - } - - void CloneAndSendLocal(TransportMessage messageToDispatch, Site destinationSite) - { - //todo - do we need to clone? check with Jonathan O - messageToDispatch.Headers[Headers.DestinationSites] = destinationSite.Key; - - messageSender.Send(messageToDispatch, localAddress); - } - - void SendToSite(TransportMessage transportMessage, Site targetSite) - { - transportMessage.Headers[Headers.OriginatingSite] = GetDefaultAddressForThisSite(); - - - //todo - derive this from the message and the channeltype - builder.Build() - .Forward(transportMessage,targetSite); - - notifier.RaiseMessageForwarded("msmq", targetSite.Channel.Type, transportMessage); - - if (addressOfAuditStore != null && addressOfAuditStore != Address.Undefined) - messageSender.Send(transportMessage, addressOfAuditStore); - } - - - string GetDefaultAddressForThisSite() - { - return channelManager.GetDefaultChannel().ToString(); - } - - Address addressOfAuditStore; - readonly IBuilder builder; - readonly IMangageReceiveChannels channelManager; - readonly IMessageNotifier notifier; - readonly ISendMessages messageSender; - ITransport transport; - readonly IMainEndpointSettings settings; - Address localAddress; - - static readonly ILog Logger = LogManager.GetLogger("NServiceBus.Gateway"); - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Sending/IForwardMessagesToSites.cs b/src/gateway/NServiceBus.Gateway/Sending/IForwardMessagesToSites.cs deleted file mode 100644 index 02676f2d5ca..00000000000 --- a/src/gateway/NServiceBus.Gateway/Sending/IForwardMessagesToSites.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace NServiceBus.Gateway.Sending -{ - using Routing; - using Unicast.Transport; - - public interface IForwardMessagesToSites - { - void Forward(TransportMessage message,Site targetSite); - } -} \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/Web.config b/src/gateway/NServiceBus.Gateway/Web.config deleted file mode 100644 index ed947fc3580..00000000000 --- a/src/gateway/NServiceBus.Gateway/Web.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/src/gateway/NServiceBus.Gateway/packages.config b/src/gateway/NServiceBus.Gateway/packages.config deleted file mode 100644 index 7004f58c1e7..00000000000 --- a/src/gateway/NServiceBus.Gateway/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/gateway/gateway.sln b/src/gateway/gateway.sln deleted file mode 100644 index bb4dea5f761..00000000000 --- a/src/gateway/gateway.sln +++ /dev/null @@ -1,32 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Gateway", "NServiceBus.Gateway\NServiceBus.Gateway.csproj", "{1BBA08E8-EC86-4BA3-B6B7-88C6D241AE18}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Gateway.Tests", "NServiceBus.Gateway.Tests\NServiceBus.Gateway.Tests.csproj", "{33632B71-0CAA-4245-A4E3-BA94B563D679}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.Persistence.Raven", "..\impl\Persistence\RavenPersistence\NServiceBus.Persistence.Raven\NServiceBus.Persistence.Raven.csproj", "{37CB5DE9-013D-4779-9D35-342F902E8DE1}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1BBA08E8-EC86-4BA3-B6B7-88C6D241AE18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1BBA08E8-EC86-4BA3-B6B7-88C6D241AE18}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1BBA08E8-EC86-4BA3-B6B7-88C6D241AE18}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1BBA08E8-EC86-4BA3-B6B7-88C6D241AE18}.Release|Any CPU.Build.0 = Release|Any CPU - {33632B71-0CAA-4245-A4E3-BA94B563D679}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {33632B71-0CAA-4245-A4E3-BA94B563D679}.Debug|Any CPU.Build.0 = Debug|Any CPU - {33632B71-0CAA-4245-A4E3-BA94B563D679}.Release|Any CPU.ActiveCfg = Release|Any CPU - {33632B71-0CAA-4245-A4E3-BA94B563D679}.Release|Any CPU.Build.0 = Release|Any CPU - {37CB5DE9-013D-4779-9D35-342F902E8DE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {37CB5DE9-013D-4779-9D35-342F902E8DE1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {37CB5DE9-013D-4779-9D35-342F902E8DE1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {37CB5DE9-013D-4779-9D35-342F902E8DE1}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/gateway/nuget.config b/src/gateway/nuget.config deleted file mode 100644 index cd17f414bd4..00000000000 --- a/src/gateway/nuget.config +++ /dev/null @@ -1,4 +0,0 @@ - - - ../../packages - \ No newline at end of file diff --git a/src/headers/NServiceBus.MessageHeaders/Bootstrapper.cs b/src/headers/NServiceBus.MessageHeaders/Bootstrapper.cs deleted file mode 100644 index 157560ffeb4..00000000000 --- a/src/headers/NServiceBus.MessageHeaders/Bootstrapper.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using NServiceBus.Config; -using NServiceBus.ObjectBuilder; - -namespace NServiceBus.MessageHeaders -{ - class Bootstrapper : INeedInitialization, IWantToRunWhenConfigurationIsComplete - { - void INeedInitialization.Init() - { - Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); - } - - public void Run() - { - ExtensionMethods.GetHeaderAction = (msg, key) => Manager.GetHeader(msg, key); - ExtensionMethods.SetHeaderAction = (msg, key, val) => Manager.SetHeader(msg, key, val); - ExtensionMethods.GetStaticOutgoingHeadersAction = () => Manager.GetStaticOutgoingHeaders(); - } - - public MessageHeaderManager Manager { get; set; } - } -} diff --git a/src/headers/NServiceBus.MessageHeaders/MessageHeaderManager.cs b/src/headers/NServiceBus.MessageHeaders/MessageHeaderManager.cs deleted file mode 100644 index 66df9b79bad..00000000000 --- a/src/headers/NServiceBus.MessageHeaders/MessageHeaderManager.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using System.Collections.Generic; -using NServiceBus.MessageMutator; -using NServiceBus.Unicast; -using NServiceBus.Unicast.Transport; - -namespace NServiceBus.MessageHeaders -{ - /// - /// Message Header Manager - /// - public class MessageHeaderManager : IMutateOutgoingTransportMessages - { - void IMutateOutgoingTransportMessages.MutateOutgoing(object[] messages, TransportMessage transportMessage) - { - foreach(var key in staticOutgoingHeaders.Keys) - transportMessage.Headers.Add(key, staticOutgoingHeaders[key]); - - if ((messages != null) && (messages.Length > 0) && (messageHeaders != null)) - if (messageHeaders.ContainsKey(messages[0])) - foreach(var key in messageHeaders[messages[0]].Keys) - transportMessage.Headers.Add(key, messageHeaders[messages[0]][key]); - } - - /// - /// Gets the Header for the Message - /// - /// message for which Headers to be find - /// Key - /// - public string GetHeader(object message, string key) - { - if (message == ExtensionMethods.CurrentMessageBeingHandled) - if (bus.CurrentMessageContext.Headers.ContainsKey(key)) - return bus.CurrentMessageContext.Headers[key]; - else - return null; - - if (messageHeaders == null) - return null; - - if (!messageHeaders.ContainsKey(message)) - return null; - - if (messageHeaders[message].ContainsKey(key)) - return messageHeaders[message][key]; - - return null; - } - - /// - /// Sets the Header for the Message - /// - /// - /// - /// - public void SetHeader(object message, string key, string value) - { - if (message == null) - throw new InvalidOperationException("Cannot set headers on a null object"); - - if (messageHeaders == null) - messageHeaders = new Dictionary>(); - - if (!messageHeaders.ContainsKey(message)) - messageHeaders.Add(message, new Dictionary()); - - if (!messageHeaders[message].ContainsKey(key)) - messageHeaders[message].Add(key, value); - else - messageHeaders[message][key] = value; - } - - /// - /// Gets Static Outgoing Headers - /// - /// - public IDictionary GetStaticOutgoingHeaders() - { - return staticOutgoingHeaders; - } - - /// - /// Bus - /// - public IUnicastBus Bus - { - get { return bus; } - set - { - bus = value; - bus.MessagesSent += - (s2, a2) => - { - if (a2.Messages != null && messageHeaders != null) - foreach (var msg in a2.Messages) - messageHeaders.Remove(msg); - }; - } - } - private IUnicastBus bus; - - private static IDictionary staticOutgoingHeaders = new Dictionary(); - - [ThreadStatic] - private static IDictionary> messageHeaders; - } -} diff --git a/src/headers/NServiceBus.MessageHeaders/NServiceBus.MessageHeaders.csproj b/src/headers/NServiceBus.MessageHeaders/NServiceBus.MessageHeaders.csproj deleted file mode 100644 index a546cc838cd..00000000000 --- a/src/headers/NServiceBus.MessageHeaders/NServiceBus.MessageHeaders.csproj +++ /dev/null @@ -1,86 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {9EE6366B-E0A4-45B5-AE08-E8CEF58862E4} - Library - Properties - NServiceBus.MessageHeaders - NServiceBus.MessageHeaders - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\NServiceBus.MessageHeaders.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - ..\..\..\build\output\NServiceBus.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Config.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.MessageMutator.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.ObjectBuilder.Common.Config.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.dll - False - - - ..\..\..\build\nservicebus.core\NServiceBus.Unicast.Transport.dll - False - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/headers/NServiceBus.MessageHeaders/Properties/AssemblyInfo.cs b/src/headers/NServiceBus.MessageHeaders/Properties/AssemblyInfo.cs deleted file mode 100644 index 754fcc2d691..00000000000 Binary files a/src/headers/NServiceBus.MessageHeaders/Properties/AssemblyInfo.cs and /dev/null differ diff --git a/src/headers/headers.sln b/src/headers/headers.sln deleted file mode 100644 index ab5876f74b8..00000000000 --- a/src/headers/headers.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NServiceBus.MessageHeaders", "NServiceBus.MessageHeaders\NServiceBus.MessageHeaders.csproj", "{9EE6366B-E0A4-45B5-AE08-E8CEF58862E4}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9EE6366B-E0A4-45B5-AE08-E8CEF58862E4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9EE6366B-E0A4-45B5-AE08-E8CEF58862E4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9EE6366B-E0A4-45B5-AE08-E8CEF58862E4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9EE6366B-E0A4-45B5-AE08-E8CEF58862E4}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/hosting/NServiceBus.Hosting.Tests/App.config b/src/hosting/NServiceBus.Hosting.Tests/App.config new file mode 100644 index 00000000000..debb6c65903 --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Tests/App.config @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Tests/AssemblyListExtensions/AllTypesAssignableToTests.cs b/src/hosting/NServiceBus.Hosting.Tests/AssemblyListExtensions/AllTypesAssignableToTests.cs new file mode 100644 index 00000000000..9ca7c78e70e --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Tests/AssemblyListExtensions/AllTypesAssignableToTests.cs @@ -0,0 +1,62 @@ +namespace NServiceBus.Hosting.Tests.AssemblyListExtensions +{ + using System; + using System.Collections.Generic; + using System.Linq; + using Helpers; + using NUnit.Framework; + + [TestFixture] + public class AllTypesAssignableToTests + { + public interface IInterfaceChild : IProfile + { + } + + public class ClassChild : IInterfaceChild + { + } + + public class ClassNotImplementing + { + } + + public abstract class Abstract : IProfile + { + } + + public class Concrete : Abstract + { + } + + [Test] + public void ShouldContainAllImplementations() + { + List types = AssemblyPathHelper.GetAllAssemblies() + .AllTypesAssignableTo() + .ToList(); + Assert.IsTrue(types.Any(x => x.Name == "ClassChild")); + Assert.IsTrue(types.Any(x => x.Name == "IInterfaceChild")); + Assert.IsTrue(types.Any(x => x.Name == "Abstract")); + Assert.IsTrue(types.Any(x => x.Name == "Concrete")); + } + + [Test] + public void ShouldNotContainNonImpl() + { + List types = AssemblyPathHelper.GetAllAssemblies() + .AllTypesAssignableTo() + .ToList(); + Assert.IsFalse(types.Any(x => x.Name == "ClassNotImplementing")); + } + + [Test] + public void ShouldNotContainSelf() + { + List types = AssemblyPathHelper.GetAllAssemblies() + .AllTypesAssignableTo() + .ToList(); + Assert.IsFalse(types.Any(x => x.Name == "IProfile")); + } + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Tests/AssemblyListExtensions/WhereConcreteTests.cs b/src/hosting/NServiceBus.Hosting.Tests/AssemblyListExtensions/WhereConcreteTests.cs new file mode 100644 index 00000000000..de390e00831 --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Tests/AssemblyListExtensions/WhereConcreteTests.cs @@ -0,0 +1,42 @@ +namespace NServiceBus.Hosting.Tests.AssemblyListExtensions +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + using Helpers; + using NUnit.Framework; + + [TestFixture] + public class WhereConcreteTests + { + public interface IInterfaceChild + { + } + + public class Class + { + } + + public abstract class Abstract + { + } + + public class Concrete : Abstract + { + } + + [Test] + public void ValidateIncludedTypes() + { + List types = Assembly.GetExecutingAssembly() + .GetTypes() + .WhereConcrete() + .ToList(); + Assert.IsTrue(types.Any(x => x.Name == "Class")); + Assert.IsTrue(types.Any(x => x.Name == "Concrete")); + Assert.IsFalse(types.Any(x => x.Name == "Abstract")); + Assert.IsFalse(types.Any(x => x.Name == "IInterfaceChild")); + } + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Tests/AssemblyPathHelper.cs b/src/hosting/NServiceBus.Hosting.Tests/AssemblyPathHelper.cs new file mode 100644 index 00000000000..3d8ab682ead --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Tests/AssemblyPathHelper.cs @@ -0,0 +1,26 @@ +namespace NServiceBus.Hosting.Tests +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Reflection; + + public class AssemblyPathHelper + { + public static List GetAllAssemblies() + { + string codeBase = Assembly.GetExecutingAssembly().CodeBase; + var uri = new UriBuilder(codeBase); + string path = Uri.UnescapeDataString(uri.Path); + string directoryName = Path.GetDirectoryName(path); + List files = Directory.EnumerateFiles(directoryName, "*.dll").ToList(); + + List allAssemblies = files + .Select(Assembly.LoadFrom) + .ToList(); + + return allAssemblies; + } + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Tests/ConfigManagerTests.cs b/src/hosting/NServiceBus.Hosting.Tests/ConfigManagerTests.cs new file mode 100644 index 00000000000..0c585ad3bb0 --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Tests/ConfigManagerTests.cs @@ -0,0 +1,77 @@ +namespace NServiceBus.Hosting.Tests +{ + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + using Configuration; + using NUnit.Framework; + + [TestFixture] + public class ConfigManagerTests + { + public interface IWantCustomInitializationChild : IWantCustomInitialization + { + } + + public class WantCustomInitializationChild : IWantCustomInitializationChild + { + public void Init() + { + } + } + + public class ClassNotImplementing + { + } + + public class ConfigureThisEndpoint : IConfigureThisEndpoint + { + } + + public class WantCustomInitialization : IWantCustomInitialization + { + public void Init() + { + } + } + + public abstract class AbstractWantCustomInitialization : IWantCustomInitialization + { + public void Init() + { + } + } + + public class ConcreteWantCustomInitialization : AbstractWantCustomInitialization + { + } + + [Test] + public void ExcludeIConfigureThisEndpoint() + { + var configManager = new ConfigManager(new List {typeof (ConfigManagerTests).Assembly}, null); + Assert.IsTrue(!configManager.toInitialize.All(x => typeof (IConfigureThisEndpoint).IsAssignableFrom(x))); + } + + [Test] + public void ShouldAllImplementInterface() + { + var configManager = new ConfigManager(new List {typeof (ConfigManagerTests).Assembly}, null); + Assert.IsTrue(configManager.toInitialize.All(x => typeof (IWantCustomInitialization).IsAssignableFrom(x))); + } + + [Test] + public void ShouldNotContainAbstractClasses() + { + var configManager = new ConfigManager(new List {typeof (ConfigManagerTests).Assembly}, null); + Assert.AreEqual(0, configManager.toInitialize.Count(x => x.IsAbstract)); + } + + [Test] + public void ShouldNotContainInterfaces() + { + var configManager = new ConfigManager(new List {typeof (ConfigManagerTests).Assembly}, null); + Assert.AreEqual(0, configManager.toInitialize.Count(x => x.IsInterface)); + } + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Tests/EndpointTypeDeterminerTests.cs b/src/hosting/NServiceBus.Hosting.Tests/EndpointTypeDeterminerTests.cs new file mode 100644 index 00000000000..d7ae2dad0a3 --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Tests/EndpointTypeDeterminerTests.cs @@ -0,0 +1,154 @@ +namespace NServiceBus.Hosting.Tests +{ + namespace EndpointTypeDeterminerTests + { + using System; + using System.Configuration; + using System.Reflection; + using System.Reflection.Emit; + using EndpointTypeTests; + using Helpers; + using NUnit.Framework; + using Windows; + using Windows.Arguments; + + public abstract class TestContext + { + protected AssemblyScannerResults AssemblyScannerResults; + protected Type EndpointTypeDefinedInConfigurationFile = typeof (ConfigWithCustomTransport); + protected Type RetrievedEndpointType; + protected EndpointTypeDeterminer Sut; + } + + [TestFixture] + public class GetEndpointConfigurationTypeForHostedEndpoint_Tests : TestContext + { + HostArguments hostArguments; + + [TestFixtureSetUp] + public void TestFixtureSetup() + { + AssemblyScannerResults = AssemblyScanner.GetScannableAssemblies(); + } + + [Test] + public void + when_endpoint_type_is_not_provided_via_hostargs_it_should_fall_through_to_other_modes_of_determining_endpoint_type + () + { + Sut = new EndpointTypeDeterminer(AssemblyScannerResults, + () => ConfigurationManager.AppSettings["EndpointConfigurationType"]); + hostArguments = new HostArguments(new string[0]); + + // will match with config-based type + RetrievedEndpointType = Sut.GetEndpointConfigurationTypeForHostedEndpoint(hostArguments).Type; + + Assert.AreEqual(EndpointTypeDefinedInConfigurationFile, RetrievedEndpointType); + } + + [Test] + public void when_endpoint_type_is_provided_via_hostargs_it_should_have_first_priority() + { + Sut = new EndpointTypeDeterminer(AssemblyScannerResults, + () => ConfigurationManager.AppSettings["EndpointConfigurationType"]); + hostArguments = new HostArguments(new string[0]) + { + EndpointConfigurationType = typeof (TestEndpointType).AssemblyQualifiedName + }; + + RetrievedEndpointType = Sut.GetEndpointConfigurationTypeForHostedEndpoint(hostArguments).Type; + + Assert.AreEqual(typeof (TestEndpointType), RetrievedEndpointType); + } + + [Test] + [ExpectedException(typeof (ConfigurationErrorsException))] + public void when_invalid_endpoint_type_is_provided_via_hostargs_it_should_blow_up() + { + Sut = new EndpointTypeDeterminer(AssemblyScannerResults, + () => ConfigurationManager.AppSettings["EndpointConfigurationType"]); + hostArguments = new HostArguments(new string[0]) + { + EndpointConfigurationType = "I am an invalid type name" + }; + + RetrievedEndpointType = Sut.GetEndpointConfigurationTypeForHostedEndpoint(hostArguments).Type; + } + } + + [TestFixture] + public class GetEndpointConfigurationType_Tests : TestContext + { + Assembly BuildTestEndpointAssembly(out Type endpointType) + { + AppDomain appDomain = AppDomain.CurrentDomain; + var aname = new AssemblyName("MyDynamicAssembly"); + AssemblyBuilder assemBuilder = appDomain.DefineDynamicAssembly(aname, AssemblyBuilderAccess.Run); + ModuleBuilder modBuilder = assemBuilder.DefineDynamicModule("DynModule"); + TypeBuilder tb = modBuilder.DefineType("TestEndpoint", TypeAttributes.Public, typeof (Object), + new[] {typeof (IConfigureThisEndpoint)}); + endpointType = tb.CreateType(); + return assemBuilder; + } + + [Test] + public void when_endpoint_type_is_found_via_assembly_scanning_it_should_have_second_priority() + { + AssemblyScannerResults = new AssemblyScannerResults(); + Type endpointTypeInAssembly; + Assembly dynamicAssembly = BuildTestEndpointAssembly(out endpointTypeInAssembly); + AssemblyScannerResults.Assemblies.Add(dynamicAssembly); + Sut = new EndpointTypeDeterminer(AssemblyScannerResults, () => null); + + RetrievedEndpointType = Sut.GetEndpointConfigurationType().Type; + + Assert.AreEqual(endpointTypeInAssembly, RetrievedEndpointType); + } + + [Test] + public void when_endpoint_type_is_provided_via_configuration_it_should_have_first_priority() + { + Sut = new EndpointTypeDeterminer(AssemblyScanner.GetScannableAssemblies(), + () => ConfigurationManager.AppSettings["EndpointConfigurationType"]); + + RetrievedEndpointType = Sut.GetEndpointConfigurationType().Type; + + Assert.AreEqual(EndpointTypeDefinedInConfigurationFile, RetrievedEndpointType); + } + + [Test] + [ExpectedException(typeof (ConfigurationErrorsException), + ExpectedMessage = "The 'EndpointConfigurationType' entry in the NServiceBus.Host.exe.config", + MatchType = MessageMatch.StartsWith)] + public void when_invalid_endpoint_type_is_provided_via_configuration_it_should_blow_up() + { + Sut = new EndpointTypeDeterminer(AssemblyScanner.GetScannableAssemblies(), + () => "I am an invalid type name"); + + RetrievedEndpointType = Sut.GetEndpointConfigurationType().Type; + } + + [Test] + [ExpectedException(typeof (InvalidOperationException), + ExpectedMessage = "Host doesn't support hosting of multiple endpoints", + MatchType = MessageMatch.StartsWith)] + public void when_multiple_endpoint_types_found_via_assembly_scanning_it_should_blow_up() + { + Sut = new EndpointTypeDeterminer(AssemblyScanner.GetScannableAssemblies(), () => null); + + RetrievedEndpointType = Sut.GetEndpointConfigurationType().Type; + } + + [Test] + [ExpectedException(typeof (InvalidOperationException), + ExpectedMessage = "No endpoint configuration found in scanned assemblies", + MatchType = MessageMatch.StartsWith)] + public void when_no_endpoint_type_found_via_configuration_or_assembly_scanning_it_should_blow_up() + { + Sut = new EndpointTypeDeterminer(new AssemblyScannerResults(), () => null); + + RetrievedEndpointType = Sut.GetEndpointConfigurationType().Type; + } + } + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Tests/EndpointTypeTests.cs b/src/hosting/NServiceBus.Hosting.Tests/EndpointTypeTests.cs new file mode 100644 index 00000000000..f57bd372138 --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Tests/EndpointTypeTests.cs @@ -0,0 +1,183 @@ +namespace NServiceBus.Hosting.Tests +{ + namespace EndpointTypeTests + { + using System; + using NUnit.Framework; + using Windows; + using Windows.Arguments; + + public abstract class TestContext + { + protected EndpointType Sut; + protected string TestValue; + } + + [TestFixture] + public class OtherProperty_Getter_Tests : TestContext + { + [TestFixtureSetUp] + public void TestFixtureSetup() + { + Sut = new EndpointType(typeof (TestEndpointType)); + } + + [Test] + public void the_assemblyqualifiedname_getter_should_not_blow_up() + { + TestValue = Sut.AssemblyQualifiedName; + } + + [Test] + public void the_endpointconfigurationfile_getter_should_not_blow_up() + { + TestValue = Sut.EndpointConfigurationFile; + } + + [Test] + public void the_endpointversion_getter_should_not_blow_up() + { + TestValue = Sut.EndpointVersion; + } + } + + [TestFixture] + public class EndpointName_Getter_Tests : TestContext + { + [SetUp] + public void Setup() + { + // configuration hangs around between tests - have to clear it + Configure.With().DefineEndpointName((Func) null); + } + + HostArguments hostArguments; + + [TestFixtureSetUp] + public void TestFixtureSetup() + { + hostArguments = new HostArguments(new string[0]) + { + EndpointName = "EndpointNameFromHostArgs" + }; + } + + [Test] + public void when_endpointname_attribute_exists_it_should_have_first_priority() + { + Configure.With().DefineEndpointName("EndpointNameFromConfiguration"); + Sut = new EndpointType(hostArguments, typeof (TestEndpointTypeWithEndpointNameAttribute)); + + Assert.AreEqual("EndpointNameFromAttribute", Sut.EndpointName); + } + + [Test] + [Ignore("this hasn't been implemented yet as far as i can tell")] + public void when_endpointname_is_provided_via_configuration_it_should_have_second_priority() + { + Configure.With().DefineEndpointName("EndpointNameFromConfiguration"); + Sut = new EndpointType(hostArguments, typeof (TestEndpointType)); + + Assert.AreEqual("EndpointNameFromConfiguration", Sut.EndpointName); + } + + [Test] + public void when_endpointname_is_provided_via_hostargs_it_should_have_third_priority() + { + Sut = new EndpointType(hostArguments, typeof (TestEndpointType)); + + Assert.AreEqual("EndpointNameFromHostArgs", Sut.EndpointName); + } + + [Test] + [Ignore( + "not sure how to test this when interface marked as obsolete - get build errors if interface is referenced" + )] + public void when_inamethisendpoint_is_implemented_it_should_have_second_priority() + { + } + + [Test] + public void when_no_endpointname_defined_it_should_return_null() + { + hostArguments.EndpointName = null; + Sut = new EndpointType(hostArguments, typeof (TestEndpointType)); + Assert.IsNull(Sut.EndpointName); + } + } + + [TestFixture] + public class ServiceName_Getter_Tests : TestContext + { + HostArguments hostArguments; + + [Test] + public void + when_servicename_is_not_provided_via_hostargs_and_endpoint_has_a_namespace_it_should_use_the_namespace() + { + hostArguments = new HostArguments(new string[0]); + Sut = new EndpointType(hostArguments, typeof (TestEndpointType)); + + Assert.AreEqual("NServiceBus.Hosting.Tests.EndpointTypeTests", Sut.ServiceName); + } + + [Test] + public void + when_servicename_is_not_provided_via_hostargs_and_endpoint_has_no_namespace_it_should_use_the_assembly_name + () + { + hostArguments = new HostArguments(new string[0]); + Sut = new EndpointType(hostArguments, typeof (TestEndpointTypeWithoutANamespace)); + + Assert.AreEqual("NServiceBus.Hosting.Tests", Sut.ServiceName); + } + + [Test] + public void when_servicename_is_provided_via_hostargs_it_should_have_first_priority() + { + hostArguments = new HostArguments(new string[0]) + { + ServiceName = "ServiceNameFromHostArgs" + }; + Sut = new EndpointType(hostArguments, typeof (TestEndpointType)); + + Assert.AreEqual("ServiceNameFromHostArgs", Sut.ServiceName); + } + } + + [TestFixture] + public class Constructor_Tests + { + protected EndpointType Sut; + + [Test] + [ExpectedException(typeof (InvalidOperationException), + ExpectedMessage = "Endpoint configuration type needs to have a default constructor", + MatchType = MessageMatch.StartsWith)] + public void When_type_does_not_have_empty_public_constructor_it_should_blow_up() + { + Sut = new EndpointType(typeof (TypeWithoutEmptyPublicConstructor)); + } + } + + internal class TypeWithoutEmptyPublicConstructor + { + public TypeWithoutEmptyPublicConstructor(object foo) + { + } + } + + internal class TestEndpointType + { + } + + [EndpointName("EndpointNameFromAttribute")] + internal class TestEndpointTypeWithEndpointNameAttribute + { + } + } +} + +internal class TestEndpointTypeWithoutANamespace +{ +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Tests/NServiceBus.Hosting.Tests.csproj b/src/hosting/NServiceBus.Hosting.Tests/NServiceBus.Hosting.Tests.csproj index c1446957633..af6990442b0 100644 --- a/src/hosting/NServiceBus.Hosting.Tests/NServiceBus.Hosting.Tests.csproj +++ b/src/hosting/NServiceBus.Hosting.Tests/NServiceBus.Hosting.Tests.csproj @@ -13,6 +13,10 @@ v4.0 512 + true + ..\..\NServiceBus.snk + ..\..\..\ + true true @@ -22,6 +26,8 @@ DEBUG;TRACE prompt 4 + + pdbonly @@ -30,38 +36,65 @@ TRACE prompt 4 + + - + False - ..\..\..\lib\log4net.dll + ..\..\..\packages\Castle.Core.3.2.0\lib\net40-client\Castle.Core.dll - + False - ..\..\..\build\output\NServiceBus.dll + ..\..\..\packages\Castle.Windsor.3.2.0\lib\net40\Castle.Windsor.dll - - False - ..\..\..\build\output\NServiceBus.Core.dll + + ..\..\..\packages\Iesi.Collections.3.3.3.4000\lib\Net35\Iesi.Collections.dll + + + ..\..\..\packages\NHibernate.3.3.3.4000\lib\Net35\NHibernate.dll - False - ..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll + ..\..\..\packages\NUnit.2.6.2\lib\nunit.framework.dll + 3.5 + + + + + + + + + + + - - {B5F333D1-D6B1-49FB-82F6-74641E5D11E3} - NServiceBus.Hosting + + {dd48b2d0-e996-412d-9157-821ed8b17a9d} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11} + NServiceBus.Hosting.Windows + + + + + + \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Tests/PreserveStackTracePreserverTests.cs b/src/hosting/NServiceBus.Hosting.Tests/PreserveStackTracePreserverTests.cs new file mode 100644 index 00000000000..26a4817bf1d --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Tests/PreserveStackTracePreserverTests.cs @@ -0,0 +1,62 @@ +namespace NServiceBus.Hosting.Tests +{ + using System; + using System.Runtime.CompilerServices; + using Windows; + using NUnit.Framework; + + [TestFixture] + public class PreserveStackTracePreserverTests + { + + [Test] + public void PreservedStackTraceShouldInclude() + { + //Note the NoInlining below is to prevent the JIT from optimizing out the stack trace + var preservedException = Assert.Throws(MethodThatReThrowsInnerExceptionWithPreserve); + var actual = "actual: " + preservedException.StackTrace; + Assert.IsTrue(preservedException.StackTrace.Contains("MethodThatThrows2"), actual); + Assert.IsTrue(preservedException.StackTrace.Contains("MethodThatThrows1"), actual); + } + + + [MethodImpl(MethodImplOptions.NoInlining)] + void MethodThatReThrowsInnerExceptionWithPreserve() + { + try + { + MethodThatThrowsWithInnerException(); + } + catch (Exception exception) + { + var innerException = exception.InnerException; + innerException.PreserveStackTrace(); + throw innerException; + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + void MethodThatThrowsWithInnerException() + { + try + { + MethodThatThrows1(); + } + catch (Exception exception) + { + throw new Exception("bar", exception); + } + } + + [MethodImpl(MethodImplOptions.NoInlining)] + void MethodThatThrows1() + { + MethodThatThrows2(); + } + [MethodImpl(MethodImplOptions.NoInlining)] + void MethodThatThrows2() + { + throw new Exception("Foo"); + } + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Tests/ProfileManagerTests.cs b/src/hosting/NServiceBus.Hosting.Tests/ProfileManagerTests.cs new file mode 100644 index 00000000000..ba8ae12e5da --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Tests/ProfileManagerTests.cs @@ -0,0 +1,651 @@ +namespace NServiceBus.Hosting.Tests +{ + using System; + using System.Collections.Generic; + using System.Linq; + using System.Reflection; + using NUnit.Framework; + using Profiles; + + [TestFixture] + public class ProfileManagerTests + { + static List allAssemblies = AssemblyPathHelper.GetAllAssemblies(); + + [TestFixture] + public class When_a_profile_is_a_interface + { + public interface InterfaceProfile : IProfile + { + } + + public class InterfaceProfileHandler : IHandleProfile + { + internal static bool activated; + + public void ProfileActivated() + { + activated = true; + } + } + + [Test] + public void Should_exist_in_active_profiles() + { + var profiles = new[] + { + typeof(InterfaceProfile).FullName, + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + + Assert.Contains(typeof(InterfaceProfile), profileManager.activeProfiles); + } + [Test] + public void Should_be_activated() + { + var profiles = new[] + { + typeof(InterfaceProfile).FullName, + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + profileManager.ActivateProfileHandlers(); + Assert.IsTrue(InterfaceProfileHandler.activated); + } + [Test] + public void Should_be_returned_as_an_implementation() + { + var profiles = new[] + { + typeof(InterfaceProfile).FullName, + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + var implementations = profileManager.GetImplementor(typeof(IHandleProfile<>)) + .ToList(); + Assert.IsTrue(implementations.Any(x => x.GetType() == typeof(InterfaceProfileHandler))); + } + } + [TestFixture] + public class When_a_profile_is_a_class + { + public class ClassProfile : IProfile + { + } + + public class ClassProfileHandler : IHandleProfile + { + internal static bool activated; + + public void ProfileActivated() + { + activated = true; + } + } + + [Test] + public void Should_exist_in_active_profiles() + { + var profiles = new[] + { + typeof(ClassProfile).FullName, + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + + Assert.Contains(typeof(ClassProfile), profileManager.activeProfiles); + } + [Test] + public void Should_be_activated() + { + var profiles = new[] + { + typeof(ClassProfile).FullName, + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + profileManager.ActivateProfileHandlers(); + Assert.IsTrue(ClassProfileHandler.activated); + } + [Test] + public void Should_be_returned_as_an_implementation() + { + var profiles = new[] + { + typeof(ClassProfile).FullName, + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + var implementations = profileManager.GetImplementor(typeof(IHandleProfile<>)) + .ToList(); + Assert.IsTrue(implementations.Any(x => x.GetType() == typeof(ClassProfileHandler))); + } + } + + [TestFixture] + public class When_profiles_are_inherited_interfaces + { + public interface ChildProfile : BaseProfile + { + } + public interface BaseProfile : IProfile + { + } + + public class ChildProfileHandler : IHandleProfile + { + public static bool activated; + + public void ProfileActivated() + { + activated = true; + } + } + + public class BaseProfileHandler : IHandleProfile + { + public static bool activated; + + public void ProfileActivated() + { + activated = true; + } + } + [Test] + public void All_profiles_should_be_registered_in_active_profiles() + { + var profiles = new[] + { + typeof(ChildProfile).FullName, + typeof(BaseProfile).FullName, + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + + Assert.AreEqual(2, profileManager.activeProfiles.Count); + Assert.Contains(typeof(ChildProfile), profileManager.activeProfiles); + Assert.Contains(typeof(BaseProfile), profileManager.activeProfiles); + } + + [Test] + public void Both_handlers_should_be_activated_for_child_profile() + { + var profiles = new[] { typeof(ChildProfile).FullName }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + profileManager.ActivateProfileHandlers(); + Assert.IsTrue(BaseProfileHandler.activated); + Assert.IsTrue(ChildProfileHandler.activated); + } + [Test] + public void Base_handler_should_be_activated_for_base_profile() + { + var profiles = new[] { typeof(ChildProfile).FullName }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + profileManager.ActivateProfileHandlers(); + Assert.IsTrue(BaseProfileHandler.activated); + Assert.IsTrue(ChildProfileHandler.activated); + } + [Test] + public void Should_return_all_implementations_for_child_profile() + { + var profiles = new[] { typeof(ChildProfile).FullName }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + var implementations = profileManager.GetImplementor(typeof(IHandleProfile<>)) + .ToList(); + Assert.IsTrue(implementations.Any(x => x.GetType() == typeof(ChildProfileHandler))); + Assert.IsTrue(implementations.Any(x => x.GetType() == typeof(BaseProfileHandler))); + } + [Test] + public void Should_return_only_base_implementations_for_base_profile() + { + var profiles = new[] { typeof(BaseProfile).FullName }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + var implementations = profileManager.GetImplementor(typeof(IHandleProfile<>)) + .ToList(); + Assert.AreEqual(1, implementations.Count); + Assert.IsTrue(implementations.Any(x => x.GetType() == typeof(BaseProfileHandler))); + } + + [Test] + public void Should_not_return_child_implementations_when_using_a_base_profile() + { + var profiles = new[] { typeof(BaseProfile).FullName }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + var implementations = profileManager.GetImplementor(typeof(IHandleProfile<>)) + .ToList(); + Assert.IsTrue(implementations.Any(x => x.GetType() == typeof(BaseProfileHandler))); + Assert.IsFalse(implementations.Any(x => x.GetType() == typeof(ChildProfileHandler))); + } + + [Test] + public void Should_not_duplicate_implementations_when_using_both_profiles() + { + var profiles = new[] + { + typeof (BaseProfile).FullName, + typeof (ChildProfile).FullName + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + var implementations = profileManager.GetImplementor(typeof(IHandleProfile<>)) + .ToList(); + Assert.AreEqual(2, implementations.Count); + Assert.IsTrue(implementations.Any(x => x.GetType() == typeof(BaseProfileHandler))); + Assert.IsTrue(implementations.Any(x => x.GetType() == typeof(ChildProfileHandler))); + } + } + + [TestFixture] + public class When_passing_no_arguments + { + + [Test] + public void Should_use_default_profile() + { + var profileManager = new ProfileManager(allAssemblies, null, new string[] { }, new List { typeof(Production) }); + + Assert.AreEqual(1, profileManager.activeProfiles.Count); + Assert.AreEqual(typeof(Production), profileManager.activeProfiles.First()); + } + } + + [TestFixture] + public class When_a_profile_implements_multiple_profiles + { + public interface MyProfile : AlsoThisInterface + { + } + + public interface AlsoThisInterface : IProfile + { + } + + public class Handler : IHandleProfile + { + public static int activatedCount; + + public void ProfileActivated() + { + activatedCount++; + } + } + [Test] + public void All_profiles_should_be_registered_in_active_profiles() + { + var profiles = new[] {typeof (MyProfile).FullName}; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + Assert.Contains(typeof (MyProfile), profileManager.activeProfiles); + Assert.Contains(typeof (AlsoThisInterface), profileManager.activeProfiles); + } + [Test] + public void Should_not_duplicate_profiles() + { + var profiles = new[] {typeof (MyProfile).FullName}; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + Assert.AreEqual(2, profileManager.activeProfiles.Count); + } + [Test] + public void Handlers_should_be_activated_once() + { + var profiles = new[] { typeof(MyProfile).FullName }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + profileManager.ActivateProfileHandlers(); + Assert.AreEqual(1, Handler.activatedCount ); + } + } + + + + [TestFixture] + public class When_multiple_handlers_for_a_profile_exist + { + + public interface Profile : IProfile + { + } + + public class Handler1 : IHandleProfile + { + public static bool activated; + + public void ProfileActivated() + { + activated = true; + } + } + + public class Handler2 : IHandleProfile + { + public static bool activated; + public void ProfileActivated() + { + activated = true; + } + } + + [Test] + public void Should_return_all_implementations() + { + var profiles = new[] + { + typeof (Profile).FullName, + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + var implementations = profileManager.GetImplementor(typeof(IHandleProfile<>)) + .ToList(); + Assert.AreEqual(2, implementations.Count); + Assert.IsTrue(implementations.Any(x => x.GetType() == typeof(Handler2))); + Assert.IsTrue(implementations.Any(x => x.GetType() == typeof(Handler1))); + } + + [Test] + public void Both_handlers_should_be_activated() + { + var profiles = new[] + { + typeof (Profile).FullName, + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + profileManager.ActivateProfileHandlers(); + Assert.IsTrue(Handler1.activated); + Assert.IsTrue(Handler2.activated); + } + } + + [TestFixture] + [Explicit] + public class When_multiple_profile_exist + { + static List activationOrderList = new List(); + + public interface Profile1 : IProfile + { + } + + public interface Profile2 : IProfile + { + } + + public class Handler1 : IHandleProfile + { + public void ProfileActivated() + { + activationOrderList.Add(this); + } + } + + public class Handler2 : IHandleProfile + { + public void ProfileActivated() + { + activationOrderList.Add(this); + } + } + + [Test] + public void Should_be_correctly_ordered_in_active_profiles() + { + var profilesA = new[] + { + typeof (Profile1).FullName, + typeof (Profile2).FullName, + }; + var profileManagerA = new ProfileManager(allAssemblies, null, profilesA, null); + Assert.AreEqual(typeof(Profile1), profileManagerA.activeProfiles[0]); + Assert.AreEqual(typeof(Profile2), profileManagerA.activeProfiles[1]); + + var profilesB = new[] + { + typeof (Profile2).FullName, + typeof (Profile1).FullName, + }; + var profileManagerB = new ProfileManager(allAssemblies, null, profilesB, null); + Assert.AreEqual(typeof(Profile2), profileManagerB.activeProfiles[0]); + Assert.AreEqual(typeof(Profile1), profileManagerB.activeProfiles[1]); + } + + [Test] + public void Should_get_implementations_in_order() + { + var profilesA = new[] + { + typeof (Profile1).FullName, + typeof (Profile2).FullName, + }; + var profileManagerA = new ProfileManager(allAssemblies, null, profilesA, null); + var implementationsA = profileManagerA.GetImplementor(typeof(IHandleProfile<>)) + .ToList(); + Assert.IsInstanceOf(implementationsA[0]); + Assert.IsInstanceOf(implementationsA[1]); + + var profilesB = new[] + { + typeof (Profile2).FullName, + typeof (Profile1).FullName, + }; + var profileManagerB = new ProfileManager(allAssemblies, null, profilesB, null); + var implementationsB = profileManagerB.GetImplementor(typeof(IHandleProfile<>)) + .ToList(); + Assert.IsInstanceOf(implementationsB[0]); + Assert.IsInstanceOf(implementationsB[1]); + } + [Test] + public void Should_activate_in_order() + { + var profilesA = new[] + { + typeof (Profile1).FullName, + typeof (Profile2).FullName, + }; + var profileManagerA = new ProfileManager(allAssemblies, null, profilesA, null); + profileManagerA.ActivateProfileHandlers(); + Assert.IsInstanceOf(activationOrderList[0]); + Assert.IsInstanceOf(activationOrderList[1]); + + activationOrderList.Clear(); + + var profilesB = new[] + { + typeof (Profile2).FullName, + typeof (Profile1).FullName, + }; + var profileManagerB = new ProfileManager(allAssemblies, null, profilesB, null); + profileManagerB.ActivateProfileHandlers(); + Assert.IsInstanceOf(activationOrderList[0]); + Assert.IsInstanceOf(activationOrderList[1]); + } + + } + [TestFixture] + public class When_abstract_base_handler + { + public interface Profile : IProfile + { + } + + public class ChildHandler : AbstractHandler + { + public new static bool activated; + public override void ProfileActivated() + { + activated = true; + } + } + + public abstract class AbstractHandler : IHandleProfile + { + public static bool activated; + public virtual void ProfileActivated() + { + activated = true; + } + } + [Test] + public void Should_return_concrete_implementation() + { + var profiles = new[] + { + typeof (Profile).FullName, + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + var implementations = profileManager.GetImplementor(typeof(IHandleProfile<>)) + .ToList(); + Assert.AreEqual(1, implementations.Count); + Assert.IsTrue(implementations.Any(x => x.GetType() == typeof(ChildHandler))); + } + [Test] + public void Only_child_should_be_activated() + { + var profiles = new[] + { + typeof (Profile).FullName, + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + profileManager.ActivateProfileHandlers(); + Assert.IsTrue(ChildHandler.activated); + Assert.IsFalse(AbstractHandler.activated); + } + + } + [TestFixture] + public class When_handler_implements_IWantTheEndpointConfig + { + + public class ConfigureThisEndpoint : IConfigureThisEndpoint + { + } + public interface Profile : IProfile + { + } + + public class Handler : IHandleProfile, IWantTheEndpointConfig + { + internal static IConfigureThisEndpoint config; + + public void ProfileActivated() + { + } + + public IConfigureThisEndpoint Config + { + get { return config; } + set { config = value; } + } + } + [Test] + public void ActiveProfiles_should_be_set() + { + var profiles = new[] + { + typeof (Profile).FullName, + }; + var configureThisEndpoint = new ConfigureThisEndpoint(); + var profileManager = new ProfileManager(allAssemblies, configureThisEndpoint, profiles, null); + profileManager.ActivateProfileHandlers(); + Assert.AreEqual(configureThisEndpoint, Handler.config); + } + + } + [TestFixture] + public class When_handler_implements_IWantTheListOfActiveProfiles + { + public interface Profile : IProfile + { + } + + public class Handler : IHandleProfile, IWantTheListOfActiveProfiles + { + internal static IEnumerable activeProfiles; + + public void ProfileActivated() + { + } + + public IEnumerable ActiveProfiles + { + get { return activeProfiles; } + set { activeProfiles = value; } + } + } + + [Test] + public void ActiveProfiles_should_be_set() + { + var profiles = new[] + { + typeof (Profile).FullName, + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + profileManager.ActivateProfileHandlers(); + Assert.IsNotNull(Handler.activeProfiles); + Assert.AreEqual(1, Handler.activeProfiles.Count()); + } + + + } + + [TestFixture] + public class When_profiles_are_activated + { + public interface Profile : IProfile + { + } + + public class Handler : IHandleProfile + { + internal static bool activatedCalled; + + public void ProfileActivated() + { + activatedCalled = true; + } + + } + [Test] + public void ProfileActivated_should_be_called() + { + var profiles = new[] + { + typeof (Profile).FullName, + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + profileManager.ActivateProfileHandlers(); + Assert.IsTrue(Handler.activatedCalled); + } + + + } + [TestFixture] + public class When_child_and_base_handlers_implement_a_profile + { + public interface Profile : IProfile + { + } + + public class ChildHandler : BaseHandler + { + public override void ProfileActivated() + { + } + } + + public class BaseHandler : IHandleProfile + { + public virtual void ProfileActivated() + { + } + } + + [Test] + public void Should_return_all_implementations() + { + var profiles = new[] + { + typeof (Profile).FullName, + }; + var profileManager = new ProfileManager(allAssemblies, null, profiles, null); + var implementations = profileManager.GetImplementor(typeof(IHandleProfile<>)) + .ToList(); + Assert.AreEqual(2, implementations.Count); + Assert.IsTrue(implementations.Any(x => x.GetType() == typeof(ChildHandler))); + Assert.IsTrue(implementations.Any(x => x.GetType() == typeof(BaseHandler))); + } + + + } + } +} + //test for class profiles \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Tests/Properties/AssemblyInfo.cs b/src/hosting/NServiceBus.Hosting.Tests/Properties/AssemblyInfo.cs index fffc6f5e5f1..62b8d996836 100644 Binary files a/src/hosting/NServiceBus.Hosting.Tests/Properties/AssemblyInfo.cs and b/src/hosting/NServiceBus.Hosting.Tests/Properties/AssemblyInfo.cs differ diff --git a/src/hosting/NServiceBus.Hosting.Tests/RoleManagerTests.cs b/src/hosting/NServiceBus.Hosting.Tests/RoleManagerTests.cs index d174e244833..ba59a16db5d 100644 --- a/src/hosting/NServiceBus.Hosting.Tests/RoleManagerTests.cs +++ b/src/hosting/NServiceBus.Hosting.Tests/RoleManagerTests.cs @@ -1,52 +1,54 @@ -using NServiceBus.Hosting.Roles; -using NServiceBus.Unicast.Config; -using NUnit.Framework; - namespace NServiceBus.Hosting.Tests { + using NUnit.Framework; + using Roles; + using Unicast.Config; + [TestFixture] public class RoleManagerTests { - private RoleManager roleManager; - [SetUp] public void SetUp() { - roleManager = new RoleManager(new[] { typeof(RoleManagerTests).Assembly }); + roleManager = new RoleManager(new[] {typeof (RoleManagerTests).Assembly}); } + RoleManager roleManager; + [Test] - public void Should_configure_requested_role() + public void Should_configure_inherited_roles() { - roleManager.ConfigureBusForEndpoint(new ConfigurationWithTestRole()); + roleManager.ConfigureBusForEndpoint(new ConfigurationWithInheritedRole()); Assert.True(TestRoleConfigurer.ConfigureCalled); } [Test] - public void Should_configure_inherited_roles() + public void Should_configure_requested_role() { - roleManager.ConfigureBusForEndpoint(new ConfigurationWithInheritedRole()); + roleManager.ConfigureBusForEndpoint(new ConfigurationWithTestRole()); Assert.True(TestRoleConfigurer.ConfigureCalled); } } - internal class ConfigurationWithTestRole:IConfigureThisEndpoint,TestRole + internal class ConfigurationWithTestRole : IConfigureThisEndpoint, TestRole { - } internal class ConfigurationWithInheritedRole : IConfigureThisEndpoint, InheritedRole { - } - public interface TestRole:IRole{} + public interface TestRole : IRole + { + } - public interface InheritedRole : TestRole { } + public interface InheritedRole : TestRole + { + } - public class TestRoleConfigurer:IConfigureRole + public class TestRoleConfigurer : IConfigureRole { public static bool ConfigureCalled = false; diff --git a/src/hosting/NServiceBus.Hosting.Tests/With_transport_tests.cs b/src/hosting/NServiceBus.Hosting.Tests/With_transport_tests.cs new file mode 100644 index 00000000000..54af4dfb892 --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Tests/With_transport_tests.cs @@ -0,0 +1,81 @@ +namespace NServiceBus.Hosting.Tests +{ + using System; + using NUnit.Framework; + using Roles; + using Roles.Handlers; + using Settings; + using Transports; + using Transports.Msmq; + using Unicast.Config; + + [TestFixture] + public class With_transport_tests + { + [SetUp] + public void SetUp() + { + Configure.With(new[] {typeof (TransportRoleHandler), typeof (MyTransportConfigurer)}) + .DefineEndpointName("myTests") + .DefaultBuilder(); + + roleManager = new RoleManager(new[] {typeof (TransportRoleHandler).Assembly}); + } + + RoleManager roleManager; + + [Test] + public void Should_configure_requested_transport() + { + roleManager.ConfigureBusForEndpoint(new ConfigWithCustomTransport()); + + Assert.True(MyTransportConfigurer.Called); + } + + [Test] + public void Should_default_to_msmq_if_no_other_transport_is_configured() + { + var handler = new DefaultTransportForHost(); + handler.Run(); + + Assert.True(SettingsHolder.Get("NServiceBus.Transport.SelectedTransport") is Msmq); + } + + [Test] + public void Should_used_configured_transport_if_one_is_configured() + { + var handler = new DefaultTransportForHost(); + Configure.Instance.Configurer.ConfigureComponent(DependencyLifecycle.SingleInstance); + + handler.Run(); + + Assert.IsInstanceOf(Configure.Instance.Builder.Build()); + } + } + + public class MyTestTransportSender : ISendMessages + { + public void Send(TransportMessage message, Address address) + { + } + } + + public class ConfigWithCustomTransport : IConfigureThisEndpoint, AsA_Server, UsingTransport + { + } + + + public class MyTestTransport : TransportDefinition + { + } + + public class MyTransportConfigurer : IConfigureTransport + { + public static bool Called; + + public void Configure(Configure config) + { + Called = true; + } + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Tests/packages.config b/src/hosting/NServiceBus.Hosting.Tests/packages.config new file mode 100644 index 00000000000..de76ffdbc9d --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Tests/packages.config @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/Arguments/HostArguments.cs b/src/hosting/NServiceBus.Hosting.Windows/Arguments/HostArguments.cs index bf805b14eff..43c76f89c5b 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/Arguments/HostArguments.cs +++ b/src/hosting/NServiceBus.Hosting.Windows/Arguments/HostArguments.cs @@ -1,53 +1,175 @@ -using System.Linq; -using Topshelf.Internal; -using Topshelf.Internal.ArgumentParsing; - namespace NServiceBus.Hosting.Windows.Arguments { - internal class HostArguments + using System; + using System.Collections.Generic; + using System.IO; + using System.Reflection; + using System.Text; + using NDesk.Options; + + public class HostArguments { - public HostArguments(Parser.Args arguments) + private readonly OptionSet installOptions; + private readonly OptionSet uninstallOptions; + + public HostArguments(IEnumerable args) { - Help = GetArgument(arguments, "help") ?? GetArgument(arguments, "?"); - ServiceName = GetArgument(arguments, "serviceName"); - DisplayName = GetArgument(arguments, "displayName"); - Description = GetArgument(arguments, "description"); - EndpointConfigurationType = GetArgument(arguments, "endpointConfigurationType"); - DependsOn = GetArgument(arguments, "dependsOn"); - StartManually = GetArgument(arguments, "startManually"); - Username = GetArgument(arguments, "username"); - Password = GetArgument(arguments, "password"); - SideBySide = GetArgument(arguments, "sideBySide"); - EndpointName = GetArgument(arguments, "endpointName"); - InstallInfrastructure = GetArgument(arguments, "installInfrastructure"); - ScannedAssemblies = GetArgument(arguments, "scannedAssemblies"); - } - - public IArgument SideBySide{ get; set; } - public IArgument Help { get; set; } - public IArgument ServiceName { get; set; } - public IArgument DisplayName { get; set; } - public IArgument Description { get; set; } - public IArgument EndpointConfigurationType { get; set; } - public IArgument DependsOn { get; set; } - public IArgument StartManually { get; set; } - public IArgument Username { get; set; } - public IArgument Password { get; set; } - public IArgument EndpointName { get; set; } - public IArgument InstallInfrastructure{ get; set; } - public IArgument ScannedAssemblies { get; set; } - - - private static IArgument GetArgument(Parser.Args arguments, string key) + DependsOn = new List(); + ScannedAssemblies = new List(); + + uninstallOptions = new OptionSet + { + { + "?|h|help", "Help about the command line options.", key => { Help = true; } + }, + { + "uninstall", + @"Uninstall the endpoint as a Windows service." + , s => { } + }, + { + "serviceName=", + @"Specify the service name for the installed service." + , s => { ServiceName = s; } + }, + { + "sideBySide", + @"Install the service with the version included in the service name. This allows running multiple endpoints side by side when doing hot deployments." + , s => { SideBySide = true; } + }, + }; + + installOptions = new OptionSet + { + { + "?|h|help", + "Help about the command line options.", + key => { Help = true; } + }, + { + "install", + @"Install the endpoint as a Windows service." + , s => { Install = true; } + }, + { + "serviceName=", + @"Specify the service name for the installed service." + , s => { ServiceName = s; } + }, + { + "displayName=", + @"Friendly name for the installed service." + , s => { DisplayName = s; } + }, + { + "description=", + @"Description for the service." + , s => { Description = s; } + }, + { + "endpointConfigurationType=", + @"Specify the type implementing IConfigureThisEndpoint that should be used." + , s => { EndpointConfigurationType = s; } + }, + { + "dependsOn=", + @"Specifies the names of services or groups which must start before this service." + , s => DependsOn.Add(s) + }, + { + "sideBySide", + @"Install the service with the version included in the service name. This allows running multiple endpoints side by side when doing hot deployments." + , s => { SideBySide = true; } + }, + { + "endpointName=", + @"The name of this endpoint." + , s => { EndpointName = s; } + }, + { + "username=", + @"Username for the account the service should run under." + , s => { Username = s; } + }, + { + "password=", + @"Password for the service account." + , s => { Password = s; } + }, + { + "startManually", + @"Specifies that the service should start manually." + , s => { StartManually = true; } + }, + { + "installInfrastructure", + @"This setting is no longer in use. Please see http://particular.net/articles/managing-nservicebus-using-powershell for the replacement." + , s => + { + throw new ArgumentException( + "This parameter is no longer supported. Please see http://particular.net/articles/managing-nservicebus-using-powershell for the replacement."); + } + }, + { + "scannedAssemblies=", + @"Configures NServiceBus to use the types found in the given assemblies." + , s => ScannedAssemblies.Add(s) + }, + }; + + try + { + OtherArgs = installOptions.Parse(args); + } + catch (Exception e) + { + Console.WriteLine(e.Message); + Help = true; + } + } + + public bool Install { get; private set; } + public List OtherArgs { get; set; } + public bool SideBySide { get; set; } + public bool Help { get; set; } + public string ServiceName { get; set; } + public string DisplayName { get; set; } + public string Description { get; set; } + public string EndpointConfigurationType { get; set; } + public List DependsOn { get; private set; } + public bool StartManually { get; set; } + public string Username { get; set; } + public string Password { get; set; } + public string EndpointName { get; set; } + public List ScannedAssemblies { get; private set; } + + public void PrintUsage() { - IArgument argument = arguments.CustomArguments.Where(x => x.Key != null).SingleOrDefault(x => x.Key.ToUpper() == key.ToUpper()); + var sb = new StringBuilder(); - if (argument != null) + string helpText = String.Empty; + using ( + Stream stream = + Assembly.GetCallingAssembly() + .GetManifestResourceStream("NServiceBus.Hosting.Windows.Content.Help.txt")) { - arguments.CustomArguments = arguments.CustomArguments.Except(new[] {argument}); + if (stream != null) + { + using (var streamReader = new StreamReader(stream)) + { + helpText = streamReader.ReadToEnd(); + } + } } - return argument; + installOptions.WriteOptionDescriptions(new StringWriter(sb)); + string installOptionsHelp = sb.ToString(); + + sb.Clear(); + uninstallOptions.WriteOptionDescriptions(new StringWriter(sb)); + string uninstallOptionsHelp = sb.ToString(); + + Console.Out.WriteLine(helpText, installOptionsHelp, uninstallOptionsHelp); } } } \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/Content/Help.txt b/src/hosting/NServiceBus.Hosting.Windows/Content/Help.txt index cebdb427696..04f1c717307 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/Content/Help.txt +++ b/src/hosting/NServiceBus.Hosting.Windows/Content/Help.txt @@ -1,69 +1,36 @@ -NServiceBus Message Endpoint Host Service +NServiceBus Endpoint Host Service USAGE: - NServiceBus.Host.exe [/install [/serviceName] - [/displayName] - [/description] - [/endpointConfigurationType] - [/endpointName] - [/installInfrastructure] - [/scannedAssemblies] - [/dependsOn] - [/sideBySide] - [/startManually] - [/username] - [/password]] | - [/uninstall [/serviceName] - [/sidebyside]] - -OPTIONS: + NServiceBus.Host.exe [-install] [options] + NServiceBus.Host.exe [-uninstall] [options] + +INSTALL OPTIONS: -/install Install the message endpoint as a Windows service. -/serviceName Specify the service name for the installed service. -/displayName Friendly name for the installed service. -/description Description for the service. -/endpointConfigurationType Specify the type implementing IConfigureThisEndpoint - that should be used. -/dependsOn Specifies the names of services or groups which must - start before this service. The names are separated by - colons (,). -/sideBySide Install the service with the version included in the - service name. This allows running multiple endpoints - side by side when doing hot deployments. -/endpointName The name of this endpoint. -/installInfrastructure Runs the infrastructure installers, this will install - things like MSMQ, RavenDB if needed. -/scannedAssemblies Configures NServiceBus to use the types found in the - given assemblies. The names are separated by - semicolons (;). -/startManually Specifies that the service should start manually. -/username Username for the account the service should run under. -/password Password for the service account. +{0} -If no service name is specified NServiceBus will use the full name of the -endpoint configuration type (that which implements NServiceBus.IConfigureThisEndpoint) -along with the version number of the assembly it is contained within, for example: +UNINSTALL OPTIONS: - MyPublisher.Endpoint_v1.0.0.0 +{1} + +If no service name is specified NServiceBus will use the endpoint name along with the version number of the assembly it is contained within, for example: + + MyProject.MyEndpoint-1.0.0 -The default for the display name is the same value as the service name, and the description -defaults to a generic NServiceBus host description. +The default for the display name is the same value as the service name, and the description defaults to a generic NServiceBus host description. -You can also specify the endpoint configuration type in the file NServiceBus.Host.exe.config. -This file is optional. +You can also specify the endpoint configuration type in the file NServiceBus.Host.exe.config. This file is optional. -If you don't specify the endpoint configuration type either in the command-line or in the -NServiceBus.Host.exe.config file, all the DLLs in the runtime directory will be scanned -for a type that implements NServiceBus.IConfigureThisEndpoint. +If you don't specify the endpoint configuration type either in the command-line or in the NServiceBus.Host.exe.config file, all the DLLs in the runtime directory will be scanned for a type that implements NServiceBus.IConfigureThisEndpoint. -If you set the service name and sidebyside during installation you will need to specify -them when uninstalling them as well, ex: +If you set the service name and sidebyside during installation you will need to specify them when uninstalling them as well, eg: - NServiceBus.Host.exe /uninstall /serviceName:"MyPublisher" /sidebyside + NServiceBus.Host.exe -uninstall -serviceName="MyPublisher" -sidebyside EXAMPLES: - NServiceBus.Host.exe /install /serviceName:"MyPublisher" /displayName:"My Publisher Service" - /description:"Service for publishing event messages" - /endpointConfigurationType:"YourEndpointConfigType.YourNameSpace, YourAssembly" - /username:"corp\serviceuser" - /password:"p@ssw0rd!" NServiceBus.Production + NServiceBus.Host.exe -install + -serviceName="MyPublisher" + -displayName="My Publisher Service" + -description="Service for publishing event messages" + -endpointConfigurationType="YourEndpointConfigType.YourNameSpace, YourAssembly" + -username="corp\serviceuser" + -password="p@ssw0rd!" NServiceBus.Production diff --git a/src/hosting/NServiceBus.Hosting.Windows/EndpointType.cs b/src/hosting/NServiceBus.Hosting.Windows/EndpointType.cs new file mode 100644 index 00000000000..7281b2df59d --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Windows/EndpointType.cs @@ -0,0 +1,112 @@ +namespace NServiceBus.Hosting.Windows +{ + using System; + using System.IO; + using System.Reflection; + using Arguments; + using Utils; + + /// + /// Representation of an Endpoint Type with additional descriptive properties. + /// + public class EndpointType + { + internal EndpointType(HostArguments arguments, Type type) : this(type) + { + if (arguments == null) + { + throw new ArgumentNullException("arguments"); + } + this.arguments = arguments; + } + + /// + /// Initializes a new instance of the class. + /// + /// The type. + public EndpointType(Type type) + { + if (type == null) + { + throw new ArgumentNullException("type"); + } + this.type = type; + AssertIsValid(); + endpointConfiguration = Activator.CreateInstance(type); + } + + internal Type Type + { + get { return type; } + } + + public string EndpointConfigurationFile + { + get { return Path.Combine(AppDomain.CurrentDomain.BaseDirectory, type.Assembly.ManifestModule.Name + ".config"); } + } + + public string EndpointVersion + { + get { return FileVersionRetriever.GetFileVersion(type); } + } + + public string AssemblyQualifiedName + { + get { return type.AssemblyQualifiedName; } + } + + public string EndpointName + { + get + { + object[] arr = type.GetCustomAttributes(typeof (EndpointNameAttribute), false); + if (arr.Length == 1) + { + return ((EndpointNameAttribute) arr[0]).Name; + } + + var nameThisEndpoint = endpointConfiguration as INameThisEndpoint; + if (nameThisEndpoint != null) + { + return nameThisEndpoint.GetName(); + } + + if (arguments.EndpointName != null) + { + return arguments.EndpointName; + } + return null; + } + } + + public string ServiceName + { + get + { + string serviceName = type.Namespace ?? type.Assembly.GetName().Name; + + if (arguments.ServiceName != null) + { + serviceName = arguments.ServiceName; + } + + return serviceName; + } + } + + void AssertIsValid() + { + ConstructorInfo constructor = type.GetConstructor(Type.EmptyTypes); + + if (constructor == null) + { + throw new InvalidOperationException( + "Endpoint configuration type needs to have a default constructor: " + type.FullName); + } + } + + readonly HostArguments arguments = new HostArguments(new string[0]); + readonly object endpointConfiguration; + readonly Type type; + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/EndpointTypeDeterminer.cs b/src/hosting/NServiceBus.Hosting.Windows/EndpointTypeDeterminer.cs new file mode 100644 index 00000000000..7bff909854b --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Windows/EndpointTypeDeterminer.cs @@ -0,0 +1,170 @@ +namespace NServiceBus.Hosting.Windows +{ + using System; + using System.Collections.Generic; + using System.Configuration; + using System.Linq; + using System.Reflection; + using Arguments; + using Helpers; + + /// + /// Determines the Endpoint Type by applying conventions. + /// + /// + /// The first eligible Type is returned, checking (in order): + /// Args (for windows hosted endpoints) + /// Configuration + /// Assembly scanning for + /// + public class EndpointTypeDeterminer + { + + /// + /// Initializes a new instance of the class. + /// + /// The assembly scanner results. + /// A func to retrieve the endpoint configuration type from config. + /// assemblyScannerResults + public EndpointTypeDeterminer(AssemblyScannerResults assemblyScannerResults, + Func getEndpointConfigurationTypeFromConfig) + { + if (assemblyScannerResults == null) + { + throw new ArgumentNullException("assemblyScannerResults"); + } + if (getEndpointConfigurationTypeFromConfig == null) + { + throw new ArgumentNullException("getEndpointConfigurationTypeFromConfig"); + } + this.assemblyScannerResults = assemblyScannerResults; + this.getEndpointConfigurationTypeFromConfig = getEndpointConfigurationTypeFromConfig; + } + + internal EndpointType GetEndpointConfigurationTypeForHostedEndpoint(HostArguments arguments) + { + Type type; + + if (TryGetEndpointConfigurationTypeFromArguments(arguments, out type)) + { + return new EndpointType(arguments,type); + } + + return GetEndpointConfigurationType(arguments); + } + + /// + /// Gets the type of the endpoint configuration. + /// + /// + /// No endpoint configuration found in scanned assemblies. + public EndpointType GetEndpointConfigurationType() + { + return GetEndpointConfigurationType(new HostArguments(new string[] {})); + } + public EndpointType GetEndpointConfigurationType(HostArguments arguments) + { + Type type; + + if (TryGetEndpointConfigurationTypeFromConfiguration(out type)) + { + return new EndpointType(arguments,type); + } + + if (TryGetEndpointConfigurationTypeFromScannedAssemblies(out type)) + { + return new EndpointType(arguments,type); + } + + throw new InvalidOperationException("No endpoint configuration found in scanned assemblies. " + + "This usually happens when NServiceBus fails to load your assembly containing IConfigureThisEndpoint." + + " Try specifying the type explicitly in the NServiceBus.Host.exe.config using the appsetting key: EndpointConfigurationType, " + + "Scanned path: " + AppDomain.CurrentDomain.BaseDirectory); + } + + bool TryGetEndpointConfigurationTypeFromArguments(HostArguments arguments, out Type type) + { + if (arguments.EndpointConfigurationType == null) + { + type = null; + return false; + } + + Type endpointType = Type.GetType(arguments.EndpointConfigurationType, false); + if (endpointType == null) + { + throw new ConfigurationErrorsException( + string.Format( + "Command line argument 'endpointConfigurationType' has specified to use the type '{0}' but that type could not be loaded.", + arguments.EndpointConfigurationType)); + } + type = endpointType; + return true; + } + + bool TryGetEndpointConfigurationTypeFromConfiguration(out Type type) + { + string endpoint = getEndpointConfigurationTypeFromConfig(); + if (endpoint == null) + { + type = null; + return false; + } + + Type endpointType = Type.GetType(endpoint, false); + if (endpointType == null) + { + throw new ConfigurationErrorsException( + string.Format( + "The 'EndpointConfigurationType' entry in the NServiceBus.Host.exe.config has specified to use the type '{0}' but that type could not be loaded.", + endpoint)); + } + + type = endpointType; + return true; + } + + bool TryGetEndpointConfigurationTypeFromScannedAssemblies(out Type type) + { + List endpoints = ScanAssembliesForEndpoints().ToList(); + if (!endpoints.Any()) + { + Console.Out.WriteLine(assemblyScannerResults); + type = null; + return false; + } + + AssertThatNotMoreThanOneEndpointIsDefined(endpoints); + type = endpoints.First(); + return true; + } + + static void AssertThatNotMoreThanOneEndpointIsDefined(List endpointConfigurationTypes) + { + if (endpointConfigurationTypes.Count > 1) + { + throw new InvalidOperationException("Host doesn't support hosting of multiple endpoints. " + + "Endpoint classes found: " + + string.Join(", ", + endpointConfigurationTypes.Select( + e => e.AssemblyQualifiedName).ToArray()) + + " You may have some old assemblies in your runtime directory." + + " Try right-clicking your VS project, and selecting 'Clean'." + ); + } + } + + IEnumerable ScanAssembliesForEndpoints() + { + List scannableAssemblies = assemblyScannerResults.Assemblies; + + return scannableAssemblies.SelectMany(assembly => assembly.GetTypes().Where( + t => typeof (IConfigureThisEndpoint).IsAssignableFrom(t) + && t != typeof (IConfigureThisEndpoint) + && !t.IsAbstract)); + } + + readonly AssemblyScannerResults assemblyScannerResults; + readonly Func getEndpointConfigurationTypeFromConfig; + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/Fody.targets b/src/hosting/NServiceBus.Hosting.Windows/Fody.targets new file mode 100644 index 00000000000..a668a51fc04 --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Windows/Fody.targets @@ -0,0 +1,89 @@ + + + + + + $(NCrunchOriginalSolutionDir) + + + + + $(SolutionDir) + + + + + $(MSBuildProjectDirectory)\..\ + + + + + + + $(KeyOriginatorFile) + + + + + $(AssemblyOriginatorKeyFile) + + + + + + + + + + $(ProjectDir)$(IntermediateOutputPath) + Low + $(SignAssembly) + $(MSBuildThisFileDirectory) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/FodyWeavers.xml b/src/hosting/NServiceBus.Hosting.Windows/FodyWeavers.xml new file mode 100644 index 00000000000..7b0ab397e86 --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Windows/FodyWeavers.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/HostServiceLocator.cs b/src/hosting/NServiceBus.Hosting.Windows/HostServiceLocator.cs index b140ea4ae5a..12b7f6cb033 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/HostServiceLocator.cs +++ b/src/hosting/NServiceBus.Hosting.Windows/HostServiceLocator.cs @@ -1,10 +1,8 @@ using System; -using System.Collections.Generic; -using System.Linq; -using Microsoft.Practices.ServiceLocation; -using NServiceBus.Hosting.Windows.Arguments; -using Topshelf.Internal; - +using System.Collections.Generic; +using Microsoft.Practices.ServiceLocation; +using NServiceBus.Hosting.Windows.Arguments; + namespace NServiceBus.Hosting.Windows { /// @@ -15,8 +13,8 @@ public class HostServiceLocator : ServiceLocatorImplBase /// /// Command line arguments. /// - public static string[] Args; - + public static string[] Args; + /// /// Returns an instance of /// @@ -25,20 +23,15 @@ public class HostServiceLocator : ServiceLocatorImplBase /// protected override object DoGetInstance(Type serviceType, string key) { - var endpoint = Type.GetType(key,true); - - Parser.Args commandLineArguments = Parser.ParseArgs(Args); - var arguments = new HostArguments(commandLineArguments); - - string endpointName = string.Empty; - if (arguments.EndpointName != null) - endpointName = arguments.EndpointName.Value; - - string[] scannedAssemblies = null; - if (arguments.ScannedAssemblies != null) - scannedAssemblies = arguments.ScannedAssemblies.Value.Split(';').ToArray(); - - return new WindowsHost(endpoint, Args, endpointName, false, false, scannedAssemblies); + var endpoint = Type.GetType(key,true); + + var arguments = new HostArguments(Args); + + string endpointName = string.Empty; + if (arguments.EndpointName != null) + endpointName = arguments.EndpointName; + + return new WindowsHost(endpoint, Args, endpointName, false, arguments.ScannedAssemblies.ToArray()); } /// diff --git a/src/hosting/NServiceBus.Hosting/Configuration/INameThisEndpoint.cs b/src/hosting/NServiceBus.Hosting.Windows/INameThisEndpoint.cs similarity index 75% rename from src/hosting/NServiceBus.Hosting/Configuration/INameThisEndpoint.cs rename to src/hosting/NServiceBus.Hosting.Windows/INameThisEndpoint.cs index 6aefe9c830f..e6775b290d3 100644 --- a/src/hosting/NServiceBus.Hosting/Configuration/INameThisEndpoint.cs +++ b/src/hosting/NServiceBus.Hosting.Windows/INameThisEndpoint.cs @@ -1,14 +1,15 @@ -namespace NServiceBus -{ - /// - /// Implement this interface in the endpoint configuration class if you want to give this endpoint your own name - /// - public interface INameThisEndpoint - { - /// - /// Returns the name to be used for this endpoint - /// - /// - string GetName(); - } +namespace NServiceBus +{ + /// + /// Implement this interface in the endpoint configuration class if you want to give this endpoint your own name + /// + [ObsoleteEx(Replacement = "Configure.DefineEndpointName()", TreatAsErrorFromVersion = "4.0", RemoveInVersion = "5.0")] + public interface INameThisEndpoint + { + /// + /// Returns the name to be used for this endpoint + /// + /// + string GetName(); + } } \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/Installers/WindowsInstaller.cs b/src/hosting/NServiceBus.Hosting.Windows/Installers/WindowsInstaller.cs index 06ea4efe64d..ab2a768f5a9 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/Installers/WindowsInstaller.cs +++ b/src/hosting/NServiceBus.Hosting.Windows/Installers/WindowsInstaller.cs @@ -1,81 +1,72 @@ -using System; -using System.Linq; -using System.Collections.Generic; -using NServiceBus.Utils; -using NServiceBus.Hosting.Windows.Arguments; -using Topshelf.Internal; - -namespace NServiceBus.Hosting.Windows.Installers -{ - /// - /// Windows Installer for NService Bus Host - /// - public class WindowsInstaller - { - /// - /// Run installers (infrastructure and per endpoint) and handles profiles. - /// - /// - /// - public static void Install(IEnumerable args, string configFile) - { - // Create the new appdomain with the new config. - var installDomain = AppDomain.CreateDomain("installDomain", AppDomain.CurrentDomain.Evidence, new AppDomainSetup - { - ConfigurationFile = configFile, - AppDomainInitializer = DomainInitializer, - AppDomainInitializerArguments = args.ToArray() - }); - - // Call the right config method in that appdomain. - var del = new CrossAppDomainDelegate(RunInstall); - installDomain.DoCallBack(del); - } - - - /// - /// Run Install - /// - static void RunInstall() - { - Console.WriteLine("Executing the NServiceBus installers"); - - try - { - host.Install(); - } - catch (Exception ex) - { - //need to suppress here in order to avoid infinite loop - Console.WriteLine("Failed to execute installers: " +ex); - } - - - } - - static void DomainInitializer(string[] args) - { - Console.WriteLine("Initializing the installer in the Install AppDomain"); - Parser.Args commandLineArguments = Parser.ParseArgs(args); - var arguments = new HostArguments(commandLineArguments); - - string endpointName = string.Empty; - if (arguments.EndpointName != null) - endpointName = arguments.EndpointName.Value; - - string[] scannedAssemblies = null; - if (arguments.ScannedAssemblies != null) - scannedAssemblies = arguments.ScannedAssemblies.Value.Split(';').ToArray(); - - if (arguments.Username != null) - { - MsmqUtilities.AccountToBeAssignedQueuePermissions(arguments.Username.Value); - } - - host = new WindowsHost(Type.GetType(arguments.EndpointConfigurationType.Value, true), args, endpointName, commandLineArguments.Install, (arguments.InstallInfrastructure != null), scannedAssemblies); - } - - static WindowsHost host; - - } +namespace NServiceBus.Hosting.Windows.Installers +{ + using System; + using Arguments; + + + /// + /// Windows Installer for NService Bus Host + /// + public class WindowsInstaller + { + /// + /// Run installers (infrastructure and per endpoint) and handles profiles. + /// + /// + /// + public static void Install(string[] args, string configFile) + { + // Create the new appdomain with the new config. + var installDomain = AppDomain.CreateDomain("installDomain", AppDomain.CurrentDomain.Evidence, new AppDomainSetup + { + ConfigurationFile = configFile, + AppDomainInitializer = DomainInitializer, + AppDomainInitializerArguments = args + }); + + // Call the right config method in that appdomain. + var del = new CrossAppDomainDelegate(RunInstall); + installDomain.DoCallBack(del); + } + + /// + /// Run Install + /// + static void RunInstall() + { + Console.WriteLine("Executing the NServiceBus installers"); + + try + { + host.Install(username); + Configure.Instance.Builder.Dispose(); + } + catch (Exception ex) + { + //need to suppress here in order to avoid infinite loop + Console.WriteLine("Failed to execute installers: " +ex); + } + } + + private static string username; + + static void DomainInitializer(string[] args) + { + Console.WriteLine("Initializing the installer in the Install AppDomain"); + var arguments = new HostArguments(args); + string endpointName = null; + + if (arguments.EndpointName != null) + { + endpointName = arguments.EndpointName; + } + + username = arguments.Username; + + host = new WindowsHost(Type.GetType(arguments.EndpointConfigurationType, true), args, endpointName, arguments.Install, arguments.ScannedAssemblies); + } + + static WindowsHost host; + + } } \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/InternalsVisibleTo.cs b/src/hosting/NServiceBus.Hosting.Windows/InternalsVisibleTo.cs new file mode 100644 index 00000000000..cd819434f5e --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Windows/InternalsVisibleTo.cs @@ -0,0 +1,3 @@ +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("NServiceBus.Hosting.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100dde965e6172e019ac82c2639ffe494dd2e7dd16347c34762a05732b492e110f2e4e2e1b5ef2d85c848ccfb671ee20a47c8d1376276708dc30a90ff1121b647ba3b7259a6bc383b2034938ef0e275b58b920375ac605076178123693c6c4f1331661a62eba28c249386855637780e3ff5f23a6d854700eaa6803ef48907513b92")] \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/IntegrationLoggingHandler.cs b/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/IntegrationLoggingHandler.cs index ab864b6acfa..72a4dc3e651 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/IntegrationLoggingHandler.cs +++ b/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/IntegrationLoggingHandler.cs @@ -1,5 +1,6 @@ -using log4net.Appender; -using log4net.Core; +using NServiceBus.Hosting.Windows.LoggingHandlers.Internal; +using NServiceBus.Logging.Loggers.Log4NetAdapter; +using NServiceBus.Logging.Loggers.NLogAdapter; namespace NServiceBus.Hosting.Windows.LoggingHandlers { @@ -10,13 +11,12 @@ public class IntegrationLoggingHandler : IConfigureLoggingForProfile(null, - a => - { - LiteLoggingHandler.PrepareColors(a); - a.Threshold = Level.Info; - } - ); + if (Log4NetConfigurator.Log4NetExists) + SetLoggingLibrary.Log4Net(null, Log4NetAppenderFactory.CreateColoredConsoleAppender("Info")); + else if (NLogConfigurator.NLogExists) + SetLoggingLibrary.NLog(null, NLogTargetFactory.CreateColoredConsoleTarget()); + else + ConfigureInternalLog4Net.Integration(); } } } \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/Internal/ConfigureInternalLog4Net.cs b/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/Internal/ConfigureInternalLog4Net.cs new file mode 100644 index 00000000000..7906b2d2455 --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/Internal/ConfigureInternalLog4Net.cs @@ -0,0 +1,114 @@ +using System; +using System.Reflection; +using System.Runtime.InteropServices; +using NServiceBus.Logging; +using log4net.Appender; +using log4net.Core; + +namespace NServiceBus.Hosting.Windows.LoggingHandlers.Internal +{ + internal class ConfigureInternalLog4Net + { + public static void Lite() + { + ConfigureColoredConsoleAppender(Level.Info); + + LogManager.LoggerFactory = new InternalLog4NetLoggerFactory(); + } + + public static void Integration() + { + ConfigureColoredConsoleAppender(Level.Info); + + LogManager.LoggerFactory = new InternalLog4NetLoggerFactory(); + } + + public static void Production(bool logToConsole) + { + ConfigureFileAppender(); + + if (logToConsole) + ConfigureColoredConsoleAppender(Level.Info); + + LogManager.LoggerFactory = new InternalLog4NetLoggerFactory(); + } + + private static void ConfigureFileAppender() + { + var appender = new RollingFileAppender + { + CountDirection = 1, + DatePattern = "yyyy-MM-dd", + RollingStyle = RollingFileAppender.RollingMode.Composite, + MaxFileSize = 1024*1024, + MaxSizeRollBackups = 10, + LockingModel = new FileAppender.MinimalLock(), + StaticLogFileName = true, + File = "logfile", + AppendToFile = true + }; + + ConfigureAppender(appender); + } + + private static void ConfigureColoredConsoleAppender(Level threshold) + { + var appender = new ColoredConsoleAppender() + { + Threshold = threshold + }; + + appender.AddMapping( + new ColoredConsoleAppender.LevelColors + { + Level = Level.Debug, + ForeColor = ColoredConsoleAppender.Colors.White + }); + appender.AddMapping( + new ColoredConsoleAppender.LevelColors + { + Level = Level.Info, + ForeColor = ColoredConsoleAppender.Colors.Green + }); + appender.AddMapping( + new ColoredConsoleAppender.LevelColors + { + Level = Level.Warn, + ForeColor = ColoredConsoleAppender.Colors.Yellow | ColoredConsoleAppender.Colors.HighIntensity + }); + appender.AddMapping( + new ColoredConsoleAppender.LevelColors + { + Level = Level.Error, + ForeColor = ColoredConsoleAppender.Colors.Red | ColoredConsoleAppender.Colors.HighIntensity + }); + + ConfigureAppender(appender); + } + + private static void ConfigureAppender(AppenderSkeleton appender) + { + if (appender.Layout == null) + appender.Layout = new log4net.Layout.PatternLayout("%d [%t] %-5p %c [%x] <%X{auth}> - %m%n"); + + var cfg = Configure.GetConfigSection(); + if (cfg != null) + { + foreach (var f in typeof(Level).GetFields(BindingFlags.Public | BindingFlags.Static)) + if (string.Compare(cfg.Threshold, f.Name, true) == 0) + { + var val = f.GetValue(null); + appender.Threshold = val as Level; + break; + } + } + + if (appender.Threshold == null) + appender.Threshold = Level.Info; + + appender.ActivateOptions(); + + log4net.Config.BasicConfigurator.Configure(appender); + } + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/Internal/InternalLog4NetLog.cs b/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/Internal/InternalLog4NetLog.cs new file mode 100644 index 00000000000..be523fe8576 --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/Internal/InternalLog4NetLog.cs @@ -0,0 +1,115 @@ +using System; +using NServiceBus.Logging; + +namespace NServiceBus.Hosting.Windows.LoggingHandlers.Internal +{ + internal class InternalLog4NetLog : ILog + { + private readonly log4net.ILog _log; + + internal InternalLog4NetLog(log4net.ILog log) + { + _log = log; + } + + public void Debug(string message) + { + _log.Debug(message); + } + + public void Debug(string message, Exception exception) + { + _log.Debug(message, exception); + } + + public void DebugFormat(string format, params object[] args) + { + _log.DebugFormat(format, args); + } + + public void Info(string message) + { + _log.Info(message); + } + + public void Info(string message, Exception exception) + { + _log.Info(message, exception); + } + + public void InfoFormat(string format, params object[] args) + { + _log.InfoFormat(format, args); + } + + public void Warn(string message) + { + _log.Warn(message); + } + + public void Warn(string message, Exception exception) + { + _log.Warn(message, exception); + } + + public void WarnFormat(string format, params object[] args) + { + _log.WarnFormat(format, args); + } + + public void Error(string message) + { + _log.Error(message); + } + + public void Error(string message, Exception exception) + { + _log.Error(message, exception); + } + + public void ErrorFormat(string format, params object[] args) + { + _log.ErrorFormat(format, args); + } + + public void Fatal(string message) + { + _log.Fatal(message); + } + + public void Fatal(string message, Exception exception) + { + _log.Fatal(message, exception); + } + + public void FatalFormat(string format, params object[] args) + { + _log.FatalFormat(format, args); + } + + public bool IsDebugEnabled + { + get { return _log.IsDebugEnabled; } + } + + public bool IsInfoEnabled + { + get { return _log.IsInfoEnabled; } + } + + public bool IsWarnEnabled + { + get { return _log.IsWarnEnabled; } + } + + public bool IsErrorEnabled + { + get { return _log.IsErrorEnabled; } + } + + public bool IsFatalEnabled + { + get { return _log.IsFatalEnabled; } + } + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/Internal/InternalLog4NetLoggerFactory.cs b/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/Internal/InternalLog4NetLoggerFactory.cs new file mode 100644 index 00000000000..76ecc2e96fe --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/Internal/InternalLog4NetLoggerFactory.cs @@ -0,0 +1,18 @@ +using System; +using NServiceBus.Logging; + +namespace NServiceBus.Hosting.Windows.LoggingHandlers.Internal +{ + internal class InternalLog4NetLoggerFactory : ILoggerFactory + { + public ILog GetLogger(Type type) + { + return new InternalLog4NetLog(log4net.LogManager.GetLogger(type)); + } + + public ILog GetLogger(string name) + { + return new InternalLog4NetLog(log4net.LogManager.GetLogger(name)); + } + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/LiteLoggingHandler.cs b/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/LiteLoggingHandler.cs index ac1ef63c9f5..30b62b2a8d4 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/LiteLoggingHandler.cs +++ b/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/LiteLoggingHandler.cs @@ -1,5 +1,6 @@ -using log4net.Appender; -using log4net.Core; +using NServiceBus.Hosting.Windows.LoggingHandlers.Internal; +using NServiceBus.Logging.Loggers.Log4NetAdapter; +using NServiceBus.Logging.Loggers.NLogAdapter; namespace NServiceBus.Hosting.Windows.LoggingHandlers { @@ -10,46 +11,12 @@ public class LiteLoggingHandler : IConfigureLoggingForProfile { void IConfigureLogging.Configure(IConfigureThisEndpoint specifier) { - SetLoggingLibrary.Log4Net(null, - a => - { - PrepareColors(a); - a.Threshold = Level.Info; - } - ); - } - - - /// - /// Sets default colors for a ColredConsoleAppender - /// - /// - public static void PrepareColors(ColoredConsoleAppender a) - { - a.AddMapping( - new ColoredConsoleAppender.LevelColors - { - Level = Level.Debug, - ForeColor = ColoredConsoleAppender.Colors.White - }); - a.AddMapping( - new ColoredConsoleAppender.LevelColors - { - Level = Level.Info, - ForeColor = ColoredConsoleAppender.Colors.Green - }); - a.AddMapping( - new ColoredConsoleAppender.LevelColors - { - Level = Level.Warn, - ForeColor = ColoredConsoleAppender.Colors.Yellow | ColoredConsoleAppender.Colors.HighIntensity - }); - a.AddMapping( - new ColoredConsoleAppender.LevelColors - { - Level = Level.Error, - ForeColor = ColoredConsoleAppender.Colors.Red | ColoredConsoleAppender.Colors.HighIntensity - }); + if (Log4NetConfigurator.Log4NetExists) + SetLoggingLibrary.Log4Net(null, Log4NetAppenderFactory.CreateColoredConsoleAppender("Info")); + else if (NLogConfigurator.NLogExists) + SetLoggingLibrary.NLog(null, NLogTargetFactory.CreateColoredConsoleTarget()); + else + ConfigureInternalLog4Net.Lite(); } } } \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/ProductionLoggingHandler.cs b/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/ProductionLoggingHandler.cs index 81eb1860456..013e272afe0 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/ProductionLoggingHandler.cs +++ b/src/hosting/NServiceBus.Hosting.Windows/LoggingHandlers/ProductionLoggingHandler.cs @@ -1,11 +1,13 @@ -using log4net.Appender; +using NServiceBus.Hosting.Windows.LoggingHandlers.Internal; +using NServiceBus.Logging.Loggers.Log4NetAdapter; +using NServiceBus.Logging.Loggers.NLogAdapter; namespace NServiceBus.Hosting.Windows.LoggingHandlers -{ - using System; - using System.Runtime.InteropServices; - using log4net.Core; - +{ + using System; + using System.Runtime.InteropServices; + using System.Collections.Generic; + /// /// Handles logging configuration for the production profile /// @@ -13,34 +15,36 @@ public class ProductionLoggingHandler : IConfigureLoggingForProfile { void IConfigureLogging.Configure(IConfigureThisEndpoint specifier) { - SetLoggingLibrary.Log4Net(null, - a => + var logToConsole = GetStdHandle(STD_OUTPUT_HANDLE) != IntPtr.Zero; + + if (Log4NetConfigurator.Log4NetExists) + { + SetLoggingLibrary.Log4Net(null, Log4NetAppenderFactory.CreateRollingFileAppender(null, "logfile")); + + if (logToConsole) + SetLoggingLibrary.Log4Net(null, Log4NetAppenderFactory.CreateColoredConsoleAppender("Info")); + } + else if (NLogConfigurator.NLogExists) + { + const string layout = "${longdate}|${level:uppercase=true}|${logger}|${message}${onexception:${newline}${exception:format=tostring}}"; + + var targets = new List {NLogTargetFactory.CreateRollingFileTarget("logfile", layout)}; + + if (logToConsole) { - a.CountDirection = 1; - a.DatePattern = "yyyy-MM-dd"; - a.RollingStyle = RollingFileAppender.RollingMode.Composite; - a.MaxFileSize = 1024 * 1024; - a.MaxSizeRollBackups = 10; - a.LockingModel = new FileAppender.MinimalLock(); - a.StaticLogFileName = true; - a.File = "logfile"; - a.AppendToFile = true; - }); - - if (GetStdHandle(STD_OUTPUT_HANDLE) == IntPtr.Zero) - return; - - SetLoggingLibrary.Log4Net(null, - a => - { - LiteLoggingHandler.PrepareColors(a); - a.Threshold = Level.Info; - } - ); + targets.Add(NLogTargetFactory.CreateColoredConsoleTarget(layout)); + } + + SetLoggingLibrary.NLog(null, targets.ToArray()); + } + else + { + ConfigureInternalLog4Net.Production(logToConsole); + } } - [DllImport("kernel32.dll", SetLastError = true)] - static extern IntPtr GetStdHandle(int nStdHandle); - const int STD_OUTPUT_HANDLE = -11; + [DllImport("kernel32.dll", SetLastError = true)] + static extern IntPtr GetStdHandle(int nStdHandle); + const int STD_OUTPUT_HANDLE = -11; } } \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/NServiceBus.Hosting.Windows.csproj b/src/hosting/NServiceBus.Hosting.Windows/NServiceBus.Hosting.Windows.csproj index 4e536e2a17f..8829851f7c2 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/NServiceBus.Hosting.Windows.csproj +++ b/src/hosting/NServiceBus.Hosting.Windows/NServiceBus.Hosting.Windows.csproj @@ -1,128 +1,162 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {85E813C0-4A94-4946-8B1F-DE1E39AA7D11} - Exe - Properties - NServiceBus.Hosting.Windows - NServiceBus.Hosting.Windows - v4.0 - 512 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - bin\Debug\NServiceBus.Hosting.Windows.xml - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - bin\Release\NServiceBus.Hosting.Windows.xml - - - - False - ..\..\..\lib\log4net.dll - - - False - ..\..\..\lib\Topshelf\Magnum.dll - - - False - ..\..\..\lib\ServiceLocation\Microsoft.Practices.ServiceLocation.dll - - - False - ..\..\..\build\output\NServiceBus.dll - - - False - ..\..\..\build\output\NServiceBus.Core.dll - - - - - 3.5 - - - - 3.0 - - - - - False - ..\..\..\lib\Topshelf\Topshelf.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {B5F333D1-D6B1-49FB-82F6-74641E5D11E3} - NServiceBus.Hosting - - - - - - xcopy /Y "$(ProjectDir)$(OutDir)*.*" "$(ProjectDir)..\..\..\build\host\" - + + + + Debug + AnyCPU + 9.0.30729 + 2.0 + {85E813C0-4A94-4946-8B1F-DE1E39AA7D11} + Exe + Properties + NServiceBus.Hosting.Windows + NServiceBus.Host + v4.0 + 512 + true + ..\..\NServiceBus.snk + ..\..\..\ + true + ..\..\..\packages\Fody.1.13.8.0 + + + true + full + false + ..\..\..\binaries\ + DEBUG;TRACE + prompt + 4 + ..\..\..\binaries\NServiceBus.Host.XML + + + pdbonly + true + ..\..\..\binaries\ + TRACE + prompt + 4 + ..\..\..\binaries\NServiceBus.Host.XML + + + true + bin\x86\Debug\ + DEBUG;TRACE + ..\..\..\binaries\NServiceBus.Host.XML + full + x86 + prompt + MinimumRecommendedRules.ruleset + + + bin\x86\Release\ + TRACE + ..\..\..\binaries\NServiceBus.Host.XML + true + pdbonly + x86 + prompt + MinimumRecommendedRules.ruleset + + + + ..\..\..\packages\log4net.1.2.10\lib\2.0\log4net.dll + + + ..\..\..\packages\CommonServiceLocator.1.0\lib\NET35\Microsoft.Practices.ServiceLocation.dll + + + False + ..\..\..\packages\Obsolete.Fody.1.6.2.0\Lib\NET35\Obsolete.dll + False + + + + + 3.5 + + + + 3.0 + + + + + + False + ..\..\..\lib\Topshelf\Topshelf.dll + + + + Designer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {dd48b2d0-e996-412d-9157-821ed8b17a9d} + NServiceBus.Core + + + {73867d40-8cbb-48e9-bffa-12bbdd48a341} + NServiceBus %28NServiceBus\NServiceBus%29 + + + + + + + + xcopy /Y "$(ProjectDir)$(OutDir)*.*" "$(ProjectDir)..\..\..\build\host\" + + + \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/Options.cs b/src/hosting/NServiceBus.Hosting.Windows/Options.cs new file mode 100644 index 00000000000..1846bfb7744 --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Windows/Options.cs @@ -0,0 +1,1175 @@ +// +// Options.cs +// +// Authors: +// Jonathan Pryor +// +// Copyright (C) 2008 Novell (http://www.novell.com) +// +// Permission is hereby granted, free of charge, to any person obtaining +// a copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +// + +// Compile With: +// gmcs -debug+ -r:System.Core Options.cs -o:NDesk.Options.dll +// gmcs -debug+ -d:LINQ -r:System.Core Options.cs -o:NDesk.Options.dll +// +// The LINQ version just changes the implementation of +// OptionSet.Parse(IEnumerable), and confers no semantic changes. + +// +// A Getopt::Long-inspired option parsing library for C#. +// +// NDesk.Options.OptionSet is built upon a key/value table, where the +// key is a option format string and the value is a delegate that is +// invoked when the format string is matched. +// +// Option format strings: +// Regex-like BNF Grammar: +// name: .+ +// type: [=:] +// sep: ( [^{}]+ | '{' .+ '}' )? +// aliases: ( name type sep ) ( '|' name type sep )* +// +// Each '|'-delimited name is an alias for the associated action. If the +// format string ends in a '=', it has a required value. If the format +// string ends in a ':', it has an optional value. If neither '=' or ':' +// is present, no value is supported. `=' or `:' need only be defined on one +// alias, but if they are provided on more than one they must be consistent. +// +// Each alias portion may also end with a "key/value separator", which is used +// to split option values if the option accepts > 1 value. If not specified, +// it defaults to '=' and ':'. If specified, it can be any character except +// '{' and '}' OR the *string* between '{' and '}'. If no separator should be +// used (i.e. the separate values should be distinct arguments), then "{}" +// should be used as the separator. +// +// Options are extracted either from the current option by looking for +// the option name followed by an '=' or ':', or is taken from the +// following option IFF: +// - The current option does not contain a '=' or a ':' +// - The current option requires a value (i.e. not a Option type of ':') +// +// The `name' used in the option format string does NOT include any leading +// option indicator, such as '-', '--', or '/'. All three of these are +// permitted/required on any named option. +// +// Option bundling is permitted so long as: +// - '-' is used to start the option group +// - all of the bundled options are a single character +// - at most one of the bundled options accepts a value, and the value +// provided starts from the next character to the end of the string. +// +// This allows specifying '-a -b -c' as '-abc', and specifying '-D name=value' +// as '-Dname=value'. +// +// Option processing is disabled by specifying "--". All options after "--" +// are returned by OptionSet.Parse() unchanged and unprocessed. +// +// Unprocessed options are returned from OptionSet.Parse(). +// +// Examples: +// int verbose = 0; +// OptionSet p = new OptionSet () +// .Add ("v", v => ++verbose) +// .Add ("name=|value=", v => Console.WriteLine (v)); +// p.Parse (new string[]{"-v", "--v", "/v", "-name=A", "/name", "B", "extra"}); +// +// The above would parse the argument string array, and would invoke the +// lambda expression three times, setting `verbose' to 3 when complete. +// It would also print out "A" and "B" to standard output. +// The returned array would contain the string "extra". +// +// C# 3.0 collection initializers are supported and encouraged: +// var p = new OptionSet () { +// { "h|?|help", v => ShowHelp () }, +// }; +// +// System.ComponentModel.TypeConverter is also supported, allowing the use of +// custom data types in the callback type; TypeConverter.ConvertFromString() +// is used to convert the value option to an instance of the specified +// type: +// +// var p = new OptionSet () { +// { "foo=", (Foo f) => Console.WriteLine (f.ToString ()) }, +// }; +// +// Random other tidbits: +// - Boolean options (those w/o '=' or ':' in the option format string) +// are explicitly enabled if they are followed with '+', and explicitly +// disabled if they are followed with '-': +// string a = null; +// var p = new OptionSet () { +// { "a", s => a = s }, +// }; +// p.Parse (new string[]{"-a"}); // sets v != null +// p.Parse (new string[]{"-a+"}); // sets v != null +// p.Parse (new string[]{"-a-"}); // sets v == null +// + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Globalization; +using System.IO; +using System.Runtime.Serialization; +using System.Security.Permissions; +using System.Text; +using System.Text.RegularExpressions; + +#if LINQ +using System.Linq; +#endif + +#if TEST +using NDesk.Options; +#endif + +namespace NDesk.Options +{ + + public class OptionValueCollection : IList, IList + { + + List values = new List(); + OptionContext c; + + internal OptionValueCollection(OptionContext c) + { + this.c = c; + } + + #region ICollection + void ICollection.CopyTo(Array array, int index) { (values as ICollection).CopyTo(array, index); } + bool ICollection.IsSynchronized { get { return (values as ICollection).IsSynchronized; } } + object ICollection.SyncRoot { get { return (values as ICollection).SyncRoot; } } + #endregion + + #region ICollection + public void Add(string item) { values.Add(item); } + public void Clear() { values.Clear(); } + public bool Contains(string item) { return values.Contains(item); } + public void CopyTo(string[] array, int arrayIndex) { values.CopyTo(array, arrayIndex); } + public bool Remove(string item) { return values.Remove(item); } + public int Count { get { return values.Count; } } + public bool IsReadOnly { get { return false; } } + #endregion + + #region IEnumerable + IEnumerator IEnumerable.GetEnumerator() { return values.GetEnumerator(); } + #endregion + + #region IEnumerable + public IEnumerator GetEnumerator() { return values.GetEnumerator(); } + #endregion + + #region IList + int IList.Add(object value) { return (values as IList).Add(value); } + bool IList.Contains(object value) { return (values as IList).Contains(value); } + int IList.IndexOf(object value) { return (values as IList).IndexOf(value); } + void IList.Insert(int index, object value) { (values as IList).Insert(index, value); } + void IList.Remove(object value) { (values as IList).Remove(value); } + void IList.RemoveAt(int index) { (values as IList).RemoveAt(index); } + bool IList.IsFixedSize { get { return false; } } + object IList.this[int index] { get { return this[index]; } set { (values as IList)[index] = value; } } + #endregion + + #region IList + public int IndexOf(string item) { return values.IndexOf(item); } + public void Insert(int index, string item) { values.Insert(index, item); } + public void RemoveAt(int index) { values.RemoveAt(index); } + + private void AssertValid(int index) + { + if (c.Option == null) + throw new InvalidOperationException("OptionContext.Option is null."); + if (index >= c.Option.MaxValueCount) + throw new ArgumentOutOfRangeException("index"); + if (c.Option.OptionValueType == OptionValueType.Required && + index >= values.Count) + throw new OptionException(string.Format( + c.OptionSet.MessageLocalizer("Missing required value for option '{0}'."), c.OptionName), + c.OptionName); + } + + public string this[int index] + { + get + { + AssertValid(index); + return index >= values.Count ? null : values[index]; + } + set + { + values[index] = value; + } + } + #endregion + + public List ToList() + { + return new List(values); + } + + public string[] ToArray() + { + return values.ToArray(); + } + + public override string ToString() + { + return string.Join(", ", values.ToArray()); + } + } + + public class OptionContext + { + private Option option; + private string name; + private int index; + private OptionSet set; + private OptionValueCollection c; + + public OptionContext(OptionSet set) + { + this.set = set; + this.c = new OptionValueCollection(this); + } + + public Option Option + { + get { return option; } + set { option = value; } + } + + public string OptionName + { + get { return name; } + set { name = value; } + } + + public int OptionIndex + { + get { return index; } + set { index = value; } + } + + public OptionSet OptionSet + { + get { return set; } + } + + public OptionValueCollection OptionValues + { + get { return c; } + } + } + + public enum OptionValueType + { + None, + Optional, + Required, + } + + public abstract class Option + { + string prototype, description; + string[] names; + OptionValueType type; + int count; + string[] separators; + + protected Option(string prototype, string description) + : this(prototype, description, 1) + { + } + + protected Option(string prototype, string description, int maxValueCount) + { + if (prototype == null) + throw new ArgumentNullException("prototype"); + if (prototype.Length == 0) + throw new ArgumentException("Cannot be the empty string.", "prototype"); + if (maxValueCount < 0) + throw new ArgumentOutOfRangeException("maxValueCount"); + + this.prototype = prototype; + this.names = prototype.Split('|'); + this.description = description; + this.count = maxValueCount; + this.type = ParsePrototype(); + + if (this.count == 0 && type != OptionValueType.None) + throw new ArgumentException( + "Cannot provide maxValueCount of 0 for OptionValueType.Required or " + + "OptionValueType.Optional.", + "maxValueCount"); + if (this.type == OptionValueType.None && maxValueCount > 1) + throw new ArgumentException( + string.Format("Cannot provide maxValueCount of {0} for OptionValueType.None.", maxValueCount), + "maxValueCount"); + if (Array.IndexOf(names, "<>") >= 0 && + ((names.Length == 1 && this.type != OptionValueType.None) || + (names.Length > 1 && this.MaxValueCount > 1))) + throw new ArgumentException( + "The default option handler '<>' cannot require values.", + "prototype"); + } + + public string Prototype { get { return prototype; } } + public string Description { get { return description; } } + public OptionValueType OptionValueType { get { return type; } } + public int MaxValueCount { get { return count; } } + + public string[] GetNames() + { + return (string[])names.Clone(); + } + + public string[] GetValueSeparators() + { + if (separators == null) + return new string[0]; + return (string[])separators.Clone(); + } + + protected static T Parse(string value, OptionContext c) + { + TypeConverter conv = TypeDescriptor.GetConverter(typeof(T)); + T t = default(T); + try + { + if (value != null) + t = (T)conv.ConvertFromString(value); + } + catch (Exception e) + { + throw new OptionException( + string.Format( + c.OptionSet.MessageLocalizer("Could not convert string `{0}' to type {1} for option `{2}'."), + value, typeof(T).Name, c.OptionName), + c.OptionName, e); + } + return t; + } + + internal string[] Names { get { return names; } } + internal string[] ValueSeparators { get { return separators; } } + + static readonly char[] NameTerminator = new char[] { '=', ':' }; + + private OptionValueType ParsePrototype() + { + char type = '\0'; + List seps = new List(); + for (int i = 0; i < names.Length; ++i) + { + string name = names[i]; + if (name.Length == 0) + throw new ArgumentException("Empty option names are not supported.", "prototype"); + + int end = name.IndexOfAny(NameTerminator); + if (end == -1) + continue; + names[i] = name.Substring(0, end); + if (type == '\0' || type == name[end]) + type = name[end]; + else + throw new ArgumentException( + string.Format("Conflicting option types: '{0}' vs. '{1}'.", type, name[end]), + "prototype"); + AddSeparators(name, end, seps); + } + + if (type == '\0') + return OptionValueType.None; + + if (count <= 1 && seps.Count != 0) + throw new ArgumentException( + string.Format("Cannot provide key/value separators for Options taking {0} value(s).", count), + "prototype"); + if (count > 1) + { + if (seps.Count == 0) + this.separators = new string[] { ":", "=" }; + else if (seps.Count == 1 && seps[0].Length == 0) + this.separators = null; + else + this.separators = seps.ToArray(); + } + + return type == '=' ? OptionValueType.Required : OptionValueType.Optional; + } + + private static void AddSeparators(string name, int end, ICollection seps) + { + int start = -1; + for (int i = end + 1; i < name.Length; ++i) + { + switch (name[i]) + { + case '{': + if (start != -1) + throw new ArgumentException( + string.Format("Ill-formed name/value separator found in \"{0}\".", name), + "prototype"); + start = i + 1; + break; + case '}': + if (start == -1) + throw new ArgumentException( + string.Format("Ill-formed name/value separator found in \"{0}\".", name), + "prototype"); + seps.Add(name.Substring(start, i - start)); + start = -1; + break; + default: + if (start == -1) + seps.Add(name[i].ToString()); + break; + } + } + if (start != -1) + throw new ArgumentException( + string.Format("Ill-formed name/value separator found in \"{0}\".", name), + "prototype"); + } + + public void Invoke(OptionContext c) + { + OnParseComplete(c); + c.OptionName = null; + c.Option = null; + c.OptionValues.Clear(); + } + + protected abstract void OnParseComplete(OptionContext c); + + public override string ToString() + { + return Prototype; + } + } + + [Serializable] + public class OptionException : Exception + { + private string option; + + public OptionException() + { + } + + public OptionException(string message, string optionName) + : base(message) + { + this.option = optionName; + } + + public OptionException(string message, string optionName, Exception innerException) + : base(message, innerException) + { + this.option = optionName; + } + + protected OptionException(SerializationInfo info, StreamingContext context) + : base(info, context) + { + this.option = info.GetString("OptionName"); + } + + public string OptionName + { + get { return this.option; } + } + + [SecurityPermission(SecurityAction.LinkDemand, SerializationFormatter = true)] + public override void GetObjectData(SerializationInfo info, StreamingContext context) + { + base.GetObjectData(info, context); + info.AddValue("OptionName", option); + } + } + + public delegate void OptionAction(TKey key, TValue value); + + public class OptionSet : KeyedCollection + { + public OptionSet() + : this(f => f) + { + } + + public OptionSet(Converter localizer) + : base(StringComparer.OrdinalIgnoreCase) + { + this.localizer = localizer; + } + + Converter localizer; + + public Converter MessageLocalizer + { + get { return localizer; } + } + + protected override string GetKeyForItem(Option item) + { + if (item == null) + throw new ArgumentNullException("option"); + if (item.Names != null && item.Names.Length > 0) + return item.Names[0]; + // This should never happen, as it's invalid for Option to be + // constructed w/o any names. + throw new InvalidOperationException("Option has no names!"); + } + + [Obsolete("Use KeyedCollection.this[string]")] + protected Option GetOptionForName(string option) + { + if (option == null) + throw new ArgumentNullException("option"); + try + { + return base[option]; + } + catch (KeyNotFoundException) + { + return null; + } + } + + protected override void InsertItem(int index, Option item) + { + base.InsertItem(index, item); + AddImpl(item); + } + + protected override void RemoveItem(int index) + { + base.RemoveItem(index); + Option p = Items[index]; + // KeyedCollection.RemoveItem() handles the 0th item + for (int i = 1; i < p.Names.Length; ++i) + { + Dictionary.Remove(p.Names[i]); + } + } + + protected override void SetItem(int index, Option item) + { + base.SetItem(index, item); + RemoveItem(index); + AddImpl(item); + } + + private void AddImpl(Option option) + { + if (option == null) + throw new ArgumentNullException("option"); + List added = new List(option.Names.Length); + try + { + // KeyedCollection.InsertItem/SetItem handle the 0th name. + for (int i = 1; i < option.Names.Length; ++i) + { + Dictionary.Add(option.Names[i], option); + added.Add(option.Names[i]); + } + } + catch (Exception) + { + foreach (string name in added) + Dictionary.Remove(name); + throw; + } + } + + public new OptionSet Add(Option option) + { + base.Add(option); + return this; + } + + sealed class ActionOption : Option + { + Action action; + + public ActionOption(string prototype, string description, int count, Action action) + : base(prototype, description, count) + { + if (action == null) + throw new ArgumentNullException("action"); + this.action = action; + } + + protected override void OnParseComplete(OptionContext c) + { + action(c.OptionValues); + } + } + + public OptionSet Add(string prototype, Action action) + { + return Add(prototype, null, action); + } + + public OptionSet Add(string prototype, string description, Action action) + { + if (action == null) + throw new ArgumentNullException("action"); + Option p = new ActionOption(prototype, description, 1, + delegate(OptionValueCollection v) { action(v[0]); }); + base.Add(p); + return this; + } + + public OptionSet Add(string prototype, OptionAction action) + { + return Add(prototype, null, action); + } + + public OptionSet Add(string prototype, string description, OptionAction action) + { + if (action == null) + throw new ArgumentNullException("action"); + Option p = new ActionOption(prototype, description, 2, + delegate(OptionValueCollection v) { action(v[0], v[1]); }); + base.Add(p); + return this; + } + + sealed class ActionOption : Option + { + Action action; + + public ActionOption(string prototype, string description, Action action) + : base(prototype, description, 1) + { + if (action == null) + throw new ArgumentNullException("action"); + this.action = action; + } + + protected override void OnParseComplete(OptionContext c) + { + action(Parse(c.OptionValues[0], c)); + } + } + + sealed class ActionOption : Option + { + OptionAction action; + + public ActionOption(string prototype, string description, OptionAction action) + : base(prototype, description, 2) + { + if (action == null) + throw new ArgumentNullException("action"); + this.action = action; + } + + protected override void OnParseComplete(OptionContext c) + { + action( + Parse(c.OptionValues[0], c), + Parse(c.OptionValues[1], c)); + } + } + + public OptionSet Add(string prototype, Action action) + { + return Add(prototype, null, action); + } + + public OptionSet Add(string prototype, string description, Action action) + { + return Add(new ActionOption(prototype, description, action)); + } + + public OptionSet Add(string prototype, OptionAction action) + { + return Add(prototype, null, action); + } + + public OptionSet Add(string prototype, string description, OptionAction action) + { + return Add(new ActionOption(prototype, description, action)); + } + + protected virtual OptionContext CreateOptionContext() + { + return new OptionContext(this); + } + +#if LINQ + public List Parse (IEnumerable arguments) + { + bool process = true; + OptionContext c = CreateOptionContext (); + c.OptionIndex = -1; + var def = GetOptionForName ("<>"); + var unprocessed = + from argument in arguments + where ++c.OptionIndex >= 0 && (process || def != null) + ? process + ? argument == "--" + ? (process = false) + : !Parse (argument, c) + ? def != null + ? Unprocessed (null, def, c, argument) + : true + : false + : def != null + ? Unprocessed (null, def, c, argument) + : true + : true + select argument; + List r = unprocessed.ToList (); + if (c.Option != null) + c.Option.Invoke (c); + return r; + } +#else + public List Parse(IEnumerable arguments) + { + OptionContext c = CreateOptionContext(); + c.OptionIndex = -1; + bool process = true; + List unprocessed = new List(); + Option def = Contains("<>") ? this["<>"] : null; + foreach (string argument in arguments) + { + ++c.OptionIndex; + if (argument == "--") + { + process = false; + continue; + } + if (!process) + { + Unprocessed(unprocessed, def, c, argument); + continue; + } + if (!Parse(argument, c)) + Unprocessed(unprocessed, def, c, argument); + } + if (c.Option != null) + c.Option.Invoke(c); + return unprocessed; + } +#endif + + private static bool Unprocessed(ICollection extra, Option def, OptionContext c, string argument) + { + if (def == null) + { + extra.Add(argument); + return false; + } + c.OptionValues.Add(argument); + c.Option = def; + c.Option.Invoke(c); + return false; + } + + private readonly Regex ValueOption = new Regex( + @"^(?--|-|/)(?[^:=]+)((?[:=])(?.*))?$"); + + protected bool GetOptionParts(string argument, out string flag, out string name, out string sep, out string value) + { + if (argument == null) + throw new ArgumentNullException("argument"); + + flag = name = sep = value = null; + Match m = ValueOption.Match(argument); + if (!m.Success) + { + return false; + } + flag = m.Groups["flag"].Value; + name = m.Groups["name"].Value; + if (m.Groups["sep"].Success && m.Groups["value"].Success) + { + sep = m.Groups["sep"].Value; + value = m.Groups["value"].Value; + } + return true; + } + + protected virtual bool Parse(string argument, OptionContext c) + { + if (c.Option != null) + { + ParseValue(argument, c); + return true; + } + + string f, n, s, v; + if (!GetOptionParts(argument, out f, out n, out s, out v)) + return false; + + Option p; + if (Contains(n)) + { + p = this[n]; + c.OptionName = f + n; + c.Option = p; + switch (p.OptionValueType) + { + case OptionValueType.None: + c.OptionValues.Add(n); + c.Option.Invoke(c); + break; + case OptionValueType.Optional: + case OptionValueType.Required: + ParseValue(v, c); + break; + } + return true; + } + // no match; is it a bool option? + if (ParseBool(argument, n, c)) + return true; + // is it a bundled option? + if (ParseBundledValue(f, string.Concat(n + s + v), c)) + return true; + + return false; + } + + private void ParseValue(string option, OptionContext c) + { + if (option != null) + foreach (string o in c.Option.ValueSeparators != null + ? option.Split(c.Option.ValueSeparators, StringSplitOptions.None) + : new string[] { option }) + { + c.OptionValues.Add(o); + } + if (c.OptionValues.Count == c.Option.MaxValueCount || + c.Option.OptionValueType == OptionValueType.Optional) + c.Option.Invoke(c); + else if (c.OptionValues.Count > c.Option.MaxValueCount) + { + throw new OptionException(localizer(string.Format( + "Error: Found {0} option values when expecting {1}.", + c.OptionValues.Count, c.Option.MaxValueCount)), + c.OptionName); + } + } + + private bool ParseBool(string option, string n, OptionContext c) + { + Option p; + string rn; + if (n.Length >= 1 && (n[n.Length - 1] == '+' || n[n.Length - 1] == '-') && + Contains((rn = n.Substring(0, n.Length - 1)))) + { + p = this[rn]; + string v = n[n.Length - 1] == '+' ? option : null; + c.OptionName = option; + c.Option = p; + c.OptionValues.Add(v); + p.Invoke(c); + return true; + } + return false; + } + + private bool ParseBundledValue(string f, string n, OptionContext c) + { + if (f != "-") + return false; + for (int i = 0; i < n.Length; ++i) + { + Option p; + string opt = f + n[i].ToString(); + string rn = n[i].ToString(); + if (!Contains(rn)) + { + if (i == 0) + return false; + throw new OptionException(string.Format(localizer( + "Cannot bundle unregistered option '{0}'."), opt), opt); + } + p = this[rn]; + switch (p.OptionValueType) + { + case OptionValueType.None: + Invoke(c, opt, n, p); + break; + case OptionValueType.Optional: + case OptionValueType.Required: + { + string v = n.Substring(i + 1); + c.Option = p; + c.OptionName = opt; + ParseValue(v.Length != 0 ? v : null, c); + return true; + } + default: + throw new InvalidOperationException("Unknown OptionValueType: " + p.OptionValueType); + } + } + return true; + } + + private static void Invoke(OptionContext c, string name, string value, Option option) + { + c.OptionName = name; + c.Option = option; + c.OptionValues.Add(value); + option.Invoke(c); + } + + private const int OptionWidth = 29; + + public void WriteOptionDescriptions(TextWriter o) + { + foreach (Option p in this) + { + int written = 0; + if (!WriteOptionPrototype(o, p, ref written)) + continue; + + if (written < OptionWidth) + o.Write(new string(' ', OptionWidth - written)); + else + { + o.WriteLine(); + o.Write(new string(' ', OptionWidth)); + } + + List lines = GetLines(localizer(GetDescription(p.Description))); + o.WriteLine(lines[0]); + string prefix = new string(' ', OptionWidth + 2); + for (int i = 1; i < lines.Count; ++i) + { + o.Write(prefix); + o.WriteLine(lines[i]); + } + } + } + + bool WriteOptionPrototype(TextWriter o, Option p, ref int written) + { + string[] names = p.Names; + + int i = GetNextOptionIndex(names, 0); + if (i == names.Length) + return false; + + if (names[i].Length == 1) + { + Write(o, ref written, " -"); + Write(o, ref written, names[0]); + } + else + { + Write(o, ref written, " -"); + Write(o, ref written, names[0]); + } + + for (i = GetNextOptionIndex(names, i + 1); + i < names.Length; i = GetNextOptionIndex(names, i + 1)) + { + Write(o, ref written, ", "); + Write(o, ref written, names[i].Length == 1 ? "-" : "-"); + Write(o, ref written, names[i]); + } + + if (p.OptionValueType == OptionValueType.Optional || + p.OptionValueType == OptionValueType.Required) + { + if (p.OptionValueType == OptionValueType.Optional) + { + Write(o, ref written, localizer("[")); + } + Write(o, ref written, localizer("=" + GetArgumentName(0, p.MaxValueCount, p.Description))); + string sep = p.ValueSeparators != null && p.ValueSeparators.Length > 0 + ? p.ValueSeparators[0] + : " "; + for (int c = 1; c < p.MaxValueCount; ++c) + { + Write(o, ref written, localizer(sep + GetArgumentName(c, p.MaxValueCount, p.Description))); + } + if (p.OptionValueType == OptionValueType.Optional) + { + Write(o, ref written, localizer("]")); + } + } + return true; + } + + static int GetNextOptionIndex(string[] names, int i) + { + while (i < names.Length && names[i] == "<>") + { + ++i; + } + return i; + } + + static void Write(TextWriter o, ref int n, string s) + { + n += s.Length; + o.Write(s); + } + + private static string GetArgumentName(int index, int maxIndex, string description) + { + if (description == null) + return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1); + string[] nameStart; + if (maxIndex == 1) + nameStart = new string[] { "{0:", "{" }; + else + nameStart = new string[] { "{" + index + ":" }; + for (int i = 0; i < nameStart.Length; ++i) + { + int start, j = 0; + do + { + start = description.IndexOf(nameStart[i], j); + } while (start >= 0 && j != 0 ? description[j++ - 1] == '{' : false); + if (start == -1) + continue; + int end = description.IndexOf("}", start); + if (end == -1) + continue; + return description.Substring(start + nameStart[i].Length, end - start - nameStart[i].Length); + } + return maxIndex == 1 ? "VALUE" : "VALUE" + (index + 1); + } + + private static string GetDescription(string description) + { + if (description == null) + return string.Empty; + StringBuilder sb = new StringBuilder(description.Length); + int start = -1; + for (int i = 0; i < description.Length; ++i) + { + switch (description[i]) + { + case '{': + if (i == start) + { + sb.Append('{'); + start = -1; + } + else if (start < 0) + start = i + 1; + break; + case '}': + if (start < 0) + { + if ((i + 1) == description.Length || description[i + 1] != '}') + throw new InvalidOperationException("Invalid option description: " + description); + ++i; + sb.Append("}"); + } + else + { + sb.Append(description.Substring(start, i - start)); + start = -1; + } + break; + case ':': + if (start < 0) + goto default; + start = i + 1; + break; + default: + if (start < 0) + sb.Append(description[i]); + break; + } + } + return sb.ToString(); + } + + private static List GetLines(string description) + { + List lines = new List(); + if (string.IsNullOrEmpty(description)) + { + lines.Add(string.Empty); + return lines; + } + int length = 80 - OptionWidth - 2; + int start = 0, end; + do + { + end = GetLineEnd(start, length, description); + bool cont = false; + if (end < description.Length) + { + char c = description[end]; + if (c == '-' || (char.IsWhiteSpace(c) && c != '\n')) + ++end; + else if (c != '\n') + { + cont = true; + --end; + } + } + lines.Add(description.Substring(start, end - start)); + if (cont) + { + lines[lines.Count - 1] += "-"; + } + start = end; + if (start < description.Length && description[start] == '\n') + ++start; + } while (end < description.Length); + return lines; + } + + private static int GetLineEnd(int start, int length, string description) + { + int end = Math.Min(start + length, description.Length); + int sep = -1; + for (int i = start; i < end; ++i) + { + switch (description[i]) + { + case ' ': + case '\t': + case '\v': + case '-': + case ',': + case '.': + case ';': + sep = i; + break; + case '\n': + return i; + } + } + if (sep == -1 || end == description.Length) + return end; + return sep; + } + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/PreserveStackTracePreserver.cs b/src/hosting/NServiceBus.Hosting.Windows/PreserveStackTracePreserver.cs new file mode 100644 index 00000000000..187fa55a4f5 --- /dev/null +++ b/src/hosting/NServiceBus.Hosting.Windows/PreserveStackTracePreserver.cs @@ -0,0 +1,19 @@ +namespace NServiceBus.Hosting.Windows +{ + using System; + using System.Runtime.Serialization; + + static class PreserveStackTracePreserver + { + public static void PreserveStackTrace(this Exception exception) + { + var context = new StreamingContext(StreamingContextStates.CrossAppDomain); + var objectManager = new ObjectManager(null, context); + var serializationInfo = new SerializationInfo(exception.GetType(), new FormatterConverter()); + + exception.GetObjectData(serializationInfo, context); + objectManager.RegisterObject(exception, 1, serializationInfo); // prepare for SetObjectData + objectManager.DoFixups(); // ObjectManager calls SetObjectData + } + } +} \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/GatewayProfileHandler.cs b/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/GatewayProfileHandler.cs index 888c3b253cc..1134d694f06 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/GatewayProfileHandler.cs +++ b/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/GatewayProfileHandler.cs @@ -1,14 +1,13 @@ namespace NServiceBus.Hosting.Windows.Profiles.Handlers { + using Features; using Hosting.Profiles; - internal class GatewayProfileHandler : IHandleProfile, IWantTheEndpointConfig + internal class GatewayProfileHandler : IHandleProfile { void IHandleProfile.ProfileActivated() { Configure.Instance.RunGateway(); } - - public IConfigureThisEndpoint Config { get; set; } } } diff --git a/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/IntegrationProfileHandler.cs b/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/IntegrationProfileHandler.cs index 2ceec64de2f..a9be54fd391 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/IntegrationProfileHandler.cs +++ b/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/IntegrationProfileHandler.cs @@ -1,41 +1,18 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace NServiceBus.Hosting.Windows.Profiles.Handlers -{ - using Faults; - using Hosting.Profiles; - using Saga; - using Unicast.Subscriptions; - - internal class IntegrationProfileHandler : IHandleProfile, IWantTheEndpointConfig, IWantTheListOfActiveProfiles - { - void IHandleProfile.ProfileActivated() - { - Configure.Instance.RavenPersistence(); - - if (!Configure.Instance.Configurer.HasComponent()) - Configure.Instance.MessageForwardingInCaseOfFault(); - - if (!Configure.Instance.Configurer.HasComponent()) - Configure.Instance.RavenSagaPersister(); - - - if (Config is AsA_Publisher && !Configure.Instance.Configurer.HasComponent()) - { - if ((ActiveProfiles.Contains(typeof(Master))) || (ActiveProfiles.Contains(typeof(Worker))) || (ActiveProfiles.Contains(typeof(Distributor)))) - Configure.Instance.RavenSubscriptionStorage(); - else - Configure.Instance.MsmqSubscriptionStorage(); - } - - WindowsInstallerRunner.RunInstallers = true; - WindowsInstallerRunner.RunInfrastructureInstallers = false; - } - - public IConfigureThisEndpoint Config { get; set; } - - public IEnumerable ActiveProfiles { get; set; } - } +namespace NServiceBus.Hosting.Windows.Profiles.Handlers +{ + using Faults; + using Hosting.Profiles; + + internal class IntegrationProfileHandler : IHandleProfile + { + void IHandleProfile.ProfileActivated() + { + if (!Configure.Instance.Configurer.HasComponent()) + { + Configure.Instance.MessageForwardingInCaseOfFault(); + } + + WindowsInstallerRunner.RunInstallers = true; + } + } } \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/LiteProfileHandler.cs b/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/LiteProfileHandler.cs index 81ccb01be62..12a9edf001c 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/LiteProfileHandler.cs +++ b/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/LiteProfileHandler.cs @@ -1,40 +1,25 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using NServiceBus.Faults; -using NServiceBus.Hosting.Profiles; -using NServiceBus.Saga; -using NServiceBus.Unicast.Subscriptions; - - +using NServiceBus.Faults; +using NServiceBus.Hosting.Profiles; + + namespace NServiceBus.Hosting.Windows.Profiles.Handlers { - + using Persistence.InMemory; + internal class LiteProfileHandler : IHandleProfile, IWantTheEndpointConfig { - void IHandleProfile.ProfileActivated() - { - - if (Configure.Instance.IsTimeoutManagerEnabled()) - Configure.Instance.DefaultToInMemoryTimeoutPersistence(); - - Configure.Instance.AsMasterNode() - .DefaultToInMemoryGatewayPersistence(); + void IHandleProfile.ProfileActivated() + { + InMemoryPersistence.UseAsDefault(); + + Configure.Instance.AsMasterNode(); - if (!Configure.Instance.Configurer.HasComponent()) - Configure.Instance.InMemorySagaPersister(); - if (!Configure.Instance.Configurer.HasComponent()) Configure.Instance.InMemoryFaultManagement(); - if (Config is AsA_Publisher) - if (!Configure.Instance.Configurer.HasComponent()) - Configure.Instance.InMemorySubscriptionStorage(); - - WindowsInstallerRunner.RunInstallers = true; - WindowsInstallerRunner.RunInfrastructureInstallers = false; + WindowsInstallerRunner.RunInstallers = true; } - public IConfigureThisEndpoint Config { get; set; } + public IConfigureThisEndpoint Config { get; set; } } } \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/MasterProfileHandler.cs b/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/MasterProfileHandler.cs index 318f4123b5d..2661750c23d 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/MasterProfileHandler.cs +++ b/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/MasterProfileHandler.cs @@ -1,24 +1,23 @@ -namespace NServiceBus.Hosting.Windows.Profiles.Handlers -{ - using System; - using System.Collections.Generic; - using System.Configuration; - using System.Linq; - using Hosting.Profiles; - - class MasterProfileHandler : IHandleProfile, IWantTheListOfActiveProfiles - { - public void ProfileActivated() - { - if (ActiveProfiles.Contains(typeof(Worker))) - throw new ConfigurationErrorsException("Master profile and Worker profile should not coexist."); - - Configure.Instance.AsMasterNode() - .RunDistributor() - .RunGateway() - .RunTimeoutManager(); - } - - public IEnumerable ActiveProfiles { get; set; } - } -} +namespace NServiceBus.Hosting.Windows.Profiles.Handlers +{ + using System; + using System.Collections.Generic; + using System.Configuration; + using System.Linq; + using Hosting.Profiles; + + class MasterProfileHandler : IHandleProfile, IWantTheListOfActiveProfiles + { + public void ProfileActivated() + { + if (ActiveProfiles.Contains(typeof(Worker))) + throw new ConfigurationErrorsException("Master profile and Worker profile should not coexist."); + + Configure.Instance.AsMasterNode() + .RunDistributor() + .RunGateway(); + } + + public IEnumerable ActiveProfiles { get; set; } + } +} diff --git a/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/PerformanceCountersProfileHandler.cs b/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/PerformanceCountersProfileHandler.cs index 125676a8ab5..4cb239eeba2 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/PerformanceCountersProfileHandler.cs +++ b/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/PerformanceCountersProfileHandler.cs @@ -1,6 +1,6 @@ namespace NServiceBus.Hosting.Windows.Profiles.Handlers -{ - using Hosting.Profiles; +{ + using Hosting.Profiles; /// /// Handles the PerformanceCounters profile. @@ -8,7 +8,7 @@ public class PerformanceCountersProfileHandler : IHandleProfile { void IHandleProfile.ProfileActivated() - { + { Configure.Instance.EnablePerformanceCounters(); } } diff --git a/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/ProductionProfileHandler.cs b/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/ProductionProfileHandler.cs index 4dc3886f7b0..4987cff2969 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/ProductionProfileHandler.cs +++ b/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/ProductionProfileHandler.cs @@ -1,27 +1,16 @@ -using NServiceBus.Faults; -using NServiceBus.Hosting.Profiles; -using NServiceBus.Unicast.Subscriptions; - -namespace NServiceBus.Hosting.Windows.Profiles.Handlers -{ - using Saga; - - internal class ProductionProfileHandler : IHandleProfile, IWantTheEndpointConfig +namespace NServiceBus.Hosting.Windows.Profiles.Handlers +{ + using Faults; + using Hosting.Profiles; + + internal class ProductionProfileHandler : IHandleProfile { void IHandleProfile.ProfileActivated() - { - Configure.Instance.RavenPersistence(); - - if (!Configure.Instance.Configurer.HasComponent()) - Configure.Instance.RavenSagaPersister(); - + { if (!Configure.Instance.Configurer.HasComponent()) - Configure.Instance.MessageForwardingInCaseOfFault(); - - if (Config is AsA_Publisher && !Configure.Instance.Configurer.HasComponent()) - Configure.Instance.RavenSubscriptionStorage(); + { + Configure.Instance.MessageForwardingInCaseOfFault(); + } } - - public IConfigureThisEndpoint Config { get; set; } } } \ No newline at end of file diff --git a/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/TimeoutProfileHandler.cs b/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/TimeoutProfileHandler.cs index e73b88d2086..b60a21cbad9 100644 --- a/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/TimeoutProfileHandler.cs +++ b/src/hosting/NServiceBus.Hosting.Windows/Profiles/Handlers/TimeoutProfileHandler.cs @@ -1,17 +1,17 @@ -namespace NServiceBus.Hosting.Windows.Profiles.Handlers +using NServiceBus.Logging; + +namespace NServiceBus.Hosting.Windows.Profiles.Handlers { - using System; - using log4net; using Hosting.Profiles; - [Obsolete("Timeout Profile is obsolete as Timeout Manager is on by default for Server and Publisher roles.")] + [ObsoleteEx(Message = "Timeout Profile is obsolete as Timeout Manager is on by default for Server and Publisher roles.", RemoveInVersion = "5.0", TreatAsErrorFromVersion = "4.0")] internal class TimeoutProfileHandler : IHandleProfile